@sps-woodland/rich-text-editor 8.12.0 → 8.12.2

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 +69 -93
  2. package/package.json +10 -10
package/lib/index.es.js CHANGED
@@ -1356,8 +1356,7 @@ function W0(e, t) {
1356
1356
  r = 2;
1357
1357
  break;
1358
1358
  }
1359
- } else
1360
- i.type === "labelEnd" && (o = n);
1359
+ } else i.type === "labelEnd" && (o = n);
1361
1360
  const c = {
1362
1361
  type: e[s][1].type === "labelLink" ? "link" : "image",
1363
1362
  start: Object.assign({}, e[s][1].start),
@@ -1826,8 +1825,7 @@ function Cc(e, t) {
1826
1825
  if (typeof u == "string") {
1827
1826
  for (o = u.length; u.charCodeAt(o - 1) === 32; )
1828
1827
  a++, o--;
1829
- if (o)
1830
- break;
1828
+ if (o) break;
1831
1829
  o = -1;
1832
1830
  } else if (u === -2)
1833
1831
  c = !0, a++;
@@ -2060,8 +2058,7 @@ function xc(e, t) {
2060
2058
  break;
2061
2059
  }
2062
2060
  case -1: {
2063
- if (!t && i)
2064
- continue;
2061
+ if (!t && i) continue;
2065
2062
  o = " ";
2066
2063
  break;
2067
2064
  }
@@ -2179,8 +2176,7 @@ function Fc() {
2179
2176
  break;
2180
2177
  }
2181
2178
  case 9: {
2182
- for (f = Math.ceil(e / 4) * 4, c.push(-2); e++ < f; )
2183
- c.push(-1);
2179
+ for (f = Math.ceil(e / 4) * 4, c.push(-2); e++ < f; ) c.push(-1);
2184
2180
  break;
2185
2181
  }
2186
2182
  case 10: {
@@ -2428,11 +2424,9 @@ function Gc(e) {
2428
2424
  for (tt = void 0; Ln--; ) {
2429
2425
  const nt = _[Ln];
2430
2426
  if (nt[1].type === "lineEnding" || nt[1].type === "lineEndingBlank") {
2431
- if (nt[0] === "exit")
2432
- continue;
2427
+ if (nt[0] === "exit") continue;
2433
2428
  tt && (_[tt][1].type = "lineEndingBlank", ve = !0), nt[1].type = "lineEnding", tt = Ln;
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;
2429
+ } else if (!(nt[1].type === "linePrefix" || nt[1].type === "blockQuotePrefix" || nt[1].type === "blockQuotePrefixWhitespace" || nt[1].type === "blockQuoteMarker" || nt[1].type === "listItemIndent")) break;
2436
2430
  }
2437
2431
  e1 && (!tt || e1 < tt) && (ht._spread = !0), ht.end = Object.assign(
2438
2432
  {},
@@ -2483,13 +2477,12 @@ function Gc(e) {
2483
2477
  const H = this.stack.pop(), Z = this.tokenStack.pop();
2484
2478
  if (Z)
2485
2479
  Z[0].type !== _.type && (y ? y.call(this, _, Z[0]) : (Z[1] || Ti).call(this, _, Z[0]));
2486
- else
2487
- throw new Error(
2488
- "Cannot close `" + _.type + "` (" + d1({
2489
- start: _.start,
2490
- end: _.end
2491
- }) + "): it’s not open"
2492
- );
2480
+ else throw new Error(
2481
+ "Cannot close `" + _.type + "` (" + d1({
2482
+ start: _.start,
2483
+ end: _.end
2484
+ }) + "): it’s not open"
2485
+ );
2493
2486
  return H.position.end = mt(_.end), H;
2494
2487
  }
2495
2488
  function g() {
@@ -2926,8 +2919,7 @@ function Bo(e, t) {
2926
2919
  function Qc(e, t) {
2927
2920
  const n = e.footnoteById;
2928
2921
  let r = 1;
2929
- for (; r in n; )
2930
- r++;
2922
+ for (; r in n; ) r++;
2931
2923
  const i = String(r);
2932
2924
  return n[i] = {
2933
2925
  type: "footnoteDefinition",
@@ -3274,8 +3266,7 @@ function Eu(e) {
3274
3266
  function r(...i) {
3275
3267
  let s = -1;
3276
3268
  for (; ++s < t.length; )
3277
- if (t[s].call(this, ...i))
3278
- return !0;
3269
+ if (t[s].call(this, ...i)) return !0;
3279
3270
  return !1;
3280
3271
  }
3281
3272
  }
@@ -3284,8 +3275,7 @@ function gu(e) {
3284
3275
  function t(n) {
3285
3276
  let r;
3286
3277
  for (r in e)
3287
- if (n[r] !== e[r])
3288
- return !1;
3278
+ if (n[r] !== e[r]) return !1;
3289
3279
  return !0;
3290
3280
  }
3291
3281
  }
@@ -5712,8 +5702,7 @@ function H9(e) {
5712
5702
  for (; ++r < t.length; ) {
5713
5703
  const i = t[r];
5714
5704
  if (i.type === "element" && (i.tagName === "title" || i.tagName === "base")) {
5715
- if (n.includes(i.tagName))
5716
- return !1;
5705
+ if (n.includes(i.tagName)) return !1;
5717
5706
  n.push(i.tagName);
5718
5707
  }
5719
5708
  }
@@ -5938,8 +5927,7 @@ var W1 = Object.prototype.hasOwnProperty, ua = Object.prototype.toString, Di = O
5938
5927
  if (W1.call(t, n)) {
5939
5928
  if (Fi)
5940
5929
  return Fi(t, n).value;
5941
- } else
5942
- return;
5930
+ } else return;
5943
5931
  return t[n];
5944
5932
  }, e5 = function e() {
5945
5933
  var t, n, r, i, s, o, a = arguments[0], c = 1, u = arguments.length, f = !1;
@@ -6070,8 +6058,7 @@ function r5(e, t) {
6070
6058
  n = i + 1;
6071
6059
  break;
6072
6060
  }
6073
- } else
6074
- r < 0 && (s = !0, r = i + 1);
6061
+ } else r < 0 && (s = !0, r = i + 1);
6075
6062
  return r < 0 ? "" : e.slice(n, r);
6076
6063
  }
6077
6064
  if (t === e)
@@ -6097,8 +6084,7 @@ function i5(e) {
6097
6084
  t = n;
6098
6085
  break;
6099
6086
  }
6100
- } else
6101
- r || (r = !0);
6087
+ } else r || (r = !0);
6102
6088
  return t < 0 ? e.charCodeAt(0) === 47 ? "/" : "." : t === 1 && e.charCodeAt(0) === 47 ? "//" : e.slice(0, t);
6103
6089
  }
6104
6090
  function s5(e) {
@@ -6142,25 +6128,23 @@ function l5(e, t) {
6142
6128
  a = 47;
6143
6129
  }
6144
6130
  if (a === 47) {
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;
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;
6155
6136
  continue;
6156
6137
  }
6138
+ } else if (n.length > 0) {
6139
+ n = "", r = 0, i = o, s = 0;
6140
+ continue;
6157
6141
  }
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;
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;
6161
6146
  i = o, s = 0;
6162
- } else
6163
- a === 46 && s > -1 ? s++ : s = -1;
6147
+ } else a === 46 && s > -1 ? s++ : s = -1;
6164
6148
  }
