@dxos/plugin-presenter 0.8.4-main.67995b8 → 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.
Files changed (93) hide show
  1. package/dist/lib/browser/{CollectionPresenterContainer-IPDW4HZR.mjs → CollectionPresenterContainer-4JFW3EKV.mjs} +33 -25
  2. package/dist/lib/browser/CollectionPresenterContainer-4JFW3EKV.mjs.map +7 -0
  3. package/dist/lib/browser/{DocumentPresenterContainer-LJBJM5UB.mjs → DocumentPresenterContainer-SX32NAEH.mjs} +51 -53
  4. package/dist/lib/browser/DocumentPresenterContainer-SX32NAEH.mjs.map +7 -0
  5. package/dist/lib/browser/{MarkdownSlide-KG7ESCSU.mjs → MarkdownSlide-MEXR54L5.mjs} +18 -131
  6. package/dist/lib/browser/MarkdownSlide-MEXR54L5.mjs.map +7 -0
  7. package/dist/lib/browser/app-graph-builder-UJEKUKAP.mjs +106 -0
  8. package/dist/lib/browser/app-graph-builder-UJEKUKAP.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-TANLITL2.mjs → chunk-BJWK5GQV.mjs} +6 -4
  10. package/dist/lib/browser/chunk-BJWK5GQV.mjs.map +7 -0
  11. package/dist/lib/browser/{chunk-QWJM3ADC.mjs → chunk-Q3H4KEFB.mjs} +15 -11
  12. package/dist/lib/browser/chunk-Q3H4KEFB.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-TMTUZQCK.mjs +18 -0
  14. package/dist/lib/browser/chunk-TMTUZQCK.mjs.map +7 -0
  15. package/dist/lib/browser/{chunk-W4IR3DJE.mjs → chunk-VRRPVTKA.mjs} +7 -7
  16. package/dist/lib/browser/chunk-VRRPVTKA.mjs.map +7 -0
  17. package/dist/lib/browser/index.mjs +8 -9
  18. package/dist/lib/browser/index.mjs.map +3 -3
  19. package/dist/lib/browser/meta.json +1 -1
  20. package/dist/lib/browser/{react-surface-3SPF2ANF.mjs → react-surface-S4T6X72R.mjs} +16 -16
  21. package/dist/lib/browser/react-surface-S4T6X72R.mjs.map +7 -0
  22. package/dist/lib/browser/{settings-VBRYUIWN.mjs → settings-57TUVRW3.mjs} +5 -5
  23. package/dist/lib/browser/{settings-VBRYUIWN.mjs.map → settings-57TUVRW3.mjs.map} +2 -2
  24. package/dist/types/src/PresenterPlugin.d.ts +1 -1
  25. package/dist/types/src/PresenterPlugin.d.ts.map +1 -1
  26. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  27. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  28. package/dist/types/src/capabilities/index.d.ts +3 -3
  29. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  30. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  31. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  32. package/dist/types/src/capabilities/settings.d.ts +1 -1
  33. package/dist/types/src/components/CollectionPresenterContainer.d.ts +2 -2
  34. package/dist/types/src/components/CollectionPresenterContainer.d.ts.map +1 -1
  35. package/dist/types/src/components/DocumentPresenterContainer.d.ts.map +1 -1
  36. package/dist/types/src/components/Markdown/Container.stories.d.ts +14 -22
  37. package/dist/types/src/components/Markdown/Container.stories.d.ts.map +1 -1
  38. package/dist/types/src/components/Markdown/Slide.d.ts +1 -3
  39. package/dist/types/src/components/Markdown/Slide.d.ts.map +1 -1
  40. package/dist/types/src/components/Markdown/Slide.stories.d.ts +11 -12
  41. package/dist/types/src/components/Markdown/Slide.stories.d.ts.map +1 -1
  42. package/dist/types/src/components/Presenter/Pager.d.ts +1 -1
  43. package/dist/types/src/components/Presenter/Pager.d.ts.map +1 -1
  44. package/dist/types/src/components/Presenter/Pager.stories.d.ts +12 -4
  45. package/dist/types/src/components/Presenter/Pager.stories.d.ts.map +1 -1
  46. package/dist/types/src/components/PresenterSettings.d.ts.map +1 -1
  47. package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts.map +1 -1
  48. package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts +18 -2
  49. package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts.map +1 -1
  50. package/dist/types/src/components/index.d.ts +20 -3
  51. package/dist/types/src/components/index.d.ts.map +1 -1
  52. package/dist/types/src/meta.d.ts +0 -1
  53. package/dist/types/src/meta.d.ts.map +1 -1
  54. package/dist/types/src/translations.d.ts +1 -0
  55. package/dist/types/src/translations.d.ts.map +1 -1
  56. package/dist/types/src/types.d.ts +7 -6
  57. package/dist/types/src/types.d.ts.map +1 -1
  58. package/dist/types/src/useExitPresenter.d.ts.map +1 -1
  59. package/dist/types/tsconfig.tsbuildinfo +1 -1
  60. package/package.json +39 -38
  61. package/src/PresenterPlugin.tsx +23 -24
  62. package/src/capabilities/app-graph-builder.ts +49 -14
  63. package/src/capabilities/react-surface.tsx +25 -15
  64. package/src/capabilities/settings.ts +1 -1
  65. package/src/components/CollectionPresenterContainer.tsx +5 -4
  66. package/src/components/DocumentPresenterContainer.tsx +2 -1
  67. package/src/components/Markdown/Container.stories.tsx +21 -20
  68. package/src/components/Markdown/Container.tsx +1 -1
  69. package/src/components/Markdown/Slide.stories.tsx +11 -7
  70. package/src/components/Markdown/Slide.tsx +12 -128
  71. package/src/components/Markdown/styles.css +104 -0
  72. package/src/components/Markdown/theme.ts +2 -2
  73. package/src/components/Markdown/typings.d.ts +8 -0
  74. package/src/components/Presenter/Pager.stories.tsx +8 -8
  75. package/src/components/Presenter/Pager.tsx +53 -18
  76. package/src/components/PresenterSettings.tsx +15 -11
  77. package/src/components/RevealPlayer/RevealPlayer.stories.tsx +7 -5
  78. package/src/components/RevealPlayer/RevealPlayer.tsx +61 -57
  79. package/src/meta.ts +7 -4
  80. package/src/translations.ts +1 -0
  81. package/src/types.ts +5 -5
  82. package/src/useExitPresenter.ts +5 -3
  83. package/dist/lib/browser/CollectionPresenterContainer-IPDW4HZR.mjs.map +0 -7
  84. package/dist/lib/browser/DocumentPresenterContainer-LJBJM5UB.mjs.map +0 -7
  85. package/dist/lib/browser/MarkdownSlide-KG7ESCSU.mjs.map +0 -7
  86. package/dist/lib/browser/app-graph-builder-LURIPUEV.mjs +0 -77
  87. package/dist/lib/browser/app-graph-builder-LURIPUEV.mjs.map +0 -7
  88. package/dist/lib/browser/chunk-QWJM3ADC.mjs.map +0 -7
  89. package/dist/lib/browser/chunk-TANLITL2.mjs.map +0 -7
  90. package/dist/lib/browser/chunk-VSD5LSE5.mjs +0 -15
  91. package/dist/lib/browser/chunk-VSD5LSE5.mjs.map +0 -7
  92. package/dist/lib/browser/chunk-W4IR3DJE.mjs.map +0 -7
  93. package/dist/lib/browser/react-surface-3SPF2ANF.mjs.map +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-presenter",
