@ixo/editor 3.1.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-5D26UG3I.mjs → chunk-F2JSGDES.mjs} +730 -519
- package/dist/chunk-F2JSGDES.mjs.map +1 -0
- package/dist/{chunk-KXKEXO53.mjs → chunk-IQX6H7AK.mjs} +2 -2
- package/dist/{chunk-FM2G22RS.mjs → chunk-ZCRLP7QH.mjs} +581 -512
- package/dist/chunk-ZCRLP7QH.mjs.map +1 -0
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.mjs +2 -2
- package/dist/{graphql-client-B49ND-qp.d.ts → graphql-client-BxmM6bOC.d.ts} +3 -1
- package/dist/{index-Ch49AFng.d.ts → index-DMrZ4EwQ.d.ts} +5 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +3 -3
- package/dist/mantine/index.d.ts +4 -4
- package/dist/mantine/index.mjs +2 -2
- package/dist/{setup-eMnRk02Q.d.ts → setup-B0la8n04.d.ts} +21 -15
- package/package.json +1 -1
- package/dist/chunk-5D26UG3I.mjs.map +0 -1
- package/dist/chunk-FM2G22RS.mjs.map +0 -1
- /package/dist/{chunk-KXKEXO53.mjs.map → chunk-IQX6H7AK.mjs.map} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
LATEST_VERSION,
|
|
2
3
|
buildDomainCardLinkedResource,
|
|
3
4
|
buildFlowNodeFromBlock,
|
|
4
5
|
buildGovernanceGroupLinkedEntities,
|
|
@@ -7,6 +8,7 @@ import {
|
|
|
7
8
|
createInvocationStore,
|
|
8
9
|
createRuntimeStateManager,
|
|
9
10
|
createUcanDelegationStore,
|
|
11
|
+
createUcanService,
|
|
10
12
|
executeNode,
|
|
11
13
|
extractSurveyAnswersTemplate,
|
|
12
14
|
getAction,
|
|
@@ -19,7 +21,7 @@ import {
|
|
|
19
21
|
resolveActionType,
|
|
20
22
|
sendDirectMessage,
|
|
21
23
|
transformSurveyToCredentialSubject
|
|
22
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-F2JSGDES.mjs";
|
|
23
25
|
|
|
24
26
|
// src/mantine/hooks/useCreateIxoEditor.ts
|
|
25
27
|
import { useCreateBlockNote } from "@blocknote/react";
|
|
@@ -55,7 +57,7 @@ import { createReactBlockSpec } from "@blocknote/react";
|
|
|
55
57
|
import React27 from "react";
|
|
56
58
|
|
|
57
59
|
// src/mantine/blocks/checkbox/template/TemplateView.tsx
|
|
58
|
-
import React24, { useMemo as
|
|
60
|
+
import React24, { useMemo as useMemo9 } from "react";
|
|
59
61
|
|
|
60
62
|
// src/mantine/blocks/checkbox/template/TemplateConfig.tsx
|
|
61
63
|
import React22, { useCallback as useCallback14 } from "react";
|
|
@@ -339,7 +341,7 @@ var useListBlocksUI = () => {
|
|
|
339
341
|
// src/mantine/components/Layouts/BaseRightPanelLayout.tsx
|
|
340
342
|
import { ActionIcon as ActionIcon3, Box as Box2, Flex as Flex2, Stack as Stack10, Text as Text8, Title } from "@mantine/core";
|
|
341
343
|
import { IconBrain, IconShieldCheck, IconWand, IconX as IconX2 } from "@tabler/icons-react";
|
|
342
|
-
import React19, { useEffect as useEffect9, useMemo as
|
|
344
|
+
import React19, { useEffect as useEffect9, useMemo as useMemo7 } from "react";
|
|
343
345
|
import { useMediaQuery } from "@mantine/hooks";
|
|
344
346
|
|
|
345
347
|
// src/mantine/components/ReusablePanel.tsx
|
|
@@ -511,7 +513,7 @@ import React12, { useCallback as useCallback7 } from "react";
|
|
|
511
513
|
import { Stack as Stack4, SegmentedControl as SegmentedControl2, Text as Text3, Alert } from "@mantine/core";
|
|
512
514
|
|
|
513
515
|
// src/mantine/blocks/components/ConditionBuilder/ConditionRow.tsx
|
|
514
|
-
import React10, { useCallback as useCallback6, useMemo as
|
|
516
|
+
import React10, { useCallback as useCallback6, useMemo as useMemo5 } from "react";
|
|
515
517
|
import { Stack as Stack3, Group, Button } from "@mantine/core";
|
|
516
518
|
|
|
517
519
|
// src/mantine/blocks/apiRequest/types.ts
|
|
@@ -1067,10 +1069,10 @@ import { Card } from "@mantine/core";
|
|
|
1067
1069
|
import React9 from "react";
|
|
1068
1070
|
|
|
1069
1071
|
// src/mantine/hooks/useBlockPresence.ts
|
|
1070
|
-
import { useMemo as
|
|
1072
|
+
import { useMemo as useMemo4, useState as useState4, useEffect as useEffect5 } from "react";
|
|
1071
1073
|
|
|
1072
1074
|
// src/mantine/context/BlocknoteContext.tsx
|
|
1073
|
-
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";
|
|
1074
1076
|
|
|
1075
1077
|
// src/mantine/blocks/hooks/hookedActions/registry.ts
|
|
1076
1078
|
var hookedActionTypesRegistry = /* @__PURE__ */ new Map();
|
|
@@ -1498,6 +1500,7 @@ function initializeHookedActions() {
|
|
|
1498
1500
|
// src/mantine/context/BlocknoteContext.tsx
|
|
1499
1501
|
var BlocknoteContext = createContext({
|
|
1500
1502
|
docType: "flow",
|
|
1503
|
+
flowVersion: "0.3",
|
|
1501
1504
|
sharedProposals: {},
|
|
1502
1505
|
fetchSharedProposal: async () => {
|
|
1503
1506
|
throw new Error("BlocknoteContext not initialized");
|
|
@@ -1534,6 +1537,37 @@ var BlocknoteProvider = ({
|
|
|
1534
1537
|
const [activeDrawerId, setActiveDrawerId] = useState3(null);
|
|
1535
1538
|
const [drawerContent, setDrawerContent] = useState3(null);
|
|
1536
1539
|
const docType = editor?.docType || "flow";
|
|
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]);
|
|
1537
1571
|
useEffect4(() => {
|
|
1538
1572
|
initializeHookedActions();
|
|
1539
1573
|
}, []);
|
|
@@ -1617,6 +1651,7 @@ var BlocknoteProvider = ({
|
|
|
1617
1651
|
blockRequirements,
|
|
1618
1652
|
editable,
|
|
1619
1653
|
docType,
|
|
1654
|
+
flowVersion,
|
|
1620
1655
|
sharedProposals,
|
|
1621
1656
|
fetchSharedProposal,
|
|
1622
1657
|
invalidateProposal,
|
|
@@ -1665,7 +1700,7 @@ function useBlockPresence(blockId, options) {
|
|
|
1665
1700
|
awarenessInstance.off("change", onChange);
|
|
1666
1701
|
};
|
|
1667
1702
|
}, [awarenessInstance]);
|
|
1668
|
-
return
|
|
1703
|
+
return useMemo4(() => {
|
|
1669
1704
|
if (!blockId || !awarenessInstance) {
|
|
1670
1705
|
return [];
|
|
1671
1706
|
}
|
|
@@ -1747,15 +1782,15 @@ function BaseContainer({ children, onClick, style, blockId }) {
|
|
|
1747
1782
|
|
|
1748
1783
|
// src/mantine/blocks/components/ConditionBuilder/ConditionRow.tsx
|
|
1749
1784
|
function ConditionRow({ condition, availableBlocks, onUpdate, onDelete }) {
|
|
1750
|
-
const availableProperties =
|
|
1785
|
+
const availableProperties = useMemo5(() => {
|
|
1751
1786
|
if (!condition.sourceBlockType) return [];
|
|
1752
1787
|
return getConditionableProperties(condition.sourceBlockType);
|
|
1753
1788
|
}, [condition.sourceBlockType]);
|
|
1754
|
-
const selectedProperty =
|
|
1789
|
+
const selectedProperty = useMemo5(() => {
|
|
1755
1790
|
if (!condition.sourceBlockType || !condition.rule.property) return null;
|
|
1756
1791
|
return getPropertyByName(condition.sourceBlockType, condition.rule.property);
|
|
1757
1792
|
}, [condition.sourceBlockType, condition.rule.property]);
|
|
1758
|
-
const availableOperators =
|
|
1793
|
+
const availableOperators = useMemo5(() => {
|
|
1759
1794
|
if (!selectedProperty) return [];
|
|
1760
1795
|
const baseOperators = [
|
|
1761
1796
|
{ value: "equals", label: "equals" },
|
|
@@ -2246,7 +2281,7 @@ import { useDisclosure } from "@mantine/hooks";
|
|
|
2246
2281
|
import { IconArrowsMaximize, IconArrowsMinimize, IconChevronDown, IconChevronRight, IconDotsVertical, IconHourglass, IconUsers } from "@tabler/icons-react";
|
|
2247
2282
|
|
|
2248
2283
|
// src/mantine/components/TtlTab.tsx
|
|
2249
|
-
import React17, { useCallback as useCallback11, useMemo as
|
|
2284
|
+
import React17, { useCallback as useCallback11, useMemo as useMemo6 } from "react";
|
|
2250
2285
|
import { Stack as Stack8, Text as Text6, Group as Group3 } from "@mantine/core";
|
|
2251
2286
|
|
|
2252
2287
|
// src/core/utils/dates.ts
|
|
@@ -2319,7 +2354,7 @@ function datetimeLocalToIso(value) {
|
|
|
2319
2354
|
}
|
|
2320
2355
|
}
|
|
2321
2356
|
var DurationInput = ({ label, description, value, onChange }) => {
|
|
2322
|
-
const parts =
|
|
2357
|
+
const parts = useMemo6(() => parseDuration(value), [value]);
|
|
2323
2358
|
const update = useCallback11(
|
|
2324
2359
|
(field, val) => {
|
|
2325
2360
|
onChange(toDuration({ ...parts, [field]: Math.max(0, val || 0) }));
|
|
@@ -2468,7 +2503,7 @@ function BaseRightPanelLayout({ title, isTemplate: _isTemplate = true, captionCo
|
|
|
2468
2503
|
icon: icon(IconShieldCheck)
|
|
2469
2504
|
}
|
|
2470
2505
|
] : tabs;
|
|
2471
|
-
const selectedSkill =
|
|
2506
|
+
const selectedSkill = useMemo7(() => {
|
|
2472
2507
|
try {
|
|
2473
2508
|
return JSON.parse(context?.block.props.skill || "{}");
|
|
2474
2509
|
} catch {
|
|
@@ -2540,7 +2575,7 @@ function BaseRightPanelLayout({ title, isTemplate: _isTemplate = true, captionCo
|
|
|
2540
2575
|
}
|
|
2541
2576
|
|
|
2542
2577
|
// src/mantine/components/AuthorizationTab.tsx
|
|
2543
|
-
import React21, { useMemo as
|
|
2578
|
+
import React21, { useMemo as useMemo8, useState as useState8, useEffect as useEffect10, useCallback as useCallback13 } from "react";
|
|
2544
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";
|
|
2545
2580
|
import { IconShieldPlus as IconShieldPlus2, IconShieldCheck as IconShieldCheck2, IconTrash, IconUser as IconUser2, IconRobot as IconRobot2, IconKey } from "@tabler/icons-react";
|
|
2546
2581
|
|
|
@@ -2727,16 +2762,16 @@ function getAvailableBlocks2(document2, currentBlockId) {
|
|
|
2727
2762
|
}
|
|
2728
2763
|
var AuthorizationTab = ({ editor, block: initialBlock, flowUri = "", entityDid: entityDidProp = "" }) => {
|
|
2729
2764
|
const handlers = useBlocknoteHandlers();
|
|
2730
|
-
const flowOwnerDid =
|
|
2765
|
+
const flowOwnerDid = useMemo8(() => {
|
|
2731
2766
|
return editor.getFlowOwnerDid?.() || "";
|
|
2732
2767
|
}, [editor]);
|
|
2733
|
-
const currentUserDid =
|
|
2768
|
+
const currentUserDid = useMemo8(() => {
|
|
2734
2769
|
return editor.user?.id || "";
|
|
2735
2770
|
}, [editor.user?.id]);
|
|
2736
|
-
const isFlowOwner =
|
|
2771
|
+
const isFlowOwner = useMemo8(() => {
|
|
2737
2772
|
return flowOwnerDid && currentUserDid && flowOwnerDid === currentUserDid;
|
|
2738
2773
|
}, [flowOwnerDid, currentUserDid]);
|
|
2739
|
-
const entityDid =
|
|
2774
|
+
const entityDid = useMemo8(() => {
|
|
2740
2775
|
if (entityDidProp) return entityDidProp;
|
|
2741
2776
|
if (handlers.getEntityDid) return handlers.getEntityDid() || "";
|
|
2742
2777
|
return "";
|
|
@@ -2744,7 +2779,7 @@ var AuthorizationTab = ({ editor, block: initialBlock, flowUri = "", entityDid:
|
|
|
2744
2779
|
const [creatingRootCapability, setCreatingRootCapability] = useState8(false);
|
|
2745
2780
|
const [rootCapabilityError, setRootCapabilityError] = useState8(null);
|
|
2746
2781
|
const [, forceUpdate] = useState8({});
|
|
2747
|
-
const block =
|
|
2782
|
+
const block = useMemo8(() => {
|
|
2748
2783
|
const doc = editor?.document || [];
|
|
2749
2784
|
return doc.find((b) => b.id === initialBlock.id) || initialBlock;
|
|
2750
2785
|
}, [editor?.document, initialBlock]);
|
|
@@ -2758,7 +2793,7 @@ var AuthorizationTab = ({ editor, block: initialBlock, flowUri = "", entityDid:
|
|
|
2758
2793
|
const activationUpstreamNodeId = block.props.activationUpstreamNodeId || "";
|
|
2759
2794
|
const activationRequiredStatus = block.props.activationRequiredStatus || "";
|
|
2760
2795
|
const activationRequireAuthorisedActor = Boolean(block.props.activationRequireAuthorisedActor);
|
|
2761
|
-
const availableBlocks =
|
|
2796
|
+
const availableBlocks = useMemo8(() => getAvailableBlocks2(editor?.document || [], block.id), [editor?.document, block.id]);
|
|
2762
2797
|
const updateProps = useCallback13(
|
|
2763
2798
|
(updates) => {
|
|
2764
2799
|
const currentBlock = (editor?.document || []).find((b) => b.id === block.id) || block;
|
|
@@ -2772,7 +2807,7 @@ var AuthorizationTab = ({ editor, block: initialBlock, flowUri = "", entityDid:
|
|
|
2772
2807
|
[editor, block.id]
|
|
2773
2808
|
);
|
|
2774
2809
|
const [viewMode, setViewMode] = useState8("main");
|
|
2775
|
-
const rootCapability =
|
|
2810
|
+
const rootCapability = useMemo8(() => {
|
|
2776
2811
|
return editor.getRootCapability?.() || null;
|
|
2777
2812
|
}, [editor, creatingRootCapability]);
|
|
2778
2813
|
const createRootCapability = async (pin) => {
|
|
@@ -2818,7 +2853,7 @@ var AuthorizationTab = ({ editor, block: initialBlock, flowUri = "", entityDid:
|
|
|
2818
2853
|
return { success: false, error: errorMsg };
|
|
2819
2854
|
}
|
|
2820
2855
|
};
|
|
2821
|
-
const blockCapabilities =
|
|
2856
|
+
const blockCapabilities = useMemo8(() => {
|
|
2822
2857
|
if (!editor.getAllDelegations) return [];
|
|
2823
2858
|
const allDelegations = editor.getAllDelegations();
|
|
2824
2859
|
const blockResource = flowUri ? `${flowUri}:${block.id}` : `ixo:flow:*:${block.id}`;
|
|
@@ -3094,13 +3129,13 @@ var getIcon = (fallback = "square-check", key, color = "white", size = 26, strok
|
|
|
3094
3129
|
var CHECKBOX_TEMPLATE_PANEL_ID = "checkbox-template-panel";
|
|
3095
3130
|
var CheckboxTemplateView = ({ editor, block }) => {
|
|
3096
3131
|
const panelId = `${CHECKBOX_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
3097
|
-
const panelContent =
|
|
3132
|
+
const panelContent = useMemo9(() => /* @__PURE__ */ React24.createElement(TemplateConfig, { editor, block }), [editor, block]);
|
|
3098
3133
|
const { open } = usePanel(panelId, panelContent);
|
|
3099
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() })));
|
|
3100
3135
|
};
|
|
3101
3136
|
|
|
3102
3137
|
// src/mantine/blocks/checkbox/flow/FlowView.tsx
|
|
3103
|
-
import React26, { useMemo as
|
|
3138
|
+
import React26, { useMemo as useMemo10 } from "react";
|
|
3104
3139
|
import { Checkbox as Checkbox3, Group as Group8, Stack as Stack14, Text as Text12, Tooltip } from "@mantine/core";
|
|
3105
3140
|
|
|
3106
3141
|
// src/mantine/hooks/useNodeRuntime.ts
|
|
@@ -3165,7 +3200,7 @@ var CheckboxFlowView = ({ editor, block, isDisabled }) => {
|
|
|
3165
3200
|
const disabled = isDisabled?.isDisabled === "disable";
|
|
3166
3201
|
const [runtime, updateRuntime] = useNodeRuntime(editor, block.id);
|
|
3167
3202
|
const panelId = `${CHECKBOX_FLOW_PANEL_ID}-${block.id}`;
|
|
3168
|
-
const panelContent =
|
|
3203
|
+
const panelContent = useMemo10(() => /* @__PURE__ */ React26.createElement(FlowConfig, { editor, block }), [editor, block]);
|
|
3169
3204
|
const { open } = usePanel(panelId, panelContent);
|
|
3170
3205
|
const checked = runtime.output?.checked ?? false;
|
|
3171
3206
|
const handleCheckboxChange = (event) => {
|
|
@@ -3182,7 +3217,7 @@ var CheckboxFlowView = ({ editor, block, isDisabled }) => {
|
|
|
3182
3217
|
};
|
|
3183
3218
|
|
|
3184
3219
|
// src/mantine/blocks/hooks/useBlockConditions.ts
|
|
3185
|
-
import { useMemo as
|
|
3220
|
+
import { useMemo as useMemo11, useEffect as useEffect12, useState as useState10 } from "react";
|
|
3186
3221
|
|
|
3187
3222
|
// src/mantine/blocks/utils/conditionNormalizer.ts
|
|
3188
3223
|
var OPERATOR_INVERSIONS = {
|
|
@@ -3317,7 +3352,7 @@ function evaluateBlockConditions(conditionConfig, editorDocument, currentUser) {
|
|
|
3317
3352
|
// src/mantine/blocks/hooks/useBlockConditions.ts
|
|
3318
3353
|
function useBlockConditions(block, editor, currentUser) {
|
|
3319
3354
|
const editorDocument = editor?.document;
|
|
3320
|
-
const conditionConfig =
|
|
3355
|
+
const conditionConfig = useMemo11(() => {
|
|
3321
3356
|
return parseConditionConfig(block?.props?.conditions);
|
|
3322
3357
|
}, [block?.props?.conditions]);
|
|
3323
3358
|
const [sourceBlockVersion, setSourceBlockVersion] = useState10(0);
|
|
@@ -3334,7 +3369,7 @@ function useBlockConditions(block, editor, currentUser) {
|
|
|
3334
3369
|
});
|
|
3335
3370
|
return cleanup;
|
|
3336
3371
|
}, [editor, conditionConfig]);
|
|
3337
|
-
const result =
|
|
3372
|
+
const result = useMemo11(() => {
|
|
3338
3373
|
if (!editorDocument || !block) {
|
|
3339
3374
|
return {
|
|
3340
3375
|
actions: []
|
|
@@ -3424,7 +3459,7 @@ import { createReactBlockSpec as createReactBlockSpec3 } from "@blocknote/react"
|
|
|
3424
3459
|
import React89 from "react";
|
|
3425
3460
|
|
|
3426
3461
|
// src/mantine/blocks/list/template/TemplateView.tsx
|
|
3427
|
-
import React32, { useMemo as
|
|
3462
|
+
import React32, { useMemo as useMemo12 } from "react";
|
|
3428
3463
|
|
|
3429
3464
|
// src/mantine/blocks/list/template/TemplateConfig.tsx
|
|
3430
3465
|
import React31, { useCallback as useCallback16 } from "react";
|
|
@@ -4657,7 +4692,7 @@ import { Group as Group10, Stack as Stack16, Text as Text14 } from "@mantine/cor
|
|
|
4657
4692
|
var LIST_TEMPLATE_PANEL_ID = "list-template-panel";
|
|
4658
4693
|
var ListTemplateView = ({ editor, block }) => {
|
|
4659
4694
|
const panelId = `${LIST_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
4660
|
-
const panelContent =
|
|
4695
|
+
const panelContent = useMemo12(() => /* @__PURE__ */ React32.createElement(TemplateConfig2, { editor, block }), [editor, block]);
|
|
4661
4696
|
const { open } = usePanel(panelId, panelContent);
|
|
4662
4697
|
const listType = block.props.listType && block.props.listType !== "" ? block.props.listType : null;
|
|
4663
4698
|
const listName = listType ? getListNameByType(listType) : "Unconfigured List";
|
|
@@ -4665,7 +4700,7 @@ var ListTemplateView = ({ editor, block }) => {
|
|
|
4665
4700
|
};
|
|
4666
4701
|
|
|
4667
4702
|
// src/mantine/blocks/list/flow/ListFlowView.tsx
|
|
4668
|
-
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";
|
|
4669
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";
|
|
4670
4705
|
|
|
4671
4706
|
// src/mantine/blocks/list/linked_resources/ResourcesList.tsx
|
|
@@ -5230,7 +5265,7 @@ var DeedSubscriptionsList = ({ items, isMultiSelect: _isMultiSelect, isItemCheck
|
|
|
5230
5265
|
};
|
|
5231
5266
|
|
|
5232
5267
|
// src/mantine/blocks/list/ListSelectionPanel.tsx
|
|
5233
|
-
import React83, { useState as useState34, useEffect as useEffect33, useMemo as
|
|
5268
|
+
import React83, { useState as useState34, useEffect as useEffect33, useMemo as useMemo38 } from "react";
|
|
5234
5269
|
import { Stack as Stack55, Alert as Alert14, Text as Text55, Loader as Loader15, Center as Center8, Space } from "@mantine/core";
|
|
5235
5270
|
import { IconClipboardText, IconChecklist as IconChecklist4, IconFileDescription as IconFileDescription2 } from "@tabler/icons-react";
|
|
5236
5271
|
|
|
@@ -5331,7 +5366,7 @@ var TransactionDetails = ({ transaction }) => {
|
|
|
5331
5366
|
};
|
|
5332
5367
|
|
|
5333
5368
|
// src/mantine/blocks/list/claims/ClaimsListPanelContent.tsx
|
|
5334
|
-
import React54, { useEffect as useEffect14, useMemo as
|
|
5369
|
+
import React54, { useEffect as useEffect14, useMemo as useMemo13, useState as useState14 } from "react";
|
|
5335
5370
|
import { Text as Text33, Stack as Stack34, Loader as Loader3, Alert as Alert5 } from "@mantine/core";
|
|
5336
5371
|
import { Survey, SurveyModel } from "@ixo/surveys";
|
|
5337
5372
|
|
|
@@ -5474,7 +5509,7 @@ var ClaimsListPanelContent = ({ collectionId, deedId, claim }) => {
|
|
|
5474
5509
|
setSurveyLoading(false);
|
|
5475
5510
|
}
|
|
5476
5511
|
};
|
|
5477
|
-
const surveyModel =
|
|
5512
|
+
const surveyModel = useMemo13(() => {
|
|
5478
5513
|
if (!surveyJson || !claimData) return null;
|
|
5479
5514
|
const model = new SurveyModel(surveyJson);
|
|
5480
5515
|
model.applyTheme(surveyTheme);
|
|
@@ -5497,14 +5532,14 @@ var ClaimsListPanelContent = ({ collectionId, deedId, claim }) => {
|
|
|
5497
5532
|
};
|
|
5498
5533
|
|
|
5499
5534
|
// src/mantine/blocks/list/claims/ClaimsEvaluation.tsx
|
|
5500
|
-
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";
|
|
5501
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";
|
|
5502
5537
|
|
|
5503
5538
|
// src/mantine/blocks/evaluator/EvaluatorBlock.tsx
|
|
5504
5539
|
import React79 from "react";
|
|
5505
5540
|
|
|
5506
5541
|
// src/mantine/blocks/evaluator/template/TemplateView.tsx
|
|
5507
|
-
import React65, { useMemo as
|
|
5542
|
+
import React65, { useMemo as useMemo21 } from "react";
|
|
5508
5543
|
import { Group as Group14, Stack as Stack40, Text as Text39 } from "@mantine/core";
|
|
5509
5544
|
|
|
5510
5545
|
// src/mantine/blocks/evaluator/template/TemplateConfig.tsx
|
|
@@ -5512,7 +5547,7 @@ import React59, { useCallback as useCallback19 } from "react";
|
|
|
5512
5547
|
import { IconSettings as IconSettings3, IconShieldCheck as IconShieldCheck5, IconContract, IconClock as IconClock2 } from "@tabler/icons-react";
|
|
5513
5548
|
|
|
5514
5549
|
// src/mantine/blocks/evaluator/template/GeneralTab.tsx
|
|
5515
|
-
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";
|
|
5516
5551
|
|
|
5517
5552
|
// src/mantine/components/CollectionSelector.tsx
|
|
5518
5553
|
import React55, { useState as useState15, useEffect as useEffect15 } from "react";
|
|
@@ -5618,7 +5653,7 @@ var GeneralTab3 = ({
|
|
|
5618
5653
|
useEffect16(() => {
|
|
5619
5654
|
setLocalDescription(description || "");
|
|
5620
5655
|
}, [description]);
|
|
5621
|
-
const parsedSelectedCollections =
|
|
5656
|
+
const parsedSelectedCollections = useMemo14(() => {
|
|
5622
5657
|
try {
|
|
5623
5658
|
return JSON.parse(selectedCollections || "[]");
|
|
5624
5659
|
} catch {
|
|
@@ -5679,7 +5714,7 @@ var GeneralTab3 = ({
|
|
|
5679
5714
|
};
|
|
5680
5715
|
|
|
5681
5716
|
// src/mantine/components/CommitmentTab.tsx
|
|
5682
|
-
import React58, { useMemo as
|
|
5717
|
+
import React58, { useMemo as useMemo15, useState as useState17, useEffect as useEffect17, useCallback as useCallback18 } from "react";
|
|
5683
5718
|
import { Stack as Stack36, Flex as Flex19, Text as Text35 } from "@mantine/core";
|
|
5684
5719
|
|
|
5685
5720
|
// src/mantine/components/Base/BaseAvatar.tsx
|
|
@@ -5710,11 +5745,11 @@ var CommitmentTab = ({ editor, block: initialBlock }) => {
|
|
|
5710
5745
|
const [selectedValue, setSelectedValue] = useState17(null);
|
|
5711
5746
|
const roomId = editor.getRoomId?.() || null;
|
|
5712
5747
|
const mx = editor.getMatrixClient?.() || null;
|
|
5713
|
-
const currentUserMatrixId =
|
|
5748
|
+
const currentUserMatrixId = useMemo15(() => {
|
|
5714
5749
|
return editor.user?.id || "";
|
|
5715
5750
|
}, [editor.user?.id]);
|
|
5716
5751
|
const [, forceUpdate] = useState17({});
|
|
5717
|
-
const block =
|
|
5752
|
+
const block = useMemo15(() => {
|
|
5718
5753
|
const doc = editor?.document || [];
|
|
5719
5754
|
return doc.find((b) => b.id === initialBlock.id) || initialBlock;
|
|
5720
5755
|
}, [editor?.document, initialBlock]);
|
|
@@ -5801,20 +5836,20 @@ var CommitmentTab = ({ editor, block: initialBlock }) => {
|
|
|
5801
5836
|
setSelectedValue(null);
|
|
5802
5837
|
setSearchValue("");
|
|
5803
5838
|
};
|
|
5804
|
-
const filteredMembers =
|
|
5839
|
+
const filteredMembers = useMemo15(() => {
|
|
5805
5840
|
if (!searchValue.trim()) {
|
|
5806
5841
|
return roomMembers;
|
|
5807
5842
|
}
|
|
5808
5843
|
const query = searchValue.toLowerCase();
|
|
5809
5844
|
return roomMembers.filter((member) => member.name.toLowerCase().includes(query));
|
|
5810
5845
|
}, [roomMembers, searchValue]);
|
|
5811
|
-
const selectData =
|
|
5846
|
+
const selectData = useMemo15(() => {
|
|
5812
5847
|
return filteredMembers.map((member) => ({
|
|
5813
5848
|
value: member.did,
|
|
5814
5849
|
label: member.name || member.did
|
|
5815
5850
|
}));
|
|
5816
5851
|
}, [filteredMembers]);
|
|
5817
|
-
const memberLookup =
|
|
5852
|
+
const memberLookup = useMemo15(() => {
|
|
5818
5853
|
const lookup = {};
|
|
5819
5854
|
roomMembers.forEach((member) => {
|
|
5820
5855
|
lookup[member.did] = member;
|
|
@@ -5897,10 +5932,10 @@ var TemplateConfig3 = ({ editor, block }) => {
|
|
|
5897
5932
|
|
|
5898
5933
|
// src/mantine/blocks/components/AssignmentPanel.tsx
|
|
5899
5934
|
import React62 from "react";
|
|
5900
|
-
import { useMemo as
|
|
5935
|
+
import { useMemo as useMemo18 } from "react";
|
|
5901
5936
|
|
|
5902
5937
|
// src/mantine/components/AssignmentTab.tsx
|
|
5903
|
-
import React60, { useMemo as
|
|
5938
|
+
import React60, { useMemo as useMemo16, useState as useState18, useEffect as useEffect18, useCallback as useCallback20 } from "react";
|
|
5904
5939
|
import { Stack as Stack37, Flex as Flex20, Text as Text36 } from "@mantine/core";
|
|
5905
5940
|
var AssignmentTab = ({ editor, block: initialBlock }) => {
|
|
5906
5941
|
const handlers = useBlocknoteHandlers();
|
|
@@ -5909,11 +5944,11 @@ var AssignmentTab = ({ editor, block: initialBlock }) => {
|
|
|
5909
5944
|
const [selectedValue, setSelectedValue] = useState18(null);
|
|
5910
5945
|
const roomId = editor.getRoomId?.() || null;
|
|
5911
5946
|
const mx = editor.getMatrixClient?.() || null;
|
|
5912
|
-
const currentUserMatrixId =
|
|
5947
|
+
const currentUserMatrixId = useMemo16(() => {
|
|
5913
5948
|
return editor.user?.id || "";
|
|
5914
5949
|
}, [editor.user?.id]);
|
|
5915
5950
|
const [, forceUpdate] = useState18({});
|
|
5916
|
-
const block =
|
|
5951
|
+
const block = useMemo16(() => {
|
|
5917
5952
|
const doc = editor?.document || [];
|
|
5918
5953
|
return doc.find((b) => b.id === initialBlock.id) || initialBlock;
|
|
5919
5954
|
}, [editor?.document, initialBlock]);
|
|
@@ -6021,20 +6056,20 @@ var AssignmentTab = ({ editor, block: initialBlock }) => {
|
|
|
6021
6056
|
setSelectedValue(null);
|
|
6022
6057
|
setSearchValue("");
|
|
6023
6058
|
};
|
|
6024
|
-
const filteredMembers =
|
|
6059
|
+
const filteredMembers = useMemo16(() => {
|
|
6025
6060
|
if (!searchValue.trim()) {
|
|
6026
6061
|
return roomMembers;
|
|
6027
6062
|
}
|
|
6028
6063
|
const query = searchValue.toLowerCase();
|
|
6029
6064
|
return roomMembers.filter((member) => member.name.toLowerCase().includes(query));
|
|
6030
6065
|
}, [roomMembers, searchValue]);
|
|
6031
|
-
const selectData =
|
|
6066
|
+
const selectData = useMemo16(() => {
|
|
6032
6067
|
return filteredMembers.map((member) => ({
|
|
6033
6068
|
value: member.did,
|
|
6034
6069
|
label: member.name || member.did
|
|
6035
6070
|
}));
|
|
6036
6071
|
}, [filteredMembers]);
|
|
6037
|
-
const memberLookup =
|
|
6072
|
+
const memberLookup = useMemo16(() => {
|
|
6038
6073
|
const lookup = {};
|
|
6039
6074
|
roomMembers.forEach((member) => {
|
|
6040
6075
|
lookup[member.did] = member;
|
|
@@ -6078,7 +6113,7 @@ var AssignmentTab = ({ editor, block: initialBlock }) => {
|
|
|
6078
6113
|
};
|
|
6079
6114
|
|
|
6080
6115
|
// src/mantine/components/AssignmentDisplay.tsx
|
|
6081
|
-
import React61, { useMemo as
|
|
6116
|
+
import React61, { useMemo as useMemo17 } from "react";
|
|
6082
6117
|
import { Stack as Stack38, Text as Text37, Flex as Flex21, Box as Box18, Popover as Popover3, Avatar as Avatar3 } from "@mantine/core";
|
|
6083
6118
|
import { useDisclosure as useDisclosure2 } from "@mantine/hooks";
|
|
6084
6119
|
var AVATAR_SIZE = 24;
|
|
@@ -6102,7 +6137,7 @@ var AvatarWrapper = React61.forwardRef(({ children, onClick, onMouseEnter, onMou
|
|
|
6102
6137
|
AvatarWrapper.displayName = "AvatarWrapper";
|
|
6103
6138
|
var AssignmentDisplay = ({ block, onClick }) => {
|
|
6104
6139
|
const [opened, { open, close }] = useDisclosure2(false);
|
|
6105
|
-
const assignmentState =
|
|
6140
|
+
const assignmentState = useMemo17(() => {
|
|
6106
6141
|
try {
|
|
6107
6142
|
const assignment = typeof block.props.assignment === "string" ? JSON.parse(block.props.assignment) : block.props.assignment;
|
|
6108
6143
|
return assignment || {
|
|
@@ -6129,7 +6164,7 @@ var ASSIGNMENT_PANEL_ID = "assignment-panel";
|
|
|
6129
6164
|
function AssignmentPanel({ block, editor }) {
|
|
6130
6165
|
const assignmentPanelId = `${ASSIGNMENT_PANEL_ID}-${block.id}`;
|
|
6131
6166
|
const { closePanel } = usePanelStore();
|
|
6132
|
-
const assignmentPanelContent =
|
|
6167
|
+
const assignmentPanelContent = useMemo18(
|
|
6133
6168
|
() => /* @__PURE__ */ React62.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Assignment Tab" }, /* @__PURE__ */ React62.createElement(AssignmentTab, { editor, block })),
|
|
6134
6169
|
[editor, block, closePanel]
|
|
6135
6170
|
);
|
|
@@ -6139,10 +6174,10 @@ function AssignmentPanel({ block, editor }) {
|
|
|
6139
6174
|
|
|
6140
6175
|
// src/mantine/blocks/components/CommitmentPanel.tsx
|
|
6141
6176
|
import React64 from "react";
|
|
6142
|
-
import { useMemo as
|
|
6177
|
+
import { useMemo as useMemo20 } from "react";
|
|
6143
6178
|
|
|
6144
6179
|
// src/mantine/components/CommitmentDisplay.tsx
|
|
6145
|
-
import React63, { useMemo as
|
|
6180
|
+
import React63, { useMemo as useMemo19 } from "react";
|
|
6146
6181
|
import { Stack as Stack39, Text as Text38, Flex as Flex22, Box as Box19, Popover as Popover4, Avatar as Avatar4 } from "@mantine/core";
|
|
6147
6182
|
import { useDisclosure as useDisclosure3 } from "@mantine/hooks";
|
|
6148
6183
|
var AVATAR_SIZE2 = 24;
|
|
@@ -6166,7 +6201,7 @@ var AvatarWrapper2 = React63.forwardRef(({ children, onClick, onMouseEnter, onMo
|
|
|
6166
6201
|
AvatarWrapper2.displayName = "AvatarWrapper";
|
|
6167
6202
|
var CommitmentDisplay = ({ block, onClick }) => {
|
|
6168
6203
|
const [opened, { open, close }] = useDisclosure3(false);
|
|
6169
|
-
const commitmentState =
|
|
6204
|
+
const commitmentState = useMemo19(() => {
|
|
6170
6205
|
try {
|
|
6171
6206
|
const commitment = typeof block.props.commitment === "string" ? JSON.parse(block.props.commitment) : block.props.commitment;
|
|
6172
6207
|
return commitment || {
|
|
@@ -6194,7 +6229,7 @@ var COMMITMENT_PANEL_ID = "commitment-panel";
|
|
|
6194
6229
|
function CommitmentPanel({ block, editor }) {
|
|
6195
6230
|
const commitmentPanelId = `${COMMITMENT_PANEL_ID}-${block.id}`;
|
|
6196
6231
|
const { closePanel } = usePanelStore();
|
|
6197
|
-
const commitmentPanelContent =
|
|
6232
|
+
const commitmentPanelContent = useMemo20(
|
|
6198
6233
|
() => /* @__PURE__ */ React64.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Commitment Tab" }, /* @__PURE__ */ React64.createElement(CommitmentTab, { editor, block })),
|
|
6199
6234
|
[editor, block, closePanel]
|
|
6200
6235
|
);
|
|
@@ -6206,13 +6241,13 @@ function CommitmentPanel({ block, editor }) {
|
|
|
6206
6241
|
var EVALUATOR_TEMPLATE_PANEL_ID = "evaluator-template-panel";
|
|
6207
6242
|
var EvaluatorTemplateView = ({ editor, block }) => {
|
|
6208
6243
|
const panelId = `${EVALUATOR_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
6209
|
-
const panelContent =
|
|
6244
|
+
const panelContent = useMemo21(() => /* @__PURE__ */ React65.createElement(TemplateConfig3, { editor, block }), [editor, block]);
|
|
6210
6245
|
const { open } = usePanel(panelId, panelContent);
|
|
6211
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 }))));
|
|
6212
6247
|
};
|
|
6213
6248
|
|
|
6214
6249
|
// src/mantine/blocks/evaluator/flow/FlowView.tsx
|
|
6215
|
-
import React78, { useMemo as
|
|
6250
|
+
import React78, { useMemo as useMemo36 } from "react";
|
|
6216
6251
|
import { Stack as Stack52, Text as Text52, Loader as Loader13, Center as Center7, Alert as Alert12 } from "@mantine/core";
|
|
6217
6252
|
import { IconAlertCircle as IconAlertCircle7 } from "@tabler/icons-react";
|
|
6218
6253
|
|
|
@@ -6240,7 +6275,7 @@ function useCurrentUser() {
|
|
|
6240
6275
|
}
|
|
6241
6276
|
|
|
6242
6277
|
// src/mantine/hooks/useCollections.ts
|
|
6243
|
-
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";
|
|
6244
6279
|
function useCollections(did, selectedCollectionIds, block, editor) {
|
|
6245
6280
|
const { getClaimCollections } = useBlocknoteHandlers();
|
|
6246
6281
|
const getClaimCollectionsRef = useRef7(getClaimCollections);
|
|
@@ -6251,7 +6286,7 @@ function useCollections(did, selectedCollectionIds, block, editor) {
|
|
|
6251
6286
|
const [loading, setLoading] = useState20(false);
|
|
6252
6287
|
const [error, setError] = useState20(null);
|
|
6253
6288
|
const adminAddressUpdatedRef = useRef7(false);
|
|
6254
|
-
const selectedCollectionIdsStr =
|
|
6289
|
+
const selectedCollectionIdsStr = useMemo22(() => JSON.stringify(selectedCollectionIds.sort()), [selectedCollectionIds]);
|
|
6255
6290
|
const fetchCollections = useCallback21(async () => {
|
|
6256
6291
|
if (!did || selectedCollectionIds.length === 0) {
|
|
6257
6292
|
setCollections([]);
|
|
@@ -6295,7 +6330,7 @@ import React77 from "react";
|
|
|
6295
6330
|
import { Stack as Stack51, Text as Text51, Loader as Loader12, Center as Center6 } from "@mantine/core";
|
|
6296
6331
|
|
|
6297
6332
|
// src/mantine/hooks/useUserRoles.ts
|
|
6298
|
-
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";
|
|
6299
6334
|
|
|
6300
6335
|
// src/mantine/hooks/utils.ts
|
|
6301
6336
|
function isClientFulfillmentError(error) {
|
|
@@ -6313,11 +6348,11 @@ function useUserRoles(collections, userAddress, adminAddress, deedId) {
|
|
|
6313
6348
|
const [userRoles, setUserRoles] = useState21({});
|
|
6314
6349
|
const [loading, setLoading] = useState21(true);
|
|
6315
6350
|
const failedRequestKeyRef = useRef8(null);
|
|
6316
|
-
const collectionIdsKey =
|
|
6351
|
+
const collectionIdsKey = useMemo23(
|
|
6317
6352
|
() => collections.map((c) => c.id).sort().join("|"),
|
|
6318
6353
|
[collections]
|
|
6319
6354
|
);
|
|
6320
|
-
const requestKey =
|
|
6355
|
+
const requestKey = useMemo23(() => [userAddress, adminAddress, deedId, collectionIdsKey].filter(Boolean).join("|"), [userAddress, adminAddress, deedId, collectionIdsKey]);
|
|
6321
6356
|
useEffect21(() => {
|
|
6322
6357
|
let isMounted = true;
|
|
6323
6358
|
const setEmptyRoles = () => {
|
|
@@ -6381,11 +6416,11 @@ function useUserRoles(collections, userAddress, adminAddress, deedId) {
|
|
|
6381
6416
|
}
|
|
6382
6417
|
|
|
6383
6418
|
// src/mantine/blocks/claim/flow/ClaimCollectionItem.tsx
|
|
6384
|
-
import React67, { useMemo as
|
|
6419
|
+
import React67, { useMemo as useMemo25 } from "react";
|
|
6385
6420
|
import { Stack as Stack42, Text as Text41, Group as Group16 } from "@mantine/core";
|
|
6386
6421
|
|
|
6387
6422
|
// src/mantine/blocks/claim/flow/ClaimsListSheet.tsx
|
|
6388
|
-
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";
|
|
6389
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";
|
|
6390
6425
|
import { IconArrowLeft as IconArrowLeft2, IconAlertCircle as IconAlertCircle2 } from "@tabler/icons-react";
|
|
6391
6426
|
import { Survey as Survey2, SurveyModel as SurveyModel2 } from "@ixo/surveys";
|
|
@@ -6462,7 +6497,7 @@ var ClaimsListSheet = ({
|
|
|
6462
6497
|
console.log("[ClaimsListSheet] useEffect fetchClaims");
|
|
6463
6498
|
fetchClaims();
|
|
6464
6499
|
}, [fetchClaims]);
|
|
6465
|
-
const surveyModel =
|
|
6500
|
+
const surveyModel = useMemo24(() => {
|
|
6466
6501
|
console.log("[ClaimsListSheet] surveyModel useMemo", { hasSurveyJson: !!surveyJson });
|
|
6467
6502
|
if (!surveyJson) return null;
|
|
6468
6503
|
const model = new SurveyModel2(surveyJson);
|
|
@@ -6505,7 +6540,8 @@ var ClaimsListSheet = ({
|
|
|
6505
6540
|
invocationStore: execution.invocationStore,
|
|
6506
6541
|
flowUri: execution.flowUri || "",
|
|
6507
6542
|
flowId: execution.flowId || "",
|
|
6508
|
-
flowOwnerDid: execution.flowOwnerDid || ""
|
|
6543
|
+
flowOwnerDid: execution.flowOwnerDid || "",
|
|
6544
|
+
schemaVersion: execution.schemaVersion || "0.3"
|
|
6509
6545
|
},
|
|
6510
6546
|
pin: "",
|
|
6511
6547
|
// TODO: collect PIN from user for invocation signing
|
|
@@ -6691,7 +6727,7 @@ var ClaimCollectionItem = ({ collection, block, deedId, editor, adminAddress, us
|
|
|
6691
6727
|
const collectionName = getCollectionName2(collection);
|
|
6692
6728
|
console.log("[CollectionItem] Panel setup", { claimsPanelId, collectionName, canAccessClaims });
|
|
6693
6729
|
console.log("[CollectionItem] Creating claimsPanelContent useMemo...");
|
|
6694
|
-
const claimsPanelContent =
|
|
6730
|
+
const claimsPanelContent = useMemo25(() => {
|
|
6695
6731
|
console.log("[CollectionItem] claimsPanelContent useMemo EXECUTING", { collectionId: collection.id });
|
|
6696
6732
|
return /* @__PURE__ */ React67.createElement(
|
|
6697
6733
|
ClaimsListSheet,
|
|
@@ -6727,20 +6763,21 @@ var ClaimCollectionItem = ({ collection, block, deedId, editor, adminAddress, us
|
|
|
6727
6763
|
};
|
|
6728
6764
|
|
|
6729
6765
|
// src/mantine/blocks/components/bid/components/BidCollectionItem.tsx
|
|
6730
|
-
import React73, { useMemo as
|
|
6766
|
+
import React73, { useMemo as useMemo32 } from "react";
|
|
6731
6767
|
import { Stack as Stack47, Text as Text47, Center as Center4, Loader as Loader10, Group as Group19 } from "@mantine/core";
|
|
6732
6768
|
|
|
6733
6769
|
// src/mantine/hooks/useBlockAuthorization.ts
|
|
6734
|
-
import { useState as useState23, useEffect as useEffect23, useMemo as
|
|
6770
|
+
import { useState as useState23, useEffect as useEffect23, useMemo as useMemo26 } from "react";
|
|
6735
6771
|
function useBlockAuthorization({ editor, blockId, actorDid, ucanService, flowUri }) {
|
|
6736
6772
|
const [result, setResult] = useState23({ authorized: false, reason: "Checking authorization..." });
|
|
6737
6773
|
const [loading, setLoading] = useState23(true);
|
|
6738
6774
|
const [checkTrigger, setCheckTrigger] = useState23(0);
|
|
6739
|
-
const resolvedFlowUri =
|
|
6775
|
+
const resolvedFlowUri = useMemo26(() => {
|
|
6740
6776
|
if (flowUri) return flowUri;
|
|
6741
6777
|
const metadata = editor.getFlowMetadata?.();
|
|
6742
6778
|
return metadata?.doc_id ? `ixo:flow:${metadata.doc_id}` : "";
|
|
6743
6779
|
}, [flowUri, editor]);
|
|
6780
|
+
const schemaVersion = useMemo26(() => editor.getFlowMetadata?.()?.schema_version || "0.3", [editor]);
|
|
6744
6781
|
useEffect23(() => {
|
|
6745
6782
|
const checkAuthorization = async () => {
|
|
6746
6783
|
setLoading(true);
|
|
@@ -6749,18 +6786,13 @@ function useBlockAuthorization({ editor, blockId, actorDid, ucanService, flowUri
|
|
|
6749
6786
|
setLoading(false);
|
|
6750
6787
|
return;
|
|
6751
6788
|
}
|
|
6752
|
-
if (!ucanService) {
|
|
6753
|
-
setResult({ authorized: false, reason: "UCAN service not configured" });
|
|
6754
|
-
setLoading(false);
|
|
6755
|
-
return;
|
|
6756
|
-
}
|
|
6757
6789
|
if (!resolvedFlowUri) {
|
|
6758
6790
|
setResult({ authorized: false, reason: "Flow URI not available" });
|
|
6759
6791
|
setLoading(false);
|
|
6760
6792
|
return;
|
|
6761
6793
|
}
|
|
6762
6794
|
try {
|
|
6763
|
-
const authResult = await isAuthorized(blockId, actorDid, ucanService, resolvedFlowUri);
|
|
6795
|
+
const authResult = await isAuthorized(blockId, actorDid, ucanService, resolvedFlowUri, schemaVersion);
|
|
6764
6796
|
setResult(authResult);
|
|
6765
6797
|
} catch (error) {
|
|
6766
6798
|
setResult({
|
|
@@ -6772,7 +6804,7 @@ function useBlockAuthorization({ editor, blockId, actorDid, ucanService, flowUri
|
|
|
6772
6804
|
}
|
|
6773
6805
|
};
|
|
6774
6806
|
checkAuthorization();
|
|
6775
|
-
}, [blockId, actorDid, ucanService, resolvedFlowUri, checkTrigger]);
|
|
6807
|
+
}, [blockId, actorDid, ucanService, resolvedFlowUri, schemaVersion, checkTrigger]);
|
|
6776
6808
|
const recheck = () => setCheckTrigger((prev) => prev + 1);
|
|
6777
6809
|
return {
|
|
6778
6810
|
isAuthorized: result.authorized,
|
|
@@ -6790,18 +6822,18 @@ import { Stack as Stack45, Text as Text44, Loader as Loader7, Center as Center3,
|
|
|
6790
6822
|
import { IconAlertCircle as IconAlertCircle4 } from "@tabler/icons-react";
|
|
6791
6823
|
|
|
6792
6824
|
// src/mantine/blocks/components/bid/components/BidItem.tsx
|
|
6793
|
-
import React69, { useMemo as
|
|
6825
|
+
import React69, { useMemo as useMemo29 } from "react";
|
|
6794
6826
|
import { Stack as Stack44, Text as Text43, Badge as Badge6, Group as Group18, ActionIcon as ActionIcon8 } from "@mantine/core";
|
|
6795
6827
|
import { IconArrowRight } from "@tabler/icons-react";
|
|
6796
6828
|
|
|
6797
6829
|
// src/mantine/blocks/components/bid/components/BidViewPanel.tsx
|
|
6798
|
-
import React68, { useMemo as
|
|
6830
|
+
import React68, { useMemo as useMemo28, useState as useState26 } from "react";
|
|
6799
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";
|
|
6800
6832
|
import { Survey as Survey3 } from "@ixo/surveys";
|
|
6801
6833
|
import { IconCheck as IconCheck2, IconX as IconX5, IconAlertCircle as IconAlertCircle3 } from "@tabler/icons-react";
|
|
6802
6834
|
|
|
6803
6835
|
// src/mantine/blocks/components/bid/hooks/useBidView.ts
|
|
6804
|
-
import { useState as useState24, useEffect as useEffect24, useMemo as
|
|
6836
|
+
import { useState as useState24, useEffect as useEffect24, useMemo as useMemo27 } from "react";
|
|
6805
6837
|
import { SurveyModel as SurveyModel3 } from "@ixo/surveys";
|
|
6806
6838
|
|
|
6807
6839
|
// src/mantine/blocks/components/bid/constants.ts
|
|
@@ -6881,7 +6913,7 @@ function useBidView(bid, deedId) {
|
|
|
6881
6913
|
};
|
|
6882
6914
|
fetchSurveyTemplate();
|
|
6883
6915
|
}, [deedId, bid.role, handlers]);
|
|
6884
|
-
const surveyModel =
|
|
6916
|
+
const surveyModel = useMemo27(() => {
|
|
6885
6917
|
if (!surveyJson) return null;
|
|
6886
6918
|
const model = new SurveyModel3(surveyJson);
|
|
6887
6919
|
model.applyTheme(surveyTheme);
|
|
@@ -6916,7 +6948,8 @@ function useBidActions(bid, deedId, adminAddress, execution, onRefresh, executeH
|
|
|
6916
6948
|
invocationStore: execution.invocationStore,
|
|
6917
6949
|
flowUri: execution.flowUri || "",
|
|
6918
6950
|
flowId: execution.flowId || "",
|
|
6919
|
-
flowOwnerDid: execution.flowOwnerDid || ""
|
|
6951
|
+
flowOwnerDid: execution.flowOwnerDid || "",
|
|
6952
|
+
schemaVersion: execution.schemaVersion || "0.3"
|
|
6920
6953
|
},
|
|
6921
6954
|
pin: "",
|
|
6922
6955
|
// TODO: collect PIN from user for invocation signing
|
|
@@ -6995,7 +7028,8 @@ function useBidActions(bid, deedId, adminAddress, execution, onRefresh, executeH
|
|
|
6995
7028
|
invocationStore: execution.invocationStore,
|
|
6996
7029
|
flowUri: execution.flowUri || "",
|
|
6997
7030
|
flowId: execution.flowId || "",
|
|
6998
|
-
flowOwnerDid: execution.flowOwnerDid || ""
|
|
7031
|
+
flowOwnerDid: execution.flowOwnerDid || "",
|
|
7032
|
+
schemaVersion: execution.schemaVersion || "0.3"
|
|
6999
7033
|
},
|
|
7000
7034
|
pin: "",
|
|
7001
7035
|
// TODO: collect PIN from user for invocation signing
|
|
@@ -7083,7 +7117,7 @@ var BidViewPanel = ({ editor, block, bid, deedId, adminAddress, onRefresh, execu
|
|
|
7083
7117
|
const maxAmounts = buildMaxAmounts();
|
|
7084
7118
|
approveBid(maxAmounts);
|
|
7085
7119
|
};
|
|
7086
|
-
const surveyContainerStyle =
|
|
7120
|
+
const surveyContainerStyle = useMemo28(
|
|
7087
7121
|
() => ({
|
|
7088
7122
|
flex: 1,
|
|
7089
7123
|
overflow: "auto",
|
|
@@ -7135,7 +7169,7 @@ function useUserProfile(did) {
|
|
|
7135
7169
|
var BidItem = ({ editor, block, bid, deedId, adminAddress, onRefresh, execution, executeHookedActions }) => {
|
|
7136
7170
|
const { userProfile, loading: loadingProfile } = useUserProfile(bid.did);
|
|
7137
7171
|
const bidPanelId = `bid-view-${bid.id}`;
|
|
7138
|
-
const bidPanelContent =
|
|
7172
|
+
const bidPanelContent = useMemo29(
|
|
7139
7173
|
() => /* @__PURE__ */ React69.createElement(
|
|
7140
7174
|
BidViewPanel,
|
|
7141
7175
|
{
|
|
@@ -7290,12 +7324,12 @@ var BidRoleSelectPanel = ({ editor, block, collectionId, openEA, openSA, userRol
|
|
|
7290
7324
|
};
|
|
7291
7325
|
|
|
7292
7326
|
// src/mantine/blocks/components/bid/components/BidSurveyPanel.tsx
|
|
7293
|
-
import React72, { useMemo as
|
|
7327
|
+
import React72, { useMemo as useMemo31, useEffect as useEffect29, useRef as useRef9, useCallback as useCallback28 } from "react";
|
|
7294
7328
|
import { Loader as Loader9, Stack as Stack46, Text as Text46 } from "@mantine/core";
|
|
7295
7329
|
import { Survey as Survey4 } from "@ixo/surveys";
|
|
7296
7330
|
|
|
7297
7331
|
// src/mantine/blocks/components/bid/hooks/useBidSurvey.ts
|
|
7298
|
-
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";
|
|
7299
7333
|
import { SurveyModel as SurveyModel4 } from "@ixo/surveys";
|
|
7300
7334
|
function useBidSurvey(deedId, collectionId, role, onSubmitComplete, execution, executeHookedActions) {
|
|
7301
7335
|
const handlers = useBlocknoteHandlers();
|
|
@@ -7322,7 +7356,7 @@ function useBidSurvey(deedId, collectionId, role, onSubmitComplete, execution, e
|
|
|
7322
7356
|
};
|
|
7323
7357
|
fetchSurveyTemplate();
|
|
7324
7358
|
}, [deedId, role, handlers]);
|
|
7325
|
-
const surveyModel =
|
|
7359
|
+
const surveyModel = useMemo30(() => {
|
|
7326
7360
|
if (!surveyJson) return null;
|
|
7327
7361
|
const model = new SurveyModel4(surveyJson);
|
|
7328
7362
|
model.applyTheme(surveyTheme);
|
|
@@ -7345,7 +7379,8 @@ function useBidSurvey(deedId, collectionId, role, onSubmitComplete, execution, e
|
|
|
7345
7379
|
invocationStore: execution.invocationStore,
|
|
7346
7380
|
flowUri: execution.flowUri || "",
|
|
7347
7381
|
flowId: execution.flowId || "",
|
|
7348
|
-
flowOwnerDid: execution.flowOwnerDid || ""
|
|
7382
|
+
flowOwnerDid: execution.flowOwnerDid || "",
|
|
7383
|
+
schemaVersion: execution.schemaVersion || "0.3"
|
|
7349
7384
|
},
|
|
7350
7385
|
pin: "",
|
|
7351
7386
|
// TODO: collect PIN from user for invocation signing
|
|
@@ -7405,7 +7440,7 @@ var BidSurveyPanel = ({ editor, block, deedId, collectionId, role, onSubmitCompl
|
|
|
7405
7440
|
const stableHandleSurveyComplete = useCallback28((sender) => {
|
|
7406
7441
|
handleSurveyCompleteRef.current(sender);
|
|
7407
7442
|
}, []);
|
|
7408
|
-
const surveyContainerStyle =
|
|
7443
|
+
const surveyContainerStyle = useMemo31(
|
|
7409
7444
|
() => ({
|
|
7410
7445
|
flex: 1,
|
|
7411
7446
|
overflow: "auto",
|
|
@@ -7478,6 +7513,9 @@ var BidCollectionItem = ({ collection, editor, block, deedId, adminAddress, user
|
|
|
7478
7513
|
},
|
|
7479
7514
|
get editor() {
|
|
7480
7515
|
return executionRef.current.editor;
|
|
7516
|
+
},
|
|
7517
|
+
get schemaVersion() {
|
|
7518
|
+
return executionRef.current.schemaVersion;
|
|
7481
7519
|
}
|
|
7482
7520
|
}),
|
|
7483
7521
|
[]
|
|
@@ -7494,7 +7532,7 @@ var BidCollectionItem = ({ collection, editor, block, deedId, adminAddress, user
|
|
|
7494
7532
|
const isBidSubmissionAllowed = userRole !== "SA" /* ServiceProvider */ && userRole !== "EA" /* Evaluator */ && !isController && !userBid && isAuthorized2;
|
|
7495
7533
|
const isLoading = authLoading || userBidLoading;
|
|
7496
7534
|
const serviceAgentPanelId = `bid-survey-${collection.id}-service_agent`;
|
|
7497
|
-
const serviceAgentPanelContent =
|
|
7535
|
+
const serviceAgentPanelContent = useMemo32(
|
|
7498
7536
|
() => /* @__PURE__ */ React73.createElement(
|
|
7499
7537
|
BidSurveyPanel,
|
|
7500
7538
|
{
|
|
@@ -7512,7 +7550,7 @@ var BidCollectionItem = ({ collection, editor, block, deedId, adminAddress, user
|
|
|
7512
7550
|
);
|
|
7513
7551
|
const { open: openServiceAgent, opened: SAOpened } = usePanel(serviceAgentPanelId, serviceAgentPanelContent);
|
|
7514
7552
|
const evaluationAgentPanelId = `bid-survey-${collection.id}-evaluation_agent`;
|
|
7515
|
-
const evaluationAgentPanelContent =
|
|
7553
|
+
const evaluationAgentPanelContent = useMemo32(
|
|
7516
7554
|
() => /* @__PURE__ */ React73.createElement(
|
|
7517
7555
|
BidSurveyPanel,
|
|
7518
7556
|
{
|
|
@@ -7530,7 +7568,7 @@ var BidCollectionItem = ({ collection, editor, block, deedId, adminAddress, user
|
|
|
7530
7568
|
);
|
|
7531
7569
|
const { open: openEvaluationAgent, opened: EAOpened } = usePanel(evaluationAgentPanelId, evaluationAgentPanelContent);
|
|
7532
7570
|
const roleSelectionPanelId = `role-survey-${collection.id}`;
|
|
7533
|
-
const bidRoleSelectionPanel =
|
|
7571
|
+
const bidRoleSelectionPanel = useMemo32(
|
|
7534
7572
|
() => /* @__PURE__ */ React73.createElement(
|
|
7535
7573
|
BidRoleSelectPanel,
|
|
7536
7574
|
{
|
|
@@ -7550,7 +7588,7 @@ var BidCollectionItem = ({ collection, editor, block, deedId, adminAddress, user
|
|
|
7550
7588
|
);
|
|
7551
7589
|
const { open: openRoleSelectionPanel, opened: bidPanelOpened } = usePanel(roleSelectionPanelId, bidRoleSelectionPanel);
|
|
7552
7590
|
const bidsListPanelId = `bids-list-${collection.id}`;
|
|
7553
|
-
const bidsListPanelContent =
|
|
7591
|
+
const bidsListPanelContent = useMemo32(
|
|
7554
7592
|
() => /* @__PURE__ */ React73.createElement(
|
|
7555
7593
|
BidsList,
|
|
7556
7594
|
{
|
|
@@ -7583,11 +7621,11 @@ var BidCollectionItem = ({ collection, editor, block, deedId, adminAddress, user
|
|
|
7583
7621
|
};
|
|
7584
7622
|
|
|
7585
7623
|
// src/mantine/blocks/evaluator/flow/EvaluationCollectionItem.tsx
|
|
7586
|
-
import React76, { useMemo as
|
|
7624
|
+
import React76, { useMemo as useMemo35, useEffect as useEffect31, useRef as useRef10 } from "react";
|
|
7587
7625
|
import { Group as Group22, Stack as Stack50, Text as Text50 } from "@mantine/core";
|
|
7588
7626
|
|
|
7589
7627
|
// src/mantine/blocks/evaluator/flow/ClaimsList.tsx
|
|
7590
|
-
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";
|
|
7591
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";
|
|
7592
7630
|
|
|
7593
7631
|
// src/mantine/utils/claimStatus.ts
|
|
@@ -7834,7 +7872,7 @@ var surveyTheme2 = {
|
|
|
7834
7872
|
};
|
|
7835
7873
|
|
|
7836
7874
|
// src/mantine/blocks/evaluator/flow/RubricEvaluationResults.tsx
|
|
7837
|
-
import React74, { useMemo as
|
|
7875
|
+
import React74, { useMemo as useMemo33 } from "react";
|
|
7838
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";
|
|
7839
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";
|
|
7840
7878
|
var getOutcomeConfig = (outcome) => {
|
|
@@ -7901,7 +7939,7 @@ var formatTimestamp = (timestamp) => {
|
|
|
7901
7939
|
};
|
|
7902
7940
|
var RubricEvaluationResults = ({ evaluation }) => {
|
|
7903
7941
|
const { trace, error } = evaluation;
|
|
7904
|
-
const stats =
|
|
7942
|
+
const stats = useMemo33(() => {
|
|
7905
7943
|
if (!trace?.result?.steps) return null;
|
|
7906
7944
|
const steps = trace.result.steps;
|
|
7907
7945
|
const passed = steps.filter((s) => s.success).length;
|
|
@@ -8235,7 +8273,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
8235
8273
|
setPaymentAmount("");
|
|
8236
8274
|
fetchClaims();
|
|
8237
8275
|
}, [fetchClaims]);
|
|
8238
|
-
const surveyModel =
|
|
8276
|
+
const surveyModel = useMemo34(() => {
|
|
8239
8277
|
if (!surveyJson || !claimData) return null;
|
|
8240
8278
|
const model = new SurveyModel5(surveyJson);
|
|
8241
8279
|
model.applyTheme(surveyTheme2);
|
|
@@ -8247,7 +8285,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
8247
8285
|
}
|
|
8248
8286
|
return model;
|
|
8249
8287
|
}, [surveyJson, claimData]);
|
|
8250
|
-
const surveyContainerStyle =
|
|
8288
|
+
const surveyContainerStyle = useMemo34(
|
|
8251
8289
|
() => ({
|
|
8252
8290
|
flex: 1,
|
|
8253
8291
|
overflow: "auto",
|
|
@@ -8445,7 +8483,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
8445
8483
|
setEvaluating(false);
|
|
8446
8484
|
}
|
|
8447
8485
|
}, [selectedClaim, handlers, deedId, collectionId, adminAddress, evaluationResult, handleBackToList, onEvaluationComplete, editor, buildPaymentCoin]);
|
|
8448
|
-
const isClaimAlreadyEvaluated =
|
|
8486
|
+
const isClaimAlreadyEvaluated = useMemo34(() => {
|
|
8449
8487
|
if (!selectedClaim) return false;
|
|
8450
8488
|
return isClaimEvaluated(selectedClaim);
|
|
8451
8489
|
}, [selectedClaim]);
|
|
@@ -8604,7 +8642,7 @@ var EvaluationCollectionItem = ({ collection, block, deedId, adminAddress, edito
|
|
|
8604
8642
|
const canEvaluateClaims = isEvaluator;
|
|
8605
8643
|
const claimsPanelId = `evaluator-claims-list-${collection.id}`;
|
|
8606
8644
|
const collectionName = getCollectionName2(collection);
|
|
8607
|
-
const claimsPanelContent =
|
|
8645
|
+
const claimsPanelContent = useMemo35(
|
|
8608
8646
|
() => /* @__PURE__ */ React76.createElement(
|
|
8609
8647
|
ClaimsList,
|
|
8610
8648
|
{
|
|
@@ -8720,7 +8758,7 @@ var ClaimCollectionsList = ({
|
|
|
8720
8758
|
// src/mantine/blocks/evaluator/flow/FlowView.tsx
|
|
8721
8759
|
var EvaluatorFlowView = ({ editor, block }) => {
|
|
8722
8760
|
const userAddress = useCurrentUser();
|
|
8723
|
-
const selectedCollectionIds =
|
|
8761
|
+
const selectedCollectionIds = useMemo36(() => {
|
|
8724
8762
|
try {
|
|
8725
8763
|
const parsed = JSON.parse(block.props.selectedCollections || "[]");
|
|
8726
8764
|
return Array.isArray(parsed) ? parsed : [];
|
|
@@ -9112,7 +9150,7 @@ var ClaimsEvaluation = ({ collectionId, adminAddress, deedId, claim, onRefresh }
|
|
|
9112
9150
|
setEvaluating(false);
|
|
9113
9151
|
}
|
|
9114
9152
|
}, [claim, handlers, deedId, collectionId, adminAddress, evaluationResult, onRefresh, editor, buildPaymentCoin]);
|
|
9115
|
-
const isClaimAlreadyEvaluated =
|
|
9153
|
+
const isClaimAlreadyEvaluated = useMemo37(() => {
|
|
9116
9154
|
if (!claim) return false;
|
|
9117
9155
|
const claimStatus = getClaimStatus(claim);
|
|
9118
9156
|
return claimStatus.status === "Approved" || claimStatus.status === "Rejected";
|
|
@@ -9137,12 +9175,12 @@ var ListSelectionPanel = ({ selectedIds, listConfig, listData, listType, userRol
|
|
|
9137
9175
|
const [loading, setLoading] = useState34(false);
|
|
9138
9176
|
const [error, setError] = useState34(null);
|
|
9139
9177
|
const isEvaluator = userRole === "EA" /* Evaluator */;
|
|
9140
|
-
const selectedItemId =
|
|
9178
|
+
const selectedItemId = useMemo38(() => {
|
|
9141
9179
|
if (selectedIds.size === 0) return null;
|
|
9142
9180
|
const idsArray = Array.from(selectedIds);
|
|
9143
9181
|
return idsArray[idsArray.length - 1];
|
|
9144
9182
|
}, [selectedIds]);
|
|
9145
|
-
const panelConfig =
|
|
9183
|
+
const panelConfig = useMemo38(() => {
|
|
9146
9184
|
if (!listType) return null;
|
|
9147
9185
|
return getSelectionPanelConfig(listType);
|
|
9148
9186
|
}, [listType]);
|
|
@@ -9174,7 +9212,7 @@ var ListSelectionPanel = ({ selectedIds, listConfig, listData, listType, userRol
|
|
|
9174
9212
|
};
|
|
9175
9213
|
fetchItemDetails();
|
|
9176
9214
|
}, [selectedItemId, listType, handlers, panelConfig, listData?.items]);
|
|
9177
|
-
const tabs =
|
|
9215
|
+
const tabs = useMemo38(() => {
|
|
9178
9216
|
switch (listType) {
|
|
9179
9217
|
case "claims":
|
|
9180
9218
|
return [
|
|
@@ -9297,12 +9335,12 @@ var DaosList = ({ items, isMultiSelect, isItemChecked, onItemCheck }) => {
|
|
|
9297
9335
|
};
|
|
9298
9336
|
|
|
9299
9337
|
// src/mantine/blocks/list/claims/ClaimsList.tsx
|
|
9300
|
-
import React86, { useState as useState35, useEffect as useEffect34, useMemo as
|
|
9338
|
+
import React86, { useState as useState35, useEffect as useEffect34, useMemo as useMemo39 } from "react";
|
|
9301
9339
|
import { Text as Text58, Stack as Stack58, Flex as Flex25, Box as Box27, Group as Group24 } from "@mantine/core";
|
|
9302
9340
|
var ClaimsList2 = ({ items, isMultiSelect, isItemChecked, onItemCheck }) => {
|
|
9303
9341
|
const handlers = useBlocknoteHandlers();
|
|
9304
9342
|
const [profiles, setProfiles] = useState35({});
|
|
9305
|
-
const uniqueAgentDids =
|
|
9343
|
+
const uniqueAgentDids = useMemo39(() => {
|
|
9306
9344
|
const dids = /* @__PURE__ */ new Set();
|
|
9307
9345
|
items.forEach((item) => {
|
|
9308
9346
|
if (item.agentDid) {
|
|
@@ -9639,12 +9677,12 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
9639
9677
|
const [runtimeSearchValue, setRuntimeSearchValue] = useState37(null);
|
|
9640
9678
|
const [isSearchOpen, setIsSearchOpen] = useState37(false);
|
|
9641
9679
|
const panelId = `${LIST_FLOW_PANEL_ID}-${block.id}`;
|
|
9642
|
-
const panelContent =
|
|
9680
|
+
const panelContent = useMemo40(() => /* @__PURE__ */ React88.createElement(TemplateConfig2, { editor, block }), [editor, block]);
|
|
9643
9681
|
const { open: openPanel } = usePanel(panelId, panelContent);
|
|
9644
9682
|
const handlers = useBlocknoteHandlers();
|
|
9645
9683
|
const listType = block.props.listType && block.props.listType !== "" ? block.props.listType : null;
|
|
9646
9684
|
const { subscribe } = useListBlocksUI();
|
|
9647
|
-
const listConfig =
|
|
9685
|
+
const listConfig = useMemo40(() => {
|
|
9648
9686
|
if (block.props.listConfig && block.props.listConfig !== "{}") {
|
|
9649
9687
|
try {
|
|
9650
9688
|
return JSON.parse(block.props.listConfig);
|
|
@@ -9659,7 +9697,7 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
9659
9697
|
}, []);
|
|
9660
9698
|
const fetchDataRef = useRef12(null);
|
|
9661
9699
|
const selectionPanelId = `${LIST_SELECTION_FLOW_PANEL_ID}-${block.id}`;
|
|
9662
|
-
const selectionPanelContent =
|
|
9700
|
+
const selectionPanelContent = useMemo40(
|
|
9663
9701
|
() => /* @__PURE__ */ React88.createElement(
|
|
9664
9702
|
ListSelectionPanel,
|
|
9665
9703
|
{
|
|
@@ -9724,7 +9762,7 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
9724
9762
|
},
|
|
9725
9763
|
[setRuntimeSearchValue, setPage]
|
|
9726
9764
|
);
|
|
9727
|
-
const listSortConfigOptions =
|
|
9765
|
+
const listSortConfigOptions = useMemo40(() => {
|
|
9728
9766
|
if (block.props.sortOptions && block.props.sortOptions !== "{}") {
|
|
9729
9767
|
try {
|
|
9730
9768
|
return JSON.parse(block.props.sortOptions);
|
|
@@ -9734,7 +9772,7 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
9734
9772
|
}
|
|
9735
9773
|
return {};
|
|
9736
9774
|
}, [block.props.sortOptions]);
|
|
9737
|
-
const listFilterConfigOptions =
|
|
9775
|
+
const listFilterConfigOptions = useMemo40(() => {
|
|
9738
9776
|
if (block.props.filterOptions && block.props.filterOptions !== "{}") {
|
|
9739
9777
|
try {
|
|
9740
9778
|
return JSON.parse(block.props.filterOptions);
|
|
@@ -9744,7 +9782,7 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
9744
9782
|
}
|
|
9745
9783
|
return {};
|
|
9746
9784
|
}, [block.props.filterOptions]);
|
|
9747
|
-
const listFilterConfig =
|
|
9785
|
+
const listFilterConfig = useMemo40(() => {
|
|
9748
9786
|
if (block.props.filter && block.props.filter !== "{}") {
|
|
9749
9787
|
try {
|
|
9750
9788
|
return JSON.parse(block.props.filter);
|
|
@@ -9754,7 +9792,7 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
9754
9792
|
}
|
|
9755
9793
|
return {};
|
|
9756
9794
|
}, [block.props.filter]);
|
|
9757
|
-
const listSortConfig =
|
|
9795
|
+
const listSortConfig = useMemo40(() => {
|
|
9758
9796
|
if (block.props.sort && block.props.sort !== "{}") {
|
|
9759
9797
|
try {
|
|
9760
9798
|
return JSON.parse(block.props.sort);
|
|
@@ -9999,11 +10037,11 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
9999
10037
|
}
|
|
10000
10038
|
updateProps({ sort: JSON.stringify(sortOption) });
|
|
10001
10039
|
};
|
|
10002
|
-
const sortedData =
|
|
10040
|
+
const sortedData = useMemo40(() => {
|
|
10003
10041
|
if (!data) return null;
|
|
10004
10042
|
return sortListItems(data, listSortConfig);
|
|
10005
10043
|
}, [data?.items, listSortConfig]);
|
|
10006
|
-
const filteredData =
|
|
10044
|
+
const filteredData = useMemo40(() => {
|
|
10007
10045
|
if (!listFilterConfig?.key) return sortedData;
|
|
10008
10046
|
if (!sortedData) return null;
|
|
10009
10047
|
if (listType === "daos" && daoRoleFilter) return sortedData;
|
|
@@ -10303,7 +10341,7 @@ import { createReactBlockSpec as createReactBlockSpec5 } from "@blocknote/react"
|
|
|
10303
10341
|
import React134 from "react";
|
|
10304
10342
|
|
|
10305
10343
|
// src/mantine/blocks/proposal/template/TemplateView.tsx
|
|
10306
|
-
import React128, { useMemo as
|
|
10344
|
+
import React128, { useMemo as useMemo42 } from "react";
|
|
10307
10345
|
|
|
10308
10346
|
// src/mantine/blocks/proposal/template/TemplateConfig.tsx
|
|
10309
10347
|
import React127, { useCallback as useCallback33 } from "react";
|
|
@@ -10533,7 +10571,7 @@ var ActionsCard = ({ actions, isSelected, onClick, onEditAction, onRemoveAction,
|
|
|
10533
10571
|
};
|
|
10534
10572
|
|
|
10535
10573
|
// src/mantine/blocks/proposal/ActionsPanel.tsx
|
|
10536
|
-
import React124, { useState as useState46, useEffect as useEffect39, useMemo as
|
|
10574
|
+
import React124, { useState as useState46, useEffect as useEffect39, useMemo as useMemo41 } from "react";
|
|
10537
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";
|
|
10538
10576
|
|
|
10539
10577
|
// src/mantine/blocks/proposal/actions-components/SpendActionForm.tsx
|
|
@@ -12425,7 +12463,7 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
12425
12463
|
return config?.getDefaultData() || {};
|
|
12426
12464
|
});
|
|
12427
12465
|
const currentActionConfig = getActionConfig(selectedActionType);
|
|
12428
|
-
const categorizedActions =
|
|
12466
|
+
const categorizedActions = useMemo41(() => getCategorizedActions(), []);
|
|
12429
12467
|
useEffect39(() => {
|
|
12430
12468
|
if (!isEditing) {
|
|
12431
12469
|
const config = getActionConfig(selectedActionType);
|
|
@@ -12713,13 +12751,13 @@ import { Group as Group38, Stack as Stack96, Text as Text72 } from "@mantine/cor
|
|
|
12713
12751
|
var PROPOSAL_TEMPLATE_PANEL_ID = "proposal-template-panel";
|
|
12714
12752
|
var ProposalTemplateView = ({ editor, block }) => {
|
|
12715
12753
|
const panelId = `${PROPOSAL_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
12716
|
-
const panelContent =
|
|
12754
|
+
const panelContent = useMemo42(() => /* @__PURE__ */ React128.createElement(TemplateConfig4, { editor, block }), [editor, block]);
|
|
12717
12755
|
const { open } = usePanel(panelId, panelContent);
|
|
12718
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")));
|
|
12719
12757
|
};
|
|
12720
12758
|
|
|
12721
12759
|
// src/mantine/blocks/proposal/flow/FlowView.tsx
|
|
12722
|
-
import React133, { useMemo as
|
|
12760
|
+
import React133, { useMemo as useMemo43 } from "react";
|
|
12723
12761
|
|
|
12724
12762
|
// src/mantine/blocks/proposal/components/OnChainProposalCard.tsx
|
|
12725
12763
|
import React129 from "react";
|
|
@@ -13556,7 +13594,7 @@ var ProposalFlowView = ({ block, editor }) => {
|
|
|
13556
13594
|
block,
|
|
13557
13595
|
editor
|
|
13558
13596
|
});
|
|
13559
|
-
const panelContent =
|
|
13597
|
+
const panelContent = useMemo43(() => /* @__PURE__ */ React133.createElement(FlowConfig2, { editor, block }), [editor, block]);
|
|
13560
13598
|
const { open } = usePanel(panelId, panelContent);
|
|
13561
13599
|
const handleVote = () => {
|
|
13562
13600
|
open();
|
|
@@ -13658,7 +13696,7 @@ var ProposalBlockSpec = createReactBlockSpec5(
|
|
|
13658
13696
|
);
|
|
13659
13697
|
|
|
13660
13698
|
// src/mantine/blocks/enumChecklist/EnumChecklistBlock.tsx
|
|
13661
|
-
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";
|
|
13662
13700
|
import { createReactBlockSpec as createReactBlockSpec6 } from "@blocknote/react";
|
|
13663
13701
|
import { Stack as Stack106, Text as Text82, Button as Button26, ActionIcon as ActionIcon14, Center as Center10, Flex as Flex29 } from "@mantine/core";
|
|
13664
13702
|
|
|
@@ -14030,7 +14068,7 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
|
14030
14068
|
const [modalOpened, setModalOpened] = useState54(false);
|
|
14031
14069
|
const { editable } = useBlocknoteContext();
|
|
14032
14070
|
const listType = block.props.listType && block.props.listType !== "" ? block.props.listType : null;
|
|
14033
|
-
const listConfig =
|
|
14071
|
+
const listConfig = useMemo44(() => {
|
|
14034
14072
|
if (block.props.listConfig && block.props.listConfig !== "{}") {
|
|
14035
14073
|
try {
|
|
14036
14074
|
return JSON.parse(block.props.listConfig);
|
|
@@ -14040,7 +14078,7 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
|
14040
14078
|
}
|
|
14041
14079
|
return {};
|
|
14042
14080
|
}, [block.props.listConfig]);
|
|
14043
|
-
const selectedIds =
|
|
14081
|
+
const selectedIds = useMemo44(() => {
|
|
14044
14082
|
if (block.props.selectedIds && block.props.selectedIds !== "[]") {
|
|
14045
14083
|
try {
|
|
14046
14084
|
return new Set(JSON.parse(block.props.selectedIds));
|
|
@@ -14166,10 +14204,10 @@ import { createReactBlockSpec as createReactBlockSpec7 } from "@blocknote/react"
|
|
|
14166
14204
|
import React151 from "react";
|
|
14167
14205
|
|
|
14168
14206
|
// src/mantine/blocks/apiRequest/template/TemplateView.tsx
|
|
14169
|
-
import React149, { useMemo as
|
|
14207
|
+
import React149, { useMemo as useMemo49 } from "react";
|
|
14170
14208
|
|
|
14171
14209
|
// src/mantine/blocks/apiRequest/template/TemplateConfig.tsx
|
|
14172
|
-
import React148, { useCallback as useCallback39, useMemo as
|
|
14210
|
+
import React148, { useCallback as useCallback39, useMemo as useMemo48 } from "react";
|
|
14173
14211
|
import { IconSettings as IconSettings7, IconCode as IconCode2, IconShieldCheck as IconShieldCheck7, IconUser as IconUser7, IconChecklist as IconChecklist5, IconClock as IconClock6 } from "@tabler/icons-react";
|
|
14174
14212
|
|
|
14175
14213
|
// src/mantine/blocks/apiRequest/template/GeneralTab.tsx
|
|
@@ -14178,12 +14216,12 @@ import { Divider as Divider11, Stack as Stack108, Text as Text84, Button as Butt
|
|
|
14178
14216
|
import { IconTrash as IconTrash2, IconPlus as IconPlus3 } from "@tabler/icons-react";
|
|
14179
14217
|
|
|
14180
14218
|
// src/mantine/components/DataInput/DataInput.tsx
|
|
14181
|
-
import React144, { useState as useState56, useCallback as useCallback37, useMemo as
|
|
14219
|
+
import React144, { useState as useState56, useCallback as useCallback37, useMemo as useMemo46 } from "react";
|
|
14182
14220
|
import { Input, ActionIcon as ActionIcon16, Tooltip as Tooltip8, Group as Group46 } from "@mantine/core";
|
|
14183
14221
|
import { IconVariable, IconX as IconX9 } from "@tabler/icons-react";
|
|
14184
14222
|
|
|
14185
14223
|
// src/mantine/components/DataInput/BlockPropSelector.tsx
|
|
14186
|
-
import React143, { useState as useState55, useMemo as
|
|
14224
|
+
import React143, { useState as useState55, useMemo as useMemo45 } from "react";
|
|
14187
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";
|
|
14188
14226
|
import { IconSearch as IconSearch4, IconX as IconX8, IconChevronRight as IconChevronRight4, IconArrowLeft as IconArrowLeft4, IconBolt as IconBolt4 } from "@tabler/icons-react";
|
|
14189
14227
|
function buildPropertyTree(properties) {
|
|
@@ -14245,7 +14283,7 @@ function BlockPropSelector({ children, opened, onClose, onSelect, editorDocument
|
|
|
14245
14283
|
const [searchQuery, setSearchQuery] = useState55("");
|
|
14246
14284
|
const [selectedBlock, setSelectedBlock] = useState55(null);
|
|
14247
14285
|
const [navigationPath, setNavigationPath] = useState55([]);
|
|
14248
|
-
const availableBlocks =
|
|
14286
|
+
const availableBlocks = useMemo45(() => {
|
|
14249
14287
|
if (!editorDocument) return [];
|
|
14250
14288
|
return editorDocument.filter((block) => {
|
|
14251
14289
|
if (currentBlockId && block.id === currentBlockId) return false;
|
|
@@ -14257,7 +14295,7 @@ function BlockPropSelector({ children, opened, onClose, onSelect, editorDocument
|
|
|
14257
14295
|
propertyTree: buildPropertyTree(getConditionableProperties(block.type, block))
|
|
14258
14296
|
}));
|
|
14259
14297
|
}, [editorDocument, currentBlockId]);
|
|
14260
|
-
const filteredBlocks =
|
|
14298
|
+
const filteredBlocks = useMemo45(() => {
|
|
14261
14299
|
if (!searchQuery.trim()) return availableBlocks;
|
|
14262
14300
|
const query = searchQuery.toLowerCase();
|
|
14263
14301
|
return availableBlocks.filter((block) => {
|
|
@@ -14266,7 +14304,7 @@ function BlockPropSelector({ children, opened, onClose, onSelect, editorDocument
|
|
|
14266
14304
|
return block.properties.some((prop) => prop.name.toLowerCase().includes(query) || prop.displayName.toLowerCase().includes(query));
|
|
14267
14305
|
});
|
|
14268
14306
|
}, [availableBlocks, searchQuery]);
|
|
14269
|
-
const currentNodes =
|
|
14307
|
+
const currentNodes = useMemo45(() => {
|
|
14270
14308
|
if (!selectedBlock) return [];
|
|
14271
14309
|
if (navigationPath.length === 0) return selectedBlock.propertyTree;
|
|
14272
14310
|
return navigationPath[navigationPath.length - 1].children;
|
|
@@ -14502,8 +14540,8 @@ function DataInput({
|
|
|
14502
14540
|
size = "sm"
|
|
14503
14541
|
}) {
|
|
14504
14542
|
const [selectorOpened, setSelectorOpened] = useState56(false);
|
|
14505
|
-
const containsReferences =
|
|
14506
|
-
const references =
|
|
14543
|
+
const containsReferences = useMemo46(() => hasReferences(value), [value]);
|
|
14544
|
+
const references = useMemo46(() => parseReferences(value || ""), [value]);
|
|
14507
14545
|
const handleOpenSelector = useCallback37(() => setSelectorOpened(true), []);
|
|
14508
14546
|
const handleCloseSelector = useCallback37(() => setSelectorOpened(false), []);
|
|
14509
14547
|
const handleSelectProperty = useCallback37(
|
|
@@ -14820,11 +14858,11 @@ var ResponseSchemaTab = ({ schema, onSchemaChange, blockId }) => {
|
|
|
14820
14858
|
};
|
|
14821
14859
|
|
|
14822
14860
|
// src/mantine/components/EvaluationTab.tsx
|
|
14823
|
-
import React147, { useMemo as
|
|
14861
|
+
import React147, { useMemo as useMemo47, useState as useState58, useEffect as useEffect47, useCallback as useCallback38 } from "react";
|
|
14824
14862
|
import { Stack as Stack110, TextInput as TextInput5, Text as Text86 } from "@mantine/core";
|
|
14825
14863
|
var EvaluationTab = ({ editor, block: initialBlock }) => {
|
|
14826
14864
|
const [, forceUpdate] = useState58({});
|
|
14827
|
-
const block =
|
|
14865
|
+
const block = useMemo47(() => {
|
|
14828
14866
|
const doc = editor?.document || [];
|
|
14829
14867
|
return doc.find((b) => b.id === initialBlock.id) || initialBlock;
|
|
14830
14868
|
}, [editor?.document, initialBlock]);
|
|
@@ -14894,10 +14932,10 @@ var TemplateConfig5 = ({ editor, block }) => {
|
|
|
14894
14932
|
},
|
|
14895
14933
|
[updateProp]
|
|
14896
14934
|
);
|
|
14897
|
-
const parsedResponseSchema =
|
|
14935
|
+
const parsedResponseSchema = useMemo48(() => {
|
|
14898
14936
|
return parseResponseSchema(block.props.responseSchema);
|
|
14899
14937
|
}, [block.props.responseSchema]);
|
|
14900
|
-
const tabs =
|
|
14938
|
+
const tabs = useMemo48(
|
|
14901
14939
|
() => [
|
|
14902
14940
|
{
|
|
14903
14941
|
label: "General",
|
|
@@ -15000,8 +15038,8 @@ var ApiRequestTemplateView = ({ editor, block }) => {
|
|
|
15000
15038
|
const panelId = `${API_REQUEST_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
15001
15039
|
const assignmentPanelId = `${API_REQUEST_ASSIGNMENT_PANEL_ID}-${block.id}`;
|
|
15002
15040
|
const { closePanel } = usePanelStore();
|
|
15003
|
-
const panelContent =
|
|
15004
|
-
const assignmentPanelContent =
|
|
15041
|
+
const panelContent = useMemo49(() => /* @__PURE__ */ React149.createElement(TemplateConfig5, { editor, block }), [editor, block]);
|
|
15042
|
+
const assignmentPanelContent = useMemo49(
|
|
15005
15043
|
() => /* @__PURE__ */ React149.createElement(
|
|
15006
15044
|
BaseRightPanelLayout,
|
|
15007
15045
|
{
|
|
@@ -15015,7 +15053,7 @@ var ApiRequestTemplateView = ({ editor, block }) => {
|
|
|
15015
15053
|
const { open } = usePanel(panelId, panelContent);
|
|
15016
15054
|
const { open: openAssignment } = usePanel(assignmentPanelId, assignmentPanelContent);
|
|
15017
15055
|
const commitmentPanelId = `${API_REQUEST_COMMITMENT_PANEL_ID}-${block.id}`;
|
|
15018
|
-
const commitmentPanelContent =
|
|
15056
|
+
const commitmentPanelContent = useMemo49(
|
|
15019
15057
|
() => /* @__PURE__ */ React149.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Commitment Tab" }, /* @__PURE__ */ React149.createElement(CommitmentTab, { editor, block })),
|
|
15020
15058
|
[editor, block, closePanel]
|
|
15021
15059
|
);
|
|
@@ -15042,7 +15080,7 @@ var ApiRequestTemplateView = ({ editor, block }) => {
|
|
|
15042
15080
|
};
|
|
15043
15081
|
|
|
15044
15082
|
// src/mantine/blocks/apiRequest/flow/FlowView.tsx
|
|
15045
|
-
import React150, { useMemo as
|
|
15083
|
+
import React150, { useMemo as useMemo50, useState as useState59 } from "react";
|
|
15046
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";
|
|
15047
15085
|
import { IconSend as IconSend2, IconAlertTriangle as IconAlertTriangle2, IconUser as IconUser9, IconApi } from "@tabler/icons-react";
|
|
15048
15086
|
var getMethodColor2 = (method) => {
|
|
@@ -15094,7 +15132,7 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
|
15094
15132
|
const endpoint = block.props.endpoint || "";
|
|
15095
15133
|
const runtimeState = runtime.state;
|
|
15096
15134
|
const status = runtimeState === "running" ? "loading" : runtimeState === "completed" ? "success" : runtimeState === "failed" ? "error" : "idle";
|
|
15097
|
-
const tabs =
|
|
15135
|
+
const tabs = useMemo50(
|
|
15098
15136
|
() => [
|
|
15099
15137
|
{
|
|
15100
15138
|
label: "Execute",
|
|
@@ -15111,13 +15149,13 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
|
15111
15149
|
],
|
|
15112
15150
|
[editor, block, disabled, isDisabled?.message]
|
|
15113
15151
|
);
|
|
15114
|
-
const panelContent =
|
|
15152
|
+
const panelContent = useMemo50(
|
|
15115
15153
|
() => /* @__PURE__ */ React150.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "API Request Settings", tabs, context: { editor, block } }),
|
|
15116
15154
|
[tabs, editor, block, closePanel]
|
|
15117
15155
|
);
|
|
15118
15156
|
const { open } = usePanel(panelId, panelContent);
|
|
15119
15157
|
const commitmentPanelId = `api-request-flow-commitment-${block.id}`;
|
|
15120
|
-
const commitmentPanelContent =
|
|
15158
|
+
const commitmentPanelContent = useMemo50(
|
|
15121
15159
|
() => /* @__PURE__ */ React150.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Commitment Tab" }, /* @__PURE__ */ React150.createElement(CommitmentTab, { editor, block })),
|
|
15122
15160
|
[editor, block, closePanel]
|
|
15123
15161
|
);
|
|
@@ -15355,7 +15393,7 @@ import { createReactBlockSpec as createReactBlockSpec8 } from "@blocknote/react"
|
|
|
15355
15393
|
import React157 from "react";
|
|
15356
15394
|
|
|
15357
15395
|
// src/mantine/blocks/notify/template/TemplateView.tsx
|
|
15358
|
-
import React155, { useMemo as
|
|
15396
|
+
import React155, { useMemo as useMemo51 } from "react";
|
|
15359
15397
|
|
|
15360
15398
|
// src/mantine/blocks/notify/template/TemplateConfig.tsx
|
|
15361
15399
|
import React154, { useCallback as useCallback40 } from "react";
|
|
@@ -15661,7 +15699,7 @@ import { Group as Group52, Stack as Stack114, Text as Text90, Badge as Badge18 }
|
|
|
15661
15699
|
var NOTIFY_TEMPLATE_PANEL_ID = "notify-template-panel";
|
|
15662
15700
|
var NotifyTemplateView = ({ editor, block }) => {
|
|
15663
15701
|
const panelId = `${NOTIFY_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
15664
|
-
const panelContent =
|
|
15702
|
+
const panelContent = useMemo51(() => /* @__PURE__ */ React155.createElement(TemplateConfig6, { editor, block }), [editor, block]);
|
|
15665
15703
|
const { open } = usePanel(panelId, panelContent);
|
|
15666
15704
|
const channel = block.props.channel || "email";
|
|
15667
15705
|
const to = (() => {
|
|
@@ -15912,7 +15950,7 @@ import { createReactBlockSpec as createReactBlockSpec9 } from "@blocknote/react"
|
|
|
15912
15950
|
import React163 from "react";
|
|
15913
15951
|
|
|
15914
15952
|
// src/mantine/blocks/claim/template/TemplateView.tsx
|
|
15915
|
-
import React161, { useMemo as
|
|
15953
|
+
import React161, { useMemo as useMemo53 } from "react";
|
|
15916
15954
|
import { Group as Group54, Stack as Stack116, Text as Text92 } from "@mantine/core";
|
|
15917
15955
|
|
|
15918
15956
|
// src/mantine/blocks/claim/template/TemplateConfig.tsx
|
|
@@ -15920,7 +15958,7 @@ import React160, { useCallback as useCallback42 } from "react";
|
|
|
15920
15958
|
import { IconSettings as IconSettings9, IconShieldCheck as IconShieldCheck8, IconUser as IconUser10, IconContract as IconContract2, IconChecklist as IconChecklist6, IconClock as IconClock7 } from "@tabler/icons-react";
|
|
15921
15959
|
|
|
15922
15960
|
// src/mantine/blocks/claim/template/GeneralTab.tsx
|
|
15923
|
-
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";
|
|
15924
15962
|
var GeneralTab7 = ({
|
|
15925
15963
|
title,
|
|
15926
15964
|
description,
|
|
@@ -15941,7 +15979,7 @@ var GeneralTab7 = ({
|
|
|
15941
15979
|
useEffect49(() => {
|
|
15942
15980
|
setLocalDescription(description || "");
|
|
15943
15981
|
}, [description]);
|
|
15944
|
-
const parsedSelectedCollections =
|
|
15982
|
+
const parsedSelectedCollections = useMemo52(() => {
|
|
15945
15983
|
try {
|
|
15946
15984
|
return JSON.parse(selectedCollections || "[]");
|
|
15947
15985
|
} catch {
|
|
@@ -16074,28 +16112,29 @@ var TemplateConfig7 = ({ editor, block }) => {
|
|
|
16074
16112
|
var CLAIM_TEMPLATE_PANEL_ID = "claim-template-panel";
|
|
16075
16113
|
var ClaimTemplateView = ({ editor, block }) => {
|
|
16076
16114
|
const panelId = `${CLAIM_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
16077
|
-
const panelContent =
|
|
16115
|
+
const panelContent = useMemo53(() => /* @__PURE__ */ React161.createElement(TemplateConfig7, { editor, block }), [editor, block]);
|
|
16078
16116
|
const { open } = usePanel(panelId, panelContent);
|
|
16079
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 }))));
|
|
16080
16118
|
};
|
|
16081
16119
|
|
|
16082
16120
|
// src/mantine/blocks/claim/flow/FlowView.tsx
|
|
16083
|
-
import React162, { useMemo as
|
|
16121
|
+
import React162, { useMemo as useMemo54, useRef as useRef13, useEffect as useEffect50, useCallback as useCallback43 } from "react";
|
|
16084
16122
|
import { Stack as Stack117, Text as Text93, Loader as Loader22, Center as Center11, Alert as Alert23 } from "@mantine/core";
|
|
16085
16123
|
import { IconAlertCircle as IconAlertCircle10 } from "@tabler/icons-react";
|
|
16086
16124
|
var ClaimFlowView = ({ editor, block }) => {
|
|
16087
16125
|
const userAddress = useCurrentUser();
|
|
16088
|
-
const flowNode =
|
|
16089
|
-
const runtime =
|
|
16090
|
-
const ucanService =
|
|
16091
|
-
const invocationStore =
|
|
16092
|
-
const flowId =
|
|
16093
|
-
const flowOwnerDid =
|
|
16094
|
-
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(() => {
|
|
16095
16134
|
const docId = editor.getFlowMetadata?.()?.doc_id || block.id;
|
|
16096
16135
|
return `ixo:flow:${docId}`;
|
|
16097
16136
|
}, [editor, block.id]);
|
|
16098
|
-
const executionValue =
|
|
16137
|
+
const executionValue = useMemo54(
|
|
16099
16138
|
() => ({
|
|
16100
16139
|
flowNode,
|
|
16101
16140
|
runtime,
|
|
@@ -16104,15 +16143,16 @@ var ClaimFlowView = ({ editor, block }) => {
|
|
|
16104
16143
|
actorDid: userAddress || "",
|
|
16105
16144
|
flowOwnerDid,
|
|
16106
16145
|
flowUri,
|
|
16107
|
-
flowId
|
|
16146
|
+
flowId,
|
|
16147
|
+
schemaVersion
|
|
16108
16148
|
}),
|
|
16109
|
-
[flowNode, runtime, ucanService, invocationStore, userAddress, flowOwnerDid, flowUri, flowId]
|
|
16149
|
+
[flowNode, runtime, ucanService, invocationStore, userAddress, flowOwnerDid, flowUri, flowId, schemaVersion]
|
|
16110
16150
|
);
|
|
16111
16151
|
const executionRef = useRef13(executionValue);
|
|
16112
16152
|
useEffect50(() => {
|
|
16113
16153
|
executionRef.current = executionValue;
|
|
16114
16154
|
}, [executionValue]);
|
|
16115
|
-
const execution =
|
|
16155
|
+
const execution = useMemo54(
|
|
16116
16156
|
() => ({
|
|
16117
16157
|
get flowNode() {
|
|
16118
16158
|
return executionRef.current.flowNode;
|
|
@@ -16137,11 +16177,14 @@ var ClaimFlowView = ({ editor, block }) => {
|
|
|
16137
16177
|
},
|
|
16138
16178
|
get flowId() {
|
|
16139
16179
|
return executionRef.current.flowId;
|
|
16180
|
+
},
|
|
16181
|
+
get schemaVersion() {
|
|
16182
|
+
return executionRef.current.schemaVersion;
|
|
16140
16183
|
}
|
|
16141
16184
|
}),
|
|
16142
16185
|
[]
|
|
16143
16186
|
);
|
|
16144
|
-
const selectedCollectionIds =
|
|
16187
|
+
const selectedCollectionIds = useMemo54(() => {
|
|
16145
16188
|
try {
|
|
16146
16189
|
const parsed = JSON.parse(block.props.selectedCollections || "[]");
|
|
16147
16190
|
return Array.isArray(parsed) ? parsed : [];
|
|
@@ -16244,7 +16287,7 @@ import React166 from "react";
|
|
|
16244
16287
|
import { createReactBlockSpec as createReactBlockSpec10 } from "@blocknote/react";
|
|
16245
16288
|
|
|
16246
16289
|
// src/mantine/blocks/visualization/VisualizationBlock.tsx
|
|
16247
|
-
import React165, { useMemo as
|
|
16290
|
+
import React165, { useMemo as useMemo55, useCallback as useCallback44, useRef as useRef14, useState as useState63, useEffect as useEffect51 } from "react";
|
|
16248
16291
|
import { Box as Box35, Stack as Stack118, Text as Text94, Paper as Paper12, Group as Group55 } from "@mantine/core";
|
|
16249
16292
|
function VisualizationBlock({ block, editor }) {
|
|
16250
16293
|
const { visualizationRenderer } = useBlocknoteContext();
|
|
@@ -16265,7 +16308,7 @@ function VisualizationBlock({ block, editor }) {
|
|
|
16265
16308
|
resizeObserver.disconnect();
|
|
16266
16309
|
};
|
|
16267
16310
|
}, []);
|
|
16268
|
-
const parsedConfig =
|
|
16311
|
+
const parsedConfig = useMemo55(() => {
|
|
16269
16312
|
try {
|
|
16270
16313
|
return typeof config === "string" ? JSON.parse(config) : config;
|
|
16271
16314
|
} catch (e) {
|
|
@@ -16273,7 +16316,7 @@ function VisualizationBlock({ block, editor }) {
|
|
|
16273
16316
|
return null;
|
|
16274
16317
|
}
|
|
16275
16318
|
}, [config]);
|
|
16276
|
-
const parsedPreferences =
|
|
16319
|
+
const parsedPreferences = useMemo55(() => {
|
|
16277
16320
|
try {
|
|
16278
16321
|
return typeof preferences === "string" ? JSON.parse(preferences) : preferences || {};
|
|
16279
16322
|
} catch (e) {
|
|
@@ -16341,7 +16384,7 @@ import React169 from "react";
|
|
|
16341
16384
|
import { createReactBlockSpec as createReactBlockSpec11 } from "@blocknote/react";
|
|
16342
16385
|
|
|
16343
16386
|
// src/mantine/blocks/dynamicList/DynamicListBlock.tsx
|
|
16344
|
-
import React168, { useMemo as
|
|
16387
|
+
import React168, { useMemo as useMemo57, useState as useState65, useCallback as useCallback45, useEffect as useEffect52, useRef as useRef15 } from "react";
|
|
16345
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";
|
|
16346
16389
|
import { useDisclosure as useDisclosure6 } from "@mantine/hooks";
|
|
16347
16390
|
import {
|
|
@@ -16362,7 +16405,7 @@ import {
|
|
|
16362
16405
|
} from "@tabler/icons-react";
|
|
16363
16406
|
|
|
16364
16407
|
// src/mantine/blocks/dynamicList/DynamicListSelectionPanel.tsx
|
|
16365
|
-
import React167, { useMemo as
|
|
16408
|
+
import React167, { useMemo as useMemo56, useState as useState64 } from "react";
|
|
16366
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";
|
|
16367
16410
|
import { IconSparkles as IconSparkles2, IconChevronDown as IconChevronDown6, IconChevronRight as IconChevronRight5 } from "@tabler/icons-react";
|
|
16368
16411
|
function formatKeyAsLabel(key) {
|
|
@@ -16393,7 +16436,7 @@ function DefaultKeyValueView({
|
|
|
16393
16436
|
// actions,
|
|
16394
16437
|
}) {
|
|
16395
16438
|
const [valuesExpanded, setValuesExpanded] = useState64(false);
|
|
16396
|
-
const columnMap =
|
|
16439
|
+
const columnMap = useMemo56(() => {
|
|
16397
16440
|
const map = {};
|
|
16398
16441
|
columns.forEach((col) => {
|
|
16399
16442
|
map[col.key] = col;
|
|
@@ -16523,14 +16566,14 @@ function DynamicListBlock({ block, editor }) {
|
|
|
16523
16566
|
const [orderByCollapsed, setOrderByCollapsed] = useState65(true);
|
|
16524
16567
|
const [columnsCollapsed, setColumnsCollapsed] = useState65(true);
|
|
16525
16568
|
const [showInfo, setShowInfo] = useState65(false);
|
|
16526
|
-
const parsedColumns =
|
|
16569
|
+
const parsedColumns = useMemo57(() => {
|
|
16527
16570
|
try {
|
|
16528
16571
|
return typeof columns === "string" ? JSON.parse(columns) : columns;
|
|
16529
16572
|
} catch {
|
|
16530
16573
|
return [];
|
|
16531
16574
|
}
|
|
16532
16575
|
}, [columns]);
|
|
16533
|
-
const parsedDataSource =
|
|
16576
|
+
const parsedDataSource = useMemo57(() => {
|
|
16534
16577
|
try {
|
|
16535
16578
|
const parsed = typeof dataSource === "string" ? JSON.parse(dataSource) : dataSource;
|
|
16536
16579
|
return parsed && Object.keys(parsed).length > 0 ? parsed : null;
|
|
@@ -16538,7 +16581,7 @@ function DynamicListBlock({ block, editor }) {
|
|
|
16538
16581
|
return null;
|
|
16539
16582
|
}
|
|
16540
16583
|
}, [dataSource]);
|
|
16541
|
-
const parsedSnapshot =
|
|
16584
|
+
const parsedSnapshot = useMemo57(() => {
|
|
16542
16585
|
try {
|
|
16543
16586
|
if (!snapshot || snapshot === "") return null;
|
|
16544
16587
|
return typeof snapshot === "string" ? JSON.parse(snapshot) : snapshot;
|
|
@@ -16546,7 +16589,7 @@ function DynamicListBlock({ block, editor }) {
|
|
|
16546
16589
|
return null;
|
|
16547
16590
|
}
|
|
16548
16591
|
}, [snapshot]);
|
|
16549
|
-
const liveData =
|
|
16592
|
+
const liveData = useMemo57(() => {
|
|
16550
16593
|
if (getDynamicListData && listId) {
|
|
16551
16594
|
return getDynamicListData(listId);
|
|
16552
16595
|
}
|
|
@@ -16555,7 +16598,7 @@ function DynamicListBlock({ block, editor }) {
|
|
|
16555
16598
|
const hasSnapshot = parsedSnapshot && parsedSnapshot.length > 0;
|
|
16556
16599
|
const useSnapshot = hasSnapshot && !useLiveMode;
|
|
16557
16600
|
const rawData = useSnapshot ? parsedSnapshot : liveData.items;
|
|
16558
|
-
const filteredData =
|
|
16601
|
+
const filteredData = useMemo57(() => {
|
|
16559
16602
|
if (!rawData || !searchQuery.trim()) return rawData;
|
|
16560
16603
|
const query = searchQuery.toLowerCase();
|
|
16561
16604
|
return rawData.filter(
|
|
@@ -16565,7 +16608,7 @@ function DynamicListBlock({ block, editor }) {
|
|
|
16565
16608
|
);
|
|
16566
16609
|
}, [rawData, searchQuery]);
|
|
16567
16610
|
const hasData = filteredData && filteredData.length > 0;
|
|
16568
|
-
const sortOptions =
|
|
16611
|
+
const sortOptions = useMemo57(() => {
|
|
16569
16612
|
return parsedColumns.filter((col) => {
|
|
16570
16613
|
if (!rawData || rawData.length <= 1) return true;
|
|
16571
16614
|
const firstValue = rawData[0]?.[col.key];
|
|
@@ -16594,13 +16637,13 @@ function DynamicListBlock({ block, editor }) {
|
|
|
16594
16637
|
return String(aVal).localeCompare(String(bVal)) * dir;
|
|
16595
16638
|
});
|
|
16596
16639
|
}, []);
|
|
16597
|
-
const allData =
|
|
16640
|
+
const allData = useMemo57(() => {
|
|
16598
16641
|
if (!filteredData) return null;
|
|
16599
16642
|
return sortData(filteredData, sortConfig);
|
|
16600
16643
|
}, [filteredData, sortConfig, sortData]);
|
|
16601
16644
|
const totalItems = allData?.length || 0;
|
|
16602
16645
|
const totalPages = Math.ceil(totalItems / DEFAULT_PAGE_SIZE);
|
|
16603
|
-
const paginatedData =
|
|
16646
|
+
const paginatedData = useMemo57(() => {
|
|
16604
16647
|
if (!allData) return null;
|
|
16605
16648
|
const startIndex = (page - 1) * DEFAULT_PAGE_SIZE;
|
|
16606
16649
|
const endIndex = startIndex + DEFAULT_PAGE_SIZE;
|
|
@@ -16641,7 +16684,7 @@ function DynamicListBlock({ block, editor }) {
|
|
|
16641
16684
|
[parsedColumns, editor, block]
|
|
16642
16685
|
);
|
|
16643
16686
|
const panelId = `${DYNAMIC_LIST_SELECTION_PANEL_ID}-${block.id}`;
|
|
16644
|
-
const panelContent =
|
|
16687
|
+
const panelContent = useMemo57(
|
|
16645
16688
|
() => /* @__PURE__ */ React168.createElement(
|
|
16646
16689
|
DynamicListSelectionPanel,
|
|
16647
16690
|
{
|
|
@@ -16655,7 +16698,7 @@ function DynamicListBlock({ block, editor }) {
|
|
|
16655
16698
|
[selectedItem, parsedColumns, parsedDataSource, panelDescription, handlePanelClose]
|
|
16656
16699
|
);
|
|
16657
16700
|
const { open: openSelectionPanel, close: closeSelectionPanel } = usePanel(panelId, panelContent);
|
|
16658
|
-
const columnsByPosition =
|
|
16701
|
+
const columnsByPosition = useMemo57(() => {
|
|
16659
16702
|
const grouped = {
|
|
16660
16703
|
topLeft: void 0,
|
|
16661
16704
|
bottomLeft: void 0,
|
|
@@ -17017,7 +17060,7 @@ import { createReactBlockSpec as createReactBlockSpec12 } from "@blocknote/react
|
|
|
17017
17060
|
import React175 from "react";
|
|
17018
17061
|
|
|
17019
17062
|
// src/mantine/blocks/domainCreator/template/TemplateView.tsx
|
|
17020
|
-
import React172, { useMemo as
|
|
17063
|
+
import React172, { useMemo as useMemo58 } from "react";
|
|
17021
17064
|
import { Badge as Badge21, Group as Group58, Stack as Stack121, Text as Text97 } from "@mantine/core";
|
|
17022
17065
|
|
|
17023
17066
|
// src/mantine/blocks/domainCreator/template/TemplateConfig.tsx
|
|
@@ -17105,18 +17148,18 @@ var TemplateConfig8 = ({ editor, block }) => {
|
|
|
17105
17148
|
var DOMAIN_CREATOR_TEMPLATE_PANEL_ID = "domain-creator-template-panel";
|
|
17106
17149
|
var DomainCreatorTemplateView = ({ editor, block }) => {
|
|
17107
17150
|
const panelId = `${DOMAIN_CREATOR_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
17108
|
-
const panelContent =
|
|
17151
|
+
const panelContent = useMemo58(() => /* @__PURE__ */ React172.createElement(TemplateConfig8, { editor, block }), [editor, block]);
|
|
17109
17152
|
const { open } = usePanel(panelId, panelContent);
|
|
17110
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")))));
|
|
17111
17154
|
};
|
|
17112
17155
|
|
|
17113
17156
|
// src/mantine/blocks/domainCreator/flow/FlowView.tsx
|
|
17114
|
-
import React174, { useCallback as useCallback48, useMemo as
|
|
17157
|
+
import React174, { useCallback as useCallback48, useMemo as useMemo60, useState as useState68 } from "react";
|
|
17115
17158
|
import { ActionIcon as ActionIcon22, Badge as Badge22, Group as Group60, Stack as Stack123, Text as Text99, Tooltip as Tooltip11 } from "@mantine/core";
|
|
17116
17159
|
import { IconChevronRight as IconChevronRight7, IconCheck as IconCheck8, IconAlertCircle as IconAlertCircle12 } from "@tabler/icons-react";
|
|
17117
17160
|
|
|
17118
17161
|
// src/mantine/blocks/domainCreator/flow/DomainCreatorSurveyPanel.tsx
|
|
17119
|
-
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";
|
|
17120
17163
|
import { Alert as Alert24, Button as Button32, Group as Group59, Loader as Loader23, Stack as Stack122, Text as Text98 } from "@mantine/core";
|
|
17121
17164
|
import { useDebouncedCallback } from "@mantine/hooks";
|
|
17122
17165
|
import { IconAlertCircle as IconAlertCircle11, IconCheck as IconCheck7 } from "@tabler/icons-react";
|
|
@@ -17833,7 +17876,7 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
17833
17876
|
const [createdEntityType, setCreatedEntityType] = useState67(existingBlockEntityType || null);
|
|
17834
17877
|
const isUpdatingFromProp = useRef16(false);
|
|
17835
17878
|
const lastSyncedAnswers = useRef16("");
|
|
17836
|
-
const surveyModel =
|
|
17879
|
+
const surveyModel = useMemo59(() => {
|
|
17837
17880
|
const model = new SurveyModel6(tempDomainCreatorSurvey);
|
|
17838
17881
|
model.applyTheme(surveyTheme);
|
|
17839
17882
|
model.showQuestionNumbers = "off";
|
|
@@ -18087,7 +18130,7 @@ var DomainCreatorFlowView = ({ editor, block }) => {
|
|
|
18087
18130
|
[block, editor]
|
|
18088
18131
|
);
|
|
18089
18132
|
const panelId = `${DOMAIN_CREATOR_FLOW_PANEL_ID}-${block.id}`;
|
|
18090
|
-
const panelContent =
|
|
18133
|
+
const panelContent = useMemo60(() => /* @__PURE__ */ React174.createElement(DomainCreatorSurveyPanel, { editor, block, onComplete: handleComplete }), [editor, block, handleComplete]);
|
|
18091
18134
|
const { open } = usePanel(panelId, panelContent);
|
|
18092
18135
|
const handleOpen = () => {
|
|
18093
18136
|
setHasOpened(true);
|
|
@@ -18151,11 +18194,11 @@ import { createReactBlockSpec as createReactBlockSpec13 } from "@blocknote/react
|
|
|
18151
18194
|
import React182 from "react";
|
|
18152
18195
|
|
|
18153
18196
|
// src/mantine/blocks/email/template/TemplateView.tsx
|
|
18154
|
-
import React180, { useMemo as
|
|
18197
|
+
import React180, { useMemo as useMemo63 } from "react";
|
|
18155
18198
|
import { Badge as Badge24, Group as Group62, Stack as Stack126, Text as Text102 } from "@mantine/core";
|
|
18156
18199
|
|
|
18157
18200
|
// src/mantine/blocks/email/template/TemplateConfig.tsx
|
|
18158
|
-
import React179, { useCallback as useCallback51, useMemo as
|
|
18201
|
+
import React179, { useCallback as useCallback51, useMemo as useMemo62 } from "react";
|
|
18159
18202
|
import { IconSettings as IconSettings11, IconVariable as IconVariable2, IconShieldCheck as IconShieldCheck10 } from "@tabler/icons-react";
|
|
18160
18203
|
|
|
18161
18204
|
// src/mantine/blocks/email/template/GeneralTab.tsx
|
|
@@ -18324,20 +18367,20 @@ var GeneralTab9 = ({ editor, blockId, getCurrentBlock, onTitleChange, onTemplate
|
|
|
18324
18367
|
};
|
|
18325
18368
|
|
|
18326
18369
|
// src/mantine/blocks/email/template/VariablesTab.tsx
|
|
18327
|
-
import React178, { useMemo as
|
|
18370
|
+
import React178, { useMemo as useMemo61, useCallback as useCallback50, useState as useState70, useEffect as useEffect56 } from "react";
|
|
18328
18371
|
import { Alert as Alert25, Badge as Badge23, Divider as Divider16, Group as Group61, Stack as Stack125, Text as Text101 } from "@mantine/core";
|
|
18329
18372
|
import { IconInfoCircle as IconInfoCircle4, IconCheck as IconCheck9 } from "@tabler/icons-react";
|
|
18330
18373
|
var VariablesTab = ({ editor, blockId, getCurrentBlock, onVariablesChange }) => {
|
|
18331
18374
|
const block = getCurrentBlock();
|
|
18332
18375
|
const blockProps = block.props;
|
|
18333
|
-
const parsedExtractedVariables =
|
|
18376
|
+
const parsedExtractedVariables = useMemo61(() => {
|
|
18334
18377
|
try {
|
|
18335
18378
|
return JSON.parse(blockProps.extractedVariables || "[]");
|
|
18336
18379
|
} catch {
|
|
18337
18380
|
return [];
|
|
18338
18381
|
}
|
|
18339
18382
|
}, [blockProps.extractedVariables]);
|
|
18340
|
-
const parsedVariableMapping =
|
|
18383
|
+
const parsedVariableMapping = useMemo61(() => {
|
|
18341
18384
|
try {
|
|
18342
18385
|
return JSON.parse(blockProps.variables || "{}");
|
|
18343
18386
|
} catch {
|
|
@@ -18421,7 +18464,7 @@ var TemplateConfig9 = ({ editor, block }) => {
|
|
|
18421
18464
|
},
|
|
18422
18465
|
[updateProp]
|
|
18423
18466
|
);
|
|
18424
|
-
const tabs =
|
|
18467
|
+
const tabs = useMemo62(
|
|
18425
18468
|
() => [
|
|
18426
18469
|
{
|
|
18427
18470
|
label: "General",
|
|
@@ -18461,16 +18504,16 @@ var TemplateConfig9 = ({ editor, block }) => {
|
|
|
18461
18504
|
var EMAIL_TEMPLATE_PANEL_ID = "email-template-panel";
|
|
18462
18505
|
var EmailTemplateView = ({ editor, block }) => {
|
|
18463
18506
|
const panelId = `${EMAIL_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
18464
|
-
const panelContent =
|
|
18507
|
+
const panelContent = useMemo63(() => /* @__PURE__ */ React180.createElement(TemplateConfig9, { editor, block }), [editor, block.id]);
|
|
18465
18508
|
const { open } = usePanel(panelId, panelContent);
|
|
18466
|
-
const extractedVariables =
|
|
18509
|
+
const extractedVariables = useMemo63(() => {
|
|
18467
18510
|
try {
|
|
18468
18511
|
return JSON.parse(block.props.extractedVariables || "[]");
|
|
18469
18512
|
} catch {
|
|
18470
18513
|
return [];
|
|
18471
18514
|
}
|
|
18472
18515
|
}, [block.props.extractedVariables]);
|
|
18473
|
-
const variableMapping =
|
|
18516
|
+
const variableMapping = useMemo63(() => {
|
|
18474
18517
|
try {
|
|
18475
18518
|
return JSON.parse(block.props.variables || "{}");
|
|
18476
18519
|
} catch {
|
|
@@ -18483,7 +18526,7 @@ var EmailTemplateView = ({ editor, block }) => {
|
|
|
18483
18526
|
};
|
|
18484
18527
|
|
|
18485
18528
|
// src/mantine/blocks/email/flow/FlowView.tsx
|
|
18486
|
-
import React181, { useMemo as
|
|
18529
|
+
import React181, { useMemo as useMemo64 } from "react";
|
|
18487
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";
|
|
18488
18531
|
import { IconSend as IconSend4, IconCheck as IconCheck10, IconX as IconX12, IconMail as IconMail3, IconUser as IconUser11 } from "@tabler/icons-react";
|
|
18489
18532
|
|
|
@@ -18609,7 +18652,7 @@ var EmailFlowView = ({ editor, block, isDisabled }) => {
|
|
|
18609
18652
|
const editorDocument = editor.document || [];
|
|
18610
18653
|
const toDisplay = resolveReferences(block.props.to, editorDocument);
|
|
18611
18654
|
const disabled = isDisabled?.isDisabled === "disable";
|
|
18612
|
-
const tabs =
|
|
18655
|
+
const tabs = useMemo64(
|
|
18613
18656
|
() => [
|
|
18614
18657
|
{
|
|
18615
18658
|
label: "Send",
|
|
@@ -18626,14 +18669,14 @@ var EmailFlowView = ({ editor, block, isDisabled }) => {
|
|
|
18626
18669
|
],
|
|
18627
18670
|
[editor, block, isDisabled, disabled]
|
|
18628
18671
|
);
|
|
18629
|
-
const panelContent =
|
|
18672
|
+
const panelContent = useMemo64(
|
|
18630
18673
|
() => /* @__PURE__ */ React181.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Email Details", tabs, context: { editor, block } }),
|
|
18631
18674
|
[tabs, editor, block, closePanel]
|
|
18632
18675
|
);
|
|
18633
18676
|
const panelId = `email-details-panel-${block.id}`;
|
|
18634
18677
|
const { open: openDetails } = usePanel(panelId, panelContent);
|
|
18635
18678
|
const assignmentPanelId = `email-assignment-panel-${block.id}`;
|
|
18636
|
-
const assignmentPanelContent =
|
|
18679
|
+
const assignmentPanelContent = useMemo64(
|
|
18637
18680
|
() => /* @__PURE__ */ React181.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Assignment Tab", isTemplate: false }, /* @__PURE__ */ React181.createElement(AssignmentTab, { editor, block })),
|
|
18638
18681
|
[editor, block, closePanel]
|
|
18639
18682
|
);
|
|
@@ -18757,20 +18800,20 @@ import { createReactBlockSpec as createReactBlockSpec14 } from "@blocknote/react
|
|
|
18757
18800
|
import React190 from "react";
|
|
18758
18801
|
|
|
18759
18802
|
// src/mantine/blocks/protocolSelector/template/TemplateView.tsx
|
|
18760
|
-
import React186, { useMemo as
|
|
18803
|
+
import React186, { useMemo as useMemo66 } from "react";
|
|
18761
18804
|
|
|
18762
18805
|
// src/mantine/blocks/protocolSelector/template/TemplateConfig.tsx
|
|
18763
18806
|
import React185, { useCallback as useCallback53 } from "react";
|
|
18764
18807
|
import { IconSettings as IconSettings12 } from "@tabler/icons-react";
|
|
18765
18808
|
|
|
18766
18809
|
// src/mantine/blocks/protocolSelector/template/GeneralTab.tsx
|
|
18767
|
-
import React184, { useEffect as useEffect57, useMemo as
|
|
18810
|
+
import React184, { useEffect as useEffect57, useMemo as useMemo65, useState as useState72 } from "react";
|
|
18768
18811
|
import { Divider as Divider18, Stack as Stack128, Text as Text104, PillsInput as PillsInput2, Pill as Pill2, Box as Box38 } from "@mantine/core";
|
|
18769
18812
|
var GeneralTab10 = ({ title, description, protocolDids, onTitleChange, onDescriptionChange, onProtocolDidsChange }) => {
|
|
18770
18813
|
const [localTitle, setLocalTitle] = useState72(title || "");
|
|
18771
18814
|
const [localDescription, setLocalDescription] = useState72(description || "");
|
|
18772
18815
|
const [inputValue, setInputValue] = useState72("");
|
|
18773
|
-
const localDids =
|
|
18816
|
+
const localDids = useMemo65(() => {
|
|
18774
18817
|
try {
|
|
18775
18818
|
const parsed = JSON.parse(protocolDids || "[]");
|
|
18776
18819
|
return Array.isArray(parsed) ? parsed : [];
|
|
@@ -18868,9 +18911,9 @@ import { IconCircleDashed as IconCircleDashed2 } from "@tabler/icons-react";
|
|
|
18868
18911
|
var PROTOCOL_SELECTOR_TEMPLATE_PANEL_ID = "protocol-selector-template-panel";
|
|
18869
18912
|
var ProtocolSelectorTemplateView = ({ editor, block }) => {
|
|
18870
18913
|
const panelId = `${PROTOCOL_SELECTOR_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
18871
|
-
const panelContent =
|
|
18914
|
+
const panelContent = useMemo66(() => /* @__PURE__ */ React186.createElement(TemplateConfig10, { editor, block }), [editor, block]);
|
|
18872
18915
|
const { open } = usePanel(panelId, panelContent);
|
|
18873
|
-
const protocolDids =
|
|
18916
|
+
const protocolDids = useMemo66(() => {
|
|
18874
18917
|
try {
|
|
18875
18918
|
const parsed = JSON.parse(block.props.protocolDids || "[]");
|
|
18876
18919
|
return Array.isArray(parsed) ? parsed : [];
|
|
@@ -18896,12 +18939,12 @@ var ProtocolSelectorTemplateView = ({ editor, block }) => {
|
|
|
18896
18939
|
};
|
|
18897
18940
|
|
|
18898
18941
|
// src/mantine/blocks/protocolSelector/flow/FlowView.tsx
|
|
18899
|
-
import React189, { useMemo as
|
|
18942
|
+
import React189, { useMemo as useMemo68 } from "react";
|
|
18900
18943
|
import { Badge as Badge26, Box as Box41, Group as Group66, Stack as Stack131, Text as Text107, Tooltip as Tooltip13 } from "@mantine/core";
|
|
18901
18944
|
import { IconCircleDashed as IconCircleDashed3, IconChecks as IconChecks3 } from "@tabler/icons-react";
|
|
18902
18945
|
|
|
18903
18946
|
// src/mantine/blocks/protocolSelector/flow/ProtocolSelectionPanel.tsx
|
|
18904
|
-
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";
|
|
18905
18948
|
import { Stack as Stack130, Text as Text106, Box as Box40, Group as Group65, Loader as Loader26 } from "@mantine/core";
|
|
18906
18949
|
|
|
18907
18950
|
// src/icons/EntityAvatar.tsx
|
|
@@ -18931,7 +18974,7 @@ var EntityAvatar_default = EntityAvatar;
|
|
|
18931
18974
|
var ProtocolSelectionPanel = ({ editor, block }) => {
|
|
18932
18975
|
const { closePanel } = usePanelStore();
|
|
18933
18976
|
const handlers = useBlocknoteHandlers();
|
|
18934
|
-
const protocolDids =
|
|
18977
|
+
const protocolDids = useMemo67(() => {
|
|
18935
18978
|
try {
|
|
18936
18979
|
const parsed = JSON.parse(block.props.protocolDids || "[]");
|
|
18937
18980
|
return Array.isArray(parsed) ? parsed : [];
|
|
@@ -19054,7 +19097,7 @@ var ProtocolSelectorFlowView = ({ editor, block, isDisabled }) => {
|
|
|
19054
19097
|
const disabled = isDisabled?.isDisabled === "disable";
|
|
19055
19098
|
const panelId = `${PROTOCOL_SELECTOR_FLOW_PANEL_ID}-${block.id}`;
|
|
19056
19099
|
const isCompleted = block.props.status === "completed" && block.props.selectedProtocolDid;
|
|
19057
|
-
const panelContent =
|
|
19100
|
+
const panelContent = useMemo68(() => /* @__PURE__ */ React189.createElement(ProtocolSelectionPanel, { editor, block }), [editor, block]);
|
|
19058
19101
|
const { open } = usePanel(panelId, panelContent);
|
|
19059
19102
|
const handleClick = () => {
|
|
19060
19103
|
if (disabled) return;
|
|
@@ -19160,7 +19203,7 @@ import { createReactBlockSpec as createReactBlockSpec15 } from "@blocknote/react
|
|
|
19160
19203
|
import React197 from "react";
|
|
19161
19204
|
|
|
19162
19205
|
// src/mantine/blocks/form/template/TemplateView.tsx
|
|
19163
|
-
import React194, { useMemo as
|
|
19206
|
+
import React194, { useMemo as useMemo69 } from "react";
|
|
19164
19207
|
import { Badge as Badge27, Group as Group67, Stack as Stack132, Text as Text109 } from "@mantine/core";
|
|
19165
19208
|
|
|
19166
19209
|
// src/mantine/blocks/form/template/TemplateConfig.tsx
|
|
@@ -19287,19 +19330,19 @@ var TemplateConfig11 = ({ editor, block }) => {
|
|
|
19287
19330
|
var FORM_TEMPLATE_PANEL_ID = "form-template-panel";
|
|
19288
19331
|
var FormTemplateView = ({ editor, block }) => {
|
|
19289
19332
|
const panelId = `${FORM_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
19290
|
-
const panelContent =
|
|
19333
|
+
const panelContent = useMemo69(() => /* @__PURE__ */ React194.createElement(TemplateConfig11, { editor, block }), [editor, block]);
|
|
19291
19334
|
const { open } = usePanel(panelId, panelContent);
|
|
19292
19335
|
const hasSchema = Boolean(block.props.surveySchema);
|
|
19293
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")))));
|
|
19294
19337
|
};
|
|
19295
19338
|
|
|
19296
19339
|
// src/mantine/blocks/form/flow/FlowView.tsx
|
|
19297
|
-
import React196, { useMemo as
|
|
19340
|
+
import React196, { useMemo as useMemo71, useState as useState75, useCallback as useCallback57 } from "react";
|
|
19298
19341
|
import { ActionIcon as ActionIcon24, Badge as Badge28, Group as Group68, Stack as Stack133, Text as Text111, Tooltip as Tooltip14 } from "@mantine/core";
|
|
19299
19342
|
import { IconChevronRight as IconChevronRight8 } from "@tabler/icons-react";
|
|
19300
19343
|
|
|
19301
19344
|
// src/mantine/blocks/form/flow/FormPanel.tsx
|
|
19302
|
-
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";
|
|
19303
19346
|
import { Alert as Alert27, Text as Text110 } from "@mantine/core";
|
|
19304
19347
|
import { useDebouncedCallback as useDebouncedCallback2 } from "@mantine/hooks";
|
|
19305
19348
|
import { IconAlertCircle as IconAlertCircle13 } from "@tabler/icons-react";
|
|
@@ -19327,7 +19370,7 @@ var FormPanel = ({ editor, block, onComplete }) => {
|
|
|
19327
19370
|
const [runtime, updateRuntime] = useNodeRuntime(editor, block.id);
|
|
19328
19371
|
const isUpdatingFromProp = useRef18(false);
|
|
19329
19372
|
const lastSyncedAnswers = useRef18("");
|
|
19330
|
-
const surveySchema =
|
|
19373
|
+
const surveySchema = useMemo70(() => {
|
|
19331
19374
|
if (!block.props.surveySchema) return null;
|
|
19332
19375
|
try {
|
|
19333
19376
|
return JSON.parse(block.props.surveySchema);
|
|
@@ -19335,7 +19378,7 @@ var FormPanel = ({ editor, block, onComplete }) => {
|
|
|
19335
19378
|
return null;
|
|
19336
19379
|
}
|
|
19337
19380
|
}, [block.props.surveySchema]);
|
|
19338
|
-
const surveyModel =
|
|
19381
|
+
const surveyModel = useMemo70(() => {
|
|
19339
19382
|
if (!surveySchema) return null;
|
|
19340
19383
|
const model = new SurveyModel7(surveySchema);
|
|
19341
19384
|
model.applyTheme(surveyTheme);
|
|
@@ -19445,7 +19488,7 @@ var FormFlowView = ({ editor, block }) => {
|
|
|
19445
19488
|
});
|
|
19446
19489
|
}, [updateRuntime]);
|
|
19447
19490
|
const panelId = `${FORM_FLOW_PANEL_ID}-${block.id}`;
|
|
19448
|
-
const panelContent =
|
|
19491
|
+
const panelContent = useMemo71(() => /* @__PURE__ */ React196.createElement(FormPanel, { editor, block, onComplete: handleComplete }), [editor, block, handleComplete]);
|
|
19449
19492
|
const { open } = usePanel(panelId, panelContent);
|
|
19450
19493
|
const handleOpen = () => {
|
|
19451
19494
|
setHasOpened(true);
|
|
@@ -19519,7 +19562,7 @@ import { createReactBlockSpec as createReactBlockSpec16 } from "@blocknote/react
|
|
|
19519
19562
|
import React206 from "react";
|
|
19520
19563
|
|
|
19521
19564
|
// src/mantine/blocks/domainCreatorSign/template/TemplateView.tsx
|
|
19522
|
-
import React201, { useMemo as
|
|
19565
|
+
import React201, { useMemo as useMemo72 } from "react";
|
|
19523
19566
|
import { Badge as Badge29, Group as Group69, Stack as Stack134, Text as Text112 } from "@mantine/core";
|
|
19524
19567
|
|
|
19525
19568
|
// src/mantine/blocks/domainCreatorSign/template/TemplateConfig.tsx
|
|
@@ -19613,13 +19656,13 @@ var TemplateConfig12 = ({ editor, block }) => {
|
|
|
19613
19656
|
var DOMAIN_CREATOR_SIGN_TEMPLATE_PANEL_ID = "domain-creator-sign-template-panel";
|
|
19614
19657
|
var DomainCreatorSignTemplateView = ({ editor, block }) => {
|
|
19615
19658
|
const panelId = `${DOMAIN_CREATOR_SIGN_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
19616
|
-
const panelContent =
|
|
19659
|
+
const panelContent = useMemo72(() => /* @__PURE__ */ React201.createElement(TemplateConfig12, { editor, block }), [editor, block]);
|
|
19617
19660
|
const { open } = usePanel(panelId, panelContent);
|
|
19618
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 }))));
|
|
19619
19662
|
};
|
|
19620
19663
|
|
|
19621
19664
|
// src/mantine/blocks/domainCreatorSign/flow/FlowView.tsx
|
|
19622
|
-
import React205, { useCallback as useCallback60, useMemo as
|
|
19665
|
+
import React205, { useCallback as useCallback60, useMemo as useMemo73, useEffect as useEffect62 } from "react";
|
|
19623
19666
|
import { ActionIcon as ActionIcon25, Badge as Badge31, Group as Group71, Stack as Stack137, Text as Text116, Tooltip as Tooltip16 } from "@mantine/core";
|
|
19624
19667
|
import { IconChevronRight as IconChevronRight9 } from "@tabler/icons-react";
|
|
19625
19668
|
|
|
@@ -19969,17 +20012,17 @@ var DomainCreatorSignFlowView = ({ editor, block }) => {
|
|
|
19969
20012
|
[updateRuntime]
|
|
19970
20013
|
);
|
|
19971
20014
|
const panelId = `${DOMAIN_CREATOR_SIGN_FLOW_PANEL_ID}-${block.id}`;
|
|
19972
|
-
const panelContent =
|
|
20015
|
+
const panelContent = useMemo73(() => /* @__PURE__ */ React205.createElement(SignPanel, { editor, block, onComplete: handleComplete, onError: handleError }), [editor, block, handleComplete, handleError]);
|
|
19973
20016
|
const { open } = usePanel(panelId, panelContent);
|
|
19974
20017
|
const { closePanel } = usePanelStore();
|
|
19975
20018
|
const assignmentPanelId = `domain-creator-sign-assignment-${block.id}`;
|
|
19976
|
-
const assignmentPanelContent =
|
|
20019
|
+
const assignmentPanelContent = useMemo73(
|
|
19977
20020
|
() => /* @__PURE__ */ React205.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Assignment Tab" }, /* @__PURE__ */ React205.createElement(AssignmentTab, { editor, block })),
|
|
19978
20021
|
[editor, block, closePanel]
|
|
19979
20022
|
);
|
|
19980
20023
|
const { open: openAssignment } = usePanel(assignmentPanelId, assignmentPanelContent);
|
|
19981
20024
|
const commitmentPanelId = `domain-creator-sign-commitment-${block.id}`;
|
|
19982
|
-
const commitmentPanelContent =
|
|
20025
|
+
const commitmentPanelContent = useMemo73(
|
|
19983
20026
|
() => /* @__PURE__ */ React205.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Commitment Tab" }, /* @__PURE__ */ React205.createElement(CommitmentTab, { editor, block })),
|
|
19984
20027
|
[editor, block, closePanel]
|
|
19985
20028
|
);
|
|
@@ -20090,7 +20133,7 @@ import { createReactBlockSpec as createReactBlockSpec17 } from "@blocknote/react
|
|
|
20090
20133
|
import React213 from "react";
|
|
20091
20134
|
|
|
20092
20135
|
// src/mantine/blocks/domainCardViewer/template/TemplateView.tsx
|
|
20093
|
-
import React210, { useMemo as
|
|
20136
|
+
import React210, { useMemo as useMemo74 } from "react";
|
|
20094
20137
|
import { Badge as Badge32, Group as Group72, Stack as Stack138, Text as Text117 } from "@mantine/core";
|
|
20095
20138
|
|
|
20096
20139
|
// src/mantine/blocks/domainCardViewer/template/TemplateConfig.tsx
|
|
@@ -20186,18 +20229,18 @@ var TemplateConfig13 = ({ editor, block }) => {
|
|
|
20186
20229
|
var DOMAIN_CARD_VIEWER_TEMPLATE_PANEL_ID = "domain-card-viewer-template-panel";
|
|
20187
20230
|
var DomainCardViewerTemplateView = ({ editor, block }) => {
|
|
20188
20231
|
const panelId = `${DOMAIN_CARD_VIEWER_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
20189
|
-
const panelContent =
|
|
20232
|
+
const panelContent = useMemo74(() => /* @__PURE__ */ React210.createElement(TemplateConfig13, { editor, block }), [editor, block]);
|
|
20190
20233
|
const { open } = usePanel(panelId, panelContent);
|
|
20191
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")))));
|
|
20192
20235
|
};
|
|
20193
20236
|
|
|
20194
20237
|
// src/mantine/blocks/domainCardViewer/flow/FlowView.tsx
|
|
20195
|
-
import React212, { useMemo as
|
|
20238
|
+
import React212, { useMemo as useMemo76, useCallback as useCallback62, useEffect as useEffect64 } from "react";
|
|
20196
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";
|
|
20197
20240
|
import { IconChevronRight as IconChevronRight10, IconLoader, IconTestPipe, IconTrash as IconTrash5 } from "@tabler/icons-react";
|
|
20198
20241
|
|
|
20199
20242
|
// src/mantine/blocks/domainCardViewer/flow/ViewerPanel.tsx
|
|
20200
|
-
import React211, { useMemo as
|
|
20243
|
+
import React211, { useMemo as useMemo75 } from "react";
|
|
20201
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";
|
|
20202
20245
|
import { IconAlertCircle as IconAlertCircle15, IconCheck as IconCheck12, IconSparkles as IconSparkles4 } from "@tabler/icons-react";
|
|
20203
20246
|
function parsePreviewData(jsonString) {
|
|
@@ -20217,7 +20260,7 @@ var ViewerPanel = ({ block, onApprove }) => {
|
|
|
20217
20260
|
const status = block.props.status || "pending";
|
|
20218
20261
|
const loadingMessage = block.props.loadingMessage || "Agents is generating your domain data...";
|
|
20219
20262
|
const errorMessage = block.props.errorMessage || "An error occurred while generating the domain data.";
|
|
20220
|
-
const domainPreviewData =
|
|
20263
|
+
const domainPreviewData = useMemo75(() => parsePreviewData(block.props.domainPreviewData || "{}"), [block.props.domainPreviewData]);
|
|
20221
20264
|
const isLoading = status === "loading";
|
|
20222
20265
|
const isError = status === "error";
|
|
20223
20266
|
const isReady = status === "ready";
|
|
@@ -20526,7 +20569,7 @@ var DomainCardViewerFlowView = ({ editor, block }) => {
|
|
|
20526
20569
|
});
|
|
20527
20570
|
}, [editor, block]);
|
|
20528
20571
|
const panelId = `${DOMAIN_CARD_VIEWER_FLOW_PANEL_ID}-${block.id}`;
|
|
20529
|
-
const panelContent =
|
|
20572
|
+
const panelContent = useMemo76(() => /* @__PURE__ */ React212.createElement(ViewerPanel, { editor, block, onApprove: handleApprove }), [editor, block, handleApprove]);
|
|
20530
20573
|
const { open } = usePanel(panelId, panelContent);
|
|
20531
20574
|
const handleInjectDummyData = useCallback62(
|
|
20532
20575
|
(e) => {
|
|
@@ -20656,7 +20699,7 @@ import { createReactBlockSpec as createReactBlockSpec18 } from "@blocknote/react
|
|
|
20656
20699
|
import React222 from "react";
|
|
20657
20700
|
|
|
20658
20701
|
// src/mantine/blocks/governanceGroup/template/TemplateView.tsx
|
|
20659
|
-
import React219, { useMemo as
|
|
20702
|
+
import React219, { useMemo as useMemo78 } from "react";
|
|
20660
20703
|
import { Badge as Badge36, Group as Group76, Stack as Stack144, Text as Text123 } from "@mantine/core";
|
|
20661
20704
|
|
|
20662
20705
|
// src/mantine/blocks/governanceGroup/template/TemplateConfig.tsx
|
|
@@ -20771,7 +20814,7 @@ var GeneralTab14 = ({ title, description, icon: icon2, groupType, onTitleChange,
|
|
|
20771
20814
|
};
|
|
20772
20815
|
|
|
20773
20816
|
// src/mantine/components/HookedActionsTab/HookedActionsTab.tsx
|
|
20774
|
-
import React217, { useCallback as useCallback64, useMemo as
|
|
20817
|
+
import React217, { useCallback as useCallback64, useMemo as useMemo77, useEffect as useEffect67, useState as useState83 } from "react";
|
|
20775
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";
|
|
20776
20819
|
import { IconPlus as IconPlus5, IconMail as IconMail5, IconLink as IconLink3 } from "@tabler/icons-react";
|
|
20777
20820
|
|
|
@@ -21041,12 +21084,12 @@ var HookedActionsTab = ({ editor, block, blockActions, hookedActions, onHookedAc
|
|
|
21041
21084
|
cancelled = true;
|
|
21042
21085
|
};
|
|
21043
21086
|
}, [blockActions, handlers, block?.props]);
|
|
21044
|
-
const config =
|
|
21045
|
-
const availableActionTypes =
|
|
21087
|
+
const config = useMemo77(() => parseHookedActionsConfig(hookedActions), [hookedActions]);
|
|
21088
|
+
const availableActionTypes = useMemo77(() => {
|
|
21046
21089
|
ensureActionTypesRegistered();
|
|
21047
21090
|
return getAllHookedActionTypes();
|
|
21048
21091
|
}, []);
|
|
21049
|
-
const availableBlocks =
|
|
21092
|
+
const availableBlocks = useMemo77(() => {
|
|
21050
21093
|
if (!editor?.document) return [];
|
|
21051
21094
|
return editor.document.filter((docBlock) => docBlock.id !== block.id).map((docBlock) => ({
|
|
21052
21095
|
id: docBlock.id,
|
|
@@ -22017,18 +22060,18 @@ var TemplateConfig14 = ({ editor, block }) => {
|
|
|
22017
22060
|
var GOVERNANCE_GROUP_TEMPLATE_PANEL_ID = "governance-group-template-panel";
|
|
22018
22061
|
var GovernanceGroupTemplateView = ({ editor, block }) => {
|
|
22019
22062
|
const panelId = `${GOVERNANCE_GROUP_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
22020
|
-
const panelContent =
|
|
22063
|
+
const panelContent = useMemo78(() => /* @__PURE__ */ React219.createElement(TemplateConfig14, { editor, block }), [editor, block]);
|
|
22021
22064
|
const { open } = usePanel(panelId, panelContent);
|
|
22022
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")))));
|
|
22023
22066
|
};
|
|
22024
22067
|
|
|
22025
22068
|
// src/mantine/blocks/governanceGroup/flow/FlowView.tsx
|
|
22026
|
-
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";
|
|
22027
22070
|
import { ActionIcon as ActionIcon28, Badge as Badge37, Group as Group78, Stack as Stack146, Text as Text125, Tooltip as Tooltip18 } from "@mantine/core";
|
|
22028
22071
|
import { IconChevronRight as IconChevronRight11 } from "@tabler/icons-react";
|
|
22029
22072
|
|
|
22030
22073
|
// src/mantine/blocks/governanceGroup/flow/GovernanceGroupPanel.tsx
|
|
22031
|
-
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";
|
|
22032
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";
|
|
22033
22076
|
import { useDebouncedCallback as useDebouncedCallback3 } from "@mantine/hooks";
|
|
22034
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";
|
|
@@ -22075,7 +22118,7 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22075
22118
|
const [createdGroupAddress, setCreatedGroupAddress] = useState84(block.props.groupAddress || null);
|
|
22076
22119
|
const isUpdatingFromProp = useRef19(false);
|
|
22077
22120
|
const lastSyncedAnswers = useRef19("");
|
|
22078
|
-
const surveyModel =
|
|
22121
|
+
const surveyModel = useMemo79(() => {
|
|
22079
22122
|
if (!selectedGroupType) return null;
|
|
22080
22123
|
const surveySchema = getSurveyForGroupType(selectedGroupType);
|
|
22081
22124
|
if (!surveySchema) return null;
|
|
@@ -22288,7 +22331,7 @@ var GovernanceGroupFlowView = ({ editor, block }) => {
|
|
|
22288
22331
|
editorRef.current = editor;
|
|
22289
22332
|
blockRef.current = block;
|
|
22290
22333
|
});
|
|
22291
|
-
const stableEditor =
|
|
22334
|
+
const stableEditor = useMemo80(
|
|
22292
22335
|
() => new Proxy(editor, {
|
|
22293
22336
|
get(_, prop) {
|
|
22294
22337
|
return editorRef.current[prop];
|
|
@@ -22296,7 +22339,7 @@ var GovernanceGroupFlowView = ({ editor, block }) => {
|
|
|
22296
22339
|
}),
|
|
22297
22340
|
[]
|
|
22298
22341
|
);
|
|
22299
|
-
const stableBlock =
|
|
22342
|
+
const stableBlock = useMemo80(
|
|
22300
22343
|
() => new Proxy(block, {
|
|
22301
22344
|
get(_, prop) {
|
|
22302
22345
|
return blockRef.current[prop];
|
|
@@ -22335,7 +22378,7 @@ var GovernanceGroupFlowView = ({ editor, block }) => {
|
|
|
22335
22378
|
[]
|
|
22336
22379
|
);
|
|
22337
22380
|
const panelId = `${GOVERNANCE_GROUP_FLOW_PANEL_ID}-${block.id}`;
|
|
22338
|
-
const panelContent =
|
|
22381
|
+
const panelContent = useMemo80(
|
|
22339
22382
|
() => /* @__PURE__ */ React221.createElement(GovernanceGroupPanel, { editor: stableEditor, block: stableBlock, onComplete: stableHandleComplete }),
|
|
22340
22383
|
[stableEditor, stableBlock, stableHandleComplete]
|
|
22341
22384
|
);
|
|
@@ -22413,7 +22456,7 @@ import { createReactBlockSpec as createReactBlockSpec19 } from "@blocknote/react
|
|
|
22413
22456
|
import React230 from "react";
|
|
22414
22457
|
|
|
22415
22458
|
// src/mantine/blocks/flowLink/template/TemplateView.tsx
|
|
22416
|
-
import React227, { useMemo as
|
|
22459
|
+
import React227, { useMemo as useMemo82 } from "react";
|
|
22417
22460
|
import { Group as Group80, Stack as Stack149, Text as Text127 } from "@mantine/core";
|
|
22418
22461
|
|
|
22419
22462
|
// src/mantine/blocks/flowLink/template/TemplateConfig.tsx
|
|
@@ -22451,7 +22494,7 @@ var GeneralTab15 = ({ title, description, icon: icon2, onTitleChange, onDescript
|
|
|
22451
22494
|
};
|
|
22452
22495
|
|
|
22453
22496
|
// src/mantine/blocks/flowLink/template/LinksTab.tsx
|
|
22454
|
-
import React225, { useEffect as useEffect70, useMemo as
|
|
22497
|
+
import React225, { useEffect as useEffect70, useMemo as useMemo81, useState as useState86 } from "react";
|
|
22455
22498
|
import { Stack as Stack148, Card as Card21, Group as Group79, ActionIcon as ActionIcon29, Text as Text126, Divider as Divider20 } from "@mantine/core";
|
|
22456
22499
|
import { IconPlus as IconPlus6, IconTrash as IconTrash7, IconGripVertical } from "@tabler/icons-react";
|
|
22457
22500
|
import { DndContext, PointerSensor, useSensor, useSensors, closestCenter, useDraggable, useDroppable } from "@dnd-kit/core";
|
|
@@ -22534,7 +22577,7 @@ var DraggableLinkCard = ({ link, index, onRemove, onUpdate }) => {
|
|
|
22534
22577
|
};
|
|
22535
22578
|
var LinksTab = ({ links, onLinksChange }) => {
|
|
22536
22579
|
const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 8 } }));
|
|
22537
|
-
const sortedLinks =
|
|
22580
|
+
const sortedLinks = useMemo81(() => [...links].sort((a, b) => a.position - b.position), [links]);
|
|
22538
22581
|
const handleAddLink = () => {
|
|
22539
22582
|
const maxPosition = links.length > 0 ? Math.max(...links.map((l) => l.position)) : -1;
|
|
22540
22583
|
const newLink = {
|
|
@@ -22606,7 +22649,7 @@ var TemplateConfig15 = ({ editor, block }) => {
|
|
|
22606
22649
|
var FLOW_LINK_TEMPLATE_PANEL_ID = "flow-link-template-panel";
|
|
22607
22650
|
var FlowLinkTemplateView = ({ editor, block }) => {
|
|
22608
22651
|
const panelId = `${FLOW_LINK_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
22609
|
-
const panelContent =
|
|
22652
|
+
const panelContent = useMemo82(() => /* @__PURE__ */ React227.createElement(TemplateConfig15, { editor, block }), [editor, block]);
|
|
22610
22653
|
const { open } = usePanel(panelId, panelContent);
|
|
22611
22654
|
const links = safeParseJSONArray(block.props.links);
|
|
22612
22655
|
const linksCount = links.length;
|
|
@@ -22614,7 +22657,7 @@ var FlowLinkTemplateView = ({ editor, block }) => {
|
|
|
22614
22657
|
};
|
|
22615
22658
|
|
|
22616
22659
|
// src/mantine/blocks/flowLink/flow/FlowView.tsx
|
|
22617
|
-
import React229, { useMemo as
|
|
22660
|
+
import React229, { useMemo as useMemo83 } from "react";
|
|
22618
22661
|
import { Badge as Badge39, Group as Group82, Stack as Stack151, Text as Text129, Tooltip as Tooltip20 } from "@mantine/core";
|
|
22619
22662
|
|
|
22620
22663
|
// src/mantine/blocks/flowLink/flow/FlowLinkPanel.tsx
|
|
@@ -22700,7 +22743,7 @@ var FlowLinkFlowView = ({ editor, block, isDisabled }) => {
|
|
|
22700
22743
|
const links = safeParseJSONArray(block.props.links);
|
|
22701
22744
|
const linksCount = links.length;
|
|
22702
22745
|
const panelId = `${FLOW_LINK_FLOW_PANEL_ID}-${block.id}`;
|
|
22703
|
-
const panelContent =
|
|
22746
|
+
const panelContent = useMemo83(() => /* @__PURE__ */ React229.createElement(FlowLinkPanel, { editor, block }), [editor, block]);
|
|
22704
22747
|
const { open } = usePanel(panelId, panelContent);
|
|
22705
22748
|
const handleClick = () => {
|
|
22706
22749
|
if (!disabled) {
|
|
@@ -22792,15 +22835,15 @@ import { createReactBlockSpec as createReactBlockSpec20 } from "@blocknote/react
|
|
|
22792
22835
|
import React273 from "react";
|
|
22793
22836
|
|
|
22794
22837
|
// src/mantine/blocks/action/template/TemplateView.tsx
|
|
22795
|
-
import React235, { useMemo as
|
|
22838
|
+
import React235, { useMemo as useMemo86 } from "react";
|
|
22796
22839
|
|
|
22797
22840
|
// src/mantine/blocks/action/template/TemplateConfig.tsx
|
|
22798
|
-
import React234, { useCallback as useCallback69, useMemo as
|
|
22841
|
+
import React234, { useCallback as useCallback69, useMemo as useMemo85 } from "react";
|
|
22799
22842
|
import { Stack as Stack154 } from "@mantine/core";
|
|
22800
22843
|
import { IconCheck as IconCheck15, IconClock as IconClock11, IconContract as IconContract4, IconSettings as IconSettings18, IconShieldCheck as IconShieldCheck13, IconUserCheck as IconUserCheck4 } from "@tabler/icons-react";
|
|
22801
22844
|
|
|
22802
22845
|
// src/mantine/blocks/action/template/GeneralTab.tsx
|
|
22803
|
-
import React233, { useEffect as useEffect72, useMemo as
|
|
22846
|
+
import React233, { useEffect as useEffect72, useMemo as useMemo84, useState as useState88 } from "react";
|
|
22804
22847
|
import { Group as Group84, Stack as Stack153, Text as Text131, Button as Button39, ActionIcon as ActionIcon31, Paper as Paper16 } from "@mantine/core";
|
|
22805
22848
|
import {
|
|
22806
22849
|
IconMail as IconMail6,
|
|
@@ -23032,7 +23075,7 @@ var GeneralTab16 = ({
|
|
|
23032
23075
|
const [localDescription, setLocalDescription] = useState88(description || "");
|
|
23033
23076
|
useEffect72(() => setLocalTitle(title || ""), [title]);
|
|
23034
23077
|
useEffect72(() => setLocalDescription(description || ""), [description]);
|
|
23035
|
-
const actionTypeOptions =
|
|
23078
|
+
const actionTypeOptions = useMemo84(() => {
|
|
23036
23079
|
return getAllActions().map((a) => {
|
|
23037
23080
|
const m = getActionMeta(a.type);
|
|
23038
23081
|
return { value: a.type, label: m.label, description: m.description, icon: m.icon };
|
|
@@ -23110,7 +23153,7 @@ function GenericInputsEditor({ inputs, onInputsChange, editor, blockId }) {
|
|
|
23110
23153
|
// src/mantine/blocks/action/template/TemplateConfig.tsx
|
|
23111
23154
|
var TemplateConfig16 = ({ editor, block }) => {
|
|
23112
23155
|
const { closePanel } = usePanelStore();
|
|
23113
|
-
const isValid =
|
|
23156
|
+
const isValid = useMemo85(() => {
|
|
23114
23157
|
const title = (block.props.title || "").trim();
|
|
23115
23158
|
const actionType = resolveActionType(block.props.actionType || "");
|
|
23116
23159
|
if (!title || !actionType) return false;
|
|
@@ -23216,8 +23259,8 @@ var ActionTemplateView = ({ editor, block }) => {
|
|
|
23216
23259
|
const panelId = `${ACTION_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
23217
23260
|
const assignmentPanelId = `${ACTION_ASSIGNMENT_PANEL_ID}-${block.id}`;
|
|
23218
23261
|
const { closePanel, activePanel } = usePanelStore();
|
|
23219
|
-
const panelContent =
|
|
23220
|
-
const assignmentPanelContent =
|
|
23262
|
+
const panelContent = useMemo86(() => /* @__PURE__ */ React235.createElement(TemplateConfig16, { editor, block }), [editor, block]);
|
|
23263
|
+
const assignmentPanelContent = useMemo86(
|
|
23221
23264
|
() => /* @__PURE__ */ React235.createElement(
|
|
23222
23265
|
BaseRightPanelLayout,
|
|
23223
23266
|
{
|
|
@@ -23231,7 +23274,7 @@ var ActionTemplateView = ({ editor, block }) => {
|
|
|
23231
23274
|
const { open } = usePanel(panelId, panelContent);
|
|
23232
23275
|
const { open: openAssignment } = usePanel(assignmentPanelId, assignmentPanelContent);
|
|
23233
23276
|
const commitmentPanelId = `${ACTION_COMMITMENT_PANEL_ID}-${block.id}`;
|
|
23234
|
-
const commitmentPanelContent =
|
|
23277
|
+
const commitmentPanelContent = useMemo86(
|
|
23235
23278
|
() => /* @__PURE__ */ React235.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Commitment Tab" }, /* @__PURE__ */ React235.createElement(CommitmentTab, { editor, block })),
|
|
23236
23279
|
[editor, block, closePanel]
|
|
23237
23280
|
);
|
|
@@ -23263,7 +23306,7 @@ var ActionTemplateView = ({ editor, block }) => {
|
|
|
23263
23306
|
};
|
|
23264
23307
|
|
|
23265
23308
|
// src/mantine/blocks/action/flow/FlowView.tsx
|
|
23266
|
-
import React238, { useCallback as useCallback71, useMemo as
|
|
23309
|
+
import React238, { useCallback as useCallback71, useMemo as useMemo88, useRef as useRef22, useState as useState91 } from "react";
|
|
23267
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";
|
|
23268
23311
|
import { IconAlertTriangle as IconAlertTriangle4, IconUser as IconUser13, IconBolt as IconBolt8, IconShieldCheck as IconShieldCheck14, IconPlayerPlay as IconPlayerPlay2 } from "@tabler/icons-react";
|
|
23269
23312
|
|
|
@@ -23489,14 +23532,14 @@ import React237 from "react";
|
|
|
23489
23532
|
import { Text as Text134 } from "@mantine/core";
|
|
23490
23533
|
|
|
23491
23534
|
// src/mantine/blocks/action/diff/useActionDiff.ts
|
|
23492
|
-
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";
|
|
23493
23536
|
function useActionDiff({ actionType, inputs, actorDid = "", entityDid }) {
|
|
23494
23537
|
const [diffs, setDiffs] = useState90([]);
|
|
23495
23538
|
const [error, setError] = useState90();
|
|
23496
23539
|
const [fetchKey, setFetchKey] = useState90(0);
|
|
23497
23540
|
const handlers = useBlocknoteHandlers();
|
|
23498
23541
|
const hasResolver = hasDiffResolver(actionType);
|
|
23499
|
-
const parsedInputs =
|
|
23542
|
+
const parsedInputs = useMemo87(() => {
|
|
23500
23543
|
if (!inputs) return {};
|
|
23501
23544
|
if (typeof inputs === "object") return inputs;
|
|
23502
23545
|
try {
|
|
@@ -23575,7 +23618,7 @@ var ActionFlowView = ({ editor, block, isDisabled }) => {
|
|
|
23575
23618
|
const statusColor3 = getStatusColor4(runtimeState);
|
|
23576
23619
|
const dueDate = block.props.ttlAbsoluteDueDate;
|
|
23577
23620
|
const dueDateDisplay = dueDate ? formatDate(dueDate) : "";
|
|
23578
|
-
const tabs =
|
|
23621
|
+
const tabs = useMemo88(() => {
|
|
23579
23622
|
const baseTabs = [
|
|
23580
23623
|
{
|
|
23581
23624
|
label: "Execute",
|
|
@@ -23610,13 +23653,13 @@ var ActionFlowView = ({ editor, block, isDisabled }) => {
|
|
|
23610
23653
|
);
|
|
23611
23654
|
return baseTabs;
|
|
23612
23655
|
}, [editor, block, actionType, FlowDetailComponent, disabled, isDisabled?.message]);
|
|
23613
|
-
const panelContent =
|
|
23656
|
+
const panelContent = useMemo88(
|
|
23614
23657
|
() => /* @__PURE__ */ React238.createElement(BaseRightPanelLayout, { onClose: closePanel, title: block.props.title || getActionMeta(actionType).label || "", tabs, context: { editor, block } }),
|
|
23615
23658
|
[tabs, editor, block, closePanel, actionType]
|
|
23616
23659
|
);
|
|
23617
23660
|
const { open } = usePanel(panelId, panelContent);
|
|
23618
23661
|
const commitmentPanelId = `action-flow-commitment-${block.id}`;
|
|
23619
|
-
const commitmentPanelContent =
|
|
23662
|
+
const commitmentPanelContent = useMemo88(
|
|
23620
23663
|
() => /* @__PURE__ */ React238.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Commitment Tab" }, /* @__PURE__ */ React238.createElement(CommitmentTab, { editor, block })),
|
|
23621
23664
|
[editor, block, closePanel]
|
|
23622
23665
|
);
|
|
@@ -23663,7 +23706,7 @@ function ActionPanelContent({
|
|
|
23663
23706
|
const actionTypeUI = actionType ? getActionTypeUI(actionType) : void 0;
|
|
23664
23707
|
const executionMode = actionTypeUI?.executionMode ?? "custom";
|
|
23665
23708
|
const isSlideToSign = executionMode === "slide-to-sign";
|
|
23666
|
-
const mergedInputs =
|
|
23709
|
+
const mergedInputs = useMemo88(() => {
|
|
23667
23710
|
try {
|
|
23668
23711
|
const template = typeof block.props.inputs === "string" ? JSON.parse(block.props.inputs || "{}") : block.props.inputs || {};
|
|
23669
23712
|
return { ...template, ...runtimeInputs };
|
|
@@ -23746,32 +23789,33 @@ function GenericFlowPanel({
|
|
|
23746
23789
|
disabledMessage
|
|
23747
23790
|
}) {
|
|
23748
23791
|
const handlers = useBlocknoteHandlers();
|
|
23749
|
-
const services =
|
|
23750
|
-
const flowNode =
|
|
23751
|
-
const runtimeManager =
|
|
23752
|
-
const ucanService =
|
|
23753
|
-
const invocationStore =
|
|
23754
|
-
const flowId =
|
|
23755
|
-
const flowOwnerDid =
|
|
23756
|
-
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(() => {
|
|
23757
23801
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
23758
23802
|
return `ixo:flow:${docId}`;
|
|
23759
23803
|
}, [editor, block.id]);
|
|
23760
|
-
const actorDid =
|
|
23804
|
+
const actorDid = useMemo88(() => {
|
|
23761
23805
|
try {
|
|
23762
23806
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
23763
23807
|
} catch {
|
|
23764
23808
|
return "";
|
|
23765
23809
|
}
|
|
23766
23810
|
}, [handlers]);
|
|
23767
|
-
const parsedInputs =
|
|
23811
|
+
const parsedInputs = useMemo88(() => {
|
|
23768
23812
|
try {
|
|
23769
23813
|
return typeof inputs === "string" ? JSON.parse(inputs) : inputs || {};
|
|
23770
23814
|
} catch {
|
|
23771
23815
|
return {};
|
|
23772
23816
|
}
|
|
23773
23817
|
}, [inputs]);
|
|
23774
|
-
const outputJson =
|
|
23818
|
+
const outputJson = useMemo88(() => {
|
|
23775
23819
|
if (!runtime.output) return "";
|
|
23776
23820
|
try {
|
|
23777
23821
|
return JSON.stringify(runtime.output, null, 2);
|
|
@@ -23805,7 +23849,8 @@ function GenericFlowPanel({
|
|
|
23805
23849
|
invocationStore,
|
|
23806
23850
|
flowUri,
|
|
23807
23851
|
flowId,
|
|
23808
|
-
flowOwnerDid
|
|
23852
|
+
flowOwnerDid,
|
|
23853
|
+
schemaVersion
|
|
23809
23854
|
},
|
|
23810
23855
|
action: async () => {
|
|
23811
23856
|
const result = await actionDef.run(resolvedInputs, {
|
|
@@ -24021,14 +24066,14 @@ var HttpRequestConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
24021
24066
|
};
|
|
24022
24067
|
|
|
24023
24068
|
// src/mantine/blocks/action/actionTypes/httpRequest/HttpRequestFlowDetail.tsx
|
|
24024
|
-
import React240, { useMemo as
|
|
24069
|
+
import React240, { useMemo as useMemo89, useState as useState93 } from "react";
|
|
24025
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";
|
|
24026
24071
|
import { IconSend as IconSend5, IconChevronDown as IconChevronDown9, IconChevronUp as IconChevronUp4, IconAlertTriangle as IconAlertTriangle5 } from "@tabler/icons-react";
|
|
24027
24072
|
var HttpRequestFlowDetail = ({ inputs, editor, runtime, updateRuntime, isDisabled }) => {
|
|
24028
24073
|
const [isLoading, setIsLoading] = useState93(false);
|
|
24029
24074
|
const [showDetails, setShowDetails] = useState93(false);
|
|
24030
24075
|
const [validationWarnings, setValidationWarnings] = useState93([]);
|
|
24031
|
-
const parsed =
|
|
24076
|
+
const parsed = useMemo89(() => parseHttpRequestInputs(inputs), [inputs]);
|
|
24032
24077
|
const { endpoint, method, headers, body, responseSchema } = parsed;
|
|
24033
24078
|
const runtimeState = runtime.state;
|
|
24034
24079
|
const status = runtimeState === "running" ? "loading" : runtimeState === "completed" ? "success" : runtimeState === "failed" ? "error" : "idle";
|
|
@@ -24156,7 +24201,7 @@ registerActionTypeUI("qi/http.request", {
|
|
|
24156
24201
|
});
|
|
24157
24202
|
|
|
24158
24203
|
// src/mantine/blocks/action/actionTypes/emailSend/EmailSendConfig.tsx
|
|
24159
|
-
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";
|
|
24160
24205
|
import { Alert as Alert36, Badge as Badge42, Group as Group90, Loader as Loader34, Stack as Stack160, Text as Text138 } from "@mantine/core";
|
|
24161
24206
|
import { IconCheck as IconCheck16, IconInfoCircle as IconInfoCircle6 } from "@tabler/icons-react";
|
|
24162
24207
|
|
|
@@ -24259,14 +24304,14 @@ var EmailSendConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
24259
24304
|
},
|
|
24260
24305
|
[handlers.getEmailTemplate, update]
|
|
24261
24306
|
);
|
|
24262
|
-
const parsedExtractedVariables =
|
|
24307
|
+
const parsedExtractedVariables = useMemo90(() => {
|
|
24263
24308
|
try {
|
|
24264
24309
|
return JSON.parse(local.extractedVariables || "[]");
|
|
24265
24310
|
} catch {
|
|
24266
24311
|
return [];
|
|
24267
24312
|
}
|
|
24268
24313
|
}, [local.extractedVariables]);
|
|
24269
|
-
const parsedVariableMapping =
|
|
24314
|
+
const parsedVariableMapping = useMemo90(() => {
|
|
24270
24315
|
try {
|
|
24271
24316
|
return JSON.parse(local.variables || "{}");
|
|
24272
24317
|
} catch {
|
|
@@ -24338,7 +24383,7 @@ registerActionTypeUI("qi/email.send", {
|
|
|
24338
24383
|
});
|
|
24339
24384
|
|
|
24340
24385
|
// src/mantine/blocks/action/actionTypes/bid/BidConfig.tsx
|
|
24341
|
-
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";
|
|
24342
24387
|
import { Alert as Alert37, Button as Button42, Loader as Loader35, Stack as Stack161, Text as Text139 } from "@mantine/core";
|
|
24343
24388
|
import { IconInfoCircle as IconInfoCircle7 } from "@tabler/icons-react";
|
|
24344
24389
|
|
|
@@ -24407,7 +24452,7 @@ var BidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
24407
24452
|
setLoadingCollections(false);
|
|
24408
24453
|
}
|
|
24409
24454
|
}, [handlers, local, onInputsChange, update]);
|
|
24410
|
-
const collectionOptions =
|
|
24455
|
+
const collectionOptions = useMemo91(
|
|
24411
24456
|
() => collections.map((collection) => ({
|
|
24412
24457
|
value: collection.id,
|
|
24413
24458
|
label: collection.protocol?.profile?.name || collection.name || collection.id
|
|
@@ -24452,7 +24497,7 @@ var BidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
24452
24497
|
};
|
|
24453
24498
|
|
|
24454
24499
|
// src/mantine/blocks/action/actionTypes/bid/BidFlowDetail.tsx
|
|
24455
|
-
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";
|
|
24456
24501
|
import { Alert as Alert38, Loader as Loader36, Stack as Stack162, Text as Text140 } from "@mantine/core";
|
|
24457
24502
|
import { IconPlayerPlay as IconPlayerPlay3 } from "@tabler/icons-react";
|
|
24458
24503
|
import { SurveyModel as SurveyModel9 } from "@ixo/surveys";
|
|
@@ -24474,27 +24519,28 @@ var BidFlowDetail = ({
|
|
|
24474
24519
|
registerRuntimeInputs
|
|
24475
24520
|
}) => {
|
|
24476
24521
|
const handlers = useBlocknoteHandlers();
|
|
24477
|
-
const services =
|
|
24478
|
-
const flowNode =
|
|
24479
|
-
const runtimeManager =
|
|
24480
|
-
const ucanService =
|
|
24481
|
-
const invocationStore =
|
|
24482
|
-
const flowId =
|
|
24483
|
-
const flowOwnerDid =
|
|
24484
|
-
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(() => {
|
|
24485
24531
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
24486
24532
|
return `ixo:flow:${docId}`;
|
|
24487
24533
|
}, [editor, block.id]);
|
|
24488
|
-
const actorDid =
|
|
24534
|
+
const actorDid = useMemo92(() => {
|
|
24489
24535
|
try {
|
|
24490
24536
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
24491
24537
|
} catch {
|
|
24492
24538
|
return "";
|
|
24493
24539
|
}
|
|
24494
24540
|
}, [handlers]);
|
|
24495
|
-
const parsed =
|
|
24541
|
+
const parsed = useMemo92(() => parseBidActionInputs(inputs), [inputs]);
|
|
24496
24542
|
const editorDocument = editor?.document || [];
|
|
24497
|
-
const resolveOpts =
|
|
24543
|
+
const resolveOpts = useMemo92(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
24498
24544
|
const deedDid = resolveReferences(parsed.deedDid, editorDocument, resolveOpts).trim();
|
|
24499
24545
|
const collectionId = resolveReferences(parsed.collectionId, editorDocument, resolveOpts).trim();
|
|
24500
24546
|
const [role, setRole] = useState96("service_agent");
|
|
@@ -24506,7 +24552,7 @@ var BidFlowDetail = ({
|
|
|
24506
24552
|
const [userBid, setUserBid] = useState96(null);
|
|
24507
24553
|
const [userRole, setUserRole] = useState96(null);
|
|
24508
24554
|
const [surveyReady, setSurveyReady] = useState96(false);
|
|
24509
|
-
const surveyModel =
|
|
24555
|
+
const surveyModel = useMemo92(() => {
|
|
24510
24556
|
if (!surveyJson) return null;
|
|
24511
24557
|
const model = new SurveyModel9(surveyJson);
|
|
24512
24558
|
model.applyTheme(surveyTheme);
|
|
@@ -24645,7 +24691,8 @@ var BidFlowDetail = ({
|
|
|
24645
24691
|
invocationStore,
|
|
24646
24692
|
flowUri,
|
|
24647
24693
|
flowId,
|
|
24648
|
-
flowOwnerDid
|
|
24694
|
+
flowOwnerDid,
|
|
24695
|
+
schemaVersion
|
|
24649
24696
|
},
|
|
24650
24697
|
action: async () => {
|
|
24651
24698
|
const result = await actionDef.run(
|
|
@@ -24757,7 +24804,7 @@ registerActionTypeUI("qi/bid.submit", {
|
|
|
24757
24804
|
});
|
|
24758
24805
|
|
|
24759
24806
|
// src/mantine/blocks/action/actionTypes/evaluateBid/EvaluateBidConfig.tsx
|
|
24760
|
-
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";
|
|
24761
24808
|
import { Alert as Alert39, Button as Button43, Loader as Loader37, Stack as Stack163 } from "@mantine/core";
|
|
24762
24809
|
|
|
24763
24810
|
// src/mantine/blocks/action/actionTypes/evaluateBid/types.ts
|
|
@@ -24825,7 +24872,7 @@ var EvaluateBidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
24825
24872
|
setLoadingCollections(false);
|
|
24826
24873
|
}
|
|
24827
24874
|
}, [handlers, local, onInputsChange, update]);
|
|
24828
|
-
const collectionOptions =
|
|
24875
|
+
const collectionOptions = useMemo93(
|
|
24829
24876
|
() => collections.map((collection) => ({
|
|
24830
24877
|
value: collection.id,
|
|
24831
24878
|
label: collection.protocol?.profile?.name || collection.name || collection.id
|
|
@@ -24870,7 +24917,7 @@ var EvaluateBidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
24870
24917
|
};
|
|
24871
24918
|
|
|
24872
24919
|
// src/mantine/blocks/action/actionTypes/evaluateBid/EvaluateBidFlowDetail.tsx
|
|
24873
|
-
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";
|
|
24874
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";
|
|
24875
24922
|
import { IconArrowLeft as IconArrowLeft6, IconCheck as IconCheck17, IconFilter } from "@tabler/icons-react";
|
|
24876
24923
|
|
|
@@ -24960,27 +25007,28 @@ var EvaluateBidFlowDetail = ({
|
|
|
24960
25007
|
registerRuntimeInputs
|
|
24961
25008
|
}) => {
|
|
24962
25009
|
const handlers = useBlocknoteHandlers();
|
|
24963
|
-
const services =
|
|
24964
|
-
const flowNode =
|
|
24965
|
-
const runtimeManager =
|
|
24966
|
-
const ucanService =
|
|
24967
|
-
const invocationStore =
|
|
24968
|
-
const flowId =
|
|
24969
|
-
const flowOwnerDid =
|
|
24970
|
-
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(() => {
|
|
24971
25019
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
24972
25020
|
return `ixo:flow:${docId}`;
|
|
24973
25021
|
}, [editor, block.id]);
|
|
24974
|
-
const actorDid =
|
|
25022
|
+
const actorDid = useMemo94(() => {
|
|
24975
25023
|
try {
|
|
24976
25024
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
24977
25025
|
} catch {
|
|
24978
25026
|
return "";
|
|
24979
25027
|
}
|
|
24980
25028
|
}, [handlers]);
|
|
24981
|
-
const parsed =
|
|
25029
|
+
const parsed = useMemo94(() => parseEvaluateBidActionInputs(inputs), [inputs]);
|
|
24982
25030
|
const editorDocument = editor?.document || [];
|
|
24983
|
-
const resolveOpts =
|
|
25031
|
+
const resolveOpts = useMemo94(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
24984
25032
|
const deedDid = resolveReferences(parsed.deedDid, editorDocument, resolveOpts).trim();
|
|
24985
25033
|
const collectionId = resolveReferences(parsed.collectionId, editorDocument, resolveOpts).trim();
|
|
24986
25034
|
const [bids, setBids] = useState99([]);
|
|
@@ -24994,8 +25042,8 @@ var EvaluateBidFlowDetail = ({
|
|
|
24994
25042
|
const [activeFilter, setActiveFilter] = useState99("pending");
|
|
24995
25043
|
const [paymentRows, setPaymentRows] = useState99([createPaymentRow()]);
|
|
24996
25044
|
const [profilesByDid, setProfilesByDid] = useState99({});
|
|
24997
|
-
const selectedBid =
|
|
24998
|
-
const filteredBids =
|
|
25045
|
+
const selectedBid = useMemo94(() => bids.find((bid) => bid.id === selectedBidId) || null, [bids, selectedBidId]);
|
|
25046
|
+
const filteredBids = useMemo94(() => {
|
|
24999
25047
|
if (activeFilter === "all") return bids;
|
|
25000
25048
|
return bids.filter((bid) => {
|
|
25001
25049
|
const status = getBidStatus(bid).label.toLowerCase();
|
|
@@ -25148,7 +25196,8 @@ var EvaluateBidFlowDetail = ({
|
|
|
25148
25196
|
invocationStore,
|
|
25149
25197
|
flowUri,
|
|
25150
25198
|
flowId,
|
|
25151
|
-
flowOwnerDid
|
|
25199
|
+
flowOwnerDid,
|
|
25200
|
+
schemaVersion
|
|
25152
25201
|
},
|
|
25153
25202
|
action: async () => {
|
|
25154
25203
|
const result = await actionDef.run(
|
|
@@ -25359,7 +25408,7 @@ registerActionTypeUI("qi/bid.evaluate", {
|
|
|
25359
25408
|
});
|
|
25360
25409
|
|
|
25361
25410
|
// src/mantine/blocks/action/actionTypes/claim/ClaimConfig.tsx
|
|
25362
|
-
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";
|
|
25363
25412
|
import { Alert as Alert41, Button as Button45, Loader as Loader39, Stack as Stack165 } from "@mantine/core";
|
|
25364
25413
|
|
|
25365
25414
|
// src/mantine/blocks/action/actionTypes/claim/types.ts
|
|
@@ -25427,7 +25476,7 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
25427
25476
|
setLoadingCollections(false);
|
|
25428
25477
|
}
|
|
25429
25478
|
}, [handlers, local, onInputsChange, update]);
|
|
25430
|
-
const collectionOptions =
|
|
25479
|
+
const collectionOptions = useMemo95(
|
|
25431
25480
|
() => collections.map((collection) => ({
|
|
25432
25481
|
value: collection.id,
|
|
25433
25482
|
label: collection.protocol?.profile?.name || collection.name || collection.id
|
|
@@ -25472,7 +25521,7 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
25472
25521
|
};
|
|
25473
25522
|
|
|
25474
25523
|
// src/mantine/blocks/action/actionTypes/claim/ClaimFlowDetail.tsx
|
|
25475
|
-
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";
|
|
25476
25525
|
import { Alert as Alert42, Box as Box49, Group as Group93, Loader as Loader40, Stack as Stack166, Text as Text143 } from "@mantine/core";
|
|
25477
25526
|
import { IconCheck as IconCheck18, IconPlayerPlay as IconPlayerPlay4 } from "@tabler/icons-react";
|
|
25478
25527
|
import { SurveyModel as SurveyModel10 } from "@ixo/surveys";
|
|
@@ -25511,27 +25560,28 @@ var ClaimFlowDetail = ({
|
|
|
25511
25560
|
registerRuntimeInputs
|
|
25512
25561
|
}) => {
|
|
25513
25562
|
const handlers = useBlocknoteHandlers();
|
|
25514
|
-
const services =
|
|
25515
|
-
const flowNode =
|
|
25516
|
-
const runtimeManager =
|
|
25517
|
-
const ucanService =
|
|
25518
|
-
const invocationStore =
|
|
25519
|
-
const flowId =
|
|
25520
|
-
const flowOwnerDid =
|
|
25521
|
-
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(() => {
|
|
25522
25572
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
25523
25573
|
return `ixo:flow:${docId}`;
|
|
25524
25574
|
}, [editor, block.id]);
|
|
25525
|
-
const actorDid =
|
|
25575
|
+
const actorDid = useMemo96(() => {
|
|
25526
25576
|
try {
|
|
25527
25577
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
25528
25578
|
} catch {
|
|
25529
25579
|
return "";
|
|
25530
25580
|
}
|
|
25531
25581
|
}, [handlers]);
|
|
25532
|
-
const parsed =
|
|
25582
|
+
const parsed = useMemo96(() => parseClaimActionInputs(inputs), [inputs]);
|
|
25533
25583
|
const editorDocument = editor?.document || [];
|
|
25534
|
-
const resolveOpts =
|
|
25584
|
+
const resolveOpts = useMemo96(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
25535
25585
|
const deedDid = resolveReferences(parsed.deedDid, editorDocument, resolveOpts).trim();
|
|
25536
25586
|
const collectionId = resolveReferences(parsed.collectionId, editorDocument, resolveOpts).trim();
|
|
25537
25587
|
const [claims, setClaims] = useState101([]);
|
|
@@ -25544,7 +25594,7 @@ var ClaimFlowDetail = ({
|
|
|
25544
25594
|
const [profilesByDid, setProfilesByDid] = useState101({});
|
|
25545
25595
|
const [isServiceAgentAuthorized, setIsServiceAgentAuthorized] = useState101(false);
|
|
25546
25596
|
const [authChecking, setAuthChecking] = useState101(true);
|
|
25547
|
-
const surveyModel =
|
|
25597
|
+
const surveyModel = useMemo96(() => {
|
|
25548
25598
|
if (!surveyJson) return null;
|
|
25549
25599
|
const model = new SurveyModel10(surveyJson);
|
|
25550
25600
|
model.applyTheme(surveyTheme);
|
|
@@ -25730,7 +25780,8 @@ var ClaimFlowDetail = ({
|
|
|
25730
25780
|
invocationStore,
|
|
25731
25781
|
flowUri,
|
|
25732
25782
|
flowId,
|
|
25733
|
-
flowOwnerDid
|
|
25783
|
+
flowOwnerDid,
|
|
25784
|
+
schemaVersion
|
|
25734
25785
|
},
|
|
25735
25786
|
action: async () => {
|
|
25736
25787
|
const result = await actionDef.run(
|
|
@@ -25856,7 +25907,7 @@ registerActionTypeUI("qi/claim.submit", {
|
|
|
25856
25907
|
});
|
|
25857
25908
|
|
|
25858
25909
|
// src/mantine/blocks/action/actionTypes/evaluateClaim/EvaluateClaimConfig.tsx
|
|
25859
|
-
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";
|
|
25860
25911
|
import { Alert as Alert43, Button as Button46, Loader as Loader41, Stack as Stack167 } from "@mantine/core";
|
|
25861
25912
|
|
|
25862
25913
|
// src/mantine/blocks/action/actionTypes/evaluateClaim/types.ts
|
|
@@ -25924,7 +25975,7 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
25924
25975
|
setLoadingCollections(false);
|
|
25925
25976
|
}
|
|
25926
25977
|
}, [handlers, local, onInputsChange, update]);
|
|
25927
|
-
const collectionOptions =
|
|
25978
|
+
const collectionOptions = useMemo97(
|
|
25928
25979
|
() => collections.map((collection) => ({
|
|
25929
25980
|
value: collection.id,
|
|
25930
25981
|
label: collection.protocol?.profile?.name || collection.name || collection.id
|
|
@@ -25969,7 +26020,7 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
25969
26020
|
};
|
|
25970
26021
|
|
|
25971
26022
|
// src/mantine/blocks/action/actionTypes/evaluateClaim/EvaluateClaimFlowDetail.tsx
|
|
25972
|
-
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";
|
|
25973
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";
|
|
25974
26025
|
import { IconArrowLeft as IconArrowLeft7, IconCheck as IconCheck19, IconFilter as IconFilter2 } from "@tabler/icons-react";
|
|
25975
26026
|
import { SurveyModel as SurveyModel11 } from "@ixo/surveys";
|
|
@@ -26023,27 +26074,28 @@ var EvaluateClaimFlowDetail = ({
|
|
|
26023
26074
|
registerRuntimeInputs
|
|
26024
26075
|
}) => {
|
|
26025
26076
|
const handlers = useBlocknoteHandlers();
|
|
26026
|
-
const services =
|
|
26027
|
-
const flowNode =
|
|
26028
|
-
const runtimeManager =
|
|
26029
|
-
const ucanService =
|
|
26030
|
-
const invocationStore =
|
|
26031
|
-
const flowId =
|
|
26032
|
-
const flowOwnerDid =
|
|
26033
|
-
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(() => {
|
|
26034
26086
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
26035
26087
|
return `ixo:flow:${docId}`;
|
|
26036
26088
|
}, [editor, block.id]);
|
|
26037
|
-
const actorDid =
|
|
26089
|
+
const actorDid = useMemo98(() => {
|
|
26038
26090
|
try {
|
|
26039
26091
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
26040
26092
|
} catch {
|
|
26041
26093
|
return "";
|
|
26042
26094
|
}
|
|
26043
26095
|
}, [handlers]);
|
|
26044
|
-
const parsed =
|
|
26096
|
+
const parsed = useMemo98(() => parseEvaluateClaimActionInputs(inputs), [inputs]);
|
|
26045
26097
|
const editorDocument = editor?.document || [];
|
|
26046
|
-
const resolveOpts =
|
|
26098
|
+
const resolveOpts = useMemo98(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
26047
26099
|
const deedDid = resolveReferences(parsed.deedDid, editorDocument, resolveOpts).trim();
|
|
26048
26100
|
const collectionId = resolveReferences(parsed.collectionId, editorDocument, resolveOpts).trim();
|
|
26049
26101
|
const [claims, setClaims] = useState103([]);
|
|
@@ -26068,15 +26120,15 @@ var EvaluateClaimFlowDetail = ({
|
|
|
26068
26120
|
const [isEvaluatorAuthorized, setIsEvaluatorAuthorized] = useState103(false);
|
|
26069
26121
|
const [authChecking, setAuthChecking] = useState103(true);
|
|
26070
26122
|
const [profilesByDid, setProfilesByDid] = useState103({});
|
|
26071
|
-
const selectedClaim =
|
|
26072
|
-
const filteredClaims =
|
|
26123
|
+
const selectedClaim = useMemo98(() => claims.find((claim) => claim.claimId === selectedClaimId) || null, [claims, selectedClaimId]);
|
|
26124
|
+
const filteredClaims = useMemo98(() => {
|
|
26073
26125
|
if (activeFilter === "all") return claims;
|
|
26074
26126
|
return claims.filter((claim) => {
|
|
26075
26127
|
const status = getClaimStatusInfo(claim).key;
|
|
26076
26128
|
return status === activeFilter;
|
|
26077
26129
|
});
|
|
26078
26130
|
}, [claims, activeFilter]);
|
|
26079
|
-
const surveyModel =
|
|
26131
|
+
const surveyModel = useMemo98(() => {
|
|
26080
26132
|
if (!surveyJson || !claimData) return null;
|
|
26081
26133
|
const model = new SurveyModel11(surveyJson);
|
|
26082
26134
|
model.applyTheme(surveyTheme);
|
|
@@ -26086,7 +26138,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
26086
26138
|
model.data = claimData;
|
|
26087
26139
|
return model;
|
|
26088
26140
|
}, [surveyJson, claimData]);
|
|
26089
|
-
const outcomeSurveyModel =
|
|
26141
|
+
const outcomeSurveyModel = useMemo98(() => {
|
|
26090
26142
|
if (!outcomeTemplateJson) return null;
|
|
26091
26143
|
const model = new SurveyModel11(outcomeTemplateJson);
|
|
26092
26144
|
model.applyTheme(surveyTheme2);
|
|
@@ -26284,7 +26336,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
26284
26336
|
setOutcomeComplete(false);
|
|
26285
26337
|
loadClaimDetail(selectedClaim);
|
|
26286
26338
|
}, [selectedClaim, loadClaimDetail]);
|
|
26287
|
-
const isClaimAlreadyEvaluated =
|
|
26339
|
+
const isClaimAlreadyEvaluated = useMemo98(() => {
|
|
26288
26340
|
if (!selectedClaim) return false;
|
|
26289
26341
|
return isClaimEvaluated(selectedClaim);
|
|
26290
26342
|
}, [selectedClaim]);
|
|
@@ -26355,7 +26407,8 @@ var EvaluateClaimFlowDetail = ({
|
|
|
26355
26407
|
invocationStore,
|
|
26356
26408
|
flowUri,
|
|
26357
26409
|
flowId,
|
|
26358
|
-
flowOwnerDid
|
|
26410
|
+
flowOwnerDid,
|
|
26411
|
+
schemaVersion
|
|
26359
26412
|
},
|
|
26360
26413
|
action: async () => {
|
|
26361
26414
|
const result = await actionDef.run(
|
|
@@ -26720,7 +26773,7 @@ var ProposalCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
26720
26773
|
};
|
|
26721
26774
|
|
|
26722
26775
|
// src/mantine/blocks/action/actionTypes/proposalCreate/ProposalCreateFlowDetail.tsx
|
|
26723
|
-
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";
|
|
26724
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";
|
|
26725
26778
|
import { IconPlus as IconPlus9, IconPlayerPlay as IconPlayerPlay5 } from "@tabler/icons-react";
|
|
26726
26779
|
var CHAIN_STATUSES2 = ["open", "passed", "rejected", "executed", "closed", "execution_failed", "veto_timelock"];
|
|
@@ -26740,27 +26793,28 @@ var statusColor2 = {
|
|
|
26740
26793
|
};
|
|
26741
26794
|
var ProposalCreateFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
26742
26795
|
const handlers = useBlocknoteHandlers();
|
|
26743
|
-
const services =
|
|
26744
|
-
const flowNode =
|
|
26745
|
-
const runtimeManager =
|
|
26746
|
-
const ucanService =
|
|
26747
|
-
const invocationStore =
|
|
26748
|
-
const flowId =
|
|
26749
|
-
const flowOwnerDid =
|
|
26750
|
-
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(() => {
|
|
26751
26805
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
26752
26806
|
return `ixo:flow:${docId}`;
|
|
26753
26807
|
}, [editor, block.id]);
|
|
26754
|
-
const actorDid =
|
|
26808
|
+
const actorDid = useMemo99(() => {
|
|
26755
26809
|
try {
|
|
26756
26810
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
26757
26811
|
} catch {
|
|
26758
26812
|
return "";
|
|
26759
26813
|
}
|
|
26760
26814
|
}, [handlers]);
|
|
26761
|
-
const parsed =
|
|
26815
|
+
const parsed = useMemo99(() => parseProposalCreateInputs(inputs), [inputs]);
|
|
26762
26816
|
const editorDocument = editor?.document || [];
|
|
26763
|
-
const resolveOpts =
|
|
26817
|
+
const resolveOpts = useMemo99(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
26764
26818
|
const coreAddress = resolveReferences(parsed.coreAddress, editorDocument, resolveOpts).trim();
|
|
26765
26819
|
const proposalTitle = resolveReferences(parsed.proposalTitle, editorDocument, resolveOpts).trim();
|
|
26766
26820
|
const proposalDescription = resolveReferences(parsed.proposalDescription, editorDocument, resolveOpts).trim();
|
|
@@ -26854,7 +26908,8 @@ var ProposalCreateFlowDetail = ({ inputs, editor, block, runtime, updateRuntime,
|
|
|
26854
26908
|
invocationStore,
|
|
26855
26909
|
flowUri,
|
|
26856
26910
|
flowId,
|
|
26857
|
-
flowOwnerDid
|
|
26911
|
+
flowOwnerDid,
|
|
26912
|
+
schemaVersion
|
|
26858
26913
|
},
|
|
26859
26914
|
action: async () => {
|
|
26860
26915
|
const result = await actionDef.run(
|
|
@@ -27128,7 +27183,7 @@ var ProposalVoteConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
27128
27183
|
};
|
|
27129
27184
|
|
|
27130
27185
|
// src/mantine/blocks/action/actionTypes/proposalVote/ProposalVoteFlowDetail.tsx
|
|
27131
|
-
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";
|
|
27132
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";
|
|
27133
27188
|
var getVoteIcon2 = (voteType) => {
|
|
27134
27189
|
switch (voteType) {
|
|
@@ -27145,27 +27200,28 @@ var getVoteIcon2 = (voteType) => {
|
|
|
27145
27200
|
};
|
|
27146
27201
|
var ProposalVoteFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
27147
27202
|
const handlers = useBlocknoteHandlers();
|
|
27148
|
-
const services =
|
|
27149
|
-
const flowNode =
|
|
27150
|
-
const runtimeManager =
|
|
27151
|
-
const ucanService =
|
|
27152
|
-
const invocationStore =
|
|
27153
|
-
const flowId =
|
|
27154
|
-
const flowOwnerDid =
|
|
27155
|
-
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(() => {
|
|
27156
27212
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
27157
27213
|
return `ixo:flow:${docId}`;
|
|
27158
27214
|
}, [editor, block.id]);
|
|
27159
|
-
const actorDid =
|
|
27215
|
+
const actorDid = useMemo100(() => {
|
|
27160
27216
|
try {
|
|
27161
27217
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
27162
27218
|
} catch {
|
|
27163
27219
|
return "";
|
|
27164
27220
|
}
|
|
27165
27221
|
}, [handlers]);
|
|
27166
|
-
const parsed =
|
|
27222
|
+
const parsed = useMemo100(() => parseProposalVoteInputs(inputs), [inputs]);
|
|
27167
27223
|
const editorDocument = editor?.document || [];
|
|
27168
|
-
const resolveOpts =
|
|
27224
|
+
const resolveOpts = useMemo100(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
27169
27225
|
const proposalId = resolveReferences(parsed.proposalId, editorDocument, resolveOpts).trim();
|
|
27170
27226
|
const coreAddress = resolveReferences(parsed.coreAddress, editorDocument, resolveOpts).trim();
|
|
27171
27227
|
const inputContractAddress = resolveReferences(parsed.proposalContractAddress, editorDocument, resolveOpts).trim();
|
|
@@ -27240,7 +27296,8 @@ var ProposalVoteFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, i
|
|
|
27240
27296
|
invocationStore,
|
|
27241
27297
|
flowUri,
|
|
27242
27298
|
flowId,
|
|
27243
|
-
flowOwnerDid
|
|
27299
|
+
flowOwnerDid,
|
|
27300
|
+
schemaVersion
|
|
27244
27301
|
},
|
|
27245
27302
|
action: async () => {
|
|
27246
27303
|
const result = await actionDef.run(
|
|
@@ -27461,7 +27518,7 @@ registerActionTypeUI("qi/proposal.vote", {
|
|
|
27461
27518
|
});
|
|
27462
27519
|
|
|
27463
27520
|
// src/mantine/blocks/action/actionTypes/protocolSelect/ProtocolSelectConfig.tsx
|
|
27464
|
-
import React256, { useMemo as
|
|
27521
|
+
import React256, { useMemo as useMemo101, useState as useState108 } from "react";
|
|
27465
27522
|
import { Box as Box52, Pill as Pill3, PillsInput as PillsInput3, Stack as Stack173, Text as Text149 } from "@mantine/core";
|
|
27466
27523
|
function parseInputs(json) {
|
|
27467
27524
|
try {
|
|
@@ -27474,7 +27531,7 @@ function parseInputs(json) {
|
|
|
27474
27531
|
}
|
|
27475
27532
|
}
|
|
27476
27533
|
var ProtocolSelectConfig = ({ inputs, onInputsChange }) => {
|
|
27477
|
-
const local =
|
|
27534
|
+
const local = useMemo101(() => parseInputs(inputs), [inputs]);
|
|
27478
27535
|
const [inputValue, setInputValue] = useState108("");
|
|
27479
27536
|
const update = (dids) => {
|
|
27480
27537
|
onInputsChange(JSON.stringify({ ...local, protocolDids: dids }));
|
|
@@ -27506,7 +27563,7 @@ var ProtocolSelectConfig = ({ inputs, onInputsChange }) => {
|
|
|
27506
27563
|
};
|
|
27507
27564
|
|
|
27508
27565
|
// src/mantine/blocks/action/actionTypes/protocolSelect/ProtocolSelectFlowDetail.tsx
|
|
27509
|
-
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";
|
|
27510
27567
|
import { Box as Box53, Group as Group97, Loader as Loader46, Stack as Stack174, Text as Text150 } from "@mantine/core";
|
|
27511
27568
|
function parseInputs2(json) {
|
|
27512
27569
|
try {
|
|
@@ -27520,7 +27577,7 @@ function parseInputs2(json) {
|
|
|
27520
27577
|
}
|
|
27521
27578
|
var ProtocolSelectFlowDetail = ({ inputs, block, runtime, updateRuntime, isDisabled }) => {
|
|
27522
27579
|
const handlers = useBlocknoteHandlers();
|
|
27523
|
-
const { protocolDids } =
|
|
27580
|
+
const { protocolDids } = useMemo102(() => parseInputs2(inputs), [inputs]);
|
|
27524
27581
|
const [protocols, setProtocols] = useState109([]);
|
|
27525
27582
|
const selectedDid = runtime.output?.selectedProtocolDid;
|
|
27526
27583
|
useEffect89(() => {
|
|
@@ -27690,7 +27747,7 @@ var DomainSignConfig = ({ inputs, onInputsChange }) => {
|
|
|
27690
27747
|
};
|
|
27691
27748
|
|
|
27692
27749
|
// src/mantine/blocks/action/actionTypes/domainSign/DomainSignFlowDetail.tsx
|
|
27693
|
-
import React259, { useCallback as useCallback88, useMemo as
|
|
27750
|
+
import React259, { useCallback as useCallback88, useMemo as useMemo103, useState as useState111 } from "react";
|
|
27694
27751
|
import { Alert as Alert47, Button as Button50, Group as Group98, Loader as Loader47, Stack as Stack176, Text as Text152 } from "@mantine/core";
|
|
27695
27752
|
import { IconCheck as IconCheck20, IconAlertCircle as IconAlertCircle17, IconExternalLink as IconExternalLink2 } from "@tabler/icons-react";
|
|
27696
27753
|
var STEP_LABELS = {
|
|
@@ -27700,29 +27757,30 @@ var STEP_LABELS = {
|
|
|
27700
27757
|
};
|
|
27701
27758
|
var DomainSignFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
27702
27759
|
const handlers = useBlocknoteHandlers();
|
|
27703
|
-
const services =
|
|
27704
|
-
const flowNode =
|
|
27705
|
-
const runtimeManager =
|
|
27706
|
-
const ucanService =
|
|
27707
|
-
const invocationStore =
|
|
27708
|
-
const flowId =
|
|
27709
|
-
const flowOwnerDid =
|
|
27710
|
-
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(() => {
|
|
27711
27769
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
27712
27770
|
return `ixo:flow:${docId}`;
|
|
27713
27771
|
}, [editor, block.id]);
|
|
27714
|
-
const actorDid =
|
|
27772
|
+
const actorDid = useMemo103(() => {
|
|
27715
27773
|
try {
|
|
27716
27774
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
27717
27775
|
} catch {
|
|
27718
27776
|
return "";
|
|
27719
27777
|
}
|
|
27720
27778
|
}, [handlers]);
|
|
27721
|
-
const parsed =
|
|
27779
|
+
const parsed = useMemo103(() => parseDomainSignInputs(inputs), [inputs]);
|
|
27722
27780
|
const editorDocument = editor?.document || [];
|
|
27723
|
-
const resolveOpts =
|
|
27781
|
+
const resolveOpts = useMemo103(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
27724
27782
|
const entityType = resolveReferences(parsed.entityType, editorDocument, resolveOpts).trim();
|
|
27725
|
-
const domainCardData =
|
|
27783
|
+
const domainCardData = useMemo103(() => {
|
|
27726
27784
|
try {
|
|
27727
27785
|
const raw = runtime.output?.domainCardData || block.props?.domainCardData;
|
|
27728
27786
|
if (!raw) return null;
|
|
@@ -27769,7 +27827,8 @@ var DomainSignFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
27769
27827
|
invocationStore,
|
|
27770
27828
|
flowUri,
|
|
27771
27829
|
flowId,
|
|
27772
|
-
flowOwnerDid
|
|
27830
|
+
flowOwnerDid,
|
|
27831
|
+
schemaVersion
|
|
27773
27832
|
},
|
|
27774
27833
|
action: async () => {
|
|
27775
27834
|
const wrappedHandlers = handlers ? {
|
|
@@ -27940,39 +27999,40 @@ var DomainCreateConfig = ({ inputs, onInputsChange }) => {
|
|
|
27940
27999
|
};
|
|
27941
28000
|
|
|
27942
28001
|
// src/mantine/blocks/action/actionTypes/domainCreate/DomainCreateFlowDetail.tsx
|
|
27943
|
-
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";
|
|
27944
28003
|
import { Alert as Alert48, Button as Button51, Group as Group99, Loader as Loader48, Stack as Stack178, Text as Text154 } from "@mantine/core";
|
|
27945
28004
|
import { IconCheck as IconCheck21, IconAlertCircle as IconAlertCircle18, IconPlayerPlay as IconPlayerPlay6 } from "@tabler/icons-react";
|
|
27946
28005
|
import { SurveyModel as SurveyModel12 } from "@ixo/surveys";
|
|
27947
28006
|
var DomainCreateFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
27948
28007
|
const handlers = useBlocknoteHandlers();
|
|
27949
|
-
const services =
|
|
27950
|
-
const flowNode =
|
|
27951
|
-
const runtimeManager =
|
|
27952
|
-
const ucanService =
|
|
27953
|
-
const invocationStore =
|
|
27954
|
-
const flowId =
|
|
27955
|
-
const flowOwnerDid =
|
|
27956
|
-
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(() => {
|
|
27957
28017
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
27958
28018
|
return `ixo:flow:${docId}`;
|
|
27959
28019
|
}, [editor, block.id]);
|
|
27960
|
-
const actorDid =
|
|
28020
|
+
const actorDid = useMemo104(() => {
|
|
27961
28021
|
try {
|
|
27962
28022
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
27963
28023
|
} catch {
|
|
27964
28024
|
return "";
|
|
27965
28025
|
}
|
|
27966
28026
|
}, [handlers]);
|
|
27967
|
-
const parsed =
|
|
28027
|
+
const parsed = useMemo104(() => parseDomainCreateInputs(inputs), [inputs]);
|
|
27968
28028
|
const editorDocument = editor?.document || [];
|
|
27969
|
-
const resolveOpts =
|
|
28029
|
+
const resolveOpts = useMemo104(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
27970
28030
|
const entityType = resolveReferences(parsed.entityType, editorDocument, resolveOpts).trim() || "dao";
|
|
27971
28031
|
const initialStep = runtime.output?.entityDid ? "success" : "idle";
|
|
27972
28032
|
const [flowStep, setFlowStep] = useState113(initialStep);
|
|
27973
28033
|
const [error, setError] = useState113(null);
|
|
27974
28034
|
const surveySchema = parsed.surveySchema || tempDomainCreatorSurvey;
|
|
27975
|
-
const surveyModel =
|
|
28035
|
+
const surveyModel = useMemo104(() => {
|
|
27976
28036
|
const model = new SurveyModel12(surveySchema);
|
|
27977
28037
|
model.applyTheme(surveyTheme);
|
|
27978
28038
|
model.showQuestionNumbers = "off";
|
|
@@ -28000,7 +28060,8 @@ var DomainCreateFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, i
|
|
|
28000
28060
|
invocationStore,
|
|
28001
28061
|
flowUri,
|
|
28002
28062
|
flowId,
|
|
28003
|
-
flowOwnerDid
|
|
28063
|
+
flowOwnerDid,
|
|
28064
|
+
schemaVersion
|
|
28004
28065
|
},
|
|
28005
28066
|
action: async () => {
|
|
28006
28067
|
const result = await actionDef.run(
|
|
@@ -28133,14 +28194,14 @@ var OracleConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28133
28194
|
};
|
|
28134
28195
|
|
|
28135
28196
|
// src/mantine/blocks/action/actionTypes/oracle/OracleFlowDetail.tsx
|
|
28136
|
-
import React263, { useCallback as useCallback92, useMemo as
|
|
28197
|
+
import React263, { useCallback as useCallback92, useMemo as useMemo105, useState as useState115 } from "react";
|
|
28137
28198
|
import { Alert as Alert49, Button as Button52, Stack as Stack180 } from "@mantine/core";
|
|
28138
28199
|
import { IconCheck as IconCheck22, IconAlertCircle as IconAlertCircle19, IconSparkles as IconSparkles6 } from "@tabler/icons-react";
|
|
28139
28200
|
var OracleFlowDetail = ({ inputs, editor, runtime, updateRuntime, isDisabled }) => {
|
|
28140
28201
|
const handlers = useBlocknoteHandlers();
|
|
28141
|
-
const parsed =
|
|
28202
|
+
const parsed = useMemo105(() => parseOracleInputs(inputs), [inputs]);
|
|
28142
28203
|
const editorDocument = editor?.document || [];
|
|
28143
|
-
const resolveOpts =
|
|
28204
|
+
const resolveOpts = useMemo105(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
28144
28205
|
const resolvedPrompt = resolveReferences(parsed.prompt, editorDocument, resolveOpts).trim();
|
|
28145
28206
|
const [isLoading, setIsLoading] = useState115(false);
|
|
28146
28207
|
const [error, setError] = useState115(null);
|
|
@@ -28231,7 +28292,7 @@ var OraclePromptConfig = ({ inputs, onInputsChange }) => {
|
|
|
28231
28292
|
};
|
|
28232
28293
|
|
|
28233
28294
|
// src/mantine/blocks/action/actionTypes/oraclePrompt/OraclePromptFlowDetail.tsx
|
|
28234
|
-
import React265, { useCallback as useCallback94, useMemo as
|
|
28295
|
+
import React265, { useCallback as useCallback94, useMemo as useMemo106, useState as useState117 } from "react";
|
|
28235
28296
|
import { Alert as Alert50, Loader as Loader49, Stack as Stack182, Text as Text155 } from "@mantine/core";
|
|
28236
28297
|
import { IconSend as IconSend6 } from "@tabler/icons-react";
|
|
28237
28298
|
function parsePrimarySkill(rawSkill) {
|
|
@@ -28271,10 +28332,10 @@ function buildFinalPrompt(prompt, skill) {
|
|
|
28271
28332
|
}
|
|
28272
28333
|
var OraclePromptFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
28273
28334
|
const handlers = useBlocknoteHandlers();
|
|
28274
|
-
const parsed =
|
|
28335
|
+
const parsed = useMemo106(() => parseOraclePromptInputs(inputs), [inputs]);
|
|
28275
28336
|
const editorDocument = editor?.document || [];
|
|
28276
|
-
const resolveOpts =
|
|
28277
|
-
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]);
|
|
28278
28339
|
const [submitting, setSubmitting] = useState117(false);
|
|
28279
28340
|
const [error, setError] = useState117(null);
|
|
28280
28341
|
const handleExecute = useCallback94(async () => {
|
|
@@ -28389,7 +28450,7 @@ var FormSubmitConfig = ({ inputs, onInputsChange }) => {
|
|
|
28389
28450
|
};
|
|
28390
28451
|
|
|
28391
28452
|
// src/mantine/blocks/action/actionTypes/formSubmit/FormSubmitFlowDetail.tsx
|
|
28392
|
-
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";
|
|
28393
28454
|
import { Alert as Alert51, Loader as Loader50, Stack as Stack184, Text as Text157 } from "@mantine/core";
|
|
28394
28455
|
import { SurveyModel as SurveyModel13 } from "@ixo/surveys";
|
|
28395
28456
|
function parsePrimarySkill2(rawSkill) {
|
|
@@ -28438,31 +28499,32 @@ ${answersJson}`
|
|
|
28438
28499
|
}
|
|
28439
28500
|
var FormSubmitFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
28440
28501
|
const handlers = useBlocknoteHandlers();
|
|
28441
|
-
const services =
|
|
28442
|
-
const flowNode =
|
|
28443
|
-
const runtimeManager =
|
|
28444
|
-
const ucanService =
|
|
28445
|
-
const invocationStore =
|
|
28446
|
-
const flowId =
|
|
28447
|
-
const flowOwnerDid =
|
|
28448
|
-
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(() => {
|
|
28449
28511
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
28450
28512
|
return `ixo:flow:${docId}`;
|
|
28451
28513
|
}, [editor, block.id]);
|
|
28452
|
-
const actorDid =
|
|
28514
|
+
const actorDid = useMemo107(() => {
|
|
28453
28515
|
try {
|
|
28454
28516
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
28455
28517
|
} catch {
|
|
28456
28518
|
return "";
|
|
28457
28519
|
}
|
|
28458
28520
|
}, [handlers]);
|
|
28459
|
-
const parsed =
|
|
28521
|
+
const parsed = useMemo107(() => parseFormSubmitActionInputs(inputs), [inputs]);
|
|
28460
28522
|
const editorDocument = editor?.document || [];
|
|
28461
|
-
const resolveOpts =
|
|
28462
|
-
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]);
|
|
28463
28525
|
const [submitting, setSubmitting] = useState119(false);
|
|
28464
28526
|
const [error, setError] = useState119(null);
|
|
28465
|
-
const parsedSchema =
|
|
28527
|
+
const parsedSchema = useMemo107(() => {
|
|
28466
28528
|
if (!resolvedSchemaString) return null;
|
|
28467
28529
|
try {
|
|
28468
28530
|
const schema = JSON.parse(resolvedSchemaString);
|
|
@@ -28474,7 +28536,7 @@ var FormSubmitFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
28474
28536
|
}, [resolvedSchemaString]);
|
|
28475
28537
|
const isCompleted = runtime.state === "completed";
|
|
28476
28538
|
const savedAnswers = isCompleted && runtime.output?.answers && typeof runtime.output.answers === "object" ? runtime.output.answers : null;
|
|
28477
|
-
const surveyModel =
|
|
28539
|
+
const surveyModel = useMemo107(() => {
|
|
28478
28540
|
if (!parsedSchema) return null;
|
|
28479
28541
|
const model = new SurveyModel13(parsedSchema);
|
|
28480
28542
|
model.applyTheme(surveyTheme);
|
|
@@ -28526,7 +28588,8 @@ var FormSubmitFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
28526
28588
|
invocationStore,
|
|
28527
28589
|
flowUri,
|
|
28528
28590
|
flowId,
|
|
28529
|
-
flowOwnerDid
|
|
28591
|
+
flowOwnerDid,
|
|
28592
|
+
schemaVersion
|
|
28530
28593
|
},
|
|
28531
28594
|
action: async () => {
|
|
28532
28595
|
const result = await actionDef.run(
|
|
@@ -28672,7 +28735,7 @@ var CredentialStoreConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28672
28735
|
};
|
|
28673
28736
|
|
|
28674
28737
|
// src/mantine/blocks/action/actionTypes/credentialStore/CredentialStoreFlowDetail.tsx
|
|
28675
|
-
import React269, { useCallback as useCallback98, useMemo as
|
|
28738
|
+
import React269, { useCallback as useCallback98, useMemo as useMemo108, useState as useState121 } from "react";
|
|
28676
28739
|
import { Alert as Alert52, Button as Button53, Code as Code10, Loader as Loader51, Stack as Stack186, Text as Text159 } from "@mantine/core";
|
|
28677
28740
|
import { IconShieldCheck as IconShieldCheck15 } from "@tabler/icons-react";
|
|
28678
28741
|
function safeParse(value) {
|
|
@@ -28688,7 +28751,7 @@ function safeParse(value) {
|
|
|
28688
28751
|
return result;
|
|
28689
28752
|
}
|
|
28690
28753
|
function CredentialPreview({ value }) {
|
|
28691
|
-
const display =
|
|
28754
|
+
const display = useMemo108(() => {
|
|
28692
28755
|
if (!value) return null;
|
|
28693
28756
|
const parsed = safeParse(value);
|
|
28694
28757
|
if (parsed && typeof parsed === "object") {
|
|
@@ -28701,33 +28764,34 @@ function CredentialPreview({ value }) {
|
|
|
28701
28764
|
}
|
|
28702
28765
|
var CredentialStoreFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
28703
28766
|
const handlers = useBlocknoteHandlers();
|
|
28704
|
-
const services =
|
|
28705
|
-
const flowNode =
|
|
28706
|
-
const runtimeManager =
|
|
28707
|
-
const ucanService =
|
|
28708
|
-
const invocationStore =
|
|
28709
|
-
const flowId =
|
|
28710
|
-
const flowOwnerDid =
|
|
28711
|
-
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(() => {
|
|
28712
28776
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
28713
28777
|
return `ixo:flow:${docId}`;
|
|
28714
28778
|
}, [editor, block.id]);
|
|
28715
|
-
const actorDid =
|
|
28779
|
+
const actorDid = useMemo108(() => {
|
|
28716
28780
|
try {
|
|
28717
28781
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
28718
28782
|
} catch {
|
|
28719
28783
|
return "";
|
|
28720
28784
|
}
|
|
28721
28785
|
}, [handlers]);
|
|
28722
|
-
const parsed =
|
|
28786
|
+
const parsed = useMemo108(() => parseCredentialStoreInputs(inputs), [inputs]);
|
|
28723
28787
|
const editorDocument = editor?.document || [];
|
|
28724
|
-
const resolveOpts =
|
|
28725
|
-
const resolvedCredentialKey =
|
|
28788
|
+
const resolveOpts = useMemo108(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
28789
|
+
const resolvedCredentialKey = useMemo108(
|
|
28726
28790
|
() => resolveReferences(parsed.credentialKey || "", editorDocument, resolveOpts).trim(),
|
|
28727
28791
|
[parsed.credentialKey, editorDocument, resolveOpts]
|
|
28728
28792
|
);
|
|
28729
|
-
const resolvedCredential =
|
|
28730
|
-
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]);
|
|
28731
28795
|
const [submitting, setSubmitting] = useState121(false);
|
|
28732
28796
|
const [error, setError] = useState121(null);
|
|
28733
28797
|
const hasCredential = !!resolvedCredential;
|
|
@@ -28754,7 +28818,8 @@ var CredentialStoreFlowDetail = ({ inputs, editor, block, runtime, updateRuntime
|
|
|
28754
28818
|
invocationStore,
|
|
28755
28819
|
flowUri,
|
|
28756
28820
|
flowId,
|
|
28757
|
-
flowOwnerDid
|
|
28821
|
+
flowOwnerDid,
|
|
28822
|
+
schemaVersion
|
|
28758
28823
|
},
|
|
28759
28824
|
action: async () => {
|
|
28760
28825
|
const result = await actionDef.run(
|
|
@@ -28902,7 +28967,7 @@ var PaymentConfig = ({ inputs, onInputsChange }) => {
|
|
|
28902
28967
|
};
|
|
28903
28968
|
|
|
28904
28969
|
// src/mantine/blocks/action/actionTypes/payment/PaymentFlowDetail.tsx
|
|
28905
|
-
import React271, { useCallback as useCallback100, useMemo as
|
|
28970
|
+
import React271, { useCallback as useCallback100, useMemo as useMemo109, useState as useState123 } from "react";
|
|
28906
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";
|
|
28907
28972
|
import { IconAlertTriangle as IconAlertTriangle6, IconCash as IconCash2, IconSearch as IconSearch6, IconSend as IconSend7 } from "@tabler/icons-react";
|
|
28908
28973
|
function parsePrimarySkill3(rawSkill) {
|
|
@@ -28978,31 +29043,32 @@ function getPaymentStatusColor(status) {
|
|
|
28978
29043
|
}
|
|
28979
29044
|
var PaymentFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
28980
29045
|
const handlers = useBlocknoteHandlers();
|
|
28981
|
-
const services =
|
|
28982
|
-
const flowNode =
|
|
28983
|
-
const runtimeManager =
|
|
28984
|
-
const ucanService =
|
|
28985
|
-
const invocationStore =
|
|
28986
|
-
const flowId =
|
|
28987
|
-
const flowOwnerDid =
|
|
28988
|
-
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(() => {
|
|
28989
29055
|
const docId = editor?.getFlowMetadata?.()?.doc_id || block.id;
|
|
28990
29056
|
return `ixo:flow:${docId}`;
|
|
28991
29057
|
}, [editor, block.id]);
|
|
28992
|
-
const actorDid =
|
|
29058
|
+
const actorDid = useMemo109(() => {
|
|
28993
29059
|
try {
|
|
28994
29060
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
28995
29061
|
} catch {
|
|
28996
29062
|
return "";
|
|
28997
29063
|
}
|
|
28998
29064
|
}, [handlers]);
|
|
28999
|
-
const parsed =
|
|
29065
|
+
const parsed = useMemo109(() => parsePaymentInputs(inputs), [inputs]);
|
|
29000
29066
|
const [submitting, setSubmitting] = useState123(false);
|
|
29001
29067
|
const [error, setError] = useState123(null);
|
|
29002
29068
|
const paymentStatus = block.props.paymentStatus || "";
|
|
29003
29069
|
const transactionId = block.props.transactionId || "";
|
|
29004
29070
|
const paymentError = block.props.paymentError || "";
|
|
29005
|
-
const proposal =
|
|
29071
|
+
const proposal = useMemo109(() => {
|
|
29006
29072
|
const raw = block.props.paymentProposal;
|
|
29007
29073
|
if (!raw) return null;
|
|
29008
29074
|
try {
|
|
@@ -29011,7 +29077,7 @@ var PaymentFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisa
|
|
|
29011
29077
|
return null;
|
|
29012
29078
|
}
|
|
29013
29079
|
}, [block.props.paymentProposal]);
|
|
29014
|
-
const summary =
|
|
29080
|
+
const summary = useMemo109(() => {
|
|
29015
29081
|
const raw = block.props.paymentSummary;
|
|
29016
29082
|
if (!raw) return null;
|
|
29017
29083
|
try {
|
|
@@ -29020,7 +29086,7 @@ var PaymentFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisa
|
|
|
29020
29086
|
return null;
|
|
29021
29087
|
}
|
|
29022
29088
|
}, [block.props.paymentSummary]);
|
|
29023
|
-
const paymentConfig =
|
|
29089
|
+
const paymentConfig = useMemo109(() => {
|
|
29024
29090
|
if (!parsed.paymentConfig) return null;
|
|
29025
29091
|
try {
|
|
29026
29092
|
return JSON.parse(parsed.paymentConfig);
|
|
@@ -29087,7 +29153,8 @@ var PaymentFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisa
|
|
|
29087
29153
|
invocationStore,
|
|
29088
29154
|
flowUri,
|
|
29089
29155
|
flowId,
|
|
29090
|
-
flowOwnerDid
|
|
29156
|
+
flowOwnerDid,
|
|
29157
|
+
schemaVersion
|
|
29091
29158
|
},
|
|
29092
29159
|
action: async () => {
|
|
29093
29160
|
const result = await actionDef.run(
|
|
@@ -29220,7 +29287,7 @@ registerActionTypeUI("qi/payment.execute", {
|
|
|
29220
29287
|
});
|
|
29221
29288
|
|
|
29222
29289
|
// src/mantine/blocks/action/actionTypes/matrixDm/MatrixDmConfig.tsx
|
|
29223
|
-
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";
|
|
29224
29291
|
import { Flex as Flex34, Stack as Stack189, Text as Text162 } from "@mantine/core";
|
|
29225
29292
|
|
|
29226
29293
|
// src/mantine/blocks/action/actionTypes/matrixDm/types.ts
|
|
@@ -29272,13 +29339,13 @@ var MatrixDmConfig = ({ inputs, onInputsChange, editor }) => {
|
|
|
29272
29339
|
},
|
|
29273
29340
|
[local, onInputsChange]
|
|
29274
29341
|
);
|
|
29275
|
-
const selectData =
|
|
29342
|
+
const selectData = useMemo110(() => {
|
|
29276
29343
|
return roomMembers.map((member) => ({
|
|
29277
29344
|
value: member.did,
|
|
29278
29345
|
label: member.name || member.did
|
|
29279
29346
|
}));
|
|
29280
29347
|
}, [roomMembers]);
|
|
29281
|
-
const memberLookup =
|
|
29348
|
+
const memberLookup = useMemo110(() => {
|
|
29282
29349
|
const lookup = {};
|
|
29283
29350
|
roomMembers.forEach((member) => {
|
|
29284
29351
|
lookup[member.did] = member;
|
|
@@ -29429,7 +29496,7 @@ import { createReactBlockSpec as createReactBlockSpec21 } from "@blocknote/react
|
|
|
29429
29496
|
import React282 from "react";
|
|
29430
29497
|
|
|
29431
29498
|
// src/mantine/blocks/location/template/TemplateView.tsx
|
|
29432
|
-
import React279, { useMemo as
|
|
29499
|
+
import React279, { useMemo as useMemo111 } from "react";
|
|
29433
29500
|
import { Group as Group102, Stack as Stack191, Text as Text165 } from "@mantine/core";
|
|
29434
29501
|
import { IconMapPin } from "@tabler/icons-react";
|
|
29435
29502
|
|
|
@@ -29857,14 +29924,14 @@ function LocationMap(props) {
|
|
|
29857
29924
|
var LOCATION_TEMPLATE_PANEL_ID = "location-template-panel";
|
|
29858
29925
|
var LocationTemplateView = ({ editor, block }) => {
|
|
29859
29926
|
const panelId = `${LOCATION_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
29860
|
-
const panelContent =
|
|
29927
|
+
const panelContent = useMemo111(() => /* @__PURE__ */ React279.createElement(TemplateConfig17, { editor, block }), [editor, block]);
|
|
29861
29928
|
const { open } = usePanel(panelId, panelContent);
|
|
29862
29929
|
const hasLocation = block.props.latitude && block.props.longitude;
|
|
29863
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 })));
|
|
29864
29931
|
};
|
|
29865
29932
|
|
|
29866
29933
|
// src/mantine/blocks/location/flow/FlowView.tsx
|
|
29867
|
-
import React281, { useMemo as
|
|
29934
|
+
import React281, { useMemo as useMemo112 } from "react";
|
|
29868
29935
|
import { Center as Center13, Group as Group103, Stack as Stack192, Text as Text166 } from "@mantine/core";
|
|
29869
29936
|
import { IconMapPin as IconMapPin2 } from "@tabler/icons-react";
|
|
29870
29937
|
|
|
@@ -29880,7 +29947,7 @@ var FlowConfig3 = ({ block }) => {
|
|
|
29880
29947
|
var LOCATION_FLOW_PANEL_ID = "location-flow-panel";
|
|
29881
29948
|
var LocationFlowView = ({ editor, block }) => {
|
|
29882
29949
|
const panelId = `${LOCATION_FLOW_PANEL_ID}-${block.id}`;
|
|
29883
|
-
const panelContent =
|
|
29950
|
+
const panelContent = useMemo112(() => /* @__PURE__ */ React281.createElement(FlowConfig3, { editor, block }), [editor, block]);
|
|
29884
29951
|
const { open } = usePanel(panelId, panelContent);
|
|
29885
29952
|
const hasLocation = block.props.latitude && block.props.longitude;
|
|
29886
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"))));
|
|
@@ -29924,7 +29991,7 @@ import { createReactBlockSpec as createReactBlockSpec22 } from "@blocknote/react
|
|
|
29924
29991
|
import React289 from "react";
|
|
29925
29992
|
|
|
29926
29993
|
// src/mantine/blocks/embed/template/TemplateView.tsx
|
|
29927
|
-
import React286, { useMemo as
|
|
29994
|
+
import React286, { useMemo as useMemo113 } from "react";
|
|
29928
29995
|
import { Box as Box56, Group as Group104, Stack as Stack194, Text as Text168 } from "@mantine/core";
|
|
29929
29996
|
|
|
29930
29997
|
// src/mantine/blocks/embed/template/TemplateConfig.tsx
|
|
@@ -30041,7 +30108,7 @@ function sanitizeEmbedUrl(raw) {
|
|
|
30041
30108
|
var EMBED_TEMPLATE_PANEL_ID = "embed-template-panel";
|
|
30042
30109
|
var EmbedTemplateView = ({ editor, block }) => {
|
|
30043
30110
|
const panelId = `${EMBED_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
30044
|
-
const panelContent =
|
|
30111
|
+
const panelContent = useMemo113(() => /* @__PURE__ */ React286.createElement(TemplateConfig18, { editor, block }), [editor, block]);
|
|
30045
30112
|
const { open } = usePanel(panelId, panelContent);
|
|
30046
30113
|
const safeUrl = sanitizeEmbedUrl(block.props.url);
|
|
30047
30114
|
const height = Number(block.props.height) || 400;
|
|
@@ -30062,7 +30129,7 @@ var EmbedTemplateView = ({ editor, block }) => {
|
|
|
30062
30129
|
};
|
|
30063
30130
|
|
|
30064
30131
|
// src/mantine/blocks/embed/flow/FlowView.tsx
|
|
30065
|
-
import React288, { useMemo as
|
|
30132
|
+
import React288, { useMemo as useMemo114 } from "react";
|
|
30066
30133
|
import { Box as Box57, Group as Group105, Stack as Stack195, Text as Text169 } from "@mantine/core";
|
|
30067
30134
|
|
|
30068
30135
|
// src/mantine/blocks/embed/flow/FlowConfig.tsx
|
|
@@ -30107,7 +30174,7 @@ var FlowConfig4 = ({ editor, block }) => {
|
|
|
30107
30174
|
var EMBED_FLOW_PANEL_ID = "embed-flow-panel";
|
|
30108
30175
|
var EmbedFlowView = ({ editor, block }) => {
|
|
30109
30176
|
const panelId = `${EMBED_FLOW_PANEL_ID}-${block.id}`;
|
|
30110
|
-
const panelContent =
|
|
30177
|
+
const panelContent = useMemo114(() => /* @__PURE__ */ React288.createElement(FlowConfig4, { editor, block }), [editor, block]);
|
|
30111
30178
|
const { open } = usePanel(panelId, panelContent);
|
|
30112
30179
|
const safeUrl = sanitizeEmbedUrl(block.props.url);
|
|
30113
30180
|
const height = Number(block.props.height) || 400;
|
|
@@ -30374,10 +30441,10 @@ blockRegistry.register({
|
|
|
30374
30441
|
});
|
|
30375
30442
|
|
|
30376
30443
|
// src/mantine/blocks/hooks/useBlockDependencies.ts
|
|
30377
|
-
import { useMemo as
|
|
30444
|
+
import { useMemo as useMemo115, useEffect as useEffect104, useState as useState130, useCallback as useCallback106 } from "react";
|
|
30378
30445
|
|
|
30379
30446
|
// src/mantine/blocks/hooks/useDependsOn.ts
|
|
30380
|
-
import { useMemo as
|
|
30447
|
+
import { useMemo as useMemo116 } from "react";
|
|
30381
30448
|
|
|
30382
30449
|
// src/mantine/blocks/index.ts
|
|
30383
30450
|
var blockSpecs = {
|
|
@@ -30872,7 +30939,7 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
|
30872
30939
|
import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
|
|
30873
30940
|
|
|
30874
30941
|
// src/core/hooks/useMatrixProvider.ts
|
|
30875
|
-
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";
|
|
30876
30943
|
import { MatrixProvider } from "@ixo/matrix-crdt";
|
|
30877
30944
|
function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
30878
30945
|
const [matrixProvider, setProvider] = useState131(null);
|
|
@@ -30880,7 +30947,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
30880
30947
|
const isMountedRef = useRef26(true);
|
|
30881
30948
|
const providerRef = useRef26(null);
|
|
30882
30949
|
const retryTimeoutRef = useRef26(null);
|
|
30883
|
-
const providerOptions =
|
|
30950
|
+
const providerOptions = useMemo117(
|
|
30884
30951
|
() => ({
|
|
30885
30952
|
translator: {
|
|
30886
30953
|
updateEventType: "matrix-crdt.doc_update",
|
|
@@ -30967,17 +31034,17 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
30967
31034
|
}
|
|
30968
31035
|
|
|
30969
31036
|
// src/mantine/hooks/useCollaborativeYDoc.ts
|
|
30970
|
-
import { useMemo as
|
|
31037
|
+
import { useMemo as useMemo118 } from "react";
|
|
30971
31038
|
import * as Y from "yjs";
|
|
30972
31039
|
function useCollaborativeYDoc(_options) {
|
|
30973
|
-
return
|
|
31040
|
+
return useMemo118(() => {
|
|
30974
31041
|
const doc = new Y.Doc();
|
|
30975
31042
|
return doc;
|
|
30976
31043
|
}, []);
|
|
30977
31044
|
}
|
|
30978
31045
|
|
|
30979
31046
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
30980
|
-
import { useMemo as
|
|
31047
|
+
import { useMemo as useMemo119, useEffect as useEffect107, useState as useState132, useRef as useRef28 } from "react";
|
|
30981
31048
|
|
|
30982
31049
|
// src/core/lib/matrixMetadata.ts
|
|
30983
31050
|
var COVER_IMAGE_EVENT_TYPE = "ixo.page.cover_image";
|
|
@@ -31503,7 +31570,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31503
31570
|
matrixClient,
|
|
31504
31571
|
permissions = { write: false }
|
|
31505
31572
|
} = options || {};
|
|
31506
|
-
const memoizedUser =
|
|
31573
|
+
const memoizedUser = useMemo119(
|
|
31507
31574
|
() => ({
|
|
31508
31575
|
id: user?.id || "",
|
|
31509
31576
|
name: user?.name || "",
|
|
@@ -31519,13 +31586,13 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31519
31586
|
matrixClient,
|
|
31520
31587
|
roomId: options.roomId
|
|
31521
31588
|
});
|
|
31522
|
-
const metadataManager =
|
|
31589
|
+
const metadataManager = useMemo119(() => new MatrixMetadataManager(matrixClient, options.roomId), [matrixClient, options.roomId]);
|
|
31523
31590
|
useEffect107(() => {
|
|
31524
31591
|
return () => {
|
|
31525
31592
|
metadataManager.dispose();
|
|
31526
31593
|
};
|
|
31527
31594
|
}, [metadataManager]);
|
|
31528
|
-
const defaultUploadFile =
|
|
31595
|
+
const defaultUploadFile = useMemo119(
|
|
31529
31596
|
() => uploadFile || (async (file) => {
|
|
31530
31597
|
return new Promise((resolve, reject) => {
|
|
31531
31598
|
const reader = new FileReader();
|
|
@@ -31539,7 +31606,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31539
31606
|
}),
|
|
31540
31607
|
[uploadFile]
|
|
31541
31608
|
);
|
|
31542
|
-
const schema =
|
|
31609
|
+
const schema = useMemo119(
|
|
31543
31610
|
() => BlockNoteSchema2.create({
|
|
31544
31611
|
blockSpecs: {
|
|
31545
31612
|
...defaultBlockSpecs2,
|
|
@@ -31554,13 +31621,14 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31554
31621
|
}),
|
|
31555
31622
|
[]
|
|
31556
31623
|
);
|
|
31557
|
-
const root =
|
|
31558
|
-
const documentFragment =
|
|
31559
|
-
const flowArray =
|
|
31560
|
-
const runtimeMap =
|
|
31561
|
-
const delegationsMap =
|
|
31562
|
-
const invocationsMap =
|
|
31563
|
-
const
|
|
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(() => {
|
|
31564
31632
|
const store = createUcanDelegationStore(delegationsMap);
|
|
31565
31633
|
const originalSet = store.set;
|
|
31566
31634
|
store.set = (delegation) => {
|
|
@@ -31569,7 +31637,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31569
31637
|
};
|
|
31570
31638
|
return store;
|
|
31571
31639
|
}, [delegationsMap, matrixClient, options.roomId]);
|
|
31572
|
-
const invocationStore =
|
|
31640
|
+
const invocationStore = useMemo119(() => {
|
|
31573
31641
|
const store = createInvocationStore(invocationsMap);
|
|
31574
31642
|
const originalAdd = store.add;
|
|
31575
31643
|
store.add = (invocation) => {
|
|
@@ -31578,8 +31646,8 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31578
31646
|
};
|
|
31579
31647
|
return store;
|
|
31580
31648
|
}, [invocationsMap, matrixClient, options.roomId]);
|
|
31581
|
-
const userFragment =
|
|
31582
|
-
const collaborationConfig =
|
|
31649
|
+
const userFragment = useMemo119(() => yDoc.getMap(memoizedUser.id), [yDoc, memoizedUser.id]);
|
|
31650
|
+
const collaborationConfig = useMemo119(
|
|
31583
31651
|
() => ({
|
|
31584
31652
|
provider: matrixProvider,
|
|
31585
31653
|
fragment: documentFragment,
|
|
@@ -31591,7 +31659,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31591
31659
|
}),
|
|
31592
31660
|
[matrixProvider, documentFragment, memoizedUser.name, memoizedUser.color]
|
|
31593
31661
|
);
|
|
31594
|
-
const ixoConfig =
|
|
31662
|
+
const ixoConfig = useMemo119(
|
|
31595
31663
|
() => ({
|
|
31596
31664
|
theme,
|
|
31597
31665
|
editable,
|
|
@@ -31611,7 +31679,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31611
31679
|
collaboration: collaborationConfig,
|
|
31612
31680
|
pasteHandler: ixoPasteHandler
|
|
31613
31681
|
});
|
|
31614
|
-
const titleText =
|
|
31682
|
+
const titleText = useMemo119(() => yDoc.getText("title"), [yDoc]);
|
|
31615
31683
|
let ixoEditor;
|
|
31616
31684
|
if (editor) {
|
|
31617
31685
|
ixoEditor = editor;
|
|
@@ -31676,6 +31744,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31676
31744
|
ixoEditor._yInvocations = invocationsMap;
|
|
31677
31745
|
ixoEditor._ucanDelegationStore = ucanDelegationStore;
|
|
31678
31746
|
ixoEditor._invocationStore = invocationStore;
|
|
31747
|
+
ixoEditor._yMigration = migrationMap;
|
|
31679
31748
|
ixoEditor.getUcanService = () => {
|
|
31680
31749
|
return null;
|
|
31681
31750
|
};
|
|
@@ -31816,9 +31885,9 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31816
31885
|
if (!permissions.write) {
|
|
31817
31886
|
return;
|
|
31818
31887
|
}
|
|
31819
|
-
root.set("@context",
|
|
31888
|
+
root.set("@context", `https://ixo.world/flow/${LATEST_VERSION}`);
|
|
31820
31889
|
root.set("_type", "ixo.flow.crdt");
|
|
31821
|
-
root.set("schema_version",
|
|
31890
|
+
root.set("schema_version", LATEST_VERSION);
|
|
31822
31891
|
root.set("doc_id", options.docId || `flow_${Date.now()}`);
|
|
31823
31892
|
root.set("createdAt", (/* @__PURE__ */ new Date()).toISOString());
|
|
31824
31893
|
root.set("createdBy", memoizedUser.id || "anonymous");
|
|
@@ -31947,7 +32016,7 @@ function PanelContent({ theme }) {
|
|
|
31947
32016
|
}
|
|
31948
32017
|
|
|
31949
32018
|
// src/mantine/components/CoverImage.tsx
|
|
31950
|
-
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";
|
|
31951
32020
|
import { Box as Box62, Group as Group109 } from "@mantine/core";
|
|
31952
32021
|
import { IconMoodSmile, IconPhoto as IconPhoto4, IconSettings as IconSettings22, IconArrowsMove, IconTrash as IconTrash11, IconRefresh as IconRefresh5 } from "@tabler/icons-react";
|
|
31953
32022
|
|
|
@@ -32127,7 +32196,7 @@ var CoverImageButton = forwardRef(function CoverImageButton2({ isActive = false,
|
|
|
32127
32196
|
});
|
|
32128
32197
|
|
|
32129
32198
|
// src/mantine/components/Base/BaseIconPicker.tsx
|
|
32130
|
-
import React293, { useState as useState134, useMemo as
|
|
32199
|
+
import React293, { useState as useState134, useMemo as useMemo120, useEffect as useEffect108 } from "react";
|
|
32131
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";
|
|
32132
32201
|
import * as TablerIcons from "@tabler/icons-react";
|
|
32133
32202
|
import { IconSearch as IconSearch7, IconX as IconX13, IconChevronLeft, IconChevronRight as IconChevronRight13 } from "@tabler/icons-react";
|
|
@@ -32163,11 +32232,11 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
32163
32232
|
const [searchQuery, setSearchQuery] = useState134("");
|
|
32164
32233
|
const [activeTab, setActiveTab] = useState134("icons");
|
|
32165
32234
|
const [currentPage, setCurrentPage] = useState134(1);
|
|
32166
|
-
const allIcons =
|
|
32235
|
+
const allIcons = useMemo120(() => {
|
|
32167
32236
|
const iconEntries = Object.entries(TablerIcons).filter(([name]) => name.startsWith("Icon") && name !== "IconProps");
|
|
32168
32237
|
return iconEntries;
|
|
32169
32238
|
}, []);
|
|
32170
|
-
const filteredIcons =
|
|
32239
|
+
const filteredIcons = useMemo120(() => {
|
|
32171
32240
|
if (!searchQuery) return allIcons;
|
|
32172
32241
|
const query = searchQuery.toLowerCase();
|
|
32173
32242
|
return allIcons.filter(([name]) => name.toLowerCase().includes(query));
|
|
@@ -32175,13 +32244,13 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
32175
32244
|
useEffect108(() => {
|
|
32176
32245
|
setCurrentPage(1);
|
|
32177
32246
|
}, [searchQuery]);
|
|
32178
|
-
const paginatedIcons =
|
|
32247
|
+
const paginatedIcons = useMemo120(() => {
|
|
32179
32248
|
const startIndex = (currentPage - 1) * ICONS_PER_PAGE;
|
|
32180
32249
|
const endIndex = startIndex + ICONS_PER_PAGE;
|
|
32181
32250
|
return filteredIcons.slice(startIndex, endIndex);
|
|
32182
32251
|
}, [filteredIcons, currentPage]);
|
|
32183
32252
|
const totalPages = Math.ceil(filteredIcons.length / ICONS_PER_PAGE);
|
|
32184
|
-
const recentIcons =
|
|
32253
|
+
const recentIcons = useMemo120(() => {
|
|
32185
32254
|
const recentIconNames = localStorageService.get(iconsKey);
|
|
32186
32255
|
if (!recentIconNames || recentIconNames.length === 0) return [];
|
|
32187
32256
|
return recentIconNames.slice(0, 24).map((iconName) => allIcons.find(([name]) => name === iconName)).filter((entry) => entry !== void 0);
|
|
@@ -32303,12 +32372,12 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
32303
32372
|
}
|
|
32304
32373
|
|
|
32305
32374
|
// src/mantine/components/Base/PageIcon.tsx
|
|
32306
|
-
import React294, { useMemo as
|
|
32375
|
+
import React294, { useMemo as useMemo121 } from "react";
|
|
32307
32376
|
import { Center as Center15, Box as Box60 } from "@mantine/core";
|
|
32308
32377
|
import * as TablerIcons2 from "@tabler/icons-react";
|
|
32309
32378
|
function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
32310
32379
|
const isIconName = src && !src.startsWith("http");
|
|
32311
|
-
const IconComponent =
|
|
32380
|
+
const IconComponent = useMemo121(() => {
|
|
32312
32381
|
if (!isIconName || !src) return null;
|
|
32313
32382
|
const iconComponent = TablerIcons2[src];
|
|
32314
32383
|
if (iconComponent) {
|
|
@@ -32436,7 +32505,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32436
32505
|
const logoFileInputRef = useRef29(null);
|
|
32437
32506
|
const [opened, { open, close }] = useDisclosure7(false);
|
|
32438
32507
|
const [metadata, setMetadata] = useState136(() => editor?.getPageMetadata?.() || null);
|
|
32439
|
-
const settingsPanelContent =
|
|
32508
|
+
const settingsPanelContent = useMemo122(() => editor ? /* @__PURE__ */ React296.createElement(FlowSettingsPanel, { editor }) : null, [editor]);
|
|
32440
32509
|
const { open: openSettings } = usePanel("flow-settings-panel", settingsPanelContent);
|
|
32441
32510
|
useEffect110(() => {
|
|
32442
32511
|
if (!editor?._metadataManager) {
|
|
@@ -33722,14 +33791,14 @@ var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) =
|
|
|
33722
33791
|
};
|
|
33723
33792
|
|
|
33724
33793
|
// src/mantine/components/FlowPermissionsPanel.tsx
|
|
33725
|
-
import React303, { useState as useState141, useEffect as useEffect114, useMemo as
|
|
33794
|
+
import React303, { useState as useState141, useEffect as useEffect114, useMemo as useMemo123 } from "react";
|
|
33726
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";
|
|
33727
33796
|
import { IconPlus as IconPlus11, IconTrash as IconTrash12, IconShieldCheck as IconShieldCheck16, IconUser as IconUser14, IconRobot as IconRobot4, IconBuilding as IconBuilding2 } from "@tabler/icons-react";
|
|
33728
33797
|
var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission, onRevokePermission, getUserDisplayName }) => {
|
|
33729
33798
|
const [delegations, setDelegations] = useState141([]);
|
|
33730
33799
|
const [loading, setLoading] = useState141(true);
|
|
33731
33800
|
const [revoking, setRevoking] = useState141(null);
|
|
33732
|
-
const rootDelegation =
|
|
33801
|
+
const rootDelegation = useMemo123(() => {
|
|
33733
33802
|
if (editor.getUcanService) {
|
|
33734
33803
|
return editor.getUcanService()?.getRootDelegation() || null;
|
|
33735
33804
|
}
|
|
@@ -34083,4 +34152,4 @@ export {
|
|
|
34083
34152
|
getExtraSlashMenuItems,
|
|
34084
34153
|
useCreateIxoEditor
|
|
34085
34154
|
};
|
|
34086
|
-
//# sourceMappingURL=chunk-
|
|
34155
|
+
//# sourceMappingURL=chunk-ZCRLP7QH.mjs.map
|