@constructive-io/sheets 0.3.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.
Files changed (55) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +188 -0
  3. package/dist/advanced.cjs +5477 -0
  4. package/dist/advanced.cjs.map +1 -0
  5. package/dist/advanced.d.cts +83 -0
  6. package/dist/advanced.d.ts +83 -0
  7. package/dist/advanced.js +34 -0
  8. package/dist/advanced.js.map +1 -0
  9. package/dist/auth.cjs +1396 -0
  10. package/dist/auth.cjs.map +1 -0
  11. package/dist/auth.d.cts +60 -0
  12. package/dist/auth.d.ts +60 -0
  13. package/dist/auth.js +19 -0
  14. package/dist/auth.js.map +1 -0
  15. package/dist/chunk-4PGPVMZB.js +670 -0
  16. package/dist/chunk-4PGPVMZB.js.map +1 -0
  17. package/dist/chunk-FNVHSOQQ.js +1314 -0
  18. package/dist/chunk-FNVHSOQQ.js.map +1 -0
  19. package/dist/chunk-GGECS2BP.js +17 -0
  20. package/dist/chunk-GGECS2BP.js.map +1 -0
  21. package/dist/chunk-GLVZSPV2.js +43 -0
  22. package/dist/chunk-GLVZSPV2.js.map +1 -0
  23. package/dist/chunk-H4JJTMP5.js +160 -0
  24. package/dist/chunk-H4JJTMP5.js.map +1 -0
  25. package/dist/chunk-ODUBS2NL.js +100 -0
  26. package/dist/chunk-ODUBS2NL.js.map +1 -0
  27. package/dist/chunk-PZL2BCWF.js +168 -0
  28. package/dist/chunk-PZL2BCWF.js.map +1 -0
  29. package/dist/chunk-TU7ATZ4X.js +4494 -0
  30. package/dist/chunk-TU7ATZ4X.js.map +1 -0
  31. package/dist/chunk-X7DHTSOX.js +21 -0
  32. package/dist/chunk-X7DHTSOX.js.map +1 -0
  33. package/dist/chunk-YDQQA46V.js +13 -0
  34. package/dist/chunk-YDQQA46V.js.map +1 -0
  35. package/dist/date-editor-CXKKGNL6.js +361 -0
  36. package/dist/date-editor-CXKKGNL6.js.map +1 -0
  37. package/dist/editor-props-M6Dh0P9f.d.cts +245 -0
  38. package/dist/editor-props-M6Dh0P9f.d.ts +245 -0
  39. package/dist/index.cjs +15861 -0
  40. package/dist/index.cjs.map +1 -0
  41. package/dist/index.d.cts +1650 -0
  42. package/dist/index.d.ts +1650 -0
  43. package/dist/index.js +8470 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/map-picker-VTKDS6CM.js +290 -0
  46. package/dist/map-picker-VTKDS6CM.js.map +1 -0
  47. package/dist/sheets-context-CojEFlaY.d.cts +214 -0
  48. package/dist/sheets-context-Da55TTR9.d.ts +214 -0
  49. package/dist/testing.cjs +1113 -0
  50. package/dist/testing.cjs.map +1 -0
  51. package/dist/testing.d.cts +45 -0
  52. package/dist/testing.d.ts +45 -0
  53. package/dist/testing.js +269 -0
  54. package/dist/testing.js.map +1 -0
  55. package/package.json +144 -0
