@lumea-labs/spreadsheet 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/spreadsheet-document.d.ts +2 -2
- package/dist/spreadsheet-document.js +2 -1
- package/dist/spreadsheet-sheet.d.ts +2 -2
- package/dist/spreadsheet-sheet.js +2 -1
- package/dist/spreadsheet-skeleton.d.ts +2 -2
- package/dist/spreadsheet-skeleton.js +42 -32
- package/dist/spreadsheet-status-bar.d.ts +2 -2
- package/dist/spreadsheet-status-bar.js +2 -1
- package/dist/spreadsheet-toolbar.d.ts +2 -2
- package/dist/spreadsheet-toolbar.js +2 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export { SpreadsheetContextValue, SpreadsheetDocument, SpreadsheetDocumentProps,
|
|
|
3
3
|
export { SpreadsheetToolbar } from './spreadsheet-toolbar.js';
|
|
4
4
|
export { SpreadsheetStatusBar } from './spreadsheet-status-bar.js';
|
|
5
5
|
export { SpreadsheetSkeleton } from './spreadsheet-skeleton.js';
|
|
6
|
+
import 'react/jsx-runtime';
|
|
6
7
|
import 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { SpreadsheetSnapshot, SpreadsheetDensity, SpreadsheetLabels, SpreadsheetTheme } from './types.js';
|
|
4
4
|
|
|
@@ -60,6 +60,6 @@ interface SpreadsheetDocumentProps {
|
|
|
60
60
|
theme?: SpreadsheetTheme;
|
|
61
61
|
children: ReactNode;
|
|
62
62
|
}
|
|
63
|
-
declare function SpreadsheetDocument({ initialSnapshot, onChange, density, labels, theme, children, }: SpreadsheetDocumentProps):
|
|
63
|
+
declare function SpreadsheetDocument({ initialSnapshot, onChange, density, labels, theme, children, }: SpreadsheetDocumentProps): react_jsx_runtime.JSX.Element;
|
|
64
64
|
|
|
65
65
|
export { type SpreadsheetContextValue, SpreadsheetDocument, type SpreadsheetDocumentProps, type SpreadsheetEngineHandle, useSpreadsheetDocument, useSpreadsheetInternal };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import {
|
|
3
4
|
createContext,
|
|
4
5
|
use,
|
|
@@ -72,7 +73,7 @@ function SpreadsheetDocument({
|
|
|
72
73
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
73
74
|
[theme]
|
|
74
75
|
);
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
+
return /* @__PURE__ */ jsx(SpreadsheetContext, { value: publicValue, children: /* @__PURE__ */ jsx(SpreadsheetInternalContext, { value: internalValue, children }) });
|
|
76
77
|
}
|
|
77
78
|
export {
|
|
78
79
|
SpreadsheetDocument,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import { useEffect, useRef } from "react";
|
|
3
4
|
import {
|
|
4
5
|
useSpreadsheetDocument,
|
|
@@ -124,7 +125,7 @@ function SpreadsheetSheet() {
|
|
|
124
125
|
};
|
|
125
126
|
}, [internal]);
|
|
126
127
|
const cls = doc.meta.density === "compact" ? "min-h-0 flex-1 overflow-hidden" : "min-h-0 flex-1 overflow-hidden";
|
|
127
|
-
return /* @__PURE__ */
|
|
128
|
+
return /* @__PURE__ */ jsx("div", { ref: containerRef, className: cls });
|
|
128
129
|
}
|
|
129
130
|
export {
|
|
130
131
|
SpreadsheetSheet
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* `<SpreadsheetSkeleton>` — placeholder while Univer (~1MB engine)
|
|
@@ -6,6 +6,6 @@ import * as react from 'react';
|
|
|
6
6
|
* cells + a column-header row + a row-number rail. Same visual
|
|
7
7
|
* footprint the real sheet will fill.
|
|
8
8
|
*/
|
|
9
|
-
declare function SpreadsheetSkeleton():
|
|
9
|
+
declare function SpreadsheetSkeleton(): react_jsx_runtime.JSX.Element;
|
|
10
10
|
|
|
11
11
|
export { SpreadsheetSkeleton };
|
|
@@ -1,41 +1,51 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
function SpreadsheetSkeleton() {
|
|
3
|
-
return /* @__PURE__ */
|
|
4
|
-
|
|
5
|
-
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
Array.from({ length: 6 }, (_2, c) => /* @__PURE__ */ React.createElement(
|
|
4
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden bg-p-bg", children: [
|
|
5
|
+
/* @__PURE__ */ jsx(SkeletonStyles, {}),
|
|
6
|
+
/* @__PURE__ */ jsxs("div", { className: "flex h-8 shrink-0 items-stretch border-b border-p-line bg-p-warm/30", children: [
|
|
7
|
+
/* @__PURE__ */ jsx("div", { className: "w-10 border-r border-p-line" }),
|
|
8
|
+
Array.from({ length: 6 }, (_, i) => /* @__PURE__ */ jsx(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
className: "flex flex-1 items-center justify-center border-r border-p-line",
|
|
12
|
+
children: /* @__PURE__ */ jsx("div", { className: "fm-skeleton h-2 w-6 rounded-sm" })
|
|
13
|
+
},
|
|
14
|
+
i
|
|
15
|
+
))
|
|
16
|
+
] }),
|
|
17
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden", children: Array.from({ length: 8 }, (_, r) => /* @__PURE__ */ jsxs(
|
|
18
18
|
"div",
|
|
19
19
|
{
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
className: "flex h-8 shrink-0 items-stretch border-b border-p-line/60",
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ jsx("div", { className: "flex w-10 items-center justify-center border-r border-p-line/60 bg-p-warm/20", children: /* @__PURE__ */ jsx("div", { className: "fm-skeleton h-2 w-3 rounded-sm" }) }),
|
|
23
|
+
Array.from({ length: 6 }, (_2, c) => /* @__PURE__ */ jsx(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: "flex flex-1 items-center border-r border-p-line/40 px-2",
|
|
27
|
+
children: /* @__PURE__ */ jsx(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
className: "fm-skeleton h-2 rounded-sm",
|
|
31
|
+
style: {
|
|
32
|
+
// Vary widths so the grid doesn't look like a
|
|
33
|
+
// perfect lattice — feels more like real data.
|
|
34
|
+
width: `${30 + (r * 7 + c * 13) % 50}%`
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
},
|
|
39
|
+
c
|
|
40
|
+
))
|
|
41
|
+
]
|
|
22
42
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
className: "fm-skeleton h-2 rounded-sm",
|
|
27
|
-
style: {
|
|
28
|
-
// Vary widths so the grid doesn't look like a
|
|
29
|
-
// perfect lattice — feels more like real data.
|
|
30
|
-
width: `${30 + (r * 7 + c * 13) % 50}%`
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
)
|
|
34
|
-
))
|
|
35
|
-
))));
|
|
43
|
+
r
|
|
44
|
+
)) })
|
|
45
|
+
] });
|
|
36
46
|
}
|
|
37
47
|
function SkeletonStyles() {
|
|
38
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ jsx("style", { children: `
|
|
39
49
|
@keyframes fmSkShimmer {
|
|
40
50
|
0% { background-position: -200% 0; }
|
|
41
51
|
100% { background-position: 200% 0; }
|
|
@@ -50,7 +60,7 @@ function SkeletonStyles() {
|
|
|
50
60
|
background-size: 200% 100%;
|
|
51
61
|
animation: fmSkShimmer 1.6s ease-in-out infinite;
|
|
52
62
|
}
|
|
53
|
-
`);
|
|
63
|
+
` });
|
|
54
64
|
}
|
|
55
65
|
export {
|
|
56
66
|
SpreadsheetSkeleton
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -8,6 +8,6 @@ import { ReactNode } from 'react';
|
|
|
8
8
|
*/
|
|
9
9
|
declare function SpreadsheetStatusBar({ children }: {
|
|
10
10
|
children?: ReactNode;
|
|
11
|
-
}):
|
|
11
|
+
}): react_jsx_runtime.JSX.Element;
|
|
12
12
|
|
|
13
13
|
export { SpreadsheetStatusBar };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import { useSpreadsheetDocument } from "./spreadsheet-document";
|
|
3
4
|
function SpreadsheetStatusBar({ children }) {
|
|
4
5
|
const { meta } = useSpreadsheetDocument();
|
|
5
6
|
const cls = meta.density === "compact" ? "flex h-7 shrink-0 items-center gap-2 border-t border-p-line bg-p-surface px-2 text-[11px] text-p-ink-3" : "flex h-8 shrink-0 items-center gap-2 border-t border-p-line bg-p-surface px-3 text-[12px] text-p-ink-3";
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ jsx("div", { className: cls, children });
|
|
7
8
|
}
|
|
8
9
|
export {
|
|
9
10
|
SpreadsheetStatusBar
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -13,6 +13,6 @@ import { ReactNode } from 'react';
|
|
|
13
13
|
*/
|
|
14
14
|
declare function SpreadsheetToolbar({ children }: {
|
|
15
15
|
children?: ReactNode;
|
|
16
|
-
}):
|
|
16
|
+
}): react_jsx_runtime.JSX.Element;
|
|
17
17
|
|
|
18
18
|
export { SpreadsheetToolbar };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import { useSpreadsheetDocument } from "./spreadsheet-document";
|
|
3
4
|
function SpreadsheetToolbar({ children }) {
|
|
4
5
|
const { meta } = useSpreadsheetDocument();
|
|
5
6
|
const cls = meta.density === "compact" ? "flex h-10 shrink-0 items-center gap-1 border-b border-p-line bg-p-surface px-2" : "flex h-11 shrink-0 items-center gap-1 border-b border-p-line bg-p-surface px-3";
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ jsx("div", { className: cls, children });
|
|
7
8
|
}
|
|
8
9
|
export {
|
|
9
10
|
SpreadsheetToolbar
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumea-labs/spreadsheet",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Univer-based workbook with 9 presets (filter, sort, conditional formatting, drawing, find-replace, hyperlinks, table, note, data validation).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|