@printstack/print-studio 0.0.0-stage → 0.1.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.
Files changed (429) hide show
  1. package/README.md +246 -2
  2. package/assets/render.worker-Ch4qWx3S.js +109 -0
  3. package/cloneDeep-PCw2ErRl.js +1923 -0
  4. package/components/base-dialog/base-dialog.vue.d.ts +56 -0
  5. package/components/base-dialog/index.d.ts +2 -0
  6. package/components/base-dialog/types.d.ts +20 -0
  7. package/components/button-group/ButtonGroup.d.ts +64 -0
  8. package/components/button-group/index.d.ts +2 -0
  9. package/components/error-fallback/ErrorBoundary.d.ts +15 -0
  10. package/components/error-fallback/browser.d.ts +7 -0
  11. package/components/error-fallback/core.d.ts +36 -0
  12. package/components/error-fallback/exceptions/SilentException.d.ts +7 -0
  13. package/components/error-fallback/index.d.ts +8 -0
  14. package/components/error-fallback/rules/silent-exception.d.ts +2 -0
  15. package/components/error-fallback/vue.d.ts +3 -0
  16. package/components/popup-layer/container.d.ts +2 -0
  17. package/components/popup-layer/use-popup-layer.d.ts +6 -0
  18. package/components/popup-layer/with-popup-layer.d.ts +37 -0
  19. package/components/print-s-logo/print-s-logo.vue.d.ts +12 -0
  20. package/components/s-form/FieldRenderer.d.ts +21 -0
  21. package/components/s-form/SForm.d.ts +77 -0
  22. package/components/s-form/adapter.d.ts +61 -0
  23. package/components/s-form/builtin.d.ts +1 -0
  24. package/components/s-form/context.d.ts +44 -0
  25. package/components/s-form/diagnostics.d.ts +28 -0
  26. package/components/s-form/field-status.d.ts +18 -0
  27. package/components/s-form/index.d.ts +15 -0
  28. package/components/s-form/layouts/CollapseToggle.d.ts +28 -0
  29. package/components/s-form/layouts/FlexLayout.d.ts +89 -0
  30. package/components/s-form/layouts/GridLayout.d.ts +67 -0
  31. package/components/s-form/registry.d.ts +31 -0
  32. package/components/s-form/schema.d.ts +9 -0
  33. package/components/s-form/states.d.ts +59 -0
  34. package/components/s-form/types.d.ts +550 -0
  35. package/components/s-form/use-form-layout.d.ts +21 -0
  36. package/components/s-form/use-form-model.d.ts +15 -0
  37. package/components/s-form/utils.d.ts +76 -0
  38. package/composables/use-json-object-input.d.ts +10 -0
  39. package/composables/use-keyboard-shortcuts.d.ts +16 -0
  40. package/composables/use-z-index.d.ts +9 -0
  41. package/core/align.d.ts +43 -0
  42. package/core/binding-expression.d.ts +25 -0
  43. package/core/binding-formatters.d.ts +43 -0
  44. package/core/data-context.d.ts +73 -0
  45. package/core/data-source-path.d.ts +10 -0
  46. package/core/data-source.d.ts +26 -0
  47. package/core/document-expand.d.ts +7 -0
  48. package/core/document-model.d.ts +56 -0
  49. package/core/document-variable-resolver.d.ts +10 -0
  50. package/core/document-variables.d.ts +23 -0
  51. package/core/element-group.d.ts +73 -0
  52. package/core/element-registry.d.ts +229 -0
  53. package/core/element-transform.d.ts +12 -0
  54. package/core/errors.d.ts +20 -0
  55. package/core/events.d.ts +311 -0
  56. package/core/flow-expand.d.ts +13 -0
  57. package/core/follow-block.d.ts +9 -0
  58. package/core/follow-layout.d.ts +8 -0
  59. package/core/geometry.d.ts +110 -0
  60. package/core/index.d.ts +5 -0
  61. package/core/inspector.d.ts +27 -0
  62. package/core/layout-references.d.ts +8 -0
  63. package/core/overflow-expand.d.ts +7 -0
  64. package/core/page-extensions.d.ts +26 -0
  65. package/core/page-layout.d.ts +6 -0
  66. package/core/parser-version.d.ts +2 -0
  67. package/core/pointer-drag.d.ts +33 -0
  68. package/core/render/barcode.d.ts +26 -0
  69. package/core/render/canvas.d.ts +3 -0
  70. package/core/render/color.d.ts +19 -0
  71. package/core/render/dash.d.ts +4 -0
  72. package/core/render/element-warning.d.ts +3 -0
  73. package/core/render/fonts.d.ts +20 -0
  74. package/core/render/frame.d.ts +10 -0
  75. package/core/render/html.d.ts +11 -0
  76. package/core/render/image.d.ts +13 -0
  77. package/core/render/jspdf-loader.d.ts +6 -0
  78. package/core/render/pdf-draw.d.ts +64 -0
  79. package/core/render/qrcode.d.ts +15 -0
  80. package/core/render/render-task.d.ts +7 -0
  81. package/core/render/resource-data.d.ts +1 -0
  82. package/core/render/resource-task.d.ts +5 -0
  83. package/core/render/text-layout.d.ts +34 -0
  84. package/core/repeat-expand.d.ts +17 -0
  85. package/core/repeat-layout.d.ts +15 -0
  86. package/core/runtime-config.d.ts +12 -0
  87. package/core/types.d.ts +289 -0
  88. package/core/units.d.ts +15 -0
  89. package/core/z-index.d.ts +41 -0
  90. package/core.js +48 -0
  91. package/cost-sheet-Dwg0rt_l.js +1600 -0
  92. package/designer/commands/builtins.d.ts +2 -0
  93. package/designer/commands/command-registry.d.ts +39 -0
  94. package/designer/commands/domain-commands.d.ts +2 -0
  95. package/designer/commands/menu-adapter.d.ts +12 -0
  96. package/designer/commands/menu-interaction.d.ts +2 -0
  97. package/designer/commands/menu-types.d.ts +28 -0
  98. package/designer/commands/types.d.ts +57 -0
  99. package/designer/commands/use-command-shortcuts.d.ts +2 -0
  100. package/designer/components/bars/check-toggle.vue.d.ts +14 -0
  101. package/designer/components/bars/menu-bar.vue.d.ts +11 -0
  102. package/designer/components/bars/options-bar.vue.d.ts +3 -0
  103. package/designer/components/bars/tool-bar.vue.d.ts +3 -0
  104. package/designer/components/binding/binding-picker.vue.d.ts +23 -0
  105. package/designer/components/binding/binding-presets.d.ts +9 -0
  106. package/designer/components/binding/field-tree.vue.d.ts +21 -0
  107. package/designer/components/binding/schema-tree-editor.vue.d.ts +13 -0
  108. package/designer/components/binding/use-binding-expression.d.ts +41 -0
  109. package/designer/components/binding/use-binding-preview.d.ts +14 -0
  110. package/designer/components/binding/use-binding-sources.d.ts +37 -0
  111. package/designer/components/binding/use-binding-submission.d.ts +16 -0
  112. package/designer/components/designer-shell.vue.d.ts +16 -0
  113. package/designer/components/dialogs/apply-template-dialog.vue.d.ts +3 -0
  114. package/designer/components/dialogs/canvas-color-dialog.vue.d.ts +3 -0
  115. package/designer/components/dialogs/data-source-dialog.vue.d.ts +3 -0
  116. package/designer/components/dialogs/dialog-session-host.vue.d.ts +21 -0
  117. package/designer/components/dialogs/element-dialog.vue.d.ts +7 -0
  118. package/designer/components/dialogs/element-settings-workspace.vue.d.ts +28 -0
  119. package/designer/components/dialogs/export-progress-dialog.vue.d.ts +3 -0
  120. package/designer/components/dialogs/follow-dialog.vue.d.ts +3 -0
  121. package/designer/components/dialogs/follow-manager-dialog.vue.d.ts +3 -0
  122. package/designer/components/dialogs/guide-dialog.vue.d.ts +3 -0
  123. package/designer/components/dialogs/page-dialog.vue.d.ts +3 -0
  124. package/designer/components/dialogs/preview-dialog.vue.d.ts +12 -0
  125. package/designer/components/dialogs/print-preview-dialog.vue.d.ts +14 -0
  126. package/designer/components/dialogs/print-preview-source.d.ts +22 -0
  127. package/designer/components/dialogs/repeat-dialog.vue.d.ts +3 -0
  128. package/designer/components/dialogs/repeat-manager-dialog.vue.d.ts +3 -0
  129. package/designer/components/dialogs/template-library-dialog.vue.d.ts +3 -0
  130. package/designer/components/dialogs/tutorial-dialog.vue.d.ts +3 -0
  131. package/designer/components/dialogs/use-data-source-sample.d.ts +18 -0
  132. package/designer/components/dialogs/use-document-preview.d.ts +33 -0
  133. package/designer/components/dialogs/use-preview-renderer.d.ts +32 -0
  134. package/designer/components/dialogs/use-preview-viewport.d.ts +37 -0
  135. package/designer/components/dialogs/use-print-preview.d.ts +33 -0
  136. package/designer/components/dialogs/use-template-catalog.d.ts +51 -0
  137. package/designer/components/dialogs/use-template-preview.d.ts +35 -0
  138. package/designer/components/fields/field-boolean.vue.d.ts +20 -0
  139. package/designer/components/fields/field-color.vue.d.ts +20 -0
  140. package/designer/components/fields/field-data-preview.vue.d.ts +12 -0
  141. package/designer/components/fields/field-image.vue.d.ts +14 -0
  142. package/designer/components/fields/field-table-borders.vue.d.ts +22 -0
  143. package/designer/components/fields/field-table-cell-style.vue.d.ts +13 -0
  144. package/designer/components/fields/field-table-continuation-layout.vue.d.ts +14 -0
  145. package/designer/components/fields/field-table-merge-rules.vue.d.ts +13 -0
  146. package/designer/components/fields/field-table-rows.vue.d.ts +13 -0
  147. package/designer/components/fields/field-table-structure.vue.d.ts +19 -0
  148. package/designer/components/fields/field-table.vue.d.ts +21 -0
  149. package/designer/components/fields/use-table-cells.d.ts +38 -0
  150. package/designer/components/fields/use-table-column-resize.d.ts +11 -0
  151. package/designer/components/fields/use-table-columns.d.ts +19 -0
  152. package/designer/components/fields/use-table-draft.d.ts +569 -0
  153. package/designer/components/fields/use-table-header-selection.d.ts +25 -0
  154. package/designer/components/fields/use-table-headers.d.ts +22 -0
  155. package/designer/components/fields/use-table-selection.d.ts +32 -0
  156. package/designer/components/forms/collection-picker-field.vue.d.ts +12 -0
  157. package/designer/components/forms/designer-field.vue.d.ts +23 -0
  158. package/designer/components/forms/designer-form.vue.d.ts +28 -0
  159. package/designer/components/forms/form-presentation.d.ts +6 -0
  160. package/designer/components/forms/inspector-schema.d.ts +9 -0
  161. package/designer/components/forms/table-inspector-control.vue.d.ts +24 -0
  162. package/designer/components/panels/control-panel.vue.d.ts +3 -0
  163. package/designer/components/panels/info-bar.vue.d.ts +7 -0
  164. package/designer/components/panels/inspector-field.vue.d.ts +13 -0
  165. package/designer/components/panels/layers-panel.vue.d.ts +3 -0
  166. package/designer/components/panels/pages-panel.vue.d.ts +3 -0
  167. package/designer/components/panels/panel-column.vue.d.ts +11 -0
  168. package/designer/components/panels/panel-dock.vue.d.ts +3 -0
  169. package/designer/components/panels/panel-group.vue.d.ts +12 -0
  170. package/designer/components/panels/transform-fields.d.ts +4 -0
  171. package/designer/components/panels/use-panel-drop-target.d.ts +24 -0
  172. package/designer/components/panels/use-panel-interactions.d.ts +22 -0
  173. package/designer/components/previews/barcode-preview.vue.d.ts +8 -0
  174. package/designer/components/previews/ellipse-preview.vue.d.ts +8 -0
  175. package/designer/components/previews/image-preview.vue.d.ts +8 -0
  176. package/designer/components/previews/line-preview.vue.d.ts +10 -0
  177. package/designer/components/previews/qrcode-preview.vue.d.ts +8 -0
  178. package/designer/components/previews/rect-preview.vue.d.ts +8 -0
  179. package/designer/components/previews/table-preview.vue.d.ts +8 -0
  180. package/designer/components/previews/text-preview.vue.d.ts +8 -0
  181. package/designer/components/stage/canvas-stage.vue.d.ts +3 -0
  182. package/designer/components/stage/element-renderer.vue.d.ts +12 -0
  183. package/designer/components/stage/follow-overlay.vue.d.ts +8 -0
  184. package/designer/components/stage/guides-drag-layer.vue.d.ts +3 -0
  185. package/designer/components/stage/guides-layer.vue.d.ts +8 -0
  186. package/designer/components/stage/inline-text-editor.vue.d.ts +16 -0
  187. package/designer/components/stage/page-view.vue.d.ts +10 -0
  188. package/designer/components/stage/repeat-overlay.vue.d.ts +8 -0
  189. package/designer/components/stage/ruler.vue.d.ts +6 -0
  190. package/designer/components/stage/selection-overlay.vue.d.ts +10 -0
  191. package/designer/components/stage/template-editing-banner.vue.d.ts +3 -0
  192. package/designer/components/stage/use-stage-pan.d.ts +6 -0
  193. package/designer/components/stage/use-stage-viewport.d.ts +13 -0
  194. package/designer/components/startup/startup-loading-view.vue.d.ts +9 -0
  195. package/designer/components/startup/startup-loading.d.ts +7 -0
  196. package/designer/components/ui/align-grid.vue.d.ts +9 -0
  197. package/designer/components/ui/align-icons.d.ts +3 -0
  198. package/designer/components/ui/align-target.vue.d.ts +3 -0
  199. package/designer/components/ui/context-menu.vue.d.ts +3 -0
  200. package/designer/components/ui/dialog-tabs.vue.d.ts +15 -0
  201. package/designer/components/ui/extension-slot.vue.d.ts +6 -0
  202. package/designer/components/ui/fallback-block.vue.d.ts +42 -0
  203. package/designer/components/ui/form-block.vue.d.ts +27 -0
  204. package/designer/components/ui/hint-text.vue.d.ts +23 -0
  205. package/designer/components/ui/icon-button.vue.d.ts +24 -0
  206. package/designer/components/ui/icon.vue.d.ts +6 -0
  207. package/designer/components/ui/icons.d.ts +2 -0
  208. package/designer/components/ui/menu-items.vue.d.ts +11 -0
  209. package/designer/components/ui/panel-frame.vue.d.ts +21 -0
  210. package/designer/components/ui/toast-host.vue.d.ts +3 -0
  211. package/designer/components/ui/tool-icon.vue.d.ts +6 -0
  212. package/designer/components/variable-text/use-variable-text-bindings.d.ts +9 -0
  213. package/designer/components/variable-text/use-variable-text-editor.d.ts +38 -0
  214. package/designer/components/variable-text/variable-formatter-editor.vue.d.ts +16 -0
  215. package/designer/components/variable-text/variable-text-field.vue.d.ts +33 -0
  216. package/designer/components/variable-text/variable-text-preview.vue.d.ts +7 -0
  217. package/designer/composables/use-restored-ui-state.d.ts +2 -0
  218. package/designer/config/canvas-background.d.ts +18 -0
  219. package/designer/context/editor-context.d.ts +64 -0
  220. package/designer/context/editor-runtime.d.ts +11 -0
  221. package/designer/context/editor-view.d.ts +8 -0
  222. package/designer/context/inspector-layout.d.ts +7 -0
  223. package/designer/context/use-element-definition.d.ts +1 -0
  224. package/designer/events/store-event-bindings.d.ts +7 -0
  225. package/designer/facade/bindings.d.ts +6 -0
  226. package/designer/facade/editing.d.ts +43 -0
  227. package/designer/facade/elements.d.ts +37 -0
  228. package/designer/facade/entities.d.ts +15364 -0
  229. package/designer/facade/output.d.ts +21 -0
  230. package/designer/facade/pages.d.ts +204 -0
  231. package/designer/facade/print-studio.d.ts +3 -0
  232. package/designer/facade/state.d.ts +10 -0
  233. package/designer/facade/use-print-studio.d.ts +6 -0
  234. package/designer/frame/entry.d.ts +0 -0
  235. package/designer/frame/host.d.ts +7 -0
  236. package/designer/frame/print-designer-frame.vue.d.ts +25 -0
  237. package/designer/frame/shared.d.ts +32 -0
  238. package/designer/frame/view.d.ts +15 -0
  239. package/designer/interactions/create.d.ts +3 -0
  240. package/designer/interactions/geometry-update.d.ts +3 -0
  241. package/designer/interactions/guides.d.ts +7 -0
  242. package/designer/interactions/marquee.d.ts +3 -0
  243. package/designer/interactions/move.d.ts +3 -0
  244. package/designer/interactions/point.d.ts +3 -0
  245. package/designer/interactions/pointer-drag.d.ts +3 -0
  246. package/designer/interactions/resize-strategies.d.ts +23 -0
  247. package/designer/interactions/snap.d.ts +48 -0
  248. package/designer/interactions/transform.d.ts +5 -0
  249. package/designer/mount-print-designer.d.ts +2 -0
  250. package/designer/mount-print-preview.d.ts +5 -0
  251. package/designer/plugins/builtins.d.ts +6 -0
  252. package/designer/plugins/context-menu-guard.d.ts +2 -0
  253. package/designer/plugins/domain-builtins.d.ts +5 -0
  254. package/designer/plugins/element-previews.d.ts +2 -0
  255. package/designer/plugins/error-handling.d.ts +5 -0
  256. package/designer/plugins/extension-points.d.ts +34 -0
  257. package/designer/plugins/follow-layout.d.ts +2 -0
  258. package/designer/plugins/panels.d.ts +2 -0
  259. package/designer/plugins/plugin-bootstrap.d.ts +5 -0
  260. package/designer/plugins/plugin-canvas.d.ts +29 -0
  261. package/designer/plugins/plugin-context.d.ts +100 -0
  262. package/designer/plugins/plugin-manager.d.ts +44 -0
  263. package/designer/plugins/plugin-scope.d.ts +10 -0
  264. package/designer/plugins/sandbox-plugin.d.ts +9 -0
  265. package/designer/plugins/tdesign-forms.d.ts +32 -0
  266. package/designer/plugins/template-library.d.ts +7 -0
  267. package/designer/plugins/tutorials.d.ts +2 -0
  268. package/designer/plugins/types.d.ts +63 -0
  269. package/designer/presets.d.ts +8 -0
  270. package/designer/print-designer.vue.d.ts +25 -0
  271. package/designer/print-preview.vue.d.ts +4 -0
  272. package/designer/services/document-actions.d.ts +17 -0
  273. package/designer/services/editor-resources.d.ts +6 -0
  274. package/designer/services/element-drop.d.ts +4 -0
  275. package/designer/services/file-reader.d.ts +2 -0
  276. package/designer/services/file-service.d.ts +7 -0
  277. package/designer/services/preference-storage.d.ts +9 -0
  278. package/designer/services/sample-preview.d.ts +16 -0
  279. package/designer/services/stage-service.d.ts +24 -0
  280. package/designer/services/text-input.d.ts +10 -0
  281. package/designer/stores/canvas-store.d.ts +33 -0
  282. package/designer/stores/clipboard-store.d.ts +143 -0
  283. package/designer/stores/config-store.d.ts +80 -0
  284. package/designer/stores/data-source-store.d.ts +58 -0
  285. package/designer/stores/document-store.d.ts +1186 -0
  286. package/designer/stores/editor-store.d.ts +10224 -0
  287. package/designer/stores/element-group-store.d.ts +101 -0
  288. package/designer/stores/element-store.d.ts +237 -0
  289. package/designer/stores/follow-block-store.d.ts +290 -0
  290. package/designer/stores/guide-store.d.ts +44 -0
  291. package/designer/stores/history-store.d.ts +45 -0
  292. package/designer/stores/layout-store.d.ts +18 -0
  293. package/designer/stores/navigation-store.d.ts +56 -0
  294. package/designer/stores/page-store.d.ts +164 -0
  295. package/designer/stores/panel-store.d.ts +526 -0
  296. package/designer/stores/plugin-store.d.ts +19 -0
  297. package/designer/stores/rendering-store.d.ts +120 -0
  298. package/designer/stores/repeat-group-store.d.ts +99 -0
  299. package/designer/stores/scope-store.d.ts +31 -0
  300. package/designer/stores/selection-store.d.ts +101 -0
  301. package/designer/stores/template-store.d.ts +655 -0
  302. package/designer/stores/tutorial-store.d.ts +75 -0
  303. package/designer/stores/types.d.ts +135 -0
  304. package/designer/stores/ui-store.d.ts +723 -0
  305. package/designer/stores/view-store.d.ts +483 -0
  306. package/designer/stores/z-index-store.d.ts +62 -0
  307. package/designer/template-library/builtin/cost-sheet.json.d.ts +1450 -0
  308. package/designer/template-library/builtin/invoice.json.d.ts +3338 -0
  309. package/designer/template-library/builtin/purchase-order.json.d.ts +1541 -0
  310. package/designer/template-library/builtin/welcome.json.d.ts +658 -0
  311. package/designer/template-library/builtin-templates.d.ts +4183 -0
  312. package/designer/template-library/registry.d.ts +13 -0
  313. package/designer/template-library/remote-provider.d.ts +25 -0
  314. package/designer/template-library/types.d.ts +35 -0
  315. package/designer/tools.d.ts +18 -0
  316. package/designer/tutorials/builtins.d.ts +20 -0
  317. package/designer/tutorials/interaction-guard.d.ts +3 -0
  318. package/designer/tutorials/playback.d.ts +17 -0
  319. package/designer/tutorials/scene.d.ts +11 -0
  320. package/designer/tutorials/screenplay.d.ts +3 -0
  321. package/designer/tutorials/types.d.ts +64 -0
  322. package/designer/tutorials/use-tutorial-interaction-guard.d.ts +2 -0
  323. package/designer/tutorials/use-tutorial-playback.d.ts +30 -0
  324. package/designer/types.d.ts +39 -0
  325. package/designer.d.ts +7 -0
  326. package/designer.js +45 -0
  327. package/document-model-GhFP9OGp.js +1302 -0
  328. package/elements/definitions/barcode-element.d.ts +1 -0
  329. package/elements/definitions/ellipse-element.d.ts +1 -0
  330. package/elements/definitions/image-element.d.ts +1 -0
  331. package/elements/definitions/line-element.d.ts +5 -0
  332. package/elements/definitions/qrcode-element.d.ts +1 -0
  333. package/elements/definitions/rect-element.d.ts +1 -0
  334. package/elements/definitions/table-element.d.ts +1 -0
  335. package/elements/definitions/text-element.d.ts +3 -0
  336. package/elements/index.d.ts +8 -0
  337. package/elements/shared/image-drop.d.ts +2 -0
  338. package/elements/shared/line-style.d.ts +4 -0
  339. package/elements/shared/qrcode-inspector.d.ts +7 -0
  340. package/elements/shared/rect-style.d.ts +6 -0
  341. package/elements/shared/shape-props.d.ts +8 -0
  342. package/elements/shared/text-style.d.ts +29 -0
  343. package/elements/table/table-cell-style.d.ts +14 -0
  344. package/elements/table/table-continuation.d.ts +6 -0
  345. package/elements/table/table-html.d.ts +8 -0
  346. package/elements/table/table-layout.d.ts +81 -0
  347. package/elements/table/table-merges.d.ts +3 -0
  348. package/elements/table/table-overflow.d.ts +2 -0
  349. package/elements/table/table-pdf-render.d.ts +3 -0
  350. package/elements/table/table-preview.d.ts +3 -0
  351. package/elements/table/table-render.d.ts +3 -0
  352. package/elements/table/table-structure.d.ts +13 -0
  353. package/elements/table/table-style.d.ts +219 -0
  354. package/host-CuGR8rD6.js +123 -0
  355. package/html2canvas-DGcfD7Np.js +4004 -0
  356. package/index.d.ts +23 -0
  357. package/index.es-LpNWVW4Q.js +5742 -0
  358. package/index.js +84 -0
  359. package/invoice-DuBN6ZCM.js +3282 -0
  360. package/jspdf.es.min-CKTVf941.js +18216 -0
  361. package/locales/adapters/locale-loaders.d.ts +3 -0
  362. package/locales/index.d.ts +11 -0
  363. package/locales/plugin-locales.d.ts +11 -0
  364. package/locales/runtime.d.ts +2084 -0
  365. package/locales/setup.d.ts +3 -0
  366. package/locales/translations/zh-CN/app.json.d.ts +47 -0
  367. package/locales/translations/zh-CN/components.json.d.ts +38 -0
  368. package/locales/translations/zh-CN/core.json.d.ts +127 -0
  369. package/locales/translations/zh-CN/designer.json.d.ts +1562 -0
  370. package/locales/translations/zh-CN/elements.json.d.ts +287 -0
  371. package/locales/translations/zh-CN/parser.json.d.ts +34 -0
  372. package/locales/types.d.ts +8 -0
  373. package/locales/utils.d.ts +5 -0
  374. package/mount-print-designer-BLgVZOnm.js +50 -0
  375. package/mount-print-preview-D7M-1AqH.js +65 -0
  376. package/package.json +46 -4
  377. package/parser/html/html-parser.d.ts +22 -0
  378. package/parser/index.d.ts +28 -0
  379. package/parser/pdf/pdf-parser.d.ts +23 -0
  380. package/parser/prepare-document.d.ts +4 -0
  381. package/parser/prepare-resources.d.ts +7 -0
  382. package/parser/registry.d.ts +6 -0
  383. package/parser/render-runtime.d.ts +39 -0
  384. package/parser/types.d.ts +27 -0
  385. package/parser/worker/render.worker.d.ts +1 -0
  386. package/parser/worker/worker-capabilities.d.ts +6 -0
  387. package/parser/worker/worker-client.d.ts +17 -0
  388. package/parser/worker/worker-handler.d.ts +3 -0
  389. package/parser/worker/worker-protocol.d.ts +55 -0
  390. package/plugins/pen/editing-geometry.d.ts +10 -0
  391. package/plugins/pen/element.d.ts +4 -0
  392. package/plugins/pen/geometry.d.ts +19 -0
  393. package/plugins/pen/index.d.ts +3 -0
  394. package/plugins/pen/locale.d.ts +3 -0
  395. package/plugins/pen/locales/zh-CN.json.d.ts +18 -0
  396. package/plugins/pen/pen-edit-surface.vue.d.ts +10 -0
  397. package/plugins/pen/pen-overlay.vue.d.ts +7 -0
  398. package/plugins/pen/pen-plugin.d.ts +4 -0
  399. package/plugins/pen/pen-preview.vue.d.ts +8 -0
  400. package/plugins/pen/pen-surface.vue.d.ts +9 -0
  401. package/plugins/pen/resources.d.ts +2 -0
  402. package/plugins/saas/client.d.ts +3 -0
  403. package/plugins/saas/errors.d.ts +5 -0
  404. package/plugins/saas/index.d.ts +5 -0
  405. package/plugins/saas/integration.d.ts +2 -0
  406. package/plugins/saas/plugin.d.ts +17 -0
  407. package/plugins/saas/preferences.d.ts +5 -0
  408. package/plugins/saas/types.d.ts +96 -0
  409. package/presets-D3WhkbZK.js +13 -0
  410. package/purchase-order-DNBFPpEZ.js +1526 -0
  411. package/purify.es-BTRXviHm.js +876 -0
  412. package/registries-dZq8MewR.js +9737 -0
  413. package/rolldown-runtime-QGRDbDUS.js +19 -0
  414. package/runtime/browser-output.d.ts +18 -0
  415. package/runtime/document-output.d.ts +21 -0
  416. package/runtime/print-renderer.d.ts +26 -0
  417. package/runtime/registries.d.ts +10 -0
  418. package/runtime.js +45 -0
  419. package/saas-B1H161e1.js +524 -0
  420. package/saas.js +1 -0
  421. package/studio-BFQYHZsg.js +6244 -0
  422. package/studio-types.d.ts +200 -0
  423. package/studio.d.ts +2 -0
  424. package/style.css +2 -0
  425. package/styles/lib.d.ts +0 -0
  426. package/styles.js +0 -0
  427. package/types-Vh_6jhVV.js +5 -0
  428. package/vue.d.ts +13 -0
  429. package/vue.js +32849 -0