6165
6149
  return n;
6166
6150
  }
@@ -6463,13 +6447,12 @@ function ma() {
6463
6447
  }
6464
6448
  function c(S, ...R) {
6465
6449
  let N;
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 + "`");
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 + "`");
6473
6456
  return N && (n.settings = Object.assign(n.settings || {}, N)), s;
6474
6457
  function U(A) {
6475
6458
  if (typeof A == "function")
@@ -6488,14 +6471,13 @@ function ma() {
6488
6471
  }
6489
6472
  function G(A) {
6490
6473
  let D = -1;
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 + "`");
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 + "`");
6499
6481
  }
6500
6482
  function z(A, D) {
6501
6483
  let Y = -1, W;
@@ -10042,8 +10024,7 @@ function Ba(e, t) {
10042
10024
  if (n === l.OPTGROUP) {
10043
10025
  const r = e.openElements.items[e.openElements.stackTop - 1], i = r && e.treeAdapter.getTagName(r);
10044
10026
  e.openElements.currentTagName === l.OPTION && i === l.OPTGROUP && e.openElements.pop(), e.openElements.currentTagName === l.OPTGROUP && e.openElements.pop();
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);
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);
10047
10028
  }
10048
10029
  function Zf(e, t) {
10049
10030
  const n = t.tagName;
@@ -10191,11 +10172,9 @@ function g4(e, t, n, r) {
10191
10172
  let s = -1, o;
10192
10173
  if (r != null) {
10193
10174
  if (typeof r == "number") {
10194
- if (Number.isNaN(r))
10195
- return;
10175
+ if (Number.isNaN(r)) return;
10196
10176
  o = 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);
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);
10199
10178
  if (Array.isArray(o)) {
10200
10179
  const a = [];
10201
10180
  for (; ++s < o.length; )
@@ -10207,16 +10186,15 @@ function g4(e, t, n, r) {
10207
10186
  }
10208
10187
  function Er(e, t) {
10209
10188
  let n = -1;
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 + "`");
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 + "`");
10220
10198
  }
10221
10199
  function no(e, t, n) {
10222
10200
  if (typeof n == "string") {
@@ -11114,8 +11092,7 @@ function Qa(e, t, n) {
11114
11092
  if (t.properties && t.properties.dataMdast === "ignore")
11115
11093
  return;
11116
11094
  mn.call(e.handlers, t.tagName) && (r = e.handlers[t.tagName]);
11117
- } else
11118
- mn.call(e.handlers, t.type) && (r = e.handlers[t.type]);
11095
+ } else mn.call(e.handlers, t.type) && (r = e.handlers[t.type]);
11119
11096
  return typeof r == "function" ? r(e, t, n) : W4(e, t);
11120
11097
  }
11121
11098
  function W4(e, t) {
@@ -13167,19 +13144,18 @@ function n3(e) {
13167
13144
  const f = i.getCommandArg ? i.getCommandArg(s) : void 0;
13168
13145
  document.execCommand(i.command, void 0, f), a && (qr(r.target.parentNode), document.execCommand(i.command));
13169
13146
  }
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
- }
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);
13180
13155
  }
