@veltra/desktop 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/action/action-group.js.map +1 -1
- package/dist/components/action/action-group.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/action/action-group.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/action/action.js +1 -1
- package/dist/components/action/style.js +2 -2
- package/dist/components/action/style2.css +1 -0
- package/dist/components/ai-button/ai-button.js +9 -10
- package/dist/components/ai-button/ai-button.js.map +1 -1
- package/dist/components/ai-button/style2.css +1 -0
- package/dist/components/alert/alert.js +1 -2
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/alert/style2.css +13 -12
- package/dist/components/anchor/anchor.js +0 -1
- package/dist/components/anchor/anchor.js.map +1 -1
- package/dist/components/anchor/di.js.map +1 -1
- package/dist/components/anchor/style2.css +1 -0
- package/dist/components/anchor/use-anchor.js +0 -2
- package/dist/components/anchor/use-anchor.js.map +1 -1
- package/dist/components/auto-complete/auto-complete.js +6 -7
- package/dist/components/auto-complete/auto-complete.js.map +1 -1
- package/dist/components/auto-complete/style.js +1 -1
- package/dist/components/auto-complete/style2.css +4 -1
- package/dist/components/auto-complete/use-suggestions.js +0 -4
- package/dist/components/auto-complete/use-suggestions.js.map +1 -1
- package/dist/components/avatar/avatar-group.js.map +1 -1
- package/dist/components/avatar/style2.css +1 -0
- package/dist/components/back-top/back-top.js +4 -4
- package/dist/components/back-top/back-top.js.map +1 -1
- package/dist/components/back-top/style2.css +1 -0
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/badge/style2.css +1 -0
- package/dist/components/batch-edit/batch-edit-form.js +13 -13
- package/dist/components/batch-edit/batch-edit-list.js +11 -11
- package/dist/components/batch-edit/batch-edit-list.js.map +1 -1
- package/dist/components/batch-edit/batch-edit.js +13 -18
- package/dist/components/batch-edit/batch-edit.js.map +1 -1
- package/dist/components/batch-edit/form-action-header.js +0 -1
- package/dist/components/batch-edit/form-action-header.js.map +1 -1
- package/dist/components/batch-edit/helper.d.ts +0 -5
- package/dist/components/batch-edit/helper.js +0 -5
- package/dist/components/batch-edit/helper.js.map +1 -1
- package/dist/components/batch-edit/style.d.ts +1 -1
- package/dist/components/batch-edit/style.js +5 -5
- package/dist/components/batch-edit/style2.css +1 -0
- package/dist/components/batch-edit/use-dialog-effect.js.map +1 -1
- package/dist/components/batch-edit/use-edit-state.js +0 -1
- package/dist/components/batch-edit/use-edit-state.js.map +1 -1
- package/dist/components/batch-edit/use-handlers.js +0 -8
- package/dist/components/batch-edit/use-handlers.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/breadcrumb/style2.css +1 -0
- package/dist/components/button/button-group.js +2 -2
- package/dist/components/button/button.js +5 -5
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button/style2.css +1 -0
- package/dist/components/calendar/style2.css +1 -0
- package/dist/components/calendar/utils.js +0 -18
- package/dist/components/calendar/utils.js.map +1 -1
- package/dist/components/card/card-cover.js.map +1 -1
- package/dist/components/card/style2.css +21 -2
- package/dist/components/carousel/carousel.js +1 -1
- package/dist/components/carousel/carousel.js.map +1 -1
- package/dist/components/carousel/style2.css +1 -0
- package/dist/components/carousel/use-carousel.js +0 -1
- package/dist/components/carousel/use-carousel.js.map +1 -1
- package/dist/components/cascade/cascade-panel-item.js +6 -6
- package/dist/components/cascade/cascade-panel-item.js.map +1 -1
- package/dist/components/cascade/cascade.js +91 -100
- package/dist/components/cascade/cascade.js.map +1 -1
- package/dist/components/cascade/di.js.map +1 -1
- package/dist/components/cascade/style.js +3 -3
- package/dist/components/cascade/style2.css +8 -4
- package/dist/components/cascade/use-check.js.map +1 -1
- package/dist/components/cascade/use-data-map.js.map +1 -1
- package/dist/components/cascade/use-select.js +0 -8
- package/dist/components/cascade/use-select.js.map +1 -1
- package/dist/components/check-tag/style2.css +1 -0
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/checkbox/style2.css +1 -0
- package/dist/components/checkbox-group/checkbox-group.js +1 -11
- package/dist/components/checkbox-group/checkbox-group.js.map +1 -1
- package/dist/components/checkbox-group/style2.css +1 -0
- package/dist/components/chip/style2.css +1 -0
- package/dist/components/chip-group/chip-group.js +1 -1
- package/dist/components/chip-group/style2.css +1 -0
- package/dist/components/code-editor/basic-setup.js +3 -3
- package/dist/components/code-editor/code-editor.js +4 -10
- package/dist/components/code-editor/code-editor.js.map +1 -1
- package/dist/components/code-editor/langs/spel/completion.js +0 -1
- package/dist/components/code-editor/langs/spel/completion.js.map +1 -1
- package/dist/components/code-editor/langs/spel/language.js +0 -1
- package/dist/components/code-editor/langs/spel/language.js.map +1 -1
- package/dist/components/code-editor/shell-extension.js +0 -3
- package/dist/components/code-editor/shell-extension.js.map +1 -1
- package/dist/components/code-editor/style2.css +1 -0
- package/dist/components/collapse/collapse-item.js +1 -1
- package/dist/components/collapse/collapse-item.js.map +1 -1
- package/dist/components/collapse/collapse.js.map +1 -1
- package/dist/components/collapse/style2.css +1 -0
- package/dist/components/condition-editor/components/condition-group.js.map +1 -1
- package/dist/components/condition-editor/components/condition-row.js.map +1 -1
- package/dist/components/condition-editor/condition-editor.js +1 -1
- package/dist/components/condition-editor/condition-editor.js.map +1 -1
- package/dist/components/condition-editor/core/evaluator.js.map +1 -1
- package/dist/components/condition-editor/style.js +3 -3
- package/dist/components/condition-editor/style2.css +1 -0
- package/dist/components/contextmenu/contextmenu-item.js +1 -1
- package/dist/components/contextmenu/contextmenu-item.js.map +1 -1
- package/dist/components/contextmenu/contextmenu-panel.js +1 -1
- package/dist/components/contextmenu/contextmenu-sub.js +2 -2
- package/dist/components/contextmenu/contextmenu-sub.js.map +1 -1
- package/dist/components/contextmenu/contextmenu.js +1 -1
- package/dist/components/contextmenu/contextmenu.js.map +1 -1
- package/dist/components/contextmenu/style2.css +50 -4
- package/dist/components/date-panel/date-panel.js.map +1 -1
- package/dist/components/date-panel/di.js.map +1 -1
- package/dist/components/date-panel/style2.css +2 -1
- package/dist/components/date-panel/use-date-select.js +0 -6
- package/dist/components/date-panel/use-date-select.js.map +1 -1
- package/dist/components/date-panel/use-panel-date.js +0 -1
- package/dist/components/date-panel/use-panel-date.js.map +1 -1
- package/dist/components/date-panel/use-panel.js +0 -2
- package/dist/components/date-panel/use-panel.js.map +1 -1
- package/dist/components/date-picker/date-picker.js +5 -5
- package/dist/components/date-picker/style.js +1 -1
- package/dist/components/date-picker/style2.css +1 -0
- package/dist/components/date-range-picker/date-range-picker.js +6 -6
- package/dist/components/date-range-picker/style.js +1 -1
- package/dist/components/date-range-picker/style2.css +1 -0
- package/dist/components/descriptions/descriptions-item.js.map +1 -1
- package/dist/components/descriptions/descriptions.js +9 -4
- package/dist/components/descriptions/descriptions.js.map +1 -1
- package/dist/components/descriptions/style2.css +78 -16
- package/dist/components/dialog/dialog.js +85 -95
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/dialog/style.js +1 -1
- package/dist/components/dialog/style2.css +41 -4
- package/dist/components/dialog/use-maximum.js.map +1 -1
- package/dist/components/divider/divider.js.map +1 -1
- package/dist/components/divider/style2.css +1 -0
- package/dist/components/drawer/drawer.js +1 -3
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/drawer/style2.css +17 -2
- package/dist/components/dropdown/dropdown.js +0 -3
- package/dist/components/dropdown/dropdown.js.map +1 -1
- package/dist/components/dropdown/style2.css +18 -1
- package/dist/components/dual-nav/dual-nav-app.js +21 -6
- package/dist/components/dual-nav/dual-nav-app.js.map +1 -1
- package/dist/components/dual-nav/dual-nav.js +43 -47
- package/dist/components/dual-nav/dual-nav.js.map +1 -1
- package/dist/components/dual-nav/helper.js +0 -2
- package/dist/components/dual-nav/helper.js.map +1 -1
- package/dist/components/dual-nav/style.js +1 -1
- package/dist/components/dual-nav/style2.css +23 -1
- package/dist/components/empty/style2.css +1 -0
- package/dist/components/expression-editor/components/variable-picker.js +6 -10
- package/dist/components/expression-editor/components/variable-picker.js.map +1 -1
- package/dist/components/expression-editor/core/chip.js +0 -4
- package/dist/components/expression-editor/core/chip.js.map +1 -1
- package/dist/components/expression-editor/core/editor.js.map +1 -1
- package/dist/components/expression-editor/core/mention.js.map +1 -1
- package/dist/components/expression-editor/expression-editor.js +1 -1
- package/dist/components/expression-editor/style.js +2 -2
- package/dist/components/expression-editor/style2.css +4 -5
- package/dist/components/file-picker/style2.css +1 -0
- package/dist/components/file-viewer/file-viewer-toolbar.js +1 -1
- package/dist/components/file-viewer/file-viewer-toolbar.js.map +1 -1
- package/dist/components/file-viewer/file-viewer.js +2 -2
- package/dist/components/file-viewer/file-viewer.js.map +1 -1
- package/dist/components/file-viewer/helper.js +0 -3
- package/dist/components/file-viewer/helper.js.map +1 -1
- package/dist/components/file-viewer/previewers/docx-previewer.js.map +1 -1
- package/dist/components/file-viewer/previewers/ofd-previewer.js.map +1 -1
- package/dist/components/file-viewer/previewers/pdf-previewer.js +2 -3
- package/dist/components/file-viewer/previewers/pdf-previewer.js.map +1 -1
- package/dist/components/file-viewer/previewers/pdf-worker-wrapper.js +2899 -2525
- package/dist/components/file-viewer/previewers/pdf-worker-wrapper.js.map +1 -1
- package/dist/components/file-viewer/previewers/sheet-previewer.js.map +1 -1
- package/dist/components/file-viewer/previewers/text-previewer.js.map +1 -1
- package/dist/components/file-viewer/previewers/video-previewer.js.map +1 -1
- package/dist/components/file-viewer/previewers/wasm/LICENSE_PDFJS_QUICKJS +21 -0
- package/dist/components/file-viewer/previewers/wasm/LICENSE_QUICKJS +22 -0
- package/dist/components/file-viewer/previewers/wasm/jbig2_nowasm_fallback.js +1 -14
- package/dist/components/file-viewer/previewers/wasm/openjpeg.wasm +0 -0
- package/dist/components/file-viewer/previewers/wasm/openjpeg_nowasm_fallback.js +1 -16
- package/dist/components/file-viewer/style.js +2 -2
- package/dist/components/file-viewer/style2.css +1 -0
- package/dist/components/float-button/float-button.js +4 -9
- package/dist/components/float-button/float-button.js.map +1 -1
- package/dist/components/float-button/style2.css +1 -0
- package/dist/components/form/form.js.map +1 -1
- package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/form/is-field-modified.js +0 -1
- package/dist/components/form/is-field-modified.js.map +1 -1
- package/dist/components/form/style2.css +1 -0
- package/dist/components/form/use-node-interceptor.js +0 -4
- package/dist/components/form/use-node-interceptor.js.map +1 -1
- package/dist/components/form-item/form-item.js.map +1 -1
- package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js +19 -25
- package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/form-item/helper.js.map +1 -1
- package/dist/components/form-item/style2.css +19 -2
- package/dist/components/form-item/validate.js +0 -1
- package/dist/components/form-item/validate.js.map +1 -1
- package/dist/components/gantt-chart/style2.css +1 -0
- package/dist/components/grid/breakpoint.js +0 -9
- package/dist/components/grid/breakpoint.js.map +1 -1
- package/dist/components/grid/di.js.map +1 -1
- package/dist/components/grid/grid-item.js.map +1 -1
- package/dist/components/grid/grid.js.map +1 -1
- package/dist/components/grid/style2.css +1 -0
- package/dist/components/grid/use-responsive.js.map +1 -1
- package/dist/components/grid-input/grid-input.js +0 -2
- package/dist/components/grid-input/grid-input.js.map +1 -1
- package/dist/components/grid-input/style2.css +1 -0
- package/dist/components/group-input/group-input.js +1 -0
- package/dist/components/group-input/group-input.js.map +1 -1
- package/dist/components/group-input/style2.css +14 -3
- package/dist/components/group-nav/group-nav-item.js +1 -1
- package/dist/components/group-nav/group-nav-item.js.map +1 -1
- package/dist/components/group-nav/group-nav.js +1 -1
- package/dist/components/group-nav/style.js +1 -1
- package/dist/components/group-nav/style2.css +18 -21
- package/dist/components/icon/style2.css +1 -0
- package/dist/components/image-cropper/draw-crop.js +0 -1
- package/dist/components/image-cropper/draw-crop.js.map +1 -1
- package/dist/components/image-cropper/image-cropper.js +109 -120
- package/dist/components/image-cropper/image-cropper.js.map +1 -1
- package/dist/components/image-cropper/style2.css +1 -0
- package/dist/components/image-cropper/use-image-loader.js.map +1 -1
- package/dist/components/image-cropper/use-preview.js.map +1 -1
- package/dist/components/image-cropper/use-selection.js +0 -2
- package/dist/components/image-cropper/use-selection.js.map +1 -1
- package/dist/components/image-cropper/use-transform.js +0 -1
- package/dist/components/image-cropper/use-transform.js.map +1 -1
- package/dist/components/image-previewer/image-previewer.js +2 -2
- package/dist/components/image-previewer/image-previewer.js.map +1 -1
- package/dist/components/image-previewer/style2.css +1 -0
- package/dist/components/index.d.ts +74 -78
- package/dist/components/index.js +147 -155
- package/dist/components/index.js.map +1 -1
- package/dist/components/input/input.js.map +1 -1
- package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/input/style2.css +1 -0
- package/dist/components/kanban/di.js +0 -1
- package/dist/components/kanban/di.js.map +1 -1
- package/dist/components/kanban/kanban-column.js +114 -22
- package/dist/components/kanban/kanban-column.js.map +1 -1
- package/dist/components/kanban/kanban.js +27 -20
- package/dist/components/kanban/kanban.js.map +1 -1
- package/dist/components/kanban/style2.css +48 -12
- package/dist/components/kbd/style2.css +1 -0
- package/dist/components/layout/layout-resizer.js +1 -1
- package/dist/components/layout/layout-resizer.js.map +1 -1
- package/dist/components/layout/layout.js +19 -25
- package/dist/components/layout/layout.js.map +1 -1
- package/dist/components/layout/style2.css +1 -0
- package/dist/components/loading/style2.css +1 -0
- package/dist/components/message/message.d.ts +0 -1
- package/dist/components/message/message.js +1 -1
- package/dist/components/message/message.js.map +1 -1
- package/dist/components/message/message2.js +0 -10
- package/dist/components/message/message2.js.map +1 -1
- package/dist/components/message/style2.css +1 -0
- package/dist/components/message-confirm/message-confirm.d.ts +0 -1
- package/dist/components/message-confirm/message-confirm.js +5 -6
- package/dist/components/message-confirm/message-confirm.js.map +1 -1
- package/dist/components/message-confirm/message-confirm2.js +0 -9
- package/dist/components/message-confirm/message-confirm2.js.map +1 -1
- package/dist/components/message-confirm/style2.css +68 -32
- package/dist/components/multi-select/di.js.map +1 -1
- package/dist/components/multi-select/multi-select-option.js +1 -1
- package/dist/components/multi-select/multi-select.js +30 -38
- package/dist/components/multi-select/multi-select.js.map +1 -1
- package/dist/components/multi-select/style.js +3 -3
- package/dist/components/multi-select/style2.css +1 -12
- package/dist/components/multi-tree-select/multi-tree-select.js +36 -51
- package/dist/components/multi-tree-select/multi-tree-select.js.map +1 -1
- package/dist/components/multi-tree-select/style.d.ts +2 -2
- package/dist/components/multi-tree-select/style.js +2 -2
- package/dist/components/multi-tree-select/style2.css +1 -0
- package/dist/components/nav/helper.js +0 -1
- package/dist/components/nav/helper.js.map +1 -1
- package/dist/components/nav/nav-icon.js +6 -2
- package/dist/components/nav/nav-icon.js.map +1 -1
- package/dist/components/nav/nav-item-collapsed.js +10 -13
- package/dist/components/nav/nav-item-collapsed.js.map +1 -1
- package/dist/components/nav/nav-item.js +5 -9
- package/dist/components/nav/nav-item.js.map +1 -1
- package/dist/components/nav/nav-sub-collapsed.js +5 -9
- package/dist/components/nav/nav-sub-collapsed.js.map +1 -1
- package/dist/components/nav/nav-sub.js +1 -3
- package/dist/components/nav/nav-sub.js.map +1 -1
- package/dist/components/nav/nav.js +6 -6
- package/dist/components/nav/nav.js.map +1 -1
- package/dist/components/nav/style.js +1 -1
- package/dist/components/nav/style2.css +35 -42
- package/dist/components/node-render/style2.css +1 -0
- package/dist/components/notification/notification-box.js +0 -1
- package/dist/components/notification/notification-box.js.map +1 -1
- package/dist/components/notification/notification.d.ts +0 -1
- package/dist/components/notification/notification.js +5 -5
- package/dist/components/notification/notification.js.map +1 -1
- package/dist/components/notification/notification2.js +0 -9
- package/dist/components/notification/notification2.js.map +1 -1
- package/dist/components/notification/style2.css +20 -1
- package/dist/components/number/style2.css +1 -0
- package/dist/components/number-input/number-input.js +1 -24
- package/dist/components/number-input/number-input.js.map +1 -1
- package/dist/components/number-input/style2.css +1 -0
- package/dist/components/number-range-input/style2.css +1 -0
- package/dist/components/paginator/paginator.js +5 -8
- package/dist/components/paginator/paginator.js.map +1 -1
- package/dist/components/paginator/style.js +1 -1
- package/dist/components/paginator/style2.css +1 -0
- package/dist/components/palette/color-transform.js +0 -20
- package/dist/components/palette/color-transform.js.map +1 -1
- package/dist/components/palette/di.js.map +1 -1
- package/dist/components/palette/palette-color-switch.js +2 -2
- package/dist/components/palette/palette-sv.js +3 -3
- package/dist/components/palette/palette-sv.js.map +1 -1
- package/dist/components/palette/palette.js +15 -11
- package/dist/components/palette/palette.js.map +1 -1
- package/dist/components/palette/style.js +1 -1
- package/dist/components/palette/style2.css +2 -0
- package/dist/components/palette/use-hsv.js +0 -6
- package/dist/components/palette/use-hsv.js.map +1 -1
- package/dist/components/password-input/password-input.js +1 -1
- package/dist/components/password-input/password-input.js.map +1 -1
- package/dist/components/password-input/style.js +1 -1
- package/dist/components/password-input/style2.css +1 -0
- package/dist/components/pop-confirm/pop-confirm.js +11 -8
- package/dist/components/pop-confirm/pop-confirm.js.map +1 -1
- package/dist/components/pop-confirm/style.js +1 -1
- package/dist/components/pop-confirm/style2.css +1 -0
- package/dist/components/progress/progress.js +5 -6
- package/dist/components/progress/progress.js.map +1 -1
- package/dist/components/progress/style2.css +1 -0
- package/dist/components/radio/radio.js +1 -2
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/radio/style2.css +1 -0
- package/dist/components/radio-group/radio-group.js +1 -1
- package/dist/components/radio-group/style2.css +1 -0
- package/dist/components/rate/rate.js +1 -3
- package/dist/components/rate/rate.js.map +1 -1
- package/dist/components/rate/style2.css +1 -0
- package/dist/components/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/components/rich-text-editor/style2.css +1 -0
- package/dist/components/rich-text-editor/toolbar.js +1 -1
- package/dist/components/rich-text-editor/toolbar.js.map +1 -1
- package/dist/components/scroll/di.js +0 -1
- package/dist/components/scroll/di.js.map +1 -1
- package/dist/components/scroll/scroll-bar.js +0 -6
- package/dist/components/scroll/scroll-bar.js.map +1 -1
- package/dist/components/scroll/scroll.js.map +1 -1
- package/dist/components/scroll/style2.css +1 -0
- package/dist/components/segment/segment.js +3 -54
- package/dist/components/segment/segment.js.map +1 -1
- package/dist/components/segment/style2.css +26 -22
- package/dist/components/select/select.js +8 -11
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/select/style.js +1 -1
- package/dist/components/select/style2.css +3 -15
- package/dist/components/select/use-keyboard.js +0 -1
- package/dist/components/select/use-keyboard.js.map +1 -1
- package/dist/components/select/use-options.js +0 -1
- package/dist/components/select/use-options.js.map +1 -1
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/skeleton/style2.css +1 -0
- package/dist/components/slider/slider.js.map +1 -1
- package/dist/components/slider/style2.css +1 -0
- package/dist/components/slider/use-slider.js +0 -10
- package/dist/components/slider/use-slider.js.map +1 -1
- package/dist/components/space/style2.css +1 -0
- package/dist/components/steps/steps.js +10 -9
- package/dist/components/steps/steps.js.map +1 -1
- package/dist/components/steps/style2.css +185 -126
- package/dist/components/switch/style2.css +1 -0
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/table/di.js.map +1 -1
- package/dist/components/table/node/col.js +0 -15
- package/dist/components/table/node/col.js.map +1 -1
- package/dist/components/table/node/row.js +0 -14
- package/dist/components/table/node/row.js.map +1 -1
- package/dist/components/table/style.js +2 -2
- package/dist/components/table/style2.css +1 -0
- package/dist/components/table/table-body.js +1 -2
- package/dist/components/table/table-body.js.map +1 -1
- package/dist/components/table/table-cell.js.map +1 -1
- package/dist/components/table/table-foot.js +1 -1
- package/dist/components/table/table-foot.js.map +1 -1
- package/dist/components/table/table-row.js +4 -4
- package/dist/components/table/table-row.js.map +1 -1
- package/dist/components/table/table.js +1 -2
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/table/use-cell-tip.js.map +1 -1
- package/dist/components/table/use-check.js +0 -1
- package/dist/components/table/use-check.js.map +1 -1
- package/dist/components/table/use-col-resize.js +1 -4
- package/dist/components/table/use-col-resize.js.map +1 -1
- package/dist/components/table/use-columns.d.ts +0 -4
- package/dist/components/table/use-columns.js +4 -17
- package/dist/components/table/use-columns.js.map +1 -1
- package/dist/components/table/use-rows.js +0 -8
- package/dist/components/table/use-rows.js.map +1 -1
- package/dist/components/table/use-table.js +0 -25
- package/dist/components/table/use-table.js.map +1 -1
- package/dist/components/table-editor/style.d.ts +2 -2
- package/dist/components/table-editor/style.js +1 -1
- package/dist/components/table-editor/style2.css +1 -0
- package/dist/components/table-editor/table-editor.js +12 -12
- package/dist/components/table-editor/table-editor.js.map +1 -1
- package/dist/components/tabs/style2.css +1 -0
- package/dist/components/tabs/tabs-horizontal.js +1 -1
- package/dist/components/tabs/tabs-horizontal.js.map +1 -1
- package/dist/components/tabs/tabs-vertical.js +1 -1
- package/dist/components/tabs/tabs-vertical.js.map +1 -1
- package/dist/components/tabs/tabs.js +1 -1
- package/dist/components/tag/style2.css +1 -0
- package/dist/components/tag/tag.js +1 -1
- package/dist/components/tag/tag.js.map +1 -1
- package/dist/components/text/style2.css +1 -0
- package/dist/components/text/text.js +1 -1
- package/dist/components/textarea/style2.css +101 -39
- package/dist/components/textarea/textarea.js +45 -44
- package/dist/components/textarea/textarea.js.map +1 -1
- package/dist/components/theme/schema.js +969 -154
- package/dist/components/theme/schema.js.map +1 -1
- package/dist/components/theme/style.d.ts +2 -2
- package/dist/components/theme/style.js +10 -2
- package/dist/components/theme/style2.css +215 -263
- package/dist/components/theme/theme-field-group.js +228 -0
- package/dist/components/theme/theme-field-group.js.map +1 -0
- package/dist/components/theme/theme.js +204 -265
- package/dist/components/theme/theme.js.map +1 -1
- package/dist/components/theme/use-theme-editor.js +456 -0
- package/dist/components/theme/use-theme-editor.js.map +1 -0
- package/dist/components/time-picker/style.js +1 -1
- package/dist/components/time-picker/style2.css +1 -0
- package/dist/components/time-picker/time-picker.js +5 -5
- package/dist/components/timeline/style2.css +43 -26
- package/dist/components/timeline/timeline-item.js +8 -10
- package/dist/components/timeline/timeline-item.js.map +1 -1
- package/dist/components/tip/style2.css +54 -25
- package/dist/components/tip/tip.js +38 -44
- package/dist/components/tip/tip.js.map +1 -1
- package/dist/components/tip/use-nest.js +0 -11
- package/dist/components/tip/use-nest.js.map +1 -1
- package/dist/components/tree/di.js +0 -1
- package/dist/components/tree/di.js.map +1 -1
- package/dist/components/tree/style.js +2 -2
- package/dist/components/tree/style2.css +6 -10
- package/dist/components/tree/tree-node.js +6 -6
- package/dist/components/tree/tree-node.js.map +1 -1
- package/dist/components/tree/tree-node2.js +0 -2
- package/dist/components/tree/tree-node2.js.map +1 -1
- package/dist/components/tree/tree.js +1 -1
- package/dist/components/tree/tree.js.map +1 -1
- package/dist/components/tree/use-check.js +0 -3
- package/dist/components/tree/use-check.js.map +1 -1
- package/dist/components/tree/use-filter.js +0 -4
- package/dist/components/tree/use-filter.js.map +1 -1
- package/dist/components/tree/use-select.js +0 -3
- package/dist/components/tree/use-select.js.map +1 -1
- package/dist/components/tree-select/style.js +1 -1
- package/dist/components/tree-select/style2.css +1 -0
- package/dist/components/tree-select/tree-select.js +8 -16
- package/dist/components/tree-select/tree-select.js.map +1 -1
- package/dist/components/watermark/style2.css +1 -0
- package/dist/components/watermark/watermark.js.map +1 -1
- package/dist/composables/use-overlay.js +0 -7
- package/dist/composables/use-overlay.js.map +1 -1
- package/dist/index.d.ts +48 -55
- package/dist/index.js +46 -50
- package/dist/install.js +1 -1
- package/dist/node_modules/.bun/@codemirror_commands@6.11.1/node_modules/@codemirror/commands/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-css@6.3.1/node_modules/@codemirror/lang-css/dist/index.js +2 -2
- package/dist/node_modules/.bun/@codemirror_lang-html@6.4.12/node_modules/@codemirror/lang-html/dist/index.js +4 -4
- package/dist/node_modules/.bun/@codemirror_lang-java@6.0.2/node_modules/@codemirror/lang-java/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-javascript@6.2.5/node_modules/@codemirror/lang-javascript/dist/index.js +3 -3
- package/dist/node_modules/.bun/@codemirror_lang-json@6.0.2/node_modules/@codemirror/lang-json/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-markdown@6.5.2/node_modules/@codemirror/lang-markdown/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-sql@6.10.0/node_modules/@codemirror/lang-sql/dist/index.js +2 -2
- package/dist/node_modules/.bun/@codemirror_language@6.13.1/node_modules/@codemirror/language/dist/index.js +2 -2
- package/dist/node_modules/.bun/@codemirror_lint@6.9.7/node_modules/@codemirror/lint/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_search@6.7.2/node_modules/@codemirror/search/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_theme-one-dark@6.1.3/node_modules/@codemirror/theme-one-dark/dist/index.js +1 -1
- package/dist/node_modules/.bun/@lezer_css@1.3.9/node_modules/@lezer/css/dist/index.js +1 -1
- package/dist/node_modules/.bun/@lezer_html@1.3.13/node_modules/@lezer/html/dist/index.js +2 -2
- package/dist/node_modules/.bun/@lezer_java@1.1.5/node_modules/@lezer/java/dist/index.js +1 -1
- package/dist/node_modules/.bun/@lezer_javascript@1.5.6/node_modules/@lezer/javascript/dist/index.js +1 -1
- package/dist/node_modules/.bun/@lezer_json@1.0.3/node_modules/@lezer/json/dist/index.js +1 -1
- package/dist/packages/ofd-core/dist/ctm.js +0 -1
- package/dist/packages/ofd-core/dist/ctm.js.map +1 -1
- package/dist/packages/ofd-core/dist/index.js +3 -3
- package/dist/packages/ofd-core/dist/page-objects.js +1 -1
- package/dist/packages/ofd-core/dist/page-objects.js.map +1 -1
- package/dist/packages/ofd-core/dist/parse.js +1 -1
- package/dist/packages/ofd-core/dist/render.js +3 -3
- package/dist/packages/ofd-core/dist/render.js.map +1 -1
- package/dist/packages/ofd-core/dist/xml.js +2 -2
- package/dist/packages/ofd-core/dist/xml.js.map +1 -1
- package/dist/style.d.ts +7 -8
- package/dist/style.js +63 -65
- package/dist/types/action.d.ts +0 -5
- package/dist/types/ai-button.d.ts +0 -4
- package/dist/types/alert.d.ts +1 -8
- package/dist/types/anchor.d.ts +0 -10
- package/dist/types/animation.d.ts +0 -4
- package/dist/types/auto-complete.d.ts +0 -6
- package/dist/types/avatar.d.ts +1 -6
- package/dist/types/back-top.d.ts +0 -3
- package/dist/types/badge.d.ts +0 -8
- package/dist/types/batch-edit.d.ts +2 -33
- package/dist/types/breadcrumb.d.ts +0 -6
- package/dist/types/button.d.ts +0 -13
- package/dist/types/calendar.d.ts +0 -11
- package/dist/types/card.d.ts +0 -6
- package/dist/types/carousel.d.ts +3 -5
- package/dist/types/cascade.d.ts +0 -21
- package/dist/types/check-tag.d.ts +0 -3
- package/dist/types/checkbox-group.d.ts +0 -8
- package/dist/types/checkbox.d.ts +0 -7
- package/dist/types/chip-group.d.ts +0 -8
- package/dist/types/chip.d.ts +0 -6
- package/dist/types/code-editor.d.ts +0 -3
- package/dist/types/collapse.d.ts +0 -6
- package/dist/types/condition-editor.d.ts +0 -4
- package/dist/types/contextmenu.d.ts +0 -14
- package/dist/types/css-transition.d.ts +0 -16
- package/dist/types/date-picker.d.ts +0 -9
- package/dist/types/date-range-picker.d.ts +0 -10
- package/dist/types/descriptions.d.ts +1 -4
- package/dist/types/dialog.d.ts +0 -11
- package/dist/types/divider.d.ts +2 -4
- package/dist/types/drawer.d.ts +0 -8
- package/dist/types/dropdown.d.ts +0 -24
- package/dist/types/dual-nav.d.ts +0 -7
- package/dist/types/empty.d.ts +0 -4
- package/dist/types/expression-editor.d.ts +0 -6
- package/dist/types/file-picker.d.ts +0 -7
- package/dist/types/file-viewer.d.ts +1 -7
- package/dist/types/float-button.d.ts +0 -8
- package/dist/types/form-item.d.ts +0 -5
- package/dist/types/form.d.ts +0 -7
- package/dist/types/gantt-chart.d.ts +0 -3
- package/dist/types/grid-input.d.ts +0 -5
- package/dist/types/grid.d.ts +0 -17
- package/dist/types/group-input.d.ts +0 -7
- package/dist/types/group-nav.d.ts +0 -4
- package/dist/types/icon.d.ts +0 -3
- package/dist/types/image-cropper.d.ts +0 -13
- package/dist/types/image-previewer.d.ts +0 -5
- package/dist/types/index.d.ts +6 -9
- package/dist/types/input.d.ts +0 -14
- package/dist/types/kanban.d.ts +0 -12
- package/dist/types/layout.d.ts +0 -6
- package/dist/types/loading.d.ts +0 -4
- package/dist/types/message-confirm.d.ts +0 -21
- package/dist/types/message.d.ts +0 -20
- package/dist/types/multi-auto-complete.d.ts +0 -3
- package/dist/types/multi-select.d.ts +0 -17
- package/dist/types/multi-tree-select.d.ts +0 -13
- package/dist/types/nav.d.ts +0 -14
- package/dist/types/node-render.d.ts +0 -2
- package/dist/types/notification.d.ts +0 -25
- package/dist/types/number-input.d.ts +0 -10
- package/dist/types/number-range-input.d.ts +0 -6
- package/dist/types/number.d.ts +0 -10
- package/dist/types/paginator.d.ts +0 -9
- package/dist/types/palette.d.ts +1 -6
- package/dist/types/password-input.d.ts +0 -3
- package/dist/types/pop-confirm.d.ts +0 -14
- package/dist/types/pop.d.ts +0 -3
- package/dist/types/progress.d.ts +0 -6
- package/dist/types/quick-batch-edit.d.ts +0 -3
- package/dist/types/radio-group.d.ts +0 -12
- package/dist/types/radio.d.ts +0 -7
- package/dist/types/rate.d.ts +0 -5
- package/dist/types/rich-text-editor.d.ts +0 -8
- package/dist/types/scroll.d.ts +0 -19
- package/dist/types/segment.d.ts +0 -12
- package/dist/types/select.d.ts +0 -11
- package/dist/types/skeleton.d.ts +6 -8
- package/dist/types/slider.d.ts +0 -7
- package/dist/types/space.d.ts +2 -4
- package/dist/types/steps.d.ts +6 -21
- package/dist/types/switch.d.ts +0 -6
- package/dist/types/table-editor.d.ts +0 -4
- package/dist/types/table.d.ts +0 -64
- package/dist/types/tabs.d.ts +0 -30
- package/dist/types/tag.d.ts +0 -5
- package/dist/types/text-editor.d.ts +0 -3
- package/dist/types/text.d.ts +0 -7
- package/dist/types/textarea.d.ts +0 -42
- package/dist/types/theme.d.ts +0 -6
- package/dist/types/time-picker.d.ts +0 -10
- package/dist/types/timeline.d.ts +0 -4
- package/dist/types/tip.d.ts +0 -21
- package/dist/types/tree-select.d.ts +0 -12
- package/dist/types/tree.d.ts +0 -29
- package/dist/types/watermark.d.ts +0 -7
- package/package.json +10 -10
- package/src/components/ai-button/ai-button.vue +0 -3
- package/src/components/alert/alert.vue +0 -1
- package/src/components/alert/style.scss +3 -3
- package/src/components/anchor/anchor.vue +0 -1
- package/src/components/anchor/di.ts +0 -4
- package/src/components/anchor/use-anchor.ts +0 -5
- package/src/components/auto-complete/auto-complete.vue +0 -5
- package/src/components/auto-complete/style.scss +3 -1
- package/src/components/auto-complete/use-suggestions.ts +0 -5
- package/src/components/batch-edit/__test__/batch-edit.test.ts +0 -21
- package/src/components/batch-edit/batch-edit-list.vue +0 -1
- package/src/components/batch-edit/batch-edit.vue +0 -3
- package/src/components/batch-edit/form-action-header.ts +0 -2
- package/src/components/batch-edit/helper.ts +0 -5
- package/src/components/batch-edit/use-dialog-effect.ts +0 -1
- package/src/components/batch-edit/use-edit-state.ts +0 -1
- package/src/components/batch-edit/use-handlers.ts +0 -10
- package/src/components/button/button.vue +0 -3
- package/src/components/calendar/utils.ts +0 -21
- package/src/components/card/style.scss +10 -3
- package/src/components/carousel/use-carousel.ts +0 -5
- package/src/components/cascade/__test__/cascade.test.ts +0 -3
- package/src/components/cascade/cascade.vue +0 -5
- package/src/components/cascade/di.ts +0 -1
- package/src/components/cascade/style.scss +11 -4
- package/src/components/cascade/use-check.ts +0 -1
- package/src/components/cascade/use-data-map.ts +0 -1
- package/src/components/cascade/use-select.ts +0 -10
- package/src/components/checkbox-group/checkbox-group.vue +0 -10
- package/src/components/code-editor/code-editor.vue +0 -6
- package/src/components/code-editor/langs/spel/completion.ts +0 -4
- package/src/components/code-editor/langs/spel/language.ts +0 -7
- package/src/components/code-editor/shell-extension.ts +0 -5
- package/src/components/collapse/__test__/collapse.test.ts +0 -7
- package/src/components/collapse/collapse-item.vue +0 -1
- package/src/components/collapse/collapse.vue +0 -1
- package/src/components/condition-editor/condition-editor.vue +0 -2
- package/src/components/condition-editor/core/evaluator.ts +0 -2
- package/src/components/contextmenu/style.scss +14 -5
- package/src/components/date-panel/di.ts +0 -8
- package/src/components/date-panel/style.scss +1 -1
- package/src/components/date-panel/use-date-select.ts +1 -14
- package/src/components/date-panel/use-panel-date.ts +0 -1
- package/src/components/date-panel/use-panel.ts +0 -2
- package/src/components/date-picker/use-date.ts +0 -17
- package/src/components/descriptions/descriptions.vue +7 -2
- package/src/components/descriptions/style.scss +77 -18
- package/src/components/dialog/dialog.vue +1 -13
- package/src/components/dialog/style.scss +39 -4
- package/src/components/dialog/use-maximum.ts +0 -2
- package/src/components/drawer/drawer.vue +0 -5
- package/src/components/drawer/style.scss +1 -3
- package/src/components/dropdown/dropdown.vue +1 -11
- package/src/components/dropdown/style.scss +1 -3
- package/src/components/dual-nav/__test__/dual-nav.test.ts +157 -0
- package/src/components/dual-nav/dual-nav-app.vue +19 -3
- package/src/components/dual-nav/dual-nav.vue +0 -2
- package/src/components/dual-nav/helper.ts +0 -2
- package/src/components/dual-nav/style.scss +5 -1
- package/src/components/expression-editor/__test__/mention.test.ts +0 -2
- package/src/components/expression-editor/components/variable-picker.vue +0 -7
- package/src/components/expression-editor/core/chip.ts +0 -5
- package/src/components/expression-editor/core/editor.ts +0 -11
- package/src/components/expression-editor/core/mention.ts +0 -2
- package/src/components/expression-editor/style.scss +3 -5
- package/src/components/file-viewer/file-viewer.vue +0 -1
- package/src/components/file-viewer/helper.ts +0 -5
- package/src/components/file-viewer/previewers/ofd-previewer.vue +0 -4
- package/src/components/file-viewer/previewers/pdf-previewer.vue +0 -6
- package/src/components/float-button/float-button.vue +0 -5
- package/src/components/form/is-field-modified.ts +0 -1
- package/src/components/form/use-node-interceptor.ts +0 -4
- package/src/components/form-item/__test__/style.test.ts +100 -0
- package/src/components/form-item/form-item.vue +1 -8
- package/src/components/form-item/helper.ts +0 -5
- package/src/components/form-item/style.scss +31 -2
- package/src/components/form-item/validate.ts +0 -4
- package/src/components/grid/breakpoint.ts +0 -10
- package/src/components/grid/di.ts +0 -2
- package/src/components/grid/grid.vue +0 -2
- package/src/components/grid/use-responsive.ts +0 -1
- package/src/components/grid-input/grid-input.vue +0 -3
- package/src/components/group-input/group-input.vue +2 -6
- package/src/components/group-input/style.scss +12 -4
- package/src/components/group-nav/style.scss +1 -28
- package/src/components/image-cropper/__test__/image-cropper.test.ts +0 -9
- package/src/components/image-cropper/__test__/use-transform.test.ts +0 -3
- package/src/components/image-cropper/draw-crop.ts +0 -1
- package/src/components/image-cropper/image-cropper.vue +0 -5
- package/src/components/image-cropper/use-image-loader.ts +0 -6
- package/src/components/image-cropper/use-preview.ts +0 -2
- package/src/components/image-cropper/use-selection.ts +0 -8
- package/src/components/image-cropper/use-transform.ts +0 -9
- package/src/components/image-previewer/image-previewer.vue +0 -3
- package/src/components/index.ts +0 -6
- package/src/components/kanban/__test__/kanban.test.ts +131 -1
- package/src/components/kanban/di.ts +0 -3
- package/src/components/kanban/kanban-column.vue +124 -15
- package/src/components/kanban/kanban.vue +14 -11
- package/src/components/kanban/style.scss +58 -12
- package/src/components/layout/layout-resizer.vue +1 -6
- package/src/components/layout/layout.vue +0 -12
- package/src/components/message/message.ts +0 -15
- package/src/components/message-confirm/message-confirm.ts +0 -14
- package/src/components/message-confirm/message-confirm.vue +6 -13
- package/src/components/message-confirm/style.scss +78 -30
- package/src/components/multi-select/__test__/multi-select.test.ts +0 -4
- package/src/components/multi-select/di.ts +0 -3
- package/src/components/multi-select/multi-select.vue +10 -21
- package/src/components/multi-select/style.scss +0 -13
- package/src/components/multi-tree-select/__test__/multi-tree-select.test.ts +0 -11
- package/src/components/multi-tree-select/__test__/show-checkbox.test.ts +0 -8
- package/src/components/multi-tree-select/multi-tree-select.vue +0 -17
- package/src/components/nav/helper.ts +0 -1
- package/src/components/nav/nav-item-collapsed.vue +0 -3
- package/src/components/nav/nav-item.vue +0 -1
- package/src/components/nav/nav-sub-collapsed.vue +0 -1
- package/src/components/nav/nav-sub.vue +0 -2
- package/src/components/nav/nav.vue +0 -2
- package/src/components/nav/style.scss +2 -31
- package/src/components/notification/notification-box.vue +0 -2
- package/src/components/notification/notification.ts +0 -15
- package/src/components/notification/style.scss +1 -1
- package/src/components/number-input/number-input.vue +0 -43
- package/src/components/paginator/paginator.vue +0 -3
- package/src/components/palette/color-transform.ts +1 -28
- package/src/components/palette/di.ts +0 -8
- package/src/components/palette/palette-sv.vue +0 -3
- package/src/components/palette/palette.vue +13 -7
- package/src/components/palette/style.scss +1 -0
- package/src/components/palette/use-hsv.ts +0 -6
- package/src/components/password-input/password-input.vue +0 -3
- package/src/components/progress/progress.vue +1 -12
- package/src/components/radio/radio.vue +0 -1
- package/src/components/rate/rate.vue +0 -2
- package/src/components/rich-text-editor/rich-text-editor.vue +0 -9
- package/src/components/rich-text-editor/toolbar.vue +0 -6
- package/src/components/scroll/di.ts +0 -1
- package/src/components/scroll/scroll-bar.vue +0 -7
- package/src/components/scroll/scroll.vue +1 -6
- package/src/components/segment/__test__/segment.test.ts +2 -3
- package/src/components/segment/segment.vue +2 -56
- package/src/components/segment/style.scss +28 -27
- package/src/components/select/__test__/select.test.ts +0 -17
- package/src/components/select/select.vue +0 -8
- package/src/components/select/style.scss +2 -16
- package/src/components/select/use-keyboard.ts +0 -2
- package/src/components/select/use-options.ts +0 -9
- package/src/components/slider/slider.vue +0 -1
- package/src/components/slider/use-slider.ts +0 -10
- package/src/components/steps/steps.vue +5 -6
- package/src/components/steps/style.scss +199 -116
- package/src/components/table/__test__/col-width.test.ts +0 -2
- package/src/components/table/di.ts +0 -20
- package/src/components/table/node/col.ts +0 -15
- package/src/components/table/node/row.ts +0 -14
- package/src/components/table/table-body.vue +0 -1
- package/src/components/table/table.vue +0 -1
- package/src/components/table/use-cell-tip.ts +0 -1
- package/src/components/table/use-check.ts +0 -12
- package/src/components/table/use-col-resize.ts +0 -4
- package/src/components/table/use-columns.ts +1 -30
- package/src/components/table/use-rows.ts +0 -28
- package/src/components/table/use-table.ts +0 -25
- package/src/components/table-editor/__test__/table-editor.test.ts +0 -17
- package/src/components/table-editor/table-editor.vue +0 -4
- package/src/components/tag/tag.vue +0 -4
- package/src/components/textarea/__test__/textarea.test.ts +97 -0
- package/src/components/textarea/style.scss +103 -35
- package/src/components/textarea/textarea.vue +47 -42
- package/src/components/theme/__test__/theme.test.ts +219 -0
- package/src/components/theme/schema.ts +924 -150
- package/src/components/theme/style.scss +224 -307
- package/src/components/theme/style.ts +10 -2
- package/src/components/theme/theme-field-group.vue +221 -0
- package/src/components/theme/theme.vue +233 -403
- package/src/components/theme/use-theme-editor.ts +585 -0
- package/src/components/timeline/__test__/timeline.test.ts +84 -0
- package/src/components/timeline/style.scss +44 -32
- package/src/components/timeline/timeline-item.vue +4 -15
- package/src/components/tip/style.scss +30 -17
- package/src/components/tip/tip.vue +1 -6
- package/src/components/tip/use-nest.ts +0 -11
- package/src/components/tree/__test__/show-checkbox.test.ts +0 -3
- package/src/components/tree/di.ts +0 -10
- package/src/components/tree/style.scss +8 -12
- package/src/components/tree/tree-node.ts +1 -6
- package/src/components/tree/use-check.ts +0 -5
- package/src/components/tree/use-filter.ts +0 -5
- package/src/components/tree/use-select.ts +0 -3
- package/src/components/tree-select/__test__/tree-select.test.ts +0 -11
- package/src/components/tree-select/tree-select.vue +1 -17
- package/src/components/watermark/base64.ts +0 -3
- package/src/components/watermark/watermark.vue +0 -9
- package/src/composables/use-overlay.ts +0 -10
- package/src/style.ts +0 -2
- package/src/types/action.ts +0 -5
- package/src/types/ai-button.ts +0 -4
- package/src/types/alert.ts +1 -8
- package/src/types/anchor.ts +0 -10
- package/src/types/animation.ts +0 -4
- package/src/types/auto-complete.ts +0 -6
- package/src/types/avatar.ts +1 -6
- package/src/types/back-top.ts +0 -3
- package/src/types/badge.ts +0 -8
- package/src/types/batch-edit.ts +1 -29
- package/src/types/breadcrumb.ts +0 -6
- package/src/types/button.ts +0 -13
- package/src/types/calendar.ts +0 -11
- package/src/types/card.ts +0 -6
- package/src/types/carousel.ts +3 -5
- package/src/types/cascade.ts +0 -21
- package/src/types/check-tag.ts +0 -3
- package/src/types/checkbox-group.ts +0 -8
- package/src/types/checkbox.ts +0 -7
- package/src/types/chip-group.ts +0 -8
- package/src/types/chip.ts +0 -6
- package/src/types/code-editor.ts +0 -3
- package/src/types/collapse.ts +0 -6
- package/src/types/condition-editor.ts +0 -4
- package/src/types/contextmenu.ts +0 -14
- package/src/types/css-transition.ts +0 -16
- package/src/types/date-picker.ts +0 -9
- package/src/types/date-range-picker.ts +0 -10
- package/src/types/descriptions.ts +1 -4
- package/src/types/dialog.ts +0 -11
- package/src/types/divider.ts +2 -4
- package/src/types/drawer.ts +0 -8
- package/src/types/dropdown.ts +1 -27
- package/src/types/dual-nav.ts +0 -7
- package/src/types/empty.ts +0 -4
- package/src/types/expression-editor.ts +0 -6
- package/src/types/file-picker.ts +0 -7
- package/src/types/file-viewer.ts +1 -7
- package/src/types/float-button.ts +0 -8
- package/src/types/form-item.ts +0 -5
- package/src/types/form.ts +0 -7
- package/src/types/gantt-chart.ts +0 -3
- package/src/types/grid-input.ts +0 -5
- package/src/types/grid.ts +0 -17
- package/src/types/group-input.ts +0 -7
- package/src/types/group-nav.ts +0 -4
- package/src/types/icon.ts +0 -3
- package/src/types/image-cropper.ts +0 -13
- package/src/types/image-previewer.ts +0 -5
- package/src/types/index.ts +0 -3
- package/src/types/input.ts +0 -14
- package/src/types/kanban.ts +0 -12
- package/src/types/layout.ts +0 -6
- package/src/types/loading.ts +0 -4
- package/src/types/message-confirm.ts +0 -21
- package/src/types/message.ts +0 -20
- package/src/types/multi-auto-complete.ts +0 -3
- package/src/types/multi-select.ts +0 -17
- package/src/types/multi-tree-select.ts +0 -13
- package/src/types/nav.ts +0 -14
- package/src/types/node-render.ts +0 -2
- package/src/types/notification.ts +0 -25
- package/src/types/number-input.ts +0 -10
- package/src/types/number-range-input.ts +0 -6
- package/src/types/number.ts +0 -10
- package/src/types/paginator.ts +0 -9
- package/src/types/palette.ts +1 -6
- package/src/types/password-input.ts +0 -3
- package/src/types/pop-confirm.ts +0 -14
- package/src/types/pop.ts +0 -3
- package/src/types/progress.ts +0 -6
- package/src/types/quick-batch-edit.ts +0 -3
- package/src/types/radio-group.ts +0 -12
- package/src/types/radio.ts +0 -7
- package/src/types/rate.ts +0 -5
- package/src/types/rich-text-editor.ts +0 -8
- package/src/types/scroll.ts +0 -19
- package/src/types/segment.ts +0 -12
- package/src/types/select.ts +0 -11
- package/src/types/skeleton.ts +6 -8
- package/src/types/slider.ts +0 -7
- package/src/types/space.ts +2 -4
- package/src/types/steps.ts +6 -21
- package/src/types/switch.ts +0 -6
- package/src/types/table-editor.ts +0 -4
- package/src/types/table.ts +0 -64
- package/src/types/tabs.ts +0 -30
- package/src/types/tag.ts +0 -5
- package/src/types/text-editor.ts +0 -3
- package/src/types/text.ts +0 -7
- package/src/types/textarea.ts +0 -42
- package/src/types/theme.ts +0 -6
- package/src/types/time-picker.ts +0 -10
- package/src/types/timeline.ts +0 -4
- package/src/types/tip.ts +0 -21
- package/src/types/tree-select.ts +0 -12
- package/src/types/tree.ts +0 -29
- package/src/types/watermark.ts +0 -7
- package/dist/components/list/list-item.js +0 -17
- package/dist/components/list/list-item.js.map +0 -1
- package/dist/components/list/list.js +0 -35
- package/dist/components/list/list.js.map +0 -1
- package/dist/components/list/style.d.ts +0 -1
- package/dist/components/list/style.js +0 -2
- package/dist/components/list/style2.css +0 -35
- package/dist/components/progress-nodes/progress-nodes.js +0 -137
- package/dist/components/progress-nodes/progress-nodes.js.map +0 -1
- package/dist/components/progress-nodes/style.d.ts +0 -1
- package/dist/components/progress-nodes/style.js +0 -1
- package/dist/components/progress-nodes/style2.css +0 -207
- package/dist/components/transfer/style.d.ts +0 -1
- package/dist/components/transfer/style.js +0 -4
- package/dist/components/transfer/style2.css +0 -192
- package/dist/components/transfer/transfer-list.js +0 -104
- package/dist/components/transfer/transfer-list.js.map +0 -1
- package/dist/components/transfer/transfer.js +0 -138
- package/dist/components/transfer/transfer.js.map +0 -1
- package/dist/types/list.d.ts +0 -10
- package/dist/types/progress-nodes.d.ts +0 -30
- package/dist/types/transfer.d.ts +0 -35
- package/src/components/list/index.ts +0 -3
- package/src/components/list/list-item.vue +0 -14
- package/src/components/list/list.vue +0 -23
- package/src/components/list/style.scss +0 -16
- package/src/components/list/style.ts +0 -2
- package/src/components/progress-nodes/index.ts +0 -1
- package/src/components/progress-nodes/progress-nodes.vue +0 -146
- package/src/components/progress-nodes/style.scss +0 -180
- package/src/components/progress-nodes/style.ts +0 -1
- package/src/components/theme/di.ts +0 -4
- package/src/components/theme/group-item.vue +0 -22
- package/src/components/theme/group.vue +0 -22
- package/src/components/transfer/index.ts +0 -1
- package/src/components/transfer/style.scss +0 -165
- package/src/components/transfer/style.ts +0 -4
- package/src/components/transfer/transfer-list.vue +0 -124
- package/src/components/transfer/transfer.vue +0 -135
- package/src/types/list.ts +0 -13
- package/src/types/progress-nodes.ts +0 -33
- package/src/types/transfer.ts +0 -45
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Decoration, EditorView, ViewPlugin, getDialog, getPanel, runScopeHandlers, showDialog, showPanel } from "../../../../../@codemirror_view@6.43.14/node_modules/@codemirror/view/dist/index.js";
|
|
1
2
|
import { CharCategory, EditorSelection, EditorState, Facet, Prec, RangeSetBuilder, StateEffect, StateField, codePointAt, codePointSize, combineConfig, findClusterBreak, fromCodePoint } from "../../../../../@codemirror_state@6.7.6/node_modules/@codemirror/state/dist/index.js";
|
|
2
3
|
import crelt from "../../../../../crelt@1.0.7/node_modules/crelt/index.js";
|
|
3
|
-
import { Decoration, EditorView, ViewPlugin, getDialog, getPanel, runScopeHandlers, showDialog, showPanel } from "../../../../../@codemirror_view@6.43.14/node_modules/@codemirror/view/dist/index.js";
|
|
4
4
|
// ../../node_modules/.bun/@codemirror+search@6.7.2/node_modules/@codemirror/search/dist/index.js
|
|
5
5
|
const basicNormalize = typeof String.prototype.normalize == "function" ? (x) => x.normalize("NFKD") : (x) => x;
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EditorView } from "../../../../../@codemirror_view@6.43.14/node_modules/@codemirror/view/dist/index.js";
|
|
2
|
-
import { tags } from "../../../../../@lezer_highlight@1.2.5/node_modules/@lezer/highlight/dist/index.js";
|
|
3
2
|
import { HighlightStyle, syntaxHighlighting } from "../../../../../@codemirror_language@6.13.1/node_modules/@codemirror/language/dist/index.js";
|
|
3
|
+
import { tags } from "../../../../../@lezer_highlight@1.2.5/node_modules/@lezer/highlight/dist/index.js";
|
|
4
4
|
// ../../node_modules/.bun/@codemirror+theme-one-dark@6.1.3/node_modules/@codemirror/theme-one-dark/dist/index.js
|
|
5
5
|
const chalky = "#e5c07b";
|
|
6
6
|
const coral = "#e06c75";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { styleTags, tags } from "../../../../../@lezer_highlight@1.2.5/node_modules/@lezer/highlight/dist/index.js";
|
|
2
1
|
import { ExternalTokenizer, LRParser, LocalTokenGroup } from "../../../../../@lezer_lr@1.4.11/node_modules/@lezer/lr/dist/index.js";
|
|
2
|
+
import { styleTags, tags } from "../../../../../@lezer_highlight@1.2.5/node_modules/@lezer/highlight/dist/index.js";
|
|
3
3
|
// ../../node_modules/.bun/@lezer+css@1.3.9/node_modules/@lezer/css/dist/index.js
|
|
4
4
|
const descendantOp = 148;
|
|
5
5
|
const Unit = 1;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { parseMixed } from "../../../../../@lezer_common@1.5.4/node_modules/@lezer/common/dist/index.js";
|
|
2
|
-
import { styleTags, tags } from "../../../../../@lezer_highlight@1.2.5/node_modules/@lezer/highlight/dist/index.js";
|
|
3
1
|
import { ContextTracker, ExternalTokenizer, LRParser } from "../../../../../@lezer_lr@1.4.11/node_modules/@lezer/lr/dist/index.js";
|
|
2
|
+
import { styleTags, tags } from "../../../../../@lezer_highlight@1.2.5/node_modules/@lezer/highlight/dist/index.js";
|
|
3
|
+
import { parseMixed } from "../../../../../@lezer_common@1.5.4/node_modules/@lezer/common/dist/index.js";
|
|
4
4
|
// ../../node_modules/.bun/@lezer+html@1.3.13/node_modules/@lezer/html/dist/index.js
|
|
5
5
|
const scriptText = 55;
|
|
6
6
|
const StartCloseScriptTag = 1;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { styleTags, tags } from "../../../../../@lezer_highlight@1.2.5/node_modules/@lezer/highlight/dist/index.js";
|
|
2
1
|
import { LRParser } from "../../../../../@lezer_lr@1.4.11/node_modules/@lezer/lr/dist/index.js";
|
|
2
|
+
import { styleTags, tags } from "../../../../../@lezer_highlight@1.2.5/node_modules/@lezer/highlight/dist/index.js";
|
|
3
3
|
// ../../node_modules/.bun/@lezer+java@1.1.5/node_modules/@lezer/java/dist/index.js
|
|
4
4
|
const javaHighlighting = styleTags({
|
|
5
5
|
null: tags.null,
|
package/dist/node_modules/.bun/@lezer_javascript@1.5.6/node_modules/@lezer/javascript/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { styleTags, tags } from "../../../../../@lezer_highlight@1.2.5/node_modules/@lezer/highlight/dist/index.js";
|
|
2
1
|
import { ContextTracker, ExternalTokenizer, LRParser, LocalTokenGroup } from "../../../../../@lezer_lr@1.4.11/node_modules/@lezer/lr/dist/index.js";
|
|
2
|
+
import { styleTags, tags } from "../../../../../@lezer_highlight@1.2.5/node_modules/@lezer/highlight/dist/index.js";
|
|
3
3
|
// ../../node_modules/.bun/@lezer+javascript@1.5.6/node_modules/@lezer/javascript/dist/index.js
|
|
4
4
|
const noSemi = 317;
|
|
5
5
|
const noSemiType = 318;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { styleTags, tags } from "../../../../../@lezer_highlight@1.2.5/node_modules/@lezer/highlight/dist/index.js";
|
|
2
1
|
import { LRParser } from "../../../../../@lezer_lr@1.4.11/node_modules/@lezer/lr/dist/index.js";
|
|
2
|
+
import { styleTags, tags } from "../../../../../@lezer_highlight@1.2.5/node_modules/@lezer/highlight/dist/index.js";
|
|
3
3
|
// ../../node_modules/.bun/@lezer+json@1.0.3/node_modules/@lezer/json/dist/index.js
|
|
4
4
|
const jsonHighlighting = styleTags({
|
|
5
5
|
String: tags.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ctm.js","names":[],"sources":["../../../../../ofd-core/dist/ctm.js"],"sourcesContent":["// src/ctm.ts\
|
|
1
|
+
{"version":3,"file":"ctm.js","names":[],"sources":["../../../../../ofd-core/dist/ctm.js"],"sourcesContent":["// src/ctm.ts\nconst IDENTITY_MATRIX = [\n\t1,\n\t0,\n\t0,\n\t1,\n\t0,\n\t0\n];\n/** 矩阵乘法:`multiplyMatrix(outer, inner)` 等价于先 inner 后 outer */\nfunction multiplyMatrix(outer, inner) {\n\tconst [a1, b1, c1, d1, e1, f1] = outer;\n\tconst [a2, b2, c2, d2, e2, f2] = inner;\n\treturn [\n\t\ta1 * a2 + c1 * b2,\n\t\tb1 * a2 + d1 * b2,\n\t\ta1 * c2 + c1 * d2,\n\t\tb1 * c2 + d1 * d2,\n\t\ta1 * e2 + c1 * f2 + e1,\n\t\tb1 * e2 + d1 * f2 + f1\n\t];\n}\n/** 解析 `CTM` 属性;缺失或不合法返回 null(渲染时按单位矩阵处理) */\nfunction parseMatrix(value) {\n\tconst numbers = parseNumberList(value);\n\treturn numbers.length === 6 ? [\n\t\tnumbers[0],\n\t\tnumbers[1],\n\t\tnumbers[2],\n\t\tnumbers[3],\n\t\tnumbers[4],\n\t\tnumbers[5]\n\t] : null;\n}\n/** 解析 `Boundary=\"x y w h\"` 属性;缺失或不完整返回 null */\nfunction parseBoundary(value) {\n\tconst numbers = parseNumberList(value);\n\tif (numbers.length !== 4) return null;\n\treturn {\n\t\tx: numbers[0],\n\t\ty: numbers[1],\n\t\twidth: numbers[2],\n\t\theight: numbers[3]\n\t};\n}\n/** 按空白或逗号切分数值列表(CTM / Boundary / DeltaX / DashPattern 共用) */\nfunction parseNumberList(value) {\n\tif (!value) return [];\n\treturn value.trim().split(/[\\s,]+/).filter((token) => token !== \"\").map((token) => Number(token)).filter((number) => Number.isFinite(number));\n}\nexport { IDENTITY_MATRIX, multiplyMatrix, parseBoundary, parseMatrix, parseNumberList };\n\n//# sourceMappingURL=ctm.js.map"],"mappings":";AACA,MAAM,kBAAkB;CACvB;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,SAAS,eAAe,OAAO,OAAO;CACrC,MAAM,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,MAAM;CACjC,MAAM,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,MAAM;CACjC,OAAO;EACN,KAAK,KAAK,KAAK;EACf,KAAK,KAAK,KAAK;EACf,KAAK,KAAK,KAAK;EACf,KAAK,KAAK,KAAK;EACf,KAAK,KAAK,KAAK,KAAK;EACpB,KAAK,KAAK,KAAK,KAAK;CACrB;AACD;;AAEA,SAAS,YAAY,OAAO;CAC3B,MAAM,UAAU,gBAAgB,KAAK;CACrC,OAAO,QAAQ,WAAW,IAAI;EAC7B,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;CACT,IAAI;AACL;;AAEA,SAAS,cAAc,OAAO;CAC7B,MAAM,UAAU,gBAAgB,KAAK;CACrC,IAAI,QAAQ,WAAW,GAAG,OAAO;CACjC,OAAO;EACN,GAAG,QAAQ;EACX,GAAG,QAAQ;EACX,OAAO,QAAQ;EACf,QAAQ,QAAQ;CACjB;AACD;;AAEA,SAAS,gBAAgB,OAAO;CAC/B,IAAI,CAAC,OAAO,OAAO,CAAC;CACpB,OAAO,MAAM,KAAK,CAAC,CAAC,MAAM,QAAQ,CAAC,CAAC,QAAQ,UAAU,UAAU,EAAE,CAAC,CAAC,KAAK,UAAU,OAAO,KAAK,CAAC,CAAC,CAAC,QAAQ,WAAW,OAAO,SAAS,MAAM,CAAC;AAC7I"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OfdParseError } from "./error.js";
|
|
2
|
-
import { openOfdZip } from "./zip.js";
|
|
3
1
|
import { parseOfd, parseOfdContainer } from "./parse.js";
|
|
4
|
-
import { glyphPathD, parseEmbeddedFont } from "./font.js";
|
|
5
2
|
import { pageToSvg } from "./render.js";
|
|
3
|
+
import { glyphPathD, parseEmbeddedFont } from "./font.js";
|
|
4
|
+
import { openOfdZip } from "./zip.js";
|
|
5
|
+
import { OfdParseError } from "./error.js";
|
|
6
6
|
export { OfdParseError, glyphPathD, openOfdZip, pageToSvg, parseEmbeddedFont, parseOfd, parseOfdContainer };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { parseBoundary, parseMatrix, parseNumberList } from "./ctm.js";
|
|
2
1
|
import { parseOfdColor } from "./color.js";
|
|
2
|
+
import { parseBoundary, parseMatrix, parseNumberList } from "./ctm.js";
|
|
3
3
|
import { childElements, childrenNamed, firstChildNamed, localNameOf, parseLayerType, parseXml, rootElementOf } from "./xml.js";
|
|
4
4
|
// ../ofd-core/dist/page-objects.js
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-objects.js","names":[],"sources":["../../../../../ofd-core/dist/page-objects.js"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"page-objects.js","names":[],"sources":["../../../../../ofd-core/dist/page-objects.js"],"sourcesContent":["import { parseOfdColor } from \"./color.js\";\nimport { parseBoundary, parseMatrix, parseNumberList } from \"./ctm.js\";\nimport { childElements, childrenNamed, firstChildNamed, localNameOf, parseLayerType, parseXml, rootElementOf } from \"./xml.js\";\n// src/page-objects.ts\n/**\n* Page.xml 内容对象模型:图层内的文本 / 图片 / 路径 / 复合对象。\n*\n* 与 P1 的 OfdPage(图层声明)分离:渲染按页懒执行,这里在渲染前按需解析,\n* 使页与页相互独立、未渲染页不产生解析开销。\n*/\n/** 页面内容文件根元素:普通页为 Page,模板页内容也有产出写作 TemplatePage */\nconst PAGE_ROOT_NAMES = [\"Page\", \"TemplatePage\"];\n/** 解析页 / 模板页内容的图元对象;未知对象类型跳过 */\nfunction parsePageContent(xml, source) {\n\tconst root = rootElementOf(parseXml(xml, source), PAGE_ROOT_NAMES, source);\n\tconst layerParent = firstChildNamed(root, \"Content\") ?? root;\n\tconst layers = [];\n\tconst objectsById = /* @__PURE__ */ new Map();\n\tfor (const layer of childrenNamed(layerParent, \"Layer\")) {\n\t\tconst objects = [];\n\t\tcollectLayerObjects(layer, objects, objectsById);\n\t\tlayers.push({\n\t\t\ttype: parseLayerType(layer.getAttribute(\"Type\")),\n\t\t\tdrawParamId: layer.getAttribute(\"DrawParam\"),\n\t\t\tobjects\n\t\t});\n\t}\n\treturn {\n\t\tlayers,\n\t\tobjectsById,\n\t\ttemplateRefs: childrenNamed(root, \"Template\").map(parseTemplateRef)\n\t};\n}\n/**\n* 图层内对象收集:PageBlock 是纯分组容器(新版数电票正文层实证,自身无\n* Boundary/CTM),递归扁平化不改变成员对象坐标。\n*/\nfunction collectLayerObjects(container, out, objectsById) {\n\tfor (const element of childElements(container)) {\n\t\tif (localNameOf(element) === \"PageBlock\") {\n\t\t\tcollectLayerObjects(element, out, objectsById);\n\t\t\tcontinue;\n\t\t}\n\t\tconst object = parsePageObject(element);\n\t\tif (!object) continue;\n\t\tif (object.id) objectsById.set(object.id, object);\n\t\tout.push(object);\n\t}\n}\n/** 解析 Template 引用:TemplateID 取声明 ID,ZOrder 缺省按背景叠加 */\nfunction parseTemplateRef(element) {\n\tconst stackedForeground = element.getAttribute(\"ZOrder\")?.toLowerCase() === \"foreground\";\n\treturn {\n\t\ttemplateId: element.getAttribute(\"TemplateID\"),\n\t\tzOrder: stackedForeground ? \"foreground\" : \"background\"\n\t};\n}\nfunction parsePageObject(element) {\n\tconst base = {\n\t\tid: element.getAttribute(\"ID\"),\n\t\tboundary: parseBoundary(element.getAttribute(\"Boundary\")),\n\t\tctm: parseMatrix(element.getAttribute(\"CTM\")),\n\t\tdrawParamId: element.getAttribute(\"DrawParam\")\n\t};\n\tswitch (localNameOf(element)) {\n\t\tcase \"TextObject\": return {\n\t\t\t...base,\n\t\t\tkind: \"text\",\n\t\t\tfontId: element.getAttribute(\"FontID\") ?? element.getAttribute(\"Font\"),\n\t\t\tfontSize: parseNumber(element.getAttribute(\"FontSize\") ?? element.getAttribute(\"Size\")),\n\t\t\tfillColor: objectColor(element, \"FillColor\"),\n\t\t\tcodes: childrenNamed(element, \"TextCode\").map(parseTextCode),\n\t\t\tglyphSubstitutions: childrenNamed(element, \"CGTransform\").map(parseGlyphSubstitution)\n\t\t};\n\t\tcase \"ImageObject\": return {\n\t\t\t...base,\n\t\t\tkind: \"image\",\n\t\t\tresourceId: element.getAttribute(\"ResourceID\")\n\t\t};\n\t\tcase \"PathObject\": return {\n\t\t\t...base,\n\t\t\tkind: \"path\",\n\t\t\tfill: element.getAttribute(\"Fill\") === \"true\",\n\t\t\tfillColor: objectColor(element, \"FillColor\"),\n\t\t\tstrokeColor: objectColor(element, \"StrokeColor\"),\n\t\t\tlineWidth: parseNumber(element.getAttribute(\"LineWidth\")),\n\t\t\tdashPattern: parseNumberList(element.getAttribute(\"DashPattern\")),\n\t\t\tcommands: parsePathCommands(firstChildNamed(element, \"AbbreviatedData\")?.textContent ?? null)\n\t\t};\n\t\tcase \"CompositeObject\": return {\n\t\t\t...base,\n\t\t\tkind: \"composite\",\n\t\t\treferenceId: element.getAttribute(\"ReferenceID\")\n\t\t};\n\t\tdefault: return null;\n\t}\n}\n/**\n* 对象颜色声明兼容两种形式:属性 `FillColor=\"128 0 0\"` 与子元素\n* `<FillColor Value=\"128 0 0\"/>`(新版数电票实证为子元素形式)。\n*/\nfunction objectColor(element, name) {\n\treturn parseOfdColor(element.getAttribute(name) ?? firstChildNamed(element, name)?.getAttribute(\"Value\") ?? null);\n}\n/** 解析 CGTransform:Glyphs 支持 ST_Array 的 `g n v` 压缩写法 */\nfunction parseGlyphSubstitution(element) {\n\treturn {\n\t\tcodePosition: parseNumber(element.getAttribute(\"CodePosition\")) ?? 0,\n\t\tcodeCount: parseNumber(element.getAttribute(\"CodeCount\")) ?? 0,\n\t\tglyphIds: parseDeltaList(firstChildNamed(element, \"Glyphs\")?.textContent ?? null)\n\t};\n}\nfunction parseTextCode(code) {\n\treturn {\n\t\tx: parseNumber(code.getAttribute(\"X\")),\n\t\ty: parseNumber(code.getAttribute(\"Y\")),\n\t\tdeltaX: parseDeltaList(code.getAttribute(\"DeltaX\")),\n\t\tdeltaY: parseDeltaList(code.getAttribute(\"DeltaY\")),\n\t\ttext: code.textContent ?? \"\"\n\t};\n}\n/**\n* 解析 TextCode 位移数组:数值按序对应相邻字符位移;`g n v` 是 ST_Array 的\n* 压缩写法(数电发票实证),表示 n 个连续位移均为 v。\n*/\nfunction parseDeltaList(value) {\n\tconst tokens = value?.trim().split(/[\\s,]+/).filter((token) => token !== \"\") ?? [];\n\tconst deltas = [];\n\tfor (let index = 0; index < tokens.length;) {\n\t\tif (tokens[index] === \"g\") {\n\t\t\tconst count = Number(tokens[index + 1]);\n\t\t\tconst repeated = Number(tokens[index + 2]);\n\t\t\tif (Number.isInteger(count) && count > 0 && Number.isFinite(repeated)) {\n\t\t\t\tfor (let repeat = 0; repeat < count; repeat++) deltas.push(repeated);\n\t\t\t\tindex += 3;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tindex += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tconst delta = Number(tokens[index]);\n\t\tif (Number.isFinite(delta)) deltas.push(delta);\n\t\tindex += 1;\n\t}\n\treturn deltas;\n}\nconst PATH_ARITY = {\n\tM: 2,\n\tL: 2,\n\tC: 6,\n\tB: 4,\n\tQ: 4,\n\tZ: 0\n};\nfunction parsePathCommands(data) {\n\tconst tokens = data?.trim().split(/[\\s,]+/).filter((token) => token !== \"\") ?? [];\n\tconst commands = [];\n\tfor (let index = 0; index < tokens.length;) {\n\t\tconst type = tokens[index].toUpperCase();\n\t\tconst arity = PATH_ARITY[type];\n\t\tif (arity === void 0) {\n\t\t\tindex += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tconst points = tokens.slice(index + 1, index + 1 + arity).map(Number);\n\t\tif (points.length === arity && points.every((point) => Number.isFinite(point))) commands.push({\n\t\t\ttype,\n\t\t\tpoints\n\t\t});\n\t\tindex += 1 + arity;\n\t}\n\treturn commands;\n}\nfunction parseNumber(value) {\n\tconst numbers = parseNumberList(value);\n\treturn numbers.length > 0 ? numbers[0] : null;\n}\nexport { parsePageContent };\n\n//# sourceMappingURL=page-objects.js.map"],"mappings":";;;;;;;;;;;AAWA,MAAM,kBAAkB,CAAC,QAAQ,cAAc;;AAE/C,SAAS,iBAAiB,KAAK,QAAQ;CACtC,MAAM,OAAO,cAAc,SAAS,KAAK,MAAM,GAAG,iBAAiB,MAAM;CACzE,MAAM,cAAc,gBAAgB,MAAM,SAAS,KAAK;CACxD,MAAM,SAAS,CAAC;CAChB,MAAM,8BAA8B,IAAI,IAAI;CAC5C,KAAK,MAAM,SAAS,cAAc,aAAa,OAAO,GAAG;EACxD,MAAM,UAAU,CAAC;EACjB,oBAAoB,OAAO,SAAS,WAAW;EAC/C,OAAO,KAAK;GACX,MAAM,eAAe,MAAM,aAAa,MAAM,CAAC;GAC/C,aAAa,MAAM,aAAa,WAAW;GAC3C;EACD,CAAC;CACF;CACA,OAAO;EACN;EACA;EACA,cAAc,cAAc,MAAM,UAAU,CAAC,CAAC,IAAI,gBAAgB;CACnE;AACD;;;;;AAKA,SAAS,oBAAoB,WAAW,KAAK,aAAa;CACzD,KAAK,MAAM,WAAW,cAAc,SAAS,GAAG;EAC/C,IAAI,YAAY,OAAO,MAAM,aAAa;GACzC,oBAAoB,SAAS,KAAK,WAAW;GAC7C;EACD;EACA,MAAM,SAAS,gBAAgB,OAAO;EACtC,IAAI,CAAC,QAAQ;EACb,IAAI,OAAO,IAAI,YAAY,IAAI,OAAO,IAAI,MAAM;EAChD,IAAI,KAAK,MAAM;CAChB;AACD;;AAE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;AACR;AACA,MAAM,aAAa;CAClB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACJ;AACA,SAAS,kBAAkB,MAAM;CAChC,MAAM,SAAS,MAAM,KAAK,CAAC,CAAC,MAAM,QAAQ,CAAC,CAAC,QAAQ,UAAU,UAAU,EAAE,KAAK,CAAC;CAChF,MAAM,WAAW,CAAC;CAClB,KAAK,IAAI,QAAQ,GAAG,QAAQ,OAAO,SAAS;EAC3C,MAAM,OAAO,OAAO,MAAM,CAAC,YAAY;EACvC,MAAM,QAAQ,WAAW;EACzB,IAAI,UAAU,KAAK,GAAG;GACrB,SAAS;GACT;EACD;EACA,MAAM,SAAS,OAAO,MAAM,QAAQ,GAAG,QAAQ,IAAI,KAAK,CAAC,CAAC,IAAI,MAAM;EACpE,IAAI,OAAO,WAAW,SAAS,OAAO,OAAO,UAAU,OAAO,SAAS,KAAK,CAAC,GAAG,SAAS,KAAK;GAC7F;GACA;EACD,CAAC;EACD,SAAS,IAAI;CACd;CACA,OAAO;AACR;AACA,SAAS,YAAY,OAAO;CAC3B,MAAM,UAAU,gBAAgB,KAAK;CACrC,OAAO,QAAQ,SAAS,IAAI,QAAQ,KAAK;AAC1C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OfdParseError } from "./error.js";
|
|
2
|
-
import { openOfdZip } from "./zip.js";
|
|
3
2
|
import { joinZipPath, parseDocumentRes, parseDocumentXml, parseOfdRoot, parsePageXml } from "./xml.js";
|
|
3
|
+
import { openOfdZip } from "./zip.js";
|
|
4
4
|
// ../ofd-core/dist/parse.js
|
|
5
5
|
/** 解析 OFD 文件字节:解包 ZIP 容器并解析全部文档的页面模型 */
|
|
6
6
|
async function parseOfd(data) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { OfdParseError } from "./error.js";
|
|
2
1
|
import { IDENTITY_MATRIX, multiplyMatrix } from "./ctm.js";
|
|
2
|
+
import { OfdParseError } from "./error.js";
|
|
3
3
|
import { joinZipPath } from "./xml.js";
|
|
4
|
-
import { resolveContentLocation } from "./parse.js";
|
|
5
|
-
import { formatNumber, roundTo } from "./number.js";
|
|
6
4
|
import { glyphPathD, parseEmbeddedFont } from "./font.js";
|
|
5
|
+
import { formatNumber, roundTo } from "./number.js";
|
|
7
6
|
import { parsePageContent } from "./page-objects.js";
|
|
7
|
+
import { resolveContentLocation } from "./parse.js";
|
|
8
8
|
// ../ofd-core/dist/render.js
|
|
9
9
|
/**
|
|
10
10
|
* 逐页 SVG 输出(P2 渲染内核出口)。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","names":[],"sources":["../../../../../ofd-core/dist/render.js"],"sourcesContent":["import { OfdParseError } from \"./error.js\";\nimport { IDENTITY_MATRIX, multiplyMatrix } from \"./ctm.js\";\nimport { joinZipPath } from \"./xml.js\";\nimport { resolveContentLocation } from \"./parse.js\";\nimport { formatNumber, roundTo } from \"./number.js\";\nimport { glyphPathD, parseEmbeddedFont } from \"./font.js\";\nimport { parsePageContent } from \"./page-objects.js\";\n// src/render.ts\n/**\n* 逐页 SVG 输出(P2 渲染内核出口)。\n*\n* 页面物理尺寸按 OFD 毫米 → CSS 像素换算(96dpi),内容坐标系保持 OFD 原始\n* 毫米单位(通过 viewBox 缩放),坐标与文档声明一一对应,便于断言与调试。\n* 页与页相互独立、可单独调用,供上层做懒渲染 / 虚拟滚动。\n*/\n/** CSS 约定 96px = 1in = 25.4mm */\nconst PX_PER_MM = 96 / 25.4;\n/** 对象未声明填充色时的默认色(GB/T 33190 未声明时文字按黑色呈现,Fill 路径同) */\nconst DEFAULT_FILL = \"#000\";\n/** 输出指定文档指定页的完整 SVG 字符串 */\nasync function pageToSvg(zip, container, documentIndex, pageIndex) {\n\tconst doc = container.docs[documentIndex];\n\tif (!doc) throw new OfdParseError(\"out-of-range\", `文档序号 ${documentIndex} 超出范围(容器共 ${container.docs.length} 个文档)`);\n\tconst page = doc.pages[pageIndex];\n\tif (!page) throw new OfdParseError(\"out-of-range\", `页序号 ${pageIndex} 超出范围(文档 ${documentIndex} 共 ${doc.pages.length} 页)`);\n\tconst content = parsePageContent(await zip.text(page.location), page.location);\n\tconst size = page.size ?? doc.pageSize ?? {\n\t\twidth: 210,\n\t\theight: 297\n\t};\n\tconst context = {\n\t\tzip,\n\t\tdoc,\n\t\tfonts: /* @__PURE__ */ new Map(),\n\t\ttemplateContents: /* @__PURE__ */ new Map()\n\t};\n\tconst renderedTemplates = await Promise.all(content.templateRefs.map((ref) => renderTemplateRef(ref, context, [content.objectsById], /* @__PURE__ */ new Set())));\n\tconst background = [];\n\tconst foreground = [];\n\tconst templateFrames = [];\n\tfor (const rendered of renderedTemplates) {\n\t\tif (rendered.background !== \"\") background.push(rendered.background);\n\t\tif (rendered.foreground !== \"\") foreground.push(rendered.foreground);\n\t\ttemplateFrames.push(rendered.frames);\n\t}\n\tconst pageFrames = [content.objectsById, ...templateFrames.flat()];\n\tconst layers = await Promise.all(content.layers.map((layer) => renderLayer(layer, context, pageFrames)));\n\treturn `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"${formatNumber(roundTo(size.width * PX_PER_MM, 2))}px\" height=\"${formatNumber(roundTo(size.height * PX_PER_MM, 2))}px\" viewBox=\"0 0 ${formatNumber(size.width)} ${formatNumber(size.height)}\">${background.join(\"\")}${layers.join(\"\")}${foreground.join(\"\")}</svg>`;\n}\n/** 渲染单个图层:对象按声明顺序叠加,空图层不输出外壳 */\nasync function renderLayer(layer, context, frames) {\n\tconst rendered = (await Promise.all(layer.objects.map((object) => renderObject(object, IDENTITY_MATRIX, null, context, /* @__PURE__ */ new Set(), {\n\t\tframes,\n\t\tdrawParamId: layer.drawParamId\n\t})))).join(\"\");\n\tif (rendered === \"\") return \"\";\n\treturn `<g${layer.type === null ? \"\" : ` data-ofd-layer=\"${layer.type}\"`}>${rendered}</g>`;\n}\n/**\n* 按引用渲染一个模板页:自身引用的模板先于其内容(背景)或后于其内容(前景)\n* 展开,与页面同规则;以内容文件路径判环,递归引用直接断开。\n*/\nasync function renderTemplateRef(ref, context, outerFrames, visiting) {\n\tconst baseLocation = (ref.templateId === null ? void 0 : context.doc.templates.find((template) => template.id === ref.templateId))?.location ?? null;\n\tif (baseLocation === null) return {\n\t\tbackground: \"\",\n\t\tforeground: \"\",\n\t\tframes: []\n\t};\n\tconst location = resolveContentLocation(context.doc.dir, baseLocation);\n\tif (visiting.has(location)) return {\n\t\tbackground: \"\",\n\t\tforeground: \"\",\n\t\tframes: []\n\t};\n\tconst content = await loadTemplateContent(context, location);\n\tconst frames = [content.objectsById, ...outerFrames];\n\tconst nextVisiting = new Set(visiting).add(location);\n\tconst innerRendered = await Promise.all(content.templateRefs.map((innerRef) => renderTemplateRef(innerRef, context, frames, nextVisiting)));\n\tconst innerBackground = [];\n\tconst innerForeground = [];\n\tfor (const rendered of innerRendered) {\n\t\tinnerBackground.push(rendered.background);\n\t\tinnerForeground.push(rendered.foreground);\n\t}\n\tconst ownLayers = (await Promise.all(content.layers.map((layer) => renderLayer(layer, context, frames)))).join(\"\");\n\tconst bundle = innerBackground.join(\"\") + ownLayers + innerForeground.join(\"\");\n\treturn ref.zOrder === \"foreground\" ? {\n\t\tbackground: \"\",\n\t\tforeground: bundle,\n\t\tframes\n\t} : {\n\t\tbackground: bundle,\n\t\tforeground: \"\",\n\t\tframes\n\t};\n}\n/** 加载并解析模板页内容;同一页内重复或递归引用复用解析结果 */\nasync function loadTemplateContent(context, location) {\n\tconst cached = context.templateContents.get(location);\n\tif (cached) return cached;\n\tconst content = parsePageContent(await context.zip.text(location), location);\n\tcontext.templateContents.set(location, content);\n\treturn content;\n}\n/** 渲染单个对象:CTM 链 + Boundary 定位外壳,内容坐标相对 Boundary 原点 */\nasync function renderObject(object, parentCtm, boundaryOverride, context, visiting, scope) {\n\tif (object.id && visiting.has(object.id)) return \"\";\n\tconst ctm = object.ctm ? multiplyMatrix(parentCtm, object.ctm) : parentCtm;\n\tif (object.kind === \"composite\") return renderComposite(object, ctm, context, visiting, scope);\n\tconst boundary = boundaryOverride ?? object.boundary;\n\tconst inner = await renderContent(object, boundary, ctm, context, scope);\n\tif (inner === \"\") return \"\";\n\tconst transform = groupTransform(ctm, boundary);\n\treturn `<g${transform ? ` transform=\"${transform}\"` : \"\"}>${inner}</g>`;\n}\nasync function renderContent(object, boundary, ctm, context, scope) {\n\tswitch (object.kind) {\n\t\tcase \"text\": return renderText(object, context, scope);\n\t\tcase \"image\": return renderImage(object, boundary, ctm, context);\n\t\tcase \"path\": return renderPath(object, context, scope);\n\t}\n}\n/** 复合对象:递归渲染被引用对象,CTM 链向下继承,循环引用直接断开 */\nasync function renderComposite(object, parentCtm, context, visiting, scope) {\n\tconst referenced = findReferencedObject(object, scope);\n\tif (!referenced) return \"\";\n\tconst nextVisiting = new Set(visiting);\n\tif (object.id) nextVisiting.add(object.id);\n\treturn renderObject(referenced, parentCtm, object.boundary, context, nextVisiting, scope);\n}\n/** 复合对象引用查找:当前内容域优先,未命中再沿外层内容域兜底 */\nfunction findReferencedObject(object, scope) {\n\tif (object.referenceId === null) return void 0;\n\tfor (const frame of scope.frames) {\n\t\tconst referenced = frame.get(object.referenceId);\n\t\tif (referenced) return referenced;\n\t}\n}\n/** 文本渲染:声明内嵌字体(Font@FontFile)时按 glyph 轮廓输出 path,否则回退系统字体 text */\nasync function renderText(object, context, scope) {\n\tconst draw = resolveDrawAttributes(object.drawParamId ?? scope.drawParamId, context);\n\tconst fill = object.fillColor ?? draw.fillColor ?? DEFAULT_FILL;\n\tconst font = await loadEmbeddedFont(object.fontId, context);\n\tif (!font || object.fontSize === null) return renderSystemFontText(object, fill, context);\n\tconst fontSize = object.fontSize;\n\tconst parts = [];\n\tlet baseIndex = 0;\n\tfor (const code of object.codes) {\n\t\tconst part = textCodePathD(font, code, fontSize, object.glyphSubstitutions, baseIndex);\n\t\tif (part !== \"\") parts.push(part);\n\t\tbaseIndex += code.text.length;\n\t}\n\tconst d = parts.join(\" \");\n\tif (d === \"\") return object.codes.some((code) => code.text.length > 0) ? renderSystemFontText(object, fill, context) : \"\";\n\treturn `<path d=\"${d}\" fill=\"${fill}\"/>`;\n}\n/** 加载 TextObject@FontID 声明的内嵌 TTF;缺失或损坏返回 null(不阻断整页渲染) */\nasync function loadEmbeddedFont(fontId, context) {\n\tif (fontId === null) return null;\n\tconst cached = context.fonts.get(fontId);\n\tif (cached !== void 0) return cached;\n\tconst decl = context.doc.resources.fonts.find((font) => font.id === fontId);\n\tlet font = null;\n\tif (decl?.fontFile) try {\n\t\tfont = parseEmbeddedFont(await context.zip.read(joinZipPath(context.doc.dir, decl.fontFile)), decl.fontFile);\n\t} catch {\n\t\tfont = null;\n\t}\n\tcontext.fonts.set(fontId, font);\n\treturn font;\n}\n/**\n* 单个 TextCode 的 glyph 路径:从 X/Y 基线原点起笔逐字排布。\n* DeltaX/DeltaY 按标准是「相对前一个字符的位移」,声明时替代字形步进宽度。\n* 字形来源优先取 CGTransform 替换序号(子集字体无 cmap 时的唯一映射),\n* 其次 cmap 码点映射;两者都未命中时跳过该字符的轮廓、仅按位移推进。\n*/\nfunction textCodePathD(font, code, fontSize, substitutions, baseIndex) {\n\tconst scale = fontSize / font.unitsPerEm;\n\tconst parts = [];\n\tlet penX = code.x ?? 0;\n\tlet penY = code.y ?? 0;\n\tlet dxIndex = 0;\n\tlet dyIndex = 0;\n\tlet charIndex = 0;\n\tfor (const char of code.text) {\n\t\tconst gid = substitutedGlyphId(substitutions, baseIndex + charIndex) ?? font.glyphIndexOf(char.codePointAt(0));\n\t\tif (gid !== null) {\n\t\t\tconst d = glyphPathD(font, gid, fontSize, penX, penY);\n\t\t\tif (d !== \"\") parts.push(d);\n\t\t}\n\t\tconst deltaX = dxIndex < code.deltaX.length ? code.deltaX[dxIndex++] : null;\n\t\tpenX += deltaX ?? (gid !== null ? font.advanceWidth(gid) * scale : 0);\n\t\tconst deltaY = dyIndex < code.deltaY.length ? code.deltaY[dyIndex++] : null;\n\t\tpenY += deltaY ?? 0;\n\t\tcharIndex++;\n\t}\n\treturn parts.join(\" \");\n}\n/** 字形替换查找:字符落在声明区间时取 Glyphs 中对应序号,合字耗尽或未覆盖返回 null */\nfunction substitutedGlyphId(substitutions, charIndex) {\n\tfor (const substitution of substitutions) if (charIndex >= substitution.codePosition && charIndex < substitution.codePosition + substitution.codeCount) {\n\t\tconst offset = charIndex - substitution.codePosition;\n\t\treturn offset < substitution.glyphIds.length ? substitution.glyphIds[offset] : null;\n\t}\n\treturn null;\n}\n/** 无内嵌字体可用时的系统字体回退:保留 P2 的 text 输出与文字内容 */\nfunction renderSystemFontText(object, fill, context) {\n\tconst fontFamily = resolveFontFamily(object.fontId, context);\n\treturn object.codes.map((code) => {\n\t\treturn `<text ${[\n\t\t\t\"xml:space=\\\"preserve\\\"\",\n\t\t\tcodePositionAttr(\"x\", code.x, code.text.length, code.deltaX),\n\t\t\tcodePositionAttr(\"y\", code.y, code.text.length, code.deltaY),\n\t\t\tattr(\"font-size\", object.fontSize),\n\t\t\tfontFamily === null ? null : `font-family=\"${escapeXml(fontFamily)}\"`,\n\t\t\t`fill=\"${fill}\"`\n\t\t].filter((value) => value !== null).join(\" \")}>${escapeXml(code.text)}</text>`;\n\t}).join(\"\");\n}\n/**\n* TextCode 位移转 SVG 逐字符坐标:DeltaX/DeltaY 是相邻字符间的绝对步长\n* (替代字形自然步进),而 SVG 的 dx/dy 是在自然步进上的附加量,语义不同,\n* 这里换算成绝对坐标列表;位移未覆盖的字符交由自然排布。\n*/\nfunction codePositionAttr(name, start, charCount, deltas) {\n\tif (start === null && deltas.length === 0) return null;\n\tconst positions = [start ?? 0];\n\tconst covered = Math.min(charCount - 1, deltas.length);\n\tfor (let index = 0; index < covered; index++) positions.push(positions[index] + deltas[index]);\n\treturn positions.length === 1 ? `${name}=\"${formatNumber(positions[0])}\"` : `${name}=\"${positions.map(formatNumber).join(\" \")}\"`;\n}\nfunction resolveFontFamily(fontId, context) {\n\tif (!fontId) return null;\n\treturn context.doc.resources.fonts.find((font) => font.id === fontId)?.fontName ?? null;\n}\n/**\n* 图片:解析 MultiMedia 声明并读资源字节,缺资源或不可识别的媒体类型跳过(不阻断整页)。\n* Type 兼容标准单字母 'g' 与主流产出的 'Image' 拼写。\n*/\nasync function renderImage(object, boundary, ctm, context) {\n\tconst media = object.resourceId === null ? void 0 : context.doc.resources.medias.find((item) => item.id === object.resourceId);\n\tconst location = media?.location;\n\tconst type = media?.type?.toLowerCase();\n\tif (!location || type !== void 0 && type !== \"g\" && type !== \"image\") return \"\";\n\tlet bytes;\n\ttry {\n\t\tbytes = await context.zip.read(joinZipPath(context.doc.dir, location));\n\t} catch {\n\t\treturn \"\";\n\t}\n\tconst mime = sniffImageMime(bytes);\n\tif (!mime) return \"\";\n\tconst content = boundary === null ? null : imageContentSize(boundary, ctm);\n\treturn `<image${content === null ? \"\" : ` width=\"${formatNumber(content.width)}\" height=\"${formatNumber(content.height)}\"`} href=\"data:${mime};base64,${toBase64(bytes)}\"/>`;\n}\n/**\n* 图片内容盒尺寸:无缩放 CTM 时 Boundary 即内容盒;带缩放 CTM 的产出\n* (WPS / 新版数电发票实证)图片内容为 [0,1] 单位盒,尺寸与定位由 CTM 给出,\n* Boundary 只提供平移原点(WPS 写最终包围盒、数电票二维码写整页盒,均不参与定尺寸)。\n*/\nfunction imageContentSize(boundary, ctm) {\n\tif (!hasScaleComponent(ctm)) return {\n\t\twidth: boundary.width,\n\t\theight: boundary.height\n\t};\n\treturn {\n\t\twidth: 1,\n\t\theight: 1\n\t};\n}\n/** 按魔数识别可渲染的图片媒体类型;多帧格式(GIF/APNG)由展示端取首帧 */\nfunction sniffImageMime(bytes) {\n\tif (bytes.length >= 4 && bytes[0] === 137 && bytes[1] === 80 && bytes[2] === 78 && bytes[3] === 71) return \"image/png\";\n\tif (bytes.length >= 3 && bytes[0] === 255 && bytes[1] === 216 && bytes[2] === 255) return \"image/jpeg\";\n\tif (bytes.length >= 3 && bytes[0] === 71 && bytes[1] === 73 && bytes[2] === 70) return \"image/gif\";\n\tif (bytes.length >= 2 && bytes[0] === 66 && bytes[1] === 77) return \"image/bmp\";\n\tif (bytes.length >= 12 && bytes[8] === 87 && bytes[9] === 69 && bytes[10] === 66 && bytes[11] === 80) return \"image/webp\";\n\treturn null;\n}\nfunction toBase64(bytes) {\n\tlet binary = \"\";\n\tconst chunkSize = 32768;\n\tfor (let offset = 0; offset < bytes.length; offset += chunkSize) binary += String.fromCharCode(...bytes.subarray(offset, offset + chunkSize));\n\treturn btoa(binary);\n}\n/** 对象生效绘制参数:自身 FillColor/StrokeColor/LineWidth 声明优先于 DrawParam 继承链 */\nfunction resolveDrawAttributes(drawParamId, context) {\n\tconst chain = [];\n\tconst visited = /* @__PURE__ */ new Set();\n\tlet current = drawParamId === null ? void 0 : findDrawParam(drawParamId, context);\n\twhile (current && !visited.has(current.id)) {\n\t\tvisited.add(current.id);\n\t\tchain.unshift(current);\n\t\tcurrent = current.relative === null ? void 0 : findDrawParam(current.relative, context);\n\t}\n\tlet fillColor = null;\n\tlet strokeColor = null;\n\tlet lineWidth = null;\n\tfor (const declaration of chain) {\n\t\tfillColor ??= declaration.fillColor;\n\t\tstrokeColor ??= declaration.strokeColor;\n\t\tlineWidth ??= declaration.lineWidth;\n\t}\n\treturn {\n\t\tfillColor,\n\t\tstrokeColor,\n\t\tlineWidth\n\t};\n}\nfunction findDrawParam(id, context) {\n\treturn context.doc.resources.drawParams.find((param) => param.id === id);\n}\nfunction renderPath(object, context, scope) {\n\tconst d = pathD(object.commands);\n\tif (d === \"\") return \"\";\n\tconst draw = resolveDrawAttributes(object.drawParamId ?? scope.drawParamId, context);\n\tconst strokeColor = object.strokeColor ?? draw.strokeColor;\n\tconst fill = object.fillColor ?? draw.fillColor ?? (object.fill ? DEFAULT_FILL : \"none\");\n\treturn `<path ${[\n\t\t`d=\"${d}\"`,\n\t\t`fill=\"${fill}\"`,\n\t\tstrokeColor === null ? null : `stroke=\"${strokeColor}\"`,\n\t\tattr(\"stroke-width\", object.lineWidth ?? draw.lineWidth),\n\t\tlistAttr(\"stroke-dasharray\", object.dashPattern)\n\t].filter((value) => value !== null).join(\" \")}/>`;\n}\nfunction pathD(commands) {\n\treturn commands.map((command) => command.type === \"Z\" ? \"Z\" : `${command.type === \"B\" ? \"Q\" : command.type} ${command.points.map(formatNumber).join(\" \")}`).join(\" \");\n}\n/** 对象外壳 transform:CTM 矩阵 + 平移到 Boundary 原点,单位矩阵不输出 */\nfunction groupTransform(ctm, boundary) {\n\tconst matrix = isIdentityMatrix(ctm) ? null : `matrix(${ctm.map(formatNumber).join(\" \")})`;\n\tif (!boundary) return matrix ?? \"\";\n\tconst translate = `translate(${formatNumber(boundary.x)} ${formatNumber(boundary.y)})`;\n\tif (hasScaleComponent(ctm)) return matrix ? `${translate} ${matrix}` : translate;\n\treturn matrix ? `${matrix} ${translate}` : translate;\n}\n/** CTM 是否带缩放分量(旋转/切变的轴长为 1,缩放会偏离 1) */\nfunction hasScaleComponent(ctm) {\n\treturn Math.abs(Math.hypot(ctm[0], ctm[1]) - 1) > 1e-6 || Math.abs(Math.hypot(ctm[2], ctm[3]) - 1) > 1e-6;\n}\nfunction isIdentityMatrix(matrix) {\n\treturn matrix[0] === 1 && matrix[1] === 0 && matrix[2] === 0 && matrix[3] === 1 && matrix[4] === 0 && matrix[5] === 0;\n}\nfunction attr(name, value) {\n\tif (value === null) return null;\n\treturn `${name}=\"${typeof value === \"number\" ? formatNumber(value) : escapeXml(value)}\"`;\n}\nfunction listAttr(name, values) {\n\treturn values.length === 0 ? null : `${name}=\"${values.map(formatNumber).join(\" \")}\"`;\n}\nfunction escapeXml(text) {\n\treturn text.replaceAll(\"&\", \"&\").replaceAll(\"<\", \"<\").replaceAll(\">\", \">\").replaceAll(\"\\\"\", \""\");\n}\nexport { pageToSvg };\n\n//# sourceMappingURL=render.js.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,YAAY,KAAK;;AAEvB,MAAM,eAAe;;AAErB,eAAe,UAAU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,KAAK,OAAO,OAAO;AACrH;AACA,SAAS,KAAK,MAAM,OAAO;CAC1B,IAAI,UAAU,MAAM,OAAO;CAC3B,OAAO,GAAG,KAAK,IAAI,OAAO,UAAU,WAAW,aAAa,KAAK,IAAI,UAAU,KAAK,EAAE;AACvF;AACA,SAAS,SAAS,MAAM,QAAQ;CAC/B,OAAO,OAAO,WAAW,IAAI,OAAO,GAAG,KAAK,IAAI,OAAO,IAAI,YAAY,CAAC,CAAC,KAAK,GAAG,EAAE;AACpF;AACA,SAAS,UAAU,MAAM;CACxB,OAAO,KAAK,WAAW,KAAK,OAAO,CAAC,CAAC,WAAW,KAAK,MAAM,CAAC,CAAC,WAAW,KAAK,MAAM,CAAC,CAAC,WAAW,MAAM,QAAQ;AAC/G"}
|
|
1
|
+
{"version":3,"file":"render.js","names":[],"sources":["../../../../../ofd-core/dist/render.js"],"sourcesContent":["import { IDENTITY_MATRIX, multiplyMatrix } from \"./ctm.js\";\nimport { OfdParseError } from \"./error.js\";\nimport { joinZipPath } from \"./xml.js\";\nimport { glyphPathD, parseEmbeddedFont } from \"./font.js\";\nimport { formatNumber, roundTo } from \"./number.js\";\nimport { parsePageContent } from \"./page-objects.js\";\nimport { resolveContentLocation } from \"./parse.js\";\n// src/render.ts\n/**\n* 逐页 SVG 输出(P2 渲染内核出口)。\n*\n* 页面物理尺寸按 OFD 毫米 → CSS 像素换算(96dpi),内容坐标系保持 OFD 原始\n* 毫米单位(通过 viewBox 缩放),坐标与文档声明一一对应,便于断言与调试。\n* 页与页相互独立、可单独调用,供上层做懒渲染 / 虚拟滚动。\n*/\n/** CSS 约定 96px = 1in = 25.4mm */\nconst PX_PER_MM = 96 / 25.4;\n/** 对象未声明填充色时的默认色(GB/T 33190 未声明时文字按黑色呈现,Fill 路径同) */\nconst DEFAULT_FILL = \"#000\";\n/** 输出指定文档指定页的完整 SVG 字符串 */\nasync function pageToSvg(zip, container, documentIndex, pageIndex) {\n\tconst doc = container.docs[documentIndex];\n\tif (!doc) throw new OfdParseError(\"out-of-range\", `文档序号 ${documentIndex} 超出范围(容器共 ${container.docs.length} 个文档)`);\n\tconst page = doc.pages[pageIndex];\n\tif (!page) throw new OfdParseError(\"out-of-range\", `页序号 ${pageIndex} 超出范围(文档 ${documentIndex} 共 ${doc.pages.length} 页)`);\n\tconst content = parsePageContent(await zip.text(page.location), page.location);\n\tconst size = page.size ?? doc.pageSize ?? {\n\t\twidth: 210,\n\t\theight: 297\n\t};\n\tconst context = {\n\t\tzip,\n\t\tdoc,\n\t\tfonts: /* @__PURE__ */ new Map(),\n\t\ttemplateContents: /* @__PURE__ */ new Map()\n\t};\n\tconst renderedTemplates = await Promise.all(content.templateRefs.map((ref) => renderTemplateRef(ref, context, [content.objectsById], /* @__PURE__ */ new Set())));\n\tconst background = [];\n\tconst foreground = [];\n\tconst templateFrames = [];\n\tfor (const rendered of renderedTemplates) {\n\t\tif (rendered.background !== \"\") background.push(rendered.background);\n\t\tif (rendered.foreground !== \"\") foreground.push(rendered.foreground);\n\t\ttemplateFrames.push(rendered.frames);\n\t}\n\tconst pageFrames = [content.objectsById, ...templateFrames.flat()];\n\tconst layers = await Promise.all(content.layers.map((layer) => renderLayer(layer, context, pageFrames)));\n\treturn `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"${formatNumber(roundTo(size.width * PX_PER_MM, 2))}px\" height=\"${formatNumber(roundTo(size.height * PX_PER_MM, 2))}px\" viewBox=\"0 0 ${formatNumber(size.width)} ${formatNumber(size.height)}\">${background.join(\"\")}${layers.join(\"\")}${foreground.join(\"\")}</svg>`;\n}\n/** 渲染单个图层:对象按声明顺序叠加,空图层不输出外壳 */\nasync function renderLayer(layer, context, frames) {\n\tconst rendered = (await Promise.all(layer.objects.map((object) => renderObject(object, IDENTITY_MATRIX, null, context, /* @__PURE__ */ new Set(), {\n\t\tframes,\n\t\tdrawParamId: layer.drawParamId\n\t})))).join(\"\");\n\tif (rendered === \"\") return \"\";\n\treturn `<g${layer.type === null ? \"\" : ` data-ofd-layer=\"${layer.type}\"`}>${rendered}</g>`;\n}\n/**\n* 按引用渲染一个模板页:自身引用的模板先于其内容(背景)或后于其内容(前景)\n* 展开,与页面同规则;以内容文件路径判环,递归引用直接断开。\n*/\nasync function renderTemplateRef(ref, context, outerFrames, visiting) {\n\tconst baseLocation = (ref.templateId === null ? void 0 : context.doc.templates.find((template) => template.id === ref.templateId))?.location ?? null;\n\tif (baseLocation === null) return {\n\t\tbackground: \"\",\n\t\tforeground: \"\",\n\t\tframes: []\n\t};\n\tconst location = resolveContentLocation(context.doc.dir, baseLocation);\n\tif (visiting.has(location)) return {\n\t\tbackground: \"\",\n\t\tforeground: \"\",\n\t\tframes: []\n\t};\n\tconst content = await loadTemplateContent(context, location);\n\tconst frames = [content.objectsById, ...outerFrames];\n\tconst nextVisiting = new Set(visiting).add(location);\n\tconst innerRendered = await Promise.all(content.templateRefs.map((innerRef) => renderTemplateRef(innerRef, context, frames, nextVisiting)));\n\tconst innerBackground = [];\n\tconst innerForeground = [];\n\tfor (const rendered of innerRendered) {\n\t\tinnerBackground.push(rendered.background);\n\t\tinnerForeground.push(rendered.foreground);\n\t}\n\tconst ownLayers = (await Promise.all(content.layers.map((layer) => renderLayer(layer, context, frames)))).join(\"\");\n\tconst bundle = innerBackground.join(\"\") + ownLayers + innerForeground.join(\"\");\n\treturn ref.zOrder === \"foreground\" ? {\n\t\tbackground: \"\",\n\t\tforeground: bundle,\n\t\tframes\n\t} : {\n\t\tbackground: bundle,\n\t\tforeground: \"\",\n\t\tframes\n\t};\n}\n/** 加载并解析模板页内容;同一页内重复或递归引用复用解析结果 */\nasync function loadTemplateContent(context, location) {\n\tconst cached = context.templateContents.get(location);\n\tif (cached) return cached;\n\tconst content = parsePageContent(await context.zip.text(location), location);\n\tcontext.templateContents.set(location, content);\n\treturn content;\n}\n/** 渲染单个对象:CTM 链 + Boundary 定位外壳,内容坐标相对 Boundary 原点 */\nasync function renderObject(object, parentCtm, boundaryOverride, context, visiting, scope) {\n\tif (object.id && visiting.has(object.id)) return \"\";\n\tconst ctm = object.ctm ? multiplyMatrix(parentCtm, object.ctm) : parentCtm;\n\tif (object.kind === \"composite\") return renderComposite(object, ctm, context, visiting, scope);\n\tconst boundary = boundaryOverride ?? object.boundary;\n\tconst inner = await renderContent(object, boundary, ctm, context, scope);\n\tif (inner === \"\") return \"\";\n\tconst transform = groupTransform(ctm, boundary);\n\treturn `<g${transform ? ` transform=\"${transform}\"` : \"\"}>${inner}</g>`;\n}\nasync function renderContent(object, boundary, ctm, context, scope) {\n\tswitch (object.kind) {\n\t\tcase \"text\": return renderText(object, context, scope);\n\t\tcase \"image\": return renderImage(object, boundary, ctm, context);\n\t\tcase \"path\": return renderPath(object, context, scope);\n\t}\n}\n/** 复合对象:递归渲染被引用对象,CTM 链向下继承,循环引用直接断开 */\nasync function renderComposite(object, parentCtm, context, visiting, scope) {\n\tconst referenced = findReferencedObject(object, scope);\n\tif (!referenced) return \"\";\n\tconst nextVisiting = new Set(visiting);\n\tif (object.id) nextVisiting.add(object.id);\n\treturn renderObject(referenced, parentCtm, object.boundary, context, nextVisiting, scope);\n}\n/** 复合对象引用查找:当前内容域优先,未命中再沿外层内容域兜底 */\nfunction findReferencedObject(object, scope) {\n\tif (object.referenceId === null) return void 0;\n\tfor (const frame of scope.frames) {\n\t\tconst referenced = frame.get(object.referenceId);\n\t\tif (referenced) return referenced;\n\t}\n}\n/** 文本渲染:声明内嵌字体(Font@FontFile)时按 glyph 轮廓输出 path,否则回退系统字体 text */\nasync function renderText(object, context, scope) {\n\tconst draw = resolveDrawAttributes(object.drawParamId ?? scope.drawParamId, context);\n\tconst fill = object.fillColor ?? draw.fillColor ?? DEFAULT_FILL;\n\tconst font = await loadEmbeddedFont(object.fontId, context);\n\tif (!font || object.fontSize === null) return renderSystemFontText(object, fill, context);\n\tconst fontSize = object.fontSize;\n\tconst parts = [];\n\tlet baseIndex = 0;\n\tfor (const code of object.codes) {\n\t\tconst part = textCodePathD(font, code, fontSize, object.glyphSubstitutions, baseIndex);\n\t\tif (part !== \"\") parts.push(part);\n\t\tbaseIndex += code.text.length;\n\t}\n\tconst d = parts.join(\" \");\n\tif (d === \"\") return object.codes.some((code) => code.text.length > 0) ? renderSystemFontText(object, fill, context) : \"\";\n\treturn `<path d=\"${d}\" fill=\"${fill}\"/>`;\n}\n/** 加载 TextObject@FontID 声明的内嵌 TTF;缺失或损坏返回 null(不阻断整页渲染) */\nasync function loadEmbeddedFont(fontId, context) {\n\tif (fontId === null) return null;\n\tconst cached = context.fonts.get(fontId);\n\tif (cached !== void 0) return cached;\n\tconst decl = context.doc.resources.fonts.find((font) => font.id === fontId);\n\tlet font = null;\n\tif (decl?.fontFile) try {\n\t\tfont = parseEmbeddedFont(await context.zip.read(joinZipPath(context.doc.dir, decl.fontFile)), decl.fontFile);\n\t} catch {\n\t\tfont = null;\n\t}\n\tcontext.fonts.set(fontId, font);\n\treturn font;\n}\n/**\n* 单个 TextCode 的 glyph 路径:从 X/Y 基线原点起笔逐字排布。\n* DeltaX/DeltaY 按标准是「相对前一个字符的位移」,声明时替代字形步进宽度。\n* 字形来源优先取 CGTransform 替换序号(子集字体无 cmap 时的唯一映射),\n* 其次 cmap 码点映射;两者都未命中时跳过该字符的轮廓、仅按位移推进。\n*/\nfunction textCodePathD(font, code, fontSize, substitutions, baseIndex) {\n\tconst scale = fontSize / font.unitsPerEm;\n\tconst parts = [];\n\tlet penX = code.x ?? 0;\n\tlet penY = code.y ?? 0;\n\tlet dxIndex = 0;\n\tlet dyIndex = 0;\n\tlet charIndex = 0;\n\tfor (const char of code.text) {\n\t\tconst gid = substitutedGlyphId(substitutions, baseIndex + charIndex) ?? font.glyphIndexOf(char.codePointAt(0));\n\t\tif (gid !== null) {\n\t\t\tconst d = glyphPathD(font, gid, fontSize, penX, penY);\n\t\t\tif (d !== \"\") parts.push(d);\n\t\t}\n\t\tconst deltaX = dxIndex < code.deltaX.length ? code.deltaX[dxIndex++] : null;\n\t\tpenX += deltaX ?? (gid !== null ? font.advanceWidth(gid) * scale : 0);\n\t\tconst deltaY = dyIndex < code.deltaY.length ? code.deltaY[dyIndex++] : null;\n\t\tpenY += deltaY ?? 0;\n\t\tcharIndex++;\n\t}\n\treturn parts.join(\" \");\n}\n/** 字形替换查找:字符落在声明区间时取 Glyphs 中对应序号,合字耗尽或未覆盖返回 null */\nfunction substitutedGlyphId(substitutions, charIndex) {\n\tfor (const substitution of substitutions) if (charIndex >= substitution.codePosition && charIndex < substitution.codePosition + substitution.codeCount) {\n\t\tconst offset = charIndex - substitution.codePosition;\n\t\treturn offset < substitution.glyphIds.length ? substitution.glyphIds[offset] : null;\n\t}\n\treturn null;\n}\n/** 无内嵌字体可用时的系统字体回退:保留 P2 的 text 输出与文字内容 */\nfunction renderSystemFontText(object, fill, context) {\n\tconst fontFamily = resolveFontFamily(object.fontId, context);\n\treturn object.codes.map((code) => {\n\t\treturn `<text ${[\n\t\t\t\"xml:space=\\\"preserve\\\"\",\n\t\t\tcodePositionAttr(\"x\", code.x, code.text.length, code.deltaX),\n\t\t\tcodePositionAttr(\"y\", code.y, code.text.length, code.deltaY),\n\t\t\tattr(\"font-size\", object.fontSize),\n\t\t\tfontFamily === null ? null : `font-family=\"${escapeXml(fontFamily)}\"`,\n\t\t\t`fill=\"${fill}\"`\n\t\t].filter((value) => value !== null).join(\" \")}>${escapeXml(code.text)}</text>`;\n\t}).join(\"\");\n}\n/**\n* TextCode 位移转 SVG 逐字符坐标:DeltaX/DeltaY 是相邻字符间的绝对步长\n* (替代字形自然步进),而 SVG 的 dx/dy 是在自然步进上的附加量,语义不同,\n* 这里换算成绝对坐标列表;位移未覆盖的字符交由自然排布。\n*/\nfunction codePositionAttr(name, start, charCount, deltas) {\n\tif (start === null && deltas.length === 0) return null;\n\tconst positions = [start ?? 0];\n\tconst covered = Math.min(charCount - 1, deltas.length);\n\tfor (let index = 0; index < covered; index++) positions.push(positions[index] + deltas[index]);\n\treturn positions.length === 1 ? `${name}=\"${formatNumber(positions[0])}\"` : `${name}=\"${positions.map(formatNumber).join(\" \")}\"`;\n}\nfunction resolveFontFamily(fontId, context) {\n\tif (!fontId) return null;\n\treturn context.doc.resources.fonts.find((font) => font.id === fontId)?.fontName ?? null;\n}\n/**\n* 图片:解析 MultiMedia 声明并读资源字节,缺资源或不可识别的媒体类型跳过(不阻断整页)。\n* Type 兼容标准单字母 'g' 与主流产出的 'Image' 拼写。\n*/\nasync function renderImage(object, boundary, ctm, context) {\n\tconst media = object.resourceId === null ? void 0 : context.doc.resources.medias.find((item) => item.id === object.resourceId);\n\tconst location = media?.location;\n\tconst type = media?.type?.toLowerCase();\n\tif (!location || type !== void 0 && type !== \"g\" && type !== \"image\") return \"\";\n\tlet bytes;\n\ttry {\n\t\tbytes = await context.zip.read(joinZipPath(context.doc.dir, location));\n\t} catch {\n\t\treturn \"\";\n\t}\n\tconst mime = sniffImageMime(bytes);\n\tif (!mime) return \"\";\n\tconst content = boundary === null ? null : imageContentSize(boundary, ctm);\n\treturn `<image${content === null ? \"\" : ` width=\"${formatNumber(content.width)}\" height=\"${formatNumber(content.height)}\"`} href=\"data:${mime};base64,${toBase64(bytes)}\"/>`;\n}\n/**\n* 图片内容盒尺寸:无缩放 CTM 时 Boundary 即内容盒;带缩放 CTM 的产出\n* (WPS / 新版数电发票实证)图片内容为 [0,1] 单位盒,尺寸与定位由 CTM 给出,\n* Boundary 只提供平移原点(WPS 写最终包围盒、数电票二维码写整页盒,均不参与定尺寸)。\n*/\nfunction imageContentSize(boundary, ctm) {\n\tif (!hasScaleComponent(ctm)) return {\n\t\twidth: boundary.width,\n\t\theight: boundary.height\n\t};\n\treturn {\n\t\twidth: 1,\n\t\theight: 1\n\t};\n}\n/** 按魔数识别可渲染的图片媒体类型;多帧格式(GIF/APNG)由展示端取首帧 */\nfunction sniffImageMime(bytes) {\n\tif (bytes.length >= 4 && bytes[0] === 137 && bytes[1] === 80 && bytes[2] === 78 && bytes[3] === 71) return \"image/png\";\n\tif (bytes.length >= 3 && bytes[0] === 255 && bytes[1] === 216 && bytes[2] === 255) return \"image/jpeg\";\n\tif (bytes.length >= 3 && bytes[0] === 71 && bytes[1] === 73 && bytes[2] === 70) return \"image/gif\";\n\tif (bytes.length >= 2 && bytes[0] === 66 && bytes[1] === 77) return \"image/bmp\";\n\tif (bytes.length >= 12 && bytes[8] === 87 && bytes[9] === 69 && bytes[10] === 66 && bytes[11] === 80) return \"image/webp\";\n\treturn null;\n}\nfunction toBase64(bytes) {\n\tlet binary = \"\";\n\tconst chunkSize = 32768;\n\tfor (let offset = 0; offset < bytes.length; offset += chunkSize) binary += String.fromCharCode(...bytes.subarray(offset, offset + chunkSize));\n\treturn btoa(binary);\n}\n/** 对象生效绘制参数:自身 FillColor/StrokeColor/LineWidth 声明优先于 DrawParam 继承链 */\nfunction resolveDrawAttributes(drawParamId, context) {\n\tconst chain = [];\n\tconst visited = /* @__PURE__ */ new Set();\n\tlet current = drawParamId === null ? void 0 : findDrawParam(drawParamId, context);\n\twhile (current && !visited.has(current.id)) {\n\t\tvisited.add(current.id);\n\t\tchain.unshift(current);\n\t\tcurrent = current.relative === null ? void 0 : findDrawParam(current.relative, context);\n\t}\n\tlet fillColor = null;\n\tlet strokeColor = null;\n\tlet lineWidth = null;\n\tfor (const declaration of chain) {\n\t\tfillColor ??= declaration.fillColor;\n\t\tstrokeColor ??= declaration.strokeColor;\n\t\tlineWidth ??= declaration.lineWidth;\n\t}\n\treturn {\n\t\tfillColor,\n\t\tstrokeColor,\n\t\tlineWidth\n\t};\n}\nfunction findDrawParam(id, context) {\n\treturn context.doc.resources.drawParams.find((param) => param.id === id);\n}\nfunction renderPath(object, context, scope) {\n\tconst d = pathD(object.commands);\n\tif (d === \"\") return \"\";\n\tconst draw = resolveDrawAttributes(object.drawParamId ?? scope.drawParamId, context);\n\tconst strokeColor = object.strokeColor ?? draw.strokeColor;\n\tconst fill = object.fillColor ?? draw.fillColor ?? (object.fill ? DEFAULT_FILL : \"none\");\n\treturn `<path ${[\n\t\t`d=\"${d}\"`,\n\t\t`fill=\"${fill}\"`,\n\t\tstrokeColor === null ? null : `stroke=\"${strokeColor}\"`,\n\t\tattr(\"stroke-width\", object.lineWidth ?? draw.lineWidth),\n\t\tlistAttr(\"stroke-dasharray\", object.dashPattern)\n\t].filter((value) => value !== null).join(\" \")}/>`;\n}\nfunction pathD(commands) {\n\treturn commands.map((command) => command.type === \"Z\" ? \"Z\" : `${command.type === \"B\" ? \"Q\" : command.type} ${command.points.map(formatNumber).join(\" \")}`).join(\" \");\n}\n/** 对象外壳 transform:CTM 矩阵 + 平移到 Boundary 原点,单位矩阵不输出 */\nfunction groupTransform(ctm, boundary) {\n\tconst matrix = isIdentityMatrix(ctm) ? null : `matrix(${ctm.map(formatNumber).join(\" \")})`;\n\tif (!boundary) return matrix ?? \"\";\n\tconst translate = `translate(${formatNumber(boundary.x)} ${formatNumber(boundary.y)})`;\n\tif (hasScaleComponent(ctm)) return matrix ? `${translate} ${matrix}` : translate;\n\treturn matrix ? `${matrix} ${translate}` : translate;\n}\n/** CTM 是否带缩放分量(旋转/切变的轴长为 1,缩放会偏离 1) */\nfunction hasScaleComponent(ctm) {\n\treturn Math.abs(Math.hypot(ctm[0], ctm[1]) - 1) > 1e-6 || Math.abs(Math.hypot(ctm[2], ctm[3]) - 1) > 1e-6;\n}\nfunction isIdentityMatrix(matrix) {\n\treturn matrix[0] === 1 && matrix[1] === 0 && matrix[2] === 0 && matrix[3] === 1 && matrix[4] === 0 && matrix[5] === 0;\n}\nfunction attr(name, value) {\n\tif (value === null) return null;\n\treturn `${name}=\"${typeof value === \"number\" ? formatNumber(value) : escapeXml(value)}\"`;\n}\nfunction listAttr(name, values) {\n\treturn values.length === 0 ? null : `${name}=\"${values.map(formatNumber).join(\" \")}\"`;\n}\nfunction escapeXml(text) {\n\treturn text.replaceAll(\"&\", \"&\").replaceAll(\"<\", \"<\").replaceAll(\">\", \">\").replaceAll(\"\\\"\", \""\");\n}\nexport { pageToSvg };\n\n//# sourceM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,QAAQ;CACjC,OAAO,OAAO,OAAO,KAAK,OAAO,OAAO,KAAK,OAAO,OAAO,KAAK,OAAO,OAAO,KAAK,OAAO,OAAO,KAAK,OAAO,OAAO;AACrH;AACA,SAAS,KAAK,MAAM,OAAO;CAC1B,IAAI,UAAU,MAAM,OAAO;CAC3B,OAAO,GAAG,KAAK,IAAI,OAAO,UAAU,WAAW,aAAa,KAAK,IAAI,UAAU,KAAK,EAAE;AACvF;AACA,SAAS,SAAS,MAAM,QAAQ;CAC/B,OAAO,OAAO,WAAW,IAAI,OAAO,GAAG,KAAK,IAAI,OAAO,IAAI,YAAY,CAAC,CAAC,KAAK,GAAG,EAAE;AACpF;AACA,SAAS,UAAU,MAAM;CACxB,OAAO,KAAK,WAAW,KAAK,OAAO,CAAC,CAAC,WAAW,KAAK,MAAM,CAAC,CAAC,WAAW,KAAK,MAAM,CAAC,CAAC,WAAW,MAAM,QAAQ;AAC/G"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OfdParseError } from "./error.js";
|
|
2
|
-
import { parseNumberList } from "./ctm.js";
|
|
3
1
|
import { parseOfdColor } from "./color.js";
|
|
2
|
+
import { parseNumberList } from "./ctm.js";
|
|
3
|
+
import { OfdParseError } from "./error.js";
|
|
4
4
|
// ../ofd-core/dist/xml.js
|
|
5
5
|
function childElements(element) {
|
|
6
6
|
const out = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xml.js","names":[],"sources":["../../../../../ofd-core/dist/xml.js"],"sourcesContent":["import { OfdParseError } from \"./error.js\";\nimport { parseNumberList } from \"./ctm.js\";\nimport { parseOfdColor } from \"./color.js\";\n// src/xml.ts\nfunction childElements(element) {\n\tconst out = [];\n\tfor (let i = 0; i < element.childNodes.length; i++) {\n\t\tconst node = element.childNodes[i];\n\t\tif (node && node.nodeType === 1) out.push(node);\n\t}\n\treturn out;\n}\nfunction localNameOf(element) {\n\tif (element.localName) return element.localName;\n\tconst tag = element.nodeName;\n\treturn tag.includes(\":\") ? tag.slice(tag.indexOf(\":\") + 1) : tag;\n}\nfunction childrenNamed(element, name) {\n\treturn childElements(element).filter((child) => localNameOf(child) === name);\n}\nfunction firstChildNamed(element, name) {\n\treturn childrenNamed(element, name)[0] ?? null;\n}\nfunction childText(element, name) {\n\treturn firstChildNamed(element, name)?.textContent ?? null;\n}\nfunction normalizedText(value) {\n\tconst text = value?.trim();\n\treturn text ? text : null;\n}\nfunction parseXml(xml, source) {\n\tlet doc;\n\ttry {\n\t\tdoc = new DOMParser().parseFromString(xml, \"application/xml\");\n\t} catch (cause) {\n\t\tthrow new OfdParseError(\"invalid-xml\", `${source} 不是合法的 XML`, { cause });\n\t}\n\tif (doc.getElementsByTagName(\"parsererror\").length > 0) throw new OfdParseError(\"invalid-xml\", `${source} 不是合法的 XML`);\n\treturn doc;\n}\nfunction rootElementOf(doc, names, source) {\n\tconst expected = typeof names === \"string\" ? [names] : names;\n\tconst root = doc.documentElement;\n\tconst lowered = expected.map((name) => name.toLowerCase());\n\tif (!root || !lowered.includes(localNameOf(root).toLowerCase())) throw new OfdParseError(\"invalid-structure\", `${source} 根节点不是 ${expected.join(\" / \")}`);\n\treturn root;\n}\n/** 解析 OFD.xml:每个 DocBody 产出一条入口,支持多文档容器 */\nfunction parseOfdRoot(xml, source = \"OFD.xml\") {\n\treturn childrenNamed(rootElementOf(parseXml(xml, source), \"Ofd\", source), \"DocBody\").map((body) => {\n\t\tconst docRoot = normalizedText(childText(body, \"DocRoot\"));\n\t\tif (!docRoot) throw new OfdParseError(\"invalid-structure\", `${source} 中 DocBody 缺少 DocRoot`);\n\t\tconst info = firstChildNamed(body, \"DocInfo\");\n\t\treturn {\n\t\t\tdocRoot,\n\t\t\tinfo: {\n\t\t\t\tdocId: info ? normalizedText(childText(info, \"DocID\")) : null,\n\t\t\t\ttitle: info ? normalizedText(childText(info, \"Title\")) : null\n\t\t\t}\n\t\t};\n\t});\n}\n/** 解析 Document.xml:默认页尺寸、公共资源引用、模板页声明、页面树 */\nfunction parseDocumentXml(xml, source) {\n\tconst root = rootElementOf(parseXml(xml, source), \"Document\", source);\n\tconst commonData = firstChildNamed(root, \"CommonData\");\n\tconst pages = firstChildNamed(root, \"Pages\");\n\treturn {\n\t\tpageSize: commonData ? parsePageSize(commonData) ?? physicalBoxSize(commonData, \"PageArea\") : null,\n\t\tresLocation: resDeclarationLocation(root, commonData, \"DocumentRes\"),\n\t\tpublicResLocation: resDeclarationLocation(root, commonData, \"PublicRes\"),\n\t\ttemplates: commonData ? childrenNamed(commonData, \"TemplatePage\").map((template) => ({\n\t\t\tid: template.getAttribute(\"ID\"),\n\t\t\tlocation: normalizedText(template.getAttribute(\"BaseLoc\") ?? template.textContent)\n\t\t})) : [],\n\t\tpageLocations: pages ? childrenNamed(pages, \"Page\").map((page) => normalizedText(page.getAttribute(\"BaseLoc\"))).filter((value) => value !== null) : []\n\t};\n}\n/**\n* 资源声明路径兼容两种产出形态:声明元素挂在 Document 根或 CommonData 下,\n* 路径写在 ResLoc 属性或元素文本中(WPS / 数科 / 数电发票产出均为文本形态)。\n*/\nfunction resDeclarationLocation(root, commonData, name) {\n\tconst node = firstChildNamed(root, name) ?? (commonData && firstChildNamed(commonData, name));\n\tif (!node) return null;\n\treturn normalizedText(node.getAttribute(\"ResLoc\")) ?? normalizedText(node.textContent);\n}\n/** 物理盒尺寸兜底(\"x y w h\" 取宽高);主流生成器以 PhysicalBox 代替 PageWidth/PageHeight */\nfunction physicalBoxSize(scope, wrapper) {\n\tconst container = firstChildNamed(scope, wrapper);\n\tconst box = container ? firstChildNamed(container, \"PhysicalBox\") : null;\n\tconst numbers = parseNumberList(box?.textContent ?? null);\n\treturn numbers.length === 4 ? {\n\t\twidth: numbers[2],\n\t\theight: numbers[3]\n\t} : null;\n}\n/** 解析 DocumentRes.xml / PublicRes.xml:字体、多媒体资源与绘制参数声明 */\nfunction parseDocumentRes(xml, source) {\n\tconst root = rootElementOf(parseXml(xml, source), \"Res\", source);\n\tconst baseLoc = normalizedText(root.getAttribute(\"BaseLoc\"));\n\tconst fonts = [];\n\tconst medias = [];\n\tconst drawParams = [];\n\tfor (const group of childrenNamed(root, \"Fonts\")) for (const font of childrenNamed(group, \"Font\")) {\n\t\tconst id = font.getAttribute(\"ID\");\n\t\tif (id !== null) fonts.push({\n\t\t\tid,\n\t\t\tfontName: normalizedText(font.getAttribute(\"FontName\")),\n\t\t\tfontFile: fontFileLocation(baseLoc, font)\n\t\t});\n\t}\n\tfor (const group of childrenNamed(root, \"MultiMedias\")) for (const media of childrenNamed(group, \"MultiMedia\")) {\n\t\tconst id = media.getAttribute(\"ID\");\n\t\tif (id !== null) medias.push({\n\t\t\tid,\n\t\t\ttype: media.getAttribute(\"Type\"),\n\t\t\tlocation: normalizedText(media.getAttribute(\"ResLoc\")) ?? mediaFileLocation(baseLoc, media)\n\t\t});\n\t}\n\tfor (const group of childrenNamed(root, \"DrawParams\")) for (const param of childrenNamed(group, \"DrawParam\")) {\n\t\tconst id = param.getAttribute(\"ID\");\n\t\tif (id !== null) drawParams.push({\n\t\t\tid,\n\t\t\tlineWidth: parseNumber(param.getAttribute(\"LineWidth\")),\n\t\t\trelative: normalizedText(param.getAttribute(\"Relative\")),\n\t\t\tfillColor: declaredColor(param, \"FillColor\"),\n\t\t\tstrokeColor: declaredColor(param, \"StrokeColor\")\n\t\t});\n\t}\n\treturn {\n\t\tfonts,\n\t\tmedias,\n\t\tdrawParams\n\t};\n}\n/** DrawParam 子元素颜色:<FillColor Value=\"128 0 0\"/> 按 Value 属性解析 */\nfunction declaredColor(param, name) {\n\treturn parseOfdColor(firstChildNamed(param, name)?.getAttribute(\"Value\") ?? null);\n}\n/**\n* 字体文件位置:FontFile 兼容属性与子元素两种声明(新版数电发票实证为子元素),\n* 路径相对资源声明根的 BaseLoc 解析,未声明 BaseLoc 时相对文档根。\n*/\nfunction fontFileLocation(baseLoc, font) {\n\tconst file = normalizedText(font.getAttribute(\"FontFile\")) ?? normalizedText(childText(font, \"FontFile\"));\n\treturn file === null ? null : joinZipPath(baseLoc ?? \"\", file);\n}\n/** 媒体位置兜底:MediaFile 子元素声明文件名,相对资源声明根的 BaseLoc 解析 */\nfunction mediaFileLocation(baseLoc, media) {\n\tconst file = normalizedText(firstChildNamed(media, \"MediaFile\")?.textContent ?? null);\n\treturn file === null ? null : joinZipPath(baseLoc ?? \"\", file);\n}\n/**\n* 拼接并规范化容器内路径:去空段与 './',统一 '/' 分隔(页面定位、图片资源定位共用)。\n* 段以 '/' 开头时按容器绝对路径处理(个别产出在相对文档根的位置写绝对路径)。\n*/\nfunction joinZipPath(...segments) {\n\tconst parts = [];\n\tfor (const segment of segments) {\n\t\tif (segment.startsWith(\"/\")) parts.length = 0;\n\t\tfor (const piece of segment.split(\"/\")) if (piece !== \"\" && piece !== \".\") parts.push(piece);\n\t}\n\treturn parts.join(\"/\");\n}\n/** 解析 Page.xml:页面尺寸覆盖与图层声明 */\nfunction parsePageXml(xml, source) {\n\tconst root = rootElementOf(parseXml(xml, source), \"Page\", source);\n\tconst commonData = firstChildNamed(root, \"CommonData\");\n\tconst layerParent = firstChildNamed(root, \"Content\") ?? root;\n\treturn {\n\t\tsize: (commonData ? parsePageSize(commonData) ?? physicalBoxSize(commonData, \"PageArea\") : null) ?? physicalBoxSize(root, \"Area\"),\n\t\tlayers: childrenNamed(layerParent, \"Layer\").map((layer) => ({\n\t\t\tid: layer.getAttribute(\"ID\"),\n\t\t\ttype: parseLayerType(layer.getAttribute(\"Type\"))\n\t\t}))\n\t};\n}\nfunction parsePageSize(commonData) {\n\tconst width = parseNumber(childText(commonData, \"PageWidth\"));\n\tconst height = parseNumber(childText(commonData, \"PageHeight\"));\n\treturn width !== null && height !== null ? {\n\t\twidth,\n\t\theight\n\t} : null;\n}\nfunction parseNumber(value) {\n\tif (value === null || value.trim() === \"\") return null;\n\tconst parsed = Number(value);\n\treturn Number.isFinite(parsed) ? parsed : null;\n}\nfunction parseLayerType(value) {\n\tconst lowered = value?.toLowerCase();\n\treturn lowered === \"background\" || lowered === \"body\" || lowered === \"foreground\" || lowered === \"annotation\" ? lowered : null;\n}\nexport { childElements, childrenNamed, firstChildNamed, joinZipPath, localNameOf, parseDocumentRes, parseDocumentXml, parseLayerType, parseOfdRoot, parsePageXml, parseXml, rootElementOf };\n\n//# sourceMappingURL=xml.js.map"],"mappings":";;;;AAIA,SAAS,cAAc,SAAS;CAC/B,MAAM,MAAM,CAAC;CACb,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,WAAW,QAAQ,KAAK;EACnD,MAAM,OAAO,QAAQ,WAAW;EAChC,IAAI,QAAQ,KAAK,aAAa,GAAG,IAAI,KAAK,IAAI;CAC/C;CACA,OAAO;AACR;AACA,SAAS,YAAY,SAAS;CAC7B,IAAI,QAAQ,WAAW,OAAO,QAAQ;CACtC,MAAM,MAAM,QAAQ;CACpB,OAAO,IAAI,SAAS,GAAG,IAAI,IAAI,MAAM,IAAI,QAAQ,GAAG,IAAI,CAAC,IAAI;AAC9D;AACA,SAAS,cAAc,SAAS,MAAM;CACrC,OAAO,cAAc,OAAO,CAAC,CAAC,QAAQ,UAAU,YAAY,KAAK,MAAM,IAAI;AAC5E;AACA,SAAS,gBAAgB,SAAS,MAAM;CACvC,OAAO,cAAc,SAAS,IAAI,CAAC,CAAC,MAAM;AAC3C;AACA,SAAS,UAAU,SAAS,MAAM;CACjC,OAAO,gBAAgB,SAAS,IAAI,CAAC,EAAE,eAAe;AACvD;AACA,SAAS,eAAe,OAAO;CAC9B,MAAM,OAAO,OAAO,KAAK;CACzB,OAAO,OAAO,OAAO;AACtB;AACA,SAAS,SAAS,KAAK,QAAQ;CAC9B,IAAI;CACJ,IAAI;EACH,MAAM,IAAI,UAAU,CAAC,CAAC,gBAAgB,KAAK,iBAAiB;CAC7D,SAAS,OAAO;EACf,MAAM,IAAI,cAAc,eAAe,GAAG,OAAO,aAAa,EAAE,MAAM,CAAC;CACxE;CACA,IAAI,IAAI,qBAAqB,aAAa,CAAC,CAAC,SAAS,GAA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,GAAG,GAAG,MAAM,SAAS;EAC5C,KAAK,MAAM,SAAS,QAAQ,MAAM,GAAG,GAAG,IAAI,UAAU,MAAM,UAAU,KAAK,MAAM,KAAK,KAAK;CAC5F;CACA,OAAO,MAAM,KAAK,GAAG;AACtB;;AAEA,SAAS,aAAa,KAAK,QAAQ;CAClC,MAAM,OAAO,cAAc,SAAS,KAAK,MAAM,GAAG,QAAQ,MAAM;CAChE,MAAM,aAAa,gBAAgB,MAAM,YAAY;CACrD,MAAM,cAAc,gBAAgB,MAAM,SAAS,KAAK;CACxD,OAAO;EACN,OAAO,aAAa,cAAc,UAAU,KAAK,gBAAgB,YAAY,UAAU,IAAI,SAAS,gBAAgB,MAAM,MAAM;EAChI,QAAQ,cAAc,aAAa,OAAO,CAAC,CAAC,KAAK,WAAW;GAC3D,IAAI,MAAM,aAAa,IAAI;GAC3B,MAAM,eAAe,MAAM,aAAa,MAAM,CAAC;EAChD,EAAE;CACH;AACD;AACA,SAAS,cAAc,YAAY;CAClC,MAAM,QAAQ,YAAY,UAAU,YAAY,WAAW,CAAC;CAC5D,MAAM,SAAS,YAAY,UAAU,YAAY,YAAY,CAAC;CAC9D,OAAO,UAAU,QAAQ,WAAW,OAAO;EAC1C;EACA;CACD,IAAI;AACL;AACA,SAAS,YAAY,OAAO;CAC3B,IAAI,UAAU,QAAQ,MAAM,KAAK,MAAM,IAAI,OAAO;CAClD,MAAM,SAAS,OAAO,KAAK;CAC3B,OAAO,OAAO,SAAS,MAAM,IAAI,SAAS;AAC3C;AACA,SAAS,eAAe,OAAO;CAC9B,MAAM,UAAU,OAAO,YAAY;CACnC,OAAO,YAAY,gBAAgB,YAAY,UAAU,YAAY,gBAAgB,YAAY,eAAe,UAAU;AAC3H"}
|
|
1
|
+
{"version":3,"file":"xml.js","names":[],"sources":["../../../../../ofd-core/dist/xml.js"],"sourcesContent":["import { parseOfdColor } from \"./color.js\";\nimport { parseNumberList } from \"./ctm.js\";\nimport { OfdParseError } from \"./error.js\";\n// src/xml.ts\nfunction childElements(element) {\n\tconst out = [];\n\tfor (let i = 0; i < element.childNodes.length; i++) {\n\t\tconst node = element.childNodes[i];\n\t\tif (node && node.nodeType === 1) out.push(node);\n\t}\n\treturn out;\n}\nfunction localNameOf(element) {\n\tif (element.localName) return element.localName;\n\tconst tag = element.nodeName;\n\treturn tag.includes(\":\") ? tag.slice(tag.indexOf(\":\") + 1) : tag;\n}\nfunction childrenNamed(element, name) {\n\treturn childElements(element).filter((child) => localNameOf(child) === name);\n}\nfunction firstChildNamed(element, name) {\n\treturn childrenNamed(element, name)[0] ?? null;\n}\nfunction childText(element, name) {\n\treturn firstChildNamed(element, name)?.textContent ?? null;\n}\nfunction normalizedText(value) {\n\tconst text = value?.trim();\n\treturn text ? text : null;\n}\nfunction parseXml(xml, source) {\n\tlet doc;\n\ttry {\n\t\tdoc = new DOMParser().parseFromString(xml, \"application/xml\");\n\t} catch (cause) {\n\t\tthrow new OfdParseError(\"invalid-xml\", `${source} 不是合法的 XML`, { cause });\n\t}\n\tif (doc.getElementsByTagName(\"parsererror\").length > 0) throw new OfdParseError(\"invalid-xml\", `${source} 不是合法的 XML`);\n\treturn doc;\n}\nfunction rootElementOf(doc, names, source) {\n\tconst expected = typeof names === \"string\" ? [names] : names;\n\tconst root = doc.documentElement;\n\tconst lowered = expected.map((name) => name.toLowerCase());\n\tif (!root || !lowered.includes(localNameOf(root).toLowerCase())) throw new OfdParseError(\"invalid-structure\", `${source} 根节点不是 ${expected.join(\" / \")}`);\n\treturn root;\n}\n/** 解析 OFD.xml:每个 DocBody 产出一条入口,支持多文档容器 */\nfunction parseOfdRoot(xml, source = \"OFD.xml\") {\n\treturn childrenNamed(rootElementOf(parseXml(xml, source), \"Ofd\", source), \"DocBody\").map((body) => {\n\t\tconst docRoot = normalizedText(childText(body, \"DocRoot\"));\n\t\tif (!docRoot) throw new OfdParseError(\"invalid-structure\", `${source} 中 DocBody 缺少 DocRoot`);\n\t\tconst info = firstChildNamed(body, \"DocInfo\");\n\t\treturn {\n\t\t\tdocRoot,\n\t\t\tinfo: {\n\t\t\t\tdocId: info ? normalizedText(childText(info, \"DocID\")) : null,\n\t\t\t\ttitle: info ? normalizedText(childText(info, \"Title\")) : null\n\t\t\t}\n\t\t};\n\t});\n}\n/** 解析 Document.xml:默认页尺寸、公共资源引用、模板页声明、页面树 */\nfunction parseDocumentXml(xml, source) {\n\tconst root = rootElementOf(parseXml(xml, source), \"Document\", source);\n\tconst commonData = firstChildNamed(root, \"CommonData\");\n\tconst pages = firstChildNamed(root, \"Pages\");\n\treturn {\n\t\tpageSize: commonData ? parsePageSize(commonData) ?? physicalBoxSize(commonData, \"PageArea\") : null,\n\t\tresLocation: resDeclarationLocation(root, commonData, \"DocumentRes\"),\n\t\tpublicResLocation: resDeclarationLocation(root, commonData, \"PublicRes\"),\n\t\ttemplates: commonData ? childrenNamed(commonData, \"TemplatePage\").map((template) => ({\n\t\t\tid: template.getAttribute(\"ID\"),\n\t\t\tlocation: normalizedText(template.getAttribute(\"BaseLoc\") ?? template.textContent)\n\t\t})) : [],\n\t\tpageLocations: pages ? childrenNamed(pages, \"Page\").map((page) => normalizedText(page.getAttribute(\"BaseLoc\"))).filter((value) => value !== null) : []\n\t};\n}\n/**\n* 资源声明路径兼容两种产出形态:声明元素挂在 Document 根或 CommonData 下,\n* 路径写在 ResLoc 属性或元素文本中(WPS / 数科 / 数电发票产出均为文本形态)。\n*/\nfunction resDeclarationLocation(root, commonData, name) {\n\tconst node = firstChildNamed(root, name) ?? (commonData && firstChildNamed(commonData, name));\n\tif (!node) return null;\n\treturn normalizedText(node.getAttribute(\"ResLoc\")) ?? normalizedText(node.textContent);\n}\n/** 物理盒尺寸兜底(\"x y w h\" 取宽高);主流生成器以 PhysicalBox 代替 PageWidth/PageHeight */\nfunction physicalBoxSize(scope, wrapper) {\n\tconst container = firstChildNamed(scope, wrapper);\n\tconst box = container ? firstChildNamed(container, \"PhysicalBox\") : null;\n\tconst numbers = parseNumberList(box?.textContent ?? null);\n\treturn numbers.length === 4 ? {\n\t\twidth: numbers[2],\n\t\theight: numbers[3]\n\t} : null;\n}\n/** 解析 DocumentRes.xml / PublicRes.xml:字体、多媒体资源与绘制参数声明 */\nfunction parseDocumentRes(xml, source) {\n\tconst root = rootElementOf(parseXml(xml, source), \"Res\", source);\n\tconst baseLoc = normalizedText(root.getAttribute(\"BaseLoc\"));\n\tconst fonts = [];\n\tconst medias = [];\n\tconst drawParams = [];\n\tfor (const group of childrenNamed(root, \"Fonts\")) for (const font of childrenNamed(group, \"Font\")) {\n\t\tconst id = font.getAttribute(\"ID\");\n\t\tif (id !== null) fonts.push({\n\t\t\tid,\n\t\t\tfontName: normalizedText(font.getAttribute(\"FontName\")),\n\t\t\tfontFile: fontFileLocation(baseLoc, font)\n\t\t});\n\t}\n\tfor (const group of childrenNamed(root, \"MultiMedias\")) for (const media of childrenNamed(group, \"MultiMedia\")) {\n\t\tconst id = media.getAttribute(\"ID\");\n\t\tif (id !== null) medias.push({\n\t\t\tid,\n\t\t\ttype: media.getAttribute(\"Type\"),\n\t\t\tlocation: normalizedText(media.getAttribute(\"ResLoc\")) ?? mediaFileLocation(baseLoc, media)\n\t\t});\n\t}\n\tfor (const group of childrenNamed(root, \"DrawParams\")) for (const param of childrenNamed(group, \"DrawParam\")) {\n\t\tconst id = param.getAttribute(\"ID\");\n\t\tif (id !== null) drawParams.push({\n\t\t\tid,\n\t\t\tlineWidth: parseNumber(param.getAttribute(\"LineWidth\")),\n\t\t\trelative: normalizedText(param.getAttribute(\"Relative\")),\n\t\t\tfillColor: declaredColor(param, \"FillColor\"),\n\t\t\tstrokeColor: declaredColor(param, \"StrokeColor\")\n\t\t});\n\t}\n\treturn {\n\t\tfonts,\n\t\tmedias,\n\t\tdrawParams\n\t};\n}\n/** DrawParam 子元素颜色:<FillColor Value=\"128 0 0\"/> 按 Value 属性解析 */\nfunction declaredColor(param, name) {\n\treturn parseOfdColor(firstChildNamed(param, name)?.getAttribute(\"Value\") ?? null);\n}\n/**\n* 字体文件位置:FontFile 兼容属性与子元素两种声明(新版数电发票实证为子元素),\n* 路径相对资源声明根的 BaseLoc 解析,未声明 BaseLoc 时相对文档根。\n*/\nfunction fontFileLocation(baseLoc, font) {\n\tconst file = normalizedText(font.getAttribute(\"FontFile\")) ?? normalizedText(childText(font, \"FontFile\"));\n\treturn file === null ? null : joinZipPath(baseLoc ?? \"\", file);\n}\n/** 媒体位置兜底:MediaFile 子元素声明文件名,相对资源声明根的 BaseLoc 解析 */\nfunction mediaFileLocation(baseLoc, media) {\n\tconst file = normalizedText(firstChildNamed(media, \"MediaFile\")?.textContent ?? null);\n\treturn file === null ? null : joinZipPath(baseLoc ?? \"\", file);\n}\n/**\n* 拼接并规范化容器内路径:去空段与 './',统一 '/' 分隔(页面定位、图片资源定位共用)。\n* 段以 '/' 开头时按容器绝对路径处理(个别产出在相对文档根的位置写绝对路径)。\n*/\nfunction joinZipPath(...segments) {\n\tconst parts = [];\n\tfor (const segment of segments) {\n\t\tif (segment.startsWith(\"/\")) parts.length = 0;\n\t\tfor (const piece of segment.split(\"/\")) if (piece !== \"\" && piece !== \".\") parts.push(piece);\n\t}\n\treturn parts.join(\"/\");\n}\n/** 解析 Page.xml:页面尺寸覆盖与图层声明 */\nfunction parsePageXml(xml, source) {\n\tconst root = rootElementOf(parseXml(xml, source), \"Page\", source);\n\tconst commonData = firstChildNamed(root, \"CommonData\");\n\tconst layerParent = firstChildNamed(root, \"Content\") ?? root;\n\treturn {\n\t\tsize: (commonData ? parsePageSize(commonData) ?? physicalBoxSize(commonData, \"PageArea\") : null) ?? physicalBoxSize(root, \"Area\"),\n\t\tlayers: childrenNamed(layerParent, \"Layer\").map((layer) => ({\n\t\t\tid: layer.getAttribute(\"ID\"),\n\t\t\ttype: parseLayerType(layer.getAttribute(\"Type\"))\n\t\t}))\n\t};\n}\nfunction parsePageSize(commonData) {\n\tconst width = parseNumber(childText(commonData, \"PageWidth\"));\n\tconst height = parseNumber(childText(commonData, \"PageHeight\"));\n\treturn width !== null && height !== null ? {\n\t\twidth,\n\t\theight\n\t} : null;\n}\nfunction parseNumber(value) {\n\tif (value === null || value.trim() === \"\") return null;\n\tconst parsed = Number(value);\n\treturn Number.isFinite(parsed) ? parsed : null;\n}\nfunction parseLayerType(value) {\n\tconst lowered = value?.toLowerCase();\n\treturn lowered === \"background\" || lowered === \"body\" || lowered === \"foreground\" || lowered === \"annotation\" ? lowered : null;\n}\nexport { childElements, childrenNamed, firstChildNamed, joinZipPath, localNameOf, parseDocumentRes, parseDocumentXml, parseLayerType, parseOfdRoot, parsePageXml, parseXml, rootElementOf };\n\n//# sourceMappingURL=xml.js.map"],"mappings":";;;;AAIA,SAAS,cAAc,SAAS;CAC/B,MAAM,MAAM,CAAC;CACb,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,WAAW,QAAQ,KAAK;EACnD,MAAM,OAAO,QAAQ,WAAW;EAChC,IAAI,QAAQ,KAAK,aAAa,GAAG,IAAI,KAAK,IAAI;CAC/C;CACA,OAAO;AACR;AACA,SAAS,YAAY,SAAS;CAC7B,IAAI,QAAQ,WAAW,OAAO,QAAQ;CACtC,MAAM,MAAM,QAAQ;CACpB,OAAO,IAAI,SAAS,GAAG,IAAI,IAAI,MAAM,IAAI,QAAQ,GAAG,IAAI,CAAC,IAAI;AAC9D;AACA,SAAS,cAAc,SAAS,MAAM;CACrC,OAAO,cAAc,OAAO,CAAC,CAAC,QAAQ,UAAU,YAAY,KAAK,MAAM,IAAI;AAC5E;AACA,SAAS,gBAAgB,SAAS,MAAM;CACvC,OAAO,cAAc,SAAS,IAAI,CAAC,CAAC,MAAM;AAC3C;AACA,SAAS,UAAU,SAAS,MAAM;CACjC,OAAO,gBAAgB,SAAS,IAAI,CAAC,EAAE,eAAe;AACvD;AACA,SAAS,eAAe,OAAO;CAC9B,MAAM,OAAO,OAAO,KAAK;CACzB,OAAO,OAAO,OAAO;AACtB;AACA,SAAS,SAAS,KAAK,QAAQ;CAC9B,IAAI;CACJ,I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Y,UAAU,YAAY,gBAAgB,YAAY,eAAe,UAAU;AAC3H"}
|
package/dist/style.d.ts
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import "./components/button/style.js";
|
|
2
|
-
import "./components/pop-confirm/style.js";
|
|
3
1
|
import "./components/action/style.js";
|
|
4
|
-
import "./components/dropdown/style.js";
|
|
5
2
|
import "./components/auto-complete/style.js";
|
|
6
|
-
import "./components/dialog/style.js";
|
|
7
|
-
import "./components/table/style.js";
|
|
8
3
|
import "./components/batch-edit/style.js";
|
|
4
|
+
import "./components/button/style.js";
|
|
9
5
|
import "./components/cascade/style.js";
|
|
10
|
-
import "./components/select/style.js";
|
|
11
6
|
import "./components/code-editor/style.js";
|
|
12
7
|
import "./components/condition-editor/style.js";
|
|
13
8
|
import "./components/contextmenu/style.js";
|
|
14
9
|
import "./components/date-picker/style.js";
|
|
15
10
|
import "./components/date-range-picker/style.js";
|
|
16
|
-
import "./components/
|
|
11
|
+
import "./components/dialog/style.js";
|
|
12
|
+
import "./components/dropdown/style.js";
|
|
17
13
|
import "./components/float-button/style.js";
|
|
18
14
|
import "./components/group-input/style.js";
|
|
19
|
-
import "./components/list/style.js";
|
|
20
15
|
import "./components/loading/style.js";
|
|
16
|
+
import "./components/dual-nav/style.js";
|
|
21
17
|
import "./components/multi-select/style.js";
|
|
22
18
|
import "./components/multi-tree-select/style.js";
|
|
23
19
|
import "./components/number-input/style.js";
|
|
24
20
|
import "./components/number-range-input/style.js";
|
|
25
21
|
import "./components/paginator/style.js";
|
|
26
22
|
import "./components/palette/style.js";
|
|
23
|
+
import "./components/pop-confirm/style.js";
|
|
24
|
+
import "./components/select/style.js";
|
|
27
25
|
import "./components/table-editor/style.js";
|
|
26
|
+
import "./components/table/style.js";
|
|
28
27
|
import "./components/tabs/style.js";
|
|
29
28
|
import "./components/theme/style.js";
|
|
30
29
|
import "./components/tree-select/style.js";
|
package/dist/style.js
CHANGED
|
@@ -1,79 +1,77 @@
|
|
|
1
|
-
import "./components/
|
|
2
|
-
import "./components/
|
|
3
|
-
import "./components/
|
|
4
|
-
import "./components/
|
|
5
|
-
import "./components/
|
|
6
|
-
import "./components/select/style.js";
|
|
7
|
-
import "./components/tip/style.js";
|
|
8
|
-
import "./components/expression-editor/style.js";
|
|
9
|
-
import "./components/condition-editor/style.js";
|
|
10
|
-
import "./components/loading/style.js";
|
|
11
|
-
import "./components/tabs/style.js";
|
|
12
|
-
import "./components/tag/style.js";
|
|
13
|
-
import "./components/checkbox/style.js";
|
|
14
|
-
import "./components/tree/style.js";
|
|
15
|
-
import "./components/tree-select/style.js";
|
|
16
|
-
import "./components/code-editor/style.js";
|
|
17
|
-
import "./components/drawer/style.js";
|
|
18
|
-
import "./components/form-item/style.js";
|
|
19
|
-
import "./components/grid/style.js";
|
|
20
|
-
import "./components/form/style.js";
|
|
21
|
-
import "./components/message-confirm/style.js";
|
|
1
|
+
import "./components/action/style.js";
|
|
2
|
+
import "./components/auto-complete/style.js";
|
|
3
|
+
import "./components/badge/style.js";
|
|
4
|
+
import "./components/batch-edit/style.js";
|
|
5
|
+
import "./components/breadcrumb/style.js";
|
|
22
6
|
import "./components/button/style.js";
|
|
23
7
|
import "./components/calendar/style.js";
|
|
24
|
-
import "./components/radio/style.js";
|
|
25
8
|
import "./components/card/style.js";
|
|
9
|
+
import "./components/cascade/style.js";
|
|
10
|
+
import "./components/check-tag/style.js";
|
|
11
|
+
import "./components/checkbox-group/style.js";
|
|
12
|
+
import "./components/checkbox/style.js";
|
|
13
|
+
import "./components/code-editor/style.js";
|
|
14
|
+
import "./components/collapse/style.js";
|
|
15
|
+
import "./components/condition-editor/style.js";
|
|
16
|
+
import "./components/contextmenu/style.js";
|
|
26
17
|
import "./components/date-panel/style.js";
|
|
18
|
+
import "./components/date-picker/style.js";
|
|
27
19
|
import "./components/date-range-picker/style.js";
|
|
28
|
-
import "./components/
|
|
29
|
-
import "./components/
|
|
30
|
-
import "./components/
|
|
31
|
-
import "./components/
|
|
32
|
-
import "./components/
|
|
33
|
-
import "./components/
|
|
34
|
-
import "./components/
|
|
20
|
+
import "./components/dialog/style.js";
|
|
21
|
+
import "./components/drawer/style.js";
|
|
22
|
+
import "./components/dropdown/style.js";
|
|
23
|
+
import "./components/empty/style.js";
|
|
24
|
+
import "./components/expression-editor/style.js";
|
|
25
|
+
import "./components/file-picker/style.js";
|
|
26
|
+
import "./components/file-viewer/style.js";
|
|
27
|
+
import "./components/float-button/style.js";
|
|
28
|
+
import "./components/form-item/style.js";
|
|
29
|
+
import "./components/form/style.js";
|
|
35
30
|
import "./components/gantt-chart/style.js";
|
|
31
|
+
import "./components/grid-input/style.js";
|
|
32
|
+
import "./components/grid/style.js";
|
|
33
|
+
import "./components/group-input/style.js";
|
|
34
|
+
import "./components/icon/style.js";
|
|
35
|
+
import "./components/kbd/style.js";
|
|
36
|
+
import "./components/input/style.js";
|
|
37
|
+
import "./components/layout/style.js";
|
|
38
|
+
import "./components/loading/style.js";
|
|
39
|
+
import "./components/dual-nav/style.js";
|
|
40
|
+
import "./components/group-nav/style.js";
|
|
41
|
+
import "./components/nav/style.js";
|
|
42
|
+
import "./components/message-confirm/style.js";
|
|
36
43
|
import "./components/message/style.js";
|
|
37
|
-
import "./components/
|
|
44
|
+
import "./components/multi-select/style.js";
|
|
45
|
+
import "./components/multi-tree-select/style.js";
|
|
46
|
+
import "./components/node-render/style.js";
|
|
47
|
+
import "./components/notification/style.js";
|
|
38
48
|
import "./components/number-input/style.js";
|
|
39
49
|
import "./components/number-range-input/style.js";
|
|
40
|
-
import "./components/collapse/style.js";
|
|
41
|
-
import "./components/table/style.js";
|
|
42
|
-
import "./components/table-editor/style.js";
|
|
43
|
-
import "./components/check-tag/style.js";
|
|
44
|
-
import "./components/contextmenu/style.js";
|
|
45
|
-
import "./components/password-input/style.js";
|
|
46
50
|
import "./components/number/style.js";
|
|
47
|
-
import "./components/
|
|
48
|
-
import "./components/watermark/style.js";
|
|
49
|
-
import "./components/pop-confirm/style.js";
|
|
50
|
-
import "./components/action/style.js";
|
|
51
|
-
import "./components/kbd/style.js";
|
|
52
|
-
import "./components/batch-edit/style.js";
|
|
53
|
-
import "./components/textarea/style.js";
|
|
54
|
-
import "./components/cascade/style.js";
|
|
55
|
-
import "./components/steps/style.js";
|
|
56
|
-
import "./components/date-picker/style.js";
|
|
51
|
+
import "./components/paginator/style.js";
|
|
57
52
|
import "./components/palette/style.js";
|
|
58
|
-
import "./components/
|
|
59
|
-
import "./components/
|
|
60
|
-
import "./components/
|
|
53
|
+
import "./components/password-input/style.js";
|
|
54
|
+
import "./components/pop-confirm/style.js";
|
|
55
|
+
import "./components/progress/style.js";
|
|
56
|
+
import "./components/chip-group/style.js";
|
|
57
|
+
import "./components/chip/style.js";
|
|
58
|
+
import "./components/radio-group/style.js";
|
|
59
|
+
import "./components/radio/style.js";
|
|
61
60
|
import "./components/rich-text-editor/style.js";
|
|
62
|
-
import "./components/
|
|
63
|
-
import "./components/
|
|
64
|
-
import "./components/
|
|
65
|
-
import "./components/
|
|
61
|
+
import "./components/scroll/style.js";
|
|
62
|
+
import "./components/select/style.js";
|
|
63
|
+
import "./components/segment/style.js";
|
|
64
|
+
import "./components/slider/style.js";
|
|
65
|
+
import "./components/steps/style.js";
|
|
66
66
|
import "./components/switch/style.js";
|
|
67
|
-
import "./components/
|
|
68
|
-
import "./components/
|
|
69
|
-
import "./components/
|
|
70
|
-
import "./components/
|
|
71
|
-
import "./components/file-viewer/style.js";
|
|
67
|
+
import "./components/table-editor/style.js";
|
|
68
|
+
import "./components/table/style.js";
|
|
69
|
+
import "./components/tabs/style.js";
|
|
70
|
+
import "./components/tag/style.js";
|
|
72
71
|
import "./components/text/style.js";
|
|
73
|
-
import "./components/
|
|
74
|
-
import "./components/
|
|
75
|
-
import "./components/
|
|
76
|
-
import "./components/
|
|
77
|
-
import "./components/
|
|
78
|
-
import "./components/
|
|
79
|
-
import "./components/node-render/style.js";
|
|
72
|
+
import "./components/textarea/style.js";
|
|
73
|
+
import "./components/theme/style.js";
|
|
74
|
+
import "./components/tip/style.js";
|
|
75
|
+
import "./components/tree-select/style.js";
|
|
76
|
+
import "./components/tree/style.js";
|
|
77
|
+
import "./components/watermark/style.js";
|