@guodun/antdv 1.4.8 → 1.5.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/dist/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +315 -286
- package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +316 -285
- package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.vue.mjs +62 -54
- package/dist/es/components/contract-signing-location/style/index.css +1 -1
- package/dist/es/components/index.mjs +1 -0
- package/dist/es/components/pro-contract-template-designer/index.mjs +1 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractPrintIframe.mjs +7 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractPrintIframe.vue.mjs +129 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractPrintIframe.vue_vue_type_style_index_0_scoped_a9912ff0_lang.css +1 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.mjs +10 -5
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.mjs +64 -43
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.mjs +82 -53
- package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +271 -265
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +762 -751
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +217 -197
- package/dist/es/components/pro-contract-template-designer/src/constants.mjs +29 -51
- package/dist/es/components/pro-contract-template-designer/src/extensions/template-variable.mjs +103 -103
- package/dist/es/components/pro-contract-template-designer/src/extensions/word-paste.mjs +24 -21
- package/dist/es/components/pro-contract-template-designer/src/utils/contract-print-document.mjs +314 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/page-decorations.mjs +1 -1
- package/dist/es/components/pro-contract-template-designer/src/utils/template-variable-render.mjs +47 -47
- package/dist/es/components/pro-contract-template-designer/src/utils/word-paste.mjs +216 -148
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/index.mjs +27 -26
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/style/index.css +1 -1
- package/dist/lib/components/index.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractPrintIframe.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractPrintIframe.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractPrintIframe.vue_vue_type_style_index_0_scoped_a9912ff0_lang.css +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/constants.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/extensions/template-variable.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/extensions/word-paste.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/contract-print-document.cjs +211 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/page-decorations.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-variable-render.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/word-paste.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/theme/contract-signing-location.css +1 -1
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +7 -0
- package/dist/types/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.d.ts +4 -0
- package/dist/types/components/contract-signing-location/src/ContractSigningTemplatePage.vue.d.ts +9 -3
- package/dist/types/components/contract-signing-location/src/types.d.ts +5 -0
- package/dist/types/components/pro-contract-template-designer/index.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractPrintIframe.vue.d.ts +35 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.d.ts +2 -2
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.d.ts +13 -1
- package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +6 -0
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +4 -4
- package/dist/types/components/pro-contract-template-designer/src/extensions/word-paste.d.ts +8 -0
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +10 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/contract-print-document.d.ts +119 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/word-paste.d.ts +2 -0
- package/package.json +4 -3
|
@@ -9,6 +9,7 @@ export * from './src/utils/template-renderer';
|
|
|
9
9
|
export * from './src/utils/signing-placement';
|
|
10
10
|
export * from './src/utils/content-image';
|
|
11
11
|
export * from './src/utils/advanced-controls';
|
|
12
|
+
export { configureContractPrintFonts, resolveContractFontBaseUrl, toAbsoluteContractFontBaseUrl, CONTRACT_PRINT_FONT_UNCONFIGURED_MESSAGE, } from './src/utils/contract-print-document';
|
|
12
13
|
export declare const GdAntProContractTemplateDesigner: SFCWithInstall<typeof ProContractTemplateDesigner>;
|
|
13
14
|
export declare const GdAntProContractTemplateRenderer: SFCWithInstall<typeof ProContractTemplateRenderer>;
|
|
14
15
|
export default GdAntProContractTemplateDesigner;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ContractPrintFrameInteraction, ContractPrintFrameMetrics, ContractPrintFrameStatus } from './utils/contract-print-document';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
pageId: string;
|
|
4
|
+
pageFormat?: string;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
paddingTop: number;
|
|
8
|
+
paddingBottom: number;
|
|
9
|
+
classNames: string;
|
|
10
|
+
decorationsHtml: string;
|
|
11
|
+
contentHtml: string;
|
|
12
|
+
/** 兼容旧宿主传入;系统字体路径不再消费该值,也不参与 srcdoc 重载。 */
|
|
13
|
+
fontBaseUrl?: string;
|
|
14
|
+
activeKey?: string;
|
|
15
|
+
scrollRequest?: number;
|
|
16
|
+
title?: string;
|
|
17
|
+
};
|
|
18
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
19
|
+
status: (status: ContractPrintFrameStatus, detail?: string | undefined) => any;
|
|
20
|
+
metrics: (metrics: ContractPrintFrameMetrics) => any;
|
|
21
|
+
interaction: (interaction: ContractPrintFrameInteraction) => any;
|
|
22
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
23
|
+
onStatus?: ((status: ContractPrintFrameStatus, detail?: string | undefined) => any) | undefined;
|
|
24
|
+
onMetrics?: ((metrics: ContractPrintFrameMetrics) => any) | undefined;
|
|
25
|
+
onInteraction?: ((interaction: ContractPrintFrameInteraction) => any) | undefined;
|
|
26
|
+
}>, {
|
|
27
|
+
title: string;
|
|
28
|
+
activeKey: string;
|
|
29
|
+
pageFormat: string;
|
|
30
|
+
fontBaseUrl: string;
|
|
31
|
+
scrollRequest: number;
|
|
32
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
33
|
+
iframe: HTMLIFrameElement;
|
|
34
|
+
}, HTMLIFrameElement>;
|
|
35
|
+
export default _default;
|
|
@@ -42,8 +42,8 @@ type __VLS_PublicProps = {
|
|
|
42
42
|
'toolbarMoreOpen'?: boolean;
|
|
43
43
|
} & __VLS_Props;
|
|
44
44
|
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
45
|
-
"insert-table": (rows: number, cols: number) => any;
|
|
46
45
|
command: (command: ContractTemplateEditorCommand) => any;
|
|
46
|
+
"insert-table": (rows: number, cols: number) => any;
|
|
47
47
|
"patch-block-format": (value: unknown) => any;
|
|
48
48
|
"patch-font-family": (value: unknown) => any;
|
|
49
49
|
"patch-font-size": (value: unknown) => any;
|
|
@@ -68,8 +68,8 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
|
|
|
68
68
|
"update:tableInsertDraft": (value: ContractTemplateTableInsertOptions) => any;
|
|
69
69
|
"update:toolbarMoreOpen": (value: boolean) => any;
|
|
70
70
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
71
|
-
"onInsert-table"?: ((rows: number, cols: number) => any) | undefined;
|
|
72
71
|
onCommand?: ((command: ContractTemplateEditorCommand) => any) | undefined;
|
|
72
|
+
"onInsert-table"?: ((rows: number, cols: number) => any) | undefined;
|
|
73
73
|
"onPatch-block-format"?: ((value: unknown) => any) | undefined;
|
|
74
74
|
"onPatch-font-family"?: ((value: unknown) => any) | undefined;
|
|
75
75
|
"onPatch-font-size"?: ((value: unknown) => any) | undefined;
|
|
@@ -23,6 +23,7 @@ type __VLS_Props = {
|
|
|
23
23
|
}>;
|
|
24
24
|
};
|
|
25
25
|
previewSnapshot?: ContractTemplateData;
|
|
26
|
+
fontBaseUrl?: string;
|
|
26
27
|
};
|
|
27
28
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
28
29
|
cancel: () => any;
|
|
@@ -8,6 +8,7 @@ type __VLS_Props = {
|
|
|
8
8
|
pageNumber: number;
|
|
9
9
|
totalPages: number;
|
|
10
10
|
variables: ContractTemplateVariable[];
|
|
11
|
+
fontBaseUrl?: string;
|
|
11
12
|
};
|
|
12
13
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
13
14
|
export default _default;
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import { ContractTemplateRenderPage } from './utils/template-renderer';
|
|
2
|
+
import { ContractPrintFrameInteraction, ContractPrintFrameMetrics, ContractPrintFrameStatus } from './utils/contract-print-document';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
page: ContractTemplateRenderPage;
|
|
4
5
|
index: number;
|
|
5
6
|
total: number;
|
|
6
7
|
zoom: number;
|
|
7
8
|
showMeta: boolean;
|
|
9
|
+
fontBaseUrl?: string;
|
|
10
|
+
activeKey?: string;
|
|
11
|
+
scrollRequest?: number;
|
|
8
12
|
};
|
|
9
|
-
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
14
|
+
status: (status: ContractPrintFrameStatus, detail?: string | undefined) => any;
|
|
15
|
+
metrics: (metrics: ContractPrintFrameMetrics) => any;
|
|
16
|
+
interaction: (interaction: ContractPrintFrameInteraction) => any;
|
|
17
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
18
|
+
onStatus?: ((status: ContractPrintFrameStatus, detail?: string | undefined) => any) | undefined;
|
|
19
|
+
onMetrics?: ((metrics: ContractPrintFrameMetrics) => any) | undefined;
|
|
20
|
+
onInteraction?: ((interaction: ContractPrintFrameInteraction) => any) | undefined;
|
|
21
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
10
22
|
export default _default;
|
|
@@ -166,6 +166,9 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
|
166
166
|
"editor-focus": (pageId: string) => any;
|
|
167
167
|
"editor-state-change": (pageId: string, state: ContractTemplateEditorState) => any;
|
|
168
168
|
"editor-context-menu": (payload: ContractTemplateEditorContextMenuPayload) => any;
|
|
169
|
+
"word-paste": (payload: {
|
|
170
|
+
replacedFontFamilies: string[];
|
|
171
|
+
}) => any;
|
|
169
172
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
170
173
|
"onPage-update"?: ((page: ContractTemplatePage) => any) | undefined;
|
|
171
174
|
"onVariable-drop"?: ((pageId: string, type: ContractTemplateFieldType, clientX: number, clientY: number) => any) | undefined;
|
|
@@ -178,6 +181,9 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
|
178
181
|
"onEditor-focus"?: ((pageId: string) => any) | undefined;
|
|
179
182
|
"onEditor-state-change"?: ((pageId: string, state: ContractTemplateEditorState) => any) | undefined;
|
|
180
183
|
"onEditor-context-menu"?: ((payload: ContractTemplateEditorContextMenuPayload) => any) | undefined;
|
|
184
|
+
"onWord-paste"?: ((payload: {
|
|
185
|
+
replacedFontFamilies: string[];
|
|
186
|
+
}) => any) | undefined;
|
|
181
187
|
}>, {
|
|
182
188
|
disabled: boolean;
|
|
183
189
|
readonly: boolean;
|
|
@@ -89,6 +89,7 @@ declare const _default: import('vue').DefineComponent<ContractTemplateDesignerPr
|
|
|
89
89
|
height: string | number;
|
|
90
90
|
readonly: boolean;
|
|
91
91
|
pageSize: ContractTemplatePageSize;
|
|
92
|
+
contractFontBaseUrl: string;
|
|
92
93
|
showDraftCacheStatus: boolean;
|
|
93
94
|
showClearButton: boolean;
|
|
94
95
|
showSubmitDataViewer: boolean;
|
|
@@ -52,6 +52,7 @@ declare const __VLS_component: import('vue').DefineComponent<ContractTemplateRen
|
|
|
52
52
|
zoom: number;
|
|
53
53
|
showToolbar: boolean;
|
|
54
54
|
showSubmitButton: boolean;
|
|
55
|
+
contractFontBaseUrl: string;
|
|
55
56
|
selectorHttp: undefined;
|
|
56
57
|
selectorUrlPrefix: string;
|
|
57
58
|
showValidateButton: boolean;
|
|
@@ -2,11 +2,11 @@ import { ContractTemplateEditorCommand, ContractTemplateEditorTextAlign, Contrac
|
|
|
2
2
|
/**
|
|
3
3
|
* 合同正文默认字体。
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* 拉丁由 GD Contract Latin 锁定 Times 盒宽,CJK 走系统宋体栈;
|
|
6
|
+
* iframe 度量门禁失败时禁止保存签署坐标,不为对齐跨 OS 去补偿 signTop。
|
|
7
7
|
*/
|
|
8
|
-
export declare const DEFAULT_CONTRACT_FONT_FAMILY = "
|
|
9
|
-
/**
|
|
8
|
+
export declare const DEFAULT_CONTRACT_FONT_FAMILY = "\"GD Contract Latin\", \"Songti SC\", SimSun, \"Noto Serif CJK SC\", \"Source Han Serif SC\", serif";
|
|
9
|
+
/** 内置字体只保留合同宋体 / 文档黑体两档;其它字体可由宿主自定义,但不承诺打印一致。 */
|
|
10
10
|
export declare const DEFAULT_FONT_FAMILY_OPTIONS: ContractTemplateFontFamilyOption[];
|
|
11
11
|
/** 字号下拉的预设档位;不在此列表里的字号仍可手动输入,由工具栏临时补进选项。 */
|
|
12
12
|
export declare const DEFAULT_FONT_SIZE_PRESETS: number[];
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
|
2
2
|
import { ClipboardHtmlSource } from '../utils/word-paste';
|
|
3
|
+
declare module '@tiptap/core' {
|
|
4
|
+
interface EditorEvents {
|
|
5
|
+
'contract-word-paste': {
|
|
6
|
+
replacedFontFamilies: string[];
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
}
|
|
3
10
|
interface PendingPastePayload {
|
|
4
11
|
html: string;
|
|
5
12
|
plainText: string;
|
|
@@ -11,6 +18,7 @@ interface PendingPastePayload {
|
|
|
11
18
|
}
|
|
12
19
|
interface WordPasteStorage {
|
|
13
20
|
pending?: PendingPastePayload;
|
|
21
|
+
lastReplacedFontFamilies: string[];
|
|
14
22
|
}
|
|
15
23
|
interface WordPasteOptions {
|
|
16
24
|
processImageFile?: (file: File) => Promise<string | null>;
|
|
@@ -561,6 +561,11 @@ export interface ContractTemplateRendererProps {
|
|
|
561
561
|
/** 透传给内置用户/部门/角色选择器的宿主请求实例。 */
|
|
562
562
|
selectorHttp?: unknown;
|
|
563
563
|
selectorUrlPrefix?: string;
|
|
564
|
+
/**
|
|
565
|
+
* 可选合同打印字体目录 URL。优先于 `configureContractPrintFonts()`。
|
|
566
|
+
* 系统字体路径不再依赖它;未配置不会阻断。
|
|
567
|
+
*/
|
|
568
|
+
contractFontBaseUrl?: string;
|
|
564
569
|
}
|
|
565
570
|
export interface ContractTemplateRendererEmits {
|
|
566
571
|
/** 填写值变化时同步 v-model:values */
|
|
@@ -701,6 +706,11 @@ export interface ContractTemplateDesignerProps {
|
|
|
701
706
|
* @default 'append'
|
|
702
707
|
*/
|
|
703
708
|
fontFamilyMode?: ContractTemplateFontFamilyMode;
|
|
709
|
+
/**
|
|
710
|
+
* 可选合同打印字体目录 URL。优先于 `configureContractPrintFonts()`。
|
|
711
|
+
* 系统字体路径不再依赖它;未配置不会阻断。
|
|
712
|
+
*/
|
|
713
|
+
contractFontBaseUrl?: string;
|
|
704
714
|
/**
|
|
705
715
|
* 是否展示内置提交数据查看入口;关闭后仍可通过 expose 方法打开
|
|
706
716
|
* @default true
|
package/dist/types/components/pro-contract-template-designer/src/utils/contract-print-document.d.ts
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export declare const CONTRACT_PRINT_MESSAGE_NAMESPACE = "gd-contract-print";
|
|
2
|
+
/** 汉字/标点/数字与混排基线共用的容差;超过说明排版盒已分叉,不能靠 signTop 补偿。 */
|
|
3
|
+
export declare const CONTRACT_PRINT_METRICS_TOLERANCE = 0.5;
|
|
4
|
+
export declare const CONTRACT_PRINT_METRICS_SAMPLE = "\u5408\u540C\u7B7E\u7F72\u4F4D\u7F6E\uFF1A\u7532\u65B9\uFF08Company A\uFF09\u7F16\u53F7 2026-08-31\u3002";
|
|
5
|
+
/** 父页超时比 iframe 内 document.fonts.ready 再多 1s,让内层度量错误先到达,而不是只报初始化超时。 */
|
|
6
|
+
export declare const CONTRACT_PRINT_FRAME_TIMEOUT_MS: number;
|
|
7
|
+
type FrameMessageHandler = (event: MessageEvent) => void;
|
|
8
|
+
export declare function subscribeContractPrintFrameMessages(handler: FrameMessageHandler): void;
|
|
9
|
+
export declare function unsubscribeContractPrintFrameMessages(handler: FrameMessageHandler): void;
|
|
10
|
+
export declare const CONTRACT_PRINT_METRICS_HANZI = "\u5408\u540C\u7B7E\u7F72\u4F4D\u7F6E\u7532\u4E59\u53CC\u65B9";
|
|
11
|
+
export declare const CONTRACT_PRINT_METRICS_PUNCT = "\uFF1A\uFF0C\uFF08\uFF09\u3002\uFF1B";
|
|
12
|
+
export declare const CONTRACT_PRINT_METRICS_DIGIT = "20260831";
|
|
13
|
+
/** 16px 宋体汉字与 `text-spacing-trim: space-all` 下的中文标点都是 1em。 */
|
|
14
|
+
export declare const CONTRACT_PRINT_METRICS_HANZI_ADVANCE = 16;
|
|
15
|
+
export declare const CONTRACT_PRINT_METRICS_PUNCT_ADVANCE = 16;
|
|
16
|
+
/** Times / GD Contract Latin 数字半角宽为 0.5em。 */
|
|
17
|
+
export declare const CONTRACT_PRINT_METRICS_DIGIT_ADVANCE = 8;
|
|
18
|
+
/**
|
|
19
|
+
* 混排样本与变量行高由本机 Chromium 探针钉死(macOS 2026-08-31)。
|
|
20
|
+
* 汉字/标点按 1em、数字按 Times 0.5em 另做门禁;字形允许 Songti SC / SimSun 差异。
|
|
21
|
+
* 行高探针挂在 body 上,吃的是显式 16px/28px,不是变量节点 32px min-height。
|
|
22
|
+
* Windows 未测,禁止用这组 macOS 数字代称 Windows 结果。
|
|
23
|
+
*/
|
|
24
|
+
export declare const CONTRACT_PRINT_METRICS_BASELINE: {
|
|
25
|
+
readonly textWidth: 379.546875;
|
|
26
|
+
readonly sansTextWidth: 393;
|
|
27
|
+
readonly variableRowHeight: 28;
|
|
28
|
+
};
|
|
29
|
+
export type ContractPrintFrameStatus = 'loading' | 'ready' | 'error';
|
|
30
|
+
export interface ContractPrintFrameMetrics {
|
|
31
|
+
pageWidth: number;
|
|
32
|
+
pageHeight: number;
|
|
33
|
+
contentHeight: number;
|
|
34
|
+
overflowHeight: number;
|
|
35
|
+
paddingTop: number;
|
|
36
|
+
paddingBottom: number;
|
|
37
|
+
paddingLeft: number;
|
|
38
|
+
paddingRight: number;
|
|
39
|
+
fontSize: number;
|
|
40
|
+
lineHeight: number;
|
|
41
|
+
fontFamily: string;
|
|
42
|
+
textWidth: number;
|
|
43
|
+
sansTextWidth: number;
|
|
44
|
+
variableRowHeight: number;
|
|
45
|
+
probeOffsets: Record<string, number>;
|
|
46
|
+
blocks: Array<{
|
|
47
|
+
text: string;
|
|
48
|
+
top: number;
|
|
49
|
+
lineCount: number;
|
|
50
|
+
}>;
|
|
51
|
+
}
|
|
52
|
+
export interface ContractPrintFrameMessage {
|
|
53
|
+
namespace: typeof CONTRACT_PRINT_MESSAGE_NAMESPACE;
|
|
54
|
+
messageId: string;
|
|
55
|
+
type: 'ready' | 'metrics' | 'error' | 'interaction';
|
|
56
|
+
metrics?: ContractPrintFrameMetrics;
|
|
57
|
+
error?: string;
|
|
58
|
+
interaction?: ContractPrintFrameInteraction;
|
|
59
|
+
}
|
|
60
|
+
export type ContractPrintFrameInteraction = {
|
|
61
|
+
kind: 'select';
|
|
62
|
+
key: string;
|
|
63
|
+
pageId: string;
|
|
64
|
+
} | {
|
|
65
|
+
kind: 'input';
|
|
66
|
+
key: string;
|
|
67
|
+
pageId: string;
|
|
68
|
+
value: string | number | boolean | undefined;
|
|
69
|
+
};
|
|
70
|
+
export interface ContractPrintFrameCommand {
|
|
71
|
+
namespace: typeof CONTRACT_PRINT_MESSAGE_NAMESPACE;
|
|
72
|
+
messageId: string;
|
|
73
|
+
type: 'command';
|
|
74
|
+
command: {
|
|
75
|
+
kind: 'highlight';
|
|
76
|
+
key: string;
|
|
77
|
+
scroll: boolean;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export interface BuildContractPrintDocumentOptions {
|
|
81
|
+
messageId: string;
|
|
82
|
+
parentOrigin: string;
|
|
83
|
+
pageId: string;
|
|
84
|
+
pageFormat?: string;
|
|
85
|
+
width: number;
|
|
86
|
+
height: number;
|
|
87
|
+
paddingTop: number;
|
|
88
|
+
paddingBottom: number;
|
|
89
|
+
classNames: string;
|
|
90
|
+
decorationsHtml: string;
|
|
91
|
+
contentHtml: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* 公共错误文案别名,标识符保留给旧宿主 import,不得改名。
|
|
95
|
+
* 系统字体路径不再因未配置字体目录而抛出;仅度量门禁失败时阻断签署坐标。
|
|
96
|
+
* 文案不能再写成「必须配置字体目录」。
|
|
97
|
+
*/
|
|
98
|
+
export declare const CONTRACT_PRINT_FONT_UNCONFIGURED_MESSAGE = "\u5408\u540C\u6392\u7248\u5EA6\u91CF\u6821\u9A8C\u5931\u8D25\uFF0C\u7981\u6B62\u751F\u6210\u7B7E\u7F72\u5750\u6807";
|
|
99
|
+
export interface ConfigureContractPrintFontsOptions {
|
|
100
|
+
/** 可选字体目录 URL,仅兼容旧宿主;系统字体路径不再依赖它。 */
|
|
101
|
+
baseUrl: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* 可选配置合同打印 iframe 的字体目录。
|
|
105
|
+
*
|
|
106
|
+
* 解析顺序:组件 `contractFontBaseUrl` / `fontBaseUrl` > 本函数 > 空字符串。
|
|
107
|
+
* 未配置不再阻断,改由页盒度量门禁(汉字/标点 1em、数字 0.5em)校验排版盒。
|
|
108
|
+
*/
|
|
109
|
+
export declare function configureContractPrintFonts(options: ConfigureContractPrintFontsOptions): void;
|
|
110
|
+
export declare function resolveContractFontBaseUrl(explicit?: string): string;
|
|
111
|
+
/** srcdoc 文档 URL 是 about:srcdoc,相对路径必须先落到当前页 origin。 */
|
|
112
|
+
export declare function toAbsoluteContractFontBaseUrl(baseUrl: string, origin?: string): string;
|
|
113
|
+
/**
|
|
114
|
+
* contentHtml 在进入这里前必须由现有模板净化器清洗;这里只负责安全组合 srcdoc,
|
|
115
|
+
* 不把正文拼进脚本,也不允许正文覆盖 canonical style。
|
|
116
|
+
*/
|
|
117
|
+
export declare function buildContractPrintDocument(options: BuildContractPrintDocumentOptions): string;
|
|
118
|
+
export declare function isContractPrintFrameMessage(value: unknown): value is ContractPrintFrameMessage;
|
|
119
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guodun/antdv",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"CHANGELOG.md",
|
|
@@ -82,8 +82,9 @@
|
|
|
82
82
|
"scroll-into-view-if-needed": "2.2.31",
|
|
83
83
|
"vue-types": "3.0.2",
|
|
84
84
|
"vue": "^3.5.18",
|
|
85
|
-
"@guodun/contract-
|
|
86
|
-
"@guodun/utils": "^1.0.0"
|
|
85
|
+
"@guodun/contract-print-css": "^0.1.1",
|
|
86
|
+
"@guodun/utils": "^1.0.0",
|
|
87
|
+
"@guodun/contract-template-agent": "^0.1.0"
|
|
87
88
|
},
|
|
88
89
|
"scripts": {
|
|
89
90
|
"build": "rm -rf dist/types && vite build && vite build --config vite.theme.config.ts",
|