@dxos/plugin-sheet 0.6.8-main.046e6cf

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 (147) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +14 -0
  3. package/dist/lib/browser/SheetContainer-H22IDJ43.mjs +3740 -0
  4. package/dist/lib/browser/SheetContainer-H22IDJ43.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-6VPEAUG6.mjs +82 -0
  6. package/dist/lib/browser/chunk-6VPEAUG6.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-AT2FJXQX.mjs +861 -0
  8. package/dist/lib/browser/chunk-AT2FJXQX.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-JRL5LGCE.mjs +18 -0
  10. package/dist/lib/browser/chunk-JRL5LGCE.mjs.map +7 -0
  11. package/dist/lib/browser/index.mjs +213 -0
  12. package/dist/lib/browser/index.mjs.map +7 -0
  13. package/dist/lib/browser/meta.json +1 -0
  14. package/dist/lib/browser/meta.mjs +9 -0
  15. package/dist/lib/browser/meta.mjs.map +7 -0
  16. package/dist/lib/browser/types.mjs +22 -0
  17. package/dist/lib/browser/types.mjs.map +7 -0
  18. package/dist/lib/node/SheetContainer-S32KTNZ6.cjs +3731 -0
  19. package/dist/lib/node/SheetContainer-S32KTNZ6.cjs.map +7 -0
  20. package/dist/lib/node/chunk-4CE6FK5Z.cjs +108 -0
  21. package/dist/lib/node/chunk-4CE6FK5Z.cjs.map +7 -0
  22. package/dist/lib/node/chunk-BJ6ZD7MN.cjs +51 -0
  23. package/dist/lib/node/chunk-BJ6ZD7MN.cjs.map +7 -0
  24. package/dist/lib/node/chunk-FCKJ4QRM.cjs +881 -0
  25. package/dist/lib/node/chunk-FCKJ4QRM.cjs.map +7 -0
  26. package/dist/lib/node/index.cjs +226 -0
  27. package/dist/lib/node/index.cjs.map +7 -0
  28. package/dist/lib/node/meta.cjs +30 -0
  29. package/dist/lib/node/meta.cjs.map +7 -0
  30. package/dist/lib/node/meta.json +1 -0
  31. package/dist/lib/node/types.cjs +44 -0
  32. package/dist/lib/node/types.cjs.map +7 -0
  33. package/dist/types/src/SheetPlugin.d.ts +4 -0
  34. package/dist/types/src/SheetPlugin.d.ts.map +1 -0
  35. package/dist/types/src/components/CellEditor/CellEditor.d.ts +14 -0
  36. package/dist/types/src/components/CellEditor/CellEditor.d.ts.map +1 -0
  37. package/dist/types/src/components/CellEditor/CellEditor.stories.d.ts +29 -0
  38. package/dist/types/src/components/CellEditor/CellEditor.stories.d.ts.map +1 -0
  39. package/dist/types/src/components/CellEditor/extension.d.ts +18 -0
  40. package/dist/types/src/components/CellEditor/extension.d.ts.map +1 -0
  41. package/dist/types/src/components/CellEditor/extension.test.d.ts +2 -0
  42. package/dist/types/src/components/CellEditor/extension.test.d.ts.map +1 -0
  43. package/dist/types/src/components/CellEditor/functions.d.ts +66 -0
  44. package/dist/types/src/components/CellEditor/functions.d.ts.map +1 -0
  45. package/dist/types/src/components/CellEditor/index.d.ts +3 -0
  46. package/dist/types/src/components/CellEditor/index.d.ts.map +1 -0
  47. package/dist/types/src/components/ComputeGraph/async-function.d.ts +52 -0
  48. package/dist/types/src/components/ComputeGraph/async-function.d.ts.map +1 -0
  49. package/dist/types/src/components/ComputeGraph/custom.d.ts +21 -0
  50. package/dist/types/src/components/ComputeGraph/custom.d.ts.map +1 -0
  51. package/dist/types/src/components/ComputeGraph/edge-function.d.ts +20 -0
  52. package/dist/types/src/components/ComputeGraph/edge-function.d.ts.map +1 -0
  53. package/dist/types/src/components/ComputeGraph/graph-context.d.ts +11 -0
  54. package/dist/types/src/components/ComputeGraph/graph-context.d.ts.map +1 -0
  55. package/dist/types/src/components/ComputeGraph/graph.browser.test.d.ts +2 -0
  56. package/dist/types/src/components/ComputeGraph/graph.browser.test.d.ts.map +1 -0
  57. package/dist/types/src/components/ComputeGraph/graph.d.ts +21 -0
  58. package/dist/types/src/components/ComputeGraph/graph.d.ts.map +1 -0
  59. package/dist/types/src/components/ComputeGraph/index.d.ts +4 -0
  60. package/dist/types/src/components/ComputeGraph/index.d.ts.map +1 -0
  61. package/dist/types/src/components/Sheet/Sheet.d.ts +55 -0
  62. package/dist/types/src/components/Sheet/Sheet.d.ts.map +1 -0
  63. package/dist/types/src/components/Sheet/Sheet.stories.d.ts +54 -0
  64. package/dist/types/src/components/Sheet/Sheet.stories.d.ts.map +1 -0
  65. package/dist/types/src/components/Sheet/formatting.d.ts +14 -0
  66. package/dist/types/src/components/Sheet/formatting.d.ts.map +1 -0
  67. package/dist/types/src/components/Sheet/grid.d.ts +52 -0
  68. package/dist/types/src/components/Sheet/grid.d.ts.map +1 -0
  69. package/dist/types/src/components/Sheet/index.d.ts +2 -0
  70. package/dist/types/src/components/Sheet/index.d.ts.map +1 -0
  71. package/dist/types/src/components/Sheet/nav.d.ts +29 -0
  72. package/dist/types/src/components/Sheet/nav.d.ts.map +1 -0
  73. package/dist/types/src/components/Sheet/sheet-context.d.ts +24 -0
  74. package/dist/types/src/components/Sheet/sheet-context.d.ts.map +1 -0
  75. package/dist/types/src/components/Sheet/util.d.ts +18 -0
  76. package/dist/types/src/components/Sheet/util.d.ts.map +1 -0
  77. package/dist/types/src/components/SheetContainer.d.ts +9 -0
  78. package/dist/types/src/components/SheetContainer.d.ts.map +1 -0
  79. package/dist/types/src/components/Toolbar/Toolbar.d.ts +21 -0
  80. package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -0
  81. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +35 -0
  82. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -0
  83. package/dist/types/src/components/Toolbar/common.d.ts +20 -0
  84. package/dist/types/src/components/Toolbar/common.d.ts.map +1 -0
  85. package/dist/types/src/components/Toolbar/index.d.ts +2 -0
  86. package/dist/types/src/components/Toolbar/index.d.ts.map +1 -0
  87. package/dist/types/src/components/index.d.ts +7 -0
  88. package/dist/types/src/components/index.d.ts.map +1 -0
  89. package/dist/types/src/index.d.ts +4 -0
  90. package/dist/types/src/index.d.ts.map +1 -0
  91. package/dist/types/src/meta.d.ts +15 -0
  92. package/dist/types/src/meta.d.ts.map +1 -0
  93. package/dist/types/src/model/index.d.ts +3 -0
  94. package/dist/types/src/model/index.d.ts.map +1 -0
  95. package/dist/types/src/model/model.browser.test.d.ts +2 -0
  96. package/dist/types/src/model/model.browser.test.d.ts.map +1 -0
  97. package/dist/types/src/model/model.d.ts +142 -0
  98. package/dist/types/src/model/model.d.ts.map +1 -0
  99. package/dist/types/src/model/types.d.ts +17 -0
  100. package/dist/types/src/model/types.d.ts.map +1 -0
  101. package/dist/types/src/model/types.test.d.ts +2 -0
  102. package/dist/types/src/model/types.test.d.ts.map +1 -0
  103. package/dist/types/src/model/util.d.ts +15 -0
  104. package/dist/types/src/model/util.d.ts.map +1 -0
  105. package/dist/types/src/translations.d.ts +16 -0
  106. package/dist/types/src/translations.d.ts.map +1 -0
  107. package/dist/types/src/types.d.ts +94 -0
  108. package/dist/types/src/types.d.ts.map +1 -0
  109. package/package.json +122 -0
  110. package/src/SheetPlugin.tsx +150 -0
  111. package/src/components/CellEditor/CellEditor.stories.tsx +88 -0
  112. package/src/components/CellEditor/CellEditor.tsx +113 -0
  113. package/src/components/CellEditor/extension.test.ts +42 -0
  114. package/src/components/CellEditor/extension.ts +286 -0
  115. package/src/components/CellEditor/functions.ts +2017 -0
  116. package/src/components/CellEditor/index.ts +6 -0
  117. package/src/components/ComputeGraph/async-function.ts +148 -0
  118. package/src/components/ComputeGraph/custom.ts +70 -0
  119. package/src/components/ComputeGraph/edge-function.ts +60 -0
  120. package/src/components/ComputeGraph/graph-context.tsx +37 -0
  121. package/src/components/ComputeGraph/graph.browser.test.ts +49 -0
  122. package/src/components/ComputeGraph/graph.ts +52 -0
  123. package/src/components/ComputeGraph/index.ts +7 -0
  124. package/src/components/Sheet/Sheet.stories.tsx +329 -0
  125. package/src/components/Sheet/Sheet.tsx +1164 -0
  126. package/src/components/Sheet/formatting.ts +106 -0
  127. package/src/components/Sheet/grid.ts +191 -0
  128. package/src/components/Sheet/index.ts +5 -0
  129. package/src/components/Sheet/nav.ts +157 -0
  130. package/src/components/Sheet/sheet-context.tsx +101 -0
  131. package/src/components/Sheet/util.ts +56 -0
  132. package/src/components/SheetContainer.tsx +30 -0
  133. package/src/components/Toolbar/Toolbar.stories.tsx +36 -0
  134. package/src/components/Toolbar/Toolbar.tsx +198 -0
  135. package/src/components/Toolbar/common.tsx +72 -0
  136. package/src/components/Toolbar/index.ts +5 -0
  137. package/src/components/index.ts +10 -0
  138. package/src/index.ts +9 -0
  139. package/src/meta.tsx +18 -0
  140. package/src/model/index.ts +6 -0
  141. package/src/model/model.browser.test.ts +100 -0
  142. package/src/model/model.ts +480 -0
  143. package/src/model/types.test.ts +92 -0
  144. package/src/model/types.ts +71 -0
  145. package/src/model/util.ts +36 -0
  146. package/src/translations.ts +22 -0
  147. package/src/types.ts +110 -0
