lucid-extension-sdk 0.0.451 → 0.0.453

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/commandtypes.d.ts CHANGED
@@ -1222,6 +1222,13 @@ export type CreateBlockQuery = {
1222
1222
  'c': string;
1223
1223
  /** If specified, the stencil for a custom shape. Only valid if the class name is 'CustomBlock' */
1224
1224
  's'?: UnsafeJsonSerializableOrUndefined | undefined;
1225
+ /** If specified, the initial bounding box for the block, set during creation*/
1226
+ 'b'?: {
1227
+ x: number;
1228
+ y: number;
1229
+ w: number;
1230
+ h: number;
1231
+ } | undefined;
1225
1232
  };
1226
1233
  export type CreateBlockResult = string;
1227
1234
  export type CreateCardsQuery = {
@@ -42,6 +42,7 @@ export declare const isSerializedDataSourceProperties: (subject: unknown) => sub
42
42
  ShowOnlyIfHasInward: (x: unknown) => x is boolean | null | undefined;
43
43
  SkipOutwardRelationships: (x: unknown) => x is boolean | null | undefined;
44
44
  ShowOnlyIfHasOutward: (x: unknown) => x is boolean | null | undefined;
45
+ SuppressLinkedItems: (x: unknown) => x is string | null | undefined;
45
46
  }>> | undefined;
46
47
  }>[] | null | undefined;
47
48
  }>;
@@ -83,6 +83,7 @@ export declare const isSerializedImportedDataSource: (subject: unknown) => subje
83
83
  ShowOnlyIfHasInward: (x: unknown) => x is boolean | null | undefined;
84
84
  SkipOutwardRelationships: (x: unknown) => x is boolean | null | undefined;
85
85
  ShowOnlyIfHasOutward: (x: unknown) => x is boolean | null | undefined;
86
+ SuppressLinkedItems: (x: unknown) => x is string | null | undefined;
86
87
  }>> | undefined;
87
88
  }>[] | null | undefined;
88
89
  }>;
@@ -142,6 +143,7 @@ export declare const isSerializedPreviewData: (subject: unknown) => subject is i
142
143
  ShowOnlyIfHasInward: (x: unknown) => x is boolean | null | undefined;
143
144
  SkipOutwardRelationships: (x: unknown) => x is boolean | null | undefined;
144
145
  ShowOnlyIfHasOutward: (x: unknown) => x is boolean | null | undefined;
146
+ SuppressLinkedItems: (x: unknown) => x is string | null | undefined;
145
147
  }>> | undefined;
146
148
  }>[] | null | undefined;
147
149
  }>;
@@ -1,8 +1,10 @@
1
1
  import { isString } from '../../checks';
2
2
  export type SerializedHierarchicalRelationshipFilterConfig = {
3
3
  'ShowOnlyIfHasInward'?: boolean | null | undefined;
4
+ /** @deprecated Use `SuppressLinkedItems` instead */
4
5
  'SkipOutwardRelationships'?: boolean | null | undefined;
5
6
  'ShowOnlyIfHasOutward'?: boolean | null | undefined;
7
+ 'SuppressLinkedItems'?: string | null | undefined;
6
8
  };
7
9
  export type SerializedSourceForeignKey = {
8
10
  'Id': string;
@@ -30,6 +32,7 @@ export declare const isSerializedHierarchicalRelationshipFilterConfig: (subject:
30
32
  ShowOnlyIfHasInward: (x: unknown) => x is boolean | null | undefined;
31
33
  SkipOutwardRelationships: (x: unknown) => x is boolean | null | undefined;
32
34
  ShowOnlyIfHasOutward: (x: unknown) => x is boolean | null | undefined;
35
+ SuppressLinkedItems: (x: unknown) => x is string | null | undefined;
33
36
  }>>;
34
37
  export declare const isSerializedSourceForeignKey: (subject: unknown) => subject is import("../../guards").DestructureGuardedTypeObj<{
35
38
  Id: typeof isString;
@@ -41,5 +44,6 @@ export declare const isSerializedSourceForeignKey: (subject: unknown) => subject
41
44
  ShowOnlyIfHasInward: (x: unknown) => x is boolean | null | undefined;
42
45
  SkipOutwardRelationships: (x: unknown) => x is boolean | null | undefined;
43
46
  ShowOnlyIfHasOutward: (x: unknown) => x is boolean | null | undefined;
47
+ SuppressLinkedItems: (x: unknown) => x is string | null | undefined;
44
48
  }>> | undefined;
45
49
  }>;
@@ -7,6 +7,7 @@ exports.isSerializedHierarchicalRelationshipFilterConfig = (0, validators_1.part
7
7
  'ShowOnlyIfHasInward': (0, validators_1.nullableOption)(checks_1.isBoolean),
8
8
  'SkipOutwardRelationships': (0, validators_1.nullableOption)(checks_1.isBoolean),
9
9
  'ShowOnlyIfHasOutward': (0, validators_1.nullableOption)(checks_1.isBoolean),
10
+ 'SuppressLinkedItems': (0, validators_1.nullableOption)(checks_1.isString),
10
11
  });
