@dxos/plugin-presenter 0.8.4-main.5ea62a8 → 0.8.4-main.66e292d

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 (77) hide show
  1. package/dist/lib/browser/{CollectionPresenterContainer-U7D57ZVN.mjs → CollectionPresenterContainer-4JFW3EKV.mjs} +31 -23
  2. package/dist/lib/browser/CollectionPresenterContainer-4JFW3EKV.mjs.map +7 -0
  3. package/dist/lib/browser/{DocumentPresenterContainer-F42V4KAL.mjs → DocumentPresenterContainer-SX32NAEH.mjs} +5 -5
  4. package/dist/lib/browser/{DocumentPresenterContainer-F42V4KAL.mjs.map → DocumentPresenterContainer-SX32NAEH.mjs.map} +2 -2
  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-5LNLRZBN.mjs → app-graph-builder-UJEKUKAP.mjs} +24 -23
  8. package/dist/lib/browser/app-graph-builder-UJEKUKAP.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-UVGTHJUO.mjs → chunk-BJWK5GQV.mjs} +6 -4
  10. package/dist/lib/browser/chunk-BJWK5GQV.mjs.map +7 -0
  11. package/dist/lib/browser/{chunk-NINDSVTB.mjs → chunk-Q3H4KEFB.mjs} +8 -8
  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 +6 -8
  18. package/dist/lib/browser/index.mjs.map +2 -2
  19. package/dist/lib/browser/meta.json +1 -1
  20. package/dist/lib/browser/{react-surface-GZIAFGCD.mjs → react-surface-S4T6X72R.mjs} +14 -14
  21. package/dist/lib/browser/react-surface-S4T6X72R.mjs.map +7 -0
  22. package/dist/lib/browser/{settings-VQVVDAGY.mjs → settings-57TUVRW3.mjs} +5 -5
  23. package/dist/lib/browser/{settings-VQVVDAGY.mjs.map → settings-57TUVRW3.mjs.map} +1 -1
  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.map +1 -1
  27. package/dist/types/src/components/CollectionPresenterContainer.d.ts +2 -2
  28. package/dist/types/src/components/CollectionPresenterContainer.d.ts.map +1 -1
  29. package/dist/types/src/components/Markdown/Container.stories.d.ts +0 -1
  30. package/dist/types/src/components/Markdown/Container.stories.d.ts.map +1 -1
  31. package/dist/types/src/components/Markdown/Slide.d.ts +1 -3
  32. package/dist/types/src/components/Markdown/Slide.d.ts.map +1 -1
  33. package/dist/types/src/components/Markdown/Slide.stories.d.ts +1 -1
  34. package/dist/types/src/components/Markdown/Slide.stories.d.ts.map +1 -1
  35. package/dist/types/src/components/Presenter/Pager.d.ts.map +1 -1
  36. package/dist/types/src/components/Presenter/Pager.stories.d.ts +0 -1
  37. package/dist/types/src/components/Presenter/Pager.stories.d.ts.map +1 -1
  38. package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts.map +1 -1
  39. package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts +1 -1
  40. package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts.map +1 -1
  41. package/dist/types/src/components/index.d.ts +8 -6
  42. package/dist/types/src/components/index.d.ts.map +1 -1
  43. package/dist/types/src/meta.d.ts +0 -1
  44. package/dist/types/src/meta.d.ts.map +1 -1
  45. package/dist/types/src/types.d.ts +8 -10
  46. package/dist/types/src/types.d.ts.map +1 -1
  47. package/dist/types/src/useExitPresenter.d.ts.map +1 -1
  48. package/dist/types/tsconfig.tsbuildinfo +1 -1
  49. package/package.json +37 -36
  50. package/src/PresenterPlugin.tsx +22 -23
  51. package/src/capabilities/app-graph-builder.ts +21 -20
  52. package/src/capabilities/react-surface.tsx +12 -12
  53. package/src/components/CollectionPresenterContainer.tsx +3 -3
  54. package/src/components/Markdown/Container.stories.tsx +2 -4
  55. package/src/components/Markdown/Container.tsx +1 -1
  56. package/src/components/Markdown/Slide.stories.tsx +3 -2
  57. package/src/components/Markdown/Slide.tsx +12 -128
  58. package/src/components/Markdown/styles.css +104 -0
  59. package/src/components/Markdown/theme.ts +2 -2
  60. package/src/components/Markdown/typings.d.ts +8 -0
  61. package/src/components/Presenter/Pager.stories.tsx +1 -3
  62. package/src/components/Presenter/Pager.tsx +51 -16
  63. package/src/components/PresenterSettings.tsx +3 -3
  64. package/src/components/RevealPlayer/RevealPlayer.stories.tsx +3 -2
  65. package/src/components/RevealPlayer/RevealPlayer.tsx +11 -4
  66. package/src/meta.ts +7 -4
  67. package/src/types.ts +5 -5
  68. package/src/useExitPresenter.ts +5 -3
  69. package/dist/lib/browser/CollectionPresenterContainer-U7D57ZVN.mjs.map +0 -7
  70. package/dist/lib/browser/MarkdownSlide-KG7ESCSU.mjs.map +0 -7
  71. package/dist/lib/browser/app-graph-builder-5LNLRZBN.mjs.map +0 -7
  72. package/dist/lib/browser/chunk-NINDSVTB.mjs.map +0 -7
  73. package/dist/lib/browser/chunk-UVGTHJUO.mjs.map +0 -7
  74. package/dist/lib/browser/chunk-VSD5LSE5.mjs +0 -15
  75. package/dist/lib/browser/chunk-VSD5LSE5.mjs.map +0 -7
  76. package/dist/lib/browser/chunk-W4IR3DJE.mjs.map +0 -7
  77. package/dist/lib/browser/react-surface-GZIAFGCD.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.5ea62a8",