@@ -0,0 +1,19 @@
1
+ // \0rolldown/runtime.js
2
+ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), s = (e, n) => {
3
+ let r = {};
4
+ for (var i in e) t(r, i, {
5
+ get: e[i],
6
+ enumerable: !0
7
+ });
8
+ return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
9
+ }, c = (e, i, o, s) => {
10
+ if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
11
+ get: ((e) => i[e]).bind(null, d),
12
+ enumerable: !(s = n(i, d)) || s.enumerable
13
+ });
14
+ return e;
15
+ }, l = (n, r, o) => (o = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule || !a.call(n, "default") ? t(o, "default", {
16
+ value: n,
17
+ enumerable: !0
18
+ }) : o, n));
19
+ export { s as n, l as r, o as t };
@@ -0,0 +1,18 @@
1
+ export interface PreviewHandle {
2
+ close(): void;
3
+ element: HTMLIFrameElement;
4
+ warnings: string[];
5
+ }
6
+ export interface BrowserOutputOptions {
7
+ container?: HTMLElement;
8
+ /** 仅 studio.preview() 使用,其他浏览器输出入口忽略此选项。 */
9
+ mode?: 'designer' | 'iframe';
10
+ signal?: AbortSignal;
11
+ timeoutMs?: number;
12
+ }
13
+ export declare function createBrowserOutput(): {
14
+ dispose: () => void;
15
+ preview: (html: string, options?: BrowserOutputOptions, hidden?: boolean) => Promise<PreviewHandle>;
16
+ print: (html: string, options?: BrowserOutputOptions) => Promise<string[]>;
17
+ track: (handle: PreviewHandle) => PreviewHandle;
18
+ };
@@ -0,0 +1,21 @@
1
+ import { PrintDocument } from '../core/types';
2
+ import { HtmlParseOptions, PdfParseOptions, RenderExecutionOptions } from '../parser';
3
+ import { HtmlResult, PdfResult } from '../studio-types';
4
+ import { BrowserOutputOptions, createBrowserOutput } from './browser-output';
5
+ interface DocumentRendering {
6
+ html(document: PrintDocument, input?: Record<string, unknown>, options?: HtmlParseOptions, execution?: RenderExecutionOptions): Promise<HtmlResult>;
7
+ pdf(document: PrintDocument, input?: Record<string, unknown>, options?: PdfParseOptions, execution?: RenderExecutionOptions): Promise<PdfResult>;
8
+ }
9
+ export declare function createDocumentOutput(rendering: DocumentRendering, browser: ReturnType<typeof createBrowserOutput> | undefined, ensureActive: () => void): {
10
+ preview(document: PrintDocument, input?: Record<string, unknown>, options?: BrowserOutputOptions): Promise<{
11
+ warnings: string[];
12
+ close(): void;
13
+ element: HTMLIFrameElement;
14
+ }>;
15
+ print(document: PrintDocument, input?: Record<string, unknown>, options?: BrowserOutputOptions): Promise<{
16
+ warnings: string[];
17
+ }>;
18
+ toHTML: (document: PrintDocument, input?: Record<string, unknown>, options?: HtmlParseOptions, execution?: RenderExecutionOptions) => Promise<HtmlResult>;
19
+ toPDF: (document: PrintDocument, input?: Record<string, unknown>, options?: PdfParseOptions, execution?: RenderExecutionOptions) => Promise<PdfResult>;
20
+ };
21
+ export {};
@@ -0,0 +1,26 @@
1
+ import { ErrorRuntime } from '../components/error-fallback/core';
2
+ import { RuntimeConfigOptions } from '../core/runtime-config';
3
+ import { PrintDocument } from '../core/types';
4
+ import { HtmlParseOptions, PdfParseOptions, RenderExecutionOptions } from '../parser';
5
+ import { BrowserOutputOptions } from './browser-output';
6
+ import { RegistryOptions } from './registries';
7
+ export interface PrintRendererOptions extends RegistryOptions, RuntimeConfigOptions {
8
+ errors?: ErrorRuntime;
9
+ }
10
+ export declare function createPrintRenderer(options?: PrintRendererOptions): {
11
+ preview: (template: PrintDocument, data: Record<string, unknown>, outputOptions?: BrowserOutputOptions) => Promise<{
12
+ warnings: string[];
13
+ close(): void;
14
+ element: HTMLIFrameElement;
15
+ }>;
16
+ print: (template: PrintDocument, data: Record<string, unknown>, outputOptions?: BrowserOutputOptions) => Promise<{
17
+ warnings: string[];
18
+ }>;
19
+ toHTML: (template: PrintDocument, data: Record<string, unknown>, parseOptions?: HtmlParseOptions, execution?: RenderExecutionOptions) => Promise<import('..').HtmlResult>;
20
+ toPDF: (template: PrintDocument, data: Record<string, unknown>, parseOptions?: PdfParseOptions, execution?: RenderExecutionOptions) => Promise<import('..').PdfResult>;
21
+ elements: import('../core').ElementRegistry;
22
+ parsers: import('..').ParserRegistry;
23
+ dispose: () => void;
24
+ errors: ErrorRuntime;
25
+ };
26
+ export type PrintRenderer = ReturnType<typeof createPrintRenderer>;
@@ -0,0 +1,10 @@
1
+ import { ElementDefinition, ElementRegistry } from '../core/element-registry';
2
+ import { DocumentParser, ParserRegistry } from '../parser/types';
3
+ export interface RegistryOptions {
4
+ elements?: ElementDefinition[];
5
+ parsers?: DocumentParser<unknown, unknown>[];
6
+ }
7
+ export declare function createRegistries(options?: RegistryOptions): {
8
+ elements: ElementRegistry;
9
+ parsers: ParserRegistry;
10
+ };
package/runtime.js ADDED
@@ -0,0 +1,45 @@
1
+ import { t as e } from "./cloneDeep-PCw2ErRl.js";
2
+ import { O as t, Y as n, Z as r, n as i, r as a, t as o } from "./registries-dZq8MewR.js";
3
+ // src/runtime/print-renderer.ts
4
+ function s(s = {}) {
5
+ let c = t(s), l = s.errors ?? r(), u = o(s), d = a({
6
+ ...u,
7
+ config: () => c.rendering,
8
+ snapshot: e
9
+ }), f = i(), p = !1, m = n(d, f, () => {
10
+ if (p) throw Error("Print renderer has been disposed");
11
+ });
12
+ async function h(e, t) {
13
+ if (p) throw Error("Print renderer has been disposed");
14
+ try {
15
+ return await t();
16
+ } catch (t) {
17
+ throw await l.capture(t, { source: e }), t;
18
+ }
19
+ }
20
+ function g(t, n, r, i) {
21
+ return h("runtime.html", () => m.toHTML(e(t), e(n), r, i));
22
+ }
23
+ function _(t, n, r, i) {
24
+ return h("runtime.pdf", () => m.toPDF(e(t), e(n), r, i));
25
+ }
26
+ function v(t, n, r) {
27
+ return h("runtime.preview", () => m.preview(e(t), e(n), r));
28
+ }
29
+ function y(t, n, r) {
30
+ return h("runtime.print", () => m.print(e(t), e(n), r));
31
+ }
32
+ function b() {
33
+ p || (p = !0, d.dispose(), f.dispose());
34
+ }
35
+ return {
36
+ dispose: b,
37
+ errors: l,
38
+ ...u,
39
+ preview: v,
40
+ print: y,
41
+ toHTML: g,
42
+ toPDF: _
43
+ };
44
+ }
45
+ export { s as createPrintRenderer };
@@ -0,0 +1,524 @@
1
+ import { A as e, B as t, P as n, t as r } from "./cloneDeep-PCw2ErRl.js";
2
+ // src/plugins/saas/errors.ts
3
+ var i = class extends e {
4
+ status;
5
+ constructor(e, n) {
6
+ super(t("app.saas.requestFailed"), {
7
+ code: "saas.http-failed",
8
+ detail: n
9
+ }), this.status = e, this.name = "SaasHttpError";
10
+ }
11
+ };
12
+ // src/plugins/saas/client.ts
13
+ function a(e = {}) {
14
+ let t = (...t) => {
15
+ let n = e.fetcher ?? globalThis.fetch;
16
+ if (!n) throw Error("A fetch implementation is required for SaaS requests");
17
+ return n(...t);
18
+ }, n = e.baseUrl ?? "", r = e.credentials ?? "include", a = {
19
+ config: "/api/config",
20
+ exports: "/api/exports",
21
+ preferences: "/api/preferences",
22
+ session: "/api/session",
23
+ templates: "/api/templates",
24
+ workspace: "/api/workspace",
25
+ ...e.paths
26
+ };
27
+ async function o() {
28
+ return e.headers ? typeof e.headers == "function" ? e.headers() : e.headers : {};
29
+ }
30
+ async function s(e, a, s = "application/json") {
31
+ let c = new Headers(await o());
32
+ c.has("Accept") || c.set("Accept", s), new Headers(a?.headers).forEach((e, t) => c.set(t, e));
33
+ let l = await t(`${n}${e}`, {
34
+ credentials: r,
35
+ ...a,
36
+ headers: c
37
+ });
38
+ if (!l.ok) {
39
+ let e = `SaaS request failed: ${l.status}`;
40
+ try {
41
+ e = (await l.json()).error ?? e;
42
+ } catch {}
43
+ throw new i(l.status, e);
44
+ }
45
+ return l;
46
+ }
47
+ async function c(e, t) {
48
+ return await (await s(e, t)).json();
49
+ }
50
+ function l(e, t) {
51
+ return {
52
+ body: JSON.stringify(t),
53
+ headers: { "Content-Type": "application/json" },
54
+ method: e
55
+ };
56
+ }
57
+ return {
58
+ async cancelExport(e) {
59
+ await s(`${a.exports}/${encodeURIComponent(e)}`, { method: "DELETE" });
60
+ },
61
+ async createTemplate(e) {
62
+ return (await c(a.templates, l("POST", { document: e }))).template;
63
+ },
64
+ async deleteTemplate(e, t) {
65
+ await s(`${a.templates}/${encodeURIComponent(e)}`, l("DELETE", { revision: t }));
66
+ },
67
+ async downloadExport(e) {
68
+ return (await s(`${a.exports}/${encodeURIComponent(e)}/file`, void 0, "*/*")).blob();
69
+ },
70
+ async getConfig() {
71
+ return c(a.config);
72
+ },
73
+ async getExport(e) {
74
+ return (await c(`${a.exports}/${encodeURIComponent(e)}`)).job;
75
+ },
76
+ async getPreferences() {
77
+ return (await c(a.preferences)).preferences;
78
+ },
79
+ async getSession() {
80
+ return c(a.session);
81
+ },
82
+ async getTemplate(e) {
83
+ return (await c(`${a.templates}/${encodeURIComponent(e)}`)).template;
84
+ },
85
+ async getWorkspace() {
86
+ return (await c(a.workspace)).workspace;
87
+ },
88
+ async listTemplates() {
89
+ return (await c(a.templates)).templates;
90
+ },
91
+ async logout() {
92
+ await s(a.session, { method: "DELETE" });
93
+ },
94
+ async saveWorkspace(e, t) {
95
+ return c(a.workspace, l("PUT", {
96
+ document: t,
97
+ revision: e
98
+ }));
99
+ },
100
+ async setPreference(e, t) {
101
+ await s(`${a.preferences}/${encodeURIComponent(e)}`, l("PUT", { value: t }));
102
+ },
103
+ async submitExport(e, t, n) {
104
+ return (await c(a.exports, l("POST", {
105
+ document: t,
106
+ format: e,
107
+ input: n
108
+ }))).job;
109
+ },
110
+ async updateTemplate(e, t, n) {
111
+ return (await c(`${a.templates}/${encodeURIComponent(e)}`, l("PUT", {
112
+ document: n,
113
+ revision: t
114
+ }))).template;
115
+ }
116
+ };
117
+ }
118
+ // src/plugins/saas/preferences.ts
119
+ function o(e, t, n) {
120
+ let r = { ...t }, i = /* @__PURE__ */ new Map(), a = !1;
121
+ return {
122
+ dispose() {
123
+ a = !0, i.clear();
124
+ },
125
+ get(e) {
126
+ return r[e] ?? null;
127
+ },
128
+ set(t, o) {
129
+ if (a || r[t] === o) return;
130
+ r[t] = o;
131
+ let s = (i.get(t) ?? Promise.resolve()).then(() => {
132
+ if (!a) return e.setPreference(t, o);
133
+ }).catch((e) => {
134
+ a || n(e);
135
+ });
136
+ i.set(t, s);
137
+ }
138
+ };
139
+ }
140
+ // src/plugins/saas/plugin.ts
141
+ function s(n, r) {
142
+ return {
143
+ id: `saas.${r.id}`,
144
+ async load() {
145
+ let i = r.document ? r : await n.getTemplate(r.id);
146
+ if (!i.document) throw new e(t("app.saas.templateFailed"), { code: "saas.template-missing" });
147
+ return i.document;
148
+ },
149
+ name: r.name,
150
+ async remove() {
151
+ await n.deleteTemplate(r.id, r.revision);
152
+ },
153
+ async update(e) {
154
+ await n.updateTemplate(r.id, r.revision, e);
155
+ }
156
+ };
157
+ }
158
+ function c(e) {
159
+ return {
160
+ async create(t) {
161
+ await e.createTemplate(t);
162
+ },
163
+ id: "saas",
164
+ async list() {
165
+ return (await e.listTemplates()).map((t) => s(e, t));
166
+ },
167
+ title: () => t("app.saas.templateSource")
168
+ };
169
+ }
170
+ function l(e, t) {
171
+ return (e instanceof i || typeof e == "object" && !!e && "status" in e) && e.status === t;
172
+ }
173
+ function u(e) {
174
+ return new Promise((t, n) => {
175
+ e.throwIfAborted();
176
+ let r = setTimeout(() => {
177
+ e.removeEventListener("abort", i), t();
178
+ }, 500);
179
+ function i() {
180
+ clearTimeout(r), n(e.reason);
181
+ }
182
+ e.addEventListener("abort", i, { once: !0 });
183
+ });
184
+ }
185
+ async function d(n, r, i) {
186
+ let a = r;
187
+ for (; a.status === "queued" || a.status === "running";) await u(i), a = await n.getExport(a.id);
188
+ if (a.status !== "completed") throw new e(t("app.saas.exportFailed"), {
189
+ code: "saas.export-failed",
190
+ detail: a.error
191
+ });
192
+ return a;
193
+ }
194
+ function f(n, r, i, a) {
195
+ let o = [];
196
+ o.push(n.document.suspendPersistence());
197
+ let s = !1, c = i.initialRevision ?? 0, u = i.initialSnapshot ? JSON.stringify(i.initialSnapshot) : "", d, f = !1, p = 1e3, m = !1, h, g = !1, _, v = JSON.stringify(n.document.getPersistentDocument()), y;
198
+ a === void 0 ? i.initialRevision !== void 0 || i.initialSnapshot ? (g = !0, y = Promise.resolve()) : y = x().then(() => {
199
+ g = !0;
200
+ }) : (b(a), g = !0, y = Promise.resolve()), y.catch((e) => {
201
+ h = e, f = !0, s || n.errors.capture(e, { source: "saas.workspace" });
202
+ });
203
+ function b(r) {
204
+ if (!r) return;
205
+ let i = n.document.normalize(r.document);
206
+ if (i.skippedTypes.length > 0) throw new e(t("designer.documentStore.skippedElementTypesMessage", { elementTypes: i.skippedTypes.join(", ") }), { code: "document.unsupported-elements" });
207
+ if (v !== JSON.stringify(i.document)) throw Error("Prepared SaaS workspace does not match the designer document");
208
+ c = r.revision, u = v;
209
+ }
210
+ async function x() {
211
+ let i = await r.getWorkspace();
212
+ if (s || !i) return;
213
+ if (JSON.stringify(n.document.getPersistentDocument()) !== v) throw m = !0, new e(t("app.saas.conflict"), { code: "saas.conflict" });
214
+ let a = n.document.normalize(i.document);
215
+ if (a.skippedTypes.length > 0) throw new e(t("designer.documentStore.skippedElementTypesMessage", { elementTypes: a.skippedTypes.join(", ") }), { code: "document.unsupported-elements" });
216
+ n.document.load(a.document), c = i.revision, u = JSON.stringify(n.document.getPersistentDocument());
217
+ }
218
+ function S() {
219
+ s || f || (clearTimeout(_), _ = setTimeout(() => {
220
+ C().catch((r) => {
221
+ if (s || !g) return;
222
+ (l(r, 409) || l(r, 401)) && (f = !0, m = l(r, 409));
223
+ let i = l(r, 409) ? t("app.saas.conflict") : t("app.saas.saveFailed");
224
+ n.errors.capture(new e(i, {
225
+ cause: r,
226
+ code: "saas.save-failed"
227
+ }), { source: "saas.persistence" }), !f && !s && (_ = setTimeout(S, p), p = Math.min(p * 2, 3e4));
228
+ });
229
+ }, i.saveDelayMs ?? 800));
230
+ }
231
+ async function C() {
232
+ if (await y, s) return;
233
+ if (h) throw h;
234
+ if (m) throw new e(t("app.saas.conflict"), { code: "saas.conflict" });
235
+ for (; d;) await d;
236
+ if (s) return;
237
+ if (f) throw new e(t("app.saas.saveFailed"), { code: "saas.save-failed" });
238
+ let i = n.document.getPersistentDocument(), a = JSON.stringify(i);
239
+ if (a === u) return;
240
+ let o = (async () => {
241
+ c = (await r.saveWorkspace(c, i)).revision, u = a, p = 1e3;
242
+ })();
243
+ d = o;
244
+ try {
245
+ await o;
246
+ } finally {
247
+ d = void 0;
248
+ }
249
+ }
250
+ o.push(n.events.on("document:changed", S)), y.then(() => {
251
+ !i.initialSnapshot && u === "" && S();
252
+ }, () => {});
253
+ let w = n.commands.get("file.save") ?? {
254
+ group: "file",
255
+ id: "file.save",
256
+ order: 3,
257
+ shortcut: "Ctrl+S",
258
+ get title() {
259
+ return t("designer.builtins.saveTemplateTitle");
260
+ }
261
+ };
262
+ return o.push(n.commands.registerScoped([{
263
+ ...w,
264
+ async run() {
265
+ clearTimeout(_), await C(), n.ui.toast(t("designer.documentActions.documentSavedMessage"), "success");
266
+ },
267
+ get title() {
268
+ return w.title;
269
+ }
270
+ }, {
271
+ id: "document.save",
272
+ async run() {
273
+ clearTimeout(_), await C();
274
+ },
275
+ get title() {
276
+ return w.title;
277
+ }
278
+ }])), {
279
+ dispose() {
280
+ s = !0, clearTimeout(_);
281
+ for (let e of o.reverse()) e();
282
+ },
283
+ async save() {
284
+ clearTimeout(_), await C();
285
+ }
286
+ };
287
+ }
288
+ async function p(e, t, i, a, o, s) {
289
+ let c;
290
+ try {
291
+ c = await t.submitExport(i, a, o ? r(o) : n(a)), s.throwIfAborted();
292
+ let e = await d(t, c, s), l = await t.downloadExport(c.id);
293
+ return s.throwIfAborted(), {
294
+ blob: l,
295
+ warnings: e.warnings
296
+ };
297
+ } finally {
298
+ if (s.aborted && c) {
299
+ try {
300
+ await t.cancelExport(c.id);
301
+ } catch (t) {
302
+ e.errors.capture(t, { source: "saas.export-cancel" });
303
+ }
304
+ s.throwIfAborted();
305
+ }
306
+ }
307
+ }
308
+ function m(e, n, r) {
309
+ if (r.length > 0) {
310
+ let i = t(`designer.documentActions.${n === "html" ? "exportHtmlAction" : "exportPdfAction"}`);
311
+ e.ui.toast(t("designer.documentActions.bindingWarningsMessage", {
312
+ actionName: i,
313
+ count: r.length
314
+ })), console.warn(t("designer.documentActions.bindingWarningsDetail", {
315
+ actionName: i,
316
+ warnings: r.join("\n")
317
+ }));
318
+ }
319
+ let i = n === "html" ? "htmlExportedMessage" : "pdfExportedMessage";
320
+ e.ui.toast(t(`designer.documentActions.${i}`), "success");
321
+ }
322
+ function h(e, n) {
323
+ let r, i = !e.commands.get("export.html") && !e.commands.get("export.pdf"), a = ["html", "pdf"].map((a) => {
324
+ let o = e.commands.get(`export.${a}`);
325
+ if (!o && i && (o = {
326
+ group: "export",
327
+ id: `export.${a}`,
328
+ order: a === "html" ? 10 : 11,
329
+ run() {},
330
+ get title() {
331
+ return t(`designer.builtins.${a === "html" ? "exportHtmlTitle" : "exportPdfTitle"}`);
332
+ }
333
+ }), !o) throw Error(`Missing export command: ${a}`);
334
+ return {
335
+ ...o,
336
+ async run(t, ...i) {
337
+ if (e.rendering.active || e.ui.exportDialog) return;
338
+ let o = e.document.getDocument();
339
+ e.ui.openExportDialog(a);
340
+ try {
341
+ let t = await e.rendering.runExternal(async (t) => {
342
+ let s = new AbortController();
343
+ r = s;
344
+ let c = () => s.abort(t.reason);
345
+ t.addEventListener("abort", c, { once: !0 }), t.aborted && c();
346
+ try {
347
+ let t = i[0];
348
+ return await p(e, n, a, o, t, s.signal);
349
+ } finally {
350
+ t.removeEventListener("abort", c), r === s && (r = void 0);
351
+ }
352
+ });
353
+ e.ui.completeExportDialog(), e.output.download(`${o.name || "document"}.${a}`, t.blob), m(e, a, t.warnings);
354
+ } finally {
355
+ e.ui.finishExportDialog();
356
+ }
357
+ },
358
+ get title() {
359
+ return o.title;
360
+ }
361
+ };
362
+ }), o = e.commands.registerScoped(a);
363
+ return () => {
364
+ r?.abort(new DOMException("SaaS plugin disposed", "AbortError")), o();
365
+ };
366
+ }
367
+ function g(e, t = {}) {
368
+ let n = _(e, t);
369
+ return t.preferences ? {
370
+ manifest: {
371
+ ...n.manifest,
372
+ permissions: [...n.manifest.permissions ?? [], "preferences"]
373
+ },
374
+ async setup(t) {
375
+ let r = await e.getPreferences();
376
+ t.signal.throwIfAborted();
377
+ let i = o(e, r, (e) => {
378
+ t.signal.aborted || t.errors.capture(e, { source: "saas.preferences" });
379
+ });
380
+ return t.onDispose(i.dispose), t.preferences.register(i), n.setup(t);
381
+ }
382
+ } : n;
383
+ }
384
+ function _(e, n = {}, r) {
385
+ return {
386
+ manifest: {
387
+ apiVersion: "1.0",
388
+ id: "saas:services",
389
+ permissions: [
390
+ "commands",
391
+ "events",
392
+ "templates",
393
+ "document:read",
394
+ "document:write",
395
+ "ui",
396
+ "rendering"
397
+ ],
398
+ version: "1.0.0"
399
+ },
400
+ setup(i) {
401
+ let a = [];
402
+ try {
403
+ let o = n.workspace ? f(i, e, n, r) : void 0;
404
+ return o && a.push(o.dispose), n.templates && a.push(i.templateLibrary.register(c(e))), n.workspace && a.push(i.commands.registerScoped([{
405
+ group: "file",
406
+ id: "saas.downloadJson",
407
+ order: 3.5,
408
+ run() {
409
+ let e = i.document.getDocument();
410
+ i.output.download(`${e.name || "document"}.json`, new Blob([JSON.stringify(e, null, 2)], { type: "application/json" }));
411
+ },
412
+ get title() {
413
+ return t("app.saas.downloadJson");
414
+ }
415
+ }])), n.logout !== !1 && a.push(i.commands.registerScoped([{
416
+ group: "file",
417
+ id: "saas.logout",
418
+ order: 100,
419
+ async run() {
420
+ await o?.save(), await e.logout();
421
+ },
422
+ get title() {
423
+ return t("app.saas.logout");
424
+ }
425
+ }])), n.exports && a.push(h(i, e)), () => {
426
+ for (let e of a.reverse()) e();
427
+ };
428
+ } catch (e) {
429
+ for (let e of a.reverse()) e();
430
+ throw e;
431
+ }
432
+ }
433
+ };
434
+ }
435
+ // src/plugins/saas/integration.ts
436
+ function v(e, t) {
437
+ if (!t?.onUnauthorized) return e;
438
+ async function n(e) {
439
+ throw typeof e == "object" && e && "status" in e && e.status === 401 && await t?.onUnauthorized?.(e), e;
440
+ }
441
+ return new Proxy(e, { get(e, t, r) {
442
+ let i = Reflect.get(e, t, r);
443
+ return typeof i == "function" ? (...t) => {
444
+ try {
445
+ return Reflect.apply(i, e, t).catch(n);
446
+ } catch (e) {
447
+ return n(e);
448
+ }
449
+ } : i;
450
+ } });
451
+ }
452
+ function y(e = {}) {
453
+ let t = v({
454
+ ...a(e),
455
+ ...e.api
456
+ }, e.hooks);
457
+ async function n(e = {}) {
458
+ let n = e.discoverFeatures ? await t.getConfig() : void 0;
459
+ if (n && n.mode !== "saas") throw Error("The service is not configured for SaaS");
460
+ e.authenticate !== !1 && await t.getSession();
461
+ let i = e.workspace ?? n?.features.workspace ?? !0, a = e.preferences ?? i, [s, c] = await Promise.all([i ? t.getWorkspace() : Promise.resolve(null), a ? t.getPreferences() : Promise.resolve({})]), l, u = !1, d = !1, f = [], p = o(t, c, (t) => {
462
+ e.onError ? e.onError(t) : l ? l.capture(t, { source: "saas.preferences" }) : f.push(t);
463
+ }), m = _(r, {
464
+ exports: e.exports ?? n?.features.exports ?? !0,
465
+ logout: e.logout,
466
+ saveDelayMs: e.saveDelayMs,
467
+ templates: e.templates ?? n?.features.templates ?? !0,
468
+ workspace: i
469
+ }, s), h = {
470
+ manifest: m.manifest,
471
+ setup(e) {
472
+ if (u || d) throw Error("Prepared SaaS integration has already been used");
473
+ d = !0, l = e.errors;
474
+ for (let e of f.splice(0)) l.capture(e, { source: "saas.preferences" });
475
+ let t;
476
+ try {
477
+ let n = m.setup(e);
478
+ if (n instanceof Promise) throw Error("Prepared SaaS setup must be synchronous");
479
+ t = n;
480
+ } catch (e) {
481
+ throw u = !0, p.dispose(), l = void 0, e;
482
+ }
483
+ return () => {
484
+ try {
485
+ t?.();
486
+ } finally {
487
+ u = !0, p.dispose(), l = void 0;
488
+ }
489
+ };
490
+ }
491
+ };
492
+ return {
493
+ designerOptions: {
494
+ initialDocument: s?.document,
495
+ persistPreferences: a,
496
+ preferenceStorage: a ? p : void 0,
497
+ ...i ? { storage: !1 } : {},
498
+ strictInitialDocument: i
499
+ },
500
+ dispose() {
501
+ if (d && !u) throw Error("Remove the SaaS plugin before disposing its preparation");
502
+ u = !0, p.dispose();
503
+ },
504
+ plugin: h
505
+ };
506
+ }
507
+ let r = {
508
+ ...t,
509
+ createPlugin(e) {
510
+ return g(r, e ?? {
511
+ exports: !0,
512
+ preferences: !0,
513
+ templates: !0,
514
+ workspace: !0
515
+ });
516
+ },
517
+ async logout() {
518
+ await t.logout(), await e.hooks?.onLogout?.();
519
+ },
520
+ prepare: n
521
+ };
522
+ return r;
523
+ }
524
+ export { i, g as n, c as r, y as t };
package/saas.js ADDED
@@ -0,0 +1 @@
1
+ export { i as SaasHttpError, t as createSaasClient, n as createSaasPlugin, r as createSaasTemplateProvider } from "./saas-B1H161e1.js";