@onereach/ui-components 4.3.9-beta.2650.0 → 4.3.9

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.
Files changed (48) hide show
  1. package/dist/bundled/v2/components/OrButtonV2/OrButton.js +1 -1
  2. package/dist/bundled/v2/components/OrCarousel/OrCarousel.js +1 -1
  3. package/dist/bundled/v2/components/OrCode/OrCode.js +2 -2
  4. package/dist/bundled/v2/components/OrCode/index.js +2 -2
  5. package/dist/bundled/v2/components/OrCode/lang.js +2 -2
  6. package/dist/bundled/v2/components/OrCode/theme.js +1 -1
  7. package/dist/bundled/v2/components/OrConfirm/OrConfirm.js +1 -1
  8. package/dist/bundled/v2/components/OrConfirm/index.js +1 -1
  9. package/dist/bundled/v2/components/OrConfirmV3/OrConfirm.js +1 -1
  10. package/dist/bundled/v2/components/OrConfirmV3/index.js +1 -1
  11. package/dist/bundled/v2/components/OrDateTimePicker/OrDateTimePicker.js +1 -1
  12. package/dist/bundled/v2/components/index.js +3 -3
  13. package/dist/bundled/{v3/index-e0b25cea.js → v2/index-cf2c3c27.js} +59 -20
  14. package/dist/bundled/v2/index.js +4 -4
  15. package/dist/bundled/v2/{lang-7718d094.js → lang-0fb8f78b.js} +1 -1
  16. package/dist/bundled/v3/{OrCode.vue_vue_type_script_lang-d081cc44.js → OrCode.vue_vue_type_script_lang-74060519.js} +2 -2
  17. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-2c3578e7.js → OrConfirm.vue_vue_type_script_lang-23e4ce08.js} +1 -1
  18. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-925534a5.js → OrConfirm.vue_vue_type_script_lang-e5a8f92a.js} +1 -1
  19. package/dist/bundled/v3/{OrListOfInputs.vue_vue_type_script_lang-085ca836.js → OrListOfInputs.vue_vue_type_script_lang-006e0106.js} +1 -1
  20. package/dist/bundled/v3/components/OrButtonV2/OrButton.js +1 -1
  21. package/dist/bundled/v3/components/OrCarousel/OrCarousel.js +1 -1
  22. package/dist/bundled/v3/components/OrCode/OrCode.js +4 -4
  23. package/dist/bundled/v3/components/OrCode/index.js +3 -3
  24. package/dist/bundled/v3/components/OrCode/lang.js +2 -2
  25. package/dist/bundled/v3/components/OrCode/theme.js +1 -1
  26. package/dist/bundled/v3/components/OrConfirm/OrConfirm.js +3 -3
  27. package/dist/bundled/v3/components/OrConfirm/index.js +2 -2
  28. package/dist/bundled/v3/components/OrConfirmV3/OrConfirm.js +3 -3
  29. package/dist/bundled/v3/components/OrConfirmV3/index.js +2 -2
  30. package/dist/bundled/v3/components/OrDateTimePicker/OrDateTimePicker.js +1 -1
  31. package/dist/bundled/v3/components/OrList/OrList.js +2 -2
  32. package/dist/bundled/v3/components/OrList/index.js +1 -1
  33. package/dist/bundled/v3/components/OrListOfInputs/OrListOfInputs.js +3 -3
  34. package/dist/bundled/v3/components/OrListOfInputs/index.js +2 -2
  35. package/dist/bundled/v3/components/OrOverflowMenu/OrOverflowMenu.js +2 -2
  36. package/dist/bundled/v3/components/OrOverflowMenu/index.js +1 -1
  37. package/dist/bundled/v3/components/OrStepper/OrStepper.js +2 -2
  38. package/dist/bundled/v3/components/OrStepper/index.js +1 -1
  39. package/dist/bundled/v3/components/index.js +10 -10
  40. package/dist/bundled/{v2/index-e0b25cea.js → v3/index-cf2c3c27.js} +59 -20
  41. package/dist/bundled/v3/index.js +11 -11
  42. package/dist/bundled/v3/{lang-7718d094.js → lang-0fb8f78b.js} +1 -1
  43. package/package.json +6 -6
  44. /package/dist/bundled/v2/{index-63e094a0.js → index-968c331a.js} +0 -0
  45. /package/dist/bundled/v3/{OrList.vue_vue_type_script_lang-8366e01b.js → OrList.vue_vue_type_script_lang-47bafed1.js} +0 -0
  46. /package/dist/bundled/v3/{OrOverflowMenu.vue_vue_type_script_lang-638f90d1.js → OrOverflowMenu.vue_vue_type_script_lang-fe2d0395.js} +0 -0
  47. /package/dist/bundled/v3/{OrStepper.vue_vue_type_script_lang-846beafb.js → OrStepper.vue_vue_type_script_lang-d230260e.js} +0 -0
  48. /package/dist/bundled/v3/{index-63e094a0.js → index-968c331a.js} +0 -0
