@bluechaine/print-designer 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.en.md +154 -0
  2. package/README.md +151 -0
  3. package/README.zh-CN.md +5 -0
  4. package/dist/plugins/api-image.cjs +2 -0
  5. package/dist/plugins/api-image.cjs.map +1 -0
  6. package/dist/plugins/api-image.mjs +28 -0
  7. package/dist/plugins/api-image.mjs.map +1 -0
  8. package/dist/plugins/api-pdf.cjs +2 -0
  9. package/dist/plugins/api-pdf.cjs.map +1 -0
  10. package/dist/plugins/api-pdf.mjs +35 -0
  11. package/dist/plugins/api-pdf.mjs.map +1 -0
  12. package/dist/plugins/view-code-edit.cjs +11 -0
  13. package/dist/plugins/view-code-edit.cjs.map +1 -0
  14. package/dist/plugins/view-code-edit.mjs +55 -0
  15. package/dist/plugins/view-code-edit.mjs.map +1 -0
  16. package/dist/types/plugins/plugin-api-image/src/index.d.ts +11 -0
  17. package/dist/types/plugins/plugin-api-pdf/src/index.d.ts +15 -0
  18. package/dist/types/plugins/plugin-view-code-edit/src/index.d.ts +15 -0
  19. package/dist/types/src/components/Designer.vue.d.ts +2016 -0
  20. package/dist/types/src/components/DragBox.vue.d.ts +223 -0
  21. package/dist/types/src/components/Header.vue.d.ts +96 -0
  22. package/dist/types/src/components/JsonEditorModal.vue.d.ts +25 -0
  23. package/dist/types/src/components/Preview.vue.d.ts +27 -0
  24. package/dist/types/src/components/PrintDataEditorModal.vue.d.ts +86 -0
  25. package/dist/types/src/components/Ruler.vue.d.ts +16 -0
  26. package/dist/types/src/components/SvpIcon.vue.d.ts +31 -0
  27. package/dist/types/src/components/Toolbar.vue.d.ts +116 -0
  28. package/dist/types/src/components/panels/DraggableElsPanel.vue.d.ts +322 -0
  29. package/dist/types/src/components/panels/LocationExchangePanel.vue.d.ts +226 -0
  30. package/dist/types/src/components/panels/MiniMapPanel.vue.d.ts +278 -0
  31. package/dist/types/src/components/panels/PageHistoryPanel.vue.d.ts +345 -0
  32. package/dist/types/src/components/panels/PageStructurePanel.vue.d.ts +262 -0
  33. package/dist/types/src/components/panels/PageTabsPanel.vue.d.ts +267 -0
  34. package/dist/types/src/components/panels/PaperProperties.vue.d.ts +52 -0
  35. package/dist/types/src/components/panels/PropertiesPanel.vue.d.ts +225 -0
  36. package/dist/types/src/composables/useDesigner.d.ts +9 -0
  37. package/dist/types/src/composables/useDesignerUi.d.ts +2 -0
  38. package/dist/types/src/composables/useDragBox.d.ts +41 -0
  39. package/dist/types/src/composables/useRuler.d.ts +10 -0
  40. package/dist/types/src/constants/default-table-element.d.ts +151 -0
  41. package/dist/types/src/constants/header-elements.d.ts +3 -0
  42. package/dist/types/src/constants/icons.d.ts +61 -0
  43. package/dist/types/src/constants/panel-layout.d.ts +74 -0
  44. package/dist/types/src/constants.d.ts +37 -0
  45. package/dist/types/src/core/designer-options.d.ts +34 -0
  46. package/dist/types/src/core/designer-utils.d.ts +209 -0
  47. package/dist/types/src/core/hiprint-bridge.d.ts +24 -0
  48. package/dist/types/src/core/hiprint-paper-list.d.ts +20 -0
  49. package/dist/types/src/core/history-labels.d.ts +8 -0
  50. package/dist/types/src/core/history.d.ts +24 -0
  51. package/dist/types/src/core/json-editor-modal.d.ts +15 -0
  52. package/dist/types/src/core/plugins.d.ts +17 -0
  53. package/dist/types/src/core/preview-html.d.ts +2 -0
  54. package/dist/types/src/core/print-data-editor-modal.d.ts +19 -0
  55. package/dist/types/src/core/providers.d.ts +5 -0
  56. package/dist/types/src/core/register-icons.d.ts +1 -0
  57. package/dist/types/src/core/shortcuts.d.ts +20 -0
  58. package/dist/types/src/core/storage.d.ts +3 -0
  59. package/dist/types/src/core/stores.d.ts +77 -0
  60. package/dist/types/src/core/svp-element-provider.d.ts +8 -0
  61. package/dist/types/src/core/template-fields.d.ts +28 -0
  62. package/dist/types/src/core/theme.d.ts +1 -0
  63. package/dist/types/src/i18n/en-US.d.ts +104 -0
  64. package/dist/types/src/i18n/index.d.ts +12 -0
  65. package/dist/types/src/i18n/zh-CN.d.ts +104 -0
  66. package/dist/types/src/index.d.ts +52 -0
  67. package/dist/types/src/types.d.ts +229 -0
  68. package/dist/vue2/index.cjs +10329 -0
  69. package/dist/vue2/index.cjs.map +1 -0
  70. package/dist/vue2/index.mjs +10324 -0
  71. package/dist/vue2/index.mjs.map +1 -0
  72. package/dist/vue2/index.umd.cjs +10330 -0
  73. package/dist/vue2/index.umd.cjs.map +1 -0
  74. package/dist/vue2/style.css +2657 -0
  75. package/dist/vue3/index.cjs +10062 -0
  76. package/dist/vue3/index.cjs.map +1 -0
  77. package/dist/vue3/index.mjs +10057 -0
  78. package/dist/vue3/index.mjs.map +1 -0
  79. package/dist/vue3/index.umd.cjs +10063 -0
  80. package/dist/vue3/index.umd.cjs.map +1 -0
  81. package/dist/vue3/style.css +2657 -0
  82. package/package.json +129 -0
