@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.
- package/LICENSE +8 -0
- package/README.md +14 -0
- package/dist/lib/browser/SheetContainer-H22IDJ43.mjs +3740 -0
- package/dist/lib/browser/SheetContainer-H22IDJ43.mjs.map +7 -0
- package/dist/lib/browser/chunk-6VPEAUG6.mjs +82 -0
- package/dist/lib/browser/chunk-6VPEAUG6.mjs.map +7 -0
- package/dist/lib/browser/chunk-AT2FJXQX.mjs +861 -0
- package/dist/lib/browser/chunk-AT2FJXQX.mjs.map +7 -0
- package/dist/lib/browser/chunk-JRL5LGCE.mjs +18 -0
- package/dist/lib/browser/chunk-JRL5LGCE.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +213 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/browser/meta.mjs +9 -0
- package/dist/lib/browser/meta.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +22 -0
- package/dist/lib/browser/types.mjs.map +7 -0
- package/dist/lib/node/SheetContainer-S32KTNZ6.cjs +3731 -0
- package/dist/lib/node/SheetContainer-S32KTNZ6.cjs.map +7 -0
- package/dist/lib/node/chunk-4CE6FK5Z.cjs +108 -0
- package/dist/lib/node/chunk-4CE6FK5Z.cjs.map +7 -0
- package/dist/lib/node/chunk-BJ6ZD7MN.cjs +51 -0
- package/dist/lib/node/chunk-BJ6ZD7MN.cjs.map +7 -0
- package/dist/lib/node/chunk-FCKJ4QRM.cjs +881 -0
- package/dist/lib/node/chunk-FCKJ4QRM.cjs.map +7 -0
- package/dist/lib/node/index.cjs +226 -0
- package/dist/lib/node/index.cjs.map +7 -0
- package/dist/lib/node/meta.cjs +30 -0
- package/dist/lib/node/meta.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -0
- package/dist/lib/node/types.cjs +44 -0
- package/dist/lib/node/types.cjs.map +7 -0
- package/dist/types/src/SheetPlugin.d.ts +4 -0
- package/dist/types/src/SheetPlugin.d.ts.map +1 -0
- package/dist/types/src/components/CellEditor/CellEditor.d.ts +14 -0
- package/dist/types/src/components/CellEditor/CellEditor.d.ts.map +1 -0
- package/dist/types/src/components/CellEditor/CellEditor.stories.d.ts +29 -0
- package/dist/types/src/components/CellEditor/CellEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/CellEditor/extension.d.ts +18 -0
- package/dist/types/src/components/CellEditor/extension.d.ts.map +1 -0
- package/dist/types/src/components/CellEditor/extension.test.d.ts +2 -0
- package/dist/types/src/components/CellEditor/extension.test.d.ts.map +1 -0
- package/dist/types/src/components/CellEditor/functions.d.ts +66 -0
- package/dist/types/src/components/CellEditor/functions.d.ts.map +1 -0
- package/dist/types/src/components/CellEditor/index.d.ts +3 -0
- package/dist/types/src/components/CellEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/ComputeGraph/async-function.d.ts +52 -0
- package/dist/types/src/components/ComputeGraph/async-function.d.ts.map +1 -0
- package/dist/types/src/components/ComputeGraph/custom.d.ts +21 -0
- package/dist/types/src/components/ComputeGraph/custom.d.ts.map +1 -0
- package/dist/types/src/components/ComputeGraph/edge-function.d.ts +20 -0
- package/dist/types/src/components/ComputeGraph/edge-function.d.ts.map +1 -0
- package/dist/types/src/components/ComputeGraph/graph-context.d.ts +11 -0
- package/dist/types/src/components/ComputeGraph/graph-context.d.ts.map +1 -0
- package/dist/types/src/components/ComputeGraph/graph.browser.test.d.ts +2 -0
- package/dist/types/src/components/ComputeGraph/graph.browser.test.d.ts.map +1 -0
- package/dist/types/src/components/ComputeGraph/graph.d.ts +21 -0
- package/dist/types/src/components/ComputeGraph/graph.d.ts.map +1 -0
- package/dist/types/src/components/ComputeGraph/index.d.ts +4 -0
- package/dist/types/src/components/ComputeGraph/index.d.ts.map +1 -0
- package/dist/types/src/components/Sheet/Sheet.d.ts +55 -0
- package/dist/types/src/components/Sheet/Sheet.d.ts.map +1 -0
- package/dist/types/src/components/Sheet/Sheet.stories.d.ts +54 -0
- package/dist/types/src/components/Sheet/Sheet.stories.d.ts.map +1 -0
- package/dist/types/src/components/Sheet/formatting.d.ts +14 -0
- package/dist/types/src/components/Sheet/formatting.d.ts.map +1 -0
- package/dist/types/src/components/Sheet/grid.d.ts +52 -0
- package/dist/types/src/components/Sheet/grid.d.ts.map +1 -0
- package/dist/types/src/components/Sheet/index.d.ts +2 -0
- package/dist/types/src/components/Sheet/index.d.ts.map +1 -0
- package/dist/types/src/components/Sheet/nav.d.ts +29 -0
- package/dist/types/src/components/Sheet/nav.d.ts.map +1 -0
- package/dist/types/src/components/Sheet/sheet-context.d.ts +24 -0
- package/dist/types/src/components/Sheet/sheet-context.d.ts.map +1 -0
- package/dist/types/src/components/Sheet/util.d.ts +18 -0
- package/dist/types/src/components/Sheet/util.d.ts.map +1 -0
- package/dist/types/src/components/SheetContainer.d.ts +9 -0
- package/dist/types/src/components/SheetContainer.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +21 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +35 -0
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/common.d.ts +20 -0
- package/dist/types/src/components/Toolbar/common.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/index.d.ts +2 -0
- package/dist/types/src/components/Toolbar/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +7 -0
- package/dist/types/src/components/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +15 -0
- package/dist/types/src/meta.d.ts.map +1 -0
- package/dist/types/src/model/index.d.ts +3 -0
- package/dist/types/src/model/index.d.ts.map +1 -0
- package/dist/types/src/model/model.browser.test.d.ts +2 -0
- package/dist/types/src/model/model.browser.test.d.ts.map +1 -0
- package/dist/types/src/model/model.d.ts +142 -0
- package/dist/types/src/model/model.d.ts.map +1 -0
- package/dist/types/src/model/types.d.ts +17 -0
- package/dist/types/src/model/types.d.ts.map +1 -0
- package/dist/types/src/model/types.test.d.ts +2 -0
- package/dist/types/src/model/types.test.d.ts.map +1 -0
- package/dist/types/src/model/util.d.ts +15 -0
- package/dist/types/src/model/util.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +16 -0
- package/dist/types/src/translations.d.ts.map +1 -0
- package/dist/types/src/types.d.ts +94 -0
- package/dist/types/src/types.d.ts.map +1 -0
- package/package.json +122 -0
- package/src/SheetPlugin.tsx +150 -0
- package/src/components/CellEditor/CellEditor.stories.tsx +88 -0
- package/src/components/CellEditor/CellEditor.tsx +113 -0
- package/src/components/CellEditor/extension.test.ts +42 -0
- package/src/components/CellEditor/extension.ts +286 -0
- package/src/components/CellEditor/functions.ts +2017 -0
- package/src/components/CellEditor/index.ts +6 -0
- package/src/components/ComputeGraph/async-function.ts +148 -0
- package/src/components/ComputeGraph/custom.ts +70 -0
- package/src/components/ComputeGraph/edge-function.ts +60 -0
- package/src/components/ComputeGraph/graph-context.tsx +37 -0
- package/src/components/ComputeGraph/graph.browser.test.ts +49 -0
- package/src/components/ComputeGraph/graph.ts +52 -0
- package/src/components/ComputeGraph/index.ts +7 -0
- package/src/components/Sheet/Sheet.stories.tsx +329 -0
- package/src/components/Sheet/Sheet.tsx +1164 -0
- package/src/components/Sheet/formatting.ts +106 -0
- package/src/components/Sheet/grid.ts +191 -0
- package/src/components/Sheet/index.ts +5 -0
- package/src/components/Sheet/nav.ts +157 -0
- package/src/components/Sheet/sheet-context.tsx +101 -0
- package/src/components/Sheet/util.ts +56 -0
- package/src/components/SheetContainer.tsx +30 -0
- package/src/components/Toolbar/Toolbar.stories.tsx +36 -0
- package/src/components/Toolbar/Toolbar.tsx +198 -0
- package/src/components/Toolbar/common.tsx +72 -0
- package/src/components/Toolbar/index.ts +5 -0
- package/src/components/index.ts +10 -0
- package/src/index.ts +9 -0
- package/src/meta.tsx +18 -0
- package/src/model/index.ts +6 -0
- package/src/model/model.browser.test.ts +100 -0
- package/src/model/model.ts +480 -0
- package/src/model/types.test.ts +92 -0
- package/src/model/types.ts +71 -0
- package/src/model/util.ts +36 -0
- package/src/translations.ts +22 -0
- package/src/types.ts +110 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/ComputeGraph/graph.ts", "../../../src/components/ComputeGraph/async-function.ts", "../../../src/components/ComputeGraph/custom.ts", "../../../src/components/ComputeGraph/edge-function.ts", "../../../src/components/ComputeGraph/graph-context.tsx", "../../../src/model/types.ts", "../../../src/model/model.ts", "../../../src/model/util.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { HyperFormula } from 'hyperformula';\n\nimport { Event } from '@dxos/async';\nimport { type Space } from '@dxos/client/echo';\nimport { PublicKey } from '@dxos/keys';\nimport { log } from '@dxos/log';\n\nimport { FunctionContext } from './async-function';\nimport { CustomPlugin, CustomPluginTranslations } from './custom';\nimport { EdgeFunctionPlugin, EdgeFunctionPluginTranslations } from './edge-function';\n\n/**\n * Create root graph for space.\n */\nexport const createComputeGraph = (space?: Space): ComputeGraph => {\n // TODO(burdon): Configure.\n HyperFormula.registerFunctionPlugin(CustomPlugin, CustomPluginTranslations);\n HyperFormula.registerFunctionPlugin(EdgeFunctionPlugin, EdgeFunctionPluginTranslations);\n\n const hf = HyperFormula.buildEmpty({ licenseKey: 'gpl-v3' });\n return new ComputeGraph(hf, space);\n};\n\n/**\n * Per-space compute and dependency graph.\n */\n// TODO(burdon): Create instance for each space.\nexport class ComputeGraph {\n public readonly id = `graph-${PublicKey.random().truncate()}`;\n public readonly update = new Event();\n\n // The context is passed to all functions.\n public readonly context = new FunctionContext(this.hf, this._space, () => {\n this.refresh();\n });\n\n constructor(\n public readonly hf: HyperFormula,\n private readonly _space?: Space,\n ) {\n this.hf.updateConfig({ context: this.context });\n }\n\n refresh() {\n log('refresh', { id: this.id });\n this.update.emit();\n }\n}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { CellError, ErrorType, EmptyValue, FunctionPlugin, type HyperFormula } from 'hyperformula';\nimport { type InterpreterState } from 'hyperformula/typings/interpreter/InterpreterState';\nimport { type InterpreterValue } from 'hyperformula/typings/interpreter/InterpreterValue';\nimport { type ProcedureAst } from 'hyperformula/typings/parser';\n\nimport { debounce } from '@dxos/async';\nimport { type Space } from '@dxos/client/echo';\nimport { log } from '@dxos/log';\n\n// TODO(burdon): API gateways!\n// https://publicapis.io\n// https://api-ninjas.com/api/cryptoprice\n// https://developers.google.com/apis-explorer\n// https://publicapis.io/coin-desk-api\n\n// TODO(burdon): Create wrapper.\nexport type AsyncFunction = (...args: any) => Promise<InterpreterValue>;\n\nexport type FunctionOptions = {\n ttl?: number;\n};\n\nexport type FunctionContextOptions = {\n defaultTtl: number;\n recalculationDelay: number;\n};\n\nexport const defaultFunctionContextOptions: FunctionContextOptions = {\n defaultTtl: 5_000,\n recalculationDelay: 200,\n};\n\n/**\n * The context singleton for the model is passed into custom functions.\n *\n * HyperFormula does not support async functions.\n * - https://hyperformula.handsontable.com/guide/custom-functions.html\n * - https://hyperformula.handsontable.com/guide/known-limitations.html#known-limitations\n * - https://github.com/handsontable/hyperformula/issues/892\n */\nexport class FunctionContext {\n // Mangle name with params.\n static createInvocationKey(name: string, ...args: any) {\n return JSON.stringify({ name, ...args });\n }\n\n // Cached values for cell.\n private readonly _cache = new Map<string, { value: InterpreterValue; ts: number }>();\n\n // Active requests.\n private readonly _pending = new Map<string, number>();\n\n // Invocation count.\n private _invocations: Record<string, number> = {};\n\n private readonly _onUpdate: () => void;\n\n constructor(\n private readonly _hf: HyperFormula,\n private readonly _space: Space | undefined,\n onUpdate: (context: FunctionContext) => void,\n private readonly _options = defaultFunctionContextOptions,\n ) {\n this._onUpdate = debounce(() => {\n // TODO(burdon): Better way to trigger recalculation?\n // NOTE: rebuildAndRecalculate resets the undo history.\n this._hf.resumeEvaluation();\n onUpdate(this);\n }, this._options.recalculationDelay);\n }\n\n get space() {\n return this._space;\n }\n\n get info() {\n return { cache: this._cache.size, invocations: this._invocations };\n }\n\n flush() {\n this._cache.clear();\n this._invocations = {};\n }\n\n /**\n * Exec the function if TTL has expired.\n * Return the cached value.\n */\n invokeFunction(\n name: string,\n state: InterpreterState,\n args: any[],\n cb: AsyncFunction,\n options?: FunctionOptions,\n ): InterpreterValue | undefined {\n const ttl = options?.ttl ?? this._options.defaultTtl;\n\n const { formulaAddress: cell } = state;\n const invocationKey = FunctionContext.createInvocationKey(name, ...args);\n const { value = undefined, ts = 0 } = this._cache.get(invocationKey) ?? {};\n\n const now = Date.now();\n const delta = now - ts;\n if ((!ts || delta > ttl) && !this._pending.has(invocationKey)) {\n this._pending.set(invocationKey, now);\n setTimeout(async () => {\n this._invocations[name] = (this._invocations[name] ?? 0) + 1;\n try {\n // Exec function.\n const value = await cb(...args);\n this._cache.set(invocationKey, { value, ts: Date.now() });\n log('set', { cell, value });\n this._onUpdate();\n } catch (err) {\n // TODO(burdon): Show error to user.\n log.warn('failed', { cell, err });\n this._cache.set(invocationKey, { value: new CellError(ErrorType.ERROR, 'Function failed.'), ts: Date.now() });\n } finally {\n this._pending.delete(invocationKey);\n }\n });\n }\n\n log('invoke', { cell, name, args, cache: value });\n return value;\n }\n}\n\n/**\n * Base class for async functions.\n */\nexport class FunctionPluginAsync extends FunctionPlugin {\n get context() {\n return this.config.context as FunctionContext;\n }\n\n runAsyncFunction(ast: ProcedureAst, state: InterpreterState, cb: AsyncFunction, options?: FunctionOptions) {\n const { procedureName } = ast;\n const metadata = this.metadata(procedureName);\n return this.runFunction(ast.args, state, metadata, (...args: any) => {\n return this.context.invokeFunction(procedureName, state, args, cb, options) ?? EmptyValue;\n });\n }\n}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { FunctionArgumentType } from 'hyperformula';\nimport { type InterpreterState } from 'hyperformula/typings/interpreter/InterpreterState';\nimport { type ProcedureAst } from 'hyperformula/typings/parser';\n\nimport { getDeep } from '@dxos/util';\n\nimport { type AsyncFunction, FunctionPluginAsync } from './async-function';\n\n// TODO(burdon): Factor out.\nconst parseNumberString = (str: string): number => {\n return parseFloat(str.replace(/[^\\d.]/g, ''));\n};\n\n/**\n * https://hyperformula.handsontable.com/guide/custom-functions.html#add-a-simple-custom-function\n */\nexport class CustomPlugin extends FunctionPluginAsync {\n test(ast: ProcedureAst, state: InterpreterState) {\n const handler: AsyncFunction = async () => {\n return Math.random();\n };\n\n return this.runAsyncFunction(ast, state, handler);\n }\n\n crypto(ast: ProcedureAst, state: InterpreterState) {\n const handler: AsyncFunction = async (_currency) => {\n const currency = (_currency || 'USD').toUpperCase();\n const result = await fetch(`https://api.coindesk.com/v1/bpi/currentprice/${currency}.json`);\n const data = await result.json();\n const rate = getDeep<string>(data, ['bpi', currency, 'rate']);\n if (!rate) {\n return NaN;\n }\n\n return parseNumberString(rate);\n };\n\n return this.runAsyncFunction(ast, state, handler, { ttl: 10_000 });\n }\n}\n\nCustomPlugin.implementedFunctions = {\n TEST: {\n method: 'test',\n parameters: [],\n isVolatile: true,\n },\n\n CRYPTO: {\n method: 'crypto',\n parameters: [{ argumentType: FunctionArgumentType.STRING, optionalArg: true }],\n isVolatile: true,\n },\n};\n\nexport const CustomPluginTranslations = {\n enGB: {\n TEST: 'TEST',\n CRYPTO: 'CRYPTO',\n },\n enUS: {\n TEST: 'TEST',\n CRYPTO: 'CRYPTO',\n },\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { CellError, ErrorType, FunctionArgumentType } from 'hyperformula';\nimport { type InterpreterState } from 'hyperformula/typings/interpreter/InterpreterState';\nimport { type ProcedureAst } from 'hyperformula/typings/parser';\n\nimport { Filter, getMeta } from '@dxos/client/echo';\nimport { getUserFunctionUrlInMetadata } from '@dxos/plugin-script/edge';\nimport { ScriptType } from '@dxos/plugin-script/types';\n\nimport { type AsyncFunction, FunctionPluginAsync } from './async-function';\n\n/**\n * A hyperformula function plugin for calling EDGE functions.\n *\n * https://hyperformula.handsontable.com/guide/custom-functions.html#add-a-simple-custom-function\n */\nexport class EdgeFunctionPlugin extends FunctionPluginAsync {\n edge(ast: ProcedureAst, state: InterpreterState) {\n const handler: AsyncFunction = async (binding: string) => {\n const space = this.context.space;\n if (!space) {\n return new CellError(ErrorType.VALUE, 'No space');\n }\n\n const {\n objects: [script],\n } = await space.db.query(Filter.schema(ScriptType, { binding })).run();\n if (!script) {\n return new CellError(ErrorType.VALUE, 'No script');\n }\n\n const path = getUserFunctionUrlInMetadata(getMeta(script));\n // TODO(wittjosiah): Get base url from client config.\n const result = await fetch(`https://functions-staging.dxos.workers.dev${path}`, { method: 'POST' });\n return await result.text();\n };\n\n return this.runAsyncFunction(ast, state, handler, { ttl: 10_000 });\n }\n}\n\nEdgeFunctionPlugin.implementedFunctions = {\n EDGE: {\n method: 'edge',\n parameters: [{ argumentType: FunctionArgumentType.STRING }],\n isVolatile: true,\n },\n};\n\nexport const EdgeFunctionPluginTranslations = {\n enGB: {\n EDGE: 'EDGE',\n },\n enUS: {\n EDGE: 'EDGE',\n },\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { createContext, type PropsWithChildren, useContext, useEffect } from 'react';\n\nimport { type Space } from '@dxos/react-client/echo';\n\nimport { createComputeGraph, type ComputeGraph } from './graph';\n\nexport type ComputeGraphContextType = {\n graphs: Record<string, ComputeGraph>;\n setGraph: (key: string, graph: ComputeGraph) => void;\n};\n\nexport const ComputeGraphContext = createContext<ComputeGraphContextType>({ graphs: {}, setGraph: () => {} });\n\nexport const ComputeGraphContextProvider = ({\n children,\n graphs,\n setGraph,\n}: PropsWithChildren<ComputeGraphContextType>) => {\n return <ComputeGraphContext.Provider value={{ graphs, setGraph }}>{children}</ComputeGraphContext.Provider>;\n};\n\nexport const useComputeGraph = (space: Space): ComputeGraph => {\n const { graphs, setGraph } = useContext(ComputeGraphContext);\n const graph = graphs[space.id] ?? createComputeGraph(space);\n\n useEffect(() => {\n if (!graphs[space.id]) {\n setGraph(space.id, graph);\n }\n }, [space]);\n\n return graph;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { invariant } from '@dxos/invariant';\n\nexport const MAX_COLUMNS = 26 * 26;\n\nexport type CellAddress = { column: number; row: number };\nexport type CellRange = { from: CellAddress; to?: CellAddress };\n\nexport const posEquals = (a: CellAddress | undefined, b: CellAddress | undefined) => {\n return a?.column === b?.column && a?.row === b?.row;\n};\n\nexport const columnLetter = (column: number): string => {\n invariant(column < MAX_COLUMNS, `Invalid column: ${column}`);\n return (\n (column >= 26 ? String.fromCharCode('A'.charCodeAt(0) + Math.floor(column / 26) - 1) : '') +\n String.fromCharCode('A'.charCodeAt(0) + (column % 26))\n );\n};\n\nexport const addressToA1Notation = ({ column, row }: CellAddress): string => {\n return `${columnLetter(column)}${row + 1}`;\n};\n\nexport const addressFromA1Notation = (ref: string): CellAddress => {\n const match = ref.match(/([A-Z]+)(\\d+)/);\n invariant(match, `Invalid notation: ${ref}`);\n return {\n row: parseInt(match[2], 10) - 1,\n column: match[1].split('').reduce((acc, c) => acc * 26 + c.charCodeAt(0) - 'A'.charCodeAt(0) + 1, 0) - 1,\n };\n};\n\nexport const rangeToA1Notation = (range: CellRange) => {\n return [range?.from && addressToA1Notation(range?.from), range?.to && addressToA1Notation(range?.to)]\n .filter(Boolean)\n .join(':');\n};\n\nexport const rangeFromA1Notation = (ref: string): CellRange => {\n const [from, to] = ref.split(':').map(addressFromA1Notation);\n return { from, to };\n};\n\nexport const inRange = (range: CellRange | undefined, cell: CellAddress): boolean => {\n if (!range) {\n return false;\n }\n\n const { from, to } = range;\n if ((from && posEquals(from, cell)) || (to && posEquals(to, cell))) {\n return true;\n }\n\n if (!from || !to) {\n return false;\n }\n\n const { column: c1, row: r1 } = from;\n const { column: c2, row: r2 } = to;\n const cMin = Math.min(c1, c2);\n const cMax = Math.max(c1, c2);\n const rMin = Math.min(r1, r2);\n const rMax = Math.max(r1, r2);\n\n const { column, row } = cell;\n return column >= cMin && column <= cMax && row >= rMin && row <= rMax;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { DetailedCellError, ExportedCellChange } from 'hyperformula';\nimport { type SimpleCellRange } from 'hyperformula/typings/AbsoluteCellRange';\nimport { type SimpleCellAddress } from 'hyperformula/typings/Cell';\nimport { type SimpleDate, type SimpleDateTime } from 'hyperformula/typings/DateTimeHelper';\n\nimport { Event } from '@dxos/async';\nimport { Context } from '@dxos/context';\nimport { invariant } from '@dxos/invariant';\nimport { PublicKey } from '@dxos/keys';\nimport { log } from '@dxos/log';\n\nimport { addressFromA1Notation, addressToA1Notation, type CellAddress, type CellRange } from './types';\nimport { createIndices, RangeException, ReadonlyException } from './util';\nimport { type ComputeGraph } from '../components';\nimport { type CellScalarValue, type CellValue, type SheetType, ValueTypeEnum } from '../types';\n\n// TODO(burdon): Defaults or Max?\nconst DEFAULT_ROWS = 500;\nconst DEFAULT_COLUMNS = 26 * 2;\n\nexport type CellIndex = string;\n\nexport type CellContentValue = number | string | boolean | null;\n\nexport type SheetModelOptions = {\n readonly?: boolean;\n rows: number;\n columns: number;\n};\n\nconst typeMap: Record<string, ValueTypeEnum> = {\n BOOLEAN: ValueTypeEnum.Boolean,\n NUMBER_RAW: ValueTypeEnum.Number,\n NUMBER_PERCENT: ValueTypeEnum.Percent,\n NUMBER_CURRENCY: ValueTypeEnum.Currency,\n NUMBER_DATETIME: ValueTypeEnum.DateTime,\n NUMBER_DATE: ValueTypeEnum.Date,\n NUMBER_TIME: ValueTypeEnum.Time,\n};\n\nexport const defaultOptions: SheetModelOptions = {\n rows: 50,\n columns: 26,\n};\n\nconst getTopLeft = (range: CellRange) => {\n const to = range.to ?? range.from;\n return { row: Math.min(range.from.row, to.row), column: Math.min(range.from.column, to.column) };\n};\n\nconst toSimpleCellAddress = (sheet: number, cell: CellAddress): SimpleCellAddress => ({\n sheet,\n row: cell.row,\n col: cell.column,\n});\n\nconst toModelRange = (sheet: number, range: CellRange): SimpleCellRange => ({\n start: toSimpleCellAddress(sheet, range.from),\n end: toSimpleCellAddress(sheet, range.to ?? range.from),\n});\n\n/**\n * Spreadsheet data model.\n *\n * [ComputeGraphContext] > [SheetContext]:[SheetModel] > [Sheet.Root]\n */\nexport class SheetModel {\n public readonly id = `model-${PublicKey.random().truncate()}`;\n private _ctx?: Context = undefined;\n\n /**\n * Formula engine.\n * Acts as a write through cache for scalar and computed values.\n */\n private readonly _sheetId: number;\n private readonly _options: SheetModelOptions;\n\n public readonly update = new Event();\n\n constructor(\n private readonly _graph: ComputeGraph,\n private readonly _sheet: SheetType,\n options: Partial<SheetModelOptions> = {},\n ) {\n // Sheet for this object.\n const name = this._sheet.id;\n if (!this._graph.hf.doesSheetExist(name)) {\n this._graph.hf.addSheet(name);\n }\n this._sheetId = this._graph.hf.getSheetId(name)!;\n this._options = { ...defaultOptions, ...options };\n this.reset();\n }\n\n get graph() {\n return this._graph;\n }\n\n get sheet() {\n return this._sheet;\n }\n\n get readonly() {\n return this._options.readonly;\n }\n\n get bounds() {\n return {\n rows: this._sheet.rows.length,\n columns: this._sheet.columns.length,\n };\n }\n\n get functions(): string[] {\n return this._graph.hf.getRegisteredFunctionNames();\n }\n\n get initialized(): boolean {\n return !!this._ctx;\n }\n\n /**\n * Initialize sheet and engine.\n */\n async initialize() {\n log('initialize', { id: this.id });\n invariant(!this.initialized, 'Already initialized.');\n this._ctx = new Context();\n if (!this._sheet.rows.length) {\n this._insertIndices(this._sheet.rows, 0, this._options.rows, DEFAULT_ROWS);\n }\n if (!this._sheet.columns.length) {\n this._insertIndices(this._sheet.columns, 0, this._options.columns, DEFAULT_COLUMNS);\n }\n this.reset();\n\n // Listen for model updates (e.g., async calculations).\n const unsubscribe = this._graph.update.on(() => this.update.emit());\n this._ctx.onDispose(unsubscribe);\n\n return this;\n }\n\n async destroy() {\n log('destroy', { id: this.id });\n if (this._ctx) {\n await this._ctx.dispose();\n this._ctx = undefined;\n }\n }\n\n /**\n * Update engine.\n * NOTE: This resets the undo history.\n * @deprecated\n */\n reset() {\n this._graph.hf.clearSheet(this._sheetId);\n Object.entries(this._sheet.cells).forEach(([key, { value }]) => {\n const { column, row } = this.addressFromIndex(key);\n if (typeof value === 'string' && value.charAt(0) === '=') {\n value = this.mapFormulaIndicesToRefs(value);\n }\n\n this._graph.hf.setCellContents({ sheet: this._sheetId, row, col: column }, value);\n });\n }\n\n /**\n * Recalculate formulas.\n * NOTE: This resets the undo history.\n * https://hyperformula.handsontable.com/guide/volatile-functions.html#volatile-actions\n * @deprecated\n */\n // TODO(burdon): Remove.\n recalculate() {\n this._graph.hf.rebuildAndRecalculate();\n }\n\n insertRows(i: number, n = 1) {\n this._insertIndices(this._sheet.rows, i, n, DEFAULT_ROWS);\n this.reset();\n }\n\n insertColumns(i: number, n = 1) {\n this._insertIndices(this._sheet.columns, i, n, DEFAULT_COLUMNS);\n this.reset();\n }\n\n //\n // Undoable actions.\n // TODO(burdon): Group undoable methods; consistently update hf/sheet.\n //\n\n /**\n * Clear range of values.\n */\n clear(range: CellRange) {\n const topLeft = getTopLeft(range);\n const values = this._iterRange(range, () => null);\n this._graph.hf.setCellContents(toSimpleCellAddress(this._sheetId, topLeft), values);\n this._iterRange(range, (cell) => {\n const idx = this.addressToIndex(cell);\n delete this._sheet.cells[idx];\n });\n }\n\n cut(range: CellRange) {\n this._graph.hf.cut(toModelRange(this._sheetId, range));\n this._iterRange(range, (cell) => {\n const idx = this.addressToIndex(cell);\n delete this._sheet.cells[idx];\n });\n }\n\n copy(range: CellRange) {\n this._graph.hf.copy(toModelRange(this._sheetId, range));\n }\n\n paste(cell: CellAddress) {\n if (!this._graph.hf.isClipboardEmpty()) {\n const changes = this._graph.hf.paste(toSimpleCellAddress(this._sheetId, cell));\n for (const change of changes) {\n if (change instanceof ExportedCellChange) {\n const { address, newValue } = change;\n const idx = this.addressToIndex({ row: address.row, column: address.col });\n this._sheet.cells[idx] = { value: newValue };\n }\n }\n }\n }\n\n // TODO(burdon): Display undo/redo state.\n undo() {\n if (this._graph.hf.isThereSomethingToUndo()) {\n this._graph.hf.undo();\n this.update.emit();\n }\n }\n\n redo() {\n if (this._graph.hf.isThereSomethingToRedo()) {\n this._graph.hf.redo();\n this.update.emit();\n }\n }\n\n /**\n * Get value from sheet.\n */\n getCellValue(cell: CellAddress): CellScalarValue {\n const idx = this.addressToIndex(cell);\n return this._sheet.cells[idx]?.value ?? null;\n }\n\n /**\n * Get value as a string for editing.\n */\n getCellText(cell: CellAddress): string | undefined {\n const value = this.getCellValue(cell);\n if (value == null) {\n return undefined;\n }\n\n if (typeof value === 'string' && value.charAt(0) === '=') {\n return this.mapFormulaIndicesToRefs(value);\n } else {\n return String(value);\n }\n }\n\n /**\n * Get array of raw values from sheet.\n */\n getCellValues(range: CellRange): CellScalarValue[][] {\n return this._iterRange(range, (cell) => this.getCellValue(cell));\n }\n\n /**\n * Gets the regular or computed value from the engine.\n */\n getValue(cell: CellAddress): CellScalarValue {\n // Applies rounding and post-processing.\n const value = this._graph.hf.getCellValue(toSimpleCellAddress(this._sheetId, cell));\n if (value instanceof DetailedCellError) {\n return value.toString();\n }\n\n return value;\n }\n\n /**\n * Get value type.\n */\n getValueType(cell: CellAddress): ValueTypeEnum {\n const addr = toSimpleCellAddress(this._sheetId, cell);\n const type = this._graph.hf.getCellValueDetailedType(addr);\n return typeMap[type];\n }\n\n /**\n * Sets the value, updating the sheet and engine.\n */\n setValue(cell: CellAddress, value: CellScalarValue) {\n if (this._options.readonly) {\n throw new ReadonlyException();\n }\n\n // Reallocate if > current bounds.\n let refresh = false;\n if (cell.row >= this._sheet.rows.length) {\n this._insertIndices(this._sheet.rows, cell.row, 1, DEFAULT_ROWS);\n refresh = true;\n }\n if (cell.column >= this._sheet.columns.length) {\n this._insertIndices(this._sheet.columns, cell.column, 1, DEFAULT_COLUMNS);\n refresh = true;\n }\n if (refresh) {\n // TODO(burdon): Remove.\n this.reset();\n }\n\n // Insert into engine.\n this._graph.hf.setCellContents({ sheet: this._sheetId, row: cell.row, col: cell.column }, [[value]]);\n\n // Insert into sheet.\n const idx = this.addressToIndex(cell);\n if (value === undefined || value === null) {\n delete this._sheet.cells[idx];\n } else {\n if (typeof value === 'string' && value.charAt(0) === '=') {\n value = this.mapFormulaRefsToIndices(value);\n }\n\n this._sheet.cells[idx] = { value };\n }\n }\n\n /**\n * Sets values from a simple map.\n */\n setValues(values: Record<string, CellValue>) {\n Object.entries(values).forEach(([key, { value }]) => {\n this.setValue(addressFromA1Notation(key), value);\n });\n }\n\n /**\n * Iterate range.\n */\n private _iterRange(range: CellRange, cb: (cell: CellAddress) => CellScalarValue | void): CellScalarValue[][] {\n const to = range.to ?? range.from;\n const rowRange = [Math.min(range.from.row, to.row), Math.max(range.from.row, to.row)];\n const columnRange = [Math.min(range.from.column, to.column), Math.max(range.from.column, to.column)];\n const rows: CellScalarValue[][] = [];\n for (let row = rowRange[0]; row <= rowRange[1]; row++) {\n const rowCells: CellScalarValue[] = [];\n for (let column = columnRange[0]; column <= columnRange[1]; column++) {\n const value = cb({ row, column });\n if (value !== undefined) {\n rowCells.push(value);\n }\n }\n rows.push(rowCells);\n }\n\n return rows;\n }\n\n /**\n *\n */\n // TODO(burdon): Insert indices into sheet.\n private _insertIndices(indices: string[], i: number, n: number, max: number) {\n if (i + n > max) {\n throw new RangeException(i + n);\n }\n\n const idx = createIndices(n);\n indices.splice(i, 0, ...idx);\n }\n\n // TODO(burdon): Delete index.\n private _deleteIndices(indices: string[], i: number, n: number) {\n throw new Error('Not implemented');\n }\n\n // TODO(burdon): Move. Cannot use fractional without changing. Switch back to using unique IDs?\n private _moveIndices(indices: string[], i: number, j: number, n: number) {\n throw new Error('Not implemented');\n }\n\n //\n // Indices.\n //\n\n /**\n * E.g., \"A1\" => \"x1@y1\".\n */\n addressToIndex(cell: CellAddress): CellIndex {\n return `${this._sheet.columns[cell.column]}@${this._sheet.rows[cell.row]}`;\n }\n\n /**\n * E.g., \"x1@y1\" => \"A1\".\n */\n addressFromIndex(idx: CellIndex): CellAddress {\n const [column, row] = idx.split('@');\n return {\n column: this._sheet.columns.indexOf(column),\n row: this._sheet.rows.indexOf(row),\n };\n }\n\n /**\n * E.g., \"A1:B2\" => \"x1@y1:x2@y2\".\n */\n rangeToIndex(range: CellRange): string {\n return [range.from, range.to ?? range.from].map((cell) => this.addressToIndex(cell)).join(':');\n }\n\n /**\n * E.g., \"x1@y1:x2@y2\" => \"A1:B2\".\n */\n rangeFromIndex(idx: string): CellRange {\n const [from, to] = idx.split(':').map((idx) => this.addressFromIndex(idx));\n return { from, to };\n }\n\n /**\n * Map from A1 notation to indices.\n */\n mapFormulaRefsToIndices(formula: string): string {\n invariant(formula.charAt(0) === '=');\n return formula.replace(/([a-zA-Z]+)([0-9]+)/g, (match) => {\n return this.addressToIndex(addressFromA1Notation(match));\n });\n }\n\n /**\n * Map from indices to A1 notation.\n */\n mapFormulaIndicesToRefs(formula: string): string {\n invariant(formula.charAt(0) === '=');\n return formula.replace(/([a-zA-Z0-9]+)@([a-zA-Z0-9]+)/g, (idx) => {\n return addressToA1Notation(this.addressFromIndex(idx));\n });\n }\n\n //\n // Values\n //\n\n /**\n * https://hyperformula.handsontable.com/guide/date-and-time-handling.html#example\n * https://hyperformula.handsontable.com/api/interfaces/configparams.html#nulldate\n * NOTE: TODAY() is number of FULL days since nullDate. It will typically be -1 days from NOW().\n */\n toLocalDate(num: number): Date {\n const { year, month, day, hours, minutes, seconds } = this.toDateTime(num);\n return new Date(year, month - 1, day, hours, minutes, seconds);\n }\n\n toDateTime(num: number): SimpleDateTime {\n return this._graph.hf.numberToDateTime(num) as SimpleDateTime;\n }\n\n toDate(num: number): SimpleDate {\n return this._graph.hf.numberToDate(num) as SimpleDate;\n }\n\n toTime(num: number): SimpleDate {\n return this._graph.hf.numberToTime(num) as SimpleDate;\n }\n}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { randomBytes } from '@dxos/crypto';\n\n// TODO(burdon): Factor out from dxos/protocols to new common package.\nexport class ApiError extends Error {}\nexport class ReadonlyException extends ApiError {}\nexport class RangeException extends ApiError {\n constructor(n: number) {\n super();\n }\n}\n\n/**\n * With a string length of 8, the chance of a collision is 0.02% for a sheet with 10,000 strings.\n */\nexport const createIndex = (length = 8): string => {\n const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const charactersLength = characters.length;\n const randomBuffer = randomBytes(length);\n return Array.from(randomBuffer, (byte) => characters[byte % charactersLength]).join('');\n};\n\nexport const createIndices = (length: number): string[] => Array.from({ length }).map(() => createIndex());\n\n// TODO(burdon): Factor out.\nexport const pickOne = <T>(values: T[]): T => values[Math.floor(Math.random() * values.length)];\nexport const pickSome = <T>(values: T[], n = 1): T[] => {\n const result = new Set<T>();\n while (result.size < n) {\n result.add(pickOne(values));\n }\n return Array.from(result.values());\n};\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,oBAAoB;AAE7B,SAASC,aAAa;AAEtB,SAASC,iBAAiB;AAC1B,SAASC,OAAAA,YAAW;;;ACLpB,SAASC,WAAWC,WAAWC,YAAYC,sBAAyC;AAKpF,SAASC,gBAAgB;AAEzB,SAASC,WAAW;;AAoBb,IAAMC,gCAAwD;EACnEC,YAAY;EACZC,oBAAoB;AACtB;AAUO,IAAMC,kBAAN,MAAMA,iBAAAA;;EAEX,OAAOC,oBAAoBC,SAAiBC,MAAW;AACrD,WAAOC,KAAKC,UAAU;MAAEH;MAAM,GAAGC;IAAK,CAAA;EACxC;EAaAG,YACmBC,KACAC,QACjBC,UACiBC,WAAWb,+BAC5B;SAJiBU,MAAAA;SACAC,SAAAA;SAEAE,WAAAA;SAdFC,SAAS,oBAAIC,IAAAA;SAGbC,WAAW,oBAAID,IAAAA;SAGxBE,eAAuC,CAAC;AAU9C,SAAKC,YAAYpB,SAAS,MAAA;AAGxB,WAAKY,IAAIS,iBAAgB;A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event", "PublicKey", "log", "CellError", "ErrorType", "EmptyValue", "FunctionPlugin", "debounce", "log", "defaultFunctionContextOptions", "defaultTtl", "recalculationDelay", "FunctionContext", "createInvocationKey", "name", "args", "JSON", "stringify", "constructor", "_hf", "_space", "onUpdate", "_options", "_cache", "Map", "_pending", "_invocations", "_onUpdate", "resumeEvaluation", "space", "info", "cache", "size", "invocations", "flush", "clear", "invokeFunction", "state", "cb", "options", "ttl", "formulaAddress", "cell", "invocationKey", "value", "undefined", "ts", "get", "now", "Date", "delta", "has", "set", "setTimeout", "err", "warn", "ERROR", "delete", "FunctionPluginAsync", "context", "config", "runAsyncFunction", "ast", "procedureName", "metadata", "runFunction", "FunctionArgumentType", "getDeep", "parseNumberString", "str", "parseFloat", "replace", "CustomPlugin", "FunctionPluginAsync", "test", "ast", "state", "handler", "Math", "random", "runAsyncFunction", "crypto", "_currency", "currency", "toUpperCase", "result", "fetch", "data", "json", "rate", "getDeep", "NaN", "ttl", "implementedFunctions", "TEST", "method", "parameters", "isVolatile", "CRYPTO", "argumentType", "FunctionArgumentType", "STRING", "optionalArg", "CustomPluginTranslations", "enGB", "enUS", "CellError", "ErrorType", "FunctionArgumentType", "Filter", "getMeta", "getUserFunctionUrlInMetadata", "ScriptType", "EdgeFunctionPlugin", "FunctionPluginAsync", "edge", "ast", "state", "handler", "binding", "space", "context", "CellError", "ErrorType", "VALUE", "objects", "script", "db", "query", "Filter", "schema", "ScriptType", "run", "path", "getUserFunctionUrlInMetadata", "getMeta", "result", "fetch", "method", "text", "runAsyncFunction", "ttl", "implementedFunctions", "EDGE", "parameters", "argumentType", "FunctionArgumentType", "STRING", "isVolatile", "EdgeFunctionPluginTranslations", "enGB", "enUS", "createComputeGraph", "space", "HyperFormula", "registerFunctionPlugin", "CustomPlugin", "CustomPluginTranslations", "EdgeFunctionPlugin", "EdgeFunctionPluginTranslations", "hf", "buildEmpty", "licenseKey", "ComputeGraph", "constructor", "_space", "id", "PublicKey", "random", "truncate", "update", "Event", "context", "FunctionContext", "refresh", "updateConfig", "log", "emit", "React", "createContext", "useContext", "useEffect", "ComputeGraphContext", "createContext", "graphs", "setGraph", "ComputeGraphContextProvider", "children", "Provider", "value", "useComputeGraph", "space", "useContext", "graph", "id", "createComputeGraph", "useEffect", "invariant", "MAX_COLUMNS", "posEquals", "a", "b", "column", "row", "columnLetter", "String", "fromCharCode", "charCodeAt", "Math", "floor", "addressToA1Notation", "addressFromA1Notation", "ref", "match", "parseInt", "split", "reduce", "acc", "c", "rangeToA1Notation", "range", "from", "to", "filter", "Boolean", "join", "inRange", "range", "cell", "from", "to", "posEquals", "column", "c1", "row", "r1", "c2", "r2", "cMin", "Math", "min", "cMax", "max", "rMin", "rMax", "DetailedCellError", "ExportedCellChange", "Event", "Context", "invariant", "PublicKey", "log", "randomBytes", "ApiError", "Error", "ReadonlyException", "RangeException", "constructor", "n", "createIndex", "length", "characters", "charactersLength", "randomBuffer", "randomBytes", "Array", "from", "byte", "join", "createIndices", "map", "DEFAULT_ROWS", "DEFAULT_COLUMNS", "typeMap", "BOOLEAN", "ValueTypeEnum", "Boolean", "NUMBER_RAW", "Number", "NUMBER_PERCENT", "Percent", "NUMBER_CURRENCY", "Currency", "NUMBER_DATETIME", "DateTime", "NUMBER_DATE", "Date", "NUMBER_TIME", "Time", "defaultOptions", "rows", "columns", "getTopLeft", "range", "to", "from", "row", "Math", "min", "column", "toSimpleCellAddress", "sheet", "cell", "col", "toModelRange", "start", "end", "SheetModel", "constructor", "_graph", "_sheet", "options", "id", "PublicKey", "random", "truncate", "_ctx", "undefined", "update", "Event", "name", "hf", "doesSheetExist", "addSheet", "_sheetId", "getSheetId", "_options", "reset", "graph", "readonly", "bounds", "length", "functions", "getRegisteredFunctionNames", "initialized", "initialize", "log", "invariant", "Context", "_insertIndices", "unsubscribe", "on", "emit", "onDispose", "destroy", "dispose", "clearSheet", "Object", "entries", "cells", "forEach", "key", "value", "addressFromIndex", "charAt", "mapFormulaIndicesToRefs", "setCellContents", "recalculate", "rebuildAndRecalculate", "insertRows", "i", "n", "insertColumns", "clear", "topLeft", "values", "_iterRange", "idx", "addressToIndex", "cut", "copy", "paste", "isClipboardEmpty", "changes", "change", "ExportedCellChange", "address", "newValue", "undo", "isThereSomethingToUndo", "redo", "isThereSomethingToRedo", "getCellValue", "getCellText", "String", "getCellValues", "getValue", "DetailedCellError", "toString", "getValueType", "addr", "type", "getCellValueDetailedType", "setValue", "ReadonlyException", "refresh", "mapFormulaRefsToIndices", "setValues", "addressFromA1Notation", "cb", "rowRange", "max", "columnRange", "rowCells", "push", "indices", "RangeException", "createIndices", "splice", "_deleteIndices", "Error", "_moveIndices", "j", "split", "indexOf", "rangeToIndex", "map", "join", "rangeFromIndex", "formula", "replace", "match", "addressToA1Notation", "toLocalDate", "num", "year", "month", "day", "hours", "minutes", "seconds", "toDateTime", "numberToDateTime", "toDate", "numberToDate", "toTime", "numberToTime"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// packages/plugins/plugin-sheet/src/meta.tsx
|
|
2
|
+
import { GridNine } from "@phosphor-icons/react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { pluginMeta } from "@dxos/app-framework";
|
|
5
|
+
var SHEET_PLUGIN = "dxos.org/plugin/sheet";
|
|
6
|
+
var meta_default = pluginMeta({
|
|
7
|
+
id: SHEET_PLUGIN,
|
|
8
|
+
name: "Sheet",
|
|
9
|
+
description: "A simple spreadsheet plugin.",
|
|
10
|
+
iconComponent: (props) => /* @__PURE__ */ React.createElement(GridNine, props),
|
|
11
|
+
iconSymbol: "ph--grid-nine--regular"
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
SHEET_PLUGIN,
|
|
16
|
+
meta_default
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=chunk-JRL5LGCE.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { GridNine, type IconProps } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport { pluginMeta } from '@dxos/app-framework';\n\nexport const SHEET_PLUGIN = 'dxos.org/plugin/sheet';\n\nexport default pluginMeta({\n id: SHEET_PLUGIN,\n name: 'Sheet',\n description: 'A simple spreadsheet plugin.',\n iconComponent: (props: IconProps) => <GridNine {...props} />,\n iconSymbol: 'ph--grid-nine--regular',\n});\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,gBAAgC;AACzC,OAAOC,WAAW;AAElB,SAASC,kBAAkB;AAEpB,IAAMC,eAAe;AAE5B,IAAA,eAAeC,WAAW;EACxBC,IAAIF;EACJG,MAAM;EACNC,aAAa;EACbC,eAAe,CAACC,UAAqB,sBAAA,cAACC,UAAaD,KAAAA;EACnDE,YAAY;AACd,CAAA;",
|
|
6
|
+
"names": ["GridNine", "React", "pluginMeta", "SHEET_PLUGIN", "pluginMeta", "id", "name", "description", "iconComponent", "props", "GridNine", "iconSymbol"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ComputeGraphContextProvider,
|
|
3
|
+
SheetModel,
|
|
4
|
+
createComputeGraph
|
|
5
|
+
} from "./chunk-AT2FJXQX.mjs";
|
|
6
|
+
import {
|
|
7
|
+
SheetAction,
|
|
8
|
+
SheetType,
|
|
9
|
+
createSheet
|
|
10
|
+
} from "./chunk-6VPEAUG6.mjs";
|
|
11
|
+
import {
|
|
12
|
+
SHEET_PLUGIN,
|
|
13
|
+
meta_default
|
|
14
|
+
} from "./chunk-JRL5LGCE.mjs";
|
|
15
|
+
|
|
16
|
+
// packages/plugins/plugin-sheet/src/SheetPlugin.tsx
|
|
17
|
+
import { GridNine } from "@phosphor-icons/react";
|
|
18
|
+
import React2 from "react";
|
|
19
|
+
import { NavigationAction, parseIntentPlugin, resolvePlugin } from "@dxos/app-framework";
|
|
20
|
+
import { create } from "@dxos/echo-schema";
|
|
21
|
+
import { parseClientPlugin } from "@dxos/plugin-client";
|
|
22
|
+
import { createExtension, isActionGroup } from "@dxos/plugin-graph";
|
|
23
|
+
import { SpaceAction } from "@dxos/plugin-space";
|
|
24
|
+
import { getSpace, isEchoObject } from "@dxos/react-client/echo";
|
|
25
|
+
|
|
26
|
+
// packages/plugins/plugin-sheet/src/components/index.ts
|
|
27
|
+
import React from "react";
|
|
28
|
+
var SheetContainer = React.lazy(() => import("./SheetContainer-H22IDJ43.mjs"));
|
|
29
|
+
|
|
30
|
+
// packages/plugins/plugin-sheet/src/translations.ts
|
|
31
|
+
var translations_default = [
|
|
32
|
+
{
|
|
33
|
+
"en-US": {
|
|
34
|
+
[SHEET_PLUGIN]: {
|
|
35
|
+
"plugin name": "Sheets",
|
|
36
|
+
"sheet title placeholder": "New sheet",
|
|
37
|
+
"create sheet label": "Create sheet",
|
|
38
|
+
"create sheet section label": "Create sheet",
|
|
39
|
+
"cell placeholder": "Cell value...",
|
|
40
|
+
"toolbar left label": "Align left",
|
|
41
|
+
"toolbar left center": "Align center",
|
|
42
|
+
"toolbar left right": "Align right"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
// packages/plugins/plugin-sheet/src/SheetPlugin.tsx
|
|
49
|
+
var SheetPlugin = () => {
|
|
50
|
+
const graphs = create({});
|
|
51
|
+
const setGraph = (key, graph) => {
|
|
52
|
+
graphs[key] = graph;
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
meta: meta_default,
|
|
56
|
+
provides: {
|
|
57
|
+
context: ({ children }) => {
|
|
58
|
+
return /* @__PURE__ */ React2.createElement(ComputeGraphContextProvider, {
|
|
59
|
+
graphs,
|
|
60
|
+
setGraph
|
|
61
|
+
}, children);
|
|
62
|
+
},
|
|
63
|
+
metadata: {
|
|
64
|
+
records: {
|
|
65
|
+
[SheetType.typename]: {
|
|
66
|
+
placeholder: [
|
|
67
|
+
"sheet title placeholder",
|
|
68
|
+
{
|
|
69
|
+
ns: SHEET_PLUGIN
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
icon: (props) => /* @__PURE__ */ React2.createElement(GridNine, props),
|
|
73
|
+
iconSymbol: "ph--grid-nine--regular"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
translations: translations_default,
|
|
78
|
+
echo: {
|
|
79
|
+
schema: [
|
|
80
|
+
SheetType
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
graph: {
|
|
84
|
+
builder: (plugins) => {
|
|
85
|
+
const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;
|
|
86
|
+
const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatch;
|
|
87
|
+
if (!client || !dispatch) {
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
return createExtension({
|
|
91
|
+
id: SheetAction.CREATE,
|
|
92
|
+
filter: (node) => isActionGroup(node) && node.id.startsWith(SpaceAction.ADD_OBJECT),
|
|
93
|
+
actions: ({ node }) => {
|
|
94
|
+
const id = node.id.split("/").at(-1);
|
|
95
|
+
const [spaceId, objectId] = id?.split(":") ?? [];
|
|
96
|
+
const space = client.spaces.get().find((space2) => space2.id === spaceId);
|
|
97
|
+
const object = objectId && space?.db.getObjectById(objectId);
|
|
98
|
+
const target = objectId ? object : space;
|
|
99
|
+
if (!target) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
return [
|
|
103
|
+
{
|
|
104
|
+
id: `${SHEET_PLUGIN}/create/${node.id}`,
|
|
105
|
+
data: async () => {
|
|
106
|
+
await dispatch([
|
|
107
|
+
{
|
|
108
|
+
plugin: SHEET_PLUGIN,
|
|
109
|
+
action: SheetAction.CREATE,
|
|
110
|
+
data: {
|
|
111
|
+
space
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
action: SpaceAction.ADD_OBJECT,
|
|
116
|
+
data: {
|
|
117
|
+
target
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
action: NavigationAction.OPEN
|
|
122
|
+
}
|
|
123
|
+
]);
|
|
124
|
+
},
|
|
125
|
+
properties: {
|
|
126
|
+
label: [
|
|
127
|
+
"create sheet label",
|
|
128
|
+
{
|
|
129
|
+
ns: SHEET_PLUGIN
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
icon: (props) => /* @__PURE__ */ React2.createElement(GridNine, props),
|
|
133
|
+
iconSymbol: "ph--grid-nine--regular",
|
|
134
|
+
testId: "sheetPlugin.createObject"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
];
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
stack: {
|
|
143
|
+
creators: [
|
|
144
|
+
{
|
|
145
|
+
id: "create-stack-section-sheet",
|
|
146
|
+
testId: "sheetPlugin.createSectionSpaceSheet",
|
|
147
|
+
type: [
|
|
148
|
+
"plugin name",
|
|
149
|
+
{
|
|
150
|
+
ns: SHEET_PLUGIN
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
label: [
|
|
154
|
+
"create sheet section label",
|
|
155
|
+
{
|
|
156
|
+
ns: SHEET_PLUGIN
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
icon: (props) => /* @__PURE__ */ React2.createElement(GridNine, props),
|
|
160
|
+
intent: [
|
|
161
|
+
{
|
|
162
|
+
plugin: SHEET_PLUGIN,
|
|
163
|
+
action: SheetAction.CREATE
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
surface: {
|
|
170
|
+
component: ({ data, role = "never" }) => {
|
|
171
|
+
if (![
|
|
172
|
+
"article",
|
|
173
|
+
"section"
|
|
174
|
+
].includes(role) || !isEchoObject(data.object)) {
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
const space = getSpace(data.object);
|
|
178
|
+
return space && data.object instanceof SheetType ? /* @__PURE__ */ React2.createElement(SheetContainer, {
|
|
179
|
+
sheet: data.object,
|
|
180
|
+
space,
|
|
181
|
+
role,
|
|
182
|
+
coordinate: data.coordinate
|
|
183
|
+
}) : null;
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
intent: {
|
|
187
|
+
resolver: async (intent) => {
|
|
188
|
+
switch (intent.action) {
|
|
189
|
+
case SheetAction.CREATE: {
|
|
190
|
+
const space = intent.data?.space;
|
|
191
|
+
const sheet = createSheet();
|
|
192
|
+
const graph = graphs[space.id] ?? createComputeGraph(space);
|
|
193
|
+
const model = new SheetModel(graph, sheet);
|
|
194
|
+
await model.initialize();
|
|
195
|
+
await model.destroy();
|
|
196
|
+
return {
|
|
197
|
+
data: sheet
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// packages/plugins/plugin-sheet/src/index.ts
|
|
208
|
+
var src_default = SheetPlugin;
|
|
209
|
+
export {
|
|
210
|
+
SheetPlugin,
|
|
211
|
+
src_default as default
|
|
212
|
+
};
|
|
213
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/SheetPlugin.tsx", "../../../src/components/index.ts", "../../../src/translations.ts", "../../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type IconProps, GridNine } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport {\n NavigationAction,\n parseIntentPlugin,\n resolvePlugin,\n type PluginDefinition,\n type LayoutCoordinate,\n} from '@dxos/app-framework';\nimport { create } from '@dxos/echo-schema';\nimport { parseClientPlugin } from '@dxos/plugin-client';\nimport { type ActionGroup, createExtension, isActionGroup } from '@dxos/plugin-graph';\nimport { SpaceAction } from '@dxos/plugin-space';\nimport { getSpace, isEchoObject } from '@dxos/react-client/echo';\n\nimport { ComputeGraphContextProvider, createComputeGraph, SheetContainer, type ComputeGraph } from './components';\nimport meta, { SHEET_PLUGIN } from './meta';\nimport { SheetModel } from './model';\nimport translations from './translations';\nimport { createSheet, SheetAction, type SheetPluginProvides, SheetType } from './types';\n\nexport const SheetPlugin = (): PluginDefinition<SheetPluginProvides> => {\n const graphs = create<Record<string, ComputeGraph>>({});\n const setGraph = (key: string, graph: ComputeGraph) => {\n graphs[key] = graph;\n };\n\n return {\n meta,\n provides: {\n context: ({ children }) => {\n return (\n <ComputeGraphContextProvider graphs={graphs} setGraph={setGraph}>\n {children}\n </ComputeGraphContextProvider>\n );\n },\n metadata: {\n records: {\n [SheetType.typename]: {\n placeholder: ['sheet title placeholder', { ns: SHEET_PLUGIN }],\n icon: (props: IconProps) => <GridNine {...props} />,\n iconSymbol: 'ph--grid-nine--regular',\n },\n },\n },\n translations,\n echo: {\n schema: [SheetType],\n },\n graph: {\n builder: (plugins) => {\n const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;\n const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatch;\n if (!client || !dispatch) {\n return [];\n }\n\n return createExtension({\n id: SheetAction.CREATE,\n filter: (node): node is ActionGroup => isActionGroup(node) && node.id.startsWith(SpaceAction.ADD_OBJECT),\n actions: ({ node }) => {\n const id = node.id.split('/').at(-1);\n const [spaceId, objectId] = id?.split(':') ?? [];\n const space = client.spaces.get().find((space) => space.id === spaceId);\n const object = objectId && space?.db.getObjectById(objectId);\n const target = objectId ? object : space;\n if (!target) {\n return;\n }\n\n return [\n {\n id: `${SHEET_PLUGIN}/create/${node.id}`,\n data: async () => {\n await dispatch([\n { plugin: SHEET_PLUGIN, action: SheetAction.CREATE, data: { space } },\n { action: SpaceAction.ADD_OBJECT, data: { target } },\n { action: NavigationAction.OPEN },\n ]);\n },\n properties: {\n label: ['create sheet label', { ns: SHEET_PLUGIN }],\n icon: (props: IconProps) => <GridNine {...props} />,\n iconSymbol: 'ph--grid-nine--regular',\n testId: 'sheetPlugin.createObject',\n },\n },\n ];\n },\n });\n },\n },\n stack: {\n creators: [\n {\n id: 'create-stack-section-sheet',\n testId: 'sheetPlugin.createSectionSpaceSheet',\n type: ['plugin name', { ns: SHEET_PLUGIN }],\n label: ['create sheet section label', { ns: SHEET_PLUGIN }],\n icon: (props: any) => <GridNine {...props} />,\n intent: [\n {\n plugin: SHEET_PLUGIN,\n action: SheetAction.CREATE,\n },\n ],\n },\n ],\n },\n surface: {\n component: ({ data, role = 'never' }) => {\n if (!['article', 'section'].includes(role) || !isEchoObject(data.object)) {\n return null;\n }\n\n const space = getSpace(data.object);\n return space && data.object instanceof SheetType ? (\n <SheetContainer\n sheet={data.object}\n space={space}\n role={role}\n coordinate={data.coordinate as LayoutCoordinate}\n />\n ) : null;\n },\n },\n intent: {\n resolver: async (intent) => {\n switch (intent.action) {\n case SheetAction.CREATE: {\n const space = intent.data?.space;\n const sheet = createSheet();\n const graph = graphs[space.id] ?? createComputeGraph(space);\n const model = new SheetModel(graph, sheet);\n await model.initialize();\n await model.destroy();\n return { data: sheet };\n }\n }\n },\n },\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nexport * from './ComputeGraph';\n\n// Lazily load components for content surfaces.\nexport const SheetContainer = React.lazy(() => import('./SheetContainer'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { SHEET_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [SHEET_PLUGIN]: {\n 'plugin name': 'Sheets',\n 'sheet title placeholder': 'New sheet',\n 'create sheet label': 'Create sheet',\n 'create sheet section label': 'Create sheet',\n 'cell placeholder': 'Cell value...',\n 'toolbar left label': 'Align left',\n 'toolbar left center': 'Align center',\n 'toolbar left right': 'Align right',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { SheetPlugin } from './SheetPlugin';\n\nexport default SheetPlugin;\n\nexport * from './SheetPlugin';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAIA,SAAyBA,gBAAgB;AACzC,OAAOC,YAAW;AAElB,SACEC,kBACAC,mBACAC,qBAGK;AACP,SAASC,cAAc;AACvB,SAASC,yBAAyB;AAClC,SAA2BC,iBAAiBC,qBAAqB;AACjE,SAASC,mBAAmB;AAC5B,SAASC,UAAUC,oBAAoB;;;ACdvC,OAAOC,WAAW;AAKX,IAAMC,iBAAiBC,MAAMC,KAAK,MAAM,OAAO,+BAAA,CAAA;;;ACHtD,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACC,YAAAA,GAAe;QACd,eAAe;QACf,2BAA2B;QAC3B,sBAAsB;QACtB,8BAA8B;QAC9B,oBAAoB;QACpB,sBAAsB;QACtB,uBAAuB;QACvB,sBAAsB;MACxB;IACF;EACF;;;;AFMK,IAAMC,cAAc,MAAA;AACzB,QAAMC,SAASC,OAAqC,CAAC,CAAA;AACrD,QAAMC,WAAW,CAACC,KAAaC,UAAAA;AAC7BJ,WAAOG,GAAAA,IAAOC;EAChB;AAEA,SAAO;IACLC;IACAC,UAAU;MACRC,SAAS,CAAC,EAAEC,SAAQ,MAAE;AACpB,eACE,gBAAAC,OAAA,cAACC,6BAAAA;UAA4BV;UAAgBE;WAC1CM,QAAAA;MAGP;MACAG,UAAU;QACRC,SAAS;UACP,CAACC,UAAUC,QAAQ,GAAG;YACpBC,aAAa;cAAC;cAA2B;gBAAEC,IAAIC;cAAa;;YAC5DC,MAAM,CAACC,UAAqB,gBAAAV,OAAA,cAACW,UAAaD,KAAAA;YAC1CE,YAAY;UACd;QACF;MACF;MACAC;MACAC,MAAM;QACJC,QAAQ;UAACX;;MACX;MACAT,OAAO;QACLqB,SAAS,CAACC,YAAAA;AACR,gBAAMC,SAASC,cAAcF,SAASG,iBAAAA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UACR;YACE/B,IAAI;YACJ6B,QAAQ;YACRG,MAAM;cAAC;cAAe;gBAAElD,IAAIC;cAAa;;YACzC6C,OAAO;cAAC;cAA8B;gBAAE9C,IAAIC;cAAa;;YACzDC,MAAM,CAACC,UAAe,gBAAAV,OAAA,cAACW,UAAaD,KAAAA;YACpCa,QAAQ;cACN;gBACEyB,QAAQxC;gBACRyC,QAAQvB,YAAYC;cACtB;;UAEJ;;MAEJ;MACA+B,SAAS;QACPC,WAAW,CAAC,EAAEZ,MAAMa,OAAO,QAAO,MAAE;AAClC,cAAI,CAAC;YAAC;YAAW;YAAWC,SAASD,IAAAA,KAAS,CAACE,aAAaf,KAAKJ,MAAM,GAAG;AACxE,mBAAO;UACT;AAEA,gBAAMJ,QAAQwB,SAAShB,KAAKJ,MAAM;AAClC,iBAAOJ,SAASQ,KAAKJ,kBAAkBvC,YACrC,gBAAAJ,OAAA,cAACgE,gBAAAA;YACCC,OAAOlB,KAAKJ;YACZJ;YACAqB;YACAM,YAAYnB,KAAKmB;eAEjB;QACN;MACF;MACA3C,QAAQ;QACN4C,UAAU,OAAO5C,WAAAA;AACf,kBAAQA,OAAO0B,QAAM;YACnB,KAAKvB,YAAYC,QAAQ;AACvB,oBAAMY,QAAQhB,OAAOwB,MAAMR;AAC3B,oBAAM0B,QAAQG,YAAAA;AACd,oBAAMzE,QAAQJ,OAAOgD,MAAMd,EAAE,KAAK4C,mBAAmB9B,KAAAA;AACrD,oBAAM+B,QAAQ,IAAIC,WAAW5E,OAAOsE,KAAAA;AACpC,oBAAMK,MAAME,WAAU;AACtB,oBAAMF,MAAMG,QAAO;AACnB,qBAAO;gBAAE1B,MAAMkB;cAAM;YACvB;UACF;QACF;MACF;IACF;EACF;AACF;;;AG/IA,IAAA,cAAeS;",
|
|
6
|
+
"names": ["GridNine", "React", "NavigationAction", "parseIntentPlugin", "resolvePlugin", "create", "parseClientPlugin", "createExtension", "isActionGroup", "SpaceAction", "getSpace", "isEchoObject", "React", "SheetContainer", "React", "lazy", "SHEET_PLUGIN", "SheetPlugin", "graphs", "create", "setGraph", "key", "graph", "meta", "provides", "context", "children", "React", "ComputeGraphContextProvider", "metadata", "records", "SheetType", "typename", "placeholder", "ns", "SHEET_PLUGIN", "icon", "props", "GridNine", "iconSymbol", "translations", "echo", "schema", "builder", "plugins", "client", "resolvePlugin", "parseClientPlugin", "dispatch", "parseIntentPlugin", "intent", "createExtension", "id", "SheetAction", "CREATE", "filter", "node", "isActionGroup", "startsWith", "SpaceAction", "ADD_OBJECT", "actions", "split", "at", "spaceId", "objectId", "space", "spaces", "get", "find", "object", "db", "getObjectById", "target", "data", "plugin", "action", "NavigationAction", "OPEN", "properties", "label", "testId", "stack", "creators", "type", "surface", "component", "role", "includes", "isEchoObject", "getSpace", "SheetContainer", "sheet", "coordinate", "resolver", "createSheet", "createComputeGraph", "model", "SheetModel", "initialize", "destroy", "SheetPlugin"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-sheet/src/components/ComputeGraph/async-function.ts":{"bytes":15885,"imports":[{"path":"hyperformula","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-sheet/src/components/ComputeGraph/custom.ts":{"bytes":6745,"imports":[{"path":"hyperformula","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-sheet/src/components/ComputeGraph/async-function.ts","kind":"import-statement","original":"./async-function"}],"format":"esm"},"packages/plugins/plugin-sheet/src/components/ComputeGraph/edge-function.ts":{"bytes":6826,"imports":[{"path":"hyperformula","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-script/edge","kind":"import-statement","external":true},{"path":"@dxos/plugin-script/types","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-sheet/src/components/ComputeGraph/async-function.ts","kind":"import-statement","original":"./async-function"}],"format":"esm"},"packages/plugins/plugin-sheet/src/components/ComputeGraph/graph.ts":{"bytes":5833,"imports":[{"path":"hyperformula","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-sheet/src/components/ComputeGraph/async-function.ts","kind":"import-statement","original":"./async-function"},{"path":"packages/plugins/plugin-sheet/src/components/ComputeGraph/custom.ts","kind":"import-statement","original":"./custom"},{"path":"packages/plugins/plugin-sheet/src/components/ComputeGraph/edge-function.ts","kind":"import-statement","original":"./edge-function"}],"format":"esm"},"packages/plugins/plugin-sheet/src/components/ComputeGraph/graph-context.tsx":{"bytes":3755,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-sheet/src/components/ComputeGraph/graph.ts","kind":"import-statement","original":"./graph"}],"format":"esm"},"packages/plugins/plugin-sheet/src/components/ComputeGraph/index.ts":{"bytes":705,"imports":[{"path":"packages/plugins/plugin-sheet/src/components/ComputeGraph/custom.ts","kind":"import-statement","original":"./custom"},{"path":"packages/plugins/plugin-sheet/src/components/ComputeGraph/graph.ts","kind":"import-statement","original":"./graph"},{"path":"packages/plugins/plugin-sheet/src/components/ComputeGraph/graph-context.tsx","kind":"import-statement","original":"./graph-context"}],"format":"esm"},"packages/plugins/plugin-sheet/src/model/types.ts":{"bytes":8465,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-sheet/src/model/util.ts":{"bytes":4597,"imports":[{"path":"@dxos/crypto","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-sheet/src/meta.tsx":{"bytes":1868,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-sheet/src/types.ts":{"bytes":10263,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-sheet/src/meta.tsx","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-sheet/src/model/model.ts":{"bytes":49767,"imports":[{"path":"hyperformula","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-sheet/src/model/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/plugin-sheet/src/model/util.ts","kind":"import-statement","original":"./util"},{"path":"packages/plugins/plugin-sheet/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-sheet/src/model/index.ts":{"bytes":581,"imports":[{"path":"packages/plugins/plugin-sheet/src/model/model.ts","kind":"import-statement","original":"./model"},{"path":"packages/plugins/plugin-sheet/src/model/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-sheet/src/components/Sheet/grid.ts":{"bytes":17316,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-sheet/src/model/index.ts","kind":"import-statement","original":"../../model"}],"format":"esm"},"packages/plugins/plugin-sheet/src/components/Sheet/nav.ts":{"bytes":15441,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-sheet/src/components/Sheet/grid.ts","kind":"import-statement","original":"./grid"},{"path":"packages/plugins/plugin-sheet/src/model/index.ts","kind":"import-statement","original":"../../model"}],"format":"esm"},"packages/plugins/plugin-sheet/src/components/Sheet/formatting.ts":{"bytes":12660,"imports":[{"path":"packages/plugins/plugin-sheet/src/model/index.ts","kind":"import-statement","original":"../../model"},{"path":"packages/plugins/plugin-sheet/src/types.ts","kind":"import-statement","original":"../../types"}],"format":"esm"},"packages/plugins/plugin-sheet/src/components/Sheet/sheet-context.tsx":{"bytes":7818,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-sheet/src/components/Sheet/formatting.ts","kind":"import-statement","original":"./formatting"},{"path":"packages/plugins/plugin-sheet/src/model/index.ts","kind":"import-statement","original":"../../model"},{"path":"packages/plugins/plugin-sheet/src/components/ComputeGraph/index.ts","kind":"import-statement","original":"../ComputeGraph"}],"format":"esm"},"packages/plugins/plugin-sheet/src/components/Sheet/util.ts":{"bytes":7372,"imports":[],"format":"esm"},"packages/plugins/plugin-sheet/src/components/CellEditor/CellEditor.tsx":{"bytes":10459,"imports":[{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-sheet/src/components/CellEditor/functions.ts":{"bytes":186103,"imports":[],"format":"esm"},"packages/plugins/plugin-sheet/src/components/CellEditor/extension.ts":{"bytes":27343,"imports":[{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"codemirror-lang-spreadsheet","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-sheet/src/components/CellEditor/functions.ts","kind":"import-statement","original":"./functions"}],"format":"esm"},"packages/plugins/plugin-sheet/src/components/CellEditor/index.ts":{"bytes":618,"imports":[{"path":"packages/plugins/plugin-sheet/src/components/CellEditor/CellEditor.tsx","kind":"import-statement","original":"./CellEditor"},{"path":"packages/plugins/plugin-sheet/src/components/CellEditor/extension.ts","kind":"import-statement","original":"./extension"}],"format":"esm"},"packages/plugins/plugin-sheet/src/components/Sheet/Sheet.tsx":{"bytes":119445,"imports":[{"path":"@dnd-kit/core","kind":"import-statement","external":true},{"path":"@dnd-kit/modifiers","kind":"import-statement","external":true},{"path":"@dnd-kit/utilities","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"re-resizable","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-sheet/src/components/Sheet/grid.ts","kind":"import-statement","original":"./grid"},{"path":"packages/plugins/plugin-sheet/src/components/Sheet/nav.ts","kind":"import-statement","original":"./nav"},{"path":"packages/plugins/plugin-sheet/src/components/Sheet/sheet-context.tsx","kind":"import-statement","original":"./sheet-context"},{"path":"packages/plugins/plugin-sheet/src/components/Sheet/util.ts","kind":"import-statement","original":"./util"},{"path":"packages/plugins/plugin-sheet/src/model/index.ts","kind":"import-statement","original":"../../model"},{"path":"packages/plugins/plugin-sheet/src/components/CellEditor/index.ts","kind":"import-statement","original":"../CellEditor"}],"format":"esm"},"packages/plugins/plugin-sheet/src/components/Sheet/index.ts":{"bytes":511,"imports":[{"path":"packages/plugins/plugin-sheet/src/components/Sheet/Sheet.tsx","kind":"import-statement","original":"./Sheet"}],"format":"esm"},"packages/plugins/plugin-sheet/src/components/SheetContainer.tsx":{"bytes":3149,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-sheet/src/components/Sheet/index.ts","kind":"import-statement","original":"./Sheet"}],"format":"esm"},"packages/plugins/plugin-sheet/src/components/index.ts":{"bytes":1061,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-sheet/src/components/ComputeGraph/index.ts","kind":"import-statement","original":"./ComputeGraph"},{"path":"packages/plugins/plugin-sheet/src/components/SheetContainer.tsx","kind":"dynamic-import","original":"./SheetContainer"}],"format":"esm"},"packages/plugins/plugin-sheet/src/translations.ts":{"bytes":1989,"imports":[{"path":"packages/plugins/plugin-sheet/src/meta.tsx","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-sheet/src/SheetPlugin.tsx":{"bytes":20577,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-sheet/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-sheet/src/meta.tsx","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-sheet/src/model/index.ts","kind":"import-statement","original":"./model"},{"path":"packages/plugins/plugin-sheet/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-sheet/src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-sheet/src/index.ts":{"bytes":769,"imports":[{"path":"packages/plugins/plugin-sheet/src/SheetPlugin.tsx","kind":"import-statement","original":"./SheetPlugin"},{"path":"packages/plugins/plugin-sheet/src/SheetPlugin.tsx","kind":"import-statement","original":"./SheetPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-sheet/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10651},"packages/plugins/plugin-sheet/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-sheet/dist/lib/browser/chunk-AT2FJXQX.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-sheet/dist/lib/browser/chunk-6VPEAUG6.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-sheet/dist/lib/browser/chunk-JRL5LGCE.mjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-sheet/dist/lib/browser/SheetContainer-H22IDJ43.mjs","kind":"dynamic-import"}],"exports":["SheetPlugin","default"],"entryPoint":"packages/plugins/plugin-sheet/src/index.ts","inputs":{"packages/plugins/plugin-sheet/src/SheetPlugin.tsx":{"bytesInOutput":5284},"packages/plugins/plugin-sheet/src/components/index.ts":{"bytesInOutput":107},"packages/plugins/plugin-sheet/src/translations.ts":{"bytesInOutput":454},"packages/plugins/plugin-sheet/src/index.ts":{"bytesInOutput":31}},"bytes":6489},"packages/plugins/plugin-sheet/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-sheet/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/plugin-sheet/dist/lib/browser/chunk-JRL5LGCE.mjs","kind":"import-statement"}],"exports":["SHEET_PLUGIN","default"],"entryPoint":"packages/plugins/plugin-sheet/src/meta.tsx","inputs":{},"bytes":159},"packages/plugins/plugin-sheet/dist/lib/browser/types.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-sheet/dist/lib/browser/types.mjs":{"imports":[{"path":"packages/plugins/plugin-sheet/dist/lib/browser/chunk-6VPEAUG6.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-sheet/dist/lib/browser/chunk-JRL5LGCE.mjs","kind":"import-statement"}],"exports":["CellValue","Formatting","RowColumnMeta","SheetAction","SheetType","ValueType","ValueTypeEnum","createSheet"],"entryPoint":"packages/plugins/plugin-sheet/src/types.ts","inputs":{},"bytes":350},"packages/plugins/plugin-sheet/dist/lib/browser/SheetContainer-H22IDJ43.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":193181},"packages/plugins/plugin-sheet/dist/lib/browser/SheetContainer-H22IDJ43.mjs":{"imports":[{"path":"packages/plugins/plugin-sheet/dist/lib/browser/chunk-AT2FJXQX.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-sheet/dist/lib/browser/chunk-6VPEAUG6.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-sheet/dist/lib/browser/chunk-JRL5LGCE.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dnd-kit/core","kind":"import-statement","external":true},{"path":"@dnd-kit/modifiers","kind":"import-statement","external":true},{"path":"@dnd-kit/utilities","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"re-resizable","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@lezer/highlight","kind":"import-statement","external":true},{"path":"codemirror-lang-spreadsheet","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-sheet/src/components/SheetContainer.tsx","inputs":{"packages/plugins/plugin-sheet/src/components/SheetContainer.tsx":{"bytesInOutput":724},"packages/plugins/plugin-sheet/src/components/Sheet/Sheet.tsx":{"bytesInOutput":29137},"packages/plugins/plugin-sheet/src/components/Sheet/grid.ts":{"bytesInOutput":3517},"packages/plugins/plugin-sheet/src/components/Sheet/nav.ts":{"bytesInOutput":3414},"packages/plugins/plugin-sheet/src/components/Sheet/sheet-context.tsx":{"bytesInOutput":1643},"packages/plugins/plugin-sheet/src/components/Sheet/formatting.ts":{"bytesInOutput":2712},"packages/plugins/plugin-sheet/src/components/Sheet/util.ts":{"bytesInOutput":1375},"packages/plugins/plugin-sheet/src/components/CellEditor/CellEditor.tsx":{"bytesInOutput":2445},"packages/plugins/plugin-sheet/src/components/CellEditor/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-sheet/src/components/CellEditor/extension.ts":{"bytesInOutput":5941},"packages/plugins/plugin-sheet/src/components/CellEditor/functions.ts":{"bytesInOutput":62607},"packages/plugins/plugin-sheet/src/components/Sheet/index.ts":{"bytesInOutput":0}},"bytes":114847},"packages/plugins/plugin-sheet/dist/lib/browser/chunk-AT2FJXQX.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":49438},"packages/plugins/plugin-sheet/dist/lib/browser/chunk-AT2FJXQX.mjs":{"imports":[{"path":"packages/plugins/plugin-sheet/dist/lib/browser/chunk-6VPEAUG6.mjs","kind":"import-statement"},{"path":"hyperformula","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"hyperformula","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"hyperformula","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"hyperformula","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-script/edge","kind":"import-statement","external":true},{"path":"@dxos/plugin-script/types","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"hyperformula","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true}],"exports":["ComputeGraphContextProvider","SheetModel","addressFromA1Notation","addressToA1Notation","columnLetter","createComputeGraph","inRange","posEquals","rangeToA1Notation","useComputeGraph"],"inputs":{"packages/plugins/plugin-sheet/src/components/ComputeGraph/graph.ts":{"bytesInOutput":1133},"packages/plugins/plugin-sheet/src/components/ComputeGraph/async-function.ts":{"bytesInOutput":3341},"packages/plugins/plugin-sheet/src/components/ComputeGraph/custom.ts":{"bytesInOutput":1354},"packages/plugins/plugin-sheet/src/components/ComputeGraph/edge-function.ts":{"bytesInOutput":1384},"packages/plugins/plugin-sheet/src/components/ComputeGraph/graph-context.tsx":{"bytesInOutput":677},"packages/plugins/plugin-sheet/src/model/types.ts":{"bytesInOutput":1899},"packages/plugins/plugin-sheet/src/model/model.ts":{"bytesInOutput":11771},"packages/plugins/plugin-sheet/src/model/util.ts":{"bytesInOutput":611},"packages/plugins/plugin-sheet/src/model/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-sheet/src/components/ComputeGraph/index.ts":{"bytesInOutput":0}},"bytes":23141},"packages/plugins/plugin-sheet/dist/lib/browser/chunk-6VPEAUG6.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5005},"packages/plugins/plugin-sheet/dist/lib/browser/chunk-6VPEAUG6.mjs":{"imports":[{"path":"packages/plugins/plugin-sheet/dist/lib/browser/chunk-JRL5LGCE.mjs","kind":"import-statement"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["CellValue","Formatting","RowColumnMeta","SheetAction","SheetType","ValueType","ValueTypeEnum","createSheet"],"inputs":{"packages/plugins/plugin-sheet/src/types.ts":{"bytesInOutput":2484}},"bytes":2759},"packages/plugins/plugin-sheet/dist/lib/browser/chunk-JRL5LGCE.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":931},"packages/plugins/plugin-sheet/dist/lib/browser/chunk-JRL5LGCE.mjs":{"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["SHEET_PLUGIN","meta_default"],"inputs":{"packages/plugins/plugin-sheet/src/meta.tsx":{"bytesInOutput":412}},"bytes":546}}}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CellValue,
|
|
3
|
+
Formatting,
|
|
4
|
+
RowColumnMeta,
|
|
5
|
+
SheetAction,
|
|
6
|
+
SheetType,
|
|
7
|
+
ValueType,
|
|
8
|
+
ValueTypeEnum,
|
|
9
|
+
createSheet
|
|
10
|
+
} from "./chunk-6VPEAUG6.mjs";
|
|
11
|
+
import "./chunk-JRL5LGCE.mjs";
|
|
12
|
+
export {
|
|
13
|
+
CellValue,
|
|
14
|
+
Formatting,
|
|
15
|
+
RowColumnMeta,
|
|
16
|
+
SheetAction,
|
|
17
|
+
SheetType,
|
|
18
|
+
ValueType,
|
|
19
|
+
ValueTypeEnum,
|
|
20
|
+
createSheet
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=types.mjs.map
|