@knime/kds-rich-text-editor 6.6.1 → 6.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @knime/kds-rich-text-editor
2
2
 
3
+ ## 6.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [287e612]
8
+ - @knime/kds-styles@6.7.1
9
+ - @knime/kds-components@6.7.1
10
+
11
+ ## 6.7.0
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [c7da181]
16
+ - Updated dependencies [4b7f2d1]
17
+ - Updated dependencies [9fd0c13]
18
+ - @knime/kds-components@6.7.0
19
+ - @knime/utils@2.0.1
20
+ - @knime/kds-styles@6.7.0
21
+
3
22
  ## 6.6.1
4
23
 
5
24
  ### Patch Changes
package/dist/index.js CHANGED
@@ -9,8 +9,8 @@ import Link from "@tiptap/extension-link";
9
9
  import { Plugin, PluginKey } from "@tiptap/pm/state";
10
10
  import TextAlign from "@tiptap/extension-text-align";
11
11
  import Paragraph from "@tiptap/extension-paragraph";
12
- import './index.css';//#region ../../node_modules/.pnpm/dompurify@3.4.12/node_modules/dompurify/dist/purify.es.mjs
13
- /*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */
12
+ import './index.css';//#region ../../node_modules/.pnpm/dompurify@3.4.13/node_modules/dompurify/dist/purify.es.mjs
13
+ /*! @license DOMPurify 3.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/LICENSE */
14
14
  function _arrayLikeToArray(r, a) {
15
15
  (null == a || a > r.length) && (a = r.length);
16
16
  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
@@ -960,7 +960,7 @@ var _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options)
960
960
  function createDOMPurify() {
961
961
  let window = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
962
962
  const DOMPurify = (root) => createDOMPurify(root);
963
- DOMPurify.version = "3.4.12";
963
+ DOMPurify.version = "3.4.13";
964
964
  DOMPurify.removed = [];
965
965
  if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
966
966
  DOMPurify.isSupported = false;
@@ -984,6 +984,7 @@ function createDOMPurify() {
984
984
  const getAttributes = lookupGetter(ElementPrototype, "attributes");
985
985
  const getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, "nodeType") : null;
986
986
  const getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, "nodeName") : null;