@@ -0,0 +1,209 @@
1
+ import { PluginManager } from './plugins';
2
+ import { HistoryController } from './history';
3
+ import { ShortcutsController } from './shortcuts';
4
+ import type { PrintDataEditorModalHost } from './print-data-editor-modal';
5
+ import type { DesignOptions, DesignerPrintTemplateOptions, Events, PluginOptions, Provider, ProviderMap } from '../types';
6
+ export interface DesignerUtilsOptions {
7
+ connect?: boolean;
8
+ config?: any;
9
+ paperList?: import('../types').PaperType[];
10
+ providers?: Provider[];
11
+ providerMap?: ProviderMap | ProviderMap[];
12
+ plugins?: PluginOptions[];
13
+ tags?: string[];
14
+ templateKey?: string;
15
+ title?: string;
16
+ printData?: any;
17
+ events?: Events;
18
+ designOptions?: DesignOptions;
19
+ }
20
+ /**
21
+ * Façade exposed to Vue components & plugins. Mirrors the public API of
22
+ * sv-print's `DesignerUtils` so that templates and plugins port cleanly.
23
+ */
24
+ export default class DesignerUtils {
25
+ static instance: DesignerUtils | null;
26
+ options: DesignerUtilsOptions;
27
+ printTemplate: any;
28
+ printData: any;
29
+ plugins: PluginManager;
30
+ history: HistoryController;
31
+ shortcuts: ShortcutsController;
32
+ /** Sub-component refs registered by Vue components on mount. */
33
+ ruler: any;
34
+ preview: any;
35
+ toolbar: any;
36
+ miniMap: any;
37
+ mobilePanel: any;
38
+ pageHistory: any;
39
+ editor: any;
40
+ printDataEditor: PrintDataEditorModalHost | null;
41
+ /** Reactive state shared with the UI. */
42
+ state: {
43
+ theme: string;
44
+ themeList: (string | {
45
+ theme?: string | undefined;
46
+ primaryColor: string;
47
+ primaryContent?: string | undefined;
48
+ secondaryColor?: string | undefined;
49
+ secondaryContent?: string | undefined;
50
+ accentColor?: string | undefined;
51
+ accentContent?: string | undefined;
52
+ neutralColor?: string | undefined;
53
+ neutralContent?: string | undefined;
54
+ base100?: string | undefined;
55
+ base200?: string | undefined;
56
+ base300?: string | undefined;
57
+ baseContent?: string | undefined;
58
+ info?: string | undefined;
59
+ infoContent?: string | undefined;
60
+ success?: string | undefined;
61
+ successContent?: string | undefined;
62
+ warning?: string | undefined;
63
+ warningContent?: string | undefined;
64
+ error?: string | undefined;
65
+ errorContent?: string | undefined;
66
+ })[];
67
+ lang: string;
68
+ zoom: number;
69
+ panels: {
70
+ draggableEls: boolean;
71
+ miniMap: boolean;
72
+ pageStructure: boolean;
73
+ pageHistory: boolean;
74
+ properties: boolean;
75
+ };
76
+ selection: {
77
+ count: number;
78
+ ids: string[];
79
+ elements: unknown[];
80
+ };
81
+ history: {
82
+ index: number;
83
+ total: number;
84
+ capacity: number;
85
+ canUndo: boolean;
86
+ canRedo: boolean;
87
+ };
88
+ isMobile: boolean;
89
+ uiPulse: number;
90
+ };
91
+ /** Clipboard for cut / copy / paste shortcuts. */
92
+ private clipboard;
93
+ private pasteOffsetStep;
94
+ private selectionEventCleanup;
95
+ private zoomEventCleanup;
96
+ /** Optional hooks set by `<Designer>` after template / print-data edits. */
97
+ onTemplateChange?: (json: any) => void;
98
+ onPrintDataChange?: (data: any) => void;
99
+ constructor();
100
+ private afterHistoryApply;
101
+ static getInstance(): DesignerUtils;
102
+ static setInstance(u: DesignerUtils): void;
103
+ setRuler(ruler: any): void;
104
+ setPreview(preview: any): void;
105
+ setToolBar(toolbar: any): void;
106
+ setMiniMap(miniMap: any): void;
107
+ setMobilePanel(panel: any): void;
108
+ setPageHistory(history: any): void;
109
+ setEditor(editor: any): void;
110
+ setPrintDataEditor(editor: PrintDataEditorModalHost | null): void;
111
+ setPrintData(data: any): void;
112
+ setPlugins(plugins?: PluginOptions[]): void;
113
+ setConfig(config?: any): void;
114
+ setConnect(connect?: boolean, _callback?: (status?: boolean, msg?: any) => void): void;
115
+ initProviders(providers?: Provider[]): void;
116
+ buildByProvider(map?: ProviderMap | ProviderMap[], _clear?: boolean): void;
117
+ buildByHtml(tags?: string[]): void;
118
+ newPrintTemplate(template: any): any;
119
+ newDesigner(options: DesignerPrintTemplateOptions, designOptions?: DesignOptions): any;
120
+ private unbindSelectionEvents;
121
+ private unbindZoomEvents;
122
+ /** Keep store/ruler in sync when hiprint paper scale changes (e.g. zoom toolbar). */
123
+ private bindZoomEvents;
124
+ private syncZoomFromTemplate;
125
+ private readTemplateScale;
126
+ /** Sync Vue selection state when hiprint selects / deselects print elements. */
127
+ private bindSelectionEvents;
128
+ refreshPrintTemplate(): void;
129
+ private getElementTransformParts;
130
+ private buildTransformValue;
131
+ private getTransformTarget;
132
+ private applyElementTransform;
133
+ private reapplyElementTransforms;
134
+ refreshSelection(): void;
135
+ /** Select a print element from auxiliary panels (page structure, etc.). */
136
+ selectPrintElement(item: any): void;
137
+ /** Re-apply hiprint selection UI after toolbar actions that would clear it. */
138
+ private restoreSelection;
139
+ getTemplateJson(): any;
140
+ private templateStorageKey;
141
+ save(): void;
142
+ loadSaved(): any | null;
143
+ private openJsonEditor;
144
+ edit(): Promise<void>;
145
+ editData(): Promise<void>;
146
+ editFunction(option: any, printElement: any, event: any): void;
147
+ export(): void;
148
+ import(): void;
149
+ /** Import onto existing paper(s) without creating extra panels. */
150
+ private applyImportTemplateJson;
151
+ applyTemplateJson(json: any): void;
152
+ getPrinterList(): any[];
153
+ setZoom(value: number): void;
154
+ getZoom(): number;
155
+ zoomIn(): void;
156
+ zoomOut(): void;
157
+ canZoomIn(): boolean;
158
+ canZoomOut(): boolean;
159
+ adaptToSize(): void;
160
+ hasSelection(): boolean;
161
+ /** Elements on the active design panel (shallow copy for Vue reactivity). */
162
+ getPageElements(): any[];
163
+ private getSelectedElements;
164
+ private getPanelElements;
165
+ private getExplicitZIndex;
166
+ private setElementZIndex;
167
+ private updateElementOption;
168
+ private getElementFontSize;
169
+ private resolveElementTid;
170
+ private serializeElement;
171
+ private offsetElementEntity;
172
+ private insertElementEntity;
173
+ /** Insert a new canvas element by hiprint `tid` (e.g. `defaultModule.text`). */
174
+ addElementByTid(tid: string, options?: {
175
+ left?: number;
176
+ top?: number;
177
+ }): any;
178
+ /** Clone a live print element using hiprint's native clone path. */
179
+ private duplicateElement;
180
+ private setElementDraggable;
181
+ private buildOrderWithSelectedAtEnd;
182
+ private buildOrderWithSelectedAtStart;
183
+ private syncPanelElementOrder;
184
+ private getPanelSizePt;
185
+ private getElementRect;
186
+ private applyElementPosition;
187
+ private markTemplateChanged;
188
+ align(side: 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom'): void;
189
+ private callOnSelection;
190
+ moveZ(action: 'top' | 'up' | 'down' | 'bottom'): void;
191
+ flip(axis: 'h' | 'v'): void;
192
+ changeFont(delta: number): void;
193
+ setBold(bold: boolean): void;
194
+ isSelectionLocked(): boolean;
195
+ isSelectionUnlocked(): boolean;
196
+ setLock(locked: boolean): void;
197
+ clone(): void;
198
+ copy(): void;
199
+ cut(): void;
200
+ paste(): void;
201
+ delete(): void;
202
+ /** Delete a single element from the structure panel or other auxiliary UI. */
203
+ deletePrintElement(item: any): void;
204
+ rotate(deg?: number): void;
205
+ clearPanel(): void;
206
+ private bindShortcuts;
207
+ }
208
+ /** Reactive wrapper, so consumers can `import { utils }` and read state. */
209
+ export declare const reactiveDesignerUtils: () => DesignerUtils;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Thin wrapper around `vue-plugin-hiprint` so the rest of the codebase
3
+ * only needs to touch a stable surface.
4
+ */
5
+ import { hiprint, defaultElementTypeProvider } from 'vue-plugin-hiprint';
6
+ import type { PaperType, Provider } from '../types';
7
+ export interface InitOptions {
8
+ providers?: Provider[];
9
+ autoConnect?: boolean;
10
+ config?: any;
11
+ paperList?: PaperType[];
12
+ onPaperApplied?: (tpl: any) => void;
13
+ }
14
+ /**
15
+ * Initialise hiprint with at least one provider. Idempotent.
16
+ */
17
+ export declare function initHiprint(options?: InitOptions): typeof hiprint;
18
+ /**
19
+ * Bind a selector list (e.g. `.ep-draggable-item`) into hiprint so the
20
+ * elements become draggable. `vue-plugin-hiprint` exposes this via
21
+ * `PrintElementTypeManager.buildByHtml`.
22
+ */
23
+ export declare function buildByHtml(selectors: string[] | string): void;
24
+ export { hiprint, defaultElementTypeProvider };
@@ -0,0 +1,20 @@
1
+ import type { PaperType } from '../types';
2
+ export interface PaperListValue {
3
+ type: string;
4
+ width: number;
5
+ height: number;
6
+ }
7
+ export declare function registerPrintTemplate(tpl: any): void;
8
+ export declare function nearMm(a: number, b: number, eps?: number): boolean;
9
+ export declare function detectPaperType(width: number, height: number, list?: PaperType[]): string;
10
+ export declare function getTemplatePaperList(tpl?: any): PaperType[];
11
+ export declare function applyPaperList(tpl: any, value: PaperListValue, onApplied?: () => void): void;
12
+ export declare function applyPanelBackgroundColor(panel: any, color?: string): void;
13
+ /**
14
+ * Register paper-list panel options into hiprint (sv-print compatible).
15
+ * Call once during hiprint init.
16
+ */
17
+ export declare function setupHiprintPaperList(paperList?: PaperType[], onPaperApplied?: (tpl: any) => void): void;
18
+ export declare function assignTemplatePaperList(tpl: any, paperList?: PaperType[]): void;
19
+ /** Open panel-level hiprint settings (same as clicking blank paper). */
20
+ export declare function openPanelSetting(): void;
@@ -0,0 +1,8 @@
1
+ /** Canonical history labels stored in hiprint `historyList[].type`. */
2
+ export declare const HISTORY_MOVE = "\u79FB\u52A8";
3
+ export declare const HISTORY_ALIGN = "\u5143\u7D20\u5BF9\u9F50";
4
+ export declare const HISTORY_PARAM = "\u53C2\u6570\u4FEE\u6539";
5
+ export declare const HISTORY_INITIAL = "\u521D\u59CB";
6
+ export declare const HISTORY_ZOOM = "\u7F29\u653E";
7
+ /** Map hiprint / toolbar raw types to one of the three user-facing categories. */
8
+ export declare function normalizeHistoryLabel(type: string | undefined): string;
@@ -0,0 +1,24 @@
1
+ export interface HistoryStep {
2
+ index: number;
3
+ type: string;
4
+ label: string;
5
+ json?: unknown;
6
+ }
7
+ export type HistoryChangedHook = () => void;
8
+ export declare class HistoryController {
9
+ private getTpl;
10
+ private onChanged?;
11
+ steps: HistoryStep[];
12
+ constructor(getTemplate: () => any, onChanged?: HistoryChangedHook);
13
+ private applySnapshot;
14
+ refreshFromTemplate(): void;
15
+ canUndo(): boolean;
16
+ canRedo(): boolean;
17
+ undo(): void;
18
+ redo(): void;
19
+ jump(index: number): void;
20
+ clear(): void;
21
+ /** Remove one history entry. Index 0 (initial) cannot be deleted. */
22
+ remove(index: number): void;
23
+ private finishChange;
24
+ }
@@ -0,0 +1,15 @@
1
+ export interface JsonEditorModalOptions {
2
+ title: string;
3
+ value: unknown;
4
+ confirmText?: string;
5
+ cancelText?: string;
6
+ invalidText?: string;
7
+ clearText?: string;
8
+ copyText?: string;
9
+ variant?: 'template' | 'default';
10
+ }
11
+ export type JsonEditorModalHost = {
12
+ open: (options: JsonEditorModalOptions) => Promise<unknown | null>;
13
+ };
14
+ /** Imperative fallback when Vue host is unavailable. */
15
+ export declare function openJsonEditorModal(options: JsonEditorModalOptions): Promise<unknown | null>;
@@ -0,0 +1,17 @@
1
+ import type { Hook, PluginOptions } from '../types';
2
+ /**
3
+ * Hook manager: stores plugin-provided callbacks keyed by hook name,
4
+ * runs them sequentially in priority order.
5
+ */
6
+ export declare class PluginManager {
7
+ private hooks;
8
+ private plugins;
9
+ setPlugins(plugins?: PluginOptions[]): void;
10
+ register(plugin: PluginOptions): void;
11
+ list(): PluginOptions[];
12
+ has(hook: Hook): boolean;
13
+ /** Run all callbacks sequentially. Returns the array of results. */
14
+ run(hook: Hook, ...args: any[]): Promise<unknown[]>;
15
+ /** Synchronous variant — useful for shortcut handlers that must return quickly. */
16
+ runSync(hook: Hook, ...args: any[]): unknown[];
17
+ }
@@ -0,0 +1,2 @@
1
+ /** Normalize hiprint `getHtml()` output (jQuery / array-like) to an HTML string. */
2
+ export declare function resolvePreviewHtml(value: unknown): string;
@@ -0,0 +1,19 @@
1
+ import type { TemplateFieldSchema } from './template-fields';
2
+ export interface PrintDataEditorModalOptions {
3
+ title: string;
4
+ schema: TemplateFieldSchema;
5
+ value: Record<string, unknown>;
6
+ confirmText?: string;
7
+ cancelText?: string;
8
+ clearText?: string;
9
+ copyText?: string;
10
+ basicSectionTitle?: string;
11
+ tableSectionTitle?: string;
12
+ emptyHint?: string;
13
+ addRowText?: string;
14
+ deleteRowText?: string;
15
+ tableFieldLabel?: string;
16
+ }
17
+ export type PrintDataEditorModalHost = {
18
+ open: (options: PrintDataEditorModalOptions) => Promise<Record<string, unknown> | null>;
19
+ };
@@ -0,0 +1,5 @@
1
+ import type { Provider, ProviderMap } from '../types';
2
+ export { defaultElementTypeProvider } from 'vue-plugin-hiprint';
3
+ export { SvpElementTypeProvider } from './svp-element-provider';
4
+ export declare function ensureProviders(providers?: Provider[]): Provider[];
5
+ export declare function normalizeProviderMap(map?: ProviderMap | ProviderMap[]): ProviderMap[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ export interface ShortcutBinding {
2
+ combo: string;
3
+ description?: string;
4
+ run: (e: KeyboardEvent) => void | boolean;
5
+ }
6
+ export interface ShortcutOptions {
7
+ /** Receives every keydown event before bindings are evaluated; return false to block. */
8
+ beforeDispatch?: (e: KeyboardEvent) => boolean | void;
9
+ }
10
+ export declare class ShortcutsController {
11
+ private bindings;
12
+ private handler;
13
+ private options;
14
+ constructor(options?: ShortcutOptions);
15
+ add(binding: ShortcutBinding | ShortcutBinding[]): void;
16
+ remove(combo: string): void;
17
+ list(): ShortcutBinding[];
18
+ mount(): void;
19
+ unmount(): void;
20
+ }
@@ -0,0 +1,3 @@
1
+ export declare function readJSON<T = unknown>(key: string, fallback: T): T;
2
+ export declare function writeJSON(key: string, value: unknown): void;
3
+ export declare function removeKey(key: string): void;
@@ -0,0 +1,77 @@
1
+ import { type Ref } from 'vue-demi';
2
+ export interface PanelVisibility {
3
+ draggableEls: boolean;
4
+ miniMap: boolean;
5
+ pageStructure: boolean;
6
+ pageHistory: boolean;
7
+ properties: boolean;
8
+ }
9
+ export interface SelectionInfo {
10
+ count: number;
11
+ ids: string[];
12
+ /** Active hiprint elements. */
13
+ elements: unknown[];
14
+ }
15
+ export interface HistoryInfo {
16
+ index: number;
17
+ total: number;
18
+ capacity: number;
19
+ canUndo: boolean;
20
+ canRedo: boolean;
21
+ }
22
+ export declare const designerStore: {
23
+ theme: string;
24
+ themeList: (string | {
25
+ theme?: string | undefined;
26
+ primaryColor: string;
27
+ primaryContent?: string | undefined;
28
+ secondaryColor?: string | undefined;
29
+ secondaryContent?: string | undefined;
30
+ accentColor?: string | undefined;
31
+ accentContent?: string | undefined;
32
+ neutralColor?: string | undefined;
33
+ neutralContent?: string | undefined;
34
+ base100?: string | undefined;
35
+ base200?: string | undefined;
36
+ base300?: string | undefined;
37
+ baseContent?: string | undefined;
38
+ info?: string | undefined;
39
+ infoContent?: string | undefined;
40
+ success?: string | undefined;
41
+ successContent?: string | undefined;
42
+ warning?: string | undefined;
43
+ warningContent?: string | undefined;
44
+ error?: string | undefined;
45
+ errorContent?: string | undefined;
46
+ })[];
47
+ lang: string;
48
+ zoom: number;
49
+ panels: {
50
+ draggableEls: boolean;
51
+ miniMap: boolean;
52
+ pageStructure: boolean;
53
+ pageHistory: boolean;
54
+ properties: boolean;
55
+ };
56
+ selection: {
57
+ count: number;
58
+ ids: string[];
59
+ elements: unknown[];
60
+ };
61
+ history: {
62
+ index: number;
63
+ total: number;
64
+ capacity: number;
65
+ canUndo: boolean;
66
+ canRedo: boolean;
67
+ };
68
+ isMobile: boolean;
69
+ uiPulse: number;
70
+ };
71
+ export type DesignerStore = typeof designerStore;
72
+ export declare const designerStoreRef: Ref<DesignerStore>;
73
+ export declare function setZoom(value: number): void;
74
+ export declare function setPanelVisibility(key: keyof PanelVisibility, show: boolean): void;
75
+ export declare function togglePanel(key: keyof PanelVisibility): void;
76
+ export declare function toggleAllPanels(forceShow?: boolean): void;
77
+ export declare function setSelection(info: Partial<SelectionInfo>): void;
@@ -0,0 +1,8 @@
1
+ import { Provider } from '../types';
2
+ /**
3
+ * Hiprint provider: built-in element types, with `defaultModule.table`
4
+ * replaced by the project default table layout (`template.json`).
5
+ */
6
+ export declare class SvpElementTypeProvider extends Provider {
7
+ addElementTypes(context: any): void;
8
+ }
@@ -0,0 +1,28 @@
1
+ export interface BasicFieldDef {
2
+ field: string;
3
+ label: string;
4
+ testData?: string;
5
+ }
6
+ export interface TableColumnDef {
7
+ field: string;
8
+ label: string;
9
+ }
10
+ export interface TableFieldDef {
11
+ /** Print data key, e.g. `table`. */
12
+ field: string;
13
+ label: string;
14
+ columns: TableColumnDef[];
15
+ }
16
+ export interface TemplateFieldSchema {
17
+ basicFields: BasicFieldDef[];
18
+ tables: TableFieldDef[];
19
+ }
20
+ /** Extract bindable fields from a hiprint template JSON. */
21
+ export declare function extractTemplateFields(template: unknown): TemplateFieldSchema;
22
+ export declare function createEmptyTableRow(columns: TableColumnDef[]): Record<string, string>;
23
+ export declare function normalizeTableRows(value: unknown, columns: TableColumnDef[]): Record<string, string>[];
24
+ export declare function buildPrintDataFromForm(schema: TemplateFieldSchema, basicValues: Record<string, string>, tableValues: Record<string, Record<string, string>[]>, existing?: Record<string, unknown>): Record<string, unknown>;
25
+ export declare function createPrintDataFormState(schema: TemplateFieldSchema, printData?: Record<string, unknown>): {
26
+ basicValues: Record<string, string>;
27
+ tableValues: Record<string, Record<string, string>[]>;
28
+ };
@@ -0,0 +1 @@
1
+ export declare function injectThemes(theme: unknown): void;
@@ -0,0 +1,104 @@
1
+ declare const _default: {
2
+ designer: {
3
+ save: string;
4
+ preview: string;
5
+ editTemplate: string;
6
+ editPrintData: string;
7
+ exportFile: string;
8
+ importFile: string;
9
+ print: string;
10
+ pdf: string;
11
+ image: string;
12
+ close: string;
13
+ confirm: string;
14
+ apply: string;
15
+ clear: string;
16
+ copy: string;
17
+ cancel: string;
18
+ invalidJson: string;
19
+ printDataBasic: string;
20
+ printDataTable: string;
21
+ printDataEmpty: string;
22
+ printDataAddRow: string;
23
+ printDataDeleteRow: string;
24
+ printDataFieldKey: string;
25
+ paper: string;
26
+ };
27
+ header: {
28
+ title: string;
29
+ };
30
+ panel: {
31
+ draggableEls: string;
32
+ miniMap: string;
33
+ pageStructure: string;
34
+ pageHistory: string;
35
+ properties: string;
36
+ fold: string;
37
+ expand: string;
38
+ minimize: string;
39
+ show: string;
40
+ hide: string;
41
+ empty: string;
42
+ add: string;
43
+ };
44
+ history: {
45
+ move: string;
46
+ align: string;
47
+ param: string;
48
+ initial: string;
49
+ deleteRecord: string;
50
+ zoom: string;
51
+ };
52
+ tool: {
53
+ undo: string;
54
+ redo: string;
55
+ alignLeft: string;
56
+ alignCenter: string;
57
+ alignRight: string;
58
+ alignTop: string;
59
+ alignMiddle: string;
60
+ alignBottom: string;
61
+ moveTop: string;
62
+ moveUp: string;
63
+ moveDown: string;
64
+ moveBottom: string;
65
+ flipH: string;
66
+ flipV: string;
67
+ fontInc: string;
68
+ fontDec: string;
69
+ fontBold: string;
70
+ fontUnbold: string;
71
+ lock: string;
72
+ unlock: string;
73
+ clone: string;
74
+ copy: string;
75
+ cut: string;
76
+ paste: string;
77
+ delete: string;
78
+ zoomOut: string;
79
+ zoomIn: string;
80
+ rotate: string;
81
+ clear: string;
82
+ togglePanels: string;
83
+ };
84
+ category: {
85
+ base: string;
86
+ text: string;
87
+ image: string;
88
+ qrcode: string;
89
+ barcode: string;
90
+ longText: string;
91
+ table: string;
92
+ html: string;
93
+ };
94
+ group: {
95
+ regular: string;
96
+ helper: string;
97
+ };
98
+ locale: {
99
+ switch: string;
100
+ zhCN: string;
101
+ enUS: string;
102
+ };
103
+ };
104
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import type { Lang } from '../types';
2
+ type Dict = Record<string, any>;
3
+ export declare function setLocale(lang: Lang, messages?: Dict): void;
4
+ export declare function getLocaleList(): Lang[];
5
+ export declare function useI18n(): {
6
+ t: (key: string, fallback?: string) => string;
7
+ lang: import("vue").ComputedRef<Lang>;
8
+ setLocale: typeof setLocale;
9
+ };
10
+ /** Non-component i18n lookup (core utilities, modals, etc.). */
11
+ export declare function translate(key: string, fallback?: string): string;
12
+ export {};