@dxos/plugin-sheet 0.8.2-main.fbd8ed0 → 0.8.2-staging.7ac8446

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 (146) hide show
  1. package/dist/lib/browser/{SheetContainer-UV7RMPXS.mjs → SheetContainer-B3A5443Z.mjs} +88 -90
  2. package/dist/lib/browser/SheetContainer-B3A5443Z.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-TN7LTDHU.mjs → chunk-CHMPICA6.mjs} +75 -86
  4. package/dist/lib/browser/chunk-CHMPICA6.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-N2FOQHUH.mjs → chunk-ZOKEQL2K.mjs} +50 -51
  6. package/dist/lib/browser/chunk-ZOKEQL2K.mjs.map +7 -0
  7. package/dist/lib/browser/{compute-graph-registry-MBJKPAHX.mjs → compute-graph-registry-WEJLJJ6T.mjs} +2 -2
  8. package/dist/lib/browser/compute-graph-registry-WEJLJJ6T.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +8 -8
  10. package/dist/lib/browser/index.mjs.map +3 -3
  11. package/dist/lib/browser/{intent-resolver-DN7JXDAV.mjs → intent-resolver-6OUEM3IG.mjs} +2 -2
  12. package/dist/lib/browser/{markdown-57MKY5WB.mjs → markdown-DR4RDEEY.mjs} +2 -2
  13. package/dist/lib/browser/markdown-DR4RDEEY.mjs.map +7 -0
  14. package/dist/lib/browser/meta.json +1 -1
  15. package/dist/lib/browser/{react-surface-NQU63B63.mjs → react-surface-ECKBP3UZ.mjs} +3 -3
  16. package/dist/lib/browser/{thread-WU64QL2A.mjs → thread-76MK2FMV.mjs} +2 -2
  17. package/dist/lib/browser/types/index.mjs +1 -1
  18. package/dist/lib/node/{SheetContainer-GR2KDOAE.cjs → SheetContainer-LGRD3TTQ.cjs} +102 -106
  19. package/dist/lib/node/SheetContainer-LGRD3TTQ.cjs.map +7 -0
  20. package/dist/lib/node/{chunk-CN7OBGYV.cjs → chunk-AEH3L5QZ.cjs} +84 -95
  21. package/dist/lib/node/chunk-AEH3L5QZ.cjs.map +7 -0
  22. package/dist/lib/node/{chunk-HLSQVT3C.cjs → chunk-D4MOMCEU.cjs} +65 -66
  23. package/dist/lib/node/chunk-D4MOMCEU.cjs.map +7 -0
  24. package/dist/lib/node/{compute-graph-registry-EBBDN6ZX.cjs → compute-graph-registry-VVSRJUGS.cjs} +5 -5
  25. package/dist/lib/node/compute-graph-registry-VVSRJUGS.cjs.map +7 -0
  26. package/dist/lib/node/index.cjs +12 -12
  27. package/dist/lib/node/index.cjs.map +3 -3
  28. package/dist/lib/node/{intent-resolver-OPF56TAL.cjs → intent-resolver-ICHNDL6F.cjs} +9 -9
  29. package/dist/lib/node/{markdown-Q3RXYPHQ.cjs → markdown-E7OUIMZO.cjs} +5 -5
  30. package/dist/lib/node/markdown-E7OUIMZO.cjs.map +7 -0
  31. package/dist/lib/node/meta.json +1 -1
  32. package/dist/lib/node/{react-surface-7SAA5DX3.cjs → react-surface-6PBWE75L.cjs} +11 -11
  33. package/dist/lib/node/{thread-E7YPGR5T.cjs → thread-WP43BC4N.cjs} +7 -7
  34. package/dist/lib/node/types/index.cjs +29 -29
  35. package/dist/lib/node/types/index.cjs.map +1 -1
  36. package/dist/lib/node-esm/{SheetContainer-XW7B2AJI.mjs → SheetContainer-4FNTLG5R.mjs} +88 -90
  37. package/dist/lib/node-esm/SheetContainer-4FNTLG5R.mjs.map +7 -0
  38. package/dist/lib/node-esm/{chunk-LYZV4Q4C.mjs → chunk-6NB67Y6X.mjs} +50 -51
  39. package/dist/lib/node-esm/chunk-6NB67Y6X.mjs.map +7 -0
  40. package/dist/lib/node-esm/{chunk-3JJ7ETTJ.mjs → chunk-WQHYR4WD.mjs} +75 -86
  41. package/dist/lib/node-esm/chunk-WQHYR4WD.mjs.map +7 -0
  42. package/dist/lib/node-esm/{compute-graph-registry-TVG6RN2J.mjs → compute-graph-registry-PBQ52KH6.mjs} +2 -2
  43. package/dist/lib/node-esm/compute-graph-registry-PBQ52KH6.mjs.map +7 -0
  44. package/dist/lib/node-esm/index.mjs +8 -8
  45. package/dist/lib/node-esm/index.mjs.map +3 -3
  46. package/dist/lib/node-esm/{intent-resolver-7AN5CN4R.mjs → intent-resolver-2JNQCFCI.mjs} +2 -2
  47. package/dist/lib/node-esm/{markdown-ACHAWUOE.mjs → markdown-BPKS2TNG.mjs} +2 -2
  48. package/dist/lib/node-esm/markdown-BPKS2TNG.mjs.map +7 -0
  49. package/dist/lib/node-esm/meta.json +1 -1
  50. package/dist/lib/node-esm/{react-surface-BPNN7RSE.mjs → react-surface-UM2Y3ZWZ.mjs} +3 -3
  51. package/dist/lib/node-esm/{thread-ULESW6IX.mjs → thread-4NCPE5FK.mjs} +2 -2
  52. package/dist/lib/node-esm/types/index.mjs +1 -1
  53. package/dist/types/src/capabilities/compute-graph-registry.d.ts +2 -2
  54. package/dist/types/src/capabilities/compute-graph-registry.d.ts.map +1 -1
  55. package/dist/types/src/capabilities/index.d.ts +2 -2
  56. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  57. package/dist/types/src/capabilities/markdown.d.ts +2 -2
  58. package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
  59. package/dist/types/src/components/ComputeGraph/ComputeGraphContextProvider.d.ts.map +1 -1
  60. package/dist/types/src/components/GridSheet/GridSheet.d.ts.map +1 -1
  61. package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +1 -1
  62. package/dist/types/src/components/GridSheet/util.d.ts.map +1 -1
  63. package/dist/types/src/components/RangeList/RangeList.d.ts.map +1 -1
  64. package/dist/types/src/components/SheetContainer/SheetContainer.d.ts +2 -3
  65. package/dist/types/src/components/SheetContainer/SheetContainer.d.ts.map +1 -1
  66. package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts.map +1 -1
  67. package/dist/types/src/components/SheetContext/SheetContext.d.ts.map +1 -1
  68. package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts.map +1 -1
  69. package/dist/types/src/components/SheetToolbar/align.d.ts +1 -4
  70. package/dist/types/src/components/SheetToolbar/align.d.ts.map +1 -1
  71. package/dist/types/src/components/SheetToolbar/comment.d.ts +1 -3
  72. package/dist/types/src/components/SheetToolbar/comment.d.ts.map +1 -1
  73. package/dist/types/src/components/SheetToolbar/style.d.ts +1 -3
  74. package/dist/types/src/components/SheetToolbar/style.d.ts.map +1 -1
  75. package/dist/types/src/components/SheetToolbar/useToolbarAction.d.ts +8 -0
  76. package/dist/types/src/components/SheetToolbar/useToolbarAction.d.ts.map +1 -0
  77. package/dist/types/src/components/SheetToolbar/useToolbarState.d.ts +1 -1
  78. package/dist/types/src/components/SheetToolbar/useToolbarState.d.ts.map +1 -1
  79. package/dist/types/src/components/index.d.ts +6 -1
  80. package/dist/types/src/components/index.d.ts.map +1 -1
  81. package/dist/types/src/extensions/compute.d.ts.map +1 -1
  82. package/dist/types/src/extensions/editor/extension.d.ts.map +1 -1
  83. package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -1
  84. package/dist/types/src/model/testing.d.ts.map +1 -1
  85. package/dist/types/src/model/useSheetModel.d.ts.map +1 -1
  86. package/dist/types/src/testing/data.d.ts.map +1 -1
  87. package/dist/types/src/testing/testing.d.ts.map +1 -1
  88. package/dist/types/src/translations.d.ts +54 -2
  89. package/dist/types/src/translations.d.ts.map +1 -1
  90. package/dist/types/src/types/schema.d.ts +144 -239
  91. package/dist/types/src/types/schema.d.ts.map +1 -1
  92. package/dist/types/src/types/sheet-range-types.d.ts.map +1 -1
  93. package/dist/types/src/types/types.d.ts +36 -36
  94. package/dist/types/src/types/types.d.ts.map +1 -1
  95. package/dist/types/src/types/util.d.ts.map +1 -1
  96. package/dist/types/tsconfig.tsbuildinfo +1 -1
  97. package/package.json +47 -53
  98. package/src/capabilities/compute-graph-registry.ts +3 -3
  99. package/src/capabilities/markdown.ts +3 -3
  100. package/src/components/ComputeGraph/compute-graph.stories.tsx +4 -4
  101. package/src/components/FunctionEditor/FunctionEditor.tsx +1 -1
  102. package/src/components/GridSheet/GridSheet.stories.tsx +2 -5
  103. package/src/components/GridSheet/GridSheet.tsx +12 -18
  104. package/src/components/GridSheet/SheetCellEditor.stories.tsx +2 -2
  105. package/src/components/GridSheet/util.ts +2 -7
  106. package/src/components/RangeList/RangeList.tsx +2 -2
  107. package/src/components/SheetContainer/SheetContainer.stories.tsx +5 -1
  108. package/src/components/SheetContainer/SheetContainer.tsx +7 -4
  109. package/src/components/SheetToolbar/SheetToolbar.stories.tsx +1 -1
  110. package/src/components/SheetToolbar/SheetToolbar.tsx +8 -33
  111. package/src/components/SheetToolbar/align.ts +14 -44
  112. package/src/components/SheetToolbar/comment.ts +11 -39
  113. package/src/components/SheetToolbar/style.ts +12 -48
  114. package/src/components/SheetToolbar/useToolbarAction.ts +87 -0
  115. package/src/components/SheetToolbar/useToolbarState.ts +2 -2
  116. package/src/integrations/thread-ranges.ts +3 -2
  117. package/src/model/sheet-model.test.ts +1 -1
  118. package/src/sanity.test.ts +3 -3
  119. package/src/serializer.ts +2 -2
  120. package/src/types/schema.ts +19 -21
  121. package/src/types/types.ts +25 -25
  122. package/src/types/util.ts +2 -2
  123. package/dist/lib/browser/SheetContainer-UV7RMPXS.mjs.map +0 -7
  124. package/dist/lib/browser/chunk-N2FOQHUH.mjs.map +0 -7
  125. package/dist/lib/browser/chunk-TN7LTDHU.mjs.map +0 -7
  126. package/dist/lib/browser/compute-graph-registry-MBJKPAHX.mjs.map +0 -7
  127. package/dist/lib/browser/markdown-57MKY5WB.mjs.map +0 -7
  128. package/dist/lib/node/SheetContainer-GR2KDOAE.cjs.map +0 -7
  129. package/dist/lib/node/chunk-CN7OBGYV.cjs.map +0 -7
  130. package/dist/lib/node/chunk-HLSQVT3C.cjs.map +0 -7
  131. package/dist/lib/node/compute-graph-registry-EBBDN6ZX.cjs.map +0 -7
  132. package/dist/lib/node/markdown-Q3RXYPHQ.cjs.map +0 -7
  133. package/dist/lib/node-esm/SheetContainer-XW7B2AJI.mjs.map +0 -7
  134. package/dist/lib/node-esm/chunk-3JJ7ETTJ.mjs.map +0 -7
  135. package/dist/lib/node-esm/chunk-LYZV4Q4C.mjs.map +0 -7
  136. package/dist/lib/node-esm/compute-graph-registry-TVG6RN2J.mjs.map +0 -7
  137. package/dist/lib/node-esm/markdown-ACHAWUOE.mjs.map +0 -7
  138. /package/dist/lib/browser/{intent-resolver-DN7JXDAV.mjs.map → intent-resolver-6OUEM3IG.mjs.map} +0 -0
  139. /package/dist/lib/browser/{react-surface-NQU63B63.mjs.map → react-surface-ECKBP3UZ.mjs.map} +0 -0
  140. /package/dist/lib/browser/{thread-WU64QL2A.mjs.map → thread-76MK2FMV.mjs.map} +0 -0
  141. /package/dist/lib/node/{intent-resolver-OPF56TAL.cjs.map → intent-resolver-ICHNDL6F.cjs.map} +0 -0
  142. /package/dist/lib/node/{react-surface-7SAA5DX3.cjs.map → react-surface-6PBWE75L.cjs.map} +0 -0
  143. /package/dist/lib/node/{thread-E7YPGR5T.cjs.map → thread-WP43BC4N.cjs.map} +0 -0
  144. /package/dist/lib/node-esm/{intent-resolver-7AN5CN4R.mjs.map → intent-resolver-2JNQCFCI.mjs.map} +0 -0
  145. /package/dist/lib/node-esm/{react-surface-BPNN7RSE.mjs.map → react-surface-UM2Y3ZWZ.mjs.map} +0 -0
  146. /package/dist/lib/node-esm/{thread-ULESW6IX.mjs.map → thread-4NCPE5FK.mjs.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  completeCellRangeToThreadCursor,
5
5
  useComputeGraph,
6
6
  useSheetContext
7
- } from "./chunk-TN7LTDHU.mjs";
7
+ } from "./chunk-CHMPICA6.mjs";
8
8
  import "./chunk-AT5ZK6JD.mjs";
