@kodaris/krubble-app-components 1.0.165 → 1.0.166

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.
@@ -3677,6 +3677,28 @@
3677
3677
  this._inputValue = payload.message;
3678
3678
  this._handleSubmit();
3679
3679
  }
3680
+ /**
3681
+ * Open the panel and place `payload.message` in the composer, selected, without sending it.
3682
+ *
3683
+ * For a host app that wants to suggest an opening message rather than send one (e.g. a site
3684
+ * editor deep link): Enter sends it as is, typing replaces it. Nothing is persisted beyond the
3685
+ * composer draft state any typed text gets.
3686
+ */
3687
+ draft(payload) {
3688
+ this.open();
3689
+ this._inputValue = payload.message;
3690
+ this._saveState();
3691
+ // Same delay as the open-focus in `updated`: the panel has to finish showing before the
3692
+ // textarea can take focus, and this has to run after that focus so the selection sticks.
3693
+ this.updateComplete.then(() => {
3694
+ setTimeout(() => {
3695
+ if (this._inputEl) {
3696
+ this._inputEl.focus();
3697
+ this._inputEl.select();
3698
+ }
3699
+ }, 200);
3700
+ });
3701
+ }
3680
3702
  // --- Private methods ---
3681
3703
  /**
3682
3704
  * Shows a full-viewport transparent overlay during drag/resize operations.