@dxos/plugin-presenter 0.8.2-main.f11618f → 0.8.2-staging.42af850
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-7UXPBYKA.mjs +189 -0
- package/dist/lib/browser/{CollectionPresenterContainer-5ETXRUWZ.mjs.map → CollectionPresenterContainer-7UXPBYKA.mjs.map} +1 -1
- package/dist/lib/browser/DocumentPresenterContainer-QNXYZ5WX.mjs +185 -0
- package/dist/lib/browser/{DocumentPresenterContainer-CAPKSXNP.mjs.map → DocumentPresenterContainer-QNXYZ5WX.mjs.map} +1 -1
- package/dist/lib/browser/{MarkdownSlide-5NYXG5SC.mjs → MarkdownSlide-EI5XTZGO.mjs} +77 -54
- package/dist/lib/browser/{MarkdownSlide-5NYXG5SC.mjs.map → MarkdownSlide-EI5XTZGO.mjs.map} +2 -2
- package/dist/lib/browser/{app-graph-builder-QS5KTYD3.mjs → app-graph-builder-5NILN2ZH.mjs} +14 -12
- package/dist/lib/browser/app-graph-builder-5NILN2ZH.mjs.map +7 -0
- package/dist/lib/browser/chunk-K4SDUVTH.mjs +37 -0
- package/dist/lib/browser/{chunk-VTBPPB5Z.mjs.map → chunk-K4SDUVTH.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-CQR4O6KC.mjs → chunk-Y6REDI5E.mjs} +12 -12
- package/dist/lib/browser/chunk-Y6REDI5E.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-N23VEZ2O.mjs → react-surface-6AJLL4EM.mjs} +2 -2
- package/dist/lib/browser/{settings-KWSP73SU.mjs → settings-JBNMCJHB.mjs} +2 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -179
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -177
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Container.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Slide.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Layout.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Pager.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/testing.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +17 -185
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/useExitPresenter.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -26
- package/src/capabilities/app-graph-builder.ts +61 -50
- package/src/components/Markdown/theme.ts +1 -1
- package/src/types.ts +10 -10
- package/dist/lib/browser/CollectionPresenterContainer-5ETXRUWZ.mjs +0 -166
- package/dist/lib/browser/DocumentPresenterContainer-CAPKSXNP.mjs +0 -173
- package/dist/lib/browser/app-graph-builder-QS5KTYD3.mjs.map +0 -7
- package/dist/lib/browser/chunk-CQR4O6KC.mjs.map +0 -7
- package/dist/lib/browser/chunk-VTBPPB5Z.mjs +0 -31
- /package/dist/lib/browser/{react-surface-N23VEZ2O.mjs.map → react-surface-6AJLL4EM.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-KWSP73SU.mjs.map → settings-JBNMCJHB.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,OAAO,CAAC;AAGpD,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,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useExitPresenter.d.ts","sourceRoot":"","sources":["../../../src/useExitPresenter.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAK9C,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"useExitPresenter.d.ts","sourceRoot":"","sources":["../../../src/useExitPresenter.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAK9C,eAAO,MAAM,gBAAgB,GAAI,QAAQ,IAAI,CAAC,GAAG,CAAC;;;EAsBjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.
|
|
1
|
+
{"version":"5.8.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-presenter",
|
|
3
|
-
"version": "0.8.2-
|
|
3
|
+
"version": "0.8.2-staging.42af850",
|
|
4
4
|
"description": "Braneframe presenter plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"src"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@preact/
|
|
26
|
+
"@preact-signals/safe-react": "^0.9.0",
|
|
27
|
+
"@preact/signals-core": "^1.9.0",
|
|
27
28
|
"hastscript": "^7.1.0",
|
|
28
29
|
"highlight.js": "^11.9.0",
|
|
29
30
|
"marked": "^12.0.2",
|
|
@@ -34,44 +35,48 @@
|
|
|
34
35
|
"remark-frontmatter": "^5.0.0",
|
|
35
36
|
"remark-parse-frontmatter": "^1.0.3",
|
|
36
37
|
"reveal.js": "^5.1.0",
|
|
37
|
-
"@dxos/app-framework": "0.8.2-
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/live-object": "0.8.2-
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/plugin-
|
|
45
|
-
"@dxos/plugin-deck": "0.8.2-
|
|
46
|
-
"@dxos/plugin-
|
|
47
|
-
"@dxos/plugin-
|
|
48
|
-
"@dxos/plugin-
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/react-
|
|
51
|
-
"@dxos/react-ui-form": "0.8.2-
|
|
38
|
+
"@dxos/app-framework": "0.8.2-staging.42af850",
|
|
39
|
+
"@dxos/async": "0.8.2-staging.42af850",
|
|
40
|
+
"@dxos/echo": "0.8.2-staging.42af850",
|
|
41
|
+
"@dxos/live-object": "0.8.2-staging.42af850",
|
|
42
|
+
"@dxos/local-storage": "0.8.2-staging.42af850",
|
|
43
|
+
"@dxos/echo-schema": "0.8.2-staging.42af850",
|
|
44
|
+
"@dxos/log": "0.8.2-staging.42af850",
|
|
45
|
+
"@dxos/plugin-client": "0.8.2-staging.42af850",
|
|
46
|
+
"@dxos/plugin-deck": "0.8.2-staging.42af850",
|
|
47
|
+
"@dxos/plugin-graph": "0.8.2-staging.42af850",
|
|
48
|
+
"@dxos/plugin-stack": "0.8.2-staging.42af850",
|
|
49
|
+
"@dxos/plugin-markdown": "0.8.2-staging.42af850",
|
|
50
|
+
"@dxos/plugin-space": "0.8.2-staging.42af850",
|
|
51
|
+
"@dxos/react-client": "0.8.2-staging.42af850",
|
|
52
|
+
"@dxos/react-ui-form": "0.8.2-staging.42af850",
|
|
53
|
+
"@dxos/react-ui-stack": "0.8.2-staging.42af850"
|
|
52
54
|
},
|
|
53
55
|
"devDependencies": {
|
|
56
|
+
"@effect-rx/rx-react": "^0.34.1",
|
|
57
|
+
"@effect/platform": "0.80.12",
|
|
54
58
|
"@phosphor-icons/react": "^2.1.5",
|
|
55
|
-
"@types/lodash.get": "^4.4.7",
|
|
56
59
|
"@types/react": "~18.2.0",
|
|
57
60
|
"@types/react-dom": "~18.2.0",
|
|
58
61
|
"@types/reveal.js": "^5.0.3",
|
|
59
|
-
"effect": "3.
|
|
62
|
+
"effect": "3.14.21",
|
|
60
63
|
"react": "~18.2.0",
|
|
61
64
|
"react-dom": "~18.2.0",
|
|
62
65
|
"vite": "5.4.7",
|
|
63
|
-
"@dxos/random": "0.8.2-
|
|
64
|
-
"@dxos/react-ui": "0.8.2-
|
|
65
|
-
"@dxos/react-ui-theme": "0.8.2-
|
|
66
|
-
"@dxos/storybook-utils": "0.8.2-
|
|
66
|
+
"@dxos/random": "0.8.2-staging.42af850",
|
|
67
|
+
"@dxos/react-ui": "0.8.2-staging.42af850",
|
|
68
|
+
"@dxos/react-ui-theme": "0.8.2-staging.42af850",
|
|
69
|
+
"@dxos/storybook-utils": "0.8.2-staging.42af850"
|
|
67
70
|
},
|
|
68
71
|
"peerDependencies": {
|
|
72
|
+
"@effect-rx/rx-react": "^0.34.1",
|
|
73
|
+
"@effect/platform": "0.80.12",
|
|
69
74
|
"@phosphor-icons/react": "^2.1.5",
|
|
70
|
-
"effect": "3.13.3",
|
|
75
|
+
"effect": "^3.13.3",
|
|
71
76
|
"react": "~18.2.0",
|
|
72
77
|
"react-dom": "~18.2.0",
|
|
73
|
-
"@dxos/react-ui": "0.8.2-
|
|
74
|
-
"@dxos/react-ui-theme": "0.8.2-
|
|
78
|
+
"@dxos/react-ui": "0.8.2-staging.42af850",
|
|
79
|
+
"@dxos/react-ui-theme": "0.8.2-staging.42af850"
|
|
75
80
|
},
|
|
76
81
|
"publishConfig": {
|
|
77
82
|
"access": "public"
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
+
import { Option, pipe } from 'effect';
|
|
7
|
+
|
|
8
|
+
import { contributes, type PluginContext, Capabilities, createIntent, LayoutAction } from '@dxos/app-framework';
|
|
6
9
|
import { isInstanceOf } from '@dxos/echo-schema';
|
|
7
10
|
import { DeckCapabilities } from '@dxos/plugin-deck';
|
|
8
11
|
import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
|
|
9
|
-
import { createExtension,
|
|
12
|
+
import { createExtension, rxFromSignal } from '@dxos/plugin-graph';
|
|
10
13
|
import { DocumentType } from '@dxos/plugin-markdown/types';
|
|
11
14
|
import { CollectionType } from '@dxos/plugin-space/types';
|
|
12
15
|
import { fullyQualifiedId, getSpace } from '@dxos/react-client/echo';
|
|
@@ -14,58 +17,66 @@ import { fullyQualifiedId, getSpace } from '@dxos/react-client/echo';
|
|
|
14
17
|
import { PRESENTER_PLUGIN } from '../meta';
|
|
15
18
|
import { PresenterAction, type PresenterSettingsProps } from '../types';
|
|
16
19
|
|
|
17
|
-
export default (context:
|
|
20
|
+
export default (context: PluginContext) =>
|
|
18
21
|
contributes(
|
|
19
22
|
Capabilities.AppGraphBuilder,
|
|
20
23
|
createExtension({
|
|
21
24
|
id: PRESENTER_PLUGIN,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
actions: ({ node }) => {
|
|
31
|
-
const object = node.data;
|
|
32
|
-
const id = fullyQualifiedId(object);
|
|
33
|
-
const spaceId = getSpace(object)?.id;
|
|
34
|
-
return [
|
|
35
|
-
{
|
|
36
|
-
id: `${PresenterAction.TogglePresentation._tag}/${id}`,
|
|
37
|
-
// TODO(burdon): Allow function so can generate state when activated.
|
|
38
|
-
// So can set explicit fullscreen state coordinated with current presenter state.
|
|
39
|
-
data: async () => {
|
|
40
|
-
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
41
|
-
const layout = context.requestCapability(DeckCapabilities.MutableDeckState);
|
|
42
|
-
const presenterId = [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR);
|
|
43
|
-
if (!layout.deck.fullscreen) {
|
|
44
|
-
void dispatch(
|
|
45
|
-
createIntent(DeckAction.Adjust, {
|
|
46
|
-
type: 'solo--fullscreen',
|
|
47
|
-
id: presenterId,
|
|
48
|
-
}),
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
await dispatch(
|
|
52
|
-
createIntent(LayoutAction.Open, {
|
|
53
|
-
part: 'main',
|
|
54
|
-
subject: [presenterId],
|
|
55
|
-
options: { workspace: spaceId },
|
|
56
|
-
}),
|
|
25
|
+
actions: (node) =>
|
|
26
|
+
Rx.make((get) =>
|
|
27
|
+
pipe(
|
|
28
|
+
get(node),
|
|
29
|
+
Option.flatMap((node) => {
|
|
30
|
+
const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
|
|
31
|
+
const settings = get(
|
|
32
|
+
rxFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(PRESENTER_PLUGIN)?.value),
|
|
57
33
|
);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
34
|
+
const isPresentable = settings?.presentCollections
|
|
35
|
+
? isInstanceOf(CollectionType, node.data) || isInstanceOf(DocumentType, node.data)
|
|
36
|
+
: isInstanceOf(DocumentType, node.data);
|
|
37
|
+
return isPresentable ? Option.some(node.data) : Option.none();
|
|
38
|
+
}),
|
|
39
|
+
Option.map((object) => {
|
|
40
|
+
const id = fullyQualifiedId(object);
|
|
41
|
+
const spaceId = getSpace(object)?.id;
|
|
42
|
+
return [
|
|
43
|
+
{
|
|
44
|
+
id: `${PresenterAction.TogglePresentation._tag}/${id}`,
|
|
45
|
+
// TODO(burdon): Allow function so can generate state when activated.
|
|
46
|
+
// So can set explicit fullscreen state coordinated with current presenter state.
|
|
47
|
+
data: async () => {
|
|
48
|
+
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
49
|
+
const layout = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
50
|
+
const presenterId = [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR);
|
|
51
|
+
if (!layout.deck.fullscreen) {
|
|
52
|
+
void dispatch(
|
|
53
|
+
createIntent(DeckAction.Adjust, {
|
|
54
|
+
type: 'solo--fullscreen',
|
|
55
|
+
id: presenterId,
|
|
56
|
+
}),
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
await dispatch(
|
|
60
|
+
createIntent(LayoutAction.Open, {
|
|
61
|
+
part: 'main',
|
|
62
|
+
subject: [presenterId],
|
|
63
|
+
options: { workspace: spaceId },
|
|
64
|
+
}),
|
|
65
|
+
);
|
|
66
|
+
},
|
|
67
|
+
properties: {
|
|
68
|
+
label: ['toggle presentation label', { ns: PRESENTER_PLUGIN }],
|
|
69
|
+
icon: 'ph--presentation--regular',
|
|
70
|
+
keyBinding: {
|
|
71
|
+
macos: 'shift+meta+p',
|
|
72
|
+
windows: 'shift+alt+p',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
}),
|
|
78
|
+
Option.getOrElse(() => []),
|
|
79
|
+
),
|
|
80
|
+
),
|
|
70
81
|
}),
|
|
71
82
|
);
|
|
@@ -20,7 +20,7 @@ export const theme = {
|
|
|
20
20
|
ol: 'my-[16px] ml-24 leading-relaxed list-decimal',
|
|
21
21
|
li: 'pl-6 text-[48px]',
|
|
22
22
|
|
|
23
|
-
pre: 'w-full mx-0 my-[32px] p-0 __border-l-[16px] bg-
|
|
23
|
+
pre: 'w-full mx-0 my-[32px] p-0 __border-l-[16px] bg-inputSurface p-4 __whitespace-pre-line',
|
|
24
24
|
code: 'p-0 text-[40px]',
|
|
25
25
|
},
|
|
26
26
|
};
|
package/src/types.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Schema } from 'effect';
|
|
5
6
|
import { type Context, createContext } from 'react';
|
|
6
7
|
|
|
7
|
-
import { S } from '@dxos/echo-schema';
|
|
8
8
|
import { DocumentType } from '@dxos/plugin-markdown/types';
|
|
9
9
|
import { CollectionType } from '@dxos/plugin-space/types';
|
|
10
10
|
|
|
@@ -13,14 +13,14 @@ import { PRESENTER_PLUGIN } from './meta';
|
|
|
13
13
|
export namespace PresenterAction {
|
|
14
14
|
const PRESENTER_ACTION = `${PRESENTER_PLUGIN}/action`;
|
|
15
15
|
|
|
16
|
-
export class TogglePresentation extends
|
|
16
|
+
export class TogglePresentation extends Schema.TaggedClass<TogglePresentation>()(
|
|
17
17
|
`${PRESENTER_ACTION}/toggle-presentation`,
|
|
18
18
|
{
|
|
19
|
-
input:
|
|
20
|
-
object:
|
|
21
|
-
state:
|
|
19
|
+
input: Schema.Struct({
|
|
20
|
+
object: Schema.Union(DocumentType, CollectionType),
|
|
21
|
+
state: Schema.optional(Schema.Boolean),
|
|
22
22
|
}),
|
|
23
|
-
output:
|
|
23
|
+
output: Schema.Void,
|
|
24
24
|
},
|
|
25
25
|
) {}
|
|
26
26
|
}
|
|
@@ -37,10 +37,10 @@ export const PresenterContext: Context<PresenterContextType> = createContext<Pre
|
|
|
37
37
|
stop: () => {},
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
export const PresenterSettingsSchema =
|
|
41
|
-
|
|
42
|
-
presentCollections:
|
|
40
|
+
export const PresenterSettingsSchema = Schema.mutable(
|
|
41
|
+
Schema.Struct({
|
|
42
|
+
presentCollections: Schema.optional(Schema.Boolean),
|
|
43
43
|
}),
|
|
44
44
|
);
|
|
45
45
|
|
|
46
|
-
export type PresenterSettingsProps =
|
|
46
|
+
export type PresenterSettingsProps = Schema.Schema.Type<typeof PresenterSettingsSchema>;
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useExitPresenter
|
|
3
|
-
} from "./chunk-2RWWAQZK.mjs";
|
|
4
|
-
import {
|
|
5
|
-
PresenterContext
|
|
6
|
-
} from "./chunk-CQR4O6KC.mjs";
|
|
7
|
-
import "./chunk-S2S5RFJ4.mjs";
|
|
8
|
-
|
|
9
|
-
// packages/plugins/plugin-presenter/src/components/CollectionPresenterContainer.tsx
|
|
10
|
-
import React3, { useContext, useState } from "react";
|
|
11
|
-
import { Surface } from "@dxos/app-framework";
|
|
12
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
13
|
-
|
|
14
|
-
// packages/plugins/plugin-presenter/src/components/Presenter/Layout.tsx
|
|
15
|
-
import React from "react";
|
|
16
|
-
import { mx } from "@dxos/react-ui-theme";
|
|
17
|
-
var Layout = ({ children, classNames, topLeft, topRight, bottomLeft, bottomRight }) => {
|
|
18
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
19
|
-
className: mx("flex grow relative overflow-hidden bg-attention", classNames)
|
|
20
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
21
|
-
className: mx("flex flex-col grow overflow-hidden")
|
|
22
|
-
}, children), /* @__PURE__ */ React.createElement("div", {
|
|
23
|
-
className: "z-[200]"
|
|
24
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
25
|
-
className: "absolute top-4 left-4"
|
|
26
|
-
}, topLeft), /* @__PURE__ */ React.createElement("div", {
|
|
27
|
-
className: "absolute top-4 right-4"
|
|
28
|
-
}, topRight), /* @__PURE__ */ React.createElement("div", {
|
|
29
|
-
className: "absolute bottom-4 left-4"
|
|
30
|
-
}, bottomLeft), /* @__PURE__ */ React.createElement("div", {
|
|
31
|
-
className: "absolute bottom-4 right-4"
|
|
32
|
-
}, bottomRight)));
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// packages/plugins/plugin-presenter/src/components/Presenter/Pager.tsx
|
|
36
|
-
import { Play, X, CaretDoubleLeft, CaretDoubleRight, CaretLeft, CaretRight } from "@phosphor-icons/react";
|
|
37
|
-
import React2, { useEffect } from "react";
|
|
38
|
-
import { Button, useControlledState } from "@dxos/react-ui";
|
|
39
|
-
import { getSize, mx as mx2 } from "@dxos/react-ui-theme";
|
|
40
|
-
var Pager = ({ index: controlledIndex = 0, count = 0, keys, onChange, onExit }) => {
|
|
41
|
-
const [index, setIndex] = useControlledState(controlledIndex);
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
onChange?.(index);
|
|
44
|
-
}, [
|
|
45
|
-
index
|
|
46
|
-
]);
|
|
47
|
-
const handleChangeIndex = (dir) => {
|
|
48
|
-
setIndex((index2) => {
|
|
49
|
-
const next = index2 + dir;
|
|
50
|
-
return next >= 0 && next < count ? next : index2;
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
if (!keys) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
const keydownHandler = (event) => {
|
|
58
|
-
switch (event.key) {
|
|
59
|
-
case "Escape": {
|
|
60
|
-
onExit?.();
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
case "ArrowLeft": {
|
|
64
|
-
if (event.shiftKey) {
|
|
65
|
-
onChange?.(0);
|
|
66
|
-
} else {
|
|
67
|
-
handleChangeIndex(-1);
|
|
68
|
-
}
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
case "ArrowRight": {
|
|
72
|
-
if (event.shiftKey) {
|
|
73
|
-
onChange?.(count - 1);
|
|
74
|
-
} else {
|
|
75
|
-
handleChangeIndex(1);
|
|
76
|
-
}
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
case "ArrowUp": {
|
|
80
|
-
onChange?.(0);
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
case "ArrowDown": {
|
|
84
|
-
onChange?.(count - 1);
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
window.addEventListener("keydown", keydownHandler);
|
|
90
|
-
return () => window.removeEventListener("keydown", keydownHandler);
|
|
91
|
-
}, [
|
|
92
|
-
keys,
|
|
93
|
-
count
|
|
94
|
-
]);
|
|
95
|
-
if (index === void 0 || !count) {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
99
|
-
className: "flex items-center text-neutral-500"
|
|
100
|
-
}, /* @__PURE__ */ React2.createElement(Button, {
|
|
101
|
-
variant: "ghost",
|
|
102
|
-
classNames: "p-0",
|
|
103
|
-
onClick: () => onChange?.(0)
|
|
104
|
-
}, /* @__PURE__ */ React2.createElement(CaretDoubleLeft, {
|
|
105
|
-
className: mx2(getSize(6))
|
|
106
|
-
})), /* @__PURE__ */ React2.createElement(Button, {
|
|
107
|
-
variant: "ghost",
|
|
108
|
-
classNames: "p-0",
|
|
109
|
-
onClick: () => handleChangeIndex(-1)
|
|
110
|
-
}, /* @__PURE__ */ React2.createElement(CaretLeft, {
|
|
111
|
-
className: mx2(getSize(6))
|
|
112
|
-
})), /* @__PURE__ */ React2.createElement(Button, {
|
|
113
|
-
variant: "ghost",
|
|
114
|
-
classNames: "p-0",
|
|
115
|
-
onClick: () => handleChangeIndex(1)
|
|
116
|
-
}, /* @__PURE__ */ React2.createElement(CaretRight, {
|
|
117
|
-
className: mx2(getSize(6))
|
|
118
|
-
})), /* @__PURE__ */ React2.createElement(Button, {
|
|
119
|
-
variant: "ghost",
|
|
120
|
-
classNames: "p-0",
|
|
121
|
-
onClick: () => onChange?.(count - 1)
|
|
122
|
-
}, /* @__PURE__ */ React2.createElement(CaretDoubleRight, {
|
|
123
|
-
className: mx2(getSize(6))
|
|
124
|
-
})));
|
|
125
|
-
};
|
|
126
|
-
var PageNumber = ({ index = 0, count = 1 }) => {
|
|
127
|
-
if (index === void 0 || !count) {
|
|
128
|
-
return null;
|
|
129
|
-
}
|
|
130
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
131
|
-
className: "flex items-center text-neutral-500 text-2xl"
|
|
132
|
-
}, /* @__PURE__ */ React2.createElement("div", null, index + 1, " / ", count));
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
// packages/plugins/plugin-presenter/src/components/CollectionPresenterContainer.tsx
|
|
136
|
-
var CollectionPresenterContainer = ({ collection }) => {
|
|
137
|
-
const [slide, setSlide] = useState(0);
|
|
138
|
-
const { running } = useContext(PresenterContext);
|
|
139
|
-
const handleExit = useExitPresenter(collection);
|
|
140
|
-
return /* @__PURE__ */ React3.createElement(StackItem.Content, {
|
|
141
|
-
classNames: "relative"
|
|
142
|
-
}, /* @__PURE__ */ React3.createElement(Layout, {
|
|
143
|
-
bottomRight: /* @__PURE__ */ React3.createElement(PageNumber, {
|
|
144
|
-
index: slide,
|
|
145
|
-
count: collection.objects.length
|
|
146
|
-
}),
|
|
147
|
-
bottomLeft: /* @__PURE__ */ React3.createElement(Pager, {
|
|
148
|
-
index: slide,
|
|
149
|
-
count: collection.objects.length,
|
|
150
|
-
keys: running,
|
|
151
|
-
onChange: setSlide,
|
|
152
|
-
onExit: handleExit
|
|
153
|
-
})
|
|
154
|
-
}, /* @__PURE__ */ React3.createElement(Surface, {
|
|
155
|
-
role: "slide",
|
|
156
|
-
data: {
|
|
157
|
-
subject: collection.objects[slide]
|
|
158
|
-
},
|
|
159
|
-
placeholder: /* @__PURE__ */ React3.createElement(React3.Fragment, null)
|
|
160
|
-
})));
|
|
161
|
-
};
|
|
162
|
-
var CollectionPresenterContainer_default = CollectionPresenterContainer;
|
|
163
|
-
export {
|
|
164
|
-
CollectionPresenterContainer_default as default
|
|
165
|
-
};
|
|
166
|
-
//# sourceMappingURL=CollectionPresenterContainer-5ETXRUWZ.mjs.map
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useExitPresenter
|
|
3
|
-
} from "./chunk-2RWWAQZK.mjs";
|
|
4
|
-
|
|
5
|
-
// packages/plugins/plugin-presenter/src/components/DocumentPresenterContainer.tsx
|
|
6
|
-
import React2 from "react";
|
|
7
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
8
|
-
|
|
9
|
-
// packages/plugins/plugin-presenter/src/components/RevealPlayer/RevealPlayer.tsx
|
|
10
|
-
import "reveal.js/dist/reveal.css";
|
|
11
|
-
import "reveal.js/dist/theme/black.css";
|
|
12
|
-
import "highlight.js/styles/tokyo-night-dark.css";
|
|
13
|
-
import hljs from "highlight.js";
|
|
14
|
-
import typescript from "highlight.js/lib/languages/typescript";
|
|
15
|
-
import React, { useEffect, useRef } from "react";
|
|
16
|
-
import Reveal from "reveal.js";
|
|
17
|
-
import RevealHighlight from "reveal.js/plugin/highlight/highlight";
|
|
18
|
-
import RevealMarkdown from "reveal.js/plugin/markdown/plugin.js";
|
|
19
|
-
import { mx } from "@dxos/react-ui-theme";
|
|
20
|
-
var styles = `
|
|
21
|
-
<style type="text/css">
|
|
22
|
-
.reveal h1 {
|
|
23
|
-
font-weight: 100;
|
|
24
|
-
font-size: 60px;
|
|
25
|
-
opacity: 0.5;
|
|
26
|
-
}
|
|
27
|
-
.reveal h2 {
|
|
28
|
-
font-weight: 100;
|
|
29
|
-
padding-top: 60px;
|
|
30
|
-
padding-left: 40px;
|
|
31
|
-
font-size: 48px;
|
|
32
|
-
opacity: 0.3;
|
|
33
|
-
}
|
|
34
|
-
.reveal h1, h2, p {
|
|
35
|
-
font-family: "Raleway", sans-serif;
|
|
36
|
-
text-align: left;
|
|
37
|
-
font-weight: 200;
|
|
38
|
-
}
|
|
39
|
-
.reveal ul {
|
|
40
|
-
font-family: "Raleway", sans-serif;
|
|
41
|
-
display: block;
|
|
42
|
-
list-style: "- ";
|
|
43
|
-
}
|
|
44
|
-
.reveal blockquote p {
|
|
45
|
-
text-align: center;
|
|
46
|
-
font-weight: 100;
|
|
47
|
-
padding: 32px;
|
|
48
|
-
}
|
|
49
|
-
.reveal pre {
|
|
50
|
-
margin-left: 0;
|
|
51
|
-
}
|
|
52
|
-
.reveal code {
|
|
53
|
-
font-size: 20px;
|
|
54
|
-
background: #111111;
|
|
55
|
-
color: #eeeeee;
|
|
56
|
-
max-height: unset !important;
|
|
57
|
-
}
|
|
58
|
-
</style>
|
|
59
|
-
`;
|
|
60
|
-
var RevealPlayer = ({ classNames, content, slide, fullscreen = true, onExit }) => {
|
|
61
|
-
const deckDivRef = useRef(null);
|
|
62
|
-
const deckRef = useRef(null);
|
|
63
|
-
useEffect(() => {
|
|
64
|
-
if (deckRef.current) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
hljs.registerLanguage("typescript", typescript);
|
|
68
|
-
const t = setTimeout(async () => {
|
|
69
|
-
deckRef.current = new Reveal(deckDivRef.current, {
|
|
70
|
-
// view: 'scroll',
|
|
71
|
-
progress: false,
|
|
72
|
-
transition: "none",
|
|
73
|
-
slideNumber: false,
|
|
74
|
-
embedded: true,
|
|
75
|
-
// TODO(burdon): Speaker view requires server to serve popout window.
|
|
76
|
-
// https://revealjs.com/speaker-view
|
|
77
|
-
showNotes: false,
|
|
78
|
-
// width: 1600,
|
|
79
|
-
// height: 900,
|
|
80
|
-
margin: 0.1,
|
|
81
|
-
// center: false,
|
|
82
|
-
// minScale: 0.1,
|
|
83
|
-
// maxScale: 1.4,
|
|
84
|
-
// https://revealjs.com/markdown
|
|
85
|
-
// TODO(burdon): Requires server to serve popout window.
|
|
86
|
-
plugins: [
|
|
87
|
-
RevealMarkdown,
|
|
88
|
-
RevealHighlight
|
|
89
|
-
],
|
|
90
|
-
// See https://marked.js.org/using_advanced#options
|
|
91
|
-
markdown: {
|
|
92
|
-
gfm: true,
|
|
93
|
-
smartypants: true,
|
|
94
|
-
highlight: (code, language) => {
|
|
95
|
-
if (language) {
|
|
96
|
-
return hljs.highlight(code, {
|
|
97
|
-
language
|
|
98
|
-
}).value;
|
|
99
|
-
}
|
|
100
|
-
return hljs.highlightAuto(code).value;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
await deckRef.current.initialize();
|
|
105
|
-
if (slide !== void 0) {
|
|
106
|
-
deckRef.current.slide(slide < 0 ? deckRef.current?.getTotalSlides() + slide : slide - 1);
|
|
107
|
-
}
|
|
108
|
-
deckRef.current.addKeyBinding({
|
|
109
|
-
keyCode: 27,
|
|
110
|
-
key: "Escape",
|
|
111
|
-
description: "Exit full screen"
|
|
112
|
-
}, () => {
|
|
113
|
-
onExit?.();
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
return () => {
|
|
117
|
-
try {
|
|
118
|
-
clearTimeout(t);
|
|
119
|
-
if (deckRef.current) {
|
|
120
|
-
deckRef.current.destroy();
|
|
121
|
-
deckRef.current = null;
|
|
122
|
-
}
|
|
123
|
-
} catch (err) {
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
});
|
|
127
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
128
|
-
className: mx("absolute flex h-full w-full items-center justify-center", fullscreen && "inset-0", classNames)
|
|
129
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
130
|
-
className: "relative aspect-video w-full"
|
|
131
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
132
|
-
ref: deckDivRef,
|
|
133
|
-
className: "reveal"
|
|
134
|
-
}, /* @__PURE__ */ React.createElement("style", null, /* @__PURE__ */ React.createElement("link", {
|
|
135
|
-
rel: "preconnect",
|
|
136
|
-
href: "https://fonts.googleapis.com"
|
|
137
|
-
}), /* @__PURE__ */ React.createElement("link", {
|
|
138
|
-
rel: "preconnect",
|
|
139
|
-
href: "https://fonts.gstatic.com",
|
|
140
|
-
crossOrigin: ""
|
|
141
|
-
}), /* @__PURE__ */ React.createElement("link", {
|
|
142
|
-
rel: "stylesheet",
|
|
143
|
-
href: "https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap"
|
|
144
|
-
})), /* @__PURE__ */ React.createElement("div", {
|
|
145
|
-
className: "slides"
|
|
146
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
147
|
-
className: "!text-center"
|
|
148
|
-
}), /* @__PURE__ */ React.createElement("section", {
|
|
149
|
-
"data-markdown": []
|
|
150
|
-
}, /* @__PURE__ */ React.createElement("textarea", {
|
|
151
|
-
"data-template": true,
|
|
152
|
-
defaultValue: [
|
|
153
|
-
styles,
|
|
154
|
-
content
|
|
155
|
-
].join("\n")
|
|
156
|
-
}))))));
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
// packages/plugins/plugin-presenter/src/components/DocumentPresenterContainer.tsx
|
|
160
|
-
var DocumentPresenterContainer = ({ document }) => {
|
|
161
|
-
const handleExit = useExitPresenter(document);
|
|
162
|
-
return /* @__PURE__ */ React2.createElement(StackItem.Content, {
|
|
163
|
-
classNames: "relative"
|
|
164
|
-
}, /* @__PURE__ */ React2.createElement(RevealPlayer, {
|
|
165
|
-
content: document.content.target?.content ?? "",
|
|
166
|
-
onExit: handleExit
|
|
167
|
-
}));
|
|
168
|
-
};
|
|
169
|
-
var DocumentPresenterContainer_default = DocumentPresenterContainer;
|
|
170
|
-
export {
|
|
171
|
-
DocumentPresenterContainer_default as default
|
|
172
|
-
};
|
|
173
|
-
//# sourceMappingURL=DocumentPresenterContainer-CAPKSXNP.mjs.map
|
|
@@ -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 { contributes, type PluginsContext, Capabilities, createIntent, LayoutAction } from '@dxos/app-framework';\nimport { isInstanceOf } from '@dxos/echo-schema';\nimport { DeckCapabilities } from '@dxos/plugin-deck';\nimport { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { CollectionType } from '@dxos/plugin-space/types';\nimport { fullyQualifiedId, getSpace } from '@dxos/react-client/echo';\n\nimport { PRESENTER_PLUGIN } from '../meta';\nimport { PresenterAction, type PresenterSettingsProps } from '../types';\n\nexport default (context: PluginsContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: PRESENTER_PLUGIN,\n filter: (node): node is Node<CollectionType | DocumentType> => {\n const settings = context\n .requestCapabilities(Capabilities.SettingsStore)[0]\n ?.getStore<PresenterSettingsProps>(PRESENTER_PLUGIN)?.value;\n return settings?.presentCollections\n ? isInstanceOf(CollectionType, node.data) || isInstanceOf(DocumentType, node.data)\n : isInstanceOf(DocumentType, node.data);\n },\n actions: ({ node }) => {\n const object = node.data;\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.requestCapability(Capabilities.IntentDispatcher);\n const layout = context.requestCapability(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 }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,SAASA,aAAkCC,cAAcC,cAAcC,oBAAoB;AAC3F,SAASC,oBAAoB;AAC7B,SAASC,wBAAwB;AACjC,SAASC,2BAA2BC,kBAAkB;AACtD,SAASC,uBAAkC;AAC3C,SAASC,oBAAoB;AAC7B,SAASC,sBAAsB;AAC/B,SAASC,kBAAkBC,gBAAgB;AAK3C,IAAA,4BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;EACdC,IAAIC;EACJC,QAAQ,CAACC,SAAAA;AACP,UAAMC,WAAWT,QACdU,oBAAoBR,aAAaS,aAAa,EAAE,CAAA,GAC/CC,SAAiCN,gBAAAA,GAAmBO;AACxD,WAAOJ,UAAUK,qBACbC,aAAaC,gBAAgBR,KAAKS,IAAI,KAAKF,aAAaG,cAAcV,KAAKS,IAAI,IAC/EF,aAAaG,cAAcV,KAAKS,IAAI;EAC1C;EACAE,SAAS,CAAC,EAAEX,KAAI,MAAE;AAChB,UAAMY,SAASZ,KAAKS;AACpB,UAAMZ,KAAKgB,iBAAiBD,MAAAA;AAC5B,UAAME,UAAUC,SAASH,MAAAA,GAASf;AAClC,WAAO;MACL;QACEA,IAAI,GAAGmB,gBAAgBC,mBAAmBC,IAAI,IAAIrB,EAAAA;;;QAGlDY,MAAM,YAAA;AACJ,gBAAM,EAAEU,iBAAiBC,SAAQ,IAAK5B,QAAQ6B,kBAAkB3B,aAAa4B,gBAAgB;AAC7F,gBAAMC,SAAS/B,QAAQ6B,kBAAkBG,iBAAiBC,gBAAgB;AAC1E,gBAAMC,cAAc;YAAC7B;YAAI;YAAa8B,KAAKC,yBAAAA;AAC3C,cAAI,CAACL,OAAOM,KAAKC,YAAY;AAC3B,iBAAKV,SACHW,aAAaC,WAAWC,QAAQ;cAC9BC,MAAM;cACNrC,IAAI6B;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,IAAI7C;YAAiB;;UAC5D8C,MAAM;UACNC,YAAY;YACVC,OAAO;YACPC,SAAS;UACX;QACF;MACF;;EAEJ;AACF,CAAA,CAAA;",
|
|
6
|
-
"names": ["contributes", "Capabilities", "createIntent", "LayoutAction", "isInstanceOf", "DeckCapabilities", "ATTENDABLE_PATH_SEPARATOR", "DeckAction", "createExtension", "DocumentType", "CollectionType", "fullyQualifiedId", "getSpace", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "PRESENTER_PLUGIN", "filter", "node", "settings", "requestCapabilities", "SettingsStore", "getStore", "value", "presentCollections", "isInstanceOf", "CollectionType", "data", "DocumentType", "actions", "object", "fullyQualifiedId", "spaceId", "getSpace", "PresenterAction", "TogglePresentation", "_tag", "dispatchPromise", "dispatch", "requestCapability", "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"]
|
|
7
|
-
}
|