tinybase 8.5.0-beta.0 → 8.5.0-beta.2

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 (137) hide show
  1. package/@types/ui-react-dom-charts/index.d.ts +387 -0
  2. package/@types/ui-react-dom-charts/with-schemas/index.d.ts +476 -0
  3. package/common/index.js +3 -2
  4. package/common/with-schemas/index.js +3 -2
  5. package/index.js +5 -3
  6. package/mergeable-store/index.js +5 -3
  7. package/mergeable-store/with-schemas/index.js +5 -3
  8. package/metrics/index.js +1 -1
  9. package/metrics/with-schemas/index.js +1 -1
  10. package/min/common/index.js +1 -1
  11. package/min/common/index.js.gz +0 -0
  12. package/min/common/with-schemas/index.js +1 -1
  13. package/min/common/with-schemas/index.js.gz +0 -0
  14. package/min/index.js +1 -1
  15. package/min/index.js.gz +0 -0
  16. package/min/mergeable-store/index.js +1 -1
  17. package/min/mergeable-store/index.js.gz +0 -0
  18. package/min/mergeable-store/with-schemas/index.js +1 -1
  19. package/min/mergeable-store/with-schemas/index.js.gz +0 -0
  20. package/min/omni/index.js +1 -1
  21. package/min/omni/index.js.gz +0 -0
  22. package/min/omni/with-schemas/index.js +1 -1
  23. package/min/omni/with-schemas/index.js.gz +0 -0
  24. package/min/persisters/persister-durable-object-sql-storage/index.js +1 -1
  25. package/min/persisters/persister-durable-object-sql-storage/index.js.gz +0 -0
  26. package/min/persisters/persister-durable-object-sql-storage/with-schemas/index.js +1 -1
  27. package/min/persisters/persister-durable-object-sql-storage/with-schemas/index.js.gz +0 -0
  28. package/min/persisters/persister-partykit-server/index.js +1 -1
  29. package/min/persisters/persister-partykit-server/index.js.gz +0 -0
  30. package/min/persisters/persister-partykit-server/with-schemas/index.js +1 -1
  31. package/min/persisters/persister-partykit-server/with-schemas/index.js.gz +0 -0
  32. package/min/queries/index.js +1 -1
  33. package/min/queries/index.js.gz +0 -0
  34. package/min/queries/with-schemas/index.js +1 -1
  35. package/min/queries/with-schemas/index.js.gz +0 -0
  36. package/min/synchronizers/index.js +1 -1
  37. package/min/synchronizers/index.js.gz +0 -0
  38. package/min/synchronizers/synchronizer-broadcast-channel/index.js +1 -1
  39. package/min/synchronizers/synchronizer-broadcast-channel/index.js.gz +0 -0
  40. package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +1 -1
  41. package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js.gz +0 -0
  42. package/min/synchronizers/synchronizer-local/index.js +1 -1
  43. package/min/synchronizers/synchronizer-local/index.js.gz +0 -0
  44. package/min/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
  45. package/min/synchronizers/synchronizer-local/with-schemas/index.js.gz +0 -0
  46. package/min/synchronizers/synchronizer-ws-client/index.js +1 -1
  47. package/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
  48. package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
  49. package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
  50. package/min/synchronizers/synchronizer-ws-server/index.js +1 -1
  51. package/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
  52. package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
  53. package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
  54. package/min/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
  55. package/min/synchronizers/synchronizer-ws-server-durable-object/index.js.gz +0 -0
  56. package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
  57. package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js.gz +0 -0
  58. package/min/synchronizers/with-schemas/index.js +1 -1
  59. package/min/synchronizers/with-schemas/index.js.gz +0 -0
  60. package/min/ui-react/index.js +1 -1
  61. package/min/ui-react/index.js.gz +0 -0
  62. package/min/ui-react/with-schemas/index.js +1 -1
  63. package/min/ui-react/with-schemas/index.js.gz +0 -0
  64. package/min/ui-react-dom/index.js +1 -1
  65. package/min/ui-react-dom/index.js.gz +0 -0
  66. package/min/ui-react-dom/with-schemas/index.js +1 -1
  67. package/min/ui-react-dom/with-schemas/index.js.gz +0 -0
  68. package/min/ui-react-dom-charts/index.js +1 -0
  69. package/min/ui-react-dom-charts/index.js.gz +0 -0
  70. package/min/ui-react-dom-charts/with-schemas/index.js +1 -0
  71. package/min/ui-react-dom-charts/with-schemas/index.js.gz +0 -0
  72. package/min/ui-react-inspector/index.js +1 -1
  73. package/min/ui-react-inspector/index.js.gz +0 -0
  74. package/min/ui-react-inspector/with-schemas/index.js +1 -1
  75. package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  76. package/min/ui-solid-dom/index.js +1 -1
  77. package/min/ui-solid-dom/index.js.gz +0 -0
  78. package/min/ui-solid-dom/with-schemas/index.js +1 -1
  79. package/min/ui-solid-dom/with-schemas/index.js.gz +0 -0
  80. package/min/ui-solid-inspector/index.js +1 -1
  81. package/min/ui-solid-inspector/index.js.gz +0 -0
  82. package/min/ui-solid-inspector/with-schemas/index.js +1 -1
  83. package/min/ui-solid-inspector/with-schemas/index.js.gz +0 -0
  84. package/min/ui-svelte-dom/index.js +1 -1
  85. package/min/ui-svelte-dom/index.js.gz +0 -0
  86. package/min/ui-svelte-dom/with-schemas/index.js +1 -1
  87. package/min/ui-svelte-dom/with-schemas/index.js.gz +0 -0
  88. package/min/ui-svelte-inspector/index.js +1 -1
  89. package/min/ui-svelte-inspector/index.js.gz +0 -0
  90. package/min/ui-svelte-inspector/with-schemas/index.js +1 -1
  91. package/min/ui-svelte-inspector/with-schemas/index.js.gz +0 -0
  92. package/min/with-schemas/index.js +1 -1
  93. package/min/with-schemas/index.js.gz +0 -0
  94. package/omni/index.js +7 -4
  95. package/omni/with-schemas/index.js +7 -4
  96. package/package.json +53 -17
  97. package/persisters/persister-durable-object-sql-storage/index.js +13 -11
  98. package/persisters/persister-durable-object-sql-storage/with-schemas/index.js +13 -11
  99. package/persisters/persister-partykit-client/index.js +2 -1
  100. package/persisters/persister-partykit-client/with-schemas/index.js +2 -1
  101. package/persisters/persister-partykit-server/index.js +2 -1
  102. package/persisters/persister-partykit-server/with-schemas/index.js +2 -1
  103. package/queries/index.js +1 -1
  104. package/queries/with-schemas/index.js +1 -1
  105. package/readme.md +14 -14
  106. package/releases.md +124 -61
  107. package/synchronizers/index.js +3 -2
  108. package/synchronizers/synchronizer-broadcast-channel/index.js +3 -2
  109. package/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +3 -2
  110. package/synchronizers/synchronizer-local/index.js +3 -2
  111. package/synchronizers/synchronizer-local/with-schemas/index.js +3 -2
  112. package/synchronizers/synchronizer-ws-client/index.js +3 -2
  113. package/synchronizers/synchronizer-ws-client/with-schemas/index.js +3 -2
  114. package/synchronizers/synchronizer-ws-server/index.js +3 -2
  115. package/synchronizers/synchronizer-ws-server/with-schemas/index.js +3 -2
  116. package/synchronizers/synchronizer-ws-server-durable-object/index.js +3 -2
  117. package/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +3 -2
  118. package/synchronizers/with-schemas/index.js +3 -2
  119. package/ui-react/index.js +3 -0
  120. package/ui-react/with-schemas/index.js +3 -0
  121. package/ui-react-dom/index.js +18 -12
  122. package/ui-react-dom/with-schemas/index.js +18 -12
  123. package/ui-react-dom-charts/index.js +1783 -0
  124. package/ui-react-dom-charts/with-schemas/index.js +1783 -0
  125. package/ui-react-inspector/index.js +29 -20
  126. package/ui-react-inspector/with-schemas/index.js +29 -20
  127. package/ui-solid-dom/index.js +10 -7
  128. package/ui-solid-dom/with-schemas/index.js +10 -7
  129. package/ui-solid-inspector/index.js +16 -10
  130. package/ui-solid-inspector/with-schemas/index.js +16 -10
  131. package/ui-svelte/index.js +5 -5
  132. package/ui-svelte/with-schemas/index.js +5 -5
  133. package/ui-svelte-dom/index.js +162 -164
  134. package/ui-svelte-dom/with-schemas/index.js +162 -164
  135. package/ui-svelte-inspector/index.js +192 -196
  136. package/ui-svelte-inspector/with-schemas/index.js +192 -196
  137. package/with-schemas/index.js +5 -3
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import {Fragment, jsx, jsxs} from 'react/jsx-runtime';
2
+ import {Fragment as Fragment$1, jsx, jsxs} from 'react/jsx-runtime';
3
3
  import {
4
4
  CellView,
5
5
  ResultCellView,
@@ -79,6 +79,7 @@ const id = (key) => EMPTY_STRING + key;
79
79
  const strSplit = (str, separator = EMPTY_STRING, limit) =>
80
80
  str.split(separator, limit);
81
81
 
82
+ const math = Math;
82
83
  const getIfNotFunction = (predicate) => (value, then, otherwise) =>
83
84
  predicate(value)
84
85
  ? /* istanbul ignore next */
@@ -86,7 +87,9 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
86
87
  : then(value);
87
88
  const GLOBAL = globalThis;
88
89
  const WINDOW = GLOBAL.window;
89
- const math = Math;
90
+ const number = Number;
91
+ const string = String;
92
+ const boolean = Boolean;
90
93
  const mathMin = math.min;
91
94
  const mathFloor = math.floor;
92
95
  const isFiniteNumber = isFinite;
@@ -129,6 +132,7 @@ const tryCatch = async (action, then1, then2) => {
129
132
  };
130
133
 
131
134
  const arrayHas = (array, value) => array.includes(value);
135
+ const arrayIndexOf = (array, value) => array.indexOf(value);
132
136
  const arrayEvery = (array, cb) => array.every(cb);
133
137
  const arrayIsEqual = (array1, array2) =>
134
138
  size(array1) === size(array2) &&
@@ -252,7 +256,7 @@ const NO_PROVIDED_OBJECTS_MESSAGE =
252
256
  const INSPECTOR_ERROR_MESSAGE =
253
257
  'Inspector error: please see console for details.';
254
258
  const getInitialPosition = (position) => {
255
- const index = POSITIONS.indexOf(position);
259
+ const index = arrayIndexOf(POSITIONS, position);
256
260
  return index == -1 ? 1 : index;
257
261
  };
258
262
  const getUniqueId = (...args) => jsonStringWithMap(args);
@@ -360,6 +364,7 @@ const TEXT_OVERFLOW = 'text-overflow';
360
364
  const ALIGN_ITEMS = 'align-items';
361
365
  const BACKDROP_FILTER = 'backdrop-filter';
362
366
  const MARGIN_RIGHT = MARGIN + '-' + RIGHT;
367
+ const Z_INDEX = 'z-index';
363
368
  const FIXED = 'fixed';
364
369
  const REVERT = 'revert';
365
370
  const UNSET = 'unset';
@@ -383,8 +388,8 @@ const APP_STYLESHEET = arrayJoin(
383
388
  all: 'initial',
384
389
  [FONT_SIZE]: rem(0.75),
385
390
  [POSITION]: FIXED,
391
+ [Z_INDEX]: 999999,
386
392
  'font-family': 'inter,sans-serif',
387
- 'z-index': 999999,
388
393
  '--bg': oklch(20),
389
394
  '--bg2': oklch(15),
390
395
  '--bg3': oklch(25),
@@ -488,6 +493,7 @@ const APP_STYLESHEET = arrayJoin(
488
493
  [BACKGROUND]: oklch(30, '% 0.008 var(--hue) / .5'),
489
494
  [WIDTH]: 'calc(100% - .5rem)',
490
495
  [POSITION]: 'absolute',
496
+ [Z_INDEX]: 1,
491
497
  [BORDER + '-' + BOTTOM]: cssVar(BORDER),
492
498
  [ALIGN_ITEMS]: 'center',
493
499
  [BACKDROP_FILTER]: 'blur(4px)',
@@ -2920,8 +2926,11 @@ const cancelInspectorIdleCallback = (id) =>
2920
2926
  globalThis.cancelIdleCallback?.(id) ?? clearTimeout(id);
2921
2927
 
2922
2928
  const {
2929
+ Children,
2930
+ Fragment,
2923
2931
  PureComponent,
2924
2932
  createContext,
2933
+ isValidElement,
2925
2934
  useCallback,
2926
2935
  useContext,
2927
2936
  useEffect,
@@ -3548,9 +3557,9 @@ const EditableThing = ({
3548
3557
  } else if (isArray(thing)) {
3549
3558
  setArrayThing(jsonString(thing));
3550
3559
  } else {
3551
- setStringThing(String(thing));
3552
- setNumberThing(Number(thing) || 0);
3553
- setBooleanThing(Boolean(thing));
3560
+ setStringThing(string(thing));
3561
+ setNumberThing(number(thing) || 0);
3562
+ setBooleanThing(boolean(thing));
3554
3563
  }
3555
3564
  }
3556
3565
  const handleThingChange = useCallback(
@@ -3618,7 +3627,7 @@ const EditableThing = ({
3618
3627
  onChange: useCallback(
3619
3628
  (event) =>
3620
3629
  handleThingChange(
3621
- String(event[CURRENT_TARGET][_VALUE]),
3630
+ string(event[CURRENT_TARGET][_VALUE]),
3622
3631
  setStringThing,
3623
3632
  ),
3624
3633
  [handleThingChange],
@@ -3634,7 +3643,7 @@ const EditableThing = ({
3634
3643
  onChange: useCallback(
3635
3644
  (event) =>
3636
3645
  handleThingChange(
3637
- Number(event[CURRENT_TARGET][_VALUE] || 0),
3646
+ number(event[CURRENT_TARGET][_VALUE] || 0),
3638
3647
  setNumberThing,
3639
3648
  ),
3640
3649
  [handleThingChange],
@@ -3650,7 +3659,7 @@ const EditableThing = ({
3650
3659
  onChange: useCallback(
3651
3660
  (event) =>
3652
3661
  handleThingChange(
3653
- Boolean(event[CURRENT_TARGET].checked),
3662
+ boolean(event[CURRENT_TARGET].checked),
3654
3663
  setBooleanThing,
3655
3664
  ),
3656
3665
  [handleThingChange],
@@ -3767,7 +3776,7 @@ const RelationshipInHtmlRow = ({
3767
3776
  extraRowCells(extraCellsBefore, rowProps),
3768
3777
  isFalse(idColumn)
3769
3778
  ? null
3770
- : /* @__PURE__ */ jsxs(Fragment, {
3779
+ : /* @__PURE__ */ jsxs(Fragment$1, {
3771
3780
  children: [
3772
3781
  /* @__PURE__ */ jsx('th', {
3773
3782
  title: localRowId,
@@ -3856,7 +3865,7 @@ const RelationshipInHtmlTable = ({
3856
3865
  extraHeaders(extraCellsBefore),
3857
3866
  isFalse(idColumn)
3858
3867
  ? null
3859
- : /* @__PURE__ */ jsxs(Fragment, {
3868
+ : /* @__PURE__ */ jsxs(Fragment$1, {
3860
3869
  children: [
3861
3870
  /* @__PURE__ */ jsxs('th', {
3862
3871
  children: [localTableId, '.Id'],
@@ -3973,10 +3982,10 @@ const SortedTablePaginator = ({
3973
3982
  [onChange, offset, limit],
3974
3983
  offset + limit < total,
3975
3984
  );
3976
- return /* @__PURE__ */ jsxs(Fragment, {
3985
+ return /* @__PURE__ */ jsxs(Fragment$1, {
3977
3986
  children: [
3978
3987
  total > limit &&
3979
- /* @__PURE__ */ jsxs(Fragment, {
3988
+ /* @__PURE__ */ jsxs(Fragment$1, {
3980
3989
  children: [
3981
3990
  /* @__PURE__ */ jsx('button', {
3982
3991
  className: 'previous',
@@ -4477,7 +4486,7 @@ const ConfirmableActions = ({actions, ...props}) => {
4477
4486
  }, [confirming, handleDone]);
4478
4487
  if (!isUndefined(confirming)) {
4479
4488
  const [, , Component] = actions[confirming];
4480
- return /* @__PURE__ */ jsxs(Fragment, {
4489
+ return /* @__PURE__ */ jsxs(Fragment$1, {
4481
4490
  children: [
4482
4491
  /* @__PURE__ */ jsx(Component, {onDone: handleDone, ...props}),
4483
4492
  /* @__PURE__ */ jsx('img', {
@@ -4531,7 +4540,7 @@ const NewId = ({onDone, suggestedId, has, set, prompt = 'New Id'}) => {
4531
4540
  setNewId(suggestedId);
4532
4541
  setPreviousSuggestedNewId(suggestedId);
4533
4542
  }
4534
- return /* @__PURE__ */ jsxs(Fragment, {
4543
+ return /* @__PURE__ */ jsxs(Fragment$1, {
4535
4544
  children: [
4536
4545
  prompt + ': ',
4537
4546
  /* @__PURE__ */ jsx('input', {
@@ -4564,7 +4573,7 @@ const Delete = ({onClick, prompt = 'Delete'}) => {
4564
4573
  document.addEventListener('keydown', handleKeyDown);
4565
4574
  return () => document.removeEventListener('keydown', handleKeyDown);
4566
4575
  }, [handleKeyDown]);
4567
- return /* @__PURE__ */ jsxs(Fragment, {
4576
+ return /* @__PURE__ */ jsxs(Fragment$1, {
4568
4577
  children: [
4569
4578
  prompt,
4570
4579
  '? ',
@@ -4745,7 +4754,7 @@ const CellActions = ({tableId, rowId, cellId, store}) =>
4745
4754
 
4746
4755
  const rowActions = [{label: '', component: RowActions}];
4747
4756
  const EditableCellViewWithActions = (props) =>
4748
- /* @__PURE__ */ jsxs(Fragment, {
4757
+ /* @__PURE__ */ jsxs(Fragment$1, {
4749
4758
  children: [
4750
4759
  /* @__PURE__ */ jsx(EditableCellView, {...props}),
4751
4760
  useHasCell(props.tableId, props.rowId, props.cellId, props.store) &&
@@ -5066,7 +5075,7 @@ const Header = ({s}) => {
5066
5075
  const handleClose = useSetValueCallback$1(OPEN_VALUE, () => false, [], s);
5067
5076
  const handleDock = useSetValueCallback$1(
5068
5077
  POSITION_VALUE,
5069
- (event) => Number(event[CURRENT_TARGET].dataset.id),
5078
+ (event) => number(event[CURRENT_TARGET].dataset.id),
5070
5079
  [],
5071
5080
  s,
5072
5081
  );
@@ -5132,7 +5141,7 @@ const Inspector = ({position = 'right', open = false, hue = 270}) => {
5132
5141
  await persister.startAutoSave();
5133
5142
  },
5134
5143
  );
5135
- return /* @__PURE__ */ jsxs(Fragment, {
5144
+ return /* @__PURE__ */ jsxs(Fragment$1, {
5136
5145
  children: [
5137
5146
  /* @__PURE__ */ jsxs('aside', {
5138
5147
  id: UNIQUE_ID,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import {Fragment, jsx, jsxs} from 'react/jsx-runtime';
2
+ import {Fragment as Fragment$1, jsx, jsxs} from 'react/jsx-runtime';
3
3
  import {
4
4
  CellView,
5
5
  ResultCellView,
@@ -79,6 +79,7 @@ const id = (key) => EMPTY_STRING + key;
79
79
  const strSplit = (str, separator = EMPTY_STRING, limit) =>
80
80
  str.split(separator, limit);
81
81
 
82
+ const math = Math;
82
83
  const getIfNotFunction = (predicate) => (value, then, otherwise) =>
83
84
  predicate(value)
84
85
  ? /* istanbul ignore next */
@@ -86,7 +87,9 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
86
87
  : then(value);
87
88
  const GLOBAL = globalThis;
88
89
  const WINDOW = GLOBAL.window;
89
- const math = Math;
90
+ const number = Number;
91
+ const string = String;
92
+ const boolean = Boolean;
90
93
  const mathMin = math.min;
91
94
  const mathFloor = math.floor;
92
95
  const isFiniteNumber = isFinite;
@@ -129,6 +132,7 @@ const tryCatch = async (action, then1, then2) => {
129
132
  };
130
133
 
131
134
  const arrayHas = (array, value) => array.includes(value);
135
+ const arrayIndexOf = (array, value) => array.indexOf(value);
132
136
  const arrayEvery = (array, cb) => array.every(cb);
133
137
  const arrayIsEqual = (array1, array2) =>
134
138
  size(array1) === size(array2) &&
@@ -252,7 +256,7 @@ const NO_PROVIDED_OBJECTS_MESSAGE =
252
256
  const INSPECTOR_ERROR_MESSAGE =
253
257
  'Inspector error: please see console for details.';
254
258
  const getInitialPosition = (position) => {
255
- const index = POSITIONS.indexOf(position);
259
+ const index = arrayIndexOf(POSITIONS, position);
256
260
  return index == -1 ? 1 : index;
257
261
  };
258
262
  const getUniqueId = (...args) => jsonStringWithMap(args);
@@ -360,6 +364,7 @@ const TEXT_OVERFLOW = 'text-overflow';
360
364
  const ALIGN_ITEMS = 'align-items';
361
365
  const BACKDROP_FILTER = 'backdrop-filter';
362
366
  const MARGIN_RIGHT = MARGIN + '-' + RIGHT;
367
+ const Z_INDEX = 'z-index';
363
368
  const FIXED = 'fixed';
364
369
  const REVERT = 'revert';
365
370
  const UNSET = 'unset';
@@ -383,8 +388,8 @@ const APP_STYLESHEET = arrayJoin(
383
388
  all: 'initial',
384
389
  [FONT_SIZE]: rem(0.75),
385
390
  [POSITION]: FIXED,
391
+ [Z_INDEX]: 999999,
386
392
  'font-family': 'inter,sans-serif',
387
- 'z-index': 999999,
388
393
  '--bg': oklch(20),
389
394
  '--bg2': oklch(15),
390
395
  '--bg3': oklch(25),
@@ -488,6 +493,7 @@ const APP_STYLESHEET = arrayJoin(
488
493
  [BACKGROUND]: oklch(30, '% 0.008 var(--hue) / .5'),
489
494
  [WIDTH]: 'calc(100% - .5rem)',
490
495
  [POSITION]: 'absolute',
496
+ [Z_INDEX]: 1,
491
497
  [BORDER + '-' + BOTTOM]: cssVar(BORDER),
492
498
  [ALIGN_ITEMS]: 'center',
493
499
  [BACKDROP_FILTER]: 'blur(4px)',
@@ -2920,8 +2926,11 @@ const cancelInspectorIdleCallback = (id) =>
2920
2926
  globalThis.cancelIdleCallback?.(id) ?? clearTimeout(id);
2921
2927
 
2922
2928
  const {
2929
+ Children,
2930
+ Fragment,
2923
2931
  PureComponent,
2924
2932
  createContext,
2933
+ isValidElement,
2925
2934
  useCallback,
2926
2935
  useContext,
2927
2936
  useEffect,
@@ -3548,9 +3557,9 @@ const EditableThing = ({
3548
3557
  } else if (isArray(thing)) {
3549
3558
  setArrayThing(jsonString(thing));
3550
3559
  } else {
3551
- setStringThing(String(thing));
3552
- setNumberThing(Number(thing) || 0);
3553
- setBooleanThing(Boolean(thing));
3560
+ setStringThing(string(thing));
3561
+ setNumberThing(number(thing) || 0);
3562
+ setBooleanThing(boolean(thing));
3554
3563
  }
3555
3564
  }
3556
3565
  const handleThingChange = useCallback(
@@ -3618,7 +3627,7 @@ const EditableThing = ({
3618
3627
  onChange: useCallback(
3619
3628
  (event) =>
3620
3629
  handleThingChange(
3621
- String(event[CURRENT_TARGET][_VALUE]),
3630
+ string(event[CURRENT_TARGET][_VALUE]),
3622
3631
  setStringThing,
3623
3632
  ),
3624
3633
  [handleThingChange],
@@ -3634,7 +3643,7 @@ const EditableThing = ({
3634
3643
  onChange: useCallback(
3635
3644
  (event) =>
3636
3645
  handleThingChange(
3637
- Number(event[CURRENT_TARGET][_VALUE] || 0),
3646
+ number(event[CURRENT_TARGET][_VALUE] || 0),
3638
3647
  setNumberThing,
3639
3648
  ),
3640
3649
  [handleThingChange],
@@ -3650,7 +3659,7 @@ const EditableThing = ({
3650
3659
  onChange: useCallback(
3651
3660
  (event) =>
3652
3661
  handleThingChange(
3653
- Boolean(event[CURRENT_TARGET].checked),
3662
+ boolean(event[CURRENT_TARGET].checked),
3654
3663
  setBooleanThing,
3655
3664
  ),
3656
3665
  [handleThingChange],
@@ -3767,7 +3776,7 @@ const RelationshipInHtmlRow = ({
3767
3776
  extraRowCells(extraCellsBefore, rowProps),
3768
3777
  isFalse(idColumn)
3769
3778
  ? null
3770
- : /* @__PURE__ */ jsxs(Fragment, {
3779
+ : /* @__PURE__ */ jsxs(Fragment$1, {
3771
3780
  children: [
3772
3781
  /* @__PURE__ */ jsx('th', {
3773
3782
  title: localRowId,
@@ -3856,7 +3865,7 @@ const RelationshipInHtmlTable = ({
3856
3865
  extraHeaders(extraCellsBefore),
3857
3866
  isFalse(idColumn)
3858
3867
  ? null
3859
- : /* @__PURE__ */ jsxs(Fragment, {
3868
+ : /* @__PURE__ */ jsxs(Fragment$1, {
3860
3869
  children: [
3861
3870
  /* @__PURE__ */ jsxs('th', {
3862
3871
  children: [localTableId, '.Id'],
@@ -3973,10 +3982,10 @@ const SortedTablePaginator = ({
3973
3982
  [onChange, offset, limit],
3974
3983
  offset + limit < total,
3975
3984
  );
3976
- return /* @__PURE__ */ jsxs(Fragment, {
3985
+ return /* @__PURE__ */ jsxs(Fragment$1, {
3977
3986
  children: [
3978
3987
  total > limit &&
3979
- /* @__PURE__ */ jsxs(Fragment, {
3988
+ /* @__PURE__ */ jsxs(Fragment$1, {
3980
3989
  children: [
3981
3990
  /* @__PURE__ */ jsx('button', {
3982
3991
  className: 'previous',
@@ -4477,7 +4486,7 @@ const ConfirmableActions = ({actions, ...props}) => {
4477
4486
  }, [confirming, handleDone]);
4478
4487
  if (!isUndefined(confirming)) {
4479
4488
  const [, , Component] = actions[confirming];
4480
- return /* @__PURE__ */ jsxs(Fragment, {
4489
+ return /* @__PURE__ */ jsxs(Fragment$1, {
4481
4490
  children: [
4482
4491
  /* @__PURE__ */ jsx(Component, {onDone: handleDone, ...props}),
4483
4492
  /* @__PURE__ */ jsx('img', {
@@ -4531,7 +4540,7 @@ const NewId = ({onDone, suggestedId, has, set, prompt = 'New Id'}) => {
4531
4540
  setNewId(suggestedId);
4532
4541
  setPreviousSuggestedNewId(suggestedId);
4533
4542
  }
4534
- return /* @__PURE__ */ jsxs(Fragment, {
4543
+ return /* @__PURE__ */ jsxs(Fragment$1, {
4535
4544
  children: [
4536
4545
  prompt + ': ',
4537
4546
  /* @__PURE__ */ jsx('input', {
@@ -4564,7 +4573,7 @@ const Delete = ({onClick, prompt = 'Delete'}) => {
4564
4573
  document.addEventListener('keydown', handleKeyDown);
4565
4574
  return () => document.removeEventListener('keydown', handleKeyDown);
4566
4575
  }, [handleKeyDown]);
4567
- return /* @__PURE__ */ jsxs(Fragment, {
4576
+ return /* @__PURE__ */ jsxs(Fragment$1, {
4568
4577
  children: [
4569
4578
  prompt,
4570
4579
  '? ',
@@ -4745,7 +4754,7 @@ const CellActions = ({tableId, rowId, cellId, store}) =>
4745
4754
 
4746
4755
  const rowActions = [{label: '', component: RowActions}];
4747
4756
  const EditableCellViewWithActions = (props) =>
4748
- /* @__PURE__ */ jsxs(Fragment, {
4757
+ /* @__PURE__ */ jsxs(Fragment$1, {
4749
4758
  children: [
4750
4759
  /* @__PURE__ */ jsx(EditableCellView, {...props}),
4751
4760
  useHasCell(props.tableId, props.rowId, props.cellId, props.store) &&
@@ -5066,7 +5075,7 @@ const Header = ({s}) => {
5066
5075
  const handleClose = useSetValueCallback$1(OPEN_VALUE, () => false, [], s);
5067
5076
  const handleDock = useSetValueCallback$1(
5068
5077
  POSITION_VALUE,
5069
- (event) => Number(event[CURRENT_TARGET].dataset.id),
5078
+ (event) => number(event[CURRENT_TARGET].dataset.id),
5070
5079
  [],
5071
5080
  s,
5072
5081
  );
@@ -5132,7 +5141,7 @@ const Inspector = ({position = 'right', open = false, hue = 270}) => {
5132
5141
  await persister.startAutoSave();
5133
5142
  },
5134
5143
  );
5135
- return /* @__PURE__ */ jsxs(Fragment, {
5144
+ return /* @__PURE__ */ jsxs(Fragment$1, {
5136
5145
  children: [
5137
5146
  /* @__PURE__ */ jsxs('aside', {
5138
5147
  id: UNIQUE_ID,
@@ -57,13 +57,16 @@ const EXTRA = 'extra';
57
57
  const strSplit = (str, separator = EMPTY_STRING, limit) =>
58
58
  str.split(separator, limit);
59
59
 
60
+ const math = Math;
60
61
  const getIfNotFunction = (predicate) => (value, then, otherwise) =>
61
62
  predicate(value)
62
63
  ? /* istanbul ignore next */
63
64
  otherwise?.()
64
65
  : then(value);
65
66
  const GLOBAL = globalThis;
66
- const math = Math;
67
+ const number = Number;
68
+ const string = String;
69
+ const boolean = Boolean;
67
70
  const mathMin = math.min;
68
71
  const isFiniteNumber = isFinite;
69
72
  const isNullish = (thing) => thing == null;
@@ -751,9 +754,9 @@ const EditableThing = (props) => {
751
754
  } else if (isArray(thing)) {
752
755
  setArrayThing(jsonString(thing));
753
756
  } else {
754
- setStringThing(String(thing));
755
- setNumberThing(Number(thing) || 0);
756
- setBooleanThing(Boolean(thing));
757
+ setStringThing(string(thing));
758
+ setNumberThing(number(thing) || 0);
759
+ setBooleanThing(boolean(thing));
757
760
  }
758
761
  }
759
762
  });
@@ -810,7 +813,7 @@ const EditableThing = (props) => {
810
813
  var _el$0 = _tmpl$7();
811
814
  _el$0.addEventListener('input', (event) =>
812
815
  handleThingChange(
813
- String(event[CURRENT_TARGET][_VALUE]),
816
+ string(event[CURRENT_TARGET][_VALUE]),
814
817
  setStringThing,
815
818
  ),
816
819
  );
@@ -821,7 +824,7 @@ const EditableThing = (props) => {
821
824
  var _el$1 = _tmpl$8();
822
825
  _el$1.addEventListener('input', (event) =>
823
826
  handleThingChange(
824
- Number(event[CURRENT_TARGET][_VALUE] || 0),
827
+ number(event[CURRENT_TARGET][_VALUE] || 0),
825
828
  setNumberThing,
826
829
  ),
827
830
  );
@@ -832,7 +835,7 @@ const EditableThing = (props) => {
832
835
  var _el$10 = _tmpl$9();
833
836
  _el$10.addEventListener('input', (event) =>
834
837
  handleThingChange(
835
- Boolean(event[CURRENT_TARGET].checked),
838
+ boolean(event[CURRENT_TARGET].checked),
836
839
  setBooleanThing,
837
840
  ),
838
841
  );
@@ -57,13 +57,16 @@ const EXTRA = 'extra';
57
57
  const strSplit = (str, separator = EMPTY_STRING, limit) =>
58
58
  str.split(separator, limit);
59
59
 
60
+ const math = Math;
60
61
  const getIfNotFunction = (predicate) => (value, then, otherwise) =>
61
62
  predicate(value)
62
63
  ? /* istanbul ignore next */
63
64
  otherwise?.()
64
65
  : then(value);
65
66
  const GLOBAL = globalThis;
66
- const math = Math;
67
+ const number = Number;
68
+ const string = String;
69
+ const boolean = Boolean;
67
70
  const mathMin = math.min;
68
71
  const isFiniteNumber = isFinite;
69
72
  const isNullish = (thing) => thing == null;
@@ -751,9 +754,9 @@ const EditableThing = (props) => {
751
754
  } else if (isArray(thing)) {
752
755
  setArrayThing(jsonString(thing));
753
756
  } else {
754
- setStringThing(String(thing));
755
- setNumberThing(Number(thing) || 0);
756
- setBooleanThing(Boolean(thing));
757
+ setStringThing(string(thing));
758
+ setNumberThing(number(thing) || 0);
759
+ setBooleanThing(boolean(thing));
757
760
  }
758
761
  }
759
762
  });
@@ -810,7 +813,7 @@ const EditableThing = (props) => {
810
813
  var _el$0 = _tmpl$7();
811
814
  _el$0.addEventListener('input', (event) =>
812
815
  handleThingChange(
813
- String(event[CURRENT_TARGET][_VALUE]),
816
+ string(event[CURRENT_TARGET][_VALUE]),
814
817
  setStringThing,
815
818
  ),
816
819
  );
@@ -821,7 +824,7 @@ const EditableThing = (props) => {
821
824
  var _el$1 = _tmpl$8();
822
825
  _el$1.addEventListener('input', (event) =>
823
826
  handleThingChange(
824
- Number(event[CURRENT_TARGET][_VALUE] || 0),
827
+ number(event[CURRENT_TARGET][_VALUE] || 0),
825
828
  setNumberThing,
826
829
  ),
827
830
  );
@@ -832,7 +835,7 @@ const EditableThing = (props) => {
832
835
  var _el$10 = _tmpl$9();
833
836
  _el$10.addEventListener('input', (event) =>
834
837
  handleThingChange(
835
- Boolean(event[CURRENT_TARGET].checked),
838
+ boolean(event[CURRENT_TARGET].checked),
836
839
  setBooleanThing,
837
840
  ),
838
841
  );
@@ -112,6 +112,7 @@ const id = (key) => EMPTY_STRING + key;
112
112
  const strSplit = (str, separator = EMPTY_STRING, limit) =>
113
113
  str.split(separator, limit);
114
114
 
115
+ const math = Math;
115
116
  const getIfNotFunction = (predicate) => (value, then, otherwise) =>
116
117
  predicate(value)
117
118
  ? /* istanbul ignore next */
@@ -119,7 +120,9 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
119
120
  : then(value);
120
121
  const GLOBAL = globalThis;
121
122
  const WINDOW = GLOBAL.window;
122
- const math = Math;
123
+ const number = Number;
124
+ const string = String;
125
+ const boolean = Boolean;
123
126
  const mathMin = math.min;
124
127
  const mathFloor = math.floor;
125
128
  const isFiniteNumber = isFinite;
@@ -162,6 +165,7 @@ const tryCatch = async (action, then1, then2) => {
162
165
  };
163
166
 
164
167
  const arrayHas = (array, value) => array.includes(value);
168
+ const arrayIndexOf = (array, value) => array.indexOf(value);
165
169
  const arrayEvery = (array, cb) => array.every(cb);
166
170
  const arrayIsEqual = (array1, array2) =>
167
171
  size(array1) === size(array2) &&
@@ -284,7 +288,7 @@ const NO_PROVIDED_OBJECTS_MESSAGE =
284
288
  const INSPECTOR_ERROR_MESSAGE =
285
289
  'Inspector error: please see console for details.';
286
290
  const getInitialPosition = (position) => {
287
- const index = POSITIONS.indexOf(position);
291
+ const index = arrayIndexOf(POSITIONS, position);
288
292
  return index == -1 ? 1 : index;
289
293
  };
290
294
  const getUniqueId = (...args) => jsonStringWithMap(args);
@@ -419,6 +423,7 @@ const TEXT_OVERFLOW = 'text-overflow';
419
423
  const ALIGN_ITEMS = 'align-items';
420
424
  const BACKDROP_FILTER = 'backdrop-filter';
421
425
  const MARGIN_RIGHT = MARGIN + '-' + RIGHT;
426
+ const Z_INDEX = 'z-index';
422
427
  const FIXED = 'fixed';
423
428
  const REVERT = 'revert';
424
429
  const UNSET = 'unset';
@@ -442,8 +447,8 @@ const APP_STYLESHEET = arrayJoin(
442
447
  all: 'initial',
443
448
  [FONT_SIZE]: rem(0.75),
444
449
  [POSITION]: FIXED,
450
+ [Z_INDEX]: 999999,
445
451
  'font-family': 'inter,sans-serif',
446
- 'z-index': 999999,
447
452
  '--bg': oklch(20),
448
453
  '--bg2': oklch(15),
449
454
  '--bg3': oklch(25),
@@ -547,6 +552,7 @@ const APP_STYLESHEET = arrayJoin(
547
552
  [BACKGROUND]: oklch(30, '% 0.008 var(--hue) / .5'),
548
553
  [WIDTH]: 'calc(100% - .5rem)',
549
554
  [POSITION]: 'absolute',
555
+ [Z_INDEX]: 1,
550
556
  [BORDER + '-' + BOTTOM]: cssVar(BORDER),
551
557
  [ALIGN_ITEMS]: 'center',
552
558
  [BACKDROP_FILTER]: 'blur(4px)',
@@ -3516,9 +3522,9 @@ const EditableThing = (props) => {
3516
3522
  } else if (isArray(thing)) {
3517
3523
  setArrayThing(jsonString(thing));
3518
3524
  } else {
3519
- setStringThing(String(thing));
3520
- setNumberThing(Number(thing) || 0);
3521
- setBooleanThing(Boolean(thing));
3525
+ setStringThing(string(thing));
3526
+ setNumberThing(number(thing) || 0);
3527
+ setBooleanThing(boolean(thing));
3522
3528
  }
3523
3529
  }
3524
3530
  });
@@ -3575,7 +3581,7 @@ const EditableThing = (props) => {
3575
3581
  var _el$0 = _tmpl$7$1();
3576
3582
  _el$0.addEventListener('input', (event) =>
3577
3583
  handleThingChange(
3578
- String(event[CURRENT_TARGET][_VALUE]),
3584
+ string(event[CURRENT_TARGET][_VALUE]),
3579
3585
  setStringThing,
3580
3586
  ),
3581
3587
  );
@@ -3586,7 +3592,7 @@ const EditableThing = (props) => {
3586
3592
  var _el$1 = _tmpl$8$1();
3587
3593
  _el$1.addEventListener('input', (event) =>
3588
3594
  handleThingChange(
3589
- Number(event[CURRENT_TARGET][_VALUE] || 0),
3595
+ number(event[CURRENT_TARGET][_VALUE] || 0),
3590
3596
  setNumberThing,
3591
3597
  ),
3592
3598
  );
@@ -3597,7 +3603,7 @@ const EditableThing = (props) => {
3597
3603
  var _el$10 = _tmpl$9$1();
3598
3604
  _el$10.addEventListener('input', (event) =>
3599
3605
  handleThingChange(
3600
- Boolean(event[CURRENT_TARGET].checked),
3606
+ boolean(event[CURRENT_TARGET].checked),
3601
3607
  setBooleanThing,
3602
3608
  ),
3603
3609
  );
@@ -5286,7 +5292,7 @@ const Header = (props) => {
5286
5292
  const handleClick = () => open('https://tinybase.org', '_blank');
5287
5293
  const handleClose = () => props.s.setValue(OPEN_VALUE, false);
5288
5294
  const handleDock = (event) =>
5289
- props.s.setValue(POSITION_VALUE, Number(event.currentTarget.dataset.id));
5295
+ props.s.setValue(POSITION_VALUE, number(event.currentTarget.dataset.id));
5290
5296
  return (() => {
5291
5297
  var _el$24 = _tmpl$1(),
5292
5298
  _el$25 = _el$24.firstChild,