@dxos/plugin-preview 0.8.4-main.67995b8 → 0.8.4-main.c4373fc
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-Z73ENKLE.mjs → chunk-XKCIQK3C.mjs} +2 -4
- package/dist/lib/browser/chunk-XKCIQK3C.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +8 -7
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{preview-popover-2UCEZUQW.mjs → preview-popover-EIATF2VR.mjs} +8 -12
- package/dist/lib/browser/preview-popover-EIATF2VR.mjs.map +7 -0
- package/dist/lib/browser/react-surface-X5EXLQX7.mjs +471 -0
- package/dist/lib/browser/react-surface-X5EXLQX7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2ORSL4GJ.mjs → chunk-L3IZVX56.mjs} +2 -4
- package/dist/lib/node-esm/chunk-L3IZVX56.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +8 -7
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{preview-popover-OSHWR2YE.mjs → preview-popover-623SB5KV.mjs} +8 -12
- package/dist/lib/node-esm/preview-popover-623SB5KV.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-EO4RGRB5.mjs +472 -0
- package/dist/lib/node-esm/react-surface-EO4RGRB5.mjs.map +7 -0
- package/dist/types/src/PreviewPlugin.d.ts +1 -1
- package/dist/types/src/PreviewPlugin.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/preview-popover.d.ts +1 -1
- package/dist/types/src/capabilities/preview-popover.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/CardSubjectMenu.d.ts +12 -0
- package/dist/types/src/components/CardSubjectMenu.d.ts.map +1 -0
- package/dist/types/src/components/ContactCard.d.ts +1 -1
- package/dist/types/src/components/ContactCard.d.ts.map +1 -1
- package/dist/types/src/components/OrganizationCard.d.ts +1 -1
- package/dist/types/src/components/OrganizationCard.d.ts.map +1 -1
- package/dist/types/src/components/ProjectCard.d.ts +1 -1
- package/dist/types/src/components/ProjectCard.d.ts.map +1 -1
- package/dist/types/src/components/TaskCard.d.ts +5 -0
- package/dist/types/src/components/TaskCard.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/stories/Card.stories.d.ts +27 -0
- package/dist/types/src/stories/Card.stories.d.ts.map +1 -0
- package/dist/types/src/stories/testing.d.ts +17 -0
- package/dist/types/src/stories/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +3 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +4 -1
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +34 -31
- package/src/PreviewPlugin.tsx +22 -23
- package/src/capabilities/preview-popover.ts +8 -13
- package/src/capabilities/react-surface.tsx +41 -23
- package/src/components/CardSubjectMenu.tsx +68 -0
- package/src/components/ContactCard.tsx +30 -22
- package/src/components/OrganizationCard.tsx +11 -8
- package/src/components/ProjectCard.tsx +12 -4
- package/src/components/TaskCard.tsx +46 -0
- package/src/meta.ts +1 -3
- package/src/stories/Card.stories.tsx +59 -0
- package/src/stories/testing.tsx +114 -0
- package/src/translations.ts +3 -0
- package/src/types.ts +5 -2
- package/dist/lib/browser/chunk-Z73ENKLE.mjs.map +0 -7
- package/dist/lib/browser/preview-popover-2UCEZUQW.mjs.map +0 -7
- package/dist/lib/browser/react-surface-CZMUEWPV.mjs +0 -303
- package/dist/lib/browser/react-surface-CZMUEWPV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2ORSL4GJ.mjs.map +0 -7
- package/dist/lib/node-esm/preview-popover-OSHWR2YE.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-IPZBISWS.mjs +0 -304
- package/dist/lib/node-esm/react-surface-IPZBISWS.mjs.map +0 -7
- package/dist/types/src/testing/ExtrinsicPreviews.stories.d.ts +0 -35
- package/dist/types/src/testing/ExtrinsicPreviews.stories.d.ts.map +0 -1
- package/dist/types/src/testing/IntrinsicPreviews.stories.d.ts +0 -35
- package/dist/types/src/testing/IntrinsicPreviews.stories.d.ts.map +0 -1
- package/dist/types/src/testing/PopoverPreviews.stories.d.ts +0 -35
- package/dist/types/src/testing/PopoverPreviews.stories.d.ts.map +0 -1
- package/dist/types/src/testing/util.d.ts +0 -80
- package/dist/types/src/testing/util.d.ts.map +0 -1
- package/src/testing/ExtrinsicPreviews.stories.tsx +0 -55
- package/src/testing/IntrinsicPreviews.stories.tsx +0 -55
- package/src/testing/PopoverPreviews.stories.tsx +0 -55
- package/src/testing/util.tsx +0 -79
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
8
|
-
|
|
9
|
-
import { withTheme, withLayout } from '@dxos/storybook-utils';
|
|
10
|
-
|
|
11
|
-
import { type StoryProps, render } from './util';
|
|
12
|
-
import { ContactCard, OrganizationCard, ProjectCard } from '../components';
|
|
13
|
-
import { translations } from '../translations';
|
|
14
|
-
|
|
15
|
-
const meta: Meta<StoryProps> = {
|
|
16
|
-
title: 'Cards/plugin-preview/Intrinsic',
|
|
17
|
-
render,
|
|
18
|
-
decorators: [withTheme, withLayout()],
|
|
19
|
-
parameters: {
|
|
20
|
-
layout: 'centered',
|
|
21
|
-
translations,
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default meta;
|
|
26
|
-
|
|
27
|
-
export const Contact = {
|
|
28
|
-
args: {
|
|
29
|
-
Component: ContactCard,
|
|
30
|
-
icon: 'ph--user--regular',
|
|
31
|
-
subject: 'contact',
|
|
32
|
-
withImage: true,
|
|
33
|
-
role: 'card--intrinsic',
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const Organization = {
|
|
38
|
-
args: {
|
|
39
|
-
Component: OrganizationCard,
|
|
40
|
-
icon: 'ph--building-office--regular',
|
|
41
|
-
subject: 'organization',
|
|
42
|
-
withImage: true,
|
|
43
|
-
role: 'card--intrinsic',
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const Project = {
|
|
48
|
-
args: {
|
|
49
|
-
Component: ProjectCard,
|
|
50
|
-
icon: 'ph--building--regular',
|
|
51
|
-
subject: 'project',
|
|
52
|
-
withImage: true,
|
|
53
|
-
role: 'card--intrinsic',
|
|
54
|
-
},
|
|
55
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
8
|
-
|
|
9
|
-
import { withTheme, withLayout } from '@dxos/storybook-utils';
|
|
10
|
-
|
|
11
|
-
import { type StoryProps, render } from './util';
|
|
12
|
-
import { ContactCard, OrganizationCard, ProjectCard } from '../components';
|
|
13
|
-
import { translations } from '../translations';
|
|
14
|
-
|
|
15
|
-
const meta: Meta<StoryProps> = {
|
|
16
|
-
title: 'Cards/plugin-preview/Popover',
|
|
17
|
-
render,
|
|
18
|
-
decorators: [withTheme, withLayout()],
|
|
19
|
-
parameters: {
|
|
20
|
-
layout: 'centered',
|
|
21
|
-
translations,
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default meta;
|
|
26
|
-
|
|
27
|
-
export const Contact = {
|
|
28
|
-
args: {
|
|
29
|
-
Component: ContactCard,
|
|
30
|
-
icon: 'ph--user--regular',
|
|
31
|
-
subject: 'contact',
|
|
32
|
-
withImage: true,
|
|
33
|
-
role: 'card--popover',
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const Organization = {
|
|
38
|
-
args: {
|
|
39
|
-
Component: OrganizationCard,
|
|
40
|
-
icon: 'ph--building-office--regular',
|
|
41
|
-
subject: 'organization',
|
|
42
|
-
withImage: true,
|
|
43
|
-
role: 'card--popover',
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const Project = {
|
|
48
|
-
args: {
|
|
49
|
-
Component: ProjectCard,
|
|
50
|
-
icon: 'ph--building--regular',
|
|
51
|
-
subject: 'project',
|
|
52
|
-
withImage: true,
|
|
53
|
-
role: 'card--popover',
|
|
54
|
-
},
|
|
55
|
-
};
|
package/src/testing/util.tsx
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import type { Meta } from '@storybook/react-vite';
|
|
6
|
-
import React, { type FC } from 'react';
|
|
7
|
-
|
|
8
|
-
import { Obj, Ref } from '@dxos/echo';
|
|
9
|
-
import { faker } from '@dxos/random';
|
|
10
|
-
import { CardContainer } from '@dxos/react-ui-stack/testing';
|
|
11
|
-
import { DataType } from '@dxos/schema';
|
|
12
|
-
|
|
13
|
-
import type { PreviewProps } from '../types';
|
|
14
|
-
|
|
15
|
-
faker.seed(1234);
|
|
16
|
-
|
|
17
|
-
export type StoryProps = {
|
|
18
|
-
Component: FC<PreviewProps<any>>;
|
|
19
|
-
icon?: string;
|
|
20
|
-
withImage?: boolean;
|
|
21
|
-
subject: 'project' | 'contact' | 'organization';
|
|
22
|
-
role: 'card--popover' | 'card--intrinsic' | 'card--extrinsic' | 'card--transclusion';
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const render: Meta<StoryProps>['render'] = ({
|
|
26
|
-
Component,
|
|
27
|
-
icon = 'ph--placeholder--regular',
|
|
28
|
-
role,
|
|
29
|
-
withImage,
|
|
30
|
-
subject,
|
|
31
|
-
...args
|
|
32
|
-
}) => {
|
|
33
|
-
return (
|
|
34
|
-
<CardContainer icon={icon} role={role}>
|
|
35
|
-
<Component {...args} subject={withImage ? data[subject] : omitImage(data[subject])} role={role} />
|
|
36
|
-
</CardContainer>
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const omitImage = ({ image, ...rest }: any) => rest;
|
|
41
|
-
|
|
42
|
-
export const data = (() => {
|
|
43
|
-
const organization = Obj.make(DataType.Organization, {
|
|
44
|
-
name: faker.company.name(),
|
|
45
|
-
image:
|
|
46
|
-
'https://plus.unsplash.com/premium_photo-1672116452571-896980a801c8?q=80&w=2671&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
|
|
47
|
-
website: faker.internet.url(),
|
|
48
|
-
description: faker.lorem.paragraph(),
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
const contact = Obj.make(DataType.Person, {
|
|
52
|
-
fullName: faker.person.fullName(),
|
|
53
|
-
image:
|
|
54
|
-
'https://plus.unsplash.com/premium_photo-1664536392779-049ba8fde933?q=80&w=2574&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
|
|
55
|
-
organization: Ref.make(organization),
|
|
56
|
-
emails: [
|
|
57
|
-
{
|
|
58
|
-
label: 'Work',
|
|
59
|
-
value: faker.internet.email(),
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
label: 'Work',
|
|
63
|
-
value: faker.internet.email(),
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
label: 'Work',
|
|
67
|
-
value: faker.internet.email(),
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
const project = Obj.make(DataType.Project, {
|
|
73
|
-
name: faker.person.fullName(),
|
|
74
|
-
image: 'https://dxos.network/dxos-logotype-blue.png',
|
|
75
|
-
description: faker.lorem.paragraph(),
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
return { organization, contact, project };
|
|
79
|
-
})();
|