@vonage/vivid 5.29.0 → 5.31.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 (196) hide show
  1. package/accordion/definition.js +1 -2
  2. package/accordion-item/definition.js +1 -2
  3. package/action-group/definition.js +1 -2
  4. package/alert/definition.js +1 -2
  5. package/audio-player/definition.js +1 -2
  6. package/audio-player/index.cjs +1 -1
  7. package/audio-player/index.js +1 -5
  8. package/avatar/definition.js +1 -2
  9. package/badge/definition.js +1 -2
  10. package/banner/definition.js +1 -2
  11. package/banner/index.cjs +1 -1
  12. package/banner/index.js +1 -1
  13. package/breadcrumb/definition.js +1 -2
  14. package/bundled/char-count.cjs +1 -1
  15. package/bundled/char-count.js +1 -1
  16. package/bundled/decorate.js +1 -1
  17. package/bundled/definition12.cjs +2 -1
  18. package/bundled/definition12.js +2 -1
  19. package/bundled/definition16.cjs +1 -1
  20. package/bundled/definition16.js +2 -5
  21. package/bundled/definition19.cjs +2 -2
  22. package/bundled/definition19.js +10 -25
  23. package/bundled/definition21.cjs +1 -1
  24. package/bundled/definition21.js +1 -1
  25. package/bundled/definition25.cjs +4 -4
  26. package/bundled/definition25.js +4 -4
  27. package/bundled/definition5.cjs +1 -1
  28. package/bundled/definition5.js +2 -5
  29. package/bundled/listbox.cjs +1 -1
  30. package/bundled/listbox.js +1 -5
  31. package/bundled/option.cjs +1 -1
  32. package/bundled/option.js +1 -5
  33. package/bundled/repeat.cjs +1 -1
  34. package/bundled/repeat.js +1 -5
  35. package/bundled/single-value-picker.cjs +1 -1
  36. package/bundled/single-value-picker.js +5 -15
  37. package/bundled/slottable-request.cjs +2 -2
  38. package/bundled/slottable-request.js +31 -34
  39. package/bundled/text-field.cjs +1 -1
  40. package/bundled/text-field.js +1 -1
  41. package/bundled/time-selection-picker.template.cjs +1 -1
  42. package/bundled/time-selection-picker.template.js +1 -1
  43. package/bundled/vivid-element.cjs +2 -2
  44. package/bundled/vivid-element.js +42 -38
  45. package/button/definition.js +1 -2
  46. package/calendar/definition.js +1 -2
  47. package/card/definition.js +1 -2
  48. package/checkbox/definition.js +1 -2
  49. package/color-picker/definition.js +1 -2
  50. package/color-picker/index.cjs +1 -1
  51. package/color-picker/index.js +2 -4
  52. package/combobox/definition.js +1 -2
  53. package/combobox/index.cjs +1 -1
  54. package/combobox/index.js +1 -5
  55. package/contextual-help/definition.js +1 -2
  56. package/country/definition.js +1 -2
  57. package/country-group/definition.js +1 -2
  58. package/country-group/index.cjs +1 -1
  59. package/country-group/index.js +1 -5
  60. package/custom-elements.json +4824 -4718
  61. package/data-grid/definition.js +1 -2
  62. package/data-grid/index.cjs +2 -2
  63. package/data-grid/index.js +16 -44
  64. package/date-picker/definition.js +1 -2
  65. package/date-range-picker/definition.js +1 -2
  66. package/date-range-picker/index.cjs +1 -1
  67. package/date-range-picker/index.js +7 -18
  68. package/date-time-picker/definition.js +1 -2
  69. package/dial-pad/definition.js +1 -2
  70. package/dial-pad/index.cjs +1 -1
  71. package/dial-pad/index.js +1 -5
  72. package/dialog/definition.js +1 -2
  73. package/elevation/definition.js +1 -2
  74. package/empty-state/definition.js +1 -2
  75. package/fab/definition.js +1 -2
  76. package/fab/index.cjs +1 -1
  77. package/fab/index.js +2 -5
  78. package/file-picker/definition.js +1 -2
  79. package/file-picker/index.js +1 -0
  80. package/flag/definition.js +1 -2
  81. package/form-field/definition.js +1 -2
  82. package/header/definition.js +1 -2
  83. package/kbd-key/definition.js +1 -2
  84. package/kbd-shortcut/definition.js +1 -2
  85. package/layout/definition.js +1 -2
  86. package/lib/rich-text-editor/rte/feature.d.ts +0 -1
  87. package/lib/rich-text-editor/rte/features/base.d.ts +11 -1
  88. package/lib/rich-text-editor/rte/features/bold.d.ts +5 -1
  89. package/lib/rich-text-editor/rte/features/font-size-picker.d.ts +7 -1
  90. package/lib/rich-text-editor/rte/features/hard-break.d.ts +4 -0
  91. package/lib/rich-text-editor/rte/features/inline-image.d.ts +5 -0
  92. package/lib/rich-text-editor/rte/features/italic.d.ts +5 -1
  93. package/lib/rich-text-editor/rte/features/link.d.ts +5 -1
  94. package/lib/rich-text-editor/rte/features/list.d.ts +6 -0
  95. package/lib/rich-text-editor/rte/features/monospace.d.ts +5 -1
  96. package/lib/rich-text-editor/rte/features/strikethrough.d.ts +5 -1
  97. package/lib/rich-text-editor/rte/features/text-color-picker.d.ts +7 -1
  98. package/lib/rich-text-editor/rte/features/underline.d.ts +5 -1
  99. package/lib/rich-text-editor/rte/public-interface.d.ts +1 -1
  100. package/lib/rich-text-editor/rte/utils/color.d.ts +1 -0
  101. package/lib/rich-text-editor/rte/utils/flatten-slice.d.ts +2 -0
  102. package/lib/rich-text-editor/rte/utils/sanitization.d.ts +2 -0
  103. package/listbox/definition.js +1 -2
  104. package/listbox/index.cjs +1 -1
  105. package/listbox/index.js +3 -7
  106. package/locales/en-US.js +1 -2
  107. package/menu/definition.js +1 -2
  108. package/menu-item/definition.js +1 -2
  109. package/nav/definition.js +1 -2
  110. package/nav-disclosure/definition.js +1 -2
  111. package/nav-item/definition.js +1 -2
  112. package/note/definition.js +1 -2
  113. package/number-field/definition.js +1 -2
  114. package/number-field/index.cjs +1 -1
  115. package/number-field/index.js +1 -1
  116. package/package.json +18 -18
  117. package/pagination/definition.js +1 -2
  118. package/pagination/index.cjs +1 -1
  119. package/pagination/index.js +2 -13
  120. package/platform-switch/definition.js +1 -2
  121. package/platform-switch/index.cjs +1 -1
  122. package/platform-switch/index.js +1 -7
  123. package/popover/definition.js +1 -2
  124. package/popover/index.js +1 -0
  125. package/popup/definition.js +1 -2
  126. package/progress/definition.js +1 -2
  127. package/progress-ring/definition.js +1 -2
  128. package/radio/definition.js +1 -2
  129. package/radio-group/definition.js +1 -2
  130. package/radio-group/index.cjs +13 -2
  131. package/radio-group/index.js +21 -14
  132. package/range-slider/definition.js +1 -2
  133. package/rich-text-editor/definition.js +1 -2
  134. package/rich-text-editor/index.cjs +7 -7
  135. package/rich-text-editor/index.js +2123 -2047
  136. package/rich-text-view/definition.js +1 -2
  137. package/searchable-select/definition.js +1 -2
  138. package/searchable-select/index.cjs +1 -1
  139. package/searchable-select/index.js +4 -24
  140. package/select/definition.js +1 -2
  141. package/selectable-box/definition.js +1 -2
  142. package/selectable-box/index.cjs +1 -1
  143. package/selectable-box/index.js +2 -5
  144. package/shared/foundation/vivid-element/vivid-element.browser-spec.d.ts +1 -0
  145. package/shared/foundation/vivid-element/vivid-element.d.ts +8 -8
  146. package/side-drawer/definition.js +1 -2
  147. package/side-drawer/index.cjs +1 -1
  148. package/side-drawer/index.js +2 -5
  149. package/simple-color-picker/definition.js +1 -2
  150. package/split-button/definition.js +1 -2
  151. package/split-button/index.cjs +1 -1
  152. package/split-button/index.js +4 -10
  153. package/status/definition.js +1 -2
  154. package/styles/fonts/spezia-variable.css +33 -21
  155. package/switch/definition.js +1 -2
  156. package/switch/index.cjs +1 -1
  157. package/switch/index.js +1 -1
  158. package/tab/definition.js +1 -2
  159. package/tab-panel/definition.js +1 -2
  160. package/table/definition.js +1 -2
  161. package/tabs/definition.js +1 -2
  162. package/tag/definition.js +1 -2
  163. package/tag/index.cjs +1 -1
  164. package/tag/index.js +2 -2
  165. package/tag-group/definition.js +1 -2
  166. package/text-area/definition.js +1 -2
  167. package/text-field/definition.js +1 -2
  168. package/toggletip/definition.js +1 -2
  169. package/tooltip/definition.js +1 -2
  170. package/tree-item/definition.js +1 -2
  171. package/tree-view/definition.js +1 -2
  172. package/unbundled/decorate.cjs +1 -1
  173. package/unbundled/decorate.js +1 -1
  174. package/unbundled/definition11.cjs +1 -1
  175. package/unbundled/definition11.js +1 -1
  176. package/unbundled/definition2.cjs +4 -4
  177. package/unbundled/definition2.js +4 -4
  178. package/unbundled/definition55.cjs +1 -1
  179. package/unbundled/definition55.js +1 -1
  180. package/unbundled/definition61.cjs +21 -2
  181. package/unbundled/definition61.js +21 -2
  182. package/unbundled/definition63.cjs +191 -61
  183. package/unbundled/definition63.js +191 -61
  184. package/unbundled/definition72.cjs +1 -0
  185. package/unbundled/definition72.js +1 -0
  186. package/unbundled/definition74.cjs +2 -1
  187. package/unbundled/definition74.js +2 -1
  188. package/unbundled/text-field.cjs +1 -1
  189. package/unbundled/text-field.js +1 -1
  190. package/unbundled/vivid-element.cjs +54 -1
  191. package/unbundled/vivid-element.js +55 -2
  192. package/video-player/definition.js +1 -2
  193. package/video-player/index.cjs +18 -18
  194. package/video-player/index.js +629 -1219
  195. package/visually-hidden/definition.js +1 -2
  196. package/vivid.api.json +13 -13
