@ixo/editor 3.2.0 → 3.2.1
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-3EZI42YS.mjs → chunk-F2JSGDES.mjs} +577 -570
- package/dist/chunk-F2JSGDES.mjs.map +1 -0
- package/dist/{chunk-BAW3ML7X.mjs → chunk-IQX6H7AK.mjs} +2 -2
- package/dist/{chunk-3MI2QQYH.mjs → chunk-ZCRLP7QH.mjs} +572 -510
- package/dist/chunk-ZCRLP7QH.mjs.map +1 -0
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.mjs +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +3 -3
- package/dist/mantine/index.mjs +2 -2
- package/dist/{setup-Cbd3tcfL.d.ts → setup-B0la8n04.d.ts} +20 -17
- package/package.json +1 -1
- package/dist/chunk-3EZI42YS.mjs.map +0 -1
- package/dist/chunk-3MI2QQYH.mjs.map +0 -1
- /package/dist/{chunk-BAW3ML7X.mjs.map → chunk-IQX6H7AK.mjs.map} +0 -0
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
createInvocationStore,
|
|
9
9
|
createRuntimeStateManager,
|
|
10
10
|
createUcanDelegationStore,
|
|
11
|
+
createUcanService,
|
|
11
12
|
executeNode,
|
|
12
13
|
extractSurveyAnswersTemplate,
|
|
13
14
|
getAction,
|
|
@@ -20,7 +21,7 @@ import {
|
|
|
20
21
|
resolveActionType,
|
|
21
22
|
sendDirectMessage,
|
|
22
23
|
transformSurveyToCredentialSubject
|
|
23
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-F2JSGDES.mjs";
|
|
24
25
|
|
|
25
26
|
// src/mantine/hooks/useCreateIxoEditor.ts
|
|
26
27
|
import { useCreateBlockNote } from "@blocknote/react";
|
|
@@ -56,7 +57,7 @@ import { createReactBlockSpec } from "@blocknote/react";
|
|
|
56
57
|
import React27 from "react";
|
|
57
58
|
|
|
58
59
|
// src/mantine/blocks/checkbox/template/TemplateView.tsx
|
|
59
|
-
import React24, { useMemo as
|
|
60
|
+
import React24, { useMemo as useMemo9 } from "react";
|
|
60
61
|
|
|
61
62
|
// src/mantine/blocks/checkbox/template/TemplateConfig.tsx
|
|
62
63
|
import React22, { useCallback as useCallback14 } from "react";
|
|
@@ -340,7 +341,7 @@ var useListBlocksUI = () => {
|
|
|
340
341
|
// src/mantine/components/Layouts/BaseRightPanelLayout.tsx
|
|
341
342
|
import { ActionIcon as ActionIcon3, Box as Box2, Flex as Flex2, Stack as Stack10, Text as Text8, Title } from "@mantine/core";
|
|
342
343
|
import { IconBrain, IconShieldCheck, IconWand, IconX as IconX2 } from "@tabler/icons-react";
|
|
343
|
-
import React19, { useEffect as useEffect9, useMemo as
|
|
344
|
+
import React19, { useEffect as useEffect9, useMemo as useMemo7 } from "react";
|
|
344
345
|
import { useMediaQuery } from "@mantine/hooks";
|
|
345
346
|
|
|
346
347
|
// src/mantine/components/ReusablePanel.tsx
|
|
@@ -512,7 +513,7 @@ import React12, { useCallback as useCallback7 } from "react";
|
|
|
512
513
|
import { Stack as Stack4, SegmentedControl as SegmentedControl2, Text as Text3, Alert } from "@mantine/core";
|
|
513
514
|
|
|
514
515
|
// src/mantine/blocks/components/ConditionBuilder/ConditionRow.tsx
|
|
515
|
-
import React10, { useCallback as useCallback6, useMemo as
|
|
516
|
+
import React10, { useCallback as useCallback6, useMemo as useMemo5 } from "react";
|
|
516
517
|
import { Stack as Stack3, Group, Button } from "@mantine/core";
|
|
517
518
|
|
|
518
519
|
// src/mantine/blocks/apiRequest/types.ts
|
|
@@ -1068,10 +1069,10 @@ import { Card } from "@mantine/core";
|
|
|
1068
1069
|
import React9 from "react";
|
|
1069
1070
|
|
|
1070
1071
|
// src/mantine/hooks/useBlockPresence.ts
|
|
1071
|
-
import { useMemo as
|
|
1072
|
+
import { useMemo as useMemo4, useState as useState4, useEffect as useEffect5 } from "react";
|
|
1072
1073
|
|
|
1073
1074
|
// src/mantine/context/BlocknoteContext.tsx
|
|
1074
|
-
import React8, { createContext, useContext, useState as useState3, useCallback as useCallback4, useRef as useRef3, useEffect as useEffect4 } from "react";
|
|
1075
|
+
import React8, { createContext, useContext, useState as useState3, useCallback as useCallback4, useRef as useRef3, useEffect as useEffect4, useMemo as useMemo3 } from "react";
|
|
1075
1076
|
|
|
1076
1077
|
// src/mantine/blocks/hooks/hookedActions/registry.ts
|
|
1077
1078
|
var hookedActionTypesRegistry = /* @__PURE__ */ new Map();
|
|
@@ -1537,6 +1538,36 @@ var BlocknoteProvider = ({
|
|
|
1537
1538
|
const [drawerContent, setDrawerContent] = useState3(null);
|
|
1538
1539
|
const docType = editor?.docType || "flow";
|
|
1539
1540
|
const flowVersion = editor?.getFlowMetadata?.()?.schema_version || "0.3";
|
|
1541
|
+
const ucanService = useMemo3(() => {
|
|
1542
|
+
const delegationStore = editor?._ucanDelegationStore;
|
|
1543
|
+
const invStore = editor?._invocationStore;
|
|
1544
|
+
if (!delegationStore || !invStore || !handlers) return null;
|
|
1545
|
+
const hasSigningHandlers = !!(handlers.createSignerSession || handlers.getPrivateKey || handlers.getMnemonic);
|
|
1546
|
+
if (!hasSigningHandlers) return null;
|
|
1547
|
+
const flowOwnerDid = editor?.getFlowOwnerDid?.() || "";
|
|
1548
|
+
const docId = editor?.getFlowMetadata?.()?.doc_id || "";
|
|
1549
|
+
const flowUri = docId ? `ixo:flow:${docId}` : "";
|
|
1550
|
+
return createUcanService({
|
|
1551
|
+
delegationStore,
|
|
1552
|
+
invocationStore: invStore,
|
|
1553
|
+
handlers: {
|
|
1554
|
+
createSignerSession: handlers.createSignerSession,
|
|
1555
|
+
signWithSession: handlers.signWithSession,
|
|
1556
|
+
releaseSignerSession: handlers.releaseSignerSession,
|
|
1557
|
+
getPrivateKey: handlers.getPrivateKey,
|
|
1558
|
+
getMnemonic: handlers.getMnemonic,
|
|
1559
|
+
createDelegationWithSession: handlers.createDelegationWithSession,
|
|
1560
|
+
createInvocationWithSession: handlers.createInvocationWithSession
|
|
1561
|
+
},
|
|
1562
|
+
flowOwnerDid,
|
|
1563
|
+
flowUri
|
|
1564
|
+
});
|
|
1565
|
+
}, [editor?._ucanDelegationStore, editor?._invocationStore, handlers, editor?.getFlowOwnerDid?.(), editor?.getFlowMetadata?.()?.doc_id]);
|
|
1566
|
+
useEffect4(() => {
|
|
1567
|
+
if (editor) {
|
|
1568
|
+
editor.getUcanService = () => ucanService;
|
|
1569
|
+
}
|
|
1570
|
+
}, [editor, ucanService]);
|
|
1540
1571
|
useEffect4(() => {
|
|
1541
1572
|
initializeHookedActions();
|
|
1542
1573
|
}, []);
|
|
@@ -1669,7 +1700,7 @@ function useBlockPresence(blockId, options) {
|
|
|
1669
1700
|
awarenessInstance.off("change", onChange);
|
|
1670
1701
|
};
|
|
1671
1702
|
}, [awarenessInstance]);
|
|
1672
|
-
return
|
|
1703
|
+
return useMemo4(() => {
|
|
1673
1704
|
if (!blockId || !awarenessInstance) {
|
|
1674
1705
|
return [];
|
|
1675
1706
|
}
|
|
@@ -1751,15 +1782,15 @@ function BaseContainer({ children, onClick, style, blockId }) {
|
|
|
1751
1782
|
|
|
1752
1783
|
// src/mantine/blocks/components/ConditionBuilder/ConditionRow.tsx
|
|
1753
1784
|
function ConditionRow({ condition, availableBlocks, onUpdate, onDelete }) {
|
|
1754
|
-
const availableProperties =
|
|
1785
|
+
const availableProperties = useMemo5(() => {
|
|
1755
1786
|
if (!condition.sourceBlockType) return [];
|
|
1756
1787
|
return getConditionableProperties(condition.sourceBlockType);
|
|
1757
1788
|
}, [condition.sourceBlockType]);
|
|
1758
|
-
const selectedProperty =
|
|
1789
|
+
const selectedProperty = useMemo5(() => {
|
|
1759
1790
|
if (!condition.sourceBlockType || !condition.rule.property) return null;
|
|
1760
1791
|
return getPropertyByName(condition.sourceBlockType, condition.rule.property);
|
|
1761
1792
|
}, [condition.sourceBlockType, condition.rule.property]);
|
|
1762
|
-
const availableOperators =
|
|
1793
|
+
const availableOperators = useMemo5(() => {
|
|
1763
1794
|
if (!selectedProperty) return [];
|
|
1764
1795
|
const baseOperators = [
|
|
1765
1796
|
{ value: "equals", label: "equals" },
|
|
@@ -2250,7 +2281,7 @@ import { useDisclosure } from "@mantine/hooks";
|
|
|
2250
2281
|
import { IconArrowsMaximize, IconArrowsMinimize, IconChevronDown, IconChevronRight, IconDotsVertical, IconHourglass, IconUsers } from "@tabler/icons-react";
|
|
2251
2282
|
|
|
2252
2283
|
// src/mantine/components/TtlTab.tsx
|
|
2253
|
-
import React17, { useCallback as useCallback11, useMemo as
|
|
2284
|
+
import React17, { useCallback as useCallback11, useMemo as useMemo6 } from "react";
|
|
2254
2285
|
import { Stack as Stack8, Text as Text6, Group as Group3 } from "@mantine/core";
|
|
2255
2286
|
|
|
2256
2287
|
// src/core/utils/dates.ts
|
|
@@ -2323,7 +2354,7 @@ function datetimeLocalToIso(value) {
|
|
|
2323
2354
|
}
|
|
2324
2355
|
}
|
|
2325
2356
|
var DurationInput = ({ label, description, value, onChange }) => {
|
|
2326
|
-
const parts =
|
|
2357
|
+
const parts = useMemo6(() => parseDuration(value), [value]);
|
|
2327
2358
|
const update = useCallback11(
|
|
2328
2359
|
(field, val) => {
|
|
2329
2360
|
onChange(toDuration({ ...parts, [field]: Math.max(0, val || 0) }));
|
|
@@ -2472,7 +2503,7 @@ function BaseRightPanelLayout({ title, isTemplate: _isTemplate = true, captionCo
|
|
|
2472
2503
|
icon: icon(IconShieldCheck)
|
|
2473
2504
|
}
|
|
2474
2505
|
] : tabs;
|
|
2475
|
-
const selectedSkill =
|
|
2506
|
+
const selectedSkill = useMemo7(() => {
|
|
2476
2507
|
try {
|
|
2477
2508
|
return JSON.parse(context?.block.props.skill || "{}");
|
|
2478
2509
|
} catch {
|
|
@@ -2544,7 +2575,7 @@ function BaseRightPanelLayout({ title, isTemplate: _isTemplate = true, captionCo
|
|
|
2544
2575
|
}
|
|
2545
2576
|
|
|
2546
2577
|
// src/mantine/components/AuthorizationTab.tsx
|
|
2547
|
-
import React21, { useMemo as
|
|
2578
|
+
import React21, { useMemo as useMemo8, useState as useState8, useEffect as useEffect10, useCallback as useCallback13 } from "react";
|
|
2548
2579
|
import { Stack as Stack12, Text as Text10, Badge as Badge3, Group as Group6, Switch as Switch3, Select as Select2, Divider as Divider3, Paper as Paper2, Button as Button4, ActionIcon as ActionIcon5, Alert as Alert4 } from "@mantine/core";
|
|
2549
2580
|
import { IconShieldPlus as IconShieldPlus2, IconShieldCheck as IconShieldCheck2, IconTrash, IconUser as IconUser2, IconRobot as IconRobot2, IconKey } from "@tabler/icons-react";
|
|
2550
2581
|
|
|
@@ -2731,16 +2762,16 @@ function getAvailableBlocks2(document2, currentBlockId) {
|
|
|
2731
2762
|
}
|
|
2732
2763
|
var AuthorizationTab = ({ editor, block: initialBlock, flowUri = "", entityDid: entityDidProp = "" }) => {
|
|
2733
2764
|
const handlers = useBlocknoteHandlers();
|
|
2734
|
-
const flowOwnerDid =
|
|
2765
|
+
const flowOwnerDid = useMemo8(() => {
|
|
2735
2766
|
return editor.getFlowOwnerDid?.() || "";
|
|
2736
2767
|
}, [editor]);
|
|
2737
|
-
const currentUserDid =
|
|
2768
|
+
const currentUserDid = useMemo8(() => {
|
|
2738
2769
|
return editor.user?.id || "";
|
|
2739
2770
|
}, [editor.user?.id]);
|
|
2740
|
-
const isFlowOwner =
|
|
2771
|
+
const isFlowOwner = useMemo8(() => {
|
|
2741
2772
|
return flowOwnerDid && currentUserDid && flowOwnerDid === currentUserDid;
|
|
2742
2773
|
}, [flowOwnerDid, currentUserDid]);
|
|
2743
|
-
const entityDid =
|
|
2774
|
+
const entityDid = useMemo8(() => {
|
|
2744
2775
|
if (entityDidProp) return entityDidProp;
|
|
2745
2776
|
if (handlers.getEntityDid) return handlers.getEntityDid() || "";
|
|
2746
2777
|
return "";
|
|
@@ -2748,7 +2779,7 @@ var AuthorizationTab = ({ editor, block: initialBlock, flowUri = "", entityDid:
|
|
|
2748
2779
|
const [creatingRootCapability, setCreatingRootCapability] = useState8(false);
|
|
2749
2780
|
const [rootCapabilityError, setRootCapabilityError] = useState8(null);
|
|
2750
2781
|
const [, forceUpdate] = useState8({});
|
|
2751
|
-
const block =
|
|
2782
|
+
const block = useMemo8(() => {
|
|
2752
2783
|
const doc = editor?.document || [];
|
|
2753
2784
|
return doc.find((b) => b.id === initialBlock.id) || initialBlock;
|
|
2754
2785
|
}, [editor?.document, initialBlock]);
|
|
@@ -2762,7 +2793,7 @@ var AuthorizationTab = ({ editor, block: initialBlock, flowUri = "", entityDid:
|
|
|
2762
2793
|
const activationUpstreamNodeId = block.props.activationUpstreamNodeId || "";
|
|
2763
2794
|
const activationRequiredStatus = block.props.activationRequiredStatus || "";
|
|
2764
2795
|
const activationRequireAuthorisedActor = Boolean(block.props.activationRequireAuthorisedActor);
|
|
2765
|
-
const availableBlocks =
|
|
2796
|
+
const availableBlocks = useMemo8(() => getAvailableBlocks2(editor?.document || [], block.id), [editor?.document, block.id]);
|
|
2766
2797
|
const updateProps = useCallback13(
|
|
2767
2798
|
(updates) => {
|
|
2768
2799
|
const currentBlock = (editor?.document || []).find((b) => b.id === block.id) || block;
|
|
@@ -2776,7 +2807,7 @@ var AuthorizationTab = ({ editor, block: initialBlock, flowUri = "", entityDid:
|
|
|
2776
2807
|
[editor, block.id]
|
|
2777
2808
|
);
|
|
2778
2809
|
const [viewMode, setViewMode] = useState8("main");
|
|
2779
|
-
const rootCapability =
|
|
2810
|
+
const rootCapability = useMemo8(() => {
|
|
2780
2811
|
return editor.getRootCapability?.() || null;
|
|
2781
2812
|
}, [editor, creatingRootCapability]);
|
|
2782
2813
|
const createRootCapability = async (pin) => {
|
|
@@ -2822,7 +2853,7 @@ var AuthorizationTab = ({ editor, block: initialBlock, flowUri = "", entityDid:
|
|
|
2822
2853
|
return { success: false, error: errorMsg };
|
|
2823
2854
|
}
|
|
2824
2855
|
};
|
|
2825
|
-
const blockCapabilities =
|
|
2856
|
+
const blockCapabilities = useMemo8(() => {
|
|
2826
2857
|
if (!editor.getAllDelegations) return [];
|
|
2827
2858
|
const allDelegations = editor.getAllDelegations();
|
|
2828
2859
|
const blockResource = flowUri ? `${flowUri}:${block.id}` : `ixo:flow:*:${block.id}`;
|
|
@@ -3098,13 +3129,13 @@ var getIcon = (fallback = "square-check", key, color = "white", size = 26, strok
|
|
|
3098
3129
|
var CHECKBOX_TEMPLATE_PANEL_ID = "checkbox-template-panel";
|
|
3099
3130
|
var CheckboxTemplateView = ({ editor, block }) => {
|
|
3100
3131
|
const panelId = `${CHECKBOX_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
3101
|
-
const panelContent =
|
|
3132
|
+
const panelContent = useMemo9(() => /* @__PURE__ */ React24.createElement(TemplateConfig, { editor, block }), [editor, block]);
|
|
3102
3133
|
const { open } = usePanel(panelId, panelContent);
|
|
3103
3134
|
return /* @__PURE__ */ React24.createElement(BaseContainer, { blockId: block.id, onClick: open }, /* @__PURE__ */ React24.createElement(Group7, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React24.createElement(Group7, { wrap: "nowrap", align: "center" }, getIcon("square-check", block.props.icon), /* @__PURE__ */ React24.createElement(Stack13, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React24.createElement(Text11, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Checkbox Title"), /* @__PURE__ */ React24.createElement(Text11, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || "Checkbox description"))), /* @__PURE__ */ React24.createElement(Checkbox2, { contentEditable: false, disabled: true, checked: false, style: { flexShrink: 0 }, onClick: (e) => e.stopPropagation() })));
|
|
3104
3135
|
};
|
|
3105
3136
|
|
|
3106
3137
|
// src/mantine/blocks/checkbox/flow/FlowView.tsx
|
|
3107
|
-
import React26, { useMemo as
|
|
3138
|
+
import React26, { useMemo as useMemo10 } from "react";
|
|
3108
3139
|
import { Checkbox as Checkbox3, Group as Group8, Stack as Stack14, Text as Text12, Tooltip } from "@mantine/core";
|
|
3109
3140
|
|
|
3110
3141
|
// src/mantine/hooks/useNodeRuntime.ts
|
|
@@ -3169,7 +3200,7 @@ var CheckboxFlowView = ({ editor, block, isDisabled }) => {
|
|
|
3169
3200
|
const disabled = isDisabled?.isDisabled === "disable";
|
|
3170
3201
|
const [runtime, updateRuntime] = useNodeRuntime(editor, block.id);
|
|
3171
3202
|
const panelId = `${CHECKBOX_FLOW_PANEL_ID}-${block.id}`;
|
|
3172
|
-
const panelContent =
|
|
3203
|
+
const panelContent = useMemo10(() => /* @__PURE__ */ React26.createElement(FlowConfig, { editor, block }), [editor, block]);
|
|
3173
3204
|
const { open } = usePanel(panelId, panelContent);
|
|
3174
3205
|
const checked = runtime.output?.checked ?? false;
|
|
3175
3206
|
const handleCheckboxChange = (event) => {
|
|
@@ -3186,7 +3217,7 @@ var CheckboxFlowView = ({ editor, block, isDisabled }) => {
|
|
|
3186
3217
|
};
|
|
3187
3218
|
|
|
3188
3219
|
// src/mantine/blocks/hooks/useBlockConditions.ts
|
|
3189
|
-
import { useMemo as
|
|
3220
|
+
import { useMemo as useMemo11, useEffect as useEffect12, useState as useState10 } from "react";
|
|
3190
3221
|
|
|
3191
3222
|
// src/mantine/blocks/utils/conditionNormalizer.ts
|
|
3192
3223
|
var OPERATOR_INVERSIONS = {
|
|
@@ -3321,7 +3352,7 @@ function evaluateBlockConditions(conditionConfig, editorDocument, currentUser) {
|
|
|
3321
3352
|
// src/mantine/blocks/hooks/useBlockConditions.ts
|
|
3322
3353
|
function useBlockConditions(block, editor, currentUser) {
|
|
3323
3354
|
const editorDocument = editor?.document;
|
|
3324
|
-
const conditionConfig =
|
|
3355
|
+
const conditionConfig = useMemo11(() => {
|
|
3325
3356
|
return parseConditionConfig(block?.props?.conditions);
|
|
3326
3357
|
}, [block?.props?.conditions]);
|
|
3327
3358
|
const [sourceBlockVersion, setSourceBlockVersion] = useState10(0);
|
|
@@ -3338,7 +3369,7 @@ function useBlockConditions(block, editor, currentUser) {
|
|
|
3338
3369
|
});
|
|
3339
3370
|
return cleanup;
|
|
3340
3371
|
}, [editor, conditionConfig]);
|
|
3341
|
-
const result =
|
|
3372
|
+
const result = useMemo11(() => {
|
|
3342
3373
|
if (!editorDocument || !block) {
|
|
3343
3374
|
return {
|
|
3344
3375
|
actions: []
|
|
@@ -3428,7 +3459,7 @@ import { createReactBlockSpec as createReactBlockSpec3 } from "@blocknote/react"
|
|
|
3428
3459
|
import React89 from "react";
|
|
3429
3460
|
|
|
3430
3461
|
// src/mantine/blocks/list/template/TemplateView.tsx
|
|
3431
|
-
import React32, { useMemo as
|
|
3462
|
+
import React32, { useMemo as useMemo12 } from "react";
|
|
3432
3463
|
|
|
3433
3464
|
// src/mantine/blocks/list/template/TemplateConfig.tsx
|
|
3434
3465
|
import React31, { useCallback as useCallback16 } from "react";
|
|
@@ -4661,7 +4692,7 @@ import { Group as Group10, Stack as Stack16, Text as Text14 } from "@mantine/cor
|
|
|
4661
4692
|
var LIST_TEMPLATE_PANEL_ID = "list-template-panel";
|
|
4662
4693
|
var ListTemplateView = ({ editor, block }) => {
|
|
4663
4694
|
const panelId = `${LIST_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
4664
|
-
const panelContent =
|
|
4695
|
+
const panelContent = useMemo12(() => /* @__PURE__ */ React32.createElement(TemplateConfig2, { editor, block }), [editor, block]);
|
|
4665
4696
|
const { open } = usePanel(panelId, panelContent);
|
|
4666
4697
|
const listType = block.props.listType && block.props.listType !== "" ? block.props.listType : null;
|
|
4667
4698
|
const listName = listType ? getListNameByType(listType) : "Unconfigured List";
|
|
@@ -4669,7 +4700,7 @@ var ListTemplateView = ({ editor, block }) => {
|
|
|
4669
4700
|
};
|
|
4670
4701
|
|
|
4671
4702
|
// src/mantine/blocks/list/flow/ListFlowView.tsx
|
|
4672
|
-
import React88, { useState as useState37, useEffect as useEffect35, useMemo as
|
|
4703
|
+
import React88, { useState as useState37, useEffect as useEffect35, useMemo as useMemo40, useCallback as useCallback31, useRef as useRef12 } from "react";
|
|
4673
4704
|
import { Stack as Stack59, Text as Text60, ActionIcon as ActionIcon11, Loader as Loader16, Center as Center9, Flex as Flex27, Title as Title6, Collapse as Collapse3, Tooltip as Tooltip6 } from "@mantine/core";
|
|
4674
4705
|
|
|
4675
4706
|
// src/mantine/blocks/list/linked_resources/ResourcesList.tsx
|
|
@@ -5234,7 +5265,7 @@ var DeedSubscriptionsList = ({ items, isMultiSelect: _isMultiSelect, isItemCheck
|
|
|
5234
5265
|
};
|
|
5235
5266
|
|
|
5236
5267
|
// src/mantine/blocks/list/ListSelectionPanel.tsx
|
|
5237
|
-
import React83, { useState as useState34, useEffect as useEffect33, useMemo as
|
|
5268
|
+
import React83, { useState as useState34, useEffect as useEffect33, useMemo as useMemo38 } from "react";
|
|
5238
5269
|
import { Stack as Stack55, Alert as Alert14, Text as Text55, Loader as Loader15, Center as Center8, Space } from "@mantine/core";
|
|
5239
5270
|
import { IconClipboardText, IconChecklist as IconChecklist4, IconFileDescription as IconFileDescription2 } from "@tabler/icons-react";
|
|
5240
5271
|
|
|
@@ -5335,7 +5366,7 @@ var TransactionDetails = ({ transaction }) => {
|
|
|
5335
5366
|
};
|
|
5336
5367
|
|
|
5337
5368
|
// src/mantine/blocks/list/claims/ClaimsListPanelContent.tsx
|
|
5338
|
-
import React54, { useEffect as useEffect14, useMemo as
|
|
5369
|
+
import React54, { useEffect as useEffect14, useMemo as useMemo13, useState as useState14 } from "react";
|
|
5339
5370
|
import { Text as Text33, Stack as Stack34, Loader as Loader3, Alert as Alert5 } from "@mantine/core";
|
|
5340
5371
|
import { Survey, SurveyModel } from "@ixo/surveys";
|
|
5341
5372
|
|
|
@@ -5478,7 +5509,7 @@ var ClaimsListPanelContent = ({ collectionId, deedId, claim }) => {
|
|
|
5478
5509
|
setSurveyLoading(false);
|
|
5479
5510
|
}
|
|
5480
5511
|
};
|
|
5481
|
-
const surveyModel =
|
|
5512
|
+
const surveyModel = useMemo13(() => {
|
|
5482
5513
|
if (!surveyJson || !claimData) return null;
|
|
5483
5514
|
const model = new SurveyModel(surveyJson);
|
|
5484
5515
|
model.applyTheme(surveyTheme);
|
|
@@ -5501,14 +5532,14 @@ var ClaimsListPanelContent = ({ collectionId, deedId, claim }) => {
|
|
|
5501
5532
|
};
|
|
5502
5533
|
|
|
5503
5534
|
// src/mantine/blocks/list/claims/ClaimsEvaluation.tsx
|
|
5504
|
-
import React82, { useCallback as useCallback30, useEffect as useEffect32, useMemo as
|
|
5535
|
+
import React82, { useCallback as useCallback30, useEffect as useEffect32, useMemo as useMemo37, useRef as useRef11, useState as useState33 } from "react";
|
|
5505
5536
|
import { Alert as Alert13, Box as Box24, Button as Button11, Divider as Divider8, Group as Group23, Loader as Loader14, Stack as Stack54, Text as Text54 } from "@mantine/core";
|
|
5506
5537
|
|
|
5507
5538
|
// src/mantine/blocks/evaluator/EvaluatorBlock.tsx
|
|
5508
5539
|
import React79 from "react";
|
|
5509
5540
|
|
|
5510
5541
|
// src/mantine/blocks/evaluator/template/TemplateView.tsx
|
|
5511
|
-
import React65, { useMemo as
|
|
5542
|
+
import React65, { useMemo as useMemo21 } from "react";
|
|
5512
5543
|
import { Group as Group14, Stack as Stack40, Text as Text39 } from "@mantine/core";
|
|
5513
5544
|
|
|
5514
5545
|
// src/mantine/blocks/evaluator/template/TemplateConfig.tsx
|
|
@@ -5516,7 +5547,7 @@ import React59, { useCallback as useCallback19 } from "react";
|
|
|
5516
5547
|
import { IconSettings as IconSettings3, IconShieldCheck as IconShieldCheck5, IconContract, IconClock as IconClock2 } from "@tabler/icons-react";
|
|
5517
5548
|
|
|
5518
5549
|
// src/mantine/blocks/evaluator/template/GeneralTab.tsx
|
|
5519
|
-
import React56, { useEffect as useEffect16, useState as useState16, useCallback as useCallback17, useMemo as
|
|
5550
|
+
import React56, { useEffect as useEffect16, useState as useState16, useCallback as useCallback17, useMemo as useMemo14 } from "react";
|
|
5520
5551
|
|
|
5521
5552
|
// src/mantine/components/CollectionSelector.tsx
|
|
5522
5553
|
import React55, { useState as useState15, useEffect as useEffect15 } from "react";
|
|
@@ -5622,7 +5653,7 @@ var GeneralTab3 = ({
|
|
|
5622
5653
|
useEffect16(() => {
|
|
5623
5654
|
setLocalDescription(description || "");
|
|
5624
5655
|
}, [description]);
|
|
5625
|
-
const parsedSelectedCollections =
|
|
5656
|
+
const parsedSelectedCollections = useMemo14(() => {
|
|
5626
5657
|
try {
|
|
5627
5658
|
return JSON.parse(selectedCollections || "[]");
|
|
5628
5659
|
} catch {
|
|
@@ -5683,7 +5714,7 @@ var GeneralTab3 = ({
|
|
|
5683
5714
|
};
|
|
5684
5715
|
|
|
5685
5716
|
// src/mantine/components/CommitmentTab.tsx
|
|
5686
|
-
import React58, { useMemo as
|
|
5717
|
+
import React58, { useMemo as useMemo15, useState as useState17, useEffect as useEffect17, useCallback as useCallback18 } from "react";
|
|
5687
5718
|
import { Stack as Stack36, Flex as Flex19, Text as Text35 } from "@mantine/core";
|
|
5688
5719
|
|
|
5689
5720
|
// src/mantine/components/Base/BaseAvatar.tsx
|
|
@@ -5714,11 +5745,11 @@ var CommitmentTab = ({ editor, block: initialBlock }) => {
|
|
|
5714
5745
|
const [selectedValue, setSelectedValue] = useState17(null);
|
|
5715
5746
|
const roomId = editor.getRoomId?.() || null;
|
|
5716
5747
|
const mx = editor.getMatrixClient?.() || null;
|
|
5717
|
-
const currentUserMatrixId =
|
|
5748
|
+
const currentUserMatrixId = useMemo15(() => {
|
|
5718
5749
|
return editor.user?.id || "";
|
|
5719
5750
|
}, [editor.user?.id]);
|
|
5720
5751
|
const [, forceUpdate] = useState17({});
|
|
5721
|
-
const block =
|
|
5752
|
+
const block = useMemo15(() => {
|
|
5722
5753
|
const doc = editor?.document || [];
|
|
5723
5754
|
return doc.find((b) => b.id === initialBlock.id) || initialBlock;
|
|
5724
5755
|
}, [editor?.document, initialBlock]);
|
|
@@ -5805,20 +5836,20 @@ var CommitmentTab = ({ editor, block: initialBlock }) => {
|
|
|
5805
5836
|
setSelectedValue(null);
|
|
5806
5837
|
setSearchValue("");
|
|
5807
5838
|
};
|
|
5808
|
-
const filteredMembers =
|
|
5839
|
+
const filteredMembers = useMemo15(() => {
|
|
5809
5840
|
if (!searchValue.trim()) {
|
|
5810
5841
|
return roomMembers;
|
|
5811
5842
|
}
|
|
5812
5843
|
const query = searchValue.toLowerCase();
|
|
5813
5844
|
return roomMembers.filter((member) => member.name.toLowerCase().includes(query));
|
|
5814
5845
|
}, [roomMembers, searchValue]);
|
|
5815
|
-
const selectData =
|
|
5846
|
+
const selectData = useMemo15(() => {
|
|
5816
5847
|
return filteredMembers.map((member) => ({
|
|
5817
5848
|
value: member.did,
|
|
5818
5849
|
label: member.name || member.did
|
|
5819
5850
|
}));
|
|
5820
5851
|
}, [filteredMembers]);
|
|
5821
|
-
const memberLookup =
|
|
5852
|
+
const memberLookup = useMemo15(() => {
|
|
5822
5853
|
const lookup = {};
|
|
5823
5854
|
roomMembers.forEach((member) => {
|
|
5824
5855
|
lookup[member.did] = member;
|
|
@@ -5901,10 +5932,10 @@ var TemplateConfig3 = ({ editor, block }) => {
|
|
|
5901
5932
|
|
|
5902
5933
|
// src/mantine/blocks/components/AssignmentPanel.tsx
|
|
5903
5934
|
import React62 from "react";
|
|
5904
|
-
import { useMemo as
|
|
5935
|
+
import { useMemo as useMemo18 } from "react";
|
|
5905
5936
|
|
|
5906
5937
|
// src/mantine/components/AssignmentTab.tsx
|
|
5907
|
-
import React60, { useMemo as
|
|
5938
|
+
import React60, { useMemo as useMemo16, useState as useState18, useEffect as useEffect18, useCallback as useCallback20 } from "react";
|
|
5908
5939
|
import { Stack as Stack37, Flex as Flex20, Text as Text36 } from "@mantine/core";
|
|
5909
5940
|
var AssignmentTab = ({ editor, block: initialBlock }) => {
|
|
5910
5941
|
const handlers = useBlocknoteHandlers();
|
|
@@ -5913,11 +5944,11 @@ var AssignmentTab = ({ editor, block: initialBlock }) => {
|
|
|
5913
5944
|
const [selectedValue, setSelectedValue] = useState18(null);
|
|
5914
5945
|
const roomId = editor.getRoomId?.() || null;
|
|
5915
5946
|
const mx = editor.getMatrixClient?.() || null;
|
|
5916
|
-
const currentUserMatrixId =
|
|
5947
|
+
const currentUserMatrixId = useMemo16(() => {
|
|
5917
5948
|
return editor.user?.id || "";
|
|
5918
5949
|
}, [editor.user?.id]);
|
|
5919
5950
|
const [, forceUpdate] = useState18({});
|
|
5920
|
-
const block =
|
|
5951
|
+
const block = useMemo16(() => {
|
|
5921
5952
|
const doc = editor?.document || [];
|
|
5922
5953
|
return doc.find((b) => b.id === initialBlock.id) || initialBlock;
|
|
5923
5954
|
}, [editor?.document, initialBlock]);
|
|
@@ -6025,20 +6056,20 @@ var AssignmentTab = ({ editor, block: initialBlock }) => {
|
|
|
6025
6056
|
setSelectedValue(null);
|
|
6026
6057
|
setSearchValue("");
|
|
6027
6058
|
};
|
|
6028
|
-
const filteredMembers =
|
|
6059
|
+
const filteredMembers = useMemo16(() => {
|
|
6029
6060
|
if (!searchValue.trim()) {
|
|
6030
6061
|
return roomMembers;
|
|
6031
6062
|
}
|
|
6032
6063
|
const query = searchValue.toLowerCase();
|
|
6033
6064
|
return roomMembers.filter((member) => member.name.toLowerCase().includes(query));
|
|
6034
6065
|
}, [roomMembers, searchValue]);
|
|
6035
|
-
const selectData =
|
|
6066
|
+
const selectData = useMemo16(() => {
|
|
6036
6067
|
return filteredMembers.map((member) => ({
|
|
6037
6068
|
value: member.did,
|
|
6038
6069
|
label: member.name || member.did
|
|
6039
6070
|
}));
|
|
6040
6071
|
}, [filteredMembers]);
|
|
6041
|
-
const memberLookup =
|
|
6072
|
+
const memberLookup = useMemo16(() => {
|
|
6042
6073
|
const lookup = {};
|
|
6043
6074
|
roomMembers.forEach((member) => {
|
|
6044
6075
|
lookup[member.did] = member;
|
|
@@ -6082,7 +6113,7 @@ var AssignmentTab = ({ editor, block: initialBlock }) => {
|
|
|
6082
6113
|
};
|
|
6083
6114
|
|
|
6084
6115
|
// src/mantine/components/AssignmentDisplay.tsx
|
|
6085
|
-
import React61, { useMemo as
|
|
6116
|
+
import React61, { useMemo as useMemo17 } from "react";
|
|
6086
6117
|
import { Stack as Stack38, Text as Text37, Flex as Flex21, Box as Box18, Popover as Popover3, Avatar as Avatar3 } from "@mantine/core";
|
|
6087
6118
|
import { useDisclosure as useDisclosure2 } from "@mantine/hooks";
|
|
6088
6119
|
var AVATAR_SIZE = 24;
|
|
@@ -6106,7 +6137,7 @@ var AvatarWrapper = React61.forwardRef(({ children, onClick, onMouseEnter, onMou
|
|
|
6106
6137
|
AvatarWrapper.displayName = "AvatarWrapper";
|
|
6107
6138
|
var AssignmentDisplay = ({ block, onClick }) => {
|
|
6108
6139
|
const [opened, { open, close }] = useDisclosure2(false);
|
|
6109
|
-
const assignmentState =
|
|
6140
|
+
const assignmentState = useMemo17(() => {
|
|
6110
6141
|
try {
|
|
6111
6142
|
const assignment = typeof block.props.assignment === "string" ? JSON.parse(block.props.assignment) : block.props.assignment;
|
|
6112
6143
|
return assignment || {
|
|
@@ -6133,7 +6164,7 @@ var ASSIGNMENT_PANEL_ID = "assignment-panel";
|
|
|
6133
6164
|
function AssignmentPanel({ block, editor }) {
|
|
6134
6165
|
const assignmentPanelId = `${ASSIGNMENT_PANEL_ID}-${block.id}`;
|
|
6135
6166
|
const { closePanel } = usePanelStore();
|
|
6136
|
-
const assignmentPanelContent =
|
|
6167
|
+
const assignmentPanelContent = useMemo18(
|
|
6137
6168
|
() => /* @__PURE__ */ React62.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Assignment Tab" }, /* @__PURE__ */ React62.createElement(AssignmentTab, { editor, block })),
|
|
6138
6169
|
[editor, block, closePanel]
|
|
6139
6170
|
);
|
|
@@ -6143,10 +6174,10 @@ function AssignmentPanel({ block, editor }) {
|
|
|
6143
6174
|
|
|
6144
6175
|
// src/mantine/blocks/components/CommitmentPanel.tsx
|
|
6145
6176
|
import React64 from "react";
|
|
6146
|
-
import { useMemo as
|
|
6177
|
+
import { useMemo as useMemo20 } from "react";
|
|
6147
6178
|
|
|
6148
6179
|
// src/mantine/components/CommitmentDisplay.tsx
|
|
6149
|
-
import React63, { useMemo as
|
|
6180
|
+
import React63, { useMemo as useMemo19 } from "react";
|
|
6150
6181
|
import { Stack as Stack39, Text as Text38, Flex as Flex22, Box as Box19, Popover as Popover4, Avatar as Avatar4 } from "@mantine/core";
|
|
6151
6182
|
import { useDisclosure as useDisclosure3 } from "@mantine/hooks";
|
|
6152
6183
|
var AVATAR_SIZE2 = 24;
|
|
@@ -6170,7 +6201,7 @@ var AvatarWrapper2 = React63.forwardRef(({ children, onClick, onMouseEnter, onMo
|
|
|
6170
6201
|
AvatarWrapper2.displayName = "AvatarWrapper";
|
|
6171
6202
|
var CommitmentDisplay = ({ block, onClick }) => {
|
|
6172
6203
|
const [opened, { open, close }] = useDisclosure3(false);
|
|
6173
|
-
const commitmentState =
|
|
6204
|
+
const commitmentState = useMemo19(() => {
|
|
6174
6205
|
try {
|
|
6175
6206
|
const commitment = typeof block.props.commitment === "string" ? JSON.parse(block.props.commitment) : block.props.commitment;
|
|
6176
6207
|
return commitment || {
|
|
@@ -6198,7 +6229,7 @@ var COMMITMENT_PANEL_ID = "commitment-panel";
|
|
|
6198
6229
|
function CommitmentPanel({ block, editor }) {
|
|
6199
6230
|
const commitmentPanelId = `${COMMITMENT_PANEL_ID}-${block.id}`;
|
|
6200
6231
|
const { closePanel } = usePanelStore();
|
|
6201
|
-
const commitmentPanelContent =
|
|
6232
|
+
const commitmentPanelContent = useMemo20(
|
|
6202
6233
|
() => /* @__PURE__ */ React64.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Commitment Tab" }, /* @__PURE__ */ React64.createElement(CommitmentTab, { editor, block })),
|
|
6203
6234
|
[editor, block, closePanel]
|
|
6204
6235
|
);
|
|
@@ -6210,13 +6241,13 @@ function CommitmentPanel({ block, editor }) {
|
|
|
6210
6241
|
var EVALUATOR_TEMPLATE_PANEL_ID = "evaluator-template-panel";
|
|
6211
6242
|
var EvaluatorTemplateView = ({ editor, block }) => {
|
|
6212
6243
|
const panelId = `${EVALUATOR_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
6213
|
-
const panelContent =
|
|
6244
|
+
const panelContent = useMemo21(() => /* @__PURE__ */ React65.createElement(TemplateConfig3, { editor, block }), [editor, block]);
|
|
6214
6245
|
const { open } = usePanel(panelId, panelContent);
|
|
6215
6246
|
return /* @__PURE__ */ React65.createElement(BaseContainer, { blockId: block.id, onClick: open }, /* @__PURE__ */ React65.createElement(Group14, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React65.createElement(Group14, { wrap: "nowrap", align: "center" }, getIcon("checklist", block.props.icon), /* @__PURE__ */ React65.createElement(Stack40, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React65.createElement(Text39, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Evaluator Title"), /* @__PURE__ */ React65.createElement(Text39, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || "Evaluator description"))), /* @__PURE__ */ React65.createElement(Group14, { gap: 4, wrap: "nowrap", style: { flexShrink: 0 } }, /* @__PURE__ */ React65.createElement(CommitmentPanel, { block, editor }), /* @__PURE__ */ React65.createElement(AssignmentPanel, { block, editor }))));
|
|
6216
6247
|
};
|
|
6217
6248
|
|
|
6218
6249
|
// src/mantine/blocks/evaluator/flow/FlowView.tsx
|
|
6219
|
-
import React78, { useMemo as
|
|
6250
|
+
import React78, { useMemo as useMemo36 } from "react";
|
|
6220
6251
|
import { Stack as Stack52, Text as Text52, Loader as Loader13, Center as Center7, Alert as Alert12 } from "@mantine/core";
|
|
6221
6252
|
import { IconAlertCircle as IconAlertCircle7 } from "@tabler/icons-react";
|
|
6222
6253
|
|
|
@@ -6244,7 +6275,7 @@ function useCurrentUser() {
|
|
|
6244
6275
|
}
|
|
6245
6276
|
|
|
6246
6277
|
// src/mantine/hooks/useCollections.ts
|
|
6247
|
-
import { useState as useState20, useEffect as useEffect20, useCallback as useCallback21, useRef as useRef7, useMemo as
|
|
6278
|
+
import { useState as useState20, useEffect as useEffect20, useCallback as useCallback21, useRef as useRef7, useMemo as useMemo22 } from "react";
|
|
6248
6279
|
function useCollections(did, selectedCollectionIds, block, editor) {
|
|
6249
6280
|
const { getClaimCollections } = useBlocknoteHandlers();
|
|
6250
6281
|
const getClaimCollectionsRef = useRef7(getClaimCollections);
|
|
@@ -6255,7 +6286,7 @@ function useCollections(did, selectedCollectionIds, block, editor) {
|
|
|
6255
6286
|
const [loading, setLoading] = useState20(false);
|
|
6256
6287
|
const [error, setError] = useState20(null);
|
|
6257
6288
|
const adminAddressUpdatedRef = useRef7(false);
|
|
6258
|
-
const selectedCollectionIdsStr =
|
|
6289
|
+
const selectedCollectionIdsStr = useMemo22(() => JSON.stringify(selectedCollectionIds.sort()), [selectedCollectionIds]);
|
|
6259
6290
|
const fetchCollections = useCallback21(async () => {
|
|
6260
6291
|
if (!did || selectedCollectionIds.length === 0) {
|
|
6261
6292
|
setCollections([]);
|
|
@@ -6299,7 +6330,7 @@ import React77 from "react";
|
|
|
6299
6330
|
import { Stack as Stack51, Text as Text51, Loader as Loader12, Center as Center6 } from "@mantine/core";
|
|
6300
6331
|
|
|
6301
6332
|
// src/mantine/hooks/useUserRoles.ts
|
|
6302
|
-
import { useState as useState21, useEffect as useEffect21, useMemo as
|
|
6333
|
+
import { useState as useState21, useEffect as useEffect21, useMemo as useMemo23, useRef as useRef8 } from "react";
|
|
6303
6334
|
|
|
6304
6335
|
// src/mantine/hooks/utils.ts
|
|
6305
6336
|
function isClientFulfillmentError(error) {
|
|
@@ -6317,11 +6348,11 @@ function useUserRoles(collections, userAddress, adminAddress, deedId) {
|
|
|
6317
6348
|
const [userRoles, setUserRoles] = useState21({});
|
|
6318
6349
|
const [loading, setLoading] = useState21(true);
|
|
6319
6350
|
const failedRequestKeyRef = useRef8(null);
|
|
6320
|
-
const collectionIdsKey =
|
|
6351
|
+
const collectionIdsKey = useMemo23(
|
|
6321
6352
|
() => collections.map((c) => c.id).sort().join("|"),
|
|
6322
6353
|
[collections]
|
|
6323
6354
|
);
|
|
6324
|
-
const requestKey =
|
|
6355
|
+
const requestKey = useMemo23(() => [userAddress, adminAddress, deedId, collectionIdsKey].filter(Boolean).join("|"), [userAddress, adminAddress, deedId, collectionIdsKey]);
|
|
6325
6356
|
useEffect21(() => {
|
|
6326
6357
|
let isMounted = true;
|
|
6327
6358
|
const setEmptyRoles = () => {
|
|
@@ -6385,11 +6416,11 @@ function useUserRoles(collections, userAddress, adminAddress, deedId) {
|
|
|
6385
6416
|
}
|
|
6386
6417
|
|
|
6387
6418
|
// src/mantine/blocks/claim/flow/ClaimCollectionItem.tsx
|
|
6388
|
-
import React67, { useMemo as
|
|
6419
|
+
import React67, { useMemo as useMemo25 } from "react";
|
|
6389
6420
|
import { Stack as Stack42, Text as Text41, Group as Group16 } from "@mantine/core";
|
|
6390
6421
|
|
|
6391
6422
|
// src/mantine/blocks/claim/flow/ClaimsListSheet.tsx
|
|
6392
|
-
import React66, { useState as useState22, useEffect as useEffect22, useCallback as useCallback22, useMemo as
|
|
6423
|
+
import React66, { useState as useState22, useEffect as useEffect22, useCallback as useCallback22, useMemo as useMemo24 } from "react";
|
|
6393
6424
|
import { Loader as Loader5, Stack as Stack41, Text as Text40, ActionIcon as ActionIcon7, Alert as Alert7, Box as Box20, Group as Group15 } from "@mantine/core";
|
|
6394
6425
|
import { IconArrowLeft as IconArrowLeft2, IconAlertCircle as IconAlertCircle2 } from "@tabler/icons-react";
|
|
6395
6426
|
import { Survey as Survey2, SurveyModel as SurveyModel2 } from "@ixo/surveys";
|
|
@@ -6466,7 +6497,7 @@ var ClaimsListSheet = ({
|
|
|
6466
6497
|
console.log("[ClaimsListSheet] useEffect fetchClaims");
|
|
6467
6498
|
fetchClaims();
|
|
6468
6499
|
}, [fetchClaims]);
|
|
6469
|
-
const surveyModel =
|
|
6500
|
+
const surveyModel = useMemo24(() => {
|
|
6470
6501
|
console.log("[ClaimsListSheet] surveyModel useMemo", { hasSurveyJson: !!surveyJson });
|
|
6471
6502
|
if (!surveyJson) return null;
|
|
6472
6503
|
const model = new SurveyModel2(surveyJson);
|
|
@@ -6509,7 +6540,8 @@ var ClaimsListSheet = ({
|
|
|
6509
6540
|
invocationStore: execution.invocationStore,
|
|
6510
6541
|
flowUri: execution.flowUri || "",
|
|
6511
6542
|
flowId: execution.flowId || "",
|
|
6512
|
-
flowOwnerDid: execution.flowOwnerDid || ""
|
|
6543
|
+
flowOwnerDid: execution.flowOwnerDid || "",
|
|
6544
|
+
schemaVersion: execution.schemaVersion || "0.3"
|
|
6513
6545
|
},
|
|
6514
6546
|
pin: "",
|
|
6515
6547
|
// TODO: collect PIN from user for invocation signing
|
|
@@ -6695,7 +6727,7 @@ var ClaimCollectionItem = ({ collection, block, deedId, editor, adminAddress, us
|
|
|
6695
6727
|
const collectionName = getCollectionName2(collection);
|
|
6696
6728
|
console.log("[CollectionItem] Panel setup", { claimsPanelId, collectionName, canAccessClaims });
|
|
6697
6729
|
console.log("[CollectionItem] Creating claimsPanelContent useMemo...");
|
|
6698
|
-
const claimsPanelContent =
|
|
6730
|
+
const claimsPanelContent = useMemo25(() => {
|
|
6699
6731
|
console.log("[CollectionItem] claimsPanelContent useMemo EXECUTING", { collectionId: collection.id });
|
|
6700
6732
|
return /* @__PURE__ */ React67.createElement(
|
|
6701
6733
|
ClaimsListSheet,
|
|
@@ -6731,21 +6763,21 @@ var ClaimCollectionItem = ({ collection, block, deedId, editor, adminAddress, us
|
|
|
6731
6763
|
};
|
|
6732
6764
|
|
|
6733
6765
|
// src/mantine/blocks/components/bid/components/BidCollectionItem.tsx
|
|
6734
|
-
import React73, { useMemo as
|
|
6766
|
+
import React73, { useMemo as useMemo32 } from "react";
|
|
6735
6767
|
import { Stack as Stack47, Text as Text47, Center as Center4, Loader as Loader10, Group as Group19 } from "@mantine/core";
|
|
6736
6768
|
|
|
6737
6769
|
// src/mantine/hooks/useBlockAuthorization.ts
|
|
6738
|
-
import { useState as useState23, useEffect as useEffect23, useMemo as
|
|
6770
|
+
import { useState as useState23, useEffect as useEffect23, useMemo as useMemo26 } from "react";
|
|
6739
6771
|
function useBlockAuthorization({ editor, blockId, actorDid, ucanService, flowUri }) {
|
|
6740
6772
|
const [result, setResult] = useState23({ authorized: false, reason: "Checking authorization..." });
|
|
6741
6773
|
const [loading, setLoading] = useState23(true);
|
|
6742
6774
|
const [checkTrigger, setCheckTrigger] = useState23(0);
|
|
6743
|
-
const resolvedFlowUri =
|
|
6775
|
+
const resolvedFlowUri = useMemo26(() => {
|
|
6744
6776
|
if (flowUri) return flowUri;
|
|
6745
6777
|
const metadata = editor.getFlowMetadata?.();
|
|
6746
6778
|
return metadata?.doc_id ? `ixo:flow:${metadata.doc_id}` : "";
|
|
6747
6779
|
}, [flowUri, editor]);
|
|
6748
|
-
const schemaVersion =
|
|
6780
|
+
const schemaVersion = useMemo26(() => editor.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
6749
6781
|
useEffect23(() => {
|
|
6750
6782
|
const checkAuthorization = async () => {
|
|
6751
6783
|
setLoading(true);
|
|
@@ -6754,11 +6786,6 @@ function useBlockAuthorization({ editor, blockId, actorDid, ucanService, flowUri
|
|
|
6754
6786
|
setLoading(false);
|
|
6755
6787
|
return;
|
|
6756
6788
|
}
|
|
6757
|
-
if (!ucanService) {
|
|
6758
|
-
setResult({ authorized: false, reason: "UCAN service not configured" });
|
|
6759
|
-
setLoading(false);
|
|
6760
|
-
return;
|
|
6761
|
-
}
|
|
6762
6789
|
if (!resolvedFlowUri) {
|
|
6763
6790
|
setResult({ authorized: false, reason: "Flow URI not available" });
|
|
6764
6791
|
setLoading(false);
|
|
@@ -6795,18 +6822,18 @@ import { Stack as Stack45, Text as Text44, Loader as Loader7, Center as Center3,
|
|
|
6795
6822
|
import { IconAlertCircle as IconAlertCircle4 } from "@tabler/icons-react";
|
|
6796
6823
|
|
|
6797
6824
|
// src/mantine/blocks/components/bid/components/BidItem.tsx
|
|
6798
|
-
import React69, { useMemo as
|
|
6825
|
+
import React69, { useMemo as useMemo29 } from "react";
|
|
6799
6826
|
import { Stack as Stack44, Text as Text43, Badge as Badge6, Group as Group18, ActionIcon as ActionIcon8 } from "@mantine/core";
|
|
6800
6827
|
import { IconArrowRight } from "@tabler/icons-react";
|
|
6801
6828
|
|
|
6802
6829
|
// src/mantine/blocks/components/bid/components/BidViewPanel.tsx
|
|
6803
|
-
import React68, { useMemo as
|
|
6830
|
+
import React68, { useMemo as useMemo28, useState as useState26 } from "react";
|
|
6804
6831
|
import { Loader as Loader6, Stack as Stack43, Text as Text42, Button as Button8, Group as Group17, Modal, Alert as Alert8, Box as Box21, Title as Title4 } from "@mantine/core";
|
|
6805
6832
|
import { Survey as Survey3 } from "@ixo/surveys";
|
|
6806
6833
|
import { IconCheck as IconCheck2, IconX as IconX5, IconAlertCircle as IconAlertCircle3 } from "@tabler/icons-react";
|
|
6807
6834
|
|
|
6808
6835
|
// src/mantine/blocks/components/bid/hooks/useBidView.ts
|
|
6809
|
-
import { useState as useState24, useEffect as useEffect24, useMemo as
|
|
6836
|
+
import { useState as useState24, useEffect as useEffect24, useMemo as useMemo27 } from "react";
|
|
6810
6837
|
import { SurveyModel as SurveyModel3 } from "@ixo/surveys";
|
|
6811
6838
|
|
|
6812
6839
|
// src/mantine/blocks/components/bid/constants.ts
|
|
@@ -6886,7 +6913,7 @@ function useBidView(bid, deedId) {
|
|
|
6886
6913
|
};
|
|
6887
6914
|
fetchSurveyTemplate();
|
|
6888
6915
|
}, [deedId, bid.role, handlers]);
|
|
6889
|
-
const surveyModel =
|
|
6916
|
+
const surveyModel = useMemo27(() => {
|
|
6890
6917
|
if (!surveyJson) return null;
|
|
6891
6918
|
const model = new SurveyModel3(surveyJson);
|
|
6892
6919
|
model.applyTheme(surveyTheme);
|
|
@@ -6921,7 +6948,8 @@ function useBidActions(bid, deedId, adminAddress, execution, onRefresh, executeH
|
|
|
6921
6948
|
invocationStore: execution.invocationStore,
|
|
6922
6949
|
flowUri: execution.flowUri || "",
|
|
6923
6950
|
flowId: execution.flowId || "",
|
|
6924
|
-
flowOwnerDid: execution.flowOwnerDid || ""
|
|
6951
|
+
flowOwnerDid: execution.flowOwnerDid || "",
|
|
6952
|
+
schemaVersion: execution.schemaVersion || "0.3"
|
|
6925
6953
|
},
|
|
6926
6954
|
pin: "",
|
|
6927
6955
|
// TODO: collect PIN from user for invocation signing
|
|
@@ -7000,7 +7028,8 @@ function useBidActions(bid, deedId, adminAddress, execution, onRefresh, executeH
|
|
|
7000
7028
|
invocationStore: execution.invocationStore,
|
|
7001
7029
|
flowUri: execution.flowUri || "",
|
|
7002
7030
|
flowId: execution.flowId || "",
|
|
7003
|
-
flowOwnerDid: execution.flowOwnerDid || ""
|
|
7031
|
+
flowOwnerDid: execution.flowOwnerDid || "",
|
|
7032
|
+
schemaVersion: execution.schemaVersion || "0.3"
|
|
7004
7033
|
},
|
|
7005
7034
|
pin: "",
|
|
7006
7035
|
// TODO: collect PIN from user for invocation signing
|
|
@@ -7088,7 +7117,7 @@ var BidViewPanel = ({ editor, block, bid, deedId, adminAddress, onRefresh, execu
|
|
|
7088
7117
|
const maxAmounts = buildMaxAmounts();
|
|
7089
7118
|
approveBid(maxAmounts);
|
|
7090
7119
|
};
|
|
7091
|
-
const surveyContainerStyle =
|
|
7120
|
+
const surveyContainerStyle = useMemo28(
|
|
7092
7121
|
() => ({
|
|
7093
7122
|
flex: 1,
|
|
7094
7123
|
overflow: "auto",
|
|
@@ -7140,7 +7169,7 @@ function useUserProfile(did) {
|
|
|
7140
7169
|
var BidItem = ({ editor, block, bid, deedId, adminAddress, onRefresh, execution, executeHookedActions }) => {
|
|
7141
7170
|
const { userProfile, loading: loadingProfile } = useUserProfile(bid.did);
|
|
7142
7171
|
const bidPanelId = `bid-view-${bid.id}`;
|
|
7143
|
-
const bidPanelContent =
|
|
7172
|
+
const bidPanelContent = useMemo29(
|
|
7144
7173
|
() => /* @__PURE__ */ React69.createElement(
|
|
7145
7174
|
BidViewPanel,
|
|
7146
7175
|
{
|
|
@@ -7295,12 +7324,12 @@ var BidRoleSelectPanel = ({ editor, block, collectionId, openEA, openSA, userRol
|
|
|
7295
7324
|
};
|
|
7296
7325
|
|
|
7297
7326
|
// src/mantine/blocks/components/bid/components/BidSurveyPanel.tsx
|
|
7298
|
-
import React72, { useMemo as
|
|
7327
|
+
import React72, { useMemo as useMemo31, useEffect as useEffect29, useRef as useRef9, useCallback as useCallback28 } from "react";
|
|
7299
7328
|
import { Loader as Loader9, Stack as Stack46, Text as Text46 } from "@mantine/core";
|
|
7300
7329
|
import { Survey as Survey4 } from "@ixo/surveys";
|
|
7301
7330
|
|
|
7302
7331
|
// src/mantine/blocks/components/bid/hooks/useBidSurvey.ts
|
|
7303
|
-
import { useState as useState30, useEffect as useEffect28, useMemo as
|
|
7332
|
+
import { useState as useState30, useEffect as useEffect28, useMemo as useMemo30, useCallback as useCallback27 } from "react";
|
|
7304
7333
|
import { SurveyModel as SurveyModel4 } from "@ixo/surveys";
|
|
7305
7334
|
function useBidSurvey(deedId, collectionId, role, onSubmitComplete, execution, executeHookedActions) {
|
|
7306
7335
|
const handlers = useBlocknoteHandlers();
|
|
@@ -7327,7 +7356,7 @@ function useBidSurvey(deedId, collectionId, role, onSubmitComplete, execution, e
|
|
|
7327
7356
|
};
|
|
7328
7357
|
fetchSurveyTemplate();
|
|
7329
7358
|
}, [deedId, role, handlers]);
|
|
7330
|
-
const surveyModel =
|
|
7359
|
+
const surveyModel = useMemo30(() => {
|
|
7331
7360
|
if (!surveyJson) return null;
|
|
7332
7361
|
const model = new SurveyModel4(surveyJson);
|
|
7333
7362
|
model.applyTheme(surveyTheme);
|
|
@@ -7350,7 +7379,8 @@ function useBidSurvey(deedId, collectionId, role, onSubmitComplete, execution, e
|
|
|
7350
7379
|
invocationStore: execution.invocationStore,
|
|
7351
7380
|
flowUri: execution.flowUri || "",
|
|
7352
7381
|
flowId: execution.flowId || "",
|
|
7353
|
-
flowOwnerDid: execution.flowOwnerDid || ""
|
|
7382
|
+
flowOwnerDid: execution.flowOwnerDid || "",
|
|
7383
|
+
schemaVersion: execution.schemaVersion || "0.3"
|
|
7354
7384
|
},
|
|
7355
7385
|
pin: "",
|
|
7356
7386
|
// TODO: collect PIN from user for invocation signing
|
|
@@ -7410,7 +7440,7 @@ var BidSurveyPanel = ({ editor, block, deedId, collectionId, role, onSubmitCompl
|
|
|
7410
7440
|
const stableHandleSurveyComplete = useCallback28((sender) => {
|
|
7411
7441
|
handleSurveyCompleteRef.current(sender);
|
|
7412
7442
|
}, []);
|
|
7413
|
-
const surveyContainerStyle =
|
|
7443
|
+
const surveyContainerStyle = useMemo31(
|
|
7414
7444
|
() => ({
|
|
7415
7445
|
flex: 1,
|
|
7416
7446
|
overflow: "auto",
|
|
@@ -7483,6 +7513,9 @@ var BidCollectionItem = ({ collection, editor, block, deedId, adminAddress, user
|
|
|
7483
7513
|
},
|
|
7484
7514
|
get editor() {
|
|
7485
7515
|
return executionRef.current.editor;
|
|
7516
|
+
},
|
|
7517
|
+
get schemaVersion() {
|
|
7518
|
+
return executionRef.current.schemaVersion;
|
|
7486
7519
|
}
|
|
7487
7520
|
}),
|
|
7488
7521
|
[]
|
|
@@ -7499,7 +7532,7 @@ var BidCollectionItem = ({ collection, editor, block, deedId, adminAddress, user
|
|
|
7499
7532
|
const isBidSubmissionAllowed = userRole !== "SA" /* ServiceProvider */ && userRole !== "EA" /* Evaluator */ && !isController && !userBid && isAuthorized2;
|
|
7500
7533
|
const isLoading = authLoading || userBidLoading;
|
|
7501
7534
|
const serviceAgentPanelId = `bid-survey-${collection.id}-service_agent`;
|
|
7502
|
-
const serviceAgentPanelContent =
|
|
7535
|
+
const serviceAgentPanelContent = useMemo32(
|
|
7503
7536
|
() => /* @__PURE__ */ React73.createElement(
|
|
7504
7537
|
BidSurveyPanel,
|
|
7505
7538
|
{
|
|
@@ -7517,7 +7550,7 @@ var BidCollectionItem = ({ collection, editor, block, deedId, adminAddress, user
|
|
|
7517
7550
|
);
|
|
7518
7551
|
const { open: openServiceAgent, opened: SAOpened } = usePanel(serviceAgentPanelId, serviceAgentPanelContent);
|
|
7519
7552
|
const evaluationAgentPanelId = `bid-survey-${collection.id}-evaluation_agent`;
|
|
7520
|
-
const evaluationAgentPanelContent =
|
|
7553
|
+
const evaluationAgentPanelContent = useMemo32(
|
|
7521
7554
|
() => /* @__PURE__ */ React73.createElement(
|
|
7522
7555
|
BidSurveyPanel,
|
|
7523
7556
|
{
|
|
@@ -7535,7 +7568,7 @@ var BidCollectionItem = ({ collection, editor, block, deedId, adminAddress, user
|
|
|
7535
7568
|
);
|
|
7536
7569
|
const { open: openEvaluationAgent, opened: EAOpened } = usePanel(evaluationAgentPanelId, evaluationAgentPanelContent);
|
|
7537
7570
|
const roleSelectionPanelId = `role-survey-${collection.id}`;
|
|
7538
|
-
const bidRoleSelectionPanel =
|
|
7571
|
+
const bidRoleSelectionPanel = useMemo32(
|
|
7539
7572
|
() => /* @__PURE__ */ React73.createElement(
|
|
7540
7573
|
BidRoleSelectPanel,
|
|
7541
7574
|
{
|
|
@@ -7555,7 +7588,7 @@ var BidCollectionItem = ({ collection, editor, block, deedId, adminAddress, user
|
|
|
7555
7588
|
);
|
|
7556
7589
|
const { open: openRoleSelectionPanel, opened: bidPanelOpened } = usePanel(roleSelectionPanelId, bidRoleSelectionPanel);
|
|
7557
7590
|
const bidsListPanelId = `bids-list-${collection.id}`;
|
|
7558
|
-
const bidsListPanelContent =
|
|
7591
|
+
const bidsListPanelContent = useMemo32(
|
|
7559
7592
|
() => /* @__PURE__ */ React73.createElement(
|
|
7560
7593
|
BidsList,
|
|
7561
7594
|
{
|
|
@@ -7588,11 +7621,11 @@ var BidCollectionItem = ({ collection, editor, block, deedId, adminAddress, user
|
|
|
7588
7621
|
};
|
|
7589
7622
|
|
|
7590
7623
|
// src/mantine/blocks/evaluator/flow/EvaluationCollectionItem.tsx
|
|
7591
|
-
import React76, { useMemo as
|
|
7624
|
+
import React76, { useMemo as useMemo35, useEffect as useEffect31, useRef as useRef10 } from "react";
|
|
7592
7625
|
import { Group as Group22, Stack as Stack50, Text as Text50 } from "@mantine/core";
|
|
7593
7626
|
|
|
7594
7627
|
// src/mantine/blocks/evaluator/flow/ClaimsList.tsx
|
|
7595
|
-
import React75, { useState as useState31, useEffect as useEffect30, useCallback as useCallback29, useMemo as
|
|
7628
|
+
import React75, { useState as useState31, useEffect as useEffect30, useCallback as useCallback29, useMemo as useMemo34 } from "react";
|
|
7596
7629
|
import { Paper as Paper7, CloseButton, Title as Title5, Loader as Loader11, Stack as Stack49, Text as Text49, ActionIcon as ActionIcon9, Alert as Alert11, Badge as Badge8, Group as Group21, Button as Button9, Divider as Divider7, Tabs, ScrollArea, Box as Box23, Select as Select3 } from "@mantine/core";
|
|
7597
7630
|
|
|
7598
7631
|
// src/mantine/utils/claimStatus.ts
|
|
@@ -7839,7 +7872,7 @@ var surveyTheme2 = {
|
|
|
7839
7872
|
};
|
|
7840
7873
|
|
|
7841
7874
|
// src/mantine/blocks/evaluator/flow/RubricEvaluationResults.tsx
|
|
7842
|
-
import React74, { useMemo as
|
|
7875
|
+
import React74, { useMemo as useMemo33 } from "react";
|
|
7843
7876
|
import { Paper as Paper6, Stack as Stack48, Text as Text48, Badge as Badge7, Group as Group20, Progress as Progress2, Accordion as Accordion2, ThemeIcon as ThemeIcon2, Timeline, Box as Box22, Tooltip as Tooltip4, Divider as Divider6, Card as Card4, RingProgress, Center as Center5 } from "@mantine/core";
|
|
7844
7877
|
import { IconCheck as IconCheck3, IconX as IconX6, IconAlertTriangle, IconClock as IconClock3, IconBrain as IconBrain2, IconUser as IconUser5, IconArrowUp, IconCalculator, IconCloud, IconChecklist as IconChecklist2, IconInfoCircle } from "@tabler/icons-react";
|
|
7845
7878
|
var getOutcomeConfig = (outcome) => {
|
|
@@ -7906,7 +7939,7 @@ var formatTimestamp = (timestamp) => {
|
|
|
7906
7939
|
};
|
|
7907
7940
|
var RubricEvaluationResults = ({ evaluation }) => {
|
|
7908
7941
|
const { trace, error } = evaluation;
|
|
7909
|
-
const stats =
|
|
7942
|
+
const stats = useMemo33(() => {
|
|
7910
7943
|
if (!trace?.result?.steps) return null;
|
|
7911
7944
|
const steps = trace.result.steps;
|
|
7912
7945
|
const passed = steps.filter((s) => s.success).length;
|
|
@@ -8240,7 +8273,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
8240
8273
|
setPaymentAmount("");
|
|
8241
8274
|
fetchClaims();
|
|
8242
8275
|
}, [fetchClaims]);
|
|
8243
|
-
const surveyModel =
|
|
8276
|
+
const surveyModel = useMemo34(() => {
|
|
8244
8277
|
if (!surveyJson || !claimData) return null;
|
|
8245
8278
|
const model = new SurveyModel5(surveyJson);
|
|
8246
8279
|
model.applyTheme(surveyTheme2);
|
|
@@ -8252,7 +8285,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
8252
8285
|
}
|
|
8253
8286
|
return model;
|
|
8254
8287
|
}, [surveyJson, claimData]);
|
|
8255
|
-
const surveyContainerStyle =
|
|
8288
|
+
const surveyContainerStyle = useMemo34(
|
|
8256
8289
|
() => ({
|
|
8257
8290
|
flex: 1,
|
|
8258
8291
|
overflow: "auto",
|
|
@@ -8450,7 +8483,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
8450
8483
|
setEvaluating(false);
|
|
8451
8484
|
}
|
|
8452
8485
|
}, [selectedClaim, handlers, deedId, collectionId, adminAddress, evaluationResult, handleBackToList, onEvaluationComplete, editor, buildPaymentCoin]);
|
|
8453
|
-
const isClaimAlreadyEvaluated =
|
|
8486
|
+
const isClaimAlreadyEvaluated = useMemo34(() => {
|
|
8454
8487
|
if (!selectedClaim) return false;
|
|
8455
8488
|
return isClaimEvaluated(selectedClaim);
|
|
8456
8489
|
}, [selectedClaim]);
|
|
@@ -8609,7 +8642,7 @@ var EvaluationCollectionItem = ({ collection, block, deedId, adminAddress, edito
|
|
|
8609
8642
|
const canEvaluateClaims = isEvaluator;
|
|
8610
8643
|
const claimsPanelId = `evaluator-claims-list-${collection.id}`;
|
|
8611
8644
|
const collectionName = getCollectionName2(collection);
|
|
8612
|
-
const claimsPanelContent =
|
|
8645
|
+
const claimsPanelContent = useMemo35(
|
|
8613
8646
|
() => /* @__PURE__ */ React76.createElement(
|
|
8614
8647
|
ClaimsList,
|
|
8615
8648
|
{
|
|
@@ -8725,7 +8758,7 @@ var ClaimCollectionsList = ({
|
|
|
8725
8758
|
// src/mantine/blocks/evaluator/flow/FlowView.tsx
|
|
8726
8759
|
var EvaluatorFlowView = ({ editor, block }) => {
|
|
8727
8760
|
const userAddress = useCurrentUser();
|
|
8728
|
-
const selectedCollectionIds =
|
|
8761
|
+
const selectedCollectionIds = useMemo36(() => {
|
|
8729
8762
|
try {
|
|
8730
8763
|
const parsed = JSON.parse(block.props.selectedCollections || "[]");
|
|
8731
8764
|
return Array.isArray(parsed) ? parsed : [];
|
|
@@ -9117,7 +9150,7 @@ var ClaimsEvaluation = ({ collectionId, adminAddress, deedId, claim, onRefresh }
|
|
|
9117
9150
|
setEvaluating(false);
|
|
9118
9151
|
}
|
|
9119
9152
|
}, [claim, handlers, deedId, collectionId, adminAddress, evaluationResult, onRefresh, editor, buildPaymentCoin]);
|
|
9120
|
-
const isClaimAlreadyEvaluated =
|
|
9153
|
+
const isClaimAlreadyEvaluated = useMemo37(() => {
|
|
9121
9154
|
if (!claim) return false;
|
|
9122
9155
|
const claimStatus = getClaimStatus(claim);
|
|
9123
9156
|
return claimStatus.status === "Approved" || claimStatus.status === "Rejected";
|
|
@@ -9142,12 +9175,12 @@ var ListSelectionPanel = ({ selectedIds, listConfig, listData, listType, userRol
|
|
|
9142
9175
|
const [loading, setLoading] = useState34(false);
|
|
9143
9176
|
const [error, setError] = useState34(null);
|
|
9144
9177
|
const isEvaluator = userRole === "EA" /* Evaluator */;
|
|
9145
|
-
const selectedItemId =
|
|
9178
|
+
const selectedItemId = useMemo38(() => {
|
|
9146
9179
|
if (selectedIds.size === 0) return null;
|
|
9147
9180
|
const idsArray = Array.from(selectedIds);
|
|
9148
9181
|
return idsArray[idsArray.length - 1];
|
|
9149
9182
|
}, [selectedIds]);
|
|
9150
|
-
const panelConfig =
|
|
9183
|
+
const panelConfig = useMemo38(() => {
|
|
9151
9184
|
if (!listType) return null;
|
|
9152
9185
|
return getSelectionPanelConfig(listType);
|
|
9153
9186
|
}, [listType]);
|
|
@@ -9179,7 +9212,7 @@ var ListSelectionPanel = ({ selectedIds, listConfig, listData, listType, userRol
|
|
|
9179
9212
|
};
|
|
9180
9213
|
fetchItemDetails();
|
|
9181
9214
|
}, [selectedItemId, listType, handlers, panelConfig, listData?.items]);
|
|
9182
|
-
const tabs =
|
|
9215
|
+
const tabs = useMemo38(() => {
|
|
9183
9216
|
switch (listType) {
|
|
9184
9217
|
case "claims":
|
|
9185
9218
|
return [
|
|
@@ -9302,12 +9335,12 @@ var DaosList = ({ items, isMultiSelect, isItemChecked, onItemCheck }) => {
|
|
|
9302
9335
|
};
|
|
9303
9336
|
|
|
9304
9337
|
// src/mantine/blocks/list/claims/ClaimsList.tsx
|
|
9305
|
-
import React86, { useState as useState35, useEffect as useEffect34, useMemo as
|
|
9338
|
+
import React86, { useState as useState35, useEffect as useEffect34, useMemo as useMemo39 } from "react";
|
|
9306
9339
|
import { Text as Text58, Stack as Stack58, Flex as Flex25, Box as Box27, Group as Group24 } from "@mantine/core";
|
|
9307
9340
|
var ClaimsList2 = ({ items, isMultiSelect, isItemChecked, onItemCheck }) => {
|
|
9308
9341
|
const handlers = useBlocknoteHandlers();
|
|
9309
9342
|
const [profiles, setProfiles] = useState35({});
|
|
9310
|
-
const uniqueAgentDids =
|
|
9343
|
+
const uniqueAgentDids = useMemo39(() => {
|
|
9311
9344
|
const dids = /* @__PURE__ */ new Set();
|
|
9312
9345
|
items.forEach((item) => {
|
|
9313
9346
|
if (item.agentDid) {
|
|
@@ -9644,12 +9677,12 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
9644
9677
|
const [runtimeSearchValue, setRuntimeSearchValue] = useState37(null);
|
|
9645
9678
|
const [isSearchOpen, setIsSearchOpen] = useState37(false);
|
|
9646
9679
|
const panelId = `${LIST_FLOW_PANEL_ID}-${block.id}`;
|
|
9647
|
-
const panelContent =
|
|
9680
|
+
const panelContent = useMemo40(() => /* @__PURE__ */ React88.createElement(TemplateConfig2, { editor, block }), [editor, block]);
|
|
9648
9681
|
const { open: openPanel } = usePanel(panelId, panelContent);
|
|
9649
9682
|
const handlers = useBlocknoteHandlers();
|
|
9650
9683
|
const listType = block.props.listType && block.props.listType !== "" ? block.props.listType : null;
|
|
9651
9684
|
const { subscribe } = useListBlocksUI();
|
|
9652
|
-
const listConfig =
|
|
9685
|
+
const listConfig = useMemo40(() => {
|
|
9653
9686
|
if (block.props.listConfig && block.props.listConfig !== "{}") {
|
|
9654
9687
|
try {
|
|
9655
9688
|
return JSON.parse(block.props.listConfig);
|
|
@@ -9664,7 +9697,7 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
9664
9697
|
}, []);
|
|
9665
9698
|
const fetchDataRef = useRef12(null);
|
|
9666
9699
|
const selectionPanelId = `${LIST_SELECTION_FLOW_PANEL_ID}-${block.id}`;
|
|
9667
|
-
const selectionPanelContent =
|
|
9700
|
+
const selectionPanelContent = useMemo40(
|
|
9668
9701
|
() => /* @__PURE__ */ React88.createElement(
|
|
9669
9702
|
ListSelectionPanel,
|
|
9670
9703
|
{
|
|
@@ -9729,7 +9762,7 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
9729
9762
|
},
|
|
9730
9763
|
[setRuntimeSearchValue, setPage]
|
|
9731
9764
|
);
|
|
9732
|
-
const listSortConfigOptions =
|
|
9765
|
+
const listSortConfigOptions = useMemo40(() => {
|
|
9733
9766
|
if (block.props.sortOptions && block.props.sortOptions !== "{}") {
|
|
9734
9767
|
try {
|
|
9735
9768
|
return JSON.parse(block.props.sortOptions);
|
|
@@ -9739,7 +9772,7 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
9739
9772
|
}
|
|
9740
9773
|
return {};
|
|
9741
9774
|
}, [block.props.sortOptions]);
|
|
9742
|
-
const listFilterConfigOptions =
|
|
9775
|
+
const listFilterConfigOptions = useMemo40(() => {
|
|
9743
9776
|
if (block.props.filterOptions && block.props.filterOptions !== "{}") {
|
|
9744
9777
|
try {
|
|
9745
9778
|
return JSON.parse(block.props.filterOptions);
|
|
@@ -9749,7 +9782,7 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
9749
9782
|
}
|
|
9750
9783
|
return {};
|
|
9751
9784
|
}, [block.props.filterOptions]);
|
|
9752
|
-
const listFilterConfig =
|
|
9785
|
+
const listFilterConfig = useMemo40(() => {
|
|
9753
9786
|
if (block.props.filter && block.props.filter !== "{}") {
|
|
9754
9787
|
try {
|
|
9755
9788
|
return JSON.parse(block.props.filter);
|
|
@@ -9759,7 +9792,7 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
9759
9792
|
}
|
|
9760
9793
|
return {};
|
|
9761
9794
|
}, [block.props.filter]);
|
|
9762
|
-
const listSortConfig =
|
|
9795
|
+
const listSortConfig = useMemo40(() => {
|
|
9763
9796
|
if (block.props.sort && block.props.sort !== "{}") {
|
|
9764
9797
|
try {
|
|
9765
9798
|
return JSON.parse(block.props.sort);
|
|
@@ -10004,11 +10037,11 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
10004
10037
|
}
|
|
10005
10038
|
updateProps({ sort: JSON.stringify(sortOption) });
|
|
10006
10039
|
};
|
|
10007
|
-
const sortedData =
|
|
10040
|
+
const sortedData = useMemo40(() => {
|
|
10008
10041
|
if (!data) return null;
|
|
10009
10042
|
return sortListItems(data, listSortConfig);
|
|
10010
10043
|
}, [data?.items, listSortConfig]);
|
|
10011
|
-
const filteredData =
|
|
10044
|
+
const filteredData = useMemo40(() => {
|
|
10012
10045
|
if (!listFilterConfig?.key) return sortedData;
|
|
10013
10046
|
if (!sortedData) return null;
|
|
10014
10047
|
if (listType === "daos" && daoRoleFilter) return sortedData;
|
|
@@ -10308,7 +10341,7 @@ import { createReactBlockSpec as createReactBlockSpec5 } from "@blocknote/react"
|
|
|
10308
10341
|
import React134 from "react";
|
|
10309
10342
|
|
|
10310
10343
|
// src/mantine/blocks/proposal/template/TemplateView.tsx
|
|
10311
|
-
import React128, { useMemo as
|
|
10344
|
+
import React128, { useMemo as useMemo42 } from "react";
|
|
10312
10345
|
|
|
10313
10346
|
// src/mantine/blocks/proposal/template/TemplateConfig.tsx
|
|
10314
10347
|
import React127, { useCallback as useCallback33 } from "react";
|
|
@@ -10538,7 +10571,7 @@ var ActionsCard = ({ actions, isSelected, onClick, onEditAction, onRemoveAction,
|
|
|
10538
10571
|
};
|
|
10539
10572
|
|
|
10540
10573
|
// src/mantine/blocks/proposal/ActionsPanel.tsx
|
|
10541
|
-
import React124, { useState as useState46, useEffect as useEffect39, useMemo as
|
|
10574
|
+
import React124, { useState as useState46, useEffect as useEffect39, useMemo as useMemo41 } from "react";
|
|
10542
10575
|
import { Stack as Stack93, Button as Button17, Group as Group37, Text as Text71, Card as Card11, Badge as Badge13, Divider as Divider10, ScrollArea as ScrollArea4, Alert as Alert18, Tabs as Tabs2, SimpleGrid, Paper as Paper8 } from "@mantine/core";
|
|
10543
10576
|
|
|
10544
10577
|
// src/mantine/blocks/proposal/actions-components/SpendActionForm.tsx
|
|
@@ -12430,7 +12463,7 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
12430
12463
|
return config?.getDefaultData() || {};
|
|
12431
12464
|
});
|
|
12432
12465
|
const currentActionConfig = getActionConfig(selectedActionType);
|
|
12433
|
-
const categorizedActions =
|
|
12466
|
+
const categorizedActions = useMemo41(() => getCategorizedActions(), []);
|
|
12434
12467
|
useEffect39(() => {
|
|
12435
12468
|
if (!isEditing) {
|
|
12436
12469
|
const config = getActionConfig(selectedActionType);
|
|
@@ -12718,13 +12751,13 @@ import { Group as Group38, Stack as Stack96, Text as Text72 } from "@mantine/cor
|
|
|
12718
12751
|
var PROPOSAL_TEMPLATE_PANEL_ID = "proposal-template-panel";
|
|
12719
12752
|
var ProposalTemplateView = ({ editor, block }) => {
|
|
12720
12753
|
const panelId = `${PROPOSAL_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
12721
|
-
const panelContent =
|
|
12754
|
+
const panelContent = useMemo42(() => /* @__PURE__ */ React128.createElement(TemplateConfig4, { editor, block }), [editor, block]);
|
|
12722
12755
|
const { open } = usePanel(panelId, panelContent);
|
|
12723
12756
|
return /* @__PURE__ */ React128.createElement(BaseContainer, { blockId: block.id, onClick: open }, /* @__PURE__ */ React128.createElement(Group38, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React128.createElement(Group38, { wrap: "nowrap", align: "center" }, getIcon("file-text", block.props.icon), /* @__PURE__ */ React128.createElement(Stack96, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React128.createElement(Text72, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Proposal Title"), /* @__PURE__ */ React128.createElement(Text72, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || "Proposal description"))), /* @__PURE__ */ React128.createElement(Text72, { size: "xs", c: "dimmed", contentEditable: false }, block.props.status || "draft")));
|
|
12724
12757
|
};
|
|
12725
12758
|
|
|
12726
12759
|
// src/mantine/blocks/proposal/flow/FlowView.tsx
|
|
12727
|
-
import React133, { useMemo as
|
|
12760
|
+
import React133, { useMemo as useMemo43 } from "react";
|
|
12728
12761
|
|
|
12729
12762
|
// src/mantine/blocks/proposal/components/OnChainProposalCard.tsx
|
|
12730
12763
|
import React129 from "react";
|
|
@@ -13561,7 +13594,7 @@ var ProposalFlowView = ({ block, editor }) => {
|
|
|
13561
13594
|
block,
|
|
13562
13595
|
editor
|
|
13563
13596
|
});
|
|
13564
|
-
const panelContent =
|
|
13597
|
+
const panelContent = useMemo43(() => /* @__PURE__ */ React133.createElement(FlowConfig2, { editor, block }), [editor, block]);
|
|
13565
13598
|
const { open } = usePanel(panelId, panelContent);
|
|
13566
13599
|
const handleVote = () => {
|
|
13567
13600
|
open();
|
|
@@ -13663,7 +13696,7 @@ var ProposalBlockSpec = createReactBlockSpec5(
|
|
|
13663
13696
|
);
|
|
13664
13697
|
|
|
13665
13698
|
// src/mantine/blocks/enumChecklist/EnumChecklistBlock.tsx
|
|
13666
|
-
import React142, { useState as useState54, useEffect as useEffect45, useMemo as
|
|
13699
|
+
import React142, { useState as useState54, useEffect as useEffect45, useMemo as useMemo44, useCallback as useCallback36 } from "react";
|
|
13667
13700
|
import { createReactBlockSpec as createReactBlockSpec6 } from "@blocknote/react";
|
|
13668
13701
|
import { Stack as Stack106, Text as Text82, Button as Button26, ActionIcon as ActionIcon14, Center as Center10, Flex as Flex29 } from "@mantine/core";
|
|
13669
13702
|
|
|
@@ -14035,7 +14068,7 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
|
14035
14068
|
const [modalOpened, setModalOpened] = useState54(false);
|
|
14036
14069
|
const { editable } = useBlocknoteContext();
|
|
14037
14070
|
const listType = block.props.listType && block.props.listType !== "" ? block.props.listType : null;
|
|
14038
|
-
const listConfig =
|
|
14071
|
+
const listConfig = useMemo44(() => {
|
|
14039
14072
|
if (block.props.listConfig && block.props.listConfig !== "{}") {
|
|
14040
14073
|
try {
|
|
14041
14074
|
return JSON.parse(block.props.listConfig);
|
|
@@ -14045,7 +14078,7 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
|
14045
14078
|
}
|
|
14046
14079
|
return {};
|
|
14047
14080
|
}, [block.props.listConfig]);
|
|
14048
|
-
const selectedIds =
|
|
14081
|
+
const selectedIds = useMemo44(() => {
|
|
14049
14082
|
if (block.props.selectedIds && block.props.selectedIds !== "[]") {
|
|
14050
14083
|
try {
|
|
14051
14084
|
return new Set(JSON.parse(block.props.selectedIds));
|
|
@@ -14171,10 +14204,10 @@ import { createReactBlockSpec as createReactBlockSpec7 } from "@blocknote/react"
|
|
|
14171
14204
|
import React151 from "react";
|
|
14172
14205
|
|
|
14173
14206
|
// src/mantine/blocks/apiRequest/template/TemplateView.tsx
|
|
14174
|
-
import React149, { useMemo as
|
|
14207
|
+
import React149, { useMemo as useMemo49 } from "react";
|
|
14175
14208
|
|
|
14176
14209
|
// src/mantine/blocks/apiRequest/template/TemplateConfig.tsx
|
|
14177
|
-
import React148, { useCallback as useCallback39, useMemo as
|
|
14210
|
+
import React148, { useCallback as useCallback39, useMemo as useMemo48 } from "react";
|
|
14178
14211
|
import { IconSettings as IconSettings7, IconCode as IconCode2, IconShieldCheck as IconShieldCheck7, IconUser as IconUser7, IconChecklist as IconChecklist5, IconClock as IconClock6 } from "@tabler/icons-react";
|
|
14179
14212
|
|
|
14180
14213
|
// src/mantine/blocks/apiRequest/template/GeneralTab.tsx
|
|
@@ -14183,12 +14216,12 @@ import { Divider as Divider11, Stack as Stack108, Text as Text84, Button as Butt
|
|
|
14183
14216
|
import { IconTrash as IconTrash2, IconPlus as IconPlus3 } from "@tabler/icons-react";
|
|
14184
14217
|
|
|
14185
14218
|
// src/mantine/components/DataInput/DataInput.tsx
|
|
14186
|
-
import React144, { useState as useState56, useCallback as useCallback37, useMemo as
|
|
14219
|
+
import React144, { useState as useState56, useCallback as useCallback37, useMemo as useMemo46 } from "react";
|
|
14187
14220
|
import { Input, ActionIcon as ActionIcon16, Tooltip as Tooltip8, Group as Group46 } from "@mantine/core";
|
|
14188
14221
|
import { IconVariable, IconX as IconX9 } from "@tabler/icons-react";
|
|
14189
14222
|
|
|
14190
14223
|
// src/mantine/components/DataInput/BlockPropSelector.tsx
|
|
14191
|
-
import React143, { useState as useState55, useMemo as
|
|
14224
|
+
import React143, { useState as useState55, useMemo as useMemo45 } from "react";
|
|
14192
14225
|
import { Popover as Popover5, Text as Text83, Stack as Stack107, Group as Group45, ActionIcon as ActionIcon15, TextInput as TextInput4, ScrollArea as ScrollArea5, Badge as Badge15, Box as Box34 } from "@mantine/core";
|
|
14193
14226
|
import { IconSearch as IconSearch4, IconX as IconX8, IconChevronRight as IconChevronRight4, IconArrowLeft as IconArrowLeft4, IconBolt as IconBolt4 } from "@tabler/icons-react";
|
|
14194
14227
|
function buildPropertyTree(properties) {
|
|
@@ -14250,7 +14283,7 @@ function BlockPropSelector({ children, opened, onClose, onSelect, editorDocument
|
|
|
14250
14283
|
const [searchQuery, setSearchQuery] = useState55("");
|
|
14251
14284
|
const [selectedBlock, setSelectedBlock] = useState55(null);
|
|
14252
14285
|
const [navigationPath, setNavigationPath] = useState55([]);
|
|
14253
|
-
const availableBlocks =
|
|
14286
|
+
const availableBlocks = useMemo45(() => {
|
|
14254
14287
|
if (!editorDocument) return [];
|
|
14255
14288
|
return editorDocument.filter((block) => {
|
|
14256
14289
|
if (currentBlockId && block.id === currentBlockId) return false;
|
|
@@ -14262,7 +14295,7 @@ function BlockPropSelector({ children, opened, onClose, onSelect, editorDocument
|
|
|
14262
14295
|
propertyTree: buildPropertyTree(getConditionableProperties(block.type, block))
|
|
14263
14296
|
}));
|
|
14264
14297
|
}, [editorDocument, currentBlockId]);
|
|
14265
|
-
const filteredBlocks =
|
|
14298
|
+
const filteredBlocks = useMemo45(() => {
|
|
14266
14299
|
if (!searchQuery.trim()) return availableBlocks;
|
|
14267
14300
|
const query = searchQuery.toLowerCase();
|
|
14268
14301
|
return availableBlocks.filter((block) => {
|
|
@@ -14271,7 +14304,7 @@ function BlockPropSelector({ children, opened, onClose, onSelect, editorDocument
|
|
|
14271
14304
|
return block.properties.some((prop) => prop.name.toLowerCase().includes(query) || prop.displayName.toLowerCase().includes(query));
|
|
14272
14305
|
});
|
|
14273
14306
|
}, [availableBlocks, searchQuery]);
|
|
14274
|
-
const currentNodes =
|
|
14307
|
+
const currentNodes = useMemo45(() => {
|
|
14275
14308
|
if (!selectedBlock) return [];
|
|
14276
14309
|
if (navigationPath.length === 0) return selectedBlock.propertyTree;
|
|
14277
14310
|
return navigationPath[navigationPath.length - 1].children;
|
|
@@ -14507,8 +14540,8 @@ function DataInput({
|
|
|
14507
14540
|
size = "sm"
|
|
14508
14541
|
}) {
|
|
14509
14542
|
const [selectorOpened, setSelectorOpened] = useState56(false);
|
|
14510
|
-
const containsReferences =
|
|
14511
|
-
const references =
|
|
14543
|
+
const containsReferences = useMemo46(() => hasReferences(value), [value]);
|
|
14544
|
+
const references = useMemo46(() => parseReferences(value || ""), [value]);
|
|
14512
14545
|
const handleOpenSelector = useCallback37(() => setSelectorOpened(true), []);
|
|
14513
14546
|
const handleCloseSelector = useCallback37(() => setSelectorOpened(false), []);
|
|
14514
14547
|
const handleSelectProperty = useCallback37(
|
|
@@ -14825,11 +14858,11 @@ var ResponseSchemaTab = ({ schema, onSchemaChange, blockId }) => {
|
|
|
14825
14858
|
};
|
|
14826
14859
|
|
|
14827
14860
|
// src/mantine/components/EvaluationTab.tsx
|
|
14828
|
-
import React147, { useMemo as
|
|
14861
|
+
import React147, { useMemo as useMemo47, useState as useState58, useEffect as useEffect47, useCallback as useCallback38 } from "react";
|
|
14829
14862
|
import { Stack as Stack110, TextInput as TextInput5, Text as Text86 } from "@mantine/core";
|
|
14830
14863
|
var EvaluationTab = ({ editor, block: initialBlock }) => {
|
|
14831
14864
|
const [, forceUpdate] = useState58({});
|
|
14832
|
-
const block =
|
|
14865
|
+
const block = useMemo47(() => {
|
|
14833
14866
|
const doc = editor?.document || [];
|
|
14834
14867
|
return doc.find((b) => b.id === initialBlock.id) || initialBlock;
|
|
14835
14868
|
}, [editor?.document, initialBlock]);
|
|
@@ -14899,10 +14932,10 @@ var TemplateConfig5 = ({ editor, block }) => {
|
|
|
14899
14932
|
},
|
|
14900
14933
|
[updateProp]
|
|
14901
14934
|
);
|
|
14902
|
-
const parsedResponseSchema =
|
|
14935
|
+
const parsedResponseSchema = useMemo48(() => {
|
|
14903
14936
|
return parseResponseSchema(block.props.responseSchema);
|
|
14904
14937
|
}, [block.props.responseSchema]);
|
|
14905
|
-
const tabs =
|
|
14938
|
+
const tabs = useMemo48(
|
|
14906
14939
|
() => [
|
|
14907
14940
|
{
|
|
14908
14941
|
label: "General",
|
|
@@ -15005,8 +15038,8 @@ var ApiRequestTemplateView = ({ editor, block }) => {
|
|
|
15005
15038
|
const panelId = `${API_REQUEST_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
15006
15039
|
const assignmentPanelId = `${API_REQUEST_ASSIGNMENT_PANEL_ID}-${block.id}`;
|
|
15007
15040
|
const { closePanel } = usePanelStore();
|
|
15008
|
-
const panelContent =
|
|
15009
|
-
const assignmentPanelContent =
|
|
15041
|
+
const panelContent = useMemo49(() => /* @__PURE__ */ React149.createElement(TemplateConfig5, { editor, block }), [editor, block]);
|
|
15042
|
+
const assignmentPanelContent = useMemo49(
|
|
15010
15043
|
() => /* @__PURE__ */ React149.createElement(
|
|
15011
15044
|
BaseRightPanelLayout,
|
|
15012
15045
|
{
|
|
@@ -15020,7 +15053,7 @@ var ApiRequestTemplateView = ({ editor, block }) => {
|
|
|
15020
15053
|
const { open } = usePanel(panelId, panelContent);
|
|
15021
15054
|
const { open: openAssignment } = usePanel(assignmentPanelId, assignmentPanelContent);
|
|
15022
15055
|
const commitmentPanelId = `${API_REQUEST_COMMITMENT_PANEL_ID}-${block.id}`;
|
|
15023
|
-
const commitmentPanelContent =
|
|
15056
|
+
const commitmentPanelContent = useMemo49(
|
|
15024
15057
|
() => /* @__PURE__ */ React149.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Commitment Tab" }, /* @__PURE__ */ React149.createElement(CommitmentTab, { editor, block })),
|
|
15025
15058
|
[editor, block, closePanel]
|
|
15026
15059
|
);
|
|
@@ -15047,7 +15080,7 @@ var ApiRequestTemplateView = ({ editor, block }) => {
|
|
|
15047
15080
|
};
|
|
15048
15081
|
|
|
15049
15082
|
// src/mantine/blocks/apiRequest/flow/FlowView.tsx
|
|
15050
|
-
import React150, { useMemo as
|
|
15083
|
+
import React150, { useMemo as useMemo50, useState as useState59 } from "react";
|
|
15051
15084
|
import { Group as Group50, Stack as Stack112, Text as Text88, Button as Button29, Badge as Badge17, Code as Code2, Loader as Loader20, Alert as Alert21, Divider as Divider12 } from "@mantine/core";
|
|
15052
15085
|
import { IconSend as IconSend2, IconAlertTriangle as IconAlertTriangle2, IconUser as IconUser9, IconApi } from "@tabler/icons-react";
|
|
15053
15086
|
var getMethodColor2 = (method) => {
|
|
@@ -15099,7 +15132,7 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
|
15099
15132
|
const endpoint = block.props.endpoint || "";
|
|
15100
15133
|
const runtimeState = runtime.state;
|
|
15101
15134
|
const status = runtimeState === "running" ? "loading" : runtimeState === "completed" ? "success" : runtimeState === "failed" ? "error" : "idle";
|
|
15102
|
-
const tabs =
|
|
15135
|
+
const tabs = useMemo50(
|
|
15103
15136
|
() => [
|
|
15104
15137
|
{
|
|
15105
15138
|
label: "Execute",
|
|
@@ -15116,13 +15149,13 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
|
15116
15149
|
],
|
|
15117
15150
|
[editor, block, disabled, isDisabled?.message]
|
|
15118
15151
|
);
|
|
15119
|
-
const panelContent =
|
|
15152
|
+
const panelContent = useMemo50(
|
|
15120
15153
|
() => /* @__PURE__ */ React150.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "API Request Settings", tabs, context: { editor, block } }),
|
|
15121
15154
|
[tabs, editor, block, closePanel]
|
|
15122
15155
|
);
|
|
15123
15156
|
const { open } = usePanel(panelId, panelContent);
|
|
15124
15157
|
const commitmentPanelId = `api-request-flow-commitment-${block.id}`;
|
|
15125
|
-
const commitmentPanelContent =
|
|
15158
|
+
const commitmentPanelContent = useMemo50(
|
|
15126
15159
|
() => /* @__PURE__ */ React150.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Commitment Tab" }, /* @__PURE__ */ React150.createElement(CommitmentTab, { editor, block })),
|
|
15127
15160
|
[editor, block, closePanel]
|
|
15128
15161
|
);
|
|
@@ -15360,7 +15393,7 @@ import { createReactBlockSpec as createReactBlockSpec8 } from "@blocknote/react"
|
|
|
15360
15393
|
import React157 from "react";
|
|
15361
15394
|
|
|
15362
15395
|
// src/mantine/blocks/notify/template/TemplateView.tsx
|
|
15363
|
-
import React155, { useMemo as
|
|
15396
|
+
import React155, { useMemo as useMemo51 } from "react";
|
|
15364
15397
|
|
|
15365
15398
|
// src/mantine/blocks/notify/template/TemplateConfig.tsx
|
|
15366
15399
|
import React154, { useCallback as useCallback40 } from "react";
|
|
@@ -15666,7 +15699,7 @@ import { Group as Group52, Stack as Stack114, Text as Text90, Badge as Badge18 }
|
|
|
15666
15699
|
var NOTIFY_TEMPLATE_PANEL_ID = "notify-template-panel";
|
|
15667
15700
|
var NotifyTemplateView = ({ editor, block }) => {
|
|
15668
15701
|
const panelId = `${NOTIFY_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
15669
|
-
const panelContent =
|
|
15702
|
+
const panelContent = useMemo51(() => /* @__PURE__ */ React155.createElement(TemplateConfig6, { editor, block }), [editor, block]);
|
|
15670
15703
|
const { open } = usePanel(panelId, panelContent);
|
|
15671
15704
|
const channel = block.props.channel || "email";
|
|
15672
15705
|
const to = (() => {
|
|
@@ -15917,7 +15950,7 @@ import { createReactBlockSpec as createReactBlockSpec9 } from "@blocknote/react"
|
|
|
15917
15950
|
import React163 from "react";
|
|
15918
15951
|
|
|
15919
15952
|
// src/mantine/blocks/claim/template/TemplateView.tsx
|
|
15920
|
-
import React161, { useMemo as
|
|
15953
|
+
import React161, { useMemo as useMemo53 } from "react";
|
|
15921
15954
|
import { Group as Group54, Stack as Stack116, Text as Text92 } from "@mantine/core";
|
|
15922
15955
|
|
|
15923
15956
|
// src/mantine/blocks/claim/template/TemplateConfig.tsx
|
|
@@ -15925,7 +15958,7 @@ import React160, { useCallback as useCallback42 } from "react";
|
|
|
15925
15958
|
import { IconSettings as IconSettings9, IconShieldCheck as IconShieldCheck8, IconUser as IconUser10, IconContract as IconContract2, IconChecklist as IconChecklist6, IconClock as IconClock7 } from "@tabler/icons-react";
|
|
15926
15959
|
|
|
15927
15960
|
// src/mantine/blocks/claim/template/GeneralTab.tsx
|
|
15928
|
-
import React159, { useEffect as useEffect49, useState as useState62, useCallback as useCallback41, useMemo as
|
|
15961
|
+
import React159, { useEffect as useEffect49, useState as useState62, useCallback as useCallback41, useMemo as useMemo52 } from "react";
|
|
15929
15962
|
var GeneralTab7 = ({
|
|
15930
15963
|
title,
|
|
15931
15964
|
description,
|
|
@@ -15946,7 +15979,7 @@ var GeneralTab7 = ({
|
|
|
15946
15979
|
useEffect49(() => {
|
|
15947
15980
|
setLocalDescription(description || "");
|
|
15948
15981
|
}, [description]);
|
|
15949
|
-
const parsedSelectedCollections =
|
|
15982
|
+
const parsedSelectedCollections = useMemo52(() => {
|
|
15950
15983
|
try {
|
|
15951
15984
|
return JSON.parse(selectedCollections || "[]");
|
|
15952
15985
|
} catch {
|
|
@@ -16079,28 +16112,29 @@ var TemplateConfig7 = ({ editor, block }) => {
|
|
|
16079
16112
|
var CLAIM_TEMPLATE_PANEL_ID = "claim-template-panel";
|
|
16080
16113
|
var ClaimTemplateView = ({ editor, block }) => {
|
|
16081
16114
|
const panelId = `${CLAIM_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
16082
|
-
const panelContent =
|
|
16115
|
+
const panelContent = useMemo53(() => /* @__PURE__ */ React161.createElement(TemplateConfig7, { editor, block }), [editor, block]);
|
|
16083
16116
|
const { open } = usePanel(panelId, panelContent);
|
|
16084
16117
|
return /* @__PURE__ */ React161.createElement(BaseContainer, { blockId: block.id, onClick: open }, /* @__PURE__ */ React161.createElement(Group54, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React161.createElement(Group54, { wrap: "nowrap", align: "center" }, getIcon("square-check", block.props.icon), /* @__PURE__ */ React161.createElement(Stack116, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React161.createElement(Text92, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Claim Title"), /* @__PURE__ */ React161.createElement(Text92, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || "Claim description"))), /* @__PURE__ */ React161.createElement(Group54, { gap: 4, wrap: "nowrap", style: { flexShrink: 0 } }, /* @__PURE__ */ React161.createElement(CommitmentPanel, { block, editor }), /* @__PURE__ */ React161.createElement(AssignmentPanel, { block, editor }))));
|
|
16085
16118
|
};
|
|
16086
16119
|
|
|
16087
16120
|
// src/mantine/blocks/claim/flow/FlowView.tsx
|
|
16088
|
-
import React162, { useMemo as
|
|
16121
|
+
import React162, { useMemo as useMemo54, useRef as useRef13, useEffect as useEffect50, useCallback as useCallback43 } from "react";
|
|
16089
16122
|
import { Stack as Stack117, Text as Text93, Loader as Loader22, Center as Center11, Alert as Alert23 } from "@mantine/core";
|
|
16090
16123
|
import { IconAlertCircle as IconAlertCircle10 } from "@tabler/icons-react";
|
|
16091
16124
|
var ClaimFlowView = ({ editor, block }) => {
|
|
16092
16125
|
const userAddress = useCurrentUser();
|
|
16093
|
-
const flowNode =
|
|
16094
|
-
const runtime =
|
|
16095
|
-
const ucanService =
|
|
16096
|
-
const invocationStore =
|
|
16097
|
-
const flowId =
|
|
16098
|
-
const flowOwnerDid =
|
|
16099
|
-
const
|
|
16126
|
+
const flowNode = useMemo54(() => buildFlowNodeFromBlock(block), [block]);
|
|
16127
|
+
const runtime = useMemo54(() => createRuntimeStateManager(editor), [editor]);
|
|
16128
|
+
const ucanService = useMemo54(() => editor?.getUcanService?.() || void 0, [editor]);
|
|
16129
|
+
const invocationStore = useMemo54(() => editor?._invocationStore || void 0, [editor]);
|
|
16130
|
+
const flowId = useMemo54(() => editor?.getFlowMetadata?.()?.doc_id || block.id, [editor, block.id]);
|
|
16131
|
+
const flowOwnerDid = useMemo54(() => editor.getFlowOwnerDid?.() || "", [editor]);
|
|
16132
|
+
const schemaVersion = useMemo54(() => editor?.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
16133
|
+
const flowUri = useMemo54(() => {
|
|
16100
16134
|
const docId = editor.getFlowMetadata?.()?.doc_id || block.id;
|
|
16101
16135
|
return `ixo:flow:${docId}`;
|
|
16102
16136
|
}, [editor, block.id]);
|
|
16103
|
-
const executionValue =
|
|
16137
|
+
const executionValue = useMemo54(
|
|
16104
16138
|
() => ({
|
|
16105
16139
|
flowNode,
|
|
16106
16140
|
runtime,
|
|
@@ -16109,15 +16143,16 @@ var ClaimFlowView = ({ editor, block }) => {
|
|
|
16109
16143
|
actorDid: userAddress || "",
|
|
16110
16144
|
flowOwnerDid,
|
|
16111
16145
|
flowUri,
|
|
16112
|
-
flowId
|
|
16146
|
+
flowId,
|
|
16147
|
+
schemaVersion
|
|
16113
16148
|
}),
|
|
16114
|
-
[flowNode, runtime, ucanService, invocationStore, userAddress, flowOwnerDid, flowUri, flowId]
|
|
16149
|
+
[flowNode, runtime, ucanService, invocationStore, userAddress, flowOwnerDid, flowUri, flowId, schemaVersion]
|
|
16115
16150
|
);
|
|
16116
16151
|
const executionRef = useRef13(executionValue);
|
|
16117
16152
|
useEffect50(() => {
|
|
16118
16153
|
executionRef.current = executionValue;
|
|
16119
16154
|
}, [executionValue]);
|
|
16120
|
-
const execution =
|
|
16155
|
+
const execution = useMemo54(
|
|
16121
16156
|
() => ({
|
|
16122
16157
|
get flowNode() {
|
|
16123
16158
|
return executionRef.current.flowNode;
|
|
@@ -16142,11 +16177,14 @@ var ClaimFlowView = ({ editor, block }) => {
|
|
|
16142
16177
|
},
|
|
16143
16178
|
get flowId() {
|
|
16144
16179
|
return executionRef.current.flowId;
|
|
16180
|
+
},
|
|
16181
|
+
get schemaVersion() {
|
|
16182
|
+
return executionRef.current.schemaVersion;
|
|
16145
16183
|
}
|
|
16146
16184
|
}),
|
|
16147
16185
|
[]
|
|
16148
16186
|
);
|
|
16149
|
-
const selectedCollectionIds =
|
|
16187
|
+
const selectedCollectionIds = useMemo54(() => {
|
|
16150
16188
|
try {
|
|
16151
16189
|
const parsed = JSON.parse(block.props.selectedCollections || "[]");
|
|
16152
16190
|
return Array.isArray(parsed) ? parsed : [];
|
|
@@ -16249,7 +16287,7 @@ import React166 from "react";
|
|
|
16249
16287
|
import { createReactBlockSpec as createReactBlockSpec10 } from "@blocknote/react";
|
|
16250
16288
|
|
|
16251
16289
|
// src/mantine/blocks/visualization/VisualizationBlock.tsx
|
|
16252
|
-
import React165, { useMemo as
|
|
16290
|
+
import React165, { useMemo as useMemo55, useCallback as useCallback44, useRef as useRef14, useState as useState63, useEffect as useEffect51 } from "react";
|
|
16253
16291
|
import { Box as Box35, Stack as Stack118, Text as Text94, Paper as Paper12, Group as Group55 } from "@mantine/core";
|
|
16254
16292
|
function VisualizationBlock({ block, editor }) {
|
|
16255
16293
|
const { visualizationRenderer } = useBlocknoteContext();
|
|
@@ -16270,7 +16308,7 @@ function VisualizationBlock({ block, editor }) {
|
|
|
16270
16308
|
resizeObserver.disconnect();
|
|
16271
16309
|
};
|
|
16272
16310
|
}, []);
|
|
16273
|
-
const parsedConfig =
|
|
16311
|
+
const parsedConfig = useMemo55(() => {
|
|
16274
16312
|
try {
|
|
16275
16313
|
return typeof config === "string" ? JSON.parse(config) : config;
|
|
16276
16314
|
} catch (e) {
|
|
@@ -16278,7 +16316,7 @@ function VisualizationBlock({ block, editor }) {
|
|
|
16278
16316
|
return null;
|
|
16279
16317
|
}
|
|
16280
16318
|
}, [config]);
|
|
16281
|
-
const parsedPreferences =
|
|
16319
|
+
const parsedPreferences = useMemo55(() => {
|
|
16282
16320
|
try {
|
|
16283
16321
|
return typeof preferences === "string" ? JSON.parse(preferences) : preferences || {};
|
|
16284
16322
|
} catch (e) {
|
|
@@ -16346,7 +16384,7 @@ import React169 from "react";
|
|
|
16346
16384
|
import { createReactBlockSpec as createReactBlockSpec11 } from "@blocknote/react";
|
|
16347
16385
|
|
|
16348
16386
|
// src/mantine/blocks/dynamicList/DynamicListBlock.tsx
|
|
16349
|
-
import React168, { useMemo as
|
|
16387
|
+
import React168, { useMemo as useMemo57, useState as useState65, useCallback as useCallback45, useEffect as useEffect52, useRef as useRef15 } from "react";
|
|
16350
16388
|
import { Box as Box37, Stack as Stack120, Text as Text96, Paper as Paper14, Group as Group57, Button as Button31, ActionIcon as ActionIcon21, Tooltip as Tooltip10, Code as Code5, Flex as Flex30, Collapse as Collapse7, Title as Title7, Badge as Badge20, TextInput as TextInput6, CloseButton as CloseButton3, Select as Select4, Menu as Menu2 } from "@mantine/core";
|
|
16351
16389
|
import { useDisclosure as useDisclosure6 } from "@mantine/hooks";
|
|
16352
16390
|
import {
|
|
@@ -16367,7 +16405,7 @@ import {
|
|
|
16367
16405
|
} from "@tabler/icons-react";
|
|
16368
16406
|
|
|
16369
16407
|
// src/mantine/blocks/dynamicList/DynamicListSelectionPanel.tsx
|
|
16370
|
-
import React167, { useMemo as
|
|
16408
|
+
import React167, { useMemo as useMemo56, useState as useState64 } from "react";
|
|
16371
16409
|
import { Paper as Paper13, CloseButton as CloseButton2, Stack as Stack119, Text as Text95, Box as Box36, Group as Group56, Divider as Divider14, Code as Code4, ScrollArea as ScrollArea6, Collapse as Collapse6 } from "@mantine/core";
|
|
16372
16410
|
import { IconSparkles as IconSparkles2, IconChevronDown as IconChevronDown6, IconChevronRight as IconChevronRight5 } from "@tabler/icons-react";
|
|
16373
16411
|
function formatKeyAsLabel(key) {
|
|
@@ -16398,7 +16436,7 @@ function DefaultKeyValueView({
|
|
|
16398
16436
|
// actions,
|
|
16399
16437
|
}) {
|
|
16400
16438
|
const [valuesExpanded, setValuesExpanded] = useState64(false);
|
|
16401
|
-
const columnMap =
|
|
16439
|
+
const columnMap = useMemo56(() => {
|
|
16402
16440
|
const map = {};
|
|
16403
16441
|
columns.forEach((col) => {
|
|
16404
16442
|
map[col.key] = col;
|
|
@@ -16528,14 +16566,14 @@ function DynamicListBlock({ block, editor }) {
|
|
|
16528
16566
|
const [orderByCollapsed, setOrderByCollapsed] = useState65(true);
|
|
16529
16567
|
const [columnsCollapsed, setColumnsCollapsed] = useState65(true);
|
|
16530
16568
|
const [showInfo, setShowInfo] = useState65(false);
|
|
16531
|
-
const parsedColumns =
|
|
16569
|
+
const parsedColumns = useMemo57(() => {
|
|
16532
16570
|
try {
|
|
16533
16571
|
return typeof columns === "string" ? JSON.parse(columns) : columns;
|
|
16534
16572
|
} catch {
|
|
16535
16573
|
return [];
|
|
16536
16574
|
}
|
|
16537
16575
|
}, [columns]);
|
|
16538
|
-
const parsedDataSource =
|
|
16576
|
+
const parsedDataSource = useMemo57(() => {
|
|
16539
16577
|
try {
|
|
16540
16578
|
const parsed = typeof dataSource === "string" ? JSON.parse(dataSource) : dataSource;
|
|
16541
16579
|
return parsed && Object.keys(parsed).length > 0 ? parsed : null;
|
|
@@ -16543,7 +16581,7 @@ function DynamicListBlock({ block, editor }) {
|
|
|
16543
16581
|
return null;
|
|
16544
16582
|
}
|
|
16545
16583
|
}, [dataSource]);
|
|
16546
|
-
const parsedSnapshot =
|
|
16584
|
+
const parsedSnapshot = useMemo57(() => {
|
|
16547
16585
|
try {
|
|
16548
16586
|
if (!snapshot || snapshot === "") return null;
|
|
16549
16587
|
return typeof snapshot === "string" ? JSON.parse(snapshot) : snapshot;
|
|
@@ -16551,7 +16589,7 @@ function DynamicListBlock({ block, editor }) {
|
|
|
16551
16589
|
return null;
|
|
16552
16590
|
}
|
|
16553
16591
|
}, [snapshot]);
|
|
16554
|
-
const liveData =
|
|
16592
|
+
const liveData = useMemo57(() => {
|
|
16555
16593
|
if (getDynamicListData && listId) {
|
|
16556
16594
|
return getDynamicListData(listId);
|
|
16557
16595
|
}
|
|
@@ -16560,7 +16598,7 @@ function DynamicListBlock({ block, editor }) {
|
|
|
16560
16598
|
const hasSnapshot = parsedSnapshot && parsedSnapshot.length > 0;
|
|
16561
16599
|
const useSnapshot = hasSnapshot && !useLiveMode;
|
|
16562
16600
|
const rawData = useSnapshot ? parsedSnapshot : liveData.items;
|
|
16563
|
-
const filteredData =
|
|
16601
|
+
const filteredData = useMemo57(() => {
|
|
16564
16602
|
if (!rawData || !searchQuery.trim()) return rawData;
|
|
16565
16603
|
const query = searchQuery.toLowerCase();
|
|
16566
16604
|
return rawData.filter(
|
|
@@ -16570,7 +16608,7 @@ function DynamicListBlock({ block, editor }) {
|
|
|
16570
16608
|
);
|
|
16571
16609
|
}, [rawData, searchQuery]);
|
|
16572
16610
|
const hasData = filteredData && filteredData.length > 0;
|
|
16573
|
-
const sortOptions =
|
|
16611
|
+
const sortOptions = useMemo57(() => {
|
|
16574
16612
|
return parsedColumns.filter((col) => {
|
|
16575
16613
|
if (!rawData || rawData.length <= 1) return true;
|
|
16576
16614
|
const firstValue = rawData[0]?.[col.key];
|
|
@@ -16599,13 +16637,13 @@ function DynamicListBlock({ block, editor }) {
|
|
|
16599
16637
|
return String(aVal).localeCompare(String(bVal)) * dir;
|
|
16600
16638
|
});
|
|
16601
16639
|
}, []);
|
|
16602
|
-
const allData =
|
|
16640
|
+
const allData = useMemo57(() => {
|
|
16603
16641
|
if (!filteredData) return null;
|
|
16604
16642
|
return sortData(filteredData, sortConfig);
|
|
16605
16643
|
}, [filteredData, sortConfig, sortData]);
|
|
16606
16644
|
const totalItems = allData?.length || 0;
|
|
16607
16645
|
const totalPages = Math.ceil(totalItems / DEFAULT_PAGE_SIZE);
|
|
16608
|
-
const paginatedData =
|
|
16646
|
+
const paginatedData = useMemo57(() => {
|
|
16609
16647
|
if (!allData) return null;
|
|
16610
16648
|
const startIndex = (page - 1) * DEFAULT_PAGE_SIZE;
|
|
16611
16649
|
const endIndex = startIndex + DEFAULT_PAGE_SIZE;
|
|
@@ -16646,7 +16684,7 @@ function DynamicListBlock({ block, editor }) {
|
|
|
16646
16684
|
[parsedColumns, editor, block]
|
|
16647
16685
|
);
|
|
16648
16686
|
const panelId = `${DYNAMIC_LIST_SELECTION_PANEL_ID}-${block.id}`;
|
|
16649
|
-
const panelContent =
|
|
16687
|
+
const panelContent = useMemo57(
|
|
16650
16688
|
() => /* @__PURE__ */ React168.createElement(
|
|
16651
16689
|
DynamicListSelectionPanel,
|
|
16652
16690
|
{
|
|
@@ -16660,7 +16698,7 @@ function DynamicListBlock({ block, editor }) {
|
|
|
16660
16698
|
[selectedItem, parsedColumns, parsedDataSource, panelDescription, handlePanelClose]
|
|
16661
16699
|
);
|
|
16662
16700
|
const { open: openSelectionPanel, close: closeSelectionPanel } = usePanel(panelId, panelContent);
|
|
16663
|
-
const columnsByPosition =
|
|
16701
|
+
const columnsByPosition = useMemo57(() => {
|
|
16664
16702
|
const grouped = {
|
|
16665
16703
|
topLeft: void 0,
|
|
16666
16704
|
bottomLeft: void 0,
|
|
@@ -17022,7 +17060,7 @@ import { createReactBlockSpec as createReactBlockSpec12 } from "@blocknote/react
|
|
|
17022
17060
|
import React175 from "react";
|
|
17023
17061
|
|
|
17024
17062
|
// src/mantine/blocks/domainCreator/template/TemplateView.tsx
|
|
17025
|
-
import React172, { useMemo as
|
|
17063
|
+
import React172, { useMemo as useMemo58 } from "react";
|
|
17026
17064
|
import { Badge as Badge21, Group as Group58, Stack as Stack121, Text as Text97 } from "@mantine/core";
|
|
17027
17065
|
|
|
17028
17066
|
// src/mantine/blocks/domainCreator/template/TemplateConfig.tsx
|
|
@@ -17110,18 +17148,18 @@ var TemplateConfig8 = ({ editor, block }) => {
|
|
|
17110
17148
|
var DOMAIN_CREATOR_TEMPLATE_PANEL_ID = "domain-creator-template-panel";
|
|
17111
17149
|
var DomainCreatorTemplateView = ({ editor, block }) => {
|
|
17112
17150
|
const panelId = `${DOMAIN_CREATOR_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
17113
|
-
const panelContent =
|
|
17151
|
+
const panelContent = useMemo58(() => /* @__PURE__ */ React172.createElement(TemplateConfig8, { editor, block }), [editor, block]);
|
|
17114
17152
|
const { open } = usePanel(panelId, panelContent);
|
|
17115
17153
|
return /* @__PURE__ */ React172.createElement(BaseContainer, { blockId: block.id, onClick: open }, /* @__PURE__ */ React172.createElement(Badge21, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React172.createElement(Group58, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React172.createElement(Group58, { wrap: "nowrap", align: "center" }, getIcon("file-text", block.props.icon), /* @__PURE__ */ React172.createElement(Stack121, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React172.createElement(Text97, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Domain Creator"), /* @__PURE__ */ React172.createElement(Text97, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || "Configure the domain creation flow")))));
|
|
17116
17154
|
};
|
|
17117
17155
|
|
|
17118
17156
|
// src/mantine/blocks/domainCreator/flow/FlowView.tsx
|
|
17119
|
-
import React174, { useCallback as useCallback48, useMemo as
|
|
17157
|
+
import React174, { useCallback as useCallback48, useMemo as useMemo60, useState as useState68 } from "react";
|
|
17120
17158
|
import { ActionIcon as ActionIcon22, Badge as Badge22, Group as Group60, Stack as Stack123, Text as Text99, Tooltip as Tooltip11 } from "@mantine/core";
|
|
17121
17159
|
import { IconChevronRight as IconChevronRight7, IconCheck as IconCheck8, IconAlertCircle as IconAlertCircle12 } from "@tabler/icons-react";
|
|
17122
17160
|
|
|
17123
17161
|
// src/mantine/blocks/domainCreator/flow/DomainCreatorSurveyPanel.tsx
|
|
17124
|
-
import React173, { useCallback as useCallback47, useEffect as useEffect54, useMemo as
|
|
17162
|
+
import React173, { useCallback as useCallback47, useEffect as useEffect54, useMemo as useMemo59, useRef as useRef16, useState as useState67 } from "react";
|
|
17125
17163
|
import { Alert as Alert24, Button as Button32, Group as Group59, Loader as Loader23, Stack as Stack122, Text as Text98 } from "@mantine/core";
|
|
17126
17164
|
import { useDebouncedCallback } from "@mantine/hooks";
|
|
17127
17165
|
import { IconAlertCircle as IconAlertCircle11, IconCheck as IconCheck7 } from "@tabler/icons-react";
|
|
@@ -17838,7 +17876,7 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
17838
17876
|
const [createdEntityType, setCreatedEntityType] = useState67(existingBlockEntityType || null);
|
|
17839
17877
|
const isUpdatingFromProp = useRef16(false);
|
|
17840
17878
|
const lastSyncedAnswers = useRef16("");
|
|
17841
|
-
const surveyModel =
|
|
17879
|
+
const surveyModel = useMemo59(() => {
|
|
17842
17880
|
const model = new SurveyModel6(tempDomainCreatorSurvey);
|
|
17843
17881
|
model.applyTheme(surveyTheme);
|
|
17844
17882
|
model.showQuestionNumbers = "off";
|
|
@@ -18092,7 +18130,7 @@ var DomainCreatorFlowView = ({ editor, block }) => {
|
|
|
18092
18130
|
[block, editor]
|
|
18093
18131
|
);
|
|
18094
18132
|
const panelId = `${DOMAIN_CREATOR_FLOW_PANEL_ID}-${block.id}`;
|
|
18095
|
-
const panelContent =
|
|
18133
|
+
const panelContent = useMemo60(() => /* @__PURE__ */ React174.createElement(DomainCreatorSurveyPanel, { editor, block, onComplete: handleComplete }), [editor, block, handleComplete]);
|
|
18096
18134
|
const { open } = usePanel(panelId, panelContent);
|
|
18097
18135
|
const handleOpen = () => {
|
|
18098
18136
|
setHasOpened(true);
|
|
@@ -18156,11 +18194,11 @@ import { createReactBlockSpec as createReactBlockSpec13 } from "@blocknote/react
|
|
|
18156
18194
|
import React182 from "react";
|
|
18157
18195
|
|
|
18158
18196
|
// src/mantine/blocks/email/template/TemplateView.tsx
|
|
18159
|
-
import React180, { useMemo as
|
|
18197
|
+
import React180, { useMemo as useMemo63 } from "react";
|
|
18160
18198
|
import { Badge as Badge24, Group as Group62, Stack as Stack126, Text as Text102 } from "@mantine/core";
|
|
18161
18199
|
|
|
18162
18200
|
// src/mantine/blocks/email/template/TemplateConfig.tsx
|
|
18163
|
-
import React179, { useCallback as useCallback51, useMemo as
|
|
18201
|
+
import React179, { useCallback as useCallback51, useMemo as useMemo62 } from "react";
|
|
18164
18202
|
import { IconSettings as IconSettings11, IconVariable as IconVariable2, IconShieldCheck as IconShieldCheck10 } from "@tabler/icons-react";
|
|
18165
18203
|
|
|
18166
18204
|
// src/mantine/blocks/email/template/GeneralTab.tsx
|
|
@@ -18329,20 +18367,20 @@ var GeneralTab9 = ({ editor, blockId, getCurrentBlock, onTitleChange, onTemplate
|
|
|
18329
18367
|
};
|
|
18330
18368
|
|
|
18331
18369
|
// src/mantine/blocks/email/template/VariablesTab.tsx
|
|
18332
|
-
import React178, { useMemo as
|
|
18370
|
+
import React178, { useMemo as useMemo61, useCallback as useCallback50, useState as useState70, useEffect as useEffect56 } from "react";
|
|
18333
18371
|
import { Alert as Alert25, Badge as Badge23, Divider as Divider16, Group as Group61, Stack as Stack125, Text as Text101 } from "@mantine/core";
|
|
18334
18372
|
import { IconInfoCircle as IconInfoCircle4, IconCheck as IconCheck9 } from "@tabler/icons-react";
|
|
18335
18373
|
var VariablesTab = ({ editor, blockId, getCurrentBlock, onVariablesChange }) => {
|
|
18336
18374
|
const block = getCurrentBlock();
|
|
18337
18375
|
const blockProps = block.props;
|
|
18338
|
-
const parsedExtractedVariables =
|
|
18376
|
+
const parsedExtractedVariables = useMemo61(() => {
|
|
18339
18377
|
try {
|
|
18340
18378
|
return JSON.parse(blockProps.extractedVariables || "[]");
|
|
18341
18379
|
} catch {
|
|
18342
18380
|
return [];
|
|
18343
18381
|
}
|
|
18344
18382
|
}, [blockProps.extractedVariables]);
|
|
18345
|
-
const parsedVariableMapping =
|
|
18383
|
+
const parsedVariableMapping = useMemo61(() => {
|
|
18346
18384
|
try {
|
|
18347
18385
|
return JSON.parse(blockProps.variables || "{}");
|
|
18348
18386
|
} catch {
|
|
@@ -18426,7 +18464,7 @@ var TemplateConfig9 = ({ editor, block }) => {
|
|
|
18426
18464
|
},
|
|
18427
18465
|
[updateProp]
|
|
18428
18466
|
);
|
|
18429
|
-
const tabs =
|
|
18467
|
+
const tabs = useMemo62(
|
|
18430
18468
|
() => [
|
|
18431
18469
|
{
|
|
18432
18470
|
label: "General",
|
|
@@ -18466,16 +18504,16 @@ var TemplateConfig9 = ({ editor, block }) => {
|
|
|
18466
18504
|
var EMAIL_TEMPLATE_PANEL_ID = "email-template-panel";
|
|
18467
18505
|
var EmailTemplateView = ({ editor, block }) => {
|
|
18468
18506
|
const panelId = `${EMAIL_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
18469
|
-
const panelContent =
|
|
18507
|
+
const panelContent = useMemo63(() => /* @__PURE__ */ React180.createElement(TemplateConfig9, { editor, block }), [editor, block.id]);
|
|
18470
18508
|
const { open } = usePanel(panelId, panelContent);
|
|
18471
|
-
const extractedVariables =
|
|
18509
|
+
const extractedVariables = useMemo63(() => {
|
|
18472
18510
|
try {
|
|
18473
18511
|
return JSON.parse(block.props.extractedVariables || "[]");
|
|
18474
18512
|
} catch {
|
|
18475
18513
|
return [];
|
|
18476
18514
|
}
|
|
18477
18515
|
}, [block.props.extractedVariables]);
|
|
18478
|
-
const variableMapping =
|
|
18516
|
+
const variableMapping = useMemo63(() => {
|
|
18479
18517
|
try {
|
|
18480
18518
|
return JSON.parse(block.props.variables || "{}");
|
|
18481
18519
|
} catch {
|
|
@@ -18488,7 +18526,7 @@ var EmailTemplateView = ({ editor, block }) => {
|
|
|
18488
18526
|
};
|
|
18489
18527
|
|
|
18490
18528
|
// src/mantine/blocks/email/flow/FlowView.tsx
|
|
18491
|
-
import React181, { useMemo as
|
|
18529
|
+
import React181, { useMemo as useMemo64 } from "react";
|
|
18492
18530
|
import { Group as Group63, Stack as Stack127, Text as Text103, ActionIcon as ActionIcon23, Tooltip as Tooltip12, Button as Button33, Badge as Badge25, Alert as Alert26, Loader as Loader25, Divider as Divider17 } from "@mantine/core";
|
|
18493
18531
|
import { IconSend as IconSend4, IconCheck as IconCheck10, IconX as IconX12, IconMail as IconMail3, IconUser as IconUser11 } from "@tabler/icons-react";
|
|
18494
18532
|
|
|
@@ -18614,7 +18652,7 @@ var EmailFlowView = ({ editor, block, isDisabled }) => {
|
|
|
18614
18652
|
const editorDocument = editor.document || [];
|
|
18615
18653
|
const toDisplay = resolveReferences(block.props.to, editorDocument);
|
|
18616
18654
|
const disabled = isDisabled?.isDisabled === "disable";
|
|
18617
|
-
const tabs =
|
|
18655
|
+
const tabs = useMemo64(
|
|
18618
18656
|
() => [
|
|
18619
18657
|
{
|
|
18620
18658
|
label: "Send",
|
|
@@ -18631,14 +18669,14 @@ var EmailFlowView = ({ editor, block, isDisabled }) => {
|
|
|
18631
18669
|
],
|
|
18632
18670
|
[editor, block, isDisabled, disabled]
|
|
18633
18671
|
);
|
|
18634
|
-
const panelContent =
|
|
18672
|
+
const panelContent = useMemo64(
|
|
18635
18673
|
() => /* @__PURE__ */ React181.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Email Details", tabs, context: { editor, block } }),
|
|
18636
18674
|
[tabs, editor, block, closePanel]
|
|
18637
18675
|
);
|
|
18638
18676
|
const panelId = `email-details-panel-${block.id}`;
|
|
18639
18677
|
const { open: openDetails } = usePanel(panelId, panelContent);
|
|
18640
18678
|
const assignmentPanelId = `email-assignment-panel-${block.id}`;
|
|
18641
|
-
const assignmentPanelContent =
|
|
18679
|
+
const assignmentPanelContent = useMemo64(
|
|
18642
18680
|
() => /* @__PURE__ */ React181.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Assignment Tab", isTemplate: false }, /* @__PURE__ */ React181.createElement(AssignmentTab, { editor, block })),
|
|
18643
18681
|
[editor, block, closePanel]
|
|
18644
18682
|
);
|
|
@@ -18762,20 +18800,20 @@ import { createReactBlockSpec as createReactBlockSpec14 } from "@blocknote/react
|
|
|
18762
18800
|
import React190 from "react";
|
|
18763
18801
|
|
|
18764
18802
|
// src/mantine/blocks/protocolSelector/template/TemplateView.tsx
|
|
18765
|
-
import React186, { useMemo as
|
|
18803
|
+
import React186, { useMemo as useMemo66 } from "react";
|
|
18766
18804
|
|
|
18767
18805
|
// src/mantine/blocks/protocolSelector/template/TemplateConfig.tsx
|
|
18768
18806
|
import React185, { useCallback as useCallback53 } from "react";
|
|
18769
18807
|
import { IconSettings as IconSettings12 } from "@tabler/icons-react";
|
|
18770
18808
|
|
|
18771
18809
|
// src/mantine/blocks/protocolSelector/template/GeneralTab.tsx
|
|
18772
|
-
import React184, { useEffect as useEffect57, useMemo as
|
|
18810
|
+
import React184, { useEffect as useEffect57, useMemo as useMemo65, useState as useState72 } from "react";
|
|
18773
18811
|
import { Divider as Divider18, Stack as Stack128, Text as Text104, PillsInput as PillsInput2, Pill as Pill2, Box as Box38 } from "@mantine/core";
|
|
18774
18812
|
var GeneralTab10 = ({ title, description, protocolDids, onTitleChange, onDescriptionChange, onProtocolDidsChange }) => {
|
|
18775
18813
|
const [localTitle, setLocalTitle] = useState72(title || "");
|
|
18776
18814
|
const [localDescription, setLocalDescription] = useState72(description || "");
|
|
18777
18815
|
const [inputValue, setInputValue] = useState72("");
|
|
18778
|
-
const localDids =
|
|
18816
|
+
const localDids = useMemo65(() => {
|
|
18779
18817
|
try {
|
|
18780
18818
|
const parsed = JSON.parse(protocolDids || "[]");
|
|
18781
18819
|
return Array.isArray(parsed) ? parsed : [];
|
|
@@ -18873,9 +18911,9 @@ import { IconCircleDashed as IconCircleDashed2 } from "@tabler/icons-react";
|
|
|
18873
18911
|
var PROTOCOL_SELECTOR_TEMPLATE_PANEL_ID = "protocol-selector-template-panel";
|
|
18874
18912
|
var ProtocolSelectorTemplateView = ({ editor, block }) => {
|
|
18875
18913
|
const panelId = `${PROTOCOL_SELECTOR_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
18876
|
-
const panelContent =
|
|
18914
|
+
const panelContent = useMemo66(() => /* @__PURE__ */ React186.createElement(TemplateConfig10, { editor, block }), [editor, block]);
|
|
18877
18915
|
const { open } = usePanel(panelId, panelContent);
|
|
18878
|
-
const protocolDids =
|
|
18916
|
+
const protocolDids = useMemo66(() => {
|
|
18879
18917
|
try {
|
|
18880
18918
|
const parsed = JSON.parse(block.props.protocolDids || "[]");
|
|
18881
18919
|
return Array.isArray(parsed) ? parsed : [];
|
|
@@ -18901,12 +18939,12 @@ var ProtocolSelectorTemplateView = ({ editor, block }) => {
|
|
|
18901
18939
|
};
|
|
18902
18940
|
|
|
18903
18941
|
// src/mantine/blocks/protocolSelector/flow/FlowView.tsx
|
|
18904
|
-
import React189, { useMemo as
|
|
18942
|
+
import React189, { useMemo as useMemo68 } from "react";
|
|
18905
18943
|
import { Badge as Badge26, Box as Box41, Group as Group66, Stack as Stack131, Text as Text107, Tooltip as Tooltip13 } from "@mantine/core";
|
|
18906
18944
|
import { IconCircleDashed as IconCircleDashed3, IconChecks as IconChecks3 } from "@tabler/icons-react";
|
|
18907
18945
|
|
|
18908
18946
|
// src/mantine/blocks/protocolSelector/flow/ProtocolSelectionPanel.tsx
|
|
18909
|
-
import React188, { useState as useState73, useEffect as useEffect58, useMemo as
|
|
18947
|
+
import React188, { useState as useState73, useEffect as useEffect58, useMemo as useMemo67, useCallback as useCallback54 } from "react";
|
|
18910
18948
|
import { Stack as Stack130, Text as Text106, Box as Box40, Group as Group65, Loader as Loader26 } from "@mantine/core";
|
|
18911
18949
|
|
|
18912
18950
|
// src/icons/EntityAvatar.tsx
|
|
@@ -18936,7 +18974,7 @@ var EntityAvatar_default = EntityAvatar;
|
|
|
18936
18974
|
var ProtocolSelectionPanel = ({ editor, block }) => {
|
|
18937
18975
|
const { closePanel } = usePanelStore();
|
|
18938
18976
|
const handlers = useBlocknoteHandlers();
|
|
18939
|
-
const protocolDids =
|
|
18977
|
+
const protocolDids = useMemo67(() => {
|
|
18940
18978
|
try {
|
|
18941
18979
|
const parsed = JSON.parse(block.props.protocolDids || "[]");
|
|
18942
18980
|
return Array.isArray(parsed) ? parsed : [];
|
|
@@ -19059,7 +19097,7 @@ var ProtocolSelectorFlowView = ({ editor, block, isDisabled }) => {
|
|
|
19059
19097
|
const disabled = isDisabled?.isDisabled === "disable";
|
|
19060
19098
|
const panelId = `${PROTOCOL_SELECTOR_FLOW_PANEL_ID}-${block.id}`;
|
|
19061
19099
|
const isCompleted = block.props.status === "completed" && block.props.selectedProtocolDid;
|
|
19062
|
-
const panelContent =
|
|
19100
|
+
const panelContent = useMemo68(() => /* @__PURE__ */ React189.createElement(ProtocolSelectionPanel, { editor, block }), [editor, block]);
|
|
19063
19101
|
const { open } = usePanel(panelId, panelContent);
|
|
19064
19102
|
const handleClick = () => {
|
|
19065
19103
|
if (disabled) return;
|
|
@@ -19165,7 +19203,7 @@ import { createReactBlockSpec as createReactBlockSpec15 } from "@blocknote/react
|
|
|
19165
19203
|
import React197 from "react";
|
|
19166
19204
|
|
|
19167
19205
|
// src/mantine/blocks/form/template/TemplateView.tsx
|
|
19168
|
-
import React194, { useMemo as
|
|
19206
|
+
import React194, { useMemo as useMemo69 } from "react";
|
|
19169
19207
|
import { Badge as Badge27, Group as Group67, Stack as Stack132, Text as Text109 } from "@mantine/core";
|
|
19170
19208
|
|
|
19171
19209
|
// src/mantine/blocks/form/template/TemplateConfig.tsx
|
|
@@ -19292,19 +19330,19 @@ var TemplateConfig11 = ({ editor, block }) => {
|
|
|
19292
19330
|
var FORM_TEMPLATE_PANEL_ID = "form-template-panel";
|
|
19293
19331
|
var FormTemplateView = ({ editor, block }) => {
|
|
19294
19332
|
const panelId = `${FORM_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
19295
|
-
const panelContent =
|
|
19333
|
+
const panelContent = useMemo69(() => /* @__PURE__ */ React194.createElement(TemplateConfig11, { editor, block }), [editor, block]);
|
|
19296
19334
|
const { open } = usePanel(panelId, panelContent);
|
|
19297
19335
|
const hasSchema = Boolean(block.props.surveySchema);
|
|
19298
19336
|
return /* @__PURE__ */ React194.createElement(BaseContainer, { blockId: block.id, onClick: open }, /* @__PURE__ */ React194.createElement(Badge27, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React194.createElement(Group67, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React194.createElement(Group67, { wrap: "nowrap", align: "center" }, getIcon("checklist", block.props.icon), /* @__PURE__ */ React194.createElement(Stack132, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React194.createElement(Text109, { fw: 500, size: "sm" }, block.props.title || "Form"), /* @__PURE__ */ React194.createElement(Text109, { size: "xs", c: "dimmed" }, hasSchema ? "Form configured" : "Click to configure form schema")))));
|
|
19299
19337
|
};
|
|
19300
19338
|
|
|
19301
19339
|
// src/mantine/blocks/form/flow/FlowView.tsx
|
|
19302
|
-
import React196, { useMemo as
|
|
19340
|
+
import React196, { useMemo as useMemo71, useState as useState75, useCallback as useCallback57 } from "react";
|
|
19303
19341
|
import { ActionIcon as ActionIcon24, Badge as Badge28, Group as Group68, Stack as Stack133, Text as Text111, Tooltip as Tooltip14 } from "@mantine/core";
|
|
19304
19342
|
import { IconChevronRight as IconChevronRight8 } from "@tabler/icons-react";
|
|
19305
19343
|
|
|
19306
19344
|
// src/mantine/blocks/form/flow/FormPanel.tsx
|
|
19307
|
-
import React195, { useCallback as useCallback56, useEffect as useEffect60, useMemo as
|
|
19345
|
+
import React195, { useCallback as useCallback56, useEffect as useEffect60, useMemo as useMemo70, useRef as useRef18 } from "react";
|
|
19308
19346
|
import { Alert as Alert27, Text as Text110 } from "@mantine/core";
|
|
19309
19347
|
import { useDebouncedCallback as useDebouncedCallback2 } from "@mantine/hooks";
|
|
19310
19348
|
import { IconAlertCircle as IconAlertCircle13 } from "@tabler/icons-react";
|
|
@@ -19332,7 +19370,7 @@ var FormPanel = ({ editor, block, onComplete }) => {
|
|
|
19332
19370
|
const [runtime, updateRuntime] = useNodeRuntime(editor, block.id);
|
|
19333
19371
|
const isUpdatingFromProp = useRef18(false);
|
|
19334
19372
|
const lastSyncedAnswers = useRef18("");
|
|
19335
|
-
const surveySchema =
|
|
19373
|
+
const surveySchema = useMemo70(() => {
|
|
19336
19374
|
if (!block.props.surveySchema) return null;
|
|
19337
19375
|
try {
|
|
19338
19376
|
return JSON.parse(block.props.surveySchema);
|
|
@@ -19340,7 +19378,7 @@ var FormPanel = ({ editor, block, onComplete }) => {
|
|
|
19340
19378
|
return null;
|
|
19341
19379
|
}
|
|
19342
19380
|
}, [block.props.surveySchema]);
|
|
19343
|
-
const surveyModel =
|
|
19381
|
+
const surveyModel = useMemo70(() => {
|
|
19344
19382
|
if (!surveySchema) return null;
|
|
19345
19383
|
const model = new SurveyModel7(surveySchema);
|
|
19346
19384
|
model.applyTheme(surveyTheme);
|
|
@@ -19450,7 +19488,7 @@ var FormFlowView = ({ editor, block }) => {
|
|
|
19450
19488
|
});
|
|
19451
19489
|
}, [updateRuntime]);
|
|
19452
19490
|
const panelId = `${FORM_FLOW_PANEL_ID}-${block.id}`;
|
|
19453
|
-
const panelContent =
|
|
19491
|
+
const panelContent = useMemo71(() => /* @__PURE__ */ React196.createElement(FormPanel, { editor, block, onComplete: handleComplete }), [editor, block, handleComplete]);
|
|
19454
19492
|
const { open } = usePanel(panelId, panelContent);
|
|
19455
19493
|
const handleOpen = () => {
|
|
19456
19494
|
setHasOpened(true);
|
|
@@ -19524,7 +19562,7 @@ import { createReactBlockSpec as createReactBlockSpec16 } from "@blocknote/react
|
|
|
19524
19562
|
import React206 from "react";
|
|
19525
19563
|
|
|
19526
19564
|
// src/mantine/blocks/domainCreatorSign/template/TemplateView.tsx
|
|
19527
|
-
import React201, { useMemo as
|
|
19565
|
+
import React201, { useMemo as useMemo72 } from "react";
|
|
19528
19566
|
import { Badge as Badge29, Group as Group69, Stack as Stack134, Text as Text112 } from "@mantine/core";
|
|
19529
19567
|
|
|
19530
19568
|
// src/mantine/blocks/domainCreatorSign/template/TemplateConfig.tsx
|
|
@@ -19618,13 +19656,13 @@ var TemplateConfig12 = ({ editor, block }) => {
|
|
|
19618
19656
|
var DOMAIN_CREATOR_SIGN_TEMPLATE_PANEL_ID = "domain-creator-sign-template-panel";
|
|
19619
19657
|
var DomainCreatorSignTemplateView = ({ editor, block }) => {
|
|
19620
19658
|
const panelId = `${DOMAIN_CREATOR_SIGN_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
19621
|
-
const panelContent =
|
|
19659
|
+
const panelContent = useMemo72(() => /* @__PURE__ */ React201.createElement(TemplateConfig12, { editor, block }), [editor, block]);
|
|
19622
19660
|
const { open } = usePanel(panelId, panelContent);
|
|
19623
19661
|
return /* @__PURE__ */ React201.createElement(BaseContainer, { blockId: block.id, onClick: open }, /* @__PURE__ */ React201.createElement(Badge29, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React201.createElement(Group69, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React201.createElement(Group69, { wrap: "nowrap", align: "center" }, getIcon("feather", block.props.icon), /* @__PURE__ */ React201.createElement(Stack134, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React201.createElement(Text112, { fw: 500, size: "sm" }, block.props.title || "Sign to Create"), /* @__PURE__ */ React201.createElement(Text112, { size: "xs", c: "dimmed" }, "Sign"))), /* @__PURE__ */ React201.createElement(Group69, { gap: 4, wrap: "nowrap", style: { flexShrink: 0 } }, /* @__PURE__ */ React201.createElement(CommitmentPanel, { block, editor }), /* @__PURE__ */ React201.createElement(AssignmentPanel, { block, editor }))));
|
|
19624
19662
|
};
|
|
19625
19663
|
|
|
19626
19664
|
// src/mantine/blocks/domainCreatorSign/flow/FlowView.tsx
|
|
19627
|
-
import React205, { useCallback as useCallback60, useMemo as
|
|
19665
|
+
import React205, { useCallback as useCallback60, useMemo as useMemo73, useEffect as useEffect62 } from "react";
|
|
19628
19666
|
import { ActionIcon as ActionIcon25, Badge as Badge31, Group as Group71, Stack as Stack137, Text as Text116, Tooltip as Tooltip16 } from "@mantine/core";
|
|
19629
19667
|
import { IconChevronRight as IconChevronRight9 } from "@tabler/icons-react";
|
|
19630
19668
|
|
|
@@ -19974,17 +20012,17 @@ var DomainCreatorSignFlowView = ({ editor, block }) => {
|
|
|
19974
20012
|
[updateRuntime]
|
|
19975
20013
|
);
|
|
19976
20014
|
const panelId = `${DOMAIN_CREATOR_SIGN_FLOW_PANEL_ID}-${block.id}`;
|
|
19977
|
-
const panelContent =
|
|
20015
|
+
const panelContent = useMemo73(() => /* @__PURE__ */ React205.createElement(SignPanel, { editor, block, onComplete: handleComplete, onError: handleError }), [editor, block, handleComplete, handleError]);
|
|
19978
20016
|
const { open } = usePanel(panelId, panelContent);
|
|
19979
20017
|
const { closePanel } = usePanelStore();
|
|
19980
20018
|
const assignmentPanelId = `domain-creator-sign-assignment-${block.id}`;
|
|
19981
|
-
const assignmentPanelContent =
|
|
20019
|
+
const assignmentPanelContent = useMemo73(
|
|
19982
20020
|
() => /* @__PURE__ */ React205.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Assignment Tab" }, /* @__PURE__ */ React205.createElement(AssignmentTab, { editor, block })),
|
|
19983
20021
|
[editor, block, closePanel]
|
|
19984
20022
|
);
|
|
19985
20023
|
const { open: openAssignment } = usePanel(assignmentPanelId, assignmentPanelContent);
|
|
19986
20024
|
const commitmentPanelId = `domain-creator-sign-commitment-${block.id}`;
|
|
19987
|
-
const commitmentPanelContent =
|
|
20025
|
+
const commitmentPanelContent = useMemo73(
|
|
19988
20026
|
() => /* @__PURE__ */ React205.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Commitment Tab" }, /* @__PURE__ */ React205.createElement(CommitmentTab, { editor, block })),
|
|
19989
20027
|
[editor, block, closePanel]
|
|
19990
20028
|
);
|
|
@@ -20095,7 +20133,7 @@ import { createReactBlockSpec as createReactBlockSpec17 } from "@blocknote/react
|
|
|
20095
20133
|
import React213 from "react";
|
|
20096
20134
|
|
|
20097
20135
|
// src/mantine/blocks/domainCardViewer/template/TemplateView.tsx
|
|
20098
|
-
import React210, { useMemo as
|
|
20136
|
+
import React210, { useMemo as useMemo74 } from "react";
|
|
20099
20137
|
import { Badge as Badge32, Group as Group72, Stack as Stack138, Text as Text117 } from "@mantine/core";
|
|
20100
20138
|
|
|
20101
20139
|
// src/mantine/blocks/domainCardViewer/template/TemplateConfig.tsx
|
|
@@ -20191,18 +20229,18 @@ var TemplateConfig13 = ({ editor, block }) => {
|
|
|
20191
20229
|
var DOMAIN_CARD_VIEWER_TEMPLATE_PANEL_ID = "domain-card-viewer-template-panel";
|
|
20192
20230
|
var DomainCardViewerTemplateView = ({ editor, block }) => {
|
|
20193
20231
|
const panelId = `${DOMAIN_CARD_VIEWER_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
20194
|
-
const panelContent =
|
|
20232
|
+
const panelContent = useMemo74(() => /* @__PURE__ */ React210.createElement(TemplateConfig13, { editor, block }), [editor, block]);
|
|
20195
20233
|
const { open } = usePanel(panelId, panelContent);
|
|
20196
20234
|
return /* @__PURE__ */ React210.createElement(BaseContainer, { blockId: block.id, onClick: open }, /* @__PURE__ */ React210.createElement(Badge32, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React210.createElement(Group72, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React210.createElement(Group72, { wrap: "nowrap", align: "center" }, getIcon("dots-circle", block.props.icon), /* @__PURE__ */ React210.createElement(Stack138, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React210.createElement(Text117, { fw: 500, size: "sm" }, block.props.title || "Domain Card"), /* @__PURE__ */ React210.createElement(Text117, { size: "xs", c: "dimmed" }, block.props.description || "Preview domain card generated by AI")))));
|
|
20197
20235
|
};
|
|
20198
20236
|
|
|
20199
20237
|
// src/mantine/blocks/domainCardViewer/flow/FlowView.tsx
|
|
20200
|
-
import React212, { useMemo as
|
|
20238
|
+
import React212, { useMemo as useMemo76, useCallback as useCallback62, useEffect as useEffect64 } from "react";
|
|
20201
20239
|
import { ActionIcon as ActionIcon26, Badge as Badge33, Button as Button36, Group as Group73, Stack as Stack140, Text as Text119, Tooltip as Tooltip17 } from "@mantine/core";
|
|
20202
20240
|
import { IconChevronRight as IconChevronRight10, IconLoader, IconTestPipe, IconTrash as IconTrash5 } from "@tabler/icons-react";
|
|
20203
20241
|
|
|
20204
20242
|
// src/mantine/blocks/domainCardViewer/flow/ViewerPanel.tsx
|
|
20205
|
-
import React211, { useMemo as
|
|
20243
|
+
import React211, { useMemo as useMemo75 } from "react";
|
|
20206
20244
|
import { Paper as Paper15, CloseButton as CloseButton4, Title as Title8, Stack as Stack139, Text as Text118, Loader as Loader28, Alert as Alert29, Button as Button35, Box as Box43, ScrollArea as ScrollArea7, Code as Code6 } from "@mantine/core";
|
|
20207
20245
|
import { IconAlertCircle as IconAlertCircle15, IconCheck as IconCheck12, IconSparkles as IconSparkles4 } from "@tabler/icons-react";
|
|
20208
20246
|
function parsePreviewData(jsonString) {
|
|
@@ -20222,7 +20260,7 @@ var ViewerPanel = ({ block, onApprove }) => {
|
|
|
20222
20260
|
const status = block.props.status || "pending";
|
|
20223
20261
|
const loadingMessage = block.props.loadingMessage || "Agents is generating your domain data...";
|
|
20224
20262
|
const errorMessage = block.props.errorMessage || "An error occurred while generating the domain data.";
|
|
20225
|
-
const domainPreviewData =
|
|
20263
|
+
const domainPreviewData = useMemo75(() => parsePreviewData(block.props.domainPreviewData || "{}"), [block.props.domainPreviewData]);
|
|
20226
20264
|
const isLoading = status === "loading";
|
|
20227
20265
|
const isError = status === "error";
|
|
20228
20266
|
const isReady = status === "ready";
|
|
@@ -20531,7 +20569,7 @@ var DomainCardViewerFlowView = ({ editor, block }) => {
|
|
|
20531
20569
|
});
|
|
20532
20570
|
}, [editor, block]);
|
|
20533
20571
|
const panelId = `${DOMAIN_CARD_VIEWER_FLOW_PANEL_ID}-${block.id}`;
|
|
20534
|
-
const panelContent =
|
|
20572
|
+
const panelContent = useMemo76(() => /* @__PURE__ */ React212.createElement(ViewerPanel, { editor, block, onApprove: handleApprove }), [editor, block, handleApprove]);
|
|
20535
20573
|
const { open } = usePanel(panelId, panelContent);
|
|
20536
20574
|
const handleInjectDummyData = useCallback62(
|
|
20537
20575
|
(e) => {
|
|
@@ -20661,7 +20699,7 @@ import { createReactBlockSpec as createReactBlockSpec18 } from "@blocknote/react
|
|
|
20661
20699
|
import React222 from "react";
|
|
20662
20700
|
|
|
20663
20701
|
// src/mantine/blocks/governanceGroup/template/TemplateView.tsx
|
|
20664
|
-
import React219, { useMemo as
|
|
20702
|
+
import React219, { useMemo as useMemo78 } from "react";
|
|
20665
20703
|
import { Badge as Badge36, Group as Group76, Stack as Stack144, Text as Text123 } from "@mantine/core";
|
|
20666
20704
|
|
|
20667
20705
|
// src/mantine/blocks/governanceGroup/template/TemplateConfig.tsx
|
|
@@ -20776,7 +20814,7 @@ var GeneralTab14 = ({ title, description, icon: icon2, groupType, onTitleChange,
|
|
|
20776
20814
|
};
|
|
20777
20815
|
|
|
20778
20816
|
// src/mantine/components/HookedActionsTab/HookedActionsTab.tsx
|
|
20779
|
-
import React217, { useCallback as useCallback64, useMemo as
|
|
20817
|
+
import React217, { useCallback as useCallback64, useMemo as useMemo77, useEffect as useEffect67, useState as useState83 } from "react";
|
|
20780
20818
|
import { Stack as Stack143, Text as Text122, Alert as Alert30, Accordion as Accordion4, Group as Group75, Badge as Badge35, Menu as Menu3, Button as Button37 } from "@mantine/core";
|
|
20781
20819
|
import { IconPlus as IconPlus5, IconMail as IconMail5, IconLink as IconLink3 } from "@tabler/icons-react";
|
|
20782
20820
|
|
|
@@ -21046,12 +21084,12 @@ var HookedActionsTab = ({ editor, block, blockActions, hookedActions, onHookedAc
|
|
|
21046
21084
|
cancelled = true;
|
|
21047
21085
|
};
|
|
21048
21086
|
}, [blockActions, handlers, block?.props]);
|
|
21049
|
-
const config =
|
|
21050
|
-
const availableActionTypes =
|
|
21087
|
+
const config = useMemo77(() => parseHookedActionsConfig(hookedActions), [hookedActions]);
|
|
21088
|
+
const availableActionTypes = useMemo77(() => {
|
|
21051
21089
|
ensureActionTypesRegistered();
|
|
21052
21090
|
return getAllHookedActionTypes();
|
|
21053
21091
|
}, []);
|
|
21054
|
-
const availableBlocks =
|
|
21092
|
+
const availableBlocks = useMemo77(() => {
|
|
21055
21093
|
if (!editor?.document) return [];
|
|
21056
21094
|
return editor.document.filter((docBlock) => docBlock.id !== block.id).map((docBlock) => ({
|
|
21057
21095
|
id: docBlock.id,
|
|
@@ -22022,18 +22060,18 @@ var TemplateConfig14 = ({ editor, block }) => {
|
|
|
22022
22060
|
var GOVERNANCE_GROUP_TEMPLATE_PANEL_ID = "governance-group-template-panel";
|
|
22023
22061
|
var GovernanceGroupTemplateView = ({ editor, block }) => {
|
|
22024
22062
|
const panelId = `${GOVERNANCE_GROUP_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
22025
|
-
const panelContent =
|
|
22063
|
+
const panelContent = useMemo78(() => /* @__PURE__ */ React219.createElement(TemplateConfig14, { editor, block }), [editor, block]);
|
|
22026
22064
|
const { open } = usePanel(panelId, panelContent);
|
|
22027
22065
|
return /* @__PURE__ */ React219.createElement(BaseContainer, { blockId: block.id, onClick: open }, /* @__PURE__ */ React219.createElement(Badge36, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React219.createElement(Group76, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React219.createElement(Group76, { wrap: "nowrap", align: "center" }, getIcon("users", block.props.icon), /* @__PURE__ */ React219.createElement(Stack144, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React219.createElement(Text123, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Governance Group"), /* @__PURE__ */ React219.createElement(Text123, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || "Configure the governance group creation flow")))));
|
|
22028
22066
|
};
|
|
22029
22067
|
|
|
22030
22068
|
// src/mantine/blocks/governanceGroup/flow/FlowView.tsx
|
|
22031
|
-
import React221, { useCallback as useCallback67, useEffect as useEffect69, useMemo as
|
|
22069
|
+
import React221, { useCallback as useCallback67, useEffect as useEffect69, useMemo as useMemo80, useRef as useRef20, useState as useState85 } from "react";
|
|
22032
22070
|
import { ActionIcon as ActionIcon28, Badge as Badge37, Group as Group78, Stack as Stack146, Text as Text125, Tooltip as Tooltip18 } from "@mantine/core";
|
|
22033
22071
|
import { IconChevronRight as IconChevronRight11 } from "@tabler/icons-react";
|
|
22034
22072
|
|
|
22035
22073
|
// src/mantine/blocks/governanceGroup/flow/GovernanceGroupPanel.tsx
|
|
22036
|
-
import React220, { useCallback as useCallback66, useEffect as useEffect68, useMemo as
|
|
22074
|
+
import React220, { useCallback as useCallback66, useEffect as useEffect68, useMemo as useMemo79, useRef as useRef19, useState as useState84 } from "react";
|
|
22037
22075
|
import { Alert as Alert31, Button as Button38, Card as Card20, Group as Group77, Loader as Loader30, SimpleGrid as SimpleGrid3, Stack as Stack145, Text as Text124, ThemeIcon as ThemeIcon4 } from "@mantine/core";
|
|
22038
22076
|
import { useDebouncedCallback as useDebouncedCallback3 } from "@mantine/hooks";
|
|
22039
22077
|
import { IconAlertCircle as IconAlertCircle16, IconCheck as IconCheck13, IconUsers as IconUsers5, IconSignature as IconSignature2, IconPhoto as IconPhoto3, IconCoin as IconCoin2, IconArrowLeft as IconArrowLeft5 } from "@tabler/icons-react";
|
|
@@ -22080,7 +22118,7 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22080
22118
|
const [createdGroupAddress, setCreatedGroupAddress] = useState84(block.props.groupAddress || null);
|
|
22081
22119
|
const isUpdatingFromProp = useRef19(false);
|
|
22082
22120
|
const lastSyncedAnswers = useRef19("");
|
|
22083
|
-
const surveyModel =
|
|
22121
|
+
const surveyModel = useMemo79(() => {
|
|
22084
22122
|
if (!selectedGroupType) return null;
|
|
22085
22123
|
const surveySchema = getSurveyForGroupType(selectedGroupType);
|
|
22086
22124
|
if (!surveySchema) return null;
|
|
@@ -22293,7 +22331,7 @@ var GovernanceGroupFlowView = ({ editor, block }) => {
|
|
|
22293
22331
|
editorRef.current = editor;
|
|
22294
22332
|
blockRef.current = block;
|
|
22295
22333
|
});
|
|
22296
|
-
const stableEditor =
|
|
22334
|
+
const stableEditor = useMemo80(
|
|
22297
22335
|
() => new Proxy(editor, {
|
|
22298
22336
|
get(_, prop) {
|
|
22299
22337
|
return editorRef.current[prop];
|
|
@@ -22301,7 +22339,7 @@ var GovernanceGroupFlowView = ({ editor, block }) => {
|
|
|
22301
22339
|
}),
|
|
22302
22340
|
[]
|
|
22303
22341
|
);
|
|
22304
|
-
const stableBlock =
|
|
22342
|
+
const stableBlock = useMemo80(
|
|
22305
22343
|
() => new Proxy(block, {
|
|
22306
22344
|
get(_, prop) {
|
|
22307
22345
|
return blockRef.current[prop];
|
|
@@ -22340,7 +22378,7 @@ var GovernanceGroupFlowView = ({ editor, block }) => {
|
|
|
22340
22378
|
[]
|
|
22341
22379
|
);
|
|
22342
22380
|
const panelId = `${GOVERNANCE_GROUP_FLOW_PANEL_ID}-${block.id}`;
|
|
22343
|
-
const panelContent =
|
|
22381
|
+
const panelContent = useMemo80(
|
|
22344
22382
|
() => /* @__PURE__ */ React221.createElement(GovernanceGroupPanel, { editor: stableEditor, block: stableBlock, onComplete: stableHandleComplete }),
|
|
22345
22383
|
[stableEditor, stableBlock, stableHandleComplete]
|
|
22346
22384
|
);
|
|
@@ -22418,7 +22456,7 @@ import { createReactBlockSpec as createReactBlockSpec19 } from "@blocknote/react
|
|
|
22418
22456
|
import React230 from "react";
|
|
22419
22457
|
|
|
22420
22458
|
// src/mantine/blocks/flowLink/template/TemplateView.tsx
|
|
22421
|
-
import React227, { useMemo as
|
|
22459
|
+
import React227, { useMemo as useMemo82 } from "react";
|
|
22422
22460
|
import { Group as Group80, Stack as Stack149, Text as Text127 } from "@mantine/core";
|
|
22423
22461
|
|
|
22424
22462
|
// src/mantine/blocks/flowLink/template/TemplateConfig.tsx
|
|
@@ -22456,7 +22494,7 @@ var GeneralTab15 = ({ title, description, icon: icon2, onTitleChange, onDescript
|
|
|
22456
22494
|
};
|
|
22457
22495
|
|
|
22458
22496
|
// src/mantine/blocks/flowLink/template/LinksTab.tsx
|
|
22459
|
-
import React225, { useEffect as useEffect70, useMemo as
|
|
22497
|
+
import React225, { useEffect as useEffect70, useMemo as useMemo81, useState as useState86 } from "react";
|
|
22460
22498
|
import { Stack as Stack148, Card as Card21, Group as Group79, ActionIcon as ActionIcon29, Text as Text126, Divider as Divider20 } from "@mantine/core";
|
|
22461
22499
|
import { IconPlus as IconPlus6, IconTrash as IconTrash7, IconGripVertical } from "@tabler/icons-react";
|
|
22462
22500
|
import { DndContext, PointerSensor, useSensor, useSensors, closestCenter, useDraggable, useDroppable } from "@dnd-kit/core";
|
|
@@ -22539,7 +22577,7 @@ var DraggableLinkCard = ({ link, index, onRemove, onUpdate }) => {
|
|
|
22539
22577
|
};
|
|
22540
22578
|
var LinksTab = ({ links, onLinksChange }) => {
|
|
22541
22579
|
const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 8 } }));
|
|
22542
|
-
const sortedLinks =
|
|
22580
|
+
const sortedLinks = useMemo81(() => [...links].sort((a, b) => a.position - b.position), [links]);
|
|
22543
22581
|
const handleAddLink = () => {
|
|
22544
22582
|
const maxPosition = links.length > 0 ? Math.max(...links.map((l) => l.position)) : -1;
|
|
22545
22583
|
const newLink = {
|
|
@@ -22611,7 +22649,7 @@ var TemplateConfig15 = ({ editor, block }) => {
|
|
|
22611
22649
|
var FLOW_LINK_TEMPLATE_PANEL_ID = "flow-link-template-panel";
|
|
22612
22650
|
var FlowLinkTemplateView = ({ editor, block }) => {
|
|
22613
22651
|
const panelId = `${FLOW_LINK_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
22614
|
-
const panelContent =
|
|
22652
|
+
const panelContent = useMemo82(() => /* @__PURE__ */ React227.createElement(TemplateConfig15, { editor, block }), [editor, block]);
|
|
22615
22653
|
const { open } = usePanel(panelId, panelContent);
|
|
22616
22654
|
const links = safeParseJSONArray(block.props.links);
|
|
22617
22655
|
const linksCount = links.length;
|
|
@@ -22619,7 +22657,7 @@ var FlowLinkTemplateView = ({ editor, block }) => {
|
|
|
22619
22657
|
};
|
|
22620
22658
|
|
|
22621
22659
|
// src/mantine/blocks/flowLink/flow/FlowView.tsx
|
|
22622
|
-
import React229, { useMemo as
|
|
22660
|
+
import React229, { useMemo as useMemo83 } from "react";
|
|
22623
22661
|
import { Badge as Badge39, Group as Group82, Stack as Stack151, Text as Text129, Tooltip as Tooltip20 } from "@mantine/core";
|
|
22624
22662
|
|
|
22625
22663
|
// src/mantine/blocks/flowLink/flow/FlowLinkPanel.tsx
|
|
@@ -22705,7 +22743,7 @@ var FlowLinkFlowView = ({ editor, block, isDisabled }) => {
|
|
|
22705
22743
|
const links = safeParseJSONArray(block.props.links);
|
|
22706
22744
|
const linksCount = links.length;
|
|
22707
22745
|
const panelId = `${FLOW_LINK_FLOW_PANEL_ID}-${block.id}`;
|
|
22708
|
-
const panelContent =
|
|
22746
|
+
const panelContent = useMemo83(() => /* @__PURE__ */ React229.createElement(FlowLinkPanel, { editor, block }), [editor, block]);
|
|
22709
22747
|
const { open } = usePanel(panelId, panelContent);
|
|
22710
22748
|
const handleClick = () => {
|
|
22711
22749
|
if (!disabled) {
|
|
@@ -22797,15 +22835,15 @@ import { createReactBlockSpec as createReactBlockSpec20 } from "@blocknote/react
|
|
|
22797
22835
|
import React273 from "react";
|
|
22798
22836
|
|
|
22799
22837
|
// src/mantine/blocks/action/template/TemplateView.tsx
|
|
22800
|
-
import React235, { useMemo as
|
|
22838
|
+
import React235, { useMemo as useMemo86 } from "react";
|
|
22801
22839
|
|
|
22802
22840
|
// src/mantine/blocks/action/template/TemplateConfig.tsx
|
|
22803
|
-
import React234, { useCallback as useCallback69, useMemo as
|
|
22841
|
+
import React234, { useCallback as useCallback69, useMemo as useMemo85 } from "react";
|
|
22804
22842
|
import { Stack as Stack154 } from "@mantine/core";
|
|
22805
22843
|
import { IconCheck as IconCheck15, IconClock as IconClock11, IconContract as IconContract4, IconSettings as IconSettings18, IconShieldCheck as IconShieldCheck13, IconUserCheck as IconUserCheck4 } from "@tabler/icons-react";
|
|
22806
22844
|
|
|
22807
22845
|
// src/mantine/blocks/action/template/GeneralTab.tsx
|
|
22808
|
-
import React233, { useEffect as useEffect72, useMemo as
|
|
22846
|
+
import React233, { useEffect as useEffect72, useMemo as useMemo84, useState as useState88 } from "react";
|
|
22809
22847
|
import { Group as Group84, Stack as Stack153, Text as Text131, Button as Button39, ActionIcon as ActionIcon31, Paper as Paper16 } from "@mantine/core";
|
|
22810
22848
|
import {
|
|
22811
22849
|
IconMail as IconMail6,
|
|
@@ -23037,7 +23075,7 @@ var GeneralTab16 = ({
|
|
|
23037
23075
|
const [localDescription, setLocalDescription] = useState88(description || "");
|
|
23038
23076
|
useEffect72(() => setLocalTitle(title || ""), [title]);
|
|
23039
23077
|
useEffect72(() => setLocalDescription(description || ""), [description]);
|
|
23040
|
-
const actionTypeOptions =
|
|
23078
|
+
const actionTypeOptions = useMemo84(() => {
|
|
23041
23079
|
return getAllActions().map((a) => {
|
|
23042
23080
|
const m = getActionMeta(a.type);
|
|
23043
23081
|
return { value: a.type, label: m.label, description: m.description, icon: m.icon };
|
|
@@ -23115,7 +23153,7 @@ function GenericInputsEditor({ inputs, onInputsChange, editor, blockId }) {
|
|
|
23115
23153
|
// src/mantine/blocks/action/template/TemplateConfig.tsx
|
|
23116
23154
|
var TemplateConfig16 = ({ editor, block }) => {
|
|
23117
23155
|
const { closePanel } = usePanelStore();
|
|
23118
|
-
const isValid =
|
|
23156
|
+
const isValid = useMemo85(() => {
|
|
23119
23157
|
const title = (block.props.title || "").trim();
|
|
23120
23158
|
const actionType = resolveActionType(block.props.actionType || "");
|
|
23121
23159
|
if (!title || !actionType) return false;
|
|
@@ -23221,8 +23259,8 @@ var ActionTemplateView = ({ editor, block }) => {
|
|
|
23221
23259
|
const panelId = `${ACTION_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
23222
23260
|
const assignmentPanelId = `${ACTION_ASSIGNMENT_PANEL_ID}-${block.id}`;
|
|
23223
23261
|
const { closePanel, activePanel } = usePanelStore();
|
|
23224
|
-
const panelContent =
|
|
23225
|
-
const assignmentPanelContent =
|
|
23262
|
+
const panelContent = useMemo86(() => /* @__PURE__ */ React235.createElement(TemplateConfig16, { editor, block }), [editor, block]);
|
|
23263
|
+
const assignmentPanelContent = useMemo86(
|
|
23226
23264
|
() => /* @__PURE__ */ React235.createElement(
|
|
23227
23265
|
BaseRightPanelLayout,
|
|
23228
23266
|
{
|
|
@@ -23236,7 +23274,7 @@ var ActionTemplateView = ({ editor, block }) => {
|
|
|
23236
23274
|
const { open } = usePanel(panelId, panelContent);
|
|
23237
23275
|
const { open: openAssignment } = usePanel(assignmentPanelId, assignmentPanelContent);
|
|
23238
23276
|
const commitmentPanelId = `${ACTION_COMMITMENT_PANEL_ID}-${block.id}`;
|
|
23239
|
-
const commitmentPanelContent =
|
|
23277
|
+
const commitmentPanelContent = useMemo86(
|
|
23240
23278
|
() => /* @__PURE__ */ React235.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Commitment Tab" }, /* @__PURE__ */ React235.createElement(CommitmentTab, { editor, block })),
|
|
23241
23279
|
[editor, block, closePanel]
|
|
23242
23280
|
);
|
|
@@ -23268,7 +23306,7 @@ var ActionTemplateView = ({ editor, block }) => {
|
|
|
23268
23306
|
};
|
|
23269
23307
|
|
|
23270
23308
|
// src/mantine/blocks/action/flow/FlowView.tsx
|
|
23271
|
-
import React238, { useCallback as useCallback71, useMemo as
|
|
23309
|
+
import React238, { useCallback as useCallback71, useMemo as useMemo88, useRef as useRef22, useState as useState91 } from "react";
|
|
23272
23310
|
import { Group as Group87, Stack as Stack157, Text as Text135, Code as Code7, Alert as Alert33, Box as Box46, Divider as Divider21, Button as Button40, Loader as Loader32 } from "@mantine/core";
|
|
23273
23311
|
import { IconAlertTriangle as IconAlertTriangle4, IconUser as IconUser13, IconBolt as IconBolt8, IconShieldCheck as IconShieldCheck14, IconPlayerPlay as IconPlayerPlay2 } from "@tabler/icons-react";
|
|
23274
23312
|
|
|
@@ -23494,14 +23532,14 @@ import React237 from "react";
|
|
|
23494
23532
|
import { Text as Text134 } from "@mantine/core";
|
|
23495
23533
|
|
|
23496
23534
|
// src/mantine/blocks/action/diff/useActionDiff.ts
|
|
23497
|
-
import { useState as useState90, useEffect as useEffect74, useCallback as useCallback70, useMemo as
|
|
23535
|
+
import { useState as useState90, useEffect as useEffect74, useCallback as useCallback70, useMemo as useMemo87 } from "react";
|
|
23498
23536
|
function useActionDiff({ actionType, inputs, actorDid = "", entityDid }) {
|
|
23499
23537
|
const [diffs, setDiffs] = useState90([]);
|
|
23500
23538
|
const [error, setError] = useState90();
|
|
23501
23539
|
const [fetchKey, setFetchKey] = useState90(0);
|
|
23502
23540
|
const handlers = useBlocknoteHandlers();
|
|
23503
23541
|
const hasResolver = hasDiffResolver(actionType);
|
|
23504
|
-
const parsedInputs =
|
|
23542
|
+
const parsedInputs = useMemo87(() => {
|
|
23505
23543
|
if (!inputs) return {};
|
|
23506
23544
|
if (typeof inputs === "object") return inputs;
|
|
23507
23545
|
try {
|
|
@@ -23580,7 +23618,7 @@ var ActionFlowView = ({ editor, block, isDisabled }) => {
|
|
|
23580
23618
|
const statusColor3 = getStatusColor4(runtimeState);
|
|
23581
23619
|
const dueDate = block.props.ttlAbsoluteDueDate;
|
|
23582
23620
|
const dueDateDisplay = dueDate ? formatDate(dueDate) : "";
|
|
23583
|
-
const tabs =
|
|
23621
|
+
const tabs = useMemo88(() => {
|
|
23584
23622
|
const baseTabs = [
|
|
23585
23623
|
{
|
|
23586
23624
|
label: "Execute",
|
|
@@ -23615,13 +23653,13 @@ var ActionFlowView = ({ editor, block, isDisabled }) => {
|
|
|
23615
23653
|
);
|
|
23616
23654
|
return baseTabs;
|
|
23617
23655
|
}, [editor, block, actionType, FlowDetailComponent, disabled, isDisabled?.message]);
|
|
23618
|
-
const panelContent =
|
|
23656
|
+
const panelContent = useMemo88(
|
|
23619
23657
|
() => /* @__PURE__ */ React238.createElement(BaseRightPanelLayout, { onClose: closePanel, title: block.props.title || getActionMeta(actionType).label || "", tabs, context: { editor, block } }),
|
|
23620
23658
|
[tabs, editor, block, closePanel, actionType]
|
|
23621
23659
|
);
|
|
23622
23660
|
const { open } = usePanel(panelId, panelContent);
|
|
23623
23661
|
const commitmentPanelId = `action-flow-commitment-${block.id}`;
|
|
23624
|
-
const commitmentPanelContent =
|
|
23662
|
+
const commitmentPanelContent = useMemo88(
|
|
23625
23663
|
() => /* @__PURE__ */ React238.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Commitment Tab" }, /* @__PURE__ */ React238.createElement(CommitmentTab, { editor, block })),
|
|
23626
23664
|
[editor, block, closePanel]
|
|
23627
23665
|
);
|
|
@@ -23668,7 +23706,7 @@ function ActionPanelContent({
|
|
|
23668
23706
|
const actionTypeUI = actionType ? getActionTypeUI(actionType) : void 0;
|
|
23669
23707
|
const executionMode = actionTypeUI?.executionMode ?? "custom";
|
|
23670
23708
|
const isSlideToSign = executionMode === "slide-to-sign";
|
|
23671
|
-
const mergedInputs =
|
|
23709
|
+
const mergedInputs = useMemo88(() => {
|
|
23672
23710
|
try {
|
|
23673
23711
|
const template = typeof block.props.inputs === "string" ? JSON.parse(block.props.inputs || "{}") : block.props.inputs || {};
|
|
23674
23712
|
return { ...template, ...runtimeInputs };
|
|
@@ -23751,32 +23789,33 @@ function GenericFlowPanel({
|
|
|
23751
23789
|
disabledMessage
|
|
23752
23790
|
}) {
|
|
23753
23791
|
const handlers = useBlocknoteHandlers();
|
|
23754
|
-
const services =
|
|
23755
|
-
const flowNode =
|
|
23756
|
-
const runtimeManager =
|
|
23757
|
-
const ucanService =
|
|
23758
|
-
const invocationStore =
|
|
23759
|
-
const flowId =
|
|
23760
|
-
const flowOwnerDid =
|
|
23761
|
-
const
|
|
23792
|
+
const services = useMemo88(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
23793
|
+
const flowNode = useMemo88(() => buildFlowNodeFromBlock(block), [block]);
|
|
23794
|
+
const runtimeManager = useMemo88(() => createRuntimeStateManager(editor), [editor]);
|
|
23795
|
+
const ucanService = useMemo88(() => editor?.getUcanService?.() || void 0, [editor]);
|
|
23796
|
+
const invocationStore = useMemo88(() => editor?._invocationStore || void 0, [editor]);
|
|
23797
|
+
const flowId = useMemo88(() => editor?.getFlowMetadata?.()?.doc_id || block.id, [editor, block.id]);
|
|
23798
|
+
const flowOwnerDid = useMemo88(() => editor?.getFlowOwnerDid?.() || "", [editor]);
|
|
23799
|
+
const schemaVersion = useMemo88(() => editor?.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
23800
|
+
const flowUri = useMemo88(() => {
|
|
23762
23801
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
23763
23802
|
return `ixo:flow:${docId}`;
|
|
23764
23803
|
}, [editor, block.id]);
|
|
23765
|
-
const actorDid =
|
|
23804
|
+
const actorDid = useMemo88(() => {
|
|
23766
23805
|
try {
|
|
23767
23806
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
23768
23807
|
} catch {
|
|
23769
23808
|
return "";
|
|
23770
23809
|
}
|
|
23771
23810
|
}, [handlers]);
|
|
23772
|
-
const parsedInputs =
|
|
23811
|
+
const parsedInputs = useMemo88(() => {
|
|
23773
23812
|
try {
|
|
23774
23813
|
return typeof inputs === "string" ? JSON.parse(inputs) : inputs || {};
|
|
23775
23814
|
} catch {
|
|
23776
23815
|
return {};
|
|
23777
23816
|
}
|
|
23778
23817
|
}, [inputs]);
|
|
23779
|
-
const outputJson =
|
|
23818
|
+
const outputJson = useMemo88(() => {
|
|
23780
23819
|
if (!runtime.output) return "";
|
|
23781
23820
|
try {
|
|
23782
23821
|
return JSON.stringify(runtime.output, null, 2);
|
|
@@ -23810,7 +23849,8 @@ function GenericFlowPanel({
|
|
|
23810
23849
|
invocationStore,
|
|
23811
23850
|
flowUri,
|
|
23812
23851
|
flowId,
|
|
23813
|
-
flowOwnerDid
|
|
23852
|
+
flowOwnerDid,
|
|
23853
|
+
schemaVersion
|
|
23814
23854
|
},
|
|
23815
23855
|
action: async () => {
|
|
23816
23856
|
const result = await actionDef.run(resolvedInputs, {
|
|
@@ -24026,14 +24066,14 @@ var HttpRequestConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
24026
24066
|
};
|
|
24027
24067
|
|
|
24028
24068
|
// src/mantine/blocks/action/actionTypes/httpRequest/HttpRequestFlowDetail.tsx
|
|
24029
|
-
import React240, { useMemo as
|
|
24069
|
+
import React240, { useMemo as useMemo89, useState as useState93 } from "react";
|
|
24030
24070
|
import { Group as Group89, Stack as Stack159, Text as Text137, ActionIcon as ActionIcon33, Badge as Badge41, Collapse as Collapse9, Code as Code9, Loader as Loader33, Alert as Alert35 } from "@mantine/core";
|
|
24031
24071
|
import { IconSend as IconSend5, IconChevronDown as IconChevronDown9, IconChevronUp as IconChevronUp4, IconAlertTriangle as IconAlertTriangle5 } from "@tabler/icons-react";
|
|
24032
24072
|
var HttpRequestFlowDetail = ({ inputs, editor, runtime, updateRuntime, isDisabled }) => {
|
|
24033
24073
|
const [isLoading, setIsLoading] = useState93(false);
|
|
24034
24074
|
const [showDetails, setShowDetails] = useState93(false);
|
|
24035
24075
|
const [validationWarnings, setValidationWarnings] = useState93([]);
|
|
24036
|
-
const parsed =
|
|
24076
|
+
const parsed = useMemo89(() => parseHttpRequestInputs(inputs), [inputs]);
|
|
24037
24077
|
const { endpoint, method, headers, body, responseSchema } = parsed;
|
|
24038
24078
|
const runtimeState = runtime.state;
|
|
24039
24079
|
const status = runtimeState === "running" ? "loading" : runtimeState === "completed" ? "success" : runtimeState === "failed" ? "error" : "idle";
|
|
@@ -24161,7 +24201,7 @@ registerActionTypeUI("qi/http.request", {
|
|
|
24161
24201
|
});
|
|
24162
24202
|
|
|
24163
24203
|
// src/mantine/blocks/action/actionTypes/emailSend/EmailSendConfig.tsx
|
|
24164
|
-
import React241, { useCallback as useCallback73, useEffect as useEffect76, useRef as useRef23, useState as useState94, useMemo as
|
|
24204
|
+
import React241, { useCallback as useCallback73, useEffect as useEffect76, useRef as useRef23, useState as useState94, useMemo as useMemo90 } from "react";
|
|
24165
24205
|
import { Alert as Alert36, Badge as Badge42, Group as Group90, Loader as Loader34, Stack as Stack160, Text as Text138 } from "@mantine/core";
|
|
24166
24206
|
import { IconCheck as IconCheck16, IconInfoCircle as IconInfoCircle6 } from "@tabler/icons-react";
|
|
24167
24207
|
|
|
@@ -24264,14 +24304,14 @@ var EmailSendConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
24264
24304
|
},
|
|
24265
24305
|
[handlers.getEmailTemplate, update]
|
|
24266
24306
|
);
|
|
24267
|
-
const parsedExtractedVariables =
|
|
24307
|
+
const parsedExtractedVariables = useMemo90(() => {
|
|
24268
24308
|
try {
|
|
24269
24309
|
return JSON.parse(local.extractedVariables || "[]");
|
|
24270
24310
|
} catch {
|
|
24271
24311
|
return [];
|
|
24272
24312
|
}
|
|
24273
24313
|
}, [local.extractedVariables]);
|
|
24274
|
-
const parsedVariableMapping =
|
|
24314
|
+
const parsedVariableMapping = useMemo90(() => {
|
|
24275
24315
|
try {
|
|
24276
24316
|
return JSON.parse(local.variables || "{}");
|
|
24277
24317
|
} catch {
|
|
@@ -24343,7 +24383,7 @@ registerActionTypeUI("qi/email.send", {
|
|
|
24343
24383
|
});
|
|
24344
24384
|
|
|
24345
24385
|
// src/mantine/blocks/action/actionTypes/bid/BidConfig.tsx
|
|
24346
|
-
import React242, { useCallback as useCallback74, useEffect as useEffect77, useMemo as
|
|
24386
|
+
import React242, { useCallback as useCallback74, useEffect as useEffect77, useMemo as useMemo91, useState as useState95 } from "react";
|
|
24347
24387
|
import { Alert as Alert37, Button as Button42, Loader as Loader35, Stack as Stack161, Text as Text139 } from "@mantine/core";
|
|
24348
24388
|
import { IconInfoCircle as IconInfoCircle7 } from "@tabler/icons-react";
|
|
24349
24389
|
|
|
@@ -24412,7 +24452,7 @@ var BidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
24412
24452
|
setLoadingCollections(false);
|
|
24413
24453
|
}
|
|
24414
24454
|
}, [handlers, local, onInputsChange, update]);
|
|
24415
|
-
const collectionOptions =
|
|
24455
|
+
const collectionOptions = useMemo91(
|
|
24416
24456
|
() => collections.map((collection) => ({
|
|
24417
24457
|
value: collection.id,
|
|
24418
24458
|
label: collection.protocol?.profile?.name || collection.name || collection.id
|
|
@@ -24457,7 +24497,7 @@ var BidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
24457
24497
|
};
|
|
24458
24498
|
|
|
24459
24499
|
// src/mantine/blocks/action/actionTypes/bid/BidFlowDetail.tsx
|
|
24460
|
-
import React244, { useCallback as useCallback75, useEffect as useEffect78, useMemo as
|
|
24500
|
+
import React244, { useCallback as useCallback75, useEffect as useEffect78, useMemo as useMemo92, useState as useState96 } from "react";
|
|
24461
24501
|
import { Alert as Alert38, Loader as Loader36, Stack as Stack162, Text as Text140 } from "@mantine/core";
|
|
24462
24502
|
import { IconPlayerPlay as IconPlayerPlay3 } from "@tabler/icons-react";
|
|
24463
24503
|
import { SurveyModel as SurveyModel9 } from "@ixo/surveys";
|
|
@@ -24479,27 +24519,28 @@ var BidFlowDetail = ({
|
|
|
24479
24519
|
registerRuntimeInputs
|
|
24480
24520
|
}) => {
|
|
24481
24521
|
const handlers = useBlocknoteHandlers();
|
|
24482
|
-
const services =
|
|
24483
|
-
const flowNode =
|
|
24484
|
-
const runtimeManager =
|
|
24485
|
-
const ucanService =
|
|
24486
|
-
const invocationStore =
|
|
24487
|
-
const flowId =
|
|
24488
|
-
const flowOwnerDid =
|
|
24489
|
-
const
|
|
24522
|
+
const services = useMemo92(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
24523
|
+
const flowNode = useMemo92(() => buildFlowNodeFromBlock(block), [block]);
|
|
24524
|
+
const runtimeManager = useMemo92(() => createRuntimeStateManager(editor), [editor]);
|
|
24525
|
+
const ucanService = useMemo92(() => editor?.getUcanService?.() || void 0, [editor]);
|
|
24526
|
+
const invocationStore = useMemo92(() => editor?._invocationStore || void 0, [editor]);
|
|
24527
|
+
const flowId = useMemo92(() => editor?.getFlowMetadata?.()?.doc_id || block.id, [editor, block.id]);
|
|
24528
|
+
const flowOwnerDid = useMemo92(() => editor?.getFlowOwnerDid?.() || "", [editor]);
|
|
24529
|
+
const schemaVersion = useMemo92(() => editor?.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
24530
|
+
const flowUri = useMemo92(() => {
|
|
24490
24531
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
24491
24532
|
return `ixo:flow:${docId}`;
|
|
24492
24533
|
}, [editor, block.id]);
|
|
24493
|
-
const actorDid =
|
|
24534
|
+
const actorDid = useMemo92(() => {
|
|
24494
24535
|
try {
|
|
24495
24536
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
24496
24537
|
} catch {
|
|
24497
24538
|
return "";
|
|
24498
24539
|
}
|
|
24499
24540
|
}, [handlers]);
|
|
24500
|
-
const parsed =
|
|
24541
|
+
const parsed = useMemo92(() => parseBidActionInputs(inputs), [inputs]);
|
|
24501
24542
|
const editorDocument = editor?.document || [];
|
|
24502
|
-
const resolveOpts =
|
|
24543
|
+
const resolveOpts = useMemo92(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
24503
24544
|
const deedDid = resolveReferences(parsed.deedDid, editorDocument, resolveOpts).trim();
|
|
24504
24545
|
const collectionId = resolveReferences(parsed.collectionId, editorDocument, resolveOpts).trim();
|
|
24505
24546
|
const [role, setRole] = useState96("service_agent");
|
|
@@ -24511,7 +24552,7 @@ var BidFlowDetail = ({
|
|
|
24511
24552
|
const [userBid, setUserBid] = useState96(null);
|
|
24512
24553
|
const [userRole, setUserRole] = useState96(null);
|
|
24513
24554
|
const [surveyReady, setSurveyReady] = useState96(false);
|
|
24514
|
-
const surveyModel =
|
|
24555
|
+
const surveyModel = useMemo92(() => {
|
|
24515
24556
|
if (!surveyJson) return null;
|
|
24516
24557
|
const model = new SurveyModel9(surveyJson);
|
|
24517
24558
|
model.applyTheme(surveyTheme);
|
|
@@ -24650,7 +24691,8 @@ var BidFlowDetail = ({
|
|
|
24650
24691
|
invocationStore,
|
|
24651
24692
|
flowUri,
|
|
24652
24693
|
flowId,
|
|
24653
|
-
flowOwnerDid
|
|
24694
|
+
flowOwnerDid,
|
|
24695
|
+
schemaVersion
|
|
24654
24696
|
},
|
|
24655
24697
|
action: async () => {
|
|
24656
24698
|
const result = await actionDef.run(
|
|
@@ -24762,7 +24804,7 @@ registerActionTypeUI("qi/bid.submit", {
|
|
|
24762
24804
|
});
|
|
24763
24805
|
|
|
24764
24806
|
// src/mantine/blocks/action/actionTypes/evaluateBid/EvaluateBidConfig.tsx
|
|
24765
|
-
import React245, { useCallback as useCallback76, useEffect as useEffect79, useMemo as
|
|
24807
|
+
import React245, { useCallback as useCallback76, useEffect as useEffect79, useMemo as useMemo93, useState as useState97 } from "react";
|
|
24766
24808
|
import { Alert as Alert39, Button as Button43, Loader as Loader37, Stack as Stack163 } from "@mantine/core";
|
|
24767
24809
|
|
|
24768
24810
|
// src/mantine/blocks/action/actionTypes/evaluateBid/types.ts
|
|
@@ -24830,7 +24872,7 @@ var EvaluateBidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
24830
24872
|
setLoadingCollections(false);
|
|
24831
24873
|
}
|
|
24832
24874
|
}, [handlers, local, onInputsChange, update]);
|
|
24833
|
-
const collectionOptions =
|
|
24875
|
+
const collectionOptions = useMemo93(
|
|
24834
24876
|
() => collections.map((collection) => ({
|
|
24835
24877
|
value: collection.id,
|
|
24836
24878
|
label: collection.protocol?.profile?.name || collection.name || collection.id
|
|
@@ -24875,7 +24917,7 @@ var EvaluateBidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
24875
24917
|
};
|
|
24876
24918
|
|
|
24877
24919
|
// src/mantine/blocks/action/actionTypes/evaluateBid/EvaluateBidFlowDetail.tsx
|
|
24878
|
-
import React247, { useCallback as useCallback77, useEffect as useEffect80, useMemo as
|
|
24920
|
+
import React247, { useCallback as useCallback77, useEffect as useEffect80, useMemo as useMemo94, useState as useState99 } from "react";
|
|
24879
24921
|
import { ActionIcon as ActionIcon34, Alert as Alert40, Badge as Badge43, Box as Box48, Button as Button44, Divider as Divider22, Group as Group92, Loader as Loader38, Stack as Stack164, Text as Text142, UnstyledButton as UnstyledButton4 } from "@mantine/core";
|
|
24880
24922
|
import { IconArrowLeft as IconArrowLeft6, IconCheck as IconCheck17, IconFilter } from "@tabler/icons-react";
|
|
24881
24923
|
|
|
@@ -24965,27 +25007,28 @@ var EvaluateBidFlowDetail = ({
|
|
|
24965
25007
|
registerRuntimeInputs
|
|
24966
25008
|
}) => {
|
|
24967
25009
|
const handlers = useBlocknoteHandlers();
|
|
24968
|
-
const services =
|
|
24969
|
-
const flowNode =
|
|
24970
|
-
const runtimeManager =
|
|
24971
|
-
const ucanService =
|
|
24972
|
-
const invocationStore =
|
|
24973
|
-
const flowId =
|
|
24974
|
-
const flowOwnerDid =
|
|
24975
|
-
const
|
|
25010
|
+
const services = useMemo94(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
25011
|
+
const flowNode = useMemo94(() => buildFlowNodeFromBlock(block), [block]);
|
|
25012
|
+
const runtimeManager = useMemo94(() => createRuntimeStateManager(editor), [editor]);
|
|
25013
|
+
const ucanService = useMemo94(() => editor?.getUcanService?.() || void 0, [editor]);
|
|
25014
|
+
const invocationStore = useMemo94(() => editor?._invocationStore || void 0, [editor]);
|
|
25015
|
+
const flowId = useMemo94(() => editor?.getFlowMetadata?.()?.doc_id || block.id, [editor, block.id]);
|
|
25016
|
+
const flowOwnerDid = useMemo94(() => editor?.getFlowOwnerDid?.() || "", [editor]);
|
|
25017
|
+
const schemaVersion = useMemo94(() => editor?.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
25018
|
+
const flowUri = useMemo94(() => {
|
|
24976
25019
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
24977
25020
|
return `ixo:flow:${docId}`;
|
|
24978
25021
|
}, [editor, block.id]);
|
|
24979
|
-
const actorDid =
|
|
25022
|
+
const actorDid = useMemo94(() => {
|
|
24980
25023
|
try {
|
|
24981
25024
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
24982
25025
|
} catch {
|
|
24983
25026
|
return "";
|
|
24984
25027
|
}
|
|
24985
25028
|
}, [handlers]);
|
|
24986
|
-
const parsed =
|
|
25029
|
+
const parsed = useMemo94(() => parseEvaluateBidActionInputs(inputs), [inputs]);
|
|
24987
25030
|
const editorDocument = editor?.document || [];
|
|
24988
|
-
const resolveOpts =
|
|
25031
|
+
const resolveOpts = useMemo94(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
24989
25032
|
const deedDid = resolveReferences(parsed.deedDid, editorDocument, resolveOpts).trim();
|
|
24990
25033
|
const collectionId = resolveReferences(parsed.collectionId, editorDocument, resolveOpts).trim();
|
|
24991
25034
|
const [bids, setBids] = useState99([]);
|
|
@@ -24999,8 +25042,8 @@ var EvaluateBidFlowDetail = ({
|
|
|
24999
25042
|
const [activeFilter, setActiveFilter] = useState99("pending");
|
|
25000
25043
|
const [paymentRows, setPaymentRows] = useState99([createPaymentRow()]);
|
|
25001
25044
|
const [profilesByDid, setProfilesByDid] = useState99({});
|
|
25002
|
-
const selectedBid =
|
|
25003
|
-
const filteredBids =
|
|
25045
|
+
const selectedBid = useMemo94(() => bids.find((bid) => bid.id === selectedBidId) || null, [bids, selectedBidId]);
|
|
25046
|
+
const filteredBids = useMemo94(() => {
|
|
25004
25047
|
if (activeFilter === "all") return bids;
|
|
25005
25048
|
return bids.filter((bid) => {
|
|
25006
25049
|
const status = getBidStatus(bid).label.toLowerCase();
|
|
@@ -25153,7 +25196,8 @@ var EvaluateBidFlowDetail = ({
|
|
|
25153
25196
|
invocationStore,
|
|
25154
25197
|
flowUri,
|
|
25155
25198
|
flowId,
|
|
25156
|
-
flowOwnerDid
|
|
25199
|
+
flowOwnerDid,
|
|
25200
|
+
schemaVersion
|
|
25157
25201
|
},
|
|
25158
25202
|
action: async () => {
|
|
25159
25203
|
const result = await actionDef.run(
|
|
@@ -25364,7 +25408,7 @@ registerActionTypeUI("qi/bid.evaluate", {
|
|
|
25364
25408
|
});
|
|
25365
25409
|
|
|
25366
25410
|
// src/mantine/blocks/action/actionTypes/claim/ClaimConfig.tsx
|
|
25367
|
-
import React248, { useCallback as useCallback78, useEffect as useEffect81, useMemo as
|
|
25411
|
+
import React248, { useCallback as useCallback78, useEffect as useEffect81, useMemo as useMemo95, useState as useState100 } from "react";
|
|
25368
25412
|
import { Alert as Alert41, Button as Button45, Loader as Loader39, Stack as Stack165 } from "@mantine/core";
|
|
25369
25413
|
|
|
25370
25414
|
// src/mantine/blocks/action/actionTypes/claim/types.ts
|
|
@@ -25432,7 +25476,7 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
25432
25476
|
setLoadingCollections(false);
|
|
25433
25477
|
}
|
|
25434
25478
|
}, [handlers, local, onInputsChange, update]);
|
|
25435
|
-
const collectionOptions =
|
|
25479
|
+
const collectionOptions = useMemo95(
|
|
25436
25480
|
() => collections.map((collection) => ({
|
|
25437
25481
|
value: collection.id,
|
|
25438
25482
|
label: collection.protocol?.profile?.name || collection.name || collection.id
|
|
@@ -25477,7 +25521,7 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
25477
25521
|
};
|
|
25478
25522
|
|
|
25479
25523
|
// src/mantine/blocks/action/actionTypes/claim/ClaimFlowDetail.tsx
|
|
25480
|
-
import React249, { useCallback as useCallback79, useEffect as useEffect82, useMemo as
|
|
25524
|
+
import React249, { useCallback as useCallback79, useEffect as useEffect82, useMemo as useMemo96, useState as useState101 } from "react";
|
|
25481
25525
|
import { Alert as Alert42, Box as Box49, Group as Group93, Loader as Loader40, Stack as Stack166, Text as Text143 } from "@mantine/core";
|
|
25482
25526
|
import { IconCheck as IconCheck18, IconPlayerPlay as IconPlayerPlay4 } from "@tabler/icons-react";
|
|
25483
25527
|
import { SurveyModel as SurveyModel10 } from "@ixo/surveys";
|
|
@@ -25516,27 +25560,28 @@ var ClaimFlowDetail = ({
|
|
|
25516
25560
|
registerRuntimeInputs
|
|
25517
25561
|
}) => {
|
|
25518
25562
|
const handlers = useBlocknoteHandlers();
|
|
25519
|
-
const services =
|
|
25520
|
-
const flowNode =
|
|
25521
|
-
const runtimeManager =
|
|
25522
|
-
const ucanService =
|
|
25523
|
-
const invocationStore =
|
|
25524
|
-
const flowId =
|
|
25525
|
-
const flowOwnerDid =
|
|
25526
|
-
const
|
|
25563
|
+
const services = useMemo96(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
25564
|
+
const flowNode = useMemo96(() => buildFlowNodeFromBlock(block), [block]);
|
|
25565
|
+
const runtimeManager = useMemo96(() => createRuntimeStateManager(editor), [editor]);
|
|
25566
|
+
const ucanService = useMemo96(() => editor?.getUcanService?.() || void 0, [editor]);
|
|
25567
|
+
const invocationStore = useMemo96(() => editor?._invocationStore || void 0, [editor]);
|
|
25568
|
+
const flowId = useMemo96(() => editor?.getFlowMetadata?.()?.doc_id || block.id, [editor, block.id]);
|
|
25569
|
+
const flowOwnerDid = useMemo96(() => editor?.getFlowOwnerDid?.() || "", [editor]);
|
|
25570
|
+
const schemaVersion = useMemo96(() => editor?.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
25571
|
+
const flowUri = useMemo96(() => {
|
|
25527
25572
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
25528
25573
|
return `ixo:flow:${docId}`;
|
|
25529
25574
|
}, [editor, block.id]);
|
|
25530
|
-
const actorDid =
|
|
25575
|
+
const actorDid = useMemo96(() => {
|
|
25531
25576
|
try {
|
|
25532
25577
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
25533
25578
|
} catch {
|
|
25534
25579
|
return "";
|
|
25535
25580
|
}
|
|
25536
25581
|
}, [handlers]);
|
|
25537
|
-
const parsed =
|
|
25582
|
+
const parsed = useMemo96(() => parseClaimActionInputs(inputs), [inputs]);
|
|
25538
25583
|
const editorDocument = editor?.document || [];
|
|
25539
|
-
const resolveOpts =
|
|
25584
|
+
const resolveOpts = useMemo96(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
25540
25585
|
const deedDid = resolveReferences(parsed.deedDid, editorDocument, resolveOpts).trim();
|
|
25541
25586
|
const collectionId = resolveReferences(parsed.collectionId, editorDocument, resolveOpts).trim();
|
|
25542
25587
|
const [claims, setClaims] = useState101([]);
|
|
@@ -25549,7 +25594,7 @@ var ClaimFlowDetail = ({
|
|
|
25549
25594
|
const [profilesByDid, setProfilesByDid] = useState101({});
|
|
25550
25595
|
const [isServiceAgentAuthorized, setIsServiceAgentAuthorized] = useState101(false);
|
|
25551
25596
|
const [authChecking, setAuthChecking] = useState101(true);
|
|
25552
|
-
const surveyModel =
|
|
25597
|
+
const surveyModel = useMemo96(() => {
|
|
25553
25598
|
if (!surveyJson) return null;
|
|
25554
25599
|
const model = new SurveyModel10(surveyJson);
|
|
25555
25600
|
model.applyTheme(surveyTheme);
|
|
@@ -25735,7 +25780,8 @@ var ClaimFlowDetail = ({
|
|
|
25735
25780
|
invocationStore,
|
|
25736
25781
|
flowUri,
|
|
25737
25782
|
flowId,
|
|
25738
|
-
flowOwnerDid
|
|
25783
|
+
flowOwnerDid,
|
|
25784
|
+
schemaVersion
|
|
25739
25785
|
},
|
|
25740
25786
|
action: async () => {
|
|
25741
25787
|
const result = await actionDef.run(
|
|
@@ -25861,7 +25907,7 @@ registerActionTypeUI("qi/claim.submit", {
|
|
|
25861
25907
|
});
|
|
25862
25908
|
|
|
25863
25909
|
// src/mantine/blocks/action/actionTypes/evaluateClaim/EvaluateClaimConfig.tsx
|
|
25864
|
-
import React250, { useCallback as useCallback80, useEffect as useEffect83, useMemo as
|
|
25910
|
+
import React250, { useCallback as useCallback80, useEffect as useEffect83, useMemo as useMemo97, useState as useState102 } from "react";
|
|
25865
25911
|
import { Alert as Alert43, Button as Button46, Loader as Loader41, Stack as Stack167 } from "@mantine/core";
|
|
25866
25912
|
|
|
25867
25913
|
// src/mantine/blocks/action/actionTypes/evaluateClaim/types.ts
|
|
@@ -25929,7 +25975,7 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
25929
25975
|
setLoadingCollections(false);
|
|
25930
25976
|
}
|
|
25931
25977
|
}, [handlers, local, onInputsChange, update]);
|
|
25932
|
-
const collectionOptions =
|
|
25978
|
+
const collectionOptions = useMemo97(
|
|
25933
25979
|
() => collections.map((collection) => ({
|
|
25934
25980
|
value: collection.id,
|
|
25935
25981
|
label: collection.protocol?.profile?.name || collection.name || collection.id
|
|
@@ -25974,7 +26020,7 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
25974
26020
|
};
|
|
25975
26021
|
|
|
25976
26022
|
// src/mantine/blocks/action/actionTypes/evaluateClaim/EvaluateClaimFlowDetail.tsx
|
|
25977
|
-
import React251, { useCallback as useCallback81, useEffect as useEffect84, useMemo as
|
|
26023
|
+
import React251, { useCallback as useCallback81, useEffect as useEffect84, useMemo as useMemo98, useState as useState103 } from "react";
|
|
25978
26024
|
import { ActionIcon as ActionIcon35, Alert as Alert44, Box as Box50, Button as Button47, Checkbox as Checkbox12, Divider as Divider23, Group as Group94, Loader as Loader42, ScrollArea as ScrollArea8, Stack as Stack168, Text as Text144, UnstyledButton as UnstyledButton5 } from "@mantine/core";
|
|
25979
26025
|
import { IconArrowLeft as IconArrowLeft7, IconCheck as IconCheck19, IconFilter as IconFilter2 } from "@tabler/icons-react";
|
|
25980
26026
|
import { SurveyModel as SurveyModel11 } from "@ixo/surveys";
|
|
@@ -26028,27 +26074,28 @@ var EvaluateClaimFlowDetail = ({
|
|
|
26028
26074
|
registerRuntimeInputs
|
|
26029
26075
|
}) => {
|
|
26030
26076
|
const handlers = useBlocknoteHandlers();
|
|
26031
|
-
const services =
|
|
26032
|
-
const flowNode =
|
|
26033
|
-
const runtimeManager =
|
|
26034
|
-
const ucanService =
|
|
26035
|
-
const invocationStore =
|
|
26036
|
-
const flowId =
|
|
26037
|
-
const flowOwnerDid =
|
|
26038
|
-
const
|
|
26077
|
+
const services = useMemo98(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
26078
|
+
const flowNode = useMemo98(() => buildFlowNodeFromBlock(block), [block]);
|
|
26079
|
+
const runtimeManager = useMemo98(() => createRuntimeStateManager(editor), [editor]);
|
|
26080
|
+
const ucanService = useMemo98(() => editor?.getUcanService?.() || void 0, [editor]);
|
|
26081
|
+
const invocationStore = useMemo98(() => editor?._invocationStore || void 0, [editor]);
|
|
26082
|
+
const flowId = useMemo98(() => editor?.getFlowMetadata?.()?.doc_id || block.id, [editor, block.id]);
|
|
26083
|
+
const flowOwnerDid = useMemo98(() => editor?.getFlowOwnerDid?.() || "", [editor]);
|
|
26084
|
+
const schemaVersion = useMemo98(() => editor?.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
26085
|
+
const flowUri = useMemo98(() => {
|
|
26039
26086
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
26040
26087
|
return `ixo:flow:${docId}`;
|
|
26041
26088
|
}, [editor, block.id]);
|
|
26042
|
-
const actorDid =
|
|
26089
|
+
const actorDid = useMemo98(() => {
|
|
26043
26090
|
try {
|
|
26044
26091
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
26045
26092
|
} catch {
|
|
26046
26093
|
return "";
|
|
26047
26094
|
}
|
|
26048
26095
|
}, [handlers]);
|
|
26049
|
-
const parsed =
|
|
26096
|
+
const parsed = useMemo98(() => parseEvaluateClaimActionInputs(inputs), [inputs]);
|
|
26050
26097
|
const editorDocument = editor?.document || [];
|
|
26051
|
-
const resolveOpts =
|
|
26098
|
+
const resolveOpts = useMemo98(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
26052
26099
|
const deedDid = resolveReferences(parsed.deedDid, editorDocument, resolveOpts).trim();
|
|
26053
26100
|
const collectionId = resolveReferences(parsed.collectionId, editorDocument, resolveOpts).trim();
|
|
26054
26101
|
const [claims, setClaims] = useState103([]);
|
|
@@ -26073,15 +26120,15 @@ var EvaluateClaimFlowDetail = ({
|
|
|
26073
26120
|
const [isEvaluatorAuthorized, setIsEvaluatorAuthorized] = useState103(false);
|
|
26074
26121
|
const [authChecking, setAuthChecking] = useState103(true);
|
|
26075
26122
|
const [profilesByDid, setProfilesByDid] = useState103({});
|
|
26076
|
-
const selectedClaim =
|
|
26077
|
-
const filteredClaims =
|
|
26123
|
+
const selectedClaim = useMemo98(() => claims.find((claim) => claim.claimId === selectedClaimId) || null, [claims, selectedClaimId]);
|
|
26124
|
+
const filteredClaims = useMemo98(() => {
|
|
26078
26125
|
if (activeFilter === "all") return claims;
|
|
26079
26126
|
return claims.filter((claim) => {
|
|
26080
26127
|
const status = getClaimStatusInfo(claim).key;
|
|
26081
26128
|
return status === activeFilter;
|
|
26082
26129
|
});
|
|
26083
26130
|
}, [claims, activeFilter]);
|
|
26084
|
-
const surveyModel =
|
|
26131
|
+
const surveyModel = useMemo98(() => {
|
|
26085
26132
|
if (!surveyJson || !claimData) return null;
|
|
26086
26133
|
const model = new SurveyModel11(surveyJson);
|
|
26087
26134
|
model.applyTheme(surveyTheme);
|
|
@@ -26091,7 +26138,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
26091
26138
|
model.data = claimData;
|
|
26092
26139
|
return model;
|
|
26093
26140
|
}, [surveyJson, claimData]);
|
|
26094
|
-
const outcomeSurveyModel =
|
|
26141
|
+
const outcomeSurveyModel = useMemo98(() => {
|
|
26095
26142
|
if (!outcomeTemplateJson) return null;
|
|
26096
26143
|
const model = new SurveyModel11(outcomeTemplateJson);
|
|
26097
26144
|
model.applyTheme(surveyTheme2);
|
|
@@ -26289,7 +26336,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
26289
26336
|
setOutcomeComplete(false);
|
|
26290
26337
|
loadClaimDetail(selectedClaim);
|
|
26291
26338
|
}, [selectedClaim, loadClaimDetail]);
|
|
26292
|
-
const isClaimAlreadyEvaluated =
|
|
26339
|
+
const isClaimAlreadyEvaluated = useMemo98(() => {
|
|
26293
26340
|
if (!selectedClaim) return false;
|
|
26294
26341
|
return isClaimEvaluated(selectedClaim);
|
|
26295
26342
|
}, [selectedClaim]);
|
|
@@ -26360,7 +26407,8 @@ var EvaluateClaimFlowDetail = ({
|
|
|
26360
26407
|
invocationStore,
|
|
26361
26408
|
flowUri,
|
|
26362
26409
|
flowId,
|
|
26363
|
-
flowOwnerDid
|
|
26410
|
+
flowOwnerDid,
|
|
26411
|
+
schemaVersion
|
|
26364
26412
|
},
|
|
26365
26413
|
action: async () => {
|
|
26366
26414
|
const result = await actionDef.run(
|
|
@@ -26725,7 +26773,7 @@ var ProposalCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
26725
26773
|
};
|
|
26726
26774
|
|
|
26727
26775
|
// src/mantine/blocks/action/actionTypes/proposalCreate/ProposalCreateFlowDetail.tsx
|
|
26728
|
-
import React253, { useCallback as useCallback83, useEffect as useEffect86, useMemo as
|
|
26776
|
+
import React253, { useCallback as useCallback83, useEffect as useEffect86, useMemo as useMemo99, useState as useState105 } from "react";
|
|
26729
26777
|
import { Alert as Alert45, Badge as Badge44, Button as Button48, Card as Card23, Group as Group95, Loader as Loader44, Stack as Stack170, Text as Text146 } from "@mantine/core";
|
|
26730
26778
|
import { IconPlus as IconPlus9, IconPlayerPlay as IconPlayerPlay5 } from "@tabler/icons-react";
|
|
26731
26779
|
var CHAIN_STATUSES2 = ["open", "passed", "rejected", "executed", "closed", "execution_failed", "veto_timelock"];
|
|
@@ -26745,27 +26793,28 @@ var statusColor2 = {
|
|
|
26745
26793
|
};
|
|
26746
26794
|
var ProposalCreateFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
26747
26795
|
const handlers = useBlocknoteHandlers();
|
|
26748
|
-
const services =
|
|
26749
|
-
const flowNode =
|
|
26750
|
-
const runtimeManager =
|
|
26751
|
-
const ucanService =
|
|
26752
|
-
const invocationStore =
|
|
26753
|
-
const flowId =
|
|
26754
|
-
const flowOwnerDid =
|
|
26755
|
-
const
|
|
26796
|
+
const services = useMemo99(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
26797
|
+
const flowNode = useMemo99(() => buildFlowNodeFromBlock(block), [block]);
|
|
26798
|
+
const runtimeManager = useMemo99(() => createRuntimeStateManager(editor), [editor]);
|
|
26799
|
+
const ucanService = useMemo99(() => editor?.getUcanService?.() || void 0, [editor]);
|
|
26800
|
+
const invocationStore = useMemo99(() => editor?._invocationStore || void 0, [editor]);
|
|
26801
|
+
const flowId = useMemo99(() => editor?.getFlowMetadata?.()?.doc_id || block.id, [editor, block.id]);
|
|
26802
|
+
const flowOwnerDid = useMemo99(() => editor?.getFlowOwnerDid?.() || "", [editor]);
|
|
26803
|
+
const schemaVersion = useMemo99(() => editor?.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
26804
|
+
const flowUri = useMemo99(() => {
|
|
26756
26805
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
26757
26806
|
return `ixo:flow:${docId}`;
|
|
26758
26807
|
}, [editor, block.id]);
|
|
26759
|
-
const actorDid =
|
|
26808
|
+
const actorDid = useMemo99(() => {
|
|
26760
26809
|
try {
|
|
26761
26810
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
26762
26811
|
} catch {
|
|
26763
26812
|
return "";
|
|
26764
26813
|
}
|
|
26765
26814
|
}, [handlers]);
|
|
26766
|
-
const parsed =
|
|
26815
|
+
const parsed = useMemo99(() => parseProposalCreateInputs(inputs), [inputs]);
|
|
26767
26816
|
const editorDocument = editor?.document || [];
|
|
26768
|
-
const resolveOpts =
|
|
26817
|
+
const resolveOpts = useMemo99(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
26769
26818
|
const coreAddress = resolveReferences(parsed.coreAddress, editorDocument, resolveOpts).trim();
|
|
26770
26819
|
const proposalTitle = resolveReferences(parsed.proposalTitle, editorDocument, resolveOpts).trim();
|
|
26771
26820
|
const proposalDescription = resolveReferences(parsed.proposalDescription, editorDocument, resolveOpts).trim();
|
|
@@ -26859,7 +26908,8 @@ var ProposalCreateFlowDetail = ({ inputs, editor, block, runtime, updateRuntime,
|
|
|
26859
26908
|
invocationStore,
|
|
26860
26909
|
flowUri,
|
|
26861
26910
|
flowId,
|
|
26862
|
-
flowOwnerDid
|
|
26911
|
+
flowOwnerDid,
|
|
26912
|
+
schemaVersion
|
|
26863
26913
|
},
|
|
26864
26914
|
action: async () => {
|
|
26865
26915
|
const result = await actionDef.run(
|
|
@@ -27133,7 +27183,7 @@ var ProposalVoteConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
27133
27183
|
};
|
|
27134
27184
|
|
|
27135
27185
|
// src/mantine/blocks/action/actionTypes/proposalVote/ProposalVoteFlowDetail.tsx
|
|
27136
|
-
import React255, { useCallback as useCallback85, useEffect as useEffect88, useMemo as
|
|
27186
|
+
import React255, { useCallback as useCallback85, useEffect as useEffect88, useMemo as useMemo100, useState as useState107 } from "react";
|
|
27137
27187
|
import { Alert as Alert46, Box as Box51, Button as Button49, Card as Card24, Group as Group96, Progress as Progress4, Stack as Stack172, Text as Text148, Tooltip as Tooltip21 } from "@mantine/core";
|
|
27138
27188
|
var getVoteIcon2 = (voteType) => {
|
|
27139
27189
|
switch (voteType) {
|
|
@@ -27150,27 +27200,28 @@ var getVoteIcon2 = (voteType) => {
|
|
|
27150
27200
|
};
|
|
27151
27201
|
var ProposalVoteFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
27152
27202
|
const handlers = useBlocknoteHandlers();
|
|
27153
|
-
const services =
|
|
27154
|
-
const flowNode =
|
|
27155
|
-
const runtimeManager =
|
|
27156
|
-
const ucanService =
|
|
27157
|
-
const invocationStore =
|
|
27158
|
-
const flowId =
|
|
27159
|
-
const flowOwnerDid =
|
|
27160
|
-
const
|
|
27203
|
+
const services = useMemo100(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
27204
|
+
const flowNode = useMemo100(() => buildFlowNodeFromBlock(block), [block]);
|
|
27205
|
+
const runtimeManager = useMemo100(() => createRuntimeStateManager(editor), [editor]);
|
|
27206
|
+
const ucanService = useMemo100(() => editor?.getUcanService?.() || void 0, [editor]);
|
|
27207
|
+
const invocationStore = useMemo100(() => editor?._invocationStore || void 0, [editor]);
|
|
27208
|
+
const flowId = useMemo100(() => editor?.getFlowMetadata?.()?.doc_id || block.id, [editor, block.id]);
|
|
27209
|
+
const flowOwnerDid = useMemo100(() => editor?.getFlowOwnerDid?.() || "", [editor]);
|
|
27210
|
+
const schemaVersion = useMemo100(() => editor?.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
27211
|
+
const flowUri = useMemo100(() => {
|
|
27161
27212
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
27162
27213
|
return `ixo:flow:${docId}`;
|
|
27163
27214
|
}, [editor, block.id]);
|
|
27164
|
-
const actorDid =
|
|
27215
|
+
const actorDid = useMemo100(() => {
|
|
27165
27216
|
try {
|
|
27166
27217
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
27167
27218
|
} catch {
|
|
27168
27219
|
return "";
|
|
27169
27220
|
}
|
|
27170
27221
|
}, [handlers]);
|
|
27171
|
-
const parsed =
|
|
27222
|
+
const parsed = useMemo100(() => parseProposalVoteInputs(inputs), [inputs]);
|
|
27172
27223
|
const editorDocument = editor?.document || [];
|
|
27173
|
-
const resolveOpts =
|
|
27224
|
+
const resolveOpts = useMemo100(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
27174
27225
|
const proposalId = resolveReferences(parsed.proposalId, editorDocument, resolveOpts).trim();
|
|
27175
27226
|
const coreAddress = resolveReferences(parsed.coreAddress, editorDocument, resolveOpts).trim();
|
|
27176
27227
|
const inputContractAddress = resolveReferences(parsed.proposalContractAddress, editorDocument, resolveOpts).trim();
|
|
@@ -27245,7 +27296,8 @@ var ProposalVoteFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, i
|
|
|
27245
27296
|
invocationStore,
|
|
27246
27297
|
flowUri,
|
|
27247
27298
|
flowId,
|
|
27248
|
-
flowOwnerDid
|
|
27299
|
+
flowOwnerDid,
|
|
27300
|
+
schemaVersion
|
|
27249
27301
|
},
|
|
27250
27302
|
action: async () => {
|
|
27251
27303
|
const result = await actionDef.run(
|
|
@@ -27466,7 +27518,7 @@ registerActionTypeUI("qi/proposal.vote", {
|
|
|
27466
27518
|
});
|
|
27467
27519
|
|
|
27468
27520
|
// src/mantine/blocks/action/actionTypes/protocolSelect/ProtocolSelectConfig.tsx
|
|
27469
|
-
import React256, { useMemo as
|
|
27521
|
+
import React256, { useMemo as useMemo101, useState as useState108 } from "react";
|
|
27470
27522
|
import { Box as Box52, Pill as Pill3, PillsInput as PillsInput3, Stack as Stack173, Text as Text149 } from "@mantine/core";
|
|
27471
27523
|
function parseInputs(json) {
|
|
27472
27524
|
try {
|
|
@@ -27479,7 +27531,7 @@ function parseInputs(json) {
|
|
|
27479
27531
|
}
|
|
27480
27532
|
}
|
|
27481
27533
|
var ProtocolSelectConfig = ({ inputs, onInputsChange }) => {
|
|
27482
|
-
const local =
|
|
27534
|
+
const local = useMemo101(() => parseInputs(inputs), [inputs]);
|
|
27483
27535
|
const [inputValue, setInputValue] = useState108("");
|
|
27484
27536
|
const update = (dids) => {
|
|
27485
27537
|
onInputsChange(JSON.stringify({ ...local, protocolDids: dids }));
|
|
@@ -27511,7 +27563,7 @@ var ProtocolSelectConfig = ({ inputs, onInputsChange }) => {
|
|
|
27511
27563
|
};
|
|
27512
27564
|
|
|
27513
27565
|
// src/mantine/blocks/action/actionTypes/protocolSelect/ProtocolSelectFlowDetail.tsx
|
|
27514
|
-
import React257, { useCallback as useCallback86, useEffect as useEffect89, useMemo as
|
|
27566
|
+
import React257, { useCallback as useCallback86, useEffect as useEffect89, useMemo as useMemo102, useState as useState109 } from "react";
|
|
27515
27567
|
import { Box as Box53, Group as Group97, Loader as Loader46, Stack as Stack174, Text as Text150 } from "@mantine/core";
|
|
27516
27568
|
function parseInputs2(json) {
|
|
27517
27569
|
try {
|
|
@@ -27525,7 +27577,7 @@ function parseInputs2(json) {
|
|
|
27525
27577
|
}
|
|
27526
27578
|
var ProtocolSelectFlowDetail = ({ inputs, block, runtime, updateRuntime, isDisabled }) => {
|
|
27527
27579
|
const handlers = useBlocknoteHandlers();
|
|
27528
|
-
const { protocolDids } =
|
|
27580
|
+
const { protocolDids } = useMemo102(() => parseInputs2(inputs), [inputs]);
|
|
27529
27581
|
const [protocols, setProtocols] = useState109([]);
|
|
27530
27582
|
const selectedDid = runtime.output?.selectedProtocolDid;
|
|
27531
27583
|
useEffect89(() => {
|
|
@@ -27695,7 +27747,7 @@ var DomainSignConfig = ({ inputs, onInputsChange }) => {
|
|
|
27695
27747
|
};
|
|
27696
27748
|
|
|
27697
27749
|
// src/mantine/blocks/action/actionTypes/domainSign/DomainSignFlowDetail.tsx
|
|
27698
|
-
import React259, { useCallback as useCallback88, useMemo as
|
|
27750
|
+
import React259, { useCallback as useCallback88, useMemo as useMemo103, useState as useState111 } from "react";
|
|
27699
27751
|
import { Alert as Alert47, Button as Button50, Group as Group98, Loader as Loader47, Stack as Stack176, Text as Text152 } from "@mantine/core";
|
|
27700
27752
|
import { IconCheck as IconCheck20, IconAlertCircle as IconAlertCircle17, IconExternalLink as IconExternalLink2 } from "@tabler/icons-react";
|
|
27701
27753
|
var STEP_LABELS = {
|
|
@@ -27705,29 +27757,30 @@ var STEP_LABELS = {
|
|
|
27705
27757
|
};
|
|
27706
27758
|
var DomainSignFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
27707
27759
|
const handlers = useBlocknoteHandlers();
|
|
27708
|
-
const services =
|
|
27709
|
-
const flowNode =
|
|
27710
|
-
const runtimeManager =
|
|
27711
|
-
const ucanService =
|
|
27712
|
-
const invocationStore =
|
|
27713
|
-
const flowId =
|
|
27714
|
-
const flowOwnerDid =
|
|
27715
|
-
const
|
|
27760
|
+
const services = useMemo103(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
27761
|
+
const flowNode = useMemo103(() => buildFlowNodeFromBlock(block), [block]);
|
|
27762
|
+
const runtimeManager = useMemo103(() => createRuntimeStateManager(editor), [editor]);
|
|
27763
|
+
const ucanService = useMemo103(() => editor?.getUcanService?.() || void 0, [editor]);
|
|
27764
|
+
const invocationStore = useMemo103(() => editor?._invocationStore || void 0, [editor]);
|
|
27765
|
+
const flowId = useMemo103(() => editor?.getFlowMetadata?.()?.doc_id || block.id, [editor, block.id]);
|
|
27766
|
+
const flowOwnerDid = useMemo103(() => editor?.getFlowOwnerDid?.() || "", [editor]);
|
|
27767
|
+
const schemaVersion = useMemo103(() => editor?.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
27768
|
+
const flowUri = useMemo103(() => {
|
|
27716
27769
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
27717
27770
|
return `ixo:flow:${docId}`;
|
|
27718
27771
|
}, [editor, block.id]);
|
|
27719
|
-
const actorDid =
|
|
27772
|
+
const actorDid = useMemo103(() => {
|
|
27720
27773
|
try {
|
|
27721
27774
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
27722
27775
|
} catch {
|
|
27723
27776
|
return "";
|
|
27724
27777
|
}
|
|
27725
27778
|
}, [handlers]);
|
|
27726
|
-
const parsed =
|
|
27779
|
+
const parsed = useMemo103(() => parseDomainSignInputs(inputs), [inputs]);
|
|
27727
27780
|
const editorDocument = editor?.document || [];
|
|
27728
|
-
const resolveOpts =
|
|
27781
|
+
const resolveOpts = useMemo103(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
27729
27782
|
const entityType = resolveReferences(parsed.entityType, editorDocument, resolveOpts).trim();
|
|
27730
|
-
const domainCardData =
|
|
27783
|
+
const domainCardData = useMemo103(() => {
|
|
27731
27784
|
try {
|
|
27732
27785
|
const raw = runtime.output?.domainCardData || block.props?.domainCardData;
|
|
27733
27786
|
if (!raw) return null;
|
|
@@ -27774,7 +27827,8 @@ var DomainSignFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
27774
27827
|
invocationStore,
|
|
27775
27828
|
flowUri,
|
|
27776
27829
|
flowId,
|
|
27777
|
-
flowOwnerDid
|
|
27830
|
+
flowOwnerDid,
|
|
27831
|
+
schemaVersion
|
|
27778
27832
|
},
|
|
27779
27833
|
action: async () => {
|
|
27780
27834
|
const wrappedHandlers = handlers ? {
|
|
@@ -27945,39 +27999,40 @@ var DomainCreateConfig = ({ inputs, onInputsChange }) => {
|
|
|
27945
27999
|
};
|
|
27946
28000
|
|
|
27947
28001
|
// src/mantine/blocks/action/actionTypes/domainCreate/DomainCreateFlowDetail.tsx
|
|
27948
|
-
import React261, { useCallback as useCallback90, useEffect as useEffect92, useMemo as
|
|
28002
|
+
import React261, { useCallback as useCallback90, useEffect as useEffect92, useMemo as useMemo104, useState as useState113 } from "react";
|
|
27949
28003
|
import { Alert as Alert48, Button as Button51, Group as Group99, Loader as Loader48, Stack as Stack178, Text as Text154 } from "@mantine/core";
|
|
27950
28004
|
import { IconCheck as IconCheck21, IconAlertCircle as IconAlertCircle18, IconPlayerPlay as IconPlayerPlay6 } from "@tabler/icons-react";
|
|
27951
28005
|
import { SurveyModel as SurveyModel12 } from "@ixo/surveys";
|
|
27952
28006
|
var DomainCreateFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
27953
28007
|
const handlers = useBlocknoteHandlers();
|
|
27954
|
-
const services =
|
|
27955
|
-
const flowNode =
|
|
27956
|
-
const runtimeManager =
|
|
27957
|
-
const ucanService =
|
|
27958
|
-
const invocationStore =
|
|
27959
|
-
const flowId =
|
|
27960
|
-
const flowOwnerDid =
|
|
27961
|
-
const
|
|
28008
|
+
const services = useMemo104(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
28009
|
+
const flowNode = useMemo104(() => buildFlowNodeFromBlock(block), [block]);
|
|
28010
|
+
const runtimeManager = useMemo104(() => createRuntimeStateManager(editor), [editor]);
|
|
28011
|
+
const ucanService = useMemo104(() => editor?.getUcanService?.() || void 0, [editor]);
|
|
28012
|
+
const invocationStore = useMemo104(() => editor?._invocationStore || void 0, [editor]);
|
|
28013
|
+
const flowId = useMemo104(() => editor?.getFlowMetadata?.()?.doc_id || block.id, [editor, block.id]);
|
|
28014
|
+
const flowOwnerDid = useMemo104(() => editor?.getFlowOwnerDid?.() || "", [editor]);
|
|
28015
|
+
const schemaVersion = useMemo104(() => editor?.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
28016
|
+
const flowUri = useMemo104(() => {
|
|
27962
28017
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
27963
28018
|
return `ixo:flow:${docId}`;
|
|
27964
28019
|
}, [editor, block.id]);
|
|
27965
|
-
const actorDid =
|
|
28020
|
+
const actorDid = useMemo104(() => {
|
|
27966
28021
|
try {
|
|
27967
28022
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
27968
28023
|
} catch {
|
|
27969
28024
|
return "";
|
|
27970
28025
|
}
|
|
27971
28026
|
}, [handlers]);
|
|
27972
|
-
const parsed =
|
|
28027
|
+
const parsed = useMemo104(() => parseDomainCreateInputs(inputs), [inputs]);
|
|
27973
28028
|
const editorDocument = editor?.document || [];
|
|
27974
|
-
const resolveOpts =
|
|
28029
|
+
const resolveOpts = useMemo104(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
27975
28030
|
const entityType = resolveReferences(parsed.entityType, editorDocument, resolveOpts).trim() || "dao";
|
|
27976
28031
|
const initialStep = runtime.output?.entityDid ? "success" : "idle";
|
|
27977
28032
|
const [flowStep, setFlowStep] = useState113(initialStep);
|
|
27978
28033
|
const [error, setError] = useState113(null);
|
|
27979
28034
|
const surveySchema = parsed.surveySchema || tempDomainCreatorSurvey;
|
|
27980
|
-
const surveyModel =
|
|
28035
|
+
const surveyModel = useMemo104(() => {
|
|
27981
28036
|
const model = new SurveyModel12(surveySchema);
|
|
27982
28037
|
model.applyTheme(surveyTheme);
|
|
27983
28038
|
model.showQuestionNumbers = "off";
|
|
@@ -28005,7 +28060,8 @@ var DomainCreateFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, i
|
|
|
28005
28060
|
invocationStore,
|
|
28006
28061
|
flowUri,
|
|
28007
28062
|
flowId,
|
|
28008
|
-
flowOwnerDid
|
|
28063
|
+
flowOwnerDid,
|
|
28064
|
+
schemaVersion
|
|
28009
28065
|
},
|
|
28010
28066
|
action: async () => {
|
|
28011
28067
|
const result = await actionDef.run(
|
|
@@ -28138,14 +28194,14 @@ var OracleConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28138
28194
|
};
|
|
28139
28195
|
|
|
28140
28196
|
// src/mantine/blocks/action/actionTypes/oracle/OracleFlowDetail.tsx
|
|
28141
|
-
import React263, { useCallback as useCallback92, useMemo as
|
|
28197
|
+
import React263, { useCallback as useCallback92, useMemo as useMemo105, useState as useState115 } from "react";
|
|
28142
28198
|
import { Alert as Alert49, Button as Button52, Stack as Stack180 } from "@mantine/core";
|
|
28143
28199
|
import { IconCheck as IconCheck22, IconAlertCircle as IconAlertCircle19, IconSparkles as IconSparkles6 } from "@tabler/icons-react";
|
|
28144
28200
|
var OracleFlowDetail = ({ inputs, editor, runtime, updateRuntime, isDisabled }) => {
|
|
28145
28201
|
const handlers = useBlocknoteHandlers();
|
|
28146
|
-
const parsed =
|
|
28202
|
+
const parsed = useMemo105(() => parseOracleInputs(inputs), [inputs]);
|
|
28147
28203
|
const editorDocument = editor?.document || [];
|
|
28148
|
-
const resolveOpts =
|
|
28204
|
+
const resolveOpts = useMemo105(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
28149
28205
|
const resolvedPrompt = resolveReferences(parsed.prompt, editorDocument, resolveOpts).trim();
|
|
28150
28206
|
const [isLoading, setIsLoading] = useState115(false);
|
|
28151
28207
|
const [error, setError] = useState115(null);
|
|
@@ -28236,7 +28292,7 @@ var OraclePromptConfig = ({ inputs, onInputsChange }) => {
|
|
|
28236
28292
|
};
|
|
28237
28293
|
|
|
28238
28294
|
// src/mantine/blocks/action/actionTypes/oraclePrompt/OraclePromptFlowDetail.tsx
|
|
28239
|
-
import React265, { useCallback as useCallback94, useMemo as
|
|
28295
|
+
import React265, { useCallback as useCallback94, useMemo as useMemo106, useState as useState117 } from "react";
|
|
28240
28296
|
import { Alert as Alert50, Loader as Loader49, Stack as Stack182, Text as Text155 } from "@mantine/core";
|
|
28241
28297
|
import { IconSend as IconSend6 } from "@tabler/icons-react";
|
|
28242
28298
|
function parsePrimarySkill(rawSkill) {
|
|
@@ -28276,10 +28332,10 @@ function buildFinalPrompt(prompt, skill) {
|
|
|
28276
28332
|
}
|
|
28277
28333
|
var OraclePromptFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
28278
28334
|
const handlers = useBlocknoteHandlers();
|
|
28279
|
-
const parsed =
|
|
28335
|
+
const parsed = useMemo106(() => parseOraclePromptInputs(inputs), [inputs]);
|
|
28280
28336
|
const editorDocument = editor?.document || [];
|
|
28281
|
-
const resolveOpts =
|
|
28282
|
-
const resolvedPrompt =
|
|
28337
|
+
const resolveOpts = useMemo106(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
28338
|
+
const resolvedPrompt = useMemo106(() => resolveReferences(parsed.prompt || "", editorDocument, resolveOpts).trim(), [parsed.prompt, editorDocument, resolveOpts]);
|
|
28283
28339
|
const [submitting, setSubmitting] = useState117(false);
|
|
28284
28340
|
const [error, setError] = useState117(null);
|
|
28285
28341
|
const handleExecute = useCallback94(async () => {
|
|
@@ -28394,7 +28450,7 @@ var FormSubmitConfig = ({ inputs, onInputsChange }) => {
|
|
|
28394
28450
|
};
|
|
28395
28451
|
|
|
28396
28452
|
// src/mantine/blocks/action/actionTypes/formSubmit/FormSubmitFlowDetail.tsx
|
|
28397
|
-
import React267, { useCallback as useCallback96, useEffect as useEffect96, useMemo as
|
|
28453
|
+
import React267, { useCallback as useCallback96, useEffect as useEffect96, useMemo as useMemo107, useState as useState119 } from "react";
|
|
28398
28454
|
import { Alert as Alert51, Loader as Loader50, Stack as Stack184, Text as Text157 } from "@mantine/core";
|
|
28399
28455
|
import { SurveyModel as SurveyModel13 } from "@ixo/surveys";
|
|
28400
28456
|
function parsePrimarySkill2(rawSkill) {
|
|
@@ -28443,31 +28499,32 @@ ${answersJson}`
|
|
|
28443
28499
|
}
|
|
28444
28500
|
var FormSubmitFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
28445
28501
|
const handlers = useBlocknoteHandlers();
|
|
28446
|
-
const services =
|
|
28447
|
-
const flowNode =
|
|
28448
|
-
const runtimeManager =
|
|
28449
|
-
const ucanService =
|
|
28450
|
-
const invocationStore =
|
|
28451
|
-
const flowId =
|
|
28452
|
-
const flowOwnerDid =
|
|
28453
|
-
const
|
|
28502
|
+
const services = useMemo107(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
28503
|
+
const flowNode = useMemo107(() => buildFlowNodeFromBlock(block), [block]);
|
|
28504
|
+
const runtimeManager = useMemo107(() => createRuntimeStateManager(editor), [editor]);
|
|
28505
|
+
const ucanService = useMemo107(() => editor?.getUcanService?.() || void 0, [editor]);
|
|
28506
|
+
const invocationStore = useMemo107(() => editor?._invocationStore || void 0, [editor]);
|
|
28507
|
+
const flowId = useMemo107(() => editor?.getFlowMetadata?.()?.doc_id || block.id, [editor, block.id]);
|
|
28508
|
+
const flowOwnerDid = useMemo107(() => editor?.getFlowOwnerDid?.() || "", [editor]);
|
|
28509
|
+
const schemaVersion = useMemo107(() => editor?.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
28510
|
+
const flowUri = useMemo107(() => {
|
|
28454
28511
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
28455
28512
|
return `ixo:flow:${docId}`;
|
|
28456
28513
|
}, [editor, block.id]);
|
|
28457
|
-
const actorDid =
|
|
28514
|
+
const actorDid = useMemo107(() => {
|
|
28458
28515
|
try {
|
|
28459
28516
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
28460
28517
|
} catch {
|
|
28461
28518
|
return "";
|
|
28462
28519
|
}
|
|
28463
28520
|
}, [handlers]);
|
|
28464
|
-
const parsed =
|
|
28521
|
+
const parsed = useMemo107(() => parseFormSubmitActionInputs(inputs), [inputs]);
|
|
28465
28522
|
const editorDocument = editor?.document || [];
|
|
28466
|
-
const resolveOpts =
|
|
28467
|
-
const resolvedSchemaString =
|
|
28523
|
+
const resolveOpts = useMemo107(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
28524
|
+
const resolvedSchemaString = useMemo107(() => resolveReferences(parsed.surveySchema || "", editorDocument, resolveOpts).trim(), [parsed.surveySchema, editorDocument, resolveOpts]);
|
|
28468
28525
|
const [submitting, setSubmitting] = useState119(false);
|
|
28469
28526
|
const [error, setError] = useState119(null);
|
|
28470
|
-
const parsedSchema =
|
|
28527
|
+
const parsedSchema = useMemo107(() => {
|
|
28471
28528
|
if (!resolvedSchemaString) return null;
|
|
28472
28529
|
try {
|
|
28473
28530
|
const schema = JSON.parse(resolvedSchemaString);
|
|
@@ -28479,7 +28536,7 @@ var FormSubmitFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
28479
28536
|
}, [resolvedSchemaString]);
|
|
28480
28537
|
const isCompleted = runtime.state === "completed";
|
|
28481
28538
|
const savedAnswers = isCompleted && runtime.output?.answers && typeof runtime.output.answers === "object" ? runtime.output.answers : null;
|
|
28482
|
-
const surveyModel =
|
|
28539
|
+
const surveyModel = useMemo107(() => {
|
|
28483
28540
|
if (!parsedSchema) return null;
|
|
28484
28541
|
const model = new SurveyModel13(parsedSchema);
|
|
28485
28542
|
model.applyTheme(surveyTheme);
|
|
@@ -28531,7 +28588,8 @@ var FormSubmitFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
28531
28588
|
invocationStore,
|
|
28532
28589
|
flowUri,
|
|
28533
28590
|
flowId,
|
|
28534
|
-
flowOwnerDid
|
|
28591
|
+
flowOwnerDid,
|
|
28592
|
+
schemaVersion
|
|
28535
28593
|
},
|
|
28536
28594
|
action: async () => {
|
|
28537
28595
|
const result = await actionDef.run(
|
|
@@ -28677,7 +28735,7 @@ var CredentialStoreConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28677
28735
|
};
|
|
28678
28736
|
|
|
28679
28737
|
// src/mantine/blocks/action/actionTypes/credentialStore/CredentialStoreFlowDetail.tsx
|
|
28680
|
-
import React269, { useCallback as useCallback98, useMemo as
|
|
28738
|
+
import React269, { useCallback as useCallback98, useMemo as useMemo108, useState as useState121 } from "react";
|
|
28681
28739
|
import { Alert as Alert52, Button as Button53, Code as Code10, Loader as Loader51, Stack as Stack186, Text as Text159 } from "@mantine/core";
|
|
28682
28740
|
import { IconShieldCheck as IconShieldCheck15 } from "@tabler/icons-react";
|
|
28683
28741
|
function safeParse(value) {
|
|
@@ -28693,7 +28751,7 @@ function safeParse(value) {
|
|
|
28693
28751
|
return result;
|
|
28694
28752
|
}
|
|
28695
28753
|
function CredentialPreview({ value }) {
|
|
28696
|
-
const display =
|
|
28754
|
+
const display = useMemo108(() => {
|
|
28697
28755
|
if (!value) return null;
|
|
28698
28756
|
const parsed = safeParse(value);
|
|
28699
28757
|
if (parsed && typeof parsed === "object") {
|
|
@@ -28706,33 +28764,34 @@ function CredentialPreview({ value }) {
|
|
|
28706
28764
|
}
|
|
28707
28765
|
var CredentialStoreFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
28708
28766
|
const handlers = useBlocknoteHandlers();
|
|
28709
|
-
const services =
|
|
28710
|
-
const flowNode =
|
|
28711
|
-
const runtimeManager =
|
|
28712
|
-
const ucanService =
|
|
28713
|
-
const invocationStore =
|
|
28714
|
-
const flowId =
|
|
28715
|
-
const flowOwnerDid =
|
|
28716
|
-
const
|
|
28767
|
+
const services = useMemo108(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
28768
|
+
const flowNode = useMemo108(() => buildFlowNodeFromBlock(block), [block]);
|
|
28769
|
+
const runtimeManager = useMemo108(() => createRuntimeStateManager(editor), [editor]);
|
|
28770
|
+
const ucanService = useMemo108(() => editor?.getUcanService?.() || void 0, [editor]);
|
|
28771
|
+
const invocationStore = useMemo108(() => editor?._invocationStore || void 0, [editor]);
|
|
28772
|
+
const flowId = useMemo108(() => editor?.getFlowMetadata?.()?.doc_id || block.id, [editor, block.id]);
|
|
28773
|
+
const flowOwnerDid = useMemo108(() => editor?.getFlowOwnerDid?.() || "", [editor]);
|
|
28774
|
+
const schemaVersion = useMemo108(() => editor?.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
28775
|
+
const flowUri = useMemo108(() => {
|
|
28717
28776
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
28718
28777
|
return `ixo:flow:${docId}`;
|
|
28719
28778
|
}, [editor, block.id]);
|
|
28720
|
-
const actorDid =
|
|
28779
|
+
const actorDid = useMemo108(() => {
|
|
28721
28780
|
try {
|
|
28722
28781
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
28723
28782
|
} catch {
|
|
28724
28783
|
return "";
|
|
28725
28784
|
}
|
|
28726
28785
|
}, [handlers]);
|
|
28727
|
-
const parsed =
|
|
28786
|
+
const parsed = useMemo108(() => parseCredentialStoreInputs(inputs), [inputs]);
|
|
28728
28787
|
const editorDocument = editor?.document || [];
|
|
28729
|
-
const resolveOpts =
|
|
28730
|
-
const resolvedCredentialKey =
|
|
28788
|
+
const resolveOpts = useMemo108(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
28789
|
+
const resolvedCredentialKey = useMemo108(
|
|
28731
28790
|
() => resolveReferences(parsed.credentialKey || "", editorDocument, resolveOpts).trim(),
|
|
28732
28791
|
[parsed.credentialKey, editorDocument, resolveOpts]
|
|
28733
28792
|
);
|
|
28734
|
-
const resolvedCredential =
|
|
28735
|
-
const resolvedRoomId =
|
|
28793
|
+
const resolvedCredential = useMemo108(() => resolveReferences(parsed.credential || "", editorDocument, resolveOpts).trim(), [parsed.credential, editorDocument, resolveOpts]);
|
|
28794
|
+
const resolvedRoomId = useMemo108(() => resolveReferences(parsed.roomId || "", editorDocument, resolveOpts).trim(), [parsed.roomId, editorDocument, resolveOpts]);
|
|
28736
28795
|
const [submitting, setSubmitting] = useState121(false);
|
|
28737
28796
|
const [error, setError] = useState121(null);
|
|
28738
28797
|
const hasCredential = !!resolvedCredential;
|
|
@@ -28759,7 +28818,8 @@ var CredentialStoreFlowDetail = ({ inputs, editor, block, runtime, updateRuntime
|
|
|
28759
28818
|
invocationStore,
|
|
28760
28819
|
flowUri,
|
|
28761
28820
|
flowId,
|
|
28762
|
-
flowOwnerDid
|
|
28821
|
+
flowOwnerDid,
|
|
28822
|
+
schemaVersion
|
|
28763
28823
|
},
|
|
28764
28824
|
action: async () => {
|
|
28765
28825
|
const result = await actionDef.run(
|
|
@@ -28907,7 +28967,7 @@ var PaymentConfig = ({ inputs, onInputsChange }) => {
|
|
|
28907
28967
|
};
|
|
28908
28968
|
|
|
28909
28969
|
// src/mantine/blocks/action/actionTypes/payment/PaymentFlowDetail.tsx
|
|
28910
|
-
import React271, { useCallback as useCallback100, useMemo as
|
|
28970
|
+
import React271, { useCallback as useCallback100, useMemo as useMemo109, useState as useState123 } from "react";
|
|
28911
28971
|
import { Alert as Alert53, Button as Button54, Code as Code11, Divider as Divider27, Group as Group100, Loader as Loader52, Stack as Stack188, Text as Text161 } from "@mantine/core";
|
|
28912
28972
|
import { IconAlertTriangle as IconAlertTriangle6, IconCash as IconCash2, IconSearch as IconSearch6, IconSend as IconSend7 } from "@tabler/icons-react";
|
|
28913
28973
|
function parsePrimarySkill3(rawSkill) {
|
|
@@ -28983,31 +29043,32 @@ function getPaymentStatusColor(status) {
|
|
|
28983
29043
|
}
|
|
28984
29044
|
var PaymentFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
28985
29045
|
const handlers = useBlocknoteHandlers();
|
|
28986
|
-
const services =
|
|
28987
|
-
const flowNode =
|
|
28988
|
-
const runtimeManager =
|
|
28989
|
-
const ucanService =
|
|
28990
|
-
const invocationStore =
|
|
28991
|
-
const flowId =
|
|
28992
|
-
const flowOwnerDid =
|
|
28993
|
-
const
|
|
29046
|
+
const services = useMemo109(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
29047
|
+
const flowNode = useMemo109(() => buildFlowNodeFromBlock(block), [block]);
|
|
29048
|
+
const runtimeManager = useMemo109(() => createRuntimeStateManager(editor), [editor]);
|
|
29049
|
+
const ucanService = useMemo109(() => editor?.getUcanService?.() || void 0, [editor]);
|
|
29050
|
+
const invocationStore = useMemo109(() => editor?._invocationStore || void 0, [editor]);
|
|
29051
|
+
const flowId = useMemo109(() => editor?.getFlowMetadata?.()?.doc_id || block.id, [editor, block.id]);
|
|
29052
|
+
const flowOwnerDid = useMemo109(() => editor?.getFlowOwnerDid?.() || "", [editor]);
|
|
29053
|
+
const schemaVersion = useMemo109(() => editor?.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
29054
|
+
const flowUri = useMemo109(() => {
|
|
28994
29055
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
28995
29056
|
return `ixo:flow:${docId}`;
|
|
28996
29057
|
}, [editor, block.id]);
|
|
28997
|
-
const actorDid =
|
|
29058
|
+
const actorDid = useMemo109(() => {
|
|
28998
29059
|
try {
|
|
28999
29060
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
29000
29061
|
} catch {
|
|
29001
29062
|
return "";
|
|
29002
29063
|
}
|
|
29003
29064
|
}, [handlers]);
|
|
29004
|
-
const parsed =
|
|
29065
|
+
const parsed = useMemo109(() => parsePaymentInputs(inputs), [inputs]);
|
|
29005
29066
|
const [submitting, setSubmitting] = useState123(false);
|
|
29006
29067
|
const [error, setError] = useState123(null);
|
|
29007
29068
|
const paymentStatus = block.props.paymentStatus || "";
|
|
29008
29069
|
const transactionId = block.props.transactionId || "";
|
|
29009
29070
|
const paymentError = block.props.paymentError || "";
|
|
29010
|
-
const proposal =
|
|
29071
|
+
const proposal = useMemo109(() => {
|
|
29011
29072
|
const raw = block.props.paymentProposal;
|
|
29012
29073
|
if (!raw) return null;
|
|
29013
29074
|
try {
|
|
@@ -29016,7 +29077,7 @@ var PaymentFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisa
|
|
|
29016
29077
|
return null;
|
|
29017
29078
|
}
|
|
29018
29079
|
}, [block.props.paymentProposal]);
|
|
29019
|
-
const summary =
|
|
29080
|
+
const summary = useMemo109(() => {
|
|
29020
29081
|
const raw = block.props.paymentSummary;
|
|
29021
29082
|
if (!raw) return null;
|
|
29022
29083
|
try {
|
|
@@ -29025,7 +29086,7 @@ var PaymentFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisa
|
|
|
29025
29086
|
return null;
|
|
29026
29087
|
}
|
|
29027
29088
|
}, [block.props.paymentSummary]);
|
|
29028
|
-
const paymentConfig =
|
|
29089
|
+
const paymentConfig = useMemo109(() => {
|
|
29029
29090
|
if (!parsed.paymentConfig) return null;
|
|
29030
29091
|
try {
|
|
29031
29092
|
return JSON.parse(parsed.paymentConfig);
|
|
@@ -29092,7 +29153,8 @@ var PaymentFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisa
|
|
|
29092
29153
|
invocationStore,
|
|
29093
29154
|
flowUri,
|
|
29094
29155
|
flowId,
|
|
29095
|
-
flowOwnerDid
|
|
29156
|
+
flowOwnerDid,
|
|
29157
|
+
schemaVersion
|
|
29096
29158
|
},
|
|
29097
29159
|
action: async () => {
|
|
29098
29160
|
const result = await actionDef.run(
|
|
@@ -29225,7 +29287,7 @@ registerActionTypeUI("qi/payment.execute", {
|
|
|
29225
29287
|
});
|
|
29226
29288
|
|
|
29227
29289
|
// src/mantine/blocks/action/actionTypes/matrixDm/MatrixDmConfig.tsx
|
|
29228
|
-
import React272, { useCallback as useCallback101, useEffect as useEffect99, useMemo as
|
|
29290
|
+
import React272, { useCallback as useCallback101, useEffect as useEffect99, useMemo as useMemo110, useState as useState124 } from "react";
|
|
29229
29291
|
import { Flex as Flex34, Stack as Stack189, Text as Text162 } from "@mantine/core";
|
|
29230
29292
|
|
|
29231
29293
|
// src/mantine/blocks/action/actionTypes/matrixDm/types.ts
|
|
@@ -29277,13 +29339,13 @@ var MatrixDmConfig = ({ inputs, onInputsChange, editor }) => {
|
|
|
29277
29339
|
},
|
|
29278
29340
|
[local, onInputsChange]
|
|
29279
29341
|
);
|
|
29280
|
-
const selectData =
|
|
29342
|
+
const selectData = useMemo110(() => {
|
|
29281
29343
|
return roomMembers.map((member) => ({
|
|
29282
29344
|
value: member.did,
|
|
29283
29345
|
label: member.name || member.did
|
|
29284
29346
|
}));
|
|
29285
29347
|
}, [roomMembers]);
|
|
29286
|
-
const memberLookup =
|
|
29348
|
+
const memberLookup = useMemo110(() => {
|
|
29287
29349
|
const lookup = {};
|
|
29288
29350
|
roomMembers.forEach((member) => {
|
|
29289
29351
|
lookup[member.did] = member;
|
|
@@ -29434,7 +29496,7 @@ import { createReactBlockSpec as createReactBlockSpec21 } from "@blocknote/react
|
|
|
29434
29496
|
import React282 from "react";
|
|
29435
29497
|
|
|
29436
29498
|
// src/mantine/blocks/location/template/TemplateView.tsx
|
|
29437
|
-
import React279, { useMemo as
|
|
29499
|
+
import React279, { useMemo as useMemo111 } from "react";
|
|
29438
29500
|
import { Group as Group102, Stack as Stack191, Text as Text165 } from "@mantine/core";
|
|
29439
29501
|
import { IconMapPin } from "@tabler/icons-react";
|
|
29440
29502
|
|
|
@@ -29862,14 +29924,14 @@ function LocationMap(props) {
|
|
|
29862
29924
|
var LOCATION_TEMPLATE_PANEL_ID = "location-template-panel";
|
|
29863
29925
|
var LocationTemplateView = ({ editor, block }) => {
|
|
29864
29926
|
const panelId = `${LOCATION_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
29865
|
-
const panelContent =
|
|
29927
|
+
const panelContent = useMemo111(() => /* @__PURE__ */ React279.createElement(TemplateConfig17, { editor, block }), [editor, block]);
|
|
29866
29928
|
const { open } = usePanel(panelId, panelContent);
|
|
29867
29929
|
const hasLocation = block.props.latitude && block.props.longitude;
|
|
29868
29930
|
return /* @__PURE__ */ React279.createElement(BaseContainer, { blockId: block.id, onClick: open, style: { minHeight: 90, justifyContent: "center" } }, /* @__PURE__ */ React279.createElement(Stack191, { gap: "xs", justify: "center" }, /* @__PURE__ */ React279.createElement(Group102, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React279.createElement(IconMapPin, { color: "white", size: 26, stroke: 1.5 }), /* @__PURE__ */ React279.createElement(Stack191, { gap: 2 }, /* @__PURE__ */ React279.createElement(Text165, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Location"), block.props.description && /* @__PURE__ */ React279.createElement(Text165, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description))), hasLocation && /* @__PURE__ */ React279.createElement(LocationMap, { latitude: block.props.latitude, longitude: block.props.longitude, mapId: `location-template-map-${block.id}`, zoom: 14, showMarker: true, showTilesControl: true })));
|
|
29869
29931
|
};
|
|
29870
29932
|
|
|
29871
29933
|
// src/mantine/blocks/location/flow/FlowView.tsx
|
|
29872
|
-
import React281, { useMemo as
|
|
29934
|
+
import React281, { useMemo as useMemo112 } from "react";
|
|
29873
29935
|
import { Center as Center13, Group as Group103, Stack as Stack192, Text as Text166 } from "@mantine/core";
|
|
29874
29936
|
import { IconMapPin as IconMapPin2 } from "@tabler/icons-react";
|
|
29875
29937
|
|
|
@@ -29885,7 +29947,7 @@ var FlowConfig3 = ({ block }) => {
|
|
|
29885
29947
|
var LOCATION_FLOW_PANEL_ID = "location-flow-panel";
|
|
29886
29948
|
var LocationFlowView = ({ editor, block }) => {
|
|
29887
29949
|
const panelId = `${LOCATION_FLOW_PANEL_ID}-${block.id}`;
|
|
29888
|
-
const panelContent =
|
|
29950
|
+
const panelContent = useMemo112(() => /* @__PURE__ */ React281.createElement(FlowConfig3, { editor, block }), [editor, block]);
|
|
29889
29951
|
const { open } = usePanel(panelId, panelContent);
|
|
29890
29952
|
const hasLocation = block.props.latitude && block.props.longitude;
|
|
29891
29953
|
return /* @__PURE__ */ React281.createElement(BaseContainer, { blockId: block.id, onClick: open, style: { minHeight: 90, justifyContent: "center" } }, /* @__PURE__ */ React281.createElement(Stack192, { gap: "xs", justify: "center" }, /* @__PURE__ */ React281.createElement(Group103, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React281.createElement(IconMapPin2, { color: "white", size: 26, stroke: 1.5 }), /* @__PURE__ */ React281.createElement(Stack192, { gap: 2 }, /* @__PURE__ */ React281.createElement(Text166, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Location"), block.props.description && /* @__PURE__ */ React281.createElement(Text166, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description))), hasLocation ? /* @__PURE__ */ React281.createElement(LocationMap, { latitude: block.props.latitude, longitude: block.props.longitude, mapId: `location-flow-map-${block.id}`, zoom: 14, showMarker: true, showTilesControl: true }) : /* @__PURE__ */ React281.createElement(Center13, { py: "md" }, /* @__PURE__ */ React281.createElement(Text166, { size: "sm", c: "dimmed" }, "Location not configured"))));
|
|
@@ -29929,7 +29991,7 @@ import { createReactBlockSpec as createReactBlockSpec22 } from "@blocknote/react
|
|
|
29929
29991
|
import React289 from "react";
|
|
29930
29992
|
|
|
29931
29993
|
// src/mantine/blocks/embed/template/TemplateView.tsx
|
|
29932
|
-
import React286, { useMemo as
|
|
29994
|
+
import React286, { useMemo as useMemo113 } from "react";
|
|
29933
29995
|
import { Box as Box56, Group as Group104, Stack as Stack194, Text as Text168 } from "@mantine/core";
|
|
29934
29996
|
|
|
29935
29997
|
// src/mantine/blocks/embed/template/TemplateConfig.tsx
|
|
@@ -30046,7 +30108,7 @@ function sanitizeEmbedUrl(raw) {
|
|
|
30046
30108
|
var EMBED_TEMPLATE_PANEL_ID = "embed-template-panel";
|
|
30047
30109
|
var EmbedTemplateView = ({ editor, block }) => {
|
|
30048
30110
|
const panelId = `${EMBED_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
30049
|
-
const panelContent =
|
|
30111
|
+
const panelContent = useMemo113(() => /* @__PURE__ */ React286.createElement(TemplateConfig18, { editor, block }), [editor, block]);
|
|
30050
30112
|
const { open } = usePanel(panelId, panelContent);
|
|
30051
30113
|
const safeUrl = sanitizeEmbedUrl(block.props.url);
|
|
30052
30114
|
const height = Number(block.props.height) || 400;
|
|
@@ -30067,7 +30129,7 @@ var EmbedTemplateView = ({ editor, block }) => {
|
|
|
30067
30129
|
};
|
|
30068
30130
|
|
|
30069
30131
|
// src/mantine/blocks/embed/flow/FlowView.tsx
|
|
30070
|
-
import React288, { useMemo as
|
|
30132
|
+
import React288, { useMemo as useMemo114 } from "react";
|
|
30071
30133
|
import { Box as Box57, Group as Group105, Stack as Stack195, Text as Text169 } from "@mantine/core";
|
|
30072
30134
|
|
|
30073
30135
|
// src/mantine/blocks/embed/flow/FlowConfig.tsx
|
|
@@ -30112,7 +30174,7 @@ var FlowConfig4 = ({ editor, block }) => {
|
|
|
30112
30174
|
var EMBED_FLOW_PANEL_ID = "embed-flow-panel";
|
|
30113
30175
|
var EmbedFlowView = ({ editor, block }) => {
|
|
30114
30176
|
const panelId = `${EMBED_FLOW_PANEL_ID}-${block.id}`;
|
|
30115
|
-
const panelContent =
|
|
30177
|
+
const panelContent = useMemo114(() => /* @__PURE__ */ React288.createElement(FlowConfig4, { editor, block }), [editor, block]);
|
|
30116
30178
|
const { open } = usePanel(panelId, panelContent);
|
|
30117
30179
|
const safeUrl = sanitizeEmbedUrl(block.props.url);
|
|
30118
30180
|
const height = Number(block.props.height) || 400;
|
|
@@ -30379,10 +30441,10 @@ blockRegistry.register({
|
|
|
30379
30441
|
});
|
|
30380
30442
|
|
|
30381
30443
|
// src/mantine/blocks/hooks/useBlockDependencies.ts
|
|
30382
|
-
import { useMemo as
|
|
30444
|
+
import { useMemo as useMemo115, useEffect as useEffect104, useState as useState130, useCallback as useCallback106 } from "react";
|
|
30383
30445
|
|
|
30384
30446
|
// src/mantine/blocks/hooks/useDependsOn.ts
|
|
30385
|
-
import { useMemo as
|
|
30447
|
+
import { useMemo as useMemo116 } from "react";
|
|
30386
30448
|
|
|
30387
30449
|
// src/mantine/blocks/index.ts
|
|
30388
30450
|
var blockSpecs = {
|
|
@@ -30877,7 +30939,7 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
|
30877
30939
|
import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
|
|
30878
30940
|
|
|
30879
30941
|
// src/core/hooks/useMatrixProvider.ts
|
|
30880
|
-
import { useEffect as useEffect105, useState as useState131, useRef as useRef26, useCallback as useCallback107, useMemo as
|
|
30942
|
+
import { useEffect as useEffect105, useState as useState131, useRef as useRef26, useCallback as useCallback107, useMemo as useMemo117 } from "react";
|
|
30881
30943
|
import { MatrixProvider } from "@ixo/matrix-crdt";
|
|
30882
30944
|
function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
30883
30945
|
const [matrixProvider, setProvider] = useState131(null);
|
|
@@ -30885,7 +30947,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
30885
30947
|
const isMountedRef = useRef26(true);
|
|
30886
30948
|
const providerRef = useRef26(null);
|
|
30887
30949
|
const retryTimeoutRef = useRef26(null);
|
|
30888
|
-
const providerOptions =
|
|
30950
|
+
const providerOptions = useMemo117(
|
|
30889
30951
|
() => ({
|
|
30890
30952
|
translator: {
|
|
30891
30953
|
updateEventType: "matrix-crdt.doc_update",
|
|
@@ -30972,17 +31034,17 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
30972
31034
|
}
|
|
30973
31035
|
|
|
30974
31036
|
// src/mantine/hooks/useCollaborativeYDoc.ts
|
|
30975
|
-
import { useMemo as
|
|
31037
|
+
import { useMemo as useMemo118 } from "react";
|
|
30976
31038
|
import * as Y from "yjs";
|
|
30977
31039
|
function useCollaborativeYDoc(_options) {
|
|
30978
|
-
return
|
|
31040
|
+
return useMemo118(() => {
|
|
30979
31041
|
const doc = new Y.Doc();
|
|
30980
31042
|
return doc;
|
|
30981
31043
|
}, []);
|
|
30982
31044
|
}
|
|
30983
31045
|
|
|
30984
31046
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
30985
|
-
import { useMemo as
|
|
31047
|
+
import { useMemo as useMemo119, useEffect as useEffect107, useState as useState132, useRef as useRef28 } from "react";
|
|
30986
31048
|
|
|
30987
31049
|
// src/core/lib/matrixMetadata.ts
|
|
30988
31050
|
var COVER_IMAGE_EVENT_TYPE = "ixo.page.cover_image";
|
|
@@ -31508,7 +31570,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31508
31570
|
matrixClient,
|
|
31509
31571
|
permissions = { write: false }
|
|
31510
31572
|
} = options || {};
|
|
31511
|
-
const memoizedUser =
|
|
31573
|
+
const memoizedUser = useMemo119(
|
|
31512
31574
|
() => ({
|
|
31513
31575
|
id: user?.id || "",
|
|
31514
31576
|
name: user?.name || "",
|
|
@@ -31524,13 +31586,13 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31524
31586
|
matrixClient,
|
|
31525
31587
|
roomId: options.roomId
|
|
31526
31588
|
});
|
|
31527
|
-
const metadataManager =
|
|
31589
|
+
const metadataManager = useMemo119(() => new MatrixMetadataManager(matrixClient, options.roomId), [matrixClient, options.roomId]);
|
|
31528
31590
|
useEffect107(() => {
|
|
31529
31591
|
return () => {
|
|
31530
31592
|
metadataManager.dispose();
|
|
31531
31593
|
};
|
|
31532
31594
|
}, [metadataManager]);
|
|
31533
|
-
const defaultUploadFile =
|
|
31595
|
+
const defaultUploadFile = useMemo119(
|
|
31534
31596
|
() => uploadFile || (async (file) => {
|
|
31535
31597
|
return new Promise((resolve, reject) => {
|
|
31536
31598
|
const reader = new FileReader();
|
|
@@ -31544,7 +31606,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31544
31606
|
}),
|
|
31545
31607
|
[uploadFile]
|
|
31546
31608
|
);
|
|
31547
|
-
const schema =
|
|
31609
|
+
const schema = useMemo119(
|
|
31548
31610
|
() => BlockNoteSchema2.create({
|
|
31549
31611
|
blockSpecs: {
|
|
31550
31612
|
...defaultBlockSpecs2,
|
|
@@ -31559,14 +31621,14 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31559
31621
|
}),
|
|
31560
31622
|
[]
|
|
31561
31623
|
);
|
|
31562
|
-
const root =
|
|
31563
|
-
const documentFragment =
|
|
31564
|
-
const flowArray =
|
|
31565
|
-
const runtimeMap =
|
|
31566
|
-
const delegationsMap =
|
|
31567
|
-
const invocationsMap =
|
|
31568
|
-
const migrationMap =
|
|
31569
|
-
const ucanDelegationStore =
|
|
31624
|
+
const root = useMemo119(() => yDoc.getMap("root"), [yDoc]);
|
|
31625
|
+
const documentFragment = useMemo119(() => yDoc.getXmlFragment("document"), [yDoc]);
|
|
31626
|
+
const flowArray = useMemo119(() => yDoc.getArray("flow"), [yDoc]);
|
|
31627
|
+
const runtimeMap = useMemo119(() => yDoc.getMap("runtime"), [yDoc]);
|
|
31628
|
+
const delegationsMap = useMemo119(() => yDoc.getMap("delegations"), [yDoc]);
|
|
31629
|
+
const invocationsMap = useMemo119(() => yDoc.getMap("invocations"), [yDoc]);
|
|
31630
|
+
const migrationMap = useMemo119(() => yDoc.getMap("migration"), [yDoc]);
|
|
31631
|
+
const ucanDelegationStore = useMemo119(() => {
|
|
31570
31632
|
const store = createUcanDelegationStore(delegationsMap);
|
|
31571
31633
|
const originalSet = store.set;
|
|
31572
31634
|
store.set = (delegation) => {
|
|
@@ -31575,7 +31637,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31575
31637
|
};
|
|
31576
31638
|
return store;
|
|
31577
31639
|
}, [delegationsMap, matrixClient, options.roomId]);
|
|
31578
|
-
const invocationStore =
|
|
31640
|
+
const invocationStore = useMemo119(() => {
|
|
31579
31641
|
const store = createInvocationStore(invocationsMap);
|
|
31580
31642
|
const originalAdd = store.add;
|
|
31581
31643
|
store.add = (invocation) => {
|
|
@@ -31584,8 +31646,8 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31584
31646
|
};
|
|
31585
31647
|
return store;
|
|
31586
31648
|
}, [invocationsMap, matrixClient, options.roomId]);
|
|
31587
|
-
const userFragment =
|
|
31588
|
-
const collaborationConfig =
|
|
31649
|
+
const userFragment = useMemo119(() => yDoc.getMap(memoizedUser.id), [yDoc, memoizedUser.id]);
|
|
31650
|
+
const collaborationConfig = useMemo119(
|
|
31589
31651
|
() => ({
|
|
31590
31652
|
provider: matrixProvider,
|
|
31591
31653
|
fragment: documentFragment,
|
|
@@ -31597,7 +31659,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31597
31659
|
}),
|
|
31598
31660
|
[matrixProvider, documentFragment, memoizedUser.name, memoizedUser.color]
|
|
31599
31661
|
);
|
|
31600
|
-
const ixoConfig =
|
|
31662
|
+
const ixoConfig = useMemo119(
|
|
31601
31663
|
() => ({
|
|
31602
31664
|
theme,
|
|
31603
31665
|
editable,
|
|
@@ -31617,7 +31679,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31617
31679
|
collaboration: collaborationConfig,
|
|
31618
31680
|
pasteHandler: ixoPasteHandler
|
|
31619
31681
|
});
|
|
31620
|
-
const titleText =
|
|
31682
|
+
const titleText = useMemo119(() => yDoc.getText("title"), [yDoc]);
|
|
31621
31683
|
let ixoEditor;
|
|
31622
31684
|
if (editor) {
|
|
31623
31685
|
ixoEditor = editor;
|
|
@@ -31954,7 +32016,7 @@ function PanelContent({ theme }) {
|
|
|
31954
32016
|
}
|
|
31955
32017
|
|
|
31956
32018
|
// src/mantine/components/CoverImage.tsx
|
|
31957
|
-
import React296, { useState as useState136, useRef as useRef29, useEffect as useEffect110, useMemo as
|
|
32019
|
+
import React296, { useState as useState136, useRef as useRef29, useEffect as useEffect110, useMemo as useMemo122 } from "react";
|
|
31958
32020
|
import { Box as Box62, Group as Group109 } from "@mantine/core";
|
|
31959
32021
|
import { IconMoodSmile, IconPhoto as IconPhoto4, IconSettings as IconSettings22, IconArrowsMove, IconTrash as IconTrash11, IconRefresh as IconRefresh5 } from "@tabler/icons-react";
|
|
31960
32022
|
|
|
@@ -32134,7 +32196,7 @@ var CoverImageButton = forwardRef(function CoverImageButton2({ isActive = false,
|
|
|
32134
32196
|
});
|
|
32135
32197
|
|
|
32136
32198
|
// src/mantine/components/Base/BaseIconPicker.tsx
|
|
32137
|
-
import React293, { useState as useState134, useMemo as
|
|
32199
|
+
import React293, { useState as useState134, useMemo as useMemo120, useEffect as useEffect108 } from "react";
|
|
32138
32200
|
import { TextInput as TextInput7, Tabs as Tabs4, Box as Box59, Stack as Stack196, UnstyledButton as UnstyledButton7, Text as Text171, Center as Center14, ScrollArea as ScrollArea9, Group as Group107, Popover as Popover6 } from "@mantine/core";
|
|
32139
32201
|
import * as TablerIcons from "@tabler/icons-react";
|
|
32140
32202
|
import { IconSearch as IconSearch7, IconX as IconX13, IconChevronLeft, IconChevronRight as IconChevronRight13 } from "@tabler/icons-react";
|
|
@@ -32170,11 +32232,11 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
32170
32232
|
const [searchQuery, setSearchQuery] = useState134("");
|
|
32171
32233
|
const [activeTab, setActiveTab] = useState134("icons");
|
|
32172
32234
|
const [currentPage, setCurrentPage] = useState134(1);
|
|
32173
|
-
const allIcons =
|
|
32235
|
+
const allIcons = useMemo120(() => {
|
|
32174
32236
|
const iconEntries = Object.entries(TablerIcons).filter(([name]) => name.startsWith("Icon") && name !== "IconProps");
|
|
32175
32237
|
return iconEntries;
|
|
32176
32238
|
}, []);
|
|
32177
|
-
const filteredIcons =
|
|
32239
|
+
const filteredIcons = useMemo120(() => {
|
|
32178
32240
|
if (!searchQuery) return allIcons;
|
|
32179
32241
|
const query = searchQuery.toLowerCase();
|
|
32180
32242
|
return allIcons.filter(([name]) => name.toLowerCase().includes(query));
|
|
@@ -32182,13 +32244,13 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
32182
32244
|
useEffect108(() => {
|
|
32183
32245
|
setCurrentPage(1);
|
|
32184
32246
|
}, [searchQuery]);
|
|
32185
|
-
const paginatedIcons =
|
|
32247
|
+
const paginatedIcons = useMemo120(() => {
|
|
32186
32248
|
const startIndex = (currentPage - 1) * ICONS_PER_PAGE;
|
|
32187
32249
|
const endIndex = startIndex + ICONS_PER_PAGE;
|
|
32188
32250
|
return filteredIcons.slice(startIndex, endIndex);
|
|
32189
32251
|
}, [filteredIcons, currentPage]);
|
|
32190
32252
|
const totalPages = Math.ceil(filteredIcons.length / ICONS_PER_PAGE);
|
|
32191
|
-
const recentIcons =
|
|
32253
|
+
const recentIcons = useMemo120(() => {
|
|
32192
32254
|
const recentIconNames = localStorageService.get(iconsKey);
|
|
32193
32255
|
if (!recentIconNames || recentIconNames.length === 0) return [];
|
|
32194
32256
|
return recentIconNames.slice(0, 24).map((iconName) => allIcons.find(([name]) => name === iconName)).filter((entry) => entry !== void 0);
|
|
@@ -32310,12 +32372,12 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
32310
32372
|
}
|
|
32311
32373
|
|
|
32312
32374
|
// src/mantine/components/Base/PageIcon.tsx
|
|
32313
|
-
import React294, { useMemo as
|
|
32375
|
+
import React294, { useMemo as useMemo121 } from "react";
|
|
32314
32376
|
import { Center as Center15, Box as Box60 } from "@mantine/core";
|
|
32315
32377
|
import * as TablerIcons2 from "@tabler/icons-react";
|
|
32316
32378
|
function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
32317
32379
|
const isIconName = src && !src.startsWith("http");
|
|
32318
|
-
const IconComponent =
|
|
32380
|
+
const IconComponent = useMemo121(() => {
|
|
32319
32381
|
if (!isIconName || !src) return null;
|
|
32320
32382
|
const iconComponent = TablerIcons2[src];
|
|
32321
32383
|
if (iconComponent) {
|
|
@@ -32443,7 +32505,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32443
32505
|
const logoFileInputRef = useRef29(null);
|
|
32444
32506
|
const [opened, { open, close }] = useDisclosure7(false);
|
|
32445
32507
|
const [metadata, setMetadata] = useState136(() => editor?.getPageMetadata?.() || null);
|
|
32446
|
-
const settingsPanelContent =
|
|
32508
|
+
const settingsPanelContent = useMemo122(() => editor ? /* @__PURE__ */ React296.createElement(FlowSettingsPanel, { editor }) : null, [editor]);
|
|
32447
32509
|
const { open: openSettings } = usePanel("flow-settings-panel", settingsPanelContent);
|
|
32448
32510
|
useEffect110(() => {
|
|
32449
32511
|
if (!editor?._metadataManager) {
|
|
@@ -33729,14 +33791,14 @@ var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) =
|
|
|
33729
33791
|
};
|
|
33730
33792
|
|
|
33731
33793
|
// src/mantine/components/FlowPermissionsPanel.tsx
|
|
33732
|
-
import React303, { useState as useState141, useEffect as useEffect114, useMemo as
|
|
33794
|
+
import React303, { useState as useState141, useEffect as useEffect114, useMemo as useMemo123 } from "react";
|
|
33733
33795
|
import { Stack as Stack199, Text as Text174, Paper as Paper18, Group as Group111, Badge as Badge45, Button as Button57, ActionIcon as ActionIcon38, Loader as Loader54, Alert as Alert55, Divider as Divider29 } from "@mantine/core";
|
|
33734
33796
|
import { IconPlus as IconPlus11, IconTrash as IconTrash12, IconShieldCheck as IconShieldCheck16, IconUser as IconUser14, IconRobot as IconRobot4, IconBuilding as IconBuilding2 } from "@tabler/icons-react";
|
|
33735
33797
|
var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission, onRevokePermission, getUserDisplayName }) => {
|
|
33736
33798
|
const [delegations, setDelegations] = useState141([]);
|
|
33737
33799
|
const [loading, setLoading] = useState141(true);
|
|
33738
33800
|
const [revoking, setRevoking] = useState141(null);
|
|
33739
|
-
const rootDelegation =
|
|
33801
|
+
const rootDelegation = useMemo123(() => {
|
|
33740
33802
|
if (editor.getUcanService) {
|
|
33741
33803
|
return editor.getUcanService()?.getRootDelegation() || null;
|
|
33742
33804
|
}
|
|
@@ -34090,4 +34152,4 @@ export {
|
|
|
34090
34152
|
getExtraSlashMenuItems,
|
|
34091
34153
|
useCreateIxoEditor
|
|
34092
34154
|
};
|
|
34093
|
-
//# sourceMappingURL=chunk-
|
|
34155
|
+
//# sourceMappingURL=chunk-ZCRLP7QH.mjs.map
|