@ankhorage/studio 0.0.16 → 0.0.18

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 (58) hide show
  1. package/README.md +1 -1
  2. package/dist/core/StudioContext.d.ts +6 -0
  3. package/dist/core/StudioContext.d.ts.map +1 -0
  4. package/dist/core/StudioContext.js +10 -0
  5. package/dist/core/StudioContext.js.map +1 -0
  6. package/dist/core/StudioProvider.d.ts +9 -0
  7. package/dist/core/StudioProvider.d.ts.map +1 -0
  8. package/dist/core/StudioProvider.js +92 -0
  9. package/dist/core/StudioProvider.js.map +1 -0
  10. package/dist/core/studioPackageBoundary.d.ts +2 -0
  11. package/dist/core/studioPackageBoundary.d.ts.map +1 -0
  12. package/dist/core/studioPackageBoundary.js +2 -0
  13. package/dist/core/studioPackageBoundary.js.map +1 -0
  14. package/dist/dnd/index.d.ts +3 -0
  15. package/dist/dnd/index.d.ts.map +1 -0
  16. package/dist/dnd/index.js +3 -0
  17. package/dist/dnd/index.js.map +1 -0
  18. package/dist/dnd/primitives.d.ts +2 -0
  19. package/dist/dnd/primitives.d.ts.map +1 -0
  20. package/dist/dnd/primitives.js +2 -0
  21. package/dist/dnd/primitives.js.map +1 -0
  22. package/dist/dnd/state.d.ts +6 -0
  23. package/dist/dnd/state.d.ts.map +1 -0
  24. package/dist/dnd/state.js +5 -0
  25. package/dist/dnd/state.js.map +1 -0
  26. package/dist/runtime/actionSuppression.d.ts +4 -0
  27. package/dist/runtime/actionSuppression.d.ts.map +1 -0
  28. package/dist/runtime/actionSuppression.js +5 -0
  29. package/dist/runtime/actionSuppression.js.map +1 -0
  30. package/dist/runtime/index.d.ts +5 -0
  31. package/dist/runtime/index.d.ts.map +1 -0
  32. package/dist/runtime/index.js +5 -0
  33. package/dist/runtime/index.js.map +1 -0
  34. package/dist/runtime/localizationPreview.d.ts +12 -0
  35. package/dist/runtime/localizationPreview.d.ts.map +1 -0
  36. package/dist/runtime/localizationPreview.js +11 -0
  37. package/dist/runtime/localizationPreview.js.map +1 -0
  38. package/dist/runtime/previewRegistry.d.ts +7 -0
  39. package/dist/runtime/previewRegistry.d.ts.map +1 -0
  40. package/dist/runtime/previewRegistry.js +4 -0
  41. package/dist/runtime/previewRegistry.js.map +1 -0
  42. package/dist/runtime/previewRuntimeConfig.d.ts +7 -0
  43. package/dist/runtime/previewRuntimeConfig.d.ts.map +1 -0
  44. package/dist/runtime/previewRuntimeConfig.js +7 -0
  45. package/dist/runtime/previewRuntimeConfig.js.map +1 -0
  46. package/dist/ui/AnkhStudio.d.ts +8 -0
  47. package/dist/ui/AnkhStudio.d.ts.map +1 -0
  48. package/dist/ui/AnkhStudio.js +13 -0
  49. package/dist/ui/AnkhStudio.js.map +1 -0
  50. package/dist/ui/useStudioAppBarAugmentation.d.ts +9 -0
  51. package/dist/ui/useStudioAppBarAugmentation.d.ts.map +1 -0
  52. package/dist/ui/useStudioAppBarAugmentation.js +4 -0
  53. package/dist/ui/useStudioAppBarAugmentation.js.map +1 -0
  54. package/dist/utils/treeUtils.d.ts +3 -0
  55. package/dist/utils/treeUtils.d.ts.map +1 -0
  56. package/dist/utils/treeUtils.js +3 -0
  57. package/dist/utils/treeUtils.js.map +1 -0
  58. package/package.json +59 -1
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # @ankhorage/studio
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v0.0.15](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v0.0.17](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
7
7
 
8
8
  Standalone Studio authoring package for Ankhorage apps.
9
9
 
@@ -0,0 +1,6 @@
1
+ import type { StudioContextValue } from '../index';
2
+ export type { StudioAdminRoutePath, StudioPanelId, ThemeUpdates } from '../index';
3
+ export type StudioContextType = StudioContextValue;
4
+ export declare const StudioContext: import("react").Context<StudioContextValue | undefined>;
5
+ export declare const useStudio: () => StudioContextValue;
6
+ //# sourceMappingURL=StudioContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StudioContext.d.ts","sourceRoot":"","sources":["../../src/core/StudioContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAClF,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAEnD,eAAO,MAAM,aAAa,yDAA0D,CAAC;AAErF,eAAO,MAAM,SAAS,0BAMrB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { createContext, useContext } from 'react';
2
+ export const StudioContext = createContext(undefined);
3
+ export const useStudio = () => {
4
+ const context = useContext(StudioContext);
5
+ if (!context) {
6
+ throw new Error('useStudio must be used within a StudioProvider');
7
+ }
8
+ return context;
9
+ };
10
+ //# sourceMappingURL=StudioContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StudioContext.js","sourceRoot":"","sources":["../../src/core/StudioContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAOlD,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAgC,SAAS,CAAC,CAAC;AAErF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React, { type ReactNode } from 'react';
2
+ import { type StudioContextValue, type StudioManifest } from '../index';
3
+ export interface StudioProviderProps {
4
+ children: ReactNode;
5
+ projectId: string;
6
+ initialManifest?: StudioManifest | null;
7
+ }
8
+ export declare const StudioProvider: ({ children, projectId, initialManifest, }: StudioProviderProps) => React.FunctionComponentElement<React.ProviderProps<StudioContextValue | undefined>>;
9
+ //# sourceMappingURL=StudioProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StudioProvider.d.ts","sourceRoot":"","sources":["../../src/core/StudioProvider.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAEjE,OAAO,EAKL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EAOpB,MAAM,UAAU,CAAC;AAGlB,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;CACzC;AA4BD,eAAO,MAAM,cAAc,GAAI,2CAI5B,mBAAmB,wFAqFrB,CAAC"}
@@ -0,0 +1,92 @@
1
+ import React, { useMemo, useState } from 'react';
2
+ import { findNodeById, } from '../index';
3
+ import { StudioContext } from './StudioContext';
4
+ const noop = () => undefined;
5
+ const noopAsync = () => Promise.resolve();
6
+ const resolveActiveRootNode = (manifest, activeScreenId) => {
7
+ if (!manifest) {
8
+ return null;
9
+ }
10
+ const route = manifest.navigator.routes.find((candidate) => candidate.screenId === activeScreenId) ??
11
+ manifest.navigator.routes.find((candidate) => candidate.name === manifest.navigator.initialRouteName) ??
12
+ manifest.navigator.routes[0];
13
+ const screenId = activeScreenId ?? route?.screenId;
14
+ if (!screenId) {
15
+ return null;
16
+ }
17
+ return manifest.screens[screenId]?.root ?? null;
18
+ };
19
+ export const StudioProvider = ({ children, projectId, initialManifest = null, }) => {
20
+ const [manifest, setManifest] = useState(initialManifest);
21
+ const [activePanelId, setActivePanelId] = useState(null);
22
+ const [activeAdminRoutePath, setActiveAdminRoutePath] = useState('/');
23
+ const [activeCanvasDragNodeId, setActiveCanvasDragNodeId] = useState(null);
24
+ const [activeScreenId, setActiveScreenId] = useState(null);
25
+ const [selectedNodeId, selectNode] = useState(null);
26
+ const [studioMode, setStudioMode] = useState('dark');
27
+ const [previewMode, setPreviewMode] = useState(false);
28
+ const [activeLocale, setActiveLocale] = useState('en');
29
+ const rootNode = useMemo(() => resolveActiveRootNode(manifest, activeScreenId), [activeScreenId, manifest]);
30
+ const value = useMemo(() => ({
31
+ projectId,
32
+ activeLocale,
33
+ activeScreenId,
34
+ selectedNodeId,
35
+ activePanelId,
36
+ activeAdminRoutePath,
37
+ activeCanvasDragNodeId,
38
+ studioMode,
39
+ previewMode,
40
+ saveStatus: 'idle',
41
+ isLoading: false,
42
+ error: null,
43
+ manifest,
44
+ rootNode,
45
+ selectNode,
46
+ setActivePanelId,
47
+ setActiveAdminRoutePath,
48
+ setActiveCanvasDragNodeId,
49
+ updateNode: noop,
50
+ updateAppData: (data) => setManifest((current) => (current ? { ...current, data } : current)),
51
+ updateDataBindings: (dataBindings) => setManifest((current) => (current ? { ...current, dataBindings } : current)),
52
+ updateDataSources: (dataSources) => setManifest((current) => (current ? { ...current, dataSources } : current)),
53
+ deleteNode: noop,
54
+ insertFromCatalogEntry: (_entry) => false,
55
+ moveNodeToPlacement: (_nodeId, _placement) => false,
56
+ addScreen: noop,
57
+ deleteScreen: noop,
58
+ setNavigatorType: (_type) => undefined,
59
+ setNavigatorInitialRoute: noop,
60
+ addTheme: noop,
61
+ updateTheme: (_id, _updates) => undefined,
62
+ deleteTheme: noop,
63
+ setActiveThemeId: noop,
64
+ setActiveThemeMode: setStudioMode,
65
+ updateModuleConfig: (_moduleId, _config) => undefined,
66
+ updateOAuthProviders: (_providers) => undefined,
67
+ moveNode: noop,
68
+ reorderScreens: (_newRoutes) => undefined,
69
+ setActiveScreenId,
70
+ findNode: findNodeById,
71
+ setStudioMode,
72
+ togglePreviewMode: () => setPreviewMode((current) => !current),
73
+ t: (key) => key,
74
+ setActiveLocale,
75
+ reloadDictionaries: noopAsync,
76
+ refetchManifest: noopAsync,
77
+ }), [
78
+ activeAdminRoutePath,
79
+ activeCanvasDragNodeId,
80
+ activeLocale,
81
+ activePanelId,
82
+ activeScreenId,
83
+ manifest,
84
+ previewMode,
85
+ projectId,
86
+ rootNode,
87
+ selectedNodeId,
88
+ studioMode,
89
+ ]);
90
+ return React.createElement(StudioContext.Provider, { value }, children);
91
+ };
92
+ //# sourceMappingURL=StudioProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StudioProvider.js","sourceRoot":"","sources":["../../src/core/StudioProvider.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,EAAkB,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,EACL,YAAY,GAYb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAQhD,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC;AAC7B,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;AAE1C,MAAM,qBAAqB,GAAG,CAC5B,QAA+B,EAC/B,cAAqC,EACtB,EAAE;IACjB,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,KAAK,GACT,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC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2
+ //# sourceMappingURL=studioPackageBoundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"studioPackageBoundary.d.ts","sourceRoot":"","sources":["../../src/core/studioPackageBoundary.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,EAAG,mBAA4B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const STANDALONE_STUDIO_PACKAGE_NAME = '@ankhorage/studio';
2
+ //# sourceMappingURL=studioPackageBoundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"studioPackageBoundary.js","sourceRoot":"","sources":["../../src/core/studioPackageBoundary.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,8BAA8B,GAAG,mBAA4B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './primitives';
2
+ export * from './state';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dnd/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './primitives';
2
+ export * from './state';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dnd/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from '@ankhorage/react-native-reanimated-dnd-web';
2
+ //# sourceMappingURL=primitives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/dnd/primitives.ts"],"names":[],"mappings":"AAAA,cAAc,4CAA4C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from '@ankhorage/react-native-reanimated-dnd-web';
2
+ //# sourceMappingURL=primitives.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../src/dnd/primitives.ts"],"names":[],"mappings":"AAAA,cAAc,4CAA4C,CAAC"}
@@ -0,0 +1,6 @@
1
+ export interface StudioDragState {
2
+ readonly activeNodeId: string | null;
3
+ readonly activeDropZoneId: string | null;
4
+ }
5
+ export declare const createIdleStudioDragState: () => StudioDragState;
6
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/dnd/state.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1C;AAED,eAAO,MAAM,yBAAyB,QAAO,eAG3C,CAAC"}
@@ -0,0 +1,5 @@
1
+ export const createIdleStudioDragState = () => ({
2
+ activeNodeId: null,
3
+ activeDropZoneId: null,
4
+ });
5
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/dnd/state.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAoB,EAAE,CAAC,CAAC;IAC/D,YAAY,EAAE,IAAI;IAClB,gBAAgB,EAAE,IAAI;CACvB,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { RuntimeRendererConfig } from '@ankhorage/runtime';
2
+ export declare const shouldSuppressStudioRuntimeActions: (previewMode: boolean) => boolean;
3
+ export declare const createStudioActionSuppressionConfig: (previewMode: boolean) => RuntimeRendererConfig;
4
+ //# sourceMappingURL=actionSuppression.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actionSuppression.d.ts","sourceRoot":"","sources":["../../src/runtime/actionSuppression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,eAAO,MAAM,kCAAkC,GAAI,aAAa,OAAO,KAAG,OAAuB,CAAC;AAElG,eAAO,MAAM,mCAAmC,GAC9C,aAAa,OAAO,KACnB,qBAED,CAAC"}
@@ -0,0 +1,5 @@
1
+ export const shouldSuppressStudioRuntimeActions = (previewMode) => !previewMode;
2
+ export const createStudioActionSuppressionConfig = (previewMode) => ({
3
+ disableActions: shouldSuppressStudioRuntimeActions(previewMode),
4
+ });
5
+ //# sourceMappingURL=actionSuppression.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actionSuppression.js","sourceRoot":"","sources":["../../src/runtime/actionSuppression.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,WAAoB,EAAW,EAAE,CAAC,CAAC,WAAW,CAAC;AAElG,MAAM,CAAC,MAAM,mCAAmC,GAAG,CACjD,WAAoB,EACG,EAAE,CAAC,CAAC;IAC3B,cAAc,EAAE,kCAAkC,CAAC,WAAW,CAAC;CAChE,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './actionSuppression';
2
+ export * from './localizationPreview';
3
+ export * from './previewRegistry';
4
+ export * from './previewRuntimeConfig';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './actionSuppression';
2
+ export * from './localizationPreview';
3
+ export * from './previewRegistry';
4
+ export * from './previewRuntimeConfig';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,12 @@
1
+ export interface StudioLocalizationPreviewInput {
2
+ readonly activeLocale?: string | null;
3
+ readonly defaultLocale: string;
4
+ readonly locales: readonly string[];
5
+ }
6
+ export interface StudioLocalizationPreview {
7
+ readonly activeLocale: string;
8
+ readonly defaultLocale: string;
9
+ readonly locales: readonly string[];
10
+ }
11
+ export declare const resolveStudioLocalizationPreview: (input: StudioLocalizationPreviewInput) => StudioLocalizationPreview;
12
+ //# sourceMappingURL=localizationPreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localizationPreview.d.ts","sourceRoot":"","sources":["../../src/runtime/localizationPreview.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,eAAO,MAAM,gCAAgC,GAC3C,OAAO,8BAA8B,KACpC,yBAWF,CAAC"}
@@ -0,0 +1,11 @@
1
+ export const resolveStudioLocalizationPreview = (input) => {
2
+ const activeLocale = input.activeLocale && input.locales.includes(input.activeLocale)
3
+ ? input.activeLocale
4
+ : input.defaultLocale;
5
+ return {
6
+ activeLocale,
7
+ defaultLocale: input.defaultLocale,
8
+ locales: input.locales,
9
+ };
10
+ };
11
+ //# sourceMappingURL=localizationPreview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localizationPreview.js","sourceRoot":"","sources":["../../src/runtime/localizationPreview.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAC9C,KAAqC,EACV,EAAE;IAC7B,MAAM,YAAY,GAChB,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC;QAC9D,CAAC,CAAC,KAAK,CAAC,YAAY;QACpB,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC;IAE1B,OAAO;QACL,YAAY;QACZ,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,OAAO,EAAE,KAAK,CAAC,OAAO;KACvB,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ComponentRegistry } from '@ankhorage/runtime';
2
+ export interface StudioPreviewRegistryOptions {
3
+ readonly components?: ComponentRegistry;
4
+ }
5
+ export declare const createStudioPreviewComponentRegistry: (options?: StudioPreviewRegistryOptions) => ComponentRegistry;
6
+ export declare const STUDIO_PREVIEW_COMPONENT_REGISTRY: ComponentRegistry;
7
+ //# sourceMappingURL=previewRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"previewRegistry.d.ts","sourceRoot":"","sources":["../../src/runtime/previewRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,UAAU,CAAC,EAAE,iBAAiB,CAAC;CACzC;AAED,eAAO,MAAM,oCAAoC,GAC/C,UAAS,4BAAiC,KACzC,iBAA+F,CAAC;AAEnG,eAAO,MAAM,iCAAiC,mBAAyC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { createComponentRegistry, ZORA_COMPONENT_REGISTRY } from '@ankhorage/runtime';
2
+ export const createStudioPreviewComponentRegistry = (options = {}) => createComponentRegistry(ZORA_COMPONENT_REGISTRY, options.components ?? {});
3
+ export const STUDIO_PREVIEW_COMPONENT_REGISTRY = createStudioPreviewComponentRegistry();
4
+ //# sourceMappingURL=previewRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"previewRegistry.js","sourceRoot":"","sources":["../../src/runtime/previewRegistry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAMtF,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAClD,UAAwC,EAAE,EACvB,EAAE,CAAC,uBAAuB,CAAC,uBAAuB,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;AAEnG,MAAM,CAAC,MAAM,iCAAiC,GAAG,oCAAoC,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ComponentRegistry, RuntimeRendererConfig } from '@ankhorage/runtime';
2
+ export interface StudioPreviewRuntimeConfigOptions {
3
+ readonly previewMode: boolean;
4
+ readonly components?: ComponentRegistry;
5
+ }
6
+ export declare const createStudioPreviewRuntimeConfig: (options: StudioPreviewRuntimeConfigOptions) => RuntimeRendererConfig;
7
+ //# sourceMappingURL=previewRuntimeConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"previewRuntimeConfig.d.ts","sourceRoot":"","sources":["../../src/runtime/previewRuntimeConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAKnF,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,iBAAiB,CAAC;CACzC;AAED,eAAO,MAAM,gCAAgC,GAC3C,SAAS,iCAAiC,KACzC,qBAGD,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { shouldSuppressStudioRuntimeActions } from './actionSuppression';
2
+ import { createStudioPreviewComponentRegistry } from './previewRegistry';
3
+ export const createStudioPreviewRuntimeConfig = (options) => ({
4
+ disableActions: shouldSuppressStudioRuntimeActions(options.previewMode),
5
+ registry: createStudioPreviewComponentRegistry({ components: options.components }),
6
+ });
7
+ //# sourceMappingURL=previewRuntimeConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"previewRuntimeConfig.js","sourceRoot":"","sources":["../../src/runtime/previewRuntimeConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kCAAkC,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,oCAAoC,EAAE,MAAM,mBAAmB,CAAC;AAOzE,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAC9C,OAA0C,EACnB,EAAE,CAAC,CAAC;IAC3B,cAAc,EAAE,kCAAkC,CAAC,OAAO,CAAC,WAAW,CAAC;IACvE,QAAQ,EAAE,oCAAoC,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC;CACnF,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export interface AnkhStudioProps {
3
+ children: React.ReactNode;
4
+ runtimeRegistry?: unknown;
5
+ runtimeConfig?: unknown;
6
+ }
7
+ export declare const AnkhStudio: ({ children }: AnkhStudioProps) => React.FunctionComponentElement<React.FragmentProps> | null;
8
+ //# sourceMappingURL=AnkhStudio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnkhStudio.d.ts","sourceRoot":"","sources":["../../src/ui/AnkhStudio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,eAAO,MAAM,UAAU,GAAI,cAAc,eAAe,+DAYvD,CAAC"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { useStudio } from '../core/StudioContext';
3
+ export const AnkhStudio = ({ children }) => {
4
+ const studio = useStudio();
5
+ if (studio.error) {
6
+ return React.createElement(React.Fragment, null, studio.error);
7
+ }
8
+ if (studio.isLoading || !studio.manifest) {
9
+ return null;
10
+ }
11
+ return React.createElement(React.Fragment, null, children);
12
+ };
13
+ //# sourceMappingURL=AnkhStudio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnkhStudio.js","sourceRoot":"","sources":["../../src/ui/AnkhStudio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAQlD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAmB,EAAE,EAAE;IAC1D,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IACjE,CAAC;IAED,IAAI,MAAM,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7D,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type React from 'react';
2
+ export interface StudioAppBarAugmentation {
3
+ appMode?: unknown;
4
+ actions?: React.ReactNode;
5
+ overflow?: unknown;
6
+ overlay?: React.ReactNode;
7
+ }
8
+ export declare function useStudioAppBarAugmentation(): StudioAppBarAugmentation;
9
+ //# sourceMappingURL=useStudioAppBarAugmentation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStudioAppBarAugmentation.d.ts","sourceRoot":"","sources":["../../src/ui/useStudioAppBarAugmentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,2BAA2B,IAAI,wBAAwB,CAEtE"}
@@ -0,0 +1,4 @@
1
+ export function useStudioAppBarAugmentation() {
2
+ return {};
3
+ }
4
+ //# sourceMappingURL=useStudioAppBarAugmentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStudioAppBarAugmentation.js","sourceRoot":"","sources":["../../src/ui/useStudioAppBarAugmentation.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,2BAA2B;IACzC,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { addNodeToTree, cloneWithNewIds, findNodeById, moveNodeInTree, removeNodeFromTree, updateNodeInTree } from '../index';
2
+ export { addNodeToTree, cloneWithNewIds, findNodeById, moveNodeInTree, removeNodeFromTree, updateNodeInTree, };
3
+ //# sourceMappingURL=treeUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"treeUtils.d.ts","sourceRoot":"","sources":["../../src/utils/treeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,eAAe,EACf,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,aAAa,EACb,eAAe,EACf,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,gBAAgB,GACjB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { addNodeToTree, cloneWithNewIds, findNodeById, moveNodeInTree, removeNodeFromTree, updateNodeInTree, } from '../index';
2
+ export { addNodeToTree, cloneWithNewIds, findNodeById, moveNodeInTree, removeNodeFromTree, updateNodeInTree, };
3
+ //# sourceMappingURL=treeUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"treeUtils.js","sourceRoot":"","sources":["../../src/utils/treeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,eAAe,EACf,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,aAAa,EACb,eAAe,EACf,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,gBAAgB,GACjB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/studio",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "Studio authoring package for Ankhorage apps",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ankhorage/studio#readme",
@@ -36,6 +36,62 @@
36
36
  "types": "./dist/app/index.d.ts",
