@chaibuilder/sdk 2.2.9 → 2.2.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/core.cjs +3 -3
- package/dist/core.js +163 -148
- package/dist/{new-blocks-render-helpers-BrYtxlrw.js → new-blocks-render-helpers-BGcG63he.js} +34 -32
- package/dist/new-blocks-render-helpers-DRQ8Buz8.cjs +1 -0
- package/dist/render.cjs +2 -2
- package/dist/render.js +2 -2
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +2 -1
- package/package.json +1 -1
- package/dist/new-blocks-render-helpers-DxkhHL0n.cjs +0 -1
package/dist/core.js
CHANGED
|
@@ -15,7 +15,7 @@ import { ChevronRight, PlusIcon as PlusIcon$1, DatabaseIcon, ChevronLeft, Chevro
|
|
|
15
15
|
import clsx$1, { clsx } from "clsx";
|
|
16
16
|
import { twMerge } from "tailwind-merge";
|
|
17
17
|
import TreeModel from "tree-model";
|
|
18
|
-
import { S as STYLES_KEY, e as getSplitChaiClasses, a as applyBinding, b as applyLanguage, g as getBlockTagAttributes, c as getBlockRuntimeProps, d as applyLimit, R as ROOT_TEMP_KEY } from "./new-blocks-render-helpers-
|
|
18
|
+
import { S as STYLES_KEY, e as getSplitChaiClasses, a as applyBinding, b as applyLanguage, g as getBlockTagAttributes, c as getBlockRuntimeProps, d as applyLimit, R as ROOT_TEMP_KEY } from "./new-blocks-render-helpers-BGcG63he.js";
|
|
19
19
|
import { d as defaultThemeOptions, f as defaultThemeValues, a as getChaiThemeCssVariables, g as getChaiThemeOptions, p as plugin, e as getThemeFontsLinkMarkup, h as getThemeCustomFontFace } from "./plugin-fnBB3TCm.js";
|
|
20
20
|
import Fuse from "fuse.js";
|
|
21
21
|
import { useDebouncedCallback, useThrottledCallback, useResizeObserver, useIntervalEffect } from "@react-hookz/web";
|
|
@@ -760,7 +760,7 @@ const useUndoManager = () => {
|
|
|
760
760
|
return {
|
|
761
761
|
moveBlocks: (x, y, b) => {
|
|
762
762
|
const v = map(x, (A) => {
|
|
763
|
-
const _ = r.find((
|
|
763
|
+
const _ = r.find((T) => T._id === A)._parent || null, B = r.filter((T) => _ ? T._parent === _ : !T._parent).map((T) => T._id).indexOf(A);
|
|
764
764
|
return { _id: A, oldParent: _, oldPosition: B };
|
|
765
765
|
}), w = v.find(({ _id: A }) => A === x[0]);
|
|
766
766
|
w && w.oldParent === y && w.oldPosition === b || (i(x, y, b), o({
|
|
@@ -3561,14 +3561,14 @@ const JSONFormFieldTemplate = ({
|
|
|
3561
3561
|
formData: g,
|
|
3562
3562
|
onChange: h
|
|
3563
3563
|
}) => {
|
|
3564
|
-
const { selectedLang: m, fallbackLang: f, languages: x } = useLanguages(), y = isEmpty(x) ? "" : isEmpty(m) ? f : m, b = get(LANGUAGES, y, y), v = usePageExternalData(), w = useSelectedBlock(), A = useRegisteredChaiBlocks(), E = get(A, [w == null ? void 0 : w._type, "i18nProps"], []) || [], [_, S] = useState(null), B = useSelectedBlockHierarchy(),
|
|
3564
|
+
const { selectedLang: m, fallbackLang: f, languages: x } = useLanguages(), y = isEmpty(x) ? "" : isEmpty(m) ? f : m, b = get(LANGUAGES, y, y), v = usePageExternalData(), w = useSelectedBlock(), A = useRegisteredChaiBlocks(), E = get(A, [w == null ? void 0 : w._type, "i18nProps"], []) || [], [_, S] = useState(null), B = useSelectedBlockHierarchy(), T = useMemo(() => B.length === 1 ? "" : `#${get(
|
|
3565
3565
|
B.find((L) => L._type === "Repeater"),
|
|
3566
3566
|
"repeaterItems",
|
|
3567
3567
|
""
|
|
3568
|
-
).replace(/\{\{(.*)\}\}/g, "$1")}`, [B]), C = useMemo(() => first(get(v,
|
|
3569
|
-
(
|
|
3570
|
-
if (
|
|
3571
|
-
h(`{{${
|
|
3568
|
+
).replace(/\{\{(.*)\}\}/g, "$1")}`, [B]), C = useMemo(() => first(get(v, T.replace("#", ""), [])), [T, v]), k = useCallback(
|
|
3569
|
+
(N, P) => {
|
|
3570
|
+
if (N = isEmpty(T) ? N : N.replace(`${T}.`, "$index."), P === "array" || P === "object") {
|
|
3571
|
+
h(`{{${N}}}`, {}, o);
|
|
3572
3572
|
return;
|
|
3573
3573
|
}
|
|
3574
3574
|
const L = (D) => /[.,!?;:]/.test(D), O = (D, M, H) => {
|
|
@@ -3585,7 +3585,7 @@ const JSONFormFieldTemplate = ({
|
|
|
3585
3585
|
if (R && (R.querySelector(".ProseMirror") || R.__chaiRTE)) {
|
|
3586
3586
|
const D = R.__chaiRTE;
|
|
3587
3587
|
if (D) {
|
|
3588
|
-
const M = `{{${
|
|
3588
|
+
const M = `{{${N}}}`;
|
|
3589
3589
|
D.commands.focus();
|
|
3590
3590
|
const { from: H, to: F } = D.state.selection;
|
|
3591
3591
|
if (H !== F)
|
|
@@ -3603,31 +3603,31 @@ const JSONFormFieldTemplate = ({
|
|
|
3603
3603
|
} else {
|
|
3604
3604
|
const D = $, M = D.selectionStart || 0, H = D.value || "", F = D.selectionEnd || M;
|
|
3605
3605
|
if (F > M) {
|
|
3606
|
-
const G = `{{${
|
|
3606
|
+
const G = `{{${N}}}`, { text: Y } = O(H, M, G), q = H.slice(0, M) + Y + H.slice(F);
|
|
3607
3607
|
h(q, {}, o);
|
|
3608
3608
|
return;
|
|
3609
3609
|
}
|
|
3610
|
-
const U = `{{${
|
|
3610
|
+
const U = `{{${N}}}`, { text: V } = O(H, M, U), K = H.slice(0, M) + V + H.slice(M);
|
|
3611
3611
|
h(K, {}, o);
|
|
3612
3612
|
}
|
|
3613
3613
|
},
|
|
3614
|
-
[o, h, g, w == null ? void 0 : w._id,
|
|
3614
|
+
[o, h, g, w == null ? void 0 : w._id, T]
|
|
3615
3615
|
);
|
|
3616
3616
|
if (c)
|
|
3617
3617
|
return null;
|
|
3618
3618
|
if (u.type === "boolean") return /* @__PURE__ */ jsx("div", { className: r, children: a });
|
|
3619
|
-
const
|
|
3619
|
+
const I = E == null ? void 0 : E.includes(o.replace("root.", ""));
|
|
3620
3620
|
if (u.type === "array") {
|
|
3621
|
-
const
|
|
3621
|
+
const N = _ === o;
|
|
3622
3622
|
return /* @__PURE__ */ jsxs("div", { className: `${r} relative`, children: [
|
|
3623
3623
|
u.title && /* @__PURE__ */ jsxs(
|
|
3624
3624
|
"label",
|
|
3625
3625
|
{
|
|
3626
3626
|
htmlFor: o,
|
|
3627
|
-
onClick: () => S(
|
|
3627
|
+
onClick: () => S(N ? null : o),
|
|
3628
3628
|
className: "flex cursor-pointer items-center gap-x-1 py-1 leading-tight duration-200 hover:bg-slate-100",
|
|
3629
3629
|
children: [
|
|
3630
|
-
|
|
3630
|
+
N ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-3 w-3" }),
|
|
3631
3631
|
/* @__PURE__ */ jsx(List, { className: "h-3 w-3" }),
|
|
3632
3632
|
/* @__PURE__ */ jsx("span", { className: "leading-tight", children: n }),
|
|
3633
3633
|
" ",
|
|
@@ -3635,7 +3635,7 @@ const JSONFormFieldTemplate = ({
|
|
|
3635
3635
|
]
|
|
3636
3636
|
}
|
|
3637
3637
|
),
|
|
3638
|
-
(g == null ? void 0 : g.length) === 0 ? /* @__PURE__ */ jsx("div", { className: "h-0 overflow-hidden", children: a }) : /* @__PURE__ */ jsxs("div", { className: `${
|
|
3638
|
+
(g == null ? void 0 : g.length) === 0 ? /* @__PURE__ */ jsx("div", { className: "h-0 overflow-hidden", children: a }) : /* @__PURE__ */ jsxs("div", { className: `${N ? "pt-0.5" : "h-0 overflow-hidden"}`, children: [
|
|
3639
3639
|
d,
|
|
3640
3640
|
a,
|
|
3641
3641
|
l,
|
|
@@ -3648,7 +3648,7 @@ const JSONFormFieldTemplate = ({
|
|
|
3648
3648
|
/* @__PURE__ */ jsxs("label", { htmlFor: o, className: u.type === "object" ? "pb-2" : "", children: [
|
|
3649
3649
|
n,
|
|
3650
3650
|
" ",
|
|
3651
|
-
|
|
3651
|
+
I && /* @__PURE__ */ jsxs("small", { className: "text-[9px] text-zinc-400", children: [
|
|
3652
3652
|
" ",
|
|
3653
3653
|
b
|
|
3654
3654
|
] }),
|
|
@@ -3658,7 +3658,7 @@ const JSONFormFieldTemplate = ({
|
|
|
3658
3658
|
NestedPathSelector,
|
|
3659
3659
|
{
|
|
3660
3660
|
data: {
|
|
3661
|
-
...C && { [
|
|
3661
|
+
...C && { [T]: C },
|
|
3662
3662
|
...v
|
|
3663
3663
|
},
|
|
3664
3664
|
onSelect: k,
|
|
@@ -3850,8 +3850,8 @@ const ImagePickerField = ({ value: o, onChange: r, id: n, onBlur: a }) => {
|
|
|
3850
3850
|
pageTypes: r,
|
|
3851
3851
|
onChange: n
|
|
3852
3852
|
}) => {
|
|
3853
|
-
var
|
|
3854
|
-
const { t: a } = useTranslation(), l = useBuilderProp("searchPageTypeItems", (C, k) => []), [i, d] = useState(!1), [c, p] = useState(!1), [u, g] = useState("page"), [h, m] = useState(""), [f, x] = useState([]), [y, b] = useState(-1), v = useRef(null), w = (
|
|
3853
|
+
var T;
|
|
3854
|
+
const { t: a } = useTranslation(), l = useBuilderProp("searchPageTypeItems", (C, k) => []), [i, d] = useState(!1), [c, p] = useState(!1), [u, g] = useState("page"), [h, m] = useState(""), [f, x] = useState([]), [y, b] = useState(-1), v = useRef(null), w = (T = r == null ? void 0 : r.find((C) => C.key === u)) == null ? void 0 : T.name;
|
|
3855
3855
|
useEffect(() => {
|
|
3856
3856
|
if (m(""), x([]), b(-1), p(!1), !o || i || !startsWith(o, "pageType:")) return;
|
|
3857
3857
|
const C = split(o, ":"), k = get(C, 1, "page") || "page";
|
|
@@ -4829,11 +4829,11 @@ const BlockStylingProps = () => {
|
|
|
4829
4829
|
}
|
|
4830
4830
|
if (get(k, "value") === "")
|
|
4831
4831
|
return;
|
|
4832
|
-
const
|
|
4833
|
-
C ? S(
|
|
4832
|
+
const N = `${get(k, "value", "").startsWith("-") ? "-" : ""}${c}[${get(k, "value", "").replace("-", "")}${j === "-" ? "" : j}]`;
|
|
4833
|
+
C ? S(N) : _(N);
|
|
4834
4834
|
},
|
|
4835
4835
|
[_, S, a, h, c, u]
|
|
4836
|
-
),
|
|
4836
|
+
), T = useCallback(
|
|
4837
4837
|
(C) => {
|
|
4838
4838
|
const k = getUserInputValues(`${a}`, u);
|
|
4839
4839
|
if (get(k, "error", !1)) {
|
|
@@ -4846,8 +4846,8 @@ const BlockStylingProps = () => {
|
|
|
4846
4846
|
}
|
|
4847
4847
|
if (get(k, "value") === "")
|
|
4848
4848
|
return;
|
|
4849
|
-
const j = get(k, "unit") !== "" ? get(k, "unit") : C,
|
|
4850
|
-
_(
|
|
4849
|
+
const j = get(k, "unit") !== "" ? get(k, "unit") : C, N = `${get(k, "value", "").startsWith("-") ? "-" : ""}${c}[${get(k, "value", "").replace("-", "")}${j === "-" ? "" : j}]`;
|
|
4850
|
+
_(N);
|
|
4851
4851
|
},
|
|
4852
4852
|
[_, a, c, u]
|
|
4853
4853
|
);
|
|
@@ -4880,7 +4880,7 @@ const BlockStylingProps = () => {
|
|
|
4880
4880
|
const k = parseInt$1(C.target.value);
|
|
4881
4881
|
let j = isNaN$1(k) ? 0 : k;
|
|
4882
4882
|
C.keyCode === 38 && (j += 1), C.keyCode === 40 && (j -= 1);
|
|
4883
|
-
const
|
|
4883
|
+
const I = `${j}`, P = `${I.startsWith("-") ? "-" : ""}${c}[${I.replace("-", "")}${h === "-" ? "" : h}]`;
|
|
4884
4884
|
S(P);
|
|
4885
4885
|
},
|
|
4886
4886
|
onKeyUp: (C) => {
|
|
@@ -4920,7 +4920,7 @@ const BlockStylingProps = () => {
|
|
|
4920
4920
|
units: u,
|
|
4921
4921
|
current: h,
|
|
4922
4922
|
onSelect: (C) => {
|
|
4923
|
-
n(!1), m(C),
|
|
4923
|
+
n(!1), m(C), T(C);
|
|
4924
4924
|
}
|
|
4925
4925
|
}
|
|
4926
4926
|
) })
|
|
@@ -4933,15 +4933,15 @@ const BlockStylingProps = () => {
|
|
|
4933
4933
|
onDragEnd: (C) => {
|
|
4934
4934
|
if (b(() => ""), w(!1), isEmpty(C))
|
|
4935
4935
|
return;
|
|
4936
|
-
const k = `${C}`,
|
|
4937
|
-
_(
|
|
4936
|
+
const k = `${C}`, I = `${k.startsWith("-") ? "-" : ""}${c}[${k.replace("-", "")}${h === "-" ? "" : h}]`;
|
|
4937
|
+
_(I);
|
|
4938
4938
|
},
|
|
4939
4939
|
onDrag: (C) => {
|
|
4940
4940
|
if (isEmpty(C))
|
|
4941
4941
|
return;
|
|
4942
4942
|
b(C);
|
|
4943
|
-
const k = `${C}`,
|
|
4944
|
-
S(
|
|
4943
|
+
const k = `${C}`, I = `${k.startsWith("-") ? "-" : ""}${c}[${k.replace("-", "")}${h === "-" ? "" : h}]`;
|
|
4944
|
+
S(I);
|
|
4945
4945
|
},
|
|
4946
4946
|
currentValue: a,
|
|
4947
4947
|
unit: h,
|
|
@@ -5406,9 +5406,9 @@ const COLOR_PROP = {
|
|
|
5406
5406
|
const { t: r } = useTranslation(), { type: n = "icons", label: a, property: l, onEmitChange: i = () => {
|
|
5407
5407
|
}, units: d, negative: c = !1 } = o, [p] = useDarkMode(), [u] = useStylingState(), [, g] = useScreenSizeWidth(), h = useCurrentClassByProperty(l), m = useAddClassesToBlocks(), f = useRemoveClassesFromBlocks(), [x] = useSelectedBlockIds(), y = useMemo(() => get(h, "fullCls", ""), [h]), b = useCallback(
|
|
5408
5408
|
(S, B = !0) => {
|
|
5409
|
-
const
|
|
5410
|
-
(p || u !== "") && (
|
|
5411
|
-
const C = generateFullClsName(
|
|
5409
|
+
const T = { dark: p, mq: g, mod: u, cls: S, property: l, fullCls: "" };
|
|
5410
|
+
(p || u !== "") && (T.mq = "xs");
|
|
5411
|
+
const C = generateFullClsName(T);
|
|
5412
5412
|
m(x, [C], B);
|
|
5413
5413
|
},
|
|
5414
5414
|
[x, p, g, u, l, m]
|
|
@@ -5851,12 +5851,12 @@ const AskAIStyles = ({ blockId: o }) => {
|
|
|
5851
5851
|
] });
|
|
5852
5852
|
};
|
|
5853
5853
|
function ManualClasses() {
|
|
5854
|
-
var
|
|
5855
|
-
const o = useRef(null), [r, n] = useState(""), [a, l] = useState(-1), i = useFuseSearch(), { t: d } = useTranslation(), [c] = useSelectedStylingBlocks(), p = useSelectedBlock(), u = useAddClassesToBlocks(), g = useRemoveClassesFromBlocks(), [h] = useSelectedBlockIds(), m = useBuilderProp("askAiCallBack", null), [f, x] = useState(""), y = (
|
|
5856
|
-
const
|
|
5857
|
-
u(h,
|
|
5858
|
-
}, [A, E] = useState([]), _ = ({ value:
|
|
5859
|
-
const P =
|
|
5854
|
+
var I;
|
|
5855
|
+
const o = useRef(null), [r, n] = useState(""), [a, l] = useState(-1), i = useFuseSearch(), { t: d } = useTranslation(), [c] = useSelectedStylingBlocks(), p = useSelectedBlock(), u = useAddClassesToBlocks(), g = useRemoveClassesFromBlocks(), [h] = useSelectedBlockIds(), m = useBuilderProp("askAiCallBack", null), [f, x] = useState(""), y = (I = first(c)) == null ? void 0 : I.prop, { classes: b } = getSplitChaiClasses(get(p, y, "")), v = b.split(" ").filter((N) => !isEmpty(N)), w = () => {
|
|
5856
|
+
const N = f.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
5857
|
+
u(h, N, !0), x("");
|
|
5858
|
+
}, [A, E] = useState([]), _ = ({ value: N }) => {
|
|
5859
|
+
const P = N.trim().toLowerCase(), L = P.match(/.+:/g);
|
|
5860
5860
|
let O = [];
|
|
5861
5861
|
if (L && L.length > 0) {
|
|
5862
5862
|
const [$] = L, R = P.replace($, "");
|
|
@@ -5869,7 +5869,7 @@ function ManualClasses() {
|
|
|
5869
5869
|
return E(map(O, "item"));
|
|
5870
5870
|
}, S = () => {
|
|
5871
5871
|
E([]);
|
|
5872
|
-
}, B = (
|
|
5872
|
+
}, B = (N) => N.name, T = (N) => /* @__PURE__ */ jsx("div", { className: "rounded-md p-1", children: N.name }), C = useMemo(
|
|
5873
5873
|
() => ({
|
|
5874
5874
|
ref: o,
|
|
5875
5875
|
autoComplete: "off",
|
|
@@ -5878,17 +5878,22 @@ function ManualClasses() {
|
|
|
5878
5878
|
spellCheck: !1,
|
|
5879
5879
|
placeholder: d("Enter classes separated by space"),
|
|
5880
5880
|
value: f,
|
|
5881
|
-
|
|
5882
|
-
|
|
5881
|
+
onFocus: (N) => {
|
|
5882
|
+
setTimeout(() => {
|
|
5883
|
+
N.target && N.target.select();
|
|
5884
|
+
}, 0);
|
|
5883
5885
|
},
|
|
5884
|
-
|
|
5886
|
+
onKeyDown: (N) => {
|
|
5887
|
+
N.key === "Enter" && f.trim() !== "" && w();
|
|
5888
|
+
},
|
|
5889
|
+
onChange: (N, { newValue: P }) => x(P),
|
|
5885
5890
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
5886
5891
|
}),
|
|
5887
5892
|
[f, d, o]
|
|
5888
|
-
), k = (
|
|
5893
|
+
), k = (N) => {
|
|
5889
5894
|
debugger;
|
|
5890
5895
|
const P = r.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
5891
|
-
g(h, [
|
|
5896
|
+
g(h, [N]), u(h, P, !0), n(""), l(-1);
|
|
5892
5897
|
}, j = () => {
|
|
5893
5898
|
if (navigator.clipboard === void 0) {
|
|
5894
5899
|
toast.error(d("Clipboard not supported"));
|
|
@@ -5921,7 +5926,7 @@ function ManualClasses() {
|
|
|
5921
5926
|
onSuggestionsFetchRequested: _,
|
|
5922
5927
|
onSuggestionsClearRequested: S,
|
|
5923
5928
|
getSuggestionValue: B,
|
|
5924
|
-
renderSuggestion:
|
|
5929
|
+
renderSuggestion: T,
|
|
5925
5930
|
inputProps: C,
|
|
5926
5931
|
containerProps: {
|
|
5927
5932
|
className: "relative h-8 w-full gap-y-1 py-1 border-border text-xs"
|
|
@@ -5946,37 +5951,47 @@ function ManualClasses() {
|
|
|
5946
5951
|
)
|
|
5947
5952
|
] }),
|
|
5948
5953
|
/* @__PURE__ */ jsx("div", { className: "flex w-full flex-wrap gap-2 overflow-x-hidden", children: v.map(
|
|
5949
|
-
(
|
|
5954
|
+
(N, P) => a === P ? /* @__PURE__ */ jsx(
|
|
5950
5955
|
"input",
|
|
5951
5956
|
{
|
|
5952
5957
|
ref: o,
|
|
5953
5958
|
value: r,
|
|
5954
5959
|
onChange: (L) => n(L.target.value),
|
|
5955
5960
|
onBlur: () => {
|
|
5956
|
-
k(
|
|
5961
|
+
k(N);
|
|
5957
5962
|
},
|
|
5958
5963
|
onKeyDown: (L) => {
|
|
5959
|
-
L.key === "Enter" && k(
|
|
5964
|
+
L.key === "Enter" && k(N);
|
|
5965
|
+
},
|
|
5966
|
+
onFocus: (L) => {
|
|
5967
|
+
setTimeout(() => {
|
|
5968
|
+
L.target.select();
|
|
5969
|
+
}, 0);
|
|
5960
5970
|
},
|
|
5961
5971
|
className: "group relative flex max-w-[260px] cursor-default items-center gap-x-1 truncate break-words rounded border border-border bg-gray-200 p-px px-1.5 pr-2 text-[11px] text-gray-600 hover:border-gray-300 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300"
|
|
5962
5972
|
},
|
|
5963
|
-
|
|
5973
|
+
N
|
|
5964
5974
|
) : /* @__PURE__ */ jsxs(
|
|
5965
5975
|
"button",
|
|
5966
5976
|
{
|
|
5977
|
+
onDoubleClick: () => {
|
|
5978
|
+
x(N), g(h, [N]), setTimeout(() => {
|
|
5979
|
+
o.current && o.current.focus();
|
|
5980
|
+
}, 10);
|
|
5981
|
+
},
|
|
5967
5982
|
className: "group relative flex max-w-[260px] cursor-default items-center gap-x-1 truncate break-words rounded border border-border bg-gray-200 p-px px-1.5 pr-2 text-[11px] text-gray-600 hover:border-gray-300 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300",
|
|
5968
5983
|
children: [
|
|
5969
|
-
|
|
5970
|
-
r !==
|
|
5984
|
+
N,
|
|
5985
|
+
r !== N && /* @__PURE__ */ jsx(
|
|
5971
5986
|
Cross2Icon,
|
|
5972
5987
|
{
|
|
5973
|
-
onClick: () => g(h, [
|
|
5988
|
+
onClick: () => g(h, [N], !0),
|
|
5974
5989
|
className: "invisible absolute right-1 rounded-full bg-red-400 hover:text-white group-hover:visible group-hover:cursor-pointer"
|
|
5975
5990
|
}
|
|
5976
5991
|
)
|
|
5977
5992
|
]
|
|
5978
5993
|
},
|
|
5979
|
-
|
|
5994
|
+
N
|
|
5980
5995
|
)
|
|
5981
5996
|
) })
|
|
5982
5997
|
] });
|
|
@@ -6430,7 +6445,7 @@ const CoreBlock = ({
|
|
|
6430
6445
|
return hasVideoEmbed(A) && (set(a, "_type", "Video"), set(a, "url", getVideoURLFromHTML(A)), set(a, "styles", `${STYLES_KEY},`), set(a, "controls", { autoPlay: !1, muted: !0, loop: !1, controls: !1 })), a.content = A, [a];
|
|
6431
6446
|
} else if (n.tagName === "svg") {
|
|
6432
6447
|
const A = find(n.attributes, { key: "height" }), E = find(n.attributes, { key: "width" }), _ = get(A, "value") ? `[${get(A, "value")}px]` : "24px", S = get(E, "value") ? `[${get(E, "value")}px]` : "24px", B = get(find(n.attributes, { key: "class" }), "value", "w-full h-full");
|
|
6433
|
-
return a.styles = `${STYLES_KEY}, ${cn$1(`w-${S} h-${_}`, B)}`.trim(), n.attributes = filter(n.attributes, (
|
|
6448
|
+
return a.styles = `${STYLES_KEY}, ${cn$1(`w-${S} h-${_}`, B)}`.trim(), n.attributes = filter(n.attributes, (T) => !includes(["style", "width", "height", "class"], T.key)), a.icon = stringify([n]), [a];
|
|
6434
6449
|
} else if (n.tagName == "option" && r && ((w = r.block) == null ? void 0 : w._type) === "Select")
|
|
6435
6450
|
return r.block.options.push({
|
|
6436
6451
|
label: getTextContent(n.children),
|
|
@@ -6635,7 +6650,7 @@ const BlockCard = ({
|
|
|
6635
6650
|
/* @__PURE__ */ jsx(Skeleton, { className: "col-span-3 h-full" }),
|
|
6636
6651
|
/* @__PURE__ */ jsx(Skeleton, { className: "col-span-9 h-full" })
|
|
6637
6652
|
] });
|
|
6638
|
-
const
|
|
6653
|
+
const T = filter(w, (k, j) => j % 2 === 0), C = filter(w, (k, j) => j % 2 === 1);
|
|
6639
6654
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: "flex h-full max-h-full flex-col", children: [
|
|
6640
6655
|
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 border-border py-2", children: /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
|
|
6641
6656
|
/* @__PURE__ */ jsx(Search, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }),
|
|
@@ -6696,7 +6711,7 @@ const BlockCard = ({
|
|
|
6696
6711
|
className: "z-10 flex h-full max-h-full w-full flex-col gap-2 transition-all ease-linear",
|
|
6697
6712
|
children: [
|
|
6698
6713
|
isEmpty(w) && !isEmpty(y) ? /* @__PURE__ */ jsx("div", { className: "flex h-full flex-col items-center justify-center p-6 text-center", children: /* @__PURE__ */ jsx("p", { className: "text-sm", children: E("No blocks found in this group") }) }) : /* @__PURE__ */ jsxs("div", { className: "grid w-full grid-cols-2 gap-2 px-2", children: [
|
|
6699
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-1", children:
|
|
6714
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-1", children: T.map((k, j) => /* @__PURE__ */ jsx(
|
|
6700
6715
|
BlockCard,
|
|
6701
6716
|
{
|
|
6702
6717
|
parentId: o,
|
|
@@ -6837,8 +6852,8 @@ const BlockCard = ({
|
|
|
6837
6852
|
}, []), E = useMemo(
|
|
6838
6853
|
() => c ? values(r).filter(
|
|
6839
6854
|
(k) => {
|
|
6840
|
-
var j,
|
|
6841
|
-
return (((j = k.label) == null ? void 0 : j.toLowerCase()) + " " + ((
|
|
6855
|
+
var j, I;
|
|
6856
|
+
return (((j = k.label) == null ? void 0 : j.toLowerCase()) + " " + ((I = k.type) == null ? void 0 : I.toLowerCase())).includes(c.toLowerCase());
|
|
6842
6857
|
}
|
|
6843
6858
|
) : r,
|
|
6844
6859
|
[r, c]
|
|
@@ -6850,7 +6865,7 @@ const BlockCard = ({
|
|
|
6850
6865
|
), S = useMemo(
|
|
6851
6866
|
() => sortBy(_, (k) => CORE_GROUPS.indexOf(k) === -1 ? 99 : CORE_GROUPS.indexOf(k)),
|
|
6852
6867
|
[_]
|
|
6853
|
-
), B = useMemo(() => m === "all" ? E : filter(values(E), { group: m }), [E, m]),
|
|
6868
|
+
), B = useMemo(() => m === "all" ? E : filter(values(E), { group: m }), [E, m]), T = useMemo(() => m === "all" ? S : [m], [S, m]);
|
|
6854
6869
|
return /* @__PURE__ */ jsxs("div", { className: "mx-auto flex h-full w-full max-w-3xl flex-col", children: [
|
|
6855
6870
|
/* @__PURE__ */ jsx("div", { className: "sticky top-0 z-10 bg-background/80 px-4 py-2 backdrop-blur-sm", children: /* @__PURE__ */ jsx(
|
|
6856
6871
|
Input$1,
|
|
@@ -6893,7 +6908,7 @@ const BlockCard = ({
|
|
|
6893
6908
|
' "',
|
|
6894
6909
|
c,
|
|
6895
6910
|
'"'
|
|
6896
|
-
] }) }) : /* @__PURE__ */ jsx("div", { className: "space-y-6 p-4", children:
|
|
6911
|
+
] }) }) : /* @__PURE__ */ jsx("div", { className: "space-y-6 p-4", children: T.map((k) => /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
6897
6912
|
/* @__PURE__ */ jsx("h3", { className: "px-1 text-sm font-medium", children: capitalize(i(k.toLowerCase())) }),
|
|
6898
6913
|
/* @__PURE__ */ jsx("div", { className: "grid gap-2 " + l, children: reject(
|
|
6899
6914
|
m === "all" ? filter(values(B), { group: k }) : values(B),
|
|
@@ -7264,7 +7279,7 @@ const Input = ({ node: o }) => {
|
|
|
7264
7279
|
L.isInternal && (p = L.isOpen, L.isOpen && L.close());
|
|
7265
7280
|
}, _ = (L) => {
|
|
7266
7281
|
L.isInternal && p !== null && (p ? L.open() : L.close(), p = null);
|
|
7267
|
-
}, [S, B] = useAtom$1(currentAddSelection),
|
|
7282
|
+
}, [S, B] = useAtom$1(currentAddSelection), T = () => {
|
|
7268
7283
|
var L;
|
|
7269
7284
|
C(), o.parent.isSelected || B((L = o == null ? void 0 : o.parent) == null ? void 0 : L.id);
|
|
7270
7285
|
}, C = () => {
|
|
@@ -7283,7 +7298,7 @@ const Input = ({ node: o }) => {
|
|
|
7283
7298
|
R && R.setAttribute("data-drop", O);
|
|
7284
7299
|
const D = R.getBoundingClientRect(), M = d.getBoundingClientRect();
|
|
7285
7300
|
D.top >= M.top && D.left >= M.left && D.bottom <= M.bottom && D.right <= M.right || ($.documentElement.scrollTop = R.offsetTop - M.top);
|
|
7286
|
-
},
|
|
7301
|
+
}, I = (L) => {
|
|
7287
7302
|
C();
|
|
7288
7303
|
const O = get(o, "parent.id");
|
|
7289
7304
|
O !== "__REACT_ARBORIST_INTERNAL_ROOT__" ? pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK, { _id: O, position: L }) : pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK, { position: L });
|
|
@@ -7295,7 +7310,7 @@ const Input = ({ node: o }) => {
|
|
|
7295
7310
|
"div",
|
|
7296
7311
|
{
|
|
7297
7312
|
role: "button",
|
|
7298
|
-
onClick: () =>
|
|
7313
|
+
onClick: () => I(-1),
|
|
7299
7314
|
className: "h-1 rounded bg-primary opacity-0 duration-200 group-hover:opacity-100",
|
|
7300
7315
|
children: /* @__PURE__ */ jsxs("div", { className: "absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 transform items-center gap-x-1 rounded-full bg-primary px-3 py-1 text-[9px] leading-tight text-white hover:bg-primary", children: [
|
|
7301
7316
|
/* @__PURE__ */ jsx(PlusIcon, { className: "h-2 w-2 stroke-[3]" }),
|
|
@@ -7306,7 +7321,7 @@ const Input = ({ node: o }) => {
|
|
|
7306
7321
|
),
|
|
7307
7322
|
/* @__PURE__ */ jsx("br", {})
|
|
7308
7323
|
] });
|
|
7309
|
-
const
|
|
7324
|
+
const N = useMemo(() => has(f, "_libBlockId") && !isEmpty(f._libBlockId) && (c(PERMISSIONS.CREATE_LIBRARY_BLOCK) || c(PERMISSIONS.EDIT_LIBRARY_BLOCK)), [f, c]);
|
|
7310
7325
|
return /* @__PURE__ */ jsx("div", { className: "w-full", children: /* @__PURE__ */ jsxs(
|
|
7311
7326
|
"div",
|
|
7312
7327
|
{
|
|
@@ -7332,9 +7347,9 @@ const Input = ({ node: o }) => {
|
|
|
7332
7347
|
"div",
|
|
7333
7348
|
{
|
|
7334
7349
|
onClick: (L) => {
|
|
7335
|
-
L.stopPropagation(),
|
|
7350
|
+
L.stopPropagation(), I(o.childIndex);
|
|
7336
7351
|
},
|
|
7337
|
-
onMouseEnter:
|
|
7352
|
+
onMouseEnter: T,
|
|
7338
7353
|
onMouseLeave: C,
|
|
7339
7354
|
className: "absolute -top-0.5 h-1 w-[90%] rounded bg-primary opacity-0 delay-200 duration-200 group-hover:opacity-100",
|
|
7340
7355
|
children: /* @__PURE__ */ jsx("div", { className: "absolute left-1/2 top-1/2 flex h-4 w-4 -translate-x-1/2 -translate-y-1/2 transform items-center justify-center rounded-full bg-primary p-1 outline outline-2 outline-white hover:bg-primary", children: /* @__PURE__ */ jsx(PlusIcon, { className: "h-3 w-3 stroke-[4] text-white" }) })
|
|
@@ -7350,7 +7365,7 @@ const Input = ({ node: o }) => {
|
|
|
7350
7365
|
(o == null ? void 0 : o.id) === S ? "bg-primary/10" : "",
|
|
7351
7366
|
b && "opacity-20",
|
|
7352
7367
|
l.includes(m) ? "opacity-50" : "",
|
|
7353
|
-
|
|
7368
|
+
N && x && "bg-primary/20 text-primary"
|
|
7354
7369
|
),
|
|
7355
7370
|
children: [
|
|
7356
7371
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -7366,8 +7381,8 @@ const Input = ({ node: o }) => {
|
|
|
7366
7381
|
{
|
|
7367
7382
|
className: cn(
|
|
7368
7383
|
"leading-1 flex items-center",
|
|
7369
|
-
|
|
7370
|
-
|
|
7384
|
+
N && "text-primary/60",
|
|
7385
|
+
N && x && "text-primary/80"
|
|
7371
7386
|
),
|
|
7372
7387
|
children: [
|
|
7373
7388
|
/* @__PURE__ */ jsx(TypeIcon, { type: f == null ? void 0 : f._type }),
|
|
@@ -8716,7 +8731,7 @@ const AddBlocksDialog = () => {
|
|
|
8716
8731
|
n(S), l(a), d(""), p(""), m("");
|
|
8717
8732
|
}
|
|
8718
8733
|
}, v = (S) => {
|
|
8719
|
-
const B = a.filter((
|
|
8734
|
+
const B = a.filter((T, C) => C !== S);
|
|
8720
8735
|
n(B), l(B);
|
|
8721
8736
|
}, w = (S) => {
|
|
8722
8737
|
g(S), d(a[S].key), p(a[S].value);
|
|
@@ -8732,23 +8747,23 @@ const AddBlocksDialog = () => {
|
|
|
8732
8747
|
}, E = (S) => {
|
|
8733
8748
|
S.key === "Enter" && !S.shiftKey && (S.preventDefault(), u !== null ? A() : b());
|
|
8734
8749
|
}, _ = useCallback((S) => {
|
|
8735
|
-
const B = (k) => /[.,!?;:]/.test(k),
|
|
8736
|
-
let
|
|
8750
|
+
const B = (k) => /[.,!?;:]/.test(k), T = (k, j, I) => {
|
|
8751
|
+
let N = "", P = "";
|
|
8737
8752
|
const L = j > 0 ? k[j - 1] : "", O = j < k.length ? k[j] : "";
|
|
8738
|
-
return j > 0 && (L === "." || !B(L) && L !== " ") && (
|
|
8739
|
-
text:
|
|
8740
|
-
prefixLength:
|
|
8753
|
+
return j > 0 && (L === "." || !B(L) && L !== " ") && (N = " "), j < k.length && !B(O) && O !== " " && (P = " "), {
|
|
8754
|
+
text: N + I + P,
|
|
8755
|
+
prefixLength: N.length,
|
|
8741
8756
|
suffixLength: P.length
|
|
8742
8757
|
};
|
|
8743
8758
|
}, C = x.current;
|
|
8744
8759
|
if (C) {
|
|
8745
|
-
const k = C.selectionStart || 0, j = C.value || "",
|
|
8746
|
-
if (
|
|
8747
|
-
const $ = `{{${S}}}`, { text: R } =
|
|
8760
|
+
const k = C.selectionStart || 0, j = C.value || "", I = C.selectionEnd || k;
|
|
8761
|
+
if (I > k) {
|
|
8762
|
+
const $ = `{{${S}}}`, { text: R } = T(j, k, $), D = j.slice(0, k) + R + j.slice(I);
|
|
8748
8763
|
p(D);
|
|
8749
8764
|
return;
|
|
8750
8765
|
}
|
|
8751
|
-
const P = `{{${S}}}`, { text: L } =
|
|
8766
|
+
const P = `{{${S}}}`, { text: L } = T(j, k, P), O = j.slice(0, k) + L + j.slice(k);
|
|
8752
8767
|
p(O);
|
|
8753
8768
|
}
|
|
8754
8769
|
}, []);
|
|
@@ -9204,55 +9219,55 @@ const FEATURE_TOGGLES = {
|
|
|
9204
9219
|
return (x = m.onMount) == null ? void 0 : x.call(m, f);
|
|
9205
9220
|
}, ...h) => {
|
|
9206
9221
|
const m = h[0] || ((B) => {
|
|
9207
|
-
let
|
|
9208
|
-
return
|
|
9222
|
+
let T = o.get(B);
|
|
9223
|
+
return T || (T = { d: /* @__PURE__ */ new Map(), p: /* @__PURE__ */ new Set(), n: 0 }, o.set(B, T), u == null || u(B, S)), T;
|
|
9209
9224
|
}), f = h[1] || (() => {
|
|
9210
|
-
let B,
|
|
9225
|
+
let B, T;
|
|
9211
9226
|
const C = (k) => {
|
|
9212
9227
|
try {
|
|
9213
9228
|
k();
|
|
9214
9229
|
} catch (j) {
|
|
9215
|
-
B || (B = !0,
|
|
9230
|
+
B || (B = !0, T = j);
|
|
9216
9231
|
}
|
|
9217
9232
|
};
|
|
9218
9233
|
do {
|
|
9219
9234
|
d.f && C(d.f);
|
|
9220
9235
|
const k = /* @__PURE__ */ new Set(), j = k.add.bind(k);
|
|
9221
|
-
a.forEach((
|
|
9222
|
-
var
|
|
9223
|
-
return (
|
|
9236
|
+
a.forEach((I) => {
|
|
9237
|
+
var N;
|
|
9238
|
+
return (N = r.get(I)) == null ? void 0 : N.l.forEach(j);
|
|
9224
9239
|
}), a.clear(), i.forEach(j), i.clear(), l.forEach(j), l.clear(), k.forEach(C), a.size && x();
|
|
9225
9240
|
} while (a.size || i.size || l.size);
|
|
9226
9241
|
if (B)
|
|
9227
|
-
throw
|
|
9242
|
+
throw T;
|
|
9228
9243
|
}), x = h[2] || (() => {
|
|
9229
|
-
const B = [],
|
|
9244
|
+
const B = [], T = /* @__PURE__ */ new WeakSet(), C = /* @__PURE__ */ new WeakSet(), k = Array.from(a);
|
|
9230
9245
|
for (; k.length; ) {
|
|
9231
|
-
const j = k[k.length - 1],
|
|
9246
|
+
const j = k[k.length - 1], I = m(j);
|
|
9232
9247
|
if (C.has(j)) {
|
|
9233
9248
|
k.pop();
|
|
9234
9249
|
continue;
|
|
9235
9250
|
}
|
|
9236
|
-
if (
|
|
9237
|
-
n.get(j) ===
|
|
9251
|
+
if (T.has(j)) {
|
|
9252
|
+
n.get(j) === I.n && B.push([j, I]), C.add(j), k.pop();
|
|
9238
9253
|
continue;
|
|
9239
9254
|
}
|
|
9240
|
-
|
|
9241
|
-
for (const
|
|
9242
|
-
|
|
9255
|
+
T.add(j);
|
|
9256
|
+
for (const N of getMountedOrPendingDependents(j, I, r))
|
|
9257
|
+
T.has(N) || k.push(N);
|
|
9243
9258
|
}
|
|
9244
9259
|
for (let j = B.length - 1; j >= 0; --j) {
|
|
9245
|
-
const [
|
|
9260
|
+
const [I, N] = B[j];
|
|
9246
9261
|
let P = !1;
|
|
9247
|
-
for (const L of
|
|
9248
|
-
if (L !==
|
|
9262
|
+
for (const L of N.d.keys())
|
|
9263
|
+
if (L !== I && a.has(L)) {
|
|
9249
9264
|
P = !0;
|
|
9250
9265
|
break;
|
|
9251
9266
|
}
|
|
9252
|
-
P && (y(
|
|
9267
|
+
P && (y(I), w(I)), n.delete(I);
|
|
9253
9268
|
}
|
|
9254
9269
|
}), y = h[3] || ((B) => {
|
|
9255
|
-
var
|
|
9270
|
+
var T, C;
|
|
9256
9271
|
const k = m(B);
|
|
9257
9272
|
if (isAtomStateInitialized(k) && (r.has(B) && n.get(B) !== k.n || Array.from(k.d).every(
|
|
9258
9273
|
([R, D]) => (
|
|
@@ -9264,9 +9279,9 @@ const FEATURE_TOGGLES = {
|
|
|
9264
9279
|
return k;
|
|
9265
9280
|
k.d.clear();
|
|
9266
9281
|
let j = !0;
|
|
9267
|
-
const
|
|
9282
|
+
const I = () => {
|
|
9268
9283
|
r.has(B) && (w(B), x(), f());
|
|
9269
|
-
},
|
|
9284
|
+
}, N = (R) => {
|
|
9270
9285
|
var D;
|
|
9271
9286
|
if (isSelfAtom(B, R)) {
|
|
9272
9287
|
const H = m(R);
|
|
@@ -9281,7 +9296,7 @@ const FEATURE_TOGGLES = {
|
|
|
9281
9296
|
try {
|
|
9282
9297
|
return returnAtomValue(M);
|
|
9283
9298
|
} finally {
|
|
9284
|
-
k.d.set(R, M.n), isPendingPromise(k.v) && addPendingPromiseToDependency(B, k.v, M), (D = r.get(R)) == null || D.t.add(B), j ||
|
|
9299
|
+
k.d.set(R, M.n), isPendingPromise(k.v) && addPendingPromiseToDependency(B, k.v, M), (D = r.get(R)) == null || D.t.add(B), j || I();
|
|
9285
9300
|
}
|
|
9286
9301
|
};
|
|
9287
9302
|
let P, L;
|
|
@@ -9301,10 +9316,10 @@ const FEATURE_TOGGLES = {
|
|
|
9301
9316
|
}
|
|
9302
9317
|
}, $ = k.n;
|
|
9303
9318
|
try {
|
|
9304
|
-
const R = c(B,
|
|
9305
|
-
return setAtomStateValueOrPromise(B, R, m), isPromiseLike$1(R) && ((
|
|
9306
|
-
|
|
9307
|
-
|
|
9319
|
+
const R = c(B, N, O);
|
|
9320
|
+
return setAtomStateValueOrPromise(B, R, m), isPromiseLike$1(R) && ((T = R.onCancel) == null || T.call(R, () => P == null ? void 0 : P.abort()), R.then(
|
|
9321
|
+
I,
|
|
9322
|
+
I
|
|
9308
9323
|
)), k;
|
|
9309
9324
|
} catch (R) {
|
|
9310
9325
|
return delete k.v, k.e = R, ++k.n, k;
|
|
@@ -9312,55 +9327,55 @@ const FEATURE_TOGGLES = {
|
|
|
9312
9327
|
j = !1, $ !== k.n && n.get(B) === $ && (n.set(B, k.n), a.add(B), (C = d.c) == null || C.call(d, B));
|
|
9313
9328
|
}
|
|
9314
9329
|
}), b = h[4] || ((B) => {
|
|
9315
|
-
const
|
|
9316
|
-
for (;
|
|
9317
|
-
const C =
|
|
9330
|
+
const T = [B];
|
|
9331
|
+
for (; T.length; ) {
|
|
9332
|
+
const C = T.pop(), k = m(C);
|
|
9318
9333
|
for (const j of getMountedOrPendingDependents(C, k, r)) {
|
|
9319
|
-
const
|
|
9320
|
-
n.set(j,
|
|
9334
|
+
const I = m(j);
|
|
9335
|
+
n.set(j, I.n), T.push(j);
|
|
9321
9336
|
}
|
|
9322
9337
|
}
|
|
9323
|
-
}), v = h[5] || ((B, ...
|
|
9338
|
+
}), v = h[5] || ((B, ...T) => {
|
|
9324
9339
|
let C = !0;
|
|
9325
|
-
const k = (
|
|
9340
|
+
const k = (I) => returnAtomValue(y(I)), j = (I, ...N) => {
|
|
9326
9341
|
var P;
|
|
9327
|
-
const L = m(
|
|
9342
|
+
const L = m(I);
|
|
9328
9343
|
try {
|
|
9329
|
-
if (isSelfAtom(B,
|
|
9330
|
-
if (!hasInitialValue(
|
|
9344
|
+
if (isSelfAtom(B, I)) {
|
|
9345
|
+
if (!hasInitialValue(I))
|
|
9331
9346
|
throw new Error("atom not writable");
|
|
9332
|
-
const O = L.n, $ =
|
|
9333
|
-
setAtomStateValueOrPromise(
|
|
9347
|
+
const O = L.n, $ = N[0];
|
|
9348
|
+
setAtomStateValueOrPromise(I, $, m), w(I), O !== L.n && (a.add(I), (P = d.c) == null || P.call(d, I), b(I));
|
|
9334
9349
|
return;
|
|
9335
9350
|
} else
|
|
9336
|
-
return v(
|
|
9351
|
+
return v(I, ...N);
|
|
9337
9352
|
} finally {
|
|
9338
9353
|
C || (x(), f());
|
|
9339
9354
|
}
|
|
9340
9355
|
};
|
|
9341
9356
|
try {
|
|
9342
|
-
return p(B, k, j, ...
|
|
9357
|
+
return p(B, k, j, ...T);
|
|
9343
9358
|
} finally {
|
|
9344
9359
|
C = !1;
|
|
9345
9360
|
}
|
|
9346
9361
|
}), w = h[6] || ((B) => {
|
|
9347
|
-
var
|
|
9362
|
+
var T;
|
|
9348
9363
|
const C = m(B), k = r.get(B);
|
|
9349
9364
|
if (k && !isPendingPromise(C.v)) {
|
|
9350
|
-
for (const [j,
|
|
9365
|
+
for (const [j, I] of C.d)
|
|
9351
9366
|
if (!k.d.has(j)) {
|
|
9352
|
-
const
|
|
9353
|
-
A(j).t.add(B), k.d.add(j),
|
|
9367
|
+
const N = m(j);
|
|
9368
|
+
A(j).t.add(B), k.d.add(j), I !== N.n && (a.add(j), (T = d.c) == null || T.call(d, j), b(j));
|
|
9354
9369
|
}
|
|
9355
9370
|
for (const j of k.d || [])
|
|
9356
9371
|
if (!C.d.has(j)) {
|
|
9357
9372
|
k.d.delete(j);
|
|
9358
|
-
const
|
|
9359
|
-
|
|
9373
|
+
const I = E(j);
|
|
9374
|
+
I == null || I.t.delete(B);
|
|
9360
9375
|
}
|
|
9361
9376
|
}
|
|
9362
9377
|
}), A = h[7] || ((B) => {
|
|
9363
|
-
var
|
|
9378
|
+
var T;
|
|
9364
9379
|
const C = m(B);
|
|
9365
9380
|
let k = r.get(B);
|
|
9366
9381
|
if (!k) {
|
|
@@ -9371,28 +9386,28 @@ const FEATURE_TOGGLES = {
|
|
|
9371
9386
|
l: /* @__PURE__ */ new Set(),
|
|
9372
9387
|
d: new Set(C.d.keys()),
|
|
9373
9388
|
t: /* @__PURE__ */ new Set()
|
|
9374
|
-
}, r.set(B, k), (
|
|
9389
|
+
}, r.set(B, k), (T = d.m) == null || T.call(d, B), isActuallyWritableAtom(B)) {
|
|
9375
9390
|
const j = () => {
|
|
9376
|
-
let
|
|
9377
|
-
const
|
|
9391
|
+
let I = !0;
|
|
9392
|
+
const N = (...P) => {
|
|
9378
9393
|
try {
|
|
9379
9394
|
return v(B, ...P);
|
|
9380
9395
|
} finally {
|
|
9381
|
-
|
|
9396
|
+
I || (x(), f());
|
|
9382
9397
|
}
|
|
9383
9398
|
};
|
|
9384
9399
|
try {
|
|
9385
|
-
const P = g(B,
|
|
9400
|
+
const P = g(B, N);
|
|
9386
9401
|
P && (k.u = () => {
|
|
9387
|
-
|
|
9402
|
+
I = !0;
|
|
9388
9403
|
try {
|
|
9389
9404
|
P();
|
|
9390
9405
|
} finally {
|
|
9391
|
-
|
|
9406
|
+
I = !1;
|
|
9392
9407
|
}
|
|
9393
9408
|
});
|
|
9394
9409
|
} finally {
|
|
9395
|
-
|
|
9410
|
+
I = !1;
|
|
9396
9411
|
}
|
|
9397
9412
|
};
|
|
9398
9413
|
l.add(j);
|
|
@@ -9400,17 +9415,17 @@ const FEATURE_TOGGLES = {
|
|
|
9400
9415
|
}
|
|
9401
9416
|
return k;
|
|
9402
9417
|
}), E = h[8] || ((B) => {
|
|
9403
|
-
var
|
|
9418
|
+
var T;
|
|
9404
9419
|
const C = m(B);
|
|
9405
9420
|
let k = r.get(B);
|
|
9406
9421
|
if (k && !k.l.size && !Array.from(k.t).some((j) => {
|
|
9407
|
-
var
|
|
9408
|
-
return (
|
|
9422
|
+
var I;
|
|
9423
|
+
return (I = r.get(j)) == null ? void 0 : I.d.has(B);
|
|
9409
9424
|
})) {
|
|
9410
|
-
k.u && i.add(k.u), k = void 0, r.delete(B), (
|
|
9425
|
+
k.u && i.add(k.u), k = void 0, r.delete(B), (T = d.u) == null || T.call(d, B);
|
|
9411
9426
|
for (const j of C.d.keys()) {
|
|
9412
|
-
const
|
|
9413
|
-
|
|
9427
|
+
const I = E(j);
|
|
9428
|
+
I == null || I.t.delete(B);
|
|
9414
9429
|
}
|
|
9415
9430
|
return;
|
|
9416
9431
|
}
|
|
@@ -9441,17 +9456,17 @@ const FEATURE_TOGGLES = {
|
|
|
9441
9456
|
E
|
|
9442
9457
|
], S = {
|
|
9443
9458
|
get: (B) => returnAtomValue(y(B)),
|
|
9444
|
-
set: (B, ...
|
|
9459
|
+
set: (B, ...T) => {
|
|
9445
9460
|
try {
|
|
9446
|
-
return v(B, ...
|
|
9461
|
+
return v(B, ...T);
|
|
9447
9462
|
} finally {
|
|
9448
9463
|
x(), f();
|
|
9449
9464
|
}
|
|
9450
9465
|
},
|
|
9451
|
-
sub: (B,
|
|
9466
|
+
sub: (B, T) => {
|
|
9452
9467
|
const k = A(B).l;
|
|
9453
|
-
return k.add(
|
|
9454
|
-
k.delete(
|
|
9468
|
+
return k.add(T), f(), () => {
|
|
9469
|
+
k.delete(T), E(B), f();
|
|
9455
9470
|
};
|
|
9456
9471
|
}
|
|
9457
9472
|
};
|