@orangelogic/design-system 2.156.0 → 2.157.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.
@@ -37473,7 +37473,7 @@ let or = class extends di {
37473
37473
  ), this.fetchItems = this.fetchItems.bind(this), this.handleMentionKeyDown = this.handleMentionKeyDown.bind(this), this.handleMentionStart = this.handleMentionStart.bind(this), this.handleMentionUpdate = this.handleMentionUpdate.bind(this), this.handleOutsideClick = this.handleOutsideClick.bind(this), this.toggleFullscreen = this.toggleFullscreen.bind(this), this.resetMention = this.resetMention.bind(this);
37474
37474
  }
37475
37475
  connectedCallback() {
37476
- super.connectedCallback(), document.addEventListener("click", this.handleOutsideClick), this.hasUpdated && (!this.editor || this.editor.isDestroyed) && this.runFirstUpdated();
37476
+ super.connectedCallback(), document.addEventListener("click", this.handleOutsideClick);
37477
37477
  }
37478
37478
  disconnectedCallback() {
37479
37479
  super.disconnectedCallback(), document.removeEventListener("click", this.handleOutsideClick), this.debouncedFetch.cancel(), this.caretAnimationId && (cancelAnimationFrame(this.caretAnimationId), this.caretAnimationId = void 0), this.editor?.destroy();
@@ -37646,9 +37646,22 @@ let or = class extends di {
37646
37646
  }
37647
37647
  });
37648
37648
  }
37649
+ /**
37650
+ * First init must happen here: on Cortex ajax refresh the element renders while
37651
+ * detached, so the editor DOM has to exist before insertion or the first paint
37652
+ * collapses to zero height (buttons below overlap the comment box).
37653
+ */
37649
37654
  runFirstUpdated() {
37650
37655
  this.initEditor(), FQ() && (this.contentEditable = "true"), t8(this.dialog, "dialog.show", null), t8(this.dialog, "dialog.overlay.show", null);
37651
37656
  }
37657
+ /**
37658
+ * Re-init on every (re)connect: `disconnectedCallback` destroys the editor, and on
37659
+ * Cortex ajax refresh props like `content` are applied after `runFirstUpdated`
37660
+ * (see docs/cortex-render-order.md) — re-initializing here picks up the latest values.
37661
+ */
37662
+ connectedUpdatedCallback() {
37663
+ this.initEditor();
37664
+ }
37652
37665
  handleCommentMousedown(i) {
37653
37666
  i.stopPropagation();
37654
37667
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orangelogic/design-system",
3
3
  "type": "module",
4
- "version": "2.156.0",
4
+ "version": "2.157.0",
5
5
  "license": "UNLICENSED",
6
6
  "types": "library/types.d.ts",
7
7
  "scripts": {
@@ -93,7 +93,18 @@ export default class CxComment extends CortexElement {
93
93
  private handleMentionUpdate;
94
94
  private handleMentionKeyDown;
95
95
  private initEditor;
96
+ /**
97
+ * First init must happen here: on Cortex ajax refresh the element renders while
98
+ * detached, so the editor DOM has to exist before insertion or the first paint
99
+ * collapses to zero height (buttons below overlap the comment box).
100
+ */
96
101
  runFirstUpdated(): void;
102
+ /**
103
+ * Re-init on every (re)connect: `disconnectedCallback` destroys the editor, and on
104
+ * Cortex ajax refresh props like `content` are applied after `runFirstUpdated`
105
+ * (see docs/cortex-render-order.md) — re-initializing here picks up the latest values.
106
+ */
107
+ connectedUpdatedCallback(): void;
97
108
  private handleCommentMousedown;
98
109
  handleEditableChange(): void;
99
110
  handlePlaceholderChange(): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orangelogic/design-system",
3
3
  "type": "module",
4
- "version": "2.156.0",
4
+ "version": "2.157.0",
5
5
  "license": "UNLICENSED",
6
6
  "types": "library/types.d.ts",
7
7
  "scripts": {