3
+ "version": "0.8.4-main.66e292d",
4
4
  "description": "Braneframe presenter plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -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.5ea62a8",
40
- "@dxos/async": "0.8.4-main.5ea62a8",
41
- "@dxos/echo": "0.8.4-main.5ea62a8",
42
- "@dxos/live-object": "0.8.4-main.5ea62a8",
43
- "@dxos/echo-schema": "0.8.4-main.5ea62a8",
44
- "@dxos/local-storage": "0.8.4-main.5ea62a8",
45
- "@dxos/plugin-client": "0.8.4-main.5ea62a8",
46
- "@dxos/log": "0.8.4-main.5ea62a8",
47
- "@dxos/plugin-deck": "0.8.4-main.5ea62a8",
48
- "@dxos/plugin-markdown": "0.8.4-main.5ea62a8",
49
- "@dxos/plugin-graph": "0.8.4-main.5ea62a8",
50
- "@dxos/plugin-stack": "0.8.4-main.5ea62a8",
51
- "@dxos/react-client": "0.8.4-main.5ea62a8",
52
- "@dxos/react-ui-form": "0.8.4-main.5ea62a8",
53
- "@dxos/react-ui-stack": "0.8.4-main.5ea62a8",
54
- "@dxos/schema": "0.8.4-main.5ea62a8"
39
+ "@dxos/app-framework": "0.8.4-main.66e292d",
40
+ "@dxos/async": "0.8.4-main.66e292d",
41
+ "@dxos/live-object": "0.8.4-main.66e292d",
42
+ "@dxos/local-storage": "0.8.4-main.66e292d",
43
+ "@dxos/log": "0.8.4-main.66e292d",
44
+ "@dxos/echo": "0.8.4-main.66e292d",
45
+ "@dxos/plugin-client": "0.8.4-main.66e292d",
46
+ "@dxos/plugin-deck": "0.8.4-main.66e292d",
47
+ "@dxos/plugin-graph": "0.8.4-main.66e292d",
48
+ "@dxos/plugin-stack": "0.8.4-main.66e292d",
49
+ "@dxos/react-ui-form": "0.8.4-main.66e292d",
50
+ "@dxos/plugin-markdown": "0.8.4-main.66e292d",
51
+ "@dxos/react-client": "0.8.4-main.66e292d",
52
+ "@dxos/react-ui-stack": "0.8.4-main.66e292d",
53
+ "@dxos/types": "0.8.4-main.66e292d",
54
+ "@dxos/schema": "0.8.4-main.66e292d",
55
+ "@dxos/util": "0.8.4-main.66e292d"
55
56
  },
