@dxos/plugin-presenter 0.7.5-main.9d26e3a → 0.7.5-main.b19bfc8
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/{PresenterMain-TQE4OZK2.mjs → PresenterMain-7JXM3QQ7.mjs} +8 -8
- package/dist/lib/browser/PresenterMain-7JXM3QQ7.mjs.map +7 -0
- package/dist/lib/browser/{RevealMain-JGKAQMQ4.mjs → RevealMain-YFG5E6JB.mjs} +6 -5
- package/dist/lib/browser/RevealMain-YFG5E6JB.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-6U7WTJKG.mjs +54 -0
- package/dist/lib/browser/app-graph-builder-6U7WTJKG.mjs.map +7 -0
- package/dist/lib/browser/chunk-MSAMS5TA.mjs +16 -0
- package/dist/lib/browser/chunk-MSAMS5TA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-67PDV7KN.mjs → chunk-Q5U3VOZB.mjs} +3 -3
- package/dist/lib/browser/chunk-Q5U3VOZB.mjs.map +7 -0
- package/dist/lib/browser/{chunk-Z6QQB6KB.mjs → chunk-SFMK6EE3.mjs} +7 -3
- package/dist/lib/browser/chunk-SFMK6EE3.mjs.map +7 -0
- package/dist/lib/browser/chunk-Y3TXMZKR.mjs +31 -0
- package/dist/lib/browser/chunk-Y3TXMZKR.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +57 -172
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-27OZKSSE.mjs +46 -0
- package/dist/lib/browser/intent-resolver-27OZKSSE.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-OGCVIWCS.mjs +71 -0
- package/dist/lib/browser/react-surface-OGCVIWCS.mjs.map +7 -0
- package/dist/lib/browser/settings-L73ZKGLV.mjs +22 -0
- package/dist/lib/browser/settings-L73ZKGLV.mjs.map +7 -0
- package/dist/lib/browser/state-IGJRHRIA.mjs +18 -0
- package/dist/lib/browser/state-IGJRHRIA.mjs.map +7 -0
- package/dist/types/src/PresenterPlugin.d.ts +1 -3
- package/dist/types/src/PresenterPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +8 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +183 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +4 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +4 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/components/Markdown/Container.d.ts +2 -2
- package/dist/types/src/components/Markdown/Container.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Slide.d.ts +1 -2
- package/dist/types/src/components/Markdown/Slide.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Layout.d.ts +2 -2
- package/dist/types/src/components/Presenter/Layout.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Pager.d.ts +3 -3
- package/dist/types/src/components/Presenter/Pager.d.ts.map +1 -1
- package/dist/types/src/components/PresenterSettings.d.ts +1 -2
- package/dist/types/src/components/PresenterSettings.d.ts.map +1 -1
- package/dist/types/src/components/Reveal/Reveal.d.ts +1 -2
- package/dist/types/src/components/Reveal/Reveal.d.ts.map +1 -1
- package/dist/types/src/components/RevealMain.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -3
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +4 -5
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +23 -29
- package/src/PresenterPlugin.tsx +39 -142
- package/src/capabilities/app-graph-builder.ts +51 -0
- package/src/capabilities/capabilities.ts +13 -0
- package/src/capabilities/index.ts +13 -0
- package/src/capabilities/intent-resolver.ts +44 -0
- package/src/capabilities/react-surface.tsx +60 -0
- package/src/capabilities/settings.ts +19 -0
- package/src/capabilities/state.ts +17 -0
- package/src/components/Presenter/Pager.tsx +2 -2
- package/src/components/PresenterMain.tsx +3 -3
- package/src/components/PresenterSettings.tsx +3 -3
- package/src/components/RevealMain.tsx +3 -2
- package/src/index.ts +2 -4
- package/src/meta.ts +1 -1
- package/src/types.ts +6 -15
- package/dist/lib/browser/PresenterMain-TQE4OZK2.mjs.map +0 -7
- package/dist/lib/browser/RevealMain-JGKAQMQ4.mjs.map +0 -7
- package/dist/lib/browser/chunk-67PDV7KN.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z6QQB6KB.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -9
- package/dist/lib/browser/meta.mjs.map +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,OAAO,CAAC;AAEpD,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI1D,yBAAiB,eAAe,CAAC;;;;;;;;;;IAG/B,MAAM,OAAO,kBAAmB,SAAQ,uBASvC;KAAG;;CACL;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,OAAO,CAAC,oBAAoB,CAIzD,CAAC;AAEH,eAAO,MAAM,uBAAuB;;GAInC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.7.
|
|
1
|
+
{"version":"5.7.3"}
|
package/package.json
CHANGED
|
@@ -1,29 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-presenter",
|
|
3
|
-
"version": "0.7.5-main.
|
|
3
|
+
"version": "0.7.5-main.b19bfc8",
|
|
4
4
|
"description": "Braneframe presenter plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "DXOS.org",
|
|
9
9
|
"sideEffects": true,
|
|
10
|
+
"type": "module",
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
12
13
|
"types": "./dist/types/src/index.d.ts",
|
|
13
14
|
"browser": "./dist/lib/browser/index.mjs"
|
|
14
|
-
},
|
|
15
|
-
"./meta": {
|
|
16
|
-
"types": "./dist/types/src/meta.d.ts",
|
|
17
|
-
"browser": "./dist/lib/browser/meta.mjs"
|
|
18
15
|
}
|
|
19
16
|
},
|
|
20
17
|
"types": "dist/types/src/index.d.ts",
|
|
21
18
|
"typesVersions": {
|
|
22
|
-
"*": {
|
|
23
|
-
"meta": [
|
|
24
|
-
"dist/types/src/meta.d.ts"
|
|
25
|
-
]
|
|
26
|
-
}
|
|
19
|
+
"*": {}
|
|
27
20
|
},
|
|
28
21
|
"files": [
|
|
29
22
|
"dist",
|
|
@@ -41,19 +34,20 @@
|
|
|
41
34
|
"remark-frontmatter": "^5.0.0",
|
|
42
35
|
"remark-parse-frontmatter": "^1.0.3",
|
|
43
36
|
"reveal.js": "^5.1.0",
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/local-storage": "0.7.5-main.
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/plugin-graph": "0.7.5-main.
|
|
51
|
-
"@dxos/plugin-client": "0.7.5-main.
|
|
52
|
-
"@dxos/plugin-
|
|
53
|
-
"@dxos/plugin-stack": "0.7.5-main.
|
|
54
|
-
"@dxos/plugin-
|
|
55
|
-
"@dxos/react-client": "0.7.5-main.
|
|
56
|
-
"@dxos/react-ui-form": "0.7.5-main.
|
|
37
|
+
"@dxos/app-framework": "0.7.5-main.b19bfc8",
|
|
38
|
+
"@dxos/async": "0.7.5-main.b19bfc8",
|
|
39
|
+
"@dxos/live-object": "0.7.5-main.b19bfc8",
|
|
40
|
+
"@dxos/log": "0.7.5-main.b19bfc8",
|
|
41
|
+
"@dxos/local-storage": "0.7.5-main.b19bfc8",
|
|
42
|
+
"@dxos/echo-schema": "0.7.5-main.b19bfc8",
|
|
43
|
+
"@dxos/plugin-graph": "0.7.5-main.b19bfc8",
|
|
44
|
+
"@dxos/plugin-client": "0.7.5-main.b19bfc8",
|
|
45
|
+
"@dxos/plugin-markdown": "0.7.5-main.b19bfc8",
|
|
46
|
+
"@dxos/plugin-stack": "0.7.5-main.b19bfc8",
|
|
47
|
+
"@dxos/plugin-space": "0.7.5-main.b19bfc8",
|
|
48
|
+
"@dxos/react-client": "0.7.5-main.b19bfc8",
|
|
49
|
+
"@dxos/react-ui-form": "0.7.5-main.b19bfc8",
|
|
50
|
+
"@dxos/react-ui-stack": "0.7.5-main.b19bfc8"
|
|
57
51
|
},
|
|
58
52
|
"devDependencies": {
|
|
59
53
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -64,17 +58,17 @@
|
|
|
64
58
|
"react": "~18.2.0",
|
|
65
59
|
"react-dom": "~18.2.0",
|
|
66
60
|
"vite": "5.4.7",
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/react-ui": "0.7.5-main.
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
61
|
+
"@dxos/react-ui": "0.7.5-main.b19bfc8",
|
|
62
|
+
"@dxos/react-ui-theme": "0.7.5-main.b19bfc8",
|
|
63
|
+
"@dxos/storybook-utils": "0.7.5-main.b19bfc8",
|
|
64
|
+
"@dxos/random": "0.7.5-main.b19bfc8"
|
|
71
65
|
},
|
|
72
66
|
"peerDependencies": {
|
|
73
67
|
"@phosphor-icons/react": "^2.1.5",
|
|
74
68
|
"react": "~18.2.0",
|
|
75
69
|
"react-dom": "~18.2.0",
|
|
76
|
-
"@dxos/react-ui": "0.7.5-main.
|
|
77
|
-
"@dxos/react-ui-theme": "0.7.5-main.
|
|
70
|
+
"@dxos/react-ui": "0.7.5-main.b19bfc8",
|
|
71
|
+
"@dxos/react-ui-theme": "0.7.5-main.b19bfc8"
|
|
78
72
|
},
|
|
79
73
|
"publishConfig": {
|
|
80
74
|
"access": "public"
|
package/src/PresenterPlugin.tsx
CHANGED
|
@@ -2,151 +2,48 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { definePlugin, defineModule, Events, contributes, Capabilities } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
type PluginDefinition,
|
|
10
|
-
parseIntentPlugin,
|
|
11
|
-
LayoutAction,
|
|
12
|
-
NavigationAction,
|
|
13
|
-
createSurface,
|
|
14
|
-
createIntent,
|
|
15
|
-
createResolver,
|
|
16
|
-
} from '@dxos/app-framework';
|
|
17
|
-
import { create } from '@dxos/live-object';
|
|
18
|
-
import { LocalStorageStore } from '@dxos/local-storage';
|
|
19
|
-
import { createExtension, type Node } from '@dxos/plugin-graph';
|
|
20
|
-
import { DocumentType } from '@dxos/plugin-markdown/types';
|
|
21
|
-
import { CollectionType } from '@dxos/plugin-space/types';
|
|
22
|
-
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
23
|
-
|
|
24
|
-
import { PresenterMain, PresenterSettings, MarkdownSlide, RevealMain } from './components';
|
|
25
|
-
import meta, { PRESENTER_PLUGIN } from './meta';
|
|
7
|
+
import { AppGraphBuilder, IntentResolver, PresenterSettings, PresenterState, ReactSurface } from './capabilities';
|
|
8
|
+
import { meta } from './meta';
|
|
26
9
|
import translations from './translations';
|
|
27
|
-
import { PresenterContext, type PresenterSettingsProps, type PresenterPluginProvides, PresenterAction } from './types';
|
|
28
10
|
|
|
29
11
|
// TODO(burdon): Only scale markdown content.
|
|
30
12
|
// TODO(burdon): Map stack content; Slide content type (e.g., markdown, sketch, IPFS image, table, etc.)
|
|
31
13
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
data: async () => {
|
|
69
|
-
await dispatch(createIntent(PresenterAction.TogglePresentation, { object }));
|
|
70
|
-
},
|
|
71
|
-
properties: {
|
|
72
|
-
label: ['toggle presentation label', { ns: PRESENTER_PLUGIN }],
|
|
73
|
-
icon: 'ph--presentation--regular',
|
|
74
|
-
keyBinding: {
|
|
75
|
-
macos: 'shift+meta+p',
|
|
76
|
-
windows: 'shift+alt+p',
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
];
|
|
81
|
-
},
|
|
82
|
-
});
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
context: ({ children }) => {
|
|
86
|
-
return (
|
|
87
|
-
<PresenterContext.Provider
|
|
88
|
-
value={{
|
|
89
|
-
running: state.presenting,
|
|
90
|
-
start: () => (state.presenting = true),
|
|
91
|
-
stop: () => (state.presenting = false),
|
|
92
|
-
}}
|
|
93
|
-
>
|
|
94
|
-
{children}
|
|
95
|
-
</PresenterContext.Provider>
|
|
96
|
-
);
|
|
97
|
-
},
|
|
98
|
-
surface: {
|
|
99
|
-
definitions: () => [
|
|
100
|
-
createSurface({
|
|
101
|
-
id: `${PRESENTER_PLUGIN}/document`,
|
|
102
|
-
role: 'main',
|
|
103
|
-
disposition: 'hoist',
|
|
104
|
-
filter: (data): data is { subject: DocumentType } => data.subject instanceof DocumentType,
|
|
105
|
-
component: ({ data }) => <RevealMain document={data.subject} />,
|
|
106
|
-
}),
|
|
107
|
-
createSurface({
|
|
108
|
-
id: `${PRESENTER_PLUGIN}/collection`,
|
|
109
|
-
role: 'main',
|
|
110
|
-
disposition: 'hoist',
|
|
111
|
-
filter: (data): data is { subject: CollectionType } => data.subject instanceof CollectionType,
|
|
112
|
-
component: ({ data }) => <PresenterMain collection={data.subject} />,
|
|
113
|
-
}),
|
|
114
|
-
createSurface({
|
|
115
|
-
id: `${PRESENTER_PLUGIN}/slide`,
|
|
116
|
-
role: 'slide',
|
|
117
|
-
filter: (data): data is { subject: DocumentType } => data.subject instanceof DocumentType,
|
|
118
|
-
component: ({ data }) => <MarkdownSlide document={data.subject} />,
|
|
119
|
-
}),
|
|
120
|
-
createSurface({
|
|
121
|
-
id: `${PRESENTER_PLUGIN}/settings`,
|
|
122
|
-
role: 'settings',
|
|
123
|
-
filter: (data): data is any => data.subject === PRESENTER_PLUGIN,
|
|
124
|
-
component: () => <PresenterSettings settings={settings.values} />,
|
|
125
|
-
}),
|
|
126
|
-
],
|
|
127
|
-
},
|
|
128
|
-
intent: {
|
|
129
|
-
resolvers: () =>
|
|
130
|
-
createResolver(PresenterAction.TogglePresentation, ({ object, state: next }) => {
|
|
131
|
-
state.presenting = next ?? !state.presenting;
|
|
132
|
-
|
|
133
|
-
if (state.presenting) {
|
|
134
|
-
return {
|
|
135
|
-
intents: [
|
|
136
|
-
createIntent(LayoutAction.SetLayoutMode, { layoutMode: 'fullscreen' }),
|
|
137
|
-
createIntent(NavigationAction.Open, { activeParts: { fullScreen: fullyQualifiedId(object) } }),
|
|
138
|
-
],
|
|
139
|
-
};
|
|
140
|
-
} else {
|
|
141
|
-
return {
|
|
142
|
-
intents: [
|
|
143
|
-
createIntent(LayoutAction.SetLayoutMode, { revert: true }),
|
|
144
|
-
createIntent(NavigationAction.Close, { activeParts: { fullScreen: fullyQualifiedId(object) } }),
|
|
145
|
-
],
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
}),
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
};
|
|
152
|
-
};
|
|
14
|
+
export const PresenterPlugin = () =>
|
|
15
|
+
definePlugin(meta, [
|
|
16
|
+
defineModule({
|
|
17
|
+
id: `${meta.id}/module/settings`,
|
|
18
|
+
activatesOn: Events.SetupSettings,
|
|
19
|
+
activate: PresenterSettings,
|
|
20
|
+
}),
|
|
21
|
+
defineModule({
|
|
22
|
+
id: `${meta.id}/module/state`,
|
|
23
|
+
// TODO(wittjosiah): Does not integrate with settings store.
|
|
24
|
+
// Should this be a different event?
|
|
25
|
+
// Should settings store be renamed to be more generic?
|
|
26
|
+
activatesOn: Events.SetupSettings,
|
|
27
|
+
activate: PresenterState,
|
|
28
|
+
}),
|
|
29
|
+
defineModule({
|
|
30
|
+
id: `${meta.id}/module/translations`,
|
|
31
|
+
activatesOn: Events.SetupTranslations,
|
|
32
|
+
activate: () => contributes(Capabilities.Translations, translations),
|
|
33
|
+
}),
|
|
34
|
+
defineModule({
|
|
35
|
+
id: `${meta.id}/module/react-surface`,
|
|
36
|
+
activatesOn: Events.SetupReactSurface,
|
|
37
|
+
activate: ReactSurface,
|
|
38
|
+
}),
|
|
39
|
+
defineModule({
|
|
40
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
41
|
+
activatesOn: Events.SetupIntentResolver,
|
|
42
|
+
activate: IntentResolver,
|
|
43
|
+
}),
|
|
44
|
+
defineModule({
|
|
45
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
46
|
+
activatesOn: Events.SetupAppGraph,
|
|
47
|
+
activate: AppGraphBuilder,
|
|
48
|
+
}),
|
|
49
|
+
]);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { contributes, type PluginsContext, Capabilities, createIntent } from '@dxos/app-framework';
|
|
6
|
+
import { createExtension, type Node } from '@dxos/plugin-graph';
|
|
7
|
+
import { DocumentType } from '@dxos/plugin-markdown/types';
|
|
8
|
+
import { CollectionType } from '@dxos/plugin-space/types';
|
|
9
|
+
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
10
|
+
|
|
11
|
+
import { PRESENTER_PLUGIN } from '../meta';
|
|
12
|
+
import { PresenterAction, type PresenterSettingsProps } from '../types';
|
|
13
|
+
|
|
14
|
+
export default (context: PluginsContext) =>
|
|
15
|
+
contributes(
|
|
16
|
+
Capabilities.AppGraphBuilder,
|
|
17
|
+
createExtension({
|
|
18
|
+
id: PRESENTER_PLUGIN,
|
|
19
|
+
filter: (node): node is Node<CollectionType | DocumentType> => {
|
|
20
|
+
const settings = context
|
|
21
|
+
.requestCapabilities(Capabilities.SettingsStore)[0]
|
|
22
|
+
?.getStore<PresenterSettingsProps>(PRESENTER_PLUGIN)?.value;
|
|
23
|
+
return settings?.presentCollections
|
|
24
|
+
? node.data instanceof CollectionType || node.data instanceof DocumentType
|
|
25
|
+
: node.data instanceof DocumentType;
|
|
26
|
+
},
|
|
27
|
+
actions: ({ node }) => {
|
|
28
|
+
const object = node.data;
|
|
29
|
+
const id = fullyQualifiedId(object);
|
|
30
|
+
return [
|
|
31
|
+
{
|
|
32
|
+
id: `${PresenterAction.TogglePresentation._tag}/${id}`,
|
|
33
|
+
// TODO(burdon): Allow function so can generate state when activated.
|
|
34
|
+
// So can set explicit fullscreen state coordinated with current presenter state.
|
|
35
|
+
data: async () => {
|
|
36
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
37
|
+
await dispatch(createIntent(PresenterAction.TogglePresentation, { object }));
|
|
38
|
+
},
|
|
39
|
+
properties: {
|
|
40
|
+
label: ['toggle presentation label', { ns: PRESENTER_PLUGIN }],
|
|
41
|
+
icon: 'ph--presentation--regular',
|
|
42
|
+
keyBinding: {
|
|
43
|
+
macos: 'shift+meta+p',
|
|
44
|
+
windows: 'shift+alt+p',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
51
|
+
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { PRESENTER_PLUGIN } from '../meta';
|
|
8
|
+
|
|
9
|
+
export namespace PresenterCapabilities {
|
|
10
|
+
export type State = { presenting: boolean };
|
|
11
|
+
export const State = defineCapability<Readonly<State>>(`${PRESENTER_PLUGIN}/capability/state`);
|
|
12
|
+
export const MutableState = defineCapability<State>(`${PRESENTER_PLUGIN}/capability/state`);
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { lazy } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
|
|
8
|
+
export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
9
|
+
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
10
|
+
export const PresenterSettings = lazy(() => import('./settings'));
|
|
11
|
+
export const PresenterState = lazy(() => import('./state'));
|
|
12
|
+
|
|
13
|
+
export * from './capabilities';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Capabilities,
|
|
7
|
+
contributes,
|
|
8
|
+
createIntent,
|
|
9
|
+
createResolver,
|
|
10
|
+
LayoutAction,
|
|
11
|
+
type PluginsContext,
|
|
12
|
+
} from '@dxos/app-framework';
|
|
13
|
+
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
14
|
+
|
|
15
|
+
import { PresenterCapabilities } from './capabilities';
|
|
16
|
+
import { PresenterAction } from '../types';
|
|
17
|
+
|
|
18
|
+
export default (context: PluginsContext) =>
|
|
19
|
+
contributes(
|
|
20
|
+
Capabilities.IntentResolver,
|
|
21
|
+
createResolver({
|
|
22
|
+
intent: PresenterAction.TogglePresentation,
|
|
23
|
+
resolve: ({ object, state: next }) => {
|
|
24
|
+
const state = context.requestCapability(PresenterCapabilities.MutableState);
|
|
25
|
+
state.presenting = next ?? !state.presenting;
|
|
26
|
+
|
|
27
|
+
if (state.presenting) {
|
|
28
|
+
return {
|
|
29
|
+
intents: [
|
|
30
|
+
createIntent(LayoutAction.SetLayoutMode, {
|
|
31
|
+
part: 'mode',
|
|
32
|
+
subject: fullyQualifiedId(object),
|
|
33
|
+
options: { mode: 'fullscreen' },
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
} else {
|
|
38
|
+
return {
|
|
39
|
+
intents: [createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { revert: true } })],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, contributes, createSurface, useCapability } from '@dxos/app-framework';
|
|
8
|
+
import { SettingsStore } from '@dxos/local-storage';
|
|
9
|
+
import { DocumentType } from '@dxos/plugin-markdown/types';
|
|
10
|
+
import { CollectionType } from '@dxos/plugin-space/types';
|
|
11
|
+
|
|
12
|
+
import { PresenterCapabilities } from './capabilities';
|
|
13
|
+
import { MarkdownSlide, PresenterSettings, PresenterMain, RevealMain } from '../components';
|
|
14
|
+
import { PRESENTER_PLUGIN } from '../meta';
|
|
15
|
+
import { PresenterContext, type PresenterSettingsProps } from '../types';
|
|
16
|
+
|
|
17
|
+
export default () =>
|
|
18
|
+
contributes(Capabilities.ReactSurface, [
|
|
19
|
+
createSurface({
|
|
20
|
+
id: `${PRESENTER_PLUGIN}/document`,
|
|
21
|
+
role: 'main',
|
|
22
|
+
position: 'hoist',
|
|
23
|
+
filter: (data): data is { subject: DocumentType } => data.subject instanceof DocumentType,
|
|
24
|
+
component: ({ data }) => <RevealMain document={data.subject} />,
|
|
25
|
+
}),
|
|
26
|
+
createSurface({
|
|
27
|
+
id: `${PRESENTER_PLUGIN}/collection`,
|
|
28
|
+
role: 'main',
|
|
29
|
+
position: 'hoist',
|
|
30
|
+
filter: (data): data is { subject: CollectionType } => data.subject instanceof CollectionType,
|
|
31
|
+
component: ({ data }) => {
|
|
32
|
+
const state = useCapability(PresenterCapabilities.MutableState);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<PresenterContext.Provider
|
|
36
|
+
value={{
|
|
37
|
+
running: state.presenting,
|
|
38
|
+
start: () => (state.presenting = true),
|
|
39
|
+
stop: () => (state.presenting = false),
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
<PresenterMain collection={data.subject} />
|
|
43
|
+
</PresenterContext.Provider>
|
|
44
|
+
);
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
47
|
+
createSurface({
|
|
48
|
+
id: `${PRESENTER_PLUGIN}/slide`,
|
|
49
|
+
role: 'slide',
|
|
50
|
+
filter: (data): data is { subject: DocumentType } => data.subject instanceof DocumentType,
|
|
51
|
+
component: ({ data }) => <MarkdownSlide document={data.subject} />,
|
|
52
|
+
}),
|
|
53
|
+
createSurface({
|
|
54
|
+
id: `${PRESENTER_PLUGIN}/settings`,
|
|
55
|
+
role: 'article',
|
|
56
|
+
filter: (data): data is { subject: SettingsStore<PresenterSettingsProps> } =>
|
|
57
|
+
data.subject instanceof SettingsStore && data.subject.prefix === PRESENTER_PLUGIN,
|
|
58
|
+
component: ({ data: { subject } }) => <PresenterSettings settings={subject.value} />,
|
|
59
|
+
}),
|
|
60
|
+
]);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
6
|
+
import { create } from '@dxos/live-object';
|
|
7
|
+
|
|
8
|
+
import { PRESENTER_PLUGIN } from '../meta';
|
|
9
|
+
import { PresenterSettingsSchema, type PresenterSettingsProps } from '../types';
|
|
10
|
+
|
|
11
|
+
export default () => {
|
|
12
|
+
const settings = create<PresenterSettingsProps>({});
|
|
13
|
+
|
|
14
|
+
return contributes(Capabilities.Settings, {
|
|
15
|
+
schema: PresenterSettingsSchema,
|
|
16
|
+
prefix: PRESENTER_PLUGIN,
|
|
17
|
+
value: settings,
|
|
18
|
+
});
|
|
19
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { contributes } from '@dxos/app-framework';
|
|
6
|
+
import { create } from '@dxos/live-object';
|
|
7
|
+
|
|
8
|
+
import { PresenterCapabilities } from './capabilities';
|
|
9
|
+
|
|
10
|
+
export default () => {
|
|
11
|
+
// TODO(burdon): Do we need context providers if we can get the state from the plugin?
|
|
12
|
+
// No, the main reason would be compability with existing apis.
|
|
13
|
+
// For anything made specifically for the plugin framework they can depend on `useCapabilities`.
|
|
14
|
+
const state = create<PresenterCapabilities.State>({ presenting: false });
|
|
15
|
+
|
|
16
|
+
return contributes(PresenterCapabilities.State, state);
|
|
17
|
+
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Play, X, CaretDoubleLeft, CaretDoubleRight, CaretLeft, CaretRight } from '@phosphor-icons/react';
|
|
6
6
|
import React, { type FC, useEffect } from 'react';
|
|
7
7
|
|
|
8
|
-
import { Button,
|
|
8
|
+
import { Button, useControlledState } from '@dxos/react-ui';
|
|
9
9
|
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
10
10
|
|
|
11
11
|
export type PagerProps = {
|
|
@@ -17,7 +17,7 @@ export type PagerProps = {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export const Pager = ({ index: controlledIndex = 0, count = 0, keys, onChange, onExit }: PagerProps) => {
|
|
20
|
-
const [index, setIndex] =
|
|
20
|
+
const [index, setIndex] = useControlledState(controlledIndex);
|
|
21
21
|
useEffect(() => {
|
|
22
22
|
onChange?.(index);
|
|
23
23
|
}, [index]);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { type FC, useContext, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Surface,
|
|
7
|
+
import { Surface, createIntent, useLayout, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { type CollectionType } from '@dxos/plugin-space/types';
|
|
9
9
|
import { Main } from '@dxos/react-ui';
|
|
10
10
|
import {
|
|
@@ -21,8 +21,8 @@ const PresenterMain: FC<{ collection: CollectionType }> = ({ collection }) => {
|
|
|
21
21
|
const [slide, setSlide] = useState(0);
|
|
22
22
|
|
|
23
23
|
// TODO(burdon): Should not depend on split screen.
|
|
24
|
-
const
|
|
25
|
-
const fullscreen =
|
|
24
|
+
const layout = useLayout();
|
|
25
|
+
const fullscreen = layout.mode === 'fullscreen';
|
|
26
26
|
const { running } = useContext(PresenterContext);
|
|
27
27
|
|
|
28
28
|
// TODO(burdon): Currently conflates fullscreen and running.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Input, useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import { DeprecatedFormInput } from '@dxos/react-ui-form';
|
|
8
|
+
import { DeprecatedFormContainer, DeprecatedFormInput } from '@dxos/react-ui-form';
|
|
9
9
|
|
|
10
10
|
import { PRESENTER_PLUGIN } from '../meta';
|
|
11
11
|
import { type PresenterSettingsProps } from '../types';
|
|
@@ -14,13 +14,13 @@ export const PresenterSettings = ({ settings }: { settings: PresenterSettingsPro
|
|
|
14
14
|
const { t } = useTranslation(PRESENTER_PLUGIN);
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
|
-
|
|
17
|
+
<DeprecatedFormContainer>
|
|
18
18
|
<DeprecatedFormInput label={t('present collections label')}>
|
|
19
19
|
<Input.Switch
|
|
20
20
|
checked={settings.presentCollections}
|
|
21
21
|
onCheckedChange={(checked) => (settings.presentCollections = !!checked)}
|
|
22
22
|
/>
|
|
23
23
|
</DeprecatedFormInput>
|
|
24
|
-
|
|
24
|
+
</DeprecatedFormContainer>
|
|
25
25
|
);
|
|
26
26
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { type FC } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { createIntent, useLayout, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { type DocumentType } from '@dxos/plugin-markdown/types';
|
|
9
9
|
import { Main } from '@dxos/react-ui';
|
|
10
10
|
import { topbarBlockPaddingStart, fixedInsetFlexLayout, bottombarBlockPaddingEnd } from '@dxos/react-ui-theme';
|
|
@@ -13,7 +13,8 @@ import { RevealPlayer } from './Reveal';
|
|
|
13
13
|
import { PresenterAction } from '../types';
|
|
14
14
|
|
|
15
15
|
const PresenterMain: FC<{ document: DocumentType }> = ({ document }) => {
|
|
16
|
-
const
|
|
16
|
+
const layout = useLayout();
|
|
17
|
+
const fullscreen = layout.mode === 'fullscreen';
|
|
17
18
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
18
19
|
|
|
19
20
|
return (
|
package/src/index.ts
CHANGED
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export default PresenterPlugin;
|
|
8
|
-
|
|
5
|
+
export { PresenterCapabilities } from './capabilities';
|
|
9
6
|
export * from './components';
|
|
10
7
|
|
|
8
|
+
export * from './meta';
|
|
11
9
|
export * from './PresenterPlugin';
|
package/src/meta.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -4,13 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Context, createContext } from 'react';
|
|
6
6
|
|
|
7
|
-
import type {
|
|
8
|
-
GraphBuilderProvides,
|
|
9
|
-
IntentResolverProvides,
|
|
10
|
-
SettingsProvides,
|
|
11
|
-
SurfaceProvides,
|
|
12
|
-
TranslationsProvides,
|
|
13
|
-
} from '@dxos/app-framework';
|
|
14
7
|
import { S } from '@dxos/echo-schema';
|
|
15
8
|
import { DocumentType } from '@dxos/plugin-markdown/types';
|
|
16
9
|
import { CollectionType } from '@dxos/plugin-space/types';
|
|
@@ -44,12 +37,10 @@ export const PresenterContext: Context<PresenterContextType> = createContext<Pre
|
|
|
44
37
|
stop: () => {},
|
|
45
38
|
});
|
|
46
39
|
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
export const PresenterSettingsSchema = S.mutable(
|
|
41
|
+
S.Struct({
|
|
42
|
+
presentCollections: S.optional(S.Boolean),
|
|
43
|
+
}),
|
|
44
|
+
);
|
|
50
45
|
|
|
51
|
-
export type
|
|
52
|
-
IntentResolverProvides &
|
|
53
|
-
GraphBuilderProvides &
|
|
54
|
-
TranslationsProvides &
|
|
55
|
-
SettingsProvides<PresenterSettingsProps>;
|
|
46
|
+
export type PresenterSettingsProps = S.Schema.Type<typeof PresenterSettingsSchema>;
|