@kubuild/editor 0.0.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.
Files changed (43) hide show
  1. package/dist/asset-manager-modal.d.ts +28 -0
  2. package/dist/asset-manager-modal.d.ts.map +1 -0
  3. package/dist/box-model-editor.d.ts +29 -0
  4. package/dist/box-model-editor.d.ts.map +1 -0
  5. package/dist/canvas.d.ts +14 -0
  6. package/dist/canvas.d.ts.map +1 -0
  7. package/dist/component-panel.d.ts +8 -0
  8. package/dist/component-panel.d.ts.map +1 -0
  9. package/dist/dimension-sector-controls.d.ts +27 -0
  10. package/dist/dimension-sector-controls.d.ts.map +1 -0
  11. package/dist/editor.d.ts +16 -0
  12. package/dist/editor.d.ts.map +1 -0
  13. package/dist/export-utils.d.ts +19 -0
  14. package/dist/export-utils.d.ts.map +1 -0
  15. package/dist/icons.d.ts +8 -0
  16. package/dist/icons.d.ts.map +1 -0
  17. package/dist/import-modal.d.ts +11 -0
  18. package/dist/import-modal.d.ts.map +1 -0
  19. package/dist/index.cjs +5800 -0
  20. package/dist/index.cjs.map +1 -0
  21. package/dist/index.d.ts +18 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +5754 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/inspector-panel.d.ts +18 -0
  26. package/dist/inspector-panel.d.ts.map +1 -0
  27. package/dist/layers-panel.d.ts +8 -0
  28. package/dist/layers-panel.d.ts.map +1 -0
  29. package/dist/store.d.ts +84 -0
  30. package/dist/store.d.ts.map +1 -0
  31. package/dist/style-manager-accordion.d.ts +31 -0
  32. package/dist/style-manager-accordion.d.ts.map +1 -0
  33. package/dist/table-spreadsheet-editor.d.ts +15 -0
  34. package/dist/table-spreadsheet-editor.d.ts.map +1 -0
  35. package/dist/toolbar.d.ts +9 -0
  36. package/dist/toolbar.d.ts.map +1 -0
  37. package/dist/traits-panel.d.ts +18 -0
  38. package/dist/traits-panel.d.ts.map +1 -0
  39. package/dist/typography-sector-controls.d.ts +17 -0
  40. package/dist/typography-sector-controls.d.ts.map +1 -0
  41. package/dist/variable-picker.d.ts +21 -0
  42. package/dist/variable-picker.d.ts.map +1 -0
  43. package/package.json +70 -0
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import { AssetProvider } from '@kubuild/core';
3
+ export interface AssetManagerModalProps {
4
+ isOpen: boolean;
5
+ onClose: () => void;
6
+ /** Called with the resolved URL of the picked asset. */
7
+ onSelect: (url: string) => void;
8
+ /** Optional host-provided asset provider backing the local gallery tab. */
9
+ assetProvider?: AssetProvider;
10
+ /** Acceptable MIME types, e.g. ['image/*']. Defaults to images only. */
11
+ accept?: string[];
12
+ /** Title shown in the modal header. */
13
+ title?: string;
14
+ }
15
+ /**
16
+ * STORA-250 — Unified asset picker modal.
17
+ *
18
+ * Three sources:
19
+ * - Gallery: assets listed by the host `AssetProvider` (local `.stora` gallery).
20
+ * - URL: direct CDN / external URL entry.
21
+ * - Upload: drag-and-drop or file-picker upload, resolved via
22
+ * `assetProvider.upload` when available, otherwise an in-memory object URL.
23
+ *
24
+ * Selecting an asset immediately invokes `onSelect(url)` so the caller can
25
+ * update the target node's `src` prop instantly.
26
+ */
27
+ export declare const AssetManagerModal: React.FC<AssetManagerModalProps>;
28
+ //# sourceMappingURL=asset-manager-modal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-manager-modal.d.ts","sourceRoot":"","sources":["../src/asset-manager-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,aAAa,EAAa,MAAM,eAAe,CAAC;AAEzD,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,wDAAwD;IACxD,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,2EAA2E;IAC3E,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAoBD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA8X9D,CAAC"}
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ export interface BoxModelValues {
3
+ marginTop?: string | number;
4
+ marginRight?: string | number;
5
+ marginBottom?: string | number;
6
+ marginLeft?: string | number;
7
+ borderTopWidth?: string | number;
8
+ borderRightWidth?: string | number;
9
+ borderBottomWidth?: string | number;
10
+ borderLeftWidth?: string | number;
11
+ paddingTop?: string | number;
12
+ paddingRight?: string | number;
13
+ paddingBottom?: string | number;
14
+ paddingLeft?: string | number;
15
+ }
16
+ export interface BoxModelEditorProps {
17
+ values?: BoxModelValues | Record<string, unknown>;
18
+ onChange?: (property: string, value: string) => void;
19
+ className?: string;
20
+ disabled?: boolean;
21
+ }
22
+ export declare function parseBoxValue(val: unknown): {
23
+ num: string;
24
+ unit: string;
25
+ raw: string;
26
+ };
27
+ export declare const BoxModelEditor: React.FC<BoxModelEditorProps>;
28
+ export declare const VisualBoxModel: React.FC<BoxModelEditorProps>;
29
+ //# sourceMappingURL=box-model-editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box-model-editor.d.ts","sourceRoot":"","sources":["../src/box-model-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE7B,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,iBAAiB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAElC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClD,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAiBtF;AAmID,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAkMxD,CAAC;AAEF,eAAO,MAAM,cAAc,+BAAiB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { PageDocument } from '@kubuild/schema';
3
+ import { ComponentRegistry } from '@kubuild/components';
4
+ import { RuntimeContext, Diagnostic } from '@kubuild/core';
5
+ import { Viewport } from './store';
6
+ export interface EditorCanvasProps {
7
+ document?: PageDocument;
8
+ registry: ComponentRegistry;
9
+ context?: RuntimeContext;
10
+ viewport: Viewport;
11
+ onDiagnostic?: (diagnostic: Diagnostic) => void;
12
+ }
13
+ export declare const EditorCanvas: React.FC<EditorCanvasProps>;
14
+ //# sourceMappingURL=canvas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canvas.d.ts","sourceRoot":"","sources":["../src/canvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EACL,cAAc,EACd,UAAU,EAMX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAkB,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;CACjD;AA0CD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA+SpD,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { ComponentRegistry } from '@kubuild/components';
3
+ export interface ComponentPanelProps {
4
+ registry: ComponentRegistry;
5
+ className?: string;
6
+ }
7
+ export declare const ComponentPanel: React.FC<ComponentPanelProps>;
8
+ //# sourceMappingURL=component-panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-panel.d.ts","sourceRoot":"","sources":["../src/component-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAA0C,MAAM,qBAAqB,CAAC;AAIhG,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAcD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAmDxD,CAAC"}
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ export declare const DIMENSION_UNITS: readonly ["px", "%", "rem", "em", "vw", "vh", "auto", "none"];
3
+ export type DimensionUnit = (typeof DIMENSION_UNITS)[number];
4
+ export interface ParsedDimension {
5
+ num: string;
6
+ unit: DimensionUnit;
7
+ raw: string;
8
+ }
9
+ export declare function parseDimensionValue(val: unknown, defaultUnit?: DimensionUnit): ParsedDimension;
10
+ export interface DimensionUnitInputProps {
11
+ property: string;
12
+ label: string;
13
+ value: unknown;
14
+ onChange: (property: string, value: string) => void;
15
+ allowedUnits?: DimensionUnit[];
16
+ placeholder?: string;
17
+ disabled?: boolean;
18
+ }
19
+ export declare const DimensionUnitInput: React.FC<DimensionUnitInputProps>;
20
+ export interface DimensionSectorControlsProps {
21
+ styles?: Record<string, unknown>;
22
+ onChange: (property: string, value: string) => void;
23
+ disabled?: boolean;
24
+ className?: string;
25
+ }
26
+ export declare const DimensionSectorControls: React.FC<DimensionSectorControlsProps>;
27
+ //# sourceMappingURL=dimension-sector-controls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dimension-sector-controls.d.ts","sourceRoot":"","sources":["../src/dimension-sector-controls.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,eAAO,MAAM,eAAe,+DAAgE,CAAC;AAC7F,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,aAAa,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,OAAO,EACZ,WAAW,GAAE,aAAoB,GAChC,eAAe,CAwBjB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,YAAY,CAAC,EAAE,aAAa,EAAE,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA+HhE,CAAC;AAEF,MAAM,WAAW,4BAA4B;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAmH1E,CAAC"}
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { PageDocument } from '@kubuild/schema';
3
+ import { ComponentRegistry } from '@kubuild/components';
4
+ import { RuntimeContext, VariableCatalog, Diagnostic } from '@kubuild/core';
5
+ export interface KubuildEditorProps {
6
+ initialDocument?: PageDocument;
7
+ registry?: ComponentRegistry;
8
+ context?: RuntimeContext;
9
+ /** Host-declared bindable variables + preview-only sample values (STORA-053). Never written to the document. */
10
+ variableCatalog?: VariableCatalog;
11
+ onChange?: (doc: PageDocument) => void;
12
+ onDiagnostic?: (diagnostic: Diagnostic) => void;
13
+ className?: string;
14
+ }
15
+ export declare const KubuildEditor: React.FC<KubuildEditorProps>;
16
+ //# sourceMappingURL=editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../src/editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAkC,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAmC,MAAM,eAAe,CAAC;AAS7G,MAAM,WAAW,kBAAkB;IACjC,eAAe,CAAC,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,gHAAgH;IAChH,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAoJtD,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { PageDocument } from '@kubuild/schema';
2
+ import { ExportPackageOptions } from '@kubuild/core';
3
+ /**
4
+ * Clean a page title into a safe download filename slug
5
+ */
6
+ export declare function sanitizeDocumentFilename(name: string, extension: string): string;
7
+ /**
8
+ * Triggers a browser download of in-memory binary or text data.
9
+ */
10
+ export declare function downloadFile(data: Uint8Array | ArrayBuffer | string, filename: string, mimeType?: string): void;
11
+ /**
12
+ * Exports a PageDocument as a .stora portable archive and initiates browser download.
13
+ */
14
+ export declare function downloadDocumentAsStora(doc: PageDocument, filename?: string, options?: ExportPackageOptions): Promise<Uint8Array>;
15
+ /**
16
+ * Exports a PageDocument as a formatted JSON document and initiates browser download.
17
+ */
18
+ export declare function downloadDocumentAsJson(doc: PageDocument, filename?: string): void;
19
+ //# sourceMappingURL=export-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-utils.d.ts","sourceRoot":"","sources":["../src/export-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAiB,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAEpE;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAOhF;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,UAAU,GAAG,WAAW,GAAG,MAAM,EACvC,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,MAAmC,GAC5C,IAAI,CAcN;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,YAAY,EACjB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,UAAU,CAAC,CAarB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAIjF"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export interface ComponentIconProps {
3
+ iconOrType?: string;
4
+ className?: string;
5
+ size?: number;
6
+ }
7
+ export declare const ComponentIcon: React.FC<ComponentIconProps>;
8
+ //# sourceMappingURL=icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAgTtD,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { ComponentRegistry } from '@kubuild/components';
3
+ import { PageDocument } from '@kubuild/schema';
4
+ export interface ImportModalProps {
5
+ isOpen: boolean;
6
+ onClose: () => void;
7
+ onImport: (doc: PageDocument) => void;
8
+ registry: ComponentRegistry;
9
+ }
10
+ export declare const ImportModal: React.FC<ImportModalProps>;
11
+ //# sourceMappingURL=import-modal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-modal.d.ts","sourceRoot":"","sources":["../src/import-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAsB,MAAM,iBAAiB,CAAC;AASnE,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,IAAI,CAAC;IACtC,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAyZlD,CAAC"}