@ws-ui/http-handlers-editor 1.11.3-rc1 → 1.11.3-rc2
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/http-handlers-editor.css +1 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +82 -84
- package/dist/index.es.js.map +1 -1
- package/package.json +2 -4
package/dist/index.es.js
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { jsx as e, jsxs as o, Fragment as G } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { ToolbarIcon as $e, chakraTheme as je } from "@ws-ui/webform-editor";
|
|
8
|
-
import { createContext as Ge, useReducer as qe, useEffect as O, useContext as Be, useState as _, Fragment as se, useMemo as Ue } from "react";
|
|
2
|
+
import { useSensors as he, useSensor as X, PointerSensor as me, KeyboardSensor as ge, DndContext as xe, closestCenter as fe, DragOverlay as ye } from "@dnd-kit/core";
|
|
3
|
+
import { useSortable as be, sortableKeyboardCoordinates as ve, SortableContext as Ne, verticalListSortingStrategy as we, arrayMove as Ee } from "@dnd-kit/sortable";
|
|
4
|
+
import { FdWarningDanger as j, FdRegex as Ce, FdUnRegex as De, FdDuplicate as te, FdPen as Te, FdTrash as He, FdCloseNaked as q, FdInfoCircle as ne, FdCheckCircle as Re, FdClose as Pe, FdDragHandle as Se, FdDown as K, FdEmpty as J, FdCode as Ie, FdPlus as Y } from "@ws-ui/icons";
|
|
5
|
+
import { useAppDispatch as B, switchEditor as ke, useAppSelector as W, selectCatalog as re, openModal as ae, selectTabByPath as Ae, setContent as _e, ReduxProvider as Le, getStore as Fe } from "@ws-ui/store";
|
|
6
|
+
import { createContext as Oe, useReducer as $e, useEffect as O, useContext as je, useState as _, Fragment as se, useMemo as Ge } from "react";
|
|
9
7
|
import { generate as V } from "short-uuid";
|
|
10
8
|
import { z as A } from "zod";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
9
|
+
import { ToolbarIcon as qe, Tooltip as E, ModalColor as le, ModalType as ie, useHotkeys as Be, ControlledSwitch as Ue, HTTP_HANDLERS_TAB_PATH as ze } from "@ws-ui/shared";
|
|
10
|
+
import { CSS as Me } from "@dnd-kit/utilities";
|
|
11
|
+
import { Combobox as S, Transition as oe } from "@headlessui/react";
|
|
14
12
|
import C from "classnames";
|
|
15
13
|
import { useMultipleSelection as F, useCombobox as L } from "downshift";
|
|
16
|
-
import { omit as de, isEqual as
|
|
17
|
-
import { Subject as
|
|
14
|
+
import { omit as de, isEqual as Ve } from "lodash";
|
|
15
|
+
import { Subject as Ke } from "rxjs";
|
|
18
16
|
import Z from "randexp";
|
|
19
|
-
const
|
|
17
|
+
const Je = ({
|
|
20
18
|
label: t,
|
|
21
19
|
Icon: a,
|
|
22
20
|
tab: r,
|
|
@@ -25,14 +23,14 @@ const Qe = ({
|
|
|
25
23
|
}) => {
|
|
26
24
|
const x = B();
|
|
27
25
|
return /* @__PURE__ */ e(
|
|
28
|
-
|
|
26
|
+
qe,
|
|
29
27
|
{
|
|
30
28
|
label: t,
|
|
31
29
|
Icon: a,
|
|
32
30
|
as: "button",
|
|
33
31
|
onClick: () => {
|
|
34
32
|
c == null || c(), x(
|
|
35
|
-
|
|
33
|
+
ke({
|
|
36
34
|
tab: r,
|
|
37
35
|
editor: i
|
|
38
36
|
})
|
|
@@ -40,7 +38,7 @@ const Qe = ({
|
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
40
|
);
|
|
43
|
-
}, ce =
|
|
41
|
+
}, ce = Oe(void 0), $ = new Ke(), We = (t, a) => {
|
|
44
42
|
switch (a.type) {
|
|
45
43
|
case "UPDATE_HANDLERS":
|
|
46
44
|
return {
|
|
@@ -129,7 +127,7 @@ const Qe = ({
|
|
|
129
127
|
default:
|
|
130
128
|
throw new Error("Unknown action type");
|
|
131
129
|
}
|
|
132
|
-
},
|
|
130
|
+
}, Qe = ({
|
|
133
131
|
children: t,
|
|
134
132
|
content: a
|
|
135
133
|
}) => {
|
|
@@ -137,7 +135,7 @@ const Qe = ({
|
|
|
137
135
|
content: a,
|
|
138
136
|
editing: null,
|
|
139
137
|
newlyCreatedHandlerID: null
|
|
140
|
-
}, [i, c] =
|
|
138
|
+
}, [i, c] = $e(We, r);
|
|
141
139
|
return O(() => {
|
|
142
140
|
c({
|
|
143
141
|
type: "SYNC_DATA",
|
|
@@ -145,11 +143,11 @@ const Qe = ({
|
|
|
145
143
|
});
|
|
146
144
|
}, [a]), /* @__PURE__ */ e(ce.Provider, { value: { state: i, dispatch: c }, children: t });
|
|
147
145
|
}, Q = () => {
|
|
148
|
-
const t =
|
|
146
|
+
const t = je(ce);
|
|
149
147
|
if (!t)
|
|
150
148
|
throw new Error("useHTTPHandlers must be used within a HandlerProvider");
|
|
151
149
|
return t;
|
|
152
|
-
},
|
|
150
|
+
}, Xe = ({ initialSelectedItems: t, onChange: a, touched: r, onBlur: i }) => {
|
|
153
151
|
const c = ["GET", "POST", "PUT", "DELETE"];
|
|
154
152
|
function x(h, u) {
|
|
155
153
|
const N = u.toLowerCase();
|
|
@@ -161,7 +159,7 @@ const Qe = ({
|
|
|
161
159
|
O(() => {
|
|
162
160
|
n(t);
|
|
163
161
|
}, [t]);
|
|
164
|
-
const l =
|
|
162
|
+
const l = Ge(
|
|
165
163
|
() => x(d, f),
|
|
166
164
|
[d, f]
|
|
167
165
|
), { getSelectedItemProps: p, getDropdownProps: b, removeSelectedItem: v } = F({
|
|
@@ -179,7 +177,7 @@ const Qe = ({
|
|
|
179
177
|
}), {
|
|
180
178
|
isOpen: y,
|
|
181
179
|
getToggleButtonProps: w,
|
|
182
|
-
getMenuProps:
|
|
180
|
+
getMenuProps: I,
|
|
183
181
|
getInputProps: D,
|
|
184
182
|
highlightedIndex: T,
|
|
185
183
|
getItemProps: H,
|
|
@@ -305,7 +303,7 @@ const Qe = ({
|
|
|
305
303
|
"ul",
|
|
306
304
|
{
|
|
307
305
|
className: `ring-primary-dark bg-grey-900 text-s absolute z-10 w-full rounded-b ring-1 p-1 text-white ${!(y && l.length) && "hidden"}`,
|
|
308
|
-
...
|
|
306
|
+
...I(),
|
|
309
307
|
children: y && l.map((h, u) => /* @__PURE__ */ e(
|
|
310
308
|
"li",
|
|
311
309
|
{
|
|
@@ -322,7 +320,7 @@ const Qe = ({
|
|
|
322
320
|
}
|
|
323
321
|
)
|
|
324
322
|
] });
|
|
325
|
-
},
|
|
323
|
+
}, Ye = ({
|
|
326
324
|
value: t,
|
|
327
325
|
options: a,
|
|
328
326
|
errorMessage: r = "",
|
|
@@ -389,7 +387,7 @@ const Qe = ({
|
|
|
389
387
|
}
|
|
390
388
|
),
|
|
391
389
|
/* @__PURE__ */ e(
|
|
392
|
-
|
|
390
|
+
oe,
|
|
393
391
|
{
|
|
394
392
|
as: se,
|
|
395
393
|
leave: "transition ease-in durati pb-0.5on-100",
|
|
@@ -420,7 +418,7 @@ const Qe = ({
|
|
|
420
418
|
},
|
|
421
419
|
t
|
|
422
420
|
);
|
|
423
|
-
},
|
|
421
|
+
}, Ze = ({
|
|
424
422
|
value: t,
|
|
425
423
|
options: a,
|
|
426
424
|
onChange: r,
|
|
@@ -493,7 +491,7 @@ const Qe = ({
|
|
|
493
491
|
}
|
|
494
492
|
),
|
|
495
493
|
/* @__PURE__ */ e(
|
|
496
|
-
|
|
494
|
+
oe,
|
|
497
495
|
{
|
|
498
496
|
as: se,
|
|
499
497
|
leave: "transition ease-in duration-100",
|
|
@@ -524,7 +522,7 @@ const Qe = ({
|
|
|
524
522
|
}
|
|
525
523
|
)
|
|
526
524
|
] }) });
|
|
527
|
-
}, pe = ({ listeners: t, attributes: a }) => /* @__PURE__ */ e("button", { ...a, ...t, children: /* @__PURE__ */ e(
|
|
525
|
+
}, pe = ({ listeners: t, attributes: a }) => /* @__PURE__ */ e("button", { ...a, ...t, children: /* @__PURE__ */ e(Se, {}) }), ue = (t) => {
|
|
528
526
|
var r;
|
|
529
527
|
if (!t) return "";
|
|
530
528
|
let a;
|
|
@@ -535,7 +533,7 @@ const Qe = ({
|
|
|
535
533
|
a = "";
|
|
536
534
|
}
|
|
537
535
|
return `Requests matching regex will be handled example: ${a}`;
|
|
538
|
-
},
|
|
536
|
+
}, et = ({
|
|
539
537
|
id: t,
|
|
540
538
|
class: a,
|
|
541
539
|
method: r,
|
|
@@ -557,14 +555,14 @@ const Qe = ({
|
|
|
557
555
|
}), p = W(re), b = Object.values((p == null ? void 0 : p.singletons) || {}), v = (P = b.find((s) => s.name === n.className)) == null ? void 0 : P.methods.map(({ name: s, exposed: m }) => ({ name: s, exposed: m })), {
|
|
558
556
|
dispatch: y,
|
|
559
557
|
state: { newlyCreatedHandlerID: w }
|
|
560
|
-
} = Q(),
|
|
558
|
+
} = Q(), I = B();
|
|
561
559
|
function D() {
|
|
562
|
-
const { className: s, method: m, asRegex:
|
|
563
|
-
return !!(s && m && (
|
|
560
|
+
const { className: s, method: m, asRegex: k, regexPattern: U, pattern: z, verbs: M } = n;
|
|
561
|
+
return !!(s && m && (k ? U : !z.endsWith("/")) && M.length);
|
|
564
562
|
}
|
|
565
563
|
function T() {
|
|
566
564
|
if (D()) {
|
|
567
|
-
const { className: s, method: m, asRegex:
|
|
565
|
+
const { className: s, method: m, asRegex: k, regexPattern: U, pattern: z, verbs: M } = n;
|
|
568
566
|
y({
|
|
569
567
|
type: "UPDATE_HANDLER",
|
|
570
568
|
id: t,
|
|
@@ -572,8 +570,8 @@ const Qe = ({
|
|
|
572
570
|
class: s,
|
|
573
571
|
method: m,
|
|
574
572
|
verbs: M,
|
|
575
|
-
asRegex:
|
|
576
|
-
...
|
|
573
|
+
asRegex: k,
|
|
574
|
+
...k ? { regexPattern: U } : { pattern: z }
|
|
577
575
|
}
|
|
578
576
|
}), y({ type: "SET_EDITING_HANDLER", payload: null });
|
|
579
577
|
}
|
|
@@ -590,23 +588,23 @@ const Qe = ({
|
|
|
590
588
|
y({ type: "DELETE_HANDLER", id: `${w}` }), y({ type: "SET_EDITING_HANDLER", payload: null });
|
|
591
589
|
return;
|
|
592
590
|
}
|
|
593
|
-
if (!
|
|
594
|
-
const { confirmed:
|
|
591
|
+
if (!Ve(s, m)) {
|
|
592
|
+
const { confirmed: k } = await I(
|
|
595
593
|
ae({
|
|
596
594
|
title: "Cancel Changes",
|
|
597
|
-
type:
|
|
598
|
-
color:
|
|
595
|
+
type: ie.CONFIRM,
|
|
596
|
+
color: le.DANGER,
|
|
599
597
|
message: "Are you sure you want to cancel changes made to this Handler?",
|
|
600
598
|
icon: "FdWarningDanger"
|
|
601
599
|
})
|
|
602
600
|
).unwrap();
|
|
603
|
-
if (
|
|
601
|
+
if (k) {
|
|
604
602
|
w === t && y({ type: "DELETE_HANDLER", id: t }), y({ type: "SET_EDITING_HANDLER", payload: null });
|
|
605
603
|
return;
|
|
606
604
|
}
|
|
607
605
|
}
|
|
608
606
|
};
|
|
609
|
-
|
|
607
|
+
Be(
|
|
610
608
|
"esc",
|
|
611
609
|
() => {
|
|
612
610
|
setTimeout(() => {
|
|
@@ -650,7 +648,7 @@ const Qe = ({
|
|
|
650
648
|
"grab-handle"
|
|
651
649
|
),
|
|
652
650
|
/* @__PURE__ */ e(
|
|
653
|
-
|
|
651
|
+
Ye,
|
|
654
652
|
{
|
|
655
653
|
value: n.className,
|
|
656
654
|
onChange: (s) => {
|
|
@@ -664,7 +662,7 @@ const Qe = ({
|
|
|
664
662
|
)
|
|
665
663
|
] }),
|
|
666
664
|
/* @__PURE__ */ e("div", { className: "w-60 flex-shrink-0", children: /* @__PURE__ */ e(
|
|
667
|
-
|
|
665
|
+
Ze,
|
|
668
666
|
{
|
|
669
667
|
value: n.method,
|
|
670
668
|
onChange: (s) => {
|
|
@@ -737,12 +735,12 @@ const Qe = ({
|
|
|
737
735
|
)
|
|
738
736
|
] }),
|
|
739
737
|
/* @__PURE__ */ e("div", { className: "w-20 px-2 flex justify-center", children: /* @__PURE__ */ e(
|
|
740
|
-
|
|
738
|
+
Ue,
|
|
741
739
|
{
|
|
742
740
|
value: !!n.asRegex,
|
|
743
741
|
onChange: (s) => {
|
|
744
742
|
const m = s ? { regexPattern: i, asRegex: s } : { pattern: x, asRegex: s };
|
|
745
|
-
l((
|
|
743
|
+
l((k) => ({ ...k, ...m }));
|
|
746
744
|
},
|
|
747
745
|
className: `${n.asRegex ? "bg-primary-dark" : "bg-grey-300"}
|
|
748
746
|
relative inline-flex h-5 w-8 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`,
|
|
@@ -758,7 +756,7 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
|
|
|
758
756
|
) }),
|
|
759
757
|
/* @__PURE__ */ o("div", { className: "flex flex-1 items-center", children: [
|
|
760
758
|
/* @__PURE__ */ e(
|
|
761
|
-
|
|
759
|
+
Xe,
|
|
762
760
|
{
|
|
763
761
|
initialSelectedItems: n.verbs || [],
|
|
764
762
|
onChange: (s) => {
|
|
@@ -788,7 +786,7 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
|
|
|
788
786
|
}
|
|
789
787
|
),
|
|
790
788
|
onClick: T,
|
|
791
|
-
children: /* @__PURE__ */ e(
|
|
789
|
+
children: /* @__PURE__ */ e(Re, {})
|
|
792
790
|
}
|
|
793
791
|
) }),
|
|
794
792
|
/* @__PURE__ */ e(E, { label: "Cancel Changes", className: "px-1 py-3", children: /* @__PURE__ */ e(
|
|
@@ -796,7 +794,7 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
|
|
|
796
794
|
{
|
|
797
795
|
className: "hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",
|
|
798
796
|
onClick: H,
|
|
799
|
-
children: /* @__PURE__ */ e(
|
|
797
|
+
children: /* @__PURE__ */ e(Pe, {})
|
|
800
798
|
}
|
|
801
799
|
) })
|
|
802
800
|
] })
|
|
@@ -813,17 +811,17 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
|
|
|
813
811
|
asRegex: g
|
|
814
812
|
}) => {
|
|
815
813
|
var P;
|
|
816
|
-
const { attributes: d, listeners: n, setNodeRef: l, transform: p, transition: b } =
|
|
817
|
-
transform:
|
|
814
|
+
const { attributes: d, listeners: n, setNodeRef: l, transform: p, transition: b } = be({ id: t }), v = {
|
|
815
|
+
transform: Me.Transform.toString(p),
|
|
818
816
|
transition: b
|
|
819
817
|
}, {
|
|
820
818
|
dispatch: y,
|
|
821
819
|
state: { editing: w }
|
|
822
|
-
} = Q(),
|
|
820
|
+
} = Q(), I = B(), D = g ? f : i, T = W(re), H = Object.values((T == null ? void 0 : T.singletons) || {}), R = (P = H == null ? void 0 : H.find((s) => s.name === a)) == null ? void 0 : P.methods.map(({ name: s, exposed: m }) => ({ name: s, exposed: m })), h = H == null ? void 0 : H.find(
|
|
823
821
|
(s) => s.name === a
|
|
824
822
|
), u = R == null ? void 0 : R.find((s) => s.name === r), N = u && u.exposed;
|
|
825
823
|
return /* @__PURE__ */ e("div", { className: "odd:bg-grey-500", ref: l, style: v, children: w === t ? /* @__PURE__ */ e(
|
|
826
|
-
|
|
824
|
+
et,
|
|
827
825
|
{
|
|
828
826
|
id: t,
|
|
829
827
|
class: a,
|
|
@@ -913,7 +911,7 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
|
|
|
913
911
|
children: /* @__PURE__ */ e("span", { children: D })
|
|
914
912
|
}
|
|
915
913
|
) : /* @__PURE__ */ e("span", { className: "text-grey-200 italic", children: "/" }) }),
|
|
916
|
-
/* @__PURE__ */ e("div", { className: "px-5 w-20 flex justify-center text-grey-200", children: g ? /* @__PURE__ */ e(
|
|
914
|
+
/* @__PURE__ */ e("div", { className: "px-5 w-20 flex justify-center text-grey-200", children: g ? /* @__PURE__ */ e(Ce, {}) : /* @__PURE__ */ e(De, {}) }),
|
|
917
915
|
/* @__PURE__ */ o("div", { className: "flex flex-1 items-center", children: [
|
|
918
916
|
/* @__PURE__ */ e("div", { className: "text-s w-full", children: c.length ? c.join(",") : /* @__PURE__ */ e("span", { className: "text-grey-200 italic", children: "undefined" }) }),
|
|
919
917
|
/* @__PURE__ */ o("div", { className: "flex items-center gap-0.5 px-2", children: [
|
|
@@ -932,7 +930,7 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
|
|
|
932
930
|
onClick: () => {
|
|
933
931
|
$.next(w), y({ type: "SET_EDITING_HANDLER", payload: t });
|
|
934
932
|
},
|
|
935
|
-
children: /* @__PURE__ */ e(
|
|
933
|
+
children: /* @__PURE__ */ e(Te, {})
|
|
936
934
|
}
|
|
937
935
|
) }),
|
|
938
936
|
/* @__PURE__ */ e(E, { label: "Delete Handler", className: "px-1 py-3", placement: "top-end", children: /* @__PURE__ */ e(
|
|
@@ -940,18 +938,18 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
|
|
|
940
938
|
{
|
|
941
939
|
className: "hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",
|
|
942
940
|
onClick: async () => {
|
|
943
|
-
const { confirmed: s } = await
|
|
941
|
+
const { confirmed: s } = await I(
|
|
944
942
|
ae({
|
|
945
943
|
title: "Delete Handler",
|
|
946
|
-
type:
|
|
947
|
-
color:
|
|
944
|
+
type: ie.CONFIRM,
|
|
945
|
+
color: le.DANGER,
|
|
948
946
|
message: "Are you sure you want to remove this Handler?",
|
|
949
947
|
icon: "FdWarningDanger"
|
|
950
948
|
})
|
|
951
949
|
).unwrap();
|
|
952
950
|
s && y({ type: "DELETE_HANDLER", id: t });
|
|
953
951
|
},
|
|
954
|
-
children: /* @__PURE__ */ e(
|
|
952
|
+
children: /* @__PURE__ */ e(He, {})
|
|
955
953
|
}
|
|
956
954
|
) })
|
|
957
955
|
] })
|
|
@@ -959,32 +957,32 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
|
|
|
959
957
|
]
|
|
960
958
|
}
|
|
961
959
|
) });
|
|
962
|
-
},
|
|
960
|
+
}, tt = A.object({
|
|
963
961
|
class: A.string().optional(),
|
|
964
962
|
method: A.string().optional(),
|
|
965
963
|
verbs: A.string().optional(),
|
|
966
964
|
id: A.string().optional(),
|
|
967
965
|
pattern: A.string().optional(),
|
|
968
966
|
regexPattern: A.string().optional()
|
|
969
|
-
}),
|
|
970
|
-
const a = W(
|
|
967
|
+
}), nt = A.array(tt), rt = ({ path: t }) => {
|
|
968
|
+
const a = W(Ae(t)), {
|
|
971
969
|
dispatch: r,
|
|
972
970
|
state: { content: i, editing: c }
|
|
973
|
-
} = Q(), x =
|
|
974
|
-
X(
|
|
975
|
-
X(
|
|
976
|
-
coordinateGetter:
|
|
971
|
+
} = Q(), x = he(
|
|
972
|
+
X(me),
|
|
973
|
+
X(ge, {
|
|
974
|
+
coordinateGetter: ve
|
|
977
975
|
})
|
|
978
976
|
), [f, g] = _(null), d = i.find((l) => l.id === f), n = B();
|
|
979
977
|
return O(() => {
|
|
980
978
|
const l = JSON.stringify(
|
|
981
979
|
i.map(
|
|
982
|
-
({ isExpanded: b, asRegex: v, pattern: y, regexPattern: w, ...
|
|
980
|
+
({ isExpanded: b, asRegex: v, pattern: y, regexPattern: w, ...I }) => {
|
|
983
981
|
var T;
|
|
984
982
|
const D = v ? { regexPattern: w } : { pattern: y };
|
|
985
983
|
return {
|
|
986
|
-
...
|
|
987
|
-
verbs: (T =
|
|
984
|
+
...I,
|
|
985
|
+
verbs: (T = I.verbs) == null ? void 0 : T.join(","),
|
|
988
986
|
...D
|
|
989
987
|
};
|
|
990
988
|
}
|
|
@@ -993,7 +991,7 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
|
|
|
993
991
|
2
|
|
994
992
|
), p = typeof (a == null ? void 0 : a.content) == "string" ? a.content : JSON.stringify(a == null ? void 0 : a.content, null, 2);
|
|
995
993
|
l !== p && n(
|
|
996
|
-
|
|
994
|
+
_e({
|
|
997
995
|
path: t,
|
|
998
996
|
content: l
|
|
999
997
|
})
|
|
@@ -1001,7 +999,7 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
|
|
|
1001
999
|
}, [i]), /* @__PURE__ */ o("div", { className: "bg-grey-700 flex h-full w-full flex-col text-white", children: [
|
|
1002
1000
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between border-b border-black p-2", children: [
|
|
1003
1001
|
a && /* @__PURE__ */ e(
|
|
1004
|
-
|
|
1002
|
+
Je,
|
|
1005
1003
|
{
|
|
1006
1004
|
label: "Switch to text Editor",
|
|
1007
1005
|
Icon: Ie,
|
|
@@ -1049,10 +1047,10 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
|
|
|
1049
1047
|
] })
|
|
1050
1048
|
] }),
|
|
1051
1049
|
/* @__PURE__ */ e("div", { className: "py-3", children: /* @__PURE__ */ o(
|
|
1052
|
-
|
|
1050
|
+
xe,
|
|
1053
1051
|
{
|
|
1054
1052
|
sensors: x,
|
|
1055
|
-
collisionDetection:
|
|
1053
|
+
collisionDetection: fe,
|
|
1056
1054
|
onDragStart: (l) => {
|
|
1057
1055
|
g(l.active.id);
|
|
1058
1056
|
},
|
|
@@ -1062,20 +1060,20 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
|
|
|
1062
1060
|
const v = i.map((w) => w.id).indexOf(p.id), y = i.map((w) => w.id).indexOf(b.id);
|
|
1063
1061
|
r({
|
|
1064
1062
|
type: "UPDATE_HANDLERS",
|
|
1065
|
-
payload:
|
|
1063
|
+
payload: Ee(i, v, y)
|
|
1066
1064
|
});
|
|
1067
1065
|
}
|
|
1068
1066
|
},
|
|
1069
1067
|
children: [
|
|
1070
1068
|
/* @__PURE__ */ e(
|
|
1071
|
-
|
|
1069
|
+
Ne,
|
|
1072
1070
|
{
|
|
1073
1071
|
items: i,
|
|
1074
|
-
strategy:
|
|
1072
|
+
strategy: we,
|
|
1075
1073
|
children: i.map(({ id: l, ...p }) => /* @__PURE__ */ e(ee, { id: l, ...p }, l))
|
|
1076
1074
|
}
|
|
1077
1075
|
),
|
|
1078
|
-
/* @__PURE__ */ e(
|
|
1076
|
+
/* @__PURE__ */ e(ye, { children: f && d ? /* @__PURE__ */ e("div", { className: "opacity-10", children: /* @__PURE__ */ e(ee, { ...d }) }) : null })
|
|
1079
1077
|
]
|
|
1080
1078
|
}
|
|
1081
1079
|
) })
|
|
@@ -1111,7 +1109,7 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
|
|
|
1111
1109
|
) })
|
|
1112
1110
|
] }) })
|
|
1113
1111
|
] });
|
|
1114
|
-
},
|
|
1112
|
+
}, at = ({ content: t, path: a }) => {
|
|
1115
1113
|
const [r, i] = _(null);
|
|
1116
1114
|
function c(d) {
|
|
1117
1115
|
let n;
|
|
@@ -1123,7 +1121,7 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
|
|
|
1123
1121
|
return n;
|
|
1124
1122
|
}
|
|
1125
1123
|
const x = typeof t == "string" ? c(t) : t;
|
|
1126
|
-
if (!
|
|
1124
|
+
if (!nt.safeParse(x).success || r)
|
|
1127
1125
|
throw new Error("Invalid JSON");
|
|
1128
1126
|
const g = x.map((d) => {
|
|
1129
1127
|
var l;
|
|
@@ -1135,16 +1133,16 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
|
|
|
1135
1133
|
asRegex: n
|
|
1136
1134
|
};
|
|
1137
1135
|
});
|
|
1138
|
-
return /* @__PURE__ */ e(
|
|
1139
|
-
},
|
|
1140
|
-
|
|
1136
|
+
return /* @__PURE__ */ e(Qe, { content: g, children: /* @__PURE__ */ e(rt, { path: a }) });
|
|
1137
|
+
}, wt = (t) => /* @__PURE__ */ e(Le, { store: Fe(), children: /* @__PURE__ */ e("div", { className: "h-screen bg-grey-900", children: /* @__PURE__ */ e(
|
|
1138
|
+
at,
|
|
1141
1139
|
{
|
|
1142
|
-
path:
|
|
1140
|
+
path: ze,
|
|
1143
1141
|
...t
|
|
1144
1142
|
}
|
|
1145
1143
|
) }) });
|
|
1146
1144
|
export {
|
|
1147
|
-
|
|
1148
|
-
|
|
1145
|
+
at as HTTPHandlersEditor,
|
|
1146
|
+
wt as Standalone
|
|
1149
1147
|
};
|
|
1150
1148
|
//# sourceMappingURL=index.es.js.map
|