@ixo/editor 4.3.1 → 5.0.0
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/{chunk-JMWCQ67Z.mjs → chunk-3L5YSHP3.mjs} +850 -924
- package/dist/chunk-3L5YSHP3.mjs.map +1 -0
- package/dist/{chunk-LXEEL4NA.mjs → chunk-S4DPLPJX.mjs} +2 -2
- package/dist/{chunk-B7UIUYP5.mjs → chunk-YA5P7BXL.mjs} +449 -143
- package/dist/chunk-YA5P7BXL.mjs.map +1 -0
- package/dist/core/index.d.ts +16 -24
- package/dist/core/index.mjs +6 -4
- package/dist/{decompile-rdAf19Es.d.ts → decompile-BKoXQ5wy.d.ts} +14 -2
- package/dist/{graphql-client-DJcK_z3q.d.ts → graphql-client-BaAWHrE0.d.ts} +1 -1
- package/dist/{index-ClqpuDwu.d.ts → index-DKdgkEuo.d.ts} +9 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/mantine/index.d.ts +4 -4
- package/dist/mantine/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-B7UIUYP5.mjs.map +0 -1
- package/dist/chunk-JMWCQ67Z.mjs.map +0 -1
- /package/dist/{chunk-LXEEL4NA.mjs.map → chunk-S4DPLPJX.mjs.map} +0 -0
|
@@ -22,11 +22,13 @@ import {
|
|
|
22
22
|
reconcilePendingInvocations,
|
|
23
23
|
removePendingInvocation,
|
|
24
24
|
resolveActionType,
|
|
25
|
+
resolveEntityTypeFromSchema,
|
|
25
26
|
sendDirectMessage,
|
|
26
27
|
setActiveEditor,
|
|
27
28
|
tempDomainCreatorSurvey,
|
|
28
|
-
transformSurveyToCredentialSubject
|
|
29
|
-
|
|
29
|
+
transformSurveyToCredentialSubject,
|
|
30
|
+
writeRunRecordAndReconcile
|
|
31
|
+
} from "./chunk-YA5P7BXL.mjs";
|
|
30
32
|
|
|
31
33
|
// src/mantine/hooks/useCreateIxoEditor.ts
|
|
32
34
|
import { useCreateBlockNote } from "@blocknote/react";
|
|
@@ -87,18 +89,7 @@ import { Divider, SegmentedControl, Stack, Switch, Text, PillsInput, Pill } from
|
|
|
87
89
|
import { Textarea } from "@mantine/core";
|
|
88
90
|
import React from "react";
|
|
89
91
|
function BaseTextArea({ ...props }) {
|
|
90
|
-
return /* @__PURE__ */ React.createElement(
|
|
91
|
-
Textarea,
|
|
92
|
-
{
|
|
93
|
-
minRows: 2,
|
|
94
|
-
draggable: true,
|
|
95
|
-
autosize: true,
|
|
96
|
-
maxRows: 10,
|
|
97
|
-
resize: "vertical",
|
|
98
|
-
radius: "md",
|
|
99
|
-
...props
|
|
100
|
-
}
|
|
101
|
-
);
|
|
92
|
+
return /* @__PURE__ */ React.createElement(Textarea, { minRows: 2, draggable: true, autosize: true, maxRows: 10, resize: "vertical", radius: "md", ...props });
|
|
102
93
|
}
|
|
103
94
|
|
|
104
95
|
// src/mantine/components/Base/BaseTextInput.tsx
|
|
@@ -18561,16 +18552,7 @@ var FormFlowView = ({ editor, block }) => {
|
|
|
18561
18552
|
const badgeProps = getBadgeProps();
|
|
18562
18553
|
const hasSchema = Boolean(block.props.surveySchema);
|
|
18563
18554
|
const completedAt = runtime.executedAt;
|
|
18564
|
-
return /* @__PURE__ */ React196.createElement(BaseContainer, { blockId: block.id, onClick: handleOpen }, /* @__PURE__ */ React196.createElement(Group68, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React196.createElement(Group68, { wrap: "nowrap", align: "center", style: { flex: 1 } }, getIcon("checklist", block.props.icon), /* @__PURE__ */ React196.createElement(Stack133, { gap: 4, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React196.createElement(Group68, { gap: "xs", align: "center" }, /* @__PURE__ */ React196.createElement(Text111, { fw: 600, size: "sm" }, block.props.title || "Form"), /* @__PURE__ */ React196.createElement(
|
|
18565
|
-
Badge28,
|
|
18566
|
-
{
|
|
18567
|
-
size: "xs",
|
|
18568
|
-
variant: badgeProps.variant,
|
|
18569
|
-
color: badgeProps.color,
|
|
18570
|
-
styles: { root: { backgroundColor: `var(--mantine-color-${badgeProps.color}-6)` } }
|
|
18571
|
-
},
|
|
18572
|
-
badgeProps.text
|
|
18573
|
-
)), /* @__PURE__ */ React196.createElement(Text111, { size: "xs", c: "dimmed", lineClamp: 2 }, isCompleted && completedAt ? `Completed on ${new Date(completedAt).toLocaleDateString()}` : hasSchema ? "Click to fill out the form" : "Form not configured"))), /* @__PURE__ */ React196.createElement(Tooltip16, { label: isCompleted ? "View form" : "Fill form", withArrow: true }, /* @__PURE__ */ React196.createElement(ActionIcon26, { variant: "subtle", color: "blue" }, /* @__PURE__ */ React196.createElement(IconChevronRight7, { size: 18 })))));
|
|
18555
|
+
return /* @__PURE__ */ React196.createElement(BaseContainer, { blockId: block.id, onClick: handleOpen }, /* @__PURE__ */ React196.createElement(Group68, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React196.createElement(Group68, { wrap: "nowrap", align: "center", style: { flex: 1 } }, getIcon("checklist", block.props.icon), /* @__PURE__ */ React196.createElement(Stack133, { gap: 4, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React196.createElement(Group68, { gap: "xs", align: "center" }, /* @__PURE__ */ React196.createElement(Text111, { fw: 600, size: "sm" }, block.props.title || "Form"), /* @__PURE__ */ React196.createElement(Badge28, { size: "xs", variant: badgeProps.variant, color: badgeProps.color, styles: { root: { backgroundColor: `var(--mantine-color-${badgeProps.color}-6)` } } }, badgeProps.text)), /* @__PURE__ */ React196.createElement(Text111, { size: "xs", c: "dimmed", lineClamp: 2 }, isCompleted && completedAt ? `Completed on ${new Date(completedAt).toLocaleDateString()}` : hasSchema ? "Click to fill out the form" : "Form not configured"))), /* @__PURE__ */ React196.createElement(Tooltip16, { label: isCompleted ? "View form" : "Fill form", withArrow: true }, /* @__PURE__ */ React196.createElement(ActionIcon26, { variant: "subtle", color: "blue" }, /* @__PURE__ */ React196.createElement(IconChevronRight7, { size: 18 })))));
|
|
18574
18556
|
};
|
|
18575
18557
|
|
|
18576
18558
|
// src/mantine/blocks/form/FormBlock.tsx
|
|
@@ -21913,11 +21895,11 @@ var FlowLinkBlockSpec = createReactBlockSpec19(
|
|
|
21913
21895
|
);
|
|
21914
21896
|
|
|
21915
21897
|
// src/mantine/blocks/action/ActionBlockSpec.tsx
|
|
21916
|
-
import
|
|
21898
|
+
import React289 from "react";
|
|
21917
21899
|
import { createReactBlockSpec as createReactBlockSpec20 } from "@blocknote/react";
|
|
21918
21900
|
|
|
21919
21901
|
// src/mantine/blocks/action/ActionBlock.tsx
|
|
21920
|
-
import
|
|
21902
|
+
import React288 from "react";
|
|
21921
21903
|
|
|
21922
21904
|
// src/mantine/blocks/action/template/TemplateView.tsx
|
|
21923
21905
|
import React235, { useMemo as useMemo86 } from "react";
|
|
@@ -22085,11 +22067,6 @@ var ACTION_TYPE_META = {
|
|
|
22085
22067
|
description: "Select a protocol from a configured list",
|
|
22086
22068
|
icon: icon(IconBolt7, COMBO_ICON_SIZE)
|
|
22087
22069
|
},
|
|
22088
|
-
"qi/domain.card-build": {
|
|
22089
|
-
label: "Build Domain Card",
|
|
22090
|
-
description: "Collect survey answers and build an unsigned W3C domain card credential",
|
|
22091
|
-
icon: icon(IconBuildingEstate, COMBO_ICON_SIZE)
|
|
22092
|
-
},
|
|
22093
22070
|
"qi/domain.card-preview": {
|
|
22094
22071
|
label: "Preview Domain Card",
|
|
22095
22072
|
description: "Review an oracle-enriched domain card and approve it before signing",
|
|
@@ -22222,12 +22199,15 @@ function TriggerSection({
|
|
|
22222
22199
|
const triggerTypeOptions = [
|
|
22223
22200
|
{ value: "manual", label: "Manual (user clicks invoke)" },
|
|
22224
22201
|
{ value: "flow.start", label: "On flow start" },
|
|
22225
|
-
{ value: "block.event", label: "On event from another block" }
|
|
22202
|
+
{ value: "block.event", label: "On event from another block" },
|
|
22203
|
+
{ value: "block.event.all", label: "When all events fire (barrier)" }
|
|
22226
22204
|
];
|
|
22227
22205
|
const handleTypeChange = (value) => {
|
|
22228
22206
|
if (!value) return;
|
|
22229
22207
|
if (value === "block.event") {
|
|
22230
22208
|
onTriggerChange(serializeTriggerSpec({ type: "block.event", sourceBlockId: "", eventName: "" }));
|
|
22209
|
+
} else if (value === "block.event.all") {
|
|
22210
|
+
onTriggerChange(serializeTriggerSpec({ type: "block.event.all", sources: [] }));
|
|
22231
22211
|
} else if (value === "flow.start") {
|
|
22232
22212
|
onTriggerChange(serializeTriggerSpec({ type: "flow.start" }));
|
|
22233
22213
|
} else {
|
|
@@ -22277,7 +22257,68 @@ function TriggerSection({
|
|
|
22277
22257
|
},
|
|
22278
22258
|
disabled: eventOptions.length === 0
|
|
22279
22259
|
}
|
|
22280
|
-
), selectedEvent && /* @__PURE__ */ React233.createElement(Box43, { pl: 4 }, /* @__PURE__ */ React233.createElement(Text131, { size: "xs", c: "dimmed" }, selectedEvent.description)), current.sourceBlockId && current.eventName && /* @__PURE__ */ React233.createElement(Box43, { pl: 4 }, /* @__PURE__ */ React233.createElement(Text131, { size: "xs", c: "dimmed" }, "This block will be queued for invocation each time the selected event fires. The assignee on this block (set under Assignment) will be DM'd to invoke it.")))
|
|
22260
|
+
), selectedEvent && /* @__PURE__ */ React233.createElement(Box43, { pl: 4 }, /* @__PURE__ */ React233.createElement(Text131, { size: "xs", c: "dimmed" }, selectedEvent.description)), current.sourceBlockId && current.eventName && /* @__PURE__ */ React233.createElement(Box43, { pl: 4 }, /* @__PURE__ */ React233.createElement(Text131, { size: "xs", c: "dimmed" }, "This block will be queued for invocation each time the selected event fires. The assignee on this block (set under Assignment) will be DM'd to invoke it."))), current.type === "block.event.all" && /* @__PURE__ */ React233.createElement(
|
|
22261
|
+
BarrierSourcesEditor,
|
|
22262
|
+
{
|
|
22263
|
+
sources: current.sources || [],
|
|
22264
|
+
sourceBlockOptions,
|
|
22265
|
+
onChange: (sources) => onTriggerChange(serializeTriggerSpec({ type: "block.event.all", sources }))
|
|
22266
|
+
}
|
|
22267
|
+
));
|
|
22268
|
+
}
|
|
22269
|
+
function BarrierSourcesEditor({
|
|
22270
|
+
sources,
|
|
22271
|
+
sourceBlockOptions,
|
|
22272
|
+
onChange
|
|
22273
|
+
}) {
|
|
22274
|
+
const handleAdd = () => {
|
|
22275
|
+
onChange([...sources, { sourceBlockId: "", eventName: "", alias: "" }]);
|
|
22276
|
+
};
|
|
22277
|
+
const handleRemove = (index) => {
|
|
22278
|
+
onChange(sources.filter((_, i) => i !== index));
|
|
22279
|
+
};
|
|
22280
|
+
const handleUpdate = (index, patch) => {
|
|
22281
|
+
const updated = [...sources];
|
|
22282
|
+
updated[index] = { ...updated[index], ...patch };
|
|
22283
|
+
if (patch.sourceBlockId && patch.sourceBlockId !== sources[index].sourceBlockId) {
|
|
22284
|
+
updated[index].eventName = "";
|
|
22285
|
+
}
|
|
22286
|
+
onChange(updated);
|
|
22287
|
+
};
|
|
22288
|
+
return /* @__PURE__ */ React233.createElement(Stack153, { gap: "xs" }, /* @__PURE__ */ React233.createElement(Text131, { size: "xs", c: "dimmed" }, "This block will fire only when ALL of the following events have occurred. Each source payload is namespaced by alias for input refs."), sources.map((src, index) => {
|
|
22289
|
+
const sourceAction = sourceBlockOptions.find((o) => o.value === src.sourceBlockId)?.action;
|
|
22290
|
+
const eventOptions = (sourceAction?.events || []).map((e) => ({ value: e.name, label: e.displayName }));
|
|
22291
|
+
return /* @__PURE__ */ React233.createElement(Paper16, { key: index, p: "xs", withBorder: true }, /* @__PURE__ */ React233.createElement(Stack153, { gap: "xs" }, /* @__PURE__ */ React233.createElement(Group84, { gap: "xs", align: "flex-end" }, /* @__PURE__ */ React233.createElement(
|
|
22292
|
+
Select5,
|
|
22293
|
+
{
|
|
22294
|
+
label: "Source block",
|
|
22295
|
+
placeholder: "Select block",
|
|
22296
|
+
data: sourceBlockOptions.map((o) => ({ value: o.value, label: o.label })),
|
|
22297
|
+
value: src.sourceBlockId || null,
|
|
22298
|
+
onChange: (value) => value && handleUpdate(index, { sourceBlockId: value }),
|
|
22299
|
+
style: { flex: 1 },
|
|
22300
|
+
size: "xs"
|
|
22301
|
+
}
|
|
22302
|
+
), /* @__PURE__ */ React233.createElement(ActionIcon33, { color: "red", variant: "subtle", onClick: () => handleRemove(index), size: "sm" }, /* @__PURE__ */ React233.createElement(IconTrash8, { size: 14 }))), src.sourceBlockId && /* @__PURE__ */ React233.createElement(
|
|
22303
|
+
Select5,
|
|
22304
|
+
{
|
|
22305
|
+
label: "Event",
|
|
22306
|
+
placeholder: "Select event",
|
|
22307
|
+
data: eventOptions,
|
|
22308
|
+
value: src.eventName || null,
|
|
22309
|
+
onChange: (value) => value && handleUpdate(index, { eventName: value }),
|
|
22310
|
+
size: "xs"
|
|
22311
|
+
}
|
|
22312
|
+
), /* @__PURE__ */ React233.createElement(
|
|
22313
|
+
BaseTextInput,
|
|
22314
|
+
{
|
|
22315
|
+
placeholder: "Alias (e.g. governance, preview)",
|
|
22316
|
+
value: src.alias,
|
|
22317
|
+
onChange: (e) => handleUpdate(index, { alias: e.currentTarget.value.replace(/[^a-zA-Z0-9_]/g, "") }),
|
|
22318
|
+
size: "xs"
|
|
22319
|
+
}
|
|
22320
|
+
), src.alias && /* @__PURE__ */ React233.createElement(Text131, { size: "xs", c: "dimmed" }, "Access payload via: trigger.payload.", src.alias, ".*")));
|
|
22321
|
+
}), /* @__PURE__ */ React233.createElement(Button39, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ React233.createElement(IconPlus7, { size: 14 }), onClick: handleAdd }, "Add Source"), sources.length > 0 && sources.every((s) => s.sourceBlockId && s.eventName && s.alias) && /* @__PURE__ */ React233.createElement(Box43, { pl: 4 }, /* @__PURE__ */ React233.createElement(Text131, { size: "xs", c: "dimmed" }, "All ", sources.length, " events must fire before this block is queued. Payloads are merged by alias.")));
|
|
22281
22322
|
}
|
|
22282
22323
|
function GenericInputsEditor({ inputs, onInputsChange, editor, blockId }) {
|
|
22283
22324
|
const [localInputs, setLocalInputs] = useState88(() => parseInputPairs(inputs));
|
|
@@ -22918,12 +22959,13 @@ var ActionFlowView = ({ editor, block, isDisabled }) => {
|
|
|
22918
22959
|
onClick: open,
|
|
22919
22960
|
style: {
|
|
22920
22961
|
padding: 20,
|
|
22921
|
-
borderColor: isPanelOpenForBlock ? "var(--mantine-color-
|
|
22962
|
+
borderColor: isPanelOpenForBlock ? "#2AEAB3" : "var(--mantine-color-neutralColor-6)",
|
|
22963
|
+
background: "var(--mantine-color-neutralColor-5)",
|
|
22922
22964
|
boxShadow: "none",
|
|
22923
22965
|
transition: "border-color 140ms ease"
|
|
22924
22966
|
}
|
|
22925
22967
|
},
|
|
22926
|
-
/* @__PURE__ */ React239.createElement(Group88, { wrap: "nowrap", gap: 24, align: "center", style: { width: "100%" } }, /* @__PURE__ */ React239.createElement(Group88, { wrap: "nowrap", gap: 16, align: "center", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React239.createElement(Box47, { style: { flexShrink: 0, width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center" } }, getActionMeta(actionType).icon), /* @__PURE__ */ React239.createElement(Stack158, { gap: 0, style: { flex: 1, minWidth: 0, overflow: "hidden" } }, /* @__PURE__ */ React239.createElement(Text136, { fw: 500, size: "md", c: "
|
|
22968
|
+
/* @__PURE__ */ React239.createElement(Group88, { wrap: "nowrap", gap: 24, align: "center", style: { width: "100%" } }, /* @__PURE__ */ React239.createElement(Group88, { wrap: "nowrap", gap: 16, align: "center", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React239.createElement(Box47, { style: { flexShrink: 0, width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center" } }, getActionMeta(actionType).icon), /* @__PURE__ */ React239.createElement(Stack158, { gap: 0, style: { flex: 1, minWidth: 0, overflow: "hidden" } }, /* @__PURE__ */ React239.createElement(Text136, { fw: 500, size: "md", c: "white", truncate: true, contentEditable: false, style: { letterSpacing: "0.16px", lineHeight: 1.5 } }, block.props.title || "Title of the action"), /* @__PURE__ */ React239.createElement(Text136, { size: "sm", c: "dimmed", truncate: true, contentEditable: false, style: { letterSpacing: "0.14px" } }, dueDateDisplay || block.props.description || "Due Date"))), /* @__PURE__ */ React239.createElement(Stack158, { gap: 2, align: "flex-end", style: { flexShrink: 0, minWidth: 100 } }, /* @__PURE__ */ React239.createElement(Text136, { fw: 500, size: "md", c: statusColor3, contentEditable: false, style: { letterSpacing: "0.16px", lineHeight: 1.5, textAlign: "right" } }, statusLabel), /* @__PURE__ */ React239.createElement(Group88, { gap: 4, justify: "flex-end" }, /* @__PURE__ */ React239.createElement(CommitmentDisplay, { block, onClick: openCommitment }), /* @__PURE__ */ React239.createElement(AssignmentDisplay, { block, onClick: open }))))
|
|
22927
22969
|
);
|
|
22928
22970
|
};
|
|
22929
22971
|
function ActionPanelContent({
|
|
@@ -22939,6 +22981,7 @@ function ActionPanelContent({
|
|
|
22939
22981
|
const executeFnRef = useRef22(null);
|
|
22940
22982
|
const [canSign, setCanSign] = useState92(false);
|
|
22941
22983
|
const [runtimeInputs, setRuntimeInputs] = useState92({});
|
|
22984
|
+
const [showFlowDetail, setShowFlowDetail] = useState92(false);
|
|
22942
22985
|
const provideSigningHandler = useCallback71((fn) => {
|
|
22943
22986
|
executeFnRef.current = fn;
|
|
22944
22987
|
}, []);
|
|
@@ -22951,20 +22994,19 @@ function ActionPanelContent({
|
|
|
22951
22994
|
const actionTypeUI = actionType ? getActionTypeUI(actionType) : void 0;
|
|
22952
22995
|
const executionMode = actionTypeUI?.executionMode ?? "custom";
|
|
22953
22996
|
const isSlideToSign = executionMode === "slide-to-sign";
|
|
22954
|
-
|
|
22955
|
-
|
|
22956
|
-
|
|
22957
|
-
|
|
22958
|
-
|
|
22959
|
-
|
|
22960
|
-
|
|
22961
|
-
|
|
22962
|
-
|
|
22963
|
-
|
|
22964
|
-
|
|
22965
|
-
|
|
22966
|
-
|
|
22967
|
-
}
|
|
22997
|
+
const handleInvoke = useCallback71(() => {
|
|
22998
|
+
setShowFlowDetail(true);
|
|
22999
|
+
}, []);
|
|
23000
|
+
const triggerMode = (() => {
|
|
23001
|
+
const raw = block.props.trigger;
|
|
23002
|
+
if (raw && typeof raw === "string") {
|
|
23003
|
+
try {
|
|
23004
|
+
return JSON.parse(raw)?.type || block.props.triggerMode || "manual";
|
|
23005
|
+
} catch {
|
|
23006
|
+
}
|
|
23007
|
+
}
|
|
23008
|
+
return block.props.triggerMode || "manual";
|
|
23009
|
+
})();
|
|
22968
23010
|
const mergedInputs = useMemo89(() => {
|
|
22969
23011
|
try {
|
|
22970
23012
|
const template = typeof block.props.inputs === "string" ? JSON.parse(block.props.inputs || "{}") : block.props.inputs || {};
|
|
@@ -22975,6 +23017,25 @@ function ActionPanelContent({
|
|
|
22975
23017
|
}, [block.props.inputs, runtimeInputs]);
|
|
22976
23018
|
const showPreview = hasDiffResolver(actionType);
|
|
22977
23019
|
const diffResult = useActionDiff({ actionType, inputs: mergedInputs });
|
|
23020
|
+
if (triggerMode === "block.event" || triggerMode === "block.event.all") {
|
|
23021
|
+
if (showFlowDetail && FlowDetailComponent) {
|
|
23022
|
+
return /* @__PURE__ */ React239.createElement(Stack158, { gap: "md", py: "md" }, /* @__PURE__ */ React239.createElement(
|
|
23023
|
+
FlowDetailComponent,
|
|
23024
|
+
{
|
|
23025
|
+
inputs: block.props.inputs || "{}",
|
|
23026
|
+
editor,
|
|
23027
|
+
block,
|
|
23028
|
+
runtime,
|
|
23029
|
+
updateRuntime,
|
|
23030
|
+
isDisabled,
|
|
23031
|
+
provideSigningHandler,
|
|
23032
|
+
unlockSigning,
|
|
23033
|
+
registerRuntimeInputs
|
|
23034
|
+
}
|
|
23035
|
+
), runtime.error && /* @__PURE__ */ React239.createElement(Alert33, { icon: /* @__PURE__ */ React239.createElement(IconAlertTriangle4, { size: 16 }), title: "Execution Error", color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React239.createElement(Text136, { size: "xs" }, runtime.error.message)));
|
|
23036
|
+
}
|
|
23037
|
+
return /* @__PURE__ */ React239.createElement(Stack158, { gap: "md", py: "md" }, /* @__PURE__ */ React239.createElement(PendingInvocationList, { editor, blockId: block.id, actionType, onInvoke: handleInvoke }), runtime.error && /* @__PURE__ */ React239.createElement(Alert33, { icon: /* @__PURE__ */ React239.createElement(IconAlertTriangle4, { size: 16 }), title: "Execution Error", color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React239.createElement(Text136, { size: "xs" }, runtime.error.message)));
|
|
23038
|
+
}
|
|
22978
23039
|
const hasDiffs = showPreview && (diffResult.diffs.length > 0 || diffResult.error);
|
|
22979
23040
|
const diffView = hasDiffs ? /* @__PURE__ */ React239.createElement(
|
|
22980
23041
|
ActionDiffView,
|
|
@@ -23000,18 +23061,7 @@ function ActionPanelContent({
|
|
|
23000
23061
|
unlockSigning,
|
|
23001
23062
|
registerRuntimeInputs
|
|
23002
23063
|
}
|
|
23003
|
-
), diffView, runtime.error && /* @__PURE__ */ React239.createElement(
|
|
23004
|
-
Alert33,
|
|
23005
|
-
{
|
|
23006
|
-
icon: /* @__PURE__ */ React239.createElement(IconAlertTriangle4, { size: 16 }),
|
|
23007
|
-
title: "Execution Error",
|
|
23008
|
-
color: "red",
|
|
23009
|
-
styles: actionAlertStyles,
|
|
23010
|
-
withCloseButton: true,
|
|
23011
|
-
onClose: () => updateRuntime({ error: void 0, state: runtime.state === "failed" ? "idle" : runtime.state })
|
|
23012
|
-
},
|
|
23013
|
-
/* @__PURE__ */ React239.createElement(Text136, { size: "xs" }, runtime.error.message)
|
|
23014
|
-
));
|
|
23064
|
+
), diffView, runtime.error && /* @__PURE__ */ React239.createElement(Alert33, { icon: /* @__PURE__ */ React239.createElement(IconAlertTriangle4, { size: 16 }), title: "Execution Error", color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React239.createElement(Text136, { size: "xs" }, runtime.error.message)));
|
|
23015
23065
|
}
|
|
23016
23066
|
if (FlowDetailComponent) {
|
|
23017
23067
|
return /* @__PURE__ */ React239.createElement(Stack158, { gap: "md", py: "md" }, /* @__PURE__ */ React239.createElement(FlowDetailComponent, { inputs: block.props.inputs || "{}", editor, block, runtime, updateRuntime, isDisabled }));
|
|
@@ -23109,6 +23159,7 @@ function GenericFlowPanel({
|
|
|
23109
23159
|
const editorDocument = editor?.document || [];
|
|
23110
23160
|
const yRuntime = editor?._yRuntime;
|
|
23111
23161
|
const resolvedInputs = resolveInputs(parsedInputs, editorDocument, yRuntime);
|
|
23162
|
+
let actionEvents = [];
|
|
23112
23163
|
const outcome = await executeNode({
|
|
23113
23164
|
node: flowNode,
|
|
23114
23165
|
actorDid,
|
|
@@ -23134,6 +23185,7 @@ function GenericFlowPanel({
|
|
|
23134
23185
|
handlers,
|
|
23135
23186
|
editor
|
|
23136
23187
|
});
|
|
23188
|
+
if (result.events) actionEvents = result.events;
|
|
23137
23189
|
return {
|
|
23138
23190
|
payload: result.output,
|
|
23139
23191
|
submittedByDid: actorDid || void 0
|
|
@@ -23151,6 +23203,9 @@ function GenericFlowPanel({
|
|
|
23151
23203
|
executedAt: Date.now(),
|
|
23152
23204
|
output
|
|
23153
23205
|
});
|
|
23206
|
+
if (actionEvents.length > 0) {
|
|
23207
|
+
writeRunRecordAndReconcile(editor, block.id, output, actionEvents, actorDid);
|
|
23208
|
+
}
|
|
23154
23209
|
} catch (error) {
|
|
23155
23210
|
updateRuntime({
|
|
23156
23211
|
state: "failed",
|
|
@@ -23177,7 +23232,7 @@ function GenericFlowPanel({
|
|
|
23177
23232
|
), isDisabled && disabledMessage && /* @__PURE__ */ React239.createElement(Text136, { size: "xs", c: "dimmed" }, disabledMessage), runtime.error && /* @__PURE__ */ React239.createElement(Alert33, { icon: /* @__PURE__ */ React239.createElement(IconAlertTriangle4, { size: 16 }), title: "Execution Error", color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React239.createElement(Text136, { size: "xs" }, runtime.error.message)), Object.keys(parsedInputs).length > 0 && /* @__PURE__ */ React239.createElement(React239.Fragment, null, /* @__PURE__ */ React239.createElement(Divider20, null), /* @__PURE__ */ React239.createElement(Stack158, { gap: "xs" }, /* @__PURE__ */ React239.createElement(Text136, { size: "xs", fw: 600, c: "dimmed" }, "Inputs"), /* @__PURE__ */ React239.createElement(Code7, { block: true, style: { fontSize: "11px" } }, JSON.stringify(parsedInputs, null, 2)))), outputJson && /* @__PURE__ */ React239.createElement(React239.Fragment, null, /* @__PURE__ */ React239.createElement(Divider20, null), /* @__PURE__ */ React239.createElement(Stack158, { gap: "xs" }, /* @__PURE__ */ React239.createElement(Text136, { size: "xs", fw: 600, c: "dimmed" }, "Output"), /* @__PURE__ */ React239.createElement(Code7, { block: true, style: { fontSize: "11px", maxHeight: "300px", overflow: "auto" } }, outputJson))));
|
|
23178
23233
|
}
|
|
23179
23234
|
|
|
23180
|
-
// src/mantine/blocks/action/actionTypes/pod/DomainIndexerLookupConfig.tsx
|
|
23235
|
+
// src/mantine/blocks/action/actionTypes/pod/domainIndexerLookup/DomainIndexerLookupConfig.tsx
|
|
23181
23236
|
import React240, { useCallback as useCallback72, useEffect as useEffect76, useState as useState93 } from "react";
|
|
23182
23237
|
import { Stack as Stack159, Text as Text137 } from "@mantine/core";
|
|
23183
23238
|
|
|
@@ -23201,7 +23256,7 @@ function parseJsonSafe(json, fallback) {
|
|
|
23201
23256
|
}
|
|
23202
23257
|
}
|
|
23203
23258
|
|
|
23204
|
-
// src/mantine/blocks/action/actionTypes/pod/DomainIndexerLookupConfig.tsx
|
|
23259
|
+
// src/mantine/blocks/action/actionTypes/pod/domainIndexerLookup/DomainIndexerLookupConfig.tsx
|
|
23205
23260
|
var DEFAULT = { agentMessage: "", userMessage: "" };
|
|
23206
23261
|
var DomainIndexerLookupConfig = ({ inputs, onInputsChange }) => {
|
|
23207
23262
|
const [local, setLocal] = useState93(() => parseJsonSafe(inputs, DEFAULT));
|
|
@@ -23227,7 +23282,7 @@ var DomainIndexerLookupConfig = ({ inputs, onInputsChange }) => {
|
|
|
23227
23282
|
)), /* @__PURE__ */ React240.createElement(Stack159, { gap: "xs" }, /* @__PURE__ */ React240.createElement(Text137, { size: "sm", fw: 600 }, "Default User Message (optional)"), /* @__PURE__ */ React240.createElement(Text137, { size: "xs", c: "dimmed" }, "Pre-fill the search input. The user can override this."), /* @__PURE__ */ React240.createElement(BaseTextInput, { placeholder: "e.g. Manage the organisation's finances", value: local.userMessage, onChange: (e) => update({ userMessage: e.currentTarget.value }) })));
|
|
23228
23283
|
};
|
|
23229
23284
|
|
|
23230
|
-
// src/mantine/blocks/action/actionTypes/pod/DomainIndexerLookupFlowDetail.tsx
|
|
23285
|
+
// src/mantine/blocks/action/actionTypes/pod/domainIndexerLookup/DomainIndexerLookupFlowDetail.tsx
|
|
23231
23286
|
import React241, { useCallback as useCallback73, useState as useState94 } from "react";
|
|
23232
23287
|
import { Alert as Alert34, Button as Button42, Loader as Loader33, Stack as Stack160, Text as Text138, Textarea as Textarea2 } from "@mantine/core";
|
|
23233
23288
|
import { IconSearch as IconSearch6, IconAlertCircle as IconAlertCircle17 } from "@tabler/icons-react";
|
|
@@ -23275,7 +23330,13 @@ var DomainIndexerLookupFlowDetail = ({ inputs, block, runtime, updateRuntime, is
|
|
|
23275
23330
|
), /* @__PURE__ */ React241.createElement(Button42, { leftSection: loading ? /* @__PURE__ */ React241.createElement(Loader33, { size: 14 }) : /* @__PURE__ */ React241.createElement(IconSearch6, { size: 14 }), onClick: handleSearch, disabled: isDisabled || loading || !userMessage.trim() }, loading ? "Asking companion..." : "Find Blueprints"), error && /* @__PURE__ */ React241.createElement(Alert34, { icon: /* @__PURE__ */ React241.createElement(IconAlertCircle17, { size: 16 }), title: "Search Failed", color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React241.createElement(Text138, { size: "sm" }, error)), isComplete && !error && /* @__PURE__ */ React241.createElement(Alert34, { color: "green", styles: actionAlertStyles }, /* @__PURE__ */ React241.createElement(Text138, { size: "sm" }, "Purpose recorded. Proceed to Step 2 once the companion returns blueprints.")));
|
|
23276
23331
|
};
|
|
23277
23332
|
|
|
23278
|
-
// src/mantine/blocks/action/actionTypes/pod/
|
|
23333
|
+
// src/mantine/blocks/action/actionTypes/pod/domainIndexerLookup/index.ts
|
|
23334
|
+
registerActionTypeUI("qi/pod.domain-indexer-lookup", {
|
|
23335
|
+
configComponent: DomainIndexerLookupConfig,
|
|
23336
|
+
flowDetailComponent: DomainIndexerLookupFlowDetail
|
|
23337
|
+
});
|
|
23338
|
+
|
|
23339
|
+
// src/mantine/blocks/action/actionTypes/pod/domainSingleSelection/DomainSingleSelectionConfig.tsx
|
|
23279
23340
|
import React242, { useCallback as useCallback74, useEffect as useEffect77, useState as useState95 } from "react";
|
|
23280
23341
|
import { Stack as Stack161, Text as Text139 } from "@mantine/core";
|
|
23281
23342
|
var DEFAULT2 = { filter: "", blueprintDids: [] };
|
|
@@ -23295,7 +23356,7 @@ var DomainSingleSelectionConfig = ({ inputs, onInputsChange }) => {
|
|
|
23295
23356
|
return /* @__PURE__ */ React242.createElement(Stack161, { gap: "md" }, /* @__PURE__ */ React242.createElement(Stack161, { gap: "xs" }, /* @__PURE__ */ React242.createElement(Text139, { size: "sm", fw: 600 }, "Filter Key"), /* @__PURE__ */ React242.createElement(Text139, { size: "xs", c: "dimmed" }, 'Optional category or tag key used to filter the blueprint list (e.g. "finance", "dao-ops").'), /* @__PURE__ */ React242.createElement(BaseTextInput, { placeholder: "e.g. finance", value: local.filter, onChange: (e) => update({ filter: e.currentTarget.value }) })), /* @__PURE__ */ React242.createElement(Text139, { size: "xs", c: "dimmed" }, "Blueprint candidates are populated from the preceding DomainIndexerLookup step output."));
|
|
23296
23357
|
};
|
|
23297
23358
|
|
|
23298
|
-
// src/mantine/blocks/action/actionTypes/pod/DomainSingleSelectionFlowDetail.tsx
|
|
23359
|
+
// src/mantine/blocks/action/actionTypes/pod/domainSingleSelection/DomainSingleSelectionFlowDetail.tsx
|
|
23299
23360
|
import React243, { useCallback as useCallback75 } from "react";
|
|
23300
23361
|
import { Alert as Alert35, Box as Box48, Group as Group89, Loader as Loader34, Stack as Stack162, Text as Text140 } from "@mantine/core";
|
|
23301
23362
|
import { IconAlertCircle as IconAlertCircle18 } from "@tabler/icons-react";
|
|
@@ -23312,13 +23373,16 @@ function useEntities(editor) {
|
|
|
23312
23373
|
return;
|
|
23313
23374
|
}
|
|
23314
23375
|
const map = yDoc.getMap("entities");
|
|
23376
|
+
const toPlain = (v) => v && typeof v.toJSON === "function" ? v.toJSON() : v;
|
|
23315
23377
|
const read = () => ({
|
|
23316
23378
|
query: map.get("query") ?? "",
|
|
23317
|
-
results: map.get("results") ?? [],
|
|
23379
|
+
results: toPlain(map.get("results")) ?? [],
|
|
23318
23380
|
status: map.get("status") ?? "idle",
|
|
23319
23381
|
updatedAt: map.get("updatedAt") ?? ""
|
|
23320
23382
|
});
|
|
23321
|
-
const refresh = () =>
|
|
23383
|
+
const refresh = () => {
|
|
23384
|
+
setState(read());
|
|
23385
|
+
};
|
|
23322
23386
|
refresh();
|
|
23323
23387
|
map.observeDeep(refresh);
|
|
23324
23388
|
return () => map.unobserveDeep(refresh);
|
|
@@ -23326,7 +23390,7 @@ function useEntities(editor) {
|
|
|
23326
23390
|
return state;
|
|
23327
23391
|
}
|
|
23328
23392
|
|
|
23329
|
-
// src/mantine/blocks/action/actionTypes/pod/DomainSingleSelectionFlowDetail.tsx
|
|
23393
|
+
// src/mantine/blocks/action/actionTypes/pod/domainSingleSelection/DomainSingleSelectionFlowDetail.tsx
|
|
23330
23394
|
function toCandidate(e) {
|
|
23331
23395
|
const did = String(e.did || e.id || "");
|
|
23332
23396
|
if (!did) return null;
|
|
@@ -23386,7 +23450,13 @@ var DomainSingleSelectionFlowDetail = ({ block, runtime, updateRuntime, isDisabl
|
|
|
23386
23450
|
}));
|
|
23387
23451
|
};
|
|
23388
23452
|
|
|
23389
|
-
// src/mantine/blocks/action/actionTypes/pod/
|
|
23453
|
+
// src/mantine/blocks/action/actionTypes/pod/domainSingleSelection/index.ts
|
|
23454
|
+
registerActionTypeUI("qi/pod.domain-single-selection", {
|
|
23455
|
+
configComponent: DomainSingleSelectionConfig,
|
|
23456
|
+
flowDetailComponent: DomainSingleSelectionFlowDetail
|
|
23457
|
+
});
|
|
23458
|
+
|
|
23459
|
+
// src/mantine/blocks/action/actionTypes/pod/entitySingleSelection/EntitySingleSelectionConfig.tsx
|
|
23390
23460
|
import React244, { useCallback as useCallback76, useEffect as useEffect79, useState as useState97 } from "react";
|
|
23391
23461
|
import { Stack as Stack163, Text as Text141 } from "@mantine/core";
|
|
23392
23462
|
var DEFAULT3 = { did: "", role: "controller" };
|
|
@@ -23406,7 +23476,7 @@ var EntitySingleSelectionConfig = ({ inputs, onInputsChange }) => {
|
|
|
23406
23476
|
return /* @__PURE__ */ React244.createElement(Stack163, { gap: "md" }, /* @__PURE__ */ React244.createElement(Stack163, { gap: "xs" }, /* @__PURE__ */ React244.createElement(Text141, { size: "sm", fw: 600 }, "Actor DID Reference"), /* @__PURE__ */ React244.createElement(Text141, { size: "xs", c: "dimmed" }, 'The DID to query controlled entities for. Use "userDID" to resolve to the current user at runtime.'), /* @__PURE__ */ React244.createElement(BaseTextInput, { placeholder: "userDID", value: local.did, onChange: (e) => update({ did: e.currentTarget.value }) })), /* @__PURE__ */ React244.createElement(Stack163, { gap: "xs" }, /* @__PURE__ */ React244.createElement(Text141, { size: "sm", fw: 600 }, "Required Role"), /* @__PURE__ */ React244.createElement(Text141, { size: "xs", c: "dimmed" }, "Only entities where the user holds this role are shown. Default: controller."), /* @__PURE__ */ React244.createElement(BaseTextInput, { placeholder: "controller", value: local.role, onChange: (e) => update({ role: e.currentTarget.value }) })));
|
|
23407
23477
|
};
|
|
23408
23478
|
|
|
23409
|
-
// src/mantine/blocks/action/actionTypes/pod/EntitySingleSelectionFlowDetail.tsx
|
|
23479
|
+
// src/mantine/blocks/action/actionTypes/pod/entitySingleSelection/EntitySingleSelectionFlowDetail.tsx
|
|
23410
23480
|
import React245, { useCallback as useCallback77, useEffect as useEffect80, useState as useState98 } from "react";
|
|
23411
23481
|
import { Alert as Alert36, Badge as Badge42, Box as Box49, Button as Button43, Group as Group90, Loader as Loader35, Stack as Stack164, Text as Text142 } from "@mantine/core";
|
|
23412
23482
|
var ALLOWED_TYPES = ["dao/dao", "dao/pod"];
|
|
@@ -23491,7 +23561,13 @@ var EntitySingleSelectionFlowDetail = ({ block, runtime, updateRuntime, isDisabl
|
|
|
23491
23561
|
})), isComplete && runtime.output?.skipped && /* @__PURE__ */ React245.createElement(Alert36, { color: "blue", styles: actionAlertStyles }, /* @__PURE__ */ React245.createElement(Text142, { size: "sm" }, "Skipped \u2014 this POD will be created as a top-level entity.")), /* @__PURE__ */ React245.createElement(Button43, { variant: "subtle", color: "gray", onClick: handleSkip, disabled: isDisabled }, "Skip \u2014 no parent organisation"));
|
|
23492
23562
|
};
|
|
23493
23563
|
|
|
23494
|
-
// src/mantine/blocks/action/actionTypes/pod/
|
|
23564
|
+
// src/mantine/blocks/action/actionTypes/pod/entitySingleSelection/index.ts
|
|
23565
|
+
registerActionTypeUI("qi/pod.entity-single-selection", {
|
|
23566
|
+
configComponent: EntitySingleSelectionConfig,
|
|
23567
|
+
flowDetailComponent: EntitySingleSelectionFlowDetail
|
|
23568
|
+
});
|
|
23569
|
+
|
|
23570
|
+
// src/mantine/blocks/action/actionTypes/pod/memberMultiSelect/MemberMultiSelectConfig.tsx
|
|
23495
23571
|
import React246, { useCallback as useCallback78, useEffect as useEffect81, useState as useState99 } from "react";
|
|
23496
23572
|
import { Stack as Stack165, Text as Text143 } from "@mantine/core";
|
|
23497
23573
|
var DEFAULT4 = { entity: "", group: "" };
|
|
@@ -23511,10 +23587,19 @@ var MemberMultiSelectConfig = ({ inputs, onInputsChange }) => {
|
|
|
23511
23587
|
return /* @__PURE__ */ React246.createElement(Stack165, { gap: "md" }, /* @__PURE__ */ React246.createElement(Stack165, { gap: "xs" }, /* @__PURE__ */ React246.createElement(Text143, { size: "sm", fw: 600 }, "Entity DID"), /* @__PURE__ */ React246.createElement(Text143, { size: "xs", c: "dimmed" }, "DID of the Subscription Deed or POD used to resolve available members."), /* @__PURE__ */ React246.createElement(BaseTextInput, { placeholder: "did:ixo:...", value: local.entity, onChange: (e) => update({ entity: e.currentTarget.value }) })), /* @__PURE__ */ React246.createElement(Stack165, { gap: "xs" }, /* @__PURE__ */ React246.createElement(Text143, { size: "sm", fw: 600 }, "Group ID (optional)"), /* @__PURE__ */ React246.createElement(Text143, { size: "xs", c: "dimmed" }, "Restrict members to a specific group account. Leave blank for all groups."), /* @__PURE__ */ React246.createElement(BaseTextInput, { placeholder: "Leave blank for all groups", value: local.group, onChange: (e) => update({ group: e.currentTarget.value }) })));
|
|
23512
23588
|
};
|
|
23513
23589
|
|
|
23514
|
-
// src/mantine/blocks/action/actionTypes/pod/MemberMultiSelectFlowDetail.tsx
|
|
23590
|
+
// src/mantine/blocks/action/actionTypes/pod/memberMultiSelect/MemberMultiSelectFlowDetail.tsx
|
|
23515
23591
|
import React247, { useCallback as useCallback79, useMemo as useMemo90, useRef as useRef23, useState as useState100 } from "react";
|
|
23516
23592
|
import { ActionIcon as ActionIcon35, Alert as Alert37, Badge as Badge43, Button as Button44, Flex as Flex34, Group as Group91, Loader as Loader36, NumberInput as NumberInput3, Paper as Paper18, Select as Select6, Stack as Stack166, Switch as Switch6, Text as Text144, TextInput as TextInput7 } from "@mantine/core";
|
|
23517
23593
|
import { IconSearch as IconSearch7, IconAlertCircle as IconAlertCircle19, IconCheck as IconCheck16, IconX as IconX14 } from "@tabler/icons-react";
|
|
23594
|
+
function normalizeMember(m) {
|
|
23595
|
+
return {
|
|
23596
|
+
did: m.did || "",
|
|
23597
|
+
role: m.role || "Member",
|
|
23598
|
+
votingPower: typeof m.votingPower === "number" ? m.votingPower : 1,
|
|
23599
|
+
displayName: m.displayName || m.did || "Unknown",
|
|
23600
|
+
avatarUrl: m.avatarUrl ?? null
|
|
23601
|
+
};
|
|
23602
|
+
}
|
|
23518
23603
|
var ROLE_OPTIONS = [
|
|
23519
23604
|
{ value: "Admin", label: "Admin" },
|
|
23520
23605
|
{ value: "Member", label: "Member" },
|
|
@@ -23540,39 +23625,47 @@ function validateMultisig(list, threshold) {
|
|
|
23540
23625
|
}
|
|
23541
23626
|
var MemberSearch = ({ members, onAdd, isDisabled }) => {
|
|
23542
23627
|
const handlers = useBlocknoteHandlers();
|
|
23628
|
+
const handlersRef = useRef23(handlers);
|
|
23629
|
+
handlersRef.current = handlers;
|
|
23543
23630
|
const [query, setQuery] = useState100("");
|
|
23544
23631
|
const [searching, setSearching] = useState100(false);
|
|
23545
23632
|
const [results, setResults] = useState100([]);
|
|
23546
23633
|
const [searchError, setSearchError] = useState100(null);
|
|
23547
23634
|
const debounceRef = useRef23(null);
|
|
23548
|
-
const runSearch = useCallback79(
|
|
23549
|
-
|
|
23550
|
-
|
|
23551
|
-
|
|
23552
|
-
|
|
23553
|
-
|
|
23554
|
-
|
|
23555
|
-
|
|
23556
|
-
|
|
23557
|
-
|
|
23558
|
-
|
|
23559
|
-
|
|
23560
|
-
|
|
23561
|
-
|
|
23562
|
-
|
|
23563
|
-
setResults([{ did: profile.did, displayName: profile.displayname || trimmed, avatarUrl: profile.avatarUrl, matrixAddress: profile.walletAddress }]);
|
|
23564
|
-
} else {
|
|
23565
|
-
setSearchError("Enter a Matrix ID directly (e.g. @user:matrix.ixo.world)");
|
|
23635
|
+
const runSearch = useCallback79(async (q) => {
|
|
23636
|
+
const trimmed = q.trim();
|
|
23637
|
+
if (trimmed.length < 2) {
|
|
23638
|
+
setResults([]);
|
|
23639
|
+
return;
|
|
23640
|
+
}
|
|
23641
|
+
setSearching(true);
|
|
23642
|
+
setSearchError(null);
|
|
23643
|
+
try {
|
|
23644
|
+
const h = handlersRef.current;
|
|
23645
|
+
if (h.searchUsers) {
|
|
23646
|
+
const res = await h.searchUsers(trimmed);
|
|
23647
|
+
if (!Array.isArray(res)) {
|
|
23648
|
+
setResults([]);
|
|
23649
|
+
return;
|
|
23566
23650
|
}
|
|
23567
|
-
|
|
23568
|
-
|
|
23569
|
-
|
|
23570
|
-
|
|
23571
|
-
|
|
23651
|
+
setResults(res.map((r) => ({ did: r.did, displayName: r.displayName || r.did, avatarUrl: r.avatarUrl, matrixAddress: r.address })));
|
|
23652
|
+
} else if (trimmed.startsWith("@") && trimmed.includes(":")) {
|
|
23653
|
+
const profile = await h.getMatrixInfoPerDid(trimmed);
|
|
23654
|
+
if (!profile?.did) {
|
|
23655
|
+
setSearchError("User not found");
|
|
23656
|
+
return;
|
|
23657
|
+
}
|
|
23658
|
+
setResults([{ did: profile.did, displayName: profile.displayname || trimmed, avatarUrl: profile.avatarUrl, matrixAddress: profile.walletAddress }]);
|
|
23659
|
+
} else {
|
|
23660
|
+
setSearchError("Enter a Matrix ID directly (e.g. @user:matrix.ixo.world)");
|
|
23572
23661
|
}
|
|
23573
|
-
}
|
|
23574
|
-
|
|
23575
|
-
|
|
23662
|
+
} catch (err) {
|
|
23663
|
+
setSearchError(err instanceof Error ? err.message : "Search failed");
|
|
23664
|
+
setResults([]);
|
|
23665
|
+
} finally {
|
|
23666
|
+
setSearching(false);
|
|
23667
|
+
}
|
|
23668
|
+
}, []);
|
|
23576
23669
|
const handleQueryChange = useCallback79(
|
|
23577
23670
|
(value) => {
|
|
23578
23671
|
setQuery(value);
|
|
@@ -23618,8 +23711,10 @@ var MemberSearch = ({ members, onAdd, isDisabled }) => {
|
|
|
23618
23711
|
);
|
|
23619
23712
|
}))), searchError && /* @__PURE__ */ React247.createElement(Alert37, { color: "orange", styles: actionAlertStyles }, /* @__PURE__ */ React247.createElement(Text144, { size: "xs" }, searchError)), query.trim().length >= 2 && !searching && results.length === 0 && !searchError && /* @__PURE__ */ React247.createElement(Text144, { size: "xs", c: "dimmed", pl: 4 }, 'No users found matching "', query, '"'));
|
|
23620
23713
|
};
|
|
23621
|
-
var MemberMultiSelectFlowDetail = ({ inputs, block, runtime, updateRuntime, isDisabled }) => {
|
|
23714
|
+
var MemberMultiSelectFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
23622
23715
|
const handlers = useBlocknoteHandlers();
|
|
23716
|
+
const handlersRef = useRef23(handlers);
|
|
23717
|
+
handlersRef.current = handlers;
|
|
23623
23718
|
const parsed = parseJsonSafe(inputs, { groupType: "categorical" });
|
|
23624
23719
|
const groupType = parsed.groupType || "categorical";
|
|
23625
23720
|
const creatorDid = useMemo90(() => {
|
|
@@ -23628,9 +23723,9 @@ var MemberMultiSelectFlowDetail = ({ inputs, block, runtime, updateRuntime, isDi
|
|
|
23628
23723
|
} catch {
|
|
23629
23724
|
return "";
|
|
23630
23725
|
}
|
|
23631
|
-
}, [
|
|
23726
|
+
}, []);
|
|
23632
23727
|
const [members, setMembers] = useState100(() => {
|
|
23633
|
-
if (Array.isArray(runtime.output?.members) && runtime.output.members.length > 0) return runtime.output.members;
|
|
23728
|
+
if (Array.isArray(runtime.output?.members) && runtime.output.members.length > 0) return runtime.output.members.map(normalizeMember);
|
|
23634
23729
|
if (groupType === "categorical" || groupType === "multisig") {
|
|
23635
23730
|
return creatorDid ? [{ did: creatorDid, role: "Admin", votingPower: 1, displayName: "You", avatarUrl: null }] : [];
|
|
23636
23731
|
}
|
|
@@ -23643,28 +23738,28 @@ var MemberMultiSelectFlowDetail = ({ inputs, block, runtime, updateRuntime, isDi
|
|
|
23643
23738
|
const [tokenName, setTokenName] = useState100(runtime.output?.tokenConfig?.tokenName ?? "");
|
|
23644
23739
|
const [tokenSymbol, setTokenSymbol] = useState100(runtime.output?.tokenConfig?.tokenSymbol ?? "");
|
|
23645
23740
|
const [tokenSupply, setTokenSupply] = useState100(runtime.output?.tokenConfig?.tokenSupply ?? 1e7);
|
|
23741
|
+
const creatorResolvedRef = useRef23(false);
|
|
23646
23742
|
React247.useEffect(() => {
|
|
23647
|
-
if (
|
|
23648
|
-
|
|
23649
|
-
|
|
23743
|
+
if (creatorResolvedRef.current || !creatorDid) return;
|
|
23744
|
+
const h = handlersRef.current;
|
|
23745
|
+
if (!h.getMatrixInfoPerDid) return;
|
|
23746
|
+
creatorResolvedRef.current = true;
|
|
23747
|
+
h.getMatrixInfoPerDid(creatorDid).then((profile) => {
|
|
23748
|
+
if (!profile?.displayname) return;
|
|
23650
23749
|
setMembers(
|
|
23651
|
-
(prev) => prev.map((m) => m.did === creatorDid && m.displayName === "You" ? { ...m, displayName: profile.displayname || "You", avatarUrl: profile.avatarUrl } : m)
|
|
23750
|
+
(prev) => prev.map((m) => m.did === creatorDid && m.displayName === "You" ? { ...m, displayName: profile.displayname || "You", avatarUrl: profile.avatarUrl ?? null } : m)
|
|
23652
23751
|
);
|
|
23653
23752
|
}).catch(() => {
|
|
23654
23753
|
});
|
|
23655
|
-
}, [creatorDid
|
|
23754
|
+
}, [creatorDid]);
|
|
23656
23755
|
const [validationError, setValidationError] = useState100(null);
|
|
23657
|
-
const handleAddMember = useCallback79(
|
|
23658
|
-
(
|
|
23659
|
-
if (
|
|
23660
|
-
|
|
23661
|
-
|
|
23662
|
-
|
|
23663
|
-
|
|
23664
|
-
setValidationError(null);
|
|
23665
|
-
},
|
|
23666
|
-
[members]
|
|
23667
|
-
);
|
|
23756
|
+
const handleAddMember = useCallback79((user) => {
|
|
23757
|
+
setMembers((prev) => {
|
|
23758
|
+
if (prev.some((m) => m.did === user.did)) return prev;
|
|
23759
|
+
return [...prev, { did: user.did, role: "Member", votingPower: 1, displayName: user.displayName, avatarUrl: user.avatarUrl }];
|
|
23760
|
+
});
|
|
23761
|
+
setValidationError(null);
|
|
23762
|
+
}, []);
|
|
23668
23763
|
const handleRemoveMember = useCallback79((index) => {
|
|
23669
23764
|
setMembers((prev) => prev.filter((_, i) => i !== index));
|
|
23670
23765
|
setValidationError(null);
|
|
@@ -23727,10 +23822,11 @@ var MemberMultiSelectFlowDetail = ({ inputs, block, runtime, updateRuntime, isDi
|
|
|
23727
23822
|
}
|
|
23728
23823
|
setValidationError(null);
|
|
23729
23824
|
updateRuntime({ state: "completed", executedAt: Date.now(), output });
|
|
23730
|
-
|
|
23825
|
+
writeRunRecordAndReconcile(editor, block.id, output, [{ name: "configured", payload: { memberConfig: output } }], "");
|
|
23826
|
+
}, [groupType, members, multisigThreshold, nftContractAddress, isExistingToken, tokenAddress, tokenName, tokenSymbol, tokenSupply, updateRuntime, editor, block.id]);
|
|
23731
23827
|
const renderCategorical = () => /* @__PURE__ */ React247.createElement(Stack166, { gap: "md" }, /* @__PURE__ */ React247.createElement(MemberSearch, { members, onAdd: handleAddMember, isDisabled }), members.length > 0 && /* @__PURE__ */ React247.createElement(Stack166, { gap: "xs" }, /* @__PURE__ */ React247.createElement(Text144, { size: "xs", fw: 600, c: "dimmed" }, "MEMBERS (", members.length, ")"), members.map((m, i) => {
|
|
23732
23828
|
const isCreator = m.did === creatorDid && i === 0;
|
|
23733
|
-
return /* @__PURE__ */ React247.createElement(Paper18, { key: `${m.did}-${i}`, withBorder: true, p: "sm", style: { borderRadius: 10 } }, /* @__PURE__ */ React247.createElement(Group91, { wrap: "nowrap", gap: "sm", align: "center" }, /* @__PURE__ */ React247.createElement(BaseAvatar, { src: m.avatarUrl, did: m.did, size: 32 }), /* @__PURE__ */ React247.createElement(Stack166, { gap: 0, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React247.createElement(Text144, { size: "sm", fw: 500, lineClamp: 1 }, m.displayName, isCreator && /* @__PURE__ */ React247.createElement(Text144, { span: true, size: "xs", c: "dimmed", ml: 6 }, "(you)")), /* @__PURE__ */ React247.createElement(Text144, { size: "xs", c: "dimmed", lineClamp: 1 }, m.did.length > 40 ? `${m.did.slice(0, 20)}\u2026${m.did.slice(-14)}` : m.did)), /* @__PURE__ */ React247.createElement(
|
|
23829
|
+
return /* @__PURE__ */ React247.createElement(Paper18, { key: `${m.did}-${i}`, withBorder: true, p: "sm", style: { borderRadius: 10 } }, /* @__PURE__ */ React247.createElement(Group91, { wrap: "nowrap", gap: "sm", align: "center" }, /* @__PURE__ */ React247.createElement(BaseAvatar, { src: m.avatarUrl, did: m.did, size: 32 }), /* @__PURE__ */ React247.createElement(Stack166, { gap: 0, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React247.createElement(Text144, { size: "sm", fw: 500, lineClamp: 1 }, m.displayName, isCreator && /* @__PURE__ */ React247.createElement(Text144, { span: true, size: "xs", c: "dimmed", ml: 6 }, "(you)")), /* @__PURE__ */ React247.createElement(Text144, { size: "xs", c: "dimmed", lineClamp: 1 }, (m.did || "").length > 40 ? `${m.did.slice(0, 20)}\u2026${m.did.slice(-14)}` : m.did)), /* @__PURE__ */ React247.createElement(
|
|
23734
23830
|
Select6,
|
|
23735
23831
|
{
|
|
23736
23832
|
value: m.role,
|
|
@@ -23766,7 +23862,7 @@ var MemberMultiSelectFlowDetail = ({ inputs, block, runtime, updateRuntime, isDi
|
|
|
23766
23862
|
disabled: isDisabled,
|
|
23767
23863
|
size: "sm"
|
|
23768
23864
|
}
|
|
23769
|
-
), /* @__PURE__ */ React247.createElement(MemberSearch, { members, onAdd: handleAddMember, isDisabled }), members.length > 0 && /* @__PURE__ */ React247.createElement(Stack166, { gap: "xs" }, /* @__PURE__ */ React247.createElement(Group91, { gap: "xs" }, /* @__PURE__ */ React247.createElement(Text144, { size: "xs", fw: 600, c: "dimmed" }, "SIGNATORIES (", members.length, ")"), /* @__PURE__ */ React247.createElement(Badge43, { size: "xs", color: "orange", variant: "light" }, "threshold: ", multisigThreshold, " of ", members.length)), members.map((m, i) => /* @__PURE__ */ React247.createElement(Paper18, { key: `${m.did}-${i}`, withBorder: true, p: "sm", style: { borderRadius: 10 } }, /* @__PURE__ */ React247.createElement(Group91, { wrap: "nowrap", gap: "sm", align: "center" }, /* @__PURE__ */ React247.createElement(BaseAvatar, { src: m.avatarUrl, did: m.did, size: 32 }), /* @__PURE__ */ React247.createElement(Stack166, { gap: 0, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React247.createElement(Text144, { size: "sm", fw: 500, lineClamp: 1 }, m.displayName), /* @__PURE__ */ React247.createElement(Text144, { size: "xs", c: "dimmed", lineClamp: 1 }, m.did.length > 44 ? `${m.did.slice(0, 22)}\u2026${m.did.slice(-16)}` : m.did)), /* @__PURE__ */ React247.createElement(ActionIcon35, { color: "red", variant: "subtle", size: "sm", onClick: () => handleRemoveMember(i), disabled: isDisabled || members.length === 1 }, /* @__PURE__ */ React247.createElement(IconX14, { size: 14 })))))));
|
|
23865
|
+
), /* @__PURE__ */ React247.createElement(MemberSearch, { members, onAdd: handleAddMember, isDisabled }), members.length > 0 && /* @__PURE__ */ React247.createElement(Stack166, { gap: "xs" }, /* @__PURE__ */ React247.createElement(Group91, { gap: "xs" }, /* @__PURE__ */ React247.createElement(Text144, { size: "xs", fw: 600, c: "dimmed" }, "SIGNATORIES (", members.length, ")"), /* @__PURE__ */ React247.createElement(Badge43, { size: "xs", color: "orange", variant: "light" }, "threshold: ", multisigThreshold, " of ", members.length)), members.map((m, i) => /* @__PURE__ */ React247.createElement(Paper18, { key: `${m.did}-${i}`, withBorder: true, p: "sm", style: { borderRadius: 10 } }, /* @__PURE__ */ React247.createElement(Group91, { wrap: "nowrap", gap: "sm", align: "center" }, /* @__PURE__ */ React247.createElement(BaseAvatar, { src: m.avatarUrl, did: m.did, size: 32 }), /* @__PURE__ */ React247.createElement(Stack166, { gap: 0, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React247.createElement(Text144, { size: "sm", fw: 500, lineClamp: 1 }, m.displayName), /* @__PURE__ */ React247.createElement(Text144, { size: "xs", c: "dimmed", lineClamp: 1 }, (m.did || "").length > 44 ? `${m.did.slice(0, 22)}\u2026${m.did.slice(-16)}` : m.did)), /* @__PURE__ */ React247.createElement(ActionIcon35, { color: "red", variant: "subtle", size: "sm", onClick: () => handleRemoveMember(i), disabled: isDisabled || members.length === 1 }, /* @__PURE__ */ React247.createElement(IconX14, { size: 14 })))))));
|
|
23770
23866
|
const renderNftStaking = () => /* @__PURE__ */ React247.createElement(Stack166, { gap: "md" }, /* @__PURE__ */ React247.createElement(Alert37, { color: "blue", styles: actionAlertStyles }, /* @__PURE__ */ React247.createElement(Text144, { size: "sm" }, "For NFT staking groups, voting power is derived from on-chain NFT holdings. Provide the NFT contract address \u2014 no explicit member list is needed.")), /* @__PURE__ */ React247.createElement(
|
|
23771
23867
|
TextInput7,
|
|
23772
23868
|
{
|
|
@@ -23863,7 +23959,13 @@ var MemberMultiSelectFlowDetail = ({ inputs, block, runtime, updateRuntime, isDi
|
|
|
23863
23959
|
})())), groupType === "categorical" ? renderCategorical() : null, groupType === "multisig" ? renderMultisig() : null, groupType === "nftStaking" ? renderNftStaking() : null, groupType === "tokenStaking" ? renderTokenStaking() : null, validationError && /* @__PURE__ */ React247.createElement(Alert37, { icon: /* @__PURE__ */ React247.createElement(IconAlertCircle19, { size: 16 }), color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React247.createElement(Text144, { size: "sm" }, validationError)), runtime.state === "completed" && !validationError && /* @__PURE__ */ React247.createElement(Alert37, { icon: /* @__PURE__ */ React247.createElement(IconCheck16, { size: 16 }), color: "green", styles: actionAlertStyles }, /* @__PURE__ */ React247.createElement(Text144, { size: "sm" }, groupType === "nftStaking" && "NFT contract address confirmed.", groupType === "tokenStaking" && "Token configuration confirmed.", groupType === "categorical" && `${members.length} member${members.length !== 1 ? "s" : ""} confirmed.`, groupType === "multisig" && `${members.length} signatories confirmed (threshold: ${multisigThreshold}).`)), /* @__PURE__ */ React247.createElement(Button44, { onClick: handleConfirm, disabled: isDisabled }, "Confirm Members"));
|
|
23864
23960
|
};
|
|
23865
23961
|
|
|
23866
|
-
// src/mantine/blocks/action/actionTypes/pod/
|
|
23962
|
+
// src/mantine/blocks/action/actionTypes/pod/memberMultiSelect/index.ts
|
|
23963
|
+
registerActionTypeUI("qi/pod.member-multi-select", {
|
|
23964
|
+
configComponent: MemberMultiSelectConfig,
|
|
23965
|
+
flowDetailComponent: MemberMultiSelectFlowDetail
|
|
23966
|
+
});
|
|
23967
|
+
|
|
23968
|
+
// src/mantine/blocks/action/actionTypes/pod/governanceConfig/GovernanceConfigConfig.tsx
|
|
23867
23969
|
import React248, { useCallback as useCallback80, useEffect as useEffect82, useState as useState101 } from "react";
|
|
23868
23970
|
import { Stack as Stack167, Text as Text145 } from "@mantine/core";
|
|
23869
23971
|
var DEFAULT5 = { kind: "" };
|
|
@@ -23883,7 +23985,7 @@ var GovernanceConfigConfig = ({ inputs, onInputsChange }) => {
|
|
|
23883
23985
|
return /* @__PURE__ */ React248.createElement(Stack167, { gap: "md" }, /* @__PURE__ */ React248.createElement(Stack167, { gap: "xs" }, /* @__PURE__ */ React248.createElement(Text145, { size: "sm", fw: 600 }, "Blueprint Kind"), /* @__PURE__ */ React248.createElement(Text145, { size: "xs", c: "dimmed" }, 'The blueprint category or type string used to look up governance defaults (e.g. "finance-dao"). Leave blank to use global defaults.'), /* @__PURE__ */ React248.createElement(BaseTextInput, { placeholder: "e.g. finance-dao", value: local.kind, onChange: (e) => update({ kind: e.currentTarget.value }) })));
|
|
23884
23986
|
};
|
|
23885
23987
|
|
|
23886
|
-
// src/mantine/blocks/action/actionTypes/pod/GovernanceConfigFlowDetail.tsx
|
|
23988
|
+
// src/mantine/blocks/action/actionTypes/pod/governanceConfig/GovernanceConfigFlowDetail.tsx
|
|
23887
23989
|
import React249, { useCallback as useCallback81, useState as useState102 } from "react";
|
|
23888
23990
|
import { Alert as Alert38, Box as Box50, Button as Button45, Group as Group92, Select as Select7, Stack as Stack168, Text as Text146, TextInput as TextInput8 } from "@mantine/core";
|
|
23889
23991
|
import { IconCheck as IconCheck17, IconAlertCircle as IconAlertCircle20, IconArrowLeft as IconArrowLeft6, IconUsers as IconUsers5, IconWriting, IconPhoto as IconPhoto4, IconCoin as IconCoin3 } from "@tabler/icons-react";
|
|
@@ -23932,7 +24034,7 @@ function validateGovernance(groupType, g) {
|
|
|
23932
24034
|
if (!isNaN(veto) && threshold + veto > 1) return "Threshold + Veto threshold cannot exceed 1.0";
|
|
23933
24035
|
return null;
|
|
23934
24036
|
}
|
|
23935
|
-
var GovernanceConfigFlowDetail = ({ block, runtime, updateRuntime, isDisabled }) => {
|
|
24037
|
+
var GovernanceConfigFlowDetail = ({ editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
23936
24038
|
const savedGroupType = runtime.output?.groupType;
|
|
23937
24039
|
const savedGroupName = runtime.output?.groupName;
|
|
23938
24040
|
const [groupName, setGroupName] = useState102(savedGroupName ?? "");
|
|
@@ -23971,8 +24073,10 @@ var GovernanceConfigFlowDetail = ({ block, runtime, updateRuntime, isDisabled })
|
|
|
23971
24073
|
return;
|
|
23972
24074
|
}
|
|
23973
24075
|
setValidationError(null);
|
|
23974
|
-
|
|
23975
|
-
|
|
24076
|
+
const output = { groupName: trimmedName, groupType, governance };
|
|
24077
|
+
updateRuntime({ state: "completed", executedAt: Date.now(), output });
|
|
24078
|
+
writeRunRecordAndReconcile(editor, block.id, output, [{ name: "configured", payload: { governanceConfig: { groupName: trimmedName, groupType, governance } } }], "");
|
|
24079
|
+
}, [groupName, groupType, governance, updateRuntime, editor, block.id]);
|
|
23976
24080
|
const isStakingType = groupType === "nftStaking" || groupType === "tokenStaking";
|
|
23977
24081
|
return /* @__PURE__ */ React249.createElement(Stack168, { gap: "md" }, /* @__PURE__ */ React249.createElement(Stack168, { gap: 2 }, /* @__PURE__ */ React249.createElement(Text146, { fw: 600 }, block?.props?.title || "Governance"), /* @__PURE__ */ React249.createElement(Text146, { size: "sm", c: "dimmed" }, block?.props?.description || "Choose a governance group type, then configure the decision policy.")), /* @__PURE__ */ React249.createElement(
|
|
23978
24082
|
TextInput8,
|
|
@@ -24111,7 +24215,13 @@ var GovernanceConfigFlowDetail = ({ block, runtime, updateRuntime, isDisabled })
|
|
|
24111
24215
|
)), validationError && /* @__PURE__ */ React249.createElement(Alert38, { icon: /* @__PURE__ */ React249.createElement(IconAlertCircle20, { size: 16 }), color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React249.createElement(Text146, { size: "sm" }, validationError)), runtime.state === "completed" && !validationError && /* @__PURE__ */ React249.createElement(Alert38, { icon: /* @__PURE__ */ React249.createElement(IconCheck17, { size: 16 }), color: "green", styles: actionAlertStyles }, /* @__PURE__ */ React249.createElement(Text146, { size: "sm" }, GROUP_TYPES.find((g) => g.type === savedGroupType)?.title ?? "Governance", " settings confirmed.")), /* @__PURE__ */ React249.createElement(Button45, { onClick: handleSave, disabled: isDisabled || !groupType || !groupName.trim() }, "Confirm Governance Settings"));
|
|
24112
24216
|
};
|
|
24113
24217
|
|
|
24114
|
-
// src/mantine/blocks/action/actionTypes/pod/
|
|
24218
|
+
// src/mantine/blocks/action/actionTypes/pod/governanceConfig/index.ts
|
|
24219
|
+
registerActionTypeUI("qi/pod.governance-config", {
|
|
24220
|
+
configComponent: GovernanceConfigConfig,
|
|
24221
|
+
flowDetailComponent: GovernanceConfigFlowDetail
|
|
24222
|
+
});
|
|
24223
|
+
|
|
24224
|
+
// src/mantine/blocks/action/actionTypes/pod/listDomainFlows/ListDomainFlowsConfig.tsx
|
|
24115
24225
|
import React250, { useCallback as useCallback82, useEffect as useEffect83, useState as useState103 } from "react";
|
|
24116
24226
|
import { Stack as Stack169, Text as Text147 } from "@mantine/core";
|
|
24117
24227
|
var DEFAULT6 = { entity: "" };
|
|
@@ -24131,7 +24241,7 @@ var ListDomainFlowsConfig = ({ inputs, onInputsChange }) => {
|
|
|
24131
24241
|
return /* @__PURE__ */ React250.createElement(Stack169, { gap: "md" }, /* @__PURE__ */ React250.createElement(Stack169, { gap: "xs" }, /* @__PURE__ */ React250.createElement(Text147, { size: "sm", fw: 600 }, "Protocol Entity DID"), /* @__PURE__ */ React250.createElement(Text147, { size: "xs", c: "dimmed" }, "DID of the blueprint / protocol entity whose flow templates are displayed. Use a reference like ", /* @__PURE__ */ React250.createElement("code", null, "{{blockId.selectedBlueprintDid}}"), " to bind to the preceding selection step."), /* @__PURE__ */ React250.createElement(BaseTextInput, { placeholder: "did:ixo:... or {{blockId.selectedBlueprintDid}}", value: local.entity, onChange: (e) => update({ entity: e.currentTarget.value }) })));
|
|
24132
24242
|
};
|
|
24133
24243
|
|
|
24134
|
-
// src/mantine/blocks/action/actionTypes/pod/ListDomainFlowsFlowDetail.tsx
|
|
24244
|
+
// src/mantine/blocks/action/actionTypes/pod/listDomainFlows/ListDomainFlowsFlowDetail.tsx
|
|
24135
24245
|
import React251, { useCallback as useCallback83, useEffect as useEffect84, useState as useState104 } from "react";
|
|
24136
24246
|
import { Alert as Alert39, Badge as Badge44, Box as Box51, Button as Button46, Checkbox as Checkbox12, Group as Group93, Loader as Loader37, Stack as Stack170, Text as Text148 } from "@mantine/core";
|
|
24137
24247
|
import { IconCheck as IconCheck18, IconLock } from "@tabler/icons-react";
|
|
@@ -24221,27 +24331,7 @@ var ListDomainFlowsFlowDetail = ({ inputs, block, runtime, updateRuntime, isDisa
|
|
|
24221
24331
|
))), runtime.state === "completed" && !error && /* @__PURE__ */ React251.createElement(Alert39, { icon: /* @__PURE__ */ React251.createElement(IconCheck18, { size: 16 }), color: "green", styles: actionAlertStyles }, /* @__PURE__ */ React251.createElement(Text148, { size: "sm" }, confirmedCount, " flow", confirmedCount !== 1 ? "s" : "", " confirmed", protocolFlows.length > 0 ? ` (${protocolFlows.length} from protocol, auto-included)` : "", ".")), /* @__PURE__ */ React251.createElement(Button46, { onClick: handleConfirm, disabled: isDisabled || loading || !!error, variant: runtime.state === "completed" ? "outline" : "filled" }, runtime.state === "completed" ? "Update Selection" : "Confirm Flows"));
|
|
24222
24332
|
};
|
|
24223
24333
|
|
|
24224
|
-
// src/mantine/blocks/action/actionTypes/pod/index.ts
|
|
24225
|
-
registerActionTypeUI("qi/pod.domain-indexer-lookup", {
|
|
24226
|
-
configComponent: DomainIndexerLookupConfig,
|
|
24227
|
-
flowDetailComponent: DomainIndexerLookupFlowDetail
|
|
24228
|
-
});
|
|
24229
|
-
registerActionTypeUI("qi/pod.domain-single-selection", {
|
|
24230
|
-
configComponent: DomainSingleSelectionConfig,
|
|
24231
|
-
flowDetailComponent: DomainSingleSelectionFlowDetail
|
|
24232
|
-
});
|
|
24233
|
-
registerActionTypeUI("qi/pod.entity-single-selection", {
|
|
24234
|
-
configComponent: EntitySingleSelectionConfig,
|
|
24235
|
-
flowDetailComponent: EntitySingleSelectionFlowDetail
|
|
24236
|
-
});
|
|
24237
|
-
registerActionTypeUI("qi/pod.member-multi-select", {
|
|
24238
|
-
configComponent: MemberMultiSelectConfig,
|
|
24239
|
-
flowDetailComponent: MemberMultiSelectFlowDetail
|
|
24240
|
-
});
|
|
24241
|
-
registerActionTypeUI("qi/pod.governance-config", {
|
|
24242
|
-
configComponent: GovernanceConfigConfig,
|
|
24243
|
-
flowDetailComponent: GovernanceConfigFlowDetail
|
|
24244
|
-
});
|
|
24334
|
+
// src/mantine/blocks/action/actionTypes/pod/listDomainFlows/index.ts
|
|
24245
24335
|
registerActionTypeUI("qi/pod.list-domain-flows", {
|
|
24246
24336
|
configComponent: ListDomainFlowsConfig,
|
|
24247
24337
|
flowDetailComponent: ListDomainFlowsFlowDetail
|
|
@@ -28643,20 +28733,18 @@ registerActionTypeUI("qi/protocol.select", {
|
|
|
28643
28733
|
|
|
28644
28734
|
// src/mantine/blocks/action/actionTypes/domainSign/DomainSignConfig.tsx
|
|
28645
28735
|
import React273, { useCallback as useCallback100, useEffect as useEffect101, useState as useState124 } from "react";
|
|
28646
|
-
import {
|
|
28736
|
+
import { Stack as Stack190, Text as Text166 } from "@mantine/core";
|
|
28647
28737
|
|
|
28648
28738
|
// src/mantine/blocks/action/actionTypes/domainSign/types.ts
|
|
28649
28739
|
function parseDomainSignInputs(json) {
|
|
28650
28740
|
try {
|
|
28651
28741
|
const parsed = typeof json === "string" ? JSON.parse(json) : json;
|
|
28652
28742
|
return {
|
|
28653
|
-
entityType: parsed?.entityType || ""
|
|
28654
|
-
linkedEntities: parsed?.linkedEntities || "[]"
|
|
28743
|
+
entityType: parsed?.entityType || ""
|
|
28655
28744
|
};
|
|
28656
28745
|
} catch {
|
|
28657
28746
|
return {
|
|
28658
|
-
entityType: ""
|
|
28659
|
-
linkedEntities: "[]"
|
|
28747
|
+
entityType: ""
|
|
28660
28748
|
};
|
|
28661
28749
|
}
|
|
28662
28750
|
}
|
|
@@ -28695,21 +28783,6 @@ var DomainSignConfig = ({ inputs, onInputsChange }) => {
|
|
|
28695
28783
|
data: ENTITY_TYPE_OPTIONS,
|
|
28696
28784
|
clearable: true
|
|
28697
28785
|
}
|
|
28698
|
-
)), /* @__PURE__ */ React273.createElement(Divider25, { variant: "dashed" }), /* @__PURE__ */ React273.createElement(Stack190, { gap: "xs" }, /* @__PURE__ */ React273.createElement(Text166, { size: "sm", fw: 600 }, "Governance Groups"), /* @__PURE__ */ React273.createElement(Text166, { size: "xs", c: "dimmed" }, "Optional JSON array of linked entity data for governance groups. Passed from upstream via flow inputs."), /* @__PURE__ */ React273.createElement(
|
|
28699
|
-
Textarea3,
|
|
28700
|
-
{
|
|
28701
|
-
placeholder: '[{"type":"governanceGroup","coreAddress":"cosmos1..."}]',
|
|
28702
|
-
value: local.linkedEntities === "[]" ? "" : local.linkedEntities,
|
|
28703
|
-
onChange: (event) => update({ linkedEntities: event.currentTarget.value || "[]" }),
|
|
28704
|
-
minRows: 3,
|
|
28705
|
-
autosize: true,
|
|
28706
|
-
styles: {
|
|
28707
|
-
input: {
|
|
28708
|
-
fontFamily: "monospace",
|
|
28709
|
-
fontSize: 12
|
|
28710
|
-
}
|
|
28711
|
-
}
|
|
28712
|
-
}
|
|
28713
28786
|
)));
|
|
28714
28787
|
};
|
|
28715
28788
|
|
|
@@ -28747,18 +28820,19 @@ var DomainSignFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
28747
28820
|
const editorDocument = editor?.document || [];
|
|
28748
28821
|
const resolveOpts = useMemo106(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
28749
28822
|
const entityType = resolveReferences(parsed.entityType, editorDocument, resolveOpts).trim();
|
|
28823
|
+
const pendingPayload = runtime.pendingPayload;
|
|
28750
28824
|
const domainCardData = useMemo106(() => {
|
|
28751
28825
|
try {
|
|
28752
|
-
const raw =
|
|
28826
|
+
const raw = pendingPayload?.domainCardData;
|
|
28753
28827
|
if (!raw) return null;
|
|
28754
28828
|
return typeof raw === "string" ? JSON.parse(raw) : raw;
|
|
28755
28829
|
} catch {
|
|
28756
28830
|
return null;
|
|
28757
28831
|
}
|
|
28758
|
-
}, [
|
|
28832
|
+
}, [pendingPayload]);
|
|
28759
28833
|
const domainName = domainCardData?.credentialSubject?.name || null;
|
|
28760
28834
|
const domainDescription = domainCardData?.credentialSubject?.description || null;
|
|
28761
|
-
const resolvedEntityType = entityType || (domainCardData?.credentialSubject?.type?.[0]
|
|
28835
|
+
const resolvedEntityType = entityType || (domainCardData?.credentialSubject?.type?.[0] ? resolveEntityTypeFromSchema(domainCardData.credentialSubject.type[0]) : "dao");
|
|
28762
28836
|
const [flowStep, setFlowStep] = useState125(() => {
|
|
28763
28837
|
if (runtime.state === "completed") return "success";
|
|
28764
28838
|
if (runtime.state === "failed") return "error";
|
|
@@ -28817,7 +28891,9 @@ var DomainSignFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
28817
28891
|
{
|
|
28818
28892
|
domainCardData,
|
|
28819
28893
|
entityType: entityType || void 0,
|
|
28820
|
-
|
|
28894
|
+
governanceConfig: pendingPayload?.governanceConfig || void 0,
|
|
28895
|
+
memberConfig: pendingPayload?.memberConfig || void 0,
|
|
28896
|
+
linkedEntities: pendingPayload?.linkedEntities || void 0
|
|
28821
28897
|
},
|
|
28822
28898
|
{
|
|
28823
28899
|
actorDid,
|
|
@@ -28837,7 +28913,6 @@ var DomainSignFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
28837
28913
|
};
|
|
28838
28914
|
},
|
|
28839
28915
|
pin: ""
|
|
28840
|
-
// TODO: collect PIN from user for invocation signing
|
|
28841
28916
|
});
|
|
28842
28917
|
if (!outcome.success) {
|
|
28843
28918
|
throw new Error(outcome.error || "Domain sign failed");
|
|
@@ -28874,7 +28949,7 @@ var DomainSignFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
28874
28949
|
invocationStore,
|
|
28875
28950
|
isCompleted,
|
|
28876
28951
|
isDisabled,
|
|
28877
|
-
|
|
28952
|
+
pendingPayload,
|
|
28878
28953
|
runtimeManager,
|
|
28879
28954
|
services,
|
|
28880
28955
|
ucanService,
|
|
@@ -28903,231 +28978,17 @@ registerActionTypeUI("qi/domain.sign", {
|
|
|
28903
28978
|
flowDetailComponent: DomainSignFlowDetail
|
|
28904
28979
|
});
|
|
28905
28980
|
|
|
28906
|
-
// src/mantine/blocks/action/actionTypes/domainCardBuild/DomainCardBuildConfig.tsx
|
|
28907
|
-
import React275, { useCallback as useCallback102, useEffect as useEffect102, useState as useState126 } from "react";
|
|
28908
|
-
import { Stack as Stack192, Text as Text168 } from "@mantine/core";
|
|
28909
|
-
|
|
28910
|
-
// src/mantine/blocks/action/actionTypes/domainCardBuild/types.ts
|
|
28911
|
-
function parseDomainCardBuildInputs(json) {
|
|
28912
|
-
try {
|
|
28913
|
-
const parsed = typeof json === "string" ? JSON.parse(json) : json;
|
|
28914
|
-
return {
|
|
28915
|
-
entityType: parsed?.entityType || "dao",
|
|
28916
|
-
surveySchema: parsed?.surveySchema
|
|
28917
|
-
};
|
|
28918
|
-
} catch {
|
|
28919
|
-
return {
|
|
28920
|
-
entityType: "dao"
|
|
28921
|
-
};
|
|
28922
|
-
}
|
|
28923
|
-
}
|
|
28924
|
-
function serializeDomainCardBuildInputs(inputs) {
|
|
28925
|
-
return JSON.stringify(inputs);
|
|
28926
|
-
}
|
|
28927
|
-
|
|
28928
|
-
// src/mantine/blocks/action/actionTypes/domainCardBuild/DomainCardBuildConfig.tsx
|
|
28929
|
-
var ENTITY_TYPE_OPTIONS2 = [
|
|
28930
|
-
{ value: "dao", label: "DAO" },
|
|
28931
|
-
{ value: "protocol", label: "Protocol" },
|
|
28932
|
-
{ value: "project", label: "Project" },
|
|
28933
|
-
{ value: "oracle", label: "Oracle" },
|
|
28934
|
-
{ value: "investment", label: "Investment" },
|
|
28935
|
-
{ value: "deed", label: "Deed" }
|
|
28936
|
-
];
|
|
28937
|
-
var DomainCardBuildConfig = ({ inputs, onInputsChange }) => {
|
|
28938
|
-
const [local, setLocal] = useState126(() => parseDomainCardBuildInputs(inputs));
|
|
28939
|
-
useEffect102(() => {
|
|
28940
|
-
setLocal(parseDomainCardBuildInputs(inputs));
|
|
28941
|
-
}, [inputs]);
|
|
28942
|
-
const update = useCallback102(
|
|
28943
|
-
(patch) => {
|
|
28944
|
-
const updated = { ...local, ...patch };
|
|
28945
|
-
setLocal(updated);
|
|
28946
|
-
onInputsChange(serializeDomainCardBuildInputs(updated));
|
|
28947
|
-
},
|
|
28948
|
-
[local, onInputsChange]
|
|
28949
|
-
);
|
|
28950
|
-
useEffect102(() => {
|
|
28951
|
-
if (!local.surveySchema) {
|
|
28952
|
-
update({ surveySchema: tempDomainCreatorSurvey });
|
|
28953
|
-
}
|
|
28954
|
-
}, []);
|
|
28955
|
-
return /* @__PURE__ */ React275.createElement(Stack192, { gap: "lg" }, /* @__PURE__ */ React275.createElement(Stack192, { gap: "xs" }, /* @__PURE__ */ React275.createElement(Text168, { size: "sm", fw: 600 }, "Default Entity Type"), /* @__PURE__ */ React275.createElement(Text168, { size: "xs", c: "dimmed" }, "The domain type used if not specified in the survey. The survey itself can also set the entity type."), /* @__PURE__ */ React275.createElement(
|
|
28956
|
-
BaseSelect,
|
|
28957
|
-
{
|
|
28958
|
-
placeholder: "Select entity type",
|
|
28959
|
-
value: local.entityType,
|
|
28960
|
-
onChange: (value) => {
|
|
28961
|
-
if (value) update({ entityType: value });
|
|
28962
|
-
},
|
|
28963
|
-
data: ENTITY_TYPE_OPTIONS2
|
|
28964
|
-
}
|
|
28965
|
-
)), /* @__PURE__ */ React275.createElement(Stack192, { gap: "xs" }, /* @__PURE__ */ React275.createElement(Text168, { size: "sm", fw: 600 }, "Survey"), /* @__PURE__ */ React275.createElement(Text168, { size: "xs", c: "dimmed" }, "Uses the default Domain Card survey with fields for name, type, description, contact, composition, relationships, and more.")));
|
|
28966
|
-
};
|
|
28967
|
-
|
|
28968
|
-
// src/mantine/blocks/action/actionTypes/domainCardBuild/DomainCardBuildFlowDetail.tsx
|
|
28969
|
-
import React276, { useCallback as useCallback103, useEffect as useEffect103, useMemo as useMemo107, useState as useState127 } from "react";
|
|
28970
|
-
import { Alert as Alert54, Button as Button57, Group as Group107, Loader as Loader54, Stack as Stack193, Text as Text169 } from "@mantine/core";
|
|
28971
|
-
import { IconCheck as IconCheck24, IconAlertCircle as IconAlertCircle22, IconPlayerPlay as IconPlayerPlay6, IconEdit } from "@tabler/icons-react";
|
|
28972
|
-
import { SurveyModel as SurveyModel12 } from "@ixo/surveys";
|
|
28973
|
-
var DomainCardBuildFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
28974
|
-
const handlers = useBlocknoteHandlers();
|
|
28975
|
-
const services = useMemo107(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
28976
|
-
const flowNode = useMemo107(() => buildFlowNodeFromBlock(block), [block]);
|
|
28977
|
-
const runtimeManager = useMemo107(() => createRuntimeStateManager(editor), [editor]);
|
|
28978
|
-
const ucanService = useMemo107(() => editor?.getUcanService?.() || void 0, [editor]);
|
|
28979
|
-
const invocationStore = useMemo107(() => editor?._invocationStore || void 0, [editor]);
|
|
28980
|
-
const flowId = useMemo107(() => editor?.getFlowMetadata?.()?.doc_id || block.id, [editor, block.id]);
|
|
28981
|
-
const flowOwnerDid = useMemo107(() => editor?.getFlowOwnerDid?.() || "", [editor]);
|
|
28982
|
-
const schemaVersion = useMemo107(() => editor?.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
28983
|
-
const flowUri = useMemo107(() => {
|
|
28984
|
-
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
28985
|
-
return `ixo:flow:${docId}`;
|
|
28986
|
-
}, [editor, block.id]);
|
|
28987
|
-
const actorDid = useMemo107(() => {
|
|
28988
|
-
try {
|
|
28989
|
-
return handlers?.getCurrentUser?.()?.address || "";
|
|
28990
|
-
} catch {
|
|
28991
|
-
return "";
|
|
28992
|
-
}
|
|
28993
|
-
}, [handlers]);
|
|
28994
|
-
const parsed = useMemo107(() => parseDomainCardBuildInputs(inputs), [inputs]);
|
|
28995
|
-
const editorDocument = editor?.document || [];
|
|
28996
|
-
const resolveOpts = useMemo107(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
28997
|
-
const entityType = resolveReferences(parsed.entityType, editorDocument, resolveOpts).trim() || "dao";
|
|
28998
|
-
const initialStep = runtime.output?.domainCardData ? "success" : "idle";
|
|
28999
|
-
const [flowStep, setFlowStep] = useState127(initialStep);
|
|
29000
|
-
const [error, setError] = useState127(null);
|
|
29001
|
-
const surveySchema = parsed.surveySchema || tempDomainCreatorSurvey;
|
|
29002
|
-
const surveyModel = useMemo107(() => {
|
|
29003
|
-
const model = new SurveyModel12(surveySchema);
|
|
29004
|
-
model.applyTheme(surveyTheme);
|
|
29005
|
-
model.showQuestionNumbers = "off";
|
|
29006
|
-
model.questionsOnPageMode = "singlePage";
|
|
29007
|
-
return model;
|
|
29008
|
-
}, [surveySchema]);
|
|
29009
|
-
const handleSurveyComplete = useCallback103(
|
|
29010
|
-
async (sender) => {
|
|
29011
|
-
const actionDef = getAction("qi/domain.card-build");
|
|
29012
|
-
if (!actionDef) {
|
|
29013
|
-
setError("domain.card-build action is not registered");
|
|
29014
|
-
return;
|
|
29015
|
-
}
|
|
29016
|
-
setFlowStep("submitting");
|
|
29017
|
-
setError(null);
|
|
29018
|
-
updateRuntime({ state: "running", error: void 0 });
|
|
29019
|
-
try {
|
|
29020
|
-
const outcome = await executeNode({
|
|
29021
|
-
node: flowNode,
|
|
29022
|
-
actorDid,
|
|
29023
|
-
actorType: "user",
|
|
29024
|
-
context: {
|
|
29025
|
-
runtime: runtimeManager,
|
|
29026
|
-
ucanService,
|
|
29027
|
-
invocationStore,
|
|
29028
|
-
flowUri,
|
|
29029
|
-
flowId,
|
|
29030
|
-
flowOwnerDid,
|
|
29031
|
-
schemaVersion
|
|
29032
|
-
},
|
|
29033
|
-
action: async () => {
|
|
29034
|
-
const result = await actionDef.run(
|
|
29035
|
-
{
|
|
29036
|
-
entityType,
|
|
29037
|
-
surveyData: sender.data
|
|
29038
|
-
},
|
|
29039
|
-
{
|
|
29040
|
-
actorDid,
|
|
29041
|
-
flowId: flowUri,
|
|
29042
|
-
nodeId: block.id,
|
|
29043
|
-
services,
|
|
29044
|
-
flowNode,
|
|
29045
|
-
runtime: runtimeManager,
|
|
29046
|
-
flowUri,
|
|
29047
|
-
handlers,
|
|
29048
|
-
editor
|
|
29049
|
-
}
|
|
29050
|
-
);
|
|
29051
|
-
return {
|
|
29052
|
-
payload: result.output,
|
|
29053
|
-
submittedByDid: actorDid || void 0
|
|
29054
|
-
};
|
|
29055
|
-
},
|
|
29056
|
-
pin: ""
|
|
29057
|
-
});
|
|
29058
|
-
if (!outcome.success) {
|
|
29059
|
-
throw new Error(outcome.error || "Domain card build failed");
|
|
29060
|
-
}
|
|
29061
|
-
updateRuntime({
|
|
29062
|
-
state: "completed",
|
|
29063
|
-
executedAt: Date.now(),
|
|
29064
|
-
output: outcome.result?.payload || {}
|
|
29065
|
-
});
|
|
29066
|
-
setFlowStep("success");
|
|
29067
|
-
} catch (err) {
|
|
29068
|
-
const message = err instanceof Error ? err.message : "Failed to build domain card";
|
|
29069
|
-
setError(message);
|
|
29070
|
-
setFlowStep("error");
|
|
29071
|
-
updateRuntime({
|
|
29072
|
-
state: "failed",
|
|
29073
|
-
error: { message, at: Date.now() }
|
|
29074
|
-
});
|
|
29075
|
-
}
|
|
29076
|
-
},
|
|
29077
|
-
[
|
|
29078
|
-
actorDid,
|
|
29079
|
-
block.id,
|
|
29080
|
-
editor,
|
|
29081
|
-
entityType,
|
|
29082
|
-
flowId,
|
|
29083
|
-
flowNode,
|
|
29084
|
-
flowOwnerDid,
|
|
29085
|
-
flowUri,
|
|
29086
|
-
handlers,
|
|
29087
|
-
invocationStore,
|
|
29088
|
-
runtimeManager,
|
|
29089
|
-
schemaVersion,
|
|
29090
|
-
services,
|
|
29091
|
-
ucanService,
|
|
29092
|
-
updateRuntime
|
|
29093
|
-
]
|
|
29094
|
-
);
|
|
29095
|
-
useEffect103(() => {
|
|
29096
|
-
surveyModel.onComplete.add(handleSurveyComplete);
|
|
29097
|
-
return () => {
|
|
29098
|
-
surveyModel.onComplete.remove(handleSurveyComplete);
|
|
29099
|
-
};
|
|
29100
|
-
}, [surveyModel, handleSurveyComplete]);
|
|
29101
|
-
const handleStartSurvey = useCallback103(() => {
|
|
29102
|
-
surveyModel.clear();
|
|
29103
|
-
setFlowStep("survey");
|
|
29104
|
-
setError(null);
|
|
29105
|
-
}, [surveyModel]);
|
|
29106
|
-
const handleRetry = useCallback103(() => {
|
|
29107
|
-
surveyModel.clear();
|
|
29108
|
-
setFlowStep("survey");
|
|
29109
|
-
setError(null);
|
|
29110
|
-
}, [surveyModel]);
|
|
29111
|
-
const cardName = runtime.output?.domainCardData?.credentialSubject?.name;
|
|
29112
|
-
return /* @__PURE__ */ React276.createElement(Stack193, { gap: "md" }, /* @__PURE__ */ React276.createElement(Stack193, { gap: 2 }, /* @__PURE__ */ React276.createElement(Text169, { fw: 600 }, block?.props?.title || "Build Domain Card"), /* @__PURE__ */ React276.createElement(Text169, { size: "sm", c: "dimmed" }, block?.props?.description || "Answer the survey to build an unsigned Domain Card credential for review and signing.")), flowStep === "success" && /* @__PURE__ */ React276.createElement(Stack193, { gap: "md" }, /* @__PURE__ */ React276.createElement(Alert54, { icon: /* @__PURE__ */ React276.createElement(IconCheck24, { size: 16 }), title: "Domain Card Built", color: "green", styles: actionAlertStyles }, /* @__PURE__ */ React276.createElement(Stack193, { gap: "xs" }, /* @__PURE__ */ React276.createElement(Text169, { size: "sm" }, cardName ? `"${cardName}" is ready to preview.` : "Domain card built and ready to preview."), /* @__PURE__ */ React276.createElement(Text169, { size: "xs", c: "dimmed" }, "No credential has been signed yet. The card data will flow into the next preview and signing steps."))), /* @__PURE__ */ React276.createElement(Button57, { variant: "outline", leftSection: /* @__PURE__ */ React276.createElement(IconEdit, { size: 14 }), onClick: handleStartSurvey, disabled: isDisabled }, "Edit Card")), flowStep === "error" && /* @__PURE__ */ React276.createElement(Stack193, { gap: "md" }, /* @__PURE__ */ React276.createElement(Alert54, { icon: /* @__PURE__ */ React276.createElement(IconAlertCircle22, { size: 16 }), title: "Domain Card Build Failed", color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React276.createElement(Text169, { size: "sm" }, error || "An unexpected error occurred")), /* @__PURE__ */ React276.createElement(Group107, null, /* @__PURE__ */ React276.createElement(Button57, { variant: "outline", onClick: handleRetry, disabled: isDisabled }, "Try Again"))), flowStep === "submitting" && /* @__PURE__ */ React276.createElement(Stack193, { gap: "sm", align: "center", py: "md" }, /* @__PURE__ */ React276.createElement(Loader54, { size: "md" }), /* @__PURE__ */ React276.createElement(Text169, { size: "sm", c: "dimmed" }, "Building domain card...")), flowStep === "idle" && /* @__PURE__ */ React276.createElement(Button57, { leftSection: /* @__PURE__ */ React276.createElement(IconPlayerPlay6, { size: 14 }), onClick: handleStartSurvey, disabled: isDisabled }, "Start Domain Card Survey"), flowStep === "survey" && !error && /* @__PURE__ */ React276.createElement(StableSurvey, { model: surveyModel }), runtime.error?.message && flowStep !== "error" && /* @__PURE__ */ React276.createElement(Alert54, { color: "red", styles: actionAlertStyles }, runtime.error.message));
|
|
29113
|
-
};
|
|
29114
|
-
|
|
29115
|
-
// src/mantine/blocks/action/actionTypes/domainCardBuild/index.ts
|
|
29116
|
-
registerActionTypeUI("qi/domain.card-build", {
|
|
29117
|
-
configComponent: DomainCardBuildConfig,
|
|
29118
|
-
flowDetailComponent: DomainCardBuildFlowDetail
|
|
29119
|
-
});
|
|
29120
|
-
|
|
29121
28981
|
// src/mantine/blocks/action/actionTypes/domainCardPreview/DomainCardPreviewConfig.tsx
|
|
29122
|
-
import
|
|
29123
|
-
import { Stack as
|
|
28982
|
+
import React275, { useCallback as useCallback102, useEffect as useEffect102, useState as useState126 } from "react";
|
|
28983
|
+
import { Stack as Stack192, Text as Text168, Textarea as Textarea3 } from "@mantine/core";
|
|
29124
28984
|
|
|
29125
28985
|
// src/mantine/blocks/action/actionTypes/domainCardPreview/types.ts
|
|
29126
28986
|
function parseDomainCardPreviewInputs(json) {
|
|
29127
28987
|
try {
|
|
29128
28988
|
const parsed = typeof json === "string" ? JSON.parse(json) : json;
|
|
29129
28989
|
return {
|
|
29130
|
-
domainCardData: parsed?.domainCardData || ""
|
|
28990
|
+
domainCardData: parsed?.domainCardData || "",
|
|
28991
|
+
...parsed
|
|
29131
28992
|
};
|
|
29132
28993
|
} catch {
|
|
29133
28994
|
return { domainCardData: "" };
|
|
@@ -29136,14 +28997,46 @@ function parseDomainCardPreviewInputs(json) {
|
|
|
29136
28997
|
function serializeDomainCardPreviewInputs(inputs) {
|
|
29137
28998
|
return JSON.stringify(inputs);
|
|
29138
28999
|
}
|
|
29000
|
+
function buildPreviewFromInputs(inputs) {
|
|
29001
|
+
const name = inputs.domainName;
|
|
29002
|
+
if (!name) return null;
|
|
29003
|
+
return {
|
|
29004
|
+
name,
|
|
29005
|
+
summary: inputs.tagline || void 0,
|
|
29006
|
+
description: inputs.description || void 0,
|
|
29007
|
+
keywords: inputs.keyFeatures || void 0,
|
|
29008
|
+
logo_url: inputs.logo ? { url: inputs.logo } : void 0,
|
|
29009
|
+
contact: {
|
|
29010
|
+
website: inputs.website || void 0,
|
|
29011
|
+
...inputs.socialMedia ? { socialLinks: Object.values(inputs.socialMedia).filter(Boolean) } : {}
|
|
29012
|
+
}
|
|
29013
|
+
};
|
|
29014
|
+
}
|
|
29015
|
+
function buildCardDataFromInputs(inputs) {
|
|
29016
|
+
const name = inputs.domainName;
|
|
29017
|
+
if (!name) return null;
|
|
29018
|
+
return {
|
|
29019
|
+
credentialSubject: {
|
|
29020
|
+
name,
|
|
29021
|
+
description: inputs.description || "",
|
|
29022
|
+
type: ["schema:DAO"]
|
|
29023
|
+
},
|
|
29024
|
+
validFrom: (/* @__PURE__ */ new Date()).toISOString(),
|
|
29025
|
+
validUntil: (() => {
|
|
29026
|
+
const d = /* @__PURE__ */ new Date();
|
|
29027
|
+
d.setFullYear(d.getFullYear() + 5);
|
|
29028
|
+
return d.toISOString();
|
|
29029
|
+
})()
|
|
29030
|
+
};
|
|
29031
|
+
}
|
|
29139
29032
|
|
|
29140
29033
|
// src/mantine/blocks/action/actionTypes/domainCardPreview/DomainCardPreviewConfig.tsx
|
|
29141
29034
|
var DomainCardPreviewConfig = ({ inputs, onInputsChange }) => {
|
|
29142
|
-
const [local, setLocal] =
|
|
29143
|
-
|
|
29035
|
+
const [local, setLocal] = useState126(() => parseDomainCardPreviewInputs(inputs));
|
|
29036
|
+
useEffect102(() => {
|
|
29144
29037
|
setLocal(parseDomainCardPreviewInputs(inputs));
|
|
29145
29038
|
}, [inputs]);
|
|
29146
|
-
const update =
|
|
29039
|
+
const update = useCallback102(
|
|
29147
29040
|
(patch) => {
|
|
29148
29041
|
const updated = { ...local, ...patch };
|
|
29149
29042
|
setLocal(updated);
|
|
@@ -29151,8 +29044,8 @@ var DomainCardPreviewConfig = ({ inputs, onInputsChange }) => {
|
|
|
29151
29044
|
},
|
|
29152
29045
|
[local, onInputsChange]
|
|
29153
29046
|
);
|
|
29154
|
-
return /* @__PURE__ */
|
|
29155
|
-
|
|
29047
|
+
return /* @__PURE__ */ React275.createElement(Stack192, { gap: "lg" }, /* @__PURE__ */ React275.createElement(Stack192, { gap: "xs" }, /* @__PURE__ */ React275.createElement(Text168, { size: "sm", fw: 600 }, "Domain Card Data"), /* @__PURE__ */ React275.createElement(Text168, { size: "xs", c: "dimmed" }, "Reference to the domain card data. The oracle writes this into ", /* @__PURE__ */ React275.createElement("code", null, "runtime.output.domainCardData"), "."), /* @__PURE__ */ React275.createElement(
|
|
29048
|
+
Textarea3,
|
|
29156
29049
|
{
|
|
29157
29050
|
placeholder: "{{block.<id>.output.domainCardData}}",
|
|
29158
29051
|
value: local.domainCardData,
|
|
@@ -29165,10 +29058,10 @@ var DomainCardPreviewConfig = ({ inputs, onInputsChange }) => {
|
|
|
29165
29058
|
};
|
|
29166
29059
|
|
|
29167
29060
|
// src/mantine/blocks/action/actionTypes/domainCardPreview/DomainCardPreviewFlowDetail.tsx
|
|
29168
|
-
import
|
|
29169
|
-
import { Alert as
|
|
29170
|
-
import { IconAlertCircle as
|
|
29171
|
-
var JsonViewer2 = ({ data }) => /* @__PURE__ */
|
|
29061
|
+
import React276, { useCallback as useCallback103, useMemo as useMemo107 } from "react";
|
|
29062
|
+
import { Alert as Alert54, Badge as Badge49, Box as Box61, Button as Button57, Code as Code10, Group as Group107, Loader as Loader54, ScrollArea as ScrollArea9, Stack as Stack193, Text as Text169 } from "@mantine/core";
|
|
29063
|
+
import { IconAlertCircle as IconAlertCircle22, IconCheck as IconCheck24, IconSparkles as IconSparkles6 } from "@tabler/icons-react";
|
|
29064
|
+
var JsonViewer2 = ({ data }) => /* @__PURE__ */ React276.createElement(ScrollArea9.Autosize, { mah: 360, offsetScrollbars: true }, /* @__PURE__ */ React276.createElement(Stack193, { gap: "md" }, data.name && /* @__PURE__ */ React276.createElement(Box61, null, /* @__PURE__ */ React276.createElement(Text169, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Name"), /* @__PURE__ */ React276.createElement(Text169, { size: "lg", fw: 600 }, data.name)), data.summary && /* @__PURE__ */ React276.createElement(Box61, null, /* @__PURE__ */ React276.createElement(Text169, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Summary"), /* @__PURE__ */ React276.createElement(Text169, { size: "sm" }, data.summary)), data.description && /* @__PURE__ */ React276.createElement(Box61, null, /* @__PURE__ */ React276.createElement(Text169, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Description"), /* @__PURE__ */ React276.createElement(Text169, { size: "sm" }, data.description)), data.entity_type && data.entity_type.length > 0 && /* @__PURE__ */ React276.createElement(Box61, null, /* @__PURE__ */ React276.createElement(Text169, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Type"), /* @__PURE__ */ React276.createElement(Text169, { size: "sm" }, data.entity_type.join(", "))), data.keywords && data.keywords.length > 0 && /* @__PURE__ */ React276.createElement(Box61, null, /* @__PURE__ */ React276.createElement(Text169, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Keywords"), /* @__PURE__ */ React276.createElement(Text169, { size: "sm" }, data.keywords.join(", "))), data.faq && data.faq.length > 0 && /* @__PURE__ */ React276.createElement(Box61, null, /* @__PURE__ */ React276.createElement(Text169, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, mb: "xs" }, "FAQ"), /* @__PURE__ */ React276.createElement(Stack193, { gap: "sm" }, data.faq.map((item, index) => /* @__PURE__ */ React276.createElement(Box61, { key: index, p: "sm", style: { borderRadius: 8, backgroundColor: "var(--mantine-color-dark-6)" } }, /* @__PURE__ */ React276.createElement(Text169, { size: "sm", fw: 500, mb: 4 }, item.question), /* @__PURE__ */ React276.createElement(Text169, { size: "xs", c: "dimmed" }, item.answer))))), /* @__PURE__ */ React276.createElement(Box61, null, /* @__PURE__ */ React276.createElement(Text169, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, mb: "xs" }, "Raw Data"), /* @__PURE__ */ React276.createElement(Code10, { block: true, style: { fontSize: 11, maxHeight: 200, overflow: "auto" } }, JSON.stringify(data, null, 2)))));
|
|
29172
29065
|
var STATUS_BADGE = {
|
|
29173
29066
|
approved: { color: "green", text: "Approved" },
|
|
29174
29067
|
error: { color: "red", text: "Error" },
|
|
@@ -29190,37 +29083,43 @@ function coerce(value, fallback) {
|
|
|
29190
29083
|
}
|
|
29191
29084
|
var DomainCardPreviewFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
29192
29085
|
const { domainCardRenderer } = useBlocknoteContext();
|
|
29193
|
-
const parsed =
|
|
29086
|
+
const parsed = useMemo107(() => parseDomainCardPreviewInputs(inputs), [inputs]);
|
|
29194
29087
|
const editorDocument = editor?.document || [];
|
|
29195
|
-
const resolveOpts =
|
|
29196
|
-
const upstreamCardData =
|
|
29088
|
+
const resolveOpts = useMemo107(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
29089
|
+
const upstreamCardData = useMemo107(() => {
|
|
29197
29090
|
if (!parsed.domainCardData) return void 0;
|
|
29198
29091
|
const resolved = resolveReferences(parsed.domainCardData, editorDocument, resolveOpts);
|
|
29199
29092
|
return coerce(resolved, void 0);
|
|
29200
29093
|
}, [parsed.domainCardData, editorDocument, resolveOpts]);
|
|
29201
|
-
const
|
|
29094
|
+
const inputsPreview = useMemo107(() => buildPreviewFromInputs(parsed), [parsed]);
|
|
29095
|
+
const inputsCardData = useMemo107(() => buildCardDataFromInputs(parsed), [parsed]);
|
|
29202
29096
|
const loadingMessage = runtime.output?.loadingMessage || "Agents are analyzing your domain information...";
|
|
29203
29097
|
const errorMessage = runtime.output?.errorMessage || "An error occurred while generating the domain data.";
|
|
29204
|
-
const domainPreviewData = coerce(runtime.output?.domainPreviewData, null);
|
|
29205
|
-
const domainCardData = coerce(runtime.output?.domainCardData, upstreamCardData);
|
|
29098
|
+
const domainPreviewData = coerce(runtime.output?.domainPreviewData, null) || inputsPreview;
|
|
29099
|
+
const domainCardData = coerce(runtime.output?.domainCardData, upstreamCardData) || inputsCardData;
|
|
29100
|
+
const status = useMemo107(() => {
|
|
29101
|
+
const runtimeStatus = runtime.output?.status;
|
|
29102
|
+
if (runtimeStatus) return runtimeStatus;
|
|
29103
|
+
if (domainPreviewData || domainCardData) return "ready";
|
|
29104
|
+
return "pending";
|
|
29105
|
+
}, [runtime.output?.status, domainPreviewData, domainCardData]);
|
|
29206
29106
|
const hasPreview = Boolean(domainPreviewData && (domainPreviewData.name || domainPreviewData.summary || domainPreviewData.description));
|
|
29207
29107
|
const badge = STATUS_BADGE[status];
|
|
29208
|
-
const handleApprove =
|
|
29108
|
+
const handleApprove = useCallback103(() => {
|
|
29209
29109
|
if (isDisabled) return;
|
|
29210
29110
|
if (!domainCardData) return;
|
|
29211
|
-
|
|
29212
|
-
|
|
29213
|
-
|
|
29214
|
-
|
|
29215
|
-
|
|
29216
|
-
|
|
29217
|
-
|
|
29218
|
-
|
|
29219
|
-
|
|
29220
|
-
|
|
29221
|
-
|
|
29222
|
-
},
|
|
29223
|
-
return /* @__PURE__ */ React278.createElement(Stack195, { gap: "md" }, /* @__PURE__ */ React278.createElement(Stack195, { gap: 2 }, /* @__PURE__ */ React278.createElement(Group108, { gap: "xs", align: "center" }, /* @__PURE__ */ React278.createElement(Text171, { fw: 600 }, block?.props?.title || "Preview Domain Card"), /* @__PURE__ */ React278.createElement(Badge49, { size: "xs", variant: "filled", color: badge.color }, badge.text)), /* @__PURE__ */ React278.createElement(Text171, { size: "sm", c: "dimmed" }, block?.props?.description || "Review the oracle-enriched domain card before signing.")), status === "loading" && /* @__PURE__ */ React278.createElement(Stack195, { align: "center", py: "lg", gap: "md" }, /* @__PURE__ */ React278.createElement(Loader55, { size: "lg", color: "blue" }), /* @__PURE__ */ React278.createElement(Stack195, { align: "center", gap: "xs" }, /* @__PURE__ */ React278.createElement(IconSparkles6, { size: 22, color: "var(--mantine-color-blue-5)" }), /* @__PURE__ */ React278.createElement(Text171, { size: "sm", c: "dimmed", ta: "center" }, loadingMessage))), status === "error" && /* @__PURE__ */ React278.createElement(Alert55, { icon: /* @__PURE__ */ React278.createElement(IconAlertCircle23, { size: 16 }), title: "Preview error", color: "red", variant: "light", styles: actionAlertStyles }, /* @__PURE__ */ React278.createElement(Stack195, { gap: "xs" }, /* @__PURE__ */ React278.createElement(Text171, { size: "sm" }, errorMessage), /* @__PURE__ */ React278.createElement(Text171, { size: "xs", c: "dimmed" }, "Ask the oracle agent to regenerate, or rebuild the card upstream."))), (status === "ready" || status === "approved") && hasPreview && domainPreviewData && /* @__PURE__ */ React278.createElement(Box61, { p: "md", style: { backgroundColor: "var(--mantine-color-dark-6)", borderRadius: 8 } }, domainCardRenderer ? domainCardRenderer(domainPreviewData) : /* @__PURE__ */ React278.createElement(JsonViewer2, { data: domainPreviewData })), (status === "ready" || status === "approved") && !hasPreview && domainCardData && /* @__PURE__ */ React278.createElement(Alert55, { color: "yellow", variant: "light", styles: actionAlertStyles }, /* @__PURE__ */ React278.createElement(Text171, { size: "sm" }, "No human-facing preview was published by the oracle. You can still approve the underlying card, but consider asking the oracle agent to publish", " ", /* @__PURE__ */ React278.createElement("code", null, "domainPreviewData"), ".")), status === "pending" && /* @__PURE__ */ React278.createElement(Alert55, { color: "gray", variant: "light", styles: actionAlertStyles }, /* @__PURE__ */ React278.createElement(Text171, { size: "sm" }, "Waiting for the oracle agent to generate a preview. Run the companion skill upstream to populate this node's runtime output.")), status === "ready" && domainCardData && /* @__PURE__ */ React278.createElement(Button58, { color: "teal", leftSection: /* @__PURE__ */ React278.createElement(IconCheck25, { size: 16 }), onClick: handleApprove, disabled: isDisabled, fullWidth: true }, "Approve Domain Card"), status === "approved" && /* @__PURE__ */ React278.createElement(Alert55, { icon: /* @__PURE__ */ React278.createElement(IconCheck25, { size: 16 }), color: "green", variant: "light", styles: actionAlertStyles }, /* @__PURE__ */ React278.createElement(Text171, { size: "sm" }, "Domain card approved. Ready to sign and create the domain.")), runtime.error?.message && /* @__PURE__ */ React278.createElement(Alert55, { color: "red", styles: actionAlertStyles }, runtime.error.message));
|
|
29111
|
+
const approvedAt = Date.now();
|
|
29112
|
+
const output = {
|
|
29113
|
+
...runtime.output || {},
|
|
29114
|
+
domainPreviewData: domainPreviewData ?? runtime.output?.domainPreviewData,
|
|
29115
|
+
domainCardData,
|
|
29116
|
+
status: "approved",
|
|
29117
|
+
approvedAt
|
|
29118
|
+
};
|
|
29119
|
+
updateRuntime({ state: "completed", executedAt: approvedAt, output });
|
|
29120
|
+
writeRunRecordAndReconcile(editor, block.id, output, [{ name: "approved", payload: { domainCardData, approvedAt } }], "");
|
|
29121
|
+
}, [isDisabled, domainCardData, domainPreviewData, runtime.output, updateRuntime, editor, block.id]);
|
|
29122
|
+
return /* @__PURE__ */ React276.createElement(Stack193, { gap: "md" }, /* @__PURE__ */ React276.createElement(Stack193, { gap: 2 }, /* @__PURE__ */ React276.createElement(Group107, { gap: "xs", align: "center" }, /* @__PURE__ */ React276.createElement(Text169, { fw: 600 }, block?.props?.title || "Preview Domain Card"), /* @__PURE__ */ React276.createElement(Badge49, { size: "xs", variant: "filled", color: badge.color }, badge.text)), /* @__PURE__ */ React276.createElement(Text169, { size: "sm", c: "dimmed" }, block?.props?.description || "Review the oracle-enriched domain card before signing.")), status === "loading" && /* @__PURE__ */ React276.createElement(Stack193, { align: "center", py: "lg", gap: "md" }, /* @__PURE__ */ React276.createElement(Loader54, { size: "lg", color: "blue" }), /* @__PURE__ */ React276.createElement(Stack193, { align: "center", gap: "xs" }, /* @__PURE__ */ React276.createElement(IconSparkles6, { size: 22, color: "var(--mantine-color-blue-5)" }), /* @__PURE__ */ React276.createElement(Text169, { size: "sm", c: "dimmed", ta: "center" }, loadingMessage))), status === "error" && /* @__PURE__ */ React276.createElement(Alert54, { icon: /* @__PURE__ */ React276.createElement(IconAlertCircle22, { size: 16 }), title: "Preview error", color: "red", variant: "light", styles: actionAlertStyles }, /* @__PURE__ */ React276.createElement(Stack193, { gap: "xs" }, /* @__PURE__ */ React276.createElement(Text169, { size: "sm" }, errorMessage), /* @__PURE__ */ React276.createElement(Text169, { size: "xs", c: "dimmed" }, "Ask the oracle agent to regenerate, or rebuild the card upstream."))), (status === "ready" || status === "approved") && hasPreview && domainPreviewData && /* @__PURE__ */ React276.createElement(Box61, { p: "md", style: { backgroundColor: "var(--mantine-color-dark-6)", borderRadius: 8 } }, domainCardRenderer ? domainCardRenderer(domainPreviewData) : /* @__PURE__ */ React276.createElement(JsonViewer2, { data: domainPreviewData })), (status === "ready" || status === "approved") && !hasPreview && domainCardData && /* @__PURE__ */ React276.createElement(Alert54, { color: "yellow", variant: "light", styles: actionAlertStyles }, /* @__PURE__ */ React276.createElement(Text169, { size: "sm" }, "No human-facing preview was published by the oracle. You can still approve the underlying card, but consider asking the oracle agent to publish", " ", /* @__PURE__ */ React276.createElement("code", null, "domainPreviewData"), ".")), status === "pending" && /* @__PURE__ */ React276.createElement(Alert54, { color: "gray", variant: "light", styles: actionAlertStyles }, /* @__PURE__ */ React276.createElement(Text169, { size: "sm" }, "Waiting for the oracle agent to generate a preview. Run the companion skill upstream to populate this node's runtime output.")), status === "ready" && domainCardData && /* @__PURE__ */ React276.createElement(Button57, { color: "teal", leftSection: /* @__PURE__ */ React276.createElement(IconCheck24, { size: 16 }), onClick: handleApprove, disabled: isDisabled, fullWidth: true }, "Approve Domain Card"), status === "approved" && /* @__PURE__ */ React276.createElement(Alert54, { icon: /* @__PURE__ */ React276.createElement(IconCheck24, { size: 16 }), color: "green", variant: "light", styles: actionAlertStyles }, /* @__PURE__ */ React276.createElement(Text169, { size: "sm" }, "Domain card approved. Ready to sign and create the domain.")), runtime.error?.message && /* @__PURE__ */ React276.createElement(Alert54, { color: "red", styles: actionAlertStyles }, runtime.error.message));
|
|
29224
29123
|
};
|
|
29225
29124
|
|
|
29226
29125
|
// src/mantine/blocks/action/actionTypes/domainCardPreview/index.ts
|
|
@@ -29230,8 +29129,8 @@ registerActionTypeUI("qi/domain.card-preview", {
|
|
|
29230
29129
|
});
|
|
29231
29130
|
|
|
29232
29131
|
// src/mantine/blocks/action/actionTypes/oracle/OracleConfig.tsx
|
|
29233
|
-
import
|
|
29234
|
-
import { Stack as
|
|
29132
|
+
import React277, { useCallback as useCallback104, useEffect as useEffect103, useState as useState127 } from "react";
|
|
29133
|
+
import { Stack as Stack194 } from "@mantine/core";
|
|
29235
29134
|
|
|
29236
29135
|
// src/mantine/blocks/action/actionTypes/oracle/types.ts
|
|
29237
29136
|
function parseOracleInputs(json) {
|
|
@@ -29252,11 +29151,11 @@ function serializeOracleInputs(inputs) {
|
|
|
29252
29151
|
|
|
29253
29152
|
// src/mantine/blocks/action/actionTypes/oracle/OracleConfig.tsx
|
|
29254
29153
|
var OracleConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
29255
|
-
const [local, setLocal] =
|
|
29256
|
-
|
|
29154
|
+
const [local, setLocal] = useState127(() => parseOracleInputs(inputs));
|
|
29155
|
+
useEffect103(() => {
|
|
29257
29156
|
setLocal(parseOracleInputs(inputs));
|
|
29258
29157
|
}, [inputs]);
|
|
29259
|
-
const update =
|
|
29158
|
+
const update = useCallback104(
|
|
29260
29159
|
(patch) => {
|
|
29261
29160
|
const updated = { ...local, ...patch };
|
|
29262
29161
|
setLocal(updated);
|
|
@@ -29264,7 +29163,7 @@ var OracleConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
29264
29163
|
},
|
|
29265
29164
|
[local, onInputsChange]
|
|
29266
29165
|
);
|
|
29267
|
-
return /* @__PURE__ */
|
|
29166
|
+
return /* @__PURE__ */ React277.createElement(Stack194, { gap: "lg" }, /* @__PURE__ */ React277.createElement(
|
|
29268
29167
|
DataInput,
|
|
29269
29168
|
{
|
|
29270
29169
|
label: "Prompt",
|
|
@@ -29280,19 +29179,19 @@ var OracleConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
29280
29179
|
};
|
|
29281
29180
|
|
|
29282
29181
|
// src/mantine/blocks/action/actionTypes/oracle/OracleFlowDetail.tsx
|
|
29283
|
-
import
|
|
29284
|
-
import { Alert as
|
|
29285
|
-
import { IconCheck as
|
|
29182
|
+
import React278, { useCallback as useCallback105, useMemo as useMemo108, useState as useState128 } from "react";
|
|
29183
|
+
import { Alert as Alert55, Button as Button58, Stack as Stack195 } from "@mantine/core";
|
|
29184
|
+
import { IconCheck as IconCheck25, IconAlertCircle as IconAlertCircle23, IconSparkles as IconSparkles7 } from "@tabler/icons-react";
|
|
29286
29185
|
var OracleFlowDetail = ({ inputs, editor, runtime, updateRuntime, isDisabled }) => {
|
|
29287
29186
|
const handlers = useBlocknoteHandlers();
|
|
29288
|
-
const parsed =
|
|
29187
|
+
const parsed = useMemo108(() => parseOracleInputs(inputs), [inputs]);
|
|
29289
29188
|
const editorDocument = editor?.document || [];
|
|
29290
|
-
const resolveOpts =
|
|
29189
|
+
const resolveOpts = useMemo108(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
29291
29190
|
const resolvedPrompt = resolveReferences(parsed.prompt, editorDocument, resolveOpts).trim();
|
|
29292
|
-
const [isLoading, setIsLoading] =
|
|
29293
|
-
const [error, setError] =
|
|
29191
|
+
const [isLoading, setIsLoading] = useState128(false);
|
|
29192
|
+
const [error, setError] = useState128(null);
|
|
29294
29193
|
const isCompleted = runtime.state === "completed";
|
|
29295
|
-
const handleExecute =
|
|
29194
|
+
const handleExecute = useCallback105(async () => {
|
|
29296
29195
|
if (isDisabled || isLoading || isCompleted) return;
|
|
29297
29196
|
if (!resolvedPrompt) {
|
|
29298
29197
|
setError("No prompt configured. Set a prompt in template mode.");
|
|
@@ -29323,7 +29222,7 @@ var OracleFlowDetail = ({ inputs, editor, runtime, updateRuntime, isDisabled })
|
|
|
29323
29222
|
setIsLoading(false);
|
|
29324
29223
|
}
|
|
29325
29224
|
}, [handlers, isCompleted, isDisabled, isLoading, resolvedPrompt, updateRuntime]);
|
|
29326
|
-
return /* @__PURE__ */
|
|
29225
|
+
return /* @__PURE__ */ React278.createElement(Stack195, { gap: "md" }, !resolvedPrompt && /* @__PURE__ */ React278.createElement(Alert55, { color: "yellow", styles: actionAlertStyles }, "Configure a prompt in template mode before running this action."), resolvedPrompt && !isCompleted && /* @__PURE__ */ React278.createElement(Button58, { fullWidth: true, onClick: handleExecute, disabled: isDisabled || isLoading, loading: isLoading, leftSection: !isLoading ? /* @__PURE__ */ React278.createElement(IconSparkles7, { size: 14 }) : void 0 }, isLoading ? "Sending..." : "Ask Companion"), isCompleted && /* @__PURE__ */ React278.createElement(Alert55, { icon: /* @__PURE__ */ React278.createElement(IconCheck25, { size: 16 }), color: "green", styles: actionAlertStyles }, "Prompt sent to companion."), error && /* @__PURE__ */ React278.createElement(Alert55, { icon: /* @__PURE__ */ React278.createElement(IconAlertCircle23, { size: 16 }), color: "red", styles: actionAlertStyles }, error), runtime.error?.message && !error && /* @__PURE__ */ React278.createElement(Alert55, { color: "red", styles: actionAlertStyles }, runtime.error.message));
|
|
29327
29226
|
};
|
|
29328
29227
|
|
|
29329
29228
|
// src/mantine/blocks/action/actionTypes/oracle/index.ts
|
|
@@ -29333,8 +29232,8 @@ registerActionTypeUI("oracle", {
|
|
|
29333
29232
|
});
|
|
29334
29233
|
|
|
29335
29234
|
// src/mantine/blocks/action/actionTypes/oraclePrompt/OraclePromptConfig.tsx
|
|
29336
|
-
import
|
|
29337
|
-
import { Stack as
|
|
29235
|
+
import React279, { useCallback as useCallback106, useEffect as useEffect104, useState as useState129 } from "react";
|
|
29236
|
+
import { Stack as Stack196 } from "@mantine/core";
|
|
29338
29237
|
|
|
29339
29238
|
// src/mantine/blocks/action/actionTypes/oraclePrompt/types.ts
|
|
29340
29239
|
function parseOraclePromptInputs(json) {
|
|
@@ -29353,18 +29252,18 @@ function serializeOraclePromptInputs(inputs) {
|
|
|
29353
29252
|
|
|
29354
29253
|
// src/mantine/blocks/action/actionTypes/oraclePrompt/OraclePromptConfig.tsx
|
|
29355
29254
|
var OraclePromptConfig = ({ inputs, onInputsChange }) => {
|
|
29356
|
-
const [localPrompt, setLocalPrompt] =
|
|
29357
|
-
|
|
29255
|
+
const [localPrompt, setLocalPrompt] = useState129(() => parseOraclePromptInputs(inputs).prompt);
|
|
29256
|
+
useEffect104(() => {
|
|
29358
29257
|
setLocalPrompt(parseOraclePromptInputs(inputs).prompt);
|
|
29359
29258
|
}, [inputs]);
|
|
29360
|
-
const handleChange =
|
|
29259
|
+
const handleChange = useCallback106(
|
|
29361
29260
|
(value) => {
|
|
29362
29261
|
setLocalPrompt(value);
|
|
29363
29262
|
onInputsChange(serializeOraclePromptInputs({ prompt: value }));
|
|
29364
29263
|
},
|
|
29365
29264
|
[onInputsChange]
|
|
29366
29265
|
);
|
|
29367
|
-
return /* @__PURE__ */
|
|
29266
|
+
return /* @__PURE__ */ React279.createElement(Stack196, { gap: "xs" }, /* @__PURE__ */ React279.createElement(
|
|
29368
29267
|
BaseTextArea,
|
|
29369
29268
|
{
|
|
29370
29269
|
label: "Prompt",
|
|
@@ -29378,8 +29277,8 @@ var OraclePromptConfig = ({ inputs, onInputsChange }) => {
|
|
|
29378
29277
|
};
|
|
29379
29278
|
|
|
29380
29279
|
// src/mantine/blocks/action/actionTypes/oraclePrompt/OraclePromptFlowDetail.tsx
|
|
29381
|
-
import
|
|
29382
|
-
import { Alert as
|
|
29280
|
+
import React280, { useCallback as useCallback107, useMemo as useMemo109, useState as useState130 } from "react";
|
|
29281
|
+
import { Alert as Alert56, Loader as Loader55, Stack as Stack197, Text as Text170 } from "@mantine/core";
|
|
29383
29282
|
import { IconSend as IconSend6 } from "@tabler/icons-react";
|
|
29384
29283
|
function parsePrimarySkill(rawSkill) {
|
|
29385
29284
|
const coerce2 = (candidate) => {
|
|
@@ -29418,13 +29317,13 @@ function buildFinalPrompt(prompt, skill) {
|
|
|
29418
29317
|
}
|
|
29419
29318
|
var OraclePromptFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
29420
29319
|
const handlers = useBlocknoteHandlers();
|
|
29421
|
-
const parsed =
|
|
29320
|
+
const parsed = useMemo109(() => parseOraclePromptInputs(inputs), [inputs]);
|
|
29422
29321
|
const editorDocument = editor?.document || [];
|
|
29423
|
-
const resolveOpts =
|
|
29424
|
-
const resolvedPrompt =
|
|
29425
|
-
const [submitting, setSubmitting] =
|
|
29426
|
-
const [error, setError] =
|
|
29427
|
-
const handleExecute =
|
|
29322
|
+
const resolveOpts = useMemo109(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
29323
|
+
const resolvedPrompt = useMemo109(() => resolveReferences(parsed.prompt || "", editorDocument, resolveOpts).trim(), [parsed.prompt, editorDocument, resolveOpts]);
|
|
29324
|
+
const [submitting, setSubmitting] = useState130(false);
|
|
29325
|
+
const [error, setError] = useState130(null);
|
|
29326
|
+
const handleExecute = useCallback107(async () => {
|
|
29428
29327
|
if (isDisabled || submitting || !resolvedPrompt) return;
|
|
29429
29328
|
if (typeof handlers?.askCompanion !== "function") {
|
|
29430
29329
|
setError("askCompanion handler is not available");
|
|
@@ -29454,7 +29353,7 @@ var OraclePromptFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, i
|
|
|
29454
29353
|
}
|
|
29455
29354
|
}, [block?.props?.skill, handlers, isDisabled, resolvedPrompt, submitting, updateRuntime]);
|
|
29456
29355
|
const isCompleted = runtime.state === "completed";
|
|
29457
|
-
return /* @__PURE__ */
|
|
29356
|
+
return /* @__PURE__ */ React280.createElement(Stack197, { gap: "md" }, !resolvedPrompt ? /* @__PURE__ */ React280.createElement(Alert56, { color: "yellow", styles: actionAlertStyles }, "Configure a prompt in template mode before running this action.") : /* @__PURE__ */ React280.createElement(React280.Fragment, null, /* @__PURE__ */ React280.createElement(Text170, { size: "sm", c: "dimmed", style: { whiteSpace: "pre-wrap" } }, resolvedPrompt), /* @__PURE__ */ React280.createElement(BasePrimaryButton, { leftSection: submitting ? /* @__PURE__ */ React280.createElement(Loader55, { size: 14 }) : /* @__PURE__ */ React280.createElement(IconSend6, { size: 14 }), onClick: handleExecute, disabled: isDisabled || submitting }, submitting ? "Sending..." : isCompleted ? "Send Again" : "Send Prompt")), isCompleted && /* @__PURE__ */ React280.createElement(Text170, { size: "xs", c: "dimmed" }, "Prompt sent successfully."), error && /* @__PURE__ */ React280.createElement(Alert56, { color: "red", styles: actionAlertStyles }, error), runtime.error?.message && /* @__PURE__ */ React280.createElement(Alert56, { color: "red", styles: actionAlertStyles }, runtime.error.message));
|
|
29458
29357
|
};
|
|
29459
29358
|
|
|
29460
29359
|
// src/mantine/blocks/action/actionTypes/oraclePrompt/index.ts
|
|
@@ -29464,8 +29363,8 @@ registerActionTypeUI("oracle.prompt", {
|
|
|
29464
29363
|
});
|
|
29465
29364
|
|
|
29466
29365
|
// src/mantine/blocks/action/actionTypes/formSubmit/FormSubmitConfig.tsx
|
|
29467
|
-
import
|
|
29468
|
-
import { Stack as
|
|
29366
|
+
import React281, { useCallback as useCallback108, useEffect as useEffect105, useState as useState131 } from "react";
|
|
29367
|
+
import { Stack as Stack198, Text as Text171 } from "@mantine/core";
|
|
29469
29368
|
|
|
29470
29369
|
// src/mantine/blocks/action/actionTypes/formSubmit/types.ts
|
|
29471
29370
|
function parseFormSubmitActionInputs(json) {
|
|
@@ -29499,13 +29398,13 @@ function isValidSchemaJson(value) {
|
|
|
29499
29398
|
}
|
|
29500
29399
|
}
|
|
29501
29400
|
var FormSubmitConfig = ({ inputs, onInputsChange }) => {
|
|
29502
|
-
const [localSchema, setLocalSchema] =
|
|
29503
|
-
const [error, setError] =
|
|
29504
|
-
|
|
29401
|
+
const [localSchema, setLocalSchema] = useState131(() => parseFormSubmitActionInputs(inputs).surveySchema);
|
|
29402
|
+
const [error, setError] = useState131(null);
|
|
29403
|
+
useEffect105(() => {
|
|
29505
29404
|
setLocalSchema(parseFormSubmitActionInputs(inputs).surveySchema);
|
|
29506
29405
|
setError(null);
|
|
29507
29406
|
}, [inputs]);
|
|
29508
|
-
const handleChange =
|
|
29407
|
+
const handleChange = useCallback108(
|
|
29509
29408
|
(value) => {
|
|
29510
29409
|
setLocalSchema(value);
|
|
29511
29410
|
setError(null);
|
|
@@ -29521,7 +29420,7 @@ var FormSubmitConfig = ({ inputs, onInputsChange }) => {
|
|
|
29521
29420
|
},
|
|
29522
29421
|
[onInputsChange]
|
|
29523
29422
|
);
|
|
29524
|
-
return /* @__PURE__ */
|
|
29423
|
+
return /* @__PURE__ */ React281.createElement(Stack198, { gap: "xs" }, /* @__PURE__ */ React281.createElement(
|
|
29525
29424
|
BaseTextArea,
|
|
29526
29425
|
{
|
|
29527
29426
|
label: "Survey Schema (JSON)",
|
|
@@ -29532,13 +29431,13 @@ var FormSubmitConfig = ({ inputs, onInputsChange }) => {
|
|
|
29532
29431
|
onChange: (event) => handleChange(event.currentTarget.value),
|
|
29533
29432
|
error
|
|
29534
29433
|
}
|
|
29535
|
-
), localSchema && !error && /* @__PURE__ */
|
|
29434
|
+
), localSchema && !error && /* @__PURE__ */ React281.createElement(Text171, { size: "xs", c: "green" }, "\u2713 Valid JSON object"));
|
|
29536
29435
|
};
|
|
29537
29436
|
|
|
29538
29437
|
// src/mantine/blocks/action/actionTypes/formSubmit/FormSubmitFlowDetail.tsx
|
|
29539
|
-
import
|
|
29540
|
-
import { Alert as
|
|
29541
|
-
import { SurveyModel as
|
|
29438
|
+
import React282, { useCallback as useCallback109, useEffect as useEffect106, useMemo as useMemo110, useState as useState132 } from "react";
|
|
29439
|
+
import { Alert as Alert57, Loader as Loader56, Stack as Stack199, Text as Text172 } from "@mantine/core";
|
|
29440
|
+
import { SurveyModel as SurveyModel12 } from "@ixo/surveys";
|
|
29542
29441
|
function parsePrimarySkill2(rawSkill) {
|
|
29543
29442
|
const coerce2 = (candidate) => {
|
|
29544
29443
|
if (!candidate || typeof candidate !== "object") return null;
|
|
@@ -29585,32 +29484,32 @@ ${answersJson}`
|
|
|
29585
29484
|
}
|
|
29586
29485
|
var FormSubmitFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
29587
29486
|
const handlers = useBlocknoteHandlers();
|
|
29588
|
-
const services =
|
|
29589
|
-
const flowNode =
|
|
29590
|
-
const runtimeManager =
|
|
29591
|
-
const ucanService =
|
|
29592
|
-
const invocationStore =
|
|
29593
|
-
const flowId =
|
|
29594
|
-
const flowOwnerDid =
|
|
29595
|
-
const schemaVersion =
|
|
29596
|
-
const flowUri =
|
|
29487
|
+
const services = useMemo110(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
29488
|
+
const flowNode = useMemo110(() => buildFlowNodeFromBlock(block), [block]);
|
|
29489
|
+
const runtimeManager = useMemo110(() => createRuntimeStateManager(editor), [editor]);
|
|
29490
|
+
const ucanService = useMemo110(() => editor?.getUcanService?.() || void 0, [editor]);
|
|
29491
|
+
const invocationStore = useMemo110(() => editor?._invocationStore || void 0, [editor]);
|
|
29492
|
+
const flowId = useMemo110(() => editor?.getFlowMetadata?.()?.doc_id || block.id, [editor, block.id]);
|
|
29493
|
+
const flowOwnerDid = useMemo110(() => editor?.getFlowOwnerDid?.() || "", [editor]);
|
|
29494
|
+
const schemaVersion = useMemo110(() => editor?.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
29495
|
+
const flowUri = useMemo110(() => {
|
|
29597
29496
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
29598
29497
|
return `ixo:flow:${docId}`;
|
|
29599
29498
|
}, [editor, block.id]);
|
|
29600
|
-
const actorDid =
|
|
29499
|
+
const actorDid = useMemo110(() => {
|
|
29601
29500
|
try {
|
|
29602
29501
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
29603
29502
|
} catch {
|
|
29604
29503
|
return "";
|
|
29605
29504
|
}
|
|
29606
29505
|
}, [handlers]);
|
|
29607
|
-
const parsed =
|
|
29506
|
+
const parsed = useMemo110(() => parseFormSubmitActionInputs(inputs), [inputs]);
|
|
29608
29507
|
const editorDocument = editor?.document || [];
|
|
29609
|
-
const resolveOpts =
|
|
29610
|
-
const resolvedSchemaString =
|
|
29611
|
-
const [submitting, setSubmitting] =
|
|
29612
|
-
const [error, setError] =
|
|
29613
|
-
const parsedSchema =
|
|
29508
|
+
const resolveOpts = useMemo110(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
29509
|
+
const resolvedSchemaString = useMemo110(() => resolveReferences(parsed.surveySchema || "", editorDocument, resolveOpts).trim(), [parsed.surveySchema, editorDocument, resolveOpts]);
|
|
29510
|
+
const [submitting, setSubmitting] = useState132(false);
|
|
29511
|
+
const [error, setError] = useState132(null);
|
|
29512
|
+
const parsedSchema = useMemo110(() => {
|
|
29614
29513
|
if (!resolvedSchemaString) return null;
|
|
29615
29514
|
try {
|
|
29616
29515
|
const schema = JSON.parse(resolvedSchemaString);
|
|
@@ -29622,9 +29521,9 @@ var FormSubmitFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
29622
29521
|
}, [resolvedSchemaString]);
|
|
29623
29522
|
const isCompleted = runtime.state === "completed";
|
|
29624
29523
|
const savedAnswers = isCompleted && runtime.output?.answers && typeof runtime.output.answers === "object" ? runtime.output.answers : null;
|
|
29625
|
-
const surveyModel =
|
|
29524
|
+
const surveyModel = useMemo110(() => {
|
|
29626
29525
|
if (!parsedSchema) return null;
|
|
29627
|
-
const model = new
|
|
29526
|
+
const model = new SurveyModel12(parsedSchema);
|
|
29628
29527
|
model.applyTheme(surveyTheme);
|
|
29629
29528
|
model.showQuestionNumbers = "off";
|
|
29630
29529
|
model.questionsOnPageMode = "singlePage";
|
|
@@ -29639,7 +29538,7 @@ var FormSubmitFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
29639
29538
|
}
|
|
29640
29539
|
return model;
|
|
29641
29540
|
}, [parsedSchema, isDisabled, submitting, savedAnswers]);
|
|
29642
|
-
const handleSurveyComplete =
|
|
29541
|
+
const handleSurveyComplete = useCallback109(
|
|
29643
29542
|
async (sender) => {
|
|
29644
29543
|
if (isDisabled || submitting) return;
|
|
29645
29544
|
const actionType = String(block?.props?.actionType || "qi/form.submit");
|
|
@@ -29723,7 +29622,7 @@ var FormSubmitFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
29723
29622
|
},
|
|
29724
29623
|
[actorDid, block, editor, flowId, flowNode, flowOwnerDid, flowUri, handlers, invocationStore, isDisabled, runtimeManager, services, submitting, ucanService, updateRuntime]
|
|
29725
29624
|
);
|
|
29726
|
-
|
|
29625
|
+
useEffect106(() => {
|
|
29727
29626
|
if (!surveyModel) return void 0;
|
|
29728
29627
|
surveyModel.onComplete.add(handleSurveyComplete);
|
|
29729
29628
|
return () => {
|
|
@@ -29731,7 +29630,7 @@ var FormSubmitFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
29731
29630
|
};
|
|
29732
29631
|
}, [surveyModel, handleSurveyComplete]);
|
|
29733
29632
|
const statusMessage = runtime.state === "completed" ? "Last execution completed." : submitting ? "Executing..." : null;
|
|
29734
|
-
return /* @__PURE__ */
|
|
29633
|
+
return /* @__PURE__ */ React282.createElement(Stack199, { gap: "md" }, !resolvedSchemaString ? /* @__PURE__ */ React282.createElement(Alert57, { color: "yellow", styles: actionAlertStyles }, "Configure Survey Schema JSON in template mode before running this action.") : !parsedSchema ? /* @__PURE__ */ React282.createElement(Alert57, { color: "red", styles: actionAlertStyles }, "Survey schema is invalid JSON. Fix it in template mode.") : /* @__PURE__ */ React282.createElement(StableSurvey, { model: surveyModel }), statusMessage && /* @__PURE__ */ React282.createElement(Stack199, { gap: 4 }, submitting && /* @__PURE__ */ React282.createElement(Loader56, { size: "xs" }), /* @__PURE__ */ React282.createElement(Text172, { size: "xs", c: "dimmed" }, statusMessage)), error && /* @__PURE__ */ React282.createElement(Alert57, { color: "red", styles: actionAlertStyles }, error), runtime.error?.message && /* @__PURE__ */ React282.createElement(Alert57, { color: "red", styles: actionAlertStyles }, runtime.error.message));
|
|
29735
29634
|
};
|
|
29736
29635
|
|
|
29737
29636
|
// src/mantine/blocks/action/actionTypes/formSubmit/index.ts
|
|
@@ -29745,8 +29644,8 @@ registerActionTypeUI("qi/human.form.submit", {
|
|
|
29745
29644
|
});
|
|
29746
29645
|
|
|
29747
29646
|
// src/mantine/blocks/action/actionTypes/credentialStore/CredentialStoreConfig.tsx
|
|
29748
|
-
import
|
|
29749
|
-
import { Stack as
|
|
29647
|
+
import React283, { useCallback as useCallback110, useEffect as useEffect107, useState as useState133 } from "react";
|
|
29648
|
+
import { Stack as Stack200, Text as Text173 } from "@mantine/core";
|
|
29750
29649
|
|
|
29751
29650
|
// src/mantine/blocks/action/actionTypes/credentialStore/types.ts
|
|
29752
29651
|
function parseCredentialStoreInputs(json) {
|
|
@@ -29777,11 +29676,11 @@ function serializeCredentialStoreInputs(inputs) {
|
|
|
29777
29676
|
|
|
29778
29677
|
// src/mantine/blocks/action/actionTypes/credentialStore/CredentialStoreConfig.tsx
|
|
29779
29678
|
var CredentialStoreConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
29780
|
-
const [local, setLocal] =
|
|
29781
|
-
|
|
29679
|
+
const [local, setLocal] = useState133(() => parseCredentialStoreInputs(inputs));
|
|
29680
|
+
useEffect107(() => {
|
|
29782
29681
|
setLocal(parseCredentialStoreInputs(inputs));
|
|
29783
29682
|
}, [inputs]);
|
|
29784
|
-
const update =
|
|
29683
|
+
const update = useCallback110(
|
|
29785
29684
|
(patch) => {
|
|
29786
29685
|
const updated = { ...local, ...patch };
|
|
29787
29686
|
setLocal(updated);
|
|
@@ -29789,7 +29688,7 @@ var CredentialStoreConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
29789
29688
|
},
|
|
29790
29689
|
[local, onInputsChange]
|
|
29791
29690
|
);
|
|
29792
|
-
return /* @__PURE__ */
|
|
29691
|
+
return /* @__PURE__ */ React283.createElement(Stack200, { gap: "lg" }, /* @__PURE__ */ React283.createElement(Stack200, { gap: "xs" }, /* @__PURE__ */ React283.createElement(Text173, { size: "sm", c: "neutralColor.7" }, "Credential Key"), /* @__PURE__ */ React283.createElement(
|
|
29793
29692
|
BaseTextInput,
|
|
29794
29693
|
{
|
|
29795
29694
|
placeholder: "e.g. kycamllevel1",
|
|
@@ -29797,7 +29696,7 @@ var CredentialStoreConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
29797
29696
|
value: local.credentialKey,
|
|
29798
29697
|
onChange: (e) => update({ credentialKey: e.currentTarget.value })
|
|
29799
29698
|
}
|
|
29800
|
-
)), /* @__PURE__ */
|
|
29699
|
+
)), /* @__PURE__ */ React283.createElement(Stack200, { gap: "xs" }, /* @__PURE__ */ React283.createElement(Text173, { size: "sm", c: "neutralColor.7" }, "Credential"), /* @__PURE__ */ React283.createElement(
|
|
29801
29700
|
DataInput,
|
|
29802
29701
|
{
|
|
29803
29702
|
placeholder: "Credential JSON or {{blockId.output.credential}}",
|
|
@@ -29807,7 +29706,7 @@ var CredentialStoreConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
29807
29706
|
editorDocument: editor?.document || [],
|
|
29808
29707
|
currentBlockId: blockId
|
|
29809
29708
|
}
|
|
29810
|
-
)), /* @__PURE__ */
|
|
29709
|
+
)), /* @__PURE__ */ React283.createElement(Stack200, { gap: "xs" }, /* @__PURE__ */ React283.createElement(Text173, { size: "sm", c: "neutralColor.7" }, "Room ID (optional)"), /* @__PURE__ */ React283.createElement(
|
|
29811
29710
|
DataInput,
|
|
29812
29711
|
{
|
|
29813
29712
|
placeholder: "Defaults to the actor's room",
|
|
@@ -29821,8 +29720,8 @@ var CredentialStoreConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
29821
29720
|
};
|
|
29822
29721
|
|
|
29823
29722
|
// src/mantine/blocks/action/actionTypes/credentialStore/CredentialStoreFlowDetail.tsx
|
|
29824
|
-
import
|
|
29825
|
-
import { Alert as
|
|
29723
|
+
import React284, { useCallback as useCallback111, useMemo as useMemo111, useState as useState134 } from "react";
|
|
29724
|
+
import { Alert as Alert58, Button as Button59, Code as Code11, Loader as Loader57, Stack as Stack201, Text as Text174 } from "@mantine/core";
|
|
29826
29725
|
import { IconShieldCheck as IconShieldCheck15 } from "@tabler/icons-react";
|
|
29827
29726
|
function safeParse(value) {
|
|
29828
29727
|
let result = value;
|
|
@@ -29837,7 +29736,7 @@ function safeParse(value) {
|
|
|
29837
29736
|
return result;
|
|
29838
29737
|
}
|
|
29839
29738
|
function CredentialPreview({ value }) {
|
|
29840
|
-
const display =
|
|
29739
|
+
const display = useMemo111(() => {
|
|
29841
29740
|
if (!value) return null;
|
|
29842
29741
|
const parsed = safeParse(value);
|
|
29843
29742
|
if (parsed && typeof parsed === "object") {
|
|
@@ -29846,44 +29745,44 @@ function CredentialPreview({ value }) {
|
|
|
29846
29745
|
return value;
|
|
29847
29746
|
}, [value]);
|
|
29848
29747
|
if (!display) return null;
|
|
29849
|
-
return /* @__PURE__ */
|
|
29748
|
+
return /* @__PURE__ */ React284.createElement(React284.Fragment, null, /* @__PURE__ */ React284.createElement(Text174, { size: "xs", fw: 600, c: "dimmed" }, "Credential"), /* @__PURE__ */ React284.createElement(Code11, { block: true, style: { fontSize: "11px", maxHeight: "200px", overflow: "auto" } }, display));
|
|
29850
29749
|
}
|
|
29851
29750
|
var CredentialStoreFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
29852
29751
|
const handlers = useBlocknoteHandlers();
|
|
29853
|
-
const services =
|
|
29854
|
-
const flowNode =
|
|
29855
|
-
const runtimeManager =
|
|
29856
|
-
const ucanService =
|
|
29857
|
-
const invocationStore =
|
|
29858
|
-
const flowId =
|
|
29859
|
-
const flowOwnerDid =
|
|
29860
|
-
const schemaVersion =
|
|
29861
|
-
const flowUri =
|
|
29752
|
+
const services = useMemo111(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
29753
|
+
const flowNode = useMemo111(() => buildFlowNodeFromBlock(block), [block]);
|
|
29754
|
+
const runtimeManager = useMemo111(() => createRuntimeStateManager(editor), [editor]);
|
|
29755
|
+
const ucanService = useMemo111(() => editor?.getUcanService?.() || void 0, [editor]);
|
|
29756
|
+
const invocationStore = useMemo111(() => editor?._invocationStore || void 0, [editor]);
|
|
29757
|
+
const flowId = useMemo111(() => editor?.getFlowMetadata?.()?.doc_id || block.id, [editor, block.id]);
|
|
29758
|
+
const flowOwnerDid = useMemo111(() => editor?.getFlowOwnerDid?.() || "", [editor]);
|
|
29759
|
+
const schemaVersion = useMemo111(() => editor?.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
29760
|
+
const flowUri = useMemo111(() => {
|
|
29862
29761
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
29863
29762
|
return `ixo:flow:${docId}`;
|
|
29864
29763
|
}, [editor, block.id]);
|
|
29865
|
-
const actorDid =
|
|
29764
|
+
const actorDid = useMemo111(() => {
|
|
29866
29765
|
try {
|
|
29867
29766
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
29868
29767
|
} catch {
|
|
29869
29768
|
return "";
|
|
29870
29769
|
}
|
|
29871
29770
|
}, [handlers]);
|
|
29872
|
-
const parsed =
|
|
29771
|
+
const parsed = useMemo111(() => parseCredentialStoreInputs(inputs), [inputs]);
|
|
29873
29772
|
const editorDocument = editor?.document || [];
|
|
29874
|
-
const resolveOpts =
|
|
29875
|
-
const resolvedCredentialKey =
|
|
29773
|
+
const resolveOpts = useMemo111(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
29774
|
+
const resolvedCredentialKey = useMemo111(
|
|
29876
29775
|
() => resolveReferences(parsed.credentialKey || "", editorDocument, resolveOpts).trim(),
|
|
29877
29776
|
[parsed.credentialKey, editorDocument, resolveOpts]
|
|
29878
29777
|
);
|
|
29879
|
-
const resolvedCredential =
|
|
29880
|
-
const resolvedRoomId =
|
|
29881
|
-
const [submitting, setSubmitting] =
|
|
29882
|
-
const [error, setError] =
|
|
29778
|
+
const resolvedCredential = useMemo111(() => resolveReferences(parsed.credential || "", editorDocument, resolveOpts).trim(), [parsed.credential, editorDocument, resolveOpts]);
|
|
29779
|
+
const resolvedRoomId = useMemo111(() => resolveReferences(parsed.roomId || "", editorDocument, resolveOpts).trim(), [parsed.roomId, editorDocument, resolveOpts]);
|
|
29780
|
+
const [submitting, setSubmitting] = useState134(false);
|
|
29781
|
+
const [error, setError] = useState134(null);
|
|
29883
29782
|
const hasCredential = !!resolvedCredential;
|
|
29884
29783
|
const hasKey = !!resolvedCredentialKey;
|
|
29885
29784
|
const isCompleted = runtime.state === "completed";
|
|
29886
|
-
const handleExecute =
|
|
29785
|
+
const handleExecute = useCallback111(async () => {
|
|
29887
29786
|
if (isDisabled || submitting) return;
|
|
29888
29787
|
const actionDef = getAction("qi/credential.store");
|
|
29889
29788
|
if (!actionDef) {
|
|
@@ -29972,7 +29871,7 @@ var CredentialStoreFlowDetail = ({ inputs, editor, block, runtime, updateRuntime
|
|
|
29972
29871
|
ucanService,
|
|
29973
29872
|
updateRuntime
|
|
29974
29873
|
]);
|
|
29975
|
-
return /* @__PURE__ */
|
|
29874
|
+
return /* @__PURE__ */ React284.createElement(Stack201, { gap: "md" }, !hasKey && /* @__PURE__ */ React284.createElement(Alert58, { color: "yellow", styles: actionAlertStyles }, "No credential key configured. Set one in template mode."), hasKey && !hasCredential && !isCompleted && /* @__PURE__ */ React284.createElement(Alert58, { color: "yellow", styles: actionAlertStyles }, "Waiting for credential data. It will be provided by a block reference or at execution time."), hasKey && hasCredential && !isCompleted && /* @__PURE__ */ React284.createElement(Stack201, { gap: "xs" }, /* @__PURE__ */ React284.createElement(Text174, { size: "xs", c: "dimmed" }, "Credential key: ", resolvedCredentialKey), /* @__PURE__ */ React284.createElement(CredentialPreview, { value: resolvedCredential }), /* @__PURE__ */ React284.createElement(Button59, { leftSection: submitting ? /* @__PURE__ */ React284.createElement(Loader57, { size: 14 }) : /* @__PURE__ */ React284.createElement(IconShieldCheck15, { size: 14 }), onClick: handleExecute, disabled: isDisabled || submitting, size: "sm" }, submitting ? "Storing..." : "Store Credential")), isCompleted && /* @__PURE__ */ React284.createElement(Alert58, { color: runtime.output?.duplicate ? "yellow" : "green", styles: actionAlertStyles }, runtime.output?.duplicate ? `Credential already stored under key "${runtime.output?.credentialKey || resolvedCredentialKey}" (duplicate).` : `Credential stored successfully under key "${runtime.output?.credentialKey || resolvedCredentialKey}".`), error && /* @__PURE__ */ React284.createElement(Alert58, { color: "red", styles: actionAlertStyles }, error), runtime.error?.message && !error && /* @__PURE__ */ React284.createElement(Alert58, { color: "red", styles: actionAlertStyles }, runtime.error.message));
|
|
29976
29875
|
};
|
|
29977
29876
|
|
|
29978
29877
|
// src/mantine/blocks/action/actionTypes/credentialStore/index.ts
|
|
@@ -29982,8 +29881,8 @@ registerActionTypeUI("qi/credential.store", {
|
|
|
29982
29881
|
});
|
|
29983
29882
|
|
|
29984
29883
|
// src/mantine/blocks/action/actionTypes/payment/PaymentConfig.tsx
|
|
29985
|
-
import
|
|
29986
|
-
import { Stack as
|
|
29884
|
+
import React285, { useCallback as useCallback112, useEffect as useEffect108, useState as useState135 } from "react";
|
|
29885
|
+
import { Stack as Stack202, Text as Text175 } from "@mantine/core";
|
|
29987
29886
|
|
|
29988
29887
|
// src/mantine/blocks/action/actionTypes/payment/types.ts
|
|
29989
29888
|
function parsePaymentInputs(json) {
|
|
@@ -30016,13 +29915,13 @@ function isValidPaymentConfig(value) {
|
|
|
30016
29915
|
|
|
30017
29916
|
// src/mantine/blocks/action/actionTypes/payment/PaymentConfig.tsx
|
|
30018
29917
|
var PaymentConfig = ({ inputs, onInputsChange }) => {
|
|
30019
|
-
const [localConfig, setLocalConfig] =
|
|
30020
|
-
const [error, setError] =
|
|
30021
|
-
|
|
29918
|
+
const [localConfig, setLocalConfig] = useState135(() => parsePaymentInputs(inputs).paymentConfig);
|
|
29919
|
+
const [error, setError] = useState135(null);
|
|
29920
|
+
useEffect108(() => {
|
|
30022
29921
|
setLocalConfig(parsePaymentInputs(inputs).paymentConfig);
|
|
30023
29922
|
setError(null);
|
|
30024
29923
|
}, [inputs]);
|
|
30025
|
-
const handleChange =
|
|
29924
|
+
const handleChange = useCallback112(
|
|
30026
29925
|
(value) => {
|
|
30027
29926
|
setLocalConfig(value);
|
|
30028
29927
|
setError(null);
|
|
@@ -30038,7 +29937,7 @@ var PaymentConfig = ({ inputs, onInputsChange }) => {
|
|
|
30038
29937
|
},
|
|
30039
29938
|
[onInputsChange]
|
|
30040
29939
|
);
|
|
30041
|
-
return /* @__PURE__ */
|
|
29940
|
+
return /* @__PURE__ */ React285.createElement(Stack202, { gap: "xs" }, /* @__PURE__ */ React285.createElement(
|
|
30042
29941
|
BaseTextArea,
|
|
30043
29942
|
{
|
|
30044
29943
|
label: "Payment Configuration (JSON)",
|
|
@@ -30049,12 +29948,12 @@ var PaymentConfig = ({ inputs, onInputsChange }) => {
|
|
|
30049
29948
|
onChange: (event) => handleChange(event.currentTarget.value),
|
|
30050
29949
|
error
|
|
30051
29950
|
}
|
|
30052
|
-
), localConfig && !error && /* @__PURE__ */
|
|
29951
|
+
), localConfig && !error && /* @__PURE__ */ React285.createElement(Text175, { size: "xs", c: "green" }, "Valid JSON"));
|
|
30053
29952
|
};
|
|
30054
29953
|
|
|
30055
29954
|
// src/mantine/blocks/action/actionTypes/payment/PaymentFlowDetail.tsx
|
|
30056
|
-
import
|
|
30057
|
-
import { Alert as
|
|
29955
|
+
import React286, { useCallback as useCallback113, useMemo as useMemo112, useState as useState136 } from "react";
|
|
29956
|
+
import { Alert as Alert59, Button as Button60, Code as Code12, Divider as Divider25, Group as Group108, Loader as Loader58, Stack as Stack203, Text as Text176 } from "@mantine/core";
|
|
30058
29957
|
import { IconAlertTriangle as IconAlertTriangle6, IconCash as IconCash2, IconSearch as IconSearch8, IconSend as IconSend7 } from "@tabler/icons-react";
|
|
30059
29958
|
function parsePrimarySkill3(rawSkill) {
|
|
30060
29959
|
const coerce2 = (candidate) => {
|
|
@@ -30129,32 +30028,32 @@ function getPaymentStatusColor(status) {
|
|
|
30129
30028
|
}
|
|
30130
30029
|
var PaymentFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
30131
30030
|
const handlers = useBlocknoteHandlers();
|
|
30132
|
-
const services =
|
|
30133
|
-
const flowNode =
|
|
30134
|
-
const runtimeManager =
|
|
30135
|
-
const ucanService =
|
|
30136
|
-
const invocationStore =
|
|
30137
|
-
const flowId =
|
|
30138
|
-
const flowOwnerDid =
|
|
30139
|
-
const schemaVersion =
|
|
30140
|
-
const flowUri =
|
|
30031
|
+
const services = useMemo112(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
30032
|
+
const flowNode = useMemo112(() => buildFlowNodeFromBlock(block), [block]);
|
|
30033
|
+
const runtimeManager = useMemo112(() => createRuntimeStateManager(editor), [editor]);
|
|
30034
|
+
const ucanService = useMemo112(() => editor?.getUcanService?.() || void 0, [editor]);
|
|
30035
|
+
const invocationStore = useMemo112(() => editor?._invocationStore || void 0, [editor]);
|
|
30036
|
+
const flowId = useMemo112(() => editor?.getFlowMetadata?.()?.doc_id || block.id, [editor, block.id]);
|
|
30037
|
+
const flowOwnerDid = useMemo112(() => editor?.getFlowOwnerDid?.() || "", [editor]);
|
|
30038
|
+
const schemaVersion = useMemo112(() => editor?.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
30039
|
+
const flowUri = useMemo112(() => {
|
|
30141
30040
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
30142
30041
|
return `ixo:flow:${docId}`;
|
|
30143
30042
|
}, [editor, block.id]);
|
|
30144
|
-
const actorDid =
|
|
30043
|
+
const actorDid = useMemo112(() => {
|
|
30145
30044
|
try {
|
|
30146
30045
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
30147
30046
|
} catch {
|
|
30148
30047
|
return "";
|
|
30149
30048
|
}
|
|
30150
30049
|
}, [handlers]);
|
|
30151
|
-
const parsed =
|
|
30152
|
-
const [submitting, setSubmitting] =
|
|
30153
|
-
const [error, setError] =
|
|
30050
|
+
const parsed = useMemo112(() => parsePaymentInputs(inputs), [inputs]);
|
|
30051
|
+
const [submitting, setSubmitting] = useState136(false);
|
|
30052
|
+
const [error, setError] = useState136(null);
|
|
30154
30053
|
const paymentStatus = block.props.paymentStatus || "";
|
|
30155
30054
|
const transactionId = block.props.transactionId || "";
|
|
30156
30055
|
const paymentError = block.props.paymentError || "";
|
|
30157
|
-
const proposal =
|
|
30056
|
+
const proposal = useMemo112(() => {
|
|
30158
30057
|
const raw = block.props.paymentProposal;
|
|
30159
30058
|
if (!raw) return null;
|
|
30160
30059
|
try {
|
|
@@ -30163,7 +30062,7 @@ var PaymentFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisa
|
|
|
30163
30062
|
return null;
|
|
30164
30063
|
}
|
|
30165
30064
|
}, [block.props.paymentProposal]);
|
|
30166
|
-
const summary =
|
|
30065
|
+
const summary = useMemo112(() => {
|
|
30167
30066
|
const raw = block.props.paymentSummary;
|
|
30168
30067
|
if (!raw) return null;
|
|
30169
30068
|
try {
|
|
@@ -30172,7 +30071,7 @@ var PaymentFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisa
|
|
|
30172
30071
|
return null;
|
|
30173
30072
|
}
|
|
30174
30073
|
}, [block.props.paymentSummary]);
|
|
30175
|
-
const paymentConfig =
|
|
30074
|
+
const paymentConfig = useMemo112(() => {
|
|
30176
30075
|
if (!parsed.paymentConfig) return null;
|
|
30177
30076
|
try {
|
|
30178
30077
|
return JSON.parse(parsed.paymentConfig);
|
|
@@ -30180,7 +30079,7 @@ var PaymentFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisa
|
|
|
30180
30079
|
return null;
|
|
30181
30080
|
}
|
|
30182
30081
|
}, [parsed.paymentConfig]);
|
|
30183
|
-
const handlePropose =
|
|
30082
|
+
const handlePropose = useCallback113(async () => {
|
|
30184
30083
|
if (isDisabled || submitting) return;
|
|
30185
30084
|
const skill = parsePrimarySkill3(block?.props?.skill);
|
|
30186
30085
|
if (!skill) {
|
|
@@ -30213,7 +30112,7 @@ var PaymentFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisa
|
|
|
30213
30112
|
setSubmitting(false);
|
|
30214
30113
|
}
|
|
30215
30114
|
}, [isDisabled, submitting, block, handlers, paymentConfig]);
|
|
30216
|
-
const handleExecute =
|
|
30115
|
+
const handleExecute = useCallback113(async () => {
|
|
30217
30116
|
if (isDisabled || submitting) return;
|
|
30218
30117
|
const skill = parsePrimarySkill3(block?.props?.skill);
|
|
30219
30118
|
if (!skill) {
|
|
@@ -30302,7 +30201,7 @@ var PaymentFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisa
|
|
|
30302
30201
|
const isProposed = paymentStatus === "proposed" || !!proposal;
|
|
30303
30202
|
const isSubmitted = paymentStatus === "submitted" || paymentStatus === "pending" || paymentStatus === "processing";
|
|
30304
30203
|
const isTerminal = paymentStatus === "completed" || paymentStatus === "failed";
|
|
30305
|
-
const handleCheckStatus =
|
|
30204
|
+
const handleCheckStatus = useCallback113(async () => {
|
|
30306
30205
|
if (isDisabled || submitting) return;
|
|
30307
30206
|
const skill = parsePrimarySkill3(block?.props?.skill);
|
|
30308
30207
|
if (!skill) {
|
|
@@ -30330,40 +30229,40 @@ var PaymentFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisa
|
|
|
30330
30229
|
setSubmitting(false);
|
|
30331
30230
|
}
|
|
30332
30231
|
}, [isDisabled, submitting, block, handlers, transactionId]);
|
|
30333
|
-
return /* @__PURE__ */
|
|
30334
|
-
|
|
30232
|
+
return /* @__PURE__ */ React286.createElement(Stack203, { gap: "md" }, paymentConfig && !isProposed && !isTerminal && /* @__PURE__ */ React286.createElement(React286.Fragment, null, /* @__PURE__ */ React286.createElement(Text176, { size: "xs", fw: 600, c: "dimmed" }, "Payment Configuration"), /* @__PURE__ */ React286.createElement(Code12, { block: true, style: { fontSize: "11px", maxHeight: "200px", overflow: "auto" } }, JSON.stringify(paymentConfig, null, 2))), summary && /* @__PURE__ */ React286.createElement(React286.Fragment, null, /* @__PURE__ */ React286.createElement(Divider25, null), /* @__PURE__ */ React286.createElement(Text176, { size: "xs", fw: 600, c: "dimmed" }, "Payout Proposal"), /* @__PURE__ */ React286.createElement(Stack203, { gap: 4, style: { background: "var(--mantine-color-neutralColor-4)", borderRadius: 8, padding: 12 } }, Object.entries(summary).map(([key, value]) => /* @__PURE__ */ React286.createElement(Group108, { key, justify: "space-between", wrap: "nowrap" }, /* @__PURE__ */ React286.createElement(Text176, { size: "xs", c: "dimmed", style: { textTransform: "capitalize" } }, key.replace(/_/g, " ")), /* @__PURE__ */ React286.createElement(Text176, { size: "xs", fw: 500, c: "var(--mantine-color-text)", style: { textAlign: "right", wordBreak: "break-all" } }, typeof value === "object" ? JSON.stringify(value) : String(value)))))), paymentStatus && /* @__PURE__ */ React286.createElement(React286.Fragment, null, /* @__PURE__ */ React286.createElement(Divider25, null), /* @__PURE__ */ React286.createElement(Group108, { justify: "space-between" }, /* @__PURE__ */ React286.createElement(Text176, { size: "xs", fw: 600, c: "dimmed" }, "Status"), /* @__PURE__ */ React286.createElement(Text176, { size: "sm", fw: 600, c: getPaymentStatusColor(paymentStatus), style: { textTransform: "capitalize" } }, paymentStatus))), transactionId && /* @__PURE__ */ React286.createElement(Group108, { justify: "space-between" }, /* @__PURE__ */ React286.createElement(Text176, { size: "xs", fw: 600, c: "dimmed" }, "Transaction ID"), /* @__PURE__ */ React286.createElement(Text176, { size: "xs", c: "var(--mantine-color-text)", style: { fontFamily: "monospace" } }, transactionId)), !isTerminal && /* @__PURE__ */ React286.createElement(React286.Fragment, null, /* @__PURE__ */ React286.createElement(Divider25, null), isSubmitted ? /* @__PURE__ */ React286.createElement(
|
|
30233
|
+
Button60,
|
|
30335
30234
|
{
|
|
30336
30235
|
fullWidth: true,
|
|
30337
30236
|
variant: "light",
|
|
30338
30237
|
color: "blue",
|
|
30339
|
-
leftSection: submitting ? /* @__PURE__ */
|
|
30238
|
+
leftSection: submitting ? /* @__PURE__ */ React286.createElement(Loader58, { size: 14 }) : /* @__PURE__ */ React286.createElement(IconSearch8, { size: 14 }),
|
|
30340
30239
|
onClick: handleCheckStatus,
|
|
30341
30240
|
disabled: isDisabled || submitting
|
|
30342
30241
|
},
|
|
30343
30242
|
submitting ? "Checking..." : "Check Status"
|
|
30344
|
-
) : !isProposed ? /* @__PURE__ */
|
|
30345
|
-
|
|
30243
|
+
) : !isProposed ? /* @__PURE__ */ React286.createElement(
|
|
30244
|
+
Button60,
|
|
30346
30245
|
{
|
|
30347
30246
|
fullWidth: true,
|
|
30348
30247
|
variant: "light",
|
|
30349
30248
|
color: "violet",
|
|
30350
|
-
leftSection: submitting ? /* @__PURE__ */
|
|
30249
|
+
leftSection: submitting ? /* @__PURE__ */ React286.createElement(Loader58, { size: 14 }) : /* @__PURE__ */ React286.createElement(IconCash2, { size: 14 }),
|
|
30351
30250
|
onClick: handlePropose,
|
|
30352
30251
|
disabled: isDisabled || submitting || !paymentConfig
|
|
30353
30252
|
},
|
|
30354
30253
|
submitting ? "Requesting..." : "Calculate Payout"
|
|
30355
|
-
) : /* @__PURE__ */
|
|
30356
|
-
|
|
30254
|
+
) : /* @__PURE__ */ React286.createElement(
|
|
30255
|
+
Button60,
|
|
30357
30256
|
{
|
|
30358
30257
|
fullWidth: true,
|
|
30359
30258
|
variant: "light",
|
|
30360
30259
|
color: "green",
|
|
30361
|
-
leftSection: submitting ? /* @__PURE__ */
|
|
30260
|
+
leftSection: submitting ? /* @__PURE__ */ React286.createElement(Loader58, { size: 14 }) : /* @__PURE__ */ React286.createElement(IconSend7, { size: 14 }),
|
|
30362
30261
|
onClick: handleExecute,
|
|
30363
30262
|
disabled: isDisabled || submitting
|
|
30364
30263
|
},
|
|
30365
30264
|
submitting ? "Executing..." : "Execute Payout"
|
|
30366
|
-
)), paymentError && /* @__PURE__ */
|
|
30265
|
+
)), paymentError && /* @__PURE__ */ React286.createElement(Alert59, { icon: /* @__PURE__ */ React286.createElement(IconAlertTriangle6, { size: 16 }), title: "Payment Error", color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React286.createElement(Text176, { size: "xs" }, paymentError)), error && /* @__PURE__ */ React286.createElement(Alert59, { icon: /* @__PURE__ */ React286.createElement(IconAlertTriangle6, { size: 16 }), color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React286.createElement(Text176, { size: "xs" }, error)), runtime.error?.message && /* @__PURE__ */ React286.createElement(Alert59, { icon: /* @__PURE__ */ React286.createElement(IconAlertTriangle6, { size: 16 }), color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React286.createElement(Text176, { size: "xs" }, runtime.error.message)), proposal && /* @__PURE__ */ React286.createElement(React286.Fragment, null, /* @__PURE__ */ React286.createElement(Divider25, null), /* @__PURE__ */ React286.createElement(Text176, { size: "xs", fw: 600, c: "dimmed" }, "Proposal Detail"), /* @__PURE__ */ React286.createElement(Code12, { block: true, style: { fontSize: "11px", maxHeight: "200px", overflow: "auto" } }, JSON.stringify(proposal, null, 2))));
|
|
30367
30266
|
};
|
|
30368
30267
|
|
|
30369
30268
|
// src/mantine/blocks/action/actionTypes/payment/index.ts
|
|
@@ -30373,8 +30272,8 @@ registerActionTypeUI("qi/payment.execute", {
|
|
|
30373
30272
|
});
|
|
30374
30273
|
|
|
30375
30274
|
// src/mantine/blocks/action/actionTypes/matrixDm/MatrixDmConfig.tsx
|
|
30376
|
-
import
|
|
30377
|
-
import { Flex as Flex35, Stack as
|
|
30275
|
+
import React287, { useCallback as useCallback114, useEffect as useEffect109, useMemo as useMemo113, useState as useState137 } from "react";
|
|
30276
|
+
import { Flex as Flex35, Stack as Stack204, Text as Text177 } from "@mantine/core";
|
|
30378
30277
|
|
|
30379
30278
|
// src/mantine/blocks/action/actionTypes/matrixDm/types.ts
|
|
30380
30279
|
function parseMatrixDmInputs(json) {
|
|
@@ -30398,15 +30297,15 @@ function serializeMatrixDmInputs(inputs) {
|
|
|
30398
30297
|
// src/mantine/blocks/action/actionTypes/matrixDm/MatrixDmConfig.tsx
|
|
30399
30298
|
var MatrixDmConfig = ({ inputs, onInputsChange, editor }) => {
|
|
30400
30299
|
const handlers = useBlocknoteHandlers();
|
|
30401
|
-
const [local, setLocal] =
|
|
30402
|
-
const [roomMembers, setRoomMembers] =
|
|
30403
|
-
const [searchValue, setSearchValue] =
|
|
30300
|
+
const [local, setLocal] = useState137(() => parseMatrixDmInputs(inputs));
|
|
30301
|
+
const [roomMembers, setRoomMembers] = useState137([]);
|
|
30302
|
+
const [searchValue, setSearchValue] = useState137("");
|
|
30404
30303
|
const roomId = editor?.getRoomId?.() || null;
|
|
30405
30304
|
const mx = editor?.getMatrixClient?.() || null;
|
|
30406
|
-
|
|
30305
|
+
useEffect109(() => {
|
|
30407
30306
|
setLocal(parseMatrixDmInputs(inputs));
|
|
30408
30307
|
}, [inputs]);
|
|
30409
|
-
|
|
30308
|
+
useEffect109(() => {
|
|
30410
30309
|
(async () => {
|
|
30411
30310
|
if (!roomId || !mx) return;
|
|
30412
30311
|
try {
|
|
@@ -30417,7 +30316,7 @@ var MatrixDmConfig = ({ inputs, onInputsChange, editor }) => {
|
|
|
30417
30316
|
}
|
|
30418
30317
|
})();
|
|
30419
30318
|
}, [roomId, mx]);
|
|
30420
|
-
const update =
|
|
30319
|
+
const update = useCallback114(
|
|
30421
30320
|
(patch) => {
|
|
30422
30321
|
const updated = { ...local, ...patch };
|
|
30423
30322
|
setLocal(updated);
|
|
@@ -30425,13 +30324,13 @@ var MatrixDmConfig = ({ inputs, onInputsChange, editor }) => {
|
|
|
30425
30324
|
},
|
|
30426
30325
|
[local, onInputsChange]
|
|
30427
30326
|
);
|
|
30428
|
-
const selectData =
|
|
30327
|
+
const selectData = useMemo113(() => {
|
|
30429
30328
|
return roomMembers.map((member) => ({
|
|
30430
30329
|
value: member.did,
|
|
30431
30330
|
label: member.name || member.did
|
|
30432
30331
|
}));
|
|
30433
30332
|
}, [roomMembers]);
|
|
30434
|
-
const memberLookup =
|
|
30333
|
+
const memberLookup = useMemo113(() => {
|
|
30435
30334
|
const lookup = {};
|
|
30436
30335
|
roomMembers.forEach((member) => {
|
|
30437
30336
|
lookup[member.did] = member;
|
|
@@ -30439,7 +30338,7 @@ var MatrixDmConfig = ({ inputs, onInputsChange, editor }) => {
|
|
|
30439
30338
|
return lookup;
|
|
30440
30339
|
}, [roomMembers]);
|
|
30441
30340
|
const selectedMember = local.targetDid ? memberLookup[local.targetDid] : void 0;
|
|
30442
|
-
return /* @__PURE__ */
|
|
30341
|
+
return /* @__PURE__ */ React287.createElement(Stack204, { gap: "md" }, /* @__PURE__ */ React287.createElement(
|
|
30443
30342
|
BaseSelect,
|
|
30444
30343
|
{
|
|
30445
30344
|
label: "Recipient",
|
|
@@ -30455,12 +30354,12 @@ var MatrixDmConfig = ({ inputs, onInputsChange, editor }) => {
|
|
|
30455
30354
|
required: true,
|
|
30456
30355
|
renderOption: ({ option, checked }) => {
|
|
30457
30356
|
const member = memberLookup[option.value];
|
|
30458
|
-
if (!member) return /* @__PURE__ */
|
|
30459
|
-
return /* @__PURE__ */
|
|
30357
|
+
if (!member) return /* @__PURE__ */ React287.createElement(Text177, { size: "sm" }, option.label);
|
|
30358
|
+
return /* @__PURE__ */ React287.createElement(Flex35, { align: "center", gap: "sm" }, /* @__PURE__ */ React287.createElement(BaseAvatar, { src: member.src, did: member.did, size: 24 }), /* @__PURE__ */ React287.createElement(Text177, { size: "sm", c: checked ? "accent" : void 0 }, option.label));
|
|
30460
30359
|
},
|
|
30461
|
-
leftSection: selectedMember ? /* @__PURE__ */
|
|
30360
|
+
leftSection: selectedMember ? /* @__PURE__ */ React287.createElement(BaseAvatar, { src: selectedMember.src, did: selectedMember.did, size: 20, withCenter: true }) : null
|
|
30462
30361
|
}
|
|
30463
|
-
), /* @__PURE__ */
|
|
30362
|
+
), /* @__PURE__ */ React287.createElement(
|
|
30464
30363
|
BaseTextArea,
|
|
30465
30364
|
{
|
|
30466
30365
|
label: "Message",
|
|
@@ -30484,7 +30383,7 @@ function ActionBlock({ editor, block }) {
|
|
|
30484
30383
|
const { docType } = useBlocknoteContext();
|
|
30485
30384
|
const { actions } = useBlockConditions(block, editor);
|
|
30486
30385
|
if (docType === "template") {
|
|
30487
|
-
return /* @__PURE__ */
|
|
30386
|
+
return /* @__PURE__ */ React288.createElement(ActionTemplateView, { editor, block });
|
|
30488
30387
|
}
|
|
30489
30388
|
const conditionConfig = parseConditionConfig(block.props.conditions);
|
|
30490
30389
|
const hasVisibility = hasVisibilityConditions(conditionConfig);
|
|
@@ -30495,7 +30394,7 @@ function ActionBlock({ editor, block }) {
|
|
|
30495
30394
|
const hasEnable = hasEnableConditions(conditionConfig);
|
|
30496
30395
|
const enableActionExists = actions.some((a) => a.action === "enable");
|
|
30497
30396
|
const shouldDisable = hasEnable && !enableActionExists;
|
|
30498
|
-
return /* @__PURE__ */
|
|
30397
|
+
return /* @__PURE__ */ React288.createElement(
|
|
30499
30398
|
ActionFlowView,
|
|
30500
30399
|
{
|
|
30501
30400
|
block,
|
|
@@ -30546,7 +30445,7 @@ var ActionBlockSpec = createReactBlockSpec20(
|
|
|
30546
30445
|
// Trigger mode (compiled from cap.trigger.type by the compiler).
|
|
30547
30446
|
// Used by the flow runtime UI to suppress manual run affordances on
|
|
30548
30447
|
// event-driven blocks — they only fire via pending invocations.
|
|
30549
|
-
// Values: 'manual' | 'flow.start' | 'block.event'. Default 'manual'.
|
|
30448
|
+
// Values: 'manual' | 'flow.start' | 'block.event' | 'block.event.all'. Default 'manual'.
|
|
30550
30449
|
triggerMode: { default: "manual" },
|
|
30551
30450
|
assignment: {
|
|
30552
30451
|
default: JSON.stringify({
|
|
@@ -30574,36 +30473,36 @@ var ActionBlockSpec = createReactBlockSpec20(
|
|
|
30574
30473
|
{
|
|
30575
30474
|
render: (props) => {
|
|
30576
30475
|
const ixoProps = props;
|
|
30577
|
-
return /* @__PURE__ */
|
|
30476
|
+
return /* @__PURE__ */ React289.createElement(ActionBlock, { ...ixoProps });
|
|
30578
30477
|
}
|
|
30579
30478
|
}
|
|
30580
30479
|
);
|
|
30581
30480
|
|
|
30582
30481
|
// src/mantine/blocks/location/LocationBlockSpec.tsx
|
|
30583
|
-
import
|
|
30482
|
+
import React298 from "react";
|
|
30584
30483
|
import { createReactBlockSpec as createReactBlockSpec21 } from "@blocknote/react";
|
|
30585
30484
|
|
|
30586
30485
|
// src/mantine/blocks/location/LocationBlock.tsx
|
|
30587
|
-
import
|
|
30486
|
+
import React297 from "react";
|
|
30588
30487
|
|
|
30589
30488
|
// src/mantine/blocks/location/template/TemplateView.tsx
|
|
30590
|
-
import
|
|
30591
|
-
import { Group as
|
|
30489
|
+
import React294, { useMemo as useMemo114 } from "react";
|
|
30490
|
+
import { Group as Group110, Stack as Stack206, Text as Text180 } from "@mantine/core";
|
|
30592
30491
|
import { IconMapPin } from "@tabler/icons-react";
|
|
30593
30492
|
|
|
30594
30493
|
// src/mantine/blocks/location/template/TemplateConfig.tsx
|
|
30595
|
-
import
|
|
30494
|
+
import React292, { useCallback as useCallback116 } from "react";
|
|
30596
30495
|
import { IconSettings as IconSettings19 } from "@tabler/icons-react";
|
|
30597
30496
|
|
|
30598
30497
|
// src/mantine/blocks/location/template/GeneralTab.tsx
|
|
30599
|
-
import
|
|
30600
|
-
import { Box as Box62, Divider as
|
|
30498
|
+
import React291, { useEffect as useEffect111, useRef as useRef26, useState as useState140 } from "react";
|
|
30499
|
+
import { Box as Box62, Divider as Divider26, Stack as Stack205, Text as Text178 } from "@mantine/core";
|
|
30601
30500
|
|
|
30602
30501
|
// src/core/hooks/useUnlMap.ts
|
|
30603
|
-
import { useEffect as
|
|
30502
|
+
import { useEffect as useEffect110, useState as useState138 } from "react";
|
|
30604
30503
|
function useUnlMap() {
|
|
30605
|
-
const [status, setStatus] =
|
|
30606
|
-
|
|
30504
|
+
const [status, setStatus] = useState138("loading");
|
|
30505
|
+
useEffect110(() => {
|
|
30607
30506
|
if (typeof window === "undefined") {
|
|
30608
30507
|
return;
|
|
30609
30508
|
}
|
|
@@ -30658,8 +30557,8 @@ function useUnlMap() {
|
|
|
30658
30557
|
}
|
|
30659
30558
|
|
|
30660
30559
|
// src/mantine/blocks/location/components/TileSelector.tsx
|
|
30661
|
-
import
|
|
30662
|
-
import { ActionIcon as ActionIcon41, Group as
|
|
30560
|
+
import React290, { useState as useState139, useCallback as useCallback115 } from "react";
|
|
30561
|
+
import { ActionIcon as ActionIcon41, Group as Group109, Tooltip as Tooltip26 } from "@mantine/core";
|
|
30663
30562
|
import { IconMap, IconMoon, IconSatellite, IconMountain } from "@tabler/icons-react";
|
|
30664
30563
|
var TILE_LAYERS = {
|
|
30665
30564
|
dark: {
|
|
@@ -30711,8 +30610,8 @@ function ensureLayer(map, config) {
|
|
|
30711
30610
|
);
|
|
30712
30611
|
}
|
|
30713
30612
|
var TileSelector = ({ mapRef }) => {
|
|
30714
|
-
const [active, setActive] =
|
|
30715
|
-
const switchTo =
|
|
30613
|
+
const [active, setActive] = useState139("map");
|
|
30614
|
+
const switchTo = useCallback115(
|
|
30716
30615
|
(type) => {
|
|
30717
30616
|
const map = mapRef.current;
|
|
30718
30617
|
if (!map || active === type) return;
|
|
@@ -30730,11 +30629,11 @@ var TileSelector = ({ mapRef }) => {
|
|
|
30730
30629
|
[mapRef, active]
|
|
30731
30630
|
);
|
|
30732
30631
|
const items = [
|
|
30733
|
-
{ type: "map", label: "Map", icon: /* @__PURE__ */
|
|
30632
|
+
{ type: "map", label: "Map", icon: /* @__PURE__ */ React290.createElement(IconMap, { size: 14 }) },
|
|
30734
30633
|
...OVERLAY_KEYS.map((key) => ({ type: key, label: TILE_LAYERS[key].label, icon: TILE_LAYERS[key].icon }))
|
|
30735
30634
|
];
|
|
30736
|
-
return /* @__PURE__ */
|
|
30737
|
-
|
|
30635
|
+
return /* @__PURE__ */ React290.createElement(
|
|
30636
|
+
Group109,
|
|
30738
30637
|
{
|
|
30739
30638
|
gap: 2,
|
|
30740
30639
|
style: {
|
|
@@ -30747,7 +30646,7 @@ var TileSelector = ({ mapRef }) => {
|
|
|
30747
30646
|
padding: 2
|
|
30748
30647
|
}
|
|
30749
30648
|
},
|
|
30750
|
-
items.map(({ type, label, icon: icon2 }) => /* @__PURE__ */
|
|
30649
|
+
items.map(({ type, label, icon: icon2 }) => /* @__PURE__ */ React290.createElement(Tooltip26, { key: type, label, withArrow: true }, /* @__PURE__ */ React290.createElement(
|
|
30751
30650
|
ActionIcon41,
|
|
30752
30651
|
{
|
|
30753
30652
|
variant: active === type ? "filled" : "subtle",
|
|
@@ -30768,22 +30667,22 @@ var DEFAULT_CENTER = [0, 20];
|
|
|
30768
30667
|
var DEFAULT_ZOOM = 2;
|
|
30769
30668
|
var PLACED_ZOOM = 14;
|
|
30770
30669
|
var GeneralTab17 = ({ title, description, latitude, longitude, onTitleChange, onDescriptionChange, onCoordinatesChange }) => {
|
|
30771
|
-
const [localTitle, setLocalTitle] =
|
|
30772
|
-
const [localDescription, setLocalDescription] =
|
|
30773
|
-
const [mapError, setMapError] =
|
|
30670
|
+
const [localTitle, setLocalTitle] = useState140(title);
|
|
30671
|
+
const [localDescription, setLocalDescription] = useState140(description);
|
|
30672
|
+
const [mapError, setMapError] = useState140(null);
|
|
30774
30673
|
const { status, UnlSdk } = useUnlMap();
|
|
30775
30674
|
const { mapConfig } = useBlocknoteContext();
|
|
30776
30675
|
const markerRef = useRef26(null);
|
|
30777
30676
|
const mapRef = useRef26(null);
|
|
30778
30677
|
const wrapperRef = useRef26(null);
|
|
30779
30678
|
const containerRef = useRef26(null);
|
|
30780
|
-
|
|
30679
|
+
useEffect111(() => {
|
|
30781
30680
|
setLocalTitle(title);
|
|
30782
30681
|
}, [title]);
|
|
30783
|
-
|
|
30682
|
+
useEffect111(() => {
|
|
30784
30683
|
setLocalDescription(description);
|
|
30785
30684
|
}, [description]);
|
|
30786
|
-
|
|
30685
|
+
useEffect111(() => {
|
|
30787
30686
|
if (status !== "ready" || !UnlSdk || mapRef.current || !mapConfig || !containerRef.current || !wrapperRef.current) return;
|
|
30788
30687
|
try {
|
|
30789
30688
|
const hasCoords = latitude && longitude;
|
|
@@ -30833,7 +30732,7 @@ var GeneralTab17 = ({ title, description, latitude, longitude, onTitleChange, on
|
|
|
30833
30732
|
markerRef.current = null;
|
|
30834
30733
|
};
|
|
30835
30734
|
}, [status, UnlSdk]);
|
|
30836
|
-
return /* @__PURE__ */
|
|
30735
|
+
return /* @__PURE__ */ React291.createElement(Stack205, { gap: "lg" }, /* @__PURE__ */ React291.createElement(Stack205, { gap: "xs" }, /* @__PURE__ */ React291.createElement(Text178, { size: "sm", fw: 600 }, "Title"), /* @__PURE__ */ React291.createElement(
|
|
30837
30736
|
BaseTextInput,
|
|
30838
30737
|
{
|
|
30839
30738
|
placeholder: "e.g. Project Location",
|
|
@@ -30844,7 +30743,7 @@ var GeneralTab17 = ({ title, description, latitude, longitude, onTitleChange, on
|
|
|
30844
30743
|
onTitleChange(v);
|
|
30845
30744
|
}
|
|
30846
30745
|
}
|
|
30847
|
-
)), /* @__PURE__ */
|
|
30746
|
+
)), /* @__PURE__ */ React291.createElement(Stack205, { gap: "xs" }, /* @__PURE__ */ React291.createElement(Text178, { size: "sm", fw: 600 }, "Description"), /* @__PURE__ */ React291.createElement(
|
|
30848
30747
|
BaseTextInput,
|
|
30849
30748
|
{
|
|
30850
30749
|
placeholder: "e.g. Main project site coordinates",
|
|
@@ -30855,7 +30754,7 @@ var GeneralTab17 = ({ title, description, latitude, longitude, onTitleChange, on
|
|
|
30855
30754
|
onDescriptionChange(v);
|
|
30856
30755
|
}
|
|
30857
30756
|
}
|
|
30858
|
-
)), /* @__PURE__ */
|
|
30757
|
+
)), /* @__PURE__ */ React291.createElement(Divider26, { variant: "dashed" }), /* @__PURE__ */ React291.createElement(Stack205, { gap: "xs" }, /* @__PURE__ */ React291.createElement(Text178, { size: "sm", fw: 600 }, "Location"), /* @__PURE__ */ React291.createElement(Text178, { size: "xs", c: "dimmed" }, "Click on the map to set the location."), mapError ? /* @__PURE__ */ React291.createElement(Text178, { size: "sm", c: "red" }, mapError) : /* @__PURE__ */ React291.createElement(Box62, { ref: wrapperRef, mx: "auto", w: "100%", miw: 280, h: 300, style: { borderRadius: 12, position: "relative", overflow: "hidden" } }, /* @__PURE__ */ React291.createElement(
|
|
30859
30758
|
Box62,
|
|
30860
30759
|
{
|
|
30861
30760
|
ref: containerRef,
|
|
@@ -30868,19 +30767,19 @@ var GeneralTab17 = ({ title, description, latitude, longitude, onTitleChange, on
|
|
|
30868
30767
|
height: "600px"
|
|
30869
30768
|
}
|
|
30870
30769
|
}
|
|
30871
|
-
), /* @__PURE__ */
|
|
30770
|
+
), /* @__PURE__ */ React291.createElement(TileSelector, { mapRef }))), /* @__PURE__ */ React291.createElement(Stack205, { gap: "xs" }, /* @__PURE__ */ React291.createElement(BaseTextInput, { label: "Latitude", value: latitude, readOnly: true, placeholder: "Not set" }), /* @__PURE__ */ React291.createElement(BaseTextInput, { label: "Longitude", value: longitude, readOnly: true, placeholder: "Not set" })));
|
|
30872
30771
|
};
|
|
30873
30772
|
|
|
30874
30773
|
// src/mantine/blocks/location/template/TemplateConfig.tsx
|
|
30875
30774
|
var TemplateConfig17 = ({ editor, block }) => {
|
|
30876
30775
|
const { closePanel } = usePanelStore();
|
|
30877
|
-
const updateProp =
|
|
30776
|
+
const updateProp = useCallback116(
|
|
30878
30777
|
(key, value) => {
|
|
30879
30778
|
editor.updateBlock(block, { props: { ...block.props, [key]: value } });
|
|
30880
30779
|
},
|
|
30881
30780
|
[editor, block]
|
|
30882
30781
|
);
|
|
30883
|
-
const updateProps =
|
|
30782
|
+
const updateProps = useCallback116(
|
|
30884
30783
|
(updates) => {
|
|
30885
30784
|
editor.updateBlock(block, { props: { ...block.props, ...updates } });
|
|
30886
30785
|
},
|
|
@@ -30891,7 +30790,7 @@ var TemplateConfig17 = ({ editor, block }) => {
|
|
|
30891
30790
|
label: "General",
|
|
30892
30791
|
value: "general",
|
|
30893
30792
|
icon: icon(IconSettings19),
|
|
30894
|
-
content: /* @__PURE__ */
|
|
30793
|
+
content: /* @__PURE__ */ React292.createElement(
|
|
30895
30794
|
GeneralTab17,
|
|
30896
30795
|
{
|
|
30897
30796
|
title: block.props.title || "",
|
|
@@ -30905,21 +30804,21 @@ var TemplateConfig17 = ({ editor, block }) => {
|
|
|
30905
30804
|
)
|
|
30906
30805
|
}
|
|
30907
30806
|
];
|
|
30908
|
-
return /* @__PURE__ */
|
|
30807
|
+
return /* @__PURE__ */ React292.createElement(BaseRightPanelLayout, { title: "Location Settings", onClose: closePanel, tabs, context: { editor, block } });
|
|
30909
30808
|
};
|
|
30910
30809
|
|
|
30911
30810
|
// src/mantine/blocks/location/components/LocationMap.tsx
|
|
30912
|
-
import
|
|
30913
|
-
import { Box as Box63, Flex as Flex36, Loader as
|
|
30811
|
+
import React293, { useEffect as useEffect112, useRef as useRef27, useState as useState141 } from "react";
|
|
30812
|
+
import { Box as Box63, Flex as Flex36, Loader as Loader59, Text as Text179 } from "@mantine/core";
|
|
30914
30813
|
var UnlMap = ({ w = "100%", h = 200, latitude, longitude, zoom = 5, showMarker = true, showTilesControl = false }) => {
|
|
30915
|
-
const [mapError, setMapError] =
|
|
30814
|
+
const [mapError, setMapError] = useState141(null);
|
|
30916
30815
|
const { mapConfig } = useBlocknoteContext();
|
|
30917
30816
|
const wrapperRef = useRef27(null);
|
|
30918
30817
|
const containerRef = useRef27(null);
|
|
30919
30818
|
const mapRef = useRef27(null);
|
|
30920
30819
|
const markerRef = useRef27(null);
|
|
30921
30820
|
const { status, UnlSdk } = useUnlMap();
|
|
30922
|
-
|
|
30821
|
+
useEffect112(() => {
|
|
30923
30822
|
if (status !== "ready" || !UnlSdk || mapRef.current || !containerRef.current || !wrapperRef.current) return;
|
|
30924
30823
|
let ro;
|
|
30925
30824
|
let resizeTimer;
|
|
@@ -30950,7 +30849,7 @@ var UnlMap = ({ w = "100%", h = 200, latitude, longitude, zoom = 5, showMarker =
|
|
|
30950
30849
|
ro?.disconnect();
|
|
30951
30850
|
};
|
|
30952
30851
|
}, [status, UnlSdk, mapConfig]);
|
|
30953
|
-
|
|
30852
|
+
useEffect112(() => {
|
|
30954
30853
|
if (!mapRef.current || !latitude || !longitude) return;
|
|
30955
30854
|
const coords = [Number(longitude), Number(latitude)];
|
|
30956
30855
|
mapRef.current.setCenter(coords);
|
|
@@ -30959,7 +30858,7 @@ var UnlMap = ({ w = "100%", h = 200, latitude, longitude, zoom = 5, showMarker =
|
|
|
30959
30858
|
}
|
|
30960
30859
|
}, [latitude, longitude, showMarker]);
|
|
30961
30860
|
if (status === "loading") {
|
|
30962
|
-
return /* @__PURE__ */
|
|
30861
|
+
return /* @__PURE__ */ React293.createElement(
|
|
30963
30862
|
Box63,
|
|
30964
30863
|
{
|
|
30965
30864
|
style: {
|
|
@@ -30971,11 +30870,11 @@ var UnlMap = ({ w = "100%", h = 200, latitude, longitude, zoom = 5, showMarker =
|
|
|
30971
30870
|
w,
|
|
30972
30871
|
h
|
|
30973
30872
|
},
|
|
30974
|
-
/* @__PURE__ */
|
|
30873
|
+
/* @__PURE__ */ React293.createElement(Loader59, null)
|
|
30975
30874
|
);
|
|
30976
30875
|
}
|
|
30977
30876
|
if (status === "error" || mapError) {
|
|
30978
|
-
return /* @__PURE__ */
|
|
30877
|
+
return /* @__PURE__ */ React293.createElement(
|
|
30979
30878
|
Box63,
|
|
30980
30879
|
{
|
|
30981
30880
|
style: {
|
|
@@ -30987,10 +30886,10 @@ var UnlMap = ({ w = "100%", h = 200, latitude, longitude, zoom = 5, showMarker =
|
|
|
30987
30886
|
w,
|
|
30988
30887
|
h
|
|
30989
30888
|
},
|
|
30990
|
-
/* @__PURE__ */
|
|
30889
|
+
/* @__PURE__ */ React293.createElement(Text179, { size: "sm", c: "red" }, mapError || "Failed to load map")
|
|
30991
30890
|
);
|
|
30992
30891
|
}
|
|
30993
|
-
return /* @__PURE__ */
|
|
30892
|
+
return /* @__PURE__ */ React293.createElement(Box63, { ref: wrapperRef, style: { position: "relative", borderRadius: 16, overflow: "hidden" }, w, h }, /* @__PURE__ */ React293.createElement(
|
|
30994
30893
|
Box63,
|
|
30995
30894
|
{
|
|
30996
30895
|
ref: containerRef,
|
|
@@ -31003,54 +30902,54 @@ var UnlMap = ({ w = "100%", h = 200, latitude, longitude, zoom = 5, showMarker =
|
|
|
31003
30902
|
height: "600px"
|
|
31004
30903
|
}
|
|
31005
30904
|
}
|
|
31006
|
-
), showTilesControl && /* @__PURE__ */
|
|
30905
|
+
), showTilesControl && /* @__PURE__ */ React293.createElement(TileSelector, { mapRef }));
|
|
31007
30906
|
};
|
|
31008
30907
|
function LocationMap(props) {
|
|
31009
30908
|
if (props.latitude === void 0 || props.longitude === void 0)
|
|
31010
|
-
return /* @__PURE__ */
|
|
31011
|
-
return /* @__PURE__ */
|
|
30909
|
+
return /* @__PURE__ */ React293.createElement(Flex36, { w: "100%", h: 200, align: "center", justify: "center" }, /* @__PURE__ */ React293.createElement(Loader59, null));
|
|
30910
|
+
return /* @__PURE__ */ React293.createElement(UnlMap, { ...props });
|
|
31012
30911
|
}
|
|
31013
30912
|
|
|
31014
30913
|
// src/mantine/blocks/location/template/TemplateView.tsx
|
|
31015
30914
|
var LOCATION_TEMPLATE_PANEL_ID = "location-template-panel";
|
|
31016
30915
|
var LocationTemplateView = ({ editor, block }) => {
|
|
31017
30916
|
const panelId = `${LOCATION_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
31018
|
-
const panelContent =
|
|
30917
|
+
const panelContent = useMemo114(() => /* @__PURE__ */ React294.createElement(TemplateConfig17, { editor, block }), [editor, block]);
|
|
31019
30918
|
const { open } = usePanel(panelId, panelContent);
|
|
31020
30919
|
const hasLocation = block.props.latitude && block.props.longitude;
|
|
31021
|
-
return /* @__PURE__ */
|
|
30920
|
+
return /* @__PURE__ */ React294.createElement(BaseContainer, { blockId: block.id, onClick: open, style: { minHeight: 90, justifyContent: "center" } }, /* @__PURE__ */ React294.createElement(Stack206, { gap: "xs", justify: "center" }, /* @__PURE__ */ React294.createElement(Group110, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React294.createElement(IconMapPin, { color: "currentColor", size: 26, stroke: 1.5 }), /* @__PURE__ */ React294.createElement(Stack206, { gap: 2 }, /* @__PURE__ */ React294.createElement(Text180, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Location"), block.props.description && /* @__PURE__ */ React294.createElement(Text180, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description))), hasLocation && /* @__PURE__ */ React294.createElement(LocationMap, { latitude: block.props.latitude, longitude: block.props.longitude, mapId: `location-template-map-${block.id}`, zoom: 14, showMarker: true, showTilesControl: true })));
|
|
31022
30921
|
};
|
|
31023
30922
|
|
|
31024
30923
|
// src/mantine/blocks/location/flow/FlowView.tsx
|
|
31025
|
-
import
|
|
31026
|
-
import { Center as Center14, Group as
|
|
30924
|
+
import React296, { useMemo as useMemo115 } from "react";
|
|
30925
|
+
import { Center as Center14, Group as Group111, Stack as Stack207, Text as Text181 } from "@mantine/core";
|
|
31027
30926
|
import { IconMapPin as IconMapPin2 } from "@tabler/icons-react";
|
|
31028
30927
|
|
|
31029
30928
|
// src/mantine/blocks/location/flow/FlowConfig.tsx
|
|
31030
|
-
import
|
|
30929
|
+
import React295 from "react";
|
|
31031
30930
|
var FlowConfig3 = ({ block }) => {
|
|
31032
30931
|
const { closePanel } = usePanelStore();
|
|
31033
30932
|
const hasLocation = block.props.latitude && block.props.longitude;
|
|
31034
|
-
return /* @__PURE__ */
|
|
30933
|
+
return /* @__PURE__ */ React295.createElement(BaseRightPanelLayout, { title: block.props.title || "Location", onClose: closePanel, isTemplate: false }, hasLocation ? /* @__PURE__ */ React295.createElement(LocationMap, { latitude: block.props.latitude, longitude: block.props.longitude, h: 600, zoom: 14, showMarker: true, showTilesControl: true }) : null);
|
|
31035
30934
|
};
|
|
31036
30935
|
|
|
31037
30936
|
// src/mantine/blocks/location/flow/FlowView.tsx
|
|
31038
30937
|
var LOCATION_FLOW_PANEL_ID = "location-flow-panel";
|
|
31039
30938
|
var LocationFlowView = ({ editor, block }) => {
|
|
31040
30939
|
const panelId = `${LOCATION_FLOW_PANEL_ID}-${block.id}`;
|
|
31041
|
-
const panelContent =
|
|
30940
|
+
const panelContent = useMemo115(() => /* @__PURE__ */ React296.createElement(FlowConfig3, { editor, block }), [editor, block]);
|
|
31042
30941
|
const { open } = usePanel(panelId, panelContent);
|
|
31043
30942
|
const hasLocation = block.props.latitude && block.props.longitude;
|
|
31044
|
-
return /* @__PURE__ */
|
|
30943
|
+
return /* @__PURE__ */ React296.createElement(BaseContainer, { blockId: block.id, onClick: open, style: { minHeight: 90, justifyContent: "center" } }, /* @__PURE__ */ React296.createElement(Stack207, { gap: "xs", justify: "center" }, /* @__PURE__ */ React296.createElement(Group111, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React296.createElement(IconMapPin2, { color: "currentColor", size: 26, stroke: 1.5 }), /* @__PURE__ */ React296.createElement(Stack207, { gap: 2 }, /* @__PURE__ */ React296.createElement(Text181, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Location"), block.props.description && /* @__PURE__ */ React296.createElement(Text181, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description))), hasLocation ? /* @__PURE__ */ React296.createElement(LocationMap, { latitude: block.props.latitude, longitude: block.props.longitude, mapId: `location-flow-map-${block.id}`, zoom: 14, showMarker: true, showTilesControl: true }) : /* @__PURE__ */ React296.createElement(Center14, { py: "md" }, /* @__PURE__ */ React296.createElement(Text181, { size: "sm", c: "dimmed" }, "Location not configured"))));
|
|
31045
30944
|
};
|
|
31046
30945
|
|
|
31047
30946
|
// src/mantine/blocks/location/LocationBlock.tsx
|
|
31048
30947
|
function LocationBlock({ editor, block }) {
|
|
31049
30948
|
const { docType } = useBlocknoteContext();
|
|
31050
30949
|
if (docType === "template") {
|
|
31051
|
-
return /* @__PURE__ */
|
|
30950
|
+
return /* @__PURE__ */ React297.createElement(LocationTemplateView, { editor, block });
|
|
31052
30951
|
}
|
|
31053
|
-
return /* @__PURE__ */
|
|
30952
|
+
return /* @__PURE__ */ React297.createElement(LocationFlowView, { editor, block });
|
|
31054
30953
|
}
|
|
31055
30954
|
|
|
31056
30955
|
// src/mantine/blocks/location/LocationBlockSpec.tsx
|
|
@@ -31069,29 +30968,29 @@ var LocationBlockSpec = createReactBlockSpec21(
|
|
|
31069
30968
|
{
|
|
31070
30969
|
render: (props) => {
|
|
31071
30970
|
const ixoProps = props;
|
|
31072
|
-
return /* @__PURE__ */
|
|
30971
|
+
return /* @__PURE__ */ React298.createElement(LocationBlock, { ...ixoProps });
|
|
31073
30972
|
}
|
|
31074
30973
|
}
|
|
31075
30974
|
);
|
|
31076
30975
|
|
|
31077
30976
|
// src/mantine/blocks/embed/EmbedBlockSpec.tsx
|
|
31078
|
-
import
|
|
30977
|
+
import React305 from "react";
|
|
31079
30978
|
import { createReactBlockSpec as createReactBlockSpec22 } from "@blocknote/react";
|
|
31080
30979
|
|
|
31081
30980
|
// src/mantine/blocks/embed/EmbedBlock.tsx
|
|
31082
|
-
import
|
|
30981
|
+
import React304 from "react";
|
|
31083
30982
|
|
|
31084
30983
|
// src/mantine/blocks/embed/template/TemplateView.tsx
|
|
31085
|
-
import
|
|
31086
|
-
import { Box as Box64, Group as
|
|
30984
|
+
import React301, { useMemo as useMemo116 } from "react";
|
|
30985
|
+
import { Box as Box64, Group as Group112, Stack as Stack209, Text as Text183 } from "@mantine/core";
|
|
31087
30986
|
|
|
31088
30987
|
// src/mantine/blocks/embed/template/TemplateConfig.tsx
|
|
31089
|
-
import
|
|
30988
|
+
import React300, { useCallback as useCallback117 } from "react";
|
|
31090
30989
|
import { IconSettings as IconSettings20 } from "@tabler/icons-react";
|
|
31091
30990
|
|
|
31092
30991
|
// src/mantine/blocks/embed/template/GeneralTab.tsx
|
|
31093
|
-
import
|
|
31094
|
-
import { Stack as
|
|
30992
|
+
import React299, { useEffect as useEffect113, useState as useState142 } from "react";
|
|
30993
|
+
import { Stack as Stack208, Switch as Switch7, Text as Text182 } from "@mantine/core";
|
|
31095
30994
|
var GeneralTab18 = ({
|
|
31096
30995
|
url,
|
|
31097
30996
|
title,
|
|
@@ -31106,19 +31005,19 @@ var GeneralTab18 = ({
|
|
|
31106
31005
|
onHeightChange,
|
|
31107
31006
|
onAllowAuthChange
|
|
31108
31007
|
}) => {
|
|
31109
|
-
const [localUrl, setLocalUrl] =
|
|
31110
|
-
const [localHeight, setLocalHeight] =
|
|
31008
|
+
const [localUrl, setLocalUrl] = useState142(url);
|
|
31009
|
+
const [localHeight, setLocalHeight] = useState142(height);
|
|
31111
31010
|
const iconOptions = Object.keys(ICON_MAP).map((key) => ({
|
|
31112
31011
|
value: key,
|
|
31113
31012
|
label: key.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ")
|
|
31114
31013
|
}));
|
|
31115
|
-
|
|
31014
|
+
useEffect113(() => {
|
|
31116
31015
|
setLocalUrl(url);
|
|
31117
31016
|
}, [url]);
|
|
31118
|
-
|
|
31017
|
+
useEffect113(() => {
|
|
31119
31018
|
setLocalHeight(height);
|
|
31120
31019
|
}, [height]);
|
|
31121
|
-
return /* @__PURE__ */
|
|
31020
|
+
return /* @__PURE__ */ React299.createElement(Stack208, { gap: "md" }, /* @__PURE__ */ React299.createElement(Stack208, { gap: "xs" }, /* @__PURE__ */ React299.createElement(Text182, { size: "sm", fw: 600 }, "URL"), /* @__PURE__ */ React299.createElement(
|
|
31122
31021
|
BaseTextInput,
|
|
31123
31022
|
{
|
|
31124
31023
|
placeholder: "https://example.com",
|
|
@@ -31129,7 +31028,7 @@ var GeneralTab18 = ({
|
|
|
31129
31028
|
onUrlChange(v);
|
|
31130
31029
|
}
|
|
31131
31030
|
}
|
|
31132
|
-
), /* @__PURE__ */
|
|
31031
|
+
), /* @__PURE__ */ React299.createElement(Text182, { size: "xs", c: "dimmed" }, "Enter the URL of the page to embed.")), /* @__PURE__ */ React299.createElement(BaseTextInput, { label: "Title", placeholder: "e.g. Dashboard", value: title, onChange: (e) => onTitleChange(e.currentTarget.value) }), /* @__PURE__ */ React299.createElement(BaseTextArea, { label: "Description", placeholder: "Enter description", value: description, onChange: (e) => onDescriptionChange(e.currentTarget.value), minRows: 2 }), /* @__PURE__ */ React299.createElement(BaseSelect, { label: "Icon", placeholder: "Select an icon", value: icon2 || "code", onChange: (value) => onIconChange(value || "code"), data: iconOptions, searchable: true }), /* @__PURE__ */ React299.createElement(
|
|
31133
31032
|
BaseTextInput,
|
|
31134
31033
|
{
|
|
31135
31034
|
label: "Height (px)",
|
|
@@ -31142,13 +31041,13 @@ var GeneralTab18 = ({
|
|
|
31142
31041
|
onHeightChange(v);
|
|
31143
31042
|
}
|
|
31144
31043
|
}
|
|
31145
|
-
), /* @__PURE__ */
|
|
31044
|
+
), /* @__PURE__ */ React299.createElement(Stack208, { gap: "xs" }, /* @__PURE__ */ React299.createElement(Switch7, { label: "Allow authenticated embeds", checked: allowAuth, onChange: (event) => onAllowAuthChange(event.currentTarget.checked) }), /* @__PURE__ */ React299.createElement(Text182, { size: "xs", c: "dimmed" }, "Enable for services like Google Calendar that require cookie access. Only use with trusted URLs.")));
|
|
31146
31045
|
};
|
|
31147
31046
|
|
|
31148
31047
|
// src/mantine/blocks/embed/template/TemplateConfig.tsx
|
|
31149
31048
|
var TemplateConfig18 = ({ editor, block }) => {
|
|
31150
31049
|
const { closePanel } = usePanelStore();
|
|
31151
|
-
const updateProp =
|
|
31050
|
+
const updateProp = useCallback117(
|
|
31152
31051
|
(key, value) => {
|
|
31153
31052
|
editor.updateBlock(block, { props: { ...block.props, [key]: value } });
|
|
31154
31053
|
},
|
|
@@ -31159,7 +31058,7 @@ var TemplateConfig18 = ({ editor, block }) => {
|
|
|
31159
31058
|
label: "General",
|
|
31160
31059
|
value: "general",
|
|
31161
31060
|
icon: icon(IconSettings20),
|
|
31162
|
-
content: /* @__PURE__ */
|
|
31061
|
+
content: /* @__PURE__ */ React300.createElement(
|
|
31163
31062
|
GeneralTab18,
|
|
31164
31063
|
{
|
|
31165
31064
|
url: block.props.url || "",
|
|
@@ -31178,7 +31077,7 @@ var TemplateConfig18 = ({ editor, block }) => {
|
|
|
31178
31077
|
)
|
|
31179
31078
|
}
|
|
31180
31079
|
];
|
|
31181
|
-
return /* @__PURE__ */
|
|
31080
|
+
return /* @__PURE__ */ React300.createElement(BaseRightPanelLayout, { title: "Embed Settings", onClose: closePanel, tabs, context: { editor, block } });
|
|
31182
31081
|
};
|
|
31183
31082
|
|
|
31184
31083
|
// src/mantine/blocks/embed/sanitizeUrl.ts
|
|
@@ -31211,12 +31110,12 @@ function buildImageSrcdoc(url) {
|
|
|
31211
31110
|
var EMBED_TEMPLATE_PANEL_ID = "embed-template-panel";
|
|
31212
31111
|
var EmbedTemplateView = ({ editor, block }) => {
|
|
31213
31112
|
const panelId = `${EMBED_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
31214
|
-
const panelContent =
|
|
31113
|
+
const panelContent = useMemo116(() => /* @__PURE__ */ React301.createElement(TemplateConfig18, { editor, block }), [editor, block]);
|
|
31215
31114
|
const { open } = usePanel(panelId, panelContent);
|
|
31216
31115
|
const safeUrl = sanitizeEmbedUrl(block.props.url);
|
|
31217
31116
|
const height = Number(block.props.height) || 400;
|
|
31218
31117
|
const sandbox = block.props.allowAuth === "true" ? "allow-scripts allow-same-origin allow-forms allow-popups" : "allow-scripts allow-forms allow-popups";
|
|
31219
|
-
return /* @__PURE__ */
|
|
31118
|
+
return /* @__PURE__ */ React301.createElement(BaseContainer, { blockId: block.id, onClick: open, style: { minHeight: 90, justifyContent: "center" } }, /* @__PURE__ */ React301.createElement(Stack209, { gap: "xs", justify: "center" }, /* @__PURE__ */ React301.createElement(Group112, { wrap: "nowrap", align: "center" }, getIcon("code", block.props.icon), /* @__PURE__ */ React301.createElement(Stack209, { gap: 2 }, /* @__PURE__ */ React301.createElement(Text183, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Embed"), /* @__PURE__ */ React301.createElement(Text183, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 1 }, block.props.description || safeUrl || "Click to configure"))), safeUrl && /* @__PURE__ */ React301.createElement(Box64, { style: { borderRadius: 8, overflow: "hidden" } }, /* @__PURE__ */ React301.createElement(
|
|
31220
31119
|
"iframe",
|
|
31221
31120
|
{
|
|
31222
31121
|
...isImageUrl(safeUrl) ? { srcDoc: buildImageSrcdoc(safeUrl) } : { src: safeUrl },
|
|
@@ -31232,15 +31131,15 @@ var EmbedTemplateView = ({ editor, block }) => {
|
|
|
31232
31131
|
};
|
|
31233
31132
|
|
|
31234
31133
|
// src/mantine/blocks/embed/flow/FlowView.tsx
|
|
31235
|
-
import
|
|
31236
|
-
import { Box as Box65, Group as
|
|
31134
|
+
import React303, { useMemo as useMemo117 } from "react";
|
|
31135
|
+
import { Box as Box65, Group as Group113, Stack as Stack210, Text as Text184 } from "@mantine/core";
|
|
31237
31136
|
|
|
31238
31137
|
// src/mantine/blocks/embed/flow/FlowConfig.tsx
|
|
31239
|
-
import
|
|
31138
|
+
import React302, { useCallback as useCallback118 } from "react";
|
|
31240
31139
|
import { IconSettings as IconSettings21 } from "@tabler/icons-react";
|
|
31241
31140
|
var FlowConfig4 = ({ editor, block }) => {
|
|
31242
31141
|
const { closePanel } = usePanelStore();
|
|
31243
|
-
const updateProp =
|
|
31142
|
+
const updateProp = useCallback118(
|
|
31244
31143
|
(key, value) => {
|
|
31245
31144
|
editor.updateBlock(block, { props: { ...block.props, [key]: value } });
|
|
31246
31145
|
},
|
|
@@ -31251,7 +31150,7 @@ var FlowConfig4 = ({ editor, block }) => {
|
|
|
31251
31150
|
label: "General",
|
|
31252
31151
|
value: "general",
|
|
31253
31152
|
icon: icon(IconSettings21),
|
|
31254
|
-
content: /* @__PURE__ */
|
|
31153
|
+
content: /* @__PURE__ */ React302.createElement(
|
|
31255
31154
|
GeneralTab18,
|
|
31256
31155
|
{
|
|
31257
31156
|
url: block.props.url || "",
|
|
@@ -31270,19 +31169,19 @@ var FlowConfig4 = ({ editor, block }) => {
|
|
|
31270
31169
|
)
|
|
31271
31170
|
}
|
|
31272
31171
|
];
|
|
31273
|
-
return /* @__PURE__ */
|
|
31172
|
+
return /* @__PURE__ */ React302.createElement(BaseRightPanelLayout, { title: "Embed Settings", onClose: closePanel, tabs, context: { editor, block }, isTemplate: false });
|
|
31274
31173
|
};
|
|
31275
31174
|
|
|
31276
31175
|
// src/mantine/blocks/embed/flow/FlowView.tsx
|
|
31277
31176
|
var EMBED_FLOW_PANEL_ID = "embed-flow-panel";
|
|
31278
31177
|
var EmbedFlowView = ({ editor, block }) => {
|
|
31279
31178
|
const panelId = `${EMBED_FLOW_PANEL_ID}-${block.id}`;
|
|
31280
|
-
const panelContent =
|
|
31179
|
+
const panelContent = useMemo117(() => /* @__PURE__ */ React303.createElement(FlowConfig4, { editor, block }), [editor, block]);
|
|
31281
31180
|
const { open } = usePanel(panelId, panelContent);
|
|
31282
31181
|
const safeUrl = sanitizeEmbedUrl(block.props.url);
|
|
31283
31182
|
const height = Number(block.props.height) || 400;
|
|
31284
31183
|
const sandbox = block.props.allowAuth === "true" ? "allow-scripts allow-same-origin allow-forms allow-popups" : "allow-scripts allow-forms allow-popups";
|
|
31285
|
-
return /* @__PURE__ */
|
|
31184
|
+
return /* @__PURE__ */ React303.createElement(BaseContainer, { blockId: block.id, onClick: open, style: { minHeight: 90, justifyContent: "center" } }, /* @__PURE__ */ React303.createElement(Stack210, { gap: "xs", justify: "center" }, /* @__PURE__ */ React303.createElement(Group113, { wrap: "nowrap", align: "center" }, getIcon("code", block.props.icon), /* @__PURE__ */ React303.createElement(Stack210, { gap: 2 }, /* @__PURE__ */ React303.createElement(Text184, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Embed"), /* @__PURE__ */ React303.createElement(Text184, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 1 }, block.props.description || safeUrl || "No URL configured"))), safeUrl && /* @__PURE__ */ React303.createElement(Box65, { style: { borderRadius: 8, overflow: "hidden" } }, /* @__PURE__ */ React303.createElement(
|
|
31286
31185
|
"iframe",
|
|
31287
31186
|
{
|
|
31288
31187
|
...isImageUrl(safeUrl) ? { srcDoc: buildImageSrcdoc(safeUrl) } : { src: safeUrl },
|
|
@@ -31301,9 +31200,9 @@ var EmbedFlowView = ({ editor, block }) => {
|
|
|
31301
31200
|
function EmbedBlock({ editor, block }) {
|
|
31302
31201
|
const { docType } = useBlocknoteContext();
|
|
31303
31202
|
if (docType === "template") {
|
|
31304
|
-
return /* @__PURE__ */
|
|
31203
|
+
return /* @__PURE__ */ React304.createElement(EmbedTemplateView, { editor, block });
|
|
31305
31204
|
}
|
|
31306
|
-
return /* @__PURE__ */
|
|
31205
|
+
return /* @__PURE__ */ React304.createElement(EmbedFlowView, { editor, block });
|
|
31307
31206
|
}
|
|
31308
31207
|
|
|
31309
31208
|
// src/mantine/blocks/embed/EmbedBlockSpec.tsx
|
|
@@ -31324,7 +31223,7 @@ var EmbedBlockSpec = createReactBlockSpec22(
|
|
|
31324
31223
|
{
|
|
31325
31224
|
render: (props) => {
|
|
31326
31225
|
const ixoProps = props;
|
|
31327
|
-
return /* @__PURE__ */
|
|
31226
|
+
return /* @__PURE__ */ React305.createElement(EmbedBlock, { ...ixoProps });
|
|
31328
31227
|
}
|
|
31329
31228
|
}
|
|
31330
31229
|
);
|
|
@@ -31564,10 +31463,10 @@ blockRegistry.register({
|
|
|
31564
31463
|
});
|
|
31565
31464
|
|
|
31566
31465
|
// src/mantine/blocks/hooks/useBlockDependencies.ts
|
|
31567
|
-
import { useMemo as
|
|
31466
|
+
import { useMemo as useMemo118, useEffect as useEffect114, useState as useState143, useCallback as useCallback119 } from "react";
|
|
31568
31467
|
|
|
31569
31468
|
// src/mantine/blocks/hooks/useDependsOn.ts
|
|
31570
|
-
import { useMemo as
|
|
31469
|
+
import { useMemo as useMemo119 } from "react";
|
|
31571
31470
|
|
|
31572
31471
|
// src/mantine/blocks/index.ts
|
|
31573
31472
|
var blockSpecs = {
|
|
@@ -32074,15 +31973,15 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
|
32074
31973
|
import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
|
|
32075
31974
|
|
|
32076
31975
|
// src/core/hooks/useMatrixProvider.ts
|
|
32077
|
-
import { useEffect as
|
|
31976
|
+
import { useEffect as useEffect115, useState as useState144, useRef as useRef28, useCallback as useCallback120, useMemo as useMemo120 } from "react";
|
|
32078
31977
|
import { MatrixProvider } from "@ixo/matrix-crdt";
|
|
32079
31978
|
function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
32080
|
-
const [matrixProvider, setProvider] =
|
|
32081
|
-
const [status, setStatus] =
|
|
31979
|
+
const [matrixProvider, setProvider] = useState144(null);
|
|
31980
|
+
const [status, setStatus] = useState144("disconnected");
|
|
32082
31981
|
const isMountedRef = useRef28(true);
|
|
32083
31982
|
const providerRef = useRef28(null);
|
|
32084
31983
|
const retryTimeoutRef = useRef28(null);
|
|
32085
|
-
const providerOptions =
|
|
31984
|
+
const providerOptions = useMemo120(
|
|
32086
31985
|
() => ({
|
|
32087
31986
|
translator: {
|
|
32088
31987
|
updateEventType: "matrix-crdt.doc_update",
|
|
@@ -32095,22 +31994,22 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
32095
31994
|
}),
|
|
32096
31995
|
[]
|
|
32097
31996
|
);
|
|
32098
|
-
const handleDocumentAvailable =
|
|
31997
|
+
const handleDocumentAvailable = useCallback120(() => {
|
|
32099
31998
|
if (isMountedRef.current) {
|
|
32100
31999
|
setStatus("connected");
|
|
32101
32000
|
}
|
|
32102
32001
|
}, []);
|
|
32103
|
-
const handleDocumentUnavailable =
|
|
32002
|
+
const handleDocumentUnavailable = useCallback120(() => {
|
|
32104
32003
|
if (isMountedRef.current) {
|
|
32105
32004
|
setStatus("failed");
|
|
32106
32005
|
}
|
|
32107
32006
|
}, []);
|
|
32108
|
-
const handleCanWriteChanged =
|
|
32007
|
+
const handleCanWriteChanged = useCallback120(() => {
|
|
32109
32008
|
if (isMountedRef.current && providerRef.current) {
|
|
32110
32009
|
setStatus(providerRef.current.canWrite ? "connected" : "failed");
|
|
32111
32010
|
}
|
|
32112
32011
|
}, []);
|
|
32113
|
-
const initProvider =
|
|
32012
|
+
const initProvider = useCallback120(async () => {
|
|
32114
32013
|
if (!isMountedRef.current) return;
|
|
32115
32014
|
if (retryTimeoutRef.current) {
|
|
32116
32015
|
clearTimeout(retryTimeoutRef.current);
|
|
@@ -32143,7 +32042,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
32143
32042
|
}
|
|
32144
32043
|
}
|
|
32145
32044
|
}, [matrixClient, providerOptions, handleDocumentAvailable, handleDocumentUnavailable, handleCanWriteChanged]);
|
|
32146
|
-
|
|
32045
|
+
useEffect115(() => {
|
|
32147
32046
|
isMountedRef.current = true;
|
|
32148
32047
|
initProvider();
|
|
32149
32048
|
return () => {
|
|
@@ -32160,7 +32059,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
32160
32059
|
setStatus("disconnected");
|
|
32161
32060
|
};
|
|
32162
32061
|
}, [initProvider]);
|
|
32163
|
-
|
|
32062
|
+
useEffect115(() => {
|
|
32164
32063
|
return () => {
|
|
32165
32064
|
isMountedRef.current = false;
|
|
32166
32065
|
};
|
|
@@ -32169,17 +32068,17 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
32169
32068
|
}
|
|
32170
32069
|
|
|
32171
32070
|
// src/mantine/hooks/useCollaborativeYDoc.ts
|
|
32172
|
-
import { useMemo as
|
|
32071
|
+
import { useMemo as useMemo121 } from "react";
|
|
32173
32072
|
import * as Y from "yjs";
|
|
32174
32073
|
function useCollaborativeYDoc(_options) {
|
|
32175
|
-
return
|
|
32074
|
+
return useMemo121(() => {
|
|
32176
32075
|
const doc = new Y.Doc();
|
|
32177
32076
|
return doc;
|
|
32178
32077
|
}, []);
|
|
32179
32078
|
}
|
|
32180
32079
|
|
|
32181
32080
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
32182
|
-
import { useMemo as
|
|
32081
|
+
import { useMemo as useMemo122, useEffect as useEffect117, useState as useState145, useRef as useRef30 } from "react";
|
|
32183
32082
|
|
|
32184
32083
|
// src/core/lib/matrixMetadata.ts
|
|
32185
32084
|
var COVER_IMAGE_EVENT_TYPE = "ixo.page.cover_image";
|
|
@@ -32448,7 +32347,7 @@ function logInvocation(matrixClient, roomId, invocation) {
|
|
|
32448
32347
|
}
|
|
32449
32348
|
|
|
32450
32349
|
// src/mantine/hooks/useFlowLifecycle.ts
|
|
32451
|
-
import { useEffect as
|
|
32350
|
+
import { useEffect as useEffect116, useCallback as useCallback121, useRef as useRef29 } from "react";
|
|
32452
32351
|
|
|
32453
32352
|
// src/mantine/hooks/useFlowTTLCleanup.ts
|
|
32454
32353
|
function performTTLCleanup(editor) {
|
|
@@ -32687,7 +32586,7 @@ var DEFAULT_INTERVAL_MS = 3e4;
|
|
|
32687
32586
|
function useFlowLifecycle({ editor, connectionStatus, enabled = true }) {
|
|
32688
32587
|
const hasRunInitialRef = useRef29(false);
|
|
32689
32588
|
const runningRef = useRef29(false);
|
|
32690
|
-
const runPipeline =
|
|
32589
|
+
const runPipeline = useCallback121(async () => {
|
|
32691
32590
|
if (!editor || runningRef.current) return;
|
|
32692
32591
|
runningRef.current = true;
|
|
32693
32592
|
try {
|
|
@@ -32699,19 +32598,19 @@ function useFlowLifecycle({ editor, connectionStatus, enabled = true }) {
|
|
|
32699
32598
|
runningRef.current = false;
|
|
32700
32599
|
}
|
|
32701
32600
|
}, [editor]);
|
|
32702
|
-
|
|
32601
|
+
useEffect116(() => {
|
|
32703
32602
|
if (!enabled || !editor || connectionStatus !== "connected" || hasRunInitialRef.current) return;
|
|
32704
32603
|
if (editor.docType !== "flow") return;
|
|
32705
32604
|
hasRunInitialRef.current = true;
|
|
32706
32605
|
runPipeline();
|
|
32707
32606
|
}, [editor, connectionStatus, enabled, runPipeline]);
|
|
32708
|
-
|
|
32607
|
+
useEffect116(() => {
|
|
32709
32608
|
if (!enabled || !editor || connectionStatus !== "connected") return;
|
|
32710
32609
|
if (editor.docType !== "flow") return;
|
|
32711
32610
|
const id = setInterval(runPipeline, DEFAULT_INTERVAL_MS);
|
|
32712
32611
|
return () => clearInterval(id);
|
|
32713
32612
|
}, [editor, connectionStatus, enabled, runPipeline]);
|
|
32714
|
-
|
|
32613
|
+
useEffect116(() => {
|
|
32715
32614
|
if (!enabled || !editor || connectionStatus !== "connected") return;
|
|
32716
32615
|
if (editor.docType !== "flow") return;
|
|
32717
32616
|
const runtimeMap = editor._yRuntime;
|
|
@@ -32788,6 +32687,7 @@ async function mirrorIconToRoomAvatar(matrixClient, roomId, iconValue) {
|
|
|
32788
32687
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
32789
32688
|
function useCreateCollaborativeIxoEditor(options) {
|
|
32790
32689
|
const yDoc = useCollaborativeYDoc(options);
|
|
32690
|
+
window.__yDoc = yDoc;
|
|
32791
32691
|
const {
|
|
32792
32692
|
theme = "light",
|
|
32793
32693
|
uploadFile,
|
|
@@ -32804,7 +32704,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
32804
32704
|
matrixClient,
|
|
32805
32705
|
permissions = { write: false }
|
|
32806
32706
|
} = options || {};
|
|
32807
|
-
const memoizedUser =
|
|
32707
|
+
const memoizedUser = useMemo122(
|
|
32808
32708
|
() => ({
|
|
32809
32709
|
id: user?.id || "",
|
|
32810
32710
|
name: user?.name || "",
|
|
@@ -32820,13 +32720,13 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
32820
32720
|
matrixClient,
|
|
32821
32721
|
roomId: options.roomId
|
|
32822
32722
|
});
|
|
32823
|
-
const metadataManager =
|
|
32824
|
-
|
|
32723
|
+
const metadataManager = useMemo122(() => new MatrixMetadataManager(matrixClient, options.roomId), [matrixClient, options.roomId]);
|
|
32724
|
+
useEffect117(() => {
|
|
32825
32725
|
return () => {
|
|
32826
32726
|
metadataManager.dispose();
|
|
32827
32727
|
};
|
|
32828
32728
|
}, [metadataManager]);
|
|
32829
|
-
const defaultUploadFile =
|
|
32729
|
+
const defaultUploadFile = useMemo122(
|
|
32830
32730
|
() => uploadFile || (async (file) => {
|
|
32831
32731
|
return new Promise((resolve, reject) => {
|
|
32832
32732
|
const reader = new FileReader();
|
|
@@ -32839,7 +32739,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
32839
32739
|
}),
|
|
32840
32740
|
[uploadFile]
|
|
32841
32741
|
);
|
|
32842
|
-
const schema =
|
|
32742
|
+
const schema = useMemo122(
|
|
32843
32743
|
() => BlockNoteSchema2.create({
|
|
32844
32744
|
blockSpecs: {
|
|
32845
32745
|
...defaultBlockSpecs2,
|
|
@@ -32854,14 +32754,14 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
32854
32754
|
}),
|
|
32855
32755
|
[]
|
|
32856
32756
|
);
|
|
32857
|
-
const root =
|
|
32858
|
-
const documentFragment =
|
|
32859
|
-
const flowArray =
|
|
32860
|
-
const runtimeMap =
|
|
32861
|
-
const delegationsMap =
|
|
32862
|
-
const invocationsMap =
|
|
32863
|
-
const migrationMap =
|
|
32864
|
-
const ucanDelegationStore =
|
|
32757
|
+
const root = useMemo122(() => yDoc.getMap("root"), [yDoc]);
|
|
32758
|
+
const documentFragment = useMemo122(() => yDoc.getXmlFragment("document"), [yDoc]);
|
|
32759
|
+
const flowArray = useMemo122(() => yDoc.getArray("flow"), [yDoc]);
|
|
32760
|
+
const runtimeMap = useMemo122(() => yDoc.getMap("runtime"), [yDoc]);
|
|
32761
|
+
const delegationsMap = useMemo122(() => yDoc.getMap("delegations"), [yDoc]);
|
|
32762
|
+
const invocationsMap = useMemo122(() => yDoc.getMap("invocations"), [yDoc]);
|
|
32763
|
+
const migrationMap = useMemo122(() => yDoc.getMap("migration"), [yDoc]);
|
|
32764
|
+
const ucanDelegationStore = useMemo122(() => {
|
|
32865
32765
|
const store = createUcanDelegationStore(delegationsMap);
|
|
32866
32766
|
const originalSet = store.set;
|
|
32867
32767
|
store.set = (delegation) => {
|
|
@@ -32870,7 +32770,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
32870
32770
|
};
|
|
32871
32771
|
return store;
|
|
32872
32772
|
}, [delegationsMap, matrixClient, options.roomId]);
|
|
32873
|
-
const invocationStore =
|
|
32773
|
+
const invocationStore = useMemo122(() => {
|
|
32874
32774
|
const store = createInvocationStore(invocationsMap);
|
|
32875
32775
|
const originalAdd = store.add;
|
|
32876
32776
|
store.add = (invocation) => {
|
|
@@ -32879,8 +32779,8 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
32879
32779
|
};
|
|
32880
32780
|
return store;
|
|
32881
32781
|
}, [invocationsMap, matrixClient, options.roomId]);
|
|
32882
|
-
const userFragment =
|
|
32883
|
-
const collaborationConfig =
|
|
32782
|
+
const userFragment = useMemo122(() => yDoc.getMap(memoizedUser.id), [yDoc, memoizedUser.id]);
|
|
32783
|
+
const collaborationConfig = useMemo122(
|
|
32884
32784
|
() => ({
|
|
32885
32785
|
provider: matrixProvider,
|
|
32886
32786
|
fragment: documentFragment,
|
|
@@ -32892,7 +32792,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
32892
32792
|
}),
|
|
32893
32793
|
[matrixProvider, documentFragment, memoizedUser.name, memoizedUser.color]
|
|
32894
32794
|
);
|
|
32895
|
-
const ixoConfig =
|
|
32795
|
+
const ixoConfig = useMemo122(
|
|
32896
32796
|
() => ({
|
|
32897
32797
|
theme,
|
|
32898
32798
|
editable,
|
|
@@ -32912,7 +32812,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
32912
32812
|
collaboration: collaborationConfig,
|
|
32913
32813
|
pasteHandler: ixoPasteHandler
|
|
32914
32814
|
});
|
|
32915
|
-
const titleText =
|
|
32815
|
+
const titleText = useMemo122(() => yDoc.getText("title"), [yDoc]);
|
|
32916
32816
|
let ixoEditor;
|
|
32917
32817
|
if (editor) {
|
|
32918
32818
|
ixoEditor = editor;
|
|
@@ -32973,6 +32873,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
32973
32873
|
const match = nodes.find((node) => node?.id === nodeId);
|
|
32974
32874
|
return match || null;
|
|
32975
32875
|
};
|
|
32876
|
+
ixoEditor._yDoc = yDoc;
|
|
32976
32877
|
ixoEditor._yRuntime = runtimeMap;
|
|
32977
32878
|
ixoEditor._yDelegations = delegationsMap;
|
|
32978
32879
|
ixoEditor._yInvocations = invocationsMap;
|
|
@@ -33108,12 +33009,12 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
33108
33009
|
return void 0;
|
|
33109
33010
|
};
|
|
33110
33011
|
}
|
|
33111
|
-
|
|
33012
|
+
useEffect117(() => {
|
|
33112
33013
|
if (ixoEditor) {
|
|
33113
33014
|
ixoEditor.isEditable = editable;
|
|
33114
33015
|
}
|
|
33115
33016
|
}, [ixoEditor, editable]);
|
|
33116
|
-
|
|
33017
|
+
useEffect117(() => {
|
|
33117
33018
|
if (connectionStatus !== "connected") {
|
|
33118
33019
|
return;
|
|
33119
33020
|
}
|
|
@@ -33135,10 +33036,10 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
33135
33036
|
titleText.insert(0, options.title);
|
|
33136
33037
|
}
|
|
33137
33038
|
}, [connectionStatus, root, titleText, permissions.write, options.docId, options.title, memoizedUser.id]);
|
|
33138
|
-
const [connectedUsers, setConnectedUsers] =
|
|
33039
|
+
const [connectedUsers, setConnectedUsers] = useState145([]);
|
|
33139
33040
|
const activeBlockIdRef = useRef30(null);
|
|
33140
33041
|
const awarenessInstance = matrixProvider?.awarenessInstance ?? null;
|
|
33141
|
-
|
|
33042
|
+
useEffect117(() => {
|
|
33142
33043
|
if (!awarenessInstance || connectionStatus !== "connected") {
|
|
33143
33044
|
return;
|
|
33144
33045
|
}
|
|
@@ -33156,7 +33057,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
33156
33057
|
awarenessInstance.off("change", updateUsers);
|
|
33157
33058
|
};
|
|
33158
33059
|
}, [awarenessInstance, connectionStatus]);
|
|
33159
|
-
|
|
33060
|
+
useEffect117(() => {
|
|
33160
33061
|
if (!awarenessInstance || connectionStatus !== "connected") {
|
|
33161
33062
|
return;
|
|
33162
33063
|
}
|
|
@@ -33185,7 +33086,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
33185
33086
|
};
|
|
33186
33087
|
}, [awarenessInstance, connectionStatus, memoizedUser.id, memoizedUser.name, memoizedUser.color, memoizedUser.avatar]);
|
|
33187
33088
|
useFlowLifecycle({ editor: ixoEditor, connectionStatus, enabled: permissions.write });
|
|
33188
|
-
|
|
33089
|
+
useEffect117(() => {
|
|
33189
33090
|
if (!ixoEditor) return;
|
|
33190
33091
|
setActiveEditor(ixoEditor);
|
|
33191
33092
|
return () => {
|
|
@@ -33207,14 +33108,14 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
33207
33108
|
}
|
|
33208
33109
|
|
|
33209
33110
|
// src/mantine/IxoEditor.tsx
|
|
33210
|
-
import
|
|
33111
|
+
import React315 from "react";
|
|
33211
33112
|
import { SuggestionMenuController, getDefaultReactSlashMenuItems } from "@blocknote/react";
|
|
33212
33113
|
import { BlockNoteView } from "@blocknote/mantine";
|
|
33213
33114
|
import { filterSuggestionItems } from "@blocknote/core";
|
|
33214
33115
|
|
|
33215
33116
|
// src/mantine/components/CommandPalette.tsx
|
|
33216
|
-
import
|
|
33217
|
-
import { Box as Box66, Text as
|
|
33117
|
+
import React306, { useEffect as useEffect118, useRef as useRef31, useState as useState146, useMemo as useMemo123, useCallback as useCallback122 } from "react";
|
|
33118
|
+
import { Box as Box66, Text as Text185, Stack as Stack211 } from "@mantine/core";
|
|
33218
33119
|
var GROUP_ORDER = {
|
|
33219
33120
|
Headings: 0,
|
|
33220
33121
|
"Basic blocks": 1,
|
|
@@ -33228,14 +33129,14 @@ var GROUP_ORDER = {
|
|
|
33228
33129
|
};
|
|
33229
33130
|
function PaletteItem({ item, isSelected, onClick, id }) {
|
|
33230
33131
|
const ref = useRef31(null);
|
|
33231
|
-
const [hovered, setHovered] =
|
|
33232
|
-
|
|
33132
|
+
const [hovered, setHovered] = useState146(false);
|
|
33133
|
+
useEffect118(() => {
|
|
33233
33134
|
if (isSelected && ref.current) {
|
|
33234
33135
|
ref.current.scrollIntoView({ block: "nearest" });
|
|
33235
33136
|
}
|
|
33236
33137
|
}, [isSelected]);
|
|
33237
33138
|
const highlighted = isSelected || hovered;
|
|
33238
|
-
return /* @__PURE__ */
|
|
33139
|
+
return /* @__PURE__ */ React306.createElement(
|
|
33239
33140
|
Box66,
|
|
33240
33141
|
{
|
|
33241
33142
|
ref,
|
|
@@ -33257,7 +33158,7 @@ function PaletteItem({ item, isSelected, onClick, id }) {
|
|
|
33257
33158
|
backgroundColor: highlighted ? "var(--mantine-color-neutralColor-4)" : "transparent"
|
|
33258
33159
|
}
|
|
33259
33160
|
},
|
|
33260
|
-
/* @__PURE__ */
|
|
33161
|
+
/* @__PURE__ */ React306.createElement(
|
|
33261
33162
|
Box66,
|
|
33262
33163
|
{
|
|
33263
33164
|
style: {
|
|
@@ -33274,8 +33175,8 @@ function PaletteItem({ item, isSelected, onClick, id }) {
|
|
|
33274
33175
|
},
|
|
33275
33176
|
item.icon
|
|
33276
33177
|
),
|
|
33277
|
-
/* @__PURE__ */
|
|
33278
|
-
|
|
33178
|
+
/* @__PURE__ */ React306.createElement(Stack211, { gap: 0, style: { overflow: "hidden", minWidth: 0, flex: 1 } }, /* @__PURE__ */ React306.createElement(
|
|
33179
|
+
Text185,
|
|
33279
33180
|
{
|
|
33280
33181
|
size: "sm",
|
|
33281
33182
|
fw: 500,
|
|
@@ -33285,8 +33186,8 @@ function PaletteItem({ item, isSelected, onClick, id }) {
|
|
|
33285
33186
|
}
|
|
33286
33187
|
},
|
|
33287
33188
|
item.title
|
|
33288
|
-
), item.subtext && /* @__PURE__ */
|
|
33289
|
-
|
|
33189
|
+
), item.subtext && /* @__PURE__ */ React306.createElement(
|
|
33190
|
+
Text185,
|
|
33290
33191
|
{
|
|
33291
33192
|
size: "xs",
|
|
33292
33193
|
truncate: true,
|
|
@@ -33299,7 +33200,7 @@ function PaletteItem({ item, isSelected, onClick, id }) {
|
|
|
33299
33200
|
);
|
|
33300
33201
|
}
|
|
33301
33202
|
function CommandPalette({ items, onItemClick, loadingState, selectedIndex }) {
|
|
33302
|
-
const groupedItems =
|
|
33203
|
+
const groupedItems = useMemo123(() => {
|
|
33303
33204
|
const groups = [];
|
|
33304
33205
|
let currentGroup;
|
|
33305
33206
|
for (let i = 0; i < items.length; i++) {
|
|
@@ -33312,14 +33213,14 @@ function CommandPalette({ items, onItemClick, loadingState, selectedIndex }) {
|
|
|
33312
33213
|
}
|
|
33313
33214
|
return groups;
|
|
33314
33215
|
}, [items]);
|
|
33315
|
-
const handleItemClick =
|
|
33216
|
+
const handleItemClick = useCallback122(
|
|
33316
33217
|
(item) => {
|
|
33317
33218
|
onItemClick?.(item);
|
|
33318
33219
|
},
|
|
33319
33220
|
[onItemClick]
|
|
33320
33221
|
);
|
|
33321
33222
|
if (loadingState === "loading-initial") {
|
|
33322
|
-
return /* @__PURE__ */
|
|
33223
|
+
return /* @__PURE__ */ React306.createElement(
|
|
33323
33224
|
Box66,
|
|
33324
33225
|
{
|
|
33325
33226
|
style: {
|
|
@@ -33331,10 +33232,10 @@ function CommandPalette({ items, onItemClick, loadingState, selectedIndex }) {
|
|
|
33331
33232
|
boxShadow: "0 4px 16px rgba(0, 0, 0, 0.2)"
|
|
33332
33233
|
}
|
|
33333
33234
|
},
|
|
33334
|
-
/* @__PURE__ */
|
|
33235
|
+
/* @__PURE__ */ React306.createElement(Text185, { size: "sm", style: { color: "var(--mantine-color-neutralColor-7) !important", textAlign: "center" } }, "Loading...")
|
|
33335
33236
|
);
|
|
33336
33237
|
}
|
|
33337
|
-
return /* @__PURE__ */
|
|
33238
|
+
return /* @__PURE__ */ React306.createElement(
|
|
33338
33239
|
Box66,
|
|
33339
33240
|
{
|
|
33340
33241
|
id: "bn-suggestion-menu",
|
|
@@ -33350,7 +33251,7 @@ function CommandPalette({ items, onItemClick, loadingState, selectedIndex }) {
|
|
|
33350
33251
|
padding: "6px 0"
|
|
33351
33252
|
}
|
|
33352
33253
|
},
|
|
33353
|
-
/* @__PURE__ */
|
|
33254
|
+
/* @__PURE__ */ React306.createElement(
|
|
33354
33255
|
Box66,
|
|
33355
33256
|
{
|
|
33356
33257
|
style: {
|
|
@@ -33361,8 +33262,8 @@ function CommandPalette({ items, onItemClick, loadingState, selectedIndex }) {
|
|
|
33361
33262
|
msOverflowStyle: "none"
|
|
33362
33263
|
}
|
|
33363
33264
|
},
|
|
33364
|
-
groupedItems.map((group) => /* @__PURE__ */
|
|
33365
|
-
|
|
33265
|
+
groupedItems.map((group) => /* @__PURE__ */ React306.createElement(React306.Fragment, { key: group.label }, /* @__PURE__ */ React306.createElement(
|
|
33266
|
+
Text185,
|
|
33366
33267
|
{
|
|
33367
33268
|
size: "xs",
|
|
33368
33269
|
fw: 600,
|
|
@@ -33375,7 +33276,7 @@ function CommandPalette({ items, onItemClick, loadingState, selectedIndex }) {
|
|
|
33375
33276
|
}
|
|
33376
33277
|
},
|
|
33377
33278
|
group.label
|
|
33378
|
-
), group.items.map(({ item, globalIndex }) => /* @__PURE__ */
|
|
33279
|
+
), group.items.map(({ item, globalIndex }) => /* @__PURE__ */ React306.createElement(
|
|
33379
33280
|
PaletteItem,
|
|
33380
33281
|
{
|
|
33381
33282
|
key: `${item.title}-${globalIndex}`,
|
|
@@ -33385,8 +33286,8 @@ function CommandPalette({ items, onItemClick, loadingState, selectedIndex }) {
|
|
|
33385
33286
|
id: `bn-suggestion-menu-item-${globalIndex}`
|
|
33386
33287
|
}
|
|
33387
33288
|
)))),
|
|
33388
|
-
items.length === 0 && (loadingState === "loaded" || loadingState === "loading") && /* @__PURE__ */
|
|
33389
|
-
|
|
33289
|
+
items.length === 0 && (loadingState === "loaded" || loadingState === "loading") && /* @__PURE__ */ React306.createElement(
|
|
33290
|
+
Text185,
|
|
33390
33291
|
{
|
|
33391
33292
|
size: "sm",
|
|
33392
33293
|
style: {
|
|
@@ -33422,7 +33323,7 @@ import {
|
|
|
33422
33323
|
} from "@tabler/icons-react";
|
|
33423
33324
|
|
|
33424
33325
|
// src/mantine/components/PanelContent.tsx
|
|
33425
|
-
import
|
|
33326
|
+
import React307 from "react";
|
|
33426
33327
|
import { Box as Box67 } from "@mantine/core";
|
|
33427
33328
|
var panelStyles = {
|
|
33428
33329
|
backgroundColor: "var(--mantine-color-body)",
|
|
@@ -33436,7 +33337,7 @@ function PanelContent({ theme: _theme }) {
|
|
|
33436
33337
|
const { activePanel, registeredPanels } = usePanelStore();
|
|
33437
33338
|
const isOpen = activePanel !== null;
|
|
33438
33339
|
const content = activePanel ? registeredPanels.get(activePanel) : null;
|
|
33439
|
-
return /* @__PURE__ */
|
|
33340
|
+
return /* @__PURE__ */ React307.createElement(
|
|
33440
33341
|
Box67,
|
|
33441
33342
|
{
|
|
33442
33343
|
pos: "sticky",
|
|
@@ -33455,8 +33356,8 @@ function PanelContent({ theme: _theme }) {
|
|
|
33455
33356
|
}
|
|
33456
33357
|
|
|
33457
33358
|
// src/mantine/components/CoverImage.tsx
|
|
33458
|
-
import
|
|
33459
|
-
import { Box as Box71, Group as
|
|
33359
|
+
import React312, { useState as useState150, useRef as useRef32, useEffect as useEffect121, useMemo as useMemo126 } from "react";
|
|
33360
|
+
import { Box as Box71, Group as Group117 } from "@mantine/core";
|
|
33460
33361
|
import { IconMoodSmile, IconPhoto as IconPhoto6, IconSettings as IconSettings22, IconArrowsMove, IconTrash as IconTrash11, IconRefresh as IconRefresh6 } from "@tabler/icons-react";
|
|
33461
33362
|
|
|
33462
33363
|
// src/core/lib/imageTransform.ts
|
|
@@ -33590,11 +33491,11 @@ function transformIconImage(sourceUrl, size = "default", customOptions) {
|
|
|
33590
33491
|
}
|
|
33591
33492
|
|
|
33592
33493
|
// src/mantine/components/Base/CoverImageButton.tsx
|
|
33593
|
-
import
|
|
33594
|
-
import { UnstyledButton as UnstyledButton7, Group as
|
|
33494
|
+
import React308, { forwardRef, useState as useState147 } from "react";
|
|
33495
|
+
import { UnstyledButton as UnstyledButton7, Group as Group114, Text as Text186 } from "@mantine/core";
|
|
33595
33496
|
var CoverImageButton = forwardRef(function CoverImageButton2({ isActive = false, onClick, icon: icon2, children, style }, ref) {
|
|
33596
|
-
const [hovered, setHovered] =
|
|
33597
|
-
return /* @__PURE__ */
|
|
33497
|
+
const [hovered, setHovered] = useState147(false);
|
|
33498
|
+
return /* @__PURE__ */ React308.createElement(
|
|
33598
33499
|
UnstyledButton7,
|
|
33599
33500
|
{
|
|
33600
33501
|
ref,
|
|
@@ -33610,7 +33511,7 @@ var CoverImageButton = forwardRef(function CoverImageButton2({ isActive = false,
|
|
|
33610
33511
|
...style
|
|
33611
33512
|
}
|
|
33612
33513
|
},
|
|
33613
|
-
/* @__PURE__ */
|
|
33514
|
+
/* @__PURE__ */ React308.createElement(Group114, { gap: 4, wrap: "nowrap" }, icon2 && /* @__PURE__ */ React308.createElement(
|
|
33614
33515
|
"span",
|
|
33615
33516
|
{
|
|
33616
33517
|
style: {
|
|
@@ -33620,8 +33521,8 @@ var CoverImageButton = forwardRef(function CoverImageButton2({ isActive = false,
|
|
|
33620
33521
|
}
|
|
33621
33522
|
},
|
|
33622
33523
|
icon2
|
|
33623
|
-
), /* @__PURE__ */
|
|
33624
|
-
|
|
33524
|
+
), /* @__PURE__ */ React308.createElement(
|
|
33525
|
+
Text186,
|
|
33625
33526
|
{
|
|
33626
33527
|
fz: 12,
|
|
33627
33528
|
style: {
|
|
@@ -33635,8 +33536,8 @@ var CoverImageButton = forwardRef(function CoverImageButton2({ isActive = false,
|
|
|
33635
33536
|
});
|
|
33636
33537
|
|
|
33637
33538
|
// src/mantine/components/Base/BaseIconPicker.tsx
|
|
33638
|
-
import
|
|
33639
|
-
import { TextInput as TextInput9, Tabs as Tabs4, Box as Box68, Stack as
|
|
33539
|
+
import React309, { useState as useState148, useMemo as useMemo124, useEffect as useEffect119 } from "react";
|
|
33540
|
+
import { TextInput as TextInput9, Tabs as Tabs4, Box as Box68, Stack as Stack212, UnstyledButton as UnstyledButton8, Text as Text187, Center as Center15, ScrollArea as ScrollArea10, Group as Group115, Popover as Popover6 } from "@mantine/core";
|
|
33640
33541
|
import * as TablerIcons2 from "@tabler/icons-react";
|
|
33641
33542
|
import { IconSearch as IconSearch9, IconX as IconX15, IconChevronLeft, IconChevronRight as IconChevronRight12 } from "@tabler/icons-react";
|
|
33642
33543
|
|
|
@@ -33668,28 +33569,28 @@ var localStorageService = {
|
|
|
33668
33569
|
var iconsKey = "editor_recent_icons";
|
|
33669
33570
|
var ICONS_PER_PAGE = 500;
|
|
33670
33571
|
function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove, children, currentIcon }) {
|
|
33671
|
-
const [searchQuery, setSearchQuery] =
|
|
33672
|
-
const [activeTab, setActiveTab] =
|
|
33673
|
-
const [currentPage, setCurrentPage] =
|
|
33674
|
-
const allIcons =
|
|
33572
|
+
const [searchQuery, setSearchQuery] = useState148("");
|
|
33573
|
+
const [activeTab, setActiveTab] = useState148("icons");
|
|
33574
|
+
const [currentPage, setCurrentPage] = useState148(1);
|
|
33575
|
+
const allIcons = useMemo124(() => {
|
|
33675
33576
|
const iconEntries = Object.entries(TablerIcons2).filter(([name]) => name.startsWith("Icon") && name !== "IconProps");
|
|
33676
33577
|
return iconEntries;
|
|
33677
33578
|
}, []);
|
|
33678
|
-
const filteredIcons =
|
|
33579
|
+
const filteredIcons = useMemo124(() => {
|
|
33679
33580
|
if (!searchQuery) return allIcons;
|
|
33680
33581
|
const query = searchQuery.toLowerCase();
|
|
33681
33582
|
return allIcons.filter(([name]) => name.toLowerCase().includes(query));
|
|
33682
33583
|
}, [allIcons, searchQuery]);
|
|
33683
|
-
|
|
33584
|
+
useEffect119(() => {
|
|
33684
33585
|
setCurrentPage(1);
|
|
33685
33586
|
}, [searchQuery]);
|
|
33686
|
-
const paginatedIcons =
|
|
33587
|
+
const paginatedIcons = useMemo124(() => {
|
|
33687
33588
|
const startIndex = (currentPage - 1) * ICONS_PER_PAGE;
|
|
33688
33589
|
const endIndex = startIndex + ICONS_PER_PAGE;
|
|
33689
33590
|
return filteredIcons.slice(startIndex, endIndex);
|
|
33690
33591
|
}, [filteredIcons, currentPage]);
|
|
33691
33592
|
const totalPages = Math.ceil(filteredIcons.length / ICONS_PER_PAGE);
|
|
33692
|
-
const recentIcons =
|
|
33593
|
+
const recentIcons = useMemo124(() => {
|
|
33693
33594
|
const recentIconNames = localStorageService.get(iconsKey);
|
|
33694
33595
|
if (!recentIconNames || recentIconNames.length === 0) return [];
|
|
33695
33596
|
return recentIconNames.slice(0, 24).map((iconName) => allIcons.find(([name]) => name === iconName)).filter((entry) => entry !== void 0);
|
|
@@ -33704,9 +33605,9 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
33704
33605
|
};
|
|
33705
33606
|
const renderIconGrid = (icons) => {
|
|
33706
33607
|
if (icons.length === 0) {
|
|
33707
|
-
return /* @__PURE__ */
|
|
33608
|
+
return /* @__PURE__ */ React309.createElement(Center15, { py: "xl" }, /* @__PURE__ */ React309.createElement(Text187, { c: "dimmed", size: "sm" }, "No icons found"));
|
|
33708
33609
|
}
|
|
33709
|
-
return /* @__PURE__ */
|
|
33610
|
+
return /* @__PURE__ */ React309.createElement(
|
|
33710
33611
|
Box68,
|
|
33711
33612
|
{
|
|
33712
33613
|
style: {
|
|
@@ -33718,7 +33619,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
33718
33619
|
},
|
|
33719
33620
|
icons.map(([name, IconComponent]) => {
|
|
33720
33621
|
const isSelected = currentIcon === name.replace("Icon", "").replace(/([A-Z])/g, "-$1").toLowerCase().slice(1);
|
|
33721
|
-
return /* @__PURE__ */
|
|
33622
|
+
return /* @__PURE__ */ React309.createElement(
|
|
33722
33623
|
UnstyledButton8,
|
|
33723
33624
|
{
|
|
33724
33625
|
key: name,
|
|
@@ -33744,12 +33645,12 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
33744
33645
|
}
|
|
33745
33646
|
}
|
|
33746
33647
|
},
|
|
33747
|
-
/* @__PURE__ */
|
|
33648
|
+
/* @__PURE__ */ React309.createElement(IconComponent, { size: 24, stroke: 1.5, color: "var(--mantine-color-text)" })
|
|
33748
33649
|
);
|
|
33749
33650
|
})
|
|
33750
33651
|
);
|
|
33751
33652
|
};
|
|
33752
|
-
return /* @__PURE__ */
|
|
33653
|
+
return /* @__PURE__ */ React309.createElement(Popover6, { opened, onClose, position: "right", width: 500, shadow: "xl" }, /* @__PURE__ */ React309.createElement(Popover6.Target, null, children), /* @__PURE__ */ React309.createElement(
|
|
33753
33654
|
Popover6.Dropdown,
|
|
33754
33655
|
{
|
|
33755
33656
|
style: {
|
|
@@ -33759,7 +33660,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
33759
33660
|
},
|
|
33760
33661
|
p: 0
|
|
33761
33662
|
},
|
|
33762
|
-
onRemove && /* @__PURE__ */
|
|
33663
|
+
onRemove && /* @__PURE__ */ React309.createElement(
|
|
33763
33664
|
UnstyledButton8,
|
|
33764
33665
|
{
|
|
33765
33666
|
onClick: () => {
|
|
@@ -33776,17 +33677,17 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
33776
33677
|
transition: "background 0.15s ease"
|
|
33777
33678
|
}
|
|
33778
33679
|
},
|
|
33779
|
-
/* @__PURE__ */
|
|
33680
|
+
/* @__PURE__ */ React309.createElement(Group115, { gap: 4, wrap: "nowrap" }, /* @__PURE__ */ React309.createElement(IconX15, { size: 14 }), /* @__PURE__ */ React309.createElement(Text187, { fz: 12, c: "dimmed", style: { whiteSpace: "nowrap" } }, "Remove"))
|
|
33780
33681
|
),
|
|
33781
|
-
/* @__PURE__ */
|
|
33682
|
+
/* @__PURE__ */ React309.createElement(Stack212, { gap: "md", p: "md" }, /* @__PURE__ */ React309.createElement(Tabs4, { value: activeTab, onChange: setActiveTab, variant: "pills" }, /* @__PURE__ */ React309.createElement(Tabs4.List, null, /* @__PURE__ */ React309.createElement(Tabs4.Tab, { value: "icons" }, "Icons"), /* @__PURE__ */ React309.createElement(Tabs4.Tab, { value: "upload" }, "Upload")), /* @__PURE__ */ React309.createElement(Tabs4.Panel, { value: "icons", pt: "md" }, /* @__PURE__ */ React309.createElement(
|
|
33782
33683
|
TextInput9,
|
|
33783
33684
|
{
|
|
33784
33685
|
mb: "md",
|
|
33785
33686
|
placeholder: "Filter",
|
|
33786
|
-
leftSection: /* @__PURE__ */
|
|
33687
|
+
leftSection: /* @__PURE__ */ React309.createElement(IconSearch9, { size: 18 }),
|
|
33787
33688
|
value: searchQuery,
|
|
33788
33689
|
onChange: (e) => setSearchQuery(e.currentTarget.value),
|
|
33789
|
-
rightSection: searchQuery && /* @__PURE__ */
|
|
33690
|
+
rightSection: searchQuery && /* @__PURE__ */ React309.createElement(UnstyledButton8, { onClick: () => setSearchQuery("") }, /* @__PURE__ */ React309.createElement(IconX15, { size: 18 })),
|
|
33790
33691
|
style: { flex: 1 },
|
|
33791
33692
|
styles: {
|
|
33792
33693
|
input: {
|
|
@@ -33796,26 +33697,26 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
33796
33697
|
}
|
|
33797
33698
|
}
|
|
33798
33699
|
}
|
|
33799
|
-
), !searchQuery && /* @__PURE__ */
|
|
33700
|
+
), !searchQuery && /* @__PURE__ */ React309.createElement(Box68, { mb: "md" }, /* @__PURE__ */ React309.createElement(Text187, { size: "sm", fw: 500, mb: "xs", px: "xs" }, "Recent"), /* @__PURE__ */ React309.createElement(ScrollArea10.Autosize, { scrollbarSize: 0, mah: 60 }, renderIconGrid(recentIcons))), /* @__PURE__ */ React309.createElement(Box68, null, /* @__PURE__ */ React309.createElement(Group115, { justify: "space-between", mb: "xs", px: "xs" }, /* @__PURE__ */ React309.createElement(Text187, { size: "sm", fw: 500 }, searchQuery ? "Results" : "Icons"), totalPages > 1 && /* @__PURE__ */ React309.createElement(Group115, { gap: "xs" }, /* @__PURE__ */ React309.createElement(Text187, { size: "xs", c: "dimmed" }, "Page ", currentPage, " of ", totalPages, " (", filteredIcons.length, " total)"), /* @__PURE__ */ React309.createElement(BaseButton, { size: "xs", onClick: () => setCurrentPage((p) => Math.max(1, p - 1)), disabled: currentPage === 1, leftSection: /* @__PURE__ */ React309.createElement(IconChevronLeft, { size: 14 }) }, "Prev"), /* @__PURE__ */ React309.createElement(
|
|
33800
33701
|
BaseButton,
|
|
33801
33702
|
{
|
|
33802
33703
|
size: "xs",
|
|
33803
33704
|
onClick: () => setCurrentPage((p) => Math.min(totalPages, p + 1)),
|
|
33804
33705
|
disabled: currentPage === totalPages,
|
|
33805
|
-
leftSection: /* @__PURE__ */
|
|
33706
|
+
leftSection: /* @__PURE__ */ React309.createElement(IconChevronRight12, { size: 14 })
|
|
33806
33707
|
},
|
|
33807
33708
|
"Next"
|
|
33808
|
-
))), /* @__PURE__ */
|
|
33709
|
+
))), /* @__PURE__ */ React309.createElement(ScrollArea10.Autosize, { scrollbarSize: 0, mah: 200 }, renderIconGrid(paginatedIcons)))), /* @__PURE__ */ React309.createElement(Tabs4.Panel, { value: "upload", pt: "md" }, /* @__PURE__ */ React309.createElement(Center15, { py: "xl" }, /* @__PURE__ */ React309.createElement(Stack212, { align: "center", gap: "md" }, /* @__PURE__ */ React309.createElement(Text187, { size: "sm", c: "dimmed", ta: "center" }, "Upload a custom icon image", /* @__PURE__ */ React309.createElement("br", null), "(PNG, JPG, SVG)"), /* @__PURE__ */ React309.createElement(CoverImageButton, { onClick: onUploadClick }, "Choose File"))))))
|
|
33809
33710
|
));
|
|
33810
33711
|
}
|
|
33811
33712
|
|
|
33812
33713
|
// src/mantine/components/Base/PageIcon.tsx
|
|
33813
|
-
import
|
|
33714
|
+
import React310, { useMemo as useMemo125 } from "react";
|
|
33814
33715
|
import { Center as Center16, Box as Box69 } from "@mantine/core";
|
|
33815
33716
|
import * as TablerIcons3 from "@tabler/icons-react";
|
|
33816
33717
|
function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
33817
33718
|
const isIconName = src && !src.startsWith("http");
|
|
33818
|
-
const IconComponent =
|
|
33719
|
+
const IconComponent = useMemo125(() => {
|
|
33819
33720
|
if (!isIconName || !src) return null;
|
|
33820
33721
|
const iconComponent = TablerIcons3[src];
|
|
33821
33722
|
if (iconComponent) {
|
|
@@ -33826,7 +33727,7 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
33826
33727
|
const Container = useCenter ? Center16 : Box69;
|
|
33827
33728
|
if (!src) return null;
|
|
33828
33729
|
if (IconComponent) {
|
|
33829
|
-
return /* @__PURE__ */
|
|
33730
|
+
return /* @__PURE__ */ React310.createElement(
|
|
33830
33731
|
Container,
|
|
33831
33732
|
{
|
|
33832
33733
|
style: {
|
|
@@ -33842,10 +33743,10 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
33842
33743
|
...style
|
|
33843
33744
|
}
|
|
33844
33745
|
},
|
|
33845
|
-
/* @__PURE__ */
|
|
33746
|
+
/* @__PURE__ */ React310.createElement(IconComponent, { size: iconSize, stroke: 1.5, color: "var(--mantine-color-text)" })
|
|
33846
33747
|
);
|
|
33847
33748
|
}
|
|
33848
|
-
return /* @__PURE__ */
|
|
33749
|
+
return /* @__PURE__ */ React310.createElement(
|
|
33849
33750
|
"img",
|
|
33850
33751
|
{
|
|
33851
33752
|
src,
|
|
@@ -33866,14 +33767,14 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
33866
33767
|
import { useDisclosure as useDisclosure7 } from "@mantine/hooks";
|
|
33867
33768
|
|
|
33868
33769
|
// src/mantine/components/FlowSettingsPanel.tsx
|
|
33869
|
-
import
|
|
33870
|
-
import { Stack as
|
|
33770
|
+
import React311, { useState as useState149, useEffect as useEffect120, useCallback as useCallback123 } from "react";
|
|
33771
|
+
import { Stack as Stack213, Group as Group116, Button as Button61, ActionIcon as ActionIcon42, Text as Text188, Box as Box70 } from "@mantine/core";
|
|
33871
33772
|
import { IconPlus as IconPlus10, IconTrash as IconTrash10 } from "@tabler/icons-react";
|
|
33872
33773
|
var SYSTEM_KEYS = /* @__PURE__ */ new Set(["@context", "_type", "schema_version", "doc_id", "title", "createdAt", "createdBy", "flowOwnerDid"]);
|
|
33873
33774
|
var FlowSettingsPanel = ({ editor }) => {
|
|
33874
33775
|
const { closePanel } = usePanelStore();
|
|
33875
|
-
const [rows, setRows] =
|
|
33876
|
-
const loadSettings =
|
|
33776
|
+
const [rows, setRows] = useState149([]);
|
|
33777
|
+
const loadSettings = useCallback123(() => {
|
|
33877
33778
|
const metadata = editor.getFlowMetadata?.();
|
|
33878
33779
|
if (!metadata) return;
|
|
33879
33780
|
const customRows = [];
|
|
@@ -33884,10 +33785,10 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
33884
33785
|
}
|
|
33885
33786
|
setRows(customRows);
|
|
33886
33787
|
}, [editor]);
|
|
33887
|
-
|
|
33788
|
+
useEffect120(() => {
|
|
33888
33789
|
loadSettings();
|
|
33889
33790
|
}, [loadSettings]);
|
|
33890
|
-
const handleKeyChange =
|
|
33791
|
+
const handleKeyChange = useCallback123(
|
|
33891
33792
|
(index, newKey) => {
|
|
33892
33793
|
setRows((prev) => {
|
|
33893
33794
|
const updated = [...prev];
|
|
@@ -33904,7 +33805,7 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
33904
33805
|
},
|
|
33905
33806
|
[editor]
|
|
33906
33807
|
);
|
|
33907
|
-
const handleValueChange =
|
|
33808
|
+
const handleValueChange = useCallback123(
|
|
33908
33809
|
(index, newValue) => {
|
|
33909
33810
|
setRows((prev) => {
|
|
33910
33811
|
const updated = [...prev];
|
|
@@ -33918,10 +33819,10 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
33918
33819
|
},
|
|
33919
33820
|
[editor]
|
|
33920
33821
|
);
|
|
33921
|
-
const handleAdd =
|
|
33822
|
+
const handleAdd = useCallback123(() => {
|
|
33922
33823
|
setRows((prev) => [...prev, { key: "", value: "" }]);
|
|
33923
33824
|
}, []);
|
|
33924
|
-
const handleDelete =
|
|
33825
|
+
const handleDelete = useCallback123(
|
|
33925
33826
|
(index) => {
|
|
33926
33827
|
setRows((prev) => {
|
|
33927
33828
|
const row = prev[index];
|
|
@@ -33933,23 +33834,23 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
33933
33834
|
},
|
|
33934
33835
|
[editor]
|
|
33935
33836
|
);
|
|
33936
|
-
const subtitle = /* @__PURE__ */
|
|
33937
|
-
return /* @__PURE__ */
|
|
33837
|
+
const subtitle = /* @__PURE__ */ React311.createElement(Box70, { px: 40, mb: "md" }, /* @__PURE__ */ React311.createElement(Text188, { size: "sm", c: "dimmed" }, "Add key-value settings for this flow. These are available to oracles and action blocks at runtime."));
|
|
33838
|
+
return /* @__PURE__ */ React311.createElement(BaseRightPanelLayout, { title: "Flow Details", onClose: closePanel, isTemplate: true, captionContent: subtitle }, /* @__PURE__ */ React311.createElement(Stack213, { gap: "lg" }, rows.map((row, index) => /* @__PURE__ */ React311.createElement(Stack213, { key: index, gap: "xs" }, /* @__PURE__ */ React311.createElement(Group116, { gap: "xs", align: "center", wrap: "nowrap" }, /* @__PURE__ */ React311.createElement(BaseTextInput, { placeholder: "Key (e.g. protocolDid)", value: row.key, onChange: (e) => handleKeyChange(index, e.currentTarget.value), style: { flex: 1 } }), /* @__PURE__ */ React311.createElement(ActionIcon42, { variant: "subtle", color: "red", onClick: () => handleDelete(index), size: "lg" }, /* @__PURE__ */ React311.createElement(IconTrash10, { size: 16 }))), /* @__PURE__ */ React311.createElement(BaseTextArea, { placeholder: "Value", value: row.value, onChange: (e) => handleValueChange(index, e.currentTarget.value), minRows: 1, maxRows: 8 }))), /* @__PURE__ */ React311.createElement(Button61, { variant: "subtle", leftSection: /* @__PURE__ */ React311.createElement(IconPlus10, { size: 16 }), onClick: handleAdd, size: "sm" }, "Add detail")));
|
|
33938
33839
|
};
|
|
33939
33840
|
|
|
33940
33841
|
// src/mantine/components/CoverImage.tsx
|
|
33941
33842
|
function CoverImage({ coverImageUrl, logoUrl }) {
|
|
33942
33843
|
const { editor, handlers, editable } = useBlocknoteContext();
|
|
33943
|
-
const [isHovering, setIsHovering] =
|
|
33944
|
-
const [isRepositioning, setIsRepositioning] =
|
|
33945
|
-
const [coverPosition, setCoverPosition] =
|
|
33844
|
+
const [isHovering, setIsHovering] = useState150(false);
|
|
33845
|
+
const [isRepositioning, setIsRepositioning] = useState150(false);
|
|
33846
|
+
const [coverPosition, setCoverPosition] = useState150(() => editor?.getPageMetadata?.()?.coverPosition ?? 50);
|
|
33946
33847
|
const coverFileInputRef = useRef32(null);
|
|
33947
33848
|
const logoFileInputRef = useRef32(null);
|
|
33948
33849
|
const [opened, { open, close }] = useDisclosure7(false);
|
|
33949
|
-
const [metadata, setMetadata] =
|
|
33950
|
-
const settingsPanelContent =
|
|
33850
|
+
const [metadata, setMetadata] = useState150(() => editor?.getPageMetadata?.() || null);
|
|
33851
|
+
const settingsPanelContent = useMemo126(() => editor ? /* @__PURE__ */ React312.createElement(FlowSettingsPanel, { editor }) : null, [editor]);
|
|
33951
33852
|
const { open: openSettings } = usePanel("flow-settings-panel", settingsPanelContent);
|
|
33952
|
-
|
|
33853
|
+
useEffect121(() => {
|
|
33953
33854
|
if (!editor?._metadataManager) {
|
|
33954
33855
|
return;
|
|
33955
33856
|
}
|
|
@@ -34037,7 +33938,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
34037
33938
|
return null;
|
|
34038
33939
|
}
|
|
34039
33940
|
if (!hasCover) {
|
|
34040
|
-
return /* @__PURE__ */
|
|
33941
|
+
return /* @__PURE__ */ React312.createElement(
|
|
34041
33942
|
Box71,
|
|
34042
33943
|
{
|
|
34043
33944
|
style: {
|
|
@@ -34049,7 +33950,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
34049
33950
|
onMouseEnter: () => editable && setIsHovering(true),
|
|
34050
33951
|
onMouseLeave: () => editable && setIsHovering(false)
|
|
34051
33952
|
},
|
|
34052
|
-
/* @__PURE__ */
|
|
33953
|
+
/* @__PURE__ */ React312.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "relative", minHeight: "inherit" } }, /* @__PURE__ */ React312.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }), /* @__PURE__ */ React312.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") }), logoSrc && /* @__PURE__ */ React312.createElement(
|
|
34053
33954
|
Box71,
|
|
34054
33955
|
{
|
|
34055
33956
|
style: {
|
|
@@ -34062,8 +33963,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
34062
33963
|
zIndex: 11
|
|
34063
33964
|
}
|
|
34064
33965
|
},
|
|
34065
|
-
/* @__PURE__ */
|
|
34066
|
-
editable && /* @__PURE__ */
|
|
33966
|
+
/* @__PURE__ */ React312.createElement(PageIcon, { src: logoSrc, useCenter: true, iconSize: 64 }),
|
|
33967
|
+
editable && /* @__PURE__ */ React312.createElement(
|
|
34067
33968
|
BaseIconPicker,
|
|
34068
33969
|
{
|
|
34069
33970
|
opened,
|
|
@@ -34073,7 +33974,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
34073
33974
|
onUploadClick: () => logoFileInputRef.current?.click(),
|
|
34074
33975
|
onRemove: handleRemoveLogo
|
|
34075
33976
|
},
|
|
34076
|
-
/* @__PURE__ */
|
|
33977
|
+
/* @__PURE__ */ React312.createElement(
|
|
34077
33978
|
Box71,
|
|
34078
33979
|
{
|
|
34079
33980
|
onClick: open,
|
|
@@ -34086,7 +33987,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
34086
33987
|
}
|
|
34087
33988
|
)
|
|
34088
33989
|
)
|
|
34089
|
-
), editable && (isHovering || opened) && /* @__PURE__ */
|
|
33990
|
+
), editable && (isHovering || opened) && /* @__PURE__ */ React312.createElement(Group117, { gap: 4, style: { position: "absolute", bottom: hasLogo ? -18 : 0, left: 0, zIndex: 10 } }, !logoSrc && /* @__PURE__ */ React312.createElement(
|
|
34090
33991
|
BaseIconPicker,
|
|
34091
33992
|
{
|
|
34092
33993
|
opened,
|
|
@@ -34095,11 +33996,11 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
34095
33996
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
34096
33997
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
34097
33998
|
},
|
|
34098
|
-
/* @__PURE__ */
|
|
34099
|
-
), /* @__PURE__ */
|
|
33999
|
+
/* @__PURE__ */ React312.createElement(CoverImageButton, { onClick: open, icon: /* @__PURE__ */ React312.createElement(IconMoodSmile, { size: 14 }) }, "Add icon")
|
|
34000
|
+
), /* @__PURE__ */ React312.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click(), icon: /* @__PURE__ */ React312.createElement(IconPhoto6, { size: 14 }) }, "Add cover"), /* @__PURE__ */ React312.createElement(CoverImageButton, { onClick: openSettings, icon: /* @__PURE__ */ React312.createElement(IconSettings22, { size: 14 }) }, "Details")))
|
|
34100
34001
|
);
|
|
34101
34002
|
}
|
|
34102
|
-
return /* @__PURE__ */
|
|
34003
|
+
return /* @__PURE__ */ React312.createElement(
|
|
34103
34004
|
Box71,
|
|
34104
34005
|
{
|
|
34105
34006
|
style: {
|
|
@@ -34127,7 +34028,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
34127
34028
|
}
|
|
34128
34029
|
}
|
|
34129
34030
|
},
|
|
34130
|
-
/* @__PURE__ */
|
|
34031
|
+
/* @__PURE__ */ React312.createElement(
|
|
34131
34032
|
"img",
|
|
34132
34033
|
{
|
|
34133
34034
|
src: coverUrl,
|
|
@@ -34145,8 +34046,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
34145
34046
|
}
|
|
34146
34047
|
}
|
|
34147
34048
|
),
|
|
34148
|
-
editable && isHovering && /* @__PURE__ */
|
|
34149
|
-
|
|
34049
|
+
editable && isHovering && /* @__PURE__ */ React312.createElement(
|
|
34050
|
+
Group117,
|
|
34150
34051
|
{
|
|
34151
34052
|
gap: "xs",
|
|
34152
34053
|
style: {
|
|
@@ -34156,8 +34057,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
34156
34057
|
zIndex: 10
|
|
34157
34058
|
}
|
|
34158
34059
|
},
|
|
34159
|
-
/* @__PURE__ */
|
|
34160
|
-
/* @__PURE__ */
|
|
34060
|
+
/* @__PURE__ */ React312.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click(), icon: /* @__PURE__ */ React312.createElement(IconRefresh6, { size: 14 }) }, "Change cover"),
|
|
34061
|
+
/* @__PURE__ */ React312.createElement(
|
|
34161
34062
|
CoverImageButton,
|
|
34162
34063
|
{
|
|
34163
34064
|
onClick: () => {
|
|
@@ -34167,13 +34068,13 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
34167
34068
|
setIsRepositioning(!isRepositioning);
|
|
34168
34069
|
},
|
|
34169
34070
|
isActive: isRepositioning,
|
|
34170
|
-
icon: /* @__PURE__ */
|
|
34071
|
+
icon: /* @__PURE__ */ React312.createElement(IconArrowsMove, { size: 14 })
|
|
34171
34072
|
},
|
|
34172
34073
|
isRepositioning ? "Done" : "Reposition"
|
|
34173
34074
|
),
|
|
34174
|
-
/* @__PURE__ */
|
|
34075
|
+
/* @__PURE__ */ React312.createElement(CoverImageButton, { onClick: handleRemoveCover, icon: /* @__PURE__ */ React312.createElement(IconTrash11, { size: 14 }) }, "Remove")
|
|
34175
34076
|
),
|
|
34176
|
-
/* @__PURE__ */
|
|
34077
|
+
/* @__PURE__ */ React312.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "absolute", bottom: 0, left: 0, right: 0, height: "70px" } }, /* @__PURE__ */ React312.createElement(
|
|
34177
34078
|
Box71,
|
|
34178
34079
|
{
|
|
34179
34080
|
style: {
|
|
@@ -34185,7 +34086,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
34185
34086
|
zIndex: 11
|
|
34186
34087
|
}
|
|
34187
34088
|
},
|
|
34188
|
-
logoSrc ? /* @__PURE__ */
|
|
34089
|
+
logoSrc ? /* @__PURE__ */ React312.createElement(React312.Fragment, null, /* @__PURE__ */ React312.createElement(PageIcon, { src: logoSrc, useCenter: true, iconSize: 64 }), editable && /* @__PURE__ */ React312.createElement(
|
|
34189
34090
|
BaseIconPicker,
|
|
34190
34091
|
{
|
|
34191
34092
|
opened,
|
|
@@ -34195,7 +34096,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
34195
34096
|
onUploadClick: () => logoFileInputRef.current?.click(),
|
|
34196
34097
|
onRemove: handleRemoveLogo
|
|
34197
34098
|
},
|
|
34198
|
-
/* @__PURE__ */
|
|
34099
|
+
/* @__PURE__ */ React312.createElement(
|
|
34199
34100
|
Box71,
|
|
34200
34101
|
{
|
|
34201
34102
|
onClick: open,
|
|
@@ -34207,7 +34108,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
34207
34108
|
}
|
|
34208
34109
|
}
|
|
34209
34110
|
)
|
|
34210
|
-
)) : editable && isHovering && /* @__PURE__ */
|
|
34111
|
+
)) : editable && isHovering && /* @__PURE__ */ React312.createElement(
|
|
34211
34112
|
BaseIconPicker,
|
|
34212
34113
|
{
|
|
34213
34114
|
opened,
|
|
@@ -34216,11 +34117,11 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
34216
34117
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
34217
34118
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
34218
34119
|
},
|
|
34219
|
-
/* @__PURE__ */
|
|
34120
|
+
/* @__PURE__ */ React312.createElement(
|
|
34220
34121
|
CoverImageButton,
|
|
34221
34122
|
{
|
|
34222
34123
|
onClick: open,
|
|
34223
|
-
icon: /* @__PURE__ */
|
|
34124
|
+
icon: /* @__PURE__ */ React312.createElement(IconMoodSmile, { size: 14 }),
|
|
34224
34125
|
style: {
|
|
34225
34126
|
position: "absolute",
|
|
34226
34127
|
top: "50%",
|
|
@@ -34233,13 +34134,13 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
34233
34134
|
)
|
|
34234
34135
|
)
|
|
34235
34136
|
)),
|
|
34236
|
-
/* @__PURE__ */
|
|
34237
|
-
/* @__PURE__ */
|
|
34137
|
+
/* @__PURE__ */ React312.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }),
|
|
34138
|
+
/* @__PURE__ */ React312.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") })
|
|
34238
34139
|
);
|
|
34239
34140
|
}
|
|
34240
34141
|
|
|
34241
34142
|
// src/mantine/components/PageTitle.tsx
|
|
34242
|
-
import
|
|
34143
|
+
import React313, { useState as useState151, useEffect as useEffect122, useRef as useRef33, useCallback as useCallback124 } from "react";
|
|
34243
34144
|
import { Box as Box72 } from "@mantine/core";
|
|
34244
34145
|
var DEFAULT_TITLE = "New page";
|
|
34245
34146
|
function isUserTitle(name) {
|
|
@@ -34255,11 +34156,11 @@ function cleanEmptyEditable(el) {
|
|
|
34255
34156
|
}
|
|
34256
34157
|
}
|
|
34257
34158
|
function PageTitle({ editor, editable }) {
|
|
34258
|
-
const [title, setTitle] =
|
|
34259
|
-
const [hasIcon, setHasIcon] =
|
|
34159
|
+
const [title, setTitle] = useState151("");
|
|
34160
|
+
const [hasIcon, setHasIcon] = useState151(false);
|
|
34260
34161
|
const titleRef = useRef33(null);
|
|
34261
34162
|
const isComposing = useRef33(false);
|
|
34262
|
-
|
|
34163
|
+
useEffect122(() => {
|
|
34263
34164
|
if (!editor?._metadataManager) return;
|
|
34264
34165
|
const metadata = editor._metadataManager.getMetadata();
|
|
34265
34166
|
const initial = isUserTitle(metadata?.title);
|
|
@@ -34279,12 +34180,12 @@ function PageTitle({ editor, editable }) {
|
|
|
34279
34180
|
});
|
|
34280
34181
|
return unsubscribe;
|
|
34281
34182
|
}, [editor]);
|
|
34282
|
-
|
|
34183
|
+
useEffect122(() => {
|
|
34283
34184
|
if (titleRef.current && title && !titleRef.current.textContent) {
|
|
34284
34185
|
titleRef.current.textContent = title;
|
|
34285
34186
|
}
|
|
34286
34187
|
}, [title]);
|
|
34287
|
-
const saveTitle =
|
|
34188
|
+
const saveTitle = useCallback124(
|
|
34288
34189
|
async (newTitle) => {
|
|
34289
34190
|
const trimmed = newTitle.trim();
|
|
34290
34191
|
const toSave = trimmed || DEFAULT_TITLE;
|
|
@@ -34300,19 +34201,19 @@ function PageTitle({ editor, editable }) {
|
|
|
34300
34201
|
},
|
|
34301
34202
|
[editor]
|
|
34302
34203
|
);
|
|
34303
|
-
const handleInput =
|
|
34204
|
+
const handleInput = useCallback124(() => {
|
|
34304
34205
|
if (titleRef.current) {
|
|
34305
34206
|
cleanEmptyEditable(titleRef.current);
|
|
34306
34207
|
setTitle(titleRef.current.textContent || "");
|
|
34307
34208
|
}
|
|
34308
34209
|
}, []);
|
|
34309
|
-
const handleBlur =
|
|
34210
|
+
const handleBlur = useCallback124(() => {
|
|
34310
34211
|
if (titleRef.current) {
|
|
34311
34212
|
cleanEmptyEditable(titleRef.current);
|
|
34312
34213
|
saveTitle(titleRef.current.textContent || "");
|
|
34313
34214
|
}
|
|
34314
34215
|
}, [saveTitle]);
|
|
34315
|
-
const handleKeyDown =
|
|
34216
|
+
const handleKeyDown = useCallback124(
|
|
34316
34217
|
(e) => {
|
|
34317
34218
|
if (isComposing.current) return;
|
|
34318
34219
|
if (e.key === "Enter" || e.key === "ArrowDown") {
|
|
@@ -34323,7 +34224,7 @@ function PageTitle({ editor, editable }) {
|
|
|
34323
34224
|
},
|
|
34324
34225
|
[editor, saveTitle]
|
|
34325
34226
|
);
|
|
34326
|
-
|
|
34227
|
+
useEffect122(() => {
|
|
34327
34228
|
const handleEditorKeyDown = (e) => {
|
|
34328
34229
|
if (e.key !== "ArrowUp" || !titleRef.current) return;
|
|
34329
34230
|
if (document.getElementById("bn-suggestion-menu")) return;
|
|
@@ -34347,12 +34248,12 @@ function PageTitle({ editor, editable }) {
|
|
|
34347
34248
|
container?.removeEventListener("keydown", handleEditorKeyDown, true);
|
|
34348
34249
|
};
|
|
34349
34250
|
}, [editor]);
|
|
34350
|
-
const handlePaste =
|
|
34251
|
+
const handlePaste = useCallback124((e) => {
|
|
34351
34252
|
e.preventDefault();
|
|
34352
34253
|
const text = e.clipboardData.getData("text/plain").replace(/\n/g, " ");
|
|
34353
34254
|
document.execCommand("insertText", false, text);
|
|
34354
34255
|
}, []);
|
|
34355
|
-
return /* @__PURE__ */
|
|
34256
|
+
return /* @__PURE__ */ React313.createElement(Box72, { maw: 900, mx: "auto", w: "100%" }, /* @__PURE__ */ React313.createElement(
|
|
34356
34257
|
Box72,
|
|
34357
34258
|
{
|
|
34358
34259
|
ref: titleRef,
|
|
@@ -34409,7 +34310,7 @@ if (typeof document !== "undefined") {
|
|
|
34409
34310
|
}
|
|
34410
34311
|
|
|
34411
34312
|
// src/mantine/components/ExternalDropZone.tsx
|
|
34412
|
-
import
|
|
34313
|
+
import React314, { useCallback as useCallback125, useEffect as useEffect123, useRef as useRef34, useState as useState152 } from "react";
|
|
34413
34314
|
import { Box as Box73 } from "@mantine/core";
|
|
34414
34315
|
var SCROLL_ZONE_SIZE = 80;
|
|
34415
34316
|
var SCROLL_SPEED = 12;
|
|
@@ -34423,19 +34324,19 @@ var ExternalDropZone = ({
|
|
|
34423
34324
|
children
|
|
34424
34325
|
}) => {
|
|
34425
34326
|
const containerRef = useRef34(null);
|
|
34426
|
-
const [isValidDrag, setIsValidDrag] =
|
|
34427
|
-
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] =
|
|
34428
|
-
const [indicatorStyle, setIndicatorStyle] =
|
|
34327
|
+
const [isValidDrag, setIsValidDrag] = useState152(false);
|
|
34328
|
+
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] = useState152(false);
|
|
34329
|
+
const [indicatorStyle, setIndicatorStyle] = useState152({});
|
|
34429
34330
|
const dropPositionRef = useRef34(null);
|
|
34430
34331
|
const scrollAnimationRef = useRef34(null);
|
|
34431
34332
|
const scrollDirectionRef = useRef34(null);
|
|
34432
34333
|
const scrollContainerRef = useRef34(null);
|
|
34433
|
-
const getBlockElements =
|
|
34334
|
+
const getBlockElements = useCallback125(() => {
|
|
34434
34335
|
if (!containerRef.current) return [];
|
|
34435
34336
|
const blocks = containerRef.current.querySelectorAll('[data-node-type="blockContainer"]');
|
|
34436
34337
|
return Array.from(blocks);
|
|
34437
34338
|
}, []);
|
|
34438
|
-
const getScrollContainer =
|
|
34339
|
+
const getScrollContainer = useCallback125(() => {
|
|
34439
34340
|
if (scrollContainerRef.current) return scrollContainerRef.current;
|
|
34440
34341
|
let element = containerRef.current;
|
|
34441
34342
|
while (element) {
|
|
@@ -34450,7 +34351,7 @@ var ExternalDropZone = ({
|
|
|
34450
34351
|
scrollContainerRef.current = window;
|
|
34451
34352
|
return window;
|
|
34452
34353
|
}, []);
|
|
34453
|
-
const performScroll =
|
|
34354
|
+
const performScroll = useCallback125(() => {
|
|
34454
34355
|
const container = getScrollContainer();
|
|
34455
34356
|
const direction = scrollDirectionRef.current;
|
|
34456
34357
|
if (!direction) {
|
|
@@ -34465,7 +34366,7 @@ var ExternalDropZone = ({
|
|
|
34465
34366
|
}
|
|
34466
34367
|
scrollAnimationRef.current = requestAnimationFrame(performScroll);
|
|
34467
34368
|
}, [getScrollContainer]);
|
|
34468
|
-
const startAutoScroll =
|
|
34369
|
+
const startAutoScroll = useCallback125(
|
|
34469
34370
|
(direction) => {
|
|
34470
34371
|
if (scrollDirectionRef.current === direction) return;
|
|
34471
34372
|
scrollDirectionRef.current = direction;
|
|
@@ -34475,14 +34376,14 @@ var ExternalDropZone = ({
|
|
|
34475
34376
|
},
|
|
34476
34377
|
[performScroll]
|
|
34477
34378
|
);
|
|
34478
|
-
const stopAutoScroll =
|
|
34379
|
+
const stopAutoScroll = useCallback125(() => {
|
|
34479
34380
|
scrollDirectionRef.current = null;
|
|
34480
34381
|
if (scrollAnimationRef.current) {
|
|
34481
34382
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
34482
34383
|
scrollAnimationRef.current = null;
|
|
34483
34384
|
}
|
|
34484
34385
|
}, []);
|
|
34485
|
-
const checkAutoScroll =
|
|
34386
|
+
const checkAutoScroll = useCallback125(
|
|
34486
34387
|
(clientY) => {
|
|
34487
34388
|
const container = getScrollContainer();
|
|
34488
34389
|
let containerTop;
|
|
@@ -34505,7 +34406,7 @@ var ExternalDropZone = ({
|
|
|
34505
34406
|
},
|
|
34506
34407
|
[getScrollContainer, startAutoScroll, stopAutoScroll]
|
|
34507
34408
|
);
|
|
34508
|
-
const findDropPosition =
|
|
34409
|
+
const findDropPosition = useCallback125(
|
|
34509
34410
|
(clientY) => {
|
|
34510
34411
|
const blocks = getBlockElements();
|
|
34511
34412
|
if (blocks.length === 0 || !editor?.document) return null;
|
|
@@ -34538,7 +34439,7 @@ var ExternalDropZone = ({
|
|
|
34538
34439
|
},
|
|
34539
34440
|
[getBlockElements, editor]
|
|
34540
34441
|
);
|
|
34541
|
-
const handleDragOver =
|
|
34442
|
+
const handleDragOver = useCallback125(
|
|
34542
34443
|
(e) => {
|
|
34543
34444
|
if (!e.dataTransfer.types.includes(acceptedType)) return;
|
|
34544
34445
|
e.preventDefault();
|
|
@@ -34561,7 +34462,7 @@ var ExternalDropZone = ({
|
|
|
34561
34462
|
},
|
|
34562
34463
|
[acceptedType, findDropPosition, checkAutoScroll]
|
|
34563
34464
|
);
|
|
34564
|
-
const handleDragLeave =
|
|
34465
|
+
const handleDragLeave = useCallback125(
|
|
34565
34466
|
(e) => {
|
|
34566
34467
|
if (containerRef.current && !containerRef.current.contains(e.relatedTarget)) {
|
|
34567
34468
|
setIsValidDrag(false);
|
|
@@ -34571,7 +34472,7 @@ var ExternalDropZone = ({
|
|
|
34571
34472
|
},
|
|
34572
34473
|
[stopAutoScroll]
|
|
34573
34474
|
);
|
|
34574
|
-
const handleDrop =
|
|
34475
|
+
const handleDrop = useCallback125(
|
|
34575
34476
|
(e) => {
|
|
34576
34477
|
e.preventDefault();
|
|
34577
34478
|
e.stopPropagation();
|
|
@@ -34585,7 +34486,7 @@ var ExternalDropZone = ({
|
|
|
34585
34486
|
},
|
|
34586
34487
|
[onDrop, stopAutoScroll]
|
|
34587
34488
|
);
|
|
34588
|
-
|
|
34489
|
+
useEffect123(() => {
|
|
34589
34490
|
const handleGlobalDragEnd = () => {
|
|
34590
34491
|
setIsValidDrag(false);
|
|
34591
34492
|
dropPositionRef.current = null;
|
|
@@ -34594,7 +34495,7 @@ var ExternalDropZone = ({
|
|
|
34594
34495
|
window.addEventListener("dragend", handleGlobalDragEnd);
|
|
34595
34496
|
return () => window.removeEventListener("dragend", handleGlobalDragEnd);
|
|
34596
34497
|
}, [stopAutoScroll]);
|
|
34597
|
-
const handleOverlayMouseMove =
|
|
34498
|
+
const handleOverlayMouseMove = useCallback125(
|
|
34598
34499
|
(e) => {
|
|
34599
34500
|
setIsHoveringInPlacementMode(true);
|
|
34600
34501
|
checkAutoScroll(e.clientY);
|
|
@@ -34613,12 +34514,12 @@ var ExternalDropZone = ({
|
|
|
34613
34514
|
},
|
|
34614
34515
|
[findDropPosition, checkAutoScroll]
|
|
34615
34516
|
);
|
|
34616
|
-
const handleOverlayMouseLeave =
|
|
34517
|
+
const handleOverlayMouseLeave = useCallback125(() => {
|
|
34617
34518
|
setIsHoveringInPlacementMode(false);
|
|
34618
34519
|
dropPositionRef.current = null;
|
|
34619
34520
|
stopAutoScroll();
|
|
34620
34521
|
}, [stopAutoScroll]);
|
|
34621
|
-
const handleOverlayClick =
|
|
34522
|
+
const handleOverlayClick = useCallback125(
|
|
34622
34523
|
(e) => {
|
|
34623
34524
|
e.preventDefault();
|
|
34624
34525
|
e.stopPropagation();
|
|
@@ -34632,7 +34533,7 @@ var ExternalDropZone = ({
|
|
|
34632
34533
|
},
|
|
34633
34534
|
[onDrop, stopAutoScroll]
|
|
34634
34535
|
);
|
|
34635
|
-
const handleOverlayWheel =
|
|
34536
|
+
const handleOverlayWheel = useCallback125(
|
|
34636
34537
|
(e) => {
|
|
34637
34538
|
const container = getScrollContainer();
|
|
34638
34539
|
if (container === window) {
|
|
@@ -34643,7 +34544,7 @@ var ExternalDropZone = ({
|
|
|
34643
34544
|
},
|
|
34644
34545
|
[getScrollContainer]
|
|
34645
34546
|
);
|
|
34646
|
-
|
|
34547
|
+
useEffect123(() => {
|
|
34647
34548
|
if (!isPlacementMode) return;
|
|
34648
34549
|
const handleKeyDown = (e) => {
|
|
34649
34550
|
if (e.key === "Escape") {
|
|
@@ -34666,13 +34567,13 @@ var ExternalDropZone = ({
|
|
|
34666
34567
|
document.removeEventListener("click", handleGlobalClick, true);
|
|
34667
34568
|
};
|
|
34668
34569
|
}, [isPlacementMode, onPlacementCancel]);
|
|
34669
|
-
|
|
34570
|
+
useEffect123(() => {
|
|
34670
34571
|
if (!isPlacementMode) {
|
|
34671
34572
|
setIsHoveringInPlacementMode(false);
|
|
34672
34573
|
dropPositionRef.current = null;
|
|
34673
34574
|
}
|
|
34674
34575
|
}, [isPlacementMode]);
|
|
34675
|
-
|
|
34576
|
+
useEffect123(() => {
|
|
34676
34577
|
const isActive = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
34677
34578
|
if (isActive) {
|
|
34678
34579
|
document.body.classList.add("external-artifact-drag-active");
|
|
@@ -34683,18 +34584,18 @@ var ExternalDropZone = ({
|
|
|
34683
34584
|
document.body.classList.remove("external-artifact-drag-active");
|
|
34684
34585
|
};
|
|
34685
34586
|
}, [isValidDrag, isPlacementMode, isHoveringInPlacementMode]);
|
|
34686
|
-
|
|
34587
|
+
useEffect123(() => {
|
|
34687
34588
|
return () => {
|
|
34688
34589
|
if (scrollAnimationRef.current) {
|
|
34689
34590
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
34690
34591
|
}
|
|
34691
34592
|
};
|
|
34692
34593
|
}, []);
|
|
34693
|
-
const indicatorWithPosition = dropIndicator &&
|
|
34594
|
+
const indicatorWithPosition = dropIndicator && React314.isValidElement(dropIndicator) ? React314.cloneElement(dropIndicator, {
|
|
34694
34595
|
indicatorTop: typeof indicatorStyle.top === "number" ? indicatorStyle.top : void 0
|
|
34695
34596
|
}) : dropIndicator;
|
|
34696
34597
|
const shouldShowIndicator = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
34697
|
-
return /* @__PURE__ */
|
|
34598
|
+
return /* @__PURE__ */ React314.createElement(
|
|
34698
34599
|
Box73,
|
|
34699
34600
|
{
|
|
34700
34601
|
ref: containerRef,
|
|
@@ -34710,7 +34611,7 @@ var ExternalDropZone = ({
|
|
|
34710
34611
|
"data-placement-mode": isPlacementMode ? "true" : void 0
|
|
34711
34612
|
},
|
|
34712
34613
|
children,
|
|
34713
|
-
isPlacementMode && /* @__PURE__ */
|
|
34614
|
+
isPlacementMode && /* @__PURE__ */ React314.createElement(
|
|
34714
34615
|
Box73,
|
|
34715
34616
|
{
|
|
34716
34617
|
style: {
|
|
@@ -34730,7 +34631,7 @@ var ExternalDropZone = ({
|
|
|
34730
34631
|
onWheel: handleOverlayWheel
|
|
34731
34632
|
}
|
|
34732
34633
|
),
|
|
34733
|
-
shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */
|
|
34634
|
+
shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */ React314.createElement(Box73, { style: { ...indicatorStyle, background: "none", border: "none", boxShadow: "none" } }, indicatorWithPosition)
|
|
34734
34635
|
);
|
|
34735
34636
|
};
|
|
34736
34637
|
|
|
@@ -34772,7 +34673,7 @@ function IxoEditorContent({
|
|
|
34772
34673
|
}) {
|
|
34773
34674
|
const { activePanel } = usePanelStore();
|
|
34774
34675
|
const isPanelOpen = activePanel !== null;
|
|
34775
|
-
const editorContent = /* @__PURE__ */
|
|
34676
|
+
const editorContent = /* @__PURE__ */ React315.createElement(
|
|
34776
34677
|
BlockNoteView,
|
|
34777
34678
|
{
|
|
34778
34679
|
editor,
|
|
@@ -34787,7 +34688,7 @@ function IxoEditorContent({
|
|
|
34787
34688
|
onChange,
|
|
34788
34689
|
onSelectionChange
|
|
34789
34690
|
},
|
|
34790
|
-
config.slashMenu && /* @__PURE__ */
|
|
34691
|
+
config.slashMenu && /* @__PURE__ */ React315.createElement(
|
|
34791
34692
|
SuggestionMenuController,
|
|
34792
34693
|
{
|
|
34793
34694
|
triggerCharacter: "/",
|
|
@@ -34812,7 +34713,7 @@ function IxoEditorContent({
|
|
|
34812
34713
|
),
|
|
34813
34714
|
children
|
|
34814
34715
|
);
|
|
34815
|
-
return /* @__PURE__ */
|
|
34716
|
+
return /* @__PURE__ */ React315.createElement("div", { style: { display: "flex", height: "100%", width: "100%", gap: 0 } }, /* @__PURE__ */ React315.createElement(
|
|
34816
34717
|
"div",
|
|
34817
34718
|
{
|
|
34818
34719
|
className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`,
|
|
@@ -34821,9 +34722,9 @@ function IxoEditorContent({
|
|
|
34821
34722
|
transition: "width 0.2s ease"
|
|
34822
34723
|
}
|
|
34823
34724
|
},
|
|
34824
|
-
/* @__PURE__ */
|
|
34825
|
-
/* @__PURE__ */
|
|
34826
|
-
(onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */
|
|
34725
|
+
/* @__PURE__ */ React315.createElement(CoverImage, { coverImageUrl, logoUrl }),
|
|
34726
|
+
/* @__PURE__ */ React315.createElement(PageTitle, { editor, editable: isEditable }),
|
|
34727
|
+
(onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */ React315.createElement(
|
|
34827
34728
|
ExternalDropZone,
|
|
34828
34729
|
{
|
|
34829
34730
|
editor,
|
|
@@ -34836,7 +34737,7 @@ function IxoEditorContent({
|
|
|
34836
34737
|
},
|
|
34837
34738
|
editorContent
|
|
34838
34739
|
) : editorContent
|
|
34839
|
-
), isPanelVisible && /* @__PURE__ */
|
|
34740
|
+
), isPanelVisible && /* @__PURE__ */ React315.createElement(PanelContent, { theme: config.theme }));
|
|
34840
34741
|
}
|
|
34841
34742
|
function IxoEditor({
|
|
34842
34743
|
editor,
|
|
@@ -34877,7 +34778,7 @@ function IxoEditor({
|
|
|
34877
34778
|
tableHandles: true
|
|
34878
34779
|
};
|
|
34879
34780
|
const isEditable = editable;
|
|
34880
|
-
const editorContent = /* @__PURE__ */
|
|
34781
|
+
const editorContent = /* @__PURE__ */ React315.createElement(
|
|
34881
34782
|
BlocknoteProvider,
|
|
34882
34783
|
{
|
|
34883
34784
|
editor,
|
|
@@ -34892,7 +34793,7 @@ function IxoEditor({
|
|
|
34892
34793
|
connectedUsers,
|
|
34893
34794
|
awarenessInstance
|
|
34894
34795
|
},
|
|
34895
|
-
/* @__PURE__ */
|
|
34796
|
+
/* @__PURE__ */ React315.createElement(
|
|
34896
34797
|
IxoEditorContent,
|
|
34897
34798
|
{
|
|
34898
34799
|
isPanelVisible,
|
|
@@ -34917,23 +34818,44 @@ function IxoEditor({
|
|
|
34917
34818
|
}
|
|
34918
34819
|
|
|
34919
34820
|
// src/mantine/components/DebugButton.tsx
|
|
34920
|
-
import
|
|
34821
|
+
import React316 from "react";
|
|
34921
34822
|
function DebugButton({ editor }) {
|
|
34922
34823
|
const yMapToObject = (map) => {
|
|
34923
34824
|
if (!map) return null;
|
|
34924
34825
|
const obj = {};
|
|
34925
34826
|
map.forEach((value, key) => {
|
|
34926
|
-
|
|
34827
|
+
if (value && typeof value.forEach === "function" && typeof value.get === "function" && !Array.isArray(value)) {
|
|
34828
|
+
obj[key] = yMapToObject(value);
|
|
34829
|
+
} else if (value && typeof value.toArray === "function") {
|
|
34830
|
+
obj[key] = value.toArray();
|
|
34831
|
+
} else {
|
|
34832
|
+
obj[key] = value;
|
|
34833
|
+
}
|
|
34927
34834
|
});
|
|
34928
34835
|
return Object.keys(obj).length === 0 ? "(empty)" : obj;
|
|
34929
34836
|
};
|
|
34837
|
+
const parseJsonProp = (raw) => {
|
|
34838
|
+
if (typeof raw !== "string" || !raw) return raw;
|
|
34839
|
+
try {
|
|
34840
|
+
return JSON.parse(raw);
|
|
34841
|
+
} catch {
|
|
34842
|
+
return raw;
|
|
34843
|
+
}
|
|
34844
|
+
};
|
|
34930
34845
|
const handleClick = () => {
|
|
34931
34846
|
window.__editor = editor;
|
|
34932
|
-
|
|
34847
|
+
const yDoc = editor._yDoc || editor._yRuntime?.doc;
|
|
34848
|
+
console.log("Editor exposed as window.__editor. _yDoc?", !!yDoc);
|
|
34933
34849
|
const dump = {};
|
|
34934
34850
|
dump.blocks = editor.document.map((block) => ({
|
|
34935
34851
|
id: block.id,
|
|
34936
34852
|
type: block.type,
|
|
34853
|
+
actionType: block?.props?.actionType,
|
|
34854
|
+
triggerRaw: block?.props?.trigger,
|
|
34855
|
+
trigger: parseJsonProp(block?.props?.trigger),
|
|
34856
|
+
inputs: parseJsonProp(block?.props?.inputs),
|
|
34857
|
+
assignment: parseJsonProp(block?.props?.assignment),
|
|
34858
|
+
triggerMode: block?.props?.triggerMode,
|
|
34937
34859
|
props: block.props,
|
|
34938
34860
|
content: block.content,
|
|
34939
34861
|
children: block.children
|
|
@@ -34943,12 +34865,16 @@ function DebugButton({ editor }) {
|
|
|
34943
34865
|
dump.invocations = yMapToObject(editor._yInvocations);
|
|
34944
34866
|
dump.flowMetadata = editor.getFlowMetadata?.() || null;
|
|
34945
34867
|
dump.flowArray = editor.getFlow?.() || null;
|
|
34946
|
-
const yDoc = editor._yRuntime?.doc;
|
|
34947
34868
|
dump.entities = yMapToObject(yDoc?.getMap("entities"));
|
|
34869
|
+
dump.auditTrail = yMapToObject(yDoc?.getMap("auditTrail"));
|
|
34870
|
+
dump.pendingInvocations = yMapToObject(yDoc?.getMap("pendingInvocations"));
|
|
34871
|
+
dump.barrierState = yMapToObject(yDoc?.getMap("barrierState"));
|
|
34872
|
+
dump.runtimeFailures = yMapToObject(yDoc?.getMap("runtimeFailures"));
|
|
34873
|
+
dump.dmNotifications = yMapToObject(yDoc?.getMap("dmNotifications"));
|
|
34948
34874
|
const json = JSON.stringify(dump, null, 2);
|
|
34949
34875
|
console.log("Editor Debug Dump:\n" + json);
|
|
34950
34876
|
};
|
|
34951
|
-
return /* @__PURE__ */
|
|
34877
|
+
return /* @__PURE__ */ React316.createElement(
|
|
34952
34878
|
"button",
|
|
34953
34879
|
{
|
|
34954
34880
|
onClick: handleClick,
|
|
@@ -34974,7 +34900,7 @@ function DebugButton({ editor }) {
|
|
|
34974
34900
|
}
|
|
34975
34901
|
|
|
34976
34902
|
// src/mantine/components/PageHeader.tsx
|
|
34977
|
-
import
|
|
34903
|
+
import React317, { useState as useState153, useRef as useRef35, useEffect as useEffect124 } from "react";
|
|
34978
34904
|
function PageHeader({
|
|
34979
34905
|
title = "New page",
|
|
34980
34906
|
icon: icon2,
|
|
@@ -34986,11 +34912,11 @@ function PageHeader({
|
|
|
34986
34912
|
isFavorited = false,
|
|
34987
34913
|
menuItems = []
|
|
34988
34914
|
}) {
|
|
34989
|
-
const [isMenuOpen, setIsMenuOpen] =
|
|
34990
|
-
const [isPrivacyOpen, setIsPrivacyOpen] =
|
|
34915
|
+
const [isMenuOpen, setIsMenuOpen] = useState153(false);
|
|
34916
|
+
const [isPrivacyOpen, setIsPrivacyOpen] = useState153(false);
|
|
34991
34917
|
const menuRef = useRef35(null);
|
|
34992
34918
|
const privacyRef = useRef35(null);
|
|
34993
|
-
|
|
34919
|
+
useEffect124(() => {
|
|
34994
34920
|
function handleClickOutside(event) {
|
|
34995
34921
|
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
34996
34922
|
setIsMenuOpen(false);
|
|
@@ -35012,7 +34938,7 @@ function PageHeader({
|
|
|
35012
34938
|
setIsMenuOpen(false);
|
|
35013
34939
|
}
|
|
35014
34940
|
};
|
|
35015
|
-
return /* @__PURE__ */
|
|
34941
|
+
return /* @__PURE__ */ React317.createElement("div", { style: styles.container }, /* @__PURE__ */ React317.createElement("div", { style: styles.leftSection }, /* @__PURE__ */ React317.createElement("span", { style: styles.icon }, icon2 || "\u{1F4C4}"), /* @__PURE__ */ React317.createElement("span", { style: styles.title }, title), /* @__PURE__ */ React317.createElement("div", { style: styles.privacyContainer, ref: privacyRef }, /* @__PURE__ */ React317.createElement("button", { style: styles.privacyBadge, onClick: () => onPrivacyChange && setIsPrivacyOpen(!isPrivacyOpen) }, /* @__PURE__ */ React317.createElement("span", { style: styles.lockIcon }, isPrivate ? "\u{1F512}" : "\u{1F310}"), /* @__PURE__ */ React317.createElement("span", null, isPrivate ? "Private" : "Public"), onPrivacyChange && /* @__PURE__ */ React317.createElement("span", { style: styles.chevron }, "\u25BE")), isPrivacyOpen && onPrivacyChange && /* @__PURE__ */ React317.createElement("div", { style: styles.dropdown }, /* @__PURE__ */ React317.createElement(
|
|
35016
34942
|
"button",
|
|
35017
34943
|
{
|
|
35018
34944
|
style: {
|
|
@@ -35024,9 +34950,9 @@ function PageHeader({
|
|
|
35024
34950
|
setIsPrivacyOpen(false);
|
|
35025
34951
|
}
|
|
35026
34952
|
},
|
|
35027
|
-
/* @__PURE__ */
|
|
35028
|
-
/* @__PURE__ */
|
|
35029
|
-
), /* @__PURE__ */
|
|
34953
|
+
/* @__PURE__ */ React317.createElement("span", { style: styles.menuItemIcon }, "\u{1F512}"),
|
|
34954
|
+
/* @__PURE__ */ React317.createElement("span", null, "Private")
|
|
34955
|
+
), /* @__PURE__ */ React317.createElement(
|
|
35030
34956
|
"button",
|
|
35031
34957
|
{
|
|
35032
34958
|
style: {
|
|
@@ -35038,9 +34964,9 @@ function PageHeader({
|
|
|
35038
34964
|
setIsPrivacyOpen(false);
|
|
35039
34965
|
}
|
|
35040
34966
|
},
|
|
35041
|
-
/* @__PURE__ */
|
|
35042
|
-
/* @__PURE__ */
|
|
35043
|
-
)))), /* @__PURE__ */
|
|
34967
|
+
/* @__PURE__ */ React317.createElement("span", { style: styles.menuItemIcon }, "\u{1F310}"),
|
|
34968
|
+
/* @__PURE__ */ React317.createElement("span", null, "Public")
|
|
34969
|
+
)))), /* @__PURE__ */ React317.createElement("div", { style: styles.rightSection }, lastEdited && /* @__PURE__ */ React317.createElement("span", { style: styles.editedText }, lastEdited), onShare && /* @__PURE__ */ React317.createElement("button", { style: styles.shareButton, onClick: onShare }, "Share"), onFavorite && /* @__PURE__ */ React317.createElement("button", { style: styles.iconButton, onClick: onFavorite }, isFavorited ? "\u2605" : "\u2606"), menuItems.length > 0 && /* @__PURE__ */ React317.createElement("div", { style: styles.menuContainer, ref: menuRef }, /* @__PURE__ */ React317.createElement("button", { style: styles.menuButton, onClick: () => setIsMenuOpen(!isMenuOpen), "aria-label": "Menu" }, /* @__PURE__ */ React317.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor" }, /* @__PURE__ */ React317.createElement("circle", { cx: "3", cy: "8", r: "1.5" }), /* @__PURE__ */ React317.createElement("circle", { cx: "8", cy: "8", r: "1.5" }), /* @__PURE__ */ React317.createElement("circle", { cx: "13", cy: "8", r: "1.5" }))), isMenuOpen && /* @__PURE__ */ React317.createElement("div", { style: styles.dropdown }, menuItems.map((item, index) => /* @__PURE__ */ React317.createElement(React317.Fragment, { key: index }, item.divider && index > 0 && /* @__PURE__ */ React317.createElement("div", { style: styles.divider }), /* @__PURE__ */ React317.createElement(
|
|
35044
34970
|
"button",
|
|
35045
34971
|
{
|
|
35046
34972
|
style: {
|
|
@@ -35050,8 +34976,8 @@ function PageHeader({
|
|
|
35050
34976
|
onClick: () => handleMenuItemClick(item),
|
|
35051
34977
|
disabled: item.disabled
|
|
35052
34978
|
},
|
|
35053
|
-
item.icon && /* @__PURE__ */
|
|
35054
|
-
/* @__PURE__ */
|
|
34979
|
+
item.icon && /* @__PURE__ */ React317.createElement("span", { style: styles.menuItemIcon }, item.icon),
|
|
34980
|
+
/* @__PURE__ */ React317.createElement("span", null, item.label)
|
|
35055
34981
|
)))))));
|
|
35056
34982
|
}
|
|
35057
34983
|
var styles = {
|
|
@@ -35188,15 +35114,15 @@ var styles = {
|
|
|
35188
35114
|
};
|
|
35189
35115
|
|
|
35190
35116
|
// src/mantine/components/EntitySigningSetup.tsx
|
|
35191
|
-
import
|
|
35192
|
-
import { Modal as Modal4, Stack as
|
|
35193
|
-
import { IconAlertCircle as
|
|
35117
|
+
import React318, { useState as useState154 } from "react";
|
|
35118
|
+
import { Modal as Modal4, Stack as Stack214, Text as Text189, TextInput as TextInput10, Button as Button62, Alert as Alert60, Group as Group118 } from "@mantine/core";
|
|
35119
|
+
import { IconAlertCircle as IconAlertCircle24, IconCheck as IconCheck26, IconKey as IconKey2 } from "@tabler/icons-react";
|
|
35194
35120
|
var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) => {
|
|
35195
|
-
const [pin, setPin] =
|
|
35196
|
-
const [confirmPin, setConfirmPin] =
|
|
35197
|
-
const [loading, setLoading] =
|
|
35198
|
-
const [error, setError] =
|
|
35199
|
-
const [success, setSuccess] =
|
|
35121
|
+
const [pin, setPin] = useState154("");
|
|
35122
|
+
const [confirmPin, setConfirmPin] = useState154("");
|
|
35123
|
+
const [loading, setLoading] = useState154(false);
|
|
35124
|
+
const [error, setError] = useState154(null);
|
|
35125
|
+
const [success, setSuccess] = useState154(false);
|
|
35200
35126
|
const handleSetup = async () => {
|
|
35201
35127
|
if (pin.length < 4) {
|
|
35202
35128
|
setError("PIN must be at least 4 characters");
|
|
@@ -35236,15 +35162,15 @@ var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) =
|
|
|
35236
35162
|
setSuccess(false);
|
|
35237
35163
|
}
|
|
35238
35164
|
};
|
|
35239
|
-
return /* @__PURE__ */
|
|
35165
|
+
return /* @__PURE__ */ React318.createElement(
|
|
35240
35166
|
Modal4,
|
|
35241
35167
|
{
|
|
35242
35168
|
opened,
|
|
35243
35169
|
onClose: handleClose,
|
|
35244
|
-
title: /* @__PURE__ */
|
|
35170
|
+
title: /* @__PURE__ */ React318.createElement(Group118, { gap: "xs" }, /* @__PURE__ */ React318.createElement(IconKey2, { size: 20 }), /* @__PURE__ */ React318.createElement(Text189, { fw: 600 }, "Entity Signing Setup")),
|
|
35245
35171
|
size: "md"
|
|
35246
35172
|
},
|
|
35247
|
-
/* @__PURE__ */
|
|
35173
|
+
/* @__PURE__ */ React318.createElement(Stack214, { gap: "md" }, success ? /* @__PURE__ */ React318.createElement(Alert60, { color: "green", icon: /* @__PURE__ */ React318.createElement(IconCheck26, { size: 16 }) }, "Entity signing key set up successfully!") : /* @__PURE__ */ React318.createElement(React318.Fragment, null, /* @__PURE__ */ React318.createElement(Text189, { size: "sm", c: "dimmed" }, "Flow authorization requires a signing key for", " ", /* @__PURE__ */ React318.createElement(Text189, { span: true, fw: 500 }, entityName || entityDid), "."), /* @__PURE__ */ React318.createElement(Alert60, { color: "blue", variant: "light" }, /* @__PURE__ */ React318.createElement(Text189, { size: "sm" }, "This is a ", /* @__PURE__ */ React318.createElement("strong", null, "one-time setup"), " that allows flows to grant permissions without requiring wallet signatures for each delegation.")), /* @__PURE__ */ React318.createElement(Stack214, { gap: "xs" }, /* @__PURE__ */ React318.createElement(Text189, { size: "sm", fw: 500 }, "What happens:"), /* @__PURE__ */ React318.createElement(Text189, { size: "sm", c: "dimmed" }, "1. A new signing key is generated"), /* @__PURE__ */ React318.createElement(Text189, { size: "sm", c: "dimmed" }, "2. Key is registered on the entity's DID document (requires wallet)"), /* @__PURE__ */ React318.createElement(Text189, { size: "sm", c: "dimmed" }, "3. Key is stored encrypted in the entity's Matrix room")), /* @__PURE__ */ React318.createElement(
|
|
35248
35174
|
TextInput10,
|
|
35249
35175
|
{
|
|
35250
35176
|
label: "Enter PIN to encrypt signing key",
|
|
@@ -35255,25 +35181,25 @@ var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) =
|
|
|
35255
35181
|
onChange: (e) => setPin(e.currentTarget.value),
|
|
35256
35182
|
disabled: loading
|
|
35257
35183
|
}
|
|
35258
|
-
), /* @__PURE__ */
|
|
35184
|
+
), /* @__PURE__ */ React318.createElement(TextInput10, { label: "Confirm PIN", type: "password", placeholder: "Confirm PIN", value: confirmPin, onChange: (e) => setConfirmPin(e.currentTarget.value), disabled: loading }), error && /* @__PURE__ */ React318.createElement(Alert60, { color: "red", icon: /* @__PURE__ */ React318.createElement(IconAlertCircle24, { size: 16 }) }, error), /* @__PURE__ */ React318.createElement(Group118, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React318.createElement(Button62, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React318.createElement(Button62, { onClick: handleSetup, loading, leftSection: /* @__PURE__ */ React318.createElement(IconKey2, { size: 16 }) }, "Setup Entity Signing"))))
|
|
35259
35185
|
);
|
|
35260
35186
|
};
|
|
35261
35187
|
|
|
35262
35188
|
// src/mantine/components/FlowPermissionsPanel.tsx
|
|
35263
|
-
import
|
|
35264
|
-
import { Stack as
|
|
35189
|
+
import React319, { useState as useState155, useEffect as useEffect125, useMemo as useMemo127 } from "react";
|
|
35190
|
+
import { Stack as Stack215, Text as Text190, Paper as Paper20, Group as Group119, Badge as Badge50, Button as Button63, ActionIcon as ActionIcon43, Loader as Loader60, Alert as Alert61, Divider as Divider27 } from "@mantine/core";
|
|
35265
35191
|
import { IconPlus as IconPlus11, IconTrash as IconTrash12, IconShieldCheck as IconShieldCheck16, IconUser as IconUser14, IconRobot as IconRobot4, IconBuilding as IconBuilding2 } from "@tabler/icons-react";
|
|
35266
35192
|
var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission, onRevokePermission, getUserDisplayName }) => {
|
|
35267
|
-
const [delegations, setDelegations] =
|
|
35268
|
-
const [loading, setLoading] =
|
|
35269
|
-
const [revoking, setRevoking] =
|
|
35270
|
-
const rootDelegation =
|
|
35193
|
+
const [delegations, setDelegations] = useState155([]);
|
|
35194
|
+
const [loading, setLoading] = useState155(true);
|
|
35195
|
+
const [revoking, setRevoking] = useState155(null);
|
|
35196
|
+
const rootDelegation = useMemo127(() => {
|
|
35271
35197
|
if (editor.getUcanService) {
|
|
35272
35198
|
return editor.getUcanService()?.getRootDelegation() || null;
|
|
35273
35199
|
}
|
|
35274
35200
|
return null;
|
|
35275
35201
|
}, [editor]);
|
|
35276
|
-
|
|
35202
|
+
useEffect125(() => {
|
|
35277
35203
|
const loadDelegations = async () => {
|
|
35278
35204
|
setLoading(true);
|
|
35279
35205
|
let allDelegations = [];
|
|
@@ -35315,11 +35241,11 @@ var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission,
|
|
|
35315
35241
|
const getIcon2 = (type) => {
|
|
35316
35242
|
switch (type) {
|
|
35317
35243
|
case "oracle":
|
|
35318
|
-
return /* @__PURE__ */
|
|
35244
|
+
return /* @__PURE__ */ React319.createElement(IconRobot4, { size: 16 });
|
|
35319
35245
|
case "entity":
|
|
35320
|
-
return /* @__PURE__ */
|
|
35246
|
+
return /* @__PURE__ */ React319.createElement(IconBuilding2, { size: 16 });
|
|
35321
35247
|
default:
|
|
35322
|
-
return /* @__PURE__ */
|
|
35248
|
+
return /* @__PURE__ */ React319.createElement(IconUser14, { size: 16 });
|
|
35323
35249
|
}
|
|
35324
35250
|
};
|
|
35325
35251
|
const formatCapabilities = (caps) => {
|
|
@@ -35338,32 +35264,32 @@ var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission,
|
|
|
35338
35264
|
if (date < /* @__PURE__ */ new Date()) return "Expired";
|
|
35339
35265
|
return date.toLocaleDateString();
|
|
35340
35266
|
};
|
|
35341
|
-
return /* @__PURE__ */
|
|
35267
|
+
return /* @__PURE__ */ React319.createElement(Stack215, { gap: "md" }, /* @__PURE__ */ React319.createElement(Stack215, { gap: "xs" }, /* @__PURE__ */ React319.createElement(Text190, { fw: 600, size: "sm" }, "Root Authority"), /* @__PURE__ */ React319.createElement(Paper20, { p: "sm", withBorder: true }, /* @__PURE__ */ React319.createElement(Group119, { gap: "xs" }, /* @__PURE__ */ React319.createElement(IconShieldCheck16, { size: 20, color: "var(--mantine-color-green-6)" }), /* @__PURE__ */ React319.createElement(Stack215, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React319.createElement(Text190, { size: "sm", fw: 500 }, entityName || entityDid), /* @__PURE__ */ React319.createElement(Text190, { size: "xs", c: "dimmed" }, rootDelegation ? `Granted: ${new Date(rootDelegation.createdAt).toLocaleDateString()}` : "Root capability not set up")), /* @__PURE__ */ React319.createElement(Badge50, { color: "green", variant: "light" }, "Entity")))), /* @__PURE__ */ React319.createElement(Divider27, { label: "Delegated Permissions", labelPosition: "center" }), loading ? /* @__PURE__ */ React319.createElement(Group119, { justify: "center", py: "xl" }, /* @__PURE__ */ React319.createElement(Loader60, { size: "sm" })) : delegations.length === 0 ? /* @__PURE__ */ React319.createElement(Alert61, { color: "gray", variant: "light" }, /* @__PURE__ */ React319.createElement(Text190, { size: "sm" }, "No permissions have been granted yet.")) : /* @__PURE__ */ React319.createElement(Stack215, { gap: "xs" }, delegations.map(({ delegation, displayName, type }) => /* @__PURE__ */ React319.createElement(Paper20, { key: delegation.cid, p: "sm", withBorder: true }, /* @__PURE__ */ React319.createElement(Group119, { justify: "space-between" }, /* @__PURE__ */ React319.createElement(Group119, { gap: "xs" }, getIcon2(type), /* @__PURE__ */ React319.createElement(Stack215, { gap: 2 }, /* @__PURE__ */ React319.createElement(Text190, { size: "sm", fw: 500 }, displayName), /* @__PURE__ */ React319.createElement(Text190, { size: "xs", c: "dimmed" }, formatCapabilities(delegation.capabilities)), /* @__PURE__ */ React319.createElement(Group119, { gap: "xs" }, /* @__PURE__ */ React319.createElement(Text190, { size: "xs", c: "dimmed" }, "Expires: ", formatExpiration(delegation.expiration)), /* @__PURE__ */ React319.createElement(Text190, { size: "xs", c: "dimmed" }, "\u2022"), /* @__PURE__ */ React319.createElement(Text190, { size: "xs", c: "dimmed" }, "Granted by: ", delegation.issuerDid === entityDid ? "Entity" : delegation.issuerDid.slice(-8))))), /* @__PURE__ */ React319.createElement(ActionIcon43, { color: "red", variant: "subtle", onClick: () => handleRevoke(delegation.cid), loading: revoking === delegation.cid, disabled: !!revoking }, /* @__PURE__ */ React319.createElement(IconTrash12, { size: 16 })))))), /* @__PURE__ */ React319.createElement(Button63, { leftSection: /* @__PURE__ */ React319.createElement(IconPlus11, { size: 16 }), variant: "light", onClick: onGrantPermission }, "Grant Permission"));
|
|
35342
35268
|
};
|
|
35343
35269
|
|
|
35344
35270
|
// src/mantine/components/GrantPermissionModal.tsx
|
|
35345
|
-
import
|
|
35346
|
-
import { Modal as Modal5, Stack as
|
|
35271
|
+
import React320, { useState as useState156, useCallback as useCallback126 } from "react";
|
|
35272
|
+
import { Modal as Modal5, Stack as Stack216, Text as Text191, TextInput as TextInput11, Button as Button64, Group as Group120, Radio as Radio5, Checkbox as Checkbox14, Alert as Alert62, Paper as Paper21, Loader as Loader61, Badge as Badge51, ActionIcon as ActionIcon44, Divider as Divider28, NumberInput as NumberInput4 } from "@mantine/core";
|
|
35347
35273
|
import { IconSearch as IconSearch10, IconUser as IconUser15, IconRobot as IconRobot5, IconX as IconX16, IconShieldPlus as IconShieldPlus4 } from "@tabler/icons-react";
|
|
35348
35274
|
var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, searchUsers, getOracles, onGrant }) => {
|
|
35349
35275
|
const singleBlockMode = !!targetBlockId || blocks.length === 1;
|
|
35350
35276
|
const fixedBlockId = targetBlockId || (blocks.length === 1 ? blocks[0].id : null);
|
|
35351
35277
|
const fixedBlock = fixedBlockId ? blocks.find((b) => b.id === fixedBlockId) || blocks[0] : null;
|
|
35352
|
-
const [recipientType, setRecipientType] =
|
|
35353
|
-
const [searchQuery, setSearchQuery] =
|
|
35354
|
-
const [searchResults, setSearchResults] =
|
|
35355
|
-
const [searching, setSearching] =
|
|
35356
|
-
const [selectedRecipient, setSelectedRecipient] =
|
|
35357
|
-
const [manualDid, setManualDid] =
|
|
35358
|
-
const [scopeType, setScopeType] =
|
|
35359
|
-
const [selectedBlocks, setSelectedBlocks] =
|
|
35360
|
-
const [expirationEnabled, setExpirationEnabled] =
|
|
35361
|
-
const [expirationDays, setExpirationDays] =
|
|
35362
|
-
const [canDelegate, setCanDelegate] =
|
|
35363
|
-
const [pin, setPin] =
|
|
35364
|
-
const [loading, setLoading] =
|
|
35365
|
-
const [error, setError] =
|
|
35366
|
-
const handleSearch =
|
|
35278
|
+
const [recipientType, setRecipientType] = useState156("user");
|
|
35279
|
+
const [searchQuery, setSearchQuery] = useState156("");
|
|
35280
|
+
const [searchResults, setSearchResults] = useState156([]);
|
|
35281
|
+
const [searching, setSearching] = useState156(false);
|
|
35282
|
+
const [selectedRecipient, setSelectedRecipient] = useState156(null);
|
|
35283
|
+
const [manualDid, setManualDid] = useState156("");
|
|
35284
|
+
const [scopeType, setScopeType] = useState156("full");
|
|
35285
|
+
const [selectedBlocks, setSelectedBlocks] = useState156([]);
|
|
35286
|
+
const [expirationEnabled, setExpirationEnabled] = useState156(false);
|
|
35287
|
+
const [expirationDays, setExpirationDays] = useState156(30);
|
|
35288
|
+
const [canDelegate, setCanDelegate] = useState156(false);
|
|
35289
|
+
const [pin, setPin] = useState156("");
|
|
35290
|
+
const [loading, setLoading] = useState156(false);
|
|
35291
|
+
const [error, setError] = useState156(null);
|
|
35292
|
+
const handleSearch = useCallback126(async () => {
|
|
35367
35293
|
if (searchQuery.length < 2) return;
|
|
35368
35294
|
setSearching(true);
|
|
35369
35295
|
try {
|
|
@@ -35450,15 +35376,15 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
35450
35376
|
resetForm();
|
|
35451
35377
|
}
|
|
35452
35378
|
};
|
|
35453
|
-
return /* @__PURE__ */
|
|
35379
|
+
return /* @__PURE__ */ React320.createElement(
|
|
35454
35380
|
Modal5,
|
|
35455
35381
|
{
|
|
35456
35382
|
opened,
|
|
35457
35383
|
onClose: handleClose,
|
|
35458
|
-
title: /* @__PURE__ */
|
|
35384
|
+
title: /* @__PURE__ */ React320.createElement(Group120, { gap: "xs" }, /* @__PURE__ */ React320.createElement(IconShieldPlus4, { size: 20 }), /* @__PURE__ */ React320.createElement(Text191, { fw: 600 }, "Grant Permission")),
|
|
35459
35385
|
size: "lg"
|
|
35460
35386
|
},
|
|
35461
|
-
/* @__PURE__ */
|
|
35387
|
+
/* @__PURE__ */ React320.createElement(Stack216, { gap: "md" }, /* @__PURE__ */ React320.createElement(Stack216, { gap: "xs" }, /* @__PURE__ */ React320.createElement(Text191, { size: "sm", fw: 500 }, "Recipient Type"), /* @__PURE__ */ React320.createElement(
|
|
35462
35388
|
Radio5.Group,
|
|
35463
35389
|
{
|
|
35464
35390
|
value: recipientType,
|
|
@@ -35468,23 +35394,23 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
35468
35394
|
setSearchResults([]);
|
|
35469
35395
|
}
|
|
35470
35396
|
},
|
|
35471
|
-
/* @__PURE__ */
|
|
35472
|
-
)), recipientType !== "manual" ? /* @__PURE__ */
|
|
35397
|
+
/* @__PURE__ */ React320.createElement(Group120, null, /* @__PURE__ */ React320.createElement(Radio5, { value: "user", label: "User" }), /* @__PURE__ */ React320.createElement(Radio5, { value: "oracle", label: "Oracle" }), /* @__PURE__ */ React320.createElement(Radio5, { value: "manual", label: "Enter DID" }))
|
|
35398
|
+
)), recipientType !== "manual" ? /* @__PURE__ */ React320.createElement(Stack216, { gap: "xs" }, /* @__PURE__ */ React320.createElement(
|
|
35473
35399
|
TextInput11,
|
|
35474
35400
|
{
|
|
35475
35401
|
placeholder: recipientType === "oracle" ? "Search oracles..." : "Search users...",
|
|
35476
|
-
leftSection: /* @__PURE__ */
|
|
35477
|
-
rightSection: searching ? /* @__PURE__ */
|
|
35402
|
+
leftSection: /* @__PURE__ */ React320.createElement(IconSearch10, { size: 16 }),
|
|
35403
|
+
rightSection: searching ? /* @__PURE__ */ React320.createElement(Loader61, { size: 14 }) : null,
|
|
35478
35404
|
value: searchQuery,
|
|
35479
35405
|
onChange: (e) => setSearchQuery(e.currentTarget.value),
|
|
35480
35406
|
onKeyDown: (e) => e.key === "Enter" && handleSearch()
|
|
35481
35407
|
}
|
|
35482
|
-
), selectedRecipient ? /* @__PURE__ */
|
|
35408
|
+
), selectedRecipient ? /* @__PURE__ */ React320.createElement(Paper21, { p: "sm", withBorder: true }, /* @__PURE__ */ React320.createElement(Group120, { justify: "space-between" }, /* @__PURE__ */ React320.createElement(Group120, { gap: "xs" }, recipientType === "oracle" ? /* @__PURE__ */ React320.createElement(IconRobot5, { size: 16 }) : /* @__PURE__ */ React320.createElement(IconUser15, { size: 16 }), /* @__PURE__ */ React320.createElement(Text191, { size: "sm" }, selectedRecipient.displayName), /* @__PURE__ */ React320.createElement(Badge51, { size: "xs", variant: "light" }, selectedRecipient.did.slice(-12))), /* @__PURE__ */ React320.createElement(ActionIcon44, { size: "sm", variant: "subtle", onClick: () => setSelectedRecipient(null) }, /* @__PURE__ */ React320.createElement(IconX16, { size: 14 })))) : searchResults.length > 0 ? /* @__PURE__ */ React320.createElement(Paper21, { p: "xs", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React320.createElement(Stack216, { gap: 4 }, searchResults.map((result) => /* @__PURE__ */ React320.createElement(Button64, { key: result.did, variant: "subtle", size: "sm", justify: "flex-start", onClick: () => setSelectedRecipient(result) }, result.displayName)))) : null) : /* @__PURE__ */ React320.createElement(TextInput11, { label: "Recipient DID", placeholder: "did:ixo:...", value: manualDid, onChange: (e) => setManualDid(e.currentTarget.value) }), /* @__PURE__ */ React320.createElement(Divider28, null), /* @__PURE__ */ React320.createElement(Stack216, { gap: "xs" }, /* @__PURE__ */ React320.createElement(Text191, { size: "sm", fw: 500 }, "Permission Scope"), singleBlockMode && fixedBlock ? (
|
|
35483
35409
|
// Single block mode: show fixed block info
|
|
35484
|
-
/* @__PURE__ */
|
|
35410
|
+
/* @__PURE__ */ React320.createElement(Paper21, { p: "sm", withBorder: true }, /* @__PURE__ */ React320.createElement(Group120, { gap: "xs" }, /* @__PURE__ */ React320.createElement(Badge51, { variant: "light", color: "blue" }, fixedBlock.type), /* @__PURE__ */ React320.createElement(Text191, { size: "sm" }, fixedBlock.name || `Block ${fixedBlock.id.slice(-8)}`)), /* @__PURE__ */ React320.createElement(Text191, { size: "xs", c: "dimmed", mt: "xs" }, "Permission will be granted to execute this specific block."))
|
|
35485
35411
|
) : (
|
|
35486
35412
|
// Multi-block mode: show scope selection
|
|
35487
|
-
/* @__PURE__ */
|
|
35413
|
+
/* @__PURE__ */ React320.createElement(React320.Fragment, null, /* @__PURE__ */ React320.createElement(Radio5.Group, { value: scopeType, onChange: (v) => setScopeType(v) }, /* @__PURE__ */ React320.createElement(Stack216, { gap: "xs" }, /* @__PURE__ */ React320.createElement(Radio5, { value: "full", label: "Full flow access (can execute any block)" }), /* @__PURE__ */ React320.createElement(Radio5, { value: "blocks", label: "Specific blocks only" }))), scopeType === "blocks" && /* @__PURE__ */ React320.createElement(Paper21, { p: "sm", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React320.createElement(Stack216, { gap: "xs" }, blocks.map((block) => /* @__PURE__ */ React320.createElement(
|
|
35488
35414
|
Checkbox14,
|
|
35489
35415
|
{
|
|
35490
35416
|
key: block.id,
|
|
@@ -35499,7 +35425,7 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
35499
35425
|
}
|
|
35500
35426
|
}
|
|
35501
35427
|
)))))
|
|
35502
|
-
)), /* @__PURE__ */
|
|
35428
|
+
)), /* @__PURE__ */ React320.createElement(Divider28, null), /* @__PURE__ */ React320.createElement(Stack216, { gap: "xs" }, /* @__PURE__ */ React320.createElement(Checkbox14, { label: "Set expiration", checked: expirationEnabled, onChange: (e) => setExpirationEnabled(e.currentTarget.checked) }), expirationEnabled && /* @__PURE__ */ React320.createElement(NumberInput4, { label: "Expires in (days)", placeholder: "30", value: expirationDays, onChange: setExpirationDays, min: 1, max: 365 })), /* @__PURE__ */ React320.createElement(
|
|
35503
35429
|
Checkbox14,
|
|
35504
35430
|
{
|
|
35505
35431
|
label: "Recipient can grant permissions to others",
|
|
@@ -35507,7 +35433,7 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
35507
35433
|
checked: canDelegate,
|
|
35508
35434
|
onChange: (e) => setCanDelegate(e.currentTarget.checked)
|
|
35509
35435
|
}
|
|
35510
|
-
), /* @__PURE__ */
|
|
35436
|
+
), /* @__PURE__ */ React320.createElement(Divider28, null), /* @__PURE__ */ React320.createElement(TextInput11, { label: "Enter your PIN to sign this delegation", type: "password", placeholder: "PIN", value: pin, onChange: (e) => setPin(e.currentTarget.value) }), error && /* @__PURE__ */ React320.createElement(Alert62, { color: "red" }, error), /* @__PURE__ */ React320.createElement(Group120, { justify: "flex-end" }, /* @__PURE__ */ React320.createElement(Button64, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React320.createElement(Button64, { onClick: handleGrant, loading }, "Grant Permission")))
|
|
35511
35437
|
);
|
|
35512
35438
|
};
|
|
35513
35439
|
|
|
@@ -35621,4 +35547,4 @@ export {
|
|
|
35621
35547
|
getExtraSlashMenuItems,
|
|
35622
35548
|
useCreateIxoEditor
|
|
35623
35549
|
};
|
|
35624
|
-
//# sourceMappingURL=chunk-
|
|
35550
|
+
//# sourceMappingURL=chunk-3L5YSHP3.mjs.map
|