@qkix/strapi-plugin-better-blocks 0.23.9 → 0.23.11
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/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +88 -85
- package/package.json +5 -5
package/dist/admin/index.js
CHANGED
|
@@ -1905,7 +1905,7 @@
|
|
|
1905
1905
|
'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo,
|
|
1906
1906
|
Consolas, monospace;
|
|
1907
1907
|
color: inherit;
|
|
1908
|
-
`,We=(e,t)=>{const n=d.Editor.marks(e);return n?!!n[t]:!1},Ke=(e,t)=>{const n=d.Editor.marks(e);if(!e.selection){const r=d.Editor.end(e,[]);d.Transforms.select(e,r)}n?.[t]?d.Editor.removeMark(e,t):d.Editor.addMark(e,t,!0)},Ty={uppercase:{icon:kf,isValidEventKey:e=>e.key==="A",label:{id:"components.Blocks.modifiers.uppercase",defaultMessage:"Uppercase"},checkIsActive:e=>We(e,"uppercase"),handleToggle:e=>Ke(e,"uppercase"),renderLeaf:e=>o.jsx(vy,{children:e})},superscript:{icon:jf,isValidEventKey:e=>e.key==="A",label:{id:"components.Blocks.modifiers.superscript",defaultMessage:"Superscript"},checkIsActive:e=>We(e,"superscript"),handleToggle:e=>Ke(e,"superscript"),renderLeaf:e=>o.jsx(wy,{children:e})},subscript:{icon:Mf,isValidEventKey:e=>e.key==="A",label:{id:"components.Blocks.modifiers.subscript",defaultMessage:"Subscript"},checkIsActive:e=>We(e,"subscript"),handleToggle:e=>Ke(e,"subscript"),renderLeaf:e=>o.jsx(ky,{children:e})},bold:{icon:D.Bold,isValidEventKey:e=>e.key==="b",label:{id:"components.Blocks.modifiers.bold",defaultMessage:"Bold"},checkIsActive:e=>We(e,"bold"),handleToggle:e=>Ke(e,"bold"),renderLeaf:e=>o.jsx(jy,{children:e})},italic:{icon:D.Italic,isValidEventKey:e=>e.key==="i",label:{id:"components.Blocks.modifiers.italic",defaultMessage:"Italic"},checkIsActive:e=>We(e,"italic"),handleToggle:e=>Ke(e,"italic"),renderLeaf:e=>o.jsx($y,{children:e})},underline:{icon:D.Underline,isValidEventKey:e=>e.key==="u",label:{id:"components.Blocks.modifiers.underline",defaultMessage:"Underline"},checkIsActive:e=>We(e,"underline"),handleToggle:e=>Ke(e,"underline"),renderLeaf:e=>o.jsx(Ey,{children:e})},strikethrough:{icon:D.StrikeThrough,isValidEventKey:e=>e.key==="S"&&e.shiftKey,label:{id:"components.Blocks.modifiers.strikethrough",defaultMessage:"Strikethrough"},checkIsActive:e=>We(e,"strikethrough"),handleToggle:e=>Ke(e,"strikethrough"),renderLeaf:e=>o.jsx(Cy,{children:e})},code:{icon:D.Code,isValidEventKey:e=>e.key==="e",label:{id:"components.Blocks.modifiers.code",defaultMessage:"Inline code"},checkIsActive:e=>We(e,"code"),handleToggle:e=>Ke(e,"code"),renderLeaf:e=>o.jsx(Sy,{children:e})}},My=e=>{const t=e,{isInline:n,apply:r,insertText:s}=t;t.lastInsertedLinkPath=null,t.shouldSaveLinkPath=!0,t.isInline=i=>"type"in i&&i.type==="link"?!0:n(i),t.apply=i=>{i.type==="insert_node"&&"type"in i.node&&i.node.type==="link"&&t.shouldSaveLinkPath&&(t.lastInsertedLinkPath=i
|
|
1908
|
+
`,We=(e,t)=>{const n=d.Editor.marks(e);return n?!!n[t]:!1},Ke=(e,t)=>{const n=d.Editor.marks(e);if(!e.selection){const r=d.Editor.end(e,[]);d.Transforms.select(e,r)}n?.[t]?d.Editor.removeMark(e,t):d.Editor.addMark(e,t,!0)},Ty={uppercase:{icon:kf,isValidEventKey:e=>e.key==="A",label:{id:"components.Blocks.modifiers.uppercase",defaultMessage:"Uppercase"},checkIsActive:e=>We(e,"uppercase"),handleToggle:e=>Ke(e,"uppercase"),renderLeaf:e=>o.jsx(vy,{children:e})},superscript:{icon:jf,isValidEventKey:e=>e.key==="A",label:{id:"components.Blocks.modifiers.superscript",defaultMessage:"Superscript"},checkIsActive:e=>We(e,"superscript"),handleToggle:e=>Ke(e,"superscript"),renderLeaf:e=>o.jsx(wy,{children:e})},subscript:{icon:Mf,isValidEventKey:e=>e.key==="A",label:{id:"components.Blocks.modifiers.subscript",defaultMessage:"Subscript"},checkIsActive:e=>We(e,"subscript"),handleToggle:e=>Ke(e,"subscript"),renderLeaf:e=>o.jsx(ky,{children:e})},bold:{icon:D.Bold,isValidEventKey:e=>e.key==="b",label:{id:"components.Blocks.modifiers.bold",defaultMessage:"Bold"},checkIsActive:e=>We(e,"bold"),handleToggle:e=>Ke(e,"bold"),renderLeaf:e=>o.jsx(jy,{children:e})},italic:{icon:D.Italic,isValidEventKey:e=>e.key==="i",label:{id:"components.Blocks.modifiers.italic",defaultMessage:"Italic"},checkIsActive:e=>We(e,"italic"),handleToggle:e=>Ke(e,"italic"),renderLeaf:e=>o.jsx($y,{children:e})},underline:{icon:D.Underline,isValidEventKey:e=>e.key==="u",label:{id:"components.Blocks.modifiers.underline",defaultMessage:"Underline"},checkIsActive:e=>We(e,"underline"),handleToggle:e=>Ke(e,"underline"),renderLeaf:e=>o.jsx(Ey,{children:e})},strikethrough:{icon:D.StrikeThrough,isValidEventKey:e=>e.key==="S"&&e.shiftKey,label:{id:"components.Blocks.modifiers.strikethrough",defaultMessage:"Strikethrough"},checkIsActive:e=>We(e,"strikethrough"),handleToggle:e=>Ke(e,"strikethrough"),renderLeaf:e=>o.jsx(Cy,{children:e})},code:{icon:D.Code,isValidEventKey:e=>e.key==="e",label:{id:"components.Blocks.modifiers.code",defaultMessage:"Inline code"},checkIsActive:e=>We(e,"code"),handleToggle:e=>Ke(e,"code"),renderLeaf:e=>o.jsx(Sy,{children:e})}},My=e=>{const t=e,{isInline:n,apply:r,insertText:s}=t;t.lastInsertedLinkPath=null,t.shouldSaveLinkPath=!0,t.isInline=i=>"type"in i&&i.type==="link"?!0:n(i),t.apply=i=>{i.type==="insert_node"&&"type"in i.node&&i.node.type==="link"&&t.shouldSaveLinkPath?t.lastInsertedLinkPath=i.path:t.lastInsertedLinkPath&&(t.lastInsertedLinkPath=d.Path.transform(t.lastInsertedLinkPath,i)),r(i)},t.insertText=i=>{const{selection:l}=t;if(l&&d.Range.isCollapsed(l)){const{anchor:c}=l,u=d.Editor.above(t,{match:$=>"type"in $&&!d.Editor.isEditor($)&&$.type!=="link"}),h=u?u[1]:[],f=d.Editor.start(t,h),g={anchor:c,focus:f},m=d.Editor.string(t,g),x=m.trim(),y=/https?:\/\/\S+$/,v=x.match(y);if(v){const $=v[0],E=m.lastIndexOf($),C=E+$.length,I={anchor:{path:c.path,offset:E},focus:{path:c.path,offset:C}};d.Transforms.select(t,I),t.shouldSaveLinkPath=!0,_n(t,{url:$});return}}s(i)};const{insertData:a}=t;return t.insertData=i=>{const l=i.getData("text/plain");if(l&&/^https?:\/\/\S+$/.test(l)){!t.selection||d.Range.isCollapsed(t.selection)?(t.shouldSaveLinkPath=!0,_n(t,{url:l})):(t.shouldSaveLinkPath=!0,_n(t,{url:l}));return}a(i)},t},Vs=cc.unified().use(fc.default).use(hc.default).use(pc.default),Q=(e,t={})=>({type:"text",text:e,...t}),mn=()=>Q(""),Rn=(e=[mn()])=>({type:"paragraph",children:at(e)}),Ji=(e,t)=>({type:"math",format:t,value:e,children:[mn()]}),at=e=>e.length>0?e:[mn()],dn=e=>e.trim().replace(/\s+/g," ").toLowerCase(),By=e=>{const t=new Map,n=r=>{r.forEach(s=>{s.type==="definition"&&t.set(dn(s.identifier),s),"children"in s&&n(s.children)})};return n(e.children),t},Qi=e=>e.trim()!==""&&!/^\s|\s$/.test(e),el=e=>Qi(e)?e:`$${e}$`,Iy={"c++":"cpp","c#":"csharp","obj-c":"objectivec","objective-c":"objectivec",sh:"shell","shell-session":"shell",console:"shell",zsh:"shell",bat:"powershell",cmd:"powershell",ps1:"powershell",docker:"dockerfile",golang:"go",htm:"html",js:"javascript",kt:"kotlin",md:"markdown",mdx:"markdown",objc:"objectivec",py:"python",rb:"ruby",rs:"rust",text:"plaintext",txt:"plaintext",ts:"typescript",tex:"latex",vb:"vbnet",yml:"yaml"},Ry=new Set(Ba.map(e=>e.value)),Fy=e=>{if(!e)return"plaintext";const t=e.trim().toLowerCase(),n=Iy[t]??t;return Ry.has(n)?n:"plaintext"},qs=e=>/^[a-z][a-z0-9+.-]*:/i.test(e)?e:/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(e)?`mailto:${e}`:e,ke=(e=[],t,n={})=>e.flatMap(r=>Dy(r,t,n)),Dy=(e,t,n)=>{switch(e.type){case"text":return[Q(e.value,n)];case"break":return[Q(`
|
|
1909
1909
|
`,n)];case"emphasis":return ke(e.children,t,{...n,italic:!0});case"strong":return ke(e.children,t,{...n,bold:!0});case"delete":return ke(e.children,t,{...n,strikethrough:!0});case"inlineCode":return[Q(e.value,{...n,code:!0})];case"inlineMath":{const r=e.value;return Qi(r)?[Ji(r,"inline")]:[Q(el(r),n)]}case"link":{const r=e;return[{type:"link",url:qs(r.url),children:at(ke(r.children,t,n))}]}case"linkReference":{const r=e,s=t.get(dn(r.identifier)),a=at(ke(r.children,t,n));return s?[{type:"link",url:qs(s.url),children:a}]:a}case"image":{const r=e,s=r.alt||r.url;return[{type:"link",url:r.url,children:[Q(s,n)]}]}case"imageReference":{const r=e,s=t.get(dn(r.identifier)),a=r.alt||s?.title||s?.url||"";return s?[{type:"link",url:s.url,children:[Q(a,n)]}]:[Q(a,n)]}case"footnoteReference":return[Q(`[^${e.identifier}]`,n)];case"html":return[Q(e.value,n)];default:return[]}},tl=(e=[],t)=>e.map(n=>{switch(n.type){case"text":case"inlineCode":case"html":return n.value;case"inlineMath":return el(n.value);case"break":return`
|
|
1910
1910
|
`;case"image":return n.alt||n.url;case"imageReference":{const r=n,s=t.get(dn(r.identifier));return r.alt||s?.url||""}case"footnoteReference":return`[^${n.identifier}]`;default:return"children"in n?tl(n.children||[],t):""}}).join(""),bn=(e,t)=>{switch(e.type){case"paragraph":case"heading":return tl(e.children,t);case"blockquote":return e.children.map(n=>bn(n,t)).join(`
|
|
1911
1911
|
`);case"code":case"math":case"html":return e.value;case"list":return Ay(e,t);case"footnoteDefinition":return rl(e,t);case"definition":return nl(e);case"thematicBreak":return"---";default:return""}},Ay=(e,t)=>e.children.flatMap((n,r)=>{const s=e.ordered?`${r+(e.start||1)}. `:"- ";return n.children.map(i=>bn(i,t)).map((i,l)=>l===0?`${s}${i}`:` ${i}`)}).join(`
|
package/dist/admin/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { BlocksField as Vc } from "@strapi/icons/symbols";
|
|
|
5
5
|
import { useStrapiApp as Sr, useFetchClient as Ho, createContext as qc } from "@strapi/admin/strapi-admin";
|
|
6
6
|
import { Box as re, SingleSelect as $n, SingleSelectOption as kt, Typography as A, Flex as B, Modal as G, Button as H, Checkbox as Ut, Divider as wn, Popover as Z, Field as V, IconButton as dr, Loader as Xc, Tooltip as Pn, Menu as ae, Portal as ui, FocusTrap as Yc, VisuallyHidden as Is } from "@strapi/design-system";
|
|
7
7
|
import { useIntl as z } from "react-intl";
|
|
8
|
-
import { Editor as k, Transforms as b, Node as Te, Element as oe, Text as Er, Range as
|
|
8
|
+
import { Editor as k, Transforms as b, Node as Te, Element as oe, Text as Er, Range as Fe, Path as Ie, createEditor as Zc } from "slate";
|
|
9
9
|
import { HistoryEditor as pi, withHistory as Jc } from "slate-history";
|
|
10
10
|
import { ReactEditor as F, useFocused as Qc, useSelected as Xt, useSlateStatic as Mr, useSlate as Tr, Editable as ed, Slate as td, withReact as nd } from "slate-react";
|
|
11
11
|
import { styled as x, css as Ct, useTheme as ie, createGlobalStyle as rd } from "styled-components";
|
|
@@ -16,7 +16,7 @@ import Ed from "katex";
|
|
|
16
16
|
import "katex/dist/katex.min.css";
|
|
17
17
|
import { isBuiltInBlockType as Md } from "@qkix/better-blocks-core";
|
|
18
18
|
import { unstable_batchedUpdates as Yn, createPortal as Td } from "react-dom";
|
|
19
|
-
import * as
|
|
19
|
+
import * as _e from "@radix-ui/react-toolbar";
|
|
20
20
|
import Id from "remark-gfm";
|
|
21
21
|
import Bd from "remark-math";
|
|
22
22
|
import Dd from "remark-parse";
|
|
@@ -256,7 +256,7 @@ const _d = (e, t, n) => {
|
|
|
256
256
|
label: "YAML",
|
|
257
257
|
decorate: "yml"
|
|
258
258
|
}
|
|
259
|
-
],
|
|
259
|
+
], Be = (e, t) => {
|
|
260
260
|
const [n, r] = k.last(e, []);
|
|
261
261
|
b.unwrapNodes(e, {
|
|
262
262
|
match: (h) => !k.isEditor(h) && "type" in h && h.type === "list",
|
|
@@ -509,7 +509,7 @@ const fo = /* @__PURE__ */ new Set(), Zn = /* @__PURE__ */ new Set(), go = /* @_
|
|
|
509
509
|
matchNode: (e) => !k.isEditor(e) && oe.isElement(e) && "type" in e && e.type === "code",
|
|
510
510
|
isInBlocksSelector: !0,
|
|
511
511
|
handleConvert(e) {
|
|
512
|
-
|
|
512
|
+
Be(e, {
|
|
513
513
|
type: "code",
|
|
514
514
|
language: "plaintext",
|
|
515
515
|
children: [{ type: "text", text: "" }]
|
|
@@ -550,7 +550,7 @@ const fo = /* @__PURE__ */ new Set(), Zn = /* @__PURE__ */ new Set(), go = /* @_
|
|
|
550
550
|
"heading-five": { fontSize: "1.45rem", fontWeight: 600 },
|
|
551
551
|
"heading-six": { fontSize: "1.35rem", fontWeight: 600 }
|
|
552
552
|
}, jt = (e, t) => {
|
|
553
|
-
|
|
553
|
+
Be(e, {
|
|
554
554
|
type: "heading",
|
|
555
555
|
level: t
|
|
556
556
|
});
|
|
@@ -1254,7 +1254,7 @@ const fo = /* @__PURE__ */ new Set(), Zn = /* @__PURE__ */ new Set(), go = /* @_
|
|
|
1254
1254
|
alignment: "center",
|
|
1255
1255
|
children: [{ type: "text", text: "" }]
|
|
1256
1256
|
}), zu = (e) => {
|
|
1257
|
-
const t =
|
|
1257
|
+
const t = Be(e, _s());
|
|
1258
1258
|
t && (b.removeNodes(e, { at: t }), b.insertNodes(
|
|
1259
1259
|
e,
|
|
1260
1260
|
_s(),
|
|
@@ -2399,7 +2399,7 @@ const fo = /* @__PURE__ */ new Set(), Zn = /* @__PURE__ */ new Set(), go = /* @_
|
|
|
2399
2399
|
style: vp(e),
|
|
2400
2400
|
children: [{ type: "text", text: "" }]
|
|
2401
2401
|
}), xp = (e) => {
|
|
2402
|
-
const t =
|
|
2402
|
+
const t = Be(e, Ls(e));
|
|
2403
2403
|
t && (b.removeNodes(e, { at: t }), b.insertNodes(
|
|
2404
2404
|
e,
|
|
2405
2405
|
Ls(e),
|
|
@@ -2569,7 +2569,7 @@ const fo = /* @__PURE__ */ new Set(), Zn = /* @__PURE__ */ new Set(), go = /* @_
|
|
|
2569
2569
|
})
|
|
2570
2570
|
).forEach(([, r]) => {
|
|
2571
2571
|
b.unwrapNodes(e, { at: r });
|
|
2572
|
-
}),
|
|
2572
|
+
}), Fe.isCollapsed(e.selection)) {
|
|
2573
2573
|
const r = {
|
|
2574
2574
|
type: "link",
|
|
2575
2575
|
url: t ?? "",
|
|
@@ -2616,10 +2616,10 @@ const fo = /* @__PURE__ */ new Set(), Zn = /* @__PURE__ */ new Set(), go = /* @_
|
|
|
2616
2616
|
`, Bp = S.forwardRef(
|
|
2617
2617
|
({ link: e, children: t, attributes: n }, r) => {
|
|
2618
2618
|
const { formatMessage: o } = z(), { editor: s } = O("Link"), i = F.findPath(s, e), [l, c] = S.useState(
|
|
2619
|
-
s.lastInsertedLinkPath ?
|
|
2619
|
+
s.lastInsertedLinkPath ? Ie.equals(i, s.lastInsertedLinkPath) : !1
|
|
2620
2620
|
), d = e.children.map((w) => "text" in w ? w.text : "").join(""), [u, p] = S.useState(d), [h, g] = S.useState(e.url), [y, m] = S.useState(
|
|
2621
2621
|
e.target === "_blank"
|
|
2622
|
-
), v = S.useRef(null), C = s.lastInsertedLinkPath ? !
|
|
2622
|
+
), v = S.useRef(null), C = s.lastInsertedLinkPath ? !Ie.equals(i, s.lastInsertedLinkPath) : !0, [E, M] = S.useState(!1), R = (w) => {
|
|
2623
2623
|
M(!1), g(w.target.value);
|
|
2624
2624
|
try {
|
|
2625
2625
|
new URL(
|
|
@@ -2629,7 +2629,7 @@ const fo = /* @__PURE__ */ new Set(), Zn = /* @__PURE__ */ new Set(), go = /* @_
|
|
|
2629
2629
|
M(!0);
|
|
2630
2630
|
}
|
|
2631
2631
|
}, T = (w) => {
|
|
2632
|
-
if (w.stopPropagation(), s.selection &&
|
|
2632
|
+
if (w.stopPropagation(), s.selection && Fe.isCollapsed(s.selection)) {
|
|
2633
2633
|
const [, D] = k.parent(
|
|
2634
2634
|
s,
|
|
2635
2635
|
s.selection.focus?.path
|
|
@@ -2929,7 +2929,7 @@ const fo = /* @__PURE__ */ new Set(), Zn = /* @__PURE__ */ new Set(), go = /* @_
|
|
|
2929
2929
|
}
|
|
2930
2930
|
}
|
|
2931
2931
|
b.removeNodes(e, { at: r });
|
|
2932
|
-
const p =
|
|
2932
|
+
const p = Ie.next(s);
|
|
2933
2933
|
b.insertNodes(
|
|
2934
2934
|
e,
|
|
2935
2935
|
{
|
|
@@ -2952,7 +2952,7 @@ const fo = /* @__PURE__ */ new Set(), Zn = /* @__PURE__ */ new Set(), go = /* @_
|
|
|
2952
2952
|
}, Qr = (e, t) => {
|
|
2953
2953
|
const n = { type: "list-item" };
|
|
2954
2954
|
t === "todo" && (n.checked = !1);
|
|
2955
|
-
const r =
|
|
2955
|
+
const r = Be(
|
|
2956
2956
|
e,
|
|
2957
2957
|
n
|
|
2958
2958
|
);
|
|
@@ -2976,7 +2976,7 @@ const fo = /* @__PURE__ */ new Set(), Zn = /* @__PURE__ */ new Set(), go = /* @_
|
|
|
2976
2976
|
at: o,
|
|
2977
2977
|
match: (i) => !k.isEditor(i) && "type" in i && i.type === "list"
|
|
2978
2978
|
})) {
|
|
2979
|
-
const i =
|
|
2979
|
+
const i = Ie.next(o);
|
|
2980
2980
|
b.moveNodes(e, {
|
|
2981
2981
|
at: n,
|
|
2982
2982
|
to: i
|
|
@@ -3134,7 +3134,7 @@ const fo = /* @__PURE__ */ new Set(), Zn = /* @__PURE__ */ new Set(), go = /* @_
|
|
|
3134
3134
|
);
|
|
3135
3135
|
}, Up = (e) => {
|
|
3136
3136
|
const { selection: t } = e;
|
|
3137
|
-
if (!t || !
|
|
3137
|
+
if (!t || !Fe.isCollapsed(t)) return !1;
|
|
3138
3138
|
const n = k.above(e, {
|
|
3139
3139
|
match: (p) => !k.isEditor(p) && oe.isElement(p) && p.type === "callout"
|
|
3140
3140
|
});
|
|
@@ -3151,7 +3151,7 @@ const fo = /* @__PURE__ */ new Set(), Zn = /* @__PURE__ */ new Set(), go = /* @_
|
|
|
3151
3151
|
type: "paragraph",
|
|
3152
3152
|
children: [{ type: "text", text: "" }]
|
|
3153
3153
|
},
|
|
3154
|
-
{ at:
|
|
3154
|
+
{ at: Ie.next(o), select: !0 }
|
|
3155
3155
|
), !0) : !1;
|
|
3156
3156
|
}, pt = (e, t) => e.colors[t] ?? t, Wp = x.aside`
|
|
3157
3157
|
margin: ${({ theme: e }) => e.spaces[3]} 0;
|
|
@@ -3418,7 +3418,7 @@ const fo = /* @__PURE__ */ new Set(), Zn = /* @__PURE__ */ new Set(), go = /* @_
|
|
|
3418
3418
|
);
|
|
3419
3419
|
}, Qp = (e) => {
|
|
3420
3420
|
const { selection: t } = e;
|
|
3421
|
-
if (!t || !
|
|
3421
|
+
if (!t || !Fe.isCollapsed(t)) return !1;
|
|
3422
3422
|
const n = k.above(e, {
|
|
3423
3423
|
match: (p) => !k.isEditor(p) && oe.isElement(p) && p.type === "details"
|
|
3424
3424
|
});
|
|
@@ -3435,7 +3435,7 @@ const fo = /* @__PURE__ */ new Set(), Zn = /* @__PURE__ */ new Set(), go = /* @_
|
|
|
3435
3435
|
type: "paragraph",
|
|
3436
3436
|
children: [{ type: "text", text: "" }]
|
|
3437
3437
|
},
|
|
3438
|
-
{ at:
|
|
3438
|
+
{ at: Ie.next(o), select: !0 }
|
|
3439
3439
|
), !0) : !1;
|
|
3440
3440
|
}, eh = x.div`
|
|
3441
3441
|
margin: ${({ theme: e }) => e.spaces[3]} 0;
|
|
@@ -4059,7 +4059,7 @@ const wh = (e) => {
|
|
|
4059
4059
|
defaultMessage: "Invalid diagram"
|
|
4060
4060
|
}) }) : r === null ? /* @__PURE__ */ a(A, { variant: "pi", textColor: "neutral400", children: "…" }) : /* @__PURE__ */ a("span", { dangerouslySetInnerHTML: { __html: r } });
|
|
4061
4061
|
}, Vo = (e) => {
|
|
4062
|
-
const t =
|
|
4062
|
+
const t = Be(e, {
|
|
4063
4063
|
type: "diagram",
|
|
4064
4064
|
format: "mermaid",
|
|
4065
4065
|
value: "",
|
|
@@ -4236,7 +4236,7 @@ const wh = (e) => {
|
|
|
4236
4236
|
};
|
|
4237
4237
|
b.insertNodes(e, n);
|
|
4238
4238
|
}, Xo = (e) => {
|
|
4239
|
-
const t =
|
|
4239
|
+
const t = Be(e, {
|
|
4240
4240
|
type: "math",
|
|
4241
4241
|
format: "block",
|
|
4242
4242
|
value: "",
|
|
@@ -4913,7 +4913,7 @@ const Br = (e) => {
|
|
|
4913
4913
|
alignment: "center",
|
|
4914
4914
|
children: [{ type: "text", text: "" }]
|
|
4915
4915
|
}), Ji = (e, t) => {
|
|
4916
|
-
const n = { ...Zi(), ...t }, r =
|
|
4916
|
+
const n = { ...Zi(), ...t }, r = Be(e, n);
|
|
4917
4917
|
r && (b.removeNodes(e, { at: r }), b.insertNodes(e, n, {
|
|
4918
4918
|
at: r,
|
|
4919
4919
|
select: !0
|
|
@@ -5662,7 +5662,7 @@ const Br = (e) => {
|
|
|
5662
5662
|
alignment: "center",
|
|
5663
5663
|
children: [{ type: "text", text: "" }]
|
|
5664
5664
|
}), Of = (e) => {
|
|
5665
|
-
const t =
|
|
5665
|
+
const t = Be(e, Xs());
|
|
5666
5666
|
t && (b.removeNodes(e, { at: t }), b.insertNodes(
|
|
5667
5667
|
e,
|
|
5668
5668
|
Xs(),
|
|
@@ -6626,7 +6626,7 @@ const Br = (e) => {
|
|
|
6626
6626
|
aspectRatio: "16:9",
|
|
6627
6627
|
children: [{ type: "text", text: "" }]
|
|
6628
6628
|
}), al = (e) => {
|
|
6629
|
-
const t =
|
|
6629
|
+
const t = Be(e, Zs());
|
|
6630
6630
|
t && (b.removeNodes(e, { at: t }), b.insertNodes(
|
|
6631
6631
|
e,
|
|
6632
6632
|
Zs(),
|
|
@@ -6873,7 +6873,7 @@ const Br = (e) => {
|
|
|
6873
6873
|
isInBlocksSelector: !0,
|
|
6874
6874
|
dragHandleTopMargin: "-2px",
|
|
6875
6875
|
handleConvert(e) {
|
|
6876
|
-
|
|
6876
|
+
Be(e, {
|
|
6877
6877
|
type: "paragraph"
|
|
6878
6878
|
});
|
|
6879
6879
|
},
|
|
@@ -6938,7 +6938,7 @@ const Br = (e) => {
|
|
|
6938
6938
|
matchNode: (e) => e.type === "quote",
|
|
6939
6939
|
isInBlocksSelector: !0,
|
|
6940
6940
|
handleConvert(e) {
|
|
6941
|
-
|
|
6941
|
+
Be(e, {
|
|
6942
6942
|
type: "quote"
|
|
6943
6943
|
});
|
|
6944
6944
|
},
|
|
@@ -7359,7 +7359,7 @@ const Br = (e) => {
|
|
|
7359
7359
|
});
|
|
7360
7360
|
const s = r.reduce((i, l) => Math.max(i, l.length), 0);
|
|
7361
7361
|
return { tablePath: t, rowCount: n.length, colCount: s, matrix: r, cells: o };
|
|
7362
|
-
}, Qo = (e, t) => e.cells.find((n) =>
|
|
7362
|
+
}, Qo = (e, t) => e.cells.find((n) => Ie.equals(n.path, t)), dl = (e, t) => e.cells.filter((n) => n.row === t), On = (e, t, n) => dl(e, t).filter((r) => r.col < n).length, Qs = (e, t, n) => e.row <= t && t < e.row + e.rowSpan && e.col <= n && n < e.col + e.colSpan, rm = (e, t) => {
|
|
7363
7363
|
const n = { ...t };
|
|
7364
7364
|
let r = !0;
|
|
7365
7365
|
for (; r; ) {
|
|
@@ -7512,7 +7512,7 @@ const Br = (e) => {
|
|
|
7512
7512
|
{ colSpan: Bn(c.colSpan - 1) },
|
|
7513
7513
|
{ at: c.path }
|
|
7514
7514
|
);
|
|
7515
|
-
}), l.map((c) => c.path).sort((c, d) =>
|
|
7515
|
+
}), l.map((c) => c.path).sort((c, d) => Ie.compare(d, c)).forEach((c) => b.removeNodes(e, { at: c }));
|
|
7516
7516
|
}), Yt(e, [
|
|
7517
7517
|
...t.tablePath,
|
|
7518
7518
|
r.row,
|
|
@@ -7611,7 +7611,7 @@ const Br = (e) => {
|
|
|
7611
7611
|
rowSpan: Bn(r.bottom - r.top + 1)
|
|
7612
7612
|
},
|
|
7613
7613
|
{ at: i.path }
|
|
7614
|
-
), l.map((u) => u.path).sort((u, p) =>
|
|
7614
|
+
), l.map((u) => u.path).sort((u, p) => Ie.compare(p, u)).forEach((u) => b.removeNodes(e, { at: u }));
|
|
7615
7615
|
}), Yt(e, [...o, i.row, i.indexInRow]);
|
|
7616
7616
|
}, gm = (e, t) => {
|
|
7617
7617
|
const { grid: n, focused: r, table: o, tablePath: s } = t;
|
|
@@ -7704,7 +7704,7 @@ const Br = (e) => {
|
|
|
7704
7704
|
outline: 2px solid ${({ theme: e }) => e.colors.primary600};
|
|
7705
7705
|
outline-offset: -2px;
|
|
7706
7706
|
}
|
|
7707
|
-
`,
|
|
7707
|
+
`, De = ({
|
|
7708
7708
|
label: e,
|
|
7709
7709
|
icon: t,
|
|
7710
7710
|
onAction: n,
|
|
@@ -7753,7 +7753,7 @@ const Br = (e) => {
|
|
|
7753
7753
|
const n = Mr(), { formatMessage: r } = z(), o = bm(e), s = vm(e), i = !!(e.range && ts(e.table, e.range)), l = (c, d) => r({ id: c, defaultMessage: d });
|
|
7754
7754
|
return /* @__PURE__ */ f(wm, { contentEditable: !1, gap: 0, alignItems: "center", children: [
|
|
7755
7755
|
/* @__PURE__ */ a(
|
|
7756
|
-
|
|
7756
|
+
De,
|
|
7757
7757
|
{
|
|
7758
7758
|
label: l("components.Blocks.table.insertRowAbove", "Insert row above"),
|
|
7759
7759
|
icon: qg,
|
|
@@ -7762,7 +7762,7 @@ const Br = (e) => {
|
|
|
7762
7762
|
}
|
|
7763
7763
|
),
|
|
7764
7764
|
/* @__PURE__ */ a(
|
|
7765
|
-
|
|
7765
|
+
De,
|
|
7766
7766
|
{
|
|
7767
7767
|
label: l("components.Blocks.table.insertRowBelow", "Insert row below"),
|
|
7768
7768
|
icon: Xg,
|
|
@@ -7771,7 +7771,7 @@ const Br = (e) => {
|
|
|
7771
7771
|
}
|
|
7772
7772
|
),
|
|
7773
7773
|
/* @__PURE__ */ a(
|
|
7774
|
-
|
|
7774
|
+
De,
|
|
7775
7775
|
{
|
|
7776
7776
|
label: l("components.Blocks.table.deleteRow", "Delete row"),
|
|
7777
7777
|
icon: Jg,
|
|
@@ -7782,7 +7782,7 @@ const Br = (e) => {
|
|
|
7782
7782
|
),
|
|
7783
7783
|
/* @__PURE__ */ a(nr, {}),
|
|
7784
7784
|
/* @__PURE__ */ a(
|
|
7785
|
-
|
|
7785
|
+
De,
|
|
7786
7786
|
{
|
|
7787
7787
|
label: l(
|
|
7788
7788
|
"components.Blocks.table.insertColumnLeft",
|
|
@@ -7794,7 +7794,7 @@ const Br = (e) => {
|
|
|
7794
7794
|
}
|
|
7795
7795
|
),
|
|
7796
7796
|
/* @__PURE__ */ a(
|
|
7797
|
-
|
|
7797
|
+
De,
|
|
7798
7798
|
{
|
|
7799
7799
|
label: l(
|
|
7800
7800
|
"components.Blocks.table.insertColumnRight",
|
|
@@ -7806,7 +7806,7 @@ const Br = (e) => {
|
|
|
7806
7806
|
}
|
|
7807
7807
|
),
|
|
7808
7808
|
/* @__PURE__ */ a(
|
|
7809
|
-
|
|
7809
|
+
De,
|
|
7810
7810
|
{
|
|
7811
7811
|
label: l("components.Blocks.table.deleteColumn", "Delete column"),
|
|
7812
7812
|
icon: Qg,
|
|
@@ -7817,7 +7817,7 @@ const Br = (e) => {
|
|
|
7817
7817
|
),
|
|
7818
7818
|
/* @__PURE__ */ a(nr, {}),
|
|
7819
7819
|
/* @__PURE__ */ a(
|
|
7820
|
-
|
|
7820
|
+
De,
|
|
7821
7821
|
{
|
|
7822
7822
|
label: i ? l(
|
|
7823
7823
|
"components.Blocks.table.mergeAcrossHeader",
|
|
@@ -7829,7 +7829,7 @@ const Br = (e) => {
|
|
|
7829
7829
|
}
|
|
7830
7830
|
),
|
|
7831
7831
|
/* @__PURE__ */ a(
|
|
7832
|
-
|
|
7832
|
+
De,
|
|
7833
7833
|
{
|
|
7834
7834
|
label: l("components.Blocks.table.splitCell", "Split cell"),
|
|
7835
7835
|
icon: nm,
|
|
@@ -7839,7 +7839,7 @@ const Br = (e) => {
|
|
|
7839
7839
|
),
|
|
7840
7840
|
/* @__PURE__ */ a(nr, {}),
|
|
7841
7841
|
km.map((c) => /* @__PURE__ */ a(
|
|
7842
|
-
|
|
7842
|
+
De,
|
|
7843
7843
|
{
|
|
7844
7844
|
label: l(c.id, c.defaultMessage),
|
|
7845
7845
|
icon: c.icon,
|
|
@@ -7851,7 +7851,7 @@ const Br = (e) => {
|
|
|
7851
7851
|
)),
|
|
7852
7852
|
/* @__PURE__ */ a(nr, {}),
|
|
7853
7853
|
/* @__PURE__ */ a(
|
|
7854
|
-
|
|
7854
|
+
De,
|
|
7855
7855
|
{
|
|
7856
7856
|
label: l(
|
|
7857
7857
|
"components.Blocks.table.toggleHeaderRow",
|
|
@@ -7864,7 +7864,7 @@ const Br = (e) => {
|
|
|
7864
7864
|
}
|
|
7865
7865
|
),
|
|
7866
7866
|
/* @__PURE__ */ a(
|
|
7867
|
-
|
|
7867
|
+
De,
|
|
7868
7868
|
{
|
|
7869
7869
|
label: l("components.Blocks.table.deleteTable", "Delete table"),
|
|
7870
7870
|
icon: fd,
|
|
@@ -7924,7 +7924,7 @@ const Br = (e) => {
|
|
|
7924
7924
|
children: t,
|
|
7925
7925
|
element: n
|
|
7926
7926
|
}) => {
|
|
7927
|
-
const r = Tr(), { disabled: o } = O("TableElement"), s = F.findPath(r, n), i = lm(r), l = !!(i &&
|
|
7927
|
+
const r = Tr(), { disabled: o } = O("TableElement"), s = F.findPath(r, n), i = lm(r), l = !!(i && Ie.equals(i.tablePath, s)), c = S.useMemo(
|
|
7928
7928
|
() => l && i ? {
|
|
7929
7929
|
grid: i.grid,
|
|
7930
7930
|
activeRow: i.rowIndex,
|
|
@@ -12153,7 +12153,7 @@ const We = ({
|
|
|
12153
12153
|
}) => {
|
|
12154
12154
|
const { editor: i } = O("ToolbarButton"), { formatMessage: l } = z(), c = l(n), d = r ? "primary600" : "neutral600";
|
|
12155
12155
|
return /* @__PURE__ */ a(Pn, { label: c, children: /* @__PURE__ */ a(
|
|
12156
|
-
|
|
12156
|
+
_e.ToggleItem,
|
|
12157
12157
|
{
|
|
12158
12158
|
value: t,
|
|
12159
12159
|
"data-state": r ? "on" : "off",
|
|
@@ -12373,7 +12373,7 @@ const We = ({
|
|
|
12373
12373
|
match: (v) => !k.isEditor(v) && "type" in v && v.type === "list-item"
|
|
12374
12374
|
});
|
|
12375
12375
|
if (m) {
|
|
12376
|
-
const [, v] = m, C =
|
|
12376
|
+
const [, v] = m, C = Ie.next(g);
|
|
12377
12377
|
b.moveNodes(o, {
|
|
12378
12378
|
at: v,
|
|
12379
12379
|
to: C
|
|
@@ -12980,7 +12980,7 @@ const We = ({
|
|
|
12980
12980
|
defaultMessage: "Horizontal line"
|
|
12981
12981
|
});
|
|
12982
12982
|
return /* @__PURE__ */ a(Pn, { label: r, children: /* @__PURE__ */ a(
|
|
12983
|
-
|
|
12983
|
+
_e.ToggleItem,
|
|
12984
12984
|
{
|
|
12985
12985
|
value: "horizontalLine",
|
|
12986
12986
|
"data-state": "off",
|
|
@@ -13011,7 +13011,7 @@ const We = ({
|
|
|
13011
13011
|
defaultMessage: "Inline math"
|
|
13012
13012
|
});
|
|
13013
13013
|
return /* @__PURE__ */ a(Pn, { label: r, children: /* @__PURE__ */ a(
|
|
13014
|
-
|
|
13014
|
+
_e.ToggleItem,
|
|
13015
13015
|
{
|
|
13016
13016
|
value: "inlineMath",
|
|
13017
13017
|
"data-state": "off",
|
|
@@ -13059,9 +13059,9 @@ const We = ({
|
|
|
13059
13059
|
String(c)
|
|
13060
13060
|
);
|
|
13061
13061
|
});
|
|
13062
|
-
return /* @__PURE__ */ a(
|
|
13062
|
+
return /* @__PURE__ */ a(_e.Root, { "aria-disabled": r, asChild: !0, children: /* @__PURE__ */ f(Vy, { padding: 2, width: "100%", children: [
|
|
13063
13063
|
/* @__PURE__ */ a(ky, {}),
|
|
13064
|
-
/* @__PURE__ */ a(
|
|
13064
|
+
/* @__PURE__ */ a(_e.ToggleGroup, { type: "multiple", asChild: !0, children: /* @__PURE__ */ f(yt, { children: [
|
|
13065
13065
|
/* @__PURE__ */ a(Jy, { disabled: r }),
|
|
13066
13066
|
/* @__PURE__ */ a(Qy, { disabled: r })
|
|
13067
13067
|
] }) }),
|
|
@@ -13074,12 +13074,12 @@ const We = ({
|
|
|
13074
13074
|
/* @__PURE__ */ a(Hl, {})
|
|
13075
13075
|
] }),
|
|
13076
13076
|
/* @__PURE__ */ a(vt, {}),
|
|
13077
|
-
/* @__PURE__ */ a(
|
|
13077
|
+
/* @__PURE__ */ a(_e.ToggleGroup, { type: "multiple", asChild: !0, children: /* @__PURE__ */ f(yt, { children: [
|
|
13078
13078
|
l,
|
|
13079
13079
|
/* @__PURE__ */ a(Wl, { disabled: i, location: "toolbar" })
|
|
13080
13080
|
] }) }),
|
|
13081
13081
|
/* @__PURE__ */ a(vt, {}),
|
|
13082
|
-
/* @__PURE__ */ a(
|
|
13082
|
+
/* @__PURE__ */ a(_e.ToggleGroup, { type: "single", asChild: !0, children: /* @__PURE__ */ f(yt, { children: [
|
|
13083
13083
|
/* @__PURE__ */ a(
|
|
13084
13084
|
lo,
|
|
13085
13085
|
{
|
|
@@ -13106,7 +13106,7 @@ const We = ({
|
|
|
13106
13106
|
)
|
|
13107
13107
|
] }) }),
|
|
13108
13108
|
/* @__PURE__ */ a(vt, {}),
|
|
13109
|
-
/* @__PURE__ */ a(
|
|
13109
|
+
/* @__PURE__ */ a(_e.ToggleGroup, { type: "multiple", asChild: !0, children: /* @__PURE__ */ f(yt, { children: [
|
|
13110
13110
|
/* @__PURE__ */ a(rv, { disabled: i }),
|
|
13111
13111
|
/* @__PURE__ */ a(ev, { disabled: i }),
|
|
13112
13112
|
/* @__PURE__ */ a(uv, { disabled: i }),
|
|
@@ -13115,7 +13115,7 @@ const We = ({
|
|
|
13115
13115
|
/* @__PURE__ */ a(Kl, { disabled: i })
|
|
13116
13116
|
] }) }),
|
|
13117
13117
|
/* @__PURE__ */ a(vt, {}),
|
|
13118
|
-
/* @__PURE__ */ a(
|
|
13118
|
+
/* @__PURE__ */ a(_e.ToggleGroup, { type: "multiple", asChild: !0, children: /* @__PURE__ */ f(yt, { children: [
|
|
13119
13119
|
/* @__PURE__ */ a(tv, { disabled: r }),
|
|
13120
13120
|
/* @__PURE__ */ a(nv, { disabled: r }),
|
|
13121
13121
|
/* @__PURE__ */ a(sv, { disabled: r }),
|
|
@@ -13340,7 +13340,7 @@ const We = ({
|
|
|
13340
13340
|
);
|
|
13341
13341
|
S.useEffect(() => {
|
|
13342
13342
|
const { selection: g } = e;
|
|
13343
|
-
if (!g || !
|
|
13343
|
+
if (!g || !Fe.isCollapsed(g)) {
|
|
13344
13344
|
n(!1);
|
|
13345
13345
|
return;
|
|
13346
13346
|
}
|
|
@@ -13604,7 +13604,7 @@ const We = ({
|
|
|
13604
13604
|
);
|
|
13605
13605
|
}, Ev = (e, t) => {
|
|
13606
13606
|
if (!e.selection) return;
|
|
13607
|
-
const r = [
|
|
13607
|
+
const r = [Fe.start(e.selection).path[0]];
|
|
13608
13608
|
let o = 0;
|
|
13609
13609
|
t.key === "ArrowUp" ? o = r[0] > 0 ? r[0] - 1 : r[0] : o = r[0] < e.children.length - 1 ? r[0] + 1 : r[0];
|
|
13610
13610
|
const s = [o];
|
|
@@ -13714,7 +13714,7 @@ const We = ({
|
|
|
13714
13714
|
[o, n, u, p]
|
|
13715
13715
|
), R = S.useCallback(
|
|
13716
13716
|
(_) => {
|
|
13717
|
-
if (!n.selection || !
|
|
13717
|
+
if (!n.selection || !Fe.isCollapsed(n.selection))
|
|
13718
13718
|
return;
|
|
13719
13719
|
const { anchor: L } = n.selection, j = k.string(
|
|
13720
13720
|
n,
|
|
@@ -14009,7 +14009,7 @@ const We = ({
|
|
|
14009
14009
|
}, []);
|
|
14010
14010
|
const i = S.useCallback(() => {
|
|
14011
14011
|
const { selection: l } = e;
|
|
14012
|
-
if (t || !l ||
|
|
14012
|
+
if (t || !l || Fe.isCollapsed(l) || !F.isFocused(e) || k.string(e, l) === "") return !1;
|
|
14013
14013
|
const c = e.children[l.anchor.path[0]];
|
|
14014
14014
|
return !(c && Av.includes(c.type));
|
|
14015
14015
|
}, [e, t]);
|
|
@@ -14035,7 +14035,7 @@ const We = ({
|
|
|
14035
14035
|
window.innerWidth - u - yn
|
|
14036
14036
|
);
|
|
14037
14037
|
l.style.top = `${g}px`, l.style.left = `${y}px`, l.dataset.visible = "true";
|
|
14038
|
-
}), /* @__PURE__ */ a(ui, { children: /* @__PURE__ */ a(
|
|
14038
|
+
}), /* @__PURE__ */ a(ui, { children: /* @__PURE__ */ a(_e.Root, { asChild: !0, children: /* @__PURE__ */ a(
|
|
14039
14039
|
_v,
|
|
14040
14040
|
{
|
|
14041
14041
|
ref: r,
|
|
@@ -14045,7 +14045,7 @@ const We = ({
|
|
|
14045
14045
|
role: "toolbar",
|
|
14046
14046
|
"aria-label": "Text formatting",
|
|
14047
14047
|
onMouseDown: (l) => l.preventDefault(),
|
|
14048
|
-
children: /* @__PURE__ */ a(
|
|
14048
|
+
children: /* @__PURE__ */ a(_e.ToggleGroup, { type: "multiple", asChild: !0, children: /* @__PURE__ */ f(B, { gap: 1, alignItems: "center", children: [
|
|
14049
14049
|
Rv.map((l) => {
|
|
14050
14050
|
const c = n[l];
|
|
14051
14051
|
return c ? /* @__PURE__ */ a(
|
|
@@ -14205,10 +14205,13 @@ const We = ({
|
|
|
14205
14205
|
}, Kv = (e) => {
|
|
14206
14206
|
const t = e, { isInline: n, apply: r, insertText: o } = t;
|
|
14207
14207
|
t.lastInsertedLinkPath = null, t.shouldSaveLinkPath = !0, t.isInline = (i) => "type" in i && i.type === "link" ? !0 : n(i), t.apply = (i) => {
|
|
14208
|
-
i.type === "insert_node" && "type" in i.node && i.node.type === "link" && t.shouldSaveLinkPath
|
|
14208
|
+
i.type === "insert_node" && "type" in i.node && i.node.type === "link" && t.shouldSaveLinkPath ? t.lastInsertedLinkPath = i.path : t.lastInsertedLinkPath && (t.lastInsertedLinkPath = Ie.transform(
|
|
14209
|
+
t.lastInsertedLinkPath,
|
|
14210
|
+
i
|
|
14211
|
+
)), r(i);
|
|
14209
14212
|
}, t.insertText = (i) => {
|
|
14210
14213
|
const { selection: l } = t;
|
|
14211
|
-
if (l &&
|
|
14214
|
+
if (l && Fe.isCollapsed(l)) {
|
|
14212
14215
|
const { anchor: c } = l, d = k.above(t, {
|
|
14213
14216
|
match: (C) => "type" in C && !k.isEditor(C) && C.type !== "link"
|
|
14214
14217
|
}), u = d ? d[1] : [], p = k.start(t, u), h = { anchor: c, focus: p }, g = k.string(t, h), y = g.trim(), m = /https?:\/\/\S+$/, v = y.match(m);
|
|
@@ -14227,7 +14230,7 @@ const We = ({
|
|
|
14227
14230
|
return t.insertData = (i) => {
|
|
14228
14231
|
const l = i.getData("text/plain");
|
|
14229
14232
|
if (l && /^https?:\/\/\S+$/.test(l)) {
|
|
14230
|
-
!t.selection ||
|
|
14233
|
+
!t.selection || Fe.isCollapsed(t.selection) ? (t.shouldSaveLinkPath = !0, ur(t, { url: l })) : (t.shouldSaveLinkPath = !0, ur(t, { url: l }));
|
|
14231
14234
|
return;
|
|
14232
14235
|
}
|
|
14233
14236
|
s(i);
|
|
@@ -14687,7 +14690,7 @@ const We = ({
|
|
|
14687
14690
|
], g0 = (e) => {
|
|
14688
14691
|
const { insertText: t } = e;
|
|
14689
14692
|
return e.insertText = (n) => {
|
|
14690
|
-
if (n === " " && e.selection &&
|
|
14693
|
+
if (n === " " && e.selection && Fe.isCollapsed(e.selection)) {
|
|
14691
14694
|
const { anchor: r } = e.selection, o = k.above(e, {
|
|
14692
14695
|
match: (s) => !k.isEditor(s) && "type" in s && s.type !== "text"
|
|
14693
14696
|
});
|
|
@@ -15135,7 +15138,7 @@ let wt = {
|
|
|
15135
15138
|
return n === null && (s += '\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'), s;
|
|
15136
15139
|
},
|
|
15137
15140
|
defined: "${path} must be defined"
|
|
15138
|
-
},
|
|
15141
|
+
}, Re = {
|
|
15139
15142
|
length: "${path} must be exactly ${length} characters",
|
|
15140
15143
|
min: "${path} must be at least ${min} characters",
|
|
15141
15144
|
max: "${path} must be at most ${max} characters",
|
|
@@ -15168,7 +15171,7 @@ let wt = {
|
|
|
15168
15171
|
};
|
|
15169
15172
|
Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
15170
15173
|
mixed: wt,
|
|
15171
|
-
string:
|
|
15174
|
+
string: Re,
|
|
15172
15175
|
number: _0,
|
|
15173
15176
|
date: Fo,
|
|
15174
15177
|
object: N0,
|
|
@@ -16669,8 +16672,8 @@ for (const e of ["validate", "validateSync"]) He.prototype[`${e}At`] = function(
|
|
|
16669
16672
|
for (const e of ["equals", "is"]) He.prototype[e] = He.prototype.oneOf;
|
|
16670
16673
|
for (const e of ["not", "nope"]) He.prototype[e] = He.prototype.notOneOf;
|
|
16671
16674
|
He.prototype.optional = He.prototype.notRequired;
|
|
16672
|
-
const
|
|
16673
|
-
let KM = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i, GM = /^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i, VM = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i, qM = (e) =>
|
|
16675
|
+
const Ae = (e) => e == null;
|
|
16676
|
+
let KM = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i, GM = /^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i, VM = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i, qM = (e) => Ae(e) || e === e.trim(), XM = {}.toString();
|
|
16674
16677
|
function kn() {
|
|
16675
16678
|
return new Rc();
|
|
16676
16679
|
}
|
|
@@ -16692,7 +16695,7 @@ class Rc extends He {
|
|
|
16692
16695
|
_isPresent(t) {
|
|
16693
16696
|
return super._isPresent(t) && !!t.length;
|
|
16694
16697
|
}
|
|
16695
|
-
length(t, n =
|
|
16698
|
+
length(t, n = Re.length) {
|
|
16696
16699
|
return this.test({
|
|
16697
16700
|
message: n,
|
|
16698
16701
|
name: "length",
|
|
@@ -16701,11 +16704,11 @@ class Rc extends He {
|
|
|
16701
16704
|
length: t
|
|
16702
16705
|
},
|
|
16703
16706
|
test(r) {
|
|
16704
|
-
return
|
|
16707
|
+
return Ae(r) || r.length === this.resolve(t);
|
|
16705
16708
|
}
|
|
16706
16709
|
});
|
|
16707
16710
|
}
|
|
16708
|
-
min(t, n =
|
|
16711
|
+
min(t, n = Re.min) {
|
|
16709
16712
|
return this.test({
|
|
16710
16713
|
message: n,
|
|
16711
16714
|
name: "min",
|
|
@@ -16714,11 +16717,11 @@ class Rc extends He {
|
|
|
16714
16717
|
min: t
|
|
16715
16718
|
},
|
|
16716
16719
|
test(r) {
|
|
16717
|
-
return
|
|
16720
|
+
return Ae(r) || r.length >= this.resolve(t);
|
|
16718
16721
|
}
|
|
16719
16722
|
});
|
|
16720
16723
|
}
|
|
16721
|
-
max(t, n =
|
|
16724
|
+
max(t, n = Re.max) {
|
|
16722
16725
|
return this.test({
|
|
16723
16726
|
name: "max",
|
|
16724
16727
|
exclusive: !0,
|
|
@@ -16727,7 +16730,7 @@ class Rc extends He {
|
|
|
16727
16730
|
max: t
|
|
16728
16731
|
},
|
|
16729
16732
|
test(r) {
|
|
16730
|
-
return
|
|
16733
|
+
return Ae(r) || r.length <= this.resolve(t);
|
|
16731
16734
|
}
|
|
16732
16735
|
});
|
|
16733
16736
|
}
|
|
@@ -16739,28 +16742,28 @@ class Rc extends He {
|
|
|
16739
16742
|
name: s
|
|
16740
16743
|
} = n : o = n), this.test({
|
|
16741
16744
|
name: s || "matches",
|
|
16742
|
-
message: o ||
|
|
16745
|
+
message: o || Re.matches,
|
|
16743
16746
|
params: {
|
|
16744
16747
|
regex: t
|
|
16745
16748
|
},
|
|
16746
|
-
test: (i) =>
|
|
16749
|
+
test: (i) => Ae(i) || i === "" && r || i.search(t) !== -1
|
|
16747
16750
|
});
|
|
16748
16751
|
}
|
|
16749
|
-
email(t =
|
|
16752
|
+
email(t = Re.email) {
|
|
16750
16753
|
return this.matches(KM, {
|
|
16751
16754
|
name: "email",
|
|
16752
16755
|
message: t,
|
|
16753
16756
|
excludeEmptyString: !0
|
|
16754
16757
|
});
|
|
16755
16758
|
}
|
|
16756
|
-
url(t =
|
|
16759
|
+
url(t = Re.url) {
|
|
16757
16760
|
return this.matches(GM, {
|
|
16758
16761
|
name: "url",
|
|
16759
16762
|
message: t,
|
|
16760
16763
|
excludeEmptyString: !0
|
|
16761
16764
|
});
|
|
16762
16765
|
}
|
|
16763
|
-
uuid(t =
|
|
16766
|
+
uuid(t = Re.uuid) {
|
|
16764
16767
|
return this.matches(VM, {
|
|
16765
16768
|
name: "uuid",
|
|
16766
16769
|
message: t,
|
|
@@ -16771,27 +16774,27 @@ class Rc extends He {
|
|
|
16771
16774
|
ensure() {
|
|
16772
16775
|
return this.default("").transform((t) => t === null ? "" : t);
|
|
16773
16776
|
}
|
|
16774
|
-
trim(t =
|
|
16777
|
+
trim(t = Re.trim) {
|
|
16775
16778
|
return this.transform((n) => n != null ? n.trim() : n).test({
|
|
16776
16779
|
message: t,
|
|
16777
16780
|
name: "trim",
|
|
16778
16781
|
test: qM
|
|
16779
16782
|
});
|
|
16780
16783
|
}
|
|
16781
|
-
lowercase(t =
|
|
16782
|
-
return this.transform((n) =>
|
|
16784
|
+
lowercase(t = Re.lowercase) {
|
|
16785
|
+
return this.transform((n) => Ae(n) ? n : n.toLowerCase()).test({
|
|
16783
16786
|
message: t,
|
|
16784
16787
|
name: "string_case",
|
|
16785
16788
|
exclusive: !0,
|
|
16786
|
-
test: (n) =>
|
|
16789
|
+
test: (n) => Ae(n) || n === n.toLowerCase()
|
|
16787
16790
|
});
|
|
16788
16791
|
}
|
|
16789
|
-
uppercase(t =
|
|
16790
|
-
return this.transform((n) =>
|
|
16792
|
+
uppercase(t = Re.uppercase) {
|
|
16793
|
+
return this.transform((n) => Ae(n) ? n : n.toUpperCase()).test({
|
|
16791
16794
|
message: t,
|
|
16792
16795
|
name: "string_case",
|
|
16793
16796
|
exclusive: !0,
|
|
16794
|
-
test: (n) =>
|
|
16797
|
+
test: (n) => Ae(n) || n === n.toUpperCase()
|
|
16795
16798
|
});
|
|
16796
16799
|
}
|
|
16797
16800
|
}
|
|
@@ -16840,7 +16843,7 @@ class QM extends He {
|
|
|
16840
16843
|
min: t
|
|
16841
16844
|
},
|
|
16842
16845
|
test(o) {
|
|
16843
|
-
return
|
|
16846
|
+
return Ae(o) || o >= this.resolve(r);
|
|
16844
16847
|
}
|
|
16845
16848
|
});
|
|
16846
16849
|
}
|
|
@@ -16854,7 +16857,7 @@ class QM extends He {
|
|
|
16854
16857
|
max: t
|
|
16855
16858
|
},
|
|
16856
16859
|
test(o) {
|
|
16857
|
-
return
|
|
16860
|
+
return Ae(o) || o <= this.resolve(r);
|
|
16858
16861
|
}
|
|
16859
16862
|
});
|
|
16860
16863
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qkix/strapi-plugin-better-blocks",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.11",
|
|
4
4
|
"description": "An enhanced Rich Text (Blocks) field for Strapi with inline color picker and more",
|
|
5
5
|
"strapi": {
|
|
6
6
|
"kind": "plugin",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"remark-parse": "^11.0.0",
|
|
56
56
|
"shiki": "^4.3.0",
|
|
57
57
|
"unified": "^11.0.5",
|
|
58
|
-
"@qkix/better-blocks-core": "^0.2.
|
|
58
|
+
"@qkix/better-blocks-core": "^0.2.8"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@strapi/sdk-plugin": "^5.3.2",
|
|
@@ -88,9 +88,9 @@
|
|
|
88
88
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
89
89
|
"react-intl": "^6.0.0 || ^7.0.0",
|
|
90
90
|
"react-router-dom": "^6.0.0",
|
|
91
|
-
"slate": "0.94.1",
|
|
92
|
-
"slate-history": "0.93.0",
|
|
93
|
-
"slate-react": "0.98.3",
|
|
91
|
+
"slate": "^0.94.1",
|
|
92
|
+
"slate-history": "^0.93.0",
|
|
93
|
+
"slate-react": "^0.98.3",
|
|
94
94
|
"styled-components": "^6.0.0"
|
|
95
95
|
},
|
|
96
96
|
"engines": {
|