9
9
  import {
10
10
  alignKey,
@@ -12,7 +12,7 @@ import {
12
12
  mapFormulaIndicesToRefs,
13
13
  rangeFromIndex,
14
14
  rangeToIndex
15
- } from "./chunk-N2FOQHUH.mjs";
15
+ } from "./chunk-ZOKEQL2K.mjs";
16
16
  import {
17
17
  SHEET_PLUGIN
18
18
  } from "./chunk-D3G4UGEK.mjs";
@@ -40,7 +40,7 @@ var FunctionEditor = () => {
40
40
  }
41
41
  }
42
42
  return /* @__PURE__ */ React.createElement("div", {
43
- className: "flex shrink-0 justify-between items-center px-4 py-1 text-sm bg-toolbarSurface border-bs !border-separator"
43
+ className: "flex shrink-0 justify-between items-center px-4 py-1 text-sm attention-surface border-bs !border-separator"
44
44
  }, /* @__PURE__ */ React.createElement("div", {
45
45
  className: "flex gap-4 items-center"
46
46
  }, /* @__PURE__ */ React.createElement("div", {
@@ -59,9 +59,7 @@ var FunctionEditor = () => {
59
59
  };
60
60
 
61
61
  // packages/plugins/plugin-sheet/src/components/SheetToolbar/SheetToolbar.tsx
62
- import React2, { useCallback } from "react";
63
- import { createIntent, useIntentDispatcher } from "@dxos/app-framework";
64
- import { ThreadAction } from "@dxos/plugin-thread/types";
62
+ import React2, { useCallback as useCallback2 } from "react";
65
63
  import { createGapSeparator, MenuProvider, ToolbarMenu, useMenuActions } from "@dxos/react-ui-menu";
66
64
 
67
65
  // packages/plugins/plugin-sheet/src/components/SheetToolbar/align.ts
@@ -93,31 +91,11 @@ var createAlignGroupAction = (value) => createMenuItemGroup("align", {
93
91
  selectCardinality: "single",
94
92
  value: `${alignKey}--${value}`
95
93
  });
96
- var createAlignActions = (model, state, cursorFallbackRange) => Object.entries(aligns).map(([alignValue, icon]) => {
97
- return createMenuAction(`${alignKey}--${alignValue}`, () => {
98
- if (!cursorFallbackRange) {
99
- return;
100
- }
101
- const index = model.sheet.ranges?.findIndex((range) => range.key === alignKey && inRange(rangeFromIndex(model.sheet, range.range), cursorFallbackRange.from)) ?? -1;
102
- const nextRangeEntity = {
103
- range: rangeToIndex(model.sheet, cursorFallbackRange),
104
- key: alignKey,
105
- value: alignValue
106
- };
107
- if (index < 0) {
108
- model.sheet.ranges?.push(nextRangeEntity);
109
- state[alignKey] = nextRangeEntity.value;
110
- } else if (model.sheet.ranges[index].value === nextRangeEntity.value) {
111
- model.sheet.ranges?.splice(index, 1);
112
- state[alignKey] = void 0;
113
- } else {
114
- model.sheet.ranges?.splice(index, 1, nextRangeEntity);
115
- state[alignKey] = nextRangeEntity.value;
116
- }
117
- }, {
94
+ var createAlignActions = (value) => Object.entries(aligns).map(([alignValue, icon]) => {
95
+ return createMenuAction(`${alignKey}--${alignValue}`, {
118
96
  key: alignKey,
119
97
  value: alignValue,
120
- checked: state[alignKey] === alignValue,
98
+ checked: value === alignValue,
121
99
  label: [
122
100
  `range value ${alignValue} label`,
123
101
  {
@@ -128,9 +106,9 @@ var createAlignActions = (model, state, cursorFallbackRange) => Object.entries(a
128
106
  testId: `grid.toolbar.${alignKey}.${alignValue}`
129
107
  });
130
108
  });
131
- var createAlign = (model, state, cursorFallbackRange) => {
132
- const alignGroup = createAlignGroupAction(state[alignKey]);
133
- const alignActions = createAlignActions(model, state, cursorFallbackRange);
109
+ var createAlign = ({ [alignKey]: alignValue }) => {
110
+ const alignGroup = createAlignGroupAction(alignValue);
111
+ const alignActions = createAlignActions(alignValue);
134
112
  return {
135
113
  nodes: [
136
114
  alignGroup,
@@ -171,16 +149,7 @@ var useCommentState = (state) => {
171
149
  cursorFallbackRange
172
150
  ]);
173
151
  };
174
- var createCommentAction = (model, state, onComment, cursorFallbackRange) => createMenuAction2("comment", () => {
175
- if (!cursorFallbackRange) {
176
- return;
177
- }
178
- const cellContent = model.getCellText(cursorFallbackRange.from);
179
- if (!cellContent) {
180
- return;
181
- }
182
- onComment(cellContent, completeCellRangeToThreadCursor(cursorFallbackRange));
183
- }, {
152
+ var createCommentAction = (state) => createMenuAction2("comment", {
184
153
  key: commentKey,
185
154
  testId: "editor.toolbar.comment",
186
155
  icon: "ph--chat-text--regular",
@@ -192,9 +161,9 @@ var createCommentAction = (model, state, onComment, cursorFallbackRange) => crea
192
161
  ],
193
162
  disabled: state.commentEnabled !== "comment"
194
163
  });
195
- var createComment = (model, state, onComment, cursorFallbackRange) => ({
164
+ var createComment = (state) => ({
196
165
  nodes: [
197
- createCommentAction(model, state, onComment, cursorFallbackRange)
166
+ createCommentAction(state)
198
167
  ],
199
168
  edges: [
200
169
  {
@@ -234,27 +203,8 @@ var createStyleGroup = (state) => {
234
203
  value: Object.keys(styles).filter((key) => !!state[key]).map((styleValue) => `style--${styleValue}`)
235
204
  });
236
205
  };
237
- var createStyleActions = (model, state, cursorFallbackRange) => Object.entries(styles).map(([styleValue, icon]) => {
238
- return createMenuAction3(`style--${styleValue}`, () => {
239
- if (!cursorFallbackRange) {
240
- return;
241
- }
242
- const index = model.sheet.ranges?.findIndex((range) => range.key === "style" && inRange2(rangeFromIndex(model.sheet, range.range), cursorFallbackRange.from)) ?? -1;
243
- const nextRangeEntity = {
244
- range: rangeToIndex(model.sheet, cursorFallbackRange),
245
- key: "style",
246
- value: styleValue
247
- };
248
- if (model.sheet.ranges.filter(({ range, key: rangeKey }) => rangeKey === "style" && inRange2(rangeFromIndex(model.sheet, range), cursorFallbackRange.from)).some(({ value: rangeValue }) => rangeValue === styleValue)) {
249
- if (index >= 0) {
250
- model.sheet.ranges?.splice(index, 1);
251
- }
252
- state[nextRangeEntity.value] = false;
253
- } else {
254
- model.sheet.ranges?.push(nextRangeEntity);
255
- state[nextRangeEntity.value] = true;
256
- }
257
- }, {
206
+ var createStyleActions = (state) => Object.entries(styles).map(([styleValue, icon]) => {
207
+ return createMenuAction3(`style--${styleValue}`, {
258
208
  key: "style",
259
209
  value: styleValue,
260
210
  icon,
@@ -267,9 +217,9 @@ var createStyleActions = (model, state, cursorFallbackRange) => Object.entries(s
267
217
  checked: !!state[styleValue]
268
218
  });
269
219
  });
270
- var createStyle = (model, state, cursorFallbackRange) => {
220
+ var createStyle = (state) => {
271
221
  const styleGroupAction = createStyleGroup(state);
272
- const styleActions = createStyleActions(model, state, cursorFallbackRange);
222
+ const styleActions = createStyleActions(state);
273
223
  return {
274
224
  nodes: [
275
225
  styleGroupAction,
@@ -288,19 +238,78 @@ var createStyle = (model, state, cursorFallbackRange) => {
288
238
  };
289
239
  };
290
240
 
241
+ // packages/plugins/plugin-sheet/src/components/SheetToolbar/useToolbarAction.ts
242
+ import { useCallback } from "react";
243
+ import { createIntent, useIntentDispatcher } from "@dxos/app-framework";
244
+ import { inRange as inRange3 } from "@dxos/compute";
245
+ import { ThreadAction } from "@dxos/plugin-thread/types";
246
+ var useToolbarAction = (state) => {
247
+ const { model, cursorFallbackRange, cursor } = useSheetContext();
248
+ const { dispatchPromise: dispatch } = useIntentDispatcher();
249
+ return useCallback((action) => {
250
+ const { key, value } = action.properties;
251
+ if (cursorFallbackRange) {
252
+ const index = model.sheet.ranges?.findIndex((range) => range.key === key && inRange3(rangeFromIndex(model.sheet, range.range), cursorFallbackRange.from)) ?? -1;
253
+ const nextRangeEntity = {
254
+ range: rangeToIndex(model.sheet, cursorFallbackRange),
255
+ key,
256
+ value
257
+ };
258
+ switch (key) {
259
+ case "alignment":
260
+ if (index < 0) {
261
+ model.sheet.ranges?.push(nextRangeEntity);
262
+ state[alignKey] = value;
263
+ } else if (model.sheet.ranges[index].value === value) {
264
+ model.sheet.ranges?.splice(index, 1);
265
+ state[alignKey] = void 0;
266
+ } else {
267
+ model.sheet.ranges?.splice(index, 1, nextRangeEntity);
268
+ state[alignKey] = value;
269
+ }
270
+ break;
271
+ case "style":
272
+ if (model.sheet.ranges.filter(({ range, key: rangeKey }) => rangeKey === "style" && inRange3(rangeFromIndex(model.sheet, range), cursorFallbackRange.from)).some(({ value: rangeValue }) => rangeValue === value)) {
273
+ if (index >= 0) {
274
+ model.sheet.ranges?.splice(index, 1);
275
+ }
276
+ state[value] = false;
277
+ } else {
278
+ model.sheet.ranges?.push(nextRangeEntity);
279
+ state[value] = true;
280
+ }
281
+ break;
282
+ case "comment": {
283
+ const cellContent = model.getCellText(cursorFallbackRange.from);
284
+ void dispatch(createIntent(ThreadAction.Create, {
285
+ cursor: completeCellRangeToThreadCursor(cursorFallbackRange),
286
+ name: cellContent,
287
+ subject: model.sheet
288
+ }));
289
+ }
290
+ }
291
+ }
292
+ }, [
293
+ model.sheet,
294
+ cursorFallbackRange,
295
+ cursor,
296
+ dispatch
297
+ ]);
298
+ };
299
+
291
300
  // packages/plugins/plugin-sheet/src/components/SheetToolbar/useToolbarState.ts
292
301
  import { useMemo as useMemo2 } from "react";
293
- import { live } from "@dxos/live-object";
302
+ import { create } from "@dxos/live-object";
294
303
  var useToolbarState = (initialState = {}) => {
295
- return useMemo2(() => live(initialState), []);
304
+ return useMemo2(() => create(initialState), []);
296
305
  };
297
306
 
298
307
  // packages/plugins/plugin-sheet/src/components/SheetToolbar/SheetToolbar.tsx
299
- var createToolbarActions = (model, state, onComment, cursorFallbackRange) => {
300
- const align = createAlign(model, state, cursorFallbackRange);
301
- const style = createStyle(model, state, cursorFallbackRange);
308
+ var createToolbarActions = (state) => {
309
+ const align = createAlign(state);
310
+ const style = createStyle(state);
302
311
  const gap = createGapSeparator();
303
- const comment = createComment(model, state, onComment, cursorFallbackRange);
312
+ const comment = createComment(state);
304
313
  return {
305
314
  nodes: [
306
315
  ...align.nodes,
@@ -317,30 +326,19 @@ var createToolbarActions = (model, state, onComment, cursorFallbackRange) => {
317
326
  };
318
327
  };
319
328
  var SheetToolbar = ({ attendableId, classNames }) => {
320
- const { dispatchPromise: dispatch } = useIntentDispatcher();
321
- const { model, cursorFallbackRange } = useSheetContext();
322
329
  const state = useToolbarState({});
323
330
  useAlignState(state);
324
331
  useStyleState(state);
325
332
  useCommentState(state);
326
- const handleComment = useCallback((name, cursor) => dispatch(createIntent(ThreadAction.Create, {
327
- cursor,
328
- name,
329
- subject: model.sheet
330
- })), [
331
- model.sheet,
332
- dispatch
333
- ]);
334
- const actionsCreator = useCallback(() => createToolbarActions(model, state, handleComment, cursorFallbackRange), [
335
- model,
336
- state,
337
- handleComment,
338
- cursorFallbackRange
333
+ const actionsCreator = useCallback2(() => createToolbarActions(state), [
334
+ state
339
335
  ]);
340
336
  const menu = useMenuActions(actionsCreator);
337
+ const handleAction = useToolbarAction(state);
341
338
  return /* @__PURE__ */ React2.createElement(MenuProvider, {
342
339
  ...menu,
343
- attendableId
340
+ attendableId,
341
+ onAction: handleAction
344
342
  }, /* @__PURE__ */ React2.createElement(ToolbarMenu, {
345
343
  classNames
346
344
  }));
@@ -369,4 +367,4 @@ var SheetContainer_default = SheetContainer;
369
367
  export {
370
368
  SheetContainer_default as default
371
369
  };
372
- //# sourceMappingURL=SheetContainer-UV7RMPXS.mjs.map
370
+ //# sourceMappingURL=SheetContainer-B3A5443Z.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/SheetContainer/SheetContainer.tsx", "../../../src/components/FunctionEditor/FunctionEditor.tsx", "../../../src/components/SheetToolbar/SheetToolbar.tsx", "../../../src/components/SheetToolbar/align.ts", "../../../src/components/SheetToolbar/comment.ts", "../../../src/components/SheetToolbar/style.ts", "../../../src/components/SheetToolbar/useToolbarAction.ts", "../../../src/components/SheetToolbar/useToolbarState.ts", "../../../src/components/SheetContainer/index.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { fullyQualifiedId, type Space } from '@dxos/react-client/echo';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { type SheetType } from '../../types';\nimport { useComputeGraph } from '../ComputeGraph';\nimport { FunctionEditor } from '../FunctionEditor';\nimport { GridSheet } from '../GridSheet';\nimport { SheetProvider } from '../SheetContext';\nimport { SheetToolbar } from '../SheetToolbar';\n\nexport const SheetContainer = ({\n space,\n sheet,\n role,\n ignoreAttention,\n}: {\n space: Space;\n sheet: SheetType;\n role?: string;\n ignoreAttention?: boolean;\n}) => {\n const graph = useComputeGraph(space);\n\n return graph ? (\n <SheetProvider sheet={sheet} graph={graph} ignoreAttention={ignoreAttention}>\n <StackItem.Content toolbar statusbar {...(role === 'section' && { classNames: 'aspect-video' })}>\n <SheetToolbar attendableId={fullyQualifiedId(sheet)} />\n <GridSheet />\n <FunctionEditor />\n </StackItem.Content>\n </SheetProvider>\n ) : null;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { addressToA1Notation, isFormula, rangeToA1Notation } from '@dxos/compute';\nimport { Icon } from '@dxos/react-ui';\n\nimport { mapFormulaIndicesToRefs } from '../../types';\nimport { useSheetContext } from '../SheetContext';\n\nexport const FunctionEditor = () => {\n const { model, cursor, range } = useSheetContext();\n\n let value;\n let formula = false;\n if (cursor) {\n value = model.getCellValue(cursor);\n if (isFormula(value)) {\n value = model.graph.mapFunctionBindingFromId(mapFormulaIndicesToRefs(model.sheet, value));\n formula = true;\n } else if (value != null) {\n value = String(value);\n }\n }\n\n return (\n <div className='flex shrink-0 justify-between items-center px-4 py-1 text-sm attention-surface border-bs !border-separator'>\n <div className='flex gap-4 items-center'>\n <div className='flex w-16 items-center font-mono'>\n {(range && rangeToA1Notation(range)) || (cursor && addressToA1Notation(cursor))}\n </div>\n <div className='flex gap-2 items-center'>\n <Icon icon='ph--function--regular' classNames={['text-greenText', formula ? 'visible' : 'invisible']} />\n <span className='font-mono'>{value}</span>\n </div>\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type PropsWithChildren, useCallback } from 'react';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { createGapSeparator, MenuProvider, ToolbarMenu, useMenuActions } from '@dxos/react-ui-menu';\n\nimport { createAlign, useAlignState } from './align';\nimport { createComment, useCommentState } from './comment';\nimport { createStyle, useStyleState } from './style';\nimport { useToolbarAction } from './useToolbarAction';\nimport { type ToolbarState, useToolbarState } from './useToolbarState';\n\n//\n// Root\n//\n\nexport type SheetToolbarProps = ThemedClassName<PropsWithChildren<{ attendableId?: string }>>;\n\nconst createToolbarActions = (state: ToolbarState) => {\n const align = createAlign(state);\n const style = createStyle(state);\n const gap = createGapSeparator();\n const comment = createComment(state);\n return {\n nodes: [...align.nodes, ...style.nodes, ...gap.nodes, ...comment.nodes],\n edges: [...align.edges, ...style.edges, ...gap.edges, ...comment.edges],\n };\n};\n\nexport const SheetToolbar = ({ attendableId, classNames }: SheetToolbarProps) => {\n const state = useToolbarState({});\n useAlignState(state);\n useStyleState(state);\n useCommentState(state);\n\n const actionsCreator = useCallback(() => createToolbarActions(state), [state]);\n const menu = useMenuActions(actionsCreator);\n const handleAction = useToolbarAction(state);\n\n return (\n <MenuProvider {...menu} attendableId={attendableId} onAction={handleAction}>\n <ToolbarMenu classNames={classNames} />\n </MenuProvider>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect } from 'react';\n\nimport { inRange } from '@dxos/compute';\nimport { createMenuAction, createMenuItemGroup, type ToolbarMenuActionGroupProperties } from '@dxos/react-ui-menu';\n\nimport { SHEET_PLUGIN } from '../../meta';\nimport { type AlignKey, alignKey, type AlignValue, rangeFromIndex } from '../../types';\nimport { useSheetContext } from '../SheetContext';\n\nexport type AlignAction = { key: AlignKey; value: AlignValue };\n\nexport type AlignState = { [alignKey]: AlignValue | undefined };\n\nconst aligns: Record<AlignValue, string> = {\n start: 'ph--text-align-left--regular',\n center: 'ph--text-align-center--regular',\n end: 'ph--text-align-right--regular',\n};\n\nexport const useAlignState = (state: Partial<AlignState>) => {\n const { cursor, model } = useSheetContext();\n useEffect(() => {\n // TODO(thure): Can this O(n) call be memoized?\n state[alignKey] = (\n cursor\n ? model.sheet.ranges?.findLast(\n ({ range, key }) => key === alignKey && inRange(rangeFromIndex(model.sheet, range), cursor),\n )?.value\n : undefined\n ) as AlignValue | undefined;\n }, [cursor, model.sheet]);\n};\n\nconst createAlignGroupAction = (value?: AlignValue) =>\n createMenuItemGroup('align', {\n label: ['align label', { ns: SHEET_PLUGIN }],\n variant: 'toggleGroup',\n selectCardinality: 'single',\n value: `${alignKey}--${value}`,\n } as ToolbarMenuActionGroupProperties);\n\nconst createAlignActions = (value?: AlignValue) =>\n Object.entries(aligns).map(([alignValue, icon]) => {\n return createMenuAction<AlignAction>(`${alignKey}--${alignValue}`, {\n key: alignKey,\n value: alignValue as AlignValue,\n checked: value === alignValue,\n label: [`range value ${alignValue} label`, { ns: SHEET_PLUGIN }],\n icon,\n testId: `grid.toolbar.${alignKey}.${alignValue}`,\n });\n });\n\nexport const createAlign = ({ [alignKey]: alignValue }: Partial<AlignState>) => {\n const alignGroup = createAlignGroupAction(alignValue);\n const alignActions = createAlignActions(alignValue);\n return {\n nodes: [alignGroup, ...alignActions],\n edges: [\n { source: 'root', target: 'align' },\n ...alignActions.map(({ id }) => ({ source: alignGroup.id, target: id })),\n ],\n };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useMemo } from 'react';\n\nimport { RefArray } from '@dxos/live-object';\nimport { createMenuAction } from '@dxos/react-ui-menu';\n\nimport { SHEET_PLUGIN } from '../../meta';\nimport { commentKey, type CommentKey, type CommentValue, rangeToIndex } from '../../types';\nimport { useSheetContext } from '../SheetContext';\n\nexport type CommentAction = { key: CommentKey; value: CommentValue; cellContent?: string };\n\nexport type CommentState = { commentEnabled: 'comment' | 'no cursor' | 'selection overlaps existing comment' };\n\nexport const useCommentState = (state: Partial<CommentState>) => {\n const { cursorFallbackRange, model } = useSheetContext();\n\n // TODO(thure): Can this O(n) call be memoized?\n const overlapsCommentAnchor = useMemo(\n () =>\n RefArray.targets(model.sheet.threads ?? [])\n .filter((thread) => thread.status !== 'resolved')\n .some((thread) => {\n if (!cursorFallbackRange) {\n return false;\n }\n return rangeToIndex(model.sheet, cursorFallbackRange) === thread.anchor;\n }),\n [cursorFallbackRange, model.sheet],\n );\n\n useEffect(() => {\n state.commentEnabled = !cursorFallbackRange\n ? 'no cursor'\n : overlapsCommentAnchor\n ? 'selection overlaps existing comment'\n : 'comment';\n }, [overlapsCommentAnchor, cursorFallbackRange]);\n};\n\nconst createCommentAction = (state: Partial<CommentState>) =>\n createMenuAction<Pick<CommentAction, 'key'>>('comment', {\n key: commentKey,\n testId: 'editor.toolbar.comment',\n icon: 'ph--chat-text--regular',\n label: [`${state.commentEnabled} label`, { ns: SHEET_PLUGIN }],\n disabled: state.commentEnabled !== 'comment',\n });\n\nexport const createComment = (state: Partial<CommentState>) => ({\n nodes: [createCommentAction(state)],\n edges: [{ source: 'root', target: 'comment' }],\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect } from 'react';\n\nimport { inRange } from '@dxos/compute';\nimport { createMenuAction, createMenuItemGroup, type ToolbarMenuActionGroupProperties } from '@dxos/react-ui-menu';\n\nimport { SHEET_PLUGIN } from '../../meta';\nimport { rangeFromIndex, type StyleKey, type StyleValue } from '../../types';\nimport { useSheetContext } from '../SheetContext';\n\nexport type StyleState = Partial<Record<StyleValue, boolean>>;\n\nexport type StyleAction = { key: StyleKey; value: StyleValue };\n\nconst styles: Record<StyleValue, string> = {\n highlight: 'ph--highlighter--regular',\n softwrap: 'ph--paragraph--regular',\n};\n\nexport const useStyleState = (state: StyleState) => {\n const { cursorFallbackRange, model } = useSheetContext();\n\n useEffect(() => {\n state.highlight = false;\n state.softwrap = false;\n if (cursorFallbackRange && model.sheet.ranges) {\n model.sheet.ranges\n .filter(\n ({ range, key }) => key === 'style' && inRange(rangeFromIndex(model.sheet, range), cursorFallbackRange.from),\n )\n .forEach(({ value }) => {\n state[value as StyleValue] = true;\n });\n }\n }, [cursorFallbackRange, model.sheet]);\n};\n\nconst createStyleGroup = (state: StyleState) => {\n return createMenuItemGroup('style', {\n variant: 'toggleGroup',\n selectCardinality: 'multiple',\n value: Object.keys(styles)\n .filter((key) => !!state[key as StyleValue])\n .map((styleValue) => `style--${styleValue}`),\n } as ToolbarMenuActionGroupProperties);\n};\n\nconst createStyleActions = (state: StyleState) =>\n Object.entries(styles).map(([styleValue, icon]) => {\n return createMenuAction<StyleAction>(`style--${styleValue}`, {\n key: 'style',\n value: styleValue as StyleValue,\n icon,\n label: [`range value ${styleValue} label`, { ns: SHEET_PLUGIN }],\n checked: !!state[styleValue as StyleValue],\n });\n });\n\nexport const createStyle = (state: StyleState) => {\n const styleGroupAction = createStyleGroup(state);\n const styleActions = createStyleActions(state);\n return {\n nodes: [styleGroupAction, ...styleActions],\n edges: [\n { source: 'root', target: 'style' },\n ...styleActions.map(({ id }) => ({ source: styleGroupAction.id, target: id })),\n ],\n };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useCallback } from 'react';\n\nimport { createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { inRange } from '@dxos/compute';\nimport { ThreadAction } from '@dxos/plugin-thread/types';\nimport type { MenuAction, MenuActionHandler } from '@dxos/react-ui-menu';\n\nimport { type AlignAction } from './align';\nimport { type CommentAction } from './comment';\nimport { type StyleAction } from './style';\nimport { type ToolbarState } from './useToolbarState';\nimport { completeCellRangeToThreadCursor } from '../../integrations';\nimport { alignKey, rangeFromIndex, rangeToIndex } from '../../types';\nimport { useSheetContext } from '../SheetContext';\n\nexport type ToolbarAction = StyleAction | AlignAction | CommentAction;\n\nexport const useToolbarAction = (state: ToolbarState) => {\n const { model, cursorFallbackRange, cursor } = useSheetContext();\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n // TODO(Zan): Externalize the toolbar action handler. E.g., Toolbar/keys should both fire events.\n return useCallback(\n (action: MenuAction<ToolbarAction>) => {\n const { key, value } = action.properties;\n if (cursorFallbackRange) {\n const index =\n model.sheet.ranges?.findIndex(\n (range) => range.key === key && inRange(rangeFromIndex(model.sheet, range.range), cursorFallbackRange.from),\n ) ?? -1;\n const nextRangeEntity = {\n range: rangeToIndex(model.sheet, cursorFallbackRange),\n key,\n value,\n };\n switch (key) {\n case 'alignment':\n if (index < 0) {\n model.sheet.ranges?.push(nextRangeEntity);\n state[alignKey] = value;\n } else if (model.sheet.ranges![index].value === value) {\n model.sheet.ranges?.splice(index, 1);\n state[alignKey] = undefined;\n } else {\n model.sheet.ranges?.splice(index, 1, nextRangeEntity);\n state[alignKey] = value;\n }\n break;\n case 'style':\n if (\n model.sheet.ranges\n .filter(\n ({ range, key: rangeKey }) =>\n rangeKey === 'style' && inRange(rangeFromIndex(model.sheet, range), cursorFallbackRange.from),\n )\n .some(({ value: rangeValue }) => rangeValue === value)\n ) {\n // this value should be unset\n if (index >= 0) {\n model.sheet.ranges?.splice(index, 1);\n }\n state[value] = false;\n } else {\n model.sheet.ranges?.push(nextRangeEntity);\n state[value] = true;\n }\n break;\n case 'comment': {\n const cellContent = model.getCellText(cursorFallbackRange.from);\n void dispatch(\n createIntent(ThreadAction.Create, {\n cursor: completeCellRangeToThreadCursor(cursorFallbackRange),\n name: cellContent,\n subject: model.sheet,\n }),\n );\n }\n }\n }\n },\n [model.sheet, cursorFallbackRange, cursor, dispatch],\n ) as MenuActionHandler;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { create } from '@dxos/live-object';\n\nimport { type AlignState } from './align';\nimport { type CommentState } from './comment';\nimport { type StyleState } from './style';\n\nexport type ToolbarState = Partial<StyleState & AlignState & CommentState>;\n\nexport const useToolbarState = (initialState: ToolbarState = {}) => {\n return useMemo(() => create<ToolbarState>(initialState), []);\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { SheetContainer } from './SheetContainer';\n\nexport default SheetContainer;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAIA,OAAOA,YAAW;AAElB,SAASC,wBAAoC;AAC7C,SAASC,iBAAiB;;;ACH1B,OAAOC,WAAW;AAElB,SAASC,qBAAqBC,WAAWC,yBAAyB;AAClE,SAASC,YAAY;AAKd,IAAMC,iBAAiB,MAAA;AAC5B,QAAM,EAAEC,OAAOC,QAAQC,MAAK,IAAKC,gBAAAA;AAEjC,MAAIC;AACJ,MAAIC,UAAU;AACd,MAAIJ,QAAQ;AACVG,YAAQJ,MAAMM,aAAaL,MAAAA;AAC3B,QAAIM,UAAUH,KAAAA,GAAQ;AACpBA,cAAQJ,MAAMQ,MAAMC,yBAAyBC,wBAAwBV,MAAMW,OAAOP,KAAAA,CAAAA;AAClFC,gBAAU;IACZ,WAAWD,SAAS,M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C,iBAAiBd,KAAAA;MAC7C,gBAAAK,OAAA,cAACU,WAAAA,IAAAA,GACD,gBAAAV,OAAA,cAACW,gBAAAA,IAAAA,CAAAA,CAAAA,IAGH;AACN;;;AQhCA,IAAA,yBAAeC;",
6
+ "names": ["React", "fullyQualifiedId", "StackItem", "React", "addressToA1Notation", "isFormula", "rangeToA1Notation", "Icon", "FunctionEditor", "model", "cursor", "range", "useSheetContext", "value", "formula", "getCellValue", "isFormula", "graph", "mapFunctionBindingFromId", "mapFormulaIndicesToRefs", "sheet", "String", "div", "className", "rangeToA1Notation", "addressToA1Notation", "Icon", "icon", "classNames", "span", "React", "useCallback", "createGapSeparator", "MenuProvider", "ToolbarMenu", "useMenuActions", "useEffect", "inRange", "createMenuAction", "createMenuItemGroup", "aligns", "start", "center", "end", "useAlignState", "state", "cursor", "model", "useSheetContext", "useEffect", "alignKey", "sheet", "ranges", "findLast", "range", "key", "inRange", "rangeFromIndex", "value", "undefined", "createAlignGroupAction", "createMenuItemGroup", "label", "ns", "SHEET_PLUGIN", "variant", "selectCardinality", "createAlignActions", "Object", "entries", "map", "alignValue", "icon", "createMenuAction", "checked", "testId", "createAlign", "alignGroup", "alignActions", "nodes", "edges", "source", "target", "id", "useEffect", "useMemo", "RefArray", "createMenuAction", "useCommentState", "state", "cursorFallbackRange", "model", "useSheetContext", "overlapsCommentAnchor", "useMemo", "RefArray", "targets", "sheet", "threads", "filter", "thread", "status", "some", "rangeToIndex", "anchor", "useEffect", "commentEnabled", "createCommentAction", "createMenuAction", "key", "commentKey", "testId", "icon", "label", "ns", "SHEET_PLUGIN", "disabled", "createComment", "nodes", "edges", "source", "target", "useEffect", "inRange", "createMenuAction", "createMenuItemGroup", "styles", "highlight", "softwrap", "useStyleState", "state", "cursorFallbackRange", "model", "useSheetContext", "useEffect", "sheet", "ranges", "filter", "range", "key", "inRange", "rangeFromIndex", "from", "forEach", "value", "createStyleGroup", "createMenuItemGroup", "variant", "selectCardinality", "Object", "keys", "map", "styleValue", "createStyleActions", "entries", "icon", "createMenuAction", "label", "ns", "SHEET_PLUGIN", "checked", "createStyle", "styleGroupAction", "styleActions", "nodes", "edges", "source", "target", "id", "useCallback", "createIntent", "useIntentDispatcher", "inRange", "ThreadAction", "useToolbarAction", "state", "model", "cursorFallbackRange", "cursor", "useSheetContext", "dispatchPromise", "dispatch", "useIntentDispatcher", "useCallback", "action", "key", "value", "properties", "index", "sheet", "ranges", "findIndex", "range", "inRange", "rangeFromIndex", "from", "nextRangeEntity", "rangeToIndex", "push", "alignKey", "splice", "undefined", "filter", "rangeKey", "some", "rangeValue", "cellContent", "getCellText", "createIntent", "ThreadAction", "Create", "completeCellRangeToThreadCursor", "name", "subject", "useMemo", "create", "useToolbarState", "initialState", "useMemo", "create", "createToolbarActions", "state", "align", "createAlign", "style", "createStyle", "gap", "createGapSeparator", "comment", "createComment", "nodes", "edges", "SheetToolbar", "attendableId", "classNames", "useToolbarState", "useAlignState", "useStyleState", "useCommentState", "actionsCreator", "useCallback", "menu", "useMenuActions", "handleAction", "useToolbarAction", "React", "MenuProvider", "onAction", "ToolbarMenu", "SheetContainer", "space", "sheet", "role", "ignoreAttention", "graph", "useComputeGraph", "React", "SheetProvider", "StackItem", "Content", "toolbar", "statusbar", "classNames", "SheetToolbar", "attendableId", "fullyQualifiedId", "GridSheet", "FunctionEditor", "SheetContainer"]
7
+ }
@@ -10,7 +10,7 @@ import {
10
10
  cellClassNameForRange,
11
11
  rangeFromIndex,
12
12
  useSheetModel
13
- } from "./chunk-N2FOQHUH.mjs";
13
+ } from "./chunk-ZOKEQL2K.mjs";
14
14
  import {
15
15
  SHEET_PLUGIN
16
16
  } from "./chunk-D3G4UGEK.mjs";
@@ -43,9 +43,9 @@ var useComputeGraph = (space) => {
43
43
  };
44
44
 
45
45
  // packages/plugins/plugin-sheet/src/components/RangeList/RangeList.tsx
46
- import { Schema } from "effect";
47
46
  import React2, { useCallback } from "react";
48
47
  import { rangeToA1Notation } from "@dxos/compute";
48
+ import { S } from "@dxos/echo-schema";
49
49
  import { useTranslation } from "@dxos/react-ui";
50
50
  import { List } from "@dxos/react-ui-list";
51
51
  import { ghostHover } from "@dxos/react-ui-theme";
@@ -63,7 +63,7 @@ var RangeList = ({ sheet }) => {
63
63
  className: "p-2 text-sm font-semibold"
64
64
  }, t("range list heading")), /* @__PURE__ */ React2.createElement(List.Root, {
65
65
  items: sheet.ranges,
66
- isItem: Schema.is(Range)
66
+ isItem: S.is(Range)
67
67
  }, ({ items: ranges }) => ranges.map((range, i) => /* @__PURE__ */ React2.createElement(List.Item, {
68
68
  key: i,
69
69
  item: range,
@@ -89,10 +89,9 @@ import { lazy } from "react";
89
89
  import React4, { useCallback as useCallback4, useMemo as useMemo2, useRef, useState as useState3 } from "react";
90
90
  import { createIntent as createIntent2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
91
91
  import { rangeToA1Notation as rangeToA1Notation2 } from "@dxos/compute";
92
- import { defaultColSize, defaultRowSize } from "@dxos/lit-grid";
93
92
  import { DropdownMenu, Icon, useTranslation as useTranslation2 } from "@dxos/react-ui";
94
93
  import { useAttention } from "@dxos/react-ui-attention";
95
- import { closestCell, editorKeys, parseCellIndex, Grid as Grid2, GridCellEditor } from "@dxos/react-ui-grid";
94
+ import { closestCell, defaultSizeRow, editorKeys, Grid as Grid2, GridCellEditor, parseCellIndex } from "@dxos/react-ui-grid";
96
95
 
97
96
  // packages/plugins/plugin-sheet/src/components/GridSheet/util.ts
98
97
  import { useEffect as useEffect2, useState } from "react";
@@ -103,11 +102,12 @@ import { colToA1Notation, rowToA1Notation, commentedClassName } from "@dxos/reac
103
102
  import { mx } from "@dxos/react-ui-theme";
104
103
 
105
104
  // packages/plugins/plugin-sheet/src/integrations/thread-ranges.ts
106
- import { Schema as Schema2, pipe } from "effect";
105
+ import { pipe } from "effect";
107
106
  import { useCallback as useCallback2, useEffect, useMemo } from "react";
108
107
  import { createIntent, createResolver, LayoutAction, useIntentResolver, useIntentDispatcher, chain } from "@dxos/app-framework";
109
108
  import { debounce } from "@dxos/async";
110
109
  import { inRange } from "@dxos/compute";
110
+ import { S as S2 } from "@dxos/echo-schema";
111
111
  import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from "@dxos/plugin-deck/types";
112
112
  import { ThreadAction } from "@dxos/plugin-thread/types";
113
113
  import { fullyQualifiedId } from "@dxos/react-client/echo";
@@ -138,7 +138,7 @@ var useUpdateFocusedCellOnThreadSelection = (grid) => {
138
138
  intent: LayoutAction.ScrollIntoView,
139
139
  position: "hoist",
140
140
  filter: (data) => {
141
- if (!Schema2.is(LayoutAction.ScrollIntoView.fields.input)(data)) {
141
+ if (!S2.is(LayoutAction.ScrollIntoView.fields.input)(data)) {
142
142
  return false;
143
143
  }
144
144
  return data.subject === fullyQualifiedId(model.sheet) && !!data.options?.cursor;
@@ -280,12 +280,12 @@ var gridCellGetter = (model) => {
280
280
  };
281
281
  var rowLabelCell = (row) => ({
282
282
  value: rowToA1Notation(row),
283
- className: "!bg-toolbarSurface text-subdued text-end pie-1",
283
+ className: "text-end pie-1 text-subdued",
284
284
  resizeHandle: "row"
285
285
  });
286
286
  var colLabelCell = (col) => ({
287
287
  value: colToA1Notation(col),
288
- className: "!bg-toolbarSurface text-subdued",
288
+ className: "text-subdued",
289
289
  resizeHandle: "col"
290
290
  });
291
291
  var cellGetter = (model) => {
@@ -294,13 +294,6 @@ var cellGetter = (model) => {
294
294
  switch (plane) {
295
295
  case "grid":
296
296
  return getGridCells(nextBounds);
297
- case "fixedStartStart": {
298
- return {
299
- "0,0": {
300
- className: "!bg-toolbarSurface"
301
- }
302
- };
303
- }
304
297
  case "frozenColsStart":
305
298
  return [
306
299
  ...Array(nextBounds.end.row - nextBounds.start.row)
@@ -475,23 +468,23 @@ var frozen = {
475
468
  frozenColsStart: 1,
476
469
  frozenRowsStart: 1
477
470
  };
478
- var sheetColDefault = {
479
- frozenColsStart: {
480
- size: 48,
471
+ var sheetRowDefault = {
472
+ frozenRowsStart: {
473
+ size: defaultSizeRow,
481
474
  readonly: true
482
475
  },
483
476
  grid: {
484
- size: defaultColSize,
477
+ size: defaultSizeRow,
485
478
  resizeable: true
486
479
  }
487
480
  };
488
- var sheetRowDefault = {
489
- frozenRowsStart: {
490
- size: defaultRowSize,
481
+ var sheetColDefault = {
482
+ frozenColsStart: {
483
+ size: 48,
491
484
  readonly: true
492
485
  },
493
486
  grid: {
494
- size: defaultRowSize,
487
+ size: 180,
495
488
  resizeable: true
496
489
  }
497
490
  };
@@ -748,70 +741,66 @@ var GridSheet = () => {
748
741
  ]);
749
742
  useUpdateFocusedCellOnThreadSelection(dxGrid);
750
743
  useSelectThreadOnCellFocus();
751
- return (
752
- // TODO(thure): Why are Table’s and Sheet’s editor boxes off by 1px?
753
- /* @__PURE__ */ React4.createElement("div", {
754
- role: "none",
755
- className: "relative min-bs-0 [&_.cm-editor]:!border-lb [&_.cm-editor]:!border-transparent "
756
- }, /* @__PURE__ */ React4.createElement(GridCellEditor, {
757
- getCellContent,
758
- extension,
759
- onBlur: handleBlur
760
- }), /* @__PURE__ */ React4.createElement(Grid2.Content, {
761
- initialCells,
762
- limitColumns: DEFAULT_COLS,
763
- limitRows: DEFAULT_ROWS,
764
- columns,
765
- rows,
766
- // TODO(burdon): `col` vs. `column`?
767
- columnDefault: sheetColDefault,
768
- rowDefault: sheetRowDefault,
769
- frozen,
770
- onAxisResize: handleAxisResize,
771
- onSelect: handleSelect,
772
- onFocus: handleFocus,
773
- onWheelCapture: handleWheel,
774
- onKeyDown: handleKeyDown,
775
- onContextMenu: handleContextMenu,
776
- onClick: handleClick,
777
- overscroll: "trap",
778
- className: "[--dx-grid-base:var(--baseSurface)] [&_.dx-grid]:border-bs [&_.dx-grid]:border-be [&_.dx-grid]:absolute [&_.dx-grid]:inset-0 [&_.dx-grid]:border-separator",
779
- activeRefs,
780
- ref: setDxGrid
781
- }), /* @__PURE__ */ React4.createElement(DropdownMenu.Root, {
782
- modal: false,
783
- open: !!contextMenuOpen,
784
- onOpenChange: (nextOpen) => setContextMenuOpen(nextOpen ? inertPosition : null)
785
- }, /* @__PURE__ */ React4.createElement(DropdownMenu.VirtualTrigger, {
786
- virtualRef: contextMenuAnchorRef
787
- }), /* @__PURE__ */ React4.createElement(DropdownMenu.Content, {
788
- side: contextMenuAxis === "col" ? "bottom" : "right",
789
- sideOffset: 4,
790
- collisionPadding: 8
791
- }, /* @__PURE__ */ React4.createElement(DropdownMenu.Viewport, null, /* @__PURE__ */ React4.createElement(DropdownMenu.Item, {
792
- onClick: () => handleAxisMenuAction("insert-before"),
793
- "data-testid": `grid.${contextMenuAxis}.insert-before`
794
- }, /* @__PURE__ */ React4.createElement(Icon, {
795
- size: 5,
796
- icon: contextMenuAxis === "col" ? "ph--columns-plus-left--regular" : "ph--rows-plus-top--regular"
797
- }), /* @__PURE__ */ React4.createElement("span", null, t(`add ${contextMenuAxis} before label`))), /* @__PURE__ */ React4.createElement(DropdownMenu.Item, {
798
- onClick: () => handleAxisMenuAction("insert-after"),
799
- "data-testid": `grid.${contextMenuAxis}.insert-after`
800
- }, /* @__PURE__ */ React4.createElement(Icon, {
801
- size: 5,
802
- icon: contextMenuAxis === "col" ? "ph--columns-plus-right--regular" : "ph--rows-plus-bottom--regular"
803
- }), /* @__PURE__ */ React4.createElement("span", null, t(`add ${contextMenuAxis} after label`))), /* @__PURE__ */ React4.createElement(DropdownMenu.Item, {
804
- onClick: () => handleAxisMenuAction("drop"),
805
- "data-testid": `grid.${contextMenuAxis}.drop`
806
- }, /* @__PURE__ */ React4.createElement(Icon, {
807
- size: 5,
808
- icon: "ph--backspace--regular"
809
- }), /* @__PURE__ */ React4.createElement("span", null, t(`delete ${contextMenuAxis} label`)))), /* @__PURE__ */ React4.createElement(DropdownMenu.Arrow, null))))
810
- );
744
+ return /* @__PURE__ */ React4.createElement("div", {
745
+ role: "none",
746
+ className: "relative min-bs-0"
747
+ }, /* @__PURE__ */ React4.createElement(GridCellEditor, {
748
+ getCellContent,
749
+ extension,
750
+ onBlur: handleBlur
751
+ }), /* @__PURE__ */ React4.createElement(Grid2.Content, {
752
+ initialCells,
753
+ limitColumns: DEFAULT_COLS,
754
+ limitRows: DEFAULT_ROWS,
755
+ columns,
756
+ rows,
757
+ onAxisResize: handleAxisResize,
758
+ onSelect: handleSelect,
759
+ rowDefault: sheetRowDefault,
760
+ columnDefault: sheetColDefault,
761
+ frozen,
762
+ onFocus: handleFocus,
763
+ onWheelCapture: handleWheel,
764
+ onKeyDown: handleKeyDown,
765
+ onContextMenu: handleContextMenu,
766
+ onClick: handleClick,
767
+ overscroll: "trap",
768
+ className: "[--dx-grid-base:var(--surface-bg)] [&_.dx-grid]:border-bs [&_.dx-grid]:absolute [&_.dx-grid]:inset-0 [&_.dx-grid]:border-separator",
769
+ activeRefs,
770
+ ref: setDxGrid
771
+ }), /* @__PURE__ */ React4.createElement(DropdownMenu.Root, {
772
+ modal: false,
773
+ open: !!contextMenuOpen,
774
+ onOpenChange: (nextOpen) => setContextMenuOpen(nextOpen ? inertPosition : null)
775
+ }, /* @__PURE__ */ React4.createElement(DropdownMenu.VirtualTrigger, {
776
+ virtualRef: contextMenuAnchorRef
777
+ }), /* @__PURE__ */ React4.createElement(DropdownMenu.Content, {
778
+ side: contextMenuAxis === "col" ? "bottom" : "right",
779
+ sideOffset: 4,
780
+ collisionPadding: 8
781
+ }, /* @__PURE__ */ React4.createElement(DropdownMenu.Viewport, null, /* @__PURE__ */ React4.createElement(DropdownMenu.Item, {
782
+ onClick: () => handleAxisMenuAction("insert-before"),
783
+ "data-testid": `grid.${contextMenuAxis}.insert-before`
784
+ }, /* @__PURE__ */ React4.createElement(Icon, {
785
+ size: 5,
786
+ icon: contextMenuAxis === "col" ? "ph--columns-plus-left--regular" : "ph--rows-plus-top--regular"
787
+ }), /* @__PURE__ */ React4.createElement("span", null, t(`add ${contextMenuAxis} before label`))), /* @__PURE__ */ React4.createElement(DropdownMenu.Item, {
788
+ onClick: () => handleAxisMenuAction("insert-after"),
789
+ "data-testid": `grid.${contextMenuAxis}.insert-after`
790
+ }, /* @__PURE__ */ React4.createElement(Icon, {
791
+ size: 5,
792
+ icon: contextMenuAxis === "col" ? "ph--columns-plus-right--regular" : "ph--rows-plus-bottom--regular"
793
+ }), /* @__PURE__ */ React4.createElement("span", null, t(`add ${contextMenuAxis} after label`))), /* @__PURE__ */ React4.createElement(DropdownMenu.Item, {
794
+ onClick: () => handleAxisMenuAction("drop"),
795
+ "data-testid": `grid.${contextMenuAxis}.drop`
796
+ }, /* @__PURE__ */ React4.createElement(Icon, {
797
+ size: 5,
798
+ icon: "ph--backspace--regular"
799
+ }), /* @__PURE__ */ React4.createElement("span", null, t(`delete ${contextMenuAxis} label`)))), /* @__PURE__ */ React4.createElement(DropdownMenu.Arrow, null))));
811
800
  };
812
801
 
813
802
  // packages/plugins/plugin-sheet/src/components/index.ts
814
- var SheetContainer = lazy(() => import("./SheetContainer-UV7RMPXS.mjs"));
803
+ var SheetContainer = lazy(() => import("./SheetContainer-B3A5443Z.mjs"));
815
804
 
816
805
  export {
817
806
  ComputeGraphContextProvider,
@@ -823,4 +812,4 @@ export {
823
812
  RangeList,
824
813
  SheetContainer
825
814
  };
826
- //# sourceMappingURL=chunk-TN7LTDHU.mjs.map
815
+ //# sourceMappingURL=chunk-CHMPICA6.mjs.map