@ixo/editor 1.5.1 → 1.6.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.
@@ -8420,169 +8420,177 @@ var blockSpecs = {
8420
8420
  proposal: ProposalBlockSpec,
8421
8421
  proposalActions: ProposalActionsBlockSpec
8422
8422
  };
8423
- var getExtraSlashMenuItems = (editor) => [
8424
- {
8425
- title: "Checkbox",
8426
- onItemClick: () => {
8427
- editor.insertBlocks(
8428
- [
8429
- {
8430
- type: "checkbox",
8431
- props: {
8432
- checked: false,
8433
- allowedCheckers: "all",
8434
- initialChecked: false,
8435
- title: "",
8436
- description: "",
8437
- visibility: "all",
8438
- dependencies: "",
8439
- conditions: ""
8423
+ var getExtraSlashMenuItems = (editor) => {
8424
+ const slashMenuList = [
8425
+ {
8426
+ title: "Checkbox",
8427
+ onItemClick: () => {
8428
+ editor.insertBlocks(
8429
+ [
8430
+ {
8431
+ type: "checkbox",
8432
+ props: {
8433
+ checked: false,
8434
+ allowedCheckers: "all",
8435
+ initialChecked: false,
8436
+ title: "",
8437
+ description: "",
8438
+ visibility: "all",
8439
+ dependencies: "",
8440
+ conditions: ""
8441
+ }
8440
8442
  }
8441
- }
8442
- ],
8443
- editor.getTextCursorPosition().block,
8444
- "after"
8445
- );
8443
+ ],
8444
+ editor.getTextCursorPosition().block,
8445
+ "after"
8446
+ );
8447
+ },
8448
+ aliases: ["checkbox", "task", "todo"],
8449
+ group: "Basics",
8450
+ subtext: "Add an interactive checkbox with flow permissions"
8446
8451
  },
8447
- aliases: ["checkbox", "task", "todo"],
8448
- group: "Basics",
8449
- subtext: "Add an interactive checkbox with flow permissions"
8450
- },
8451
- {
8452
- title: "List",
8453
- onItemClick: () => {
8454
- editor.insertBlocks(
8455
- [
8456
- {
8457
- type: "list",
8458
- props: {
8459
- title: "",
8460
- did: "",
8461
- fragmentIdentifier: ""
8452
+ {
8453
+ title: "List",
8454
+ onItemClick: () => {
8455
+ editor.insertBlocks(
8456
+ [
8457
+ {
8458
+ type: "list",
8459
+ props: {
8460
+ title: "",
8461
+ did: "",
8462
+ fragmentIdentifier: ""
8463
+ }
8462
8464
  }
8463
- }
8464
- ],
8465
- editor.getTextCursorPosition().block,
8466
- "after"
8467
- );
8465
+ ],
8466
+ editor.getTextCursorPosition().block,
8467
+ "after"
8468
+ );
8469
+ },
8470
+ aliases: ["list", "data", "dynamic"],
8471
+ group: "Domains",
8472
+ subtext: "Create a dynamic list from DID data"
8468
8473
  },
8469
- aliases: ["list", "data", "dynamic"],
8470
- group: "Domains",
8471
- subtext: "Create a dynamic list from DID data"
8472
- },
8473
- {
8474
- title: "Enum Checklist",
8475
- onItemClick: () => {
8476
- editor.insertBlocks(
8477
- [
8478
- {
8479
- type: EnumChecklistBlockType,
8480
- props: {
8481
- listType: "",
8482
- listConfig: "{}"
8474
+ {
8475
+ title: "Enum Checklist",
8476
+ onItemClick: () => {
8477
+ editor.insertBlocks(
8478
+ [
8479
+ {
8480
+ type: EnumChecklistBlockType,
8481
+ props: {
8482
+ listType: "",
8483
+ listConfig: "{}"
8484
+ }
8483
8485
  }
8484
- }
8485
- ],
8486
- editor.getTextCursorPosition().block,
8487
- "after"
8488
- );
8486
+ ],
8487
+ editor.getTextCursorPosition().block,
8488
+ "after"
8489
+ );
8490
+ },
8491
+ aliases: ["enum", "enum-checklist", "enum-list", "enum-checklist-block"],
8492
+ group: "Domains",
8493
+ subtext: "Create a predefined enum checklist"
8489
8494
  },
8490
- aliases: ["enum", "enum-checklist", "enum-list", "enum-checklist-block"],
8491
- group: "Domains",
8492
- subtext: "Create a predefined enum checklist"
8493
- },
8494
- {
8495
- title: "Overview",
8496
- onItemClick: () => {
8497
- editor.insertBlocks(
8498
- [
8499
- {
8500
- type: "overview",
8501
- props: {
8502
- did: ""
8495
+ {
8496
+ title: "Overview",
8497
+ onItemClick: () => {
8498
+ editor.insertBlocks(
8499
+ [
8500
+ {
8501
+ type: "overview",
8502
+ props: {
8503
+ did: ""
8504
+ }
8503
8505
  }
8504
- }
8505
- ],
8506
- editor.getTextCursorPosition().block,
8507
- "after"
8508
- );
8506
+ ],
8507
+ editor.getTextCursorPosition().block,
8508
+ "after"
8509
+ );
8510
+ },
8511
+ aliases: ["overview", "overview-block", "data-overview"],
8512
+ group: "Domains",
8513
+ subtext: "Create an overview from DID data"
8509
8514
  },
8510
- aliases: ["overview", "overview-block", "data-overview"],
8511
- group: "Domains",
8512
- subtext: "Create an overview from DID data"
8513
- },
8514
- {
8515
- title: "Proposal Vote",
8516
- onItemClick: () => {
8517
- editor.insertBlocks(
8518
- [
8519
- {
8520
- type: "proposalVote",
8521
- props: {
8522
- title: "",
8523
- subtitle: "",
8524
- icon: 'A\uFFFD\uFFFD,\uFFFD?"A3A_A,A?',
8525
- status: "open",
8526
- daysLeft: 0,
8527
- conditions: ""
8515
+ {
8516
+ title: "Proposal Vote",
8517
+ onItemClick: () => {
8518
+ editor.insertBlocks(
8519
+ [
8520
+ {
8521
+ type: "proposalVote",
8522
+ props: {
8523
+ title: "",
8524
+ subtitle: "",
8525
+ icon: 'A\uFFFD\uFFFD,\uFFFD?"A3A_A,A?',
8526
+ status: "open",
8527
+ daysLeft: 0,
8528
+ conditions: ""
8529
+ }
8528
8530
  }
8529
- }
8530
- ],
8531
- editor.getTextCursorPosition().block,
8532
- "after"
8533
- );
8531
+ ],
8532
+ editor.getTextCursorPosition().block,
8533
+ "after"
8534
+ );
8535
+ },
8536
+ aliases: ["vote", "proposal-vote", "governance-vote", "dao-vote"],
8537
+ group: "DAO",
8538
+ subtext: "Create a proposal voting block"
8534
8539
  },
8535
- aliases: ["vote", "proposal-vote", "governance-vote", "dao-vote"],
8536
- group: "DAO",
8537
- subtext: "Create a proposal voting block"
8538
- },
8539
- {
8540
- title: "Proposal",
8541
- onItemClick: () => {
8542
- editor.insertBlocks(
8543
- [
8544
- {
8545
- type: "proposal",
8546
- props: {
8547
- title: "",
8548
- description: "",
8549
- icon: "A\uFFFD\uFFFD,\uFFFD?oA?",
8550
- proposalId: "",
8551
- status: "draft"
8540
+ {
8541
+ title: "Proposal",
8542
+ onItemClick: () => {
8543
+ editor.insertBlocks(
8544
+ [
8545
+ {
8546
+ type: "proposal",
8547
+ props: {
8548
+ title: "",
8549
+ description: "",
8550
+ icon: "A\uFFFD\uFFFD,\uFFFD?oA?",
8551
+ proposalId: "",
8552
+ status: "draft"
8553
+ }
8552
8554
  }
8553
- }
8554
- ],
8555
- editor.getTextCursorPosition().block,
8556
- "after"
8557
- );
8555
+ ],
8556
+ editor.getTextCursorPosition().block,
8557
+ "after"
8558
+ );
8559
+ },
8560
+ aliases: ["proposal", "create-proposal", "dao-proposal", "governance"],
8561
+ group: "DAO",
8562
+ subtext: "Create a new DAO proposal"
8558
8563
  },
8559
- aliases: ["proposal", "create-proposal", "dao-proposal", "governance"],
8560
- group: "DAO",
8561
- subtext: "Create a new DAO proposal"
8562
- },
8563
- {
8564
- title: "Proposal Actions",
8565
- onItemClick: () => {
8566
- editor.insertBlocks(
8567
- [
8568
- {
8569
- type: "proposalActions",
8570
- props: {
8571
- proposalBlockId: "",
8572
- hasDependencies: true,
8573
- actions: "[]"
8564
+ {
8565
+ title: "Proposal Actions",
8566
+ onItemClick: () => {
8567
+ editor.insertBlocks(
8568
+ [
8569
+ {
8570
+ type: "proposalActions",
8571
+ props: {
8572
+ proposalBlockId: "",
8573
+ hasDependencies: true,
8574
+ actions: "[]"
8575
+ }
8574
8576
  }
8575
- }
8576
- ],
8577
- editor.getTextCursorPosition().block,
8578
- "after"
8579
- );
8580
- },
8581
- aliases: ["actions", "proposal-actions", "dao-actions", "governance-actions"],
8582
- group: "DAO",
8583
- subtext: "Manage proposal actions"
8577
+ ],
8578
+ editor.getTextCursorPosition().block,
8579
+ "after"
8580
+ );
8581
+ },
8582
+ aliases: ["actions", "proposal-actions", "dao-actions", "governance-actions"],
8583
+ group: "DAO",
8584
+ subtext: "Manage proposal actions"
8585
+ }
8586
+ ];
8587
+ const yRoot = editor?._yRoot;
8588
+ const docType = yRoot?.get("docType");
8589
+ if (docType === "page") {
8590
+ return slashMenuList.filter((item) => item.title !== "Proposal Actions" && item.title !== "Proposal Vote" && item.title !== "Proposal");
8584
8591
  }
8585
- ];
8592
+ return slashMenuList;
8593
+ };
8586
8594
 
8587
8595
  // src/mantine/hooks/useCreateIxoEditor.ts
8588
8596
  import { useCreateBlockNote } from "@blocknote/react";
@@ -9153,4 +9161,4 @@ export {
9153
9161
  ixoGraphQLClient,
9154
9162
  getEntity
9155
9163
  };
9156
- //# sourceMappingURL=chunk-VGSTHGS4.mjs.map
9164
+ //# sourceMappingURL=chunk-U7XWDZDL.mjs.map