@dxos/plugin-presenter 0.8.4-main.406dc2a → 0.8.4-main.52d7546f51
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-WE7HOMFY.mjs +176 -0
- package/dist/lib/browser/CollectionPresenterContainer-WE7HOMFY.mjs.map +7 -0
- package/dist/lib/browser/DocumentPresenterContainer-3BU2DS5E.mjs +173 -0
- package/dist/lib/browser/DocumentPresenterContainer-3BU2DS5E.mjs.map +7 -0
- package/dist/lib/browser/{MarkdownSlide-BLVWTH3U.mjs → MarkdownSlide-GIYJABHE.mjs} +56 -79
- package/dist/lib/browser/MarkdownSlide-GIYJABHE.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-OH6QU3DC.mjs +113 -0
- package/dist/lib/browser/app-graph-builder-OH6QU3DC.mjs.map +7 -0
- package/dist/lib/browser/chunk-46CHA6Y5.mjs +41 -0
- package/dist/lib/browser/chunk-46CHA6Y5.mjs.map +7 -0
- package/dist/lib/browser/chunk-4PZXJXBO.mjs +50 -0
- package/dist/lib/browser/chunk-4PZXJXBO.mjs.map +7 -0
- package/dist/lib/browser/chunk-L7QYO6LF.mjs +38 -0
- package/dist/lib/browser/chunk-L7QYO6LF.mjs.map +7 -0
- package/dist/lib/browser/chunk-VQVZVXPJ.mjs +18 -0
- package/dist/lib/browser/chunk-VQVZVXPJ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +24 -30
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-P7YJFHF3.mjs → react-surface-QY4ETW6S.mjs} +27 -20
- package/dist/lib/browser/react-surface-QY4ETW6S.mjs.map +7 -0
- package/dist/lib/browser/settings-OLQ7QNLC.mjs +32 -0
- package/dist/lib/browser/settings-OLQ7QNLC.mjs.map +7 -0
- package/dist/types/src/PresenterPlugin.d.ts +2 -1
- package/dist/types/src/PresenterPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +3 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +7 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +10 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/components/CollectionPresenterContainer.d.ts +5 -5
- package/dist/types/src/components/CollectionPresenterContainer.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownSlide.d.ts +4 -3
- package/dist/types/src/components/MarkdownSlide.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Pager.d.ts +1 -1
- package/dist/types/src/components/Presenter/Pager.d.ts.map +1 -1
- package/dist/types/src/components/PresenterSettings.d.ts +4 -2
- package/dist/types/src/components/PresenterSettings.d.ts.map +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +20 -19
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +35 -26
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/useExitPresenter.d.ts +2 -3
- package/dist/types/src/useExitPresenter.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +46 -38
- package/src/PresenterPlugin.tsx +9 -23
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +106 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/index.ts +3 -5
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +71 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +31 -0
- package/src/components/CollectionPresenterContainer.tsx +14 -14
- package/src/components/DocumentPresenterContainer.tsx +3 -3
- package/src/components/Markdown/Container.stories.tsx +1 -1
- package/src/components/Markdown/Container.tsx +2 -2
- package/src/components/Markdown/Slide.stories.tsx +1 -1
- package/src/components/Markdown/theme.ts +2 -2
- package/src/components/MarkdownSlide.tsx +6 -2
- package/src/components/Presenter/Layout.tsx +1 -1
- package/src/components/Presenter/Pager.stories.tsx +1 -1
- package/src/components/Presenter/Pager.tsx +53 -18
- package/src/components/PresenterSettings.tsx +16 -11
- package/src/components/RevealPlayer/RevealPlayer.stories.tsx +1 -1
- package/src/components/RevealPlayer/RevealPlayer.tsx +15 -5
- package/src/meta.ts +8 -3
- package/src/types.ts +16 -8
- package/src/useExitPresenter.ts +24 -24
- package/dist/lib/browser/CollectionPresenterContainer-LPJILYRF.mjs +0 -191
- package/dist/lib/browser/CollectionPresenterContainer-LPJILYRF.mjs.map +0 -7
- package/dist/lib/browser/DocumentPresenterContainer-F42V4KAL.mjs +0 -183
- package/dist/lib/browser/DocumentPresenterContainer-F42V4KAL.mjs.map +0 -7
- package/dist/lib/browser/MarkdownSlide-BLVWTH3U.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-RLGABE65.mjs +0 -106
- package/dist/lib/browser/app-graph-builder-RLGABE65.mjs.map +0 -7
- package/dist/lib/browser/chunk-6ZM323ED.mjs +0 -13
- package/dist/lib/browser/chunk-6ZM323ED.mjs.map +0 -7
- package/dist/lib/browser/chunk-7DV6S5XB.mjs +0 -39
- package/dist/lib/browser/chunk-7DV6S5XB.mjs.map +0 -7
- package/dist/lib/browser/chunk-QTSOWA2K.mjs +0 -41
- package/dist/lib/browser/chunk-QTSOWA2K.mjs.map +0 -7
- package/dist/lib/browser/chunk-UVGTHJUO.mjs +0 -36
- package/dist/lib/browser/chunk-UVGTHJUO.mjs.map +0 -7
- package/dist/lib/browser/react-surface-P7YJFHF3.mjs.map +0 -7
- package/dist/lib/browser/settings-7A4A2H6X.mjs +0 -22
- package/dist/lib/browser/settings-7A4A2H6X.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -113
- package/src/capabilities/react-surface.tsx +0 -63
- package/src/capabilities/settings.ts +0 -19
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/settings.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAe,MAAM,qBAAqB,CAAC;;AAMhE,wBAQE"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
-
import * as Function from 'effect/Function';
|
|
7
|
-
import * as Option from 'effect/Option';
|
|
8
|
-
|
|
9
|
-
import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
10
|
-
import { Obj } from '@dxos/echo';
|
|
11
|
-
import { DeckCapabilities } from '@dxos/plugin-deck';
|
|
12
|
-
import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
|
|
13
|
-
import { createExtension, rxFromSignal } from '@dxos/plugin-graph';
|
|
14
|
-
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
15
|
-
import { fullyQualifiedId, getSpace } from '@dxos/react-client/echo';
|
|
16
|
-
import { DataType } from '@dxos/schema';
|
|
17
|
-
|
|
18
|
-
import { meta } from '../meta';
|
|
19
|
-
import { PresenterAction, type PresenterSettingsProps } from '../types';
|
|
20
|
-
|
|
21
|
-
export default (context: PluginContext) =>
|
|
22
|
-
contributes(
|
|
23
|
-
Capabilities.AppGraphBuilder,
|
|
24
|
-
createExtension({
|
|
25
|
-
id: meta.id,
|
|
26
|
-
// TODO(wittjosiah): This is a hack to work around presenter previously relying on "variant". Remove.
|
|
27
|
-
connector: (node) =>
|
|
28
|
-
Rx.make((get) =>
|
|
29
|
-
Function.pipe(
|
|
30
|
-
get(node),
|
|
31
|
-
Option.flatMap((node) => {
|
|
32
|
-
const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
|
|
33
|
-
const settings = get(rxFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(meta.id)?.value));
|
|
34
|
-
const isPresentable = settings?.presentCollections
|
|
35
|
-
? Obj.instanceOf(DataType.Collection, node.data) || Obj.instanceOf(Markdown.Document, node.data)
|
|
36
|
-
: Obj.instanceOf(Markdown.Document, node.data);
|
|
37
|
-
return isPresentable ? Option.some(node.data) : Option.none();
|
|
38
|
-
}),
|
|
39
|
-
Option.map((object) => {
|
|
40
|
-
const id = fullyQualifiedId(object);
|
|
41
|
-
return [
|
|
42
|
-
{
|
|
43
|
-
id: [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
44
|
-
data: { type: meta.id, object },
|
|
45
|
-
type: meta.id,
|
|
46
|
-
properties: {
|
|
47
|
-
label: 'Presenter',
|
|
48
|
-
icon: 'ph--presentation--regular',
|
|
49
|
-
disposition: 'hidden',
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
];
|
|
53
|
-
}),
|
|
54
|
-
Option.getOrElse(() => []),
|
|
55
|
-
),
|
|
56
|
-
),
|
|
57
|
-
actions: (node) =>
|
|
58
|
-
Rx.make((get) =>
|
|
59
|
-
Function.pipe(
|
|
60
|
-
get(node),
|
|
61
|
-
Option.flatMap((node) => {
|
|
62
|
-
const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
|
|
63
|
-
const settings = get(rxFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(meta.id)?.value));
|
|
64
|
-
const isPresentable = settings?.presentCollections
|
|
65
|
-
? Obj.instanceOf(DataType.Collection, node.data) || Obj.instanceOf(Markdown.Document, node.data)
|
|
66
|
-
: Obj.instanceOf(Markdown.Document, node.data);
|
|
67
|
-
return isPresentable ? Option.some(node.data) : Option.none();
|
|
68
|
-
}),
|
|
69
|
-
Option.map((object) => {
|
|
70
|
-
const id = fullyQualifiedId(object);
|
|
71
|
-
const spaceId = getSpace(object)?.id;
|
|
72
|
-
return [
|
|
73
|
-
{
|
|
74
|
-
id: `${PresenterAction.TogglePresentation._tag}/${id}`,
|
|
75
|
-
// TODO(burdon): Allow function so can generate state when activated.
|
|
76
|
-
// So can set explicit fullscreen state coordinated with current presenter state.
|
|
77
|
-
data: async () => {
|
|
78
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
79
|
-
const layout = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
80
|
-
const presenterId = [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR);
|
|
81
|
-
if (!layout.deck.fullscreen) {
|
|
82
|
-
void dispatch(
|
|
83
|
-
createIntent(DeckAction.Adjust, {
|
|
84
|
-
type: 'solo--fullscreen',
|
|
85
|
-
id: presenterId,
|
|
86
|
-
}),
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
await dispatch(
|
|
90
|
-
createIntent(LayoutAction.Open, {
|
|
91
|
-
part: 'main',
|
|
92
|
-
subject: [presenterId],
|
|
93
|
-
options: { workspace: spaceId },
|
|
94
|
-
}),
|
|
95
|
-
);
|
|
96
|
-
},
|
|
97
|
-
properties: {
|
|
98
|
-
label: ['toggle presentation label', { ns: meta.id }],
|
|
99
|
-
icon: 'ph--presentation--regular',
|
|
100
|
-
disposition: 'list-item',
|
|
101
|
-
keyBinding: {
|
|
102
|
-
macos: 'shift+meta+p',
|
|
103
|
-
windows: 'shift+alt+p',
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
];
|
|
108
|
-
}),
|
|
109
|
-
Option.getOrElse(() => []),
|
|
110
|
-
),
|
|
111
|
-
),
|
|
112
|
-
}),
|
|
113
|
-
);
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
-
import { Obj } from '@dxos/echo';
|
|
9
|
-
import { SettingsStore } from '@dxos/local-storage';
|
|
10
|
-
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
11
|
-
import { DataType } from '@dxos/schema';
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
CollectionPresenterContainer,
|
|
15
|
-
DocumentPresenterContainer,
|
|
16
|
-
MarkdownSlide,
|
|
17
|
-
PresenterSettings,
|
|
18
|
-
} from '../components';
|
|
19
|
-
import { meta } from '../meta';
|
|
20
|
-
import { type PresenterSettingsProps } from '../types';
|
|
21
|
-
|
|
22
|
-
export default () =>
|
|
23
|
-
contributes(Capabilities.ReactSurface, [
|
|
24
|
-
createSurface({
|
|
25
|
-
id: `${meta.id}/document`,
|
|
26
|
-
role: 'article',
|
|
27
|
-
position: 'hoist',
|
|
28
|
-
filter: (data): data is { subject: { type: typeof meta.id; object: Markdown.Document } } =>
|
|
29
|
-
!!data.subject &&
|
|
30
|
-
typeof data.subject === 'object' &&
|
|
31
|
-
'type' in data.subject &&
|
|
32
|
-
'object' in data.subject &&
|
|
33
|
-
data.subject.type === meta.id &&
|
|
34
|
-
Obj.instanceOf(Markdown.Document, data.subject.object),
|
|
35
|
-
component: ({ data }) => <DocumentPresenterContainer document={data.subject.object} />,
|
|
36
|
-
}),
|
|
37
|
-
createSurface({
|
|
38
|
-
id: `${meta.id}/collection`,
|
|
39
|
-
role: 'article',
|
|
40
|
-
position: 'hoist',
|
|
41
|
-
filter: (data): data is { subject: { type: typeof meta.id; object: DataType.Collection } } =>
|
|
42
|
-
!!data.subject &&
|
|
43
|
-
typeof data.subject === 'object' &&
|
|
44
|
-
'type' in data.subject &&
|
|
45
|
-
'object' in data.subject &&
|
|
46
|
-
data.subject.type === meta.id &&
|
|
47
|
-
Obj.instanceOf(DataType.Collection, data.subject.object),
|
|
48
|
-
component: ({ data }) => <CollectionPresenterContainer collection={data.subject.object} />,
|
|
49
|
-
}),
|
|
50
|
-
createSurface({
|
|
51
|
-
id: `${meta.id}/slide`,
|
|
52
|
-
role: 'slide',
|
|
53
|
-
filter: (data): data is { subject: Markdown.Document } => Obj.instanceOf(Markdown.Document, data.subject),
|
|
54
|
-
component: ({ data }) => <MarkdownSlide document={data.subject} />,
|
|
55
|
-
}),
|
|
56
|
-
createSurface({
|
|
57
|
-
id: `${meta.id}/plugin-settings`,
|
|
58
|
-
role: 'article',
|
|
59
|
-
filter: (data): data is { subject: SettingsStore<PresenterSettingsProps> } =>
|
|
60
|
-
data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
|
|
61
|
-
component: ({ data: { subject } }) => <PresenterSettings settings={subject.value} />,
|
|
62
|
-
}),
|
|
63
|
-
]);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
6
|
-
import { live } from '@dxos/live-object';
|
|
7
|
-
|
|
8
|
-
import { meta } from '../meta';
|
|
9
|
-
import { type PresenterSettingsProps, PresenterSettingsSchema } from '../types';
|
|
10
|
-
|
|
11
|
-
export default () => {
|
|
12
|
-
const settings = live<PresenterSettingsProps>({});
|
|
13
|
-
|
|
14
|
-
return contributes(Capabilities.Settings, {
|
|
15
|
-
prefix: meta.id,
|
|
16
|
-
schema: PresenterSettingsSchema,
|
|
17
|
-
value: settings,
|
|
18
|
-
});
|
|
19
|
-
};
|