@ni/ok-components 0.2.8 → 0.2.10

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.
@@ -39924,7 +39924,17 @@ so this becomes the fallback color for the slot */ ''}
39924
39924
  }
39925
39925
  }
39926
39926
  }
39927
- if (gecko && added.length) {
39927
+ if (added.some(n => n.nodeName == "BR") && (view.input.lastKeyCode == 8 || view.input.lastKeyCode == 46)) {
39928
+ // Browsers sometimes insert a bogus break node if you
39929
+ // backspace out the last bit of text before an inline-flex node (#1552)
39930
+ for (let node of added)
39931
+ if (node.nodeName == "BR" && node.parentNode) {
39932
+ let after = node.nextSibling;
39933
+ if (after && after.nodeType == 1 && after.contentEditable == "false")
39934
+ node.parentNode.removeChild(node);
39935
+ }
39936
+ }
39937
+ else if (gecko && added.length) {
39928
39938
  let brs = added.filter(n => n.nodeName == "BR");
39929
39939
  if (brs.length == 2) {
39930
39940
  let [a, b] = brs;
@@ -39942,17 +39952,6 @@ so this becomes the fallback color for the slot */ ''}
39942
39952
  }
39943
39953
  }
39944
39954
  }
39945
- else if ((chrome || safari) && added.some(n => n.nodeName == "BR") &&
39946
- (view.input.lastKeyCode == 8 || view.input.lastKeyCode == 46)) {
39947
- // Chrome/Safari sometimes insert a bogus break node if you
39948
- // backspace out the last bit of text before an inline-flex node (#1552)
39949
- for (let node of added)
39950
- if (node.nodeName == "BR" && node.parentNode) {
39951
- let after = node.nextSibling;
39952
- if (after && after.nodeType == 1 && after.contentEditable == "false")
39953
- node.parentNode.removeChild(node);
39954
- }
39955
- }
39956
39955
  let readSel = null;
39957
39956
  // If it looks like the browser has reset the selection to the
39958
39957
  // start of the document after focus, restore the selection from
@@ -56746,7 +56745,7 @@ ${renderedContent}
56746
56745
  */
56747
56746
  isMarkAhead(parent, index, mark) {
56748
56747
  for (;; index++) {
56749
- if (index == parent.childCount)
56748
+ if (index >= parent.childCount)
56750
56749
  return false;
56751
56750
  let next = parent.child(index);
56752
56751
  if (next.type.name != this.options.hardBreakNodeName)
@@ -59608,6 +59607,9 @@ ${renderedContent}
59608
59607
  },
59609
59608
  class: {
59610
59609
  default: this.options.HTMLAttributes.class
59610
+ },
59611
+ title: {
59612
+ default: null
59611
59613
  }
59612
59614
  };
59613
59615
  },
@@ -59647,10 +59649,11 @@ ${renderedContent}
59647
59649
  });
59648
59650
  },
59649
59651
  renderMarkdown: (node, h) => {
59650
- var _a;
59651
- const href = ((_a = node.attrs) == null ? void 0 : _a.href) || "";
59652
+ var _a, _b, _c, _d;
59653
+ const href = (_b = (_a = node.attrs) == null ? void 0 : _a.href) != null ? _b : "";
59654
+ const title = (_d = (_c = node.attrs) == null ? void 0 : _c.title) != null ? _d : "";
59652
59655
  const text = h.renderChildren(node);
59653
- return `[${text}](${href})`;
59656
+ return title ? `[${text}](${href} "${title}")` : `[${text}](${href})`;
59654
59657
  },
59655
59658
  addCommands() {
59656
59659
  return {
@@ -96794,6 +96797,14 @@ focus outline in that case.
96794
96797
  border-color: transparent;
96795
96798
  }
96796
96799
 
96800
+ .toolbar {
96801
+ display: block;
96802
+ }
96803
+
96804
+ .toolbar.toolbar-empty {
96805
+ display: none;
96806
+ }
96807
+
96797
96808
  .messages {
96798
96809
  flex: 1;
96799
96810
  display: flex;
@@ -96821,6 +96832,9 @@ focus outline in that case.
96821
96832
  `;
96822
96833
 
96823
96834
  const template$8 = html `
96835
+ <div class="toolbar ${x => (x.toolbarEmpty ? 'toolbar-empty' : '')}">
96836
+ <slot name="toolbar" ${slotted({ property: 'slottedToolbarElements' })}></slot>
96837
+ </div>
96824
96838
  <div class="messages"><slot></slot></div>
96825
96839
  <div class="input ${x => (x.inputEmpty ? 'input-empty' : '')}">
96826
96840
  <slot name="input" ${slotted({ property: 'slottedInputElements' })}>
@@ -96844,10 +96858,15 @@ focus outline in that case.
96844
96858
  this.appearance = ChatConversationAppearance.default;
96845
96859
  /** @internal */
96846
96860
  this.inputEmpty = true;
96861
+ /** @internal */
96862
+ this.toolbarEmpty = true;
96847
96863
  }
96848
96864
  slottedInputElementsChanged(_prev, next) {
96849
96865
  this.inputEmpty = next === undefined || next.length === 0;
96850
96866
  }
96867
+ slottedToolbarElementsChanged(_prev, next) {
96868
+ this.toolbarEmpty = next === undefined || next.length === 0;
96869
+ }
96851
96870
  }
96852
96871
  __decorate([
96853
96872
  attr
@@ -96858,6 +96877,12 @@ focus outline in that case.
96858
96877
  __decorate([
96859
96878
  observable
96860
96879
  ], ChatConversation.prototype, "slottedInputElements", void 0);
96880
+ __decorate([
96881
+ observable
96882
+ ], ChatConversation.prototype, "toolbarEmpty", void 0);
96883
+ __decorate([
96884
+ observable
96885
+ ], ChatConversation.prototype, "slottedToolbarElements", void 0);
96861
96886
  const sprightChatConversation = ChatConversation.compose({
96862
96887
  baseName: 'chat-conversation',
96863
96888
  template: template$8,