13181
- Z8(i);
13182
- });
13156
+ }
13157
+ Z8(i);
13158
+ });
13183
13159
  e(t);
13184
13160
  }), []);
13185
13161
  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.12.0",
4
+ "version": "8.12.2",
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.12.0",
33
- "@sps-woodland/core": "8.12.0",
34
- "@sps-woodland/tokens": "8.12.0",
35
- "@spscommerce/ds-react": "8.12.0"
32
+ "@sps-woodland/buttons": "8.12.2",
33
+ "@sps-woodland/core": "8.12.2",
34
+ "@sps-woodland/tokens": "8.12.2",
35
+ "@spscommerce/ds-react": "8.12.2"
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.12.0",
44
- "@sps-woodland/core": "8.12.0",
45
- "@sps-woodland/tokens": "8.12.0",
46
- "@spscommerce/ds-react": "8.12.0"
43
+ "@sps-woodland/buttons": "8.12.2",
44
+ "@spscommerce/ds-react": "8.12.2",
45
+ "@sps-woodland/tokens": "8.12.2",
46
+ "@sps-woodland/core": "8.12.2"
47
47
  },
48
48
  "dependencies": {
49
49
  "rehype-parse": "^8.0.4",
@@ -62,6 +62,6 @@
62
62
  "build:types": "tsc --emitDeclarationOnly --declaration --declarationDir lib",
63
63
  "watch": "vite build --watch",
64
64
  "clean": "git clean -fdX",
65
- "pub": "node ../../../scripts/publish-package.js"
65
+ "pub": "node ../../../scripts/publish-package.mjs"
66
66
  }
67
67
  }