@ixo/editor 1.11.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,29 +24,34 @@ var BlocknoteProvider = ({ children, editor, handlers, blockRequirements, editab
24
24
  const sharedProposalsRef = useRef({});
25
25
  const [activeDrawerId, setActiveDrawerId] = useState(null);
26
26
  const [drawerContent, setDrawerContent] = useState(null);
27
- const [docType, setDocType] = useState(editor?.getDocType?.() || "flow");
27
+ const initialDocType = editor?.getDocType?.() || "flow";
28
+ console.log("[BlocknoteContext] Initial docType from editor:", initialDocType);
29
+ const [docType, setDocType] = useState(initialDocType);
30
+ useEffect(() => {
31
+ console.log("[BlocknoteContext] docType state updated to:", docType);
32
+ }, [docType]);
28
33
  useEffect(() => {
29
34
  if (!editor?._yRoot) {
30
- console.log("[BlocknoteContext] No editor._yRoot, skipping docType observer");
35
+ console.log("[BlocknoteContext] No editor._yRoot, skipping observer setup");
31
36
  return;
32
37
  }
33
38
  const updateDocType = () => {
34
39
  const newDocType = editor.getDocType?.() || "flow";
35
- console.log("[BlocknoteContext] Updating docType to:", newDocType);
36
- setDocType((current) => {
37
- console.log("[BlocknoteContext] DocType change:", { from: current, to: newDocType });
38
- return newDocType;
39
- });
40
+ console.log("[BlocknoteContext] updateDocType() called, newDocType:", newDocType, "current docType:", docType);
41
+ if (newDocType !== docType) {
42
+ console.log("[BlocknoteContext] docType changed from", docType, "to", newDocType);
43
+ setDocType(newDocType);
44
+ }
40
45
  };
41
- console.log("[BlocknoteContext] Setting up docType observer");
46
+ console.log("[BlocknoteContext] Setting up observer, calling updateDocType() initially");
42
47
  updateDocType();
43
48
  const observer = () => {
44
- console.log("[BlocknoteContext] YMap observer fired!");
49
+ console.log("[BlocknoteContext] YMap observer triggered, calling updateDocType()");
45
50
  updateDocType();
46
51
  };
47
52
  editor._yRoot?.observe(observer);
48
53
  return () => {
49
- console.log("[BlocknoteContext] Cleaning up docType observer");
54
+ console.log("[BlocknoteContext] Unobserving YMap");
50
55
  editor._yRoot?.unobserve(observer);
51
56
  };
52
57
  }, [editor]);
@@ -466,12 +471,6 @@ function PropertyValueInput({ property, value, onChange, disabled = false }) {
466
471
 
467
472
  // src/mantine/blocks/components/ConditionBuilder/ConditionRow.tsx
468
473
  function ConditionRow({ condition, availableBlocks, onUpdate, onDelete }) {
469
- console.log("[ConditionRow] Props:", {
470
- conditionId: condition.id,
471
- sourceBlockId: condition.sourceBlockId,
472
- sourceBlockType: condition.sourceBlockType,
473
- availableBlocks: availableBlocks.length
474
- });
475
474
  const availableProperties = useMemo(() => {
476
475
  if (!condition.sourceBlockType) return [];
477
476
  return getConditionableProperties(condition.sourceBlockType);
@@ -507,11 +506,6 @@ function ConditionRow({ condition, availableBlocks, onUpdate, onDelete }) {
507
506
  );
508
507
  const handleSourceBlockChange = useCallback3(
509
508
  (value) => {
510
- console.log("[ConditionRow] Block selection changed:", {
511
- oldValue: `${condition.sourceBlockType}:${condition.sourceBlockId}`,
512
- newValue: value,
513
- conditionId: condition.id
514
- });
515
509
  if (!value) {
516
510
  const updatedCondition2 = {
517
511
  ...condition,
@@ -519,7 +513,6 @@ function ConditionRow({ condition, availableBlocks, onUpdate, onDelete }) {
519
513
  sourceBlockType: "",
520
514
  rule: { ...condition.rule, property: "", value: "" }
521
515
  };
522
- console.log("[ConditionRow] Calling onUpdate with cleared condition:", updatedCondition2);
523
516
  onUpdate(updatedCondition2);
524
517
  return;
525
518
  }
@@ -530,7 +523,6 @@ function ConditionRow({ condition, availableBlocks, onUpdate, onDelete }) {
530
523
  sourceBlockType: blockType,
531
524
  rule: { ...condition.rule, property: "", value: "" }
532
525
  };
533
- console.log("[ConditionRow] Calling onUpdate with new block selection:", updatedCondition);
534
526
  onUpdate(updatedCondition);
535
527
  },
536
528
  [condition, onUpdate]
@@ -646,21 +638,11 @@ function ConditionRow({ condition, availableBlocks, onUpdate, onDelete }) {
646
638
 
647
639
  // src/mantine/components/ConditionsTab.tsx
648
640
  function ConditionsTab({ block, editor }) {
649
- console.log("[ConditionsTab] Raw block.props.conditions:", block.props.conditions);
650
641
  const currentConditions = parseConditionConfig(block.props.conditions);
651
642
  const availableBlocks = getAvailableBlocks(editor?.document || [], block.id);
652
- console.log("[ConditionsTab] Debug info:", {
653
- blockId: block?.id,
654
- blockType: block?.type,
655
- editorDocument: editor?.document,
656
- availableBlocks,
657
- currentConditions
658
- });
659
643
  const updateConditions = useCallback5(
660
644
  (newConfig) => {
661
- console.log("[ConditionsTab] updateConditions called with:", newConfig);
662
645
  const conditionsString = stringifyConditionConfig(newConfig);
663
- console.log("[ConditionsTab] Stringified conditions:", conditionsString);
664
646
  editor.updateBlock(block, {
665
647
  props: {
666
648
  ...block.props,
@@ -680,33 +662,23 @@ function ConditionsTab({ block, editor }) {
680
662
  [currentConditions, updateConditions]
681
663
  );
682
664
  const handleAddCondition = useCallback5(() => {
683
- console.log("[ConditionsTab] handleAddCondition called");
684
- console.log("[ConditionsTab] Current conditions before adding:", currentConditions);
685
665
  const newCondition = createDefaultCondition();
686
- console.log("[ConditionsTab] Created new condition:", newCondition);
687
666
  const newConfig = {
688
667
  ...currentConditions,
689
668
  enabled: true,
690
669
  // Auto-enable when adding first condition
691
670
  conditions: [...currentConditions.conditions, newCondition]
692
671
  };
693
- console.log("[ConditionsTab] New config to be saved:", newConfig);
694
672
  updateConditions(newConfig);
695
673
  }, [currentConditions, updateConditions]);
696
674
  const handleUpdateCondition = useCallback5(
697
675
  (index, updatedCondition) => {
698
- console.log("[ConditionsTab] Updating condition at index:", {
699
- index,
700
- updatedCondition,
701
- currentConditions: currentConditions.conditions.length
702
- });
703
676
  const newConditions = [...currentConditions.conditions];
704
677
  newConditions[index] = updatedCondition;
705
678
  const newConfig = {
706
679
  ...currentConditions,
707
680
  conditions: newConditions
708
681
  };
709
- console.log("[ConditionsTab] New config being sent:", newConfig);
710
682
  updateConditions(newConfig);
711
683
  },
712
684
  [currentConditions, updateConditions]
@@ -740,14 +712,7 @@ function ConditionsTab({ block, editor }) {
740
712
  onChange: handleModeChange,
741
713
  fullWidth: true
742
714
  }
743
- )), /* @__PURE__ */ React5.createElement(Stack4, { gap: "sm" }, (() => {
744
- console.log("[ConditionsTab] Rendering conditions:", {
745
- conditionsCount: currentConditions.conditions.length,
746
- conditions: currentConditions.conditions
747
- });
748
- return null;
749
- })(), currentConditions.conditions.map((condition, index) => {
750
- console.log("[ConditionsTab] Rendering condition at index:", index, condition);
715
+ )), /* @__PURE__ */ React5.createElement(Stack4, { gap: "sm" }, currentConditions.conditions.map((condition, index) => {
751
716
  return /* @__PURE__ */ React5.createElement(
752
717
  ConditionRow,
753
718
  {
@@ -1258,7 +1223,6 @@ function useBlockConditions(block, editor, currentUser) {
1258
1223
  function CheckboxBlock({ editor, block }) {
1259
1224
  const { docType } = useBlocknoteContext();
1260
1225
  const { actions } = useBlockConditions(block, editor);
1261
- console.log("Rendering CheckboxBlock with actions:", actions);
1262
1226
  if (docType === "template") {
1263
1227
  return /* @__PURE__ */ React12.createElement(CheckboxTemplateView, { editor, block });
1264
1228
  }
@@ -1267,19 +1231,11 @@ function CheckboxBlock({ editor, block }) {
1267
1231
  const showActionExists = actions.some((a) => a.action === "show");
1268
1232
  const shouldHide = hasVisibility && !showActionExists;
1269
1233
  if (shouldHide) {
1270
- console.log("[CheckboxBlock] Hiding block - visibility conditions exist but none passed");
1271
1234
  return null;
1272
1235
  }
1273
1236
  const hasEnable = hasEnableConditions(conditionConfig);
1274
1237
  const enableActionExists = actions.some((a) => a.action === "enable");
1275
1238
  const shouldDisable = hasEnable && !enableActionExists;
1276
- console.log("[CheckboxBlock] Enable state:", {
1277
- blockId: block.id,
1278
- hasEnable,
1279
- enableActionExists,
1280
- shouldDisable,
1281
- actions
1282
- });
1283
1239
  return /* @__PURE__ */ React12.createElement(
1284
1240
  CheckboxFlowView,
1285
1241
  {
@@ -2440,7 +2396,6 @@ var ListActionsMenu = ({ options, selectionMode, onSelectActionClick, value, onC
2440
2396
  key: `${opt.key}-${direction}`,
2441
2397
  leftSection: /* @__PURE__ */ React31.createElement(Icon, { size: 16 }),
2442
2398
  onClick: () => {
2443
- console.log("Changing sort: ", direction);
2444
2399
  onChange({ key: opt.key, direction });
2445
2400
  },
2446
2401
  "data-active": isActive
@@ -2972,7 +2927,6 @@ var ListFlowView = ({ block, editor }) => {
2972
2927
  }, [handlers, page, listType, listConfig]);
2973
2928
  useEffect6(() => {
2974
2929
  if (listType && listConfig) {
2975
- console.log("[ListFlowView] useEffect", listType, listConfig);
2976
2930
  fetchData();
2977
2931
  }
2978
2932
  }, [listType, page, listConfig]);
@@ -2999,7 +2953,6 @@ var ListFlowView = ({ block, editor }) => {
2999
2953
  }, [data?.items, sortedData, listFilterConfig]);
3000
2954
  const renderListComponent = () => {
3001
2955
  if (!filteredData || !listType) return null;
3002
- console.log("[ListFlowView] renderListComponent", data, listType);
3003
2956
  switch (listType) {
3004
2957
  case "linked_resources":
3005
2958
  return /* @__PURE__ */ React37.createElement(LinkedResourcesList, { items: filteredData, config: listConfig, mods: selectionMode, isItemChecked, onItemCheck });
@@ -3239,16 +3192,37 @@ import { Paper as Paper6, CloseButton as CloseButton4, Title as Title4 } from "@
3239
3192
 
3240
3193
  // src/mantine/blocks/proposal/template/GeneralTab.tsx
3241
3194
  import React41, { useEffect as useEffect8, useState as useState8 } from "react";
3242
- import { Stack as Stack25, Text as Text25, TextInput as TextInput5, Textarea as Textarea2 } from "@mantine/core";
3243
- var GeneralTab3 = ({ title, description, onTitleChange, onDescriptionChange }) => {
3195
+ import { Stack as Stack25, Text as Text25, TextInput as TextInput5, Textarea as Textarea2, Select as Select3, Loader as Loader3 } from "@mantine/core";
3196
+ var GeneralTab3 = ({ title, description, coreAddress, onTitleChange, onDescriptionChange, onGroupChange }) => {
3197
+ const handlers = useBlocknoteHandlers();
3244
3198
  const [localTitle, setLocalTitle] = useState8(title || "");
3245
3199
  const [localDescription, setLocalDescription] = useState8(description || "");
3200
+ const [groups, setGroups] = useState8([]);
3201
+ const [loadingGroups, setLoadingGroups] = useState8(false);
3246
3202
  useEffect8(() => {
3247
3203
  setLocalTitle(title || "");
3248
3204
  }, [title]);
3249
3205
  useEffect8(() => {
3250
3206
  setLocalDescription(description || "");
3251
3207
  }, [description]);
3208
+ useEffect8(() => {
3209
+ const fetchGroups = async () => {
3210
+ if (!handlers?.getDAOGroups) {
3211
+ console.warn("getDAOGroups handler not available");
3212
+ return;
3213
+ }
3214
+ setLoadingGroups(true);
3215
+ try {
3216
+ const daoGroups = await handlers.getDAOGroups();
3217
+ setGroups(daoGroups);
3218
+ } catch (error) {
3219
+ console.error("Failed to fetch DAO groups:", error);
3220
+ } finally {
3221
+ setLoadingGroups(false);
3222
+ }
3223
+ };
3224
+ fetchGroups();
3225
+ }, [handlers]);
3252
3226
  return /* @__PURE__ */ React41.createElement(Stack25, { gap: "lg" }, /* @__PURE__ */ React41.createElement(Stack25, { gap: "xs" }, /* @__PURE__ */ React41.createElement(Text25, { size: "sm", fw: 600 }, "Title"), /* @__PURE__ */ React41.createElement(
3253
3227
  TextInput5,
3254
3228
  {
@@ -3272,6 +3246,27 @@ var GeneralTab3 = ({ title, description, onTitleChange, onDescriptionChange }) =
3272
3246
  onDescriptionChange(newDescription);
3273
3247
  }
3274
3248
  }
3249
+ )), /* @__PURE__ */ React41.createElement(Stack25, { gap: "xs" }, /* @__PURE__ */ React41.createElement(Text25, { size: "sm", fw: 600 }, "Group"), /* @__PURE__ */ React41.createElement(
3250
+ Select3,
3251
+ {
3252
+ placeholder: loadingGroups ? "Loading groups..." : "Select a DAO group",
3253
+ value: groups.find((g) => g.coreAddress === coreAddress)?.id || null,
3254
+ onChange: (value) => {
3255
+ if (value) {
3256
+ const selectedGroup = groups.find((g) => g.id === value);
3257
+ if (selectedGroup) {
3258
+ onGroupChange(selectedGroup.coreAddress);
3259
+ }
3260
+ }
3261
+ },
3262
+ data: groups.map((group) => ({
3263
+ value: group.id,
3264
+ label: group.name
3265
+ })),
3266
+ disabled: loadingGroups,
3267
+ rightSection: loadingGroups ? /* @__PURE__ */ React41.createElement(Loader3, { size: "xs" }) : void 0,
3268
+ searchable: true
3269
+ }
3275
3270
  )));
3276
3271
  };
3277
3272
 
@@ -3574,7 +3569,7 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
3574
3569
 
3575
3570
  // src/mantine/blocks/proposal/actions-components/StakeActionForm.tsx
3576
3571
  import React45 from "react";
3577
- import { Stack as Stack29, TextInput as TextInput8, Select as Select3, NumberInput as NumberInput3 } from "@mantine/core";
3572
+ import { Stack as Stack29, TextInput as TextInput8, Select as Select4, NumberInput as NumberInput3 } from "@mantine/core";
3578
3573
  var stakeTypeOptions = [
3579
3574
  { value: StakeType.Delegate, label: "Delegate" },
3580
3575
  { value: StakeType.Undelegate, label: "Undelegate" },
@@ -3620,7 +3615,7 @@ var StakeActionForm = ({ data, onChange }) => {
3620
3615
  const isRedelegate = data.stakeType === StakeType.Redelegate;
3621
3616
  const needsAmount = data.stakeType !== StakeType.WithdrawDelegatorReward;
3622
3617
  return /* @__PURE__ */ React45.createElement(Stack29, { gap: "md" }, /* @__PURE__ */ React45.createElement(
3623
- Select3,
3618
+ Select4,
3624
3619
  {
3625
3620
  label: "Stake Type",
3626
3621
  value: data.stakeType,
@@ -3662,7 +3657,7 @@ var StakeActionForm = ({ data, onChange }) => {
3662
3657
  styles: inputStyles
3663
3658
  }
3664
3659
  ), /* @__PURE__ */ React45.createElement(
3665
- Select3,
3660
+ Select4,
3666
3661
  {
3667
3662
  label: "Denomination",
3668
3663
  value: data.denom,
@@ -3892,7 +3887,7 @@ Example Stargate message:
3892
3887
 
3893
3888
  // src/mantine/blocks/proposal/actions-components/forms/AuthzExecActionForm.tsx
3894
3889
  import React50 from "react";
3895
- import { Stack as Stack34, Select as Select4, TextInput as TextInput12, Textarea as Textarea5 } from "@mantine/core";
3890
+ import { Stack as Stack34, Select as Select5, TextInput as TextInput12, Textarea as Textarea5 } from "@mantine/core";
3896
3891
  var inputStyles6 = {
3897
3892
  label: { color: "#adb5bd" },
3898
3893
  input: {
@@ -3928,7 +3923,7 @@ var AuthzExecActionForm = ({ data, onChange }) => {
3928
3923
  }
3929
3924
  };
3930
3925
  return /* @__PURE__ */ React50.createElement(Stack34, { gap: "md" }, /* @__PURE__ */ React50.createElement(
3931
- Select4,
3926
+ Select5,
3932
3927
  {
3933
3928
  label: "Action Type",
3934
3929
  placeholder: "Select action type",
@@ -4750,7 +4745,7 @@ var CreateEntityActionForm = ({ data, onChange }) => {
4750
4745
 
4751
4746
  // src/mantine/blocks/proposal/actions-components/forms/UpdateVotingConfigActionForm.tsx
4752
4747
  import React65 from "react";
4753
- import { Stack as Stack49, Checkbox as Checkbox6, Select as Select5, NumberInput as NumberInput7, Group as Group18 } from "@mantine/core";
4748
+ import { Stack as Stack49, Checkbox as Checkbox6, Select as Select6, NumberInput as NumberInput7, Group as Group18 } from "@mantine/core";
4754
4749
  var inputStyles21 = {
4755
4750
  label: { color: "#adb5bd" },
4756
4751
  input: {
@@ -4775,7 +4770,7 @@ var UpdateVotingConfigActionForm = ({ data, onChange }) => {
4775
4770
  }
4776
4771
  }
4777
4772
  ), /* @__PURE__ */ React65.createElement(
4778
- Select5,
4773
+ Select6,
4779
4774
  {
4780
4775
  label: "Threshold Type",
4781
4776
  value: data.thresholdType,
@@ -4810,7 +4805,7 @@ var UpdateVotingConfigActionForm = ({ data, onChange }) => {
4810
4805
  }
4811
4806
  }
4812
4807
  ), data.quorumEnabled && /* @__PURE__ */ React65.createElement(React65.Fragment, null, /* @__PURE__ */ React65.createElement(
4813
- Select5,
4808
+ Select6,
4814
4809
  {
4815
4810
  label: "Quorum Type",
4816
4811
  value: data.quorumType,
@@ -4844,7 +4839,7 @@ var UpdateVotingConfigActionForm = ({ data, onChange }) => {
4844
4839
  styles: inputStyles21
4845
4840
  }
4846
4841
  ), /* @__PURE__ */ React65.createElement(
4847
- Select5,
4842
+ Select6,
4848
4843
  {
4849
4844
  label: "Duration Units",
4850
4845
  value: data.proposalDurationUnits,
@@ -4873,7 +4868,7 @@ var UpdateVotingConfigActionForm = ({ data, onChange }) => {
4873
4868
 
4874
4869
  // src/mantine/blocks/proposal/actions-components/forms/UpdatePreProposeConfigActionForm.tsx
4875
4870
  import React66 from "react";
4876
- import { Stack as Stack50, Checkbox as Checkbox7, TextInput as TextInput26, Select as Select6, Textarea as Textarea14 } from "@mantine/core";
4871
+ import { Stack as Stack50, Checkbox as Checkbox7, TextInput as TextInput26, Select as Select7, Textarea as Textarea14 } from "@mantine/core";
4877
4872
  var inputStyles22 = {
4878
4873
  label: { color: "#adb5bd" },
4879
4874
  input: {
@@ -4922,7 +4917,7 @@ var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
4922
4917
  styles: inputStyles22
4923
4918
  }
4924
4919
  ), /* @__PURE__ */ React66.createElement(
4925
- Select6,
4920
+ Select7,
4926
4921
  {
4927
4922
  label: "Deposit Type",
4928
4923
  value: data.depositInfo.type,
@@ -4987,7 +4982,7 @@ var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
4987
4982
 
4988
4983
  // src/mantine/blocks/proposal/actions-components/forms/GovernanceVoteActionForm.tsx
4989
4984
  import React67 from "react";
4990
- import { Stack as Stack51, TextInput as TextInput27, Select as Select7 } from "@mantine/core";
4985
+ import { Stack as Stack51, TextInput as TextInput27, Select as Select8 } from "@mantine/core";
4991
4986
  var inputStyles23 = {
4992
4987
  label: { color: "#adb5bd" },
4993
4988
  input: {
@@ -5017,7 +5012,7 @@ var GovernanceVoteActionForm = ({ data, onChange }) => {
5017
5012
  styles: inputStyles23
5018
5013
  }
5019
5014
  ), /* @__PURE__ */ React67.createElement(
5020
- Select7,
5015
+ Select8,
5021
5016
  {
5022
5017
  label: "Vote Option",
5023
5018
  value: data.vote?.toString() || "1",
@@ -5217,7 +5212,7 @@ var SendGroupTokenActionForm = ({ data, onChange }) => {
5217
5212
 
5218
5213
  // src/mantine/blocks/proposal/actions-components/forms/ValidatorActionsActionForm.tsx
5219
5214
  import React72 from "react";
5220
- import { Stack as Stack56, Select as Select8, Textarea as Textarea16 } from "@mantine/core";
5215
+ import { Stack as Stack56, Select as Select9, Textarea as Textarea16 } from "@mantine/core";
5221
5216
  var inputStyles28 = {
5222
5217
  label: { color: "#adb5bd" },
5223
5218
  input: {
@@ -5237,7 +5232,7 @@ var ValidatorActionsActionForm = ({ data, onChange }) => {
5237
5232
  { value: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission" /* WithdrawValidatorCommission */, label: "Withdraw Commission" }
5238
5233
  ];
5239
5234
  return /* @__PURE__ */ React72.createElement(Stack56, { gap: "md" }, /* @__PURE__ */ React72.createElement(
5240
- Select8,
5235
+ Select9,
5241
5236
  {
5242
5237
  label: "Validator Action Type",
5243
5238
  value: data.validatorActionType,
@@ -6227,8 +6222,10 @@ var TemplateConfig3 = ({ editor, block }) => {
6227
6222
  {
6228
6223
  title: block.props.title || "",
6229
6224
  description: block.props.description || "",
6225
+ coreAddress: block.props.coreAddress || "",
6230
6226
  onTitleChange: (value) => updateProp("title", value),
6231
- onDescriptionChange: (value) => updateProp("description", value)
6227
+ onDescriptionChange: (value) => updateProp("description", value),
6228
+ onGroupChange: (coreAddress) => updateProp("coreAddress", coreAddress)
6232
6229
  }
6233
6230
  )
6234
6231
  },
@@ -6364,8 +6361,6 @@ var parseStatus = (value) => {
6364
6361
  return isChainStatus(value) ? value : null;
6365
6362
  };
6366
6363
  var useFlowBusinessLogic = ({ block, editor }) => {
6367
- const { blockRequirements } = useBlocknoteContext();
6368
- const coreAddress = blockRequirements?.proposal?.coreAddress;
6369
6364
  const [proposalContractAddress, setProposalContractAddress] = useState17(null);
6370
6365
  const [isExecuting, setIsExecuting] = useState17(false);
6371
6366
  const [executionError, setExecutionError] = useState17(null);
@@ -6381,6 +6376,7 @@ var useFlowBusinessLogic = ({ block, editor }) => {
6381
6376
  const icon = props.icon || "\u{1F4DD}";
6382
6377
  const proposalId = props.proposalId || "";
6383
6378
  const status = parseStatus(props.status);
6379
+ const coreAddress = props.coreAddress || "";
6384
6380
  const shouldFetch = !!proposalId && !!status && !!proposalContractAddress;
6385
6381
  const {
6386
6382
  proposal,
@@ -6461,24 +6457,14 @@ var useFlowBusinessLogic = ({ block, editor }) => {
6461
6457
  let actions = [];
6462
6458
  try {
6463
6459
  const actionsJson = block.props.actions;
6464
- console.log("[createProposal] Raw actions from block.props:", actionsJson);
6465
6460
  if (actionsJson) {
6466
6461
  actions = JSON.parse(actionsJson);
6467
- console.log("[createProposal] Parsed actions:", actions);
6468
6462
  }
6469
6463
  } catch (error) {
6470
- console.error("[createProposal] Failed to parse actions:", error);
6471
6464
  }
6472
6465
  const { preProposalContractAddress } = await handlers.getPreProposalContractAddress({
6473
6466
  coreAddress: coreAddress2
6474
6467
  });
6475
- console.log("[createProposal] Creating proposal with params:", {
6476
- title: localTitle,
6477
- description: localDescription,
6478
- actionsCount: actions.length,
6479
- actions,
6480
- coreAddress: coreAddress2
6481
- });
6482
6468
  const { groupContractAddress } = await handlers.getGroupContractAddress({
6483
6469
  coreAddress: coreAddress2
6484
6470
  });
@@ -6517,8 +6503,6 @@ var useFlowBusinessLogic = ({ block, editor }) => {
6517
6503
  // src/mantine/blocks/proposal/flow/useVoteBusinessLogic.ts
6518
6504
  import { useState as useState18, useEffect as useEffect13 } from "react";
6519
6505
  var useVoteBusinessLogic = ({ block, editor }) => {
6520
- const { blockRequirements } = useBlocknoteContext();
6521
- const coreAddress = blockRequirements?.proposal?.coreAddress;
6522
6506
  const [localError, setLocalError] = useState18(null);
6523
6507
  const [userVote, setUserVote] = useState18(null);
6524
6508
  const [proposalContractAddress, setProposalContractAddress] = useState18(null);
@@ -6532,6 +6516,7 @@ var useVoteBusinessLogic = ({ block, editor }) => {
6532
6516
  const title = block.props.title || "";
6533
6517
  const description = block.props.description || "";
6534
6518
  const status = block.props.status || "draft";
6519
+ const coreAddress = block.props.coreAddress || "";
6535
6520
  useEffect13(() => {
6536
6521
  if (!handlers || !coreAddress || !proposalId) {
6537
6522
  setProposalContractAddress(null);
@@ -6946,8 +6931,7 @@ var ActionsTab2 = ({ actions, onActionsChange, editor, block, isProposalCreated
6946
6931
  // src/mantine/blocks/proposal/flow/FlowConfig.tsx
6947
6932
  var FlowConfig = ({ editor, block }) => {
6948
6933
  const { closePanel } = usePanelStore();
6949
- const { blockRequirements } = useBlocknoteContext();
6950
- const coreAddress = blockRequirements?.proposal?.coreAddress;
6934
+ const coreAddress = block.props.coreAddress || "";
6951
6935
  const [errors, setErrors] = useState21({});
6952
6936
  const [isCreating, setIsCreating] = useState21(false);
6953
6937
  const { createProposal, title, description, proposalId } = useFlowBusinessLogic({
@@ -7119,9 +7103,12 @@ var ProposalFlowView = ({ block, editor }) => {
7119
7103
  // src/mantine/blocks/proposal/ProposalBlock.tsx
7120
7104
  function ProposalBlock({ editor, block }) {
7121
7105
  const { docType } = useBlocknoteContext();
7106
+ console.log("[ProposalBlock] Rendering with docType:", docType);
7122
7107
  if (docType === "template") {
7108
+ console.log("[ProposalBlock] Rendering ProposalTemplateView (docType is template)");
7123
7109
  return /* @__PURE__ */ React83.createElement(ProposalTemplateView, { editor, block });
7124
7110
  }
7111
+ console.log("[ProposalBlock] Rendering ProposalFlowView (docType is flow)");
7125
7112
  return /* @__PURE__ */ React83.createElement(ProposalFlowView, { block, editor });
7126
7113
  }
7127
7114
 
@@ -7169,6 +7156,9 @@ var ProposalBlockSpec = createReactBlockSpec4(
7169
7156
  proposalContractAddress: {
7170
7157
  default: ""
7171
7158
  },
7159
+ coreAddress: {
7160
+ default: ""
7161
+ },
7172
7162
  conditions: {
7173
7163
  default: ""
7174
7164
  }
@@ -7199,7 +7189,7 @@ import { Paper as Paper9, CloseButton as CloseButton6, Title as Title6 } from "@
7199
7189
 
7200
7190
  // src/mantine/blocks/apiRequest/template/GeneralTab.tsx
7201
7191
  import React85, { useEffect as useEffect15, useState as useState22 } from "react";
7202
- import { Divider as Divider5, Select as Select9, Stack as Stack65, Text as Text40, TextInput as TextInput34, Textarea as Textarea19, Button as Button17, Group as Group23, ActionIcon as ActionIcon9, Paper as Paper8 } from "@mantine/core";
7192
+ import { Divider as Divider5, Select as Select10, Stack as Stack65, Text as Text40, TextInput as TextInput34, Textarea as Textarea19, Button as Button17, Group as Group23, ActionIcon as ActionIcon9, Paper as Paper8 } from "@mantine/core";
7203
7193
  import { IconTrash, IconPlus } from "@tabler/icons-react";
7204
7194
  var GeneralTab4 = ({
7205
7195
  title,
@@ -7283,7 +7273,7 @@ var GeneralTab4 = ({
7283
7273
  }
7284
7274
  }
7285
7275
  )), /* @__PURE__ */ React85.createElement(Divider5, { variant: "dashed" }), /* @__PURE__ */ React85.createElement(Stack65, { gap: "xs" }, /* @__PURE__ */ React85.createElement(Text40, { size: "sm", fw: 600 }, "HTTP Method"), /* @__PURE__ */ React85.createElement(
7286
- Select9,
7276
+ Select10,
7287
7277
  {
7288
7278
  value: localMethod,
7289
7279
  onChange: (value) => {
@@ -7469,7 +7459,7 @@ var ApiRequestTemplateView = ({ editor, block }) => {
7469
7459
 
7470
7460
  // src/mantine/blocks/apiRequest/flow/FlowView.tsx
7471
7461
  import React88, { useState as useState23 } from "react";
7472
- import { Card as Card20, Group as Group25, Stack as Stack67, Text as Text42, ActionIcon as ActionIcon11, Tooltip as Tooltip4, Button as Button18, Badge as Badge11, Collapse, Code, Loader as Loader3, Alert as Alert9 } from "@mantine/core";
7462
+ import { Card as Card20, Group as Group25, Stack as Stack67, Text as Text42, ActionIcon as ActionIcon11, Tooltip as Tooltip4, Button as Button18, Badge as Badge11, Collapse, Code, Loader as Loader4, Alert as Alert9 } from "@mantine/core";
7473
7463
  import { IconSend, IconChevronDown, IconChevronUp } from "@tabler/icons-react";
7474
7464
  var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
7475
7465
  const disabled = isDisabled?.isDisabled === "disable";
@@ -7593,7 +7583,7 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
7593
7583
  size: "sm",
7594
7584
  variant: "light",
7595
7585
  color: getMethodColor(method),
7596
- leftSection: isLoading ? /* @__PURE__ */ React88.createElement(Loader3, { size: 14 }) : /* @__PURE__ */ React88.createElement(IconSend, { size: 14 }),
7586
+ leftSection: isLoading ? /* @__PURE__ */ React88.createElement(Loader4, { size: 14 }) : /* @__PURE__ */ React88.createElement(IconSend, { size: 14 }),
7597
7587
  onClick: handleExecuteRequest,
7598
7588
  disabled: disabled || isLoading || !endpoint,
7599
7589
  style: { flexShrink: 0 }
@@ -7640,13 +7630,7 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
7640
7630
  function ApiRequestBlock({ editor, block }) {
7641
7631
  const { docType } = useBlocknoteContext();
7642
7632
  const { actions } = useBlockConditions(block, editor);
7643
- console.log("[ApiRequestBlock] Rendering with:", {
7644
- blockId: block.id,
7645
- docType,
7646
- actions
7647
- });
7648
7633
  if (docType === "template") {
7649
- console.log("[ApiRequestBlock] Rendering template view for block:", block.id);
7650
7634
  return /* @__PURE__ */ React89.createElement(ApiRequestTemplateView, { editor, block });
7651
7635
  }
7652
7636
  const conditionConfig = parseConditionConfig(block.props.conditions);
@@ -7654,19 +7638,11 @@ function ApiRequestBlock({ editor, block }) {
7654
7638
  const showActionExists = actions.some((a) => a.action === "show");
7655
7639
  const shouldHide = hasVisibility && !showActionExists;
7656
7640
  if (shouldHide) {
7657
- console.log("[ApiRequestBlock] Hiding block - visibility conditions exist but none passed");
7658
7641
  return null;
7659
7642
  }
7660
7643
  const hasEnable = hasEnableConditions(conditionConfig);
7661
7644
  const enableActionExists = actions.some((a) => a.action === "enable");
7662
7645
  const shouldDisable = hasEnable && !enableActionExists;
7663
- console.log("[ApiRequestBlock] Enable state:", {
7664
- blockId: block.id,
7665
- hasEnable,
7666
- enableActionExists,
7667
- shouldDisable,
7668
- actions
7669
- });
7670
7646
  return /* @__PURE__ */ React89.createElement(
7671
7647
  ApiRequestFlowView,
7672
7648
  {
@@ -7953,7 +7929,7 @@ var EnumChecklistPreviewStep = ({ listType, onAddToBlock, onPrev }) => {
7953
7929
 
7954
7930
  // src/mantine/blocks/enumChecklist/EnumChecklistConfigurationStep.tsx
7955
7931
  import React95 from "react";
7956
- import { Stack as Stack72, TextInput as TextInput35, Text as Text47, Button as Button22, Group as Group28, Switch as Switch4, Select as Select10 } from "@mantine/core";
7932
+ import { Stack as Stack72, TextInput as TextInput35, Text as Text47, Button as Button22, Group as Group28, Switch as Switch4, Select as Select11 } from "@mantine/core";
7957
7933
  var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onConfigChange, onPrev, onNext, isValid }) => {
7958
7934
  const typeConfig = ENUM_LIST_CONFIG[listType];
7959
7935
  const configFields = getEnumListTypesConfigFields(listType);
@@ -7983,7 +7959,7 @@ var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onC
7983
7959
  );
7984
7960
  case "select":
7985
7961
  return /* @__PURE__ */ React95.createElement(
7986
- Select10,
7962
+ Select11,
7987
7963
  {
7988
7964
  label: field.label,
7989
7965
  description: field.description,
@@ -8244,7 +8220,7 @@ import { Paper as Paper11, CloseButton as CloseButton7, Title as Title7 } from "
8244
8220
 
8245
8221
  // src/mantine/blocks/notify/template/GeneralTab.tsx
8246
8222
  import React98, { useEffect as useEffect17, useState as useState26 } from "react";
8247
- import { Divider as Divider6, Select as Select11, Stack as Stack74, Text as Text49, TextInput as TextInput36, Textarea as Textarea20, Button as Button24, Group as Group30, ActionIcon as ActionIcon13, Paper as Paper10 } from "@mantine/core";
8223
+ import { Divider as Divider6, Select as Select12, Stack as Stack74, Text as Text49, TextInput as TextInput36, Textarea as Textarea20, Button as Button24, Group as Group30, ActionIcon as ActionIcon13, Paper as Paper10 } from "@mantine/core";
8248
8224
  import { IconTrash as IconTrash2, IconPlus as IconPlus2 } from "@tabler/icons-react";
8249
8225
  var GeneralTab5 = ({
8250
8226
  title,
@@ -8341,7 +8317,7 @@ var GeneralTab5 = ({
8341
8317
  }
8342
8318
  }
8343
8319
  )), /* @__PURE__ */ React98.createElement(Divider6, { variant: "dashed" }), /* @__PURE__ */ React98.createElement(Stack74, { gap: "xs" }, /* @__PURE__ */ React98.createElement(Text49, { size: "sm", fw: 600 }, "Channel"), /* @__PURE__ */ React98.createElement(
8344
- Select11,
8320
+ Select12,
8345
8321
  {
8346
8322
  value: localChannel,
8347
8323
  onChange: (value) => {
@@ -8406,7 +8382,7 @@ var GeneralTab5 = ({
8406
8382
  }
8407
8383
  }
8408
8384
  )), /* @__PURE__ */ React98.createElement(Stack74, { gap: "xs" }, /* @__PURE__ */ React98.createElement(Text49, { size: "sm", fw: 600 }, "Body Type"), /* @__PURE__ */ React98.createElement(
8409
- Select11,
8385
+ Select12,
8410
8386
  {
8411
8387
  value: localBodyType,
8412
8388
  onChange: (value) => {
@@ -8585,7 +8561,7 @@ var NotifyTemplateView = ({ editor, block }) => {
8585
8561
 
8586
8562
  // src/mantine/blocks/notify/flow/FlowView.tsx
8587
8563
  import React101, { useState as useState27 } from "react";
8588
- import { Card as Card23, Group as Group32, Stack as Stack76, Text as Text51, ActionIcon as ActionIcon15, Tooltip as Tooltip5, Button as Button25, Badge as Badge13, Collapse as Collapse2, Alert as Alert10, Loader as Loader4, Code as Code2 } from "@mantine/core";
8564
+ import { Card as Card23, Group as Group32, Stack as Stack76, Text as Text51, ActionIcon as ActionIcon15, Tooltip as Tooltip5, Button as Button25, Badge as Badge13, Collapse as Collapse2, Alert as Alert10, Loader as Loader5, Code as Code2 } from "@mantine/core";
8589
8565
  import { IconSend as IconSend2, IconChevronDown as IconChevronDown2, IconChevronUp as IconChevronUp2, IconCheck, IconX } from "@tabler/icons-react";
8590
8566
  var NotifyFlowView = ({ editor, block, isDisabled }) => {
8591
8567
  const disabled = isDisabled?.isDisabled === "disable";
@@ -8697,7 +8673,7 @@ var NotifyFlowView = ({ editor, block, isDisabled }) => {
8697
8673
  size: "sm",
8698
8674
  variant: "light",
8699
8675
  color: getChannelColor(channel),
8700
- leftSection: isLoading ? /* @__PURE__ */ React101.createElement(Loader4, { size: 14 }) : status === "sent" ? /* @__PURE__ */ React101.createElement(IconCheck, { size: 14 }) : /* @__PURE__ */ React101.createElement(IconSend2, { size: 14 }),
8676
+ leftSection: isLoading ? /* @__PURE__ */ React101.createElement(Loader5, { size: 14 }) : status === "sent" ? /* @__PURE__ */ React101.createElement(IconCheck, { size: 14 }) : /* @__PURE__ */ React101.createElement(IconSend2, { size: 14 }),
8701
8677
  onClick: handleSendNotification,
8702
8678
  disabled: !canSend,
8703
8679
  style: { flexShrink: 0 }
@@ -9487,12 +9463,17 @@ function useCreateCollaborativeIxoEditor(options) {
9487
9463
  ixoEditor.getFlow = () => {
9488
9464
  return flowArray.toArray();
9489
9465
  };
9490
- ixoEditor.getDocType = () => root.get("docType") || "";
9466
+ ixoEditor.getDocType = () => {
9467
+ const docType = root.get("docType") || "";
9468
+ console.log("[useCollaborativeIxoEditor] getDocType() called, returning:", docType);
9469
+ return docType;
9470
+ };
9491
9471
  ixoEditor.setDocType = (value) => {
9492
9472
  if (!permissions.write) {
9493
9473
  console.warn("Cannot set doc type: write permission denied");
9494
9474
  return;
9495
9475
  }
9476
+ console.log("[useCollaborativeIxoEditor] setDocType() called, setting docType to:", value);
9496
9477
  root.set("docType", value);
9497
9478
  };
9498
9479
  }
@@ -9519,6 +9500,7 @@ function useCreateCollaborativeIxoEditor(options) {
9519
9500
  root.set("createdAt", (/* @__PURE__ */ new Date()).toISOString());
9520
9501
  root.set("createdBy", memoizedUser.id || "anonymous");
9521
9502
  root.set("docType", "");
9503
+ console.log("[useCollaborativeIxoEditor] Initializing docType to empty string for new document");
9522
9504
  if (titleText.length === 0 && options.title) {
9523
9505
  titleText.insert(0, options.title);
9524
9506
  }
@@ -9709,4 +9691,4 @@ export {
9709
9691
  ixoGraphQLClient,
9710
9692
  getEntity
9711
9693
  };
9712
- //# sourceMappingURL=chunk-7MKIYHNA.mjs.map
9694
+ //# sourceMappingURL=chunk-74X5B74P.mjs.map