@dxos/plugin-presenter 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae
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-5RJIT3DA.mjs +52 -0
- package/dist/lib/browser/CollectionPresenterContainer-5RJIT3DA.mjs.map +7 -0
- package/dist/lib/browser/DocumentPresenterContainer-ISD6N5FM.mjs +28 -0
- package/dist/lib/browser/DocumentPresenterContainer-ISD6N5FM.mjs.map +7 -0
- package/dist/lib/browser/MarkdownSlide-Q2XLZTMW.mjs +23 -0
- package/dist/lib/browser/MarkdownSlide-Q2XLZTMW.mjs.map +7 -0
- package/dist/lib/browser/PresenterSettings-WGQMXH4I.mjs +31 -0
- package/dist/lib/browser/PresenterSettings-WGQMXH4I.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-LNUGLW3H.mjs +113 -0
- package/dist/lib/browser/app-graph-builder-LNUGLW3H.mjs.map +7 -0
- package/dist/lib/browser/chunk-46CHA6Y5.mjs +41 -0
- package/dist/lib/browser/chunk-46CHA6Y5.mjs.map +7 -0
- package/dist/lib/browser/chunk-BHTOR7TG.mjs +485 -0
- package/dist/lib/browser/chunk-BHTOR7TG.mjs.map +7 -0
- package/dist/lib/browser/chunk-PSOOAW44.mjs +50 -0
- package/dist/lib/browser/chunk-PSOOAW44.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 +38 -38
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-UCM2KRSP.mjs +67 -0
- package/dist/lib/browser/react-surface-UCM2KRSP.mjs.map +7 -0
- package/dist/lib/browser/settings-GIQOCH6O.mjs +32 -0
- package/dist/lib/browser/settings-GIQOCH6O.mjs.map +7 -0
- package/dist/types/src/PresenterPlugin.d.ts +2 -1
- package/dist/types/src/PresenterPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +3 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +7 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +10 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/components/Presenter/Pager.d.ts +1 -1
- package/dist/types/src/components/Presenter/Pager.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.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -25
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.d.ts +7 -0
- package/dist/types/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.d.ts.map +1 -0
- package/dist/types/src/containers/CollectionPresenterContainer/index.d.ts +3 -0
- package/dist/types/src/containers/CollectionPresenterContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components/MarkdownSlide.d.ts → containers/DocumentPresenterContainer/DocumentPresenterContainer.d.ts} +2 -3
- package/dist/types/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.d.ts.map +1 -0
- package/dist/types/src/containers/DocumentPresenterContainer/index.d.ts +3 -0
- package/dist/types/src/containers/DocumentPresenterContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownSlide/MarkdownSlide.d.ts +8 -0
- package/dist/types/src/containers/MarkdownSlide/MarkdownSlide.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownSlide/index.d.ts +3 -0
- package/dist/types/src/containers/MarkdownSlide/index.d.ts.map +1 -0
- package/dist/types/src/containers/PresenterSettings/PresenterSettings.d.ts +8 -0
- package/dist/types/src/containers/PresenterSettings/PresenterSettings.d.ts.map +1 -0
- package/dist/types/src/containers/PresenterSettings/index.d.ts +3 -0
- package/dist/types/src/containers/PresenterSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +6 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +35 -25
- 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 -39
- package/src/PresenterPlugin.tsx +9 -23
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +106 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/index.ts +3 -5
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +71 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +31 -0
- package/src/components/Markdown/Container.stories.tsx +3 -3
- package/src/components/Markdown/Container.tsx +2 -2
- package/src/components/Markdown/Slide.stories.tsx +3 -3
- package/src/components/Markdown/theme.ts +5 -5
- package/src/components/Presenter/Layout.tsx +2 -2
- package/src/components/Presenter/Pager.stories.tsx +2 -2
- package/src/components/Presenter/Pager.tsx +53 -18
- package/src/components/RevealPlayer/RevealPlayer.stories.tsx +3 -3
- package/src/components/RevealPlayer/RevealPlayer.tsx +16 -6
- package/src/components/index.ts +3 -7
- package/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.tsx +43 -0
- package/src/containers/CollectionPresenterContainer/index.ts +7 -0
- package/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.tsx +23 -0
- package/src/containers/DocumentPresenterContainer/index.ts +7 -0
- package/src/{components → containers/MarkdownSlide}/MarkdownSlide.tsx +7 -5
- package/src/containers/MarkdownSlide/index.ts +7 -0
- package/src/containers/PresenterSettings/PresenterSettings.tsx +35 -0
- package/src/containers/PresenterSettings/index.ts +7 -0
- package/src/containers/index.ts +10 -0
- package/src/meta.ts +8 -3
- package/src/types.ts +16 -8
- package/src/useExitPresenter.ts +24 -24
- package/dist/lib/browser/CollectionPresenterContainer-LPJILYRF.mjs +0 -191
- package/dist/lib/browser/CollectionPresenterContainer-LPJILYRF.mjs.map +0 -7
- package/dist/lib/browser/DocumentPresenterContainer-F42V4KAL.mjs +0 -183
- package/dist/lib/browser/DocumentPresenterContainer-F42V4KAL.mjs.map +0 -7
- package/dist/lib/browser/MarkdownSlide-BLVWTH3U.mjs +0 -223
- package/dist/lib/browser/MarkdownSlide-BLVWTH3U.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-RLGABE65.mjs +0 -106
- package/dist/lib/browser/app-graph-builder-RLGABE65.mjs.map +0 -7
- package/dist/lib/browser/chunk-6ZM323ED.mjs +0 -13
- package/dist/lib/browser/chunk-6ZM323ED.mjs.map +0 -7
- package/dist/lib/browser/chunk-7DV6S5XB.mjs +0 -39
- package/dist/lib/browser/chunk-7DV6S5XB.mjs.map +0 -7
- package/dist/lib/browser/chunk-QTSOWA2K.mjs +0 -41
- package/dist/lib/browser/chunk-QTSOWA2K.mjs.map +0 -7
- package/dist/lib/browser/chunk-UVGTHJUO.mjs +0 -36
- package/dist/lib/browser/chunk-UVGTHJUO.mjs.map +0 -7
- package/dist/lib/browser/react-surface-P7YJFHF3.mjs +0 -57
- package/dist/lib/browser/react-surface-P7YJFHF3.mjs.map +0 -7
- package/dist/lib/browser/settings-7A4A2H6X.mjs +0 -22
- package/dist/lib/browser/settings-7A4A2H6X.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/components/CollectionPresenterContainer.d.ts +0 -7
- package/dist/types/src/components/CollectionPresenterContainer.d.ts.map +0 -1
- package/dist/types/src/components/DocumentPresenterContainer.d.ts +0 -7
- package/dist/types/src/components/DocumentPresenterContainer.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownSlide.d.ts.map +0 -1
- package/dist/types/src/components/PresenterSettings.d.ts +0 -6
- package/dist/types/src/components/PresenterSettings.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -113
- package/src/capabilities/react-surface.tsx +0 -63
- package/src/capabilities/settings.ts +0 -19
- package/src/components/CollectionPresenterContainer.tsx +0 -44
- package/src/components/DocumentPresenterContainer.tsx +0 -23
- package/src/components/PresenterSettings.tsx +0 -30
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
meta
|
|
3
|
-
} from "./chunk-6ZM323ED.mjs";
|
|
4
|
-
|
|
5
|
-
// src/types.ts
|
|
6
|
-
import * as Schema from "effect/Schema";
|
|
7
|
-
import { createContext } from "react";
|
|
8
|
-
import { Markdown } from "@dxos/plugin-markdown/types";
|
|
9
|
-
import { DataType } from "@dxos/schema";
|
|
10
|
-
(function(PresenterAction2) {
|
|
11
|
-
const PRESENTER_ACTION = `${meta.id}/action`;
|
|
12
|
-
class TogglePresentation extends Schema.TaggedClass()(`${PRESENTER_ACTION}/toggle-presentation`, {
|
|
13
|
-
input: Schema.Struct({
|
|
14
|
-
object: Schema.Union(Markdown.Document, DataType.Collection),
|
|
15
|
-
state: Schema.optional(Schema.Boolean)
|
|
16
|
-
}),
|
|
17
|
-
output: Schema.Void
|
|
18
|
-
}) {
|
|
19
|
-
}
|
|
20
|
-
PresenterAction2.TogglePresentation = TogglePresentation;
|
|
21
|
-
})(PresenterAction || (PresenterAction = {}));
|
|
22
|
-
var PresenterContext = createContext({
|
|
23
|
-
running: false,
|
|
24
|
-
start: () => {
|
|
25
|
-
},
|
|
26
|
-
stop: () => {
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
var PresenterSettingsSchema = Schema.mutable(Schema.Struct({
|
|
30
|
-
presentCollections: Schema.optional(Schema.Boolean)
|
|
31
|
-
}));
|
|
32
|
-
var PresenterAction;
|
|
33
|
-
|
|
34
|
-
export {
|
|
35
|
-
PresenterContext,
|
|
36
|
-
PresenterSettingsSchema,
|
|
37
|
-
PresenterAction
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=chunk-7DV6S5XB.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\nimport { type Context, createContext } from 'react';\n\nimport { Markdown } from '@dxos/plugin-markdown/types';\nimport { DataType } from '@dxos/schema';\n\nimport { meta } from './meta';\n\nexport namespace PresenterAction {\n const PRESENTER_ACTION = `${meta.id}/action`;\n\n export class TogglePresentation extends Schema.TaggedClass<TogglePresentation>()(\n `${PRESENTER_ACTION}/toggle-presentation`,\n {\n input: Schema.Struct({\n object: Schema.Union(Markdown.Document, DataType.Collection),\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,YAAYA,YAAY;AACxB,SAAuBC,qBAAqB;AAE5C,SAASC,gBAAgB;AACzB,SAASC,gBAAgB;UAIRC,kBAAAA;AACf,QAAMC,mBAAmB,GAAGC,KAAKC,EAAE;EAE5B,MAAMC,2BAAkCC,mBAAW,EACxD,GAAGJ,gBAAAA,wBACH;IACEK,OAAcC,cAAO;MACnBC,QAAeC,aAAMC,SAASC,UAAUC,SAASC,UAAU;MAC3DC,OAAcC,gBAAgBC,cAAO;IACvC,CAAA;IACAC,QAAeC;EACjB,CAAA,EAAA;EACC;mBATUd,qBAAAA;AAUf,GAbiBJ,oBAAAA,kBAAAA,CAAAA,EAAAA;AAqBV,IAAMmB,mBAAkDC,cAAoC;EACjGC,SAAS;EACTC,OAAO,MAAA;EAAO;EACdC,MAAM,MAAA;EAAO;AACf,CAAA;AAEO,IAAMC,0BAAiCC,eACrClB,cAAO;EACZmB,oBAA2BX,gBAAgBC,cAAO;AACpD,CAAA,CAAA;;",
|
|
6
|
-
"names": ["Schema", "createContext", "Markdown", "DataType", "PresenterAction", "PRESENTER_ACTION", "meta", "id", "TogglePresentation", "TaggedClass", "input", "Struct", "object", "Union", "Markdown", "Document", "DataType", "Collection", "state", "optional", "Boolean", "output", "Void", "PresenterContext", "createContext", "running", "start", "stop", "PresenterSettingsSchema", "mutable", "presentCollections"]
|
|
7
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
meta
|
|
3
|
-
} from "./chunk-6ZM323ED.mjs";
|
|
4
|
-
|
|
5
|
-
// src/components/PresenterSettings.tsx
|
|
6
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
7
|
-
import React from "react";
|
|
8
|
-
import { Input, useTranslation } from "@dxos/react-ui";
|
|
9
|
-
import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from "@dxos/react-ui-form";
|
|
10
|
-
var PresenterSettings = ({ settings }) => {
|
|
11
|
-
var _effect = _useSignals();
|
|
12
|
-
try {
|
|
13
|
-
const { t } = useTranslation(meta.id);
|
|
14
|
-
return /* @__PURE__ */ React.createElement(ControlPage, null, /* @__PURE__ */ React.createElement(ControlSection, {
|
|
15
|
-
title: t("settings title", {
|
|
16
|
-
ns: meta.id
|
|
17
|
-
})
|
|
18
|
-
}, /* @__PURE__ */ React.createElement(ControlGroup, null, /* @__PURE__ */ React.createElement(ControlItemInput, {
|
|
19
|
-
title: t("present collections label")
|
|
20
|
-
}, /* @__PURE__ */ React.createElement(Input.Switch, {
|
|
21
|
-
checked: settings.presentCollections,
|
|
22
|
-
onCheckedChange: (checked) => settings.presentCollections = !!checked
|
|
23
|
-
})))));
|
|
24
|
-
} finally {
|
|
25
|
-
_effect.f();
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
// src/components/index.ts
|
|
30
|
-
import { lazy } from "react";
|
|
31
|
-
var MarkdownSlide = lazy(() => import("./MarkdownSlide-BLVWTH3U.mjs"));
|
|
32
|
-
var DocumentPresenterContainer = lazy(() => import("./DocumentPresenterContainer-F42V4KAL.mjs"));
|
|
33
|
-
var CollectionPresenterContainer = lazy(() => import("./CollectionPresenterContainer-LPJILYRF.mjs"));
|
|
34
|
-
|
|
35
|
-
export {
|
|
36
|
-
PresenterSettings,
|
|
37
|
-
MarkdownSlide,
|
|
38
|
-
DocumentPresenterContainer,
|
|
39
|
-
CollectionPresenterContainer
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=chunk-QTSOWA2K.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/PresenterSettings.tsx", "../../../src/components/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Input, useTranslation } from '@dxos/react-ui';\nimport { ControlGroup, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';\n\nimport { meta } from '../meta';\nimport { type PresenterSettingsProps } from '../types';\n\nexport const PresenterSettings = ({ settings }: { settings: PresenterSettingsProps }) => {\n const { t } = useTranslation(meta.id);\n\n return (\n <ControlPage>\n <ControlSection title={t('settings title', { ns: meta.id })}>\n <ControlGroup>\n <ControlItemInput title={t('present collections label')}>\n <Input.Switch\n checked={settings.presentCollections}\n onCheckedChange={(checked) => (settings.presentCollections = !!checked)}\n />\n </ControlItemInput>\n </ControlGroup>\n </ControlSection>\n </ControlPage>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport * from './PresenterSettings';\n\nexport const MarkdownSlide = lazy(() => import('./MarkdownSlide'));\nexport const DocumentPresenterContainer = lazy(() => import('./DocumentPresenterContainer'));\nexport const CollectionPresenterContainer = lazy(() => import('./CollectionPresenterContainer'));\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,OAAOC,sBAAsB;AACtC,SAASC,cAAcC,kBAAkBC,aAAaC,sBAAsB;AAKrE,IAAMC,oBAAoB,CAAC,EAAEC,SAAQ,MAAwC;;;AAClF,UAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AAEpC,WACE,sBAAA,cAACC,aAAAA,MACC,sBAAA,cAACC,gBAAAA;MAAeC,OAAON,EAAE,kBAAkB;QAAEO,IAAIL,KAAKC;MAAG,CAAA;OACvD,sBAAA,cAACK,cAAAA,MACC,sBAAA,cAACC,kBAAAA;MAAiBH,OAAON,EAAE,2BAAA;OACzB,sBAAA,cAACU,MAAMC,QAAM;MACXC,SAASb,SAASc;MAClBC,iBAAiB,CAACF,YAAab,SAASc,qBAAqB,CAAC,CAACD;;;;;AAO7E;;;ACzBA,SAASG,YAAY;AAId,IAAMC,gBAAgBC,KAAK,MAAM,OAAO,8BAAA,CAAA;AACxC,IAAMC,6BAA6BD,KAAK,MAAM,OAAO,2CAAA,CAAA;AACrD,IAAME,+BAA+BF,KAAK,MAAM,OAAO,6CAAA,CAAA;",
|
|
6
|
-
"names": ["React", "Input", "useTranslation", "ControlGroup", "ControlItemInput", "ControlPage", "ControlSection", "PresenterSettings", "settings", "t", "useTranslation", "meta", "id", "ControlPage", "ControlSection", "title", "ns", "ControlGroup", "ControlItemInput", "Input", "Switch", "checked", "presentCollections", "onCheckedChange", "lazy", "MarkdownSlide", "lazy", "DocumentPresenterContainer", "CollectionPresenterContainer"]
|
|
7
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// src/useExitPresenter.ts
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { LayoutAction, createIntent, 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-UVGTHJUO.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 { LayoutAction, createIntent, 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", "LayoutAction", "createIntent", "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,57 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CollectionPresenterContainer,
|
|
3
|
-
DocumentPresenterContainer,
|
|
4
|
-
MarkdownSlide,
|
|
5
|
-
PresenterSettings
|
|
6
|
-
} from "./chunk-QTSOWA2K.mjs";
|
|
7
|
-
import {
|
|
8
|
-
meta
|
|
9
|
-
} from "./chunk-6ZM323ED.mjs";
|
|
10
|
-
|
|
11
|
-
// src/capabilities/react-surface.tsx
|
|
12
|
-
import React from "react";
|
|
13
|
-
import { Capabilities, contributes, createSurface } from "@dxos/app-framework";
|
|
14
|
-
import { Obj } from "@dxos/echo";
|
|
15
|
-
import { SettingsStore } from "@dxos/local-storage";
|
|
16
|
-
import { Markdown } from "@dxos/plugin-markdown/types";
|
|
17
|
-
import { DataType } from "@dxos/schema";
|
|
18
|
-
var react_surface_default = (() => contributes(Capabilities.ReactSurface, [
|
|
19
|
-
createSurface({
|
|
20
|
-
id: `${meta.id}/document`,
|
|
21
|
-
role: "article",
|
|
22
|
-
position: "hoist",
|
|
23
|
-
filter: (data) => !!data.subject && typeof data.subject === "object" && "type" in data.subject && "object" in data.subject && data.subject.type === meta.id && Obj.instanceOf(Markdown.Document, data.subject.object),
|
|
24
|
-
component: ({ data }) => /* @__PURE__ */ React.createElement(DocumentPresenterContainer, {
|
|
25
|
-
document: data.subject.object
|
|
26
|
-
})
|
|
27
|
-
}),
|
|
28
|
-
createSurface({
|
|
29
|
-
id: `${meta.id}/collection`,
|
|
30
|
-
role: "article",
|
|
31
|
-
position: "hoist",
|
|
32
|
-
filter: (data) => !!data.subject && typeof data.subject === "object" && "type" in data.subject && "object" in data.subject && data.subject.type === meta.id && Obj.instanceOf(DataType.Collection, data.subject.object),
|
|
33
|
-
component: ({ data }) => /* @__PURE__ */ React.createElement(CollectionPresenterContainer, {
|
|
34
|
-
collection: data.subject.object
|
|
35
|
-
})
|
|
36
|
-
}),
|
|
37
|
-
createSurface({
|
|
38
|
-
id: `${meta.id}/slide`,
|
|
39
|
-
role: "slide",
|
|
40
|
-
filter: (data) => Obj.instanceOf(Markdown.Document, data.subject),
|
|
41
|
-
component: ({ data }) => /* @__PURE__ */ React.createElement(MarkdownSlide, {
|
|
42
|
-
document: data.subject
|
|
43
|
-
})
|
|
44
|
-
}),
|
|
45
|
-
createSurface({
|
|
46
|
-
id: `${meta.id}/plugin-settings`,
|
|
47
|
-
role: "article",
|
|
48
|
-
filter: (data) => data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
|
|
49
|
-
component: ({ data: { subject } }) => /* @__PURE__ */ React.createElement(PresenterSettings, {
|
|
50
|
-
settings: subject.value
|
|
51
|
-
})
|
|
52
|
-
})
|
|
53
|
-
]));
|
|
54
|
-
export {
|
|
55
|
-
react_surface_default as default
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=react-surface-P7YJFHF3.mjs.map
|
|
@@ -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 { meta } from '../meta';\nimport { type PresenterSettingsProps } from '../types';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: `${meta.id}/document`,\n role: 'article',\n position: 'hoist',\n filter: (data): data is { subject: { type: typeof meta.id; 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 === meta.id &&\n Obj.instanceOf(Markdown.Document, data.subject.object),\n component: ({ data }) => <DocumentPresenterContainer document={data.subject.object} />,\n }),\n createSurface({\n id: `${meta.id}/collection`,\n role: 'article',\n position: 'hoist',\n filter: (data): data is { subject: { type: typeof meta.id; 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 === meta.id &&\n Obj.instanceOf(DataType.Collection, data.subject.object),\n component: ({ data }) => <CollectionPresenterContainer collection={data.subject.object} />,\n }),\n createSurface({\n id: `${meta.id}/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: `${meta.id}/plugin-settings`,\n role: 'article',\n filter: (data): data is { subject: SettingsStore<PresenterSettingsProps> } =>\n data.subject instanceof SettingsStore && data.subject.prefix === meta.id,\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,KAAKD,EAAE;IACdE,MAAM;IACNC,UAAU;IACVC,QAAQ,CAACC,SACP,CAAC,CAACA,KAAKC,WACP,OAAOD,KAAKC,YAAY,YACxB,UAAUD,KAAKC,WACf,YAAYD,KAAKC,WACjBD,KAAKC,QAAQC,SAASN,KAAKD,MAC3BQ,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,KAAKD,EAAE;IACdE,MAAM;IACNC,UAAU;IACVC,QAAQ,CAACC,SACP,CAAC,CAACA,KAAKC,WACP,OAAOD,KAAKC,YAAY,YACxB,UAAUD,KAAKC,WACf,YAAYD,KAAKC,WACjBD,KAAKC,QAAQC,SAASN,KAAKD,MAC3BQ,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,KAAKD,EAAE;IACdE,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,KAAKD,EAAE;IACdE,MAAM;IACNE,QAAQ,CAACC,SACPA,KAAKC,mBAAmBe,iBAAiBhB,KAAKC,QAAQgB,WAAWrB,KAAKD;IACxEa,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", "meta", "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-7DV6S5XB.mjs";
|
|
4
|
-
import {
|
|
5
|
-
meta
|
|
6
|
-
} from "./chunk-6ZM323ED.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-7A4A2H6X.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":"AAQA,OAAO,EAA8B,KAAK,aAAa,EAA6B,MAAM,qBAAqB,CAAC;yBAYhG,SAAS,aAAa;AAAtC,wBA4FI"}
|
|
@@ -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,7 +0,0 @@
|
|
|
1
|
-
import { type FC } from 'react';
|
|
2
|
-
import { type DataType } from '@dxos/schema';
|
|
3
|
-
declare const CollectionPresenterContainer: FC<{
|
|
4
|
-
collection: DataType.Collection;
|
|
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;AAI7D,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAO7C,QAAA,MAAM,4BAA4B,EAAE,EAAE,CAAC;IAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAA;CAAE,CA0BzE,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type FC } from 'react';
|
|
2
|
-
import { type Markdown } from '@dxos/plugin-markdown/types';
|
|
3
|
-
declare const DocumentPresenterContainer: FC<{
|
|
4
|
-
document: Markdown.Document;
|
|
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,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAO5D,QAAA,MAAM,0BAA0B,EAAE,EAAE,CAAC;IAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAA;CAAE,CAQnE,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownSlide.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownSlide.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAI5D,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC;IAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAA;CAAE,CAWtD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PresenterSettings.d.ts","sourceRoot":"","sources":["../../../../src/components/PresenterSettings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD,eAAO,MAAM,iBAAiB,GAAI,cAAc;IAAE,QAAQ,EAAE,sBAAsB,CAAA;CAAE,sBAiBnF,CAAC"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
-
import * as Function from 'effect/Function';
|
|
7
|
-
import * as Option from 'effect/Option';
|
|
8
|
-
|
|
9
|
-
import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
10
|
-
import { Obj } from '@dxos/echo';
|
|
11
|
-
import { DeckCapabilities } from '@dxos/plugin-deck';
|
|
12
|
-
import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
|
|
13
|
-
import { createExtension, rxFromSignal } from '@dxos/plugin-graph';
|
|
14
|
-
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
15
|
-
import { fullyQualifiedId, getSpace } from '@dxos/react-client/echo';
|
|
16
|
-
import { DataType } from '@dxos/schema';
|
|
17
|
-
|
|
18
|
-
import { meta } from '../meta';
|
|
19
|
-
import { PresenterAction, type PresenterSettingsProps } from '../types';
|
|
20
|
-
|
|
21
|
-
export default (context: PluginContext) =>
|
|
22
|
-
contributes(
|
|
23
|
-
Capabilities.AppGraphBuilder,
|
|
24
|
-
createExtension({
|
|
25
|
-
id: meta.id,
|
|
26
|
-
// TODO(wittjosiah): This is a hack to work around presenter previously relying on "variant". Remove.
|
|
27
|
-
connector: (node) =>
|
|
28
|
-
Rx.make((get) =>
|
|
29
|
-
Function.pipe(
|
|
30
|
-
get(node),
|
|
31
|
-
Option.flatMap((node) => {
|
|
32
|
-
const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
|
|
33
|
-
const settings = get(rxFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(meta.id)?.value));
|
|
34
|
-
const isPresentable = settings?.presentCollections
|
|
35
|
-
? Obj.instanceOf(DataType.Collection, node.data) || Obj.instanceOf(Markdown.Document, node.data)
|
|
36
|
-
: Obj.instanceOf(Markdown.Document, node.data);
|
|
37
|
-
return isPresentable ? Option.some(node.data) : Option.none();
|
|
38
|
-
}),
|
|
39
|
-
Option.map((object) => {
|
|
40
|
-
const id = fullyQualifiedId(object);
|
|
41
|
-
return [
|
|
42
|
-
{
|
|
43
|
-
id: [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
44
|
-
data: { type: meta.id, object },
|
|
45
|
-
type: meta.id,
|
|
46
|
-
properties: {
|
|
47
|
-
label: 'Presenter',
|
|
48
|
-
icon: 'ph--presentation--regular',
|
|
49
|
-
disposition: 'hidden',
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
];
|
|
53
|
-
}),
|
|
54
|
-
Option.getOrElse(() => []),
|
|
55
|
-
),
|
|
56
|
-
),
|
|
57
|
-
actions: (node) =>
|
|
58
|
-
Rx.make((get) =>
|
|
59
|
-
Function.pipe(
|
|
60
|
-
get(node),
|
|
61
|
-
Option.flatMap((node) => {
|
|
62
|
-
const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
|
|
63
|
-
const settings = get(rxFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(meta.id)?.value));
|
|
64
|
-
const isPresentable = settings?.presentCollections
|
|
65
|
-
? Obj.instanceOf(DataType.Collection, node.data) || Obj.instanceOf(Markdown.Document, node.data)
|
|
66
|
-
: Obj.instanceOf(Markdown.Document, node.data);
|
|
67
|
-
return isPresentable ? Option.some(node.data) : Option.none();
|
|
68
|
-
}),
|
|
69
|
-
Option.map((object) => {
|
|
70
|
-
const id = fullyQualifiedId(object);
|
|
71
|
-
const spaceId = getSpace(object)?.id;
|
|
72
|
-
return [
|
|
73
|
-
{
|
|
74
|
-
id: `${PresenterAction.TogglePresentation._tag}/${id}`,
|
|
75
|
-
// TODO(burdon): Allow function so can generate state when activated.
|
|
76
|
-
// So can set explicit fullscreen state coordinated with current presenter state.
|
|
77
|
-
data: async () => {
|
|
78
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
79
|
-
const layout = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
80
|
-
const presenterId = [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR);
|
|
81
|
-
if (!layout.deck.fullscreen) {
|
|
82
|
-
void dispatch(
|
|
83
|
-
createIntent(DeckAction.Adjust, {
|
|
84
|
-
type: 'solo--fullscreen',
|
|
85
|
-
id: presenterId,
|
|
86
|
-
}),
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
await dispatch(
|
|
90
|
-
createIntent(LayoutAction.Open, {
|
|
91
|
-
part: 'main',
|
|
92
|
-
subject: [presenterId],
|
|
93
|
-
options: { workspace: spaceId },
|
|
94
|
-
}),
|
|
95
|
-
);
|
|
96
|
-
},
|
|
97
|
-
properties: {
|
|
98
|
-
label: ['toggle presentation label', { ns: meta.id }],
|
|
99
|
-
icon: 'ph--presentation--regular',
|
|
100
|
-
disposition: 'list-item',
|
|
101
|
-
keyBinding: {
|
|
102
|
-
macos: 'shift+meta+p',
|
|
103
|
-
windows: 'shift+alt+p',
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
];
|
|
108
|
-
}),
|
|
109
|
-
Option.getOrElse(() => []),
|
|
110
|
-
),
|
|
111
|
-
),
|
|
112
|
-
}),
|
|
113
|
-
);
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
-
import { Obj } from '@dxos/echo';
|
|
9
|
-
import { SettingsStore } from '@dxos/local-storage';
|
|
10
|
-
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
11
|
-
import { DataType } from '@dxos/schema';
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
CollectionPresenterContainer,
|
|
15
|
-
DocumentPresenterContainer,
|
|
16
|
-
MarkdownSlide,
|
|
17
|
-
PresenterSettings,
|
|
18
|
-
} from '../components';
|
|
19
|
-
import { meta } from '../meta';
|
|
20
|
-
import { type PresenterSettingsProps } from '../types';
|
|
21
|
-
|
|
22
|
-
export default () =>
|
|
23
|
-
contributes(Capabilities.ReactSurface, [
|
|
24
|
-
createSurface({
|
|
25
|
-
id: `${meta.id}/document`,
|
|
26
|
-
role: 'article',
|
|
27
|
-
position: 'hoist',
|
|
28
|
-
filter: (data): data is { subject: { type: typeof meta.id; object: Markdown.Document } } =>
|
|
29
|
-
!!data.subject &&
|
|
30
|
-
typeof data.subject === 'object' &&
|
|
31
|
-
'type' in data.subject &&
|
|
32
|
-
'object' in data.subject &&
|
|
33
|
-
data.subject.type === meta.id &&
|
|
34
|
-
Obj.instanceOf(Markdown.Document, data.subject.object),
|
|
35
|
-
component: ({ data }) => <DocumentPresenterContainer document={data.subject.object} />,
|
|
36
|
-
}),
|
|
37
|
-
createSurface({
|
|
38
|
-
id: `${meta.id}/collection`,
|
|
39
|
-
role: 'article',
|
|
40
|
-
position: 'hoist',
|
|
41
|
-
filter: (data): data is { subject: { type: typeof meta.id; object: DataType.Collection } } =>
|
|
42
|
-
!!data.subject &&
|
|
43
|
-
typeof data.subject === 'object' &&
|
|
44
|
-
'type' in data.subject &&
|
|
45
|
-
'object' in data.subject &&
|
|
46
|
-
data.subject.type === meta.id &&
|
|
47
|
-
Obj.instanceOf(DataType.Collection, data.subject.object),
|
|
48
|
-
component: ({ data }) => <CollectionPresenterContainer collection={data.subject.object} />,
|
|
49
|
-
}),
|
|
50
|
-
createSurface({
|
|
51
|
-
id: `${meta.id}/slide`,
|
|
52
|
-
role: 'slide',
|
|
53
|
-
filter: (data): data is { subject: Markdown.Document } => Obj.instanceOf(Markdown.Document, data.subject),
|
|
54
|
-
component: ({ data }) => <MarkdownSlide document={data.subject} />,
|
|
55
|
-
}),
|
|
56
|
-
createSurface({
|
|
57
|
-
id: `${meta.id}/plugin-settings`,
|
|
58
|
-
role: 'article',
|
|
59
|
-
filter: (data): data is { subject: SettingsStore<PresenterSettingsProps> } =>
|
|
60
|
-
data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
|
|
61
|
-
component: ({ data: { subject } }) => <PresenterSettings settings={subject.value} />,
|
|
62
|
-
}),
|
|
63
|
-
]);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
6
|
-
import { live } from '@dxos/live-object';
|
|
7
|
-
|
|
8
|
-
import { meta } from '../meta';
|
|
9
|
-
import { type PresenterSettingsProps, PresenterSettingsSchema } from '../types';
|
|
10
|
-
|
|
11
|
-
export default () => {
|
|
12
|
-
const settings = live<PresenterSettingsProps>({});
|
|
13
|
-
|
|
14
|
-
return contributes(Capabilities.Settings, {
|
|
15
|
-
prefix: meta.id,
|
|
16
|
-
schema: PresenterSettingsSchema,
|
|
17
|
-
value: settings,
|
|
18
|
-
});
|
|
19
|
-
};
|
|
@@ -1,44 +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 { StackItem } from '@dxos/react-ui-stack';
|
|
9
|
-
import { type DataType } from '@dxos/schema';
|
|
10
|
-
|
|
11
|
-
import { PresenterContext } from '../types';
|
|
12
|
-
import { useExitPresenter } from '../useExitPresenter';
|
|
13
|
-
|
|
14
|
-
import { Layout, PageNumber, Pager } from './Presenter';
|
|
15
|
-
|
|
16
|
-
const CollectionPresenterContainer: FC<{ collection: DataType.Collection }> = ({ collection }) => {
|
|
17
|
-
const [slide, setSlide] = useState(0);
|
|
18
|
-
|
|
19
|
-
const { running } = useContext(PresenterContext);
|
|
20
|
-
|
|
21
|
-
const handleExit = useExitPresenter(collection);
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<StackItem.Content classNames='relative'>
|
|
25
|
-
<Layout
|
|
26
|
-
bottomRight={<PageNumber index={slide} count={collection.objects.length} />}
|
|
27
|
-
bottomLeft={
|
|
28
|
-
<Pager
|
|
29
|
-
index={slide}
|
|
30
|
-
count={collection.objects.length}
|
|
31
|
-
keys={running}
|
|
32
|
-
onChange={setSlide}
|
|
33
|
-
onExit={handleExit}
|
|
34
|
-
/>
|
|
35
|
-
}
|
|
36
|
-
>
|
|
37
|
-
{/* TODO(wittjosiah): Better slide placeholder. */}
|
|
38
|
-
<Surface role='slide' data={{ subject: collection.objects[slide] }} placeholder={<></>} />
|
|
39
|
-
</Layout>
|
|
40
|
-
</StackItem.Content>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export default CollectionPresenterContainer;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
import React, { type FC } from 'react';
|
|
5
|
-
|
|
6
|
-
import { type Markdown } from '@dxos/plugin-markdown/types';
|
|
7
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
8
|
-
|
|
9
|
-
import { useExitPresenter } from '../useExitPresenter';
|
|
10
|
-
|
|
11
|
-
import { RevealPlayer } from './RevealPlayer';
|
|
12
|
-
|
|
13
|
-
const DocumentPresenterContainer: FC<{ document: Markdown.Document }> = ({ document }) => {
|
|
14
|
-
const handleExit = useExitPresenter(document);
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<StackItem.Content classNames='relative'>
|
|
18
|
-
<RevealPlayer content={document.content.target?.content ?? ''} onExit={handleExit} />
|
|
19
|
-
</StackItem.Content>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default DocumentPresenterContainer;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Input, useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
9
|
-
|
|
10
|
-
import { meta } from '../meta';
|
|
11
|
-
import { type PresenterSettingsProps } from '../types';
|
|
12
|
-
|
|
13
|
-
export const PresenterSettings = ({ settings }: { settings: PresenterSettingsProps }) => {
|
|
14
|
-
const { t } = useTranslation(meta.id);
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<ControlPage>
|
|
18
|
-
<ControlSection title={t('settings title', { ns: meta.id })}>
|
|
19
|
-
<ControlGroup>
|
|
20
|
-
<ControlItemInput title={t('present collections label')}>
|
|
21
|
-
<Input.Switch
|
|
22
|
-
checked={settings.presentCollections}
|
|
23
|
-
onCheckedChange={(checked) => (settings.presentCollections = !!checked)}
|
|
24
|
-
/>
|
|
25
|
-
</ControlItemInput>
|
|
26
|
-
</ControlGroup>
|
|
27
|
-
</ControlSection>
|
|
28
|
-
</ControlPage>
|
|
29
|
-
);
|
|
30
|
-
};
|