@@ -4589,6 +4589,9 @@ class ContentView {
4589
4589
  get isWidget() {
4590
4590
  return false;
4591
4591
  }
4592
+ get isHidden() {
4593
+ return false;
4594
+ }
4592
4595
  merge(from, to, source, hasStart, openStart, openEnd) {
4593
4596
  return false;
4594
4597
  }
@@ -4926,7 +4929,7 @@ class WidgetView extends ContentView {
4926
4929
  become(other) {
4927
4930
  if (other.length == this.length && other instanceof WidgetView && other.side == this.side) {
4928
4931
  if (this.widget.constructor == other.widget.constructor) {
4929
- if (!this.widget.eq(other.widget)) this.markDirty(true);
4932
+ if (!this.widget.compare(other.widget)) this.markDirty(true);
4930
4933
  if (this.dom && !this.prevWidget) this.prevWidget = this.widget;
4931
4934
  this.widget = other.widget;
4932
4935
  return true;
@@ -4952,7 +4955,7 @@ class WidgetView extends ContentView {
4952
4955
  return text ? text.slice(start, start + this.length) : Text.empty;
4953
4956
  }
4954
4957
  domAtPos(pos) {
4955
- return pos == 0 ? DOMPos.before(this.dom) : DOMPos.after(this.dom, pos == this.length);
4958
+ return (this.length ? pos == 0 : this.side > 0) ? DOMPos.before(this.dom) : DOMPos.after(this.dom, pos == this.length);
4956
4959
  }
4957
4960
  domBoundsAround() {
4958
4961
  return null;
@@ -4973,6 +4976,9 @@ class WidgetView extends ContentView {
4973
4976
  get isWidget() {
4974
4977
  return true;
4975
4978
  }
4979
+ get isHidden() {
4980
+ return this.widget.isHidden;
4981
+ }
4976
4982
  destroy() {
4977
4983
  super.destroy();
4978
4984
  if (this.dom) this.widget.destroy(this.dom);
@@ -5112,6 +5118,9 @@ class WidgetBufferView extends ContentView {
5112
5118
  get overrideDOMText() {
5113
5119
  return Text.empty;
5114
5120
  }
5121
+ get isHidden() {
5122
+ return true;
5123
+ }
5115
5124
  }
5116
5125
  TextView.prototype.children = WidgetView.prototype.children = WidgetBufferView.prototype.children = noChildren;
5117
5126
  function inlineSiblingRect(view, side) {
@@ -5186,7 +5195,7 @@ function coordsInChildren(view, pos, side) {
5186
5195
  if (end >= pos) {
5187
5196
  if (child.children.length) {
5188
5197
  scan(child, pos - off);
5189
- } else if (!after && (end > pos || off == end && child.getSide() > 0)) {
5198
+ } else if ((!after || after instanceof WidgetBufferView && side > 0) && (end > pos || off == end && child.getSide() > 0)) {
5190
5199
  after = child;
5191
5200
  afterPos = pos - off;
5192
5201
  } else if (off < pos || off == end && child.getSide() < 0) {
@@ -5292,6 +5301,12 @@ class WidgetType {
5292
5301
  return null;
5293
5302
  }
5294
5303
  /**
5304
+ @internal
5305
+ */
5306
+ get isHidden() {
5307
+ return false;
5308
+ }
5309
+ /**
5295
5310
  This is called when the an instance of the widget is removed
5296
5311
  from the editor view.
5297
5312
  */
@@ -5713,7 +5728,7 @@ class BlockWidgetView extends ContentView {
5713
5728
  }
5714
5729
  become(other) {
5715
5730
  if (other instanceof BlockWidgetView && other.type == this.type && other.widget.constructor == this.widget.constructor) {
5716
- if (!other.widget.eq(this.widget)) this.markDirty(true);
5731
+ if (!other.widget.compare(this.widget)) this.markDirty(true);
5717
5732
  if (this.dom && !this.prevWidget) this.prevWidget = this.widget;
5718
5733
  this.widget = other.widget;
5719
5734
  this.length = other.length;
@@ -5843,7 +5858,7 @@ class ContentBuilder {
5843
5858
  let cursorBefore = this.atCursorPos && !view.isEditable && openStart <= active.length && (from < to || deco.startSide > 0);
5844
5859
  let cursorAfter = !view.isEditable && (from < to || openStart > active.length || deco.startSide <= 0);
5845
5860
  let line = this.getLine();
5846
- if (this.pendingBuffer == 2 /* Buf.IfCursor */ && !cursorBefore) this.pendingBuffer = 0 /* Buf.No */;
5861
+ if (this.pendingBuffer == 2 /* Buf.IfCursor */ && !cursorBefore && !view.isEditable) this.pendingBuffer = 0 /* Buf.No */;
5847
5862
  this.flushBuffer(active);
5848
5863
  if (cursorBefore) {
5849
5864
  line.append(wrapMarks(new WidgetBufferView(1), active), openStart);
@@ -5897,6 +5912,9 @@ class NullWidget extends WidgetType {
5897
5912
  updateDOM(elt) {
5898
5913
  return elt.nodeName.toLowerCase() == this.tag;
5899
5914
  }
5915
+ get isHidden() {
5916
+ return true;
5917
+ }
5900
5918
  }
5901
5919
  const clickAddsSelectionRange = /*@__PURE__*/Facet.define();
5902
5920
  const dragMovesSelection$1 = /*@__PURE__*/Facet.define();
@@ -6707,7 +6725,7 @@ class DocView extends ContentView {
6707
6725
  let head = main.empty ? anchor : this.domAtPos(main.head);
6708
6726
  // Always reset on Firefox when next to an uneditable node to
6709
6727
  // avoid invisible cursor bugs (#111)
6710
- if (browser.gecko && main.empty && betweenUneditable(anchor)) {
6728
+ if (browser.gecko && main.empty && !this.compositionDeco.size && betweenUneditable(anchor)) {
6711
6729
  let dummy = document.createTextNode("");
6712
6730
  this.view.observer.ignore(() => anchor.node.insertBefore(dummy, anchor.node.childNodes[anchor.offset] || null));
6713
6731
  anchor = head = new DOMPos(dummy, 0);
@@ -7518,7 +7536,15 @@ class InputState {
7518
7536
  // first, false means first has already been marked for this
7519
7537
  // composition)
7520
7538
  this.compositionFirstChange = null;
7539
+ // End time of the previous composition
7521
7540
  this.compositionEndedAt = 0;
7541
+ // Used in a kludge to detect when an Enter keypress should be
7542
+ // considered part of the composition on Safari, which fires events
7543
+ // in the wrong order
7544
+ this.compositionPendingKey = false;
7545
+ // Used to categorize changes as part of a composition, even when
7546
+ // the mutation events fire shortly after the compositionend event
7547
+ this.compositionPendingChange = false;
7522
7548
  this.mouseSelection = null;
7523
7549
  let handleEvent = (handler, event) => {
7524
7550
  if (this.ignoreDuringComposition(event)) return;
@@ -7656,8 +7682,8 @@ class InputState {
7656
7682
  // compositionend and keydown events are sometimes emitted in the
7657
7683
  // wrong order. The key event should still be ignored, even when
7658
7684
  // it happens after the compositionend event.
7659
- if (browser.safari && !browser.ios && Date.now() - this.compositionEndedAt < 100) {
7660
- this.compositionEndedAt = 0;
7685
+ if (browser.safari && !browser.ios && this.compositionPendingKey && Date.now() - this.compositionEndedAt < 100) {
7686
+ this.compositionPendingKey = false;
7661
7687
  return true;
7662
7688
  }
7663
7689
  return false;
@@ -7693,8 +7719,9 @@ const PendingKeys = [{
7693
7719
  const EmacsyPendingKeys = "dthko";
7694
7720
  // Key codes for modifier keys
7695
7721
  const modifierCodes = [16, 17, 18, 20, 91, 92, 224, 225];
7722
+ const dragScrollMargin = 6;
7696
7723
  function dragScrollSpeed(dist) {
7697
- return dist * 0.7 + 8;
7724
+ return Math.max(0, dist) * 0.7 + 8;
7698
7725
  }
7699
7726
  class MouseSelection {
7700
7727
  constructor(view, startEvent, style, mustSelect) {
@@ -7737,8 +7764,8 @@ class MouseSelection {
7737
7764
  right: this.view.win.innerWidth,
7738
7765
  bottom: this.view.win.innerHeight
7739
7766
  };
7740
- if (event.clientX <= rect.left) sx = -dragScrollSpeed(rect.left - event.clientX);else if (event.clientX >= rect.right) sx = dragScrollSpeed(event.clientX - rect.right);
7741
- if (event.clientY <= rect.top) sy = -dragScrollSpeed(rect.top - event.clientY);else if (event.clientY >= rect.bottom) sy = dragScrollSpeed(event.clientY - rect.bottom);
7767
+ if (event.clientX <= rect.left + dragScrollMargin) sx = -dragScrollSpeed(rect.left - event.clientX);else if (event.clientX >= rect.right - dragScrollMargin) sx = dragScrollSpeed(event.clientX - rect.right);
7768
+ if (event.clientY <= rect.top + dragScrollMargin) sy = -dragScrollSpeed(rect.top - event.clientY);else if (event.clientY >= rect.bottom - dragScrollMargin) sy = dragScrollSpeed(event.clientY - rect.bottom);
7742
7769
  this.setScrollSpeed(sx, sy);
7743
7770
  }
7744
7771
  up(event) {
@@ -7983,7 +8010,8 @@ function basicMouseSelection(view, event) {
7983
8010
  }
7984
8011
  },
7985
8012
  get(event, extend, multiple) {
7986
- let cur = queryPos(view, event);
8013
+ let cur = queryPos(view, event),
8014
+ removed;
7987
8015
  let range = rangeForClick(view, cur.pos, cur.bias, type);
7988
8016
  if (start.pos != cur.pos && !extend) {
7989
8017
  let startRange = rangeForClick(view, start.pos, start.bias, type);
@@ -7991,14 +8019,19 @@ function basicMouseSelection(view, event) {
7991
8019
  to = Math.max(startRange.to, range.to);
7992
8020
  range = from < range.from ? EditorSelection.range(from, to) : EditorSelection.range(to, from);
7993
8021
  }
7994
- if (extend) return startSel.replaceRange(startSel.main.extend(range.from, range.to));else if (multiple && startSel.ranges.length > 1 && startSel.ranges.some(r => r.eq(range))) return removeRange(startSel, range);else if (multiple) return startSel.addRange(range);else return EditorSelection.create([range]);
8022
+ if (extend) return startSel.replaceRange(startSel.main.extend(range.from, range.to));else if (multiple && type == 1 && startSel.ranges.length > 1 && (removed = removeRangeAround(startSel, cur.pos))) return removed;else if (multiple) return startSel.addRange(range);else return EditorSelection.create([range]);
7995
8023
  }
7996
8024
  };
7997
8025
  }
7998
- function removeRange(sel, range) {
7999
- for (let i = 0;; i++) {
8000
- if (sel.ranges[i].eq(range)) return EditorSelection.create(sel.ranges.slice(0, i).concat(sel.ranges.slice(i + 1)), sel.mainIndex == i ? 0 : sel.mainIndex - (sel.mainIndex > i ? 1 : 0));
8026
+ function removeRangeAround(sel, pos) {
8027
+ for (let i = 0; i < sel.ranges.length; i++) {
8028
+ let {
8029
+ from,
8030
+ to
8031
+ } = sel.ranges[i];
8032
+ if (from <= pos && to >= pos) return EditorSelection.create(sel.ranges.slice(0, i).concat(sel.ranges.slice(i + 1)), sel.mainIndex == i ? 0 : sel.mainIndex - (sel.mainIndex > i ? 1 : 0));
8001
8033
  }
8034
+ return null;
8002
8035
  }
8003
8036
  handlers.dragstart = (view, event) => {
8004
8037
  let {
@@ -8195,6 +8228,8 @@ handlers.compositionstart = handlers.compositionupdate = view => {
8195
8228
  handlers.compositionend = view => {
8196
8229
  view.inputState.composing = -1;
8197
8230
  view.inputState.compositionEndedAt = Date.now();
8231
+ view.inputState.compositionPendingKey = true;
8232
+ view.inputState.compositionPendingChange = view.observer.pendingRecords().length > 0;
8198
8233
  view.inputState.compositionFirstChange = null;
8199
8234
  if (browser.chrome && browser.android) view.observer.flushSoon();
8200
8235
  setTimeout(() => {
@@ -9906,7 +9941,7 @@ function applyDOMChange(view, domChange) {
9906
9941
  tr = startState.replaceSelection(view.state.toText(before + change.insert.sliceString(0, undefined, view.state.lineBreak) + after));
9907
9942
  } else {
9908
9943
  let changes = startState.changes(change);
9909
- let mainSel = newSel && !startState.selection.main.eq(newSel.main) && newSel.main.to <= changes.newLength ? newSel.main : undefined;
9944
+ let mainSel = newSel && newSel.main.to <= changes.newLength ? newSel.main : undefined;
9910
9945
  // Try to apply a composition change to all cursors
9911
9946
  if (startState.selection.ranges.length > 1 && view.inputState.composing >= 0 && change.to <= sel.to && change.to >= sel.to - 10) {
9912
9947
  let replaced = view.state.sliceDoc(change.from, change.to);
@@ -9947,7 +9982,8 @@ function applyDOMChange(view, domChange) {
9947
9982
  }
9948
9983
  }
9949
9984
  let userEvent = "input.type";
9950
- if (view.composing) {
9985
+ if (view.composing || view.inputState.compositionPendingChange && view.inputState.compositionEndedAt > Date.now() - 50) {
9986
+ view.inputState.compositionPendingChange = false;
9951
9987
  userEvent += ".compose";
9952
9988
  if (view.inputState.compositionFirstChange) {
9953
9989
  userEvent += ".start";
@@ -10299,9 +10335,12 @@ class DOMObserver {
10299
10335
  }
10300
10336
  this.flush();
10301
10337
  }
10338
+ pendingRecords() {
10339
+ for (let mut of this.observer.takeRecords()) this.queue.push(mut);
10340
+ return this.queue;
10341
+ }
10302
10342
  processRecords() {
10303
- let records = this.queue;
10304
- for (let mut of this.observer.takeRecords()) records.push(mut);
10343
+ let records = this.pendingRecords();
10305
10344
  if (records.length) this.queue = [];
10306
10345
  let from = -1,
10307
10346
  to = -1,