@dxos/plugin-presenter 0.8.2-main.fbd8ed0 → 0.8.2-staging.7ac8446

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.
Files changed (85) hide show
  1. package/dist/lib/browser/{CollectionPresenterContainer-SSFGQUYE.mjs → PresenterMain-PQPWYIWU.mjs} +43 -16
  2. package/dist/lib/browser/PresenterMain-PQPWYIWU.mjs.map +7 -0
  3. package/dist/lib/browser/{DocumentPresenterContainer-CAPKSXNP.mjs → RevealMain-B2PJXHND.mjs} +27 -13
  4. package/dist/lib/browser/RevealMain-B2PJXHND.mjs.map +7 -0
  5. package/dist/lib/browser/app-graph-builder-CWMMBJTB.mjs +55 -0
  6. package/dist/lib/browser/app-graph-builder-CWMMBJTB.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-3BSZF44U.mjs → chunk-3VVM67QE.mjs} +5 -5
  8. package/dist/lib/browser/{chunk-3BSZF44U.mjs.map → chunk-3VVM67QE.mjs.map} +3 -3
  9. package/dist/lib/browser/{chunk-OOZM543N.mjs → chunk-CQR4O6KC.mjs} +9 -9
  10. package/dist/lib/browser/chunk-CQR4O6KC.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-FK2KJZ73.mjs +16 -0
  12. package/dist/lib/browser/chunk-FK2KJZ73.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +31 -12
  14. package/dist/lib/browser/index.mjs.map +4 -4
  15. package/dist/lib/browser/intent-resolver-TTGJCKQ5.mjs +46 -0
  16. package/dist/lib/browser/intent-resolver-TTGJCKQ5.mjs.map +7 -0
  17. package/dist/lib/browser/meta.json +1 -1
  18. package/dist/lib/browser/{react-surface-YV4BLHO2.mjs → react-surface-6JT4CB4B.mjs} +29 -14
  19. package/dist/lib/browser/react-surface-6JT4CB4B.mjs.map +7 -0
  20. package/dist/lib/browser/{settings-WERSYNE5.mjs → settings-RBF22MVS.mjs} +4 -4
  21. package/dist/lib/browser/settings-RBF22MVS.mjs.map +7 -0
  22. package/dist/lib/browser/state-KI7F4I6V.mjs +18 -0
  23. package/dist/lib/browser/state-KI7F4I6V.mjs.map +7 -0
  24. package/dist/types/src/PresenterPlugin.d.ts.map +1 -1
  25. package/dist/types/src/capabilities/app-graph-builder.d.ts +179 -2
  26. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  27. package/dist/types/src/capabilities/capabilities.d.ts +8 -0
  28. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
  29. package/dist/types/src/capabilities/index.d.ts +180 -1
  30. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  31. package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
  32. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
  33. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  34. package/dist/types/src/capabilities/state.d.ts +4 -0
  35. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  36. package/dist/types/src/components/Markdown/Container.d.ts.map +1 -1
  37. package/dist/types/src/components/Markdown/Slide.d.ts.map +1 -1
  38. package/dist/types/src/components/Presenter/Layout.d.ts.map +1 -1
  39. package/dist/types/src/components/Presenter/Pager.d.ts.map +1 -1
  40. package/dist/types/src/components/PresenterMain.d.ts +7 -0
  41. package/dist/types/src/components/PresenterMain.d.ts.map +1 -0
  42. package/dist/types/src/components/PresenterSettings.d.ts.map +1 -1
  43. package/dist/types/src/components/RevealMain.d.ts +7 -0
  44. package/dist/types/src/components/RevealMain.d.ts.map +1 -0
  45. package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts.map +1 -1
  46. package/dist/types/src/components/index.d.ts +2 -2
  47. package/dist/types/src/components/index.d.ts.map +1 -1
  48. package/dist/types/src/index.d.ts +1 -0
  49. package/dist/types/src/index.d.ts.map +1 -1
  50. package/dist/types/src/testing.d.ts.map +1 -1
  51. package/dist/types/src/types.d.ts +70 -118
  52. package/dist/types/src/types.d.ts.map +1 -1
  53. package/dist/types/tsconfig.tsbuildinfo +1 -1
  54. package/package.json +21 -29
  55. package/src/PresenterPlugin.tsx +14 -1
  56. package/src/capabilities/app-graph-builder.ts +35 -65
  57. package/src/capabilities/capabilities.ts +13 -0
  58. package/src/capabilities/index.ts +4 -0
  59. package/src/capabilities/intent-resolver.ts +43 -0
  60. package/src/capabilities/react-surface.tsx +24 -16
  61. package/src/capabilities/settings.ts +2 -2
  62. package/src/capabilities/state.ts +17 -0
  63. package/src/components/PresenterMain.tsx +63 -0
  64. package/src/components/RevealMain.tsx +38 -0
  65. package/src/components/index.ts +2 -2
  66. package/src/index.ts +1 -0
  67. package/src/types.ts +10 -10
  68. package/dist/lib/browser/CollectionPresenterContainer-SSFGQUYE.mjs.map +0 -7
  69. package/dist/lib/browser/DocumentPresenterContainer-CAPKSXNP.mjs.map +0 -7
  70. package/dist/lib/browser/app-graph-builder-6G4VPN6E.mjs +0 -77
  71. package/dist/lib/browser/app-graph-builder-6G4VPN6E.mjs.map +0 -7
  72. package/dist/lib/browser/chunk-2RWWAQZK.mjs +0 -36
  73. package/dist/lib/browser/chunk-2RWWAQZK.mjs.map +0 -7
  74. package/dist/lib/browser/chunk-OOZM543N.mjs.map +0 -7
  75. package/dist/lib/browser/react-surface-YV4BLHO2.mjs.map +0 -7
  76. package/dist/lib/browser/settings-WERSYNE5.mjs.map +0 -7
  77. package/dist/types/src/components/CollectionPresenterContainer.d.ts +0 -7
  78. package/dist/types/src/components/CollectionPresenterContainer.d.ts.map +0 -1
  79. package/dist/types/src/components/DocumentPresenterContainer.d.ts +0 -7
  80. package/dist/types/src/components/DocumentPresenterContainer.d.ts.map +0 -1
  81. package/dist/types/src/useExitPresenter.d.ts +0 -6
  82. package/dist/types/src/useExitPresenter.d.ts.map +0 -1
  83. package/src/components/CollectionPresenterContainer.tsx +0 -43
  84. package/src/components/DocumentPresenterContainer.tsx +0 -22
  85. package/src/useExitPresenter.ts +0 -35
