@dxos/app-framework 0.8.4-main.5ea62a8 → 0.8.4-main.72ec0f3
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/.storybook/main.mts +11 -0
- package/.storybook/preview.mts +8 -0
- package/dist/lib/browser/{app-graph-builder-AFFC6VB2.mjs → app-graph-builder-OIEZZC45.mjs} +31 -30
- package/dist/lib/browser/app-graph-builder-OIEZZC45.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ORWHM7CO.mjs → chunk-SCPE4ZO2.mjs} +11 -8
- package/dist/lib/browser/chunk-SCPE4ZO2.mjs.map +7 -0
- package/dist/lib/browser/{chunk-DND4XMN4.mjs → chunk-VFUKEZIN.mjs} +233 -191
- package/dist/lib/browser/chunk-VFUKEZIN.mjs.map +7 -0
- package/dist/lib/browser/{chunk-OZY7HV2A.mjs → chunk-WPW5VVAX.mjs} +281 -273
- package/dist/lib/browser/chunk-WPW5VVAX.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +14 -56
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-dispatcher-QG7UPGQX.mjs → intent-dispatcher-LZ4AE66E.mjs} +2 -2
- package/dist/lib/browser/{intent-resolver-4S4PSTM5.mjs → intent-resolver-QVCKRX6G.mjs} +7 -7
- package/dist/lib/browser/intent-resolver-QVCKRX6G.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react/index.mjs +34 -0
- package/dist/lib/browser/{store-6E33KLGK.mjs → store-CNPHOYTJ.mjs} +5 -5
- package/dist/lib/browser/store-CNPHOYTJ.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +14 -16
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/{app-graph-builder-S4OAULX5.mjs → app-graph-builder-EBU4NVWD.mjs} +31 -30
- package/dist/lib/node-esm/app-graph-builder-EBU4NVWD.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-E2TK7Z4P.mjs → chunk-IJOHO66N.mjs} +233 -191
- package/dist/lib/node-esm/chunk-IJOHO66N.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-F63ZRXMK.mjs → chunk-XJZGUJ3H.mjs} +281 -273
- package/dist/lib/node-esm/chunk-XJZGUJ3H.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-UMZQERLE.mjs → chunk-ZX63QUGE.mjs} +11 -8
- package/dist/lib/node-esm/chunk-ZX63QUGE.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +14 -56
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-dispatcher-NXBGPJOX.mjs → intent-dispatcher-MGOJ3CHD.mjs} +2 -2
- package/dist/lib/node-esm/{intent-resolver-2ZKXI5ET.mjs → intent-resolver-URF3HN3G.mjs} +7 -7
- package/dist/lib/node-esm/intent-resolver-URF3HN3G.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react/index.mjs +35 -0
- package/dist/lib/node-esm/{store-QQUTQHHT.mjs → store-RK5B4XEL.mjs} +5 -5
- package/dist/lib/node-esm/store-RK5B4XEL.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +14 -16
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/common/capabilities.d.ts +41 -37
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/collaboration.d.ts +1 -1
- package/dist/types/src/common/collaboration.d.ts.map +1 -1
- package/dist/types/src/common/file.d.ts +1 -1
- package/dist/types/src/common/file.d.ts.map +1 -1
- package/dist/types/src/common/layout.d.ts +1 -3
- package/dist/types/src/common/layout.d.ts.map +1 -1
- package/dist/types/src/common/surface.d.ts +19 -16
- package/dist/types/src/common/surface.d.ts.map +1 -1
- package/dist/types/src/common/translations.d.ts +1 -1
- package/dist/types/src/common/translations.d.ts.map +1 -1
- package/dist/types/src/core/capabilities.d.ts +15 -15
- package/dist/types/src/core/capabilities.d.ts.map +1 -1
- package/dist/types/src/core/manager.d.ts +1 -1
- package/dist/types/src/core/manager.d.ts.map +1 -1
- package/dist/types/src/core/plugin.d.ts +8 -1
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/playground/debug/plugin.d.ts +1 -1
- package/dist/types/src/playground/debug/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/generator/Main.d.ts.map +1 -1
- package/dist/types/src/playground/generator/generator.d.ts +1 -1
- package/dist/types/src/playground/generator/generator.d.ts.map +1 -1
- package/dist/types/src/playground/generator/plugin.d.ts +1 -1
- package/dist/types/src/playground/generator/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/layout/plugin.d.ts +1 -1
- package/dist/types/src/playground/layout/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/logger/plugin.d.ts +1 -1
- package/dist/types/src/playground/logger/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/logger/schema.d.ts +1 -1
- package/dist/types/src/playground/logger/schema.d.ts.map +1 -1
- package/dist/types/src/playground/playground.stories.d.ts +0 -1
- package/dist/types/src/playground/playground.stories.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts +1 -1
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/actions.d.ts +5 -7
- package/dist/types/src/plugin-intent/actions.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/errors.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +4 -4
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/intent.d.ts +1 -1
- package/dist/types/src/plugin-intent/intent.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/meta.d.ts +3 -0
- package/dist/types/src/plugin-intent/meta.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +1 -1
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/actions.d.ts +5 -7
- package/dist/types/src/plugin-settings/actions.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/meta.d.ts +3 -0
- package/dist/types/src/plugin-settings/meta.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/translations.d.ts +2 -1
- package/dist/types/src/plugin-settings/translations.d.ts.map +1 -1
- package/dist/types/src/react/App.d.ts +10 -0
- package/dist/types/src/react/App.d.ts.map +1 -0
- package/dist/types/src/react/App.stories.d.ts +14 -0
- package/dist/types/src/react/App.stories.d.ts.map +1 -0
- package/dist/types/src/react/DefaultFallback.d.ts +8 -0
- package/dist/types/src/react/DefaultFallback.d.ts.map +1 -0
- package/dist/types/src/react/ErrorBoundary.d.ts +2 -2
- package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -1
- package/dist/types/src/react/Surface.d.ts +5 -5
- package/dist/types/src/react/Surface.d.ts.map +1 -1
- package/dist/types/src/react/Surface.stories.d.ts +3 -7
- package/dist/types/src/react/Surface.stories.d.ts.map +1 -1
- package/dist/types/src/react/index.d.ts +2 -0
- package/dist/types/src/react/index.d.ts.map +1 -1
- package/dist/types/src/react/types.d.ts +14 -0
- package/dist/types/src/react/types.d.ts.map +1 -0
- package/dist/types/src/{App.d.ts → react/useApp.d.ts} +7 -6
- package/dist/types/src/react/useApp.d.ts.map +1 -0
- package/dist/types/src/react/useLoading.d.ts +19 -0
- package/dist/types/src/react/useLoading.d.ts.map +1 -0
- package/dist/types/src/testing/withPluginManager.d.ts +7 -8
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/moon.yml +5 -1
- package/package.json +44 -40
- package/src/common/capabilities.ts +34 -19
- package/src/common/collaboration.ts +3 -3
- package/src/common/file.ts +1 -1
- package/src/common/layout.ts +3 -4
- package/src/common/surface.ts +23 -21
- package/src/common/translations.ts +1 -1
- package/src/core/capabilities.test.ts +2 -2
- package/src/core/capabilities.ts +26 -22
- package/src/core/manager.test.ts +19 -19
- package/src/core/manager.ts +14 -7
- package/src/core/plugin.ts +13 -2
- package/src/index.ts +0 -2
- package/src/playground/debug/Debug.tsx +1 -1
- package/src/playground/debug/plugin.ts +7 -8
- package/src/playground/generator/Main.tsx +0 -1
- package/src/playground/generator/generator.ts +2 -2
- package/src/playground/generator/plugin.ts +12 -13
- package/src/playground/layout/plugin.ts +9 -8
- package/src/playground/logger/plugin.ts +27 -23
- package/src/playground/logger/schema.ts +1 -1
- package/src/playground/playground.stories.tsx +6 -7
- package/src/plugin-intent/IntentPlugin.ts +12 -13
- package/src/plugin-intent/actions.ts +4 -6
- package/src/plugin-intent/errors.ts +2 -1
- package/src/plugin-intent/intent-dispatcher.test.ts +10 -3
- package/src/plugin-intent/intent-dispatcher.ts +13 -6
- package/src/plugin-intent/intent.ts +1 -1
- package/src/plugin-intent/meta.ts +10 -0
- package/src/plugin-settings/SettingsPlugin.ts +25 -27
- package/src/plugin-settings/actions.ts +9 -13
- package/src/plugin-settings/app-graph-builder.ts +22 -20
- package/src/plugin-settings/intent-resolver.ts +2 -2
- package/src/plugin-settings/meta.ts +10 -0
- package/src/plugin-settings/store.ts +2 -2
- package/src/plugin-settings/translations.ts +4 -4
- package/src/react/App.stories.tsx +33 -0
- package/src/react/App.tsx +59 -0
- package/src/react/DefaultFallback.tsx +26 -0
- package/src/react/ErrorBoundary.tsx +10 -8
- package/src/react/Surface.stories.tsx +70 -49
- package/src/react/Surface.tsx +67 -36
- package/src/react/index.ts +4 -0
- package/src/react/types.ts +37 -0
- package/src/{App.tsx → react/useApp.tsx} +35 -150
- package/src/react/useCapabilities.ts +2 -2
- package/src/react/useLoading.tsx +70 -0
- package/src/testing/withPluginManager.stories.tsx +1 -1
- package/src/testing/withPluginManager.tsx +24 -23
- package/tsconfig.json +11 -9
- package/vitest.config.ts +8 -6
- package/dist/lib/browser/app-graph-builder-AFFC6VB2.mjs.map +0 -7
- package/dist/lib/browser/chunk-DND4XMN4.mjs.map +0 -7
- package/dist/lib/browser/chunk-ORWHM7CO.mjs.map +0 -7
- package/dist/lib/browser/chunk-OZY7HV2A.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-4S4PSTM5.mjs.map +0 -7
- package/dist/lib/browser/store-6E33KLGK.mjs.map +0 -7
- package/dist/lib/browser/worker.mjs +0 -85
- package/dist/lib/node-esm/app-graph-builder-S4OAULX5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E2TK7Z4P.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-F63ZRXMK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UMZQERLE.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-2ZKXI5ET.mjs.map +0 -7
- package/dist/lib/node-esm/store-QQUTQHHT.mjs.map +0 -7
- package/dist/lib/node-esm/worker.mjs +0 -86
- package/dist/types/src/App.d.ts.map +0 -1
- package/dist/types/src/worker.d.ts +0 -4
- package/dist/types/src/worker.d.ts.map +0 -1
- package/src/worker.ts +0 -11
- /package/dist/lib/browser/{intent-dispatcher-QG7UPGQX.mjs.map → intent-dispatcher-LZ4AE66E.mjs.map} +0 -0
- /package/dist/lib/browser/{worker.mjs.map → react/index.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-dispatcher-NXBGPJOX.mjs.map → intent-dispatcher-MGOJ3CHD.mjs.map} +0 -0
- /package/dist/lib/node-esm/{worker.mjs.map → react/index.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-graph-builder.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/app-graph-builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-graph-builder.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/app-graph-builder.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,aAAa,EAAgC,MAAM,SAAS,CAAC;yBAM3D,SAAS,aAAa;AAAtC,wBA4IK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,eAAO,MAAM,IAAI,EAAE,UAGlB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { meta } from './meta';
|
|
1
2
|
export declare const translations: [{
|
|
2
3
|
readonly 'en-US': {
|
|
3
|
-
readonly
|
|
4
|
+
readonly [meta.id]: {
|
|
4
5
|
readonly 'open settings label': "Open settings";
|
|
5
6
|
readonly 'app settings label': "Settings";
|
|
6
7
|
readonly 'custom plugins label': "Plugins";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/translations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/translations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,eAAO,MAAM,YAAY;;QAGnB,SAAA,CAAC,IAAI,CAAC,EAAE,CAAC;;;;UAIR;;EAGwB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type UseAppOptions } from './useApp';
|
|
3
|
+
export type AppProps = Pick<UseAppOptions, 'placeholder' | 'debounce'> & {
|
|
4
|
+
state: {
|
|
5
|
+
ready: boolean;
|
|
6
|
+
error: unknown;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare const App: ({ placeholder: Placeholder, state, debounce }: AppProps) => React.JSX.Element | null;
|
|
10
|
+
//# sourceMappingURL=App.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../src/react/App.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAiC,MAAM,OAAO,CAAC;AAKtD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAI9C,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,EAAE,aAAa,GAAG,UAAU,CAAC,GAAG;IACvE,KAAK,EAAE;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;CAC3C,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,+CAA+C,QAAQ,6BA2B1E,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
render: () => React.JSX.Element;
|
|
6
|
+
decorators: import("@storybook/react").Decorator[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Default: Story;
|
|
14
|
+
//# sourceMappingURL=App.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"App.stories.d.ts","sourceRoot":"","sources":["../../../../src/react/App.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,QAAA,MAAM,IAAI;;;;;;;CAOM,CAAC;AAEjB,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultFallback.d.ts","sourceRoot":"","sources":["../../../../src/react/DefaultFallback.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,sBAgB1D,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, type FC, type
|
|
1
|
+
import { Component, type FC, type PropsWithChildren, type ReactNode } from 'react';
|
|
2
2
|
type State = {
|
|
3
3
|
error: Error | undefined;
|
|
4
4
|
};
|
|
@@ -23,7 +23,7 @@ export declare class ErrorBoundary extends Component<ErrorBoundaryProps, State>
|
|
|
23
23
|
error: undefined;
|
|
24
24
|
};
|
|
25
25
|
componentDidUpdate(prevProps: ErrorBoundaryProps): void;
|
|
26
|
-
render():
|
|
26
|
+
render(): ReactNode;
|
|
27
27
|
private resetError;
|
|
28
28
|
}
|
|
29
29
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../src/react/ErrorBoundary.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../src/react/ErrorBoundary.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1F,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;IACjD,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,QAAQ,CAAC,EAAE,EAAE,CAAC;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC,CAAC;CAC7C,CAAC,CAAC;AAEH;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,SAAS,CAAC,kBAAkB,EAAE,KAAK,CAAC;IACrE,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE;IAItD,KAAK;;MAAwB;IAE7B,kBAAkB,CAAC,SAAS,EAAE,kBAAkB,GAAG,IAAI;IAMvD,MAAM,IAAI,SAAS;IAS5B,OAAO,CAAC,UAAU;CAGnB"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type NamedExoticComponent, type RefAttributes } from 'react';
|
|
2
2
|
import { type SurfaceProps } from '../common';
|
|
3
3
|
import { type PluginContext } from '../core';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* A surface is a named region of the screen that can be populated by plugins.
|
|
6
6
|
*/
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const Surface: NamedExoticComponent<SurfaceProps & RefAttributes<HTMLElement>>;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* @returns `true` if there is a contributed surface which matches the specified role & data, `false` otherwise.
|
|
10
10
|
*/
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const isSurfaceAvailable: (context: PluginContext, { role, data }: Pick<SurfaceProps, "role" | "data">) => boolean;
|
|
12
12
|
//# sourceMappingURL=Surface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Surface.d.ts","sourceRoot":"","sources":["../../../../src/react/Surface.tsx"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"Surface.d.ts","sourceRoot":"","sources":["../../../../src/react/Surface.tsx"],"names":[],"mappings":"AAIA,OAAc,EAEZ,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAKnB,MAAM,OAAO,CAAC;AAKf,OAAO,EAAwC,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AACpF,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAO7C;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,oBAAoB,CAAC,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC,CA+BnF,CAAC;AA+BF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,aAAa,EAAE,gBAAgB,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,YAI7G,CAAC"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import '@dxos-theme';
|
|
2
1
|
import { type StoryObj } from '@storybook/react-vite';
|
|
3
2
|
import React from 'react';
|
|
4
|
-
import { type PluginManager } from '../core';
|
|
5
3
|
declare const meta: {
|
|
6
4
|
title: string;
|
|
7
|
-
render: (
|
|
8
|
-
manager: PluginManager;
|
|
9
|
-
}) => React.JSX.Element;
|
|
5
|
+
render: () => React.JSX.Element;
|
|
10
6
|
decorators: import("@storybook/react").Decorator[];
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
13
9
|
};
|
|
14
10
|
};
|
|
15
11
|
export default meta;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Surface.stories.d.ts","sourceRoot":"","sources":["../../../../src/react/Surface.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"Surface.stories.d.ts","sourceRoot":"","sources":["../../../../src/react/Surface.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAA2C,MAAM,OAAO,CAAC;AA0GhE,QAAA,MAAM,IAAI;;;;;;;CAO2B,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './common';
|
|
2
|
+
export * from './types';
|
|
2
3
|
export * from './ErrorBoundary';
|
|
3
4
|
export * from './PluginManagerProvider';
|
|
4
5
|
export * from './Surface';
|
|
6
|
+
export * from './useApp';
|
|
5
7
|
export * from './useCapabilities';
|
|
6
8
|
export * from './useIntentResolver';
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AAExB,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAE1B,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import { type Obj } from '@dxos/echo';
|
|
3
|
+
export declare const SurfaceCardRole: Schema.Literal<["card", "card--popover", "card--intrinsic", "card--extrinsic", "card--transclusion"]>;
|
|
4
|
+
export type SurfaceCardRole = Schema.Schema.Type<typeof SurfaceCardRole>;
|
|
5
|
+
export type SurfaceRole = 'item' | 'article' | 'complementary' | 'section' | SurfaceCardRole;
|
|
6
|
+
/**
|
|
7
|
+
* Base type for surface components.
|
|
8
|
+
*/
|
|
9
|
+
export type SurfaceComponentProps<Subject extends Obj.Any = Obj.Any, Props = {}, Role extends string = string> = {
|
|
10
|
+
role?: Role;
|
|
11
|
+
/** The object being displayed. */
|
|
12
|
+
subject: Subject;
|
|
13
|
+
} & Props;
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/react/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAO,MAAM,eAAe,uGAM3B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,eAAe,CAAC,CAAC;AAGzE,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,SAAS,GACT,eAAe,GACf,SAAS,GACT,eAAe,CAAC;AAEpB;;GAEG;AAGH,MAAM,MAAM,qBAAqB,CAAC,OAAO,SAAS,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,EAAE,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,IAAI;IAC/G,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG,KAAK,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { type FC } from 'react';
|
|
2
|
-
import { type Plugin, PluginManager, type PluginManagerOptions } from '
|
|
3
|
-
import { ErrorBoundary } from './
|
|
4
|
-
export type
|
|
2
|
+
import { type Plugin, PluginManager, type PluginManagerOptions } from '../core';
|
|
3
|
+
import { ErrorBoundary } from './ErrorBoundary';
|
|
4
|
+
export type UseAppOptions = {
|
|
5
5
|
pluginManager?: PluginManager;
|
|
6
6
|
pluginLoader?: PluginManagerOptions['pluginLoader'];
|
|
7
7
|
plugins?: Plugin[];
|
|
@@ -13,6 +13,7 @@ export type CreateAppOptions = {
|
|
|
13
13
|
fallback?: ErrorBoundary['props']['fallback'];
|
|
14
14
|
cacheEnabled?: boolean;
|
|
15
15
|
safeMode?: boolean;
|
|
16
|
+
debounce?: number;
|
|
16
17
|
};
|
|
17
18
|
/**
|
|
18
19
|
* Expected usage is for this to be the entrypoint of the application.
|
|
@@ -23,7 +24,7 @@ export type CreateAppOptions = {
|
|
|
23
24
|
* const core = [LayoutPluginId];
|
|
24
25
|
* const default = [MyPluginId];
|
|
25
26
|
* const fallback = <div>Initializing Plugins...</div>;
|
|
26
|
-
* const App =
|
|
27
|
+
* const App = useApp({ plugins, core, default, fallback });
|
|
27
28
|
* createRoot(document.getElementById('root')!).render(
|
|
28
29
|
* <StrictMode>
|
|
29
30
|
* <App />
|
|
@@ -39,5 +40,5 @@ export type CreateAppOptions = {
|
|
|
39
40
|
* @param params.cacheEnabled Whether to cache enabled plugins in localStorage.
|
|
40
41
|
* @param params.safeMode Whether to enable safe mode, which disables optional plugins.
|
|
41
42
|
*/
|
|
42
|
-
export declare const useApp: ({ pluginManager, pluginLoader:
|
|
43
|
-
//# sourceMappingURL=
|
|
43
|
+
export declare const useApp: ({ pluginManager, pluginLoader: pluginLoaderParam, plugins: pluginsParam, core: coreParam, defaults: defaultsParam, placeholder, fallback, cacheEnabled, safeMode, debounce, }: UseAppOptions) => () => React.JSX.Element;
|
|
44
|
+
//# sourceMappingURL=useApp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useApp.d.ts","sourceRoot":"","sources":["../../../../src/react/useApp.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAmC,MAAM,OAAO,CAAC;AAOxE,OAAO,EAAE,KAAK,MAAM,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAIhF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKhD,MAAM,MAAM,aAAa,GAAG;IAC1B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,YAAY,CAAC,EAAE,oBAAoB,CAAC,cAAc,CAAC,CAAC;IACpD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,EAAE,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC;IAC9C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,MAAM,GAAI,+KAWpB,aAAa,4BAwFf,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type AppProps } from './App';
|
|
2
|
+
export declare enum LoadingState {
|
|
3
|
+
Loading = 0,
|
|
4
|
+
FadeIn = 1,
|
|
5
|
+
FadeOut = 2,
|
|
6
|
+
Done = 3
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* To avoid "flashing" the placeholder, we wait a period of time before starting the loading animation.
|
|
10
|
+
* If loading completes during this time the placehoder is not shown, otherwise is it displayed for a minimum period of time.
|
|
11
|
+
*
|
|
12
|
+
* States:
|
|
13
|
+
* 0: Loading - Wait for a period of time before starting the loading animation.
|
|
14
|
+
* 1: Fade-in - Display a loading animation.
|
|
15
|
+
* 2: Fade-out - Fade out the loading animation.
|
|
16
|
+
* 3: Done - Remove the placeholder.
|
|
17
|
+
*/
|
|
18
|
+
export declare const useLoading: (state: AppProps["state"], debounce?: number) => LoadingState;
|
|
19
|
+
//# sourceMappingURL=useLoading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLoading.d.ts","sourceRoot":"","sources":["../../../../src/react/useLoading.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,oBAAY,YAAY;IACtB,OAAO,IAAI;IACX,MAAM,IAAI;IACV,OAAO,IAAI;IACX,IAAI,IAAI;CACT;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,QAAQ,CAAC,OAAO,CAAC,EAAE,iBAAY,iBA4ChE,CAAC"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { type Decorator } from '@storybook/react';
|
|
2
|
-
import { type
|
|
1
|
+
import { type Decorator, type StoryContext } from '@storybook/react';
|
|
2
|
+
import { type MaybeProvider } from '@dxos/util';
|
|
3
3
|
import { type ActivationEvent, type AnyCapability, type PluginContext } from '../core';
|
|
4
|
-
|
|
5
|
-
export type
|
|
6
|
-
export declare const getValue: <C, R>(providerOrValue: ProviderOrValue<C, R>, context: C) => R;
|
|
7
|
-
export type WithPluginManagerOptions = CreateAppOptions & {
|
|
4
|
+
import { type UseAppOptions } from '../react';
|
|
5
|
+
export type WithPluginManagerOptions = UseAppOptions & {
|
|
8
6
|
/** @deprecated */
|
|
9
|
-
capabilities?:
|
|
7
|
+
capabilities?: MaybeProvider<AnyCapability[], PluginContext>;
|
|
10
8
|
/** @deprecated */
|
|
11
9
|
fireEvents?: (ActivationEvent | string)[];
|
|
12
10
|
};
|
|
11
|
+
export type WithPluginManagerInitializer<Args = void> = WithPluginManagerOptions | ((context: StoryContext<Args>) => WithPluginManagerOptions);
|
|
13
12
|
/**
|
|
14
13
|
* Wraps a story with a plugin manager.
|
|
15
14
|
* NOTE: This builds up and tears down the plugin manager on every render.
|
|
16
15
|
*/
|
|
17
|
-
export declare const withPluginManager: (
|
|
16
|
+
export declare const withPluginManager: <Args>(init?: WithPluginManagerInitializer<Args>) => Decorator;
|
|
18
17
|
//# sourceMappingURL=withPluginManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withPluginManager.d.ts","sourceRoot":"","sources":["../../../../src/testing/withPluginManager.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"withPluginManager.d.ts","sourceRoot":"","sources":["../../../../src/testing/withPluginManager.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAKrE,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,YAAY,CAAC;AAGlE,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,aAAa,EAKnB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,aAAa,EAAU,MAAM,UAAU,CAAC;AA+BtD,MAAM,MAAM,wBAAwB,GAAG,aAAa,GAAG;IACrD,kBAAkB;IAClB,YAAY,CAAC,EAAE,aAAa,CAAC,aAAa,EAAE,EAAE,aAAa,CAAC,CAAC;IAC7D,kBAAkB;IAClB,UAAU,CAAC,EAAE,CAAC,eAAe,GAAG,MAAM,CAAC,EAAE,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,4BAA4B,CAAC,IAAI,GAAG,IAAI,IAChD,wBAAwB,GACxB,CAAC,CAAC,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,wBAAwB,CAAC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,IAAI,EAAG,OAAM,4BAA4B,CAAC,IAAI,CAAM,KAAG,SAgCxF,CAAC"}
|