@dxos/plugin-presenter 0.8.4-main.c1de068 → 0.8.4-main.e098934
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/{CollectionPresenterContainer-GH4GIA6P.mjs → CollectionPresenterContainer-U7D57ZVN.mjs} +6 -6
- package/dist/lib/browser/CollectionPresenterContainer-U7D57ZVN.mjs.map +7 -0
- package/dist/lib/browser/{DocumentPresenterContainer-E7RGK572.mjs → DocumentPresenterContainer-F42V4KAL.mjs} +48 -50
- package/dist/lib/browser/DocumentPresenterContainer-F42V4KAL.mjs.map +7 -0
- package/dist/lib/browser/{MarkdownSlide-QHC3GZII.mjs → MarkdownSlide-ZUPODCSC.mjs} +15 -128
- package/dist/lib/browser/MarkdownSlide-ZUPODCSC.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-2ZLAWPF2.mjs → app-graph-builder-5LNLRZBN.mjs} +33 -5
- package/dist/lib/browser/app-graph-builder-5LNLRZBN.mjs.map +7 -0
- package/dist/lib/browser/{chunk-YYPOO6XK.mjs → chunk-ENIFUI47.mjs} +12 -8
- package/dist/lib/browser/chunk-ENIFUI47.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TANLITL2.mjs → chunk-UVGTHJUO.mjs} +2 -2
- package/dist/lib/browser/{chunk-TANLITL2.mjs.map → chunk-UVGTHJUO.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-SW3HIRDA.mjs → chunk-W4IR3DJE.mjs} +3 -3
- package/dist/lib/browser/chunk-W4IR3DJE.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +6 -5
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-GQSVWJBG.mjs → react-surface-UAXR5ZP3.mjs} +8 -8
- package/dist/lib/browser/react-surface-UAXR5ZP3.mjs.map +7 -0
- package/dist/lib/browser/{settings-X7M27QCY.mjs → settings-VQVVDAGY.mjs} +2 -2
- package/dist/lib/browser/{settings-X7M27QCY.mjs.map → settings-VQVVDAGY.mjs.map} +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +3 -3
- package/dist/types/src/capabilities/index.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/capabilities/settings.d.ts +1 -1
- package/dist/types/src/components/CollectionPresenterContainer.d.ts.map +1 -1
- package/dist/types/src/components/DocumentPresenterContainer.d.ts +2 -2
- package/dist/types/src/components/DocumentPresenterContainer.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Container.stories.d.ts +14 -21
- package/dist/types/src/components/Markdown/Container.stories.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Slide.d.ts +1 -3
- package/dist/types/src/components/Markdown/Slide.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Slide.stories.d.ts +10 -11
- package/dist/types/src/components/Markdown/Slide.stories.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownSlide.d.ts +2 -2
- package/dist/types/src/components/MarkdownSlide.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Pager.d.ts +1 -1
- package/dist/types/src/components/Presenter/Pager.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Pager.stories.d.ts +12 -3
- package/dist/types/src/components/Presenter/Pager.stories.d.ts.map +1 -1
- package/dist/types/src/components/PresenterSettings.d.ts.map +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts.map +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts +17 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +18 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +3 -3
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +27 -26
- package/src/PresenterPlugin.tsx +1 -1
- package/src/capabilities/app-graph-builder.ts +38 -4
- package/src/capabilities/react-surface.tsx +20 -10
- package/src/capabilities/settings.ts +1 -1
- package/src/components/CollectionPresenterContainer.tsx +2 -1
- package/src/components/DocumentPresenterContainer.tsx +4 -3
- package/src/components/Markdown/Container.stories.tsx +20 -17
- package/src/components/Markdown/Slide.stories.tsx +9 -6
- package/src/components/Markdown/Slide.tsx +12 -128
- package/src/components/Markdown/styles.css +104 -0
- package/src/components/Markdown/typings.d.ts +8 -0
- package/src/components/MarkdownSlide.tsx +2 -2
- package/src/components/Presenter/Pager.stories.tsx +7 -5
- package/src/components/Presenter/Pager.tsx +3 -3
- package/src/components/PresenterSettings.tsx +13 -9
- package/src/components/RevealPlayer/RevealPlayer.stories.tsx +4 -3
- package/src/components/RevealPlayer/RevealPlayer.tsx +50 -53
- package/src/translations.ts +1 -0
- package/src/types.ts +2 -2
- package/src/useExitPresenter.ts +1 -1
- package/dist/lib/browser/CollectionPresenterContainer-GH4GIA6P.mjs.map +0 -7
- package/dist/lib/browser/DocumentPresenterContainer-E7RGK572.mjs.map +0 -7
- package/dist/lib/browser/MarkdownSlide-QHC3GZII.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-2ZLAWPF2.mjs.map +0 -7
- package/dist/lib/browser/chunk-SW3HIRDA.mjs.map +0 -7
- package/dist/lib/browser/chunk-YYPOO6XK.mjs.map +0 -7
- package/dist/lib/browser/react-surface-GQSVWJBG.mjs.map +0 -7
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { type FC } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Markdown } from '@dxos/plugin-markdown/types';
|
|
8
8
|
|
|
9
9
|
import { Container, Slide } from './Markdown';
|
|
10
10
|
|
|
11
|
-
const MarkdownSlide: FC<{ document:
|
|
11
|
+
const MarkdownSlide: FC<{ document: Markdown.Document }> = ({ document }) => {
|
|
12
12
|
const content = document.content.target?.content;
|
|
13
13
|
if (!content) {
|
|
14
14
|
return null;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React, { useState } from 'react';
|
|
9
9
|
|
|
10
10
|
import { withTheme } from '@dxos/storybook-utils';
|
|
@@ -24,15 +24,17 @@ const DefaultStory = ({ count = 20 }: PagerProps) => {
|
|
|
24
24
|
);
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const meta: Meta<PagerProps> = {
|
|
27
|
+
const meta = {
|
|
30
28
|
title: 'plugins/plugin-presenter/Pager',
|
|
31
29
|
render: DefaultStory,
|
|
32
30
|
decorators: [withTheme],
|
|
33
31
|
parameters: {
|
|
34
32
|
layout: 'centered',
|
|
35
33
|
},
|
|
36
|
-
}
|
|
34
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
37
35
|
|
|
38
36
|
export default meta;
|
|
37
|
+
|
|
38
|
+
type Story = StoryObj<typeof meta>;
|
|
39
|
+
|
|
40
|
+
export const Default: Story = {};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useEffect } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Button,
|
|
7
|
+
import { Button, Icon, useControlledState } from '@dxos/react-ui';
|
|
8
8
|
|
|
9
9
|
export type PagerProps = {
|
|
10
10
|
index?: number;
|
|
@@ -14,8 +14,8 @@ export type PagerProps = {
|
|
|
14
14
|
onExit?: () => void;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
export const Pager = ({ index:
|
|
18
|
-
const [index, setIndex] = useControlledState(
|
|
17
|
+
export const Pager = ({ index: indexParam = 0, count = 0, keys, onChange, onExit }: PagerProps) => {
|
|
18
|
+
const [index, setIndex] = useControlledState(indexParam);
|
|
19
19
|
useEffect(() => {
|
|
20
20
|
onChange?.(index);
|
|
21
21
|
}, [index]);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Input, useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import {
|
|
8
|
+
import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
9
9
|
|
|
10
10
|
import { PRESENTER_PLUGIN } from '../meta';
|
|
11
11
|
import { type PresenterSettingsProps } from '../types';
|
|
@@ -14,13 +14,17 @@ export const PresenterSettings = ({ settings }: { settings: PresenterSettingsPro
|
|
|
14
14
|
const { t } = useTranslation(PRESENTER_PLUGIN);
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
<ControlPage>
|
|
18
|
+
<ControlSection title={t('settings title', { ns: PRESENTER_PLUGIN })}>
|
|
19
|
+
<ControlGroup>
|
|
20
|
+
<ControlItemInput title={t('present collections label')}>
|
|
21
|
+
<Input.Switch
|
|
22
|
+
checked={settings.presentCollections}
|
|
23
|
+
onCheckedChange={(checked) => (settings.presentCollections = !!checked)}
|
|
24
|
+
/>
|
|
25
|
+
</ControlItemInput>
|
|
26
|
+
</ControlGroup>
|
|
27
|
+
</ControlSection>
|
|
28
|
+
</ControlPage>
|
|
25
29
|
);
|
|
26
30
|
};
|
|
@@ -6,10 +6,11 @@ import '@dxos-theme';
|
|
|
6
6
|
|
|
7
7
|
import { type Meta } from '@storybook/react-vite';
|
|
8
8
|
|
|
9
|
-
import { RevealPlayer } from './RevealPlayer';
|
|
10
9
|
import CONTENT from '../../../testing/deck.md?raw';
|
|
11
10
|
import { translations } from '../../translations';
|
|
12
11
|
|
|
12
|
+
import { RevealPlayer } from './RevealPlayer';
|
|
13
|
+
|
|
13
14
|
// https://revealjs.com/markdown
|
|
14
15
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/background-position
|
|
15
16
|
// https://colorhunt.co/palettes/dark
|
|
@@ -18,14 +19,14 @@ import { translations } from '../../translations';
|
|
|
18
19
|
// https://fontsource.org/fonts
|
|
19
20
|
// https://fonts.google.com
|
|
20
21
|
|
|
21
|
-
const meta
|
|
22
|
+
const meta = {
|
|
22
23
|
title: 'plugins/plugin-presenter/RevealPlayer',
|
|
23
24
|
component: RevealPlayer,
|
|
24
25
|
parameters: {
|
|
25
26
|
layout: 'fullscreen',
|
|
26
27
|
translations,
|
|
27
28
|
},
|
|
28
|
-
}
|
|
29
|
+
} satisfies Meta<typeof RevealPlayer>;
|
|
29
30
|
|
|
30
31
|
export default meta;
|
|
31
32
|
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
// eslint-disable-next-line no-restricted-imports
|
|
6
5
|
import 'reveal.js/dist/reveal.css';
|
|
7
|
-
|
|
6
|
+
|
|
8
7
|
import 'reveal.js/dist/theme/black.css';
|
|
9
8
|
|
|
10
9
|
// https://github.com/highlightjs/highlight.js/tree/main/src/styles
|
|
@@ -13,12 +12,12 @@ import 'highlight.js/styles/tokyo-night-dark.css';
|
|
|
13
12
|
|
|
14
13
|
import hljs from 'highlight.js';
|
|
15
14
|
import typescript from 'highlight.js/lib/languages/typescript';
|
|
16
|
-
import React, {
|
|
15
|
+
import React, { useRef } from 'react';
|
|
17
16
|
import Reveal from 'reveal.js';
|
|
18
17
|
import RevealHighlight from 'reveal.js/plugin/highlight/highlight';
|
|
19
18
|
import RevealMarkdown from 'reveal.js/plugin/markdown/plugin.js';
|
|
20
19
|
|
|
21
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
20
|
+
import { type ThemedClassName, useAsyncEffect } from '@dxos/react-ui';
|
|
22
21
|
import { mx } from '@dxos/react-ui-theme';
|
|
23
22
|
|
|
24
23
|
const styles = `
|
|
@@ -72,7 +71,8 @@ export type RevealProps = ThemedClassName<{
|
|
|
72
71
|
export const RevealPlayer = ({ classNames, content, slide, fullscreen = true, onExit }: RevealProps) => {
|
|
73
72
|
const deckDivRef = useRef<HTMLDivElement>(null);
|
|
74
73
|
const deckRef = useRef<Reveal.Api | null>(null);
|
|
75
|
-
|
|
74
|
+
|
|
75
|
+
useAsyncEffect(async () => {
|
|
76
76
|
if (deckRef.current) {
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
@@ -80,66 +80,63 @@ export const RevealPlayer = ({ classNames, content, slide, fullscreen = true, on
|
|
|
80
80
|
// Required for syntax highlighting.
|
|
81
81
|
hljs.registerLanguage('typescript', typescript);
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return hljs.highlightAuto(code).value;
|
|
120
|
-
},
|
|
83
|
+
// https://revealjs.com/react
|
|
84
|
+
// https://revealjs.com/config
|
|
85
|
+
// https://github.com/hakimel/reveal.js
|
|
86
|
+
// TODO(burdon): Fragments and scroll view steps 2 at a time (safe mode?)
|
|
87
|
+
deckRef.current = new Reveal(deckDivRef.current!, {
|
|
88
|
+
// view: 'scroll',
|
|
89
|
+
progress: false,
|
|
90
|
+
transition: 'none',
|
|
91
|
+
slideNumber: false,
|
|
92
|
+
embedded: true,
|
|
93
|
+
|
|
94
|
+
// TODO(burdon): Speaker view requires server to serve popout window.
|
|
95
|
+
// https://revealjs.com/speaker-view
|
|
96
|
+
showNotes: false,
|
|
97
|
+
|
|
98
|
+
// width: 1600,
|
|
99
|
+
// height: 900,
|
|
100
|
+
margin: 0.1,
|
|
101
|
+
// center: false,
|
|
102
|
+
// minScale: 0.1,
|
|
103
|
+
// maxScale: 1.4,
|
|
104
|
+
|
|
105
|
+
// https://revealjs.com/markdown
|
|
106
|
+
// TODO(burdon): Requires server to serve popout window.
|
|
107
|
+
plugins: [RevealMarkdown, RevealHighlight],
|
|
108
|
+
|
|
109
|
+
// See https://marked.js.org/using_advanced#options
|
|
110
|
+
markdown: {
|
|
111
|
+
gfm: true,
|
|
112
|
+
smartypants: true,
|
|
113
|
+
highlight: (code, language) => {
|
|
114
|
+
if (language) {
|
|
115
|
+
return hljs.highlight(code, { language }).value;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return hljs.highlightAuto(code).value;
|
|
121
119
|
},
|
|
122
|
-
}
|
|
120
|
+
},
|
|
121
|
+
});
|
|
123
122
|
|
|
124
|
-
|
|
123
|
+
await deckRef.current.initialize();
|
|
125
124
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
if (slide !== undefined) {
|
|
126
|
+
deckRef.current.slide(slide < 0 ? deckRef.current?.getTotalSlides() + slide : slide - 1);
|
|
127
|
+
}
|
|
129
128
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
});
|
|
129
|
+
deckRef.current.addKeyBinding({ keyCode: 27, key: 'Escape', description: 'Exit full screen' }, () => {
|
|
130
|
+
onExit?.();
|
|
133
131
|
});
|
|
134
132
|
|
|
135
133
|
return () => {
|
|
136
134
|
try {
|
|
137
|
-
clearTimeout(t);
|
|
138
135
|
if (deckRef.current) {
|
|
139
136
|
deckRef.current.destroy();
|
|
140
137
|
deckRef.current = null;
|
|
141
138
|
}
|
|
142
|
-
} catch
|
|
139
|
+
} catch {
|
|
143
140
|
// Ignore.
|
|
144
141
|
}
|
|
145
142
|
};
|
package/src/translations.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Schema } from 'effect';
|
|
6
6
|
import { type Context, createContext } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
9
9
|
import { DataType } from '@dxos/schema';
|
|
10
10
|
|
|
11
11
|
import { PRESENTER_PLUGIN } from './meta';
|
|
@@ -17,7 +17,7 @@ export namespace PresenterAction {
|
|
|
17
17
|
`${PRESENTER_ACTION}/toggle-presentation`,
|
|
18
18
|
{
|
|
19
19
|
input: Schema.Struct({
|
|
20
|
-
object: Schema.Union(
|
|
20
|
+
object: Schema.Union(Markdown.Document, DataType.Collection),
|
|
21
21
|
state: Schema.optional(Schema.Boolean),
|
|
22
22
|
}),
|
|
23
23
|
output: Schema.Void,
|
package/src/useExitPresenter.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent, useCapability, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { type Live } from '@dxos/live-object';
|
|
9
9
|
import { DeckCapabilities } from '@dxos/plugin-deck';
|
|
10
10
|
import { DeckAction } from '@dxos/plugin-deck/types';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/CollectionPresenterContainer.tsx", "../../../src/components/Presenter/Layout.tsx", "../../../src/components/Presenter/Pager.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC, useContext, useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { type DataType } from '@dxos/schema';\n\nimport { Layout, PageNumber, Pager } from './Presenter';\nimport { PresenterContext } from '../types';\nimport { useExitPresenter } from '../useExitPresenter';\n\nconst CollectionPresenterContainer: FC<{ collection: DataType.Collection }> = ({ collection }) => {\n const [slide, setSlide] = useState(0);\n\n const { running } = useContext(PresenterContext);\n\n const handleExit = useExitPresenter(collection);\n\n return (\n <StackItem.Content classNames='relative'>\n <Layout\n bottomRight={<PageNumber index={slide} count={collection.objects.length} />}\n bottomLeft={\n <Pager\n index={slide}\n count={collection.objects.length}\n keys={running}\n onChange={setSlide}\n onExit={handleExit}\n />\n }\n >\n {/* TODO(wittjosiah): Better slide placeholder. */}\n <Surface role='slide' data={{ subject: collection.objects[slide] }} placeholder={<></>} />\n </Layout>\n </StackItem.Content>\n );\n};\n\nexport default CollectionPresenterContainer;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type PropsWithChildren, type ReactNode } from 'react';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\n\nexport type LayoutProps = ThemedClassName<\n PropsWithChildren<{\n className?: string;\n topLeft?: ReactNode;\n topRight?: ReactNode;\n bottomLeft?: ReactNode;\n bottomRight?: ReactNode;\n }>\n>;\n\nexport const Layout = ({ children, classNames, topLeft, topRight, bottomLeft, bottomRight }: LayoutProps) => {\n return (\n <div className={mx('flex grow relative overflow-hidden bg-attention', classNames)}>\n <div className={mx('flex flex-col grow overflow-hidden')}>{children}</div>\n\n <div className='z-[200]'>\n <div className='absolute top-4 left-4'>{topLeft}</div>\n <div className='absolute top-4 right-4'>{topRight}</div>\n <div className='absolute bottom-4 left-4'>{bottomLeft}</div>\n <div className='absolute bottom-4 right-4'>{bottomRight}</div>\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useEffect } from 'react';\n\nimport { Button, useControlledState, Icon } from '@dxos/react-ui';\n\nexport type PagerProps = {\n index?: number;\n count?: number;\n keys?: boolean; // TODO(burdon): Rename.\n onChange?: (index: number) => void;\n onExit?: () => void;\n};\n\nexport const Pager = ({ index: controlledIndex = 0, count = 0, keys, onChange, onExit }: PagerProps) => {\n const [index, setIndex] = useControlledState(controlledIndex);\n useEffect(() => {\n onChange?.(index);\n }, [index]);\n\n const handleChangeIndex = (dir: number) => {\n setIndex((index) => {\n const next = index + dir;\n return next >= 0 && next < count ? next : index;\n });\n };\n\n // TODO(burdon): Standardize via system key binding.\n useEffect(() => {\n if (!keys) {\n return;\n }\n\n const keydownHandler = (event: KeyboardEvent) => {\n switch (event.key) {\n case 'Escape': {\n onExit?.();\n break;\n }\n case 'ArrowLeft': {\n if (event.shiftKey) {\n onChange?.(0);\n } else {\n handleChangeIndex(-1);\n }\n break;\n }\n case 'ArrowRight': {\n if (event.shiftKey) {\n onChange?.(count - 1);\n } else {\n handleChangeIndex(1);\n }\n break;\n }\n case 'ArrowUp': {\n onChange?.(0);\n break;\n }\n case 'ArrowDown': {\n onChange?.(count - 1);\n break;\n }\n }\n };\n\n window.addEventListener('keydown', keydownHandler);\n return () => window.removeEventListener('keydown', keydownHandler);\n }, [keys, count]);\n\n if (index === undefined || !count) {\n return null;\n }\n\n return (\n <div className='flex items-center text-neutral-500'>\n <Button variant='ghost' classNames='p-0' onClick={() => onChange?.(0)}>\n <Icon icon='ph--caret-double-left--regular' size={6} />\n </Button>\n <Button variant='ghost' classNames='p-0' onClick={() => handleChangeIndex(-1)}>\n <Icon icon='ph--caret-left--regular' size={6} />\n </Button>\n <Button variant='ghost' classNames='p-0' onClick={() => handleChangeIndex(1)}>\n <Icon icon='ph--caret-right--regular' size={6} />\n </Button>\n <Button variant='ghost' classNames='p-0' onClick={() => onChange?.(count - 1)}>\n <Icon icon='ph--caret-double-right--regular' size={6} />\n </Button>\n </div>\n );\n};\n\nexport type PageNumberProps = {\n index?: number;\n count?: number;\n};\n\nexport const PageNumber = ({ index = 0, count = 1 }: PageNumberProps) => {\n if (index === undefined || !count) {\n return null;\n }\n\n return (\n <div className='flex items-center text-neutral-500 text-2xl'>\n <div>\n {index + 1} / {count}\n </div>\n </div>\n );\n};\n\nexport const StartButton = ({ running, onClick }: { running?: boolean; onClick?: (start: boolean) => void }) => {\n return (\n <Button variant='ghost' classNames='p-0' onClick={() => onClick?.(!running)}>\n {(running && <Icon icon='ph--x--regular' size={6} />) || <Icon icon='ph--play--regular' size={6} />}\n </Button>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,OAAOA,UAAkBC,YAAYC,gBAAgB;AAErD,SAASC,eAAe;AACxB,SAASC,iBAAiB;;;;ACH1B,OAAOC,WAAuD;AAG9D,SAASC,UAAU;AAYZ,IAAMC,SAAS,CAAC,EAAEC,UAAUC,YAAYC,SAASC,UAAUC,YAAYC,YAAW,MAAe;;;AACtG,WACE,sBAAA,cAACC,OAAAA;MAAIC,WAAWC,GAAG,mDAAmDP,UAAAA;OACpE,sBAAA,cAACK,OAAAA;MAAIC,WAAWC,GAAG,oCAAA;OAAwCR,QAAAA,GAE3D,sBAAA,cAACM,OAAAA;MAAIC,WAAU;OACb,sBAAA,cAACD,OAAAA;MAAIC,WAAU;OAAyBL,OAAAA,GACxC,sBAAA,cAACI,OAAAA;MAAIC,WAAU;OAA0BJ,QAAAA,GACzC,sBAAA,cAACG,OAAAA;MAAIC,WAAU;OAA4BH,UAAAA,GAC3C,sBAAA,cAACE,OAAAA;MAAIC,WAAU;OAA6BF,WAAAA,CAAAA,CAAAA;;;;AAIpD;;;;AC5BA,OAAOI,UAASC,iBAAiB;AAEjC,SAASC,QAAQC,oBAAoBC,YAAY;AAU1C,IAAMC,QAAQ,CAAC,EAAEC,OAAOC,kBAAkB,GAAGC,QAAQ,GAAGC,MAAMC,UAAUC,OAAM,MAAc;;;AACjG,UAAM,CAACL,OAAOM,QAAAA,IAAYC,mBAAmBN,eAAAA;AAC7CO,cAAU,MAAA;AACRJ,iBAAWJ,KAAAA;IACb,G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OAAA,cAAAA,OAAA,UAAA,IAAA;;;;;AAIzF;AAEA,IAAA,uCAAeV;",
|
|
6
|
-
"names": ["React", "useContext", "useState", "Surface", "StackItem", "React", "mx", "Layout", "children", "classNames", "topLeft", "topRight", "bottomLeft", "bottomRight", "div", "className", "mx", "React", "useEffect", "Button", "useControlledState", "Icon", "Pager", "index", "controlledIndex", "count", "keys", "onChange", "onExit", "setIndex", "useControlledState", "useEffect", "handleChangeIndex", "dir", "next", "keydownHandler", "event", "key", "shiftKey", "window", "addEventListener", "removeEventListener", "undefined", "React", "div", "className", "Button", "variant", "classNames", "onClick", "Icon", "icon", "size", "PageNumber", "CollectionPresenterContainer", "collection", "slide", "setSlide", "useState", "running", "useContext", "PresenterContext", "handleExit", "useExitPresenter", "React", "StackItem", "Content", "classNames", "Layout", "bottomRight", "PageNumber", "index", "count", "objects", "length", "bottomLeft", "Pager", "keys", "onChange", "onExit", "Surface", "role", "data", "subject", "placeholder"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/DocumentPresenterContainer.tsx", "../../../src/components/RevealPlayer/RevealPlayer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\nimport React, { type FC } from 'react';\n\nimport { type DocumentType } from '@dxos/plugin-markdown/types';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { RevealPlayer } from './RevealPlayer';\nimport { useExitPresenter } from '../useExitPresenter';\n\nconst DocumentPresenterContainer: FC<{ document: DocumentType }> = ({ document }) => {\n const handleExit = useExitPresenter(document);\n\n return (\n <StackItem.Content classNames='relative'>\n <RevealPlayer content={document.content.target?.content ?? ''} onExit={handleExit} />\n </StackItem.Content>\n );\n};\n\nexport default DocumentPresenterContainer;\n", "//\n// Copyright 2024 DXOS.org\n//\n\n// eslint-disable-next-line no-restricted-imports\nimport 'reveal.js/dist/reveal.css';\n// eslint-disable-next-line no-restricted-imports\nimport 'reveal.js/dist/theme/black.css';\n\n// https://github.com/highlightjs/highlight.js/tree/main/src/styles\n// import 'highlight.js/styles/github-dark.css';\nimport 'highlight.js/styles/tokyo-night-dark.css';\n\nimport hljs from 'highlight.js';\nimport typescript from 'highlight.js/lib/languages/typescript';\nimport React, { useEffect, useRef } from 'react';\nimport Reveal from 'reveal.js';\nimport RevealHighlight from 'reveal.js/plugin/highlight/highlight';\nimport RevealMarkdown from 'reveal.js/plugin/markdown/plugin.js';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\n\nconst styles = `\n<style type=\"text/css\">\n .reveal h1 {\n font-weight: 100;\n font-size: 60px;\n opacity: 0.5;\n }\n .reveal h2 {\n font-weight: 100;\n padding-top: 60px;\n padding-left: 40px;\n font-size: 48px;\n opacity: 0.3;\n }\n .reveal h1, h2, p {\n font-family: \"Raleway\", sans-serif;\n text-align: left;\n font-weight: 200;\n }\n .reveal ul {\n font-family: \"Raleway\", sans-serif;\n display: block;\n list-style: \"- \";\n }\n .reveal blockquote p {\n text-align: center;\n font-weight: 100;\n padding: 32px;\n }\n .reveal pre {\n margin-left: 0;\n }\n .reveal code {\n font-size: 20px;\n background: #111111;\n color: #eeeeee;\n max-height: unset !important;\n }\n</style>\n`;\n\nexport type RevealProps = ThemedClassName<{\n content: string;\n slide?: number;\n fullscreen?: boolean;\n onExit?: () => void;\n}>;\n\nexport const RevealPlayer = ({ classNames, content, slide, fullscreen = true, onExit }: RevealProps) => {\n const deckDivRef = useRef<HTMLDivElement>(null);\n const deckRef = useRef<Reveal.Api | null>(null);\n useEffect(() => {\n if (deckRef.current) {\n return;\n }\n\n // Required for syntax highlighting.\n hljs.registerLanguage('typescript', typescript);\n\n const t = setTimeout(async () => {\n // https://revealjs.com/react\n // https://revealjs.com/config\n // https://github.com/hakimel/reveal.js\n // TODO(burdon): Fragments and scroll view steps 2 at a time (safe mode?)\n deckRef.current = new Reveal(deckDivRef.current!, {\n // view: 'scroll',\n progress: false,\n transition: 'none',\n slideNumber: false,\n embedded: true,\n\n // TODO(burdon): Speaker view requires server to serve popout window.\n // https://revealjs.com/speaker-view\n showNotes: false,\n\n // width: 1600,\n // height: 900,\n margin: 0.1,\n // center: false,\n // minScale: 0.1,\n // maxScale: 1.4,\n\n // https://revealjs.com/markdown\n // TODO(burdon): Requires server to serve popout window.\n plugins: [RevealMarkdown, RevealHighlight],\n\n // See https://marked.js.org/using_advanced#options\n markdown: {\n gfm: true,\n smartypants: true,\n highlight: (code, language) => {\n if (language) {\n return hljs.highlight(code, { language }).value;\n }\n\n return hljs.highlightAuto(code).value;\n },\n },\n });\n\n await deckRef.current.initialize();\n\n if (slide !== undefined) {\n deckRef.current.slide(slide < 0 ? deckRef.current?.getTotalSlides() + slide : slide - 1);\n }\n\n deckRef.current.addKeyBinding({ keyCode: 27, key: 'Escape', description: 'Exit full screen' }, () => {\n onExit?.();\n });\n });\n\n return () => {\n try {\n clearTimeout(t);\n if (deckRef.current) {\n deckRef.current.destroy();\n deckRef.current = null;\n }\n } catch (err) {\n // Ignore.\n }\n };\n });\n\n return (\n <div className={mx('absolute flex h-full w-full items-center justify-center', fullscreen && 'inset-0', classNames)}>\n <div className='relative aspect-video w-full'>\n <div ref={deckDivRef} className='reveal'>\n {/* TODO(burdon): Must be in head. */}\n <style>\n <link rel='preconnect' href='https://fonts.googleapis.com' />\n <link rel='preconnect' href='https://fonts.gstatic.com' {...{ crossOrigin: '' }} />\n <link\n rel='stylesheet'\n href='https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap'\n />\n </style>\n <div className='slides'>\n <div className='!text-center' />\n <section {...{ 'data-markdown': [] }}>\n <textarea {...{ 'data-template': true }} defaultValue={[styles, content].join('\\n')}></textarea>\n </section>\n </div>\n </div>\n </div>\n </div>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;AAGA,OAAOA,YAAwB;AAG/B,SAASC,iBAAiB;;;;ACD1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A;AAEA,aAAO,MAAA;AACL,YAAI;AACFoC,uBAAa3B,CAAAA;AACb,cAAIN,QAAQE,SAAS;AACnBF,oBAAQE,QAAQgC,QAAO;AACvBlC,oBAAQE,UAAU;UACpB;QACF,SAASiC,KAAK;QAEd;MACF;IACF,CAAA;AAEA,WACE,sBAAA,cAACC,OAAAA;MAAIC,WAAWC,GAAG,2DAA2D1C,cAAc,WAAWH,UAAAA;OACrG,sBAAA,cAAC2C,OAAAA;MAAIC,WAAU;OACb,sBAAA,cAACD,OAAAA;MAAIG,KAAKzC;MAAYuC,WAAU;OAE9B,sBAAA,cAACG,SAAAA,MACC,sBAAA,cAACC,QAAAA;MAAKC,KAAI;MAAaC,MAAK;QAC5B,sBAAA,cAACF,QAAAA;MAAKC,KAAI;MAAaC,MAAK;MAAkCC,aAAa;QAC3E,sBAAA,cAACH,QAAAA;MACCC,KAAI;MACJC,MAAK;SAGT,sBAAA,cAACP,OAAAA;MAAIC,WAAU;OACb,sBAAA,cAACD,OAAAA;MAAIC,WAAU;QACf,sBAAA,cAACQ,WAAY;MAAE,iBAAiB,CAAA;IAAG,GACjC,sBAAA,cAACC,YAAAA;MAAe,iBAAiB;MAAQC,cAAc;QAACxD;QAAQG;QAASsD,KAAK,IAAA;;;;;AAO5F;;;AD/JA,IAAMC,6BAA6D,CAAC,EAAEC,SAAQ,MAAE;;;AAC9E,UAAMC,aAAaC,iBAAiBF,QAAAA;AAEpC,WACE,gBAAAG,OAAA,cAACC,UAAUC,SAAO;MAACC,YAAW;OAC5B,gBAAAH,OAAA,cAACI,cAAAA;MAAaC,SAASR,SAASQ,QAAQC,QAAQD,WAAW;MAAIE,QAAQT;;;;;AAG7E;AAEA,IAAA,qCAAeF;",
|
|
6
|
-
"names": ["React", "StackItem", "hljs", "typescript", "React", "useEffect", "useRef", "Reveal", "RevealHighlight", "RevealMarkdown", "mx", "styles", "RevealPlayer", "classNames", "content", "slide", "fullscreen", "onExit", "deckDivRef", "useRef", "deckRef", "useEffect", "current", "hljs", "registerLanguage", "typescript", "t", "setTimeout", "Reveal", "progress", "transition", "slideNumber", "embedded", "showNotes", "margin", "plugins", "RevealMarkdown", "RevealHighlight", "markdown", "gfm", "smartypants", "highlight", "code", "language", "value", "highlightAuto", "initialize", "undefined", "getTotalSlides", "addKeyBinding", "keyCode", "key", "description", "clearTimeout", "destroy", "err", "div", "className", "mx", "ref", "style", "link", "rel", "href", "crossOrigin", "section", "textarea", "defaultValue", "join", "DocumentPresenterContainer", "document", "handleExit", "useExitPresenter", "React", "StackItem", "Content", "classNames", "RevealPlayer", "content", "target", "onExit"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/MarkdownSlide.tsx", "../../../src/components/Markdown/Container.tsx", "../../../src/components/Markdown/Slide.tsx", "../../../src/components/Markdown/theme.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC } from 'react';\n\nimport { type DocumentType } from '@dxos/plugin-markdown/types';\n\nimport { Container, Slide } from './Markdown';\n\nconst MarkdownSlide: FC<{ document: DocumentType }> = ({ document }) => {\n const content = document.content.target?.content;\n if (!content) {\n return null;\n }\n\n return (\n <Container>\n <Slide content={content} />\n </Container>\n );\n};\n\nexport default MarkdownSlide;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type PropsWithChildren, useState } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\n\nexport type ContainerProps = ThemedClassName<PropsWithChildren<{}>>;\n\n/**\n * Scaled markdown container.\n */\nexport const Container = ({ children, classNames }: ContainerProps) => {\n const [props, setProps] = useState({});\n const {\n ref: containerRef,\n width,\n height,\n } = useResizeDetector({\n refreshMode: 'debounce',\n refreshRate: 200,\n refreshOptions: {\n leading: true,\n },\n onResize: ({ width, height }) => {\n if (width && height) {\n setProps(createLayoutProps({ width, height }));\n }\n },\n });\n\n // TODO(burdon): Reconcile highlight colors with markdown editor.\n // https://www.npmjs.com/package/react-markdown\n return (\n <div ref={containerRef} className={mx('flex grow relative overflow-hidden bg-attention', classNames)}>\n <div className={mx('flex w-full h-full overflow-hidden absolute')} style={props}>\n {width && height && children}\n </div>\n </div>\n );\n};\n\n/**\n * Compute CSS properties to transform DIV to be full screen.\n *\n * Display resolutions:\n * window.screen.{availWidth, availHeight}\n * 5K Studio 16.2-inch Macbook Pro\n * Max 5120 x 2880 3456 x 2234\n * Default 2560 x 1440 1728 x 1117 (Actual height 1080 - 37 pixel notch)\n * Aspect 1.77 (16/9) 1.54\n */\nconst createLayoutProps = ({ width, height }: { width: number; height: number }) => {\n // Config.\n const aspectRatio = 16 / 9;\n const nominalWidth = 2560;\n const nominalHeight = nominalWidth / aspectRatio;\n\n // NOTE: Hack to detect full height on Macbook Pro due to notch.\n // const macIntelNotch = 1117 - 1080;\n // const fullscreen =\n // height === screen.availHeight ||\n // (window.navigator.platform === 'MacIntel' && height === screen.availHeight - macIntelNotch);\n\n // If not fullscreen then make scale slightly smaller so there's a natural border.\n // const scaleFactor = fullscreen ? 1 : 0.95;\n\n // Compute scaling factor required.\n const scale = Math.min(width / nominalWidth, height / nominalHeight);\n\n return {\n left: (width - nominalWidth) / 2,\n top: (height - nominalHeight) / 2,\n width: nominalWidth,\n height: nominalHeight,\n transform: `scale(${scale})`,\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { h } from 'hastscript';\nimport React from 'react';\nimport ReactMarkdown from 'react-markdown';\nimport addClasses from 'rehype-add-classes';\nimport highlight from 'rehype-highlight';\nimport remarkFrontmatter from 'remark-frontmatter';\nimport remarkParseFrontmatter from 'remark-parse-frontmatter';\n\nimport 'highlight.js/styles/github.css';\n\nimport { theme } from './theme';\n\nexport type SlideProps = {\n content?: string;\n classes?: { [selector: string]: string };\n};\n\nexport const Slide = ({ content = '', classes = theme.nodes }: SlideProps) => {\n // TODO(thure): `rehype-highlight` ends up using `github.css` from `highlight.js`, but this does not appear to be\n // configurable. Find a way to remove the literal stylesheet here.\n return (\n <>\n <style>{`\n.dark pre code.hljs {\n display: block;\n overflow-x: auto;\n padding: 1em\n}\n.dark code.hljs {\n padding: 3px 5px\n}\n/*!\n Theme: GitHub Dark\n Description: Dark theme as seen on github.com\n Author: github.com\n Maintainer: @Hirse\n Updated: 2021-05-15\n\n Outdated base version: https://github.com/primer/github-syntax-dark\n Current colors taken from GitHub's CSS\n*/\n.dark .hljs {\n color: #c9d1d9;\n background: #0d1117\n}\n.dark .hljs-doctag,\n.dark .hljs-keyword,\n.dark .hljs-meta .hljs-keyword,\n.dark .hljs-template-tag,\n.dark .hljs-template-variable,\n.dark .hljs-type,\n.dark .hljs-variable.language_ {\n /* prettylights-syntax-keyword */\n color: #ff7b72\n}\n.dark .hljs-title,\n.dark .hljs-title.class_,\n.dark .hljs-title.class_.inherited__,\n.dark .hljs-title.function_ {\n /* prettylights-syntax-entity */\n color: #d2a8ff\n}\n.dark .hljs-attr,\n.dark .hljs-attribute,\n.dark .hljs-literal,\n.dark .hljs-meta,\n.dark .hljs-number,\n.dark .hljs-operator,\n.dark .hljs-variable,\n.dark .hljs-selector-attr,\n.dark .hljs-selector-class,\n.dark .hljs-selector-id {\n /* prettylights-syntax-constant */\n color: #79c0ff\n}\n.dark .hljs-regexp,\n.dark .hljs-string,\n.dark .hljs-meta .hljs-string {\n /* prettylights-syntax-string */\n color: #a5d6ff\n}\n.dark .hljs-built_in,\n.dark .hljs-symbol {\n /* prettylights-syntax-variable */\n color: #ffa657\n}\n.dark .hljs-comment,\n.dark .hljs-code,\n.dark .hljs-formula {\n /* prettylights-syntax-comment */\n color: #8b949e\n}\n.dark .hljs-name,\n.dark .hljs-quote,\n.dark .hljs-selector-tag,\n.dark .hljs-selector-pseudo {\n /* prettylights-syntax-entity-tag */\n color: #7ee787\n}\n.dark .hljs-subst {\n /* prettylights-syntax-storage-modifier-import */\n color: #c9d1d9\n}\n.dark .hljs-section {\n /* prettylights-syntax-markup-heading */\n color: #1f6feb;\n font-weight: bold\n}\n.dark .hljs-bullet {\n /* prettylights-syntax-markup-list */\n color: #f2cc60\n}\n.dark .hljs-emphasis {\n /* prettylights-syntax-markup-italic */\n color: #c9d1d9;\n font-style: italic\n}\n.dark .hljs-strong {\n /* prettylights-syntax-markup-bold */\n color: #c9d1d9;\n font-weight: bold\n}\n.dark .hljs-addition {\n /* prettylights-syntax-markup-inserted */\n color: #aff5b4;\n background-color: #033a16\n}\n.dark .hljs-deletion {\n /* prettylights-syntax-markup-deleted */\n color: #ffdcd7;\n background-color: #67060c\n}\n.dark .hljs-char.escape_,\n.dark .hljs-link,\n.dark .hljs-params,\n.dark .hljs-property,\n.dark .hljs-punctuation,\n.dark .hljs-tag {\n /* purposely ignored */\n \n}\n `}</style>\n <ReactMarkdown\n components={components}\n // Markdown to HTML.\n remarkPlugins={[[remarkFrontmatter, 'yaml'], remarkParseFrontmatter as any]}\n // HTML processing.\n rehypePlugins={[highlight, [addClasses, classes], slideLayout]}\n >\n {content}\n </ReactMarkdown>\n </>\n );\n};\n\n/**\n * Rehype plugin to format DOM based on frontmatter.\n * https://github.com/unifiedjs/unified#plugin\n * TODO(burdon): See tools/presenter: remarkPluginLayout\n * E.g., layout image from front-matter.\n */\nconst slideLayout =\n (options = {}) =>\n (tree: any, file: any) => {\n const {\n data: { frontmatter = {} },\n } = file;\n\n let content = tree.children;\n const { layout, image } = frontmatter;\n if (image) {\n const img = h('div', {\n class: 'flex grow shrink-0 bg-cover bg-center bg-no-repeat',\n style: {\n backgroundImage: `url(${image})`,\n },\n });\n\n switch (layout) {\n case 'fullscreen': {\n content = img;\n break;\n }\n\n case 'columns': {\n content = h('div', { class: 'flex grow grid grid-cols-2' }, [\n h('div', { class: theme.padding }, [content]),\n img,\n ]);\n break;\n }\n\n case 'rows': {\n content = h('div', { class: 'flex grow flex-col' }, [\n h('div', { class: theme.padding }, [content]),\n h('div', { class: ['flex grow pt-0', theme.padding] }, [img]),\n ]);\n break;\n }\n }\n } else {\n content = h('div', { class: ['flex grow flex-col', theme.padding] }, [content]);\n }\n\n const root = h('div', { class: ['flex flex-col grow', theme.root] }, [content]);\n tree.children = [root];\n };\n\nconst ImageWrapper = ({ node, ...props }: { node: any }) => {\n const { alt = '', src } = props as { alt: string; src: string };\n return <img alt={alt} src={src} />;\n};\n\nconst components = { img: ImageWrapper };\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// TODO(burdon): Create theme type and picker.\n\nexport const theme = {\n root: 'bg-attention leading-relaxed font-mono',\n\n padding: 'px-40 py-16 gap-8',\n\n nodes: {\n h1: 'text-[80px] text-accentText',\n h2: 'text-[60px] text-accentText',\n h3: 'text-[48px] text-accentText',\n\n p: 'text-[48px]',\n\n ul: 'my-[16px] ml-12 leading-relaxed list-disc',\n ol: 'my-[16px] ml-24 leading-relaxed list-decimal',\n li: 'pl-6 text-[48px]',\n\n pre: 'w-full mx-0 my-[32px] p-0 __border-l-[16px] bg-inputSurface p-4 __whitespace-pre-line',\n code: 'p-0 text-[40px]',\n },\n};\n"],
|
|
5
|
-
"mappings": ";;AAIA,OAAOA,YAAwB;;;;ACA/B,OAAOC,SAAiCC,gBAAgB;AACxD,SAASC,yBAAyB;AAGlC,SAASC,UAAU;AAOZ,IAAMC,YAAY,CAAC,EAAEC,UAAUC,WAAU,MAAkB;;;AAChE,UAAM,CAACC,OAAOC,QAAAA,IAAYC,SAAS,CAAC,CAAA;AACpC,UAAM,EACJC,KAAKC,cACLC,OACAC,OAAM,IACJC,kBAAkB;MACpBC,aAAa;MACbC,aAAa;MACbC,gBAAgB;QACdC,SAAS;MACX;MACAC,UAAU,CAAC,EAAEP,OAAAA,QAAOC,QAAAA,QAAM,MAAE;AAC1B,YAAID,UAASC,SAAQ;AACnBL,mBAASY,kBAAkB;YAAER,OAAAA;YAAOC,QAAAA;UAAO,CAAA,CAAA;QAC7C;MACF;IACF,CAAA;AAI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AAA,MAAsB;;;AACrD,UAAM,EAAEC,MAAM,IAAIC,IAAG,IAAKF;AAC1B,WAAO,gBAAA3B,OAAA,cAACmB,OAAAA;MAAIS;MAAUC;;;;;AACxB;AAEA,IAAM1B,aAAa;EAAEgB,KAAKM;AAAa;;;AF/MvC,IAAMK,gBAAgD,CAAC,EAAEC,SAAQ,MAAE;;;AACjE,UAAMC,UAAUD,SAASC,QAAQC,QAAQD;AACzC,QAAI,CAACA,SAAS;AACZ,aAAO;IACT;AAEA,WACE,gBAAAE,OAAA,cAACC,WAAAA,MACC,gBAAAD,OAAA,cAACE,OAAAA;MAAMJ;;;;;AAGb;AAEA,IAAA,wBAAeF;",
|
|
6
|
-
"names": ["React", "React", "useState", "useResizeDetector", "mx", "Container", "children", "classNames", "props", "setProps", "useState", "ref", "containerRef", "width", "height", "useResizeDetector", "refreshMode", "refreshRate", "refreshOptions", "leading", "onResize", "createLayoutProps", "div", "className", "mx", "style", "aspectRatio", "nominalWidth", "nominalHeight", "scale", "Math", "min", "left", "top", "transform", "h", "React", "ReactMarkdown", "addClasses", "highlight", "remarkFrontmatter", "remarkParseFrontmatter", "theme", "root", "padding", "nodes", "h1", "h2", "h3", "p", "ul", "ol", "li", "pre", "code", "Slide", "content", "classes", "theme", "nodes", "React", "style", "ReactMarkdown", "components", "remarkPlugins", "remarkFrontmatter", "remarkParseFrontmatter", "rehypePlugins", "highlight", "addClasses", "slideLayout", "options", "tree", "file", "data", "frontmatter", "children", "layout", "image", "img", "h", "class", "backgroundImage", "padding", "root", "ImageWrapper", "node", "props", "alt", "src", "MarkdownSlide", "document", "content", "target", "React", "Container", "Slide"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { contributes, type PluginContext, Capabilities, createIntent, LayoutAction } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\nimport { DeckCapabilities } from '@dxos/plugin-deck';\nimport { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';\nimport { createExtension, rxFromSignal } from '@dxos/plugin-graph';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { fullyQualifiedId, getSpace } from '@dxos/react-client/echo';\nimport { DataType } from '@dxos/schema';\n\nimport { PRESENTER_PLUGIN } from '../meta';\nimport { PresenterAction, type PresenterSettingsProps } from '../types';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: PRESENTER_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => {\n const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));\n const settings = get(\n rxFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(PRESENTER_PLUGIN)?.value),\n );\n const isPresentable = settings?.presentCollections\n ? Obj.instanceOf(DataType.Collection, node.data) || Obj.instanceOf(DocumentType, node.data)\n : Obj.instanceOf(DocumentType, node.data);\n return isPresentable ? Option.some(node.data) : Option.none();\n }),\n Option.map((object) => {\n const id = fullyQualifiedId(object);\n const spaceId = getSpace(object)?.id;\n return [\n {\n id: `${PresenterAction.TogglePresentation._tag}/${id}`,\n // TODO(burdon): Allow function so can generate state when activated.\n // So can set explicit fullscreen state coordinated with current presenter state.\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const layout = context.getCapability(DeckCapabilities.MutableDeckState);\n const presenterId = [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR);\n if (!layout.deck.fullscreen) {\n void dispatch(\n createIntent(DeckAction.Adjust, {\n type: 'solo--fullscreen',\n id: presenterId,\n }),\n );\n }\n await dispatch(\n createIntent(LayoutAction.Open, {\n part: 'main',\n subject: [presenterId],\n options: { workspace: spaceId },\n }),\n );\n },\n properties: {\n label: ['toggle presentation label', { ns: PRESENTER_PLUGIN }],\n icon: 'ph--presentation--regular',\n keyBinding: {\n macos: 'shift+meta+p',\n windows: 'shift+alt+p',\n },\n },\n },\n ];\n }),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,SAASA,UAAU;AACnB,SAASC,QAAQC,YAAY;AAE7B,SAASC,aAAiCC,cAAcC,cAAcC,oBAAoB;AAC1F,SAASC,WAAW;AACpB,SAASC,wBAAwB;AACjC,SAASC,2BAA2BC,kBAAkB;AACtD,SAASC,iBAAiBC,oBAAoB;AAC9C,SAASC,oBAAoB;AAC7B,SAASC,kBAAkBC,gBAAgB;AAC3C,SAASC,gBAAgB;AAKzB,IAAA,4BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;EACdC,IAAIC;EACJC,SAAS,CAACC,SACRC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAAA;AACd,UAAM,CAACO,aAAAA,IAAiBJ,IAAIX,QAAQgB,aAAad,aAAae,aAAa,CAAA;AAC3E,UAAMC,WAAWP,IACfQ,aAAa,MAAMJ,eAAeK,SAAiCd,gBAAAA,GAAmBe,KAAAA,CAAAA;AAExF,UAAMC,gBAAgBJ,UAAUK,qBAC5BC,IAAIC,WAAWC,SAASC,YAAYnB,MAAKoB,IAAI,KAAKJ,IAAIC,WAAWI,cAAcrB,MAAKoB,IAAI,IACxFJ,IAAIC,WAAWI,cAAcrB,MAAKoB,IAAI;AAC1C,WAAON,gBAAgBT,OAAOiB,KAAKtB,MAAKoB,IAAI,IAAIf,OAAOkB,KAAI;EAC7D,CAAA,GACAlB,OAAOmB,IAAI,CAACC,WAAAA;AACV,UAAM5B,KAAK6B,iBAAiBD,MAAAA;AAC5B,UAAME,UAAUC,SAASH,MAAAA,GAAS5B;AAClC,WAAO;MACL;QACEA,IAAI,GAAGgC,gBAAgBC,mBAAmBC,IAAI,IAAIlC,EAAAA;;;QAGlDuB,MAAM,YAAA;AACJ,gBAAM,EAAEY,iBAAiBC,SAAQ,IAAKzC,QAAQ0C,cAAcxC,aAAayC,gBAAgB;AACzF,gBAAMC,SAAS5C,QAAQ0C,cAAcG,iBAAiBC,gBAAgB;AACtE,gBAAMC,cAAc;YAAC1C;YAAI;YAAa2C,KAAKC,yBAAAA;AAC3C,cAAI,CAACL,OAAOM,KAAKC,YAAY;AAC3B,iBAAKV,SACHW,aAAaC,WAAWC,QAAQ;cAC9BC,MAAM;cACNlD,IAAI0C;YACN,CAAA,CAAA;UAEJ;AACA,gBAAMN,SACJW,aAAaI,aAAaC,MAAM;YAC9BC,MAAM;YACNC,SAAS;cAACZ;;YACVa,SAAS;cAAEC,WAAW1B;YAAQ;UAChC,CAAA,CAAA;QAEJ;QACA2B,YAAY;UACVC,OAAO;YAAC;YAA6B;cAAEC,IAAI1D;YAAiB;;UAC5D2D,MAAM;UACNC,YAAY;YACVC,OAAO;YACPC,SAAS;UACX;QACF;MACF;;EAEJ,CAAA,GACAvD,OAAOwD,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;AAGjC,CAAA,CAAA;",
|
|
6
|
-
"names": ["Rx", "Option", "pipe", "contributes", "Capabilities", "createIntent", "LayoutAction", "Obj", "DeckCapabilities", "ATTENDABLE_PATH_SEPARATOR", "DeckAction", "createExtension", "rxFromSignal", "DocumentType", "fullyQualifiedId", "getSpace", "DataType", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "PRESENTER_PLUGIN", "actions", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "settingsStore", "capabilities", "SettingsStore", "settings", "rxFromSignal", "getStore", "value", "isPresentable", "presentCollections", "Obj", "instanceOf", "DataType", "Collection", "data", "DocumentType", "some", "none", "map", "object", "fullyQualifiedId", "spaceId", "getSpace", "PresenterAction", "TogglePresentation", "_tag", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "layout", "DeckCapabilities", "MutableDeckState", "presenterId", "join", "ATTENDABLE_PATH_SEPARATOR", "deck", "fullscreen", "createIntent", "DeckAction", "Adjust", "type", "LayoutAction", "Open", "part", "subject", "options", "workspace", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "getOrElse"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\nimport { type Context, createContext } from 'react';\n\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { DataType } from '@dxos/schema';\n\nimport { PRESENTER_PLUGIN } from './meta';\n\nexport namespace PresenterAction {\n const PRESENTER_ACTION = `${PRESENTER_PLUGIN}/action`;\n\n export class TogglePresentation extends Schema.TaggedClass<TogglePresentation>()(\n `${PRESENTER_ACTION}/toggle-presentation`,\n {\n input: Schema.Struct({\n object: Schema.Union(DocumentType, DataType.Collection),\n state: Schema.optional(Schema.Boolean),\n }),\n output: Schema.Void,\n },\n ) {}\n}\n\nexport type PresenterContextType = {\n running: boolean;\n start: () => void;\n stop: () => void;\n};\n\nexport const PresenterContext: Context<PresenterContextType> = createContext<PresenterContextType>({\n running: false,\n start: () => {},\n stop: () => {},\n});\n\nexport const PresenterSettingsSchema = Schema.mutable(\n Schema.Struct({\n presentCollections: Schema.optional(Schema.Boolean),\n }),\n);\n\nexport type PresenterSettingsProps = Schema.Schema.Type<typeof PresenterSettingsSchema>;\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SAASA,cAAc;AACvB,SAAuBC,qBAAqB;AAE5C,SAASC,oBAAoB;AAC7B,SAASC,gBAAgB;UAIRC,kBAAAA;AACf,QAAMC,mBAAmB,GAAGC,gBAAAA;EAErB,MAAMC,2BAA2BC,OAAOC,YAAW,EACxD,GAAGJ,gBAAAA,wBACH;IACEK,OAAOF,OAAOG,OAAO;MACnBC,QAAQJ,OAAOK,MAAMC,cAAcC,SAASC,UAAU;MACtDC,OAAOT,OAAOU,SAASV,OAAOW,OAAO;IACvC,CAAA;IACAC,QAAQZ,OAAOa;EACjB,CAAA,EAAA;EACC;mBATUd,qBAAAA;AAUf,GAbiBH,oBAAAA,kBAAAA,CAAAA,EAAAA;AAqBV,IAAMkB,mBAAkDC,cAAoC;EACjGC,SAAS;EACTC,OAAO,MAAA;EAAO;EACdC,MAAM,MAAA;EAAO;AACf,CAAA;AAEO,IAAMC,0BAA0BnB,OAAOoB,QAC5CpB,OAAOG,OAAO;EACZkB,oBAAoBrB,OAAOU,SAASV,OAAOW,OAAO;AACpD,CAAA,CAAA;;",
|
|
6
|
-
"names": ["Schema", "createContext", "DocumentType", "DataType", "PresenterAction", "PRESENTER_ACTION", "PRESENTER_PLUGIN", "TogglePresentation", "Schema", "TaggedClass", "input", "Struct", "object", "Union", "DocumentType", "DataType", "Collection", "state", "optional", "Boolean", "output", "Void", "PresenterContext", "createContext", "running", "start", "stop", "PresenterSettingsSchema", "mutable", "presentCollections"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/PresenterSettings.tsx", "../../../src/components/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Input, useTranslation } from '@dxos/react-ui';\nimport { DeprecatedFormContainer, DeprecatedFormInput } from '@dxos/react-ui-form';\n\nimport { PRESENTER_PLUGIN } from '../meta';\nimport { type PresenterSettingsProps } from '../types';\n\nexport const PresenterSettings = ({ settings }: { settings: PresenterSettingsProps }) => {\n const { t } = useTranslation(PRESENTER_PLUGIN);\n\n return (\n <DeprecatedFormContainer>\n <DeprecatedFormInput label={t('present collections label')}>\n <Input.Switch\n checked={settings.presentCollections}\n onCheckedChange={(checked) => (settings.presentCollections = !!checked)}\n />\n </DeprecatedFormInput>\n </DeprecatedFormContainer>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport * from './PresenterSettings';\n\nexport const MarkdownSlide = lazy(() => import('./MarkdownSlide'));\nexport const DocumentPresenterContainer = lazy(() => import('./DocumentPresenterContainer'));\nexport const CollectionPresenterContainer = lazy(() => import('./CollectionPresenterContainer'));\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,OAAOC,sBAAsB;AACtC,SAASC,yBAAyBC,2BAA2B;AAKtD,IAAMC,oBAAoB,CAAC,EAAEC,SAAQ,MAAwC;;;AAClF,UAAM,EAAEC,EAAC,IAAKC,eAAeC,gBAAAA;AAE7B,WACE,sBAAA,cAACC,yBAAAA,MACC,sBAAA,cAACC,qBAAAA;MAAoBC,OAAOL,EAAE,2BAAA;OAC5B,sBAAA,cAACM,MAAMC,QAAM;MACXC,SAAST,SAASU;MAClBC,iBAAiB,CAACF,YAAaT,SAASU,qBAAqB,CAAC,CAACD;;;;;AAKzE;;;ACrBA,SAASG,YAAY;AAId,IAAMC,gBAAgBC,KAAK,MAAM,OAAO,8BAAA,CAAA;AACxC,IAAMC,6BAA6BD,KAAK,MAAM,OAAO,2CAAA,CAAA;AACrD,IAAME,+BAA+BF,KAAK,MAAM,OAAO,6CAAA,CAAA;",
|
|
6
|
-
"names": ["React", "Input", "useTranslation", "DeprecatedFormContainer", "DeprecatedFormInput", "PresenterSettings", "settings", "t", "useTranslation", "PRESENTER_PLUGIN", "DeprecatedFormContainer", "DeprecatedFormInput", "label", "Input", "Switch", "checked", "presentCollections", "onCheckedChange", "lazy", "MarkdownSlide", "lazy", "DocumentPresenterContainer", "CollectionPresenterContainer"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\nimport { SettingsStore } from '@dxos/local-storage';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { DataType } from '@dxos/schema';\n\nimport {\n MarkdownSlide,\n PresenterSettings,\n DocumentPresenterContainer,\n CollectionPresenterContainer,\n} from '../components';\nimport { PRESENTER_PLUGIN } from '../meta';\nimport { type PresenterSettingsProps } from '../types';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: `${PRESENTER_PLUGIN}/document`,\n role: 'article',\n position: 'hoist',\n filter: (data): data is { subject: DocumentType; variant: 'presenter' } =>\n Obj.instanceOf(DocumentType, data.subject) && data.variant === 'presenter',\n component: ({ data }) => <DocumentPresenterContainer document={data.subject} />,\n }),\n createSurface({\n id: `${PRESENTER_PLUGIN}/collection`,\n role: 'article',\n position: 'hoist',\n filter: (data): data is { subject: DataType.Collection; variant: 'presenter' } =>\n Obj.instanceOf(DataType.Collection, data.subject) && data.variant === 'presenter',\n component: ({ data }) => <CollectionPresenterContainer collection={data.subject} />,\n }),\n createSurface({\n id: `${PRESENTER_PLUGIN}/slide`,\n role: 'slide',\n filter: (data): data is { subject: DocumentType } => Obj.instanceOf(DocumentType, data.subject),\n component: ({ data }) => <MarkdownSlide document={data.subject} />,\n }),\n createSurface({\n id: `${PRESENTER_PLUGIN}/plugin-settings`,\n role: 'article',\n filter: (data): data is { subject: SettingsStore<PresenterSettingsProps> } =>\n data.subject instanceof SettingsStore && data.subject.prefix === PRESENTER_PLUGIN,\n component: ({ data: { subject } }) => <PresenterSettings settings={subject.value} />,\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,cAAcC,aAAaC,qBAAqB;AACzD,SAASC,WAAW;AACpB,SAASC,qBAAqB;AAC9B,SAASC,oBAAoB;AAC7B,SAASC,gBAAgB;AAWzB,IAAA,wBAAe,MACbC,YAAYC,aAAaC,cAAc;EACrCC,cAAc;IACZC,IAAI,GAAGC,gBAAAA;IACPC,MAAM;IACNC,UAAU;IACVC,QAAQ,CAACC,SACPC,IAAIC,WAAWC,cAAcH,KAAKI,OAAO,KAAKJ,KAAKK,YAAY;IACjEC,WAAW,CAAC,EAAEN,KAAI,MAAO,sBAAA,cAACO,4BAAAA;MAA2BC,UAAUR,KAAKI;;EACtE,CAAA;EACAV,cAAc;IACZC,IAAI,GAAGC,gBAAAA;IACPC,MAAM;IACNC,UAAU;IACVC,QAAQ,CAACC,SACPC,IAAIC,WAAWO,SAASC,YAAYV,KAAKI,OAAO,KAAKJ,KAAKK,YAAY;IACxEC,WAAW,CAAC,EAAEN,KAAI,MAAO,sBAAA,cAACW,8BAAAA;MAA6BC,YAAYZ,KAAKI;;EAC1E,CAAA;EACAV,cAAc;IACZC,IAAI,GAAGC,gBAAAA;IACPC,MAAM;IACNE,QAAQ,CAACC,SAA4CC,IAAIC,WAAWC,cAAcH,KAAKI,OAAO;IAC9FE,WAAW,CAAC,EAAEN,KAAI,MAAO,sBAAA,cAACa,eAAAA;MAAcL,UAAUR,KAAKI;;EACzD,CAAA;EACAV,cAAc;IACZC,IAAI,GAAGC,gBAAAA;IACPC,MAAM;IACNE,QAAQ,CAACC,SACPA,KAAKI,mBAAmBU,iBAAiBd,KAAKI,QAAQW,WAAWnB;IACnEU,WAAW,CAAC,EAAEN,MAAM,EAAEI,QAAO,EAAE,MAAO,sBAAA,cAACY,mBAAAA;MAAkBC,UAAUb,QAAQc;;EAC7E,CAAA;CACD;",
|
|
6
|
-
"names": ["React", "Capabilities", "contributes", "createSurface", "Obj", "SettingsStore", "DocumentType", "DataType", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "PRESENTER_PLUGIN", "role", "position", "filter", "data", "Obj", "instanceOf", "DocumentType", "subject", "variant", "component", "DocumentPresenterContainer", "document", "DataType", "Collection", "CollectionPresenterContainer", "collection", "MarkdownSlide", "SettingsStore", "prefix", "PresenterSettings", "settings", "value"]
|
|
7
|
-
}
|