@dxos/plugin-presenter 0.8.2-main.f081794 → 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/{PresenterMain-PQPWYIWU.mjs → CollectionPresenterContainer-SSFGQUYE.mjs} +16 -43
- package/dist/lib/browser/CollectionPresenterContainer-SSFGQUYE.mjs.map +7 -0
- package/dist/lib/browser/{RevealMain-B2PJXHND.mjs → DocumentPresenterContainer-CAPKSXNP.mjs} +13 -27
- package/dist/lib/browser/DocumentPresenterContainer-CAPKSXNP.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-6G4VPN6E.mjs +77 -0
- package/dist/lib/browser/app-graph-builder-6G4VPN6E.mjs.map +7 -0
- package/dist/lib/browser/chunk-2RWWAQZK.mjs +36 -0
- package/dist/lib/browser/chunk-2RWWAQZK.mjs.map +7 -0
- package/dist/lib/browser/{chunk-3VVM67QE.mjs → chunk-3BSZF44U.mjs} +5 -5
- package/dist/lib/browser/{chunk-3VVM67QE.mjs.map → chunk-3BSZF44U.mjs.map} +3 -3
- 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 +12 -31
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-6JT4CB4B.mjs → react-surface-YV4BLHO2.mjs} +14 -29
- package/dist/lib/browser/react-surface-YV4BLHO2.mjs.map +7 -0
- package/dist/lib/browser/{settings-KWSP73SU.mjs → settings-WERSYNE5.mjs} +2 -2
- package/dist/types/src/PresenterPlugin.d.ts.map +1 -1
- 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 -180
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/CollectionPresenterContainer.d.ts +7 -0
- package/dist/types/src/components/CollectionPresenterContainer.d.ts.map +1 -0
- package/dist/types/src/components/DocumentPresenterContainer.d.ts +7 -0
- package/dist/types/src/components/DocumentPresenterContainer.d.ts.map +1 -0
- 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/components/index.d.ts +2 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/testing.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +118 -70
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/useExitPresenter.d.ts +6 -0
- package/dist/types/src/useExitPresenter.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +29 -21
- package/src/PresenterPlugin.tsx +1 -14
- package/src/capabilities/app-graph-builder.ts +65 -35
- package/src/capabilities/index.ts +0 -4
- package/src/capabilities/react-surface.tsx +16 -24
- package/src/components/CollectionPresenterContainer.tsx +43 -0
- package/src/components/DocumentPresenterContainer.tsx +22 -0
- package/src/components/index.ts +2 -2
- package/src/index.ts +0 -1
- package/src/types.ts +10 -10
- package/src/useExitPresenter.ts +35 -0
- package/dist/lib/browser/PresenterMain-PQPWYIWU.mjs.map +0 -7
- package/dist/lib/browser/RevealMain-B2PJXHND.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-CWMMBJTB.mjs +0 -55
- package/dist/lib/browser/app-graph-builder-CWMMBJTB.mjs.map +0 -7
- package/dist/lib/browser/chunk-CQR4O6KC.mjs.map +0 -7
- package/dist/lib/browser/chunk-FK2KJZ73.mjs +0 -16
- package/dist/lib/browser/chunk-FK2KJZ73.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-TTGJCKQ5.mjs +0 -46
- package/dist/lib/browser/intent-resolver-TTGJCKQ5.mjs.map +0 -7
- package/dist/lib/browser/react-surface-6JT4CB4B.mjs.map +0 -7
- package/dist/lib/browser/state-W6VFHVB2.mjs +0 -18
- package/dist/lib/browser/state-W6VFHVB2.mjs.map +0 -7
- package/dist/types/src/capabilities/capabilities.d.ts +0 -8
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/state.d.ts +0 -4
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/components/PresenterMain.d.ts +0 -7
- package/dist/types/src/components/PresenterMain.d.ts.map +0 -1
- package/dist/types/src/components/RevealMain.d.ts +0 -7
- package/dist/types/src/components/RevealMain.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -13
- package/src/capabilities/intent-resolver.ts +0 -43
- package/src/capabilities/state.ts +0 -17
- package/src/components/PresenterMain.tsx +0 -63
- package/src/components/RevealMain.tsx +0 -38
- /package/dist/lib/browser/{settings-KWSP73SU.mjs.map → settings-WERSYNE5.mjs.map} +0 -0
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PRESENTER_PLUGIN
|
|
3
|
-
} from "./chunk-S2S5RFJ4.mjs";
|
|
4
|
-
|
|
5
|
-
// packages/plugins/plugin-presenter/src/capabilities/capabilities.ts
|
|
6
|
-
import { defineCapability } from "@dxos/app-framework";
|
|
7
|
-
var PresenterCapabilities;
|
|
8
|
-
(function(PresenterCapabilities2) {
|
|
9
|
-
PresenterCapabilities2.State = defineCapability(`${PRESENTER_PLUGIN}/capability/state`);
|
|
10
|
-
PresenterCapabilities2.MutableState = defineCapability(`${PRESENTER_PLUGIN}/capability/state`);
|
|
11
|
-
})(PresenterCapabilities || (PresenterCapabilities = {}));
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
PresenterCapabilities
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=chunk-FK2KJZ73.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/capabilities.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\n\nimport { PRESENTER_PLUGIN } from '../meta';\n\nexport namespace PresenterCapabilities {\n export type State = { presenting: boolean };\n export const State = defineCapability<Readonly<State>>(`${PRESENTER_PLUGIN}/capability/state`);\n export const MutableState = defineCapability<State>(`${PRESENTER_PLUGIN}/capability/state`);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SAASA,wBAAwB;;UAIhBC,wBAAAA;yBAEFC,QAAQC,iBAAkC,GAAGC,gBAAAA,mBAAmC;yBAChFC,eAAeF,iBAAwB,GAAGC,gBAAAA,mBAAmC;AAC5F,GAJiBH,0BAAAA,wBAAAA,CAAAA,EAAAA;",
|
|
6
|
-
"names": ["defineCapability", "PresenterCapabilities", "State", "defineCapability", "PRESENTER_PLUGIN", "MutableState"]
|
|
7
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PresenterCapabilities
|
|
3
|
-
} from "./chunk-FK2KJZ73.mjs";
|
|
4
|
-
import {
|
|
5
|
-
PresenterAction
|
|
6
|
-
} from "./chunk-CQR4O6KC.mjs";
|
|
7
|
-
import "./chunk-S2S5RFJ4.mjs";
|
|
8
|
-
|
|
9
|
-
// packages/plugins/plugin-presenter/src/capabilities/intent-resolver.ts
|
|
10
|
-
import { Capabilities, contributes, createIntent, createResolver, LayoutAction } from "@dxos/app-framework";
|
|
11
|
-
import { fullyQualifiedId } from "@dxos/react-client/echo";
|
|
12
|
-
var intent_resolver_default = (context) => contributes(Capabilities.IntentResolver, createResolver({
|
|
13
|
-
intent: PresenterAction.TogglePresentation,
|
|
14
|
-
resolve: ({ object, state: next }) => {
|
|
15
|
-
const state = context.requestCapability(PresenterCapabilities.MutableState);
|
|
16
|
-
state.presenting = next ?? !state.presenting;
|
|
17
|
-
if (state.presenting) {
|
|
18
|
-
return {
|
|
19
|
-
intents: [
|
|
20
|
-
createIntent(LayoutAction.SetLayoutMode, {
|
|
21
|
-
part: "mode",
|
|
22
|
-
subject: fullyQualifiedId(object),
|
|
23
|
-
options: {
|
|
24
|
-
mode: "fullscreen"
|
|
25
|
-
}
|
|
26
|
-
})
|
|
27
|
-
]
|
|
28
|
-
};
|
|
29
|
-
} else {
|
|
30
|
-
return {
|
|
31
|
-
intents: [
|
|
32
|
-
createIntent(LayoutAction.SetLayoutMode, {
|
|
33
|
-
part: "mode",
|
|
34
|
-
options: {
|
|
35
|
-
revert: true
|
|
36
|
-
}
|
|
37
|
-
})
|
|
38
|
-
]
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}));
|
|
43
|
-
export {
|
|
44
|
-
intent_resolver_default as default
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=intent-resolver-TTGJCKQ5.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n Capabilities,\n contributes,\n createIntent,\n createResolver,\n LayoutAction,\n type PluginsContext,\n} from '@dxos/app-framework';\nimport { fullyQualifiedId } from '@dxos/react-client/echo';\n\nimport { PresenterCapabilities } from './capabilities';\nimport { PresenterAction } from '../types';\n\nexport default (context: PluginsContext) =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: PresenterAction.TogglePresentation,\n resolve: ({ object, state: next }) => {\n const state = context.requestCapability(PresenterCapabilities.MutableState);\n state.presenting = next ?? !state.presenting;\n if (state.presenting) {\n return {\n intents: [\n createIntent(LayoutAction.SetLayoutMode, {\n part: 'mode',\n subject: fullyQualifiedId(object),\n options: { mode: 'fullscreen' },\n }),\n ],\n };\n } else {\n return {\n intents: [createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { revert: true } })],\n };\n }\n },\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,SACEA,cACAC,aACAC,cACAC,gBACAC,oBAEK;AACP,SAASC,wBAAwB;AAKjC,IAAA,0BAAe,CAACC,YACdC,YACEC,aAAaC,gBACbC,eAAe;EACbC,QAAQC,gBAAgBC;EACxBC,SAAS,CAAC,EAAEC,QAAQC,OAAOC,KAAI,MAAE;AAC/B,UAAMD,QAAQV,QAAQY,kBAAkBC,sBAAsBC,YAAY;AAC1EJ,UAAMK,aAAaJ,QAAQ,CAACD,MAAMK;AAClC,QAAIL,MAAMK,YAAY;AACpB,aAAO;QACLC,SAAS;UACPC,aAAaC,aAAaC,eAAe;YACvCC,MAAM;YACNC,SAASC,iBAAiBb,MAAAA;YAC1Bc,SAAS;cAAEC,MAAM;YAAa;UAChC,CAAA;;MAEJ;IACF,OAAO;AACL,aAAO;QACLR,SAAS;UAACC,aAAaC,aAAaC,eAAe;YAAEC,MAAM;YAAQG,SAAS;cAAEE,QAAQ;YAAK;UAAE,CAAA;;MAC/F;IACF;EACF;AACF,CAAA,CAAA;",
|
|
6
|
-
"names": ["Capabilities", "contributes", "createIntent", "createResolver", "LayoutAction", "fullyQualifiedId", "context", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "PresenterAction", "TogglePresentation", "resolve", "object", "state", "next", "requestCapability", "PresenterCapabilities", "MutableState", "presenting", "intents", "createIntent", "LayoutAction", "SetLayoutMode", "part", "subject", "fullyQualifiedId", "options", "mode", "revert"]
|
|
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, useCapability } 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 { PresenterCapabilities } from './capabilities';\nimport { MarkdownSlide, PresenterSettings, PresenterMain, RevealMain } from '../components';\nimport { PRESENTER_PLUGIN } from '../meta';\nimport { PresenterContext, type PresenterSettingsProps } from '../types';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: `${PRESENTER_PLUGIN}/document`,\n role: 'main',\n position: 'hoist',\n filter: (data): data is { subject: DocumentType } => isInstanceOf(DocumentType, data.subject),\n component: ({ data }) => <RevealMain document={data.subject} />,\n }),\n createSurface({\n id: `${PRESENTER_PLUGIN}/collection`,\n role: 'main',\n position: 'hoist',\n filter: (data): data is { subject: CollectionType } => isInstanceOf(CollectionType, data.subject),\n component: ({ data }) => {\n const state = useCapability(PresenterCapabilities.MutableState);\n\n return (\n <PresenterContext.Provider\n value={{\n running: state.presenting,\n start: () => (state.presenting = true),\n stop: () => (state.presenting = false),\n }}\n >\n <PresenterMain collection={data.subject} />\n </PresenterContext.Provider>\n );\n },\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,eAAeC,qBAAqB;AACxE,SAASC,oBAAoB;AAC7B,SAASC,qBAAqB;AAC9B,SAASC,oBAAoB;AAC7B,SAASC,sBAAsB;AAO/B,IAAA,wBAAe,MACbC,YAAYC,aAAaC,cAAc;EACrCC,cAAc;IACZC,IAAI,GAAGC,gBAAAA;IACPC,MAAM;IACNC,UAAU;IACVC,QAAQ,CAACC,SAA4CC,aAAaC,cAAcF,KAAKG,OAAO;IAC5FC,WAAW,CAAC,EAAEJ,KAAI,MAAO,sBAAA,cAACK,YAAAA;MAAWC,UAAUN,KAAKG;;EACtD,CAAA;EACAT,cAAc;IACZC,IAAI,GAAGC,gBAAAA;IACPC,MAAM;IACNC,UAAU;IACVC,QAAQ,CAACC,SAA8CC,aAAaM,gBAAgBP,KAAKG,OAAO;IAChGC,WAAW,CAAC,EAAEJ,KAAI,MAAE;AAClB,YAAMQ,QAAQC,cAAcC,sBAAsBC,YAAY;AAE9D,aACE,sBAAA,cAACC,iBAAiBC,UAAQ;QACxBC,OAAO;UACLC,SAASP,MAAMQ;UACfC,OAAO,MAAOT,MAAMQ,aAAa;UACjCE,MAAM,MAAOV,MAAMQ,aAAa;QAClC;SAEA,sBAAA,cAACG,eAAAA;QAAcC,YAAYpB,KAAKG;;IAGtC;EACF,CAAA;EACAT,cAAc;IACZC,IAAI,GAAGC,gBAAAA;IACPC,MAAM;IACNE,QAAQ,CAACC,SAA4CC,aAAaC,cAAcF,KAAKG,OAAO;IAC5FC,WAAW,CAAC,EAAEJ,KAAI,MAAO,sBAAA,cAACqB,eAAAA;MAAcf,UAAUN,KAAKG;;EACzD,CAAA;EACAT,cAAc;IACZC,IAAI,GAAGC,gBAAAA;IACPC,MAAM;IACNE,QAAQ,CAACC,SACPA,KAAKG,mBAAmBmB,iBAAiBtB,KAAKG,QAAQoB,WAAW3B;IACnEQ,WAAW,CAAC,EAAEJ,MAAM,EAAEG,QAAO,EAAE,MAAO,sBAAA,cAACqB,mBAAAA;MAAkBC,UAAUtB,QAAQW;;EAC7E,CAAA;CACD;",
|
|
6
|
-
"names": ["React", "Capabilities", "contributes", "createSurface", "useCapability", "isInstanceOf", "SettingsStore", "DocumentType", "CollectionType", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "PRESENTER_PLUGIN", "role", "position", "filter", "data", "isInstanceOf", "DocumentType", "subject", "component", "RevealMain", "document", "CollectionType", "state", "useCapability", "PresenterCapabilities", "MutableState", "PresenterContext", "Provider", "value", "running", "presenting", "start", "stop", "PresenterMain", "collection", "MarkdownSlide", "SettingsStore", "prefix", "PresenterSettings", "settings"]
|
|
7
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PresenterCapabilities
|
|
3
|
-
} from "./chunk-FK2KJZ73.mjs";
|
|
4
|
-
import "./chunk-S2S5RFJ4.mjs";
|
|
5
|
-
|
|
6
|
-
// packages/plugins/plugin-presenter/src/capabilities/state.ts
|
|
7
|
-
import { contributes } from "@dxos/app-framework";
|
|
8
|
-
import { live } from "@dxos/live-object";
|
|
9
|
-
var state_default = () => {
|
|
10
|
-
const state = live({
|
|
11
|
-
presenting: false
|
|
12
|
-
});
|
|
13
|
-
return contributes(PresenterCapabilities.State, state);
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
state_default as default
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=state-W6VFHVB2.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/state.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes } from '@dxos/app-framework';\nimport { live } from '@dxos/live-object';\n\nimport { PresenterCapabilities } from './capabilities';\n\nexport default () => {\n // TODO(burdon): Do we need context providers if we can get the state from the plugin?\n // No, the main reason would be compability with existing apis.\n // For anything made specifically for the plugin framework they can depend on `useCapabilities`.\n const state = live<PresenterCapabilities.State>({ presenting: false });\n\n return contributes(PresenterCapabilities.State, state);\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,SAASA,mBAAmB;AAC5B,SAASC,YAAY;AAIrB,IAAA,gBAAe,MAAA;AAIb,QAAMC,QAAQC,KAAkC;IAAEC,YAAY;EAAM,CAAA;AAEpE,SAAOC,YAAYC,sBAAsBC,OAAOL,KAAAA;AAClD;",
|
|
6
|
-
"names": ["contributes", "live", "state", "live", "presenting", "contributes", "PresenterCapabilities", "State"]
|
|
7
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare namespace PresenterCapabilities {
|
|
2
|
-
type State = {
|
|
3
|
-
presenting: boolean;
|
|
4
|
-
};
|
|
5
|
-
const State: import("@dxos/app-framework").InterfaceDef<Readonly<State>>;
|
|
6
|
-
const MutableState: import("@dxos/app-framework").InterfaceDef<State>;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/capabilities.ts"],"names":[],"mappings":"AAQA,yBAAiB,qBAAqB,CAAC;IACrC,KAAY,KAAK,GAAG;QAAE,UAAU,EAAE,OAAO,CAAA;KAAE,CAAC;IACrC,MAAM,KAAK,6DAA4E,CAAC;IACxF,MAAM,YAAY,mDAAkE,CAAC;CAC7F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intent-resolver.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/intent-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,YAAY,EAKZ,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;kCAMJ,cAAc;AAAvC,wBAyBI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/state.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;;AAEvD,wBAOE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PresenterMain.d.ts","sourceRoot":"","sources":["../../../../src/components/PresenterMain.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAwB,MAAM,OAAO,CAAC;AAG7D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAY/D,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC;IAAE,UAAU,EAAE,cAAc,CAAA;CAAE,CAyCrD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RevealMain.d.ts","sourceRoot":"","sources":["../../../../src/components/RevealMain.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAOhE,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC;IAAE,QAAQ,EAAE,YAAY,CAAA;CAAE,CAqBjD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
import { PRESENTER_PLUGIN } from '../meta';
|
|
8
|
-
|
|
9
|
-
export namespace PresenterCapabilities {
|
|
10
|
-
export type State = { presenting: boolean };
|
|
11
|
-
export const State = defineCapability<Readonly<State>>(`${PRESENTER_PLUGIN}/capability/state`);
|
|
12
|
-
export const MutableState = defineCapability<State>(`${PRESENTER_PLUGIN}/capability/state`);
|
|
13
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
Capabilities,
|
|
7
|
-
contributes,
|
|
8
|
-
createIntent,
|
|
9
|
-
createResolver,
|
|
10
|
-
LayoutAction,
|
|
11
|
-
type PluginsContext,
|
|
12
|
-
} from '@dxos/app-framework';
|
|
13
|
-
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
14
|
-
|
|
15
|
-
import { PresenterCapabilities } from './capabilities';
|
|
16
|
-
import { PresenterAction } from '../types';
|
|
17
|
-
|
|
18
|
-
export default (context: PluginsContext) =>
|
|
19
|
-
contributes(
|
|
20
|
-
Capabilities.IntentResolver,
|
|
21
|
-
createResolver({
|
|
22
|
-
intent: PresenterAction.TogglePresentation,
|
|
23
|
-
resolve: ({ object, state: next }) => {
|
|
24
|
-
const state = context.requestCapability(PresenterCapabilities.MutableState);
|
|
25
|
-
state.presenting = next ?? !state.presenting;
|
|
26
|
-
if (state.presenting) {
|
|
27
|
-
return {
|
|
28
|
-
intents: [
|
|
29
|
-
createIntent(LayoutAction.SetLayoutMode, {
|
|
30
|
-
part: 'mode',
|
|
31
|
-
subject: fullyQualifiedId(object),
|
|
32
|
-
options: { mode: 'fullscreen' },
|
|
33
|
-
}),
|
|
34
|
-
],
|
|
35
|
-
};
|
|
36
|
-
} else {
|
|
37
|
-
return {
|
|
38
|
-
intents: [createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { revert: true } })],
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
}),
|
|
43
|
-
);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { contributes } from '@dxos/app-framework';
|
|
6
|
-
import { live } from '@dxos/live-object';
|
|
7
|
-
|
|
8
|
-
import { PresenterCapabilities } from './capabilities';
|
|
9
|
-
|
|
10
|
-
export default () => {
|
|
11
|
-
// TODO(burdon): Do we need context providers if we can get the state from the plugin?
|
|
12
|
-
// No, the main reason would be compability with existing apis.
|
|
13
|
-
// For anything made specifically for the plugin framework they can depend on `useCapabilities`.
|
|
14
|
-
const state = live<PresenterCapabilities.State>({ presenting: false });
|
|
15
|
-
|
|
16
|
-
return contributes(PresenterCapabilities.State, state);
|
|
17
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type FC, useContext, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Surface, createIntent, useLayout, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
-
import { type CollectionType } from '@dxos/plugin-space/types';
|
|
9
|
-
import { Main } from '@dxos/react-ui';
|
|
10
|
-
import {
|
|
11
|
-
baseSurface,
|
|
12
|
-
topbarBlockPaddingStart,
|
|
13
|
-
fixedInsetFlexLayout,
|
|
14
|
-
bottombarBlockPaddingEnd,
|
|
15
|
-
} from '@dxos/react-ui-theme';
|
|
16
|
-
|
|
17
|
-
import { Layout, PageNumber, Pager, StartButton } from './Presenter';
|
|
18
|
-
import { PresenterContext, PresenterAction } from '../types';
|
|
19
|
-
|
|
20
|
-
const PresenterMain: FC<{ collection: CollectionType }> = ({ collection }) => {
|
|
21
|
-
const [slide, setSlide] = useState(0);
|
|
22
|
-
|
|
23
|
-
// TODO(burdon): Should not depend on split screen.
|
|
24
|
-
const layout = useLayout();
|
|
25
|
-
const fullscreen = layout.mode === 'fullscreen';
|
|
26
|
-
const { running } = useContext(PresenterContext);
|
|
27
|
-
|
|
28
|
-
// TODO(burdon): Currently conflates fullscreen and running.
|
|
29
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
30
|
-
const handleSetRunning = (running: boolean) => {
|
|
31
|
-
void dispatch(createIntent(PresenterAction.TogglePresentation, { object: collection, state: running }));
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<Main.Content
|
|
36
|
-
classNames={[
|
|
37
|
-
baseSurface,
|
|
38
|
-
fixedInsetFlexLayout,
|
|
39
|
-
!fullscreen && topbarBlockPaddingStart,
|
|
40
|
-
!fullscreen && bottombarBlockPaddingEnd,
|
|
41
|
-
]}
|
|
42
|
-
>
|
|
43
|
-
<Layout
|
|
44
|
-
topRight={<StartButton running={running} onClick={(running) => handleSetRunning(running)} />}
|
|
45
|
-
bottomRight={<PageNumber index={slide} count={collection.objects.length} />}
|
|
46
|
-
bottomLeft={
|
|
47
|
-
<Pager
|
|
48
|
-
index={slide}
|
|
49
|
-
count={collection.objects.length}
|
|
50
|
-
keys={running}
|
|
51
|
-
onChange={setSlide}
|
|
52
|
-
onExit={() => handleSetRunning(false)}
|
|
53
|
-
/>
|
|
54
|
-
}
|
|
55
|
-
>
|
|
56
|
-
{/* TODO(wittjosiah): Better slide placeholder. */}
|
|
57
|
-
<Surface role='slide' data={{ subject: collection.objects[slide] }} placeholder={<></>} />
|
|
58
|
-
</Layout>
|
|
59
|
-
</Main.Content>
|
|
60
|
-
);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export default PresenterMain;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type FC } from 'react';
|
|
6
|
-
|
|
7
|
-
import { createIntent, useLayout, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
-
import { type DocumentType } from '@dxos/plugin-markdown/types';
|
|
9
|
-
import { Main } from '@dxos/react-ui';
|
|
10
|
-
import { topbarBlockPaddingStart, fixedInsetFlexLayout, bottombarBlockPaddingEnd } from '@dxos/react-ui-theme';
|
|
11
|
-
|
|
12
|
-
import { RevealPlayer } from './RevealPlayer';
|
|
13
|
-
import { PresenterAction } from '../types';
|
|
14
|
-
|
|
15
|
-
const PresenterMain: FC<{ document: DocumentType }> = ({ document }) => {
|
|
16
|
-
const layout = useLayout();
|
|
17
|
-
const fullscreen = layout.mode === 'fullscreen';
|
|
18
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<Main.Content
|
|
22
|
-
classNames={[
|
|
23
|
-
fixedInsetFlexLayout,
|
|
24
|
-
!fullscreen && topbarBlockPaddingStart,
|
|
25
|
-
!fullscreen && bottombarBlockPaddingEnd,
|
|
26
|
-
]}
|
|
27
|
-
>
|
|
28
|
-
<RevealPlayer
|
|
29
|
-
content={document.content.target?.content ?? ''}
|
|
30
|
-
onExit={() => {
|
|
31
|
-
void dispatch(createIntent(PresenterAction.TogglePresentation, { object: document, state: false }));
|
|
32
|
-
}}
|
|
33
|
-
/>
|
|
34
|
-
</Main.Content>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default PresenterMain;
|
|
File without changes
|