@@ -1,77 +0,0 @@
1
- import {
2
- PresenterAction
3
- } from "./chunk-OOZM543N.mjs";
4
- import {
5
- PRESENTER_PLUGIN
6
- } from "./chunk-S2S5RFJ4.mjs";
7
-
8
- // packages/plugins/plugin-presenter/src/capabilities/app-graph-builder.ts
9
- import { Rx } from "@effect-rx/rx-react";
10
- import { Option, pipe } from "effect";
11
- import { contributes, Capabilities, createIntent, LayoutAction } from "@dxos/app-framework";
12
- import { isInstanceOf } from "@dxos/echo-schema";
13
- import { DeckCapabilities } from "@dxos/plugin-deck";
14
- import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from "@dxos/plugin-deck/types";
15
- import { createExtension, rxFromSignal } from "@dxos/plugin-graph";
16
- import { DocumentType } from "@dxos/plugin-markdown/types";
17
- import { CollectionType } from "@dxos/plugin-space/types";
18
- import { fullyQualifiedId, getSpace } from "@dxos/react-client/echo";
19
- var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, createExtension({
20
- id: PRESENTER_PLUGIN,
21
- actions: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => {
22
- const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
23
- const settings = get(rxFromSignal(() => settingsStore?.getStore(PRESENTER_PLUGIN)?.value));
24
- const isPresentable = settings?.presentCollections ? isInstanceOf(CollectionType, node2.data) || isInstanceOf(DocumentType, node2.data) : isInstanceOf(DocumentType, node2.data);
25
- return isPresentable ? Option.some(node2.data) : Option.none();
26
- }), Option.map((object) => {
27
- const id = fullyQualifiedId(object);
28
- const spaceId = getSpace(object)?.id;
29
- return [
30
- {
31
- id: `${PresenterAction.TogglePresentation._tag}/${id}`,
32
- // TODO(burdon): Allow function so can generate state when activated.
33
- // So can set explicit fullscreen state coordinated with current presenter state.
34
- data: async () => {
35
- const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
36
- const layout = context.getCapability(DeckCapabilities.MutableDeckState);
37
- const presenterId = [
38
- id,
39
- "presenter"
40
- ].join(ATTENDABLE_PATH_SEPARATOR);
41
- if (!layout.deck.fullscreen) {
42
- void dispatch(createIntent(DeckAction.Adjust, {
43
- type: "solo--fullscreen",
44
- id: presenterId
45
- }));
46
- }
47
- await dispatch(createIntent(LayoutAction.Open, {
48
- part: "main",
49
- subject: [
50
- presenterId
51
- ],
52
- options: {
53
- workspace: spaceId
54
- }
55
- }));
56
- },
57
- properties: {
58
- label: [
59
- "toggle presentation label",
60
- {
61
- ns: PRESENTER_PLUGIN
62
- }
63
- ],
64
- icon: "ph--presentation--regular",
65
- keyBinding: {
66
- macos: "shift+meta+p",
67
- windows: "shift+alt+p"
68
- }
69
- }
70
- }
71
- ];
72
- }), Option.getOrElse(() => [])))
73
- }));
74
- export {
75
- app_graph_builder_default as default
76
- };
77
- //# sourceMappingURL=app-graph-builder-6G4VPN6E.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 { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { contributes, type PluginContext, 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, rxFromSignal } 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: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: PRESENTER_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => {\n const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));\n const settings = get(\n rxFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(PRESENTER_PLUGIN)?.value),\n );\n const isPresentable = settings?.presentCollections\n ? isInstanceOf(CollectionType, node.data) || isInstanceOf(DocumentType, node.data)\n : isInstanceOf(DocumentType, node.data);\n return isPresentable ? Option.some(node.data) : Option.none();\n }),\n Option.map((object) => {\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.getCapability(Capabilities.IntentDispatcher);\n const layout = context.getCapability(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 Option.getOrElse(() => []),\n ),\n ),\n }),\n );\n"],
5
- "mappings": ";;;;;;;;AAIA,SAASA,UAAU;AACnB,SAASC,QAAQC,YAAY;AAE7B,SAASC,aAAiCC,cAAcC,cAAcC,oBAAoB;AAC1F,SAASC,oBAAoB;AAC7B,SAASC,wBAAwB;AACjC,SAASC,2BAA2BC,kBAAkB;AACtD,SAASC,iBAAiBC,oBAAoB;AAC9C,SAASC,oBAAoB;AAC7B,SAASC,sBAAsB;AAC/B,SAASC,kBAAkBC,gBAAgB;AAK3C,IAAA,4BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;EACdC,IAAIC;EACJC,SAAS,CAACC,SACRC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAAA;AACd,UAAM,CAACO,aAAAA,IAAiBJ,IAAIX,QAAQgB,aAAad,aAAae,aAAa,CAAA;AAC3E,UAAMC,WAAWP,IACfQ,aAAa,MAAMJ,eAAeK,SAAiCd,gBAAAA,GAAmBe,KAAAA,CAAAA;AAExF,UAAMC,gBAAgBJ,UAAUK,qBAC5BC,aAAaC,gBAAgBjB,MAAKkB,IAAI,KAAKF,aAAaG,cAAcnB,MAAKkB,IAAI,IAC/EF,aAAaG,cAAcnB,MAAKkB,IAAI;AACxC,WAAOJ,gBAAgBT,OAAOe,KAAKpB,MAAKkB,IAAI,IAAIb,OAAOgB,KAAI;EAC7D,CAAA,GACAhB,OAAOiB,IAAI,CAACC,WAAAA;AACV,UAAM1B,KAAK2B,iBAAiBD,MAAAA;AAC5B,UAAME,UAAUC,SAASH,MAAAA,GAAS1B;AAClC,WAAO;MACL;QACEA,IAAI,GAAG8B,gBAAgBC,mBAAmBC,IAAI,IAAIhC,EAAAA;;;QAGlDqB,MAAM,YAAA;AACJ,gBAAM,EAAEY,iBAAiBC,SAAQ,IAAKvC,QAAQwC,cAActC,aAAauC,gBAAgB;AACzF,gBAAMC,SAAS1C,QAAQwC,cAAcG,iBAAiBC,gBAAgB;AACtE,gBAAMC,cAAc;YAACxC;YAAI;YAAayC,KAAKC,yBAAAA;AAC3C,cAAI,CAACL,OAAOM,KAAKC,YAAY;AAC3B,iBAAKV,SACHW,aAAaC,WAAWC,QAAQ;cAC9BC,MAAM;cACNhD,IAAIwC;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,IAAIxD;YAAiB;;UAC5DyD,MAAM;UACNC,YAAY;YACVC,OAAO;YACPC,SAAS;UACX;QACF;MACF;;EAEJ,CAAA,GACArD,OAAOsD,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;AAGjC,CAAA,CAAA;",
6
- "names": ["Rx", "Option", "pipe", "contributes", "Capabilities", "createIntent", "LayoutAction", "isInstanceOf", "DeckCapabilities", "ATTENDABLE_PATH_SEPARATOR", "DeckAction", "createExtension", "rxFromSignal", "DocumentType", "CollectionType", "fullyQualifiedId", "getSpace", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "PRESENTER_PLUGIN", "actions", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "settingsStore", "capabilities", "SettingsStore", "settings", "rxFromSignal", "getStore", "value", "isPresentable", "presentCollections", "isInstanceOf", "CollectionType", "data", "DocumentType", "some", "none", "map", "object", "fullyQualifiedId", "spaceId", "getSpace", "PresenterAction", "TogglePresentation", "_tag", "dispatchPromise", "dispatch", "getCapability", "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", "getOrElse"]
7
- }
@@ -1,36 +0,0 @@
1
- // packages/plugins/plugin-presenter/src/useExitPresenter.ts
2
- import { useCallback } from "react";
3
- import { createIntent, LayoutAction, useCapability, useIntentDispatcher } from "@dxos/app-framework";
4
- import { DeckCapabilities } from "@dxos/plugin-deck";
5
- import { DeckAction } from "@dxos/plugin-deck/types";
6
- import { fullyQualifiedId, getSpace } from "@dxos/react-client/echo";
7
- var useExitPresenter = (object) => {
8
- const { dispatchPromise: dispatch } = useIntentDispatcher();
9
- const layout = useCapability(DeckCapabilities.MutableDeckState);
10
- return useCallback(() => {
11
- const objectId = fullyQualifiedId(object);
12
- if (layout.deck.fullscreen) {
13
- void dispatch(createIntent(DeckAction.Adjust, {
14
- type: "solo--fullscreen",
15
- id: objectId
16
- }));
17
- }
18
- return dispatch(createIntent(LayoutAction.Open, {
19
- part: "main",
20
- subject: [
21
- objectId
22
- ],
23
- options: {
24
- workspace: getSpace(document)?.id
25
- }
26
- }));
27
- }, [
28
- dispatch,
29
- object
30
- ]);
31
- };
32
-
33
- export {
34
- useExitPresenter
35
- };
36
- //# sourceMappingURL=chunk-2RWWAQZK.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/useExitPresenter.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { useCallback } from 'react';\n\nimport { createIntent, LayoutAction, useCapability, useIntentDispatcher } from '@dxos/app-framework';\nimport { type Live } from '@dxos/live-object';\nimport { DeckCapabilities } from '@dxos/plugin-deck';\nimport { DeckAction } from '@dxos/plugin-deck/types';\nimport { fullyQualifiedId, getSpace } from '@dxos/react-client/echo';\n\nexport const useExitPresenter = (object: Live<any>) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const layout = useCapability(DeckCapabilities.MutableDeckState);\n\n return useCallback(() => {\n const objectId = fullyQualifiedId(object);\n if (layout.deck.fullscreen) {\n void dispatch(\n createIntent(DeckAction.Adjust, {\n type: 'solo--fullscreen',\n id: objectId,\n }),\n );\n }\n return dispatch(\n createIntent(LayoutAction.Open, {\n part: 'main',\n subject: [objectId],\n options: { workspace: getSpace(document)?.id },\n }),\n );\n }, [dispatch, object]);\n};\n"],
5
- "mappings": ";AAIA,SAASA,mBAAmB;AAE5B,SAASC,cAAcC,cAAcC,eAAeC,2BAA2B;AAE/E,SAASC,wBAAwB;AACjC,SAASC,kBAAkB;AAC3B,SAASC,kBAAkBC,gBAAgB;AAEpC,IAAMC,mBAAmB,CAACC,WAAAA;AAC/B,QAAM,EAAEC,iBAAiBC,SAAQ,IAAKC,oBAAAA;AACtC,QAAMC,SAASC,cAAcC,iBAAiBC,gBAAgB;AAE9D,SAAOC,YAAY,MAAA;AACjB,UAAMC,WAAWC,iBAAiBV,MAAAA;AAClC,QAAII,OAAOO,KAAKC,YAAY;AAC1B,WAAKV,SACHW,aAAaC,WAAWC,QAAQ;QAC9BC,MAAM;QACNC,IAAIR;MACN,CAAA,CAAA;IAEJ;AACA,WAAOP,SACLW,aAAaK,aAAaC,MAAM;MAC9BC,MAAM;MACNC,SAAS;QAACZ;;MACVa,SAAS;QAAEC,WAAWC,SAASC,QAAAA,GAAWR;MAAG;IAC/C,CAAA,CAAA;EAEJ,GAAG;IAACf;IAAUF;GAAO;AACvB;",
6
- "names": ["useCallback", "createIntent", "LayoutAction", "useCapability", "useIntentDispatcher", "DeckCapabilities", "DeckAction", "fullyQualifiedId", "getSpace", "useExitPresenter", "object", "dispatchPromise", "dispatch", "useIntentDispatcher", "layout", "useCapability", "DeckCapabilities", "MutableDeckState", "useCallback", "objectId", "fullyQualifiedId", "deck", "fullscreen", "createIntent", "DeckAction", "Adjust", "type", "id", "LayoutAction", "Open", "part", "subject", "options", "workspace", "getSpace", "document"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\nimport { type Context, createContext } from 'react';\n\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 Schema.TaggedClass<TogglePresentation>()(\n `${PRESENTER_ACTION}/toggle-presentation`,\n {\n input: Schema.Struct({\n object: Schema.Union(DocumentType, CollectionType),\n state: Schema.optional(Schema.Boolean),\n }),\n output: Schema.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 = Schema.mutable(\n Schema.Struct({\n presentCollections: Schema.optional(Schema.Boolean),\n }),\n);\n\nexport type PresenterSettingsProps = Schema.Schema.Type<typeof PresenterSettingsSchema>;\n"],
5
- "mappings": ";;;;;AAIA,SAASA,cAAc;AACvB,SAAuBC,qBAAqB;AAE5C,SAASC,oBAAoB;AAC7B,SAASC,sBAAsB;;UAIdC,kBAAAA;AACf,QAAMC,mBAAmB,GAAGC,gBAAAA;EAErB,MAAMC,2BAA2BC,OAAOC,YAAW,EACxD,GAAGJ,gBAAAA,wBACH;IACEK,OAAOF,OAAOG,OAAO;MACnBC,QAAQJ,OAAOK,MAAMC,cAAcC,cAAAA;MACnCC,OAAOR,OAAOS,SAAST,OAAOU,OAAO;IACvC,CAAA;IACAC,QAAQX,OAAOY;EACjB,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,OAAOmB,QAC5CnB,OAAOG,OAAO;EACZiB,oBAAoBpB,OAAOS,SAAST,OAAOU,OAAO;AACpD,CAAA,CAAA;",
6
- "names": ["Schema", "createContext", "DocumentType", "CollectionType", "PresenterAction", "PRESENTER_ACTION", "PRESENTER_PLUGIN", "TogglePresentation", "Schema", "TaggedClass", "input", "Struct", "object", "Union", "DocumentType", "CollectionType", "state", "optional", "Boolean", "output", "Void", "PresenterContext", "createContext", "running", "start", "stop", "PresenterSettingsSchema", "mutable", "presentCollections"]
7
- }
@@ -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 { isInstanceOf } from '@dxos/echo-schema';\nimport { SettingsStore } from '@dxos/local-storage';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { CollectionType } from '@dxos/plugin-space/types';\n\nimport {\n MarkdownSlide,\n PresenterSettings,\n DocumentPresenterContainer,\n CollectionPresenterContainer,\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: DocumentType; variant: 'presenter' } =>\n isInstanceOf(DocumentType, data.subject) && data.variant === 'presenter',\n component: ({ data }) => <DocumentPresenterContainer document={data.subject} />,\n }),\n createSurface({\n id: `${PRESENTER_PLUGIN}/collection`,\n role: 'article',\n position: 'hoist',\n filter: (data): data is { subject: CollectionType; variant: 'presenter' } =>\n isInstanceOf(CollectionType, data.subject) && data.variant === 'presenter',\n component: ({ data }) => <CollectionPresenterContainer collection={data.subject} />,\n }),\n createSurface({\n id: `${PRESENTER_PLUGIN}/slide`,\n role: 'slide',\n filter: (data): data is { subject: DocumentType } => isInstanceOf(DocumentType, 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,oBAAoB;AAC7B,SAASC,qBAAqB;AAC9B,SAASC,oBAAoB;AAC7B,SAASC,sBAAsB;AAW/B,IAAA,wBAAe,MACbC,YAAYC,aAAaC,cAAc;EACrCC,cAAc;IACZC,IAAI,GAAGC,gBAAAA;IACPC,MAAM;IACNC,UAAU;IACVC,QAAQ,CAACC,SACPC,aAAaC,cAAcF,KAAKG,OAAO,KAAKH,KAAKI,YAAY;IAC/DC,WAAW,CAAC,EAAEL,KAAI,MAAO,sBAAA,cAACM,4BAAAA;MAA2BC,UAAUP,KAAKG;;EACtE,CAAA;EACAT,cAAc;IACZC,IAAI,GAAGC,gBAAAA;IACPC,MAAM;IACNC,UAAU;IACVC,QAAQ,CAACC,SACPC,aAAaO,gBAAgBR,KAAKG,OAAO,KAAKH,KAAKI,YAAY;IACjEC,WAAW,CAAC,EAAEL,KAAI,MAAO,sBAAA,cAACS,8BAAAA;MAA6BC,YAAYV,KAAKG;;EAC1E,CAAA;EACAT,cAAc;IACZC,IAAI,GAAGC,gBAAAA;IACPC,MAAM;IACNE,QAAQ,CAACC,SAA4CC,aAAaC,cAAcF,KAAKG,OAAO;IAC5FE,WAAW,CAAC,EAAEL,KAAI,MAAO,sBAAA,cAACW,eAAAA;MAAcJ,UAAUP,KAAKG;;EACzD,CAAA;EACAT,cAAc;IACZC,IAAI,GAAGC,gBAAAA;IACPC,MAAM;IACNE,QAAQ,CAACC,SACPA,KAAKG,mBAAmBS,iBAAiBZ,KAAKG,QAAQU,WAAWjB;IACnES,WAAW,CAAC,EAAEL,MAAM,EAAEG,QAAO,EAAE,MAAO,sBAAA,cAACW,mBAAAA;MAAkBC,UAAUZ,QAAQa;;EAC7E,CAAA;CACD;",
6
- "names": ["React", "Capabilities", "contributes", "createSurface", "isInstanceOf", "SettingsStore", "DocumentType", "CollectionType", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "PRESENTER_PLUGIN", "role", "position", "filter", "data", "isInstanceOf", "DocumentType", "subject", "variant", "component", "DocumentPresenterContainer", "document", "CollectionType", "CollectionPresenterContainer", "collection", "MarkdownSlide", "SettingsStore", "prefix", "PresenterSettings", "settings", "value"]
7
- }
@@ -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 { PRESENTER_PLUGIN } from '../meta';\nimport { PresenterSettingsSchema, type PresenterSettingsProps } from '../types';\n\nexport default () => {\n const settings = live<PresenterSettingsProps>({});\n\n return contributes(Capabilities.Settings, {\n schema: PresenterSettingsSchema,\n prefix: PRESENTER_PLUGIN,\n value: settings,\n });\n};\n"],
5
- "mappings": ";;;;;;;;AAIA,SAASA,cAAcC,mBAAmB;AAC1C,SAASC,YAAY;AAKrB,IAAA,mBAAe,MAAA;AACb,QAAMC,WAAWC,KAA6B,CAAC,CAAA;AAE/C,SAAOC,YAAYC,aAAaC,UAAU;IACxCC,QAAQC;IACRC,QAAQC;IACRC,OAAOT;EACT,CAAA;AACF;",
6
- "names": ["Capabilities", "contributes", "live", "settings", "live", "contributes", "Capabilities", "Settings", "schema", "PresenterSettingsSchema", "prefix", "PRESENTER_PLUGIN", "value"]
7
- }
@@ -1,7 +0,0 @@
1
- import { type FC } from 'react';
2
- import { type CollectionType } from '@dxos/plugin-space/types';
3
- declare const CollectionPresenterContainer: FC<{
4
- collection: CollectionType;
5
- }>;
6
- export default CollectionPresenterContainer;
7
- //# sourceMappingURL=CollectionPresenterContainer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CollectionPresenterContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/CollectionPresenterContainer.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAwB,MAAM,OAAO,CAAC;AAG7D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAO/D,QAAA,MAAM,4BAA4B,EAAE,EAAE,CAAC;IAAE,UAAU,EAAE,cAAc,CAAA;CAAE,CA0BpE,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
@@ -1,7 +0,0 @@
1
- import { type FC } from 'react';
2
- import { type DocumentType } from '@dxos/plugin-markdown/types';
3
- declare const DocumentPresenterContainer: FC<{
4
- document: DocumentType;
5
- }>;
6
- export default DocumentPresenterContainer;
7
- //# sourceMappingURL=DocumentPresenterContainer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DocumentPresenterContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/DocumentPresenterContainer.tsx"],"names":[],"mappings":"AAGA,OAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAMhE,QAAA,MAAM,0BAA0B,EAAE,EAAE,CAAC;IAAE,QAAQ,EAAE,YAAY,CAAA;CAAE,CAQ9D,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
@@ -1,6 +0,0 @@
1
- import { type Live } from '@dxos/live-object';
2
- export declare const useExitPresenter: (object: Live<any>) => () => Promise<{
3
- data?: void | undefined;
4
- error?: Error | undefined;
5
- }>;
6
- //# sourceMappingURL=useExitPresenter.d.ts.map
@@ -1 +0,0 @@
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,43 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React, { type FC, useContext, useState } from 'react';
6
-
7
- import { Surface } from '@dxos/app-framework';
8
- import { type CollectionType } from '@dxos/plugin-space/types';
9
- import { StackItem } from '@dxos/react-ui-stack';
10
-
11
- import { Layout, PageNumber, Pager } from './Presenter';
12
- import { PresenterContext } from '../types';
13
- import { useExitPresenter } from '../useExitPresenter';
14
-
15
- const CollectionPresenterContainer: FC<{ collection: CollectionType }> = ({ collection }) => {
16
- const [slide, setSlide] = useState(0);
17
-
18
- const { running } = useContext(PresenterContext);
19
-
20
- const handleExit = useExitPresenter(collection);
21
-
22
- return (
23
- <StackItem.Content classNames='relative'>
24
- <Layout
25
- bottomRight={<PageNumber index={slide} count={collection.objects.length} />}
26
- bottomLeft={
27
- <Pager
28
- index={slide}
29
- count={collection.objects.length}
30
- keys={running}
31
- onChange={setSlide}
32
- onExit={handleExit}
33
- />
34
- }
35
- >
36
- {/* TODO(wittjosiah): Better slide placeholder. */}
37
- <Surface role='slide' data={{ subject: collection.objects[slide] }} placeholder={<></>} />
38
- </Layout>
39
- </StackItem.Content>
40
- );
41
- };
42
-
43
- export default CollectionPresenterContainer;
@@ -1,22 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
- import React, { type FC } from 'react';
5
-
6
- import { type DocumentType } from '@dxos/plugin-markdown/types';
7
- import { StackItem } from '@dxos/react-ui-stack';
8
-
9
- import { RevealPlayer } from './RevealPlayer';
10
- import { useExitPresenter } from '../useExitPresenter';
11
-
12
- const DocumentPresenterContainer: FC<{ document: DocumentType }> = ({ document }) => {
13
- const handleExit = useExitPresenter(document);
14
-
15
- return (
16
- <StackItem.Content classNames='relative'>
17
- <RevealPlayer content={document.content.target?.content ?? ''} onExit={handleExit} />
18
- </StackItem.Content>
19
- );
20
- };
21
-
22
- export default DocumentPresenterContainer;
@@ -1,35 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { useCallback } from 'react';
6
-
7
- import { createIntent, LayoutAction, useCapability, useIntentDispatcher } from '@dxos/app-framework';
8
- import { type Live } from '@dxos/live-object';
9
- import { DeckCapabilities } from '@dxos/plugin-deck';
10
- import { DeckAction } from '@dxos/plugin-deck/types';
11
- import { fullyQualifiedId, getSpace } from '@dxos/react-client/echo';
12
-
13
- export const useExitPresenter = (object: Live<any>) => {
14
- const { dispatchPromise: dispatch } = useIntentDispatcher();
15
- const layout = useCapability(DeckCapabilities.MutableDeckState);
16
-
17
- return useCallback(() => {
18
- const objectId = fullyQualifiedId(object);
19
- if (layout.deck.fullscreen) {
20
- void dispatch(
21
- createIntent(DeckAction.Adjust, {
22
- type: 'solo--fullscreen',
23
- id: objectId,
24
- }),
25
- );
26
- }
27
- return dispatch(
28
- createIntent(LayoutAction.Open, {
29
- part: 'main',
30
- subject: [objectId],
31
- options: { workspace: getSpace(document)?.id },
32
- }),
33
- );
34
- }, [dispatch, object]);
35
- };