56
57
  "devDependencies": {
57
- "@effect-rx/rx-react": "0.38.0",
58
- "@effect/platform": "0.90.2",
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.7",
63
- "react": "~18.2.0",
64
- "react-dom": "~18.2.0",
65
- "vite": "7.1.1",
66
- "@dxos/react-ui": "0.8.4-main.5ea62a8",
67
- "@dxos/random": "0.8.4-main.5ea62a8",
68
- "@dxos/react-ui-theme": "0.8.4-main.5ea62a8",
69
- "@dxos/storybook-utils": "0.8.4-main.5ea62a8"
63
+ "effect": "3.18.3",
64
+ "react": "~19.2.0",
65
+ "react-dom": "~19.2.0",
66
+ "vite": "7.1.9",
67
+ "@dxos/react-ui": "0.8.4-main.66e292d",
68
+ "@dxos/react-ui-theme": "0.8.4-main.66e292d",
69
+ "@dxos/storybook-utils": "0.8.4-main.66e292d",
70
+ "@dxos/random": "0.8.4-main.66e292d"
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-theme": "0.8.4-main.5ea62a8",
78
- "@dxos/react-ui": "0.8.4-main.5ea62a8"
76
+ "react": "^19.0.0",
77
+ "react-dom": "^19.0.0",
78
+ "@dxos/react-ui": "0.8.4-main.66e292d",
79
+ "@dxos/react-ui-theme": "0.8.4-main.66e292d"
79
80
  },