11
12
  exports.isSerializedSourceForeignKey = (0, validators_1.objectValidator)({
12
13
  'Id': checks_1.isString,
@@ -1,4 +1,34 @@
1
1
  import type { SerializedHierarchicalRelationshipFilterConfig, SerializedSourceForeignKey } from './serializedsourceforeignkey';
2
+ export declare const SuppressLinkedItems: {
3
+ /**
4
+ * Suppress only the outward direction of this relationship in the linked items panel.
5
+ * "Outward" means items that this item points to via the source field
6
+ * (e.g. a parent item that stores a list of child IDs — the children are outward).
7
+ * The inward direction (items that point back to this item) remains visible.
8
+ *
9
+ * Use this when items on one end of the relationship should show the relationship
10
+ * in the linked items panel, but items on the other end should not.
11
+ */
12
+ readonly Outward: "outward";
13
+ /**
14
+ * Suppress only the inward direction of this relationship in the linked items panel.
15
+ * "Inward" means items that point to this item via their own source field
16
+ * (i.e. items for which this item appears in their outward lookup).
17
+ * The outward direction (items this item points to) remains visible.
18
+ */
19
+ readonly Inward: "inward";
20
+ /**
21
+ * Suppress both directions of this relationship in the linked items panel.
22
+ * Neither the items this item points to (outward) nor the items that point
23
+ * to this item (inward) will appear in the linked items panel.
24
+ *
25
+ * Use this when the relationship is already represented elsewhere in your UI
26
+ * (e.g. a dedicated parent/child hierarchy view) and should not also appear
27
+ * as a linked item.
28
+ */
29
+ readonly Both: "both";
30
+ };
31
+ export type SuppressLinkedItems = (typeof SuppressLinkedItems)[keyof typeof SuppressLinkedItems];
2
32
  /**
3
33
  * Optional configuration for filtering hierarchical relationships.
4
34
  */
@@ -10,8 +40,8 @@ export type HierarchicalRelationshipFilterConfig = {
10
40
  */
11
41
  showOnlyIfHasInward?: boolean;
12
42
  /**
43
+ * @deprecated Use `suppressLinkedItems` instead.
13
44
  * If true, skip outward relationships in linked items display.
14
- * Example: ADO "Child" FK should not show children on parent cards.
15
45
  */
16
46
  skipOutwardRelationships?: boolean;
17
47
  /**
@@ -20,6 +50,21 @@ export type HierarchicalRelationshipFilterConfig = {
20
50
  * but is filtered out on parent cards (parent has no outward "parent" field).
21
51
  */
22
52
  showOnlyIfHasOutward?: boolean;
53
+ /**
54
+ * Controls which directions of this foreign key relationship are hidden from
55
+ * the linked items panel.
56
+ *
57
+ * A foreign key has two directions:
58
+ * - **Outward**: items that the current item points to(it's "children") via its source field.
59
+ * - **Inward**: items that point to the current item(it's "parent") via their own source field.
60
+ *
61
+ * Use `'outward'` to hide outward links while keeping inward links visible.
62
+ * Use `'inward'` to hide inward links while keeping outward links visible.
63
+ * Use `'both'` to hide all links for this relationship from the linked items panel.
64
+ *
65
+ * When omitted, both directions are shown normally.
66
+ */
67
+ suppressLinkedItems?: SuppressLinkedItems;
23
68
  };
24
69
  export type SourceForeignKey = {
25
70
  id: string;
@@ -1,14 +1,50 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SuppressLinkedItems = void 0;
3
4
  exports.serializeHierarchicalFilterConfig = serializeHierarchicalFilterConfig;
4
5
  exports.deserializeHierarchicalFilterConfig = deserializeHierarchicalFilterConfig;
5
6
  exports.serializeSourceForeignKey = serializeSourceForeignKey;
6
7
  exports.deserializeSourceForeignKey = deserializeSourceForeignKey;
8
+ const validators_1 = require("../../validators/validators");
9
+ exports.SuppressLinkedItems = {
10
+ /**
11
+ * Suppress only the outward direction of this relationship in the linked items panel.
12
+ * "Outward" means items that this item points to via the source field
13
+ * (e.g. a parent item that stores a list of child IDs — the children are outward).
14
+ * The inward direction (items that point back to this item) remains visible.
15
+ *
16
+ * Use this when items on one end of the relationship should show the relationship
17
+ * in the linked items panel, but items on the other end should not.
18
+ */
19
+ Outward: 'outward',
20
+ /**
21
+ * Suppress only the inward direction of this relationship in the linked items panel.
22
+ * "Inward" means items that point to this item via their own source field
23
+ * (i.e. items for which this item appears in their outward lookup).
24
+ * The outward direction (items this item points to) remains visible.
25
+ */
26
+ Inward: 'inward',
27
+ /**
28
+ * Suppress both directions of this relationship in the linked items panel.
29
+ * Neither the items this item points to (outward) nor the items that point
30
+ * to this item (inward) will appear in the linked items panel.
31
+ *
32
+ * Use this when the relationship is already represented elsewhere in your UI
33
+ * (e.g. a dedicated parent/child hierarchy view) and should not also appear
34
+ * as a linked item.
35
+ */
36
+ Both: 'both',
37
+ };
38
+ const isSuppressLinkedItems = (0, validators_1.stringEnumValidator)(exports.SuppressLinkedItems);
39
+ function parseSuppressLinkedItems(value) {
40
+ return value != null && isSuppressLinkedItems(value) ? value : undefined;
41
+ }
7
42
  function serializeHierarchicalFilterConfig(config) {
8
43
  return {
9
44
  'ShowOnlyIfHasInward': config.showOnlyIfHasInward,
10
45
  'SkipOutwardRelationships': config.skipOutwardRelationships,
11
46
  'ShowOnlyIfHasOutward': config.showOnlyIfHasOutward,
47
+ 'SuppressLinkedItems': config.suppressLinkedItems,
12
48
  };
13
49
  }
14
50
  function deserializeHierarchicalFilterConfig(config) {
@@ -17,6 +53,7 @@ function deserializeHierarchicalFilterConfig(config) {
17
53
  showOnlyIfHasInward: (_a = config['ShowOnlyIfHasInward']) !== null && _a !== void 0 ? _a : undefined,
18
54
  skipOutwardRelationships: (_b = config['SkipOutwardRelationships']) !== null && _b !== void 0 ? _b : undefined,
19
55
  showOnlyIfHasOutward: (_c = config['ShowOnlyIfHasOutward']) !== null && _c !== void 0 ? _c : undefined,
56
+ suppressLinkedItems: parseSuppressLinkedItems(config['SuppressLinkedItems']),
20
57
  };
21
58
  }
22
59
  function serializeSourceForeignKey(foreignKey) {
@@ -136,9 +136,9 @@ class PageProxy extends elementproxy_1.ElementProxy {
136
136
  'p': this.id,
137
137
  'c': def.className,
138
138
  's': def.stencil,
139
+ 'b': def.boundingBox,
139
140
  });
140
141
  const block = this.client.getBlockProxy(id);
141
- block.setBoundingBox(def.boundingBox);
142
142
  if (def.properties) {
143
143
  for (const key in def.properties) {
144
144
  block.properties.set(key, def.properties[key]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.451",
3
+ "version": "0.0.453",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/ui/menu.d.ts CHANGED
@@ -8,7 +8,7 @@ export declare const MenuType: {
8
8
  readonly Main: 1;
9
9
  /** The context menu that appears when the user right-clicks the canvas. */
10
10
  readonly Context: 2;
11
- /** The side dock in Lucidspark and Teamspaces */
11
+ /** The side dock in Lucidspark */
12
12
  readonly ContentDock: 3;
13
13
  };
14
14
  export type MenuType = (typeof MenuType)[keyof typeof MenuType];
@@ -60,7 +60,7 @@ export interface CustomDropdownMenu extends CustomMenuConfig {
60
60
  location?: MenuLocation;
61
61
  }
62
62
  /**
63
- * Data to create a content dock icon in Spark + Teamspaces
63
+ * Data to create a content dock icon in Spark
64
64
  */
65
65
  export interface CustomContentDockMenu extends CustomMenuConfig {
66
66
  /** The icon to display on the menu item.
@@ -148,7 +148,7 @@ export declare class Menu {
148
148
  */
149
149
  addContextMenuItem(item: CustomMenuConfig): void;
150
150
  /**
151
- * Create an icon tied to an action (required) that appears in the left toolbar in Lucidspark and Teamspaces (not in Lucidchart).
151
+ * Create an icon tied to an action (required) that appears in the left toolbar in Lucidspark (not in Lucidchart).
152
152
  *
153
153
  * The action must be registered with
154
154
  * [EditorClient.registerAction](/extension-sdk/#classes_editorclient-EditorClient_registeraction)
package/ui/menu.js CHANGED
@@ -11,7 +11,7 @@ exports.MenuType = {
11
11
  Main: 1,
12
12
  /** The context menu that appears when the user right-clicks the canvas. */
13
13
  Context: 2,
14
- /** The side dock in Lucidspark and Teamspaces */
14
+ /** The side dock in Lucidspark */
15
15
  ContentDock: 3,
16
16
  };
17
17
  /**
@@ -117,7 +117,7 @@ class Menu {
117
117
  });
118
118
  }
119
119
  /**
120
- * Create an icon tied to an action (required) that appears in the left toolbar in Lucidspark and Teamspaces (not in Lucidchart).
120
+ * Create an icon tied to an action (required) that appears in the left toolbar in Lucidspark (not in Lucidchart).
121
121
  *
122
122
  * The action must be registered with
123
123
  * [EditorClient.registerAction](/extension-sdk/#classes_editorclient-EditorClient_registeraction)