3
- "version": "0.8.4-main.67995b8",
3
+ "version": "0.8.4-main.72ec0f3",
4
4
  "description": "Braneframe presenter plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -10,9 +10,9 @@
10
10
  "type": "module",
11
11
  "exports": {
12
12
  ".": {
13
+ "source": "./src/index.ts",
13
14
  "types": "./dist/types/src/index.d.ts",
14
- "browser": "./dist/lib/browser/index.mjs",
15
- "source": "./src/index.ts"
15
+ "browser": "./dist/lib/browser/index.mjs"
16
16
  }
17
17
  },
18
18
  "types": "dist/types/src/index.d.ts",
@@ -25,57 +25,58 @@
25
25
  ],
26
26
  "dependencies": {
27
27
  "@preact-signals/safe-react": "^0.9.0",
28
- "@preact/signals-core": "^1.9.0",
28
+ "@preact/signals-core": "^1.12.1",
29
29
  "hastscript": "^7.1.0",
30
30
  "highlight.js": "^11.9.0",
31
31
  "marked": "^12.0.2",
32
- "react-markdown": "^8.0.5",
32
+ "react-markdown": "^10.1.0",
33
33
  "react-resize-detector": "^11.0.1",
34
34
  "rehype-add-classes": "^1.0.0",
35
35
  "rehype-highlight": "^6.0.0",
36
36
  "remark-frontmatter": "^5.0.0",
37
37
  "remark-parse-frontmatter": "^1.0.3",
38
38
  "reveal.js": "^5.1.0",
39
- "@dxos/app-framework": "0.8.4-main.67995b8",
40
- "@dxos/async": "0.8.4-main.67995b8",
41
- "@dxos/echo": "0.8.4-main.67995b8",
42
- "@dxos/local-storage": "0.8.4-main.67995b8",
43
- "@dxos/echo-schema": "0.8.4-main.67995b8",
44
- "@dxos/log": "0.8.4-main.67995b8",
45
- "@dxos/plugin-client": "0.8.4-main.67995b8",
46
- "@dxos/plugin-deck": "0.8.4-main.67995b8",
47
- "@dxos/plugin-graph": "0.8.4-main.67995b8",
48
- "@dxos/plugin-markdown": "0.8.4-main.67995b8",
49
- "@dxos/live-object": "0.8.4-main.67995b8",
50
- "@dxos/plugin-stack": "0.8.4-main.67995b8",
51
- "@dxos/react-client": "0.8.4-main.67995b8",
52
- "@dxos/react-ui-stack": "0.8.4-main.67995b8",
53
- "@dxos/schema": "0.8.4-main.67995b8",
54
- "@dxos/react-ui-form": "0.8.4-main.67995b8"
39
+ "@dxos/app-framework": "0.8.4-main.72ec0f3",
40
+ "@dxos/async": "0.8.4-main.72ec0f3",
41
+ "@dxos/echo": "0.8.4-main.72ec0f3",
42
+ "@dxos/log": "0.8.4-main.72ec0f3",
43
+ "@dxos/live-object": "0.8.4-main.72ec0f3",
44
+ "@dxos/local-storage": "0.8.4-main.72ec0f3",
45
+ "@dxos/plugin-deck": "0.8.4-main.72ec0f3",
46
+ "@dxos/plugin-client": "0.8.4-main.72ec0f3",
47
+ "@dxos/plugin-graph": "0.8.4-main.72ec0f3",
48
+ "@dxos/plugin-markdown": "0.8.4-main.72ec0f3",
49
+ "@dxos/plugin-stack": "0.8.4-main.72ec0f3",
50
+ "@dxos/react-client": "0.8.4-main.72ec0f3",
51
+ "@dxos/react-ui-form": "0.8.4-main.72ec0f3",
52
+ "@dxos/types": "0.8.4-main.72ec0f3",
53
+ "@dxos/util": "0.8.4-main.72ec0f3",
54
+ "@dxos/react-ui-stack": "0.8.4-main.72ec0f3",
55
+ "@dxos/schema": "0.8.4-main.72ec0f3"
55
56
  },
