@guodun/antdv 1.7.11 → 1.7.12

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.
@@ -1,12 +1,12 @@
1
- import { SIGNING_MARK_TYPE_LABELS as e } from "./utils/signing-mark.mjs";
2
- import { CONTRACT_PRINT_FONT_FAMILY as t, CONTRACT_PRINT_SANS_FONT_FAMILY as n } from "@guodun/contract-print-css";
1
+ import { CONTRACT_PRINT_FONT_FAMILY as e, CONTRACT_PRINT_SANS_FONT_FAMILY as t } from "../../../contract-print-css/index.mjs";
2
+ import { SIGNING_MARK_TYPE_LABELS as n } from "./utils/signing-mark.mjs";
3
3
  //#region src/components/pro-contract-template-designer/src/constants.ts
4
- var r = t, i = [{
4
+ var r = e, i = [{
5
5
  label: "合同宋体",
6
6
  value: r
7
7
  }, {
8
8
  label: "文档黑体",
9
- value: n
9
+ value: t
10
10
  }], a = [
11
11
  12,
12
12
  14,
@@ -181,9 +181,9 @@ var g = [
181
181
  "date",
182
182
  "area",
183
183
  "line"
184
- ].map((t) => ({
185
- markType: t,
186
- label: e[t]
184
+ ].map((e) => ({
185
+ markType: e,
186
+ label: n[e]
187
187
  }));
188
188
  //#endregion
189
189
  export { s as CONTRACT_BLOCK_STYLES, l as CONTRACT_TEXT_STYLE_PRESETS, d as CONTRACT_TEXT_STYLE_PRESET_COMMANDS, r as DEFAULT_CONTRACT_FONT_FAMILY, i as DEFAULT_FONT_FAMILY_OPTIONS, a as DEFAULT_FONT_SIZE_PRESETS, o as DEFAULT_TEXT_ALIGN_OPTIONS, g as SIGNING_MARK_TOOL_ITEMS, c as getContractBlockStyle, f as getContractTextStylePreset, m as normalizeFontFamilyValue, p as resolveContractTextStylePresetCommands, h as resolveFontFamilyOptions };
@@ -1,7 +1,7 @@
1
- import { shallowRef as e } from "vue";
2
- import { CONTRACT_PRINT_FONT_FAMILY as t, CONTRACT_PRINT_FONT_TIMEOUT_MS as n, CONTRACT_PRINT_METRIC_NORMALIZE_CSS as r, CONTRACT_PRINT_SANS_FONT_FAMILY as i, buildContractPrintCss as a } from "@guodun/contract-print-css";
1
+ import { CONTRACT_PRINT_FONT_FAMILY as e, CONTRACT_PRINT_FONT_TIMEOUT_MS as t, CONTRACT_PRINT_METRIC_NORMALIZE_CSS as n, CONTRACT_PRINT_SANS_FONT_FAMILY as r, buildContractPrintCss as i } from "../../../../contract-print-css/index.mjs";
2
+ import { shallowRef as a } from "vue";
3
3
  //#region src/components/pro-contract-template-designer/src/utils/contract-print-document.ts
4
- var o = "gd-contract-print", s = .5, c = "合同签署位置:甲方(Company A)编号 2026-08-31。", l = n + 1e3, u = /* @__PURE__ */ new Set();
4
+ var o = "gd-contract-print", s = .5, c = "合同签署位置:甲方(Company A)编号 2026-08-31。", l = t + 1e3, u = /* @__PURE__ */ new Set();
5
5
  function d(e) {
6
6
  u.forEach((t) => t(e));
7
7
  }
@@ -15,7 +15,7 @@ var m = "合同签署位置甲乙双方", h = ":,()。;", g = "2026083
15
15
  textWidth: 379.546875,
16
16
  sansTextWidth: 393,
17
17
  variableRowHeight: 28
18
- }, v = "合同排版度量校验失败,禁止生成签署坐标", y = e("");
18
+ }, v = "合同排版度量校验失败,禁止生成签署坐标", y = a("");
19
19
  function b(e) {
20
20
  y.value = (e?.baseUrl?.trim() ?? "").replace(/\/+$/, "");
21
21
  }
@@ -27,27 +27,27 @@ function S(e, t = typeof window > "u" ? "" : window.location.origin) {
27
27
  let n = e.trim().replace(/\/+$/, "");
28
28
  return n ? /^https?:\/\//i.test(n) ? n : t ? new URL(n.startsWith("/") ? n : `/${n}`, `${t.replace(/\/+$/, "")}/`).href.replace(/\/+$/, "") : n.startsWith("/") ? n : `/${n}` : "";
29
29
  }
30
- function C(e) {
31
- let l = `gd-contract-print-${e.messageId}`, u = a({
32
- width: e.width,
33
- height: e.height,
30
+ function C(a) {
31
+ let l = `gd-contract-print-${a.messageId}`, u = i({
32
+ width: a.width,
33
+ height: a.height,
34
34
  pages: [{
35
- id: e.pageId,
35
+ id: a.pageId,
36
36
  pageSize: {
37
- width: e.width,
38
- height: e.height
37
+ width: a.width,
38
+ height: a.height
39
39
  }
40
40
  }]
41
41
  }), d = JSON.stringify({
42
- messageId: e.messageId,
43
- parentOrigin: e.parentOrigin,
44
- pageId: e.pageId,
45
- pageHeight: e.height,
46
- timeoutMs: n,
47
- fontFamily: t,
48
- sansFontFamily: i,
42
+ messageId: a.messageId,
43
+ parentOrigin: a.parentOrigin,
44
+ pageId: a.pageId,
45
+ pageHeight: a.height,
46
+ timeoutMs: t,
47
+ fontFamily: e,
48
+ sansFontFamily: r,
49
49
  latinFontFamily: "\"GD Contract Latin\", serif",
50
- metricNormalizeCss: r.replace(/\s+/g, " ").trim(),
50
+ metricNormalizeCss: n.replace(/\s+/g, " ").trim(),
51
51
  sample: c,
52
52
  hanziSample: m,
53
53
  punctSample: h,
@@ -57,7 +57,7 @@ function C(e) {
57
57
  digitAdvance: 8,
58
58
  baseline: _,
59
59
  tolerance: s
60
- }).replace(/</g, "\\u003c"), f = `width:${e.width}px;min-height:${e.height}px;padding-top:${e.paddingTop}px;padding-bottom:${e.paddingBottom}px`;
60
+ }).replace(/</g, "\\u003c"), f = `width:${a.width}px;min-height:${a.height}px;padding-top:${a.paddingTop}px;padding-bottom:${a.paddingBottom}px`;
61
61
  return `<!doctype html>
62
62
  <html lang="zh-CN">
63
63
  <head>
@@ -69,9 +69,9 @@ ${w(u)}
69
69
  </style>
70
70
  </head>
71
71
  <body>
72
- <section class="${T(e.classNames)}" data-page-id="${T(e.pageId)}" data-page-format="${T(e.pageFormat ?? "Custom")}" data-page-width="${e.width}" data-page-height="${e.height}" style="${f}">
73
- ${e.decorationsHtml}
74
- <div class="gd-contract-template-page__content">${e.contentHtml}</div>
72
+ <section class="${T(a.classNames)}" data-page-id="${T(a.pageId)}" data-page-format="${T(a.pageFormat ?? "Custom")}" data-page-width="${a.width}" data-page-height="${a.height}" style="${f}">
73
+ ${a.decorationsHtml}
74
+ <div class="gd-contract-template-page__content">${a.contentHtml}</div>
75
75
  </section>
76
76
  <script nonce="${T(l)}">
77
77
  (() => {
@@ -0,0 +1,376 @@
1
+ //#region src/contract-print-css/index.ts
2
+ var e = "\"GD Contract Latin\", \"Songti SC\", SimSun, \"Noto Serif CJK SC\", \"Source Han Serif SC\", serif", t = "\"GD Contract Latin Sans\", \"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans CJK SC\", sans-serif", n = 8e3, r = "text-spacing-trim: space-all;\n font-kerning: none;\n font-variant-ligatures: none;\n font-variant-east-asian: normal;\n font-synthesis: none;\n font-feature-settings: \"palt\" 0, \"halt\" 0;\n font-optical-sizing: none;";
3
+ function i(n) {
4
+ let i = c(n.width, "width"), l = c(n.height, "height"), u = n.pages.map((e) => {
5
+ let t = s(e.pageSize?.width) ? e.pageSize.width : i, n = s(e.pageSize?.height) ? e.pageSize.height : l;
6
+ return `.gd-contract-template-page[data-page-id="${o(e.id)}"] { width: ${t}px; min-height: ${n}px; }`;
7
+ }).join("\n");
8
+ return `${a()}
9
+ @page { size: ${i}px ${l}px; margin: 0; }
10
+ * { box-sizing: border-box; }
11
+ html, body { margin: 0; padding: 0; background: #fff; }
12
+ body {
13
+ color: #262a33;
14
+ font-size: 16px;
15
+ font-family: ${e};
16
+ line-height: 1.75;
17
+ -webkit-print-color-adjust: exact;
18
+ print-color-adjust: exact;
19
+ }
20
+ .gd-contract-template-page {
21
+ position: relative;
22
+ box-sizing: border-box;
23
+ width: ${i}px;
24
+ min-height: ${l}px;
25
+ padding: 54px 64px;
26
+ overflow: hidden;
27
+ color: #262a33;
28
+ font-size: 16px;
29
+ font-family: ${e};
30
+ line-height: 1.75;
31
+ ${r}
32
+ break-after: page;
33
+ page-break-after: always;
34
+ }
35
+ .gd-contract-template-page *,
36
+ .gd-contract-template-page *::before,
37
+ .gd-contract-template-page *::after { box-sizing: border-box; }
38
+ .gd-contract-template-page.has-contract-header {
39
+ padding-top: var(--gd-contract-header-safe-padding, 80px);
40
+ }
41
+ .gd-contract-template-page.has-contract-footer {
42
+ padding-bottom: var(--gd-contract-footer-safe-padding, 80px);
43
+ }
44
+ .gd-contract-template-page__content { position: relative; z-index: 1; }
45
+ .gd-contract-template-page__header,
46
+ .gd-contract-template-page__footer {
47
+ position: absolute;
48
+ z-index: 2;
49
+ display: grid;
50
+ grid-template-columns: repeat(3, minmax(0, 1fr));
51
+ align-items: center;
52
+ right: 64px;
53
+ left: 64px;
54
+ gap: 8px;
55
+ min-width: 0;
56
+ padding-block: 4px;
57
+ line-height: 1.5;
58
+ pointer-events: none;
59
+ }
60
+ .gd-contract-template-page__header { top: 24px; }
61
+ .gd-contract-template-page__footer { bottom: 24px; }
62
+ .gd-contract-template-page__decoration-slot {
63
+ min-width: 0;
64
+ overflow: hidden;
65
+ text-overflow: ellipsis;
66
+ white-space: nowrap;
67
+ }
68
+ .gd-contract-template-page__decoration-slot.is-left { text-align: left; }
69
+ .gd-contract-template-page__decoration-slot.is-center { text-align: center; }
70
+ .gd-contract-template-page__decoration-slot.is-right { text-align: right; }
71
+ .gd-contract-template-page__watermark {
72
+ position: absolute;
73
+ z-index: 0;
74
+ display: grid;
75
+ inset: 0;
76
+ overflow: hidden;
77
+ letter-spacing: 0;
78
+ pointer-events: none;
79
+ user-select: none;
80
+ }
81
+ .gd-contract-template-page__watermark.is-single { place-items: center; }
82
+ .gd-contract-template-page__watermark.is-tiled {
83
+ grid-template-columns: repeat(var(--gd-watermark-columns), minmax(0, 1fr));
84
+ grid-template-rows: repeat(var(--gd-watermark-rows), minmax(0, 1fr));
85
+ padding: 72px 40px;
86
+ }
87
+ .gd-contract-template-page__watermark-item {
88
+ display: flex;
89
+ align-items: center;
90
+ justify-content: center;
91
+ min-width: 0;
92
+ max-width: 100%;
93
+ overflow: hidden;
94
+ font-weight: 500;
95
+ line-height: 1.5;
96
+ text-overflow: ellipsis;
97
+ white-space: nowrap;
98
+ transform-origin: center;
99
+ }
100
+ ${u}
101
+ .gd-contract-template-page:last-child { break-after: auto; page-break-after: auto; }
102
+ .gd-contract-template-page p { margin: 0 0 10px; }
103
+ .gd-contract-template-page table { width: 100%; border-collapse: collapse; }
104
+ .gd-contract-template-page th,
105
+ .gd-contract-template-page td { min-width: 80px; padding: 6px 8px; border: 1px solid #d9dce0; }
106
+ .gd-contract-template-page table[data-signing-layout="dual-party"] {
107
+ margin: 16px 0;
108
+ border: 0;
109
+ }
110
+ .gd-contract-template-page table[data-signing-layout="dual-party"] td {
111
+ width: 50%;
112
+ padding: 8px 20px;
113
+ border: 0;
114
+ vertical-align: top;
115
+ }
116
+ .gd-contract-template-page table[data-signing-layout="dual-party"] td + td { padding-left: 28px; }
117
+ .gd-contract-template-page img {
118
+ display: inline-block;
119
+ max-width: 100%;
120
+ object-fit: contain;
121
+ vertical-align: middle;
122
+ }
123
+ .gd-contract-template-page img[width],
124
+ .gd-contract-template-page img[height] { max-width: none; }
125
+ .gd-contract-template-page img:not([height]) { height: auto; }
126
+ .gd-contract-template-page h1,
127
+ .gd-contract-template-page h2,
128
+ .gd-contract-template-page h3,
129
+ .gd-contract-template-page h4,
130
+ .gd-contract-template-page h5,
131
+ .gd-contract-template-page h6 { display: block; font-weight: bold; }
132
+ .gd-contract-template-page h1 { margin: 0.67em 0; font-size: 2em; }
133
+ .gd-contract-template-page h2 { margin: 0.83em 0; font-size: 1.5em; }
134
+ .gd-contract-template-page h3 { margin: 1em 0; font-size: 1.17em; }
135
+ .gd-contract-template-page h4 { margin: 1.33em 0; font-size: 1em; }
136
+ .gd-contract-template-page h5 { margin: 1.67em 0; font-size: 0.83em; }
137
+ .gd-contract-template-page h6 { margin: 2.33em 0; font-size: 0.67em; }
138
+ .gd-contract-template-page ul,
139
+ .gd-contract-template-page ol {
140
+ display: block;
141
+ margin: 1em 0;
142
+ padding-inline-start: 40px;
143
+ list-style-position: outside;
144
+ }
145
+ .gd-contract-template-page ul ul,
146
+ .gd-contract-template-page ul ol,
147
+ .gd-contract-template-page ol ul,
148
+ .gd-contract-template-page ol ol { margin-block: 0; }
149
+ .gd-contract-template-page ul { list-style-type: disc; }
150
+ .gd-contract-template-page ul ul,
151
+ .gd-contract-template-page ol ul { list-style-type: circle; }
152
+ .gd-contract-template-page ul ul ul,
153
+ .gd-contract-template-page ul ol ul,
154
+ .gd-contract-template-page ol ul ul,
155
+ .gd-contract-template-page ol ol ul { list-style-type: square; }
156
+ .gd-contract-template-page ol { list-style-type: decimal; }
157
+ .gd-contract-template-page li { display: list-item; text-align: match-parent; }
158
+ .gd-contract-template-page blockquote { display: block; margin: 1em 40px; }
159
+ .gd-contract-template-page pre {
160
+ display: block;
161
+ margin: 1em 0;
162
+ font-family: monospace;
163
+ white-space: pre;
164
+ }
165
+ .gd-contract-template-page code,
166
+ .gd-contract-template-page kbd,
167
+ .gd-contract-template-page samp { font-family: ${t}; }
168
+ .gd-contract-template-page hr {
169
+ display: block;
170
+ margin: 0.5em auto;
171
+ overflow: hidden;
172
+ border-width: 1px;
173
+ border-style: inset;
174
+ }
175
+ .gd-contract-template-page b,
176
+ .gd-contract-template-page strong { font-weight: bolder; }
177
+ .gd-contract-template-page i,
178
+ .gd-contract-template-page em,
179
+ .gd-contract-template-page cite,
180
+ .gd-contract-template-page var,
181
+ .gd-contract-template-page dfn,
182
+ .gd-contract-template-page address { font-style: italic; }
183
+ .gd-contract-template-page s,
184
+ .gd-contract-template-page strike,
185
+ .gd-contract-template-page del { text-decoration: line-through; }
186
+ .gd-contract-template-page u,
187
+ .gd-contract-template-page ins { text-decoration: underline; }
188
+ .gd-contract-template-page sup {
189
+ font-size: smaller;
190
+ line-height: normal;
191
+ vertical-align: super;
192
+ }
193
+ .gd-contract-template-page sub {
194
+ font-size: smaller;
195
+ line-height: normal;
196
+ vertical-align: sub;
197
+ }
198
+ .gd-contract-template-page small { font-size: smaller; }
199
+ .gd-contract-template-page .gd-contract-template-variable,
200
+ .gd-contract-template-page [data-template-variable="true"]:not(.gd-contract-template-page__variable) {
201
+ position: relative;
202
+ box-sizing: border-box;
203
+ display: inline-flex;
204
+ align-items: center;
205
+ justify-content: var(--gd-contract-variable-justify-content, flex-start);
206
+ width: var(--gd-contract-variable-width, 160px);
207
+ min-width: 0;
208
+ min-height: var(--gd-contract-variable-height, 32px);
209
+ margin: 0 2px;
210
+ padding: 0 6px;
211
+ border: 1px solid transparent;
212
+ border-radius: 2px;
213
+ background: var(--gd-contract-variable-background, transparent);
214
+ color: var(--gd-contract-variable-color, #1f2937);
215
+ font-size: var(--gd-contract-variable-font-size, 14px);
216
+ font-family: var(--gd-contract-variable-font-family, inherit);
217
+ line-height: 1.5;
218
+ text-align: var(--gd-contract-variable-text-align, left);
219
+ vertical-align: middle;
220
+ white-space: nowrap;
221
+ }
222
+ .gd-contract-template-page .gd-contract-template-variable.has-border,
223
+ .gd-contract-template-page [data-template-variable="true"][data-border="true"]:not(.gd-contract-template-page__variable) {
224
+ border-color: var(--gd-contract-variable-line-color, #565b66);
225
+ border-style: var(--gd-contract-variable-border-style, solid);
226
+ }
227
+ .gd-contract-template-page .gd-contract-template-variable.has-underline,
228
+ .gd-contract-template-page [data-template-variable="true"][data-underline="true"]:not(.gd-contract-template-page__variable) {
229
+ border-color: transparent;
230
+ border-bottom-color: var(--gd-contract-variable-line-color, #565b66);
231
+ border-bottom-style: var(--gd-contract-variable-border-style, solid);
232
+ border-radius: 0;
233
+ }
234
+ .gd-contract-template-page .gd-contract-template-variable.is-multiline,
235
+ .gd-contract-template-page [data-template-variable="true"][data-multiline="true"]:not(.gd-contract-template-page__variable) {
236
+ display: inline-block;
237
+ width: var(--gd-contract-variable-width, 160px);
238
+ height: var(--gd-contract-variable-multiline-height, 84px);
239
+ min-height: var(--gd-contract-variable-multiline-height, 84px);
240
+ overflow: hidden;
241
+ line-height: var(--gd-contract-variable-line-height, 28px);
242
+ vertical-align: top;
243
+ white-space: pre-wrap;
244
+ overflow-wrap: anywhere;
245
+ }
246
+ .gd-contract-template-page textarea.gd-contract-template-variable.is-multiline {
247
+ resize: none;
248
+ }
249
+ .gd-contract-template-page .gd-contract-template-variable.is-multiline.has-underline,
250
+ .gd-contract-template-page [data-template-variable="true"][data-multiline="true"][data-underline="true"]:not(.gd-contract-template-page__variable) {
251
+ border-bottom-color: transparent;
252
+ background-image: linear-gradient(
253
+ to bottom,
254
+ transparent calc(100% - 1px),
255
+ var(--gd-contract-variable-line-color, #565b66) calc(100% - 1px)
256
+ );
257
+ /* 以边框盒固定横线周期;PDF 会对 repeat-y 图块边界插值,padding-box 排除顶部透明边框区的浅线。 */
258
+ background-origin: border-box;
259
+ background-position: 0 0;
260
+ background-clip: padding-box;
261
+ /* 底部 1px 边框等量移为 padding,避免末行线被 clip;总高度、内容高度和文字顶部位置均不变。 */
262
+ border-bottom-width: 0;
263
+ padding-bottom: 1px;
264
+ background-repeat: repeat-y;
265
+ background-size: 100% var(--gd-contract-variable-line-height, 28px);
266
+ }
267
+ .gd-contract-template-page .gd-contract-template-variable.is-image,
268
+ .gd-contract-template-page [data-template-variable="true"][data-variable-type="image"]:not(.gd-contract-template-page__variable) {
269
+ justify-content: var(--gd-contract-variable-justify-content, flex-start);
270
+ min-height: var(--gd-contract-variable-height, 32px);
271
+ border-color: transparent;
272
+ border-style: solid;
273
+ background-image: var(--gd-contract-variable-image, none);
274
+ background-repeat: no-repeat;
275
+ background-position: center;
276
+ background-size: var(--gd-contract-variable-object-fit, contain);
277
+ white-space: nowrap;
278
+ }
279
+ .gd-contract-template-page .gd-contract-template-variable.is-image.has-value,
280
+ .gd-contract-template-page [data-template-variable="true"][data-variable-type="image"]:not(.gd-contract-template-page__variable) {
281
+ color: transparent;
282
+ }
283
+ .gd-contract-template-page .gd-contract-template-variable.is-image.has-value::before { content: none; }
284
+ .gd-contract-template-page .gd-contract-template-variable.is-checkbox {
285
+ gap: 6px;
286
+ width: var(--gd-contract-variable-width, 160px);
287
+ min-width: 0;
288
+ padding: 0 6px;
289
+ }
290
+ .gd-contract-template-page .gd-contract-template-signing-mark,
291
+ .gd-contract-template-page [data-signing-mark="true"] {
292
+ display: inline-flex;
293
+ align-items: center;
294
+ justify-content: center;
295
+ box-sizing: border-box;
296
+ width: var(--gd-contract-sign-mark-width, 142px);
297
+ height: var(--gd-contract-sign-mark-height, 57px);
298
+ margin: 0 2px;
299
+ border: 1px dashed var(--gd-contract-sign-mark-line-color, #565b66);
300
+ border-radius: 2px;
301
+ background: var(--gd-contract-sign-mark-fill, transparent);
302
+ color: var(--gd-contract-sign-mark-color, #565b66);
303
+ font-size: 14px;
304
+ line-height: 1.4;
305
+ vertical-align: middle;
306
+ white-space: pre-wrap;
307
+ text-align: center;
308
+ }
309
+ .gd-contract-template-page .gd-contract-template-signing-mark--seal,
310
+ .gd-contract-template-page [data-signing-mark="true"][data-mark-type="seal"] {
311
+ border-color: color-mix(in srgb, #ee3939 72%, #565b66);
312
+ }
313
+ .gd-contract-template-page .gd-contract-template-signing-mark--line,
314
+ .gd-contract-template-page [data-signing-mark="true"][data-mark-type="line"] {
315
+ border-style: solid;
316
+ border-width: 0 0 1px;
317
+ border-radius: 0;
318
+ background: transparent;
319
+ justify-content: flex-start;
320
+ }
321
+ .gd-contract-template-page .gd-contract-template-signing-mark--area,
322
+ .gd-contract-template-page [data-signing-mark="true"][data-mark-type="area"] {
323
+ border-style: dashed;
324
+ }
325
+ .gd-contract-template-page .gd-contract-template-signing-mark--signature,
326
+ .gd-contract-template-page [data-signing-mark="true"][data-mark-type="signature"],
327
+ .gd-contract-template-page .gd-contract-template-signing-mark--date,
328
+ .gd-contract-template-page [data-signing-mark="true"][data-mark-type="date"] {
329
+ border-style: dashed;
330
+ }
331
+ /* 签署标记仅保留正式签署线或留白尺寸,不向预览、PDF 和签署底图泄漏辅助文案。 */
332
+ .gd-contract-template-page .gd-contract-template-signing-mark:not(.gd-contract-template-signing-mark--line),
333
+ .gd-contract-template-page [data-signing-mark="true"]:not([data-mark-type="line"]) {
334
+ border: 0;
335
+ background: transparent;
336
+ }
337
+ .gd-contract-template-page .gd-contract-template-signing-mark__label,
338
+ .gd-contract-template-page [data-signing-mark="true"] .gd-contract-template-signing-mark__label {
339
+ display: none !important;
340
+ }
341
+ /* 历史模板可能写入仅某个操作系统存在的字体;保留原数据,打印时收敛到合同标准栈。 */
342
+ .gd-contract-template-page [style*="font-family" i],
343
+ .gd-contract-template-page [data-font-family],
344
+ .gd-contract-template-page [face] {
345
+ font-family: ${e} !important;
346
+ }
347
+ .gd-contract-template-page [style*="GD Contract Latin Sans" i],
348
+ .gd-contract-template-page [style*="PingFang SC" i],
349
+ .gd-contract-template-page [style*="Microsoft YaHei" i],
350
+ .gd-contract-template-page [style*="Noto Sans CJK SC" i],
351
+ .gd-contract-template-page [data-font-family*="GD Contract Latin Sans" i],
352
+ .gd-contract-template-page [data-font-family*="PingFang SC" i],
353
+ .gd-contract-template-page [data-font-family*="Microsoft YaHei" i],
354
+ .gd-contract-template-page [data-font-family*="Noto Sans CJK SC" i],
355
+ .gd-contract-template-page [face*="GD Contract Latin Sans" i],
356
+ .gd-contract-template-page [face*="PingFang SC" i],
357
+ .gd-contract-template-page [face*="Microsoft YaHei" i],
358
+ .gd-contract-template-page [face*="Noto Sans CJK SC" i] {
359
+ font-family: ${t} !important;
360
+ }`;
361
+ }
362
+ function a() {
363
+ return "@font-face {\n font-family: \"GD Contract Latin\";\n src: local(\"Times New Roman\"), local(\"Liberation Serif\"), local(\"Tinos\");\n unicode-range: U+0000-024F, U+2000-206F, U+2190-21FF, U+2200-22FF;\n}\n@font-face {\n font-family: \"GD Contract Latin Sans\";\n src: local(\"Arial\"), local(\"Helvetica Neue\"), local(\"Liberation Sans\");\n unicode-range: U+0000-024F, U+2000-206F, U+2190-21FF, U+2200-22FF;\n}";
364
+ }
365
+ function o(e) {
366
+ return String(e).replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/[\r\n\f]/g, " ");
367
+ }
368
+ function s(e) {
369
+ return typeof e == "number" && Number.isFinite(e) && e > 0;
370
+ }
371
+ function c(e, t) {
372
+ if (!s(e)) throw TypeError(`${t} 必须是有限正数`);
373
+ return e;
374
+ }
375
+ //#endregion
376
+ export { e as CONTRACT_PRINT_FONT_FAMILY, n as CONTRACT_PRINT_FONT_TIMEOUT_MS, r as CONTRACT_PRINT_METRIC_NORMALIZE_CSS, t as CONTRACT_PRINT_SANS_FONT_FAMILY, i as buildContractPrintCss };
@@ -1 +1 @@
1
- require(`../../../_virtual/_rolldown/runtime.cjs`);const e=require(`./utils/signing-mark.cjs`);let t=require(`@guodun/contract-print-css`);var n=t.CONTRACT_PRINT_FONT_FAMILY,r=[{label:`合同宋体`,value:n},{label:`文档黑体`,value:t.CONTRACT_PRINT_SANS_FONT_FAMILY}],i=[12,14,16,18,20,24,28,32],a=[{label:`左对齐`,value:`left`},{label:`居中对齐`,value:`center`},{label:`右对齐`,value:`right`}],o=[{format:`paragraph`,label:`正文`,fontSize:14,bold:!1,marginTop:0,marginBottom:10},{format:1,label:`标题 1`,fontSize:28,bold:!0,marginTop:20,marginBottom:12},{format:2,label:`标题 2`,fontSize:24,bold:!0,marginTop:16,marginBottom:10},{format:3,label:`标题 3`,fontSize:20,bold:!0,marginTop:14,marginBottom:8},{format:4,label:`标题 4`,fontSize:18,bold:!0,marginTop:12,marginBottom:8},{format:5,label:`标题 5`,fontSize:16,bold:!0,marginTop:10,marginBottom:6},{format:6,label:`标题 6`,fontSize:14,bold:!0,marginTop:8,marginBottom:6}];function s(e){return o.find(t=>t.format===e)}var c=[{key:`contractTitle`,label:`合同标题`,headingLevel:1,fontSize:26,fontFamily:n,textAlign:`center`,bold:!0,italic:!1,underline:!1},{key:`clauseTitle`,label:`条款标题`,headingLevel:2,fontSize:18,fontFamily:n,textAlign:`left`,bold:!0,italic:!1,underline:!1},{key:`bodyClause`,label:`正文条款`,paragraph:!0,fontSize:14,fontFamily:n,textAlign:`left`,bold:!1,italic:!1,underline:!1},{key:`appendixTitle`,label:`附件标题`,headingLevel:2,fontSize:20,fontFamily:n,textAlign:`center`,bold:!0,italic:!1,underline:!1}];function l(e){return[e.paragraph?{type:`set-paragraph`}:{type:`set-heading`,level:e.headingLevel??2},{type:`set-text-align`,value:e.textAlign},{type:`set-font-family`,value:e.fontFamily},{type:`set-font-size`,value:e.fontSize},e.bold?{type:`set-bold`}:{type:`unset-bold`},e.italic?{type:`set-italic`}:{type:`unset-italic`},e.underline?{type:`set-underline`}:{type:`unset-underline`}]}var u=Object.fromEntries(c.map(e=>[e.key,l(e)]));function d(e){return c.find(t=>t.key===e)}function f(e){return(u[e]??[]).map(e=>({...e}))}function p(e){return String(e||``).replace(/["']/g,``).replace(/\s*,\s*/g,`,`).trim().toLowerCase()}function m(e,t=`append`){let n=t===`replace`?e??r:[...r,...e??[]],i=new Map;return n.forEach(e=>{e?.value&&i.set(p(e.value),e)}),Array.from(i.values())}var h=[`seal`,`signature`,`date`,`area`,`line`].map(t=>({markType:t,label:e.SIGNING_MARK_TYPE_LABELS[t]}));exports.CONTRACT_BLOCK_STYLES=o,exports.CONTRACT_TEXT_STYLE_PRESETS=c,exports.CONTRACT_TEXT_STYLE_PRESET_COMMANDS=u,exports.DEFAULT_CONTRACT_FONT_FAMILY=n,exports.DEFAULT_FONT_FAMILY_OPTIONS=r,exports.DEFAULT_FONT_SIZE_PRESETS=i,exports.DEFAULT_TEXT_ALIGN_OPTIONS=a,exports.SIGNING_MARK_TOOL_ITEMS=h,exports.getContractBlockStyle=s,exports.getContractTextStylePreset=d,exports.normalizeFontFamilyValue=p,exports.resolveContractTextStylePresetCommands=f,exports.resolveFontFamilyOptions=m;
1
+ const e=require(`../../../contract-print-css/index.cjs`),t=require(`./utils/signing-mark.cjs`);var n=e.CONTRACT_PRINT_FONT_FAMILY,r=[{label:`合同宋体`,value:n},{label:`文档黑体`,value:e.CONTRACT_PRINT_SANS_FONT_FAMILY}],i=[12,14,16,18,20,24,28,32],a=[{label:`左对齐`,value:`left`},{label:`居中对齐`,value:`center`},{label:`右对齐`,value:`right`}],o=[{format:`paragraph`,label:`正文`,fontSize:14,bold:!1,marginTop:0,marginBottom:10},{format:1,label:`标题 1`,fontSize:28,bold:!0,marginTop:20,marginBottom:12},{format:2,label:`标题 2`,fontSize:24,bold:!0,marginTop:16,marginBottom:10},{format:3,label:`标题 3`,fontSize:20,bold:!0,marginTop:14,marginBottom:8},{format:4,label:`标题 4`,fontSize:18,bold:!0,marginTop:12,marginBottom:8},{format:5,label:`标题 5`,fontSize:16,bold:!0,marginTop:10,marginBottom:6},{format:6,label:`标题 6`,fontSize:14,bold:!0,marginTop:8,marginBottom:6}];function s(e){return o.find(t=>t.format===e)}var c=[{key:`contractTitle`,label:`合同标题`,headingLevel:1,fontSize:26,fontFamily:n,textAlign:`center`,bold:!0,italic:!1,underline:!1},{key:`clauseTitle`,label:`条款标题`,headingLevel:2,fontSize:18,fontFamily:n,textAlign:`left`,bold:!0,italic:!1,underline:!1},{key:`bodyClause`,label:`正文条款`,paragraph:!0,fontSize:14,fontFamily:n,textAlign:`left`,bold:!1,italic:!1,underline:!1},{key:`appendixTitle`,label:`附件标题`,headingLevel:2,fontSize:20,fontFamily:n,textAlign:`center`,bold:!0,italic:!1,underline:!1}];function l(e){return[e.paragraph?{type:`set-paragraph`}:{type:`set-heading`,level:e.headingLevel??2},{type:`set-text-align`,value:e.textAlign},{type:`set-font-family`,value:e.fontFamily},{type:`set-font-size`,value:e.fontSize},e.bold?{type:`set-bold`}:{type:`unset-bold`},e.italic?{type:`set-italic`}:{type:`unset-italic`},e.underline?{type:`set-underline`}:{type:`unset-underline`}]}var u=Object.fromEntries(c.map(e=>[e.key,l(e)]));function d(e){return c.find(t=>t.key===e)}function f(e){return(u[e]??[]).map(e=>({...e}))}function p(e){return String(e||``).replace(/["']/g,``).replace(/\s*,\s*/g,`,`).trim().toLowerCase()}function m(e,t=`append`){let n=t===`replace`?e??r:[...r,...e??[]],i=new Map;return n.forEach(e=>{e?.value&&i.set(p(e.value),e)}),Array.from(i.values())}var h=[`seal`,`signature`,`date`,`area`,`line`].map(e=>({markType:e,label:t.SIGNING_MARK_TYPE_LABELS[e]}));exports.CONTRACT_BLOCK_STYLES=o,exports.CONTRACT_TEXT_STYLE_PRESETS=c,exports.CONTRACT_TEXT_STYLE_PRESET_COMMANDS=u,exports.DEFAULT_CONTRACT_FONT_FAMILY=n,exports.DEFAULT_FONT_FAMILY_OPTIONS=r,exports.DEFAULT_FONT_SIZE_PRESETS=i,exports.DEFAULT_TEXT_ALIGN_OPTIONS=a,exports.SIGNING_MARK_TOOL_ITEMS=h,exports.getContractBlockStyle=s,exports.getContractTextStylePreset=d,exports.normalizeFontFamilyValue=p,exports.resolveContractTextStylePresetCommands=f,exports.resolveFontFamilyOptions=m;
@@ -1,4 +1,4 @@
1
- require(`../../../../_virtual/_rolldown/runtime.cjs`);let e=require(`vue`),t=require(`@guodun/contract-print-css`);var n=`gd-contract-print`,r=.5,i=`合同签署位置:甲方(Company A)编号 2026-08-31。`,a=t.CONTRACT_PRINT_FONT_TIMEOUT_MS+1e3,o=new Set;function s(e){o.forEach(t=>t(e))}function c(e){o.size||window.addEventListener(`message`,s),o.add(e)}function l(e){o.delete(e),o.size||window.removeEventListener(`message`,s)}var u=`合同签署位置甲乙双方`,d=`:,()。;`,f=`20260831`,p={textWidth:379.546875,sansTextWidth:393,variableRowHeight:28},m=`合同排版度量校验失败,禁止生成签署坐标`,h=(0,e.shallowRef)(``);function g(e){h.value=(e?.baseUrl?.trim()??``).replace(/\/+$/,``)}function _(e){let t=e?.trim();return t?t.replace(/\/+$/,``):h.value.trim().replace(/\/+$/,``)}function v(e,t=typeof window>`u`?``:window.location.origin){let n=e.trim().replace(/\/+$/,``);return n?/^https?:\/\//i.test(n)?n:t?new URL(n.startsWith(`/`)?n:`/${n}`,`${t.replace(/\/+$/,``)}/`).href.replace(/\/+$/,``):n.startsWith(`/`)?n:`/${n}`:``}function y(e){let a=`gd-contract-print-${e.messageId}`,o=(0,t.buildContractPrintCss)({width:e.width,height:e.height,pages:[{id:e.pageId,pageSize:{width:e.width,height:e.height}}]}),s=JSON.stringify({messageId:e.messageId,parentOrigin:e.parentOrigin,pageId:e.pageId,pageHeight:e.height,timeoutMs:t.CONTRACT_PRINT_FONT_TIMEOUT_MS,fontFamily:t.CONTRACT_PRINT_FONT_FAMILY,sansFontFamily:t.CONTRACT_PRINT_SANS_FONT_FAMILY,latinFontFamily:`"GD Contract Latin", serif`,metricNormalizeCss:t.CONTRACT_PRINT_METRIC_NORMALIZE_CSS.replace(/\s+/g,` `).trim(),sample:i,hanziSample:u,punctSample:d,digitSample:f,hanziAdvance:16,punctAdvance:16,digitAdvance:8,baseline:p,tolerance:r}).replace(/</g,`\\u003c`),c=`width:${e.width}px;min-height:${e.height}px;padding-top:${e.paddingTop}px;padding-bottom:${e.paddingBottom}px`;return`<!doctype html>
1
+ require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../../../contract-print-css/index.cjs`);let t=require(`vue`);var n=`gd-contract-print`,r=.5,i=`合同签署位置:甲方(Company A)编号 2026-08-31。`,a=e.CONTRACT_PRINT_FONT_TIMEOUT_MS+1e3,o=new Set;function s(e){o.forEach(t=>t(e))}function c(e){o.size||window.addEventListener(`message`,s),o.add(e)}function l(e){o.delete(e),o.size||window.removeEventListener(`message`,s)}var u=`合同签署位置甲乙双方`,d=`:,()。;`,f=`20260831`,p={textWidth:379.546875,sansTextWidth:393,variableRowHeight:28},m=`合同排版度量校验失败,禁止生成签署坐标`,h=(0,t.shallowRef)(``);function g(e){h.value=(e?.baseUrl?.trim()??``).replace(/\/+$/,``)}function _(e){let t=e?.trim();return t?t.replace(/\/+$/,``):h.value.trim().replace(/\/+$/,``)}function v(e,t=typeof window>`u`?``:window.location.origin){let n=e.trim().replace(/\/+$/,``);return n?/^https?:\/\//i.test(n)?n:t?new URL(n.startsWith(`/`)?n:`/${n}`,`${t.replace(/\/+$/,``)}/`).href.replace(/\/+$/,``):n.startsWith(`/`)?n:`/${n}`:``}function y(t){let a=`gd-contract-print-${t.messageId}`,o=e.buildContractPrintCss({width:t.width,height:t.height,pages:[{id:t.pageId,pageSize:{width:t.width,height:t.height}}]}),s=JSON.stringify({messageId:t.messageId,parentOrigin:t.parentOrigin,pageId:t.pageId,pageHeight:t.height,timeoutMs:e.CONTRACT_PRINT_FONT_TIMEOUT_MS,fontFamily:e.CONTRACT_PRINT_FONT_FAMILY,sansFontFamily:e.CONTRACT_PRINT_SANS_FONT_FAMILY,latinFontFamily:`"GD Contract Latin", serif`,metricNormalizeCss:e.CONTRACT_PRINT_METRIC_NORMALIZE_CSS.replace(/\s+/g,` `).trim(),sample:i,hanziSample:u,punctSample:d,digitSample:f,hanziAdvance:16,punctAdvance:16,digitAdvance:8,baseline:p,tolerance:r}).replace(/</g,`\\u003c`),c=`width:${t.width}px;min-height:${t.height}px;padding-top:${t.paddingTop}px;padding-bottom:${t.paddingBottom}px`;return`<!doctype html>
2
2
  <html lang="zh-CN">
3
3
  <head>
4
4
  <meta charset="utf-8">
@@ -9,9 +9,9 @@ ${b(o)}
9
9
  </style>
10
10
  </head>
11
11
  <body>
12
- <section class="${x(e.classNames)}" data-page-id="${x(e.pageId)}" data-page-format="${x(e.pageFormat??`Custom`)}" data-page-width="${e.width}" data-page-height="${e.height}" style="${c}">
13
- ${e.decorationsHtml}
14
- <div class="gd-contract-template-page__content">${e.contentHtml}</div>
12
+ <section class="${x(t.classNames)}" data-page-id="${x(t.pageId)}" data-page-format="${x(t.pageFormat??`Custom`)}" data-page-width="${t.width}" data-page-height="${t.height}" style="${c}">
13
+ ${t.decorationsHtml}
14
+ <div class="gd-contract-template-page__content">${t.contentHtml}</div>
15
15
  </section>
16
16
  <script nonce="${x(a)}">
17
17
  (() => {