@dxos/plugin-sheet 0.6.12-main.f9d0246 → 0.6.12-staging.e11e696
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.
- package/dist/lib/browser/{SheetContainer-VISF3VUB.mjs → SheetContainer-LG77O4RM.mjs} +11 -10
- package/dist/lib/browser/SheetContainer-LG77O4RM.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ZLJ2GRE2.mjs → chunk-CHQAW4F4.mjs} +55 -33
- package/dist/lib/browser/chunk-CHQAW4F4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-Z2XOOC2R.mjs → chunk-GSV5QNLD.mjs} +183 -159
- package/dist/lib/browser/chunk-GSV5QNLD.mjs.map +7 -0
- package/dist/lib/browser/graph-M4IQ76QX.mjs +33 -0
- package/dist/lib/browser/index.mjs +37 -15
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/{SheetContainer-2MEALQWW.cjs → SheetContainer-OZ7DHH4L.cjs} +18 -17
- package/dist/lib/node/SheetContainer-OZ7DHH4L.cjs.map +7 -0
- package/dist/lib/node/{chunk-6DQABRGJ.cjs → chunk-5FTFZL5W.cjs} +57 -35
- package/dist/lib/node/chunk-5FTFZL5W.cjs.map +7 -0
- package/dist/lib/node/{chunk-P5QYYEHQ.cjs → chunk-5XPK2V4A.cjs} +186 -158
- package/dist/lib/node/chunk-5XPK2V4A.cjs.map +7 -0
- package/dist/lib/node/graph-Q3N2X26H.cjs +55 -0
- package/dist/lib/node/graph-Q3N2X26H.cjs.map +7 -0
- package/dist/lib/node/index.cjs +38 -18
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/{SheetContainer-RPSUSXWS.mjs → SheetContainer-4XS2G25Z.mjs} +11 -10
- package/dist/lib/node-esm/SheetContainer-4XS2G25Z.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-4MM7THJW.mjs → chunk-5WPZCXNS.mjs} +183 -159
- package/dist/lib/node-esm/chunk-5WPZCXNS.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-5RLTCIE2.mjs → chunk-KK3XL37M.mjs} +55 -33
- package/dist/lib/node-esm/chunk-KK3XL37M.mjs.map +7 -0
- package/dist/lib/node-esm/graph-SMPUMOV2.mjs +34 -0
- package/dist/lib/node-esm/index.mjs +37 -15
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/SheetPlugin.d.ts.map +1 -1
- package/dist/types/src/components/CellEditor/CellEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/CellEditor/extension.d.ts.map +1 -1
- package/dist/types/src/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/types/src/components/Sheet/Sheet.stories.d.ts.map +1 -1
- package/dist/types/src/components/SheetContainer.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/extensions/compute.d.ts +2 -5
- package/dist/types/src/extensions/compute.d.ts.map +1 -1
- package/dist/types/src/extensions/compute.stories.d.ts.map +1 -1
- package/dist/types/src/graph/compute-graph-registry.d.ts +34 -0
- package/dist/types/src/graph/compute-graph-registry.d.ts.map +1 -0
- package/dist/types/src/graph/compute-graph.d.ts +13 -33
- package/dist/types/src/graph/compute-graph.d.ts.map +1 -1
- package/dist/types/src/graph/compute-node.d.ts.map +1 -1
- package/dist/types/src/graph/{async-function.d.ts → functions/async-function.d.ts} +6 -3
- package/dist/types/src/graph/functions/async-function.d.ts.map +1 -0
- package/dist/types/src/graph/functions/edge-function.d.ts +21 -0
- package/dist/types/src/graph/functions/edge-function.d.ts.map +1 -0
- package/dist/types/src/graph/functions/function-defs.d.ts.map +1 -0
- package/dist/types/src/graph/functions/index.d.ts +4 -0
- package/dist/types/src/graph/functions/index.d.ts.map +1 -0
- package/dist/types/src/graph/index.d.ts +2 -1
- package/dist/types/src/graph/index.d.ts.map +1 -1
- package/dist/types/src/graph/testing/index.d.ts +2 -1
- package/dist/types/src/graph/testing/index.d.ts.map +1 -1
- package/dist/types/src/graph/testing/test-builder.d.ts +15 -0
- package/dist/types/src/graph/testing/test-builder.d.ts.map +1 -0
- package/dist/types/src/graph/testing/test-plugin.d.ts +36 -0
- package/dist/types/src/graph/testing/test-plugin.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeGraph.d.ts.map +1 -1
- package/dist/types/src/model/sheet-model.d.ts.map +1 -1
- package/dist/types/src/model/sheet-model.test.d.ts +2 -0
- package/dist/types/src/model/sheet-model.test.d.ts.map +1 -0
- package/package.json +40 -39
- package/src/SheetPlugin.tsx +12 -10
- package/src/components/CellEditor/CellEditor.stories.tsx +1 -2
- package/src/components/CellEditor/extension.test.ts +0 -1
- package/src/components/CellEditor/extension.ts +4 -3
- package/src/components/Sheet/Sheet.stories.tsx +2 -2
- package/src/components/Sheet/Sheet.tsx +30 -14
- package/src/components/SheetContainer.tsx +11 -13
- package/src/extensions/compute.stories.tsx +9 -11
- package/src/extensions/compute.ts +66 -50
- package/src/graph/compute-graph-registry.ts +90 -0
- package/src/graph/compute-graph.stories.tsx +2 -2
- package/src/graph/compute-graph.test.ts +31 -71
- package/src/graph/compute-graph.ts +45 -116
- package/src/graph/compute-node.ts +1 -0
- package/src/graph/{async-function.ts → functions/async-function.ts} +10 -9
- package/src/graph/{edge-function.ts → functions/edge-function.ts} +13 -11
- package/src/graph/functions/index.ts +7 -0
- package/src/graph/hyperformula.test.ts +1 -2
- package/src/graph/index.ts +2 -1
- package/src/graph/testing/index.ts +2 -1
- package/src/graph/testing/test-builder.ts +54 -0
- package/src/graph/testing/{custom-function.ts → test-plugin.ts} +38 -12
- package/src/hooks/useComputeGraph.ts +8 -1
- package/src/model/sheet-model.test.ts +59 -0
- package/src/model/sheet-model.ts +4 -2
- package/dist/lib/browser/SheetContainer-VISF3VUB.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z2XOOC2R.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZLJ2GRE2.mjs.map +0 -7
- package/dist/lib/browser/graph-4XFKIHRL.mjs +0 -21
- package/dist/lib/node/SheetContainer-2MEALQWW.cjs.map +0 -7
- package/dist/lib/node/chunk-6DQABRGJ.cjs.map +0 -7
- package/dist/lib/node/chunk-P5QYYEHQ.cjs.map +0 -7
- package/dist/lib/node/graph-2LRDUXBZ.cjs +0 -43
- package/dist/lib/node/graph-2LRDUXBZ.cjs.map +0 -7
- package/dist/lib/node-esm/SheetContainer-RPSUSXWS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4MM7THJW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5RLTCIE2.mjs.map +0 -7
- package/dist/lib/node-esm/graph-WG5EKOMO.mjs +0 -22
- package/dist/types/src/graph/async-function.d.ts.map +0 -1
- package/dist/types/src/graph/edge-function.d.ts +0 -20
- package/dist/types/src/graph/edge-function.d.ts.map +0 -1
- package/dist/types/src/graph/function-defs.d.ts.map +0 -1
- package/dist/types/src/graph/testing/custom-function.d.ts +0 -23
- package/dist/types/src/graph/testing/custom-function.d.ts.map +0 -1
- /package/dist/lib/browser/{graph-4XFKIHRL.mjs.map → graph-M4IQ76QX.mjs.map} +0 -0
- /package/dist/lib/node-esm/{graph-WG5EKOMO.mjs.map → graph-SMPUMOV2.mjs.map} +0 -0
- /package/dist/types/src/graph/{function-defs.d.ts → functions/function-defs.d.ts} +0 -0
- /package/src/graph/{function-defs.ts → functions/function-defs.ts} +0 -0
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_5FTFZL5W_exports = {};
|
|
30
|
+
__export(chunk_5FTFZL5W_exports, {
|
|
31
31
|
ComputeGraphContextProvider: () => ComputeGraphContextProvider,
|
|
32
32
|
Sheet: () => Sheet,
|
|
33
33
|
SheetContainer: () => SheetContainer,
|
|
@@ -37,10 +37,10 @@ __export(chunk_6DQABRGJ_exports, {
|
|
|
37
37
|
useComputeGraph: () => useComputeGraph,
|
|
38
38
|
useSheetContext: () => useSheetContext
|
|
39
39
|
});
|
|
40
|
-
module.exports = __toCommonJS(
|
|
40
|
+
module.exports = __toCommonJS(chunk_5FTFZL5W_exports);
|
|
41
41
|
var import_chunk_AOP42UAA = require("./chunk-AOP42UAA.cjs");
|
|
42
42
|
var import_chunk_BNARJ5GM = require("./chunk-BNARJ5GM.cjs");
|
|
43
|
-
var
|
|
43
|
+
var import_chunk_5XPK2V4A = require("./chunk-5XPK2V4A.cjs");
|
|
44
44
|
var import_core = require("@dnd-kit/core");
|
|
45
45
|
var import_modifiers = require("@dnd-kit/modifiers");
|
|
46
46
|
var import_utilities = require("@dnd-kit/utilities");
|
|
@@ -70,6 +70,7 @@ var import_react8 = __toESM(require("react"));
|
|
|
70
70
|
var import_react9 = require("react");
|
|
71
71
|
var import_async2 = require("@dxos/async");
|
|
72
72
|
var import_context = require("@dxos/context");
|
|
73
|
+
var import_echo_schema3 = require("@dxos/echo-schema");
|
|
73
74
|
var import_invariant3 = require("@dxos/invariant");
|
|
74
75
|
var import_keys = require("@dxos/keys");
|
|
75
76
|
var import_log2 = require("@dxos/log");
|
|
@@ -87,10 +88,10 @@ var import_react_ui2 = require("@dxos/react-ui");
|
|
|
87
88
|
var import_react_ui_editor = require("@dxos/react-ui-editor");
|
|
88
89
|
var import_autocomplete = require("@codemirror/autocomplete");
|
|
89
90
|
var import_language = require("@codemirror/language");
|
|
90
|
-
var import_state = require("@codemirror/state");
|
|
91
91
|
var import_view2 = require("@codemirror/view");
|
|
92
92
|
var import_highlight = require("@lezer/highlight");
|
|
93
93
|
var import_codemirror_lang_spreadsheet = require("codemirror-lang-spreadsheet");
|
|
94
|
+
var import_state = require("@dxos/react-ui-editor/state");
|
|
94
95
|
var import_react_ui_theme2 = require("@dxos/react-ui-theme");
|
|
95
96
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-sheet/src/defs/types.ts";
|
|
96
97
|
var DEFAULT_ROWS = 50;
|
|
@@ -578,10 +579,16 @@ var ComputeGraphContextProvider = ({ registry, children }) => {
|
|
|
578
579
|
}
|
|
579
580
|
}, children);
|
|
580
581
|
};
|
|
581
|
-
var SheetContainer = import_react7.default.lazy(() => import("./SheetContainer-
|
|
582
|
+
var SheetContainer = import_react7.default.lazy(() => import("./SheetContainer-OZ7DHH4L.cjs"));
|
|
582
583
|
var useComputeGraph = (space) => {
|
|
583
584
|
const { registry } = (0, import_react6.useContext)(ComputeGraphContext) ?? (0, import_debug.raise)(new Error("Missing ComputeGraphContext"));
|
|
584
|
-
const [graph] = (0, import_react_hooks.useAsyncState)(async () =>
|
|
585
|
+
const [graph] = (0, import_react_hooks.useAsyncState)(async () => {
|
|
586
|
+
if (space) {
|
|
587
|
+
const graph2 = registry.getOrCreateGraph(space);
|
|
588
|
+
await graph2.open();
|
|
589
|
+
return graph2;
|
|
590
|
+
}
|
|
591
|
+
}, [
|
|
585
592
|
space,
|
|
586
593
|
registry
|
|
587
594
|
]);
|
|
@@ -754,12 +761,16 @@ var SheetModel = class extends import_context.Resource {
|
|
|
754
761
|
id: this.id
|
|
755
762
|
}, {
|
|
756
763
|
F: __dxlog_file2,
|
|
757
|
-
L:
|
|
764
|
+
L: 104,
|
|
758
765
|
S: this,
|
|
759
766
|
C: (f, a) => f(...a)
|
|
760
767
|
});
|
|
761
768
|
initialize(this._sheet);
|
|
762
|
-
this._node =
|
|
769
|
+
this._node = this._graph.getOrCreateNode((0, import_chunk_5XPK2V4A.createSheetName)({
|
|
770
|
+
type: (0, import_echo_schema3.getTypename)(this._sheet),
|
|
771
|
+
id: this._sheet.id
|
|
772
|
+
}));
|
|
773
|
+
await this._node.open();
|
|
763
774
|
const unsubscribe = this._node.update.on((event) => this.update.emit(event));
|
|
764
775
|
this._ctx.onDispose(unsubscribe);
|
|
765
776
|
this.reset();
|
|
@@ -772,7 +783,7 @@ var SheetModel = class extends import_context.Resource {
|
|
|
772
783
|
reset() {
|
|
773
784
|
(0, import_invariant3.invariant)(this._node, void 0, {
|
|
774
785
|
F: __dxlog_file2,
|
|
775
|
-
L:
|
|
786
|
+
L: 124,
|
|
776
787
|
S: this,
|
|
777
788
|
A: [
|
|
778
789
|
"this._node",
|
|
@@ -783,7 +794,7 @@ var SheetModel = class extends import_context.Resource {
|
|
|
783
794
|
Object.entries(this._sheet.cells).forEach(([key, { value }]) => {
|
|
784
795
|
(0, import_invariant3.invariant)(this._node, void 0, {
|
|
785
796
|
F: __dxlog_file2,
|
|
786
|
-
L:
|
|
797
|
+
L: 127,
|
|
787
798
|
S: this,
|
|
788
799
|
A: [
|
|
789
800
|
"this._node",
|
|
@@ -829,7 +840,7 @@ var SheetModel = class extends import_context.Resource {
|
|
|
829
840
|
clear(range) {
|
|
830
841
|
(0, import_invariant3.invariant)(this._node, void 0, {
|
|
831
842
|
F: __dxlog_file2,
|
|
832
|
-
L:
|
|
843
|
+
L: 169,
|
|
833
844
|
S: this,
|
|
834
845
|
A: [
|
|
835
846
|
"this._node",
|
|
@@ -847,7 +858,7 @@ var SheetModel = class extends import_context.Resource {
|
|
|
847
858
|
cut(range) {
|
|
848
859
|
(0, import_invariant3.invariant)(this._node, void 0, {
|
|
849
860
|
F: __dxlog_file2,
|
|
850
|
-
L:
|
|
861
|
+
L: 180,
|
|
851
862
|
S: this,
|
|
852
863
|
A: [
|
|
853
864
|
"this._node",
|
|
@@ -863,7 +874,7 @@ var SheetModel = class extends import_context.Resource {
|
|
|
863
874
|
copy(range) {
|
|
864
875
|
(0, import_invariant3.invariant)(this._node, void 0, {
|
|
865
876
|
F: __dxlog_file2,
|
|
866
|
-
L:
|
|
877
|
+
L: 189,
|
|
867
878
|
S: this,
|
|
868
879
|
A: [
|
|
869
880
|
"this._node",
|
|
@@ -875,7 +886,7 @@ var SheetModel = class extends import_context.Resource {
|
|
|
875
886
|
paste(cell) {
|
|
876
887
|
(0, import_invariant3.invariant)(this._node, void 0, {
|
|
877
888
|
F: __dxlog_file2,
|
|
878
|
-
L:
|
|
889
|
+
L: 194,
|
|
879
890
|
S: this,
|
|
880
891
|
A: [
|
|
881
892
|
"this._node",
|
|
@@ -902,7 +913,7 @@ var SheetModel = class extends import_context.Resource {
|
|
|
902
913
|
undo() {
|
|
903
914
|
(0, import_invariant3.invariant)(this._node, void 0, {
|
|
904
915
|
F: __dxlog_file2,
|
|
905
|
-
L:
|
|
916
|
+
L: 209,
|
|
906
917
|
S: this,
|
|
907
918
|
A: [
|
|
908
919
|
"this._node",
|
|
@@ -916,7 +927,7 @@ var SheetModel = class extends import_context.Resource {
|
|
|
916
927
|
redo() {
|
|
917
928
|
(0, import_invariant3.invariant)(this._node, void 0, {
|
|
918
929
|
F: __dxlog_file2,
|
|
919
|
-
L:
|
|
930
|
+
L: 217,
|
|
920
931
|
S: this,
|
|
921
932
|
A: [
|
|
922
933
|
"this._node",
|
|
@@ -960,7 +971,7 @@ var SheetModel = class extends import_context.Resource {
|
|
|
960
971
|
getValue(cell) {
|
|
961
972
|
(0, import_invariant3.invariant)(this._node, void 0, {
|
|
962
973
|
F: __dxlog_file2,
|
|
963
|
-
L:
|
|
974
|
+
L: 260,
|
|
964
975
|
S: this,
|
|
965
976
|
A: [
|
|
966
977
|
"this._node",
|
|
@@ -979,7 +990,7 @@ var SheetModel = class extends import_context.Resource {
|
|
|
979
990
|
getValueType(cell) {
|
|
980
991
|
(0, import_invariant3.invariant)(this._node, void 0, {
|
|
981
992
|
F: __dxlog_file2,
|
|
982
|
-
L:
|
|
993
|
+
L: 273,
|
|
983
994
|
S: this,
|
|
984
995
|
A: [
|
|
985
996
|
"this._node",
|
|
@@ -996,7 +1007,7 @@ var SheetModel = class extends import_context.Resource {
|
|
|
996
1007
|
setValue(cell, value) {
|
|
997
1008
|
(0, import_invariant3.invariant)(this._node, void 0, {
|
|
998
1009
|
F: __dxlog_file2,
|
|
999
|
-
L:
|
|
1010
|
+
L: 283,
|
|
1000
1011
|
S: this,
|
|
1001
1012
|
A: [
|
|
1002
1013
|
"this._node",
|
|
@@ -1093,7 +1104,7 @@ var SheetModel = class extends import_context.Resource {
|
|
|
1093
1104
|
mapFormulaRefsToIndices(formula) {
|
|
1094
1105
|
(0, import_invariant3.invariant)(formula.charAt(0) === "=", void 0, {
|
|
1095
1106
|
F: __dxlog_file2,
|
|
1096
|
-
L:
|
|
1107
|
+
L: 372,
|
|
1097
1108
|
S: this,
|
|
1098
1109
|
A: [
|
|
1099
1110
|
"formula.charAt(0) === '='",
|
|
@@ -1110,7 +1121,7 @@ var SheetModel = class extends import_context.Resource {
|
|
|
1110
1121
|
mapFormulaIndicesToRefs(formula) {
|
|
1111
1122
|
(0, import_invariant3.invariant)(formula.charAt(0) === "=", void 0, {
|
|
1112
1123
|
F: __dxlog_file2,
|
|
1113
|
-
L:
|
|
1124
|
+
L: 382,
|
|
1114
1125
|
S: this,
|
|
1115
1126
|
A: [
|
|
1116
1127
|
"formula.charAt(0) === '='",
|
|
@@ -1136,7 +1147,7 @@ var SheetModel = class extends import_context.Resource {
|
|
|
1136
1147
|
toDateTime(num) {
|
|
1137
1148
|
(0, import_invariant3.invariant)(this._node, void 0, {
|
|
1138
1149
|
F: __dxlog_file2,
|
|
1139
|
-
L:
|
|
1150
|
+
L: 403,
|
|
1140
1151
|
S: this,
|
|
1141
1152
|
A: [
|
|
1142
1153
|
"this._node",
|
|
@@ -1148,7 +1159,7 @@ var SheetModel = class extends import_context.Resource {
|
|
|
1148
1159
|
toDate(num) {
|
|
1149
1160
|
(0, import_invariant3.invariant)(this._node, void 0, {
|
|
1150
1161
|
F: __dxlog_file2,
|
|
1151
|
-
L:
|
|
1162
|
+
L: 408,
|
|
1152
1163
|
S: this,
|
|
1153
1164
|
A: [
|
|
1154
1165
|
"this._node",
|
|
@@ -1160,7 +1171,7 @@ var SheetModel = class extends import_context.Resource {
|
|
|
1160
1171
|
toTime(num) {
|
|
1161
1172
|
(0, import_invariant3.invariant)(this._node, void 0, {
|
|
1162
1173
|
F: __dxlog_file2,
|
|
1163
|
-
L:
|
|
1174
|
+
L: 413,
|
|
1164
1175
|
S: this,
|
|
1165
1176
|
A: [
|
|
1166
1177
|
"this._node",
|
|
@@ -1608,7 +1619,7 @@ var highlightStyles = import_language.HighlightStyle.define([
|
|
|
1608
1619
|
class: "text-unAccent"
|
|
1609
1620
|
}
|
|
1610
1621
|
]);
|
|
1611
|
-
var languageFacet = import_state.
|
|
1622
|
+
var languageFacet = (0, import_state.singleValueFacet)();
|
|
1612
1623
|
var sheetExtension = ({ functions = [] }) => {
|
|
1613
1624
|
const { extension, language } = (0, import_codemirror_lang_spreadsheet.spreadsheet)({
|
|
1614
1625
|
idiom: "en-US",
|
|
@@ -1725,7 +1736,7 @@ var rangeExtension = (onInit) => {
|
|
|
1725
1736
|
update(view2) {
|
|
1726
1737
|
const { anchor } = view2.state.selection.ranges[0];
|
|
1727
1738
|
activeRange = void 0;
|
|
1728
|
-
const
|
|
1739
|
+
const language = view2.state.facet(languageFacet);
|
|
1729
1740
|
const { topNode } = language.parser.parse(view2.state.doc.toString());
|
|
1730
1741
|
visitTree(topNode, ({ type, from, to }) => {
|
|
1731
1742
|
if (from <= anchor && to >= anchor) {
|
|
@@ -2287,7 +2298,7 @@ var SheetGrid = /* @__PURE__ */ (0, import_react2.forwardRef)(({ size, rows, col
|
|
|
2287
2298
|
id: model.id
|
|
2288
2299
|
}, {
|
|
2289
2300
|
F: __dxlog_file4,
|
|
2290
|
-
L:
|
|
2301
|
+
L: 738,
|
|
2291
2302
|
S: void 0,
|
|
2292
2303
|
C: (f, a) => f(...a)
|
|
2293
2304
|
});
|
|
@@ -2405,8 +2416,7 @@ var SheetGrid = /* @__PURE__ */ (0, import_react2.forwardRef)(({ size, rows, col
|
|
|
2405
2416
|
columnSizes
|
|
2406
2417
|
});
|
|
2407
2418
|
const id = (0, import_echo.fullyQualifiedId)(model.sheet);
|
|
2408
|
-
const
|
|
2409
|
-
const hasAttention = (0, import_react_ui_attention.useHasAttention)(id);
|
|
2419
|
+
const { hasAttention } = (0, import_react_ui_attention.useAttention)(id);
|
|
2410
2420
|
return /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
2411
2421
|
ref: containerRef,
|
|
2412
2422
|
role: "grid",
|
|
@@ -2493,13 +2503,25 @@ var SheetGrid = /* @__PURE__ */ (0, import_react2.forwardRef)(({ size, rows, col
|
|
|
2493
2503
|
}
|
|
2494
2504
|
});
|
|
2495
2505
|
});
|
|
2496
|
-
}))), /* @__PURE__ */ (0, import_react_dom.createPortal)(/* @__PURE__ */ import_react2.default.createElement(
|
|
2506
|
+
}))), /* @__PURE__ */ (0, import_react_dom.createPortal)(/* @__PURE__ */ import_react2.default.createElement(SheetInput, {
|
|
2497
2507
|
ref: inputRef,
|
|
2498
|
-
|
|
2508
|
+
id,
|
|
2509
|
+
onKeyDown: handleKeyDown
|
|
2510
|
+
}), document.body));
|
|
2511
|
+
});
|
|
2512
|
+
var SheetInput = /* @__PURE__ */ (0, import_react2.forwardRef)(({ id, onKeyDown }, forwardedRef) => {
|
|
2513
|
+
const path = (0, import_react_ui_attention.useAttentionPath)();
|
|
2514
|
+
const attendableAttrs = (0, import_react_ui_attention.useAttendableAttributes)(id);
|
|
2515
|
+
return path.toReversed().reduce((acc, part) => {
|
|
2516
|
+
return /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
2517
|
+
[import_react_ui_attention.ATTENABLE_ATTRIBUTE]: part
|
|
2518
|
+
}, acc);
|
|
2519
|
+
}, /* @__PURE__ */ import_react2.default.createElement("input", {
|
|
2520
|
+
ref: forwardedRef,
|
|
2499
2521
|
className: "absolute w-[1px] h-[1px] bg-transparent outline-none border-none caret-transparent",
|
|
2500
|
-
onKeyDown
|
|
2522
|
+
onKeyDown,
|
|
2501
2523
|
...attendableAttrs
|
|
2502
|
-
})
|
|
2524
|
+
}));
|
|
2503
2525
|
});
|
|
2504
2526
|
var SelectionOverlay = ({ root }) => {
|
|
2505
2527
|
const { range } = useSheetContext();
|
|
@@ -2665,4 +2687,4 @@ var Sheet = {
|
|
|
2665
2687
|
useComputeGraph,
|
|
2666
2688
|
useSheetContext
|
|
2667
2689
|
});
|
|
2668
|
-
//# sourceMappingURL=chunk-
|
|
2690
|
+
//# sourceMappingURL=chunk-5FTFZL5W.cjs.map
|