@@ -0,0 +1,83 @@
1
+ import React__default, { ComponentType } from 'react';
2
+ import { E as EditorProps, C as CellCreationMetadata, S as SheetsCell } from './editor-props-M6Dh0P9f.cjs';
3
+ export { a as SheetsCellKind } from './editor-props-M6Dh0P9f.cjs';
4
+ import * as react_jsx_runtime from 'react/jsx-runtime';
5
+ import '@constructive-io/data';
6
+
7
+ /**
8
+ * A native editor that optionally advertises its overlay-preset width class and whether it
9
+ * commits-on-click-away (Stage B): `commitsOnBlur` editors own an `onBlur → onCommit` path,
10
+ * so the OverlayManager dismisses them with `dismissMode='commit'` (blur the input → commit)
11
+ * instead of cancelling. Editors without it keep cancel-on-outside.
12
+ */
13
+ type NativeEditor = ComponentType<EditorProps> & {
14
+ overlayPresetClass?: string;
15
+ commitsOnBlur?: boolean;
16
+ };
17
+ /**
18
+ * Tag a native editor with an overlay-preset width class so the OverlayManager can
19
+ * size the portal. Thin passthrough — the trap/guard/geometry are the manager's job.
20
+ */
21
+ declare function wrapNativeEditor(Editor: ComponentType<EditorProps>, presetClass?: string): NativeEditor;
22
+ declare const DOM_EDITOR_REGISTRY: Record<string, NativeEditor>;
23
+ /**
24
+ * Resolve the native editor for a type key. A consumer override wins (mirrors the
25
+ * glide `def.editor` precedence), else the built-in `DOM_EDITOR_REGISTRY` entry.
26
+ *
27
+ * @param typeKey - resolved cell-type key (e.g. `text`, `json`).
28
+ * @param consumer - optional per-instance override lookup (`registry.getEditorComponent`).
29
+ */
30
+ declare function resolveNativeEditor(typeKey: string, consumer?: (typeKey: string) => ComponentType<EditorProps> | undefined): NativeEditor | undefined;
31
+
32
+ /**
33
+ * Standardised overlay width presets for cell editors.
34
+ *
35
+ * Each preset defines `min-w` / `max-w` Tailwind classes so every overlay
36
+ * feels consistent while still fitting its content naturally.
37
+ *
38
+ * Usage:
39
+ * import { OVERLAY } from './overlay-presets';
40
+ * <EditorFocusTrap className={cn(OVERLAY.sm, 'bg-popover …')} />
41
+ */
42
+ /** Single-input editors — inet, date, interval, time */
43
+ declare const OVERLAY_SM = "min-w-[320px] max-w-[480px]";
44
+ /** Tag chips / expandable lists — array, url, relation, upload, tsvector */
45
+ declare const OVERLAY_MD = "min-w-[400px] max-w-[560px]";
46
+ /** Rich editors — JSON, image */
47
+ declare const OVERLAY_LG = "min-w-[480px] max-w-[720px]";
48
+ /** Full-width editors — geometry / map */
49
+ declare const OVERLAY_XL = "min-w-[600px] max-w-4xl";
50
+ declare const OVERLAY: {
51
+ readonly sm: "min-w-[320px] max-w-[480px]";
52
+ readonly md: "min-w-[400px] max-w-[560px]";
53
+ readonly lg: "min-w-[480px] max-w-[720px]";
54
+ readonly xl: "min-w-[600px] max-w-4xl";
55
+ };
56
+
57
+ interface EditorFocusTrapProps {
58
+ children: React__default.ReactNode;
59
+ onEscape?: () => void;
60
+ onKeyDown?: (e: React__default.KeyboardEvent) => void;
61
+ className?: string;
62
+ style?: React__default.CSSProperties;
63
+ }
64
+ declare function EditorFocusTrap({ children, onEscape, onKeyDown, className, style }: EditorFocusTrapProps): react_jsx_runtime.JSX.Element;
65
+
66
+ type TargetRect = {
67
+ x: number;
68
+ y: number;
69
+ width: number;
70
+ height: number;
71
+ };
72
+ type Props = {
73
+ children?: React__default.ReactNode;
74
+ debugName?: string;
75
+ marginPx?: number;
76
+ minBelowPx?: number;
77
+ target?: TargetRect;
78
+ };
79
+ declare function OverlayViewportGuard({ children, debugName, marginPx, minBelowPx, target }: Props): react_jsx_runtime.JSX.Element;
80
+
81
+ declare function createSheetsCell(value: unknown, metadata: CellCreationMetadata, deriveGeometry?: (value: unknown) => SheetsCell): SheetsCell;
82
+
83
+ export { DOM_EDITOR_REGISTRY, EditorFocusTrap, EditorProps, type NativeEditor, OVERLAY, OVERLAY_LG, OVERLAY_MD, OVERLAY_SM, OVERLAY_XL, OverlayViewportGuard, SheetsCell, createSheetsCell, resolveNativeEditor, wrapNativeEditor };
@@ -0,0 +1,83 @@
1
+ import React__default, { ComponentType } from 'react';
2
+ import { E as EditorProps, C as CellCreationMetadata, S as SheetsCell } from './editor-props-M6Dh0P9f.js';
3
+ export { a as SheetsCellKind } from './editor-props-M6Dh0P9f.js';
4
+ import * as react_jsx_runtime from 'react/jsx-runtime';
5
+ import '@constructive-io/data';
6
+
7
+ /**
8
+ * A native editor that optionally advertises its overlay-preset width class and whether it
9
+ * commits-on-click-away (Stage B): `commitsOnBlur` editors own an `onBlur → onCommit` path,
10
+ * so the OverlayManager dismisses them with `dismissMode='commit'` (blur the input → commit)
11
+ * instead of cancelling. Editors without it keep cancel-on-outside.
12
+ */
13
+ type NativeEditor = ComponentType<EditorProps> & {
14
+ overlayPresetClass?: string;
15
+ commitsOnBlur?: boolean;
16
+ };
17
+ /**
18
+ * Tag a native editor with an overlay-preset width class so the OverlayManager can
19
+ * size the portal. Thin passthrough — the trap/guard/geometry are the manager's job.
20
+ */
21
+ declare function wrapNativeEditor(Editor: ComponentType<EditorProps>, presetClass?: string): NativeEditor;
22
+ declare const DOM_EDITOR_REGISTRY: Record<string, NativeEditor>;
23
+ /**
24
+ * Resolve the native editor for a type key. A consumer override wins (mirrors the
25
+ * glide `def.editor` precedence), else the built-in `DOM_EDITOR_REGISTRY` entry.
26
+ *
27
+ * @param typeKey - resolved cell-type key (e.g. `text`, `json`).
28
+ * @param consumer - optional per-instance override lookup (`registry.getEditorComponent`).
29
+ */
30
+ declare function resolveNativeEditor(typeKey: string, consumer?: (typeKey: string) => ComponentType<EditorProps> | undefined): NativeEditor | undefined;
31
+
32
+ /**
33
+ * Standardised overlay width presets for cell editors.
34
+ *
35
+ * Each preset defines `min-w` / `max-w` Tailwind classes so every overlay
36
+ * feels consistent while still fitting its content naturally.
37
+ *
38
+ * Usage:
39
+ * import { OVERLAY } from './overlay-presets';
40
+ * <EditorFocusTrap className={cn(OVERLAY.sm, 'bg-popover …')} />
41
+ */
42
+ /** Single-input editors — inet, date, interval, time */
43
+ declare const OVERLAY_SM = "min-w-[320px] max-w-[480px]";
44
+ /** Tag chips / expandable lists — array, url, relation, upload, tsvector */
45
+ declare const OVERLAY_MD = "min-w-[400px] max-w-[560px]";
46
+ /** Rich editors — JSON, image */
47
+ declare const OVERLAY_LG = "min-w-[480px] max-w-[720px]";
48
+ /** Full-width editors — geometry / map */
49
+ declare const OVERLAY_XL = "min-w-[600px] max-w-4xl";
50
+ declare const OVERLAY: {
51
+ readonly sm: "min-w-[320px] max-w-[480px]";
52
+ readonly md: "min-w-[400px] max-w-[560px]";
53
+ readonly lg: "min-w-[480px] max-w-[720px]";
54
+ readonly xl: "min-w-[600px] max-w-4xl";
55
+ };
56
+
57
+ interface EditorFocusTrapProps {
58
+ children: React__default.ReactNode;
59
+ onEscape?: () => void;
60
+ onKeyDown?: (e: React__default.KeyboardEvent) => void;
61
+ className?: string;
62
+ style?: React__default.CSSProperties;
63
+ }
64
+ declare function EditorFocusTrap({ children, onEscape, onKeyDown, className, style }: EditorFocusTrapProps): react_jsx_runtime.JSX.Element;
65
+
66
+ type TargetRect = {
67
+ x: number;
68
+ y: number;
69
+ width: number;
70
+ height: number;
71
+ };
72
+ type Props = {
73
+ children?: React__default.ReactNode;
74
+ debugName?: string;
75
+ marginPx?: number;
76
+ minBelowPx?: number;
77
+ target?: TargetRect;
78
+ };
79
+ declare function OverlayViewportGuard({ children, debugName, marginPx, minBelowPx, target }: Props): react_jsx_runtime.JSX.Element;
80
+
81
+ declare function createSheetsCell(value: unknown, metadata: CellCreationMetadata, deriveGeometry?: (value: unknown) => SheetsCell): SheetsCell;
82
+
83
+ export { DOM_EDITOR_REGISTRY, EditorFocusTrap, EditorProps, type NativeEditor, OVERLAY, OVERLAY_LG, OVERLAY_MD, OVERLAY_SM, OVERLAY_XL, OverlayViewportGuard, SheetsCell, createSheetsCell, resolveNativeEditor, wrapNativeEditor };
@@ -0,0 +1,34 @@
1
+ "use client";
2
+ import {
3
+ DOM_EDITOR_REGISTRY,
4
+ OverlayViewportGuard,
5
+ createSheetsCell,
6
+ resolveNativeEditor,
7
+ wrapNativeEditor
8
+ } from "./chunk-TU7ATZ4X.js";
9
+ import "./chunk-H4JJTMP5.js";
10
+ import "./chunk-4PGPVMZB.js";
11
+ import {
12
+ EditorFocusTrap,
13
+ OVERLAY,
14
+ OVERLAY_LG,
15
+ OVERLAY_MD,
16
+ OVERLAY_SM,
17
+ OVERLAY_XL
18
+ } from "./chunk-PZL2BCWF.js";
19
+ import "./chunk-YDQQA46V.js";
20
+ import "./chunk-X7DHTSOX.js";
21
+ export {
22
+ DOM_EDITOR_REGISTRY,
23
+ EditorFocusTrap,
24
+ OVERLAY,
25
+ OVERLAY_LG,
26
+ OVERLAY_MD,
27
+ OVERLAY_SM,
28
+ OVERLAY_XL,
29
+ OverlayViewportGuard,
30
+ createSheetsCell,
31
+ resolveNativeEditor,
32
+ wrapNativeEditor
33
+ };
34
+ //# sourceMappingURL=advanced.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}