56
57
  "devDependencies": {
57
- "@effect-rx/rx-react": "0.38.0",
58
- "@effect/platform": "0.89.0",
59
- "@types/react": "~18.2.0",
60
- "@types/react-dom": "~18.2.0",
58
+ "@effect-atom/atom-react": "^0.3.4",
59
+ "@effect/platform": "0.92.1",
60
+ "@types/react": "~19.2.2",
61
+ "@types/react-dom": "~19.2.2",
61
62
  "@types/reveal.js": "^5.0.3",
62
- "effect": "3.17.0",
63
- "react": "~18.2.0",
64
- "react-dom": "~18.2.0",
65
- "vite": "5.4.7",
66
- "@dxos/random": "0.8.4-main.67995b8",
67
- "@dxos/react-ui": "0.8.4-main.67995b8",
68
- "@dxos/react-ui-theme": "0.8.4-main.67995b8",
69
- "@dxos/storybook-utils": "0.8.4-main.67995b8"
63
+ "effect": "3.18.3",
64
+ "react": "~19.2.0",
65
+ "react-dom": "~19.2.0",
66
+ "vite": "7.1.9",
67
+ "@dxos/random": "0.8.4-main.72ec0f3",
68
+ "@dxos/react-ui": "0.8.4-main.72ec0f3",
69
+ "@dxos/storybook-utils": "0.8.4-main.72ec0f3",
70
+ "@dxos/react-ui-theme": "0.8.4-main.72ec0f3"
70
71
  },
