monto-email-builder 1.2.2 → 1.2.3

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 (49) hide show
  1. package/README.md +1 -1
  2. package/dist/App/InspectorDrawer/ConfigurationPanel/index.d.ts.map +1 -1
  3. package/dist/App/InspectorDrawer/ConfigurationPanel/input-panels/TextSidebarPanel.d.ts +2 -1
  4. package/dist/App/InspectorDrawer/ConfigurationPanel/input-panels/TextSidebarPanel.d.ts.map +1 -1
  5. package/dist/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/ColorInput/BaseColorInput.d.ts.map +1 -1
  6. package/dist/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/FontStyleInput.d.ts +8 -0
  7. package/dist/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/FontStyleInput.d.ts.map +1 -0
  8. package/dist/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/FontWeightInput.d.ts.map +1 -1
  9. package/dist/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/LetterSpacingInput.d.ts +8 -0
  10. package/dist/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/LetterSpacingInput.d.ts.map +1 -0
  11. package/dist/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/LineHeightInput.d.ts +8 -0
  12. package/dist/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/LineHeightInput.d.ts.map +1 -0
  13. package/dist/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/RadioGroupInput.d.ts.map +1 -1
  14. package/dist/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/TextDecorationInput.d.ts +9 -0
  15. package/dist/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/TextDecorationInput.d.ts.map +1 -0
  16. package/dist/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/TextFormatGroup.d.ts +8 -0
  17. package/dist/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/TextFormatGroup.d.ts.map +1 -0
  18. package/dist/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/style-inputs/MultiStylePropertyPanel.d.ts.map +1 -1
  19. package/dist/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/style-inputs/SingleStylePropertyPanel.d.ts.map +1 -1
  20. package/dist/App/InspectorDrawer/index.d.ts.map +1 -1
  21. package/dist/App/TemplatePanel/index.d.ts.map +1 -1
  22. package/dist/EmailBuilder/index.d.ts +16 -0
  23. package/dist/EmailBuilder/index.d.ts.map +1 -1
  24. package/dist/HtmlEditor/index.d.ts.map +1 -1
  25. package/dist/chunks/{chunk-CxhtzHBZ.js → chunk-_7XTjFEi.js} +220 -80
  26. package/dist/documents/blocks/Text/TextEditor.d.ts.map +1 -1
  27. package/dist/documents/blocks/Text/TextEditorRich.d.ts +3 -0
  28. package/dist/documents/blocks/Text/TextEditorRich.d.ts.map +1 -0
  29. package/dist/documents/blocks/Text/textDom.d.ts +70 -0
  30. package/dist/documents/blocks/Text/textDom.d.ts.map +1 -0
  31. package/dist/documents/blocks/Text/variableCatalog.d.ts +23 -0
  32. package/dist/documents/blocks/Text/variableCatalog.d.ts.map +1 -0
  33. package/dist/documents/blocks/helpers/TStyle.d.ts +4 -0
  34. package/dist/documents/blocks/helpers/TStyle.d.ts.map +1 -1
  35. package/dist/documents/blocks/helpers/block-wrappers/EditorBlockWrapper.d.ts.map +1 -1
  36. package/dist/documents/blocks/helpers/block-wrappers/TuneMenu.d.ts.map +1 -1
  37. package/dist/documents/editor/EditorContext.d.ts +85 -0
  38. package/dist/documents/editor/EditorContext.d.ts.map +1 -1
  39. package/dist/documents/editor/collectTemplateVariables.d.ts +51 -0
  40. package/dist/documents/editor/collectTemplateVariables.d.ts.map +1 -0
  41. package/dist/documents/editor/core.d.ts +717 -4
  42. package/dist/documents/editor/core.d.ts.map +1 -1
  43. package/dist/documents/editor/flushActiveTextEditorToDocument.d.ts +6 -0
  44. package/dist/documents/editor/flushActiveTextEditorToDocument.d.ts.map +1 -0
  45. package/dist/html-editor.js +144 -127
  46. package/dist/index.d.ts +2 -1
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +5165 -2859
  49. package/package.json +16 -15
