Commit Graph

288 Commits

Author SHA1 Message Date
hand-dot
74922e9b59 Add Designer selection API 2026-05-22 17:33:18 +09:00
Kyohei Fukuda
48590919fa [codex] Disable text expand for custom basePdf (#1470)
* fix(ui): disable text expand for custom base pdf

* fix(ui): limit custom base pdf expand guard to text
2026-05-06 12:00:26 +09:00
Kyohei Fukuda
616ace4aed [codex] Add generic split range metadata (#1469)
* refactor(schemas): add generic split range metadata

* refactor(schemas): remove legacy split range fields

* refactor(schemas): polish split range helpers
2026-05-06 11:55:10 +09:00
Kyohei Fukuda
1bd2ec9bd8 [codex] Add dynamic height for text schemas (#1467)
* feat(generator): expand text schema height dynamically

* fix(schemas): restore overflow select binding

* feat(schemas): split expanded text by line

* fix(ui): merge edits from split text chunks

* fix(schemas): avoid regex splitting split text edits

* fix(schemas): harden split text dynamic layout
2026-05-06 10:41:45 +09:00
hand-dot
36d5fdb0ef style: format main after jsx merge 2026-05-05 17:49:43 +09:00
Kyohei Fukuda
bed77e5713 [codex] add list schema implementation plan (#1460)
* docs: add list schema implementation plan

* feat(schemas): add list schema

* fix(schemas): improve list form editing

* fix(schemas): localize list editing labels

* fix(schemas): align table control buttons

* fix(schemas): keep list designer editing during actions

* fix(tsconfig): resolve list schema subpath

* fix(schemas): keep list action clicks isolated

* fix(schemas): support empty list state

* fix(schemas): allow editing list items in designer

* fix(schemas): keep list designer editing on enter

* fix(schemas): ignore IME enter in list editor

* fix(schemas): make enter insert list item line breaks

* test(generator): add list plugin to playground snapshots

* refactor(schemas): render list items with text ui

* fix(schemas): adapt list prop panel fields by style

* fix(schemas): simplify list options and nested numbering

* Reorder import statements in generate-templates-thumbnail

* Reorder List plugin in getPlugins function

* fix(ui): reflow schemas after dynamic list resize

* chore: remove obsolete list plan

* fix(ui): reflow form list height changes

* fix(ui): keep designer height changes local

* fix(schemas): commit list item line breaks immediately

* fix(schemas): restore list focus after line break rerender

* fix(schemas): keep form list focused after enter

* test(generator): update dynamic list snapshots

* fix(schemas): store list content as json arrays

* fix(schemas): address list review cleanup

* test(ui): update designer snapshot

* chore: trim list pr noise

* fix(schemas): align list markers in ui
2026-05-03 13:34:51 +09:00
Kyohei Fukuda
16bec8babb [codex] Add inline markdown text format (#1461)
* feat(schemas): add inline markdown text format

* fix(common): handle missing git tags in version script

* fix(converter): align pdfjs document options with latest types

* test(generator): update pdfjs image snapshots

* test(playground): register inline markdown example

* refactor(schemas): avoid default font i18n key

* refactor(schemas): move markdown controls to prop panel end

* refactor(schemas): use checkbox for inline markdown toggle

* fix(schemas): localize multi variable text prop labels

* refactor(schemas): align inline markdown fallback control

* fix(schemas): address inline markdown review feedback

* refactor(schemas): address inline markdown review refinements

* fix(schemas): correct synthetic italic pdf skew

* test(playground): add bold italic inline markdown sample
2026-05-02 16:34:43 +09:00
Kyohei Fukuda
25bb538be3 fFix/schema name focus (#1454)
* fix(ui): prevent focus loss on schema name input

Exclude name from the live handleWatch update path to prevent the sidebar from re-rendering on every keystroke. The name field will now only be updated on blur/Enter instead.

* fix(ui): add onBlur handler to persist schema name changes

Added onBlur handler to schema name field to persist changes when field loses focus, while keeping the exclusion of 'name' from handleWatch to prevent focus loss during typing.

* fix(ui): refactor form handling and update schema name validation logic

---------

Co-authored-by: bobo-xxx <111567133+bobo-xxx@users.noreply.github.com>
2026-04-27 12:52:25 +09:00
Karthi Krishnamurthi
e3046f57de fix(ui): preserve page cursor across template updates with bounds clamping (#1431) 2026-04-27 12:38:28 +09:00
hand-dot
758983d564 fix fmt 2026-04-20 17:01:39 +09:00
Kyohei Fukuda
1422f930fb fix(cli): stop pulling ui peers through common (#1420) 2026-04-03 20:35:34 +09:00
hand-dot
76e3a75148 fix: address review followups 2026-04-02 18:14:27 +09:00
hand-dot
ca2b24a9b9 fix(ui): guard designer paste selection 2026-04-02 17:43:51 +09:00
hand-dot
69005894cc fix(ui,cli): address review regressions 2026-04-02 17:33:58 +09:00
hand-dot
c1299b42c7 fix(repo): address build and ui review feedback 2026-04-02 16:48:36 +09:00
hand-dot
eba53f7495 Keep designer left sidebar height in sync 2026-03-22 14:58:19 +09:00
hand-dot
22d4fd1f9e Fix playground CI rendering and E2E snapshots 2026-03-22 09:25:35 +09:00
hand-dot
7fae525445 Fix CI build order and async UI waits 2026-03-21 18:22:54 +09:00
hand-dot
c759a120d7 feat: update test script to run workspace tests and refactor schema imports
- Changed the test script in package.json to run workspace tests using a new script.
- Updated imports in generator and helper files to point to specific schema paths.
- Added new builtins and tables exports in schemas package.json and created corresponding files.
- Enhanced error handling in multiVariableText propPanel for JSON parsing.
- Refactored UI components to use React 18 and updated dependencies accordingly.
- Improved snapshot tests to ensure cleaner output by removing empty text nodes.
- Updated documentation to reflect changes in package usage and requirements.
2026-03-21 16:10:48 +09:00
hand-dot
3d87f977d6 use vp 2026-03-21 09:24:02 +09:00
hand-dot
577db47ad2 Clean up ui hook dependencies 2026-03-20 19:25:30 +09:00
hand-dot
6c4900f00e Complete pdf-lib and ui Vite build migration 2026-03-20 19:04:44 +09:00
hand-dot
c756700c09 Expand type-aware lint and fix pdf-lib Node ESM exports 2026-03-20 17:52:11 +09:00
hand-dot
f60a10c002 Migrate ui tests to Vitest 2026-03-20 16:14:29 +09:00
TNBO/Eedge
69f6be160b fix(dynamicTemplate): rewrite layout engine for accurate multi-page table rendering (#1294)
* fix(dynamicTemplate): rewrite layout engine for accurate multi-page table rendering

- Implement sequential offset-based layout algorithm for correct element positioning
- Add floating point tolerance (EPSILON) to prevent precision errors in page break calculations
- Fix __bodyRange indexing to correctly map dynamicHeights to table body data
- Prevent orphaned table headers by moving header with first data row when page breaks
- Fix UI recalculation timing to use immediate input values for dynamic templates
- Update tests to match new layout behavior

* refactor(common): process dynamic template per page and remove duplicate cloneDeep

* refactor(common): process each template page independently regardless of dynamic content
2025-12-16 15:17:29 +09:00
RobH
a5c71bbb9a feat: add page change listener API (#1251)
* feat: add page change listener API

- Add onPageChange() method to Designer class for listening to page changes
- Add getTotalPages() method to get total page count
- Update onPageCursorChange callback to pass totalPages from schemasList.length
- Ensures accurate page count when pages are added/removed

* feat: add page change listener to Form and Viewer

- Add onPageChange() method to Form and Viewer classes
- Add getPageCursor() and getTotalPages() methods to Form and Viewer
- Update Preview component to accept and call onPageChange callback
- Fix Designer test to use proper callback signature

---------

Co-authored-by: Rob H-Y <Rob-HY@users.noreply.github.com>
2025-12-05 09:27:30 +09:00
hand-dot
ae82bbc653 fix: optimize useEffect dependencies in DetailView component 2025-12-01 13:38:56 +09:00
Peter Ward
87aa286b02 fix: resize window down scales canvas height too (#1249) 2025-11-29 16:18:17 +09:00
Peter Ward
75b17ac05d refactor(ui): tidy designer right sidebar layout (#1247)
- introduce shared sidebar frame/header/body/footer wrappers with consistent padding
- adjust ListView and DetailView to use new structure so scrollbars reach edge
- tighten hooks in DetailView (memoized i18n helper, correct deps) and tidy sidebar container styling
2025-11-29 16:12:52 +09:00
RobH
b1fd15a909 Add HTML component classNames to Designer UI sections and buttons (#1243)
* Add HTML component IDs to Designer UI sections and buttons

- Add IDs to all major UI sections (Root, LeftSidebar, RightSidebar, Canvas, CtlBar)
- Add IDs to all interactive buttons (zoom, pager, bulk update, align, etc.)
- Add IDs to plugin buttons with dynamic type-based naming
- Update DeleteButton to use consistent ID naming
- Enables users to hide/style UI elements via CSS selectors

* Convert designer UI component IDs to class names

- Add DESIGNER_CLASSNAME constant ('pdfme-designer-') to constants.ts
- Convert all pdfme-designer-* IDs to class names using DESIGNER_CLASSNAME prefix
- Revert DELETE_BTN_ID to use uuid() as in main/master
- Add class name for canvas background element
- Update all designer UI components (Root, Canvas, LeftSidebar, RightSidebar, DetailView, AlignWidget, ListView, CtlBar)

* Use UI_CLASSNAME for CtlBar component

- Add UI_CLASSNAME constant ('pdfme-ui-') for shared UI components
- Update CtlBar to use UI_CLASSNAME instead of DESIGNER_CLASSNAME
- CtlBar is used in both Designer and Form Viewer, so needs generic prefix

---------

Co-authored-by: Rob H-Y <Rob-HY@users.noreply.github.com>
2025-11-27 15:19:56 +09:00
hand-dot
c97fa9b73d fix(table): rename headerRepeat to repeatHead for consistency 2025-11-21 15:50:32 +09:00
TNBO/Eedge
f791e0b5a2 feat(table): add headerRepeat option and fix dynamic layout (#1238) 2025-11-21 15:32:38 +09:00
hand-dot
22f199e76d feat(ui): add out-of-bounds validation for schema positioning and update related types 2025-11-09 09:46:05 +09:00
Roman Afanasyev
4e79965535 fix(ui): correct element position clamping in template2SchemasList (#1228) 2025-11-09 09:06:19 +09:00
hand-dot
2459891127 Fix CI 2025-11-08 14:20:06 +09:00
Kyohei Fukuda
fbdeaf00d7 Potential fix for code scanning alert no. 16: Incomplete string escaping or encoding (#1186)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-09-10 21:54:37 +09:00
hand-dot
4de814b4cd fix: Add DOMPurify for SVG sanitization in PluginIcon component and implement security tests 2025-09-10 20:17:42 +09:00
Kyohei Fukuda
ec072ea821 fix: Refactor SVG handling in PluginIcon component for improved size … (#1184)
* fix: Refactor SVG handling in PluginIcon component for improved size management and sanitization

* Potential fix for code scanning alert no. 41: Incomplete URL scheme check

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-09-10 16:06:31 +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
093f183d74 npm run prettier 2025-07-02 15:21:54 +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
ef0efbbf2b fix for using MVT in static schema (#1018) 2025-05-20 10:41:54 +09:00
Peter Ward
8230cfb547 Default fontName to fallback font for all newly created schemas in UI (#1015)
* 953 default fontName to fallback font for all newly created schemas in UI

* f
2025-05-19 09:12:42 +09:00
Peter Ward
0399a98485 Multivariable text fixes (#1011)
* 1009 MVT: fix sequence of schema attribute changes to avoid syntax error
* 1008 MVT: renderer loses focus when creating new variable
2025-05-16 10:58:10 +01: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
Kyohei Fukuda
652a6dc24c fix: prevent error when domContainer is missing in setSize method 2025-05-14 16:35:38 +09:00
Peter Ward
a3f77db34b avoid full schema rerender while dragging new field (#1005) 2025-05-13 09:40:38 +09:00
Kyohei Fukuda
854a336649 Minor fix 2025-05-09 14:10:30 +09:00
Yasuyuki Komatsubara
309349f5fa onChange should be fired only if the schema is in the current page (#965)
* onChange should be fired only if the schema is in the current page

* Update packages/ui/src/components/Designer/Canvas/index.tsx

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

* make the  function inline to avoid type errors

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2025-05-07 09:50:27 +09:00
Kyohei Fukuda
ae628ade13 Update docs 2025-04-28 10:55:58 +09:00