37
37
  "import": "./dist/app/index.js"
38
38
  },
39
+ "./dnd": {
40
+ "types": "./dist/dnd/index.d.ts",
41
+ "import": "./dist/dnd/index.js"
42
+ },
43
+ "./dnd/primitives": {
44
+ "types": "./dist/dnd/primitives.d.ts",
45
+ "import": "./dist/dnd/primitives.js"
46
+ },
47
+ "./dnd/state": {
48
+ "types": "./dist/dnd/state.d.ts",
49
+ "import": "./dist/dnd/state.js"
50
+ },
51
+ "./runtime": {
52
+ "types": "./dist/runtime/index.d.ts",
53
+ "import": "./dist/runtime/index.js"
54
+ },
55
+ "./runtime/actionSuppression": {
56
+ "types": "./dist/runtime/actionSuppression.d.ts",
57
+ "import": "./dist/runtime/actionSuppression.js"
58
+ },
59
+ "./runtime/localizationPreview": {
60
+ "types": "./dist/runtime/localizationPreview.d.ts",
61
+ "import": "./dist/runtime/localizationPreview.js"
62
+ },
63
+ "./runtime/previewRegistry": {
64
+ "types": "./dist/runtime/previewRegistry.d.ts",
65
+ "import": "./dist/runtime/previewRegistry.js"
66
+ },
67
+ "./runtime/previewRuntimeConfig": {
68
+ "types": "./dist/runtime/previewRuntimeConfig.d.ts",
69
+ "import": "./dist/runtime/previewRuntimeConfig.js"
70
+ },
71
+ "./core/StudioContext": {
72
+ "types": "./dist/core/StudioContext.d.ts",
73
+ "import": "./dist/core/StudioContext.js"
74
+ },
75
+ "./core/StudioProvider": {
76
+ "types": "./dist/core/StudioProvider.d.ts",
77
+ "import": "./dist/core/StudioProvider.js"
78
+ },
79
+ "./core/studioPackageBoundary": {
80
+ "types": "./dist/core/studioPackageBoundary.d.ts",
81
+ "import": "./dist/core/studioPackageBoundary.js"
82
+ },
83
+ "./ui/AnkhStudio": {
84
+ "types": "./dist/ui/AnkhStudio.d.ts",
85
+ "import": "./dist/ui/AnkhStudio.js"
86
+ },
87
+ "./ui/useStudioAppBarAugmentation": {
88
+ "types": "./dist/ui/useStudioAppBarAugmentation.d.ts",
89
+ "import": "./dist/ui/useStudioAppBarAugmentation.js"
90
+ },
91
+ "./utils/treeUtils": {
92
+ "types": "./dist/utils/treeUtils.d.ts",
93
+ "import": "./dist/utils/treeUtils.js"
94
+ },
39
95
  "./canvasDragModel": {
40
96
  "types": "./dist/canvasDragModel.d.ts",
41
97
  "import": "./dist/canvasDragModel.js"
@@ -115,6 +171,8 @@
115
171
  ],
116
172
  "dependencies": {
117
173
  "@ankhorage/contracts": "^1.19.2",
174
+ "@ankhorage/react-native-reanimated-dnd-web": "^0.3.2",
175
+ "@ankhorage/runtime": "^0.2.1",
118
176
  "@ankhorage/zora": "^2.8.1"
119
177
  },
120
178
  "peerDependencies": {