velo-text 1.0.0-beta.1
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/CHANGELOG.md +70 -0
- package/LICENSE +21 -0
- package/README.md +122 -0
- package/dist/adapters/backend/index.d.ts +4 -0
- package/dist/adapters/backend/index.d.ts.map +1 -0
- package/dist/adapters/backend/index.js +3 -0
- package/dist/adapters/backend/index.js.map +1 -0
- package/dist/adapters/backend/pdf-http.d.ts +48 -0
- package/dist/adapters/backend/pdf-http.d.ts.map +1 -0
- package/dist/adapters/backend/pdf-http.js +117 -0
- package/dist/adapters/backend/pdf-http.js.map +1 -0
- package/dist/adapters/backend/sinks.d.ts +7 -0
- package/dist/adapters/backend/sinks.d.ts.map +1 -0
- package/dist/adapters/backend/sinks.js +43 -0
- package/dist/adapters/backend/sinks.js.map +1 -0
- package/dist/adapters/browser/index.d.ts +11 -0
- package/dist/adapters/browser/index.d.ts.map +1 -0
- package/dist/adapters/browser/index.js +51 -0
- package/dist/adapters/browser/index.js.map +1 -0
- package/dist/adapters/postgres-contract/index.d.ts +45 -0
- package/dist/adapters/postgres-contract/index.d.ts.map +1 -0
- package/dist/adapters/postgres-contract/index.js +108 -0
- package/dist/adapters/postgres-contract/index.js.map +1 -0
- package/dist/adapters/s3-compatible/index.d.ts +46 -0
- package/dist/adapters/s3-compatible/index.d.ts.map +1 -0
- package/dist/adapters/s3-compatible/index.js +106 -0
- package/dist/adapters/s3-compatible/index.js.map +1 -0
- package/dist/adapters/vanilla.d.ts +5 -0
- package/dist/adapters/vanilla.d.ts.map +1 -0
- package/dist/adapters/vanilla.js +6 -0
- package/dist/adapters/vanilla.js.map +1 -0
- package/dist/assets/dimensions/index.d.ts +12 -0
- package/dist/assets/dimensions/index.d.ts.map +1 -0
- package/dist/assets/dimensions/index.js +46 -0
- package/dist/assets/dimensions/index.js.map +1 -0
- package/dist/assets/hashing/index.d.ts +7 -0
- package/dist/assets/hashing/index.d.ts.map +1 -0
- package/dist/assets/hashing/index.js +21 -0
- package/dist/assets/hashing/index.js.map +1 -0
- package/dist/assets/icons/index.d.ts +25 -0
- package/dist/assets/icons/index.d.ts.map +1 -0
- package/dist/assets/icons/index.js +107 -0
- package/dist/assets/icons/index.js.map +1 -0
- package/dist/assets/png/placeholder.d.ts +4 -0
- package/dist/assets/png/placeholder.d.ts.map +1 -0
- package/dist/assets/png/placeholder.js +13 -0
- package/dist/assets/png/placeholder.js.map +1 -0
- package/dist/assets/sniff/index.d.ts +13 -0
- package/dist/assets/sniff/index.d.ts.map +1 -0
- package/dist/assets/sniff/index.js +41 -0
- package/dist/assets/sniff/index.js.map +1 -0
- package/dist/assets/store/index.d.ts +56 -0
- package/dist/assets/store/index.d.ts.map +1 -0
- package/dist/assets/store/index.js +102 -0
- package/dist/assets/store/index.js.map +1 -0
- package/dist/assets/svg/index.d.ts +7 -0
- package/dist/assets/svg/index.d.ts.map +1 -0
- package/dist/assets/svg/index.js +82 -0
- package/dist/assets/svg/index.js.map +1 -0
- package/dist/core/equation/html.d.ts +3 -0
- package/dist/core/equation/html.d.ts.map +1 -0
- package/dist/core/equation/html.js +138 -0
- package/dist/core/equation/html.js.map +1 -0
- package/dist/core/equation/index.d.ts +19 -0
- package/dist/core/equation/index.d.ts.map +1 -0
- package/dist/core/equation/index.js +107 -0
- package/dist/core/equation/index.js.map +1 -0
- package/dist/core/events/index.d.ts +13 -0
- package/dist/core/events/index.d.ts.map +1 -0
- package/dist/core/events/index.js +18 -0
- package/dist/core/events/index.js.map +1 -0
- package/dist/core/history/history.d.ts +29 -0
- package/dist/core/history/history.d.ts.map +1 -0
- package/dist/core/history/history.js +55 -0
- package/dist/core/history/history.js.map +1 -0
- package/dist/core/history/index.d.ts +2 -0
- package/dist/core/history/index.d.ts.map +1 -0
- package/dist/core/history/index.js +2 -0
- package/dist/core/history/index.js.map +1 -0
- package/dist/core/model/block.d.ts +121 -0
- package/dist/core/model/block.d.ts.map +1 -0
- package/dist/core/model/block.js +2 -0
- package/dist/core/model/block.js.map +1 -0
- package/dist/core/model/document.d.ts +70 -0
- package/dist/core/model/document.d.ts.map +1 -0
- package/dist/core/model/document.js +2 -0
- package/dist/core/model/document.js.map +1 -0
- package/dist/core/model/factories.d.ts +35 -0
- package/dist/core/model/factories.d.ts.map +1 -0
- package/dist/core/model/factories.js +115 -0
- package/dist/core/model/factories.js.map +1 -0
- package/dist/core/model/index.d.ts +4 -0
- package/dist/core/model/index.d.ts.map +1 -0
- package/dist/core/model/index.js +4 -0
- package/dist/core/model/index.js.map +1 -0
- package/dist/core/model/inline.d.ts +43 -0
- package/dist/core/model/inline.d.ts.map +1 -0
- package/dist/core/model/inline.js +2 -0
- package/dist/core/model/inline.js.map +1 -0
- package/dist/core/model/primitives.d.ts +36 -0
- package/dist/core/model/primitives.d.ts.map +1 -0
- package/dist/core/model/primitives.js +3 -0
- package/dist/core/model/primitives.js.map +1 -0
- package/dist/core/model/table-look.d.ts +12 -0
- package/dist/core/model/table-look.d.ts.map +1 -0
- package/dist/core/model/table-look.js +99 -0
- package/dist/core/model/table-look.js.map +1 -0
- package/dist/core/model/types.d.ts +5 -0
- package/dist/core/model/types.d.ts.map +1 -0
- package/dist/core/model/types.js +5 -0
- package/dist/core/model/types.js.map +1 -0
- package/dist/core/normalize/index.d.ts +2 -0
- package/dist/core/normalize/index.d.ts.map +1 -0
- package/dist/core/normalize/index.js +2 -0
- package/dist/core/normalize/index.js.map +1 -0
- package/dist/core/normalize/normalize.d.ts +8 -0
- package/dist/core/normalize/normalize.d.ts.map +1 -0
- package/dist/core/normalize/normalize.js +145 -0
- package/dist/core/normalize/normalize.js.map +1 -0
- package/dist/core/operations/index.d.ts +2 -0
- package/dist/core/operations/index.d.ts.map +1 -0
- package/dist/core/operations/index.js +2 -0
- package/dist/core/operations/index.js.map +1 -0
- package/dist/core/operations/operations.d.ts +53 -0
- package/dist/core/operations/operations.d.ts.map +1 -0
- package/dist/core/operations/operations.js +92 -0
- package/dist/core/operations/operations.js.map +1 -0
- package/dist/core/plugin/index.d.ts +84 -0
- package/dist/core/plugin/index.d.ts.map +1 -0
- package/dist/core/plugin/index.js +137 -0
- package/dist/core/plugin/index.js.map +1 -0
- package/dist/core/schema/canonical.d.ts +6 -0
- package/dist/core/schema/canonical.d.ts.map +1 -0
- package/dist/core/schema/canonical.js +42 -0
- package/dist/core/schema/canonical.js.map +1 -0
- package/dist/core/schema/index.d.ts +3 -0
- package/dist/core/schema/index.d.ts.map +1 -0
- package/dist/core/schema/index.js +3 -0
- package/dist/core/schema/index.js.map +1 -0
- package/dist/core/schema/validator.d.ts +23 -0
- package/dist/core/schema/validator.d.ts.map +1 -0
- package/dist/core/schema/validator.js +276 -0
- package/dist/core/schema/validator.js.map +1 -0
- package/dist/core/selection/index.d.ts +2 -0
- package/dist/core/selection/index.d.ts.map +1 -0
- package/dist/core/selection/index.js +2 -0
- package/dist/core/selection/index.js.map +1 -0
- package/dist/core/selection/selection.d.ts +12 -0
- package/dist/core/selection/selection.d.ts.map +1 -0
- package/dist/core/selection/selection.js +38 -0
- package/dist/core/selection/selection.js.map +1 -0
- package/dist/editor-web/accessibility/index.d.ts +40 -0
- package/dist/editor-web/accessibility/index.d.ts.map +1 -0
- package/dist/editor-web/accessibility/index.js +170 -0
- package/dist/editor-web/accessibility/index.js.map +1 -0
- package/dist/editor-web/clipboard/index.d.ts +52 -0
- package/dist/editor-web/clipboard/index.d.ts.map +1 -0
- package/dist/editor-web/clipboard/index.js +154 -0
- package/dist/editor-web/clipboard/index.js.map +1 -0
- package/dist/editor-web/controller/column-presets.d.ts +9 -0
- package/dist/editor-web/controller/column-presets.d.ts.map +1 -0
- package/dist/editor-web/controller/column-presets.js +11 -0
- package/dist/editor-web/controller/column-presets.js.map +1 -0
- package/dist/editor-web/controller/column-resize.d.ts +6 -0
- package/dist/editor-web/controller/column-resize.d.ts.map +1 -0
- package/dist/editor-web/controller/column-resize.js +119 -0
- package/dist/editor-web/controller/column-resize.js.map +1 -0
- package/dist/editor-web/controller/columns-ui.d.ts +5 -0
- package/dist/editor-web/controller/columns-ui.d.ts.map +1 -0
- package/dist/editor-web/controller/columns-ui.js +107 -0
- package/dist/editor-web/controller/columns-ui.js.map +1 -0
- package/dist/editor-web/controller/commands.d.ts +27 -0
- package/dist/editor-web/controller/commands.d.ts.map +1 -0
- package/dist/editor-web/controller/commands.js +198 -0
- package/dist/editor-web/controller/commands.js.map +1 -0
- package/dist/editor-web/controller/format-commands.d.ts +12 -0
- package/dist/editor-web/controller/format-commands.d.ts.map +1 -0
- package/dist/editor-web/controller/format-commands.js +77 -0
- package/dist/editor-web/controller/format-commands.js.map +1 -0
- package/dist/editor-web/controller/handles.d.ts +7 -0
- package/dist/editor-web/controller/handles.d.ts.map +1 -0
- package/dist/editor-web/controller/handles.js +205 -0
- package/dist/editor-web/controller/handles.js.map +1 -0
- package/dist/editor-web/controller/host.d.ts +8 -0
- package/dist/editor-web/controller/host.d.ts.map +1 -0
- package/dist/editor-web/controller/host.js +48 -0
- package/dist/editor-web/controller/host.js.map +1 -0
- package/dist/editor-web/controller/image-resize.d.ts +9 -0
- package/dist/editor-web/controller/image-resize.d.ts.map +1 -0
- package/dist/editor-web/controller/image-resize.js +163 -0
- package/dist/editor-web/controller/image-resize.js.map +1 -0
- package/dist/editor-web/controller/index.d.ts +6 -0
- package/dist/editor-web/controller/index.d.ts.map +1 -0
- package/dist/editor-web/controller/index.js +190 -0
- package/dist/editor-web/controller/index.js.map +1 -0
- package/dist/editor-web/controller/nesting.d.ts +27 -0
- package/dist/editor-web/controller/nesting.d.ts.map +1 -0
- package/dist/editor-web/controller/nesting.js +218 -0
- package/dist/editor-web/controller/nesting.js.map +1 -0
- package/dist/editor-web/controller/place-overlay.d.ts +6 -0
- package/dist/editor-web/controller/place-overlay.d.ts.map +1 -0
- package/dist/editor-web/controller/place-overlay.js +55 -0
- package/dist/editor-web/controller/place-overlay.js.map +1 -0
- package/dist/editor-web/controller/size-picker.d.ts +28 -0
- package/dist/editor-web/controller/size-picker.d.ts.map +1 -0
- package/dist/editor-web/controller/size-picker.js +177 -0
- package/dist/editor-web/controller/size-picker.js.map +1 -0
- package/dist/editor-web/controller/table-resize.d.ts +14 -0
- package/dist/editor-web/controller/table-resize.d.ts.map +1 -0
- package/dist/editor-web/controller/table-resize.js +178 -0
- package/dist/editor-web/controller/table-resize.js.map +1 -0
- package/dist/editor-web/controller/table-ui.d.ts +5 -0
- package/dist/editor-web/controller/table-ui.d.ts.map +1 -0
- package/dist/editor-web/controller/table-ui.js +214 -0
- package/dist/editor-web/controller/table-ui.js.map +1 -0
- package/dist/editor-web/controller/types.d.ts +95 -0
- package/dist/editor-web/controller/types.d.ts.map +1 -0
- package/dist/editor-web/controller/types.js +4 -0
- package/dist/editor-web/controller/types.js.map +1 -0
- package/dist/editor-web/controller/variable-ui.d.ts +5 -0
- package/dist/editor-web/controller/variable-ui.d.ts.map +1 -0
- package/dist/editor-web/controller/variable-ui.js +75 -0
- package/dist/editor-web/controller/variable-ui.js.map +1 -0
- package/dist/editor-web/images/index.d.ts +9 -0
- package/dist/editor-web/images/index.d.ts.map +1 -0
- package/dist/editor-web/images/index.js +18 -0
- package/dist/editor-web/images/index.js.map +1 -0
- package/dist/editor-web/index.d.ts +10 -0
- package/dist/editor-web/index.d.ts.map +1 -0
- package/dist/editor-web/index.js +10 -0
- package/dist/editor-web/index.js.map +1 -0
- package/dist/editor-web/input/index.d.ts +75 -0
- package/dist/editor-web/input/index.d.ts.map +1 -0
- package/dist/editor-web/input/index.js +151 -0
- package/dist/editor-web/input/index.js.map +1 -0
- package/dist/editor-web/tables/index.d.ts +47 -0
- package/dist/editor-web/tables/index.d.ts.map +1 -0
- package/dist/editor-web/tables/index.js +159 -0
- package/dist/editor-web/tables/index.js.map +1 -0
- package/dist/editor-web/toolbar/index.d.ts +17 -0
- package/dist/editor-web/toolbar/index.d.ts.map +1 -0
- package/dist/editor-web/toolbar/index.js +36 -0
- package/dist/editor-web/toolbar/index.js.map +1 -0
- package/dist/editor-web/ux/attach.d.ts +21 -0
- package/dist/editor-web/ux/attach.d.ts.map +1 -0
- package/dist/editor-web/ux/attach.js +61 -0
- package/dist/editor-web/ux/attach.js.map +1 -0
- package/dist/editor-web/ux/command-palette.d.ts +11 -0
- package/dist/editor-web/ux/command-palette.d.ts.map +1 -0
- package/dist/editor-web/ux/command-palette.js +135 -0
- package/dist/editor-web/ux/command-palette.js.map +1 -0
- package/dist/editor-web/ux/equation-editor.d.ts +11 -0
- package/dist/editor-web/ux/equation-editor.d.ts.map +1 -0
- package/dist/editor-web/ux/equation-editor.js +130 -0
- package/dist/editor-web/ux/equation-editor.js.map +1 -0
- package/dist/editor-web/ux/equation-palette.d.ts +11 -0
- package/dist/editor-web/ux/equation-palette.d.ts.map +1 -0
- package/dist/editor-web/ux/equation-palette.js +90 -0
- package/dist/editor-web/ux/equation-palette.js.map +1 -0
- package/dist/editor-web/ux/find-replace.d.ts +6 -0
- package/dist/editor-web/ux/find-replace.d.ts.map +1 -0
- package/dist/editor-web/ux/find-replace.js +125 -0
- package/dist/editor-web/ux/find-replace.js.map +1 -0
- package/dist/editor-web/ux/find-text.d.ts +10 -0
- package/dist/editor-web/ux/find-text.d.ts.map +1 -0
- package/dist/editor-web/ux/find-text.js +101 -0
- package/dist/editor-web/ux/find-text.js.map +1 -0
- package/dist/editor-web/ux/image-drop.d.ts +7 -0
- package/dist/editor-web/ux/image-drop.d.ts.map +1 -0
- package/dist/editor-web/ux/image-drop.js +198 -0
- package/dist/editor-web/ux/image-drop.js.map +1 -0
- package/dist/editor-web/ux/link-ui.d.ts +6 -0
- package/dist/editor-web/ux/link-ui.d.ts.map +1 -0
- package/dist/editor-web/ux/link-ui.js +50 -0
- package/dist/editor-web/ux/link-ui.js.map +1 -0
- package/dist/editor-web/ux/outline.d.ts +9 -0
- package/dist/editor-web/ux/outline.d.ts.map +1 -0
- package/dist/editor-web/ux/outline.js +48 -0
- package/dist/editor-web/ux/outline.js.map +1 -0
- package/dist/editor-web/ux/page-preview.d.ts +6 -0
- package/dist/editor-web/ux/page-preview.d.ts.map +1 -0
- package/dist/editor-web/ux/page-preview.js +90 -0
- package/dist/editor-web/ux/page-preview.js.map +1 -0
- package/dist/editor-web/ux/selection-bubble.d.ts +6 -0
- package/dist/editor-web/ux/selection-bubble.d.ts.map +1 -0
- package/dist/editor-web/ux/selection-bubble.js +79 -0
- package/dist/editor-web/ux/selection-bubble.js.map +1 -0
- package/dist/editor-web/ux/shortcuts-sheet.d.ts +6 -0
- package/dist/editor-web/ux/shortcuts-sheet.d.ts.map +1 -0
- package/dist/editor-web/ux/shortcuts-sheet.js +58 -0
- package/dist/editor-web/ux/shortcuts-sheet.js.map +1 -0
- package/dist/editor-web/view/index.d.ts +3 -0
- package/dist/editor-web/view/index.d.ts.map +1 -0
- package/dist/editor-web/view/index.js +3 -0
- package/dist/editor-web/view/index.js.map +1 -0
- package/dist/editor-web/view/parse-inlines.d.ts +15 -0
- package/dist/editor-web/view/parse-inlines.d.ts.map +1 -0
- package/dist/editor-web/view/parse-inlines.js +107 -0
- package/dist/editor-web/view/parse-inlines.js.map +1 -0
- package/dist/editor-web/view/parse.d.ts +8 -0
- package/dist/editor-web/view/parse.d.ts.map +1 -0
- package/dist/editor-web/view/parse.js +238 -0
- package/dist/editor-web/view/parse.js.map +1 -0
- package/dist/editor-web/view/reconcile.d.ts +26 -0
- package/dist/editor-web/view/reconcile.d.ts.map +1 -0
- package/dist/editor-web/view/reconcile.js +142 -0
- package/dist/editor-web/view/reconcile.js.map +1 -0
- package/dist/editor-web/view/render.d.ts +14 -0
- package/dist/editor-web/view/render.d.ts.map +1 -0
- package/dist/editor-web/view/render.js +162 -0
- package/dist/editor-web/view/render.js.map +1 -0
- package/dist/export/docx/document-xml.d.ts +3 -0
- package/dist/export/docx/document-xml.d.ts.map +1 -0
- package/dist/export/docx/document-xml.js +218 -0
- package/dist/export/docx/document-xml.js.map +1 -0
- package/dist/export/docx/package-parts.d.ts +9 -0
- package/dist/export/docx/package-parts.d.ts.map +1 -0
- package/dist/export/docx/package-parts.js +91 -0
- package/dist/export/docx/package-parts.js.map +1 -0
- package/dist/export/docx/writer.d.ts +17 -0
- package/dist/export/docx/writer.d.ts.map +1 -0
- package/dist/export/docx/writer.js +48 -0
- package/dist/export/docx/writer.js.map +1 -0
- package/dist/export/images/downsample.d.ts +19 -0
- package/dist/export/images/downsample.d.ts.map +1 -0
- package/dist/export/images/downsample.js +64 -0
- package/dist/export/images/downsample.js.map +1 -0
- package/dist/export/images/png-encode.d.ts +4 -0
- package/dist/export/images/png-encode.d.ts.map +1 -0
- package/dist/export/images/png-encode.js +86 -0
- package/dist/export/images/png-encode.js.map +1 -0
- package/dist/export/images/prepare.d.ts +22 -0
- package/dist/export/images/prepare.d.ts.map +1 -0
- package/dist/export/images/prepare.js +29 -0
- package/dist/export/images/prepare.js.map +1 -0
- package/dist/export/images/rasterize.d.ts +7 -0
- package/dist/export/images/rasterize.d.ts.map +1 -0
- package/dist/export/images/rasterize.js +62 -0
- package/dist/export/images/rasterize.js.map +1 -0
- package/dist/export/index.d.ts +45 -0
- package/dist/export/index.d.ts.map +1 -0
- package/dist/export/index.js +52 -0
- package/dist/export/index.js.map +1 -0
- package/dist/export/layout/index.d.ts +23 -0
- package/dist/export/layout/index.d.ts.map +1 -0
- package/dist/export/layout/index.js +18 -0
- package/dist/export/layout/index.js.map +1 -0
- package/dist/export/layout/layout-blocks.d.ts +5 -0
- package/dist/export/layout/layout-blocks.d.ts.map +1 -0
- package/dist/export/layout/layout-blocks.js +91 -0
- package/dist/export/layout/layout-blocks.js.map +1 -0
- package/dist/export/layout/layout-flow.d.ts +25 -0
- package/dist/export/layout/layout-flow.d.ts.map +1 -0
- package/dist/export/layout/layout-flow.js +23 -0
- package/dist/export/layout/layout-flow.js.map +1 -0
- package/dist/export/layout/layout-structured.d.ts +4 -0
- package/dist/export/layout/layout-structured.d.ts.map +1 -0
- package/dist/export/layout/layout-structured.js +153 -0
- package/dist/export/layout/layout-structured.js.map +1 -0
- package/dist/export/layout/layout-types.d.ts +35 -0
- package/dist/export/layout/layout-types.d.ts.map +1 -0
- package/dist/export/layout/layout-types.js +2 -0
- package/dist/export/layout/layout-types.js.map +1 -0
- package/dist/export/layout/pagination.d.ts +9 -0
- package/dist/export/layout/pagination.d.ts.map +1 -0
- package/dist/export/layout/pagination.js +38 -0
- package/dist/export/layout/pagination.js.map +1 -0
- package/dist/export/layout/text.d.ts +47 -0
- package/dist/export/layout/text.d.ts.map +1 -0
- package/dist/export/layout/text.js +119 -0
- package/dist/export/layout/text.js.map +1 -0
- package/dist/export/layout/units.d.ts +30 -0
- package/dist/export/layout/units.d.ts.map +1 -0
- package/dist/export/layout/units.js +55 -0
- package/dist/export/layout/units.js.map +1 -0
- package/dist/export/odt/writer.d.ts +24 -0
- package/dist/export/odt/writer.d.ts.map +1 -0
- package/dist/export/odt/writer.js +258 -0
- package/dist/export/odt/writer.js.map +1 -0
- package/dist/export/pdf/assemble.d.ts +9 -0
- package/dist/export/pdf/assemble.d.ts.map +1 -0
- package/dist/export/pdf/assemble.js +105 -0
- package/dist/export/pdf/assemble.js.map +1 -0
- package/dist/export/pdf/diagnostics.d.ts +11 -0
- package/dist/export/pdf/diagnostics.d.ts.map +1 -0
- package/dist/export/pdf/diagnostics.js +88 -0
- package/dist/export/pdf/diagnostics.js.map +1 -0
- package/dist/export/pdf/equation.d.ts +55 -0
- package/dist/export/pdf/equation.d.ts.map +1 -0
- package/dist/export/pdf/equation.js +301 -0
- package/dist/export/pdf/equation.js.map +1 -0
- package/dist/export/pdf/export-pdf.d.ts +33 -0
- package/dist/export/pdf/export-pdf.d.ts.map +1 -0
- package/dist/export/pdf/export-pdf.js +54 -0
- package/dist/export/pdf/export-pdf.js.map +1 -0
- package/dist/export/pdf/fonts.d.ts +7 -0
- package/dist/export/pdf/fonts.d.ts.map +1 -0
- package/dist/export/pdf/fonts.js +15 -0
- package/dist/export/pdf/fonts.js.map +1 -0
- package/dist/export/pdf/image.d.ts +27 -0
- package/dist/export/pdf/image.d.ts.map +1 -0
- package/dist/export/pdf/image.js +271 -0
- package/dist/export/pdf/image.js.map +1 -0
- package/dist/export/pdf/layout-pages.d.ts +9 -0
- package/dist/export/pdf/layout-pages.d.ts.map +1 -0
- package/dist/export/pdf/layout-pages.js +174 -0
- package/dist/export/pdf/layout-pages.js.map +1 -0
- package/dist/export/pdf/layout-table.d.ts +29 -0
- package/dist/export/pdf/layout-table.d.ts.map +1 -0
- package/dist/export/pdf/layout-table.js +216 -0
- package/dist/export/pdf/layout-table.js.map +1 -0
- package/dist/export/pdf/page-metrics.d.ts +11 -0
- package/dist/export/pdf/page-metrics.d.ts.map +1 -0
- package/dist/export/pdf/page-metrics.js +14 -0
- package/dist/export/pdf/page-metrics.js.map +1 -0
- package/dist/export/pdf/pdf-model.d.ts +36 -0
- package/dist/export/pdf/pdf-model.d.ts.map +1 -0
- package/dist/export/pdf/pdf-model.js +4 -0
- package/dist/export/pdf/pdf-model.js.map +1 -0
- package/dist/export/pdf/stream.d.ts +6 -0
- package/dist/export/pdf/stream.d.ts.map +1 -0
- package/dist/export/pdf/stream.js +213 -0
- package/dist/export/pdf/stream.js.map +1 -0
- package/dist/export/pdf/writer.d.ts +26 -0
- package/dist/export/pdf/writer.d.ts.map +1 -0
- package/dist/export/pdf/writer.js +31 -0
- package/dist/export/pdf/writer.js.map +1 -0
- package/dist/export/validate.d.ts +29 -0
- package/dist/export/validate.d.ts.map +1 -0
- package/dist/export/validate.js +127 -0
- package/dist/export/validate.js.map +1 -0
- package/dist/export/xml/writer.d.ts +19 -0
- package/dist/export/xml/writer.d.ts.map +1 -0
- package/dist/export/xml/writer.js +57 -0
- package/dist/export/xml/writer.js.map +1 -0
- package/dist/export/zip/crc32.d.ts +2 -0
- package/dist/export/zip/crc32.d.ts.map +1 -0
- package/dist/export/zip/crc32.js +20 -0
- package/dist/export/zip/crc32.js.map +1 -0
- package/dist/export/zip/deflate.d.ts +15 -0
- package/dist/export/zip/deflate.d.ts.map +1 -0
- package/dist/export/zip/deflate.js +28 -0
- package/dist/export/zip/deflate.js.map +1 -0
- package/dist/export/zip/index.d.ts +3 -0
- package/dist/export/zip/index.d.ts.map +1 -0
- package/dist/export/zip/index.js +3 -0
- package/dist/export/zip/index.js.map +1 -0
- package/dist/export/zip/zipWriter.d.ts +23 -0
- package/dist/export/zip/zipWriter.d.ts.map +1 -0
- package/dist/export/zip/zipWriter.js +123 -0
- package/dist/export/zip/zipWriter.js.map +1 -0
- package/dist/public-api/index.d.ts +46 -0
- package/dist/public-api/index.d.ts.map +1 -0
- package/dist/public-api/index.js +40 -0
- package/dist/public-api/index.js.map +1 -0
- package/dist/template/diagnostics/index.d.ts +8 -0
- package/dist/template/diagnostics/index.d.ts.map +1 -0
- package/dist/template/diagnostics/index.js +4 -0
- package/dist/template/diagnostics/index.js.map +1 -0
- package/dist/template/formatter/index.d.ts +9 -0
- package/dist/template/formatter/index.d.ts.map +1 -0
- package/dist/template/formatter/index.js +27 -0
- package/dist/template/formatter/index.js.map +1 -0
- package/dist/template/index.d.ts +3 -0
- package/dist/template/index.d.ts.map +1 -0
- package/dist/template/index.js +3 -0
- package/dist/template/index.js.map +1 -0
- package/dist/template/parser/parser.d.ts +42 -0
- package/dist/template/parser/parser.d.ts.map +1 -0
- package/dist/template/parser/parser.js +135 -0
- package/dist/template/parser/parser.js.map +1 -0
- package/dist/template/resolver/format.d.ts +11 -0
- package/dist/template/resolver/format.d.ts.map +1 -0
- package/dist/template/resolver/format.js +80 -0
- package/dist/template/resolver/format.js.map +1 -0
- package/dist/template/resolver/resolver.d.ts +31 -0
- package/dist/template/resolver/resolver.d.ts.map +1 -0
- package/dist/template/resolver/resolver.js +218 -0
- package/dist/template/resolver/resolver.js.map +1 -0
- package/dist/theme/index.d.ts +26 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +87 -0
- package/dist/theme/index.js.map +1 -0
- package/package.json +110 -0
- package/schemas/portable-doc-v1.json +250 -0
- package/themes/base.css +71 -0
- package/themes/components.css +135 -0
- package/themes/editor-chrome.css +174 -0
- package/themes/editor-columns.css +121 -0
- package/themes/editor-overlays.css +464 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// Reference SQL — see migrations/001_init.sql for full schema
|
|
2
|
+
export const SQL_MIGRATION = `
|
|
3
|
+
-- See migrations/001_init.sql
|
|
4
|
+
`;
|
|
5
|
+
/**
|
|
6
|
+
* In-memory implementation for tests — respects optimistic concurrency control,
|
|
7
|
+
* idempotency keys, keyset pagination and transaction semantics.
|
|
8
|
+
*/
|
|
9
|
+
export function createInMemoryRepository() {
|
|
10
|
+
const store = new Map();
|
|
11
|
+
const revisions = new Map();
|
|
12
|
+
const idempotency = new Map();
|
|
13
|
+
const key = (id, tenant) => `${tenant}:${id}`;
|
|
14
|
+
const idemKey = (k, tenant) => `${tenant}:${k}`;
|
|
15
|
+
return {
|
|
16
|
+
async create(doc, tenantId, opts) {
|
|
17
|
+
if (opts?.idempotencyKey) {
|
|
18
|
+
const existing = idempotency.get(idemKey(opts.idempotencyKey, tenantId));
|
|
19
|
+
if (existing)
|
|
20
|
+
return existing;
|
|
21
|
+
}
|
|
22
|
+
const k = key(doc.id, tenantId);
|
|
23
|
+
if (store.has(k))
|
|
24
|
+
throw new Error("already exists");
|
|
25
|
+
const rec = {
|
|
26
|
+
id: doc.id,
|
|
27
|
+
tenantId,
|
|
28
|
+
title: doc.metadata.title ?? "Untitled",
|
|
29
|
+
schemaVersion: doc.schemaVersion,
|
|
30
|
+
currentRevision: doc.revision,
|
|
31
|
+
content: doc,
|
|
32
|
+
contentHash: new Uint8Array(32),
|
|
33
|
+
createdAt: doc.createdAt,
|
|
34
|
+
updatedAt: doc.updatedAt,
|
|
35
|
+
};
|
|
36
|
+
store.set(k, rec);
|
|
37
|
+
revisions.set(k, [rec]);
|
|
38
|
+
if (opts?.idempotencyKey)
|
|
39
|
+
idempotency.set(idemKey(opts.idempotencyKey, tenantId), rec);
|
|
40
|
+
return rec;
|
|
41
|
+
},
|
|
42
|
+
async get(id, tenantId) {
|
|
43
|
+
return store.get(key(id, tenantId)) ?? null;
|
|
44
|
+
},
|
|
45
|
+
async update(id, tenantId, expectedRevision, doc, opts) {
|
|
46
|
+
if (opts?.idempotencyKey) {
|
|
47
|
+
const existing = idempotency.get(idemKey(opts.idempotencyKey, tenantId));
|
|
48
|
+
if (existing)
|
|
49
|
+
return existing;
|
|
50
|
+
}
|
|
51
|
+
const k = key(id, tenantId);
|
|
52
|
+
const cur = store.get(k);
|
|
53
|
+
if (!cur)
|
|
54
|
+
throw new Error("not found");
|
|
55
|
+
if (cur.currentRevision !== expectedRevision) {
|
|
56
|
+
const err = new Error(`conflict: expected ${expectedRevision} got ${cur.currentRevision}`);
|
|
57
|
+
err.code = "CONFLICT";
|
|
58
|
+
err.currentRevision = cur.currentRevision;
|
|
59
|
+
throw err;
|
|
60
|
+
}
|
|
61
|
+
// Simulate transaction: document + revision + document_assets must be atomic
|
|
62
|
+
const next = {
|
|
63
|
+
...cur,
|
|
64
|
+
currentRevision: cur.currentRevision + 1,
|
|
65
|
+
content: { ...doc, revision: cur.currentRevision + 1 },
|
|
66
|
+
updatedAt: new Date().toISOString(),
|
|
67
|
+
};
|
|
68
|
+
// Atomic commit
|
|
69
|
+
store.set(k, next);
|
|
70
|
+
revisions.get(k).push(next);
|
|
71
|
+
if (opts?.idempotencyKey)
|
|
72
|
+
idempotency.set(idemKey(opts.idempotencyKey, tenantId), next);
|
|
73
|
+
return next;
|
|
74
|
+
},
|
|
75
|
+
async listRevisions(id, tenantId) {
|
|
76
|
+
return [...(revisions.get(key(id, tenantId)) ?? [])];
|
|
77
|
+
},
|
|
78
|
+
async restore(id, tenantId, revision) {
|
|
79
|
+
const k = key(id, tenantId);
|
|
80
|
+
const revs = revisions.get(k) ?? [];
|
|
81
|
+
const target = revs.find((r) => r.currentRevision === revision);
|
|
82
|
+
if (!target)
|
|
83
|
+
throw new Error("revision not found");
|
|
84
|
+
const restored = { ...target, currentRevision: store.get(k).currentRevision + 1, updatedAt: new Date().toISOString() };
|
|
85
|
+
store.set(k, restored);
|
|
86
|
+
revs.push(restored);
|
|
87
|
+
return restored;
|
|
88
|
+
},
|
|
89
|
+
async listDocuments(tenantId, opts = {}) {
|
|
90
|
+
const limit = opts.limit ?? 20;
|
|
91
|
+
const orderBy = opts.orderBy ?? "updatedAt";
|
|
92
|
+
const all = [...store.values()].filter((r) => r.tenantId === tenantId).sort((a, b) => b[orderBy].localeCompare(a[orderBy]));
|
|
93
|
+
let start = 0;
|
|
94
|
+
if (opts.cursor) {
|
|
95
|
+
const idx = all.findIndex((r) => r.id === opts.cursor);
|
|
96
|
+
if (idx !== -1)
|
|
97
|
+
start = idx + 1;
|
|
98
|
+
}
|
|
99
|
+
const sliced = all.slice(start, start + limit);
|
|
100
|
+
const nextCursor = all.length > start + limit ? sliced[sliced.length - 1].id : undefined;
|
|
101
|
+
return { documents: sliced, nextCursor };
|
|
102
|
+
},
|
|
103
|
+
async getIdempotency(keyStr, tenantId) {
|
|
104
|
+
return idempotency.get(idemKey(keyStr, tenantId)) ?? null;
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/postgres-contract/index.ts"],"names":[],"mappings":"AAiCA,8DAA8D;AAC9D,MAAM,CAAC,MAAM,aAAa,GAAG;;CAE5B,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,wBAAwB;IACtC,MAAM,KAAK,GAAG,IAAI,GAAG,EAA0B,CAAC;IAChD,MAAM,SAAS,GAAG,IAAI,GAAG,EAA4B,CAAC;IACtD,MAAM,WAAW,GAAG,IAAI,GAAG,EAAmB,CAAC;IAE/C,MAAM,GAAG,GAAG,CAAC,EAAU,EAAE,MAAc,EAAU,EAAE,CAAC,GAAG,MAAM,IAAI,EAAE,EAAE,CAAC;IACtE,MAAM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AC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,IAAI,IAAI,CAAC;QAC5D,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* S3-compatible adapter — Phase 5.2 / 8.2
|
|
3
|
+
* Presigned URL signing, direct upload with checksum, server-side confirmation
|
|
4
|
+
*/
|
|
5
|
+
export interface S3Config {
|
|
6
|
+
endpoint: string;
|
|
7
|
+
region: string;
|
|
8
|
+
accessKeyId: string;
|
|
9
|
+
secretAccessKey: string;
|
|
10
|
+
bucket: string;
|
|
11
|
+
forcePathStyle?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface UploadIntent {
|
|
14
|
+
sha256: string;
|
|
15
|
+
byteLength: number;
|
|
16
|
+
mediaType: string;
|
|
17
|
+
fileName: string;
|
|
18
|
+
}
|
|
19
|
+
export interface UploadIntentResponse {
|
|
20
|
+
assetId: string;
|
|
21
|
+
method: "PUT";
|
|
22
|
+
uploadUrl: string;
|
|
23
|
+
requiredHeaders: Record<string, string>;
|
|
24
|
+
expiresAt: string;
|
|
25
|
+
}
|
|
26
|
+
export interface S3Adapter {
|
|
27
|
+
createUploadIntent(intent: UploadIntent): Promise<UploadIntentResponse>;
|
|
28
|
+
confirmUpload(assetId: string): Promise<void>;
|
|
29
|
+
getDownloadUrl(storageKey: string, expiresInSec?: number): Promise<string>;
|
|
30
|
+
}
|
|
31
|
+
export declare function createPresignedUrl(config: S3Config, method: "GET" | "PUT", storageKey: string, expiresInSec?: number, opts?: {
|
|
32
|
+
contentType?: string;
|
|
33
|
+
contentSha256?: string;
|
|
34
|
+
}): Promise<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Fake implementation for tests (no real network) — also demonstrates the presigning interface.
|
|
37
|
+
*/
|
|
38
|
+
export declare function createFakeS3Adapter(_config?: S3Config): S3Adapter & {
|
|
39
|
+
storage: Map<string, Uint8Array>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Real adapter using presigned URLs — requires valid S3Config.
|
|
43
|
+
* Uses the same store interface but generates proper SigV4 URLs.
|
|
44
|
+
*/
|
|
45
|
+
export declare function createS3Adapter(config: S3Config): S3Adapter;
|
|
46
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/s3-compatible/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,KAAK,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,SAAS;IACxB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACxE,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5E;AAqBD,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,KAAK,GAAG,KAAK,EACrB,UAAU,EAAE,MAAM,EAClB,YAAY,SAAO,EACnB,IAAI,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAO,GAC1D,OAAO,CAAC,MAAM,CAAC,CAsCjB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG;IAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;CAAE,CAyBxG;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,CAqB3D"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AWS Signature Version 4 presigning — no external SDK, uses Node crypto (or Web Crypto fallback).
|
|
3
|
+
* Produces a presigned URL that restricts key, method, expiry, expected size/checksum where possible.
|
|
4
|
+
* Reference: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html
|
|
5
|
+
*/
|
|
6
|
+
import crypto from "node:crypto";
|
|
7
|
+
async function hmacSha256(key, data) {
|
|
8
|
+
const k = typeof key === "string" ? new TextEncoder().encode(key) : key;
|
|
9
|
+
// Use Node crypto for determinism in tests
|
|
10
|
+
const h = crypto.createHmac("sha256", k);
|
|
11
|
+
h.update(data);
|
|
12
|
+
return new Uint8Array(h.digest());
|
|
13
|
+
}
|
|
14
|
+
function toHex(bytes) {
|
|
15
|
+
return [...bytes].map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
16
|
+
}
|
|
17
|
+
export async function createPresignedUrl(config, method, storageKey, expiresInSec = 3600, opts = {}) {
|
|
18
|
+
const now = new Date();
|
|
19
|
+
const amzDate = now.toISOString().replace(/[-:]/g, "").slice(0, 15) + "Z"; // YYYYMMDDTHHMMSSZ
|
|
20
|
+
const dateStamp = amzDate.slice(0, 8);
|
|
21
|
+
const host = new URL(config.endpoint).host;
|
|
22
|
+
const canonicalUri = `/${config.bucket}/${storageKey}`;
|
|
23
|
+
const credentialScope = `${dateStamp}/${config.region}/s3/aws4_request`;
|
|
24
|
+
const signedHeaders = opts.contentType ? "content-type;host;x-amz-content-sha256;x-amz-date" : "host;x-amz-content-sha256;x-amz-date";
|
|
25
|
+
const queryParams = {
|
|
26
|
+
"X-Amz-Algorithm": "AWS4-HMAC-SHA256",
|
|
27
|
+
"X-Amz-Credential": `${config.accessKeyId}/${credentialScope}`,
|
|
28
|
+
"X-Amz-Date": amzDate,
|
|
29
|
+
"X-Amz-Expires": String(expiresInSec),
|
|
30
|
+
"X-Amz-SignedHeaders": signedHeaders,
|
|
31
|
+
};
|
|
32
|
+
if (opts.contentSha256)
|
|
33
|
+
queryParams["x-amz-content-sha256"] = opts.contentSha256;
|
|
34
|
+
const canonicalQuery = Object.keys(queryParams)
|
|
35
|
+
.sort()
|
|
36
|
+
.map((k) => `${encodeURIComponent(k)}=${encodeURIComponent(queryParams[k])}`)
|
|
37
|
+
.join("&");
|
|
38
|
+
const payloadHash = opts.contentSha256 ?? "UNSIGNED-PAYLOAD";
|
|
39
|
+
const canonicalHeaders = (opts.contentType ? `content-type:${opts.contentType}\n` : "") + `host:${host}\n` + `x-amz-content-sha256:${payloadHash}\n` + `x-amz-date:${amzDate}\n`;
|
|
40
|
+
const canonicalRequest = [method, canonicalUri, canonicalQuery, canonicalHeaders, signedHeaders, payloadHash].join("\n");
|
|
41
|
+
const hashedCanonical = crypto.createHash("sha256").update(canonicalRequest).digest("hex");
|
|
42
|
+
const stringToSign = ["AWS4-HMAC-SHA256", amzDate, credentialScope, hashedCanonical].join("\n");
|
|
43
|
+
const kDate = await hmacSha256(`AWS4${config.secretAccessKey}`, dateStamp);
|
|
44
|
+
const kRegion = await hmacSha256(kDate, config.region);
|
|
45
|
+
const kService = await hmacSha256(kRegion, "s3");
|
|
46
|
+
const kSigning = await hmacSha256(kService, "aws4_request");
|
|
47
|
+
const signature = toHex(await hmacSha256(kSigning, stringToSign));
|
|
48
|
+
return `${config.endpoint}${canonicalUri}?${canonicalQuery}&X-Amz-Signature=${signature}`;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Fake implementation for tests (no real network) — also demonstrates the presigning interface.
|
|
52
|
+
*/
|
|
53
|
+
export function createFakeS3Adapter(_config) {
|
|
54
|
+
const storage = new Map();
|
|
55
|
+
const intents = new Map();
|
|
56
|
+
return {
|
|
57
|
+
storage,
|
|
58
|
+
async createUploadIntent(intent) {
|
|
59
|
+
const assetId = `ast_${Math.random().toString(36).slice(2, 10)}`;
|
|
60
|
+
intents.set(assetId, intent);
|
|
61
|
+
return {
|
|
62
|
+
assetId,
|
|
63
|
+
method: "PUT",
|
|
64
|
+
uploadUrl: `https://fake-s3.test/${assetId}`,
|
|
65
|
+
requiredHeaders: { "content-type": intent.mediaType, "x-content-sha256": intent.sha256 },
|
|
66
|
+
expiresAt: new Date(Date.now() + 3600_000).toISOString(),
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
async confirmUpload(assetId) {
|
|
70
|
+
if (!intents.has(assetId))
|
|
71
|
+
throw new Error("intent not found");
|
|
72
|
+
},
|
|
73
|
+
async getDownloadUrl(storageKey) {
|
|
74
|
+
const expires = Date.now() + 3600_000;
|
|
75
|
+
return `https://fake-s3.test/${storageKey}?expires=${expires}&signature=fake`;
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Real adapter using presigned URLs — requires valid S3Config.
|
|
81
|
+
* Uses the same store interface but generates proper SigV4 URLs.
|
|
82
|
+
*/
|
|
83
|
+
export function createS3Adapter(config) {
|
|
84
|
+
const fake = createFakeS3Adapter(config);
|
|
85
|
+
return {
|
|
86
|
+
...fake,
|
|
87
|
+
async getDownloadUrl(storageKey, expiresInSec = 3600) {
|
|
88
|
+
return createPresignedUrl(config, "GET", storageKey, expiresInSec);
|
|
89
|
+
},
|
|
90
|
+
async createUploadIntent(intent) {
|
|
91
|
+
const base = await fake.createUploadIntent(intent);
|
|
92
|
+
// Override with real presigned URL if config is provided
|
|
93
|
+
try {
|
|
94
|
+
const url = await createPresignedUrl(config, "PUT", base.assetId, 3600, {
|
|
95
|
+
contentType: intent.mediaType,
|
|
96
|
+
contentSha256: intent.sha256,
|
|
97
|
+
});
|
|
98
|
+
return { ...base, uploadUrl: url };
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return base;
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/s3-compatible/index.ts"],"names":[],"mappings":"AAkCA;;;;GAIG;AACH,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,KAAK,UAAU,UAAU,CAAC,GAAwB,EAAE,IAAY;IAC9D,MAAM,CAAC,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACxE,2CAA2C;IAC3C,MAAM,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IACzC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACf,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,KAAK,CAAC,KAAiB;IAC9B,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,CAAC,KAA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IAAI;QACP,KAAK,CAAC,cAAc,CAAC,UAAU,EAAE,YAAY,GAAG,IAAI;YAClD,OAAO,kBAAkB,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;QACrE,CAAC;QACD,KAAK,CAAC,kBAAkB,CAAC,MAAM;YAC7B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;YACnD,yDAAyD;YACzD,IAAI,CAAC;gBACH,MAAM,GAAG,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE;oBACtE,WAAW,EAAE,MAAM,CAAC,SAAS;oBAC7B,aAAa,EAAE,MAAM,CAAC,MAAM;iBAC7B,CAAC,CAAC;gBACH,OAAO,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;YACrC,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Editor, type EditorOptions } from "../editor-web/controller/index.js";
|
|
2
|
+
export type VanillaEditorOptions = EditorOptions;
|
|
3
|
+
/** Official vanilla host: mounts `createEditor` on an element the app owns. */
|
|
4
|
+
export declare function mountVanillaEditor(el: HTMLElement, opts: VanillaEditorOptions): Editor;
|
|
5
|
+
//# sourceMappingURL=vanilla.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vanilla.d.ts","sourceRoot":"","sources":["../../src/adapters/vanilla.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElG,MAAM,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAEjD,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAEtF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createEditor } from "../editor-web/controller/index.js";
|
|
2
|
+
/** Official vanilla host: mounts `createEditor` on an element the app owns. */
|
|
3
|
+
export function mountVanillaEditor(el, opts) {
|
|
4
|
+
return createEditor(el, opts);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=vanilla.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vanilla.js","sourceRoot":"","sources":["../../src/adapters/vanilla.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAmC,MAAM,mCAAmC,CAAC;AAIlG,+EAA+E;AAC/E,MAAM,UAAU,kBAAkB,CAAC,EAAe,EAAE,IAA0B;IAC5E,OAAO,YAAY,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dimensions without fully decoding the image — Phase 5.1.2
|
|
3
|
+
* PNG, JPEG, WebP lectura de cabecera
|
|
4
|
+
*/
|
|
5
|
+
export interface Dimensions {
|
|
6
|
+
widthPx: number;
|
|
7
|
+
heightPx: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function getPngDimensions(bytes: Uint8Array): Dimensions | null;
|
|
10
|
+
export declare function getJpegDimensions(bytes: Uint8Array): Dimensions | null;
|
|
11
|
+
export declare function getDimensions(bytes: Uint8Array, mediaType?: string): Dimensions | null;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/assets/dimensions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,CASrE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,CAetE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAatF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export function getPngDimensions(bytes) {
|
|
2
|
+
if (bytes.length < 24)
|
|
3
|
+
return null;
|
|
4
|
+
// IHDR at offset 16: width 4 bytes BE, height 4 bytes BE
|
|
5
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
6
|
+
// verify PNG sig already done
|
|
7
|
+
const width = view.getUint32(16, false);
|
|
8
|
+
const height = view.getUint32(20, false);
|
|
9
|
+
if (width === 0 || height === 0 || width > 10000 || height > 10000)
|
|
10
|
+
return null;
|
|
11
|
+
return { widthPx: width, heightPx: height };
|
|
12
|
+
}
|
|
13
|
+
export function getJpegDimensions(bytes) {
|
|
14
|
+
// scan markers for SOF0/2
|
|
15
|
+
let i = 2;
|
|
16
|
+
while (i + 9 < bytes.length) {
|
|
17
|
+
if (bytes[i] !== 0xff)
|
|
18
|
+
break;
|
|
19
|
+
const marker = bytes[i + 1];
|
|
20
|
+
const len = (bytes[i + 2] << 8) | bytes[i + 3];
|
|
21
|
+
if (marker >= 0xc0 && marker <= 0xc3) {
|
|
22
|
+
const h = (bytes[i + 5] << 8) | bytes[i + 6];
|
|
23
|
+
const w = (bytes[i + 7] << 8) | bytes[i + 8];
|
|
24
|
+
return { widthPx: w, heightPx: h };
|
|
25
|
+
}
|
|
26
|
+
i += 2 + len;
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
export function getDimensions(bytes, mediaType) {
|
|
31
|
+
if (!mediaType) {
|
|
32
|
+
if (bytes.length >= 8 && bytes[0] === 0x89 && bytes[1] === 0x50 && bytes[2] === 0x4e && bytes[3] === 0x47) {
|
|
33
|
+
return getPngDimensions(bytes);
|
|
34
|
+
}
|
|
35
|
+
if (bytes.length >= 3 && bytes[0] === 0xff && bytes[1] === 0xd8 && bytes[2] === 0xff) {
|
|
36
|
+
return getJpegDimensions(bytes);
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
if (mediaType === "image/png")
|
|
41
|
+
return getPngDimensions(bytes);
|
|
42
|
+
if (mediaType === "image/jpeg" || mediaType === "image/jpg")
|
|
43
|
+
return getJpegDimensions(bytes);
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/assets/dimensions/index.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,gBAAgB,CAAC,KAAiB;IAChD,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE;QAAE,OAAO,IAAI,CAAC;IACnC,yDAAyD;IACzD,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC5E,8BAA8B;IAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IACzC,IAAI,KAAK,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC,IAAI,KAAK,GAAG,KAAK,IAAI,MAAM,GAAG,KAAK;QAAE,OAAO,IAAI,CAAC;IAChF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAiB;IACjD,0BAA0B;IAC1B,IAAI,CAAC,GAAG,CAAC,CAA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,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YACrF,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,SAAS,KAAK,WAAW;QAAE,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC9D,IAAI,SAAS,KAAK,YAAY,IAAI,SAAS,KAAK,WAAW;QAAE,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC7F,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/assets/hashing/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAUlE;AAID,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAGvD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hashing — Phase 5.1.2
|
|
3
|
+
* SHA-256 for deduplication
|
|
4
|
+
*/
|
|
5
|
+
export async function sha256Hex(bytes) {
|
|
6
|
+
// Use Web Crypto when available, fallback to Node sync implementation
|
|
7
|
+
const g = globalThis;
|
|
8
|
+
if (g.crypto?.subtle) {
|
|
9
|
+
const buf = await g.crypto.subtle.digest("SHA-256", bytes);
|
|
10
|
+
return [...new Uint8Array(buf)].map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
11
|
+
}
|
|
12
|
+
// Node fallback via dynamic import to avoid breaking browsers
|
|
13
|
+
const { createHash } = await import("node:crypto");
|
|
14
|
+
return createHash("sha256").update(bytes).digest("hex");
|
|
15
|
+
}
|
|
16
|
+
import cryptoNode from "node:crypto";
|
|
17
|
+
export function sha256HexSync(bytes) {
|
|
18
|
+
// Sync only in Node — for deterministic tests
|
|
19
|
+
return cryptoNode.createHash("sha256").update(bytes).digest("hex");
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/assets/hashing/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,KAAiB;IAC/C,sEAAsE;IACtE,MAAM,CAAC,GAAG,UAA+G,CAAC;IAC1H,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QACrB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,KAAqB,CAAC,CAAC;QAC3E,OAAO,CAAC,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvF,CAAC;IACD,8DAA8D;IAC9D,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;IACnD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,MAAM,UAAU,aAAa,CAAC,KAAiB;IAC7C,8CAA8C;IAC9C,OAAO,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI icons — Lucide-compatible 24x24 stroke icons (ISC-licensed path data).
|
|
3
|
+
* All SVGs are inline, zero dependencies, colored via `currentColor` so they
|
|
4
|
+
* can be recolored with CSS variables or the `color` option at render time.
|
|
5
|
+
*/
|
|
6
|
+
export type IconName = "bold" | "italic" | "underline" | "strikethrough" | "code" | "heading1" | "heading2" | "heading3" | "listUnordered" | "listOrdered" | "quote" | "link" | "image" | "imagePlus" | "table" | "variable" | "equation" | "alignLeft" | "alignCenter" | "alignRight" | "alignJustify" | "undo2" | "redo2" | "clearFormat" | "color" | "background" | "gripVertical" | "plus" | "trash" | "chevronDown" | "chevronLeft" | "chevronRight" | "palette" | "download" | "sliders" | "copy" | "move" | "columns3" | "rows3" | "eraser" | "fileText" | "panelLeft" | "split" | "moreHorizontal" | "minus";
|
|
7
|
+
export interface IconOptions {
|
|
8
|
+
size?: number;
|
|
9
|
+
color?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
strokeWidth?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Render a Lucide-style icon to inline SVG.
|
|
16
|
+
* Color via `currentColor` by default; override with `color` or CSS `--pde-icon-color`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getIconSvg(name: IconName, opts?: IconOptions): string;
|
|
19
|
+
export declare function getAllIcons(opts?: IconOptions): Record<IconName, string>;
|
|
20
|
+
export declare function listIconNames(): IconName[];
|
|
21
|
+
/**
|
|
22
|
+
* CSS for icons + selection color — icons inherit color, selection uses theme token.
|
|
23
|
+
*/
|
|
24
|
+
export declare const iconCss = "\n.pde-icon {\n display: inline-block;\n vertical-align: middle;\n flex-shrink: 0;\n color: var(--pde-icon-color, currentColor);\n pointer-events: none;\n}\n.pde-root::selection {\n background: var(--pde-color-selection, #cbd7ff);\n}\n.pde-toolbar button:hover .pde-icon,\n.pde-toolbar button[aria-pressed=\"true\"] .pde-icon {\n color: var(--pde-color-primary, #3659e3);\n}\n.pde-toolbar button:disabled .pde-icon {\n color: var(--pde-color-muted, #667085);\n opacity: 0.5;\n}\n";
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/assets/icons/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,QAAQ,GACR,WAAW,GACX,eAAe,GACf,MAAM,GACN,UAAU,GACV,UAAU,GACV,UAAU,GACV,eAAe,GACf,aAAa,GACb,OAAO,GACP,MAAM,GACN,OAAO,GACP,WAAW,GACX,OAAO,GACP,UAAU,GACV,UAAU,GACV,WAAW,GACX,aAAa,GACb,YAAY,GACZ,cAAc,GACd,OAAO,GACP,OAAO,GACP,aAAa,GACb,OAAO,GACP,YAAY,GACZ,cAAc,GACd,MAAM,GACN,OAAO,GACP,aAAa,GACb,aAAa,GACb,cAAc,GACd,SAAS,GACT,UAAU,GACV,SAAS,GACT,MAAM,GACN,MAAM,GACN,UAAU,GACV,OAAO,GACP,QAAQ,GACR,UAAU,GACV,WAAW,GACX,OAAO,GACP,gBAAgB,GAChB,OAAO,CAAC;AAEZ,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAoDD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,GAAE,WAAgB,GAAG,MAAM,CASzE;AAED,wBAAgB,WAAW,CAAC,IAAI,GAAE,WAAgB,GAAG,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAI5E;AAED,wBAAgB,aAAa,IAAI,QAAQ,EAAE,CAE1C;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,6eAmBnB,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI icons — Lucide-compatible 24x24 stroke icons (ISC-licensed path data).
|
|
3
|
+
* All SVGs are inline, zero dependencies, colored via `currentColor` so they
|
|
4
|
+
* can be recolored with CSS variables or the `color` option at render time.
|
|
5
|
+
*/
|
|
6
|
+
const ICONS = {
|
|
7
|
+
bold: '<path d="M14 12a4 4 0 0 0 0-8H6v8"/><path d="M15 20a4 4 0 0 0 0-8H6v8"/>',
|
|
8
|
+
italic: '<line x1="19" x2="10" y1="4" y2="4"/><line x1="14" x2="5" y1="20" y2="20"/><line x1="15" x2="9" y1="4" y2="20"/>',
|
|
9
|
+
underline: '<path d="M6 4v6a6 6 0 0 0 12 0V4"/><line x1="4" x2="20" y1="20" y2="20"/>',
|
|
10
|
+
strikethrough: '<path d="M16 4H9a3 3 0 0 0-2.83 4"/><path d="M14 12a4 4 0 0 1 0 8H6"/><line x1="4" x2="20" y1="12" y2="12"/>',
|
|
11
|
+
code: '<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>',
|
|
12
|
+
heading1: '<path d="M4 12h8"/><path d="M4 18V6"/><path d="M12 18V6"/><path d="m17 12 3-2v8"/>',
|
|
13
|
+
heading2: '<path d="M4 12h8"/><path d="M4 18V6"/><path d="M12 18V6"/><path d="M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1"/>',
|
|
14
|
+
heading3: '<path d="M4 12h8"/><path d="M4 18V6"/><path d="M12 18V6"/><path d="M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2c-.7 0-1.4-.3-1.9-.8"/><path d="M17.5 15.5c1.7 1 3.5 0 3.5-1.5"/>',
|
|
15
|
+
listUnordered: '<line x1="8" x2="21" y1="6" y2="6"/><line x1="8" x2="21" y1="12" y2="12"/><line x1="8" x2="21" y1="18" y2="18"/><line x1="3" x2="3.01" y1="6" y2="6"/><line x1="3" x2="3.01" y1="12" y2="12"/><line x1="3" x2="3.01" y1="18" y2="18"/>',
|
|
16
|
+
listOrdered: '<line x1="10" x2="21" y1="6" y2="6"/><line x1="10" x2="21" y1="12" y2="12"/><line x1="10" x2="21" y1="18" y2="18"/><path d="M4 6h1v4"/><path d="M4 10h2"/><path d="M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"/>',
|
|
17
|
+
quote: '<path d="M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z"/><path d="M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z"/>',
|
|
18
|
+
link: '<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/>',
|
|
19
|
+
image: '<rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/>',
|
|
20
|
+
imagePlus: '<rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/><line x1="9" x2="9" y1="2" y2="6"/><line x1="3" x2="7" y1="4" y2="4"/>',
|
|
21
|
+
table: '<path d="M12 3v18"/><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18"/><path d="M3 15h18"/>',
|
|
22
|
+
variable: '<path d="M4 6h3.5l1 1.8 1-1.8h4.7v1.2h-2.6l-1.7 3.1 1.7 3.1h2.6V14.5H9.4l-1-1.9-1 1.9H3.5V13h2.3l1.5-2.7L5.8 7.3H3.5V6z"/><path d="M15 9.5h4.5v1.2h-1.8v3.8h-1.2v-3.8h-1.5V9.5z"/>',
|
|
23
|
+
equation: '<path d="M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2"/>',
|
|
24
|
+
alignLeft: '<line x1="21" x2="3" y1="6" y2="6"/><line x1="15" x2="3" y1="12" y2="12"/><line x1="17" x2="3" y1="18" y2="18"/>',
|
|
25
|
+
alignCenter: '<line x1="21" x2="3" y1="6" y2="6"/><line x1="17" x2="7" y1="12" y2="12"/><line x1="19" x2="5" y1="18" y2="18"/>',
|
|
26
|
+
alignRight: '<line x1="21" x2="3" y1="6" y2="6"/><line x1="21" x2="9" y1="12" y2="12"/><line x1="21" x2="7" y1="18" y2="18"/>',
|
|
27
|
+
alignJustify: '<line x1="21" x2="3" y1="6" y2="6"/><line x1="21" x2="3" y1="12" y2="12"/><line x1="21" x2="3" y1="18" y2="18"/>',
|
|
28
|
+
undo2: '<path d="M9 14 4 9l5-5"/><path d="M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5 5.5 5.5 0 0 1-5.5 5.5H11"/>',
|
|
29
|
+
redo2: '<path d="m15 14 5-5-5-5"/><path d="M20 9H9.5A5.5 5.5 0 0 0 4 14.5 5.5 5.5 0 0 0 9.5 20H13"/>',
|
|
30
|
+
clearFormat: '<path d="M4 7V4h16v3"/><path d="M5 20h6"/><path d="M13 4 8 20"/><path d="m15 15 5 5"/><path d="m20 15-5 5"/>',
|
|
31
|
+
color: '<circle cx="13.5" cy="6.5" r=".5" fill="currentColor"/><circle cx="17.5" cy="10.5" r=".5" fill="currentColor"/><circle cx="8.5" cy="7.5" r=".5" fill="currentColor"/><circle cx="6.5" cy="12.5" r=".5" fill="currentColor"/><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z"/>',
|
|
32
|
+
background: '<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M12 7v10"/><path d="M7 12h10"/>',
|
|
33
|
+
gripVertical: '<circle cx="9" cy="12" r="1"/><circle cx="9" cy="5" r="1"/><circle cx="9" cy="19" r="1"/><circle cx="15" cy="12" r="1"/><circle cx="15" cy="5" r="1"/><circle cx="15" cy="19" r="1"/>',
|
|
34
|
+
plus: '<path d="M5 12h14"/><path d="M12 5v14"/>',
|
|
35
|
+
trash: '<path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/><line x1="10" x2="10" y1="11" y2="17"/><line x1="14" x2="14" y1="11" y2="17"/>',
|
|
36
|
+
chevronDown: '<path d="m6 9 6 6 6-6"/>',
|
|
37
|
+
chevronLeft: '<path d="m15 18-6-6 6-6"/>',
|
|
38
|
+
chevronRight: '<path d="m9 18 6-6-6-6"/>',
|
|
39
|
+
palette: '<circle cx="13.5" cy="6.5" r=".5" fill="currentColor"/><circle cx="17.5" cy="10.5" r=".5" fill="currentColor"/><circle cx="8.5" cy="7.5" r=".5" fill="currentColor"/><circle cx="6.5" cy="12.5" r=".5" fill="currentColor"/><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z"/>',
|
|
40
|
+
download: '<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/>',
|
|
41
|
+
sliders: '<line x1="4" x2="4" y1="21" y2="14"/><line x1="4" x2="4" y1="10" y2="3"/><line x1="12" x2="12" y1="21" y2="12"/><line x1="12" x2="12" y1="8" y2="3"/><line x1="20" x2="20" y1="21" y2="16"/><line x1="20" x2="20" y1="12" y2="3"/><line x1="2" x2="6" y1="14" y2="14"/><line x1="10" x2="14" y1="8" y2="8"/><line x1="18" x2="22" y1="16" y2="16"/>',
|
|
42
|
+
copy: '<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>',
|
|
43
|
+
move: '<polyline points="5 9 2 12 5 15"/><polyline points="9 5 12 2 15 5"/><polyline points="15 19 12 22 9 19"/><polyline points="19 9 22 12 19 15"/><line x1="2" x2="22" y1="12" y2="12"/><line x1="12" x2="12" y1="2" y2="22"/>',
|
|
44
|
+
columns3: '<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M9 3v18"/><path d="M15 3v18"/>',
|
|
45
|
+
rows3: '<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18"/><path d="M3 15h18"/>',
|
|
46
|
+
eraser: '<path d="m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21"/><path d="M22 21H7"/><path d="m5 11 9 9"/>',
|
|
47
|
+
fileText: '<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z"/><polyline points="14 2 14 8 20 8"/><line x1="16" x2="8" y1="13" y2="13"/><line x1="16" x2="8" y1="17" y2="17"/>',
|
|
48
|
+
panelLeft: '<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M9 3v18"/>',
|
|
49
|
+
split: '<path d="M8 3v18"/><path d="M16 3v18"/>',
|
|
50
|
+
moreHorizontal: '<circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/>',
|
|
51
|
+
minus: '<line x1="5" x2="19" y1="12" y2="12"/>',
|
|
52
|
+
};
|
|
53
|
+
const VIEWBOX = "0 0 24 24";
|
|
54
|
+
/**
|
|
55
|
+
* Render a Lucide-style icon to inline SVG.
|
|
56
|
+
* Color via `currentColor` by default; override with `color` or CSS `--pde-icon-color`.
|
|
57
|
+
*/
|
|
58
|
+
export function getIconSvg(name, opts = {}) {
|
|
59
|
+
const inner = ICONS[name];
|
|
60
|
+
if (!inner)
|
|
61
|
+
throw new Error(`Unknown icon: ${name}`);
|
|
62
|
+
const size = opts.size ?? 18;
|
|
63
|
+
const color = opts.color ?? "currentColor";
|
|
64
|
+
const strokeWidth = opts.strokeWidth ?? 2;
|
|
65
|
+
const klass = ["pde-icon", `pde-icon--${name}`, opts.className].filter(Boolean).join(" ");
|
|
66
|
+
const title = opts.title ? `<title>${escapeHtml(opts.title)}</title>` : "";
|
|
67
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" viewBox="${VIEWBOX}" role="img" aria-hidden="${opts.title ? "false" : "true"}" class="${klass}" style="color:${escapeAttr(color)}" fill="none" stroke="currentColor" stroke-width="${strokeWidth}" stroke-linecap="round" stroke-linejoin="round">${title}${inner}</svg>`;
|
|
68
|
+
}
|
|
69
|
+
export function getAllIcons(opts = {}) {
|
|
70
|
+
const out = {};
|
|
71
|
+
for (const name of Object.keys(ICONS))
|
|
72
|
+
out[name] = getIconSvg(name, opts);
|
|
73
|
+
return out;
|
|
74
|
+
}
|
|
75
|
+
export function listIconNames() {
|
|
76
|
+
return Object.keys(ICONS);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* CSS for icons + selection color — icons inherit color, selection uses theme token.
|
|
80
|
+
*/
|
|
81
|
+
export const iconCss = `
|
|
82
|
+
.pde-icon {
|
|
83
|
+
display: inline-block;
|
|
84
|
+
vertical-align: middle;
|
|
85
|
+
flex-shrink: 0;
|
|
86
|
+
color: var(--pde-icon-color, currentColor);
|
|
87
|
+
pointer-events: none;
|
|
88
|
+
}
|
|
89
|
+
.pde-root::selection {
|
|
90
|
+
background: var(--pde-color-selection, #cbd7ff);
|
|
91
|
+
}
|
|
92
|
+
.pde-toolbar button:hover .pde-icon,
|
|
93
|
+
.pde-toolbar button[aria-pressed="true"] .pde-icon {
|
|
94
|
+
color: var(--pde-color-primary, #3659e3);
|
|
95
|
+
}
|
|
96
|
+
.pde-toolbar button:disabled .pde-icon {
|
|
97
|
+
color: var(--pde-color-muted, #667085);
|
|
98
|
+
opacity: 0.5;
|
|
99
|
+
}
|
|
100
|
+
`;
|
|
101
|
+
function escapeHtml(s) {
|
|
102
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
103
|
+
}
|
|
104
|
+
function escapeAttr(s) {
|
|
105
|
+
return s.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<");
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/assets/icons/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAyDH,MAAM,KAAK,GAA6B;IACtC,IAAI,EAAE,0EAA0E;IAChF,MAAM,EAAE,kHAAkH;IAC1H,SAAS,EAAE,2EAA2E;IACtF,aAAa,EAAE,8GAA8G;IAC7H,IAAI,EAAE,yEAAyE;IAC/E,QAAQ,EAAE,oFAAoF;IAC9F,QAAQ,EAAE,6GAA6G;IACvH,QAAQ,EAAE,kLAAkL;IAC5L,aAAa,EAAE,wOAAwO;IACvP,WAAW,EAAE,sMAAsM;IACnN,KAAK,EAAE,oSAAoS;IAC3S,IAAI,EAAE,iJAAiJ;IACvJ,KAAK,EAAE,kIAAkI;IACzI,SAAS,EAAE,wMAAwM;IACnN,KAAK,EAAE,8GAA8G;IACrH,QAAQ,EAAE,oLAAoL;IAC9L,QAAQ,EAAE,wHAAwH;IAClI,SAAS,EAAE,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E,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder.d.ts","sourceRoot":"","sources":["../../../src/assets/png/placeholder.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,wBAAgB,cAAc,IAAI,UAAU,CAM3C;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE9D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** 1×1 gray PNG for DOCX consumers that cannot show SVG/WebP. */
|
|
2
|
+
export function placeholderPng() {
|
|
3
|
+
const b64 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==";
|
|
4
|
+
const bin = atob(b64);
|
|
5
|
+
const out = new Uint8Array(bin.length);
|
|
6
|
+
for (let i = 0; i < bin.length; i++)
|
|
7
|
+
out[i] = bin.charCodeAt(i);
|
|
8
|
+
return out;
|
|
9
|
+
}
|
|
10
|
+
export function needsRasterFallback(mediaType) {
|
|
11
|
+
return mediaType === "image/svg+xml" || mediaType === "image/webp";
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=placeholder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder.js","sourceRoot":"","sources":["../../../src/assets/png/placeholder.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,UAAU,cAAc;IAC5B,MAAM,GAAG,GAAG,kGAAkG,CAAC;IAC/G,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IACtB,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE;QAAE,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAChE,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACnD,OAAO,SAAS,KAAK,eAAe,IAAI,SAAS,KAAK,YAAY,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asset sniffing — Phase 5.1.1
|
|
3
|
+
* Magic-signature detection, declared vs real MIME validation, limits
|
|
4
|
+
*/
|
|
5
|
+
export type MediaType = "image/png" | "image/jpeg" | "image/webp" | "image/svg+xml";
|
|
6
|
+
export interface SniffResult {
|
|
7
|
+
mediaType: MediaType | null;
|
|
8
|
+
valid: boolean;
|
|
9
|
+
reason?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function sniffImage(bytes: Uint8Array, declared?: string): SniffResult;
|
|
12
|
+
export declare function isAllowedMediaType(mt: string): mt is MediaType;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|