71
72
  "peerDependencies": {
72
- "@effect-rx/rx-react": "^0.34.1",
73
+ "@effect-atom/atom-react": "^0.3.4",
73
74
  "@effect/platform": "^0.80.12",
74
75
  "effect": "^3.13.3",
75
- "react": "~18.2.0",
76
- "react-dom": "~18.2.0",
77
- "@dxos/react-ui": "0.8.4-main.67995b8",
78
- "@dxos/react-ui-theme": "0.8.4-main.67995b8"
76
+ "react": "^19.0.0",
77
+ "react-dom": "^19.0.0",
78
+ "@dxos/react-ui": "0.8.4-main.72ec0f3",
79
+ "@dxos/react-ui-theme": "0.8.4-main.72ec0f3"
79
80
  },
80
81
  "publishConfig": {
81
82
  "access": "public"
@@ -2,7 +2,7 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { definePlugin, defineModule, Events, contributes, Capabilities } from '@dxos/app-framework';
5
+ import { Capabilities, Events, contributes, defineModule, definePlugin } from '@dxos/app-framework';
6
6
 
7
7
  import { AppGraphBuilder, PresenterSettings, ReactSurface } from './capabilities';
8
8
  import { meta } from './meta';
@@ -11,26 +11,25 @@ import { translations } from './translations';
11
11
  // TODO(burdon): Only scale markdown content.
12
12
  // TODO(burdon): Map stack content; Slide content type (e.g., markdown, sketch, IPFS image, table, etc.)
13
13
 
14
- export const PresenterPlugin = () =>
15
- definePlugin(meta, [
16
- defineModule({
17
- id: `${meta.id}/module/settings`,
18
- activatesOn: Events.SetupSettings,
19
- activate: PresenterSettings,
20
- }),
21
- defineModule({
22
- id: `${meta.id}/module/translations`,
23
- activatesOn: Events.SetupTranslations,
24
- activate: () => contributes(Capabilities.Translations, translations),
25
- }),
26
- defineModule({
27
- id: `${meta.id}/module/react-surface`,
28
- activatesOn: Events.SetupReactSurface,
29
- activate: ReactSurface,
30
- }),
31
- defineModule({
32
- id: `${meta.id}/module/app-graph-builder`,
33
- activatesOn: Events.SetupAppGraph,
34
- activate: AppGraphBuilder,
35
- }),
36
- ]);
14
+ export const PresenterPlugin = definePlugin(meta, () => [
15
+ defineModule({
16
+ id: `${meta.id}/module/settings`,
17
+ activatesOn: Events.SetupSettings,
18
+ activate: PresenterSettings,
19
+ }),
20
+ defineModule({
21
+ id: `${meta.id}/module/translations`,
22
+ activatesOn: Events.SetupTranslations,
23
+ activate: () => contributes(Capabilities.Translations, translations),
24
+ }),
25
+ defineModule({
26
+ id: `${meta.id}/module/react-surface`,
27
+ activatesOn: Events.SetupReactSurface,
28
+ activate: ReactSurface,
29
+ }),
30
+ defineModule({
31
+ id: `${meta.id}/module/app-graph-builder`,
32
+ activatesOn: Events.SetupAppGraph,
33
+ activate: AppGraphBuilder,
34
+ }),
35
+ ]);
@@ -2,42 +2,76 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Rx } from '@effect-rx/rx-react';
6
- import { Option, pipe } from 'effect';
5
+ import { Atom } from '@effect-atom/atom-react';
6
+ import * as Function from 'effect/Function';
7
+ import * as Option from 'effect/Option';
7
8
 
8
- import { contributes, type PluginContext, Capabilities, createIntent, LayoutAction } from '@dxos/app-framework';
9
+ import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
9
10
  import { Obj } from '@dxos/echo';
10
11
  import { DeckCapabilities } from '@dxos/plugin-deck';
11
12
  import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
12
- import { createExtension, rxFromSignal } from '@dxos/plugin-graph';
13
+ import { atomFromSignal, createExtension } from '@dxos/plugin-graph';
13
14
  import { Markdown } from '@dxos/plugin-markdown/types';
14
- import { fullyQualifiedId, getSpace } from '@dxos/react-client/echo';
15
- import { DataType } from '@dxos/schema';
15
+ import { getSpace } from '@dxos/react-client/echo';
16
+ import { Collection } from '@dxos/schema';
16
17
 
