@designcrowd/library.brand-page 6.1.1-json-prereq-3 → 6.1.1-json-prereq-4
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/lib/src/{CreatedOnBrandCrowd-de-de-hj_ievMc.js → CreatedOnBrandCrowd-de-de-Dk-G3RbI.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-jAOSpfCw.js → CreatedOnBrandCrowd-en-us-AVAWRjbj.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-DZMVc-y3.js → CreatedOnBrandCrowd-es-es-C5Xq4Jln.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-DvB54H38.js → CreatedOnBrandCrowd-fr-ca-BQXjmcrr.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-DvB54H38.js → CreatedOnBrandCrowd-fr-fr-BQXjmcrr.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-bf-x1xhi.js → CreatedOnBrandCrowd-pt-br-DRMRc1Zk.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-bf-x1xhi.js → CreatedOnBrandCrowd-pt-pt-DRMRc1Zk.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-B-NY1B44.js → CreatedOnDcom-de-de-Dd9-oQ34.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-Cd4C6KQf.js → CreatedOnDcom-en-us-CnDfLzF4.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-DONlsQsm.js → CreatedOnDcom-es-es-bvqvI9gT.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-Dsv3FRpZ.js → CreatedOnDcom-fr-ca-BG7UGFe8.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-DOgyvY5C.js → CreatedOnDcom-fr-fr-xdz35O_B.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-DX66MhJS.js → CreatedOnDcom-pt-br-CLfHnCkk.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-COe2G0bU.js → CreatedOnDcom-pt-pt-Z7FY0BXt.js} +1 -1
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.d.ts +8 -0
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.js +18 -1
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-scDtk-Pi.js → lib-uYwxz8qR.js} +4519 -4511
- package/package.json +1 -1
- package/src/brand-page-maker/utils/rich-text-editor.util.test.ts +25 -0
- package/src/brand-page-maker/utils/rich-text-editor.util.ts +21 -1
|
@@ -28,6 +28,14 @@ export declare const getPlainTextFromRTE: (content: unknown) => string;
|
|
|
28
28
|
* concatenated visible text. Without this, `doc.length` is `undefined` (silently
|
|
29
29
|
* disabling the check) and `doc.trim()` throws — the class of bug that survived
|
|
30
30
|
* the `RichTextValue` widening because Vue Options-API `this`/item access is `any`.
|
|
31
|
+
*
|
|
32
|
+
* The JSON branch concatenates text nodes with NO separator, matching the
|
|
33
|
+
* editor's own char count (ProseMirror textContent) — the metric the MaxLength
|
|
34
|
+
* extension gates on. It deliberately does NOT reuse getRteJsonPlainText, whose
|
|
35
|
+
* space-join + trim (for readable plain-text extraction) over-counts by one per
|
|
36
|
+
* inline mark boundary — so hyperlinking or formatting a word made the item's
|
|
37
|
+
* max-length indicator disagree with the gate and fire at content that was
|
|
38
|
+
* actually under the cap (BP-5787).
|
|
31
39
|
*/
|
|
32
40
|
export declare const getRteTextLength: (value: RichTextValue | null | undefined) => number;
|
|
33
41
|
export declare const replaceTextInRTE: (existingHtml: string, newText: string) => string;
|
|
@@ -234,11 +234,28 @@ export const getPlainTextFromRTE = (content) => {
|
|
|
234
234
|
* concatenated visible text. Without this, `doc.length` is `undefined` (silently
|
|
235
235
|
* disabling the check) and `doc.trim()` throws — the class of bug that survived
|
|
236
236
|
* the `RichTextValue` widening because Vue Options-API `this`/item access is `any`.
|
|
237
|
+
*
|
|
238
|
+
* The JSON branch concatenates text nodes with NO separator, matching the
|
|
239
|
+
* editor's own char count (ProseMirror textContent) — the metric the MaxLength
|
|
240
|
+
* extension gates on. It deliberately does NOT reuse getRteJsonPlainText, whose
|
|
241
|
+
* space-join + trim (for readable plain-text extraction) over-counts by one per
|
|
242
|
+
* inline mark boundary — so hyperlinking or formatting a word made the item's
|
|
243
|
+
* max-length indicator disagree with the gate and fire at content that was
|
|
244
|
+
* actually under the cap (BP-5787).
|
|
237
245
|
*/
|
|
238
246
|
export const getRteTextLength = (value) => {
|
|
239
247
|
if (typeof value === 'string')
|
|
240
248
|
return value.length;
|
|
241
|
-
|
|
249
|
+
if (!value)
|
|
250
|
+
return 0;
|
|
251
|
+
let length = 0;
|
|
252
|
+
const walk = (node) => {
|
|
253
|
+
if (typeof node.text === 'string')
|
|
254
|
+
length += node.text.length;
|
|
255
|
+
node.content?.forEach(walk);
|
|
256
|
+
};
|
|
257
|
+
walk(value);
|
|
258
|
+
return length;
|
|
242
259
|
};
|
|
243
260
|
export const replaceTextInRTE = (existingHtml, newText) => {
|
|
244
261
|
if (!hasRTEContent(existingHtml)) {
|
package/lib/src/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as _, a as E, b as s, c as I, d as S, e as N, f as e, B as A, g as O, h as t, i as C, j as G, k as D, l as P, m as R, n as o, o as L, p as M, q as r, r as n, s as b, t as l, u as i, v as F, w as c, x as g, y as B, z as Y, C as U, D as d, E as u, F as H, G as p, H as y, I as m, J as K, K as k, L as V, M as X, N as v, O as h, P as x, Q as f, R as W, S as z, T as w, U as J, V as Z, W as j, X as q, Y as Q, Z as $, $ as aa, a0 as Ta, a1 as _a, a2 as Ea, a3 as sa, a4 as Ia, a5 as Sa, a6 as Na, a7 as ea, a8 as Aa, a9 as Oa, aa as ta, ab as Ca, ac as Ga, ad as Da, ae as Pa, af as Ra, ag as oa, ah as La, ai as Ma, aj as ra, ak as na, al as ba, am as la, an as ia, ao as Fa, ap as ca, aq as ga, ar as Ba, as as Ya, at as Ua, au as da, av as ua, aw as Ha, ax as pa, ay as ya, az as ma, aA as Ka, aB as ka, aC as Va, aD as Xa, aE as va, aF as ha, aG as xa, aH as fa, aI as Wa, aJ as za, aK as wa, aL as Ja, aM as Za, aN as ja, aO as qa, aP as Qa, aQ as $a, aR as aT, aS as TT, aT as _T, aU as ET, aV as sT, aW as IT, aX as ST, aY as NT, aZ as eT, a_ as AT, a$ as OT, b0 as tT, b1 as CT, b2 as GT, b3 as DT, b4 as PT, b5 as RT, b6 as oT, b7 as LT, b8 as MT, b9 as rT, ba as nT, bb as bT, bc as lT, bd as iT, be as FT, bf as cT, bg as gT, bh as BT, bi as YT, bj as UT, bk as dT, bl as uT, bm as HT, bn as pT, bo as yT, bp as mT, bq as KT, br as kT, bs as VT, bt as XT, bu as vT, bv as hT, bw as xT, bx as fT, by as WT, bz as zT, bA as wT, bB as JT, bC as ZT, bD as jT, bE as qT, bF as QT, bG as $T, bH as a_, bI as T_, bJ as __, bK as E_, bL as s_, bM as I_, bN as S_, bO as N_, bP as e_, bQ as A_, bR as O_, bS as t_, bT as C_, bU as G_, bV as D_, bW as P_, bX as R_, bY as o_, bZ as L_, b_ as M_, b$ as r_, c0 as n_, c1 as b_, c2 as l_, c3 as i_, c4 as F_, c5 as c_, c6 as g_, c7 as B_, c8 as Y_, c9 as U_, ca as d_, cb as u_, cc as H_, cd as p_, ce as y_, cf as m_, cg as K_, ch as k_, ci as V_, cj as X_, ck as v_, cl as h_, cm as x_, cn as f_, co as W_, cp as z_, cq as w_, cr as J_, cs as Z_, ct as j_, cu as q_, cv as Q_, cw as $_, cx as aE } from "./lib-
|
|
1
|
+
import { A as _, a as E, b as s, c as I, d as S, e as N, f as e, B as A, g as O, h as t, i as C, j as G, k as D, l as P, m as R, n as o, o as L, p as M, q as r, r as n, s as b, t as l, u as i, v as F, w as c, x as g, y as B, z as Y, C as U, D as d, E as u, F as H, G as p, H as y, I as m, J as K, K as k, L as V, M as X, N as v, O as h, P as x, Q as f, R as W, S as z, T as w, U as J, V as Z, W as j, X as q, Y as Q, Z as $, $ as aa, a0 as Ta, a1 as _a, a2 as Ea, a3 as sa, a4 as Ia, a5 as Sa, a6 as Na, a7 as ea, a8 as Aa, a9 as Oa, aa as ta, ab as Ca, ac as Ga, ad as Da, ae as Pa, af as Ra, ag as oa, ah as La, ai as Ma, aj as ra, ak as na, al as ba, am as la, an as ia, ao as Fa, ap as ca, aq as ga, ar as Ba, as as Ya, at as Ua, au as da, av as ua, aw as Ha, ax as pa, ay as ya, az as ma, aA as Ka, aB as ka, aC as Va, aD as Xa, aE as va, aF as ha, aG as xa, aH as fa, aI as Wa, aJ as za, aK as wa, aL as Ja, aM as Za, aN as ja, aO as qa, aP as Qa, aQ as $a, aR as aT, aS as TT, aT as _T, aU as ET, aV as sT, aW as IT, aX as ST, aY as NT, aZ as eT, a_ as AT, a$ as OT, b0 as tT, b1 as CT, b2 as GT, b3 as DT, b4 as PT, b5 as RT, b6 as oT, b7 as LT, b8 as MT, b9 as rT, ba as nT, bb as bT, bc as lT, bd as iT, be as FT, bf as cT, bg as gT, bh as BT, bi as YT, bj as UT, bk as dT, bl as uT, bm as HT, bn as pT, bo as yT, bp as mT, bq as KT, br as kT, bs as VT, bt as XT, bu as vT, bv as hT, bw as xT, bx as fT, by as WT, bz as zT, bA as wT, bB as JT, bC as ZT, bD as jT, bE as qT, bF as QT, bG as $T, bH as a_, bI as T_, bJ as __, bK as E_, bL as s_, bM as I_, bN as S_, bO as N_, bP as e_, bQ as A_, bR as O_, bS as t_, bT as C_, bU as G_, bV as D_, bW as P_, bX as R_, bY as o_, bZ as L_, b_ as M_, b$ as r_, c0 as n_, c1 as b_, c2 as l_, c3 as i_, c4 as F_, c5 as c_, c6 as g_, c7 as B_, c8 as Y_, c9 as U_, ca as d_, cb as u_, cc as H_, cd as p_, ce as y_, cf as m_, cg as K_, ch as k_, ci as V_, cj as X_, ck as v_, cl as h_, cm as x_, cn as f_, co as W_, cp as z_, cq as w_, cr as J_, cs as Z_, ct as j_, cu as q_, cv as Q_, cw as $_, cx as aE } from "./lib-uYwxz8qR.js";
|
|
2
2
|
import { U as _E, u as EE } from "./useEventTracker-DmQ6AkNn.js";
|
|
3
3
|
import { createPinia as IE, setActivePinia as SE } from "pinia";
|
|
4
4
|
export {
|