@@ -31,12 +31,12 @@ const s = {
31
31
  postMetrics: "Post metrics",
32
32
  respondToMessage: "Respond to inquiry",
33
33
  quickStart: "Quick Start"
34
- }, m = {
34
+ }, u = {
35
35
  styles: "Styles",
36
36
  inspect: "Inspect",
37
37
  clickBlockToInspect: "Click on a block to inspect.",
38
38
  blockNotFound: "Block with id {{id}} was not found. Click on a block to reset."
39
- }, u = {
39
+ }, m = {
40
40
  edit: "Edit",
41
41
  preview: "Preview",
42
42
  htmlOutput: "HTML output",
@@ -96,7 +96,7 @@ const s = {
96
96
  confirmChangeMessage: "Changing the column layout will delete data in some columns. This action cannot be undone. Are you sure you want to continue?",
97
97
  cancel: "Cancel",
98
98
  confirm: "Confirm"
99
- }, C = {
99
+ }, k = {
100
100
  global: "Global",
101
101
  backdropColor: "Backdrop color",
102
102
  canvasColor: "Canvas color",
@@ -105,12 +105,68 @@ const s = {
105
105
  pageWidth: "Page width",
106
106
  fontFamily: "Font family",
107
107
  textColor: "Text color"
108
- }, w = {
108
+ }, b = {
109
109
  title: "Text block",
110
110
  name: "Text",
111
111
  content: "Content",
112
- markdown: "Markdown"
113
- }, b = {
112
+ markdown: "Markdown",
113
+ selectionRange: "Text selected",
114
+ selectedSnippet: "Selected: {{snippet}}",
115
+ clearSelection: "Clear selection",
116
+ link: "Link",
117
+ linkType: "Type",
118
+ linkTypeWeb: "Web",
119
+ linkTypeEmail: "E-mail",
120
+ linkUrl: "URL",
121
+ linkPlaceholderUrl: "Enter URL here",
122
+ linkInvalid: "Please enter a valid link",
123
+ linkTargetBlank: "Open in new tab",
124
+ editLink: "Edit Link",
125
+ addVariables: "Add Variables",
126
+ replaceVariable: "Replace Variable",
127
+ linkVariables: "Variables",
128
+ variables: {
129
+ title: "Variables",
130
+ defaultsTitle: "Default values",
131
+ defaultPlaceholder: "Default value",
132
+ setDefaultTitle: "Set default value",
133
+ selectedVariable: "Selected variable",
134
+ defaultValueLabel: "Default value",
135
+ defaultRequired: "Default value is required",
136
+ back: "Back",
137
+ confirmInsert: "Insert",
138
+ groupContacts: "Contacts",
139
+ groupEmail: "Email",
140
+ groupOrganization: "Organization",
141
+ groupDate: "Date",
142
+ groupLinks: "Links",
143
+ firstName: "First name",
144
+ lastName: "Last name",
145
+ middleName: "Middle name",
146
+ email: "Email",
147
+ alternativeEmail: "Alternative email",
148
+ company: "Sender company",
149
+ addressLine1: "Sender address line 1",
150
+ addressLine2: "Sender address line 2",
151
+ country: "Sender country",
152
+ city: "Sender city",
153
+ state: "Sender state",
154
+ postalCode: "Sender postal code",
155
+ recipientCompany: "Recipient company",
156
+ recipientAddressLine1: "Recipient address line 1",
157
+ recipientAddressLine2: "Recipient address line 2",
158
+ recipientCountry: "Recipient country",
159
+ recipientCity: "Recipient city",
160
+ recipientState: "Recipient state",
161
+ recipientPostalCode: "Recipient postal code",
162
+ birthday: "Birthday",
163
+ currentDate: "Current date",
164
+ currentYear: "Current year",
165
+ currentMonthName: "Current month name",
166
+ currentWeekday: "Current weekday",
167
+ unsubscribeLink: "Unsubscribe link"
168
+ }
169
+ }, C = {
114
170
  title: "Button block",
115
171
  name: "Button",
116
172
  text: "Text",
@@ -129,12 +185,12 @@ const s = {
129
185
  stylePill: "Pill",
130
186
  textColor: "Text color",
131
187
  buttonColor: "Button color"
132
- }, k = {
188
+ }, y = {
133
189
  title: "Heading block",
134
190
  name: "Heading",
135
191
  content: "Content",
136
192
  level: "Level"
137
- }, v = {
193
+ }, f = {
138
194
  title: "Avatar block",
139
195
  size: "Size",
140
196
  shape: "Shape",
@@ -143,23 +199,23 @@ const s = {
143
199
  shapeRounded: "Rounded",
144
200
  imageUrl: "Image URL",
145
201
  altText: "Alt text"
146
- }, S = {
202
+ }, v = {
147
203
  title: "Divider block",
148
204
  name: "Divider",
149
205
  color: "Color",
150
206
  height: "Height"
151
- }, T = {
207
+ }, S = {
152
208
  title: "Container block",
153
209
  name: "Container"
154
- }, f = {
210
+ }, w = {
155
211
  title: "Spacer block",
156
212
  name: "Spacer",
157
213
  height: "Height"
158
- }, y = {
214
+ }, T = {
159
215
  title: "HTML block",
160
216
  name: "HTML",
161
217
  content: "Content"
162
- }, U = {
218
+ }, L = {
163
219
  title: "Social Media block",
164
220
  name: "Socials",
165
221
  selectPlatforms: "Social Media Selection",
@@ -172,7 +228,7 @@ const s = {
172
228
  iconUrl: "Link URL",
173
229
  placeholder: "Click the right panel to add social media icons",
174
230
  addAnother: "Add another social link"
175
- }, L = {
231
+ }, R = {
176
232
  backgroundColor: "Background color",
177
233
  borderColor: "Border color",
178
234
  borderRadius: "Border radius",
@@ -180,9 +236,23 @@ const s = {
180
236
  fontFamily: "Font family",
181
237
  fontSize: "Font size",
182
238
  fontWeight: "Font weight",
239
+ fontStyle: "Font style",
240
+ textDecoration: "Text decoration",
241
+ lineHeight: "Line height",
242
+ letterSpacing: "Letter spacing",
183
243
  alignment: "Alignment",
184
- padding: "Padding"
185
- }, x = {
244
+ padding: "Padding",
245
+ regular: "Regular",
246
+ bold: "Bold",
247
+ normal: "Normal",
248
+ italic: "Italic",
249
+ none: "None",
250
+ underline: "Underline",
251
+ strikethrough: "Strikethrough",
252
+ both: "Both",
253
+ default: "Default",
254
+ formatGroup: "Style"
255
+ }, U = {
186
256
  mode: {
187
257
  split: "Split view",
188
258
  code: "Code only",
@@ -202,27 +272,27 @@ const s = {
202
272
  desktopView: "Desktop view",
203
273
  mobileView: "Mobile view"
204
274
  }
205
- }, R = {
275
+ }, x = {
206
276
  common: s,
207
277
  samples: d,
208
- inspector: m,
209
- tabs: u,
278
+ inspector: u,
279
+ tabs: m,
210
280
  image: p,
211
281
  video: g,
212
282
  columns: h,
213
- emailLayout: C,
214
- text: w,
215
- button: b,
216
- heading: k,
217
- avatar: v,
218
- divider: S,
219
- container: T,
220
- spacer: f,
221
- html: y,
222
- socials: U,
223
- style: L,
224
- htmlEditor: x
225
- }, M = {
283
+ emailLayout: k,
284
+ text: b,
285
+ button: C,
286
+ heading: y,
287
+ avatar: f,
288
+ divider: v,
289
+ container: S,
290
+ spacer: w,
291
+ html: T,
292
+ socials: L,
293
+ style: R,
294
+ htmlEditor: U
295
+ }, B = {
226
296
  newDocument: "新建空白文档",
227
297
  useBuiltInTemplates: "使用内置模板",
228
298
  emailBuilder: "Monto 邮件编辑器",
@@ -245,7 +315,7 @@ const s = {
245
315
  undoTooltip: "撤销 (Ctrl/Cmd + Z)",
246
316
  redo: "重做",
247
317
  redoTooltip: "重做 (Ctrl/Cmd + Shift + Z)"
248
- }, B = {
318
+ }, M = {
249
319
  welcomeEmail: "营销模板",
250
320
  oneTimePasscode: "一次性密码 (OTP)",
251
321
  resetPassword: "重置密码",
@@ -260,12 +330,12 @@ const s = {
260
330
  inspect: "检查",
261
331
  clickBlockToInspect: "点击一个块进行检查。",
262
332
  blockNotFound: "未找到 id 为 {{id}} 的块。点击一个块以重置。"
263
- }, H = {
333
+ }, P = {
264
334
  edit: "编辑",
265
335
  preview: "预览",
266
336
  htmlOutput: "HTML 输出",
267
337
  jsonOutput: "JSON 输出"
268
- }, z = {
338
+ }, V = {
269
339
  title: "图片块",
270
340
  name: "图片",
271
341
  sourceUrl: "图片地址",
@@ -281,7 +351,7 @@ const s = {
281
351
  uploading: "上传中...",
282
352
  uploadHandlerNotConfigured: "请配置 imageUploadHandler 以启用本地上传功能",
283
353
  placeholder: "添加图片"
284
- }, P = {
354
+ }, I = {
285
355
  title: "视频块",
286
356
  name: "视频",
287
357
  sourceUrl: "视频地址",
@@ -302,7 +372,7 @@ const s = {
302
372
  loop: "循环播放",
303
373
  muted: "静音",
304
374
  controls: "显示控制条"
305
- }, I = {
375
+ }, z = {
306
376
  title: "列块",
307
377
  name: "列容器",
308
378
  layout: "分栏",
@@ -320,7 +390,7 @@ const s = {
320
390
  confirmChangeMessage: "切换分栏布局将删除部分列中的数据,此操作不可撤销。确定要继续吗?",
321
391
  cancel: "取消",
322
392
  confirm: "确定"
323
- }, O = {
393
+ }, E = {
324
394
  global: "全局",
325
395
  backdropColor: "背景颜色",
326
396
  canvasColor: "画布颜色",
@@ -329,12 +399,68 @@ const s = {
329
399
  pageWidth: "页面宽度",
330
400
  fontFamily: "字体",
331
401
  textColor: "文字颜色"
332
- }, $ = {
402
+ }, H = {
333
403
  title: "文本块",
334
404
  name: "文本",
335
405
  content: "内容",
336
- markdown: "Markdown"
337
- }, V = {
406
+ markdown: "Markdown",
407
+ selectionRange: "已选中部分文字",
408
+ selectedSnippet: "选中: {{snippet}}",
409
+ clearSelection: "取消选中",
410
+ link: "链接",
411
+ linkType: "类型",
412
+ linkTypeWeb: "Web",
413
+ linkTypeEmail: "E-mail",
414
+ linkUrl: "URL",
415
+ linkPlaceholderUrl: "请输入 URL",
416
+ linkInvalid: "请输入有效的链接",
417
+ linkTargetBlank: "在新标签页打开",
418
+ editLink: "编辑链接",
419
+ addVariables: "添加变量",
420
+ replaceVariable: "修改变量",
421
+ linkVariables: "变量",
422
+ variables: {
423
+ title: "变量",
424
+ defaultsTitle: "默认值",
425
+ defaultPlaceholder: "输入默认值",
426
+ setDefaultTitle: "设置默认值",
427
+ selectedVariable: "当前变量",
428
+ defaultValueLabel: "默认值",
429
+ defaultRequired: "默认值为必填项",
430
+ back: "返回",
431
+ confirmInsert: "确定插入",
432
+ groupContacts: "联系人",
433
+ groupEmail: "邮件",
434
+ groupOrganization: "组织",
435
+ groupDate: "日期",
436
+ groupLinks: "链接",
437
+ firstName: "名",
438
+ lastName: "姓",
439
+ middleName: "中间名",
440
+ email: "邮件",
441
+ alternativeEmail: "备用邮件",
442
+ company: "发件人公司",
443
+ addressLine1: "发件人地址行1",
444
+ addressLine2: "发件人地址行2",
445
+ country: "发件人国家",
446
+ city: "发件人城市",
447
+ state: "发件人省份",
448
+ postalCode: "发件人邮编",
449
+ recipientCompany: "收件人公司",
450
+ recipientAddressLine1: "收件人地址行1",
451
+ recipientAddressLine2: "收件人地址行2",
452
+ recipientCountry: "收件人国家",
453
+ recipientCity: "收件人城市",
454
+ recipientState: "收件人省份",
455
+ recipientPostalCode: "收件人邮编",
456
+ birthday: "生日",
457
+ currentDate: "今天日期(以收件人收到时为准)",
458
+ currentYear: "今年(以收件人收到时为准)",
459
+ currentMonthName: "本月(以收件人收到时为准)",
460
+ currentWeekday: "今天星期几(以收件人收到时为准)",
461
+ unsubscribeLink: "取消订阅链接"
462
+ }
463
+ }, D = {
338
464
  title: "按钮块",
339
465
  name: "按钮",
340
466
  text: "文本",
@@ -353,12 +479,12 @@ const s = {
353
479
  stylePill: "胶囊",
354
480
  textColor: "文字颜色",
355
481
  buttonColor: "按钮颜色"
356
- }, E = {
482
+ }, N = {
357
483
  title: "标题块",
358
484
  name: "标题",
359
485
  content: "内容",
360
486
  level: "级别"
361
- }, N = {
487
+ }, O = {
362
488
  title: "头像块",
363
489
  size: "尺寸",
364
490
  shape: "形状",
@@ -367,19 +493,19 @@ const s = {
367
493
  shapeRounded: "圆角",
368
494
  imageUrl: "图片地址",
369
495
  altText: "替代文本"
370
- }, F = {
496
+ }, $ = {
371
497
  title: "分割线块",
372
498
  name: "分割线",
373
499
  color: "颜色",
374
500
  height: "高度"
375
- }, J = {
501
+ }, W = {
376
502
  title: "容器块",
377
503
  name: "容器"
378
- }, W = {
504
+ }, F = {
379
505
  title: "间距块",
380
506
  name: "间距",
381
507
  height: "高度"
382
- }, D = {
508
+ }, J = {
383
509
  title: "HTML块",
384
510
  name: "HTML",
385
511
  content: "内容"
@@ -404,8 +530,22 @@ const s = {
404
530
  fontFamily: "字体",
405
531
  fontSize: "字号",
406
532
  fontWeight: "字重",
533
+ fontStyle: "字体样式",
534
+ textDecoration: "文字装饰",
535
+ lineHeight: "行间距",
536
+ letterSpacing: "字间距",
407
537
  alignment: "对齐方式",
408
- padding: "内边距"
538
+ padding: "内边距",
539
+ regular: "常规",
540
+ bold: "粗体",
541
+ normal: "常规",
542
+ italic: "斜体",
543
+ none: "无",
544
+ underline: "下划线",
545
+ strikethrough: "删除线",
546
+ both: "两者",
547
+ default: "默认",
548
+ formatGroup: "样式"
409
549
  }, j = {
410
550
  mode: {
411
551
  split: "左右栏",
@@ -426,44 +566,44 @@ const s = {
426
566
  desktopView: "桌面视图",
427
567
  mobileView: "移动视图"
428
568
  }
429
- }, X = {
430
- common: M,
431
- samples: B,
569
+ }, G = {
570
+ common: B,
571
+ samples: M,
432
572
  inspector: A,
433
- tabs: H,
434
- image: z,
435
- video: P,
436
- columns: I,
437
- emailLayout: O,
438
- text: $,
439
- button: V,
440
- heading: E,
441
- avatar: N,
442
- divider: F,
443
- container: J,
444
- spacer: W,
445
- html: D,
573
+ tabs: P,
574
+ image: V,
575
+ video: I,
576
+ columns: z,
577
+ emailLayout: E,
578
+ text: H,
579
+ button: D,
580
+ heading: N,
581
+ avatar: O,
582
+ divider: $,
583
+ container: W,
584
+ spacer: F,
585
+ html: J,
446
586
  socials: q,
447
587
  style: Z,
448
588
  htmlEditor: j
449
- }, G = {
450
- zh: X,
451
- en: R
589
+ }, X = {
590
+ zh: G,
591
+ en: x
452
592
  };
453
- function Y(e, n, i) {
454
- const a = i ?? Q(), r = e.split(".");
455
- let o = G[a];
456
- for (const t of r)
457
- if (o && typeof o == "object" && t in o)
458
- o = o[t];
593
+ function Q(e, n, l) {
594
+ const a = l ?? Y(), r = e.split(".");
595
+ let t = X[a];
596
+ for (const o of r)
597
+ if (t && typeof t == "object" && o in t)
598
+ t = t[o];
459
599
  else
460
600
  return e;
461
- return typeof o != "string" ? e : n ? o.replace(/\{\{(\w+)\}\}/g, (t, c) => {
462
- var l;
463
- return ((l = n[c]) == null ? void 0 : l.toString()) ?? t;
464
- }) : o;
601
+ return typeof t != "string" ? e : n ? t.replace(/\{\{(\w+)\}\}/g, (o, c) => {
602
+ var i;
603
+ return ((i = n[c]) == null ? void 0 : i.toString()) ?? o;
604
+ }) : t;
465
605
  }
466
- function Q() {
606
+ function Y() {
467
607
  if (typeof window > "u")
468
608
  return "en";
469
609
  const e = localStorage.getItem("app-language");
@@ -473,7 +613,7 @@ function K(e) {
473
613
  typeof window < "u" && localStorage.setItem("app-language", e);
474
614
  }
475
615
  export {
476
- Q as g,
616
+ Y as g,
477
617
  K as s,
478
- Y as t
618
+ Q as t
479
619
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../../../../src/documents/blocks/Text/TextEditor.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAKzD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,SAAS,2CA8KlD"}
1
+ {"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../../../../src/documents/blocks/Text/TextEditor.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,SAAS,EAAuC,MAAM,wBAAwB,CAAC;AA2W9F,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,SAAS,2CAq/BlD"}
@@ -0,0 +1,3 @@
1
+ /** @deprecated 与 TextEditor 合并为 HTML 正文模型,保留别名避免旧路径报错 */
2
+ export { default } from './TextEditor';
3
+ //# sourceMappingURL=TextEditorRich.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextEditorRich.d.ts","sourceRoot":"","sources":["../../../../src/documents/blocks/Text/TextEditorRich.tsx"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,70 @@
1
+ import type { TextProps } from 'monto-email-block-text';
2
+ import type { TStyle } from '../helpers/TStyle';
3
+ export declare function getFlattenedText(root: Node): string;
4
+ export declare function getFlattenedLength(root: Node): number;
5
+ export declare function offsetsToRange(root: HTMLElement, start: number, end: number): Range | null;
6
+ export declare function rangeToOffsets(root: HTMLElement, range: Range): {
7
+ start: number;
8
+ end: number;
9
+ };
10
+ /** focus 后若选区为空或不在 root 内,浏览器常不画 caret;仅在此时把折叠选区落到末尾(与 Heading/Button 编辑器一致) */
11
+ export declare function ensureCaretInContentEditable(root: HTMLElement): void;
12
+ export declare function getParagraphChildren(inner: HTMLElement): HTMLParagraphElement[];
13
+ /** 侧栏传入的增量;global 为块级默认样式,用于首次包 span 时的初始行内表现 */
14
+ export type ApplyInlineStyleInput = {
15
+ patch: Partial<TStyle>;
16
+ global: TextProps['style'] | null | undefined;
17
+ };
18
+ export declare function applyInlineStyleToRange(inner: HTMLElement, start: number, end: number, input: ApplyInlineStyleInput): void;
19
+ export declare function applyLinkToRange(inner: HTMLElement, start: number, end: number, href: string, targetBlank: boolean): void;
20
+ export declare function getLinkAtOffset(inner: HTMLElement, offset: number): {
21
+ href: string;
22
+ targetBlank: boolean;
23
+ } | null;
24
+ export declare function getLinkAtOffsetFromHtmlString(html: string, offset: number): {
25
+ href: string;
26
+ targetBlank: boolean;
27
+ } | null;
28
+ export declare function getLinkInRangeFromHtmlString(html: string, start: number, end: number): {
29
+ href: string;
30
+ targetBlank: boolean;
31
+ } | null;
32
+ export declare function readInlineStyleAtOffsetFromHtmlString(html: string, offset: number): Partial<TStyle>;
33
+ export declare function readInlineStyleInRangeFromHtmlString(html: string, start: number, end: number): Partial<TStyle>;
34
+ export declare function extractVariableNamesFromHtmlString(html: string): string[];
35
+ /** 只识别“插入式变量 span[data-text-variable]”,不识别用户手打的 {{...}} 文本 */
36
+ export declare function extractInsertedVariableNamesFromHtmlString(html: string): string[];
37
+ export type InsertedVariableKind = {
38
+ name: string;
39
+ builtin: boolean;
40
+ instanceId: string;
41
+ };
42
+ export declare function getInsertedVariableAtRangeFromHtmlString(html: string, start: number, end: number): (InsertedVariableKind & {
43
+ token: string;
44
+ }) | null;
45
+ /** 新建插入式变量实例的稳定 id(落库在 span data-variable-instance-id) */
46
+ export declare function createVariableInstanceId(): string;
47
+ /**
48
+ * 为 margin 内每个变量 span 补齐 data-variable-instance-id,并把 variableDefaults 从「按变量名」迁移为「按实例 id」。
49
+ * 旧数据:variableDefaults[middle_name] 会赋给 DOM 中第一个 {{middle_name}} 实例,其余同名实例默认空串。
50
+ */
51
+ export declare function migrateVariableInstanceIdsInMargin(margin: HTMLElement, variableDefaults: Record<string, string> | null | undefined): {
52
+ variableDefaults: Record<string, string>;
53
+ domTouched: boolean;
54
+ };
55
+ /** 每个 span[data-text-variable] 一条,DOM 顺序,不去重(同 token 多次出现会多条) */
56
+ export declare function extractInsertedVariableOccurrencesFromHtmlString(html: string): InsertedVariableKind[];
57
+ /**
58
+ * 插入式变量按 DOM 顺序列出(同一块内去重);含 `{{name}}` 与 `{%name%}`。
59
+ * 去重键优先 instanceId,否则按 builtin+name(无 id 的旧 HTML)。
60
+ */
61
+ export declare function extractInsertedVariablesWithKindFromHtmlString(html: string): InsertedVariableKind[];
62
+ export declare function extractVariableNamesFromText(text: string): string[];
63
+ export declare function extractBuiltinVariableNamesFromText(text: string): string[];
64
+ export declare function isOffsetInsideVariableToken(text: string, offset: number): boolean;
65
+ export declare function readInlineStyleAtOffset(inner: HTMLElement, offset: number): Partial<TStyle>;
66
+ export declare function ensureParagraphStructure(inner: HTMLElement): void;
67
+ /** 复制到剪贴板:去掉 ZWSP,段落无分隔拼接 */
68
+ export declare function getFlattenedTextForCopy(root: Node): string;
69
+ export declare function serializeBodyHtml(marginRoot: HTMLElement): string;
70
+ //# sourceMappingURL=textDom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textDom.d.ts","sourceRoot":"","sources":["../../../../src/documents/blocks/Text/textDom.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAoChD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAQnD;AAED,wBAAgB,kBAA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AA;CAAE,CAwDnE;AAED,iEAAiE;AACjE,wBAAgB,gDAAgD,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,EAAE,CASrG;AAED;;;GAGG;AACH,wBAAgB,8CAA8C,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,EAAE,CAanG;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAUnE;AAED,wBAAgB,mCAAmC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAU1E;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAajF;AA2ED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAsB3F;AAKD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAkBjE;AAED,6BAA6B;AAC7B,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE1D;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,WAAW,GAAG,MAAM,CAQjE"}
@@ -0,0 +1,23 @@
1
+ export type VariableGroupId = 'contacts' | 'email' | 'organization' | 'date' | 'links';
2
+ export type VariableKind = 'user' | 'builtin';
3
+ export type VariableGroup = {
4
+ id: VariableGroupId;
5
+ items: {
6
+ name: string;
7
+ labelKey: string;
8
+ kind: VariableKind;
9
+ }[];
10
+ };
11
+ /** 变量目录(基础内置项)。自定义联系人属性会在 UI 层动态追加。 */
12
+ export declare const BASE_VARIABLE_GROUPS: VariableGroup[];
13
+ export declare function buildAllowedVariableNameSets(args: {
14
+ baseGroups?: VariableGroup[];
15
+ contactAttributes?: {
16
+ AttrField: string;
17
+ Enable?: number | boolean;
18
+ }[] | null;
19
+ }): {
20
+ allowedUser: Set<string>;
21
+ allowedBuiltin: Set<string>;
22
+ };
23
+ //# sourceMappingURL=variableCatalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variableCatalog.d.ts","sourceRoot":"","sources":["../../../../src/documents/blocks/Text/variableCatalog.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,OAAO,GAAG,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;AAEvF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,eAAe,CAAC;IACpB,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,YAAY,CAAA;KAAE,EAAE,CAAC;CACjE,CAAC;AAEF,uCAAuC;AACvC,eAAO,MAAM,oBAAoB,EAAE,aAAa,EAiD/C,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,IAAI,EAAE;IACjD,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;IAC7B,iBAAiB,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,EAAE,GAAG,IAAI,CAAC;CAC/E;;;EAsBA"}
@@ -6,6 +6,10 @@ export type TStyle = {
6
6
  fontFamily?: any;
7
7
  fontSize?: any;
8
8
  fontWeight?: any;
9
+ fontStyle?: any;
10
+ textDecoration?: any;
11
+ lineHeight?: any;
12
+ letterSpacing?: any;
9
13
  padding?: any;
10
14
  textAlign?: any;
11
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TStyle.d.ts","sourceRoot":"","sources":["../../../../src/documents/blocks/helpers/TStyle.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,MAAM,GAAG;IACnB,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,SAAS,CAAC,EAAE,GAAG,CAAC;CACjB,CAAC"}
1
+ {"version":3,"file":"TStyle.d.ts","sourceRoot":"","sources":["../../../../src/documents/blocks/helpers/TStyle.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,MAAM,GAAG;IACnB,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,SAAS,CAAC,EAAE,GAAG,CAAC;CACjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"EditorBlockWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/documents/blocks/helpers/block-wrappers/EditorBlockWrapper.tsx"],"names":[],"mappings":"AASA,KAAK,wBAAwB,GAAG;IAC9B,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE,wBAAwB,2CAwLhF"}
1
+ {"version":3,"file":"EditorBlockWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/documents/blocks/helpers/block-wrappers/EditorBlockWrapper.tsx"],"names":[],"mappings":"AASA,KAAK,wBAAwB,GAAG;IAC9B,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE,wBAAwB,2CAwNhF"}
@@ -1 +1 @@
1
- {"version":3,"file":"TuneMenu.d.ts","sourceRoot":"","sources":["../../../../../src/documents/blocks/helpers/block-wrappers/TuneMenu.tsx"],"names":[],"mappings":"AA6CA,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AACF,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,KAAK,2CAmSlD"}
1
+ {"version":3,"file":"TuneMenu.d.ts","sourceRoot":"","sources":["../../../../../src/documents/blocks/helpers/block-wrappers/TuneMenu.tsx"],"names":[],"mappings":"AAwFA,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AACF,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,KAAK,2CAkWlD"}