Commit Graph

141 Commits

Author SHA1 Message Date
Kyohei Fukuda
5a313c5795 Merge branch 'main' into repeatHead 2025-10-03 10:16:57 +09:00
Kiewn
6d16b14fb8 fix: Fix calculate target page index in function page breaking. (#1188)
* fix: Fix calculate target page index in function page breaking.

* fix : fix unit test.
2025-10-03 10:11:19 +09:00
tetty
9e5a08988c fix: Align the mouse cursor with the X coordinate of the table column (#1118) 2025-07-16 09:05:05 +09:00
Kyohei Fukuda
0dd54739ac XSS vulnerability prevention for replacePlaceholders function (#1117)
* test(expression): add XSS vulnerability prevention tests for replacePlaceholders function

* Update packages/common/src/expression.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* test: group safe Object method tests into single test case

- Refactored individual tests for Object.keys, Object.values, Object.entries, and Object.assign
- Combined them into a single test case with multiple assertions for better organization
- Addresses code review feedback about test organization

Co-authored-by: Kyohei Fukuda <hand-dot@users.noreply.github.com>

* feat(security): implement safeAssign to prevent prototype pollution and enhance XSS protection

* fix(safeAssign): use object spread for safer target assignment

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Kyohei Fukuda <hand-dot@users.noreply.github.com>
2025-07-10 08:21:48 +09:00
Kyohei Fukuda
093f183d74 npm run prettier 2025-07-02 15:21:54 +09:00
Kyohei Fukuda
b63a9ece14 debug screen 2025-06-07 18:01:16 +09:00
Kyohei Fukuda
7db2f1a565 tmp 2025-06-06 12:07:04 +09:00
Kyohei Fukuda
c43639c4a1 Update header height management in breakIntoPages function
- Change header height assignment to use dynamic height variable
- Improve code clarity by removing hardcoded values

This update enhances the flexibility of header height handling in the dynamicTemplate.ts file.
2025-06-04 10:59:57 +09:00
Devin AI
a17989a770 Fix code quality issues in dynamicTemplate.ts
- Replace unsafe type casting with proper type narrowing
- Use fixed header height calculation instead of full table height
- Prevent duplicate header adjustments with Set tracking

Addresses GitHub bot feedback while maintaining repeatHead functionality.

Co-Authored-By: Kyohei Fukuda <kyoheif@wix.com>
2025-05-31 14:34:45 +00:00
hand-dot
e3dea7f111 WIP 2025-05-31 23:11:46 +09:00
hand-dot
75b7f14e7f TMP 2025-05-31 22:34:39 +09:00
Tyler Barker
9d3cec85f0 Make Designer class initial state configurable (#1003)
* Ignore XML repomix output

* Extend UIOptions schema

* Enable init and update of pageCursor, sidebarOpen, and zoomLevel through options

* Rollback options-configurable pageCursor for now

* Remove onPageCursorChange mistakenly kept in useEffect dependencies

* Add UI options section to documentation for controlling zoom level and sidebar state

---------

Co-authored-by: hand-dot <kyouhei.fukuda0729@gmail.com>
2025-05-26 22:51:10 +09:00
Peter Ward
f137dab01c improve DX with pluginRepository and make plugin checking more robust (#1007)
* add pluginRepository and make plugin checking more robust

* Apply suggestions from code review

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* f

* f

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2025-05-16 13:54:20 +09:00
devin-ai-integration[bot]
c80d66ded1 Add missing exports for BLANK_A4_PDF and CUSTOM_A4_PDF constants (#903)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Kyohei Fukuda <kyouhei.fukuda0729@gmail.com>
2025-04-01 10:13:38 +09:00
Kyohei Fukuda
e76feb1759 Add radius property to shape schema and update translations (#882)
* Add radius property to shape schema and update translations

* Update snapshots to reflect changes in button class names for consistency
2025-03-27 15:03:13 +09:00
hand-dot
72989cd9bf Add CustomPdf type and update related components for improved PDF handling 2025-03-16 15:49:30 +09:00
Kyohei Fukuda
dbf8de553e Minor fix (#819)
* tmp

* fix: add explicit any type to Plugins definition for clarity

* refactor: change ShapeSchema from type to interface for better extensibility
2025-03-07 00:43:20 +09:00
Kyohei Fukuda
9fa60cba14 Refactor type definitions and improve type safety in dynamic template handling (#816) 2025-03-06 11:18:13 +09:00
devin-ai-integration[bot]
2eff1734ca Fix TypeScript type compatibility issues (#813)
* Fix lint errors across multiple packages

- Fixed TypeScript type safety issues in common, schemas, generator, and UI packages
- Replaced 'any' types with more specific types like Map<string | number, unknown>
- Added proper type assertions in UI components to ensure type compatibility
- Created BarcodeRenderOptions interface to improve type safety in barcode rendering
- Fixed unsafe member access and return value issues in helper functions
- Ensured type safety in React components with proper type narrowing

Co-Authored-By: Kyohei Fukuda <kyouhei.fukuda0729@gmail.com>

* Fix type safety issues in tables/pdfRender.ts

Co-Authored-By: Kyohei Fukuda <kyouhei.fukuda0729@gmail.com>

* Fix remaining lint errors in multiple packages

- Fixed type safety issues in DetailView/index.tsx by removing unsafe type assertions
- Improved type safety in select/index.ts with proper type assertions
- Enhanced type safety in generate.ts with proper type narrowing and error handling

Co-Authored-By: Kyohei Fukuda <kyouhei.fukuda0729@gmail.com>

* Fix type error in DetailView/index.tsx

- Added type assertion to i18n function call to satisfy union type constraint

Co-Authored-By: Kyohei Fukuda <kyouhei.fukuda0729@gmail.com>

* Enable problematic test in Playground E2E Tests

* TMP

* Fix TypeScript type compatibility issues across packages

- Update Map type definitions to use consistent Map<string | number, unknown> type
- Fix Plugin type definition to properly handle Schema types
- Update function signatures to maintain type compatibility
- Resolve type errors in UI components and context providers
- Ensure proper type handling in schema implementations

Co-Authored-By: Kyohei Fukuda <kyouhei.fukuda0729@gmail.com>

* Refactor typedI18n function to use a type-safe key assertion for i18n

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Kyohei Fukuda <kyouhei.fukuda0729@gmail.com>
2025-03-05 19:46:54 +09:00
devin-ai-integration[bot]
6a2d86f588 Fix easy-to-resolve linting errors in packages/common (#811)
* Fix linting errors in packages/common directory

- Replace explicit 'any' types with more specific types like 'unknown'
- Fix unsafe function calls with proper type assertions
- Remove unnecessary type assertions
- Replace non-null assertions with nullish coalescing operators
- Fix redundant type constituents in union types

Co-Authored-By: Kyohei Fukuda <kyouhei.fukuda0729@gmail.com>

* Fix type error in helper.ts getFontNamesInSchemas function

Co-Authored-By: Kyohei Fukuda <kyouhei.fukuda0729@gmail.com>

* Fix type errors in schemas package and test files

Co-Authored-By: Kyohei Fukuda <kyouhei.fukuda0729@gmail.com>

* Revert strict type changes to maintain backward compatibility

Co-Authored-By: Kyohei Fukuda <kyouhei.fukuda0729@gmail.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Kyohei Fukuda <kyouhei.fukuda0729@gmail.com>
2025-03-05 14:57:53 +09:00
Kyohei Fukuda
f134f15007 Fix formatting issues and ensure consistent use of commas in function parameters and object properties 2025-03-04 11:11:23 +09:00
Kyohei Fukuda
102ca8cc62 Fix eslint (#780)
* Refactor ESLint configuration: remove legacy .eslintrc.cjs files and replace with new .mjs configurations

* Remove unnecessary TypeScript ignore comments and simplify async calls in barcode tests

* Refactor date helper: remove TypeScript ignore comments and simplify AirDatepicker usage

* Enhance date helper: add AirDatepickerDate type and improve type annotations for onSelect callback

* Update TypeScript and ESLint configurations: change module to NodeNext, refine file patterns, and enhance lint command

* Refactor ESLint configuration: remove unnecessary language options for TypeScript files
2025-03-03 10:20:36 +09:00
Kyohei Fukuda
b0d980c433 Modification to make the library ESM-based. (#770)
* Remove fast-xml-parser dependency and update vite-tsconfig-paths to 5.1.4

* tmp

* Refactor test files and scripts to use ES modules; remove obsolete files

* Enhance tests with new PDF utilities and update Jest configuration for ESM support
2025-03-01 02:23:24 +09:00
Kyohei Fukuda
8d824db3f5 Fix TS2835 (#762)
* tmp

* chore: update TypeScript configuration to use ESNext module and resolution

* fix: update remaining imports with .js extensions and tsconfig files with nodenext

Co-Authored-By: Kyohei Fukuda <kyouhei.fukuda0729@gmail.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2025-02-28 20:49:17 +09:00
Peter Ward
8530beb9b4 133 Allow custom max zoom in UI (#698) 2025-02-08 20:36:08 +09:00
Kyohei Fukuda
a2be964653 feat: implement version management script and update constants 2025-01-25 11:41:26 +09:00
Kyohei Fukuda
d43e0006d8 Fix website build 2025-01-24 12:19:09 +09:00
Kyohei Fukuda
82d8019b13 Add converter package (#681)
* TMP

* TMP

* TMP

* Update README.md to provide library description and documentation link

* TMP

* TMP

* TMP

* TMP

* Update package dependencies by adding @pdfme/converter and removing pdfjs-dist

* Remove pdfjs-dist mock and update tests to reflect changes in dependencies

* minor fix and add document for website

* Add documentation for manipulator and optimizer, and organize converter in sidebar

* Refactor package dependencies by removing @pdfme/converter from peerDependencies and reinstating optionalDependencies for canvas in converter package
2025-01-24 11:09:29 +09:00
Kyohei Fukuda
2ff80d1d55 Fix DatePicker (#679) 2025-01-18 21:07:09 +09:00
Kyohei Fukuda
f3896de632 Add comparison operator evaluations (#678) 2025-01-18 17:12:21 +09:00
Yasuyuki Komatsubara
37a6e1f70e Allow change the locale of datepicker (#665)
* reflect lang settings in date schemas

* Allow change locale of datepicker

* editable dateFormat

* change variable name to , user-friendly label

* Mionr fix

* Fix for merge

* Minor fix

---------

Co-authored-by: Kyohei Fukuda
2025-01-18 16:24:30 +09:00
Kyohei Fukuda
07c495bdbc Templates4playground (#669)
* TMP

* TMP

* TMP

* TMP

* TMP

* TMP

* TMP

* Add instructions for adding templates to the README
2025-01-06 11:45:09 +09:00
Zin Kyaw Kyaw (AJ)
abf0e360a3 [630]: Bug fix on basePdf as array buffer (#659)
* [630]: Bug fix on basePdf as array buffer

* Minor fix

* Fix handling of customPdf in getB64BasePdf to ensure proper conversion to Uint8Array

* TMP

* Fix test

---------

Co-authored-by: hand-dot <kyouhei.fukuda0729@gmail.com>
2024-12-14 15:44:42 +09:00
Kyohei Fukuda
564d6f2ae1 Update Readme and docs (#645) 2024-11-24 17:58:12 +09:00
Kyohei Fukuda
f679f73b5e Replace ant design icons to lucide icons 546 (#642)
* TMP

* Use lucide icons

* Update snapshot
2024-11-23 18:30:18 +09:00
Kyohei Fukuda
2a2323d832 Automatically replace PDFME_VERSION with the latest Git tag during the build process (#641)
* Automatically replace PDFME_VERSION with the latest Git tag during the build process

* Set fetch-depth to 0 in GitHub Actions workflow for full history checkout
2024-11-22 10:57:47 +09:00
Kyohei Fukuda
f3215b429e Enable the showHead setting of the table to be modified by the designer (#640)
* TMP

* Fix for table ui

* Add TypeScript error suppression for table schema in propPanel
2024-11-20 09:15:18 +09:00
Kyohei Fukuda
2037c383a0 Add radio checkbox schemas (#631)
* TMP

* add checkbox

* add radioGroup

* Minor fix

* add color and update doc
2024-11-15 17:09:30 +09:00
Kyohei Fukuda
2ef3f126a7 Enable placement of headers and footers in fixed positions & Use template engine (#620)
* Impl replacePlaceholders

* fix build

* Update replacePlaceholders

* optimize images

* Add doc

* update schema doc

* Fix bug

* add tests

* add security tests for replacePlaceholders to prevent access to prohibited properties and methods

* optimize parseData and evaluatePlaceholders with caching for improved performance

* remove ejs

* add license information for @types/estree and acorn in package-lock.json

* Fix ci

* write doc

* Update website/docs/headers-and-footers.md

Co-authored-by: Peter Ward <pete@pennyblack.io>

* Update playground/src/helper.ts

Co-authored-by: Peter Ward <pete@pennyblack.io>

---------

Co-authored-by: Peter Ward <pete@pennyblack.io>
2024-11-11 19:19:19 +09:00
Kyohei Fukuda
4fc737f313 Update pdfjs-dist 2024-11-09 17:52:01 +09:00
Andre Bongartz
c58953f383 fix import for index.js to support esm without importing errors (#617) 2024-11-09 17:19:07 +09:00
Kyohei Fukuda
e1c6ed13fc Fix date schema (#610)
* Refactor language property to lang in schema and generator modules

* TMP

* Fix bug

* Refactor package.json and cssTransform.js files
2024-10-13 00:26:48 +09:00
Kyohei Fukuda
915447863b [WIP] Add Schema Date input (#606)
* TMP

* IMPL

* remove console

* add remove button

* TMP

* TMP

* add select schema

* Minor fix

* fix ut

* Update package.json to include date-fns/locale.cjs module mapping
2024-10-07 15:09:39 +09:00
Kyohei Fukuda
e794eabd91 Preparing to release V5 (#600) 2024-09-25 10:39:52 +09:00
Peter Ward
1d778fe5de [BC Break]: Template schema restructure from keyed object to array (#588) 2024-09-20 10:11:23 +01:00
Kyohei Fukuda
70a93d4149 fix bug (#594) 2024-09-15 17:24:35 +09:00
Kyohei Fukuda
49d3e46835 Fix Multiple tables bug (#590) 2024-09-11 09:37:34 +09:00
Kyohei Fukuda
54b813c44b Fix table layout bug (#589)
* Fix table layout bug

* Update snapshot

* Move cloneDeep to common

* Minor fix

* revert some test pdf

* add test

* Minor fix

* Minor fix

* Minor fix

* refactoring
2024-09-10 20:49:52 +09:00
Kyohei Fukuda
11d41411e8 Integrate the ReadOnly schema (#547)
* IMPL

* Remove read-only schema from playground

* Support read-only in multiVariableText schema

* Change readOnly checkbox

* Minor fix

* revert MVT changes

* Fix for MVT

* Minor fix
2024-08-10 16:09:11 +09:00
Peter Ward
e91a7e31a1 Validating unique schema keys (#540)
* validating unique schema keys

* Minor fix

---------

Co-authored-by: Kyohei Fukuda <kyoheif@wix.com>
2024-08-04 14:57:47 +09:00