@sps-woodland/rich-text-editor 8.10.3 → 8.11.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 (2) hide show
  1. package/lib/index.es.js +93 -69
  2. package/package.json +9 -9
package/lib/index.es.js CHANGED
@@ -1356,7 +1356,8 @@ function W0(e, t) {
1356
1356
  r = 2;
1357
1357
  break;
1358
1358
  }
1359
- } else i.type === "labelEnd" && (o = n);
1359
+ } else
1360
+ i.type === "labelEnd" && (o = n);
1360
1361
  const c = {
1361
1362
  type: e[s][1].type === "labelLink" ? "link" : "image",
1362
1363
  start: Object.assign({}, e[s][1].start),
@@ -1825,7 +1826,8 @@ function Cc(e, t) {
1825
1826
  if (typeof u == "string") {
1826
1827
  for (o = u.length; u.charCodeAt(o - 1) === 32; )
1827
1828
  a++, o--;
1828
- if (o) break;
1829
+ if (o)
1830
+ break;
1829
1831
  o = -1;
1830
1832
  } else if (u === -2)
1831
1833
  c = !0, a++;
@@ -2058,7 +2060,8 @@ function xc(e, t) {
2058
2060
  break;
2059
2061
  }
2060
2062
  case -1: {
2061
- if (!t && i) continue;
2063
+ if (!t && i)
2064
+ continue;
2062
2065
  o = " ";
2063
2066
  break;
2064
2067
  }
@@ -2176,7 +2179,8 @@ function Fc() {
2176
2179
  break;
2177
2180
  }
2178
2181
  case 9: {
2179
- for (f = Math.ceil(e / 4) * 4, c.push(-2); e++ < f; ) c.push(-1);
2182
+ for (f = Math.ceil(e / 4) * 4, c.push(-2); e++ < f; )
2183
+ c.push(-1);
2180
2184
  break;
2181
2185
  }
2182
2186
  case 10: {
@@ -2424,9 +2428,11 @@ function Gc(e) {
2424
2428
  for (tt = void 0; Ln--; ) {
2425
2429
  const nt = _[Ln];
2426
2430
  if (nt[1].type === "lineEnding" || nt[1].type === "lineEndingBlank") {
2427
- if (nt[0] === "exit") continue;
2431
+ if (nt[0] === "exit")
2432
+ continue;
2428
2433
  tt && (_[tt][1].type = "lineEndingBlank", ve = !0), nt[1].type = "lineEnding", tt = Ln;
2429
- } else if (!(nt[1].type === "linePrefix" || nt[1].type === "blockQuotePrefix" || nt[1].type === "blockQuotePrefixWhitespace" || nt[1].type === "blockQuoteMarker" || nt[1].type === "listItemIndent")) break;
2434
+ } else if (!(nt[1].type === "linePrefix" || nt[1].type === "blockQuotePrefix" || nt[1].type === "blockQuotePrefixWhitespace" || nt[1].type === "blockQuoteMarker" || nt[1].type === "listItemIndent"))
2435
+ break;
2430
2436
  }
2431
2437
  e1 && (!tt || e1 < tt) && (ht._spread = !0), ht.end = Object.assign(
2432
2438
  {},
@@ -2477,12 +2483,13 @@ function Gc(e) {
2477
2483
  const H = this.stack.pop(), Z = this.tokenStack.pop();
2478
2484
  if (Z)
2479
2485
  Z[0].type !== _.type && (y ? y.call(this, _, Z[0]) : (Z[1] || Ti).call(this, _, Z[0]));
2480
- else throw new Error(
2481
- "Cannot close `" + _.type + "` (" + d1({
2482
- start: _.start,
2483
- end: _.end
2484
- }) + "): it’s not open"
2485
- );
2486
+ else
2487
+ throw new Error(
2488
+ "Cannot close `" + _.type + "` (" + d1({
2489
+ start: _.start,
2490
+ end: _.end
2491
+ }) + "): it’s not open"
2492
+ );
2486
2493
  return H.position.end = mt(_.end), H;
2487
2494
  }
2488
2495
  function g() {
@@ -2919,7 +2926,8 @@ function Bo(e, t) {
2919
2926
  function Qc(e, t) {
2920
2927
  const n = e.footnoteById;
2921
2928
  let r = 1;
2922
- for (; r in n; ) r++;
2929
+ for (; r in n; )
2930
+ r++;
2923
2931
  const i = String(r);
2924
2932
  return n[i] = {
2925
2933
  type: "footnoteDefinition",
@@ -3266,7 +3274,8 @@ function Eu(e) {
3266
3274
  function r(...i) {
3267
3275
  let s = -1;
3268
3276
  for (; ++s < t.length; )
3269
- if (t[s].call(this, ...i)) return !0;
3277
+ if (t[s].call(this, ...i))
3278
+ return !0;
3270
3279
  return !1;
3271
3280
  }
3272
3281
  }
@@ -3275,7 +3284,8 @@ function gu(e) {
3275
3284
  function t(n) {
3276
3285
  let r;
3277
3286
  for (r in e)
3278
- if (n[r] !== e[r]) return !1;
3287
+ if (n[r] !== e[r])
3288
+ return !1;
3279
3289
  return !0;
3280
3290
  }
3281
3291
  }
@@ -5702,7 +5712,8 @@ function H9(e) {
5702
5712
  for (; ++r < t.length; ) {
5703
5713
  const i = t[r];
5704
5714
  if (i.type === "element" && (i.tagName === "title" || i.tagName === "base")) {
5705
- if (n.includes(i.tagName)) return !1;
5715
+ if (n.includes(i.tagName))
5716
+ return !1;
5706
5717
  n.push(i.tagName);
5707
5718
  }
5708
5719
  }
@@ -5927,7 +5938,8 @@ var W1 = Object.prototype.hasOwnProperty, ua = Object.prototype.toString, Di = O
5927
5938
  if (W1.call(t, n)) {
5928
5939
  if (Fi)
5929
5940
  return Fi(t, n).value;
5930
- } else return;
5941
+ } else
5942
+ return;
5931
5943
  return t[n];
5932
5944
  }, e5 = function e() {
5933
5945
  var t, n, r, i, s, o, a = arguments[0], c = 1, u = arguments.length, f = !1;
@@ -6058,7 +6070,8 @@ function r5(e, t) {
6058
6070
  n = i + 1;
6059
6071
  break;
6060
6072
  }
6061
- } else r < 0 && (s = !0, r = i + 1);
6073
+ } else
6074
+ r < 0 && (s = !0, r = i + 1);
6062
6075
  return r < 0 ? "" : e.slice(n, r);
6063
6076
  }
6064
6077
  if (t === e)
@@ -6084,7 +6097,8 @@ function i5(e) {
6084
6097
  t = n;
6085
6098
  break;
6086
6099
  }
6087
- } else r || (r = !0);
6100
+ } else
6101
+ r || (r = !0);
6088
6102
  return t < 0 ? e.charCodeAt(0) === 47 ? "/" : "." : t === 1 && e.charCodeAt(0) === 47 ? "//" : e.slice(0, t);
6089
6103
  }
6090
6104
  function s5(e) {
@@ -6128,23 +6142,25 @@ function l5(e, t) {
6128
6142
  a = 47;
6129
6143
  }
6130
6144
  if (a === 47) {
6131
- if (!(i === o - 1 || s === 1)) if (i !== o - 1 && s === 2) {
6132
- if (n.length < 2 || r !== 2 || n.charCodeAt(n.length - 1) !== 46 || n.charCodeAt(n.length - 2) !== 46) {
6133
- if (n.length > 2) {
6134
- if (c = n.lastIndexOf("/"), c !== n.length - 1) {
6135
- c < 0 ? (n = "", r = 0) : (n = n.slice(0, c), r = n.length - 1 - n.lastIndexOf("/")), i = o, s = 0;
6145
+ if (!(i === o - 1 || s === 1))
6146
+ if (i !== o - 1 && s === 2) {
6147
+ if (n.length < 2 || r !== 2 || n.charCodeAt(n.length - 1) !== 46 || n.charCodeAt(n.length - 2) !== 46) {
6148
+ if (n.length > 2) {
6149
+ if (c = n.lastIndexOf("/"), c !== n.length - 1) {
6150
+ c < 0 ? (n = "", r = 0) : (n = n.slice(0, c), r = n.length - 1 - n.lastIndexOf("/")), i = o, s = 0;
6151
+ continue;
6152
+ }
6153
+ } else if (n.length > 0) {
6154
+ n = "", r = 0, i = o, s = 0;
6136
6155
  continue;
6137
6156
  }
6138
- } else if (n.length > 0) {
6139
- n = "", r = 0, i = o, s = 0;
6140
- continue;
6141
6157
  }
6142
- }
6143
- t && (n = n.length > 0 ? n + "/.." : "..", r = 2);
6144
- } else
6145
- n.length > 0 ? n += "/" + e.slice(i + 1, o) : n = e.slice(i + 1, o), r = o - i - 1;
6158
+ t && (n = n.length > 0 ? n + "/.." : "..", r = 2);
6159
+ } else
6160
+ n.length > 0 ? n += "/" + e.slice(i + 1, o) : n = e.slice(i + 1, o), r = o - i - 1;
6146
6161
  i = o, s = 0;
6147
- } else a === 46 && s > -1 ? s++ : s = -1;
6162
+ } else
6163
+ a === 46 && s > -1 ? s++ : s = -1;
6148
6164
  }
6149
6165
  return n;
6150
6166
  }
@@ -6447,12 +6463,13 @@ function ma() {
6447
6463
  }
6448
6464
  function c(S, ...R) {
6449
6465
  let N;
6450
- if (Gn("use", r), S != null) if (typeof S == "function")
6451
- z(S, ...R);
6452
- else if (typeof S == "object")
6453
- Array.isArray(S) ? G(S) : L(S);
6454
- else
6455
- throw new TypeError("Expected usable value, not `" + S + "`");
6466
+ if (Gn("use", r), S != null)
6467
+ if (typeof S == "function")
6468
+ z(S, ...R);
6469
+ else if (typeof S == "object")
6470
+ Array.isArray(S) ? G(S) : L(S);
6471
+ else
6472
+ throw new TypeError("Expected usable value, not `" + S + "`");
6456
6473
  return N && (n.settings = Object.assign(n.settings || {}, N)), s;
6457
6474
  function U(A) {
6458
6475
  if (typeof A == "function")
@@ -6471,13 +6488,14 @@ function ma() {
6471
6488
  }
6472
6489
  function G(A) {
6473
6490
  let D = -1;
6474
- if (A != null) if (Array.isArray(A))
6475
- for (; ++D < A.length; ) {
6476
- const Y = A[D];
6477
- U(Y);
6478
- }
6479
- else
6480
- throw new TypeError("Expected a list of plugins, not `" + A + "`");
6491
+ if (A != null)
6492
+ if (Array.isArray(A))
6493
+ for (; ++D < A.length; ) {
6494
+ const Y = A[D];
6495
+ U(Y);
6496
+ }
6497
+ else
6498
+ throw new TypeError("Expected a list of plugins, not `" + A + "`");
6481
6499
  }
6482
6500
  function z(A, D) {
6483
6501
  let Y = -1, W;
@@ -10024,7 +10042,8 @@ function Ba(e, t) {
10024
10042
  if (n === l.OPTGROUP) {
10025
10043
  const r = e.openElements.items[e.openElements.stackTop - 1], i = r && e.treeAdapter.getTagName(r);
10026
10044
  e.openElements.currentTagName === l.OPTION && i === l.OPTGROUP && e.openElements.pop(), e.openElements.currentTagName === l.OPTGROUP && e.openElements.pop();
10027
- } else n === l.OPTION ? e.openElements.currentTagName === l.OPTION && e.openElements.pop() : n === l.SELECT && e.openElements.hasInSelectScope(l.SELECT) ? (e.openElements.popUntilTagNamePopped(l.SELECT), e._resetInsertionMode()) : n === l.TEMPLATE && wt(e, t);
10045
+ } else
10046
+ n === l.OPTION ? e.openElements.currentTagName === l.OPTION && e.openElements.pop() : n === l.SELECT && e.openElements.hasInSelectScope(l.SELECT) ? (e.openElements.popUntilTagNamePopped(l.SELECT), e._resetInsertionMode()) : n === l.TEMPLATE && wt(e, t);
10028
10047
  }
10029
10048
  function Zf(e, t) {
10030
10049
  const n = t.tagName;
@@ -10172,9 +10191,11 @@ function g4(e, t, n, r) {
10172
10191
  let s = -1, o;
10173
10192
  if (r != null) {
10174
10193
  if (typeof r == "number") {
10175
- if (Number.isNaN(r)) return;
10194
+ if (Number.isNaN(r))
10195
+ return;
10176
10196
  o = r;
10177
- } else typeof r == "boolean" ? o = r : typeof r == "string" ? i.spaceSeparated ? o = bi(r) : i.commaSeparated ? o = ki(r) : i.commaOrSpaceSeparated ? o = bi(ki(r).join(" ")) : o = no(i, i.property, r) : Array.isArray(r) ? o = r.concat() : o = i.property === "style" ? A4(r) : String(r);
10197
+ } else
10198
+ typeof r == "boolean" ? o = r : typeof r == "string" ? i.spaceSeparated ? o = bi(r) : i.commaSeparated ? o = ki(r) : i.commaOrSpaceSeparated ? o = bi(ki(r).join(" ")) : o = no(i, i.property, r) : Array.isArray(r) ? o = r.concat() : o = i.property === "style" ? A4(r) : String(r);
10178
10199
  if (Array.isArray(o)) {
10179
10200
  const a = [];
10180
10201
  for (; ++s < o.length; )
@@ -10186,15 +10207,16 @@ function g4(e, t, n, r) {
10186
10207
  }
10187
10208
  function Er(e, t) {
10188
10209
  let n = -1;
10189
- if (t != null) if (typeof t == "string" || typeof t == "number")
10190
- e.push({ type: "text", value: String(t) });
10191
- else if (Array.isArray(t))
10192
- for (; ++n < t.length; )
10193
- Er(e, t[n]);
10194
- else if (typeof t == "object" && "type" in t)
10195
- t.type === "root" ? Er(e, t.children) : e.push(t);
10196
- else
10197
- throw new Error("Expected node, nodes, or string, got `" + t + "`");
10210
+ if (t != null)
10211
+ if (typeof t == "string" || typeof t == "number")
10212
+ e.push({ type: "text", value: String(t) });
10213
+ else if (Array.isArray(t))
10214
+ for (; ++n < t.length; )
10215
+ Er(e, t[n]);
10216
+ else if (typeof t == "object" && "type" in t)
10217
+ t.type === "root" ? Er(e, t.children) : e.push(t);
10218
+ else
10219
+ throw new Error("Expected node, nodes, or string, got `" + t + "`");
10198
10220
  }
10199
10221
  function no(e, t, n) {
10200
10222
  if (typeof n == "string") {
@@ -11092,7 +11114,8 @@ function Qa(e, t, n) {
11092
11114
  if (t.properties && t.properties.dataMdast === "ignore")
11093
11115
  return;
11094
11116
  mn.call(e.handlers, t.tagName) && (r = e.handlers[t.tagName]);
11095
- } else mn.call(e.handlers, t.type) && (r = e.handlers[t.type]);
11117
+ } else
11118
+ mn.call(e.handlers, t.type) && (r = e.handlers[t.type]);
11096
11119
  return typeof r == "function" ? r(e, t, n) : W4(e, t);
11097
11120
  }
11098
11121
  function W4(e, t) {
@@ -13144,18 +13167,19 @@ function n3(e) {
13144
13167
  const f = i.getCommandArg ? i.getCommandArg(s) : void 0;
13145
13168
  document.execCommand(i.command, void 0, f), a && (qr(r.target.parentNode), document.execCommand(i.command));
13146
13169
  }
13147
- } else r.type === "childList" && Array.from(r.addedNodes).forEach((i) => {
13148
- var o, a;
13149
- let s;
13150
- if (i instanceof HTMLElement && i.tagName === "LI" ? s = i : ((o = i == null ? void 0 : i.parentElement) == null ? void 0 : o.tagName) === "LI" && (s = i == null ? void 0 : i.parentElement), s) {
13151
- const c = s.nextElementSibling, u = (a = c == null ? void 0 : c.childNodes) == null ? void 0 : a[0];
13152
- if (u instanceof HTMLElement && ["UL", "OL"].includes(u.tagName)) {
13153
- const h = document.createElement("br");
13154
- c.insertBefore(h, u), t3(h);
13170
+ } else
13171
+ r.type === "childList" && Array.from(r.addedNodes).forEach((i) => {
13172
+ var o, a;
13173
+ let s;
13174
+ if (i instanceof HTMLElement && i.tagName === "LI" ? s = i : ((o = i == null ? void 0 : i.parentElement) == null ? void 0 : o.tagName) === "LI" && (s = i == null ? void 0 : i.parentElement), s) {
13175
+ const c = s.nextElementSibling, u = (a = c == null ? void 0 : c.childNodes) == null ? void 0 : a[0];
13176
+ if (u instanceof HTMLElement && ["UL", "OL"].includes(u.tagName)) {
13177
+ const h = document.createElement("br");
13178
+ c.insertBefore(h, u), t3(h);
13179
+ }
13155
13180
  }
13156
- }
13157
- Z8(i);
13158
- });
13181
+ Z8(i);
13182
+ });
13159
13183
  e(t);
13160
13184
  }), []);
13161
13185
  return sn(() => () => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sps-woodland/rich-text-editor",
3
3
  "description": "SPS Design System rich text editor component",
4
- "version": "8.10.3",
4
+ "version": "8.11.0",
5
5
  "author": "SPS Commerce",
6
6
  "license": "UNLICENSED",
7
7
  "repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/rich-text-editor",
@@ -29,10 +29,10 @@
29
29
  "@spscommerce/utils": "^7.0.0",
30
30
  "react": "^16.14.0",
31
31
  "react-dom": "^16.14.0",
32
- "@sps-woodland/buttons": "8.10.3",
33
- "@sps-woodland/core": "8.10.3",
34
- "@sps-woodland/tokens": "8.10.3",
35
- "@spscommerce/ds-react": "8.10.3"
32
+ "@sps-woodland/buttons": "8.11.0",
33
+ "@sps-woodland/core": "8.11.0",
34
+ "@sps-woodland/tokens": "8.11.0",
35
+ "@spscommerce/ds-react": "8.11.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@spscommerce/utils": "^7.0.0",
@@ -40,10 +40,10 @@
40
40
  "@vanilla-extract/recipes": "^0.2.5",
41
41
  "react": "^16.14.0",
42
42
  "react-dom": "^16.14.0",
43
- "@sps-woodland/buttons": "8.10.3",
44
- "@sps-woodland/core": "8.10.3",
45
- "@sps-woodland/tokens": "8.10.3",
46
- "@spscommerce/ds-react": "8.10.3"
43
+ "@sps-woodland/buttons": "8.11.0",
44
+ "@sps-woodland/core": "8.11.0",
45
+ "@sps-woodland/tokens": "8.11.0",
46
+ "@spscommerce/ds-react": "8.11.0"
47
47
  },
48
48
  "dependencies": {
49
49
  "rehype-parse": "^8.0.4",