@dxos/app-framework 0.3.7-main.fcec8cd → 0.3.7
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/dist/lib/browser/{chunk-T6Z4W7BV.mjs → chunk-WDA7VA54.mjs} +1 -1
- package/dist/lib/browser/{chunk-T6Z4W7BV.mjs.map → chunk-WDA7VA54.mjs.map} +2 -2
- package/dist/lib/browser/index.mjs +29 -19
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{plugin-T5H34MVA.mjs → plugin-XEJ5RYCP.mjs} +2 -2
- package/dist/lib/node/index.cjs +26 -16
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/types/src/App.d.ts.map +1 -1
- package/dist/types/src/plugins/PluginHost/PluginHost.d.ts.map +1 -1
- package/dist/types/src/plugins/SurfacePlugin/Surface.d.ts +9 -4
- package/dist/types/src/plugins/SurfacePlugin/Surface.d.ts.map +1 -1
- package/dist/types/src/plugins/SurfacePlugin/SurfaceRootContext.d.ts +8 -2
- package/dist/types/src/plugins/SurfacePlugin/SurfaceRootContext.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/App.tsx +1 -1
- package/src/plugins/PluginHost/PluginHost.tsx +2 -1
- package/src/plugins/SurfacePlugin/Surface.tsx +33 -24
- package/src/plugins/SurfacePlugin/SurfaceRootContext.tsx +11 -2
- /package/dist/lib/browser/{plugin-T5H34MVA.mjs.map → plugin-XEJ5RYCP.mjs.map} +0 -0
|
@@ -2,14 +2,23 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { createContext, useContext, type Context, type Provider, type ReactNode } from 'react';
|
|
5
|
+
import { createContext, useContext, type Context, type Provider, type ReactNode, type ForwardedRef } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type SurfaceProps } from './Surface';
|
|
8
|
+
|
|
9
|
+
// TODO(wittjosiah): Factor out.
|
|
10
|
+
type WithRequiredProperty<Type, Key extends keyof Type> = Type & {
|
|
11
|
+
[Property in Key]-?: Type[Property];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type SurfaceComponentProps = WithRequiredProperty<SurfaceProps, 'data'>;
|
|
6
15
|
|
|
7
16
|
/**
|
|
8
17
|
* Function which resolves a Surface.
|
|
9
18
|
*
|
|
10
19
|
* If a null value is returned, the rendering is deferred to other plugins.
|
|
11
20
|
*/
|
|
12
|
-
export type SurfaceComponent = (
|
|
21
|
+
export type SurfaceComponent = (props: SurfaceComponentProps, forwardedRef: ForwardedRef<HTMLElement>) => ReactNode;
|
|
13
22
|
|
|
14
23
|
export type SurfaceRootContext = {
|
|
15
24
|
components: Record<string, SurfaceComponent>;
|
|
File without changes
|