@@ -466,6 +466,26 @@ var sanitizeLinkHref = (url) => {
466
466
  ...domPurifyConfig
467
467
  }).querySelector("a").getAttribute("href") ?? "";
468
468
  };
469
+ /** Whether a URL is safe to use as an anchor href. */
470
+ var isSafeLinkHref = (url) => sanitizeLinkHref(url) !== "";
471
+ var RELATIVE_HREF_REGEXP = /^(?:[/?#]|\.{1,2}\/)/;
472
+ /**
473
+ * Whether a URL is acceptable as a link href: safe, and either an absolute URL
474
+ * or relative to the current document. Relative hrefs are supported, so this is
475
+ * deliberately weaker than requiring a scheme, but a bare word like "invalid"
476
+ * is still rejected.
477
+ */
478
+ var isValidLinkHref = (url) => {
479
+ const href = url.trim();
480
+ if (!href || !isSafeLinkHref(href)) return false;
481
+ if (RELATIVE_HREF_REGEXP.test(href)) return true;
482
+ try {
483
+ new URL(href);
484
+ return true;
485
+ } catch {
486
+ return false;
487
+ }
488
+ };
469
489
  /**
470
490
  * Sanitize potentially dangerous URLs, like "javascript:", in image src attributes.
471
491
  * Returns empty string if the URL is unsafe.
@@ -914,6 +934,54 @@ var RteConfigImpl = class {
914
934
  }
915
935
  };
916
936
  //#endregion
937
+ //#region src/lib/rich-text-editor/rte/utils/flatten-slice.ts
938
+ /**
939
+ * Splits a fragment into lines of inline content, collapsing all block structure.
940
+ * Each textblock becomes one line; container blocks (e.g. lists) are recursed into.
941
+ * Block nodes which are neither textblocks nor containers have no inline content
942
+ * to contribute and are dropped.
943
+ */
944
+ var linesOfInlineContent = (fragment) => {
945
+ const lines = [];
946
+ let inlineRun;
947
+ fragment.forEach((node) => {
948
+ if (node.isInline) {
949
+ if (!inlineRun) {
950
+ inlineRun = [];
951
+ lines.push(inlineRun);
952
+ }
953
+ inlineRun.push(node);
954
+ return;
955
+ }
956
+ inlineRun = void 0;
957
+ if (node.isTextblock) {
958
+ const inlineChildren = [];
959
+ node.content.forEach((child) => inlineChildren.push(child));
960
+ lines.push(inlineChildren);
961
+ } else lines.push(...linesOfInlineContent(node.content));
962
+ });
963
+ return lines;
964
+ };
965
+ /**
966
+ * Collapses a slice spanning multiple blocks into a single run of inline content,
967
+ * so that it can be inserted into a document which only permits one block.
968
+ *
969
+ * Lines are joined with a hardBreak where the schema has one, preserving the
970
+ * visual line structure. Without hardBreak the schema offers no way to mark a
971
+ * line boundary, so lines are concatenated directly.
972
+ *
973
+ * Slices that already hold a single line are returned unchanged, to keep the
974
+ * original open depths and let ProseMirror insert them as it normally would.
975
+ */
976
+ var flattenSliceToInline = (slice, schema) => {
977
+ const lines = linesOfInlineContent(slice.content);
978
+ if (lines.length <= 1) return slice;
979
+ const hardBreak = schema.nodes.hardBreak;
980
+ const separator = hardBreak ? [hardBreak.create()] : [];
981
+ const inline = lines.flatMap((line, index) => index === 0 ? line : [...separator, ...line]);
982
+ return new prosemirror_model.Slice(prosemirror_model.Fragment.fromArray(inline), 0, 0);
983
+ };
984
+ //#endregion
917
985
  //#region src/lib/rich-text-editor/rte/utils/ui.ts
918
986
  var isPropBinding = (prop) => typeof prop === "function";
919
987
  var on = (event, prop, handler) => [
@@ -1403,6 +1471,14 @@ var RteInputRulesFeatureImpl = class extends require_slottable_request.RteFeatur
1403
1471
  };
1404
1472
  //#endregion
1405
1473
  //#region src/lib/rich-text-editor/rte/features/base.ts
1474
+ var nodeNames$3 = {
1475
+ doc: "doc",
1476
+ text: "text",
1477
+ paragraph: "paragraph",
1478
+ heading1: "heading1",
1479
+ heading2: "heading2",
1480
+ heading3: "heading3"
1481
+ };
1406
1482
  var RteBaseImpl = class extends require_slottable_request.RteFeatureImpl {
1407
1483
  constructor(config) {
1408
1484
  super();
@@ -1411,10 +1487,14 @@ var RteBaseImpl = class extends require_slottable_request.RteFeatureImpl {
1411
1487
  }
1412
1488
  getSchema() {
1413
1489
  return [this.contribution({ nodes: {
1414
- doc: { content: this.config?.singleBlock ? "block" : "block+" },
1415
- text: { group: "inline" }
1490
+ [nodeNames$3.doc]: { content: this.config?.singleBlock ? "block" : "block+" },
1491
+ [nodeNames$3.text]: { group: "inline" }
1416
1492
  } })];
1417
1493
  }
1494
+ getPlugins(_rte) {
1495
+ if (!this.config?.singleBlock) return [];
1496
+ return [this.contribution(new prosemirror_state.Plugin({ props: { transformPasted: (slice, view) => flattenSliceToInline(slice, view.state.schema) } }))];
1497
+ }
1418
1498
  getFeatures() {
1419
1499
  return [
1420
1500
  this,
@@ -1455,7 +1535,7 @@ var RteBaseImpl = class extends require_slottable_request.RteFeatureImpl {
1455
1535
  };
1456
1536
  }
1457
1537
  };
1458
- var RteBase = require_slottable_request.featureFacade(RteBaseImpl);
1538
+ var RteBase = Object.assign(require_slottable_request.featureFacade(RteBaseImpl), { nodes: nodeNames$3 });
1459
1539
  //#endregion
1460
1540
  //#region src/lib/rich-text-editor/rte/features/text-block-picker.ts
1461
1541
  var RteTextBlockPickerFeatureImpl = class extends require_slottable_request.RteFeatureImpl {
@@ -1612,13 +1692,14 @@ var RtePlaceholderFeatureImpl = class extends require_slottable_request.RteFeatu
1612
1692
  var RtePlaceholderFeature = require_slottable_request.featureFacade(RtePlaceholderFeatureImpl);
1613
1693
  //#endregion
1614
1694
  //#region src/lib/rich-text-editor/rte/features/hard-break.ts
1695
+ var nodeNames$2 = { hardBreak: "hardBreak" };
1615
1696
  var RteHardBreakFeatureImpl = class extends require_slottable_request.RteFeatureImpl {
1616
1697
  constructor(..._args) {
1617
1698
  super(..._args);
1618
1699
  this.name = "RteHardBreakFeature";
1619
1700
  }
1620
1701
  getSchema() {
1621
- return [this.contribution({ nodes: { hardBreak: {
1702
+ return [this.contribution({ nodes: { [nodeNames$2.hardBreak]: {
1622
1703
  inline: true,
1623
1704
  group: "inline",
1624
1705
  selectable: false,
@@ -1640,10 +1721,11 @@ var RteHardBreakFeatureImpl = class extends require_slottable_request.RteFeature
1640
1721
  return [this.contribution((0, prosemirror_keymap.keymap)(keyBindings), require_slottable_request.contributionPriority.high)];
1641
1722
  }
1642
1723
  };
1643
- var RteHardBreakFeature = require_slottable_request.featureFacade(RteHardBreakFeatureImpl);
1724
+ var RteHardBreakFeature = Object.assign(require_slottable_request.featureFacade(RteHardBreakFeatureImpl), { nodes: nodeNames$2 });
1644
1725
  //#endregion
1645
1726
  //#region src/lib/rich-text-editor/rte/features/font-size-picker.ts
1646
1727
  var mixedFontSize = Symbol("mixedFontSize");
1728
+ var markNames$7 = { fontSize: "fontSize" };
1647
1729
  var RteFontSizePickerFeatureImpl = class extends require_slottable_request.RteFeatureImpl {
1648
1730
  constructor(config) {
1649
1731
  super();
@@ -1657,20 +1739,23 @@ var RteFontSizePickerFeatureImpl = class extends require_slottable_request.RteFe
1657
1739
  }
1658
1740
  getTextblockMarks() {
1659
1741
  if (this.config?.onBlocks) return this.config.onBlocks.map((block) => this.contribution({
1660
- markName: "fontSize",
1742
+ markName: markNames$7.fontSize,
1661
1743
  onNodeName: block.node
1662
1744
  }));
1663
- return [this.contribution({ markName: "fontSize" })];
1745
+ return [this.contribution({ markName: markNames$7.fontSize })];
1664
1746
  }
1665
1747
  getSchema() {
1666
- return [this.contribution({ marks: { fontSize: {
1748
+ const markSpec = {
1667
1749
  attrs: { size: { validate: "string" } },
1668
1750
  parseDOM: [{
1669
1751
  tag: "span[style*='font-size']",
1670
1752
  getAttrs: (node) => {
1671
1753
  const size = node.getAttribute("style").match(/font-size:\s*([^;]+)/)?.[1]?.trim();
1672
- if (size) return { size };
1673
- return false;
1754
+ if (!size) return false;
1755
+ const parsedSize = this.config?.parseSizeFromHtml ? this.config.parseSizeFromHtml(size) : size;
1756
+ if (parsedSize === null) return false;
1757
+ if (this.config?.restrictToOptions && !this.fontSizes.some((fs) => fs.size === parsedSize)) return false;
1758
+ return { size: parsedSize };
1674
1759
  }
1675
1760
  }],
1676
1761
  toDOM: (mark) => {
@@ -1691,7 +1776,8 @@ var RteFontSizePickerFeatureImpl = class extends require_slottable_request.RteFe
1691
1776
  }
1692
1777
  return null;
1693
1778
  }
1694
- } } })];
1779
+ };
1780
+ return [this.contribution({ marks: { [markNames$7.fontSize]: markSpec } })];
1695
1781
  }
1696
1782
  getPlugins() {
1697
1783
  return [this.contribution((0, prosemirror_keymap.keymap)({
@@ -1776,7 +1862,7 @@ var RteFontSizePickerFeatureImpl = class extends require_slottable_request.RteFe
1776
1862
  };
1777
1863
  }
1778
1864
  };
1779
- var RteFontSizePickerFeature = require_slottable_request.featureFacade(RteFontSizePickerFeatureImpl);
1865
+ var RteFontSizePickerFeature = Object.assign(require_slottable_request.featureFacade(RteFontSizePickerFeatureImpl), { marks: markNames$7 });
1780
1866
  //#endregion
1781
1867
  //#region src/lib/rich-text-editor/rte/features/internal/text-style.ts
1782
1868
  var RteTextStyleFeatureImpl = class extends require_slottable_request.RteFeatureImpl {
@@ -1794,14 +1880,15 @@ var RteTextStyleFeatureImpl = class extends require_slottable_request.RteFeature
1794
1880
  };
1795
1881
  //#endregion
1796
1882
  //#region src/lib/rich-text-editor/rte/features/bold.ts
1883
+ var markNames$6 = { bold: "bold" };
1797
1884
  var RteBoldFeatureImpl = class extends RteTextStyleFeatureImpl {
1798
1885
  constructor(..._args) {
1799
1886
  super(..._args);
1800
1887
  this.name = "RteBoldFeature";
1801
- this.markName = "bold";
1888
+ this.markName = markNames$6.bold;
1802
1889
  }
1803
1890
  getSchema() {
1804
- return [this.contribution({ marks: { bold: prosemirror_schema_basic.marks.strong } })];
1891
+ return [this.contribution({ marks: { [markNames$6.bold]: prosemirror_schema_basic.marks.strong } })];
1805
1892
  }
1806
1893
  getPlugins(rte) {
1807
1894
  return [this.contribution((0, prosemirror_keymap.keymap)({ "Mod-b": (0, prosemirror_commands.toggleMark)(rte.schema.marks.bold) }))];
@@ -1817,17 +1904,18 @@ var RteBoldFeatureImpl = class extends RteTextStyleFeatureImpl {
1817
1904
  }, 1)];
1818
1905
  }
1819
1906
  };
1820
- var RteBoldFeature = require_slottable_request.featureFacade(RteBoldFeatureImpl);
1907
+ var RteBoldFeature = Object.assign(require_slottable_request.featureFacade(RteBoldFeatureImpl), { marks: markNames$6 });
1821
1908
  //#endregion
1822
1909
  //#region src/lib/rich-text-editor/rte/features/italic.ts
1910
+ var markNames$5 = { italic: "italic" };
1823
1911
  var RteItalicFeatureImpl = class extends RteTextStyleFeatureImpl {
1824
1912
  constructor(..._args) {
1825
1913
  super(..._args);
1826
1914
  this.name = "RteItalicFeature";
1827
- this.markName = "italic";
1915
+ this.markName = markNames$5.italic;
1828
1916
  }
1829
1917
  getSchema() {
1830
- return [this.contribution({ marks: { italic: prosemirror_schema_basic.marks.em } })];
1918
+ return [this.contribution({ marks: { [markNames$5.italic]: prosemirror_schema_basic.marks.em } })];
1831
1919
  }
1832
1920
  getPlugins(rte) {
1833
1921
  return [this.contribution((0, prosemirror_keymap.keymap)({ "Mod-i": (0, prosemirror_commands.toggleMark)(rte.schema.marks.italic) }))];
@@ -1843,17 +1931,18 @@ var RteItalicFeatureImpl = class extends RteTextStyleFeatureImpl {
1843
1931
  }, 2)];
1844
1932
  }
1845
1933
  };
1846
- var RteItalicFeature = require_slottable_request.featureFacade(RteItalicFeatureImpl);
1934
+ var RteItalicFeature = Object.assign(require_slottable_request.featureFacade(RteItalicFeatureImpl), { marks: markNames$5 });
1847
1935
  //#endregion
1848
1936
  //#region src/lib/rich-text-editor/rte/features/underline.ts
1937
+ var markNames$4 = { underline: "underline" };
1849
1938
  var RteUnderlineFeatureImpl = class extends RteTextStyleFeatureImpl {
1850
1939
  constructor(..._args) {
1851
1940
  super(..._args);
1852
1941
  this.name = "RteUnderlineFeature";
1853
- this.markName = "underline";
1942
+ this.markName = markNames$4.underline;
1854
1943
  }
1855
1944
  getSchema() {
1856
- return [this.contribution({ marks: { underline: {
1945
+ return [this.contribution({ marks: { [markNames$4.underline]: {
1857
1946
  parseDOM: [{ tag: "u" }],
1858
1947
  toDOM() {
1859
1948
  return ["u", 0];
@@ -1874,17 +1963,18 @@ var RteUnderlineFeatureImpl = class extends RteTextStyleFeatureImpl {
1874
1963
  }, 3)];
1875
1964
  }
1876
1965
  };
1877
- var RteUnderlineFeature = require_slottable_request.featureFacade(RteUnderlineFeatureImpl);
1966
+ var RteUnderlineFeature = Object.assign(require_slottable_request.featureFacade(RteUnderlineFeatureImpl), { marks: markNames$4 });
1878
1967
  //#endregion
1879
1968
  //#region src/lib/rich-text-editor/rte/features/strikethrough.ts
1969
+ var markNames$3 = { strikethrough: "strikethrough" };
1880
1970
  var RteStrikethroughFeatureImpl = class extends RteTextStyleFeatureImpl {
1881
1971
  constructor(..._args) {
1882
1972
  super(..._args);
1883
1973
  this.name = "RteStrikethroughFeature";
1884
- this.markName = "strikethrough";
1974
+ this.markName = markNames$3.strikethrough;
1885
1975
  }
1886
1976
  getSchema() {
1887
- return [this.contribution({ marks: { strikethrough: {
1977
+ return [this.contribution({ marks: { [markNames$3.strikethrough]: {
1888
1978
  parseDOM: [{ tag: "s" }, { tag: "del" }],
1889
1979
  toDOM() {
1890
1980
  return ["s", 0];
@@ -1908,23 +1998,24 @@ var RteStrikethroughFeatureImpl = class extends RteTextStyleFeatureImpl {
1908
1998
  }, 4)];
1909
1999
  }
1910
2000
  };
1911
- var RteStrikethroughFeature = require_slottable_request.featureFacade(RteStrikethroughFeatureImpl);
2001
+ var RteStrikethroughFeature = Object.assign(require_slottable_request.featureFacade(RteStrikethroughFeatureImpl), { marks: markNames$3 });
1912
2002
  //#endregion
1913
2003
  //#region src/lib/rich-text-editor/rte/features/monospace.style.scss?inline
1914
2004
  var monospace_style_default = "tt{font:var(--vvd-typography-base-code);font-variant-ligatures:unset;font-feature-settings:unset;font-size:unset;font-weight:unset;line-height:unset}";
1915
2005
  //#endregion
1916
2006
  //#region src/lib/rich-text-editor/rte/features/monospace.ts
2007
+ var markNames$2 = { monospace: "monospace" };
1917
2008
  var RteMonospaceFeatureImpl = class extends RteTextStyleFeatureImpl {
1918
2009
  constructor(..._args) {
1919
2010
  super(..._args);
1920
2011
  this.name = "RteMonospaceFeature";
1921
- this.markName = "monospace";
2012
+ this.markName = markNames$2.monospace;
1922
2013
  }
1923
2014
  getStyles() {
1924
2015
  return [this.contribution(monospace_style_default)];
1925
2016
  }
1926
2017
  getSchema() {
1927
- return [this.contribution({ marks: { monospace: {
2018
+ return [this.contribution({ marks: { [markNames$2.monospace]: {
1928
2019
  parseDOM: [{ tag: "tt" }, { tag: "code" }],
1929
2020
  toDOM() {
1930
2021
  return ["tt", 0];
@@ -1945,7 +2036,37 @@ var RteMonospaceFeatureImpl = class extends RteTextStyleFeatureImpl {
1945
2036
  }, 5)];
1946
2037
  }
1947
2038
  };
1948
- var RteMonospaceFeature = require_slottable_request.featureFacade(RteMonospaceFeatureImpl);
2039
+ var RteMonospaceFeature = Object.assign(require_slottable_request.featureFacade(RteMonospaceFeatureImpl), { marks: markNames$2 });
2040
+ //#endregion
2041
+ //#region src/lib/rich-text-editor/rte/utils/color.ts
2042
+ /**
2043
+ * Normalizes a CSS color into its canonical CSSOM serialization, so that colors
2044
+ * written in different notations can be compared:
2045
+ *
2046
+ * ```ts
2047
+ * normalizeCssColor('#000'); // -> 'rgb(0, 0, 0)'
2048
+ * normalizeCssColor('rgb(0 0 0 / 50%)'); // -> 'rgba(0, 0, 0, 0.5)'
2049
+ * normalizeCssColor('not-a-color'); // -> null
2050
+ * ```
2051
+ *
2052
+ * Only the notation is canonicalized – nothing is resolved against the document.
2053
+ * Values the CSSOM keeps as-is are returned as-is, which means equal colors do not
2054
+ * necessarily normalize to the same string:
2055
+ *
2056
+ * ```ts
2057
+ * normalizeCssColor('BLACK'); // -> 'black', not 'rgb(0, 0, 0)'
2058
+ * normalizeCssColor('var(--brand)'); // -> 'var(--brand)', never the resolved color
2059
+ * normalizeCssColor('color-mix(in srgb, red, blue)'); // -> 'color-mix(in srgb, red, blue)'
2060
+ * normalizeCssColor('inherit'); // -> 'inherit'
2061
+ * ```
2062
+ *
2063
+ * The exact behavior is browser dependent.
2064
+ */
2065
+ var normalizeCssColor = (color) => {
2066
+ const probe = document.createElement("div");
2067
+ probe.style.color = color;
2068
+ return probe.style.color || null;
2069
+ };
1949
2070
  //#endregion
1950
2071
  //#region src/lib/rich-text-editor/rte/features/text-color-picker.ts
1951
2072
  function markApplies(doc, ranges, type) {
@@ -1962,6 +2083,7 @@ function markApplies(doc, ranges, type) {
1962
2083
  return false;
1963
2084
  }
1964
2085
  var mixedColor = Symbol("mixedColor");
2086
+ var markNames$1 = { textColor: "textColor" };
1965
2087
  var RteTextColorPickerFeatureImpl = class extends require_slottable_request.RteFeatureImpl {
1966
2088
  constructor(config) {
1967
2089
  super();
@@ -1974,24 +2096,25 @@ var RteTextColorPickerFeatureImpl = class extends require_slottable_request.RteF
1974
2096
  }
1975
2097
  getTextblockMarks() {
1976
2098
  if (this.config?.onBlocks) return this.config.onBlocks.map((block) => this.contribution({
1977
- markName: "textColor",
2099
+ markName: markNames$1.textColor,
1978
2100
  onNodeName: block.node
1979
2101
  }));
1980
- return [this.contribution({ markName: "textColor" })];
2102
+ return [this.contribution({ markName: markNames$1.textColor })];
1981
2103
  }
1982
2104
  getSchema() {
1983
- return [this.contribution({ marks: { textColor: {
2105
+ const parseColor = (color) => {
2106
+ const parsedColor = this.config?.parseColorFromHtml ? this.config.parseColorFromHtml(color) : color;
2107
+ if (parsedColor === null) return false;
2108
+ return { color: parsedColor };
2109
+ };
2110
+ return [this.contribution({ marks: { [markNames$1.textColor]: {
1984
2111
  attrs: { color: { validate: "string" } },
1985
2112
  parseDOM: [{
1986
2113
  tag: "span[data-text-color]",
1987
- getAttrs: (dom) => {
1988
- return { color: dom.getAttribute("data-text-color") };
1989
- }
2114
+ getAttrs: (dom) => parseColor(dom.getAttribute("data-text-color"))
1990
2115
  }, {
1991
2116
  style: "color",
1992
- getAttrs: (value) => {
1993
- return { color: value };
1994
- }
2117
+ getAttrs: (value) => parseColor(value)
1995
2118
  }],
1996
2119
  toDOM(node) {
1997
2120
  const { color } = node.attrs;
@@ -2080,7 +2203,16 @@ var RteTextColorPickerFeatureImpl = class extends require_slottable_request.RteF
2080
2203
  };
2081
2204
  }
2082
2205
  };
2083
- var RteTextColorPickerFeature = require_slottable_request.featureFacade(RteTextColorPickerFeatureImpl);
2206
+ var RteTextColorPickerFeature = Object.assign(require_slottable_request.featureFacade(RteTextColorPickerFeatureImpl), {
2207
+ marks: markNames$1,
2208
+ /**
2209
+ * Normalizes a CSS color into its canonical CSSOM serialization, so that
2210
+ * colors written in different notations can be compared. Nothing is resolved
2211
+ * against the document, so values such as `var(--brand)` or `inherit` are
2212
+ * returned unchanged. Returns `null` if the value is not a valid CSS color.
2213
+ */
2214
+ normalizeCssColor
2215
+ });
2084
2216
  //#endregion
2085
2217
  //#region src/lib/rich-text-editor/rte/features/list.style.scss?inline
2086
2218
  var list_style_default = ".rich-text ul,.rich-text ol{padding-inline-start:1.5em}.rich-text li{list-style-position:inside}";
@@ -2167,6 +2299,11 @@ var sinkLi = (listType, $li, tr) => {
2167
2299
  var sinkNode = (rte, listType, $node, tr) => {
2168
2300
  tr.step(new prosemirror_transform.ReplaceAroundStep($node.before(), $node.after(), $node.start(), $node.end(), new prosemirror_model.Slice(prosemirror_model.Fragment.from(listType.create(null, [rte.schema.nodes.listItem.create(rte.textblockAttrs.extractFromNode($node.parent))])), 0, 0), 2));
2169
2301
  };
2302
+ var nodeNames$1 = {
2303
+ listItem: "listItem",
2304
+ bulletList: "bulletList",
2305
+ numberedList: "numberedList"
2306
+ };
2170
2307
  var RteListFeatureImpl = class extends require_slottable_request.RteFeatureImpl {
2171
2308
  constructor(config) {
2172
2309
  super();
@@ -2179,7 +2316,7 @@ var RteListFeatureImpl = class extends require_slottable_request.RteFeatureImpl
2179
2316
  }
2180
2317
  getSchema(textblockAttrs) {
2181
2318
  return [this.contribution({ nodes: {
2182
- listItem: {
2319
+ [nodeNames$1.listItem]: {
2183
2320
  content: "inline*",
2184
2321
  attrs: textblockAttrs.attrs,
2185
2322
  defining: true,
@@ -2195,7 +2332,7 @@ var RteListFeatureImpl = class extends require_slottable_request.RteFeatureImpl
2195
2332
  ];
2196
2333
  }
2197
2334
  },
2198
- ...this.config.bulletList ? { bulletList: {
2335
+ ...this.config.bulletList ? { [nodeNames$1.bulletList]: {
2199
2336
  group: "block list",
2200
2337
  content: "(listItem | list)+",
2201
2338
  parseDOM: [{ tag: "ul" }],
@@ -2203,7 +2340,7 @@ var RteListFeatureImpl = class extends require_slottable_request.RteFeatureImpl
2203
2340
  return ["ul", 0];
2204
2341
  }
2205
2342
  } } : {},
2206
- ...this.config.numberedList ? { numberedList: {
2343
+ ...this.config.numberedList ? { [nodeNames$1.numberedList]: {
2207
2344
  group: "block list",
2208
2345
  content: "(listItem | list)+",
2209
2346
  parseDOM: [{ tag: "ol" }],
@@ -2333,7 +2470,7 @@ var RteListFeatureImpl = class extends require_slottable_request.RteFeatureImpl
2333
2470
  else return false;
2334
2471
  }
2335
2472
  };
2336
- var RteListFeature = require_slottable_request.featureFacade(RteListFeatureImpl);
2473
+ var RteListFeature = Object.assign(require_slottable_request.featureFacade(RteListFeatureImpl), { nodes: nodeNames$1 });
2337
2474
  //#endregion
2338
2475
  //#region src/lib/rich-text-editor/rte/features/alignment.ts
2339
2476
  var alignments = [
@@ -2460,6 +2597,7 @@ function convertToLink(state, matchedText, start, end) {
2460
2597
  if (trailingChars) tr.replaceWith(linkEnd, end, state.schema.text(trailingChars));
2461
2598
  return tr;
2462
2599
  }
2600
+ var markNames = { link: "link" };
2463
2601
  var RteLinkFeatureImpl = class extends require_slottable_request.RteFeatureImpl {
2464
2602
  constructor(..._args) {
2465
2603
  super(..._args);
@@ -2476,7 +2614,7 @@ var RteLinkFeatureImpl = class extends require_slottable_request.RteFeatureImpl
2476
2614
  return [this.contribution(link_style_default)];
2477
2615
  }
2478
2616
  getSchema() {
2479
- return [this.contribution({ marks: { link: {
2617
+ return [this.contribution({ marks: { [markNames.link]: {
2480
2618
  attrs: { href: { validate: "string" } },
2481
2619
  inclusive: false,
2482
2620
  parseDOM: [{
@@ -2496,7 +2634,7 @@ var RteLinkFeatureImpl = class extends require_slottable_request.RteFeatureImpl
2496
2634
  } } }, require_slottable_request.contributionPriority.high)];
2497
2635
  }
2498
2636
  getTextblockMarks() {
2499
- return [this.contribution({ markName: "link" })];
2637
+ return [this.contribution({ markName: markNames.link })];
2500
2638
  }
2501
2639
  getInputRules() {
2502
2640
  const linkRegex = new RegExp(`${linkPattern}$`);
@@ -2610,14 +2748,6 @@ var RteLinkFeatureImpl = class extends require_slottable_request.RteFeatureImpl
2610
2748
  if (from === to) return "";
2611
2749
  return state.doc.textBetween(from, to, " ");
2612
2750
  };
2613
- const isValidUrl = (url) => {
2614
- try {
2615
- new URL(url);
2616
- return true;
2617
- } catch {
2618
- return false;
2619
- }
2620
- };
2621
2751
  return [this.contribution({
2622
2752
  section: "insert",
2623
2753
  render: (ctx) => {
@@ -2642,13 +2772,11 @@ var RteLinkFeatureImpl = class extends require_slottable_request.RteFeatureImpl
2642
2772
  updateValidation();
2643
2773
  }
2644
2774
  });
2775
+ const isApplyDisabled = () => !(textField.value.length && isValidLinkHref(urlField.value));
2645
2776
  const applyButton = createButton(ctx, {
2646
2777
  label: () => ctx.rte.getLocale().richTextEditor.apply,
2647
2778
  variant: "popover-primary",
2648
- disabled: () => {
2649
- const link = this.getCurrentLink(ctx.view.state);
2650
- return !(link && link.text.length && isValidUrl(link.href));
2651
- },
2779
+ disabled: isApplyDisabled,
2652
2780
  onClick: () => {
2653
2781
  const { state, dispatch } = ctx.view;
2654
2782
  this.insertLink(rte, urlField.value, textField.value)(state, dispatch);
@@ -2656,7 +2784,7 @@ var RteLinkFeatureImpl = class extends require_slottable_request.RteFeatureImpl
2656
2784
  }
2657
2785
  });
2658
2786
  const updateValidation = () => {
2659
- applyButton.querySelector("[data-vvd-component=\"button\"]").disabled = !(textField.value.length && isValidUrl(urlField.value));
2787
+ applyButton.querySelector("[data-vvd-component=\"button\"]").disabled = isApplyDisabled();
2660
2788
  };
2661
2789
  const menu = createMenu(ctx, {
2662
2790
  label: () => ctx.rte.getLocale().richTextEditor.hyperlink,
@@ -2739,7 +2867,7 @@ var RteLinkFeatureImpl = class extends require_slottable_request.RteFeatureImpl
2739
2867
  };
2740
2868
  }
2741
2869
  };
2742
- var RteLinkFeature = require_slottable_request.featureFacade(RteLinkFeatureImpl);
2870
+ var RteLinkFeature = Object.assign(require_slottable_request.featureFacade(RteLinkFeatureImpl), { marks: markNames });
2743
2871
  //#endregion
2744
2872
  //#region src/lib/rich-text-editor/rte/features/inline-image.style.scss?inline
2745
2873
  var inline_image_style_default = ".inline-image-wrapper{vertical-align:text-bottom;display:inline-block}.inline-image{block-size:auto;display:block}.inline-image-popover{align-items:center;gap:4px;padding:8px;display:flex}.inline-image-placeholder{color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base);font-feature-settings:normal;font-variant-ligatures:normal;overflow-wrap:normal;pointer-events:none;white-space:normal}";
@@ -2830,6 +2958,7 @@ var InlineImageView = class {
2830
2958
  this.setContent(null);
2831
2959
  }
2832
2960
  };
2961
+ var nodeNames = { inlineImage: "inlineImage" };
2833
2962
  var RteInlineImageFeatureImpl = class extends require_slottable_request.RteFeatureImpl {
2834
2963
  constructor(config = {}) {
2835
2964
  super();
@@ -2840,7 +2969,7 @@ var RteInlineImageFeatureImpl = class extends require_slottable_request.RteFeatu
2840
2969
  return [this.contribution(inline_image_style_default)];
2841
2970
  }
2842
2971
  getSchema() {
2843
- return [this.contribution({ nodes: { inlineImage: {
2972
+ const inlineImage = {
2844
2973
  inline: true,
2845
2974
  group: "inline",
2846
2975
  selectable: true,
@@ -2877,7 +3006,7 @@ var RteInlineImageFeatureImpl = class extends require_slottable_request.RteFeatu
2877
3006
  return {
2878
3007
  imageUrl,
2879
3008
  alt: dom.getAttribute("alt") || "",
2880
- size: dom.style.maxWidth || null,
3009
+ size: this.config.parseSizeFromHtml ? this.config.parseSizeFromHtml(dom) : dom.style.maxWidth || null,
2881
3010
  naturalWidth: parseDimension(dom.getAttribute("width")),
2882
3011
  naturalHeight: parseDimension(dom.getAttribute("height"))
2883
3012
  };
@@ -2898,7 +3027,8 @@ var RteInlineImageFeatureImpl = class extends require_slottable_request.RteFeatu
2898
3027
  if (naturalHeight) attrs.height = naturalHeight;
2899
3028
  return ["img", attrs];
2900
3029
  }
2901
- } } })];
3030
+ };
3031
+ return [this.contribution({ nodes: { [nodeNames.inlineImage]: inlineImage } })];
2902
3032
  }
2903
3033
  getPlugins(rte) {
2904
3034
  let popover;
@@ -3003,7 +3133,7 @@ var RteInlineImageFeatureImpl = class extends require_slottable_request.RteFeatu
3003
3133
  return null;
3004
3134
  }
3005
3135
  };
3006
- var RteInlineImageFeature = require_slottable_request.featureFacade(RteInlineImageFeatureImpl);
3136
+ var RteInlineImageFeature = Object.assign(require_slottable_request.featureFacade(RteInlineImageFeatureImpl), { nodes: nodeNames });
3007
3137
  //#endregion
3008
3138
  //#region src/shared/utils/promise.ts
3009
3139
  var resolvePromise = async (promise) => {