@syntrologie/adapt-faq 2.8.0-canary.213 → 2.8.0-canary.215

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.
@@ -32,11 +32,15 @@ import type { FAQConfig } from './types';
32
32
  /**
33
33
  * Structural interface — describes only the methods the editable widget needs.
34
34
  * The real EditModeController satisfies this by structural subtyping.
35
+ *
36
+ * `tileId` (the host tile's id, threaded in via `instanceId` at mount) scopes
37
+ * controller calls to the active tile when a canvas has multiple FAQ tiles.
38
+ * It is optional so single-tile and v2 actions-shape canvases continue to work.
35
39
  */
36
40
  export interface ControllerLike {
37
- editItem(adaptive: string, itemId: string): void;
41
+ editItem(adaptive: string, itemId: string, tileId?: string): void;
38
42
  isModalOpen(): boolean;
39
- reorderItems(adaptive: string, newOrder: string[]): void;
43
+ reorderItems(adaptive: string, newOrder: string[], tileId?: string): void;
40
44
  }
41
45
  /** Return value from makeSortable. */
42
46
  export interface SortableHandle {
@@ -70,6 +74,9 @@ export declare class FAQAccordionEditableElement extends LitElement {
70
74
  controller: {
71
75
  attribute: boolean;
72
76
  };
77
+ tileId: {
78
+ attribute: boolean;
79
+ };
73
80
  _hoveredId: {
74
81
  state: boolean;
75
82
  };
@@ -77,6 +84,12 @@ export declare class FAQAccordionEditableElement extends LitElement {
77
84
  faqConfig: FAQConfig;
78
85
  /** Null when loaded without an editor context — renders read-only accordion. */
79
86
  controller: ControllerLike | null;
87
+ /**
88
+ * Host tile id, threaded in via the mountable's `instanceId`. Scopes every
89
+ * controller call so the right tile is targeted when the canvas has more
90
+ * than one FAQ tile (per-route FAQs). Empty string when unknown.
91
+ */
92
+ tileId: string;
80
93
  /**
81
94
  * The `makeSortable` factory to use. Injected by FAQWidgetLitEditableMountable
82
95
  * from the editor-sdk bootstrap so there is no direct import from editor-sdk
@@ -1 +1 @@
1
- {"version":3,"file":"FAQWidgetLit.editable.d.ts","sourceRoot":"","sources":["../src/FAQWidgetLit.editable.ts"],"names":[],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,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;QAC7B,8EAA8E;QAC9E,UAAU,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;KACjC;CAkCJ,CAAC"}
package/dist/editor.js CHANGED
@@ -4656,6 +4656,12 @@ var FAQAccordionEditableElement = class extends LitElement10 {
4656
4656
  };
4657
4657
  /** Null when loaded without an editor context — renders read-only accordion. */
4658
4658
  this.controller = null;
4659
+ /**
4660
+ * Host tile id, threaded in via the mountable's `instanceId`. Scopes every
4661
+ * controller call so the right tile is targeted when the canvas has more
4662
+ * than one FAQ tile (per-route FAQs). Empty string when unknown.
4663
+ */
4664
+ this.tileId = "";
4659
4665
  /**
4660
4666
  * The `makeSortable` factory to use. Injected by FAQWidgetLitEditableMountable
4661
4667
  * from the editor-sdk bootstrap so there is no direct import from editor-sdk
@@ -4713,7 +4719,7 @@ var FAQAccordionEditableElement = class extends LitElement10 {
4713
4719
  itemSelector: "[data-faq-editable-row]",
4714
4720
  handleSelector: "[data-drag-handle]",
4715
4721
  getItems: () => (this.faqConfig.actions ?? []).map((a) => a.config.id),
4716
- onReorder: (newOrder) => this.controller.reorderItems(ADAPTIVE_ID, newOrder),
4722
+ onReorder: (newOrder) => this.controller.reorderItems(ADAPTIVE_ID, newOrder, this.tileId || void 0),
4717
4723
  liveRegion
4718
4724
  });
4719
4725
  }
@@ -4723,7 +4729,7 @@ var FAQAccordionEditableElement = class extends LitElement10 {
4723
4729
  _handleEdit(itemId) {
4724
4730
  if (!this.controller) return;
4725
4731
  if (this.controller.isModalOpen()) return;
4726
- this.controller.editItem(ADAPTIVE_ID, itemId);
4732
+ this.controller.editItem(ADAPTIVE_ID, itemId, this.tileId || void 0);
4727
4733
  }
4728
4734
  _handleRowDblClick(itemId) {
4729
4735
  this._handleEdit(itemId);
@@ -4832,6 +4838,7 @@ var FAQAccordionEditableElement = class extends LitElement10 {
4832
4838
  FAQAccordionEditableElement.properties = {
4833
4839
  faqConfig: { attribute: false },
4834
4840
  controller: { attribute: false },
4841
+ tileId: { attribute: false },
4835
4842
  // Internal hover state per item id
4836
4843
  _hoveredId: { state: true }
4837
4844
  };
@@ -4841,7 +4848,7 @@ if (!customElements.get("syntro-faq-accordion-editable")) {
4841
4848
  var FAQWidgetLitEditableMountable = {
4842
4849
  mount(container, config) {
4843
4850
  const {
4844
- instanceId: _instanceId = "faq-editable",
4851
+ instanceId = "",
4845
4852
  controller = null,
4846
4853
  sortable = null,
4847
4854
  liveRegion = null,
@@ -4857,7 +4864,8 @@ var FAQWidgetLitEditableMountable = {
4857
4864
  faqConfig,
4858
4865
  controller,
4859
4866
  sortable,
4860
- liveRegion
4867
+ liveRegion,
4868
+ tileId: instanceId
4861
4869
  });
4862
4870
  container.appendChild(el);
4863
4871
  return () => el.remove();