987
+ const getOwnerDocument = Node && Node.prototype ? lookupGetter(Node.prototype, "ownerDocument") : null;
987
988
  if (typeof HTMLTemplateElement === "function") {
988
989
  const template = document.createElement("template");
989
990
  if (template.content && template.content.ownerDocument) document = template.content.ownerDocument;
@@ -1624,7 +1625,8 @@ function createDOMPurify() {
1624
1625
  * @return The created NodeIterator
1625
1626
  */
1626
1627
  const _createNodeIterator = function _createNodeIterator(root) {
1627
- return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
1628
+ const doc = getOwnerDocument ? getOwnerDocument(root) : root.ownerDocument;
1629
+ return createNodeIterator.call(doc || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
1628
1630
  };
1629
1631
  /**
1630
1632
  * Replace template expression syntax (mustache, ERB, template
@@ -1662,7 +1664,8 @@ function createDOMPurify() {
1662
1664
  const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {
1663
1665
  var _node$querySelectorAl;
1664
1666
  node.normalize();
1665
- const walker = createNodeIterator.call(node.ownerDocument || node, node, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);
1667
+ const doc = getOwnerDocument ? getOwnerDocument(node) : node.ownerDocument;
1668
+ const walker = createNodeIterator.call(doc || node, node, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);
1666
1669
  let currentNode = walker.nextNode();
1667
1670
  while (currentNode) {
1668
1671
  currentNode.data = _stripTemplateExpressions(currentNode.data);
@@ -1769,7 +1772,7 @@ function createDOMPurify() {
1769
1772
  * @param tagName the node's transformCaseFunc'd tag name
1770
1773
  * @return true if the node was removed, false if kept
1771
1774
  */
1772
- const _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName) {
1775
+ const _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName, root) {
1773
1776
  if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
1774
1777
  if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;
1775
1778
  if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) return false;
@@ -1780,7 +1783,7 @@ function createDOMPurify() {
1780
1783
  if (childNodes && parentNode) {
1781
1784
  const childCount = childNodes.length;
1782
1785
  for (let i = childCount - 1; i >= 0; --i) {
1783
- const hoisted = IN_PLACE ? childNodes[i] : cloneNode(childNodes[i], true);
1786
+ const hoisted = currentNode === root ? cloneNode(childNodes[i], true) : childNodes[i];
1784
1787
  parentNode.insertBefore(hoisted, getNextSibling(currentNode));
1785
1788
  }
1786
1789
  }
@@ -1789,6 +1792,24 @@ function createDOMPurify() {
1789
1792
  return true;
1790
1793
  };
1791
1794
  /**
1795
+ * Fork a hook-mutable allowlist off its shared binding the first time a
1796
+ * (possibly lazily-installed) uponSanitize* hook is about to see it, so the
1797
+ * hook cannot widen the per-instance default or the setConfig binding by
1798
+ * reference and leak past the call. Returns the set unchanged once it is
1799
+ * already call-local, so repeated calls across elements are idempotent.
1800
+ *
1801
+ * @param hookList the uponSanitize* hook array for this event
1802
+ * @param set the current ALLOWED_TAGS / ALLOWED_ATTR binding
1803
+ * @param defaultSet the per-instance DEFAULT_ALLOWED_* constant
1804
+ * @param setConfigSet the captured setConfig() binding, or null
1805
+ * @return a call-local clone if a hook is present and set is still shared,
1806
+ * else set unchanged
1807
+ */
1808
+ const _forkSharedAllowlist = function _forkSharedAllowlist(hookList, set, defaultSet, setConfigSet) {
1809
+ if (hookList.length === 0) return set;
1810
+ return set === defaultSet || set === setConfigSet ? clone(set) : set;
1811
+ };
1812
+ /**
1792
1813
  * _sanitizeElements
1793
1814
  *
1794
1815
  * @protect nodeName
@@ -1799,23 +1820,30 @@ function createDOMPurify() {
1799
1820
  */
1800
1821
  const _sanitizeElements = function _sanitizeElements(currentNode, root) {
1801
1822
  _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
1802
- if (currentNode !== root && getParentNode(currentNode) === null) return true;
1823
+ if (currentNode !== root && getParentNode(currentNode) === null) {
1824
+ if (IN_PLACE) _neutralizeSubtree(currentNode);
1825
+ return true;
1826
+ }
1803
1827
  if (_isClobbered(currentNode)) {
1804
1828
  _forceRemove(currentNode);
1805
1829
  return true;
1806
1830
  }
1807
1831
  const tagName = transformCaseFunc(getNodeName ? getNodeName(currentNode) : currentNode.nodeName);
1832
+ ALLOWED_TAGS = _forkSharedAllowlist(hooks.uponSanitizeElement, ALLOWED_TAGS, DEFAULT_ALLOWED_TAGS, SET_CONFIG_ALLOWED_TAGS);
1808
1833
  _executeHooks(hooks.uponSanitizeElement, currentNode, {
1809
1834
  tagName,
1810
1835
  allowedTags: ALLOWED_TAGS
1811
1836
  });
1812
- if (currentNode !== root && getParentNode(currentNode) === null) return true;
1837
+ if (currentNode !== root && getParentNode(currentNode) === null) {
1838
+ if (IN_PLACE) _neutralizeSubtree(currentNode);
1839
+ return true;
1840
+ }
1813
1841
  if (_isUnsafeNode(currentNode, tagName)) {
1814
1842
  _forceRemove(currentNode);
1815
1843
  return true;
1816
1844
  }
1817
1845
  if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {
1818
- const removed = _sanitizeDisallowedNode(currentNode, tagName);
1846
+ const removed = _sanitizeDisallowedNode(currentNode, tagName, root);
1819
1847
  if (removed === false) _executeHooks(hooks.afterSanitizeElements, currentNode, null);
1820
1848
  return removed;
1821
1849
  }
@@ -1939,6 +1967,7 @@ function createDOMPurify() {
1939
1967
  _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
1940
1968
  const attributes = currentNode.attributes;
1941
1969
  if (!attributes || _isClobbered(currentNode)) return;
1970
+ ALLOWED_ATTR = _forkSharedAllowlist(hooks.uponSanitizeAttribute, ALLOWED_ATTR, DEFAULT_ALLOWED_ATTR, SET_CONFIG_ALLOWED_ATTR);
1942
1971
  const hookEvent = {
1943
1972
  attrName: "",
1944
1973
  attrValue: "",
@@ -2129,8 +2158,8 @@ function createDOMPurify() {
2129
2158
  }
2130
2159
  if (body && FORCE_BODY) _forceRemove(body.firstChild);
2131
2160
  const walkRoot = inPlace ? dirty : body;
2132
- const nodeIterator = _createNodeIterator(walkRoot);
2133
2161
  try {
2162
+ const nodeIterator = _createNodeIterator(walkRoot);
2134
2163
  while (currentNode = nodeIterator.nextNode()) {
2135
2164
  _sanitizeElements(currentNode, walkRoot);
2136
2165
  _sanitizeAttributes(currentNode);