80
81
  "publishConfig": {
81
82
  "access": "public"
@@ -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,48 +2,49 @@
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
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`,
25
26
  // TODO(wittjosiah): This is a hack to work around presenter previously relying on "variant". Remove.
26
27
  connector: (node) =>
27
- Rx.make((get) =>
28
- pipe(
28
+ Atom.make((get) =>
29
+ Function.pipe(
29
30
  get(node),
30
31
  Option.flatMap((node) => {
31
32
  const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
32
33
  const settings = get(
33
- rxFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(PRESENTER_PLUGIN)?.value),
34
+ atomFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(meta.id)?.value),
34
35
  );
35
36
  const isPresentable = settings?.presentCollections
36
- ? Obj.instanceOf(DataType.Collection, node.data) || Obj.instanceOf(Markdown.Document, node.data)
37
+ ? Obj.instanceOf(Collection.Collection, node.data) || Obj.instanceOf(Markdown.Document, node.data)
37
38
  : Obj.instanceOf(Markdown.Document, node.data);
38
39
  return isPresentable ? Option.some(node.data) : Option.none();
39
40
  }),
40
41
  Option.map((object) => {
41
- const id = fullyQualifiedId(object);
42
+ const id = Obj.getDXN(object).toString();
42
43
  return [
43
44
  {
44
45
  id: [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR),
45
- data: { type: PRESENTER_PLUGIN, object },
46
- type: PRESENTER_PLUGIN,
46
+ data: { type: meta.id, object },
47
+ type: meta.id,
47
48
  properties: {
48
49
  label: 'Presenter',
49
50
  icon: 'ph--presentation--regular',
@@ -56,21 +57,21 @@ export default (context: PluginContext) =>
56
57
  ),
57
58
  ),
58
59
  actions: (node) =>
59
- Rx.make((get) =>
60
- pipe(
60
+ Atom.make((get) =>
61
+ Function.pipe(
61
62
  get(node),
62
63
  Option.flatMap((node) => {
63
64
  const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
64
65
  const settings = get(
65
- rxFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(PRESENTER_PLUGIN)?.value),
66
+ atomFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(meta.id)?.value),
66
67
  );
67
68
  const isPresentable = settings?.presentCollections
68
- ? 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)
69
70
  : Obj.instanceOf(Markdown.Document, node.data);
70
71
  return isPresentable ? Option.some(node.data) : Option.none();
71
72
  }),
72
73
  Option.map((object) => {
73
- const id = fullyQualifiedId(object);
74
+ const id = Obj.getDXN(object).toString();
74
75
  const spaceId = getSpace(object)?.id;
75
76
  return [
76
77
  {
@@ -98,7 +99,7 @@ export default (context: PluginContext) =>
98
99
  );
99
100
  },
100
101
  properties: {
101
- label: ['toggle presentation label', { ns: PRESENTER_PLUGIN }],
102
+ label: ['toggle presentation label', { ns: meta.id }],
102
103
  icon: 'ph--presentation--regular',
103
104
  disposition: 'list-item',
104
105
  keyBinding: {
@@ -8,7 +8,7 @@ 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
14
  CollectionPresenterContainer,
@@ -16,48 +16,48 @@ import {
16
16
  MarkdownSlide,
17
17
  PresenterSettings,
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: { type: typeof PRESENTER_PLUGIN; object: Markdown.Document } } =>
28
+ filter: (data): data is { subject: { type: typeof meta.id; object: Markdown.Document } } =>
29
29
  !!data.subject &&
30
30
  typeof data.subject === 'object' &&
31
31
  'type' in data.subject &&
32
32
  'object' in data.subject &&
33
- data.subject.type === PRESENTER_PLUGIN &&
33
+ data.subject.type === meta.id &&
34
34
  Obj.instanceOf(Markdown.Document, data.subject.object),
35
35
  component: ({ data }) => <DocumentPresenterContainer document={data.subject.object} />,
36
36
  }),
37
37
  createSurface({
38
- id: `${PRESENTER_PLUGIN}/collection`,
38
+ id: `${meta.id}/collection`,
39
39
  role: 'article',
40
40
  position: 'hoist',
41
- filter: (data): data is { subject: { type: typeof PRESENTER_PLUGIN; object: DataType.Collection } } =>
41
+ filter: (data): data is { subject: { type: typeof meta.id; object: Collection.Collection } } =>
42
42
  !!data.subject &&
43
43
  typeof data.subject === 'object' &&
44
44
  'type' in data.subject &&
45
45
  'object' in data.subject &&
46
- data.subject.type === PRESENTER_PLUGIN &&
47
- Obj.instanceOf(DataType.Collection, data.subject.object),
46
+ data.subject.type === meta.id &&
47
+ Obj.instanceOf(Collection.Collection, data.subject.object),
48
48
  component: ({ data }) => <CollectionPresenterContainer collection={data.subject.object} />,
49
49
  }),
50
50
  createSurface({
51
- id: `${PRESENTER_PLUGIN}/slide`,
51
+ id: `${meta.id}/slide`,
52
52
  role: 'slide',
53
53
  filter: (data): data is { subject: Markdown.Document } => Obj.instanceOf(Markdown.Document, data.subject),
54
54
  component: ({ data }) => <MarkdownSlide document={data.subject} />,
55
55
  }),
56
56
  createSurface({
57
- id: `${PRESENTER_PLUGIN}/plugin-settings`,
57
+ id: `${meta.id}/plugin-settings`,
58
58
  role: 'article',
59
59
  filter: (data): data is { subject: SettingsStore<PresenterSettingsProps> } =>
60
- data.subject instanceof SettingsStore && data.subject.prefix === PRESENTER_PLUGIN,
60
+ data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
61
61
  component: ({ data: { subject } }) => <PresenterSettings settings={subject.value} />,
62
62
  }),
63
63
  ]);
@@ -4,16 +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
11
  import { PresenterContext } from '../types';
12
12
  import { useExitPresenter } from '../useExitPresenter';
13
13
 
14
14
  import { Layout, PageNumber, Pager } from './Presenter';
15
15
 
16
- const CollectionPresenterContainer: FC<{ collection: DataType.Collection }> = ({ collection }) => {
16
+ const CollectionPresenterContainer: FC<{ collection: Collection.Collection }> = ({ collection }) => {
17
17
  const [slide, setSlide] = useState(0);
18
18
 
19
19
  const { running } = useContext(PresenterContext);
@@ -2,12 +2,10 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
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';
11
9
 
12
10
  import { createSlide } from '../../testing';
13
11
 
@@ -25,7 +23,7 @@ const DefaultStory = ({ content = '' }: SlideProps) => {
25
23
  const meta = {
26
24
  title: 'plugins/plugin-presenter/Container',
27
25
  render: DefaultStory,
28
- decorators: [withTheme, withLayout({ fullscreen: true })],
26
+ decorators: [withTheme],
29
27
  parameters: {
30
28
  layout: 'fullscreen',
31
29
  },
@@ -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,10 +2,10 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
 
7
+ import { withTheme } from '@dxos/react-ui/testing';
8
+
9
9
  import { createSlide } from '../../testing';
10
10
 
11
11
  import { Slide } from './Slide';
@@ -13,6 +13,7 @@ import { Slide } from './Slide';
13
13
  const meta = {
14
14
  title: 'plugins/plugin-presenter/Slide',
15
15
  component: Slide,
16
+ decorators: [withTheme],
16
17
  parameters: {
17
18
  layout: 'fullscreen',
18
19
  },
@@ -4,19 +4,20 @@
4
4
 
5
5
  import { h } from 'hastscript';
6
6
  import React from 'react';
7
- import ReactMarkdown from 'react-markdown';
8
- import addClasses from 'rehype-add-classes';
9
- import highlight from 'rehype-highlight';
7
+ import ReactMarkdown, { type Options as ReactMarkdownOptions } from 'react-markdown';
8
+ import rehypeAddClasses from 'rehype-add-classes';
9
+ import rehypeHighlight from 'rehype-highlight';
10
10
  import remarkFrontmatter from 'remark-frontmatter';
11
11
  import remarkParseFrontmatter from 'remark-parse-frontmatter';
12
12
 
13
13
  import 'highlight.js/styles/github.css';
14
14
 
15
+ import styles from './styles.css?raw';
15
16
  import { theme } from './theme';
16
17
 
17
18
  export type SlideProps = {
18
19
  content?: string;
19
- classes?: { [selector: string]: string };
20
+ classes?: Record<string, string>;
20
21
  };
21
22
 
22
23
  export const Slide = ({ content = '', classes = theme.nodes }: SlideProps) => {
@@ -24,132 +25,13 @@ export const Slide = ({ content = '', classes = theme.nodes }: SlideProps) => {
24
25
  // configurable. Find a way to remove the literal stylesheet here.
25
26
  return (
26
27
  <>
27
- <style>{`
28
- .dark pre code.hljs {
29
- display: block;
30
- overflow-x: auto;
31
- padding: 1em
32
- }
33
- .dark code.hljs {
34
- padding: 3px 5px
35
- }
36
- /*!
37
- Theme: GitHub Dark
38
- Description: Dark theme as seen on github.com
39
- Author: github.com
40
- Maintainer: @Hirse
41
- Updated: 2021-05-15
42
-
43
- Outdated base version: https://github.com/primer/github-syntax-dark
44
- Current colors taken from GitHub's CSS
45
- */
46
- .dark .hljs {
47
- color: #c9d1d9;
48
- background: #0d1117
49
- }
50
- .dark .hljs-doctag,
51
- .dark .hljs-keyword,
52
- .dark .hljs-meta .hljs-keyword,
53
- .dark .hljs-template-tag,
54
- .dark .hljs-template-variable,
55
- .dark .hljs-type,
56
- .dark .hljs-variable.language_ {
57
- /* prettylights-syntax-keyword */
58
- color: #ff7b72
59
- }
60
- .dark .hljs-title,
61
- .dark .hljs-title.class_,
62
- .dark .hljs-title.class_.inherited__,
63
- .dark .hljs-title.function_ {
64
- /* prettylights-syntax-entity */
65
- color: #d2a8ff
66
- }
67
- .dark .hljs-attr,
68
- .dark .hljs-attribute,
69
- .dark .hljs-literal,
70
- .dark .hljs-meta,
71
- .dark .hljs-number,
72
- .dark .hljs-operator,
73
- .dark .hljs-variable,
74
- .dark .hljs-selector-attr,
75
- .dark .hljs-selector-class,
76
- .dark .hljs-selector-id {
77
- /* prettylights-syntax-constant */
78
- color: #79c0ff
79
- }
80
- .dark .hljs-regexp,
81
- .dark .hljs-string,
82
- .dark .hljs-meta .hljs-string {
83
- /* prettylights-syntax-string */
84
- color: #a5d6ff
85
- }
86
- .dark .hljs-built_in,
87
- .dark .hljs-symbol {
88
- /* prettylights-syntax-variable */
89
- color: #ffa657
90
- }
91
- .dark .hljs-comment,
92
- .dark .hljs-code,
93
- .dark .hljs-formula {
94
- /* prettylights-syntax-comment */
95
- color: #8b949e
96
- }
97
- .dark .hljs-name,
98
- .dark .hljs-quote,
99
- .dark .hljs-selector-tag,
100
- .dark .hljs-selector-pseudo {
101
- /* prettylights-syntax-entity-tag */
102
- color: #7ee787
103
- }
104
- .dark .hljs-subst {
105
- /* prettylights-syntax-storage-modifier-import */
106
- color: #c9d1d9
107
- }
108
- .dark .hljs-section {
109
- /* prettylights-syntax-markup-heading */
110
- color: #1f6feb;
111
- font-weight: bold
112
- }
113
- .dark .hljs-bullet {
114
- /* prettylights-syntax-markup-list */
115
- color: #f2cc60
116
- }
117
- .dark .hljs-emphasis {
118
- /* prettylights-syntax-markup-italic */
119
- color: #c9d1d9;
120
- font-style: italic
121
- }
122
- .dark .hljs-strong {
123
- /* prettylights-syntax-markup-bold */
124
- color: #c9d1d9;
125
- font-weight: bold
126
- }
127
- .dark .hljs-addition {
128
- /* prettylights-syntax-markup-inserted */
129
- color: #aff5b4;
130
- background-color: #033a16
131
- }
132
- .dark .hljs-deletion {
133
- /* prettylights-syntax-markup-deleted */
134
- color: #ffdcd7;
135
- background-color: #67060c
136
- }
137
- .dark .hljs-char.escape_,
138
- .dark .hljs-link,
139
- .dark .hljs-params,
140
- .dark .hljs-property,
141
- .dark .hljs-punctuation,
142
- .dark .hljs-tag {
143
- /* purposely ignored */
144
-
145
- }
146
- `}</style>
28
+ <style>{styles}</style>
147
29
  <ReactMarkdown
148
30
  components={components}
149
31
  // Markdown to HTML.
150
32
  remarkPlugins={[[remarkFrontmatter, 'yaml'], remarkParseFrontmatter as any]}
151
33
  // HTML processing.
152
- rehypePlugins={[highlight, [addClasses, classes], slideLayout]}
34
+ rehypePlugins={[[rehypeAddClasses, classes], rehypeHighlight as any, slideLayout]}
153
35
  >
154
36
  {content}
155
37
  </ReactMarkdown>
@@ -164,7 +46,7 @@ export const Slide = ({ content = '', classes = theme.nodes }: SlideProps) => {
164
46
  * E.g., layout image from front-matter.
165
47
  */
166
48
  const slideLayout =
167
- (options = {}) =>
49
+ (_options = {}) =>
168
50
  (tree: any, file: any) => {
169
51
  const {
170
52
  data: { frontmatter = {} },
@@ -210,9 +92,11 @@ const slideLayout =
210
92
  tree.children = [root];
211
93
  };
212
94
 
213
- const ImageWrapper = ({ node, ...props }: { node: any }) => {
95
+ const ImageWrapper = ({ node: _, ...props }: { node: any }) => {
214
96
  const { alt = '', src } = props as { alt: string; src: string };
215
97
  return <img alt={alt} src={src} />;
216
98
  };
217
99
 
218
- const components = { img: ImageWrapper };
100
+ const components: ReactMarkdownOptions['components'] = {
101
+ img: ({ node, ...props }) => <ImageWrapper node={node} {...props} />,
102
+ };