@dxos/plugin-presenter 0.9.1-main.c7dcc2e112 → 0.10.0
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/PLUGIN.mdl +12 -12
- package/dist/lib/neutral/{CollectionPresenterArticle-ZRYWBX2H.mjs → CollectionArticle-7R4KJWDW.mjs} +4 -4
- package/dist/lib/neutral/CollectionArticle-7R4KJWDW.mjs.map +7 -0
- package/dist/lib/neutral/{DocumentPresenterContainer-5QF4P736.mjs → DocumentArticle-YZRKVEN7.mjs} +13 -6
- package/dist/lib/neutral/DocumentArticle-YZRKVEN7.mjs.map +7 -0
- package/dist/lib/neutral/PresenterPlugin.mjs +1 -1
- package/dist/lib/neutral/PresenterPlugin.mjs.map +1 -1
- package/dist/lib/neutral/SlideArticle-FE2I6KBO.mjs +20 -0
- package/dist/lib/neutral/SlideArticle-FE2I6KBO.mjs.map +7 -0
- package/dist/lib/neutral/{app-graph-builder-JMQVBFG2.mjs → app-graph-builder-FNDFY5L3.mjs} +2 -2
- package/dist/lib/neutral/app-graph-builder-FNDFY5L3.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +2 -2
- package/dist/lib/neutral/{chunk-H5JLSLAO.mjs → chunk-NDZ6IIAL.mjs} +2 -2
- package/dist/lib/neutral/{chunk-H5JLSLAO.mjs.map → chunk-NDZ6IIAL.mjs.map} +3 -3
- package/dist/lib/neutral/components/index.mjs +11 -19
- package/dist/lib/neutral/components/index.mjs.map +4 -4
- package/dist/lib/neutral/containers/index.mjs +6 -6
- package/dist/lib/neutral/containers/index.mjs.map +3 -3
- package/dist/lib/neutral/index.mjs +1 -1
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/{react-surface-YGBE3TDK.mjs → react-surface-VO4GPCLQ.mjs} +11 -23
- package/dist/lib/neutral/react-surface-VO4GPCLQ.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +0 -1
- package/dist/lib/neutral/translations.mjs.map +2 -2
- package/dist/lib/neutral/types/index.mjs +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown-extension.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -3
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/PresentationShell.d.ts +4 -2
- package/dist/types/src/components/Presenter/PresentationShell.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 +0 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/CollectionArticle/CollectionArticle.d.ts +6 -0
- package/dist/types/src/containers/CollectionArticle/CollectionArticle.d.ts.map +1 -0
- package/dist/types/src/containers/CollectionArticle/index.d.ts +2 -0
- package/dist/types/src/{components/PresenterSettings → containers/CollectionArticle}/index.d.ts.map +1 -1
- package/dist/types/src/containers/DocumentArticle/DocumentArticle.d.ts +6 -0
- package/dist/types/src/containers/DocumentArticle/DocumentArticle.d.ts.map +1 -0
- package/dist/types/src/containers/DocumentArticle/index.d.ts +2 -0
- package/dist/types/src/containers/DocumentArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/SlideArticle/SlideArticle.d.ts +6 -0
- package/dist/types/src/containers/SlideArticle/SlideArticle.d.ts.map +1 -0
- package/dist/types/src/containers/SlideArticle/index.d.ts +2 -0
- package/dist/types/src/containers/SlideArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +3 -3
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +4 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +0 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/PresenterOperation.d.ts +3 -12
- package/dist/types/src/types/PresenterOperation.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +32 -32
- package/src/capabilities/app-graph-builder.ts +4 -3
- package/src/capabilities/react-surface.tsx +8 -17
- package/src/components/Markdown/Panel.stories.tsx +1 -1
- package/src/components/Presenter/PresentationShell.tsx +15 -12
- package/src/components/RevealPlayer/RevealPlayer.tsx +11 -12
- package/src/components/index.ts +0 -4
- package/src/containers/{CollectionPresenterArticle/CollectionPresenterArticle.tsx → CollectionArticle/CollectionArticle.tsx} +2 -2
- package/src/containers/CollectionArticle/index.ts +5 -0
- package/src/containers/DocumentArticle/DocumentArticle.tsx +34 -0
- package/src/containers/DocumentArticle/index.ts +5 -0
- package/src/containers/{MarkdownSlide/MarkdownSlide.tsx → SlideArticle/SlideArticle.tsx} +4 -5
- package/src/containers/SlideArticle/index.ts +5 -0
- package/src/containers/index.ts +3 -3
- package/src/translations.ts +0 -1
- package/src/types/PresenterOperation.ts +1 -1
- package/dist/lib/neutral/CollectionPresenterArticle-ZRYWBX2H.mjs.map +0 -7
- package/dist/lib/neutral/DocumentPresenterContainer-5QF4P736.mjs.map +0 -7
- package/dist/lib/neutral/MarkdownSlide-WXILOIBE.mjs +0 -18
- package/dist/lib/neutral/MarkdownSlide-WXILOIBE.mjs.map +0 -7
- package/dist/lib/neutral/PresenterSettings-4YFP4K5G.mjs +0 -25
- package/dist/lib/neutral/PresenterSettings-4YFP4K5G.mjs.map +0 -7
- package/dist/lib/neutral/app-graph-builder-JMQVBFG2.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-YGBE3TDK.mjs.map +0 -7
- package/dist/types/src/components/PresenterSettings/PresenterSettings.d.ts +0 -6
- package/dist/types/src/components/PresenterSettings/PresenterSettings.d.ts.map +0 -1
- package/dist/types/src/components/PresenterSettings/PresenterSettings.stories.d.ts +0 -23
- package/dist/types/src/components/PresenterSettings/PresenterSettings.stories.d.ts.map +0 -1
- package/dist/types/src/components/PresenterSettings/index.d.ts +0 -2
- package/dist/types/src/containers/CollectionPresenterArticle/CollectionPresenterArticle.d.ts +0 -6
- package/dist/types/src/containers/CollectionPresenterArticle/CollectionPresenterArticle.d.ts.map +0 -1
- package/dist/types/src/containers/CollectionPresenterArticle/index.d.ts +0 -2
- package/dist/types/src/containers/CollectionPresenterArticle/index.d.ts.map +0 -1
- package/dist/types/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.d.ts +0 -6
- package/dist/types/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.d.ts.map +0 -1
- package/dist/types/src/containers/DocumentPresenterContainer/index.d.ts +0 -2
- package/dist/types/src/containers/DocumentPresenterContainer/index.d.ts.map +0 -1
- package/dist/types/src/containers/MarkdownSlide/MarkdownSlide.d.ts +0 -8
- package/dist/types/src/containers/MarkdownSlide/MarkdownSlide.d.ts.map +0 -1
- package/dist/types/src/containers/MarkdownSlide/index.d.ts +0 -2
- package/dist/types/src/containers/MarkdownSlide/index.d.ts.map +0 -1
- package/src/components/PresenterSettings/PresenterSettings.stories.tsx +0 -32
- package/src/components/PresenterSettings/PresenterSettings.tsx +0 -31
- package/src/components/PresenterSettings/index.ts +0 -5
- package/src/containers/CollectionPresenterArticle/index.ts +0 -5
- package/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.tsx +0 -26
- package/src/containers/DocumentPresenterContainer/index.ts +0 -5
- package/src/containers/MarkdownSlide/index.ts +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-presenter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Braneframe presenter plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -99,46 +99,46 @@
|
|
|
99
99
|
"remark-frontmatter": "^5.0.0",
|
|
100
100
|
"remark-parse-frontmatter": "^1.0.3",
|
|
101
101
|
"reveal.js": "^5.1.0",
|
|
102
|
-
"@dxos/app-toolkit": "0.
|
|
103
|
-
"@dxos/
|
|
104
|
-
"@dxos/
|
|
105
|
-
"@dxos/
|
|
106
|
-
"@dxos/
|
|
107
|
-
"@dxos/
|
|
108
|
-
"@dxos/
|
|
109
|
-
"@dxos/
|
|
110
|
-
"@dxos/plugin-
|
|
111
|
-
"@dxos/plugin-
|
|
112
|
-
"@dxos/
|
|
113
|
-
"@dxos/
|
|
114
|
-
"@dxos/
|
|
115
|
-
"@dxos/ui-
|
|
116
|
-
"@dxos/
|
|
102
|
+
"@dxos/app-toolkit": "0.10.0",
|
|
103
|
+
"@dxos/compute": "0.10.0",
|
|
104
|
+
"@dxos/app-framework": "0.10.0",
|
|
105
|
+
"@dxos/effect": "0.10.0",
|
|
106
|
+
"@dxos/echo": "0.10.0",
|
|
107
|
+
"@dxos/keys": "0.10.0",
|
|
108
|
+
"@dxos/log": "0.10.0",
|
|
109
|
+
"@dxos/plugin-deck": "0.10.0",
|
|
110
|
+
"@dxos/plugin-markdown": "0.10.0",
|
|
111
|
+
"@dxos/plugin-client": "0.10.0",
|
|
112
|
+
"@dxos/react-ui-attention": "0.10.0",
|
|
113
|
+
"@dxos/ui-editor": "0.10.0",
|
|
114
|
+
"@dxos/util": "0.10.0",
|
|
115
|
+
"@dxos/react-ui-form": "0.10.0",
|
|
116
|
+
"@dxos/plugin-graph": "0.10.0"
|
|
117
117
|
},
|
|
118
118
|
"devDependencies": {
|
|
119
119
|
"@effect-atom/atom-react": "^0.5.0",
|
|
120
|
-
"@effect/platform": "0.96.
|
|
121
|
-
"@types/react": "~19.2.
|
|
120
|
+
"@effect/platform": "0.96.2",
|
|
121
|
+
"@types/react": "~19.2.17",
|
|
122
122
|
"@types/react-dom": "~19.2.3",
|
|
123
123
|
"@types/reveal.js": "^5.0.3",
|
|
124
|
-
"effect": "3.21.
|
|
125
|
-
"react": "~19.2.
|
|
126
|
-
"react-dom": "~19.2.
|
|
124
|
+
"effect": "3.21.4",
|
|
125
|
+
"react": "~19.2.7",
|
|
126
|
+
"react-dom": "~19.2.7",
|
|
127
127
|
"vite": "^8.0.16",
|
|
128
|
-
"@dxos/plugin-testing": "0.
|
|
129
|
-
"@dxos/random": "0.
|
|
130
|
-
"@dxos/react-ui": "0.
|
|
131
|
-
"@dxos/
|
|
132
|
-
"@dxos/
|
|
128
|
+
"@dxos/plugin-testing": "0.10.0",
|
|
129
|
+
"@dxos/random": "0.10.0",
|
|
130
|
+
"@dxos/react-ui": "0.10.0",
|
|
131
|
+
"@dxos/storybook-utils": "0.10.0",
|
|
132
|
+
"@dxos/ui-theme": "0.10.0"
|
|
133
133
|
},
|
|
134
134
|
"peerDependencies": {
|
|
135
135
|
"@effect-atom/atom-react": "^0.5.0",
|
|
136
|
-
"@effect/platform": "0.96.
|
|
137
|
-
"effect": "3.21.
|
|
138
|
-
"react": "~19.2.
|
|
139
|
-
"react-dom": "~19.2.
|
|
140
|
-
"@dxos/ui
|
|
141
|
-
"@dxos/
|
|
136
|
+
"@effect/platform": "0.96.2",
|
|
137
|
+
"effect": "3.21.4",
|
|
138
|
+
"react": "~19.2.7",
|
|
139
|
+
"react-dom": "~19.2.7",
|
|
140
|
+
"@dxos/react-ui": "0.10.0",
|
|
141
|
+
"@dxos/ui-theme": "0.10.0"
|
|
142
142
|
},
|
|
143
143
|
"publishConfig": {
|
|
144
144
|
"access": "public"
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { type Atom } from '@effect-atom/atom-react';
|
|
5
6
|
import * as Effect from 'effect/Effect';
|
|
6
7
|
import * as Option from 'effect/Option';
|
|
7
8
|
|
|
@@ -18,9 +19,9 @@ import { PresenterOperation } from '#types';
|
|
|
18
19
|
import { PresenterCapabilities } from '#types';
|
|
19
20
|
|
|
20
21
|
/** Match nodes that can be presented (Collection or Document). */
|
|
21
|
-
const whenPresentable = (node: Node.Node) =>
|
|
22
|
-
Option.orElse(NodeMatcher.whenEchoType(Collection.Collection)(node), () =>
|
|
23
|
-
NodeMatcher.whenEchoType(Markdown.Document)(node),
|
|
22
|
+
const whenPresentable = (node: Node.Node, get: Atom.Context) =>
|
|
23
|
+
Option.orElse(NodeMatcher.whenEchoType(Collection.Collection)(node, get), () =>
|
|
24
|
+
NodeMatcher.whenEchoType(Markdown.Document)(node, get),
|
|
24
25
|
);
|
|
25
26
|
|
|
26
27
|
export default Capability.makeModule(
|
|
@@ -6,22 +6,21 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
8
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
-
import { Surface
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
10
10
|
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
11
11
|
import { Collection, Obj } from '@dxos/echo';
|
|
12
12
|
import { Markdown } from '@dxos/plugin-markdown';
|
|
13
|
+
import { Position } from '@dxos/util';
|
|
13
14
|
|
|
14
|
-
import {
|
|
15
|
-
import { CollectionPresenterArticle, DocumentPresenterContainer, MarkdownSlide } from '#containers';
|
|
15
|
+
import { CollectionArticle, DocumentArticle, SlideArticle } from '#containers';
|
|
16
16
|
import { meta } from '#meta';
|
|
17
|
-
import { type Settings } from '#types';
|
|
18
17
|
|
|
19
18
|
export default Capability.makeModule(() =>
|
|
20
19
|
Effect.succeed(
|
|
21
20
|
Capability.contributes(Capabilities.ReactSurface, [
|
|
22
21
|
Surface.create({
|
|
23
22
|
id: 'document',
|
|
24
|
-
position:
|
|
23
|
+
position: Position.first,
|
|
25
24
|
filter: Surface.makeFilter(
|
|
26
25
|
AppSurface.Article,
|
|
27
26
|
(data): data is AppSurface.ArticleData<{ type: typeof meta.profile.key; object: Markdown.Document }> =>
|
|
@@ -32,11 +31,11 @@ export default Capability.makeModule(() =>
|
|
|
32
31
|
data.subject.type === meta.profile.key &&
|
|
33
32
|
Obj.instanceOf(Markdown.Document, data.subject.object),
|
|
34
33
|
),
|
|
35
|
-
component: ({ data }) => <
|
|
34
|
+
component: ({ role, data }) => <DocumentArticle role={role} subject={data.subject.object} />,
|
|
36
35
|
}),
|
|
37
36
|
Surface.create({
|
|
38
37
|
id: 'collection',
|
|
39
|
-
position:
|
|
38
|
+
position: Position.first,
|
|
40
39
|
filter: Surface.makeFilter(
|
|
41
40
|
AppSurface.Article,
|
|
42
41
|
(data): data is AppSurface.ArticleData<{ type: typeof meta.profile.key; object: Collection.Collection }> =>
|
|
@@ -47,20 +46,12 @@ export default Capability.makeModule(() =>
|
|
|
47
46
|
data.subject.type === meta.profile.key &&
|
|
48
47
|
Obj.instanceOf(Collection.Collection, data.subject.object),
|
|
49
48
|
),
|
|
50
|
-
component: ({ role, data }) => <
|
|
49
|
+
component: ({ role, data }) => <CollectionArticle role={role} subject={data.subject.object} />,
|
|
51
50
|
}),
|
|
52
51
|
Surface.create({
|
|
53
52
|
id: 'slide',
|
|
54
53
|
filter: AppSurface.object(AppSurface.Slide, Markdown.Document),
|
|
55
|
-
component: ({ data }) => <
|
|
56
|
-
}),
|
|
57
|
-
Surface.create({
|
|
58
|
-
id: 'pluginSettings',
|
|
59
|
-
filter: AppSurface.settings(AppSurface.Article, meta.profile.key),
|
|
60
|
-
component: ({ data: { subject } }) => {
|
|
61
|
-
const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);
|
|
62
|
-
return <PresenterSettings settings={settings} onSettingsChange={updateSettings} />;
|
|
63
|
-
},
|
|
54
|
+
component: ({ data }) => <SlideArticle {...data} />,
|
|
64
55
|
}),
|
|
65
56
|
]),
|
|
66
57
|
),
|
|
@@ -8,12 +8,14 @@ import { composable, composableProps } from '@dxos/react-ui';
|
|
|
8
8
|
import { mx } from '@dxos/ui-theme';
|
|
9
9
|
|
|
10
10
|
export type PresentationShellProps = PropsWithChildren<{
|
|
11
|
-
/** Invoked once the exit fade-out has completed. */
|
|
12
|
-
onExit?: () => void;
|
|
13
11
|
/** Fade-in/out duration (ms). */
|
|
14
12
|
fadeDuration?: number;
|
|
15
13
|
/** Duration the [ESC] hint remains visible (ms). */
|
|
16
14
|
hintDuration?: number;
|
|
15
|
+
/** Whether the presentation is fullscreen. */
|
|
16
|
+
fullscreen?: boolean;
|
|
17
|
+
/** Invoked once the exit fade-out has completed. */
|
|
18
|
+
onExit?: () => void;
|
|
17
19
|
}>;
|
|
18
20
|
|
|
19
21
|
/**
|
|
@@ -22,7 +24,7 @@ export type PresentationShellProps = PropsWithChildren<{
|
|
|
22
24
|
* caption shown on enter.
|
|
23
25
|
*/
|
|
24
26
|
export const PresentationShell = composable<HTMLDivElement, PresentationShellProps>(
|
|
25
|
-
({ children,
|
|
27
|
+
({ children, fadeDuration = 300, hintDuration = 3000, fullscreen = true, onExit, ...props }, forwardedRef) => {
|
|
26
28
|
const [visible, setVisible] = useState(false);
|
|
27
29
|
const [exiting, setExiting] = useState(false);
|
|
28
30
|
const [showHint, setShowHint] = useState(true);
|
|
@@ -81,15 +83,16 @@ export const PresentationShell = composable<HTMLDivElement, PresentationShellPro
|
|
|
81
83
|
ref={forwardedRef}
|
|
82
84
|
>
|
|
83
85
|
{children}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
86
|
+
{fullscreen && (
|
|
87
|
+
<div
|
|
88
|
+
className={mx(
|
|
89
|
+
'absolute top-4 left-4 z-[300] transition-opacity duration-500',
|
|
90
|
+
showHint && !exiting ? 'opacity-100' : 'opacity-0',
|
|
91
|
+
)}
|
|
92
|
+
>
|
|
93
|
+
<span className='rounded-sm bg-white/10 px-2 py-1 font-mono text-sm text-white/70'>[ESC]</span>
|
|
94
|
+
</div>
|
|
95
|
+
)}
|
|
93
96
|
</div>
|
|
94
97
|
);
|
|
95
98
|
},
|
|
@@ -17,6 +17,7 @@ import RevealMarkdown from 'reveal.js/plugin/markdown/plugin.js';
|
|
|
17
17
|
|
|
18
18
|
import { useAsyncEffect } from '@dxos/react-ui';
|
|
19
19
|
import { composable, composableProps } from '@dxos/react-ui';
|
|
20
|
+
import { mx } from '@dxos/ui-theme';
|
|
20
21
|
|
|
21
22
|
const styles = `
|
|
22
23
|
<style type="text/css">
|
|
@@ -148,23 +149,21 @@ export const RevealPlayer = composable<HTMLDivElement, RevealProps>(
|
|
|
148
149
|
return (
|
|
149
150
|
<div
|
|
150
151
|
{...composableProps(props, {
|
|
151
|
-
classNames: ['dx-container grid place-items-center bg-
|
|
152
|
+
classNames: ['dx-container grid place-items-center bg-scrim-surface', fullscreen && 'absolute inset-0'],
|
|
152
153
|
})}
|
|
153
154
|
ref={forwardedRef}
|
|
154
155
|
>
|
|
155
156
|
<div className='relative aspect-video h-full w-full h-auto max-h-full overflow-hidden'>
|
|
156
157
|
<div ref={deckDivRef} className='absolute inset-0 reveal'>
|
|
157
|
-
{/*
|
|
158
|
-
<
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
<div className='slides'>
|
|
167
|
-
<div className='text-center!' />
|
|
158
|
+
{/* React hoists these to <head>; they must not be wrapped in <style> (which only renders CSS text). */}
|
|
159
|
+
<link rel='preconnect' href='https://fonts.gstatic.com' {...{ crossOrigin: '' }} />
|
|
160
|
+
<link rel='preconnect' href='https://fonts.googleapis.com' />
|
|
161
|
+
<link
|
|
162
|
+
rel='stylesheet'
|
|
163
|
+
href='https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap'
|
|
164
|
+
/>
|
|
165
|
+
<div className={mx('slides', !fullscreen && 'bg-base-surface p-8')}>
|
|
166
|
+
<div />
|
|
168
167
|
<section {...{ 'data-markdown': [] }}>
|
|
169
168
|
<textarea {...{ 'data-template': true }} defaultValue={[styles, content].join('\n')}></textarea>
|
|
170
169
|
</section>
|
package/src/components/index.ts
CHANGED
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type ComponentType, lazy } from 'react';
|
|
6
|
-
|
|
7
5
|
export * from './Markdown';
|
|
8
6
|
export * from './Presenter';
|
|
9
7
|
export * from './RevealPlayer';
|
|
10
|
-
|
|
11
|
-
export const PresenterSettings: ComponentType<any> = lazy(() => import('./PresenterSettings'));
|
|
@@ -14,9 +14,9 @@ import { PresenterContext } from '#types';
|
|
|
14
14
|
|
|
15
15
|
import { useExitPresenter } from '../../useExitPresenter';
|
|
16
16
|
|
|
17
|
-
export type
|
|
17
|
+
export type CollectionArticleProps = AppSurface.ObjectArticleProps<Collection.Collection>;
|
|
18
18
|
|
|
19
|
-
export const
|
|
19
|
+
export const CollectionArticle = ({ role, subject: collection }: CollectionArticleProps) => {
|
|
20
20
|
const [slide, setSlide] = useState(0);
|
|
21
21
|
const { running } = useContext(PresenterContext);
|
|
22
22
|
const handleExit = useExitPresenter(collection);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { AppSurface, useLayout } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { type Markdown } from '@dxos/plugin-markdown';
|
|
9
|
+
import { Panel } from '@dxos/react-ui';
|
|
10
|
+
|
|
11
|
+
import { PresentationShell, RevealPlayer } from '#components';
|
|
12
|
+
|
|
13
|
+
import { useExitPresenter } from '../../useExitPresenter';
|
|
14
|
+
|
|
15
|
+
export type DocumentArticleProps = AppSurface.ObjectArticleProps<Markdown.Document>;
|
|
16
|
+
|
|
17
|
+
export const DocumentArticle = ({ role, subject: document }: DocumentArticleProps) => {
|
|
18
|
+
const handleExit = useExitPresenter(document);
|
|
19
|
+
const layout = useLayout();
|
|
20
|
+
const fullscreen = layout.mode === 'solo--fullscreen';
|
|
21
|
+
// RevealPlayer seeds its deck once from `content` (via a `defaultValue`); wait for the markdown ref to
|
|
22
|
+
// resolve so the presentation isn't initialized empty and left blank when the content arrives later.
|
|
23
|
+
const content = document.content.target?.content;
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Panel.Root role={role} classNames='relative'>
|
|
27
|
+
<Panel.Content asChild>
|
|
28
|
+
<PresentationShell fullscreen={fullscreen} onExit={handleExit}>
|
|
29
|
+
{content !== undefined && <RevealPlayer fullscreen={fullscreen} content={content} />}
|
|
30
|
+
</PresentationShell>
|
|
31
|
+
</Panel.Content>
|
|
32
|
+
</Panel.Root>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
@@ -4,22 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
7
8
|
import { type Markdown } from '@dxos/plugin-markdown';
|
|
8
9
|
|
|
9
10
|
import { Panel, Slide } from '#components';
|
|
10
11
|
|
|
11
|
-
type
|
|
12
|
-
document: Markdown.Document;
|
|
13
|
-
};
|
|
12
|
+
export type SlideArticleProps = AppSurface.ObjectSectionProps<Markdown.Document>;
|
|
14
13
|
|
|
15
|
-
export const
|
|
14
|
+
export const SlideArticle = ({ subject: document }: SlideArticleProps) => {
|
|
16
15
|
const content = document.content.target?.content;
|
|
17
16
|
if (!content) {
|
|
18
17
|
return null;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
return (
|
|
22
|
-
<Panel>
|
|
21
|
+
<Panel classNames='border'>
|
|
23
22
|
<Slide content={content} />
|
|
24
23
|
</Panel>
|
|
25
24
|
);
|
package/src/containers/index.ts
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import { type ComponentType, lazy } from 'react';
|
|
6
6
|
|
|
7
|
-
export const
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
7
|
+
export const CollectionArticle: ComponentType<any> = lazy(() => import('./CollectionArticle'));
|
|
8
|
+
export const DocumentArticle: ComponentType<any> = lazy(() => import('./DocumentArticle'));
|
|
9
|
+
export const SlideArticle: ComponentType<any> = lazy(() => import('./SlideArticle'));
|
package/src/translations.ts
CHANGED
|
@@ -8,7 +8,7 @@ import * as Schema from 'effect/Schema';
|
|
|
8
8
|
|
|
9
9
|
import { Capability } from '@dxos/app-framework';
|
|
10
10
|
import { Operation } from '@dxos/compute';
|
|
11
|
-
import { Collection,
|
|
11
|
+
import { Collection, DXN, Type } from '@dxos/echo';
|
|
12
12
|
import { Markdown } from '@dxos/plugin-markdown';
|
|
13
13
|
|
|
14
14
|
import { meta } from '#meta';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/CollectionPresenterArticle/CollectionPresenterArticle.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useContext, useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { type Collection, Obj } from '@dxos/echo';\nimport { Panel } from '@dxos/react-ui';\n\nimport { PageNumber, Pager, PresentationShell, Layout as PresenterLayout } from '#components';\nimport { PresenterContext } from '#types';\n\nimport { useExitPresenter } from '../../useExitPresenter';\n\nexport type CollectionPresenterArticleProps = AppSurface.ObjectArticleProps<Collection.Collection>;\n\nexport const CollectionPresenterArticle = ({ role, subject: collection }: CollectionPresenterArticleProps) => {\n const [slide, setSlide] = useState(0);\n const { running } = useContext(PresenterContext);\n const handleExit = useExitPresenter(collection);\n\n return (\n <Panel.Root role={role} classNames='relative'>\n <Panel.Content asChild>\n <PresentationShell onExit={handleExit}>\n <PresenterLayout\n bottomRight={<PageNumber index={slide} count={collection.objects.length} />}\n bottomLeft={<Pager index={slide} count={collection.objects.length} keys={running} onChange={setSlide} />}\n >\n <Surface.Surface\n type={AppSurface.Slide}\n data={{\n subject: collection.objects[slide],\n attendableId: Obj.getURI(collection),\n }}\n />\n </PresenterLayout>\n </PresentationShell>\n </Panel.Content>\n </Panel.Root>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,OAAOA,SAASC,YAAYC,gBAAgB;AAE5C,SAASC,eAAe;AACxB,SAASC,kBAAkB;AAC3B,SAA0BC,WAAW;AACrC,SAASC,aAAa;AAEtB,SAASC,YAAYC,OAAOC,mBAAmBC,UAAUC,uBAAuB;AAChF,SAASC,wBAAwB;AAM1B,IAAMC,6BAA6B,CAAC,EAAEC,MAAMC,SAASC,WAAU,MAAmC;AACvG,QAAM,CAACC,OAAOC,QAAAA,IAAYC,SAAS,CAAA;AACnC,QAAM,EAAEC,QAAO,IAAKC,WAAWC,gBAAAA;AAC/B,QAAMC,aAAaC,iBAAiBR,UAAAA;AAEpC,SACE,sBAAA,cAACS,MAAMC,MAAI;IAACZ;IAAYa,YAAW;KACjC,sBAAA,cAACF,MAAMG,SAAO;IAACC,SAAAA;KACb,sBAAA,cAACC,mBAAAA;IAAkBC,QAAQR;KACzB,sBAAA,cAACS,iBAAAA;IACCC,aAAa,sBAAA,cAACC,YAAAA;MAAWC,OAAOlB;MAAOmB,OAAOpB,WAAWqB,QAAQC;;IACjEC,YAAY,sBAAA,cAACC,OAAAA;MAAML,OAAOlB;MAAOmB,OAAOpB,WAAWqB,QAAQC;MAAQG,MAAMrB;MAASsB,UAAUxB;;KAE5F,sBAAA,cAACyB,QAAQA,SAAO;IACdC,MAAMC,WAAWC;IACjBC,MAAM;MACJhC,SAASC,WAAWqB,QAAQpB,KAAAA;MAC5B+B,cAAcC,IAAIC,OAAOlC,UAAAA;IAC3B;;AAOd;",
|
|
6
|
-
"names": ["React", "useContext", "useState", "Surface", "AppSurface", "Obj", "Panel", "PageNumber", "Pager", "PresentationShell", "Layout", "PresenterLayout", "PresenterContext", "CollectionPresenterArticle", "role", "subject", "collection", "slide", "setSlide", "useState", "running", "useContext", "PresenterContext", "handleExit", "useExitPresenter", "Panel", "Root", "classNames", "Content", "asChild", "PresentationShell", "onExit", "PresenterLayout", "bottomRight", "PageNumber", "index", "count", "objects", "length", "bottomLeft", "Pager", "keys", "onChange", "Surface", "type", "AppSurface", "Slide", "data", "attendableId", "Obj", "getURI"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/DocumentPresenterContainer/DocumentPresenterContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC } from 'react';\n\nimport { type Markdown } from '@dxos/plugin-markdown';\nimport { Panel } from '@dxos/react-ui';\n\nimport { PresentationShell, RevealPlayer } from '#components';\n\nimport { useExitPresenter } from '../../useExitPresenter';\n\nexport const DocumentPresenterContainer: FC<{ document: Markdown.Document }> = ({ document }) => {\n const handleExit = useExitPresenter(document);\n\n return (\n <Panel.Root classNames='relative'>\n <Panel.Content asChild>\n <PresentationShell onExit={handleExit}>\n <RevealPlayer content={document.content.target?.content ?? ''} />\n </PresentationShell>\n </Panel.Content>\n </Panel.Root>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,OAAOA,WAAwB;AAG/B,SAASC,aAAa;AAEtB,SAASC,mBAAmBC,oBAAoB;AAIzC,IAAMC,6BAAkE,CAAC,EAAEC,SAAQ,MAAE;AAC1F,QAAMC,aAAaC,iBAAiBF,QAAAA;AAEpC,SACE,sBAAA,cAACG,MAAMC,MAAI;IAACC,YAAW;KACrB,sBAAA,cAACF,MAAMG,SAAO;IAACC,SAAAA;KACb,sBAAA,cAACC,mBAAAA;IAAkBC,QAAQR;KACzB,sBAAA,cAACS,cAAAA;IAAaC,SAASX,SAASW,QAAQC,QAAQD,WAAW;;AAKrE;",
|
|
6
|
-
"names": ["React", "Panel", "PresentationShell", "RevealPlayer", "DocumentPresenterContainer", "document", "handleExit", "useExitPresenter", "Panel", "Root", "classNames", "Content", "asChild", "PresentationShell", "onExit", "RevealPlayer", "content", "target"]
|
|
7
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/containers/MarkdownSlide/MarkdownSlide.tsx
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { Panel, Slide } from "#components";
|
|
6
|
-
var MarkdownSlide = ({ document }) => {
|
|
7
|
-
const content = document.content.target?.content;
|
|
8
|
-
if (!content) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
return /* @__PURE__ */ React.createElement(Panel, null, /* @__PURE__ */ React.createElement(Slide, {
|
|
12
|
-
content
|
|
13
|
-
}));
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
MarkdownSlide as default
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=MarkdownSlide-WXILOIBE.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/MarkdownSlide/MarkdownSlide.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Markdown } from '@dxos/plugin-markdown';\n\nimport { Panel, Slide } from '#components';\n\ntype MarkdownSlideProps = {\n document: Markdown.Document;\n};\n\nexport const MarkdownSlide = ({ document }: MarkdownSlideProps) => {\n const content = document.content.target?.content;\n if (!content) {\n return null;\n }\n\n return (\n <Panel>\n <Slide content={content} />\n </Panel>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,OAAOA,WAAW;AAIlB,SAASC,OAAOC,aAAa;AAMtB,IAAMC,gBAAgB,CAAC,EAAEC,SAAQ,MAAsB;AAC5D,QAAMC,UAAUD,SAASC,QAAQC,QAAQD;AACzC,MAAI,CAACA,SAAS;AACZ,WAAO;EACT;AAEA,SACE,sBAAA,cAACJ,OAAAA,MACC,sBAAA,cAACC,OAAAA;IAAMG;;AAGb;",
|
|
6
|
-
"names": ["React", "Panel", "Slide", "MarkdownSlide", "document", "content", "target"]
|
|
7
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/components/PresenterSettings/PresenterSettings.tsx
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { useTranslation } from "@dxos/react-ui";
|
|
6
|
-
import { Settings as SettingsForm } from "@dxos/react-ui-form";
|
|
7
|
-
import { meta } from "#meta";
|
|
8
|
-
import { Settings } from "#types";
|
|
9
|
-
var PresenterSettings = ({ settings, onSettingsChange }) => {
|
|
10
|
-
const { t } = useTranslation(meta.profile.key);
|
|
11
|
-
return /* @__PURE__ */ React.createElement(SettingsForm.Viewport, null, /* @__PURE__ */ React.createElement(SettingsForm.Section, {
|
|
12
|
-
title: t("settings.title", {
|
|
13
|
-
ns: meta.profile.key
|
|
14
|
-
})
|
|
15
|
-
}, /* @__PURE__ */ React.createElement(SettingsForm.FieldSet, {
|
|
16
|
-
readonly: !onSettingsChange,
|
|
17
|
-
schema: Settings.Settings,
|
|
18
|
-
values: settings,
|
|
19
|
-
onValuesChanged: (values) => onSettingsChange?.(() => values)
|
|
20
|
-
})));
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
PresenterSettings as default
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=PresenterSettings-4YFP4K5G.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/PresenterSettings/PresenterSettings.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { useTranslation } from '@dxos/react-ui';\nimport { Settings as SettingsForm } from '@dxos/react-ui-form';\n\nimport { meta } from '#meta';\nimport { Settings } from '#types';\n\nexport type PresenterSettingsProps = AppSurface.SettingsArticleProps<Settings.Settings>;\n\nexport const PresenterSettings = ({ settings, onSettingsChange }: PresenterSettingsProps) => {\n const { t } = useTranslation(meta.profile.key);\n\n return (\n <SettingsForm.Viewport>\n <SettingsForm.Section title={t('settings.title', { ns: meta.profile.key })}>\n <SettingsForm.FieldSet\n readonly={!onSettingsChange}\n schema={Settings.Settings}\n values={settings}\n onValuesChanged={(values) => onSettingsChange?.(() => values)}\n />\n </SettingsForm.Section>\n </SettingsForm.Viewport>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,OAAOA,WAAW;AAGlB,SAASC,sBAAsB;AAC/B,SAASC,YAAYC,oBAAoB;AAEzC,SAASC,YAAY;AACrB,SAASF,gBAAgB;AAIlB,IAAMG,oBAAoB,CAAC,EAAEC,UAAUC,iBAAgB,MAA0B;AACtF,QAAM,EAAEC,EAAC,IAAKP,eAAeG,KAAKK,QAAQC,GAAG;AAE7C,SACE,sBAAA,cAACP,aAAaQ,UAAQ,MACpB,sBAAA,cAACR,aAAaS,SAAO;IAACC,OAAOL,EAAE,kBAAkB;MAAEM,IAAIV,KAAKK,QAAQC;IAAI,CAAA;KACtE,sBAAA,cAACP,aAAaY,UAAQ;IACpBC,UAAU,CAACT;IACXU,QAAQf,SAASA;IACjBgB,QAAQZ;IACRa,iBAAiB,CAACD,WAAWX,mBAAmB,MAAMW,MAAAA;;AAKhE;",
|
|
6
|
-
"names": ["React", "useTranslation", "Settings", "SettingsForm", "meta", "PresenterSettings", "settings", "onSettingsChange", "t", "profile", "key", "Viewport", "Section", "title", "ns", "FieldSet", "readonly", "schema", "values", "onValuesChanged"]
|
|
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 * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities, AppNode } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { Collection, Obj } from '@dxos/echo';\nimport { GraphBuilder, type Node, NodeMatcher } from '@dxos/plugin-graph';\nimport { Markdown } from '@dxos/plugin-markdown';\nimport { linkedSegment } from '@dxos/react-ui-attention';\n\nimport { meta } from '#meta';\nimport { PresenterOperation } from '#types';\nimport { PresenterCapabilities } from '#types';\n\n/** Match nodes that can be presented (Collection or Document). */\nconst whenPresentable = (node: Node.Node) =>\n Option.orElse(NodeMatcher.whenEchoType(Collection.Collection)(node), () =>\n NodeMatcher.whenEchoType(Markdown.Document)(node),\n );\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const capabilities = yield* Capability.Service;\n\n const extensions = yield* GraphBuilder.createExtension({\n id: 'root',\n // TODO(wittjosiah): This is a hack to work around presenter previously relying on \"variant\". Remove.\n match: whenPresentable,\n connector: (object, get) => {\n const settingsAtom = capabilities.get(PresenterCapabilities.Settings);\n const settings = get(settingsAtom);\n const isPresentable = settings?.presentCollections\n ? Obj.instanceOf(Collection.Collection, object) || Obj.instanceOf(Markdown.Document, object)\n : Obj.instanceOf(Markdown.Document, object);\n if (!isPresentable) {\n return Effect.succeed([]);\n }\n\n return Effect.succeed([\n AppNode.makeCompanion({\n id: linkedSegment('presenter'),\n label: 'Presenter',\n icon: 'ph--presentation--regular',\n data: { type: meta.profile.key, object },\n }),\n ]);\n },\n actions: (object, get) => {\n const settingsAtom = capabilities.get(PresenterCapabilities.Settings);\n const settings = get(settingsAtom);\n const isPresentable = settings?.presentCollections\n ? Obj.instanceOf(Collection.Collection, object) || Obj.instanceOf(Markdown.Document, object)\n : Obj.instanceOf(Markdown.Document, object);\n const db = Obj.getDatabase(object);\n if (!isPresentable || !db) {\n return Effect.succeed([]);\n }\n\n return Effect.succeed([\n {\n id: PresenterOperation.TogglePresentation.meta.key,\n data: Effect.fnUntraced(function* () {\n yield* Operation.invoke(PresenterOperation.TogglePresentation, { object });\n }),\n properties: {\n label: ['toggle-presentation.label', { ns: meta.profile.key }],\n icon: 'ph--presentation--regular',\n disposition: 'list-item',\n keyBinding: {\n macos: 'shift+meta+p',\n windows: 'shift+alt+p',\n },\n },\n },\n ]);\n },\n });\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiBC,eAAe;AACzC,SAASC,iBAAiB;AAC1B,SAASC,YAAYC,WAAW;AAChC,SAASC,cAAyBC,mBAAmB;AACrD,SAASC,gBAAgB;AACzB,SAASC,qBAAqB;AAE9B,SAASC,YAAY;AACrB,SAASC,0BAA0B;AACnC,SAASC,6BAA6B;AAGtC,IAAMC,kBAAkB,CAACC,SAChBC,cAAOR,YAAYS,aAAaZ,WAAWA,UAAU,EAAEU,IAAAA,GAAO,MACnEP,YAAYS,aAAaR,SAASS,QAAQ,EAAEH,IAAAA,CAAAA;AAGhD,IAAA,4BAAed,WAAWkB,WACjBC,kBAAW,aAAA;AAChB,QAAMC,eAAe,OAAOpB,WAAWqB;AAEvC,QAAMC,aAAa,OAAOhB,aAAaiB,gBAAgB;IACrDC,IAAI;;IAEJC,OAAOZ;IACPa,WAAW,CAACC,QAAQC,QAAAA;AAClB,YAAMC,eAAeT,aAAaQ,IAAIhB,sBAAsBkB,QAAQ;AACpE,YAAMC,WAAWH,IAAIC,YAAAA;AACrB,YAAMG,gBAAgBD,UAAUE,qBAC5B5B,IAAI6B,WAAW9B,WAAWA,YAAYuB,MAAAA,KAAWtB,IAAI6B,WAAW1B,SAASS,UAAUU,MAAAA,IACnFtB,IAAI6B,WAAW1B,SAASS,UAAUU,MAAAA;AACtC,UAAI,CAACK,eAAe;AAClB,eAAcG,eAAQ,CAAA,CAAE;MAC1B;AAEA,aAAcA,eAAQ;QACpBjC,QAAQkC,cAAc;UACpBZ,IAAIf,cAAc,WAAA;UAClB4B,OAAO;UACPC,MAAM;UACNC,MAAM;YAAEC,MAAM9B,KAAK+B,QAAQC;YAAKf;UAAO;QACzC,CAAA;OACD;IACH;IACAgB,SAAS,CAAChB,QAAQC,QAAAA;AAChB,YAAMC,eAAeT,aAAaQ,IAAIhB,sBAAsBkB,QAAQ;AACpE,YAAMC,WAAWH,IAAIC,YAAAA;AACrB,YAAMG,gBAAgBD,UAAUE,qBAC5B5B,IAAI6B,WAAW9B,WAAWA,YAAYuB,MAAAA,KAAWtB,IAAI6B,WAAW1B,SAASS,UAAUU,MAAAA,IACnFtB,IAAI6B,WAAW1B,SAASS,UAAUU,MAAAA;AACtC,YAAMiB,KAAKvC,IAAIwC,YAAYlB,MAAAA;AAC3B,UAAI,CAACK,iBAAiB,CAACY,IAAI;AACzB,eAAcT,eAAQ,CAAA,CAAE;MAC1B;AAEA,aAAcA,eAAQ;QACpB;UACEX,IAAIb,mBAAmBmC,mBAAmBpC,KAAKgC;UAC/CH,MAAapB,kBAAW,aAAA;AACtB,mBAAOhB,UAAU4C,OAAOpC,mBAAmBmC,oBAAoB;cAAEnB;YAAO,CAAA;UAC1E,CAAA;UACAqB,YAAY;YACVX,OAAO;cAAC;cAA6B;gBAAEY,IAAIvC,KAAK+B,QAAQC;cAAI;;YAC5DJ,MAAM;YACNY,aAAa;YACbC,YAAY;cACVC,OAAO;cACPC,SAAS;YACX;UACF;QACF;OACD;IACH;EACF,CAAA;AAEA,SAAOrD,WAAWsD,YAAYrD,gBAAgBsD,iBAAiBjC,UAAAA;AACjE,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Option", "Capability", "AppCapabilities", "AppNode", "Operation", "Collection", "Obj", "GraphBuilder", "NodeMatcher", "Markdown", "linkedSegment", "meta", "PresenterOperation", "PresenterCapabilities", "whenPresentable", "node", "orElse", "whenEchoType", "Document", "makeModule", "fnUntraced", "capabilities", "Service", "extensions", "createExtension", "id", "match", "connector", "object", "get", "settingsAtom", "Settings", "settings", "isPresentable", "presentCollections", "instanceOf", "succeed", "makeCompanion", "label", "icon", "data", "type", "profile", "key", "actions", "db", "getDatabase", "TogglePresentation", "invoke", "properties", "ns", "disposition", "keyBinding", "macos", "windows", "contributes", "AppGraphBuilder"]
|
|
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 * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface, useSettingsState } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { Collection, Obj } from '@dxos/echo';\nimport { Markdown } from '@dxos/plugin-markdown';\n\nimport { PresenterSettings } from '#components';\nimport { CollectionPresenterArticle, DocumentPresenterContainer, MarkdownSlide } from '#containers';\nimport { meta } from '#meta';\nimport { type Settings } from '#types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n Surface.create({\n id: 'document',\n position: 'first',\n filter: Surface.makeFilter(\n AppSurface.Article,\n (data): data is AppSurface.ArticleData<{ type: typeof meta.profile.key; object: Markdown.Document }> =>\n !!data.subject &&\n typeof data.subject === 'object' &&\n 'type' in data.subject &&\n 'object' in data.subject &&\n data.subject.type === meta.profile.key &&\n Obj.instanceOf(Markdown.Document, data.subject.object),\n ),\n component: ({ data }) => <DocumentPresenterContainer document={data.subject.object} />,\n }),\n Surface.create({\n id: 'collection',\n position: 'first',\n filter: Surface.makeFilter(\n AppSurface.Article,\n (data): data is AppSurface.ArticleData<{ type: typeof meta.profile.key; object: Collection.Collection }> =>\n !!data.subject &&\n typeof data.subject === 'object' &&\n 'type' in data.subject &&\n 'object' in data.subject &&\n data.subject.type === meta.profile.key &&\n Obj.instanceOf(Collection.Collection, data.subject.object),\n ),\n component: ({ role, data }) => <CollectionPresenterArticle role={role} subject={data.subject.object} />,\n }),\n Surface.create({\n id: 'slide',\n filter: AppSurface.object(AppSurface.Slide, Markdown.Document),\n component: ({ data }) => <MarkdownSlide document={data.subject} />,\n }),\n Surface.create({\n id: 'pluginSettings',\n filter: AppSurface.settings(AppSurface.Article, meta.profile.key),\n component: ({ data: { subject } }) => {\n const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);\n return <PresenterSettings settings={settings} onSettingsChange={updateSettings} />;\n },\n }),\n ]),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,SAASC,wBAAwB;AAC1C,SAASC,kBAAkB;AAC3B,SAASC,YAAYC,WAAW;AAChC,SAASC,gBAAgB;AAEzB,SAASC,yBAAyB;AAClC,SAASC,4BAA4BC,4BAA4BC,qBAAqB;AACtF,SAASC,YAAY;AAGrB,IAAA,wBAAeX,WAAWY,WAAW,MAC5BC,eACLb,WAAWc,YAAYf,aAAagB,cAAc;EAChDd,QAAQe,OAAO;IACbC,IAAI;IACJC,UAAU;IACVC,QAAQlB,QAAQmB,WACdjB,WAAWkB,SACX,CAACC,SACC,CAAC,CAACA,KAAKC,WACP,OAAOD,KAAKC,YAAY,YACxB,UAAUD,KAAKC,WACf,YAAYD,KAAKC,WACjBD,KAAKC,QAAQC,SAASb,KAAKc,QAAQC,OACnCrB,IAAIsB,WAAWrB,SAASsB,UAAUN,KAAKC,QAAQM,MAAM,CAAA;IAEzDC,WAAW,CAAC,EAAER,KAAI,MAAO,sBAAA,cAACb,4BAAAA;MAA2BsB,UAAUT,KAAKC,QAAQM;;EAC9E,CAAA;EACA5B,QAAQe,OAAO;IACbC,IAAI;IACJC,UAAU;IACVC,QAAQlB,QAAQmB,WACdjB,WAAWkB,SACX,CAACC,SACC,CAAC,CAACA,KAAKC,WACP,OAAOD,KAAKC,YAAY,YACxB,UAAUD,KAAKC,WACf,YAAYD,KAAKC,WACjBD,KAAKC,QAAQC,SAASb,KAAKc,QAAQC,OACnCrB,IAAIsB,WAAWvB,WAAWA,YAAYkB,KAAKC,QAAQM,MAAM,CAAA;IAE7DC,WAAW,CAAC,EAAEE,MAAMV,KAAI,MAAO,sBAAA,cAACd,4BAAAA;MAA2BwB;MAAYT,SAASD,KAAKC,QAAQM;;EAC/F,CAAA;EACA5B,QAAQe,OAAO;IACbC,IAAI;IACJE,QAAQhB,WAAW0B,OAAO1B,WAAW8B,OAAO3B,SAASsB,QAAQ;IAC7DE,WAAW,CAAC,EAAER,KAAI,MAAO,sBAAA,cAACZ,eAAAA;MAAcqB,UAAUT,KAAKC;;EACzD,CAAA;EACAtB,QAAQe,OAAO;IACbC,IAAI;IACJE,QAAQhB,WAAW+B,SAAS/B,WAAWkB,SAASV,KAAKc,QAAQC,GAAG;IAChEI,WAAW,CAAC,EAAER,MAAM,EAAEC,QAAO,EAAE,MAAE;AAC/B,YAAM,EAAEW,UAAUC,eAAc,IAAKjC,iBAAoCqB,QAAQa,IAAI;AACrF,aAAO,sBAAA,cAAC7B,mBAAAA;QAAkB2B;QAAoBG,kBAAkBF;;IAClE;EACF,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "React", "Capabilities", "Capability", "Surface", "useSettingsState", "AppSurface", "Collection", "Obj", "Markdown", "PresenterSettings", "CollectionPresenterArticle", "DocumentPresenterContainer", "MarkdownSlide", "meta", "makeModule", "succeed", "contributes", "ReactSurface", "create", "id", "position", "filter", "makeFilter", "Article", "data", "subject", "type", "profile", "key", "instanceOf", "Document", "object", "component", "document", "role", "Slide", "settings", "updateSettings", "atom", "onSettingsChange"]
|
|
7
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
3
|
-
import { Settings } from '#types';
|
|
4
|
-
export type PresenterSettingsProps = AppSurface.SettingsArticleProps<Settings.Settings>;
|
|
5
|
-
export declare const PresenterSettings: ({ settings, onSettingsChange }: PresenterSettingsProps) => React.JSX.Element;
|
|
6
|
-
//# sourceMappingURL=PresenterSettings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PresenterSettings.d.ts","sourceRoot":"","sources":["../../../../../src/components/PresenterSettings/PresenterSettings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKvD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,oBAAoB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAExF,eAAO,MAAM,iBAAiB,mCAAoC,sBAAsB,sBAevF,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
-
declare const meta: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: ({ settings, onSettingsChange }: import("./PresenterSettings").PresenterSettingsProps) => import("react").JSX.Element;
|
|
5
|
-
decorators: import("@storybook/react").Decorator[];
|
|
6
|
-
tags: string[];
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: string;
|
|
9
|
-
translations: [{
|
|
10
|
-
readonly 'en-US': {
|
|
11
|
-
readonly [x: string]: {
|
|
12
|
-
readonly 'plugin.name': 'Presenter';
|
|
13
|
-
readonly 'settings.title': 'Presenter settings';
|
|
14
|
-
readonly 'toggle-presentation.label': 'Present';
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
}];
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export default meta;
|
|
21
|
-
type Story = StoryObj<typeof meta>;
|
|
22
|
-
export declare const Default: Story;
|
|
23
|
-
//# sourceMappingURL=PresenterSettings.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PresenterSettings.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/PresenterSettings/PresenterSettings.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQjE,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;CASgC,CAAC;eAE5B,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC"}
|
package/dist/types/src/containers/CollectionPresenterArticle/CollectionPresenterArticle.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
3
|
-
import { type Collection } from '@dxos/echo';
|
|
4
|
-
export type CollectionPresenterArticleProps = AppSurface.ObjectArticleProps<Collection.Collection>;
|
|
5
|
-
export declare const CollectionPresenterArticle: ({ role, subject: collection }: CollectionPresenterArticleProps) => React.JSX.Element;
|
|
6
|
-
//# sourceMappingURL=CollectionPresenterArticle.d.ts.map
|
package/dist/types/src/containers/CollectionPresenterArticle/CollectionPresenterArticle.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CollectionPresenterArticle.d.ts","sourceRoot":"","sources":["../../../../../src/containers/CollectionPresenterArticle/CollectionPresenterArticle.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,KAAK,UAAU,EAAO,MAAM,YAAY,CAAC;AAQlD,MAAM,MAAM,+BAA+B,GAAG,UAAU,CAAC,kBAAkB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAEnG,eAAO,MAAM,0BAA0B,kCAAmC,+BAA+B,sBAyBxG,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/containers/CollectionPresenterArticle/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,IAAI,OAAO,EAAE,MAAM,8BAA8B,CAAC"}
|