@@ -0,0 +1,29 @@
1
+ import '@dxosTheme';
2
+ import React from 'react';
3
+ import { type CellEditorProps } from './CellEditor';
4
+ declare const _default: {
5
+ title: string;
6
+ component: ({ value, extension, autoFocus, onBlur }: CellEditorProps) => React.JSX.Element;
7
+ render: (args: StoryProps) => React.JSX.Element;
8
+ decorators: import("@storybook/react/*").Decorator[];
9
+ };
10
+ export default _default;
11
+ type StoryProps = CellEditorProps;
12
+ export declare const Default: {};
13
+ export declare const AutoComplete: {
14
+ args: {
15
+ value: string;
16
+ };
17
+ };
18
+ export declare const Formatting: {
19
+ args: {
20
+ value: string;
21
+ };
22
+ };
23
+ export declare const Automerge: {
24
+ render: (args: StoryProps) => React.JSX.Element;
25
+ args: {
26
+ value: string;
27
+ };
28
+ };
29
+ //# sourceMappingURL=CellEditor.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CellEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/CellEditor/CellEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAGpB,OAAO,KAAuC,MAAM,OAAO,CAAC;AAO5D,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;;;;mBAO/C,UAAU;;;AAH3B,wBAKE;AAEF,KAAK,UAAU,GAAG,eAAe,CAAC;AA2ClC,eAAO,MAAM,OAAO,IAAK,CAAC;AAE1B,eAAO,MAAM,YAAY;;;;CAIxB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;CAItB,CAAC;AAEF,eAAO,MAAM,SAAS;mBACL,UAAU;;;;CAI1B,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { type Extension } from '@codemirror/state';
2
+ export type SheetExtensionOptions = {
3
+ functions?: string[];
4
+ };
5
+ /**
6
+ * Spreadsheet formula extension and parser.
7
+ * https://github.com/luizzappa/codemirror-lang-spreadsheet
8
+ * https://github.com/luizzappa/codemirror-app-spreadsheet/blob/master/src/editor.ts
9
+ * https://github.com/codemirror/lang-example
10
+ * https://hyperformula.handsontable.com/guide/key-concepts.html#grammar
11
+ */
12
+ export declare const sheetExtension: ({ functions }: SheetExtensionOptions) => Extension;
13
+ export type CellRangeNotifier = (range: string) => void;
14
+ /**
15
+ * Tracks the currently active cell within a formula and provides a callback to modify it.
16
+ */
17
+ export declare const rangeExtension: (onInit: (notifier: CellRangeNotifier) => void) => Extension;
18
+ //# sourceMappingURL=extension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../../../../src/components/CellEditor/extension.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,SAAS,EAAS,MAAM,mBAAmB,CAAC;AAiD1D,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,kBAAmB,qBAAqB,KAAG,SAiIrE,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAIxD;;GAEG;AACH,eAAO,MAAM,cAAc,WAAY,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,KAAG,SAwD9E,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=extension.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension.test.d.ts","sourceRoot":"","sources":["../../../../../src/components/CellEditor/extension.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * nullDate {year: 1899, month: 12, day: 30}
3
+ */
4
+ export declare const functions: {
5
+ Array: {
6
+ function: string;
7
+ description: string;
8
+ syntax: string;
9
+ }[];
10
+ 'Date and time': {
11
+ function: string;
12
+ description: string;
13
+ syntax: string;
14
+ }[];
15
+ Engineering: {
16
+ function: string;
17
+ description: string;
18
+ syntax: string;
19
+ }[];
20
+ Information: {
21
+ function: string;
22
+ description: string;
23
+ syntax: string;
24
+ }[];
25
+ Financial: {
26
+ function: string;
27
+ description: string;
28
+ syntax: string;
29
+ }[];
30
+ Logical: {
31
+ function: string;
32
+ description: string;
33
+ syntax: string;
34
+ }[];
35
+ 'Lookup and reference': {
36
+ function: string;
37
+ description: string;
38
+ syntax: string;
39
+ }[];
40
+ 'Math and trigonometry': {
41
+ function: string;
42
+ description: string;
43
+ syntax: string;
44
+ }[];
45
+ 'Matrix functions': {
46
+ function: string;
47
+ description: string;
48
+ syntax: string;
49
+ }[];
50
+ Operator: {
51
+ function: string;
52
+ description: string;
53
+ syntax: string;
54
+ }[];
55
+ Statistical: {
56
+ function: string;
57
+ description: string;
58
+ syntax: string;
59
+ }[];
60
+ Text: {
61
+ function: string;
62
+ description: string;
63
+ syntax: string;
64
+ }[];
65
+ };
66
+ //# sourceMappingURL=functions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../../../src/components/CellEditor/functions.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAy9DrB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './CellEditor';
2
+ export * from './extension';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CellEditor/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { FunctionPlugin, type HyperFormula } from 'hyperformula';
2
+ import { type InterpreterState } from 'hyperformula/typings/interpreter/InterpreterState';
3
+ import { type InterpreterValue } from 'hyperformula/typings/interpreter/InterpreterValue';
4
+ import { type ProcedureAst } from 'hyperformula/typings/parser';
5
+ import { type Space } from '@dxos/client/echo';
6
+ export type AsyncFunction = (...args: any) => Promise<InterpreterValue>;
7
+ export type FunctionOptions = {
8
+ ttl?: number;
9
+ };
10
+ export type FunctionContextOptions = {
11
+ defaultTtl: number;
12
+ recalculationDelay: number;
13
+ };
14
+ export declare const defaultFunctionContextOptions: FunctionContextOptions;
15
+ /**
16
+ * The context singleton for the model is passed into custom functions.
17
+ *
18
+ * HyperFormula does not support async functions.
19
+ * - https://hyperformula.handsontable.com/guide/custom-functions.html
20
+ * - https://hyperformula.handsontable.com/guide/known-limitations.html#known-limitations
21
+ * - https://github.com/handsontable/hyperformula/issues/892
22
+ */
23
+ export declare class FunctionContext {
24
+ private readonly _hf;
25
+ private readonly _space;
26
+ private readonly _options;
27
+ static createInvocationKey(name: string, ...args: any): string;
28
+ private readonly _cache;
29
+ private readonly _pending;
30
+ private _invocations;
31
+ private readonly _onUpdate;
32
+ constructor(_hf: HyperFormula, _space: Space | undefined, onUpdate: (context: FunctionContext) => void, _options?: FunctionContextOptions);
33
+ get space(): Space | undefined;
34
+ get info(): {
35
+ cache: number;
36
+ invocations: Record<string, number>;
37
+ };
38
+ flush(): void;
39
+ /**
40
+ * Exec the function if TTL has expired.
41
+ * Return the cached value.
42
+ */
43
+ invokeFunction(name: string, state: InterpreterState, args: any[], cb: AsyncFunction, options?: FunctionOptions): InterpreterValue | undefined;
44
+ }
45
+ /**
46
+ * Base class for async functions.
47
+ */
48
+ export declare class FunctionPluginAsync extends FunctionPlugin {
49
+ get context(): FunctionContext;
50
+ runAsyncFunction(ast: ProcedureAst, state: InterpreterState, cb: AsyncFunction, options?: FunctionOptions): import("hyperformula/typings/interpreter/InterpreterValue").RawInterpreterValue;
51
+ }
52
+ //# sourceMappingURL=async-function.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"async-function.d.ts","sourceRoot":"","sources":["../../../../../src/components/ComputeGraph/async-function.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoC,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AACnG,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAU/C,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAExE,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,sBAG3C,CAAC;AAEF;;;;;;;GAOG;AACH,qBAAa,eAAe;IAkBxB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAnB3B,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG;IAKrD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8D;IAGrF,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IAGtD,OAAO,CAAC,YAAY,CAA8B;IAElD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAa;gBAGpB,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,KAAK,GAAG,SAAS,EAC1C,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,EAC3B,QAAQ,yBAAgC;IAU3D,IAAI,KAAK,sBAER;IAED,IAAI,IAAI;;;MAEP;IAED,KAAK;IAKL;;;OAGG;IACH,cAAc,CACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,gBAAgB,EACvB,IAAI,EAAE,GAAG,EAAE,EACX,EAAE,EAAE,aAAa,EACjB,OAAO,CAAC,EAAE,eAAe,GACxB,gBAAgB,GAAG,SAAS;CAgChC;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,IAAI,OAAO,IACqB,eAAe,CAC9C;IAED,gBAAgB,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,eAAe;CAO1G"}
@@ -0,0 +1,21 @@
1
+ import { type InterpreterState } from 'hyperformula/typings/interpreter/InterpreterState';
2
+ import { type ProcedureAst } from 'hyperformula/typings/parser';
3
+ import { FunctionPluginAsync } from './async-function';
4
+ /**
5
+ * https://hyperformula.handsontable.com/guide/custom-functions.html#add-a-simple-custom-function
6
+ */
7
+ export declare class CustomPlugin extends FunctionPluginAsync {
8
+ test(ast: ProcedureAst, state: InterpreterState): import("hyperformula/typings/interpreter/InterpreterValue").RawInterpreterValue;
9
+ crypto(ast: ProcedureAst, state: InterpreterState): import("hyperformula/typings/interpreter/InterpreterValue").RawInterpreterValue;
10
+ }
11
+ export declare const CustomPluginTranslations: {
12
+ enGB: {
13
+ TEST: string;
14
+ CRYPTO: string;
15
+ };
16
+ enUS: {
17
+ TEST: string;
18
+ CRYPTO: string;
19
+ };
20
+ };
21
+ //# sourceMappingURL=custom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom.d.ts","sourceRoot":"","sources":["../../../../../src/components/ComputeGraph/custom.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAIhE,OAAO,EAAsB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAO3E;;GAEG;AACH,qBAAa,YAAa,SAAQ,mBAAmB;IACnD,IAAI,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB;IAQ/C,MAAM,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB;CAelD;AAgBD,eAAO,MAAM,wBAAwB;;;;;;;;;CASpC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { type InterpreterState } from 'hyperformula/typings/interpreter/InterpreterState';
2
+ import { type ProcedureAst } from 'hyperformula/typings/parser';
3
+ import { FunctionPluginAsync } from './async-function';
4
+ /**
5
+ * A hyperformula function plugin for calling EDGE functions.
6
+ *
7
+ * https://hyperformula.handsontable.com/guide/custom-functions.html#add-a-simple-custom-function
8
+ */
9
+ export declare class EdgeFunctionPlugin extends FunctionPluginAsync {
10
+ edge(ast: ProcedureAst, state: InterpreterState): import("hyperformula/typings/interpreter/InterpreterValue").RawInterpreterValue;
11
+ }
12
+ export declare const EdgeFunctionPluginTranslations: {
13
+ enGB: {
14
+ EDGE: string;
15
+ };
16
+ enUS: {
17
+ EDGE: string;
18
+ };
19
+ };
20
+ //# sourceMappingURL=edge-function.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edge-function.d.ts","sourceRoot":"","sources":["../../../../../src/components/ComputeGraph/edge-function.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAMhE,OAAO,EAAsB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE3E;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,mBAAmB;IACzD,IAAI,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB;CAsBhD;AAUD,eAAO,MAAM,8BAA8B;;;;;;;CAO1C,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React, { type PropsWithChildren } from 'react';
2
+ import { type Space } from '@dxos/react-client/echo';
3
+ import { type ComputeGraph } from './graph';
4
+ export type ComputeGraphContextType = {
5
+ graphs: Record<string, ComputeGraph>;
6
+ setGraph: (key: string, graph: ComputeGraph) => void;
7
+ };
8
+ export declare const ComputeGraphContext: React.Context<ComputeGraphContextType>;
9
+ export declare const ComputeGraphContextProvider: ({ children, graphs, setGraph, }: PropsWithChildren<ComputeGraphContextType>) => React.JSX.Element;
10
+ export declare const useComputeGraph: (space: Space) => ComputeGraph;
11
+ //# sourceMappingURL=graph-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-context.d.ts","sourceRoot":"","sources":["../../../../../src/components/ComputeGraph/graph-context.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAiB,KAAK,iBAAiB,EAAyB,MAAM,OAAO,CAAC;AAE5F,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAEhE,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACrC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;CACtD,CAAC;AAEF,eAAO,MAAM,mBAAmB,wCAA6E,CAAC;AAE9G,eAAO,MAAM,2BAA2B,oCAIrC,iBAAiB,CAAC,uBAAuB,CAAC,sBAE5C,CAAC;AAEF,eAAO,MAAM,eAAe,UAAW,KAAK,KAAG,YAW9C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=graph.browser.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.browser.test.d.ts","sourceRoot":"","sources":["../../../../../src/components/ComputeGraph/graph.browser.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ import { HyperFormula } from 'hyperformula';
2
+ import { Event } from '@dxos/async';
3
+ import { type Space } from '@dxos/client/echo';
4
+ import { FunctionContext } from './async-function';
5
+ /**
6
+ * Create root graph for space.
7
+ */
8
+ export declare const createComputeGraph: (space?: Space) => ComputeGraph;
9
+ /**
10
+ * Per-space compute and dependency graph.
11
+ */
12
+ export declare class ComputeGraph {
13
+ readonly hf: HyperFormula;
14
+ private readonly _space?;
15
+ readonly id: string;
16
+ readonly update: Event<void>;
17
+ readonly context: FunctionContext;
18
+ constructor(hf: HyperFormula, _space?: Space | undefined);
19
+ refresh(): void;
20
+ }
21
+ //# sourceMappingURL=graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../../../src/components/ComputeGraph/graph.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAI/C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAInD;;GAEG;AACH,eAAO,MAAM,kBAAkB,WAAY,KAAK,KAAG,YAOlD,CAAC;AAEF;;GAEG;AAEH,qBAAa,YAAY;aAUL,EAAE,EAAE,YAAY;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;IAV1B,SAAgB,EAAE,SAA4C;IAC9D,SAAgB,MAAM,cAAe;IAGrC,SAAgB,OAAO,kBAEpB;gBAGe,EAAE,EAAE,YAAY,EACf,MAAM,CAAC,EAAE,KAAK,YAAA;IAKjC,OAAO;CAIR"}
@@ -0,0 +1,4 @@
1
+ export * from './custom';
2
+ export * from './graph';
3
+ export * from './graph-context';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ComputeGraph/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,55 @@
1
+ import React, { type CSSProperties, type PropsWithChildren } from 'react';
2
+ import { type ThemedClassName } from '@dxos/react-ui';
3
+ import { type GridLayoutProps, type SizeMap } from './grid';
4
+ import { type GridSize } from './nav';
5
+ import { type SheetContextProps } from './sheet-context';
6
+ import { type CellIndex, type CellAddress } from '../../model';
7
+ type SheetRootProps = SheetContextProps;
8
+ type SheetMainProps = ThemedClassName<Partial<GridSize>>;
9
+ type ResizeProps = {
10
+ sizes?: SizeMap;
11
+ onResize?: (idx: CellIndex, size: number, save?: boolean) => void;
12
+ };
13
+ type MoveProps = {
14
+ onMove?: (from: number, to: number) => void;
15
+ };
16
+ type RowColumnSelection = {
17
+ selected?: number;
18
+ onSelect?: (selected: number) => void;
19
+ };
20
+ type SheetRowsProps = {
21
+ rows: CellIndex[];
22
+ } & RowColumnSelection & ResizeProps & MoveProps;
23
+ type SheetColumnsProps = {
24
+ columns: CellIndex[];
25
+ } & RowColumnSelection & ResizeProps & MoveProps;
26
+ type SheetGridProps = GridLayoutProps & {
27
+ size: GridSize;
28
+ };
29
+ type SheetCellProps = {
30
+ id: string;
31
+ cell: CellAddress;
32
+ style: CSSProperties;
33
+ active: boolean;
34
+ onSelect?: (selected: CellAddress, edit: boolean) => void;
35
+ };
36
+ export declare const Sheet: {
37
+ Root: ({ children, ...props }: PropsWithChildren<SheetContextProps>) => React.JSX.Element;
38
+ Main: React.ForwardRefExoticComponent<Omit<Partial<GridSize>, "className"> & {
39
+ classNames?: import("@dxos/react-ui").ClassNameValue;
40
+ } & React.RefAttributes<HTMLDivElement>>;
41
+ Rows: React.ForwardRefExoticComponent<{
42
+ rows: CellIndex[];
43
+ } & RowColumnSelection & ResizeProps & MoveProps & React.RefAttributes<HTMLDivElement>>;
44
+ Columns: React.ForwardRefExoticComponent<{
45
+ columns: CellIndex[];
46
+ } & RowColumnSelection & ResizeProps & MoveProps & React.RefAttributes<HTMLDivElement>>;
47
+ Grid: React.ForwardRefExoticComponent<GridLayoutProps & {
48
+ size: GridSize;
49
+ } & React.RefAttributes<HTMLDivElement>>;
50
+ Cell: ({ id, cell, style, active, onSelect }: SheetCellProps) => React.JSX.Element;
51
+ StatusBar: () => React.JSX.Element;
52
+ Debug: () => React.JSX.Element;
53
+ };
54
+ export type { SheetRootProps, SheetMainProps, SheetRowsProps, SheetColumnsProps, SheetGridProps, SheetCellProps };
55
+ //# sourceMappingURL=Sheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../../../src/components/Sheet/Sheet.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EACZ,KAAK,aAAa,EAElB,KAAK,iBAAiB,EAMvB,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAItD,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,OAAO,EAYb,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,KAAK,QAAQ,EAA6C,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,KAAK,iBAAiB,EAAyC,MAAM,iBAAiB,CAAC;AAEhG,OAAO,EACL,KAAK,SAAS,EACd,KAAK,WAAW,EAKjB,MAAM,aAAa,CAAC;AAyDrB,KAAK,cAAc,GAAG,iBAAiB,CAAC;AAUxC,KAAK,cAAc,GAAG,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;AA4NzD,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACnE,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,CAAC;AAgBF,KAAK,cAAc,GAAG;IAAE,IAAI,EAAE,SAAS,EAAE,CAAA;CAAE,GAAG,kBAAkB,GAAG,WAAW,GAAG,SAAS,CAAC;AAmK3F,KAAK,iBAAiB,GAAG;IAAE,OAAO,EAAE,SAAS,EAAE,CAAA;CAAE,GAAG,kBAAkB,GAAG,WAAW,GAAG,SAAS,CAAC;AAoKjG,KAAK,cAAc,GAAG,eAAe,GAAG;IACtC,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AA6RF,KAAK,cAAc,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3D,CAAC;AAoJF,eAAO,MAAM,KAAK;mCAhgCyB,iBAAiB,CAAC,iBAAiB,CAAC;;;;;cAgQjD,SAAS,EAAE;;;iBAmKL,SAAS,EAAE;;;cAqKvC,QAAQ;;kDAsS0C,cAAc;;;CA2JvE,CAAC;AAEF,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,54 @@
1
+ import '@dxosTheme';
2
+ import { type Decorator } from '@storybook/react';
3
+ import React from 'react';
4
+ import { type SizeMap } from './grid';
5
+ declare const _default: {
6
+ title: string;
7
+ component: {
8
+ Root: ({ children, ...props }: React.PropsWithChildren<import("./sheet-context").SheetContextProps>) => React.JSX.Element;
9
+ Main: React.ForwardRefExoticComponent<Omit<Partial<import("./nav").GridSize>, "className"> & {
10
+ classNames?: import("@dxos/react-ui").ClassNameValue;
11
+ } & React.RefAttributes<HTMLDivElement>>;
12
+ Rows: React.ForwardRefExoticComponent<{
13
+ rows: import("../../model").CellIndex[];
14
+ } & {
15
+ selected?: number;
16
+ onSelect?: (selected: number) => void;
17
+ } & {
18
+ sizes?: SizeMap;
19
+ onResize?: (idx: import("../../model").CellIndex, size: number, save?: boolean) => void;
20
+ } & {
21
+ onMove?: (from: number, to: number) => void;
22
+ } & React.RefAttributes<HTMLDivElement>>;
23
+ Columns: React.ForwardRefExoticComponent<{
24
+ columns: import("../../model").CellIndex[];
25
+ } & {
26
+ selected?: number;
27
+ onSelect?: (selected: number) => void;
28
+ } & {
29
+ sizes?: SizeMap;
30
+ onResize?: (idx: import("../../model").CellIndex, size: number, save?: boolean) => void;
31
+ } & {
32
+ onMove?: (from: number, to: number) => void;
33
+ } & React.RefAttributes<HTMLDivElement>>;
34
+ Grid: React.ForwardRefExoticComponent<import("./grid").GridLayoutProps & {
35
+ size: import("./nav").GridSize;
36
+ } & React.RefAttributes<HTMLDivElement>>;
37
+ Cell: ({ id, cell, style, active, onSelect }: import("./Sheet").SheetCellProps) => React.JSX.Element;
38
+ StatusBar: () => React.JSX.Element;
39
+ Debug: () => React.JSX.Element;
40
+ };
41
+ decorators: Decorator[];
42
+ };
43
+ export default _default;
44
+ export declare const Default: () => React.JSX.Element | null;
45
+ export declare const Debug: () => React.JSX.Element | null;
46
+ export declare const Rows: () => React.JSX.Element | null;
47
+ export declare const Columns: () => React.JSX.Element | null;
48
+ export declare const Main: () => React.JSX.Element | null;
49
+ /**
50
+ * Scrolling container with fixed border that overlaps the border of inner elements.
51
+ */
52
+ export declare const ScrollLayout: () => React.JSX.Element;
53
+ export declare const GridLayout: () => React.JSX.Element;
54
+ //# sourceMappingURL=Sheet.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sheet.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Sheet/Sheet.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAEpB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAA0C,MAAM,OAAO,CAAC;AAW/D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;;;;;;;;;;;;;;;gFAuTojE,CAAC;;;;;;;;;;;gFAAD,CAAC;;;;;;;;;;;;;AA1M3lE,wBAIE;AAEF,eAAO,MAAM,OAAO,gCAenB,CAAC;AAEF,eAAO,MAAM,KAAK,gCAajB,CAAC;AAEF,eAAO,MAAM,IAAI,gCAiBhB,CAAC;AAEF,eAAO,MAAM,OAAO,gCAiBnB,CAAC;AAEF,eAAO,MAAM,IAAI,gCAqBhB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,yBAkBxB,CAAC;AAEF,eAAO,MAAM,UAAU,yBActB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type ClassNameValue } from '@dxos/react-ui-types';
2
+ import { type SheetModel, type CellAddress } from '../../model';
3
+ export declare class FormattingModel {
4
+ private readonly model;
5
+ constructor(model: SheetModel);
6
+ /**
7
+ * Get formatted string value and className for cell.
8
+ */
9
+ getFormatting(cell: CellAddress): {
10
+ value?: string;
11
+ classNames?: ClassNameValue;
12
+ };
13
+ }
14
+ //# sourceMappingURL=formatting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../../src/components/Sheet/formatting.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAW,MAAM,aAAa,CAAC;AAGzE,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,UAAU;IAE9C;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,WAAW,GAAG;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,cAAc,CAAA;KAAE;CA0FlF"}
@@ -0,0 +1,52 @@
1
+ import { type MouseEvent } from 'react';
2
+ import { type CellAddress, type CellIndex } from '../../model';
3
+ export type SizeMap = Record<string, number>;
4
+ export type RowPosition = {
5
+ row: number;
6
+ } & Pick<DOMRect, 'top' | 'height'>;
7
+ export type ColumnPosition = {
8
+ column: number;
9
+ } & Pick<DOMRect, 'left' | 'width'>;
10
+ export declare const axisWidth = "calc(var(--rail-size)-2px)";
11
+ export declare const axisHeight = 34;
12
+ export declare const minWidth = 40;
13
+ export declare const maxWidth = 800;
14
+ export declare const minHeight = 34;
15
+ export declare const maxHeight = 400;
16
+ export declare const defaultWidth = 200;
17
+ export declare const defaultHeight = 34;
18
+ /**
19
+ * Cell nodes are identified by their A1 notation.
20
+ */
21
+ export declare const CELL_DATA_KEY = "cell";
22
+ export type GridLayoutProps = {
23
+ rows: CellIndex[];
24
+ columns: CellIndex[];
25
+ rowSizes?: SizeMap;
26
+ columnSizes?: SizeMap;
27
+ };
28
+ export type GridLayout = {
29
+ width: number;
30
+ height: number;
31
+ rowRange: RowPosition[];
32
+ columnRange: ColumnPosition[];
33
+ };
34
+ /**
35
+ * Calculates the grid geometry for the current viewport.
36
+ */
37
+ export declare const useGridLayout: ({ scroller, size, rows, columns, rowSizes, columnSizes, }: GridLayoutProps & {
38
+ scroller: HTMLDivElement | null;
39
+ size: {
40
+ width: number;
41
+ height: number;
42
+ };
43
+ }) => GridLayout;
44
+ /**
45
+ * Find child node at mouse pointer.
46
+ */
47
+ export declare const getCellAtPointer: (event: MouseEvent) => CellAddress | undefined;
48
+ /**
49
+ * Get element.
50
+ */
51
+ export declare const getCellElement: (root: HTMLElement, cell: CellAddress) => HTMLElement | null;
52
+ //# sourceMappingURL=grid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../../../../src/components/Sheet/grid.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAuB,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAA8C,MAAM,aAAa,CAAC;AAK3G,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE7C,MAAM,MAAM,WAAW,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,QAAQ,CAAC,CAAC;AAC5E,MAAM,MAAM,cAAc,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;AAElF,eAAO,MAAM,SAAS,+BAA+B,CAAC;AACtD,eAAO,MAAM,UAAU,KAAK,CAAC;AAE7B,eAAO,MAAM,QAAQ,KAAK,CAAC;AAC3B,eAAO,MAAM,QAAQ,MAAM,CAAC;AAE5B,eAAO,MAAM,SAAS,KAAa,CAAC;AACpC,eAAO,MAAM,SAAS,MAAM,CAAC;AAE7B,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,aAAa,KAAY,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,aAAa,SAAS,CAAC;AAEpC,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,WAAW,EAAE,cAAc,EAAE,CAAC;CAC/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,8DAOvB,eAAe,GAAG;IACnB,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACzC,KAAG,UA4GH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,UAAW,UAAU,KAAG,WAAW,GAAG,SASlE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,SAAU,WAAW,QAAQ,WAAW,KAAG,WAAW,GAAG,IAGnF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './Sheet';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Sheet/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { type KeyboardEvent, type MouseEventHandler } from 'react';
2
+ import { type CellAddress, type CellRange } from '../../model';
3
+ export type GridSize = {
4
+ numRows: number;
5
+ numColumns: number;
6
+ };
7
+ /**
8
+ * Calculate next range based on arrow keys.
9
+ */
10
+ export declare const handleNav: (ev: KeyboardEvent<HTMLInputElement>, cursor: CellAddress | undefined, range: CellRange | undefined, size: GridSize) => {
11
+ cursor?: CellAddress;
12
+ range?: CellRange;
13
+ };
14
+ /**
15
+ * Calculate next cell based on arrow keys.
16
+ */
17
+ export declare const handleArrowNav: (ev: Pick<KeyboardEvent<HTMLInputElement>, "key" | "metaKey">, cursor: CellAddress | undefined, { numRows, numColumns }: GridSize) => CellAddress | undefined;
18
+ /**
19
+ * Hook to manage range drag handlers.
20
+ */
21
+ export declare const useRangeSelect: (cb: (event: "start" | "move" | "end", range: CellRange | undefined) => void) => {
22
+ range: CellRange | undefined;
23
+ handlers: {
24
+ onMouseDown: MouseEventHandler<HTMLDivElement>;
25
+ onMouseMove: MouseEventHandler<HTMLDivElement>;
26
+ onMouseUp: MouseEventHandler<HTMLDivElement>;
27
+ };
28
+ };
29
+ //# sourceMappingURL=nav.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nav.d.ts","sourceRoot":"","sources":["../../../../../src/components/Sheet/nav.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAY,MAAM,OAAO,CAAC;AAG7E,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAa,MAAM,aAAa,CAAC;AAE1E,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,OAChB,aAAa,CAAC,gBAAgB,CAAC,UAC3B,WAAW,GAAG,SAAS,SACxB,SAAS,GAAG,SAAS,QACtB,QAAQ,KACb;IAAE,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAoC3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,OACrB,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC,UACpD,WAAW,GAAG,SAAS,2BACN,QAAQ,KAChC,WAAW,GAAG,SAmChB,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,cAAc,OACrB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,KAC1E;IACD,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,QAAQ,EAAE;QACR,WAAW,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;QAC/C,WAAW,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;QAC/C,SAAS,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;KAC9C,CAAC;CAwCH,CAAC"}
@@ -0,0 +1,24 @@
1
+ import React, { type PropsWithChildren } from 'react';
2
+ import { type Space } from '@dxos/react-client/echo';
3
+ import { FormattingModel } from './formatting';
4
+ import { type CellAddress, type CellRange, SheetModel } from '../../model';
5
+ import { type SheetType } from '../../types';
6
+ export type SheetContextType = {
7
+ model: SheetModel;
8
+ formatting: FormattingModel;
9
+ cursor?: CellAddress;
10
+ setCursor: (cell: CellAddress | undefined) => void;
11
+ range?: CellRange;
12
+ setRange: (range: CellRange | undefined) => void;
13
+ editing: boolean;
14
+ setEditing: (editing: boolean) => void;
15
+ onInfo?: () => void;
16
+ };
17
+ export declare const useSheetContext: () => SheetContextType;
18
+ export type SheetContextProps = {
19
+ sheet: SheetType;
20
+ space: Space;
21
+ readonly?: boolean;
22
+ } & Pick<SheetContextType, 'onInfo'>;
23
+ export declare const SheetContextProvider: ({ children, sheet, space, readonly, onInfo, }: PropsWithChildren<SheetContextProps>) => React.JSX.Element | null;
24
+ //# sourceMappingURL=sheet-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheet-context.d.ts","sourceRoot":"","sources":["../../../../../src/components/Sheet/sheet-context.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAkD,MAAM,OAAO,CAAC;AAGtG,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,UAAU,CAAC;IAClB,UAAU,EAAE,eAAe,CAAC;IAI5B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,KAAK,IAAI,CAAC;IACnD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;IAGjD,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAIvC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAIF,eAAO,MAAM,eAAe,QAAO,gBAIlC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;AAErC,eAAO,MAAM,oBAAoB,kDAM9B,iBAAiB,CAAC,iBAAiB,CAAC,6BA8CtC,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Gets the relative client rect of an element within a parent container.
3
+ * NOTE: This is stable even when the parent is scrolling.
4
+ * https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect
5
+ * @param root Parent container (e.g., scrollable container).
6
+ * @param element
7
+ */
8
+ export declare const getRelativeClientRect: (root: HTMLElement, element: HTMLElement) => DOMRect;
9
+ /**
10
+ * Union of two rectangles.
11
+ */
12
+ export declare const getRectUnion: (b1: DOMRect, b2: DOMRect) => Pick<DOMRect, "left" | "top" | "width" | "height">;
13
+ /**
14
+ * Scroll to cell.
15
+ * We need to correct for the DOM `scrollIntoView` function which doesn't show the border.
16
+ */
17
+ export declare const scrollIntoView: (scrollContainer: HTMLElement, el: HTMLElement) => void;
18
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/components/Sheet/util.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,SAAU,WAAW,WAAW,WAAW,KAAG,OAS/E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,OAAQ,OAAO,MAAM,OAAO,KAAG,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAOxG,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,oBAAqB,WAAW,MAAM,WAAW,SAiB3E,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { type LayoutCoordinate } from '@dxos/app-framework';
3
+ import { type SheetRootProps } from './Sheet';
4
+ declare const SheetContainer: ({ sheet, space, role, coordinate, }: SheetRootProps & {
5
+ role?: string;
6
+ coordinate?: LayoutCoordinate;
7
+ }) => React.JSX.Element;
8
+ export default SheetContainer;
9
+ //# sourceMappingURL=SheetContainer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SheetContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/SheetContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAS,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAErD,QAAA,MAAM,cAAc,wCAKjB,cAAc,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,gBAAgB,CAAA;CAAE,sBAWnE,CAAC;AAEF,eAAe,cAAc,CAAC"}