@dxos/plugin-template 0.8.4-main.7ace549 → 0.8.4-main.937b3ca
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-HRH4SQLU.mjs +18 -0
- package/dist/lib/browser/chunk-HRH4SQLU.mjs.map +7 -0
- package/dist/lib/browser/chunk-TRYLFURO.mjs +18 -0
- package/dist/lib/browser/chunk-TRYLFURO.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +28 -45
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-FXQGYDUN.mjs +39 -0
- package/dist/lib/browser/react-surface-FXQGYDUN.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/types/src/TemplatePlugin.d.ts +2 -1
- package/dist/types/src/TemplatePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/TemplateContainer.d.ts +3 -4
- package/dist/types/src/components/TemplateContainer.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +7 -23
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +29 -25
- package/src/TemplatePlugin.tsx +21 -39
- package/src/capabilities/index.ts +1 -4
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +29 -0
- package/src/components/TemplateContainer.tsx +7 -4
- package/src/components/index.ts +0 -1
- package/src/meta.ts +2 -2
- package/src/types/schema.ts +9 -18
- package/dist/lib/browser/chunk-6T47OUOE.mjs +0 -49
- package/dist/lib/browser/chunk-6T47OUOE.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-4BJJ7NBA.mjs +0 -20
- package/dist/lib/browser/intent-resolver-4BJJ7NBA.mjs.map +0 -7
- package/dist/lib/browser/react-surface-7J6GGCX4.mjs +0 -68
- package/dist/lib/browser/react-surface-7J6GGCX4.mjs.map +0 -7
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/Example/Example.d.ts +0 -16
- package/dist/types/src/components/Example/Example.d.ts.map +0 -1
- package/dist/types/src/components/Example/Example.stories.d.ts +0 -19
- package/dist/types/src/components/Example/Example.stories.d.ts.map +0 -1
- package/dist/types/src/components/Example/index.d.ts +0 -2
- package/dist/types/src/components/Example/index.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -18
- package/src/capabilities/react-surface.tsx +0 -23
- package/src/components/Example/Example.stories.tsx +0 -32
- package/src/components/Example/Example.tsx +0 -54
- package/src/components/Example/index.ts +0 -5
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { createContext } from '@radix-ui/react-context';
|
|
6
|
-
import React, { type PropsWithChildren } from 'react';
|
|
7
|
-
|
|
8
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
9
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
10
|
-
|
|
11
|
-
//
|
|
12
|
-
// Context
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
type ExampleContextValue = {};
|
|
16
|
-
|
|
17
|
-
const [ExampleContextProvider, useExampleContext] = createContext<ExampleContextValue>('Example');
|
|
18
|
-
|
|
19
|
-
//
|
|
20
|
-
// Root
|
|
21
|
-
//
|
|
22
|
-
|
|
23
|
-
type ExampleRootProps = PropsWithChildren<{}>;
|
|
24
|
-
|
|
25
|
-
const ExampleRoot = ({ children }: ExampleRootProps) => {
|
|
26
|
-
return <ExampleContextProvider>{children}</ExampleContextProvider>;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
ExampleRoot.displayName = 'Example.Root';
|
|
30
|
-
|
|
31
|
-
//
|
|
32
|
-
// Content
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
type ExampleContentProps = ThemedClassName<{}>;
|
|
36
|
-
|
|
37
|
-
const ExampleContent = ({ classNames }: ExampleContentProps) => {
|
|
38
|
-
const context = useExampleContext(ExampleContent.displayName);
|
|
39
|
-
return <div className={mx(classNames)}>{JSON.stringify(context)}</div>;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
ExampleContent.displayName = 'Example.Content';
|
|
43
|
-
|
|
44
|
-
//
|
|
45
|
-
// Example
|
|
46
|
-
// https://www.radix-ui.com/primitives/docs/guides/composition
|
|
47
|
-
//
|
|
48
|
-
|
|
49
|
-
export const Example = {
|
|
50
|
-
Root: ExampleRoot,
|
|
51
|
-
Content: ExampleContent,
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export type { ExampleRootProps, ExampleContentProps };
|