@dxos/plugin-template 0.8.4-main.72ec0f3 → 0.8.4-main.74a063c4e0
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/index.mjs +62 -65
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types/index.mjs +16 -3
- package/dist/lib/browser/types/index.mjs.map +4 -4
- 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 +2 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/TemplatePanel/TemplatePanel.d.ts +6 -0
- package/dist/types/src/components/TemplatePanel/TemplatePanel.d.ts.map +1 -0
- package/dist/types/src/components/TemplatePanel/index.d.ts +2 -0
- package/dist/types/src/components/TemplatePanel/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -2
- 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/translations.d.ts +12 -10
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +7 -22
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +38 -27
- package/src/TemplatePlugin.tsx +37 -52
- package/src/capabilities/index.ts +2 -3
- package/src/capabilities/react-surface.tsx +21 -15
- package/src/components/TemplatePanel/TemplatePanel.tsx +21 -0
- package/src/components/{Example → TemplatePanel}/index.ts +1 -1
- package/src/components/index.ts +1 -2
- package/src/meta.ts +3 -3
- package/src/translations.ts +12 -10
- package/src/types/schema.ts +12 -17
- 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-DOUPO3F4.mjs +0 -68
- package/dist/lib/browser/react-surface-DOUPO3F4.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/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/dist/types/src/components/TemplateContainer.d.ts +0 -7
- package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -18
- package/src/components/Example/Example.stories.tsx +0 -32
- package/src/components/Example/Example.tsx +0 -54
- package/src/components/TemplateContainer.tsx +0 -18
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, contributes, createResolver } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
import { Template } from '../types';
|
|
8
|
-
|
|
9
|
-
export default () =>
|
|
10
|
-
contributes(
|
|
11
|
-
Capabilities.IntentResolver,
|
|
12
|
-
createResolver({
|
|
13
|
-
intent: Template.Create,
|
|
14
|
-
resolve: ({ name }) => ({
|
|
15
|
-
data: { object: Template.make({ name }) },
|
|
16
|
-
}),
|
|
17
|
-
}),
|
|
18
|
-
);
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
|
|
8
|
-
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
9
|
-
|
|
10
|
-
import { Example, type ExampleRootProps } from './Example';
|
|
11
|
-
|
|
12
|
-
const DefaultStory = (props: ExampleRootProps) => {
|
|
13
|
-
return <Example.Root {...props} />;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const meta = {
|
|
17
|
-
title: 'ui/react-ui-core/Example',
|
|
18
|
-
component: Example.Root,
|
|
19
|
-
render: DefaultStory,
|
|
20
|
-
decorators: [withTheme, withLayout({ container: 'column' })],
|
|
21
|
-
parameters: {
|
|
22
|
-
layout: 'fullscreen',
|
|
23
|
-
},
|
|
24
|
-
} satisfies Meta<typeof DefaultStory>;
|
|
25
|
-
|
|
26
|
-
export default meta;
|
|
27
|
-
|
|
28
|
-
type Story = StoryObj<typeof meta>;
|
|
29
|
-
|
|
30
|
-
export const Default: Story = {
|
|
31
|
-
args: {},
|
|
32
|
-
};
|
|
@@ -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 };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Obj } from '@dxos/echo';
|
|
8
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
9
|
-
|
|
10
|
-
export const TemplateContainer = ({ object }: { object: Obj.Any; role: string }) => {
|
|
11
|
-
return (
|
|
12
|
-
<StackItem.Content>
|
|
13
|
-
<pre className='m-4 p-2 ring'>
|
|
14
|
-
<span>{Obj.getDXN(object).toString()}</span>
|
|
15
|
-
</pre>
|
|
16
|
-
</StackItem.Content>
|
|
17
|
-
);
|
|
18
|
-
};
|