17
- import { PRESENTER_PLUGIN } from '../meta';
18
+ import { meta } from '../meta';
18
19
  import { PresenterAction, type PresenterSettingsProps } from '../types';
19
20
 
20
21
  export default (context: PluginContext) =>
21
22
  contributes(
22
23
  Capabilities.AppGraphBuilder,
23
24
  createExtension({
24
- id: PRESENTER_PLUGIN,
25
+ id: `${meta.id}/root`,
26
+ // TODO(wittjosiah): This is a hack to work around presenter previously relying on "variant". Remove.
27
+ connector: (node) =>
28
+ Atom.make((get) =>
29
+ Function.pipe(
30
+ get(node),
31
+ Option.flatMap((node) => {
32
+ const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
33
+ const settings = get(
34
+ atomFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(meta.id)?.value),
35
+ );
36
+ const isPresentable = settings?.presentCollections
37
+ ? Obj.instanceOf(Collection.Collection, node.data) || Obj.instanceOf(Markdown.Document, node.data)
38
+ : Obj.instanceOf(Markdown.Document, node.data);
39
+ return isPresentable ? Option.some(node.data) : Option.none();
40
+ }),
41
+ Option.map((object) => {
42
+ const id = Obj.getDXN(object).toString();
43
+ return [
44
+ {
45
+ id: [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR),
46
+ data: { type: meta.id, object },
47
+ type: meta.id,
48
+ properties: {
49
+ label: 'Presenter',
50
+ icon: 'ph--presentation--regular',
51
+ disposition: 'hidden',
52
+ },
53
+ },
54
+ ];
55
+ }),
56
+ Option.getOrElse(() => []),
57
+ ),
58
+ ),
25
59
  actions: (node) =>
26
- Rx.make((get) =>
27
- pipe(
60
+ Atom.make((get) =>
61
+ Function.pipe(
28
62
  get(node),
29
63
  Option.flatMap((node) => {
30
64
  const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
31
65
  const settings = get(
32
- rxFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(PRESENTER_PLUGIN)?.value),
66
+ atomFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(meta.id)?.value),
33
67
  );
34
68
  const isPresentable = settings?.presentCollections
35
- ? Obj.instanceOf(DataType.Collection, node.data) || Obj.instanceOf(Markdown.Document, node.data)
69
+ ? Obj.instanceOf(Collection.Collection, node.data) || Obj.instanceOf(Markdown.Document, node.data)
36
70
  : Obj.instanceOf(Markdown.Document, node.data);
37
71
  return isPresentable ? Option.some(node.data) : Option.none();
38
72
  }),
39
73
  Option.map((object) => {
40
- const id = fullyQualifiedId(object);
74
+ const id = Obj.getDXN(object).toString();
41
75
  const spaceId = getSpace(object)?.id;
42
76
  return [
43
77
  {
@@ -65,8 +99,9 @@ export default (context: PluginContext) =>
65
99
  );
66
100
  },
67
101
  properties: {
68
- label: ['toggle presentation label', { ns: PRESENTER_PLUGIN }],
102
+ label: ['toggle presentation label', { ns: meta.id }],
69
103
  icon: 'ph--presentation--regular',
104
+ disposition: 'list-item',
70
105
  keyBinding: {
71
106
  macos: 'shift+meta+p',
72
107
  windows: 'shift+alt+p',
@@ -8,46 +8,56 @@ import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
8
8
  import { Obj } from '@dxos/echo';
9
9
  import { SettingsStore } from '@dxos/local-storage';
10
10
  import { Markdown } from '@dxos/plugin-markdown/types';
11
- import { DataType } from '@dxos/schema';
11
+ import { Collection } from '@dxos/schema';
12
12
 
13
13
  import {
14
+ CollectionPresenterContainer,
15
+ DocumentPresenterContainer,
14
16
  MarkdownSlide,
15
17
  PresenterSettings,
16
- DocumentPresenterContainer,
17
- CollectionPresenterContainer,
18
18
  } from '../components';
19
- import { PRESENTER_PLUGIN } from '../meta';
19
+ import { meta } from '../meta';
20
20
  import { type PresenterSettingsProps } from '../types';
21
21
 
22
22
  export default () =>
23
23
  contributes(Capabilities.ReactSurface, [
24
24
  createSurface({
25
- id: `${PRESENTER_PLUGIN}/document`,
25
+ id: `${meta.id}/document`,
26
26
  role: 'article',
27
27
  position: 'hoist',
28
- filter: (data): data is { subject: Markdown.Document; variant: 'presenter' } =>
29
- Obj.instanceOf(Markdown.Document, data.subject) && data.variant === 'presenter',
30
- component: ({ data }) => <DocumentPresenterContainer document={data.subject} />,
28
+ filter: (data): data is { subject: { type: typeof meta.id; object: Markdown.Document } } =>
29
+ !!data.subject &&
30
+ typeof data.subject === 'object' &&
31
+ 'type' in data.subject &&
32
+ 'object' in data.subject &&
33
+ data.subject.type === meta.id &&
34
+ Obj.instanceOf(Markdown.Document, data.subject.object),
35
+ component: ({ data }) => <DocumentPresenterContainer document={data.subject.object} />,
31
36
  }),
32
37
  createSurface({
33
- id: `${PRESENTER_PLUGIN}/collection`,
38
+ id: `${meta.id}/collection`,
34
39
  role: 'article',
35
40
  position: 'hoist',
36
- filter: (data): data is { subject: DataType.Collection; variant: 'presenter' } =>
37
- Obj.instanceOf(DataType.Collection, data.subject) && data.variant === 'presenter',
38
- component: ({ data }) => <CollectionPresenterContainer collection={data.subject} />,
41
+ filter: (data): data is { subject: { type: typeof meta.id; object: Collection.Collection } } =>
42
+ !!data.subject &&
43
+ typeof data.subject === 'object' &&
44
+ 'type' in data.subject &&
45
+ 'object' in data.subject &&
46
+ data.subject.type === meta.id &&
47
+ Obj.instanceOf(Collection.Collection, data.subject.object),
48
+ component: ({ data }) => <CollectionPresenterContainer collection={data.subject.object} />,
39
49
  }),
40
50
  createSurface({
41
- id: `${PRESENTER_PLUGIN}/slide`,
51
+ id: `${meta.id}/slide`,
42
52
  role: 'slide',
43
53
  filter: (data): data is { subject: Markdown.Document } => Obj.instanceOf(Markdown.Document, data.subject),
44
54
  component: ({ data }) => <MarkdownSlide document={data.subject} />,
45
55
  }),
46
56
  createSurface({
47
- id: `${PRESENTER_PLUGIN}/plugin-settings`,
57
+ id: `${meta.id}/plugin-settings`,
48
58
  role: 'article',
49
59
  filter: (data): data is { subject: SettingsStore<PresenterSettingsProps> } =>
50
- data.subject instanceof SettingsStore && data.subject.prefix === PRESENTER_PLUGIN,
60
+ data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
51
61
  component: ({ data: { subject } }) => <PresenterSettings settings={subject.value} />,
52
62
  }),
53
63
  ]);
@@ -6,7 +6,7 @@ import { Capabilities, contributes } from '@dxos/app-framework';
6
6
  import { live } from '@dxos/live-object';
7
7
 
8
8
  import { meta } from '../meta';
9
- import { PresenterSettingsSchema, type PresenterSettingsProps } from '../types';
9
+ import { type PresenterSettingsProps, PresenterSettingsSchema } from '../types';
10
10
 
11
11
  export default () => {
12
12
  const settings = live<PresenterSettingsProps>({});
@@ -4,15 +4,16 @@
4
4
 
5
5
  import React, { type FC, useContext, useState } from 'react';
6
6
 
7
- import { Surface } from '@dxos/app-framework';
7
+ import { Surface } from '@dxos/app-framework/react';
8
8
  import { StackItem } from '@dxos/react-ui-stack';
9
- import { type DataType } from '@dxos/schema';
9
+ import { type Collection } from '@dxos/schema';
10
10
 
11
- import { Layout, PageNumber, Pager } from './Presenter';
12
11
  import { PresenterContext } from '../types';
13
12
  import { useExitPresenter } from '../useExitPresenter';
14
13
 
15
- const CollectionPresenterContainer: FC<{ collection: DataType.Collection }> = ({ collection }) => {
14
+ import { Layout, PageNumber, Pager } from './Presenter';
15
+
16
+ const CollectionPresenterContainer: FC<{ collection: Collection.Collection }> = ({ collection }) => {
16
17
  const [slide, setSlide] = useState(0);
17
18
 
18
19
  const { running } = useContext(PresenterContext);
@@ -6,9 +6,10 @@ import React, { type FC } from 'react';
6
6
  import { type Markdown } from '@dxos/plugin-markdown/types';
7
7
  import { StackItem } from '@dxos/react-ui-stack';
8
8
 
9
- import { RevealPlayer } from './RevealPlayer';
10
9
  import { useExitPresenter } from '../useExitPresenter';
11
10
 
11
+ import { RevealPlayer } from './RevealPlayer';
12
+
12
13
  const DocumentPresenterContainer: FC<{ document: Markdown.Document }> = ({ document }) => {
13
14
  const handleExit = useExitPresenter(document);
14
15
 
@@ -2,16 +2,15 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
- import { type Meta } from '@storybook/react-vite';
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
10
- import { withLayout, withTheme } from '@dxos/storybook-utils';
8
+ import { withTheme } from '@dxos/react-ui/testing';
9
+
10
+ import { createSlide } from '../../testing';
11
11
 
12
12
  import { Container } from './Container';
13
13
  import { Slide, type SlideProps } from './Slide';
14
- import { createSlide } from '../../testing';
15
14
 
16
15
  const DefaultStory = ({ content = '' }: SlideProps) => {
17
16
  return (
@@ -21,37 +20,39 @@ const DefaultStory = ({ content = '' }: SlideProps) => {
21
20
  );
22
21
  };
23
22
 
24
- export const Default = {
23
+ const meta = {
24
+ title: 'plugins/plugin-presenter/Container',
25
+ render: DefaultStory,
26
+ decorators: [withTheme],
27
+ parameters: {
28
+ layout: 'fullscreen',
29
+ },
30
+ } satisfies Meta<typeof DefaultStory>;
31
+
32
+ export default meta;
33
+
34
+ type Story = StoryObj<typeof meta>;
35
+
36
+ export const Default: Story = {
25
37
  args: {
26
38
  content: createSlide({ number: 1 }),
27
39
  },
28
40
  };
29
41
 
30
- export const Code = {
42
+ export const Code: Story = {
31
43
  args: {
32
44
  content: createSlide({ code: true }),
33
45
  },
34
46
  };
35
47
 
36
- export const List = {
48
+ export const List: Story = {
37
49
  args: {
38
50
  content: createSlide({ list: 3 }),
39
51
  },
40
52
  };
41
53
 
42
- export const Ordered = {
54
+ export const Ordered: Story = {
43
55
  args: {
44
56
  content: createSlide({ ordered: 4 }),
45
57
  },
46
58
  };
47
-
48
- const meta: Meta<typeof Slide> = {
49
- title: 'plugins/plugin-presenter/Container',
50
- render: DefaultStory,
51
- decorators: [withTheme, withLayout({ fullscreen: true })],
52
- parameters: {
53
- layout: 'fullscreen',
54
- },
55
- };
56
-
57
- export default meta;
@@ -36,7 +36,7 @@ export const Container = ({ children, classNames }: ContainerProps) => {
36
36
  // https://www.npmjs.com/package/react-markdown
37
37
  return (
38
38
  <div ref={containerRef} className={mx('flex grow relative overflow-hidden bg-attention', classNames)}>
39
- <div className={mx('flex w-full h-full overflow-hidden absolute')} style={props}>
39
+ <div className={mx('flex is-full bs-full overflow-hidden absolute')} style={props}>
40
40
  {width && height && children}
41
41
  </div>
42
42
  </div>
@@ -2,30 +2,34 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
 
7
- import { type Meta } from '@storybook/react-vite';
7
+ import { withTheme } from '@dxos/react-ui/testing';
8
8
 
9
- import { Slide } from './Slide';
10
9
  import { createSlide } from '../../testing';
11
10
 
12
- const meta: Meta = {
11
+ import { Slide } from './Slide';
12
+
13
+ const meta = {
13
14
  title: 'plugins/plugin-presenter/Slide',
14
15
  component: Slide,
16
+ decorators: [withTheme],
15
17
  parameters: {
16
18
  layout: 'fullscreen',
17
19
  },
18
- };
20
+ } satisfies Meta<typeof Slide>;
19
21
 
20
22
  export default meta;
21
23
 
22
- export const Default = {
24
+ type Story = StoryObj<typeof meta>;
25
+
26
+ export const Default: Story = {
23
27
  args: {
24
28
  content: createSlide(),
25
29
  },
26
30
  };
27
31
 
28
- export const Code = {
32
+ export const Code: Story = {
29
33
  args: {
30
34
  content: createSlide({ code: true }),
31
35
  },