@constructive-io/sheets 0.4.1 → 0.6.0
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/README.md +19 -24
- package/dist/advanced.cjs +250 -405
- package/dist/advanced.cjs.map +1 -1
- package/dist/advanced.d.cts +9 -10
- package/dist/advanced.d.ts +9 -10
- package/dist/advanced.js +3 -3
- package/dist/auth.cjs +10 -10
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +5 -4
- package/dist/auth.d.ts +5 -4
- package/dist/auth.js +3 -3
- package/dist/{chunk-GLVZSPV2.js → chunk-4EZ6A23C.js} +4 -3
- package/dist/chunk-4EZ6A23C.js.map +1 -0
- package/dist/{chunk-3BNOZQIJ.js → chunk-KKAWMVEG.js} +11 -11
- package/dist/chunk-KKAWMVEG.js.map +1 -0
- package/dist/{chunk-FG2LRZP5.js → chunk-KOZAW264.js} +4 -3
- package/dist/chunk-KOZAW264.js.map +1 -0
- package/dist/{chunk-BWJVRYJT.js → chunk-KVPVEXWB.js} +40 -17
- package/dist/chunk-KVPVEXWB.js.map +1 -0
- package/dist/{chunk-BWKB52JB.js → chunk-LR64FLWO.js} +231 -379
- package/dist/chunk-LR64FLWO.js.map +1 -0
- package/dist/{chunk-SDKHWE7G.js → chunk-ZETPUEXH.js} +27 -2
- package/dist/chunk-ZETPUEXH.js.map +1 -0
- package/dist/{date-editor-CXKKGNL6.js → date-editor-QT47WY5T.js} +5 -3
- package/dist/date-editor-QT47WY5T.js.map +1 -0
- package/dist/{editor-props-M6Dh0P9f.d.ts → grid-cell-types-C3ARj148.d.cts} +70 -62
- package/dist/{editor-props-M6Dh0P9f.d.cts → grid-cell-types-C3ARj148.d.ts} +70 -62
- package/dist/index.cjs +564 -493
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +86 -35
- package/dist/index.d.ts +86 -35
- package/dist/index.js +264 -72
- package/dist/index.js.map +1 -1
- package/dist/{sheets-context-9u9r7Bs0.d.ts → sheets-context-B03WDhZ9.d.cts} +13 -6
- package/dist/{sheets-context-BjGIHocT.d.cts → sheets-context-DmVCOgiX.d.ts} +13 -6
- package/dist/styles.css +6 -0
- package/dist/testing.cjs +99 -33
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +11 -7
- package/dist/testing.d.ts +11 -7
- package/dist/testing.js +34 -8
- package/dist/testing.js.map +1 -1
- package/package.json +15 -16
- package/dist/chunk-3BNOZQIJ.js.map +0 -1
- package/dist/chunk-BWJVRYJT.js.map +0 -1
- package/dist/chunk-BWKB52JB.js.map +0 -1
- package/dist/chunk-FG2LRZP5.js.map +0 -1
- package/dist/chunk-GLVZSPV2.js.map +0 -1
- package/dist/chunk-SDKHWE7G.js.map +0 -1
- package/dist/date-editor-CXKKGNL6.js.map +0 -1
package/dist/advanced.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { E as EditorProps, C as CellCreationMetadata, S as SheetsCell } from './
|
|
3
|
-
export { a as SheetsCellKind } from './
|
|
4
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
|
+
import react__default, { ComponentType } from 'react';
|
|
2
|
+
import { E as EditorProps, C as CellCreationMetadata, S as SheetsCell } from './grid-cell-types-C3ARj148.cjs';
|
|
3
|
+
export { a as SheetsCellKind } from './grid-cell-types-C3ARj148.cjs';
|
|
5
4
|
import '@constructive-io/data';
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -55,13 +54,13 @@ declare const OVERLAY: {
|
|
|
55
54
|
};
|
|
56
55
|
|
|
57
56
|
interface EditorFocusTrapProps {
|
|
58
|
-
children:
|
|
57
|
+
children: react__default.ReactNode;
|
|
59
58
|
onEscape?: () => void;
|
|
60
|
-
onKeyDown?: (e:
|
|
59
|
+
onKeyDown?: (e: react__default.KeyboardEvent) => void;
|
|
61
60
|
className?: string;
|
|
62
|
-
style?:
|
|
61
|
+
style?: react__default.CSSProperties;
|
|
63
62
|
}
|
|
64
|
-
declare function EditorFocusTrap({ children, onEscape, onKeyDown, className, style }: EditorFocusTrapProps):
|
|
63
|
+
declare function EditorFocusTrap({ children, onEscape, onKeyDown, className, style }: EditorFocusTrapProps): react__default.JSX.Element;
|
|
65
64
|
|
|
66
65
|
type TargetRect = {
|
|
67
66
|
x: number;
|
|
@@ -70,13 +69,13 @@ type TargetRect = {
|
|
|
70
69
|
height: number;
|
|
71
70
|
};
|
|
72
71
|
type Props = {
|
|
73
|
-
children?:
|
|
72
|
+
children?: react__default.ReactNode;
|
|
74
73
|
debugName?: string;
|
|
75
74
|
marginPx?: number;
|
|
76
75
|
minBelowPx?: number;
|
|
77
76
|
target?: TargetRect;
|
|
78
77
|
};
|
|
79
|
-
declare function OverlayViewportGuard({ children, debugName, marginPx, minBelowPx, target }: Props):
|
|
78
|
+
declare function OverlayViewportGuard({ children, debugName, marginPx, minBelowPx, target }: Props): react__default.JSX.Element;
|
|
80
79
|
|
|
81
80
|
declare function createSheetsCell(value: unknown, metadata: CellCreationMetadata, deriveGeometry?: (value: unknown) => SheetsCell): SheetsCell;
|
|
82
81
|
|
package/dist/advanced.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { E as EditorProps, C as CellCreationMetadata, S as SheetsCell } from './
|
|
3
|
-
export { a as SheetsCellKind } from './
|
|
4
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
|
+
import react__default, { ComponentType } from 'react';
|
|
2
|
+
import { E as EditorProps, C as CellCreationMetadata, S as SheetsCell } from './grid-cell-types-C3ARj148.js';
|
|
3
|
+
export { a as SheetsCellKind } from './grid-cell-types-C3ARj148.js';
|
|
5
4
|
import '@constructive-io/data';
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -55,13 +54,13 @@ declare const OVERLAY: {
|
|
|
55
54
|
};
|
|
56
55
|
|
|
57
56
|
interface EditorFocusTrapProps {
|
|
58
|
-
children:
|
|
57
|
+
children: react__default.ReactNode;
|
|
59
58
|
onEscape?: () => void;
|
|
60
|
-
onKeyDown?: (e:
|
|
59
|
+
onKeyDown?: (e: react__default.KeyboardEvent) => void;
|
|
61
60
|
className?: string;
|
|
62
|
-
style?:
|
|
61
|
+
style?: react__default.CSSProperties;
|
|
63
62
|
}
|
|
64
|
-
declare function EditorFocusTrap({ children, onEscape, onKeyDown, className, style }: EditorFocusTrapProps):
|
|
63
|
+
declare function EditorFocusTrap({ children, onEscape, onKeyDown, className, style }: EditorFocusTrapProps): react__default.JSX.Element;
|
|
65
64
|
|
|
66
65
|
type TargetRect = {
|
|
67
66
|
x: number;
|
|
@@ -70,13 +69,13 @@ type TargetRect = {
|
|
|
70
69
|
height: number;
|
|
71
70
|
};
|
|
72
71
|
type Props = {
|
|
73
|
-
children?:
|
|
72
|
+
children?: react__default.ReactNode;
|
|
74
73
|
debugName?: string;
|
|
75
74
|
marginPx?: number;
|
|
76
75
|
minBelowPx?: number;
|
|
77
76
|
target?: TargetRect;
|
|
78
77
|
};
|
|
79
|
-
declare function OverlayViewportGuard({ children, debugName, marginPx, minBelowPx, target }: Props):
|
|
78
|
+
declare function OverlayViewportGuard({ children, debugName, marginPx, minBelowPx, target }: Props): react__default.JSX.Element;
|
|
80
79
|
|
|
81
80
|
declare function createSheetsCell(value: unknown, metadata: CellCreationMetadata, deriveGeometry?: (value: unknown) => SheetsCell): SheetsCell;
|
|
82
81
|
|
package/dist/advanced.js
CHANGED
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
createSheetsCell,
|
|
6
6
|
resolveNativeEditor,
|
|
7
7
|
wrapNativeEditor
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-LR64FLWO.js";
|
|
9
|
+
import "./chunk-ZETPUEXH.js";
|
|
10
|
+
import "./chunk-KOZAW264.js";
|
|
11
11
|
import {
|
|
12
12
|
EditorFocusTrap,
|
|
13
13
|
OVERLAY,
|
package/dist/auth.cjs
CHANGED
|
@@ -245,11 +245,11 @@ function getStorage() {
|
|
|
245
245
|
return null;
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
function setStoredToken(databaseId, accessToken, expiresAt) {
|
|
248
|
+
function setStoredToken(databaseId, accessToken, expiresAt, identityKey) {
|
|
249
249
|
const storage = getStorage();
|
|
250
250
|
if (!storage) return;
|
|
251
251
|
try {
|
|
252
|
-
const data = { accessToken, expiresAt };
|
|
252
|
+
const data = { accessToken, expiresAt, identityKey };
|
|
253
253
|
storage.setItem(storageKey(databaseId), JSON.stringify(data));
|
|
254
254
|
} catch {
|
|
255
255
|
}
|
|
@@ -363,12 +363,12 @@ function useSheetsLogin() {
|
|
|
363
363
|
if (!token) {
|
|
364
364
|
throw createInvalidCredentialsError();
|
|
365
365
|
}
|
|
366
|
-
return { token, email: credentials.email };
|
|
366
|
+
return { token, email: credentials.email, identityKey: signInResult.userId };
|
|
367
367
|
},
|
|
368
|
-
onSuccess: ({ token }) => {
|
|
368
|
+
onSuccess: ({ token, identityKey }) => {
|
|
369
369
|
const databaseId = config.databaseId || "default";
|
|
370
|
-
setStoredToken(databaseId, token.accessToken, token.expiresAt);
|
|
371
|
-
storeApi.getState().setAuthenticated(token.accessToken, token.expiresAt);
|
|
370
|
+
setStoredToken(databaseId, token.accessToken, token.expiresAt, identityKey);
|
|
371
|
+
storeApi.getState().setAuthenticated(token.accessToken, token.expiresAt, identityKey);
|
|
372
372
|
queryClient.invalidateQueries({ queryKey: ["sheets"] });
|
|
373
373
|
}
|
|
374
374
|
});
|
|
@@ -413,13 +413,13 @@ function useSheetsRegister() {
|
|
|
413
413
|
);
|
|
414
414
|
const signUpResult = result.signUp?.result;
|
|
415
415
|
const token = signUpResult ? toAuthToken(signUpResult) : null;
|
|
416
|
-
return { token, email: formData.email };
|
|
416
|
+
return { token, email: formData.email, identityKey: signUpResult?.userId ?? null };
|
|
417
417
|
},
|
|
418
|
-
onSuccess: ({ token }) => {
|
|
418
|
+
onSuccess: ({ token, identityKey }) => {
|
|
419
419
|
if (token) {
|
|
420
420
|
const databaseId = config.databaseId || "default";
|
|
421
|
-
setStoredToken(databaseId, token.accessToken, token.expiresAt);
|
|
422
|
-
storeApi.getState().setAuthenticated(token.accessToken, token.expiresAt);
|
|
421
|
+
setStoredToken(databaseId, token.accessToken, token.expiresAt, identityKey);
|
|
422
|
+
storeApi.getState().setAuthenticated(token.accessToken, token.expiresAt, identityKey);
|
|
423
423
|
}
|
|
424
424
|
queryClient.invalidateQueries({ queryKey: ["sheets"] });
|
|
425
425
|
},
|