@dxos/plugin-presenter 0.8.2-main.f11618f → 0.8.2-main.fbd8ed0
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-5ETXRUWZ.mjs → CollectionPresenterContainer-SSFGQUYE.mjs} +2 -2
- package/dist/lib/browser/{app-graph-builder-QS5KTYD3.mjs → app-graph-builder-6G4VPN6E.mjs} +14 -12
- package/dist/lib/browser/app-graph-builder-6G4VPN6E.mjs.map +7 -0
- package/dist/lib/browser/{chunk-VTBPPB5Z.mjs → chunk-3BSZF44U.mjs} +2 -2
- package/dist/lib/browser/{chunk-CQR4O6KC.mjs → chunk-OOZM543N.mjs} +9 -9
- package/dist/lib/browser/chunk-OOZM543N.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-YV4BLHO2.mjs} +2 -2
- package/dist/lib/browser/{settings-KWSP73SU.mjs → settings-WERSYNE5.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 +71 -135
- 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 +29 -24
- package/src/capabilities/app-graph-builder.ts +61 -50
- package/src/types.ts +10 -10
- 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/{CollectionPresenterContainer-5ETXRUWZ.mjs.map → CollectionPresenterContainer-SSFGQUYE.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-VTBPPB5Z.mjs.map → chunk-3BSZF44U.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-N23VEZ2O.mjs.map → react-surface-YV4BLHO2.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-KWSP73SU.mjs.map → settings-WERSYNE5.mjs.map} +0 -0
|
@@ -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
|
);
|
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,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
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Context, createContext } from 'react';\n\nimport { S } from '@dxos/echo-schema';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { CollectionType } from '@dxos/plugin-space/types';\n\nimport { PRESENTER_PLUGIN } from './meta';\n\nexport namespace PresenterAction {\n const PRESENTER_ACTION = `${PRESENTER_PLUGIN}/action`;\n\n export class TogglePresentation extends S.TaggedClass<TogglePresentation>()(\n `${PRESENTER_ACTION}/toggle-presentation`,\n {\n input: S.Struct({\n object: S.Union(DocumentType, CollectionType),\n state: S.optional(S.Boolean),\n }),\n output: S.Void,\n },\n ) {}\n}\n\nexport type PresenterContextType = {\n running: boolean;\n start: () => void;\n stop: () => void;\n};\n\nexport const PresenterContext: Context<PresenterContextType> = createContext<PresenterContextType>({\n running: false,\n start: () => {},\n stop: () => {},\n});\n\nexport const PresenterSettingsSchema = S.mutable(\n S.Struct({\n presentCollections: S.optional(S.Boolean),\n }),\n);\n\nexport type PresenterSettingsProps = S.Schema.Type<typeof PresenterSettingsSchema>;\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SAAuBA,qBAAqB;AAE5C,SAASC,SAAS;AAClB,SAASC,oBAAoB;AAC7B,SAASC,sBAAsB;;UAIdC,kBAAAA;AACf,QAAMC,mBAAmB,GAAGC,gBAAAA;EAErB,MAAMC,2BAA2BC,EAAEC,YAAW,EACnD,GAAGJ,gBAAAA,wBACH;IACEK,OAAOF,EAAEG,OAAO;MACdC,QAAQJ,EAAEK,MAAMC,cAAcC,cAAAA;MAC9BC,OAAOR,EAAES,SAAST,EAAEU,OAAO;IAC7B,CAAA;IACAC,QAAQX,EAAEY;EACZ,CAAA,EAAA;EACC;mBATUb,qBAAAA;AAUf,GAbiBH,oBAAAA,kBAAAA,CAAAA,EAAAA;AAqBV,IAAMiB,mBAAkDC,cAAoC;EACjGC,SAAS;EACTC,OAAO,MAAA;EAAO;EACdC,MAAM,MAAA;EAAO;AACf,CAAA;AAEO,IAAMC,0BAA0BlB,EAAEmB,QACvCnB,EAAEG,OAAO;EACPiB,oBAAoBpB,EAAES,SAAST,EAAEU,OAAO;AAC1C,CAAA,CAAA;",
|
|
6
|
-
"names": ["createContext", "S", "DocumentType", "CollectionType", "PresenterAction", "PRESENTER_ACTION", "PRESENTER_PLUGIN", "TogglePresentation", "S", "TaggedClass", "input", "Struct", "object", "Union", "DocumentType", "CollectionType", "state", "optional", "Boolean", "output", "Void", "PresenterContext", "createContext", "running", "start", "stop", "PresenterSettingsSchema", "mutable", "presentCollections"]
|
|
7
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|