@dxos/plugin-presenter 0.8.4-main.1da679c → 0.8.4-main.21d9917
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-IHDZWP3U.mjs +176 -0
- package/dist/lib/browser/CollectionPresenterContainer-IHDZWP3U.mjs.map +7 -0
- package/dist/lib/browser/DocumentPresenterContainer-74M6XAAI.mjs +173 -0
- package/dist/lib/browser/DocumentPresenterContainer-74M6XAAI.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-2QAQR34J.mjs +112 -0
- package/dist/lib/browser/app-graph-builder-2QAQR34J.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-5MC4V23G.mjs +38 -0
- package/dist/lib/browser/chunk-5MC4V23G.mjs.map +7 -0
- package/dist/lib/browser/chunk-GM4KOXJY.mjs +41 -0
- package/dist/lib/browser/chunk-GM4KOXJY.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 +23 -32
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-2VP2M4Z7.mjs +63 -0
- package/dist/lib/browser/react-surface-2VP2M4Z7.mjs.map +7 -0
- package/dist/lib/browser/settings-RDHXCCT4.mjs +31 -0
- package/dist/lib/browser/settings-RDHXCCT4.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 +9 -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/Markdown/Container.stories.d.ts +0 -1
- package/dist/types/src/components/Markdown/Container.stories.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Slide.stories.d.ts +1 -1
- package/dist/types/src/components/Markdown/Slide.stories.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/Presenter/Pager.stories.d.ts +0 -1
- package/dist/types/src/components/Presenter/Pager.stories.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/RevealPlayer/RevealPlayer.stories.d.ts +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +20 -17
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +36 -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 +47 -41
- package/src/PresenterPlugin.tsx +8 -24
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +105 -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 +70 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +30 -0
- package/src/components/CollectionPresenterContainer.tsx +13 -14
- package/src/components/DocumentPresenterContainer.tsx +3 -3
- package/src/components/Markdown/Container.stories.tsx +2 -4
- package/src/components/Markdown/Container.tsx +2 -2
- package/src/components/Markdown/Slide.stories.tsx +3 -2
- 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 -3
- package/src/components/Presenter/Pager.tsx +53 -18
- package/src/components/PresenterSettings.tsx +10 -5
- package/src/components/RevealPlayer/RevealPlayer.stories.tsx +3 -2
- package/src/components/RevealPlayer/RevealPlayer.tsx +15 -5
- package/src/meta.ts +9 -6
- package/src/types.ts +18 -10
- package/src/useExitPresenter.ts +24 -24
- package/dist/lib/browser/CollectionPresenterContainer-U7D57ZVN.mjs +0 -191
- package/dist/lib/browser/CollectionPresenterContainer-U7D57ZVN.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-25KJRCKD.mjs +0 -105
- package/dist/lib/browser/app-graph-builder-25KJRCKD.mjs.map +0 -7
- package/dist/lib/browser/chunk-QOZXPXC4.mjs +0 -41
- package/dist/lib/browser/chunk-QOZXPXC4.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/chunk-VSD5LSE5.mjs +0 -15
- package/dist/lib/browser/chunk-VSD5LSE5.mjs.map +0 -7
- package/dist/lib/browser/chunk-W4IR3DJE.mjs +0 -39
- package/dist/lib/browser/chunk-W4IR3DJE.mjs.map +0 -7
- package/dist/lib/browser/react-surface-4WFDCQFU.mjs +0 -57
- package/dist/lib/browser/react-surface-4WFDCQFU.mjs.map +0 -7
- package/dist/lib/browser/settings-H6OCPWOP.mjs +0 -22
- package/dist/lib/browser/settings-H6OCPWOP.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 -116
- package/src/capabilities/react-surface.tsx +0 -63
- package/src/capabilities/settings.ts +0 -19
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\nimport { SettingsStore } from '@dxos/local-storage';\nimport { Markdown } from '@dxos/plugin-markdown/types';\nimport { DataType } from '@dxos/schema';\n\nimport {\n CollectionPresenterContainer,\n DocumentPresenterContainer,\n MarkdownSlide,\n PresenterSettings,\n} from '../components';\nimport { PRESENTER_PLUGIN } from '../meta';\nimport { type PresenterSettingsProps } from '../types';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: `${PRESENTER_PLUGIN}/document`,\n role: 'article',\n position: 'hoist',\n filter: (data): data is { subject: { type: typeof PRESENTER_PLUGIN; 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 === PRESENTER_PLUGIN &&\n Obj.instanceOf(Markdown.Document, data.subject.object),\n component: ({ data }) => <DocumentPresenterContainer document={data.subject.object} />,\n }),\n createSurface({\n id: `${PRESENTER_PLUGIN}/collection`,\n role: 'article',\n position: 'hoist',\n filter: (data): data is { subject: { type: typeof PRESENTER_PLUGIN; object: DataType.Collection } } =>\n !!data.subject &&\n typeof data.subject === 'object' &&\n 'type' in data.subject &&\n 'object' in data.subject &&\n data.subject.type === PRESENTER_PLUGIN &&\n Obj.instanceOf(DataType.Collection, data.subject.object),\n component: ({ data }) => <CollectionPresenterContainer collection={data.subject.object} />,\n }),\n createSurface({\n id: `${PRESENTER_PLUGIN}/slide`,\n role: 'slide',\n filter: (data): data is { subject: Markdown.Document } => Obj.instanceOf(Markdown.Document, data.subject),\n component: ({ data }) => <MarkdownSlide document={data.subject} />,\n }),\n createSurface({\n id: `${PRESENTER_PLUGIN}/plugin-settings`,\n role: 'article',\n filter: (data): data is { subject: SettingsStore<PresenterSettingsProps> } =>\n data.subject instanceof SettingsStore && data.subject.prefix === PRESENTER_PLUGIN,\n component: ({ data: { subject } }) => <PresenterSettings settings={subject.value} />,\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,cAAcC,aAAaC,qBAAqB;AACzD,SAASC,WAAW;AACpB,SAASC,qBAAqB;AAC9B,SAASC,gBAAgB;AACzB,SAASC,gBAAgB;AAWzB,IAAA,yBAAe,MACbC,YAAYC,aAAaC,cAAc;EACrCC,cAAc;IACZC,IAAI,GAAGC,gBAAAA;IACPC,MAAM;IACNC,UAAU;IACVC,QAAQ,CAACC,SACP,CAAC,CAACA,KAAKC,WACP,OAAOD,KAAKC,YAAY,YACxB,UAAUD,KAAKC,WACf,YAAYD,KAAKC,WACjBD,KAAKC,QAAQC,SAASN,oBACtBO,IAAIC,WAAWC,SAASC,UAAUN,KAAKC,QAAQM,MAAM;IACvDC,WAAW,CAAC,EAAER,KAAI,MAAO,sBAAA,cAACS,4BAAAA;MAA2BC,UAAUV,KAAKC,QAAQM;;EAC9E,CAAA;EACAb,cAAc;IACZC,IAAI,GAAGC,gBAAAA;IACPC,MAAM;IACNC,UAAU;IACVC,QAAQ,CAACC,SACP,CAAC,CAACA,KAAKC,WACP,OAAOD,KAAKC,YAAY,YACxB,UAAUD,KAAKC,WACf,YAAYD,KAAKC,WACjBD,KAAKC,QAAQC,SAASN,oBACtBO,IAAIC,WAAWO,SAASC,YAAYZ,KAAKC,QAAQM,MAAM;IACzDC,WAAW,CAAC,EAAER,KAAI,MAAO,sBAAA,cAACa,8BAAAA;MAA6BC,YAAYd,KAAKC,QAAQM;;EAClF,CAAA;EACAb,cAAc;IACZC,IAAI,GAAGC,gBAAAA;IACPC,MAAM;IACNE,QAAQ,CAACC,SAAiDG,IAAIC,WAAWC,SAASC,UAAUN,KAAKC,OAAO;IACxGO,WAAW,CAAC,EAAER,KAAI,MAAO,sBAAA,cAACe,eAAAA;MAAcL,UAAUV,KAAKC;;EACzD,CAAA;EACAP,cAAc;IACZC,IAAI,GAAGC,gBAAAA;IACPC,MAAM;IACNE,QAAQ,CAACC,SACPA,KAAKC,mBAAmBe,iBAAiBhB,KAAKC,QAAQgB,WAAWrB;IACnEY,WAAW,CAAC,EAAER,MAAM,EAAEC,QAAO,EAAE,MAAO,sBAAA,cAACiB,mBAAAA;MAAkBC,UAAUlB,QAAQmB;;EAC7E,CAAA;CACD;",
|
|
6
|
-
"names": ["React", "Capabilities", "contributes", "createSurface", "Obj", "SettingsStore", "Markdown", "DataType", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "PRESENTER_PLUGIN", "role", "position", "filter", "data", "subject", "type", "Obj", "instanceOf", "Markdown", "Document", "object", "component", "DocumentPresenterContainer", "document", "DataType", "Collection", "CollectionPresenterContainer", "collection", "MarkdownSlide", "SettingsStore", "prefix", "PresenterSettings", "settings", "value"]
|
|
7
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PresenterSettingsSchema
|
|
3
|
-
} from "./chunk-W4IR3DJE.mjs";
|
|
4
|
-
import {
|
|
5
|
-
meta
|
|
6
|
-
} from "./chunk-VSD5LSE5.mjs";
|
|
7
|
-
|
|
8
|
-
// src/capabilities/settings.ts
|
|
9
|
-
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
10
|
-
import { live } from "@dxos/live-object";
|
|
11
|
-
var settings_default = (() => {
|
|
12
|
-
const settings = live({});
|
|
13
|
-
return contributes(Capabilities.Settings, {
|
|
14
|
-
prefix: meta.id,
|
|
15
|
-
schema: PresenterSettingsSchema,
|
|
16
|
-
value: settings
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
export {
|
|
20
|
-
settings_default as default
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=settings-H6OCPWOP.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/settings.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes } from '@dxos/app-framework';\nimport { live } from '@dxos/live-object';\n\nimport { meta } from '../meta';\nimport { type PresenterSettingsProps, PresenterSettingsSchema } from '../types';\n\nexport default () => {\n const settings = live<PresenterSettingsProps>({});\n\n return contributes(Capabilities.Settings, {\n prefix: meta.id,\n schema: PresenterSettingsSchema,\n value: settings,\n });\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,SAASA,cAAcC,mBAAmB;AAC1C,SAASC,YAAY;AAKrB,IAAA,oBAAe,MAAA;AACb,QAAMC,WAAWC,KAA6B,CAAC,CAAA;AAE/C,SAAOC,YAAYC,aAAaC,UAAU;IACxCC,QAAQC,KAAKC;IACbC,QAAQC;IACRC,OAAOV;EACT,CAAA;AACF;",
|
|
6
|
-
"names": ["Capabilities", "contributes", "live", "settings", "live", "contributes", "Capabilities", "Settings", "prefix", "meta", "id", "schema", "PresenterSettingsSchema", "value"]
|
|
7
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type PluginContext } from '@dxos/app-framework';
|
|
2
|
-
declare const _default: (context: PluginContext) => import("@dxos/app-framework").Capability<import("@dxos/app-framework").InterfaceDef<import("@dxos/app-graph").BuilderExtensions>>;
|
|
3
|
-
export default _default;
|
|
4
|
-
//# sourceMappingURL=app-graph-builder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-graph-builder.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/app-graph-builder.ts"],"names":[],"mappings":"AAOA,OAAO,EAA8B,KAAK,aAAa,EAA6B,MAAM,qBAAqB,CAAC;yBAYhG,SAAS,aAAa;AAAtC,wBAgGI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAA8B,MAAM,qBAAqB,CAAC;;AAe/E,wBAyCK"}
|
|
@@ -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,116 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
-
import { Option, pipe } from 'effect';
|
|
7
|
-
|
|
8
|
-
import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
9
|
-
import { Obj } from '@dxos/echo';
|
|
10
|
-
import { DeckCapabilities } from '@dxos/plugin-deck';
|
|
11
|
-
import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
|
|
12
|
-
import { createExtension, rxFromSignal } from '@dxos/plugin-graph';
|
|
13
|
-
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
14
|
-
import { fullyQualifiedId, getSpace } from '@dxos/react-client/echo';
|
|
15
|
-
import { DataType } from '@dxos/schema';
|
|
16
|
-
|
|
17
|
-
import { PRESENTER_PLUGIN } from '../meta';
|
|
18
|
-
import { PresenterAction, type PresenterSettingsProps } from '../types';
|
|
19
|
-
|
|
20
|
-
export default (context: PluginContext) =>
|
|
21
|
-
contributes(
|
|
22
|
-
Capabilities.AppGraphBuilder,
|
|
23
|
-
createExtension({
|
|
24
|
-
id: PRESENTER_PLUGIN,
|
|
25
|
-
// TODO(wittjosiah): This is a hack to work around presenter previously relying on "variant". Remove.
|
|
26
|
-
connector: (node) =>
|
|
27
|
-
Rx.make((get) =>
|
|
28
|
-
pipe(
|
|
29
|
-
get(node),
|
|
30
|
-
Option.flatMap((node) => {
|
|
31
|
-
const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
|
|
32
|
-
const settings = get(
|
|
33
|
-
rxFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(PRESENTER_PLUGIN)?.value),
|
|
34
|
-
);
|
|
35
|
-
const isPresentable = settings?.presentCollections
|
|
36
|
-
? Obj.instanceOf(DataType.Collection, node.data) || Obj.instanceOf(Markdown.Document, node.data)
|
|
37
|
-
: Obj.instanceOf(Markdown.Document, node.data);
|
|
38
|
-
return isPresentable ? Option.some(node.data) : Option.none();
|
|
39
|
-
}),
|
|
40
|
-
Option.map((object) => {
|
|
41
|
-
const id = fullyQualifiedId(object);
|
|
42
|
-
return [
|
|
43
|
-
{
|
|
44
|
-
id: [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
45
|
-
data: { type: PRESENTER_PLUGIN, object },
|
|
46
|
-
type: PRESENTER_PLUGIN,
|
|
47
|
-
properties: {
|
|
48
|
-
label: 'Presenter',
|
|
49
|
-
icon: 'ph--presentation--regular',
|
|
50
|
-
disposition: 'hidden',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
];
|
|
54
|
-
}),
|
|
55
|
-
Option.getOrElse(() => []),
|
|
56
|
-
),
|
|
57
|
-
),
|
|
58
|
-
actions: (node) =>
|
|
59
|
-
Rx.make((get) =>
|
|
60
|
-
pipe(
|
|
61
|
-
get(node),
|
|
62
|
-
Option.flatMap((node) => {
|
|
63
|
-
const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
|
|
64
|
-
const settings = get(
|
|
65
|
-
rxFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(PRESENTER_PLUGIN)?.value),
|
|
66
|
-
);
|
|
67
|
-
const isPresentable = settings?.presentCollections
|
|
68
|
-
? Obj.instanceOf(DataType.Collection, node.data) || Obj.instanceOf(Markdown.Document, node.data)
|
|
69
|
-
: Obj.instanceOf(Markdown.Document, node.data);
|
|
70
|
-
return isPresentable ? Option.some(node.data) : Option.none();
|
|
71
|
-
}),
|
|
72
|
-
Option.map((object) => {
|
|
73
|
-
const id = fullyQualifiedId(object);
|
|
74
|
-
const spaceId = getSpace(object)?.id;
|
|
75
|
-
return [
|
|
76
|
-
{
|
|
77
|
-
id: `${PresenterAction.TogglePresentation._tag}/${id}`,
|
|
78
|
-
// TODO(burdon): Allow function so can generate state when activated.
|
|
79
|
-
// So can set explicit fullscreen state coordinated with current presenter state.
|
|
80
|
-
data: async () => {
|
|
81
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
82
|
-
const layout = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
83
|
-
const presenterId = [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR);
|
|
84
|
-
if (!layout.deck.fullscreen) {
|
|
85
|
-
void dispatch(
|
|
86
|
-
createIntent(DeckAction.Adjust, {
|
|
87
|
-
type: 'solo--fullscreen',
|
|
88
|
-
id: presenterId,
|
|
89
|
-
}),
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
await dispatch(
|
|
93
|
-
createIntent(LayoutAction.Open, {
|
|
94
|
-
part: 'main',
|
|
95
|
-
subject: [presenterId],
|
|
96
|
-
options: { workspace: spaceId },
|
|
97
|
-
}),
|
|
98
|
-
);
|
|
99
|
-
},
|
|
100
|
-
properties: {
|
|
101
|
-
label: ['toggle presentation label', { ns: PRESENTER_PLUGIN }],
|
|
102
|
-
icon: 'ph--presentation--regular',
|
|
103
|
-
disposition: 'list-item',
|
|
104
|
-
keyBinding: {
|
|
105
|
-
macos: 'shift+meta+p',
|
|
106
|
-
windows: 'shift+alt+p',
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
];
|
|
111
|
-
}),
|
|
112
|
-
Option.getOrElse(() => []),
|
|
113
|
-
),
|
|
114
|
-
),
|
|
115
|
-
}),
|
|
116
|
-
);
|
|
@@ -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 { PRESENTER_PLUGIN } from '../meta';
|
|
20
|
-
import { type PresenterSettingsProps } from '../types';
|
|
21
|
-
|
|
22
|
-
export default () =>
|
|
23
|
-
contributes(Capabilities.ReactSurface, [
|
|
24
|
-
createSurface({
|
|
25
|
-
id: `${PRESENTER_PLUGIN}/document`,
|
|
26
|
-
role: 'article',
|
|
27
|
-
position: 'hoist',
|
|
28
|
-
filter: (data): data is { subject: { type: typeof PRESENTER_PLUGIN; 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 === PRESENTER_PLUGIN &&
|
|
34
|
-
Obj.instanceOf(Markdown.Document, data.subject.object),
|
|
35
|
-
component: ({ data }) => <DocumentPresenterContainer document={data.subject.object} />,
|
|
36
|
-
}),
|
|
37
|
-
createSurface({
|
|
38
|
-
id: `${PRESENTER_PLUGIN}/collection`,
|
|
39
|
-
role: 'article',
|
|
40
|
-
position: 'hoist',
|
|
41
|
-
filter: (data): data is { subject: { type: typeof PRESENTER_PLUGIN; 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 === PRESENTER_PLUGIN &&
|
|
47
|
-
Obj.instanceOf(DataType.Collection, data.subject.object),
|
|
48
|
-
component: ({ data }) => <CollectionPresenterContainer collection={data.subject.object} />,
|
|
49
|
-
}),
|
|
50
|
-
createSurface({
|
|
51
|
-
id: `${PRESENTER_PLUGIN}/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: `${PRESENTER_PLUGIN}/plugin-settings`,
|
|
58
|
-
role: 'article',
|
|
59
|
-
filter: (data): data is { subject: SettingsStore<PresenterSettingsProps> } =>
|
|
60
|
-
data.subject instanceof SettingsStore && data.subject.prefix === PRESENTER_PLUGIN,
|
|
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
|
-
};
|