@worm-vue3-print/canvas 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -5
- package/dist/canvas.css +1 -1
- package/dist/components/DesignerToolbar.vue.d.ts +0 -4
- package/dist/components/PageTabs.vue.d.ts +26 -0
- package/dist/components/PresetColorPicker.vue.d.ts +5 -1
- package/dist/components/PrintDesigner.vue.d.ts +21 -5
- package/dist/components/PrintHtmlPreview.vue.d.ts +8 -2
- package/dist/components/PropertyPanel.vue.d.ts +2 -0
- package/dist/components/elements/CellBarcode.vue.d.ts +14 -0
- package/dist/components/property/DesignBackgroundConfig.vue.d.ts +11 -0
- package/dist/components/property/FontSelect.vue.d.ts +15 -0
- package/dist/components/property/TilingConfig.vue.d.ts +14 -0
- package/dist/composables/useClipboard.d.ts +22 -0
- package/dist/composables/useDesignerState.d.ts +1410 -4
- package/dist/composables/useDocumentFontFace.d.ts +2 -0
- package/dist/composables/useFontCatalog.d.ts +30 -0
- package/dist/composables/useHistory.d.ts +4 -0
- package/dist/composables/useHostAdapter.d.ts +6 -1
- package/dist/composables/useShrinkFit.d.ts +6 -0
- package/dist/index.cjs +52 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4863 -3106
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ComputedRef, type MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import type { PrintFontDeclaration } from '@worm-vue3-print/core';
|
|
3
|
+
/** 下拉候选项:family 写入模板,label 仅用于界面展示 */
|
|
4
|
+
export interface FontOption {
|
|
5
|
+
family: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
/** 空目录:宿主未声明字体时的兜底 */
|
|
9
|
+
export declare const EMPTY_FONT_CATALOG: ComputedRef<readonly FontOption[]>;
|
|
10
|
+
/**
|
|
11
|
+
* 由 PrintDesigner 调用:把模板字体声明整理为下拉候选项。
|
|
12
|
+
* 去空白、丢空值、族名大小写不敏感去重,保留声明顺序(顺序即宿主期望的优先级)。
|
|
13
|
+
*/
|
|
14
|
+
export declare function useFontCatalog(declarations?: MaybeRefOrGetter<readonly PrintFontDeclaration[] | undefined>): {
|
|
15
|
+
catalog: ComputedRef<readonly FontOption[]>;
|
|
16
|
+
};
|
|
17
|
+
/** 由深层组件调用(属性面板):未注入时回退空目录,组件可独立挂载 */
|
|
18
|
+
export declare function useInjectedFontCatalog(): ComputedRef<readonly FontOption[]>;
|
|
19
|
+
/** 在目录中按族名查找(大小写不敏感) */
|
|
20
|
+
export declare function findFontOption(fonts: readonly FontOption[], family?: string): FontOption | undefined;
|
|
21
|
+
/** 下拉选项文案:有展示名时补上真实族名(写入模板的值) */
|
|
22
|
+
export declare function fontOptionLabel(option: FontOption): string;
|
|
23
|
+
/** 匹配用键:小写并去掉全部空白,使用户输入 `ya hei` 与 `yahei` 等价 */
|
|
24
|
+
export declare function normalizeFontQuery(value: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* 模糊过滤字体目录:完全相等 > 前缀 > 子串 > 子序列,同档保持目录原有顺序
|
|
27
|
+
* (目录顺序由宿主声明决定,过滤不应打乱)。
|
|
28
|
+
* 族名与展示名(label)都参与匹配,设计者按业务名搜也能命中。
|
|
29
|
+
*/
|
|
30
|
+
export declare function filterFontOptions(fonts: readonly FontOption[], query: string): FontOption[];
|
|
@@ -2,6 +2,10 @@ import type { TemplateData } from '@worm-vue3-print/core/designer';
|
|
|
2
2
|
export interface HistoryState {
|
|
3
3
|
elements: any[];
|
|
4
4
|
templateData?: TemplateData;
|
|
5
|
+
/** 多页面快照:整份页面数组(深拷贝) */
|
|
6
|
+
pages?: TemplateData[];
|
|
7
|
+
/** 多页面快照:录制时的激活页索引 */
|
|
8
|
+
activePageIndex?: number;
|
|
5
9
|
}
|
|
6
10
|
export interface UseHistoryOptions {
|
|
7
11
|
/** 历史记录上限,默认 50 步 */
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
-
import type { UploadImageFn } from '@worm-vue3-print/core/designer';
|
|
2
|
+
import type { UploadDesignBackgroundFn, UploadImageFn } from '@worm-vue3-print/core/designer';
|
|
3
|
+
import type { FontOption } from './useFontCatalog';
|
|
3
4
|
/** 图片上传适配器:PrintDesigner provide,ImageContentUpload inject */
|
|
4
5
|
export declare const UPLOAD_IMAGE_KEY: InjectionKey<ComputedRef<UploadImageFn | undefined>>;
|
|
6
|
+
/** 设计背景上传适配器:PrintDesigner provide,DesignBackgroundConfig inject */
|
|
7
|
+
export declare const UPLOAD_DESIGN_BACKGROUND_KEY: InjectionKey<ComputedRef<UploadDesignBackgroundFn | undefined>>;
|
|
8
|
+
/** 字体目录(模板声明字体):PrintDesigner provide,属性面板 inject */
|
|
9
|
+
export declare const FONT_CATALOG_KEY: InjectionKey<ComputedRef<readonly FontOption[]>>;
|