@dxos/plugin-presenter 0.7.5-main.9cb18ac → 0.7.5-main.9d2a38b
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-TQE4OZK2.mjs → PresenterMain-2RSALOUX.mjs} +6 -6
- package/dist/lib/browser/PresenterMain-2RSALOUX.mjs.map +7 -0
- package/dist/lib/browser/{RevealMain-JGKAQMQ4.mjs → RevealMain-SWCWANYN.mjs} +6 -5
- package/dist/lib/browser/{RevealMain-JGKAQMQ4.mjs.map → RevealMain-SWCWANYN.mjs.map} +3 -3
- package/dist/lib/browser/app-graph-builder-6U7WTJKG.mjs +54 -0
- package/dist/lib/browser/app-graph-builder-6U7WTJKG.mjs.map +7 -0
- package/dist/lib/browser/chunk-MSAMS5TA.mjs +16 -0
- package/dist/lib/browser/chunk-MSAMS5TA.mjs.map +7 -0
- package/dist/lib/browser/chunk-P2BIPL4V.mjs +31 -0
- package/dist/lib/browser/chunk-P2BIPL4V.mjs.map +7 -0
- package/dist/lib/browser/{chunk-67PDV7KN.mjs → chunk-Q5U3VOZB.mjs} +3 -3
- package/dist/lib/browser/chunk-Q5U3VOZB.mjs.map +7 -0
- package/dist/lib/browser/{chunk-Z6QQB6KB.mjs → chunk-SFMK6EE3.mjs} +7 -3
- package/dist/lib/browser/chunk-SFMK6EE3.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +60 -172
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-CAYS4SCJ.mjs +46 -0
- package/dist/lib/browser/intent-resolver-CAYS4SCJ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-context-A3AXJRTF.mjs +30 -0
- package/dist/lib/browser/react-context-A3AXJRTF.mjs.map +7 -0
- package/dist/lib/browser/react-surface-U7AXT65E.mjs +58 -0
- package/dist/lib/browser/react-surface-U7AXT65E.mjs.map +7 -0
- package/dist/lib/browser/settings-L73ZKGLV.mjs +22 -0
- package/dist/lib/browser/settings-L73ZKGLV.mjs.map +7 -0
- package/dist/lib/browser/state-IGJRHRIA.mjs +18 -0
- package/dist/lib/browser/state-IGJRHRIA.mjs.map +7 -0
- package/dist/types/src/PresenterPlugin.d.ts +1 -3
- package/dist/types/src/PresenterPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +8 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +188 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context.d.ts +8 -0
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +4 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +4 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/components/RevealMain.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +4 -5
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +21 -29
- package/src/PresenterPlugin.tsx +47 -141
- package/src/capabilities/app-graph-builder.ts +51 -0
- package/src/capabilities/capabilities.ts +13 -0
- package/src/capabilities/index.ts +14 -0
- package/src/capabilities/intent-resolver.ts +42 -0
- package/src/capabilities/react-context.tsx +31 -0
- package/src/capabilities/react-surface.tsx +48 -0
- package/src/capabilities/settings.ts +19 -0
- package/src/capabilities/state.ts +17 -0
- package/src/components/PresenterMain.tsx +3 -3
- package/src/components/RevealMain.tsx +3 -2
- package/src/index.ts +2 -4
- package/src/meta.ts +1 -1
- package/src/types.ts +6 -15
- package/dist/lib/browser/PresenterMain-TQE4OZK2.mjs.map +0 -7
- package/dist/lib/browser/chunk-67PDV7KN.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z6QQB6KB.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -9
- package/dist/lib/browser/meta.mjs.map +0 -7
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PresenterAction,
|
|
3
3
|
PresenterContext
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-SFMK6EE3.mjs";
|
|
5
|
+
import "./chunk-Q5U3VOZB.mjs";
|
|
6
6
|
|
|
7
7
|
// packages/plugins/plugin-presenter/src/components/PresenterMain.tsx
|
|
8
8
|
import React3, { useContext, useState } from "react";
|
|
9
|
-
import { Surface, useIntentDispatcher,
|
|
9
|
+
import { Surface, useIntentDispatcher, createIntent, Capabilities, useCapability } from "@dxos/app-framework";
|
|
10
10
|
import { Main } from "@dxos/react-ui";
|
|
11
11
|
import { baseSurface, topbarBlockPaddingStart, fixedInsetFlexLayout, bottombarBlockPaddingEnd } from "@dxos/react-ui-theme";
|
|
12
12
|
|
|
@@ -145,8 +145,8 @@ var StartButton = ({ running, onClick }) => {
|
|
|
145
145
|
// packages/plugins/plugin-presenter/src/components/PresenterMain.tsx
|
|
146
146
|
var PresenterMain = ({ collection }) => {
|
|
147
147
|
const [slide, setSlide] = useState(0);
|
|
148
|
-
const
|
|
149
|
-
const fullscreen =
|
|
148
|
+
const layout = useCapability(Capabilities.Layout);
|
|
149
|
+
const fullscreen = layout.layoutMode === "fullscreen";
|
|
150
150
|
const { running } = useContext(PresenterContext);
|
|
151
151
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
152
152
|
const handleSetRunning = (running2) => {
|
|
@@ -190,4 +190,4 @@ var PresenterMain_default = PresenterMain;
|
|
|
190
190
|
export {
|
|
191
191
|
PresenterMain_default as default
|
|
192
192
|
};
|
|
193
|
-
//# sourceMappingURL=PresenterMain-
|
|
193
|
+
//# sourceMappingURL=PresenterMain-2RSALOUX.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/PresenterMain.tsx", "../../../src/components/Presenter/Layout.tsx", "../../../src/components/Presenter/Pager.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC, useContext, useState } from 'react';\n\nimport { Surface, useIntentDispatcher, createIntent, Capabilities, useCapability } from '@dxos/app-framework';\nimport { type CollectionType } from '@dxos/plugin-space/types';\nimport { Main } from '@dxos/react-ui';\nimport {\n baseSurface,\n topbarBlockPaddingStart,\n fixedInsetFlexLayout,\n bottombarBlockPaddingEnd,\n} from '@dxos/react-ui-theme';\n\nimport { Layout, PageNumber, Pager, StartButton } from './Presenter';\nimport { PresenterContext, PresenterAction } from '../types';\n\nconst PresenterMain: FC<{ collection: CollectionType }> = ({ collection }) => {\n const [slide, setSlide] = useState(0);\n\n // TODO(burdon): Should not depend on split screen.\n const layout = useCapability(Capabilities.Layout);\n const fullscreen = layout.layoutMode === 'fullscreen';\n const { running } = useContext(PresenterContext);\n\n // TODO(burdon): Currently conflates fullscreen and running.\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const handleSetRunning = (running: boolean) => {\n void dispatch(createIntent(PresenterAction.TogglePresentation, { object: collection, state: running }));\n };\n\n return (\n <Main.Content\n classNames={[\n baseSurface,\n fixedInsetFlexLayout,\n !fullscreen && topbarBlockPaddingStart,\n !fullscreen && bottombarBlockPaddingEnd,\n ]}\n >\n <Layout\n topRight={<StartButton running={running} onClick={(running) => handleSetRunning(running)} />}\n bottomRight={<PageNumber index={slide} count={collection.objects.length} />}\n bottomLeft={\n <Pager\n index={slide}\n count={collection.objects.length}\n keys={running}\n onChange={setSlide}\n onExit={() => handleSetRunning(false)}\n />\n }\n >\n {/* TODO(wittjosiah): Better slide placeholder. */}\n <Surface role='slide' data={{ subject: collection.objects[slide] }} placeholder={<></>} />\n </Layout>\n </Main.Content>\n );\n};\n\nexport default PresenterMain;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type PropsWithChildren, type ReactNode } from 'react';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\n\nexport type LayoutProps = ThemedClassName<\n PropsWithChildren<{\n className?: string;\n topLeft?: ReactNode;\n topRight?: ReactNode;\n bottomLeft?: ReactNode;\n bottomRight?: ReactNode;\n }>\n>;\n\nexport const Layout = ({ children, classNames, topLeft, topRight, bottomLeft, bottomRight }: LayoutProps) => {\n return (\n <div className={mx('flex grow relative overflow-hidden bg-attention', classNames)}>\n <div className={mx('flex flex-col grow overflow-hidden')}>{children}</div>\n\n <div className='z-[200]'>\n <div className='absolute top-4 left-4'>{topLeft}</div>\n <div className='absolute top-4 right-4'>{topRight}</div>\n <div className='absolute bottom-4 left-4'>{bottomLeft}</div>\n <div className='absolute bottom-4 right-4'>{bottomRight}</div>\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Play, X, CaretDoubleLeft, CaretDoubleRight, CaretLeft, CaretRight } from '@phosphor-icons/react';\nimport React, { type FC, useEffect } from 'react';\n\nimport { Button, useControlledValue } from '@dxos/react-ui';\nimport { getSize, mx } from '@dxos/react-ui-theme';\n\nexport type PagerProps = {\n index?: number;\n count?: number;\n keys?: boolean; // TODO(burdon): Rename.\n onChange?: (index: number) => void;\n onExit?: () => void;\n};\n\nexport const Pager = ({ index: controlledIndex = 0, count = 0, keys, onChange, onExit }: PagerProps) => {\n const [index, setIndex] = useControlledValue(controlledIndex);\n useEffect(() => {\n onChange?.(index);\n }, [index]);\n\n const handleChangeIndex = (dir: number) => {\n setIndex((index) => {\n const next = index + dir;\n return next >= 0 && next < count ? next : index;\n });\n };\n\n // TODO(burdon): Standardize via system key binding.\n useEffect(() => {\n if (!keys) {\n return;\n }\n\n const keydownHandler = (event: KeyboardEvent) => {\n switch (event.key) {\n case 'Escape': {\n onExit?.();\n break;\n }\n case 'ArrowLeft': {\n if (event.shiftKey) {\n onChange?.(0);\n } else {\n handleChangeIndex(-1);\n }\n break;\n }\n case 'ArrowRight': {\n if (event.shiftKey) {\n onChange?.(count - 1);\n } else {\n handleChangeIndex(1);\n }\n break;\n }\n case 'ArrowUp': {\n onChange?.(0);\n break;\n }\n case 'ArrowDown': {\n onChange?.(count - 1);\n break;\n }\n }\n };\n\n window.addEventListener('keydown', keydownHandler);\n return () => window.removeEventListener('keydown', keydownHandler);\n }, [keys, count]);\n\n if (index === undefined || !count) {\n return null;\n }\n\n return (\n <div className='flex items-center text-neutral-500'>\n <Button variant='ghost' classNames='p-0' onClick={() => onChange?.(0)}>\n <CaretDoubleLeft className={mx(getSize(6))} />\n </Button>\n <Button variant='ghost' classNames='p-0' onClick={() => handleChangeIndex(-1)}>\n <CaretLeft className={mx(getSize(6))} />\n </Button>\n <Button variant='ghost' classNames='p-0' onClick={() => handleChangeIndex(1)}>\n <CaretRight className={mx(getSize(6))} />\n </Button>\n <Button variant='ghost' classNames='p-0' onClick={() => onChange?.(count - 1)}>\n <CaretDoubleRight className={mx(getSize(6))} />\n </Button>\n </div>\n );\n};\n\nexport type PageNumberProps = {\n index?: number;\n count?: number;\n};\n\nexport const PageNumber = ({ index = 0, count = 1 }: PageNumberProps) => {\n if (index === undefined || !count) {\n return null;\n }\n\n return (\n <div className='flex items-center text-neutral-500 text-2xl'>\n <div>\n {index + 1} / {count}\n </div>\n </div>\n );\n};\n\nexport const StartButton: FC<{ running?: boolean; onClick?: (start: boolean) => void }> = ({ running, onClick }) => {\n return (\n <Button variant='ghost' classNames='p-0' onClick={() => onClick?.(!running)}>\n {(running && <X className={mx(getSize(6))} />) || <Play className={mx(getSize(6))} />}\n </Button>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAIA,OAAOA,UAAkBC,YAAYC,gBAAgB;AAErD,SAASC,SAASC,qBAAqBC,cAAcC,cAAcC,qBAAqB;AAExF,SAASC,YAAY;AACrB,SACEC,aACAC,yBACAC,sBACAC,gCACK;;;ACVP,OAAOC,WAAuD;AAG9D,SAASC,UAAU;AAYZ,IAAMC,SAAS,CAAC,EAAEC,UAAUC,YAAYC,SAASC,UAAUC,YAAYC,YAAW,MAAe;AACtG,SACE,sBAAA,cAACC,OAAAA;IAAIC,WAAWC,GAAG,mDAAmDP,UAAAA;KACpE,sBAAA,cAACK,OAAAA;IAAIC,WAAWC,GAAG,oCAAA;KAAwCR,QAAAA,GAE3D,sBAAA,cAACM,OAAAA;IAAIC,WAAU;KACb,sBAAA,cAACD,OAAAA;IAAIC,WAAU;KAAyBL,OAAAA,GACxC,sBAAA,cAACI,OAAAA;IAAIC,WAAU;KAA0BJ,QAAAA,GACzC,sBAAA,cAACG,OAAAA;IAAIC,WAAU;KAA4BH,UAAAA,GAC3C,sBAAA,cAACE,OAAAA;IAAIC,WAAU;KAA6BF,WAAAA,CAAAA,CAAAA;AAIpD;;;AC5BA,SAASI,MAAMC,GAAGC,iBAAiBC,kBAAkBC,WAAWC,kBAAkB;AAClF,OAAOC,UAAkBC,iBAAiB;AAE1C,SAASC,QAAQC,0BAA0B;AAC3C,SAASC,SAASC,MAAAA,WAAU;AAUrB,IAAMC,QAAQ,CAAC,EAAEC,OAAOC,kBAAkB,GAAGC,QAAQ,GAAGC,MAAMC,UAAUC,OAAM,MAAc;AACjG,QAAM,CAACL,OAAOM,QAAAA,IAAYC,mBAAmBN,eAAAA;AAC7CO,YAAU,MAAA;AACRJ,eAAWJ,KAAAA;EACb,GAAG;IAACA;GAAM;AA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AAMC,mBAAmB,CAACN,aAAAA;AACxB,SAAKI,SAASG,aAAaC,gBAAgBC,oBAAoB;MAAEC,QAAQpB;MAAYqB,OAAOX;IAAQ,CAAA,CAAA;EACtG;AAEA,SACE,gBAAAY,OAAA,cAACC,KAAKC,SAAO;IACXC,YAAY;MACVC;MACAC;MACA,CAACnB,cAAcoB;MACf,CAACpB,cAAcqB;;KAGjB,gBAAAP,OAAA,cAACf,QAAAA;IACCuB,UAAU,gBAAAR,OAAA,cAACS,aAAAA;MAAYrB;MAAkBsB,SAAS,CAACtB,aAAYM,iBAAiBN,QAAAA;;IAChFuB,aAAa,gBAAAX,OAAA,cAACY,YAAAA;MAAWC,OAAOlC;MAAOmC,OAAOpC,WAAWqC,QAAQC;;IACjEC,YACE,gBAAAjB,OAAA,cAACkB,OAAAA;MACCL,OAAOlC;MACPmC,OAAOpC,WAAWqC,QAAQC;MAC1BG,MAAM/B;MACNgC,UAAUxC;MACVyC,QAAQ,MAAM3B,iBAAiB,KAAA;;KAKnC,gBAAAM,OAAA,cAACsB,SAAAA;IAAQC,MAAK;IAAQC,MAAM;MAAEC,SAAS/C,WAAWqC,QAAQpC,KAAAA;IAAO;IAAG+C,aAAa,gBAAA1B,OAAA,cAAAA,OAAA,UAAA,IAAA;;AAIzF;AAEA,IAAA,wBAAevB;",
|
|
6
|
+
"names": ["React", "useContext", "useState", "Surface", "useIntentDispatcher", "createIntent", "Capabilities", "useCapability", "Main", "baseSurface", "topbarBlockPaddingStart", "fixedInsetFlexLayout", "bottombarBlockPaddingEnd", "React", "mx", "Layout", "children", "classNames", "topLeft", "topRight", "bottomLeft", "bottomRight", "div", "className", "mx", "Play", "X", "CaretDoubleLeft", "CaretDoubleRight", "CaretLeft", "CaretRight", "React", "useEffect", "Button", "useControlledValue", "getSize", "mx", "Pager", "index", "controlledIndex", "count", "keys", "onChange", "onExit", "setIndex", "useControlledValue", "useEffect", "handleChangeIndex", "dir", "next", "keydownHandler", "event", "key", "shiftKey", "window", "addEventListener", "removeEventListener", "undefined", "React", "div", "className", "Button", "variant", "classNames", "onClick", "CaretDoubleLeft", "mx", "getSize", "CaretLeft", "CaretRight", "CaretDoubleRight", "PageNumber", "StartButton", "running", "X", "Play", "PresenterMain", "collection", "slide", "setSlide", "useState", "layout", "useCapability", "Capabilities", "Layout", "fullscreen", "layoutMode", "running", "useContext", "PresenterContext", "dispatchPromise", "dispatch", "useIntentDispatcher", "handleSetRunning", "createIntent", "PresenterAction", "TogglePresentation", "object", "state", "React", "Main", "Content", "classNames", "baseSurface", "fixedInsetFlexLayout", "topbarBlockPaddingStart", "bottombarBlockPaddingEnd", "topRight", "StartButton", "onClick", "bottomRight", "PageNumber", "index", "count", "objects", "length", "bottomLeft", "Pager", "keys", "onChange", "onExit", "Surface", "role", "data", "subject", "placeholder"]
|
|
7
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PresenterAction
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-SFMK6EE3.mjs";
|
|
4
|
+
import "./chunk-Q5U3VOZB.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/plugins/plugin-presenter/src/components/RevealMain.tsx
|
|
7
7
|
import React2 from "react";
|
|
8
|
-
import { useIntentDispatcher,
|
|
8
|
+
import { useIntentDispatcher, createIntent, useCapability, Capabilities } from "@dxos/app-framework";
|
|
9
9
|
import { Main } from "@dxos/react-ui";
|
|
10
10
|
import { topbarBlockPaddingStart, fixedInsetFlexLayout, bottombarBlockPaddingEnd } from "@dxos/react-ui-theme";
|
|
11
11
|
|
|
@@ -129,7 +129,8 @@ var RevealPlayer = ({ content, slide, onExit }) => {
|
|
|
129
129
|
|
|
130
130
|
// packages/plugins/plugin-presenter/src/components/RevealMain.tsx
|
|
131
131
|
var PresenterMain = ({ document }) => {
|
|
132
|
-
const
|
|
132
|
+
const layout = useCapability(Capabilities.Layout);
|
|
133
|
+
const fullscreen = layout.layoutMode === "fullscreen";
|
|
133
134
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
134
135
|
return /* @__PURE__ */ React2.createElement(Main.Content, {
|
|
135
136
|
classNames: [
|
|
@@ -151,4 +152,4 @@ var RevealMain_default = PresenterMain;
|
|
|
151
152
|
export {
|
|
152
153
|
RevealMain_default as default
|
|
153
154
|
};
|
|
154
|
-
//# sourceMappingURL=RevealMain-
|
|
155
|
+
//# sourceMappingURL=RevealMain-SWCWANYN.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/RevealMain.tsx", "../../../src/components/Reveal/Reveal.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC } from 'react';\n\nimport { useIntentDispatcher,
|
|
5
|
-
"mappings": ";;;;;;AAIA,OAAOA,YAAwB;AAE/B,SAASC,qBAAqBC,
|
|
6
|
-
"names": ["React", "useIntentDispatcher", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC } from 'react';\n\nimport { useIntentDispatcher, createIntent, useCapability, Capabilities } from '@dxos/app-framework';\nimport { type DocumentType } from '@dxos/plugin-markdown/types';\nimport { Main } from '@dxos/react-ui';\nimport { topbarBlockPaddingStart, fixedInsetFlexLayout, bottombarBlockPaddingEnd } from '@dxos/react-ui-theme';\n\nimport { RevealPlayer } from './Reveal';\nimport { PresenterAction } from '../types';\n\nconst PresenterMain: FC<{ document: DocumentType }> = ({ document }) => {\n const layout = useCapability(Capabilities.Layout);\n const fullscreen = layout.layoutMode === 'fullscreen';\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n return (\n <Main.Content\n classNames={[\n fixedInsetFlexLayout,\n !fullscreen && topbarBlockPaddingStart,\n !fullscreen && bottombarBlockPaddingEnd,\n ]}\n >\n <RevealPlayer\n content={document.content.target?.content ?? ''}\n onExit={() => {\n void dispatch(createIntent(PresenterAction.TogglePresentation, { object: document, state: false }));\n }}\n />\n </Main.Content>\n );\n};\n\nexport default PresenterMain;\n", "//\n// Copyright 2024 DXOS.org\n//\n\n// eslint-disable-next-line no-restricted-imports\nimport 'reveal.js/dist/reveal.css';\n// eslint-disable-next-line no-restricted-imports\nimport 'reveal.js/dist/theme/black.css';\n\nimport React, { useEffect, useRef } from 'react';\nimport Reveal from 'reveal.js';\nimport Markdown from 'reveal.js/plugin/markdown/plugin.js';\n// import Notes from 'reveal.js/plugin/notes/notes.js';\n\nconst styles = `\n<style type=\"text/css\">\n .reveal h1 {\n font-weight: 100;\n padding-left: 36px;\n opacity: 0.5;\n }\n .reveal h2 {\n font-weight: 100;\n padding-top: 60px;\n padding-left: 40px;\n font-size: 48px;\n opacity: 0.3;\n }\n .reveal h1, h2, p {\n font-family: \"Raleway\", sans-serif;\n text-align: left;\n font-weight: 200;\n }\n .reveal ul {\n font-family: \"Raleway\", sans-serif;\n display: block;\n list-style: \"- \";\n }\n .reveal blockquote p {\n text-align: center;\n font-weight: 100;\n padding: 32px;\n }\n</style>\n`;\n\nexport type RevealProps = {\n content: string;\n slide?: number;\n onExit?: () => void;\n};\n\n// https://revealjs.com/react\nexport const RevealPlayer = ({ content, slide, onExit }: RevealProps) => {\n const deckDivRef = useRef<HTMLDivElement>(null);\n const deckRef = useRef<Reveal.Api | null>(null);\n useEffect(() => {\n if (deckRef.current) {\n return;\n }\n\n setTimeout(async () => {\n // https://revealjs.com/config\n // https://github.com/hakimel/reveal.js\n // TODO(burdon): Fragments and scroll view steps 2 at a time (safe mode?)\n deckRef.current = new Reveal(deckDivRef.current!, {\n // view: 'scroll',\n progress: false,\n transition: 'none',\n slideNumber: false,\n embedded: true,\n // https://revealjs.com/speaker-view\n showNotes: false,\n\n center: true,\n margin: 0.01,\n minScale: 0.2,\n maxScale: 1.4,\n\n // https://revealjs.com/markdown\n plugins: [\n Markdown,\n // TODO(burdon): Requires server to serve popout window.\n // Notes\n ],\n\n // See https://marked.js.org/using_advanced#options\n markdown: {\n gfm: true,\n },\n });\n\n await deckRef.current.initialize();\n if (slide !== undefined) {\n deckRef.current.slide(slide < 0 ? deckRef.current?.getTotalSlides() + slide : slide - 1);\n }\n // TODO(burdon): Translation.\n deckRef.current.addKeyBinding({ keyCode: 27, key: 'Escape', description: 'Exit full screen' }, () => {\n onExit?.();\n });\n });\n\n return () => {\n try {\n if (deckRef.current) {\n deckRef.current.destroy();\n deckRef.current = null;\n }\n } catch (err) {\n // Ignore.\n }\n };\n });\n\n return (\n <div className='absolute inset-0 h-full'>\n <div ref={deckDivRef} className='reveal'>\n {/* TODO(burdon): Must be in head. */}\n <style>\n <link rel='preconnect' href='https://fonts.googleapis.com' />\n <link rel='preconnect' href='https://fonts.gstatic.com' {...{ crossOrigin: '' }} />\n <link\n href='https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap'\n rel='stylesheet'\n />\n </style>\n <div className='slides'>\n <div className='!text-center' />\n <section {...{ 'data-markdown': [] }}>\n <textarea {...{ 'data-template': true }} defaultValue={[styles, content].join('\\n')}></textarea>\n </section>\n </div>\n </div>\n </div>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,OAAOA,YAAwB;AAE/B,SAASC,qBAAqBC,cAAcC,eAAeC,oBAAoB;AAE/E,SAASC,YAAY;AACrB,SAASC,yBAAyBC,sBAAsBC,gCAAgC;;;ACJxF,OAAO;AAEP,OAAO;AAEP,OAAOC,SAASC,WAAWC,cAAc;AACzC,OAAOC,YAAY;AACnB,OAAOC,cAAc;AAGrB,IAAMC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCR,IAAMC,eAAe,CAAC,EAAEC,SAASC,OAAOC,OAAM,MAAe;AAClE,QAAMC,aAAaC,OAAuB,IAAA;AAC1C,QAAMC,UAAUD,OAA0B,IAAA;AAC1CE,YAAU,MAAA;AACR,QAAID,QAAQE,SAAS;AACnB;IACF;AAEAC,eAAW,YAA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C,EAAEC,SAAQ,MAAE;AACjE,QAAMC,SAASC,cAAcC,aAAaC,MAAM;AAChD,QAAMC,aAAaJ,OAAOK,eAAe;AACzC,QAAM,EAAEC,iBAAiBC,SAAQ,IAAKC,oBAAAA;AAEtC,SACE,gBAAAC,OAAA,cAACC,KAAKC,SAAO;IACXC,YAAY;MACVC;MACA,CAACT,cAAcU;MACf,CAACV,cAAcW;;KAGjB,gBAAAN,OAAA,cAACO,cAAAA;IACCC,SAASlB,SAASkB,QAAQC,QAAQD,WAAW;IAC7CE,QAAQ,MAAA;AACN,WAAKZ,SAASa,aAAaC,gBAAgBC,oBAAoB;QAAEC,QAAQxB;QAAUyB,OAAO;MAAM,CAAA,CAAA;IAClG;;AAIR;AAEA,IAAA,qBAAe1B;",
|
|
6
|
+
"names": ["React", "useIntentDispatcher", "createIntent", "useCapability", "Capabilities", "Main", "topbarBlockPaddingStart", "fixedInsetFlexLayout", "bottombarBlockPaddingEnd", "React", "useEffect", "useRef", "Reveal", "Markdown", "styles", "RevealPlayer", "content", "slide", "onExit", "deckDivRef", "useRef", "deckRef", "useEffect", "current", "setTimeout", "Reveal", "progress", "transition", "slideNumber", "embedded", "showNotes", "center", "margin", "minScale", "maxScale", "plugins", "Markdown", "markdown", "gfm", "initialize", "undefined", "getTotalSlides", "addKeyBinding", "keyCode", "key", "description", "destroy", "err", "div", "className", "ref", "style", "link", "rel", "href", "crossOrigin", "section", "textarea", "defaultValue", "join", "PresenterMain", "document", "layout", "useCapability", "Capabilities", "Layout", "fullscreen", "layoutMode", "dispatchPromise", "dispatch", "useIntentDispatcher", "React", "Main", "Content", "classNames", "fixedInsetFlexLayout", "topbarBlockPaddingStart", "bottombarBlockPaddingEnd", "RevealPlayer", "content", "target", "onExit", "createIntent", "PresenterAction", "TogglePresentation", "object", "state"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PresenterAction
|
|
3
|
+
} from "./chunk-SFMK6EE3.mjs";
|
|
4
|
+
import {
|
|
5
|
+
PRESENTER_PLUGIN
|
|
6
|
+
} from "./chunk-Q5U3VOZB.mjs";
|
|
7
|
+
|
|
8
|
+
// packages/plugins/plugin-presenter/src/capabilities/app-graph-builder.ts
|
|
9
|
+
import { contributes, Capabilities, createIntent } from "@dxos/app-framework";
|
|
10
|
+
import { createExtension } from "@dxos/plugin-graph";
|
|
11
|
+
import { DocumentType } from "@dxos/plugin-markdown/types";
|
|
12
|
+
import { CollectionType } from "@dxos/plugin-space/types";
|
|
13
|
+
import { fullyQualifiedId } from "@dxos/react-client/echo";
|
|
14
|
+
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, createExtension({
|
|
15
|
+
id: PRESENTER_PLUGIN,
|
|
16
|
+
filter: (node) => {
|
|
17
|
+
const settings = context.requestCapabilities(Capabilities.SettingsStore)[0]?.getStore(PRESENTER_PLUGIN)?.value;
|
|
18
|
+
return settings?.presentCollections ? node.data instanceof CollectionType || node.data instanceof DocumentType : node.data instanceof DocumentType;
|
|
19
|
+
},
|
|
20
|
+
actions: ({ node }) => {
|
|
21
|
+
const object = node.data;
|
|
22
|
+
const id = fullyQualifiedId(object);
|
|
23
|
+
return [
|
|
24
|
+
{
|
|
25
|
+
id: `${PresenterAction.TogglePresentation._tag}/${id}`,
|
|
26
|
+
// TODO(burdon): Allow function so can generate state when activated.
|
|
27
|
+
// So can set explicit fullscreen state coordinated with current presenter state.
|
|
28
|
+
data: async () => {
|
|
29
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
30
|
+
await dispatch(createIntent(PresenterAction.TogglePresentation, {
|
|
31
|
+
object
|
|
32
|
+
}));
|
|
33
|
+
},
|
|
34
|
+
properties: {
|
|
35
|
+
label: [
|
|
36
|
+
"toggle presentation label",
|
|
37
|
+
{
|
|
38
|
+
ns: PRESENTER_PLUGIN
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
icon: "ph--presentation--regular",
|
|
42
|
+
keyBinding: {
|
|
43
|
+
macos: "shift+meta+p",
|
|
44
|
+
windows: "shift+alt+p"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
51
|
+
export {
|
|
52
|
+
app_graph_builder_default as default
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=app-graph-builder-6U7WTJKG.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes, type PluginsContext, Capabilities, createIntent } from '@dxos/app-framework';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { CollectionType } from '@dxos/plugin-space/types';\nimport { fullyQualifiedId } from '@dxos/react-client/echo';\n\nimport { PRESENTER_PLUGIN } from '../meta';\nimport { PresenterAction, type PresenterSettingsProps } from '../types';\n\nexport default (context: PluginsContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: PRESENTER_PLUGIN,\n filter: (node): node is Node<CollectionType | DocumentType> => {\n const settings = context\n .requestCapabilities(Capabilities.SettingsStore)[0]\n ?.getStore<PresenterSettingsProps>(PRESENTER_PLUGIN)?.value;\n return settings?.presentCollections\n ? node.data instanceof CollectionType || node.data instanceof DocumentType\n : node.data instanceof DocumentType;\n },\n actions: ({ node }) => {\n const object = node.data;\n const id = fullyQualifiedId(object);\n return [\n {\n id: `${PresenterAction.TogglePresentation._tag}/${id}`,\n // TODO(burdon): Allow function so can generate state when activated.\n // So can set explicit fullscreen state coordinated with current presenter state.\n data: async () => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n await dispatch(createIntent(PresenterAction.TogglePresentation, { object }));\n },\n properties: {\n label: ['toggle presentation label', { ns: PRESENTER_PLUGIN }],\n icon: 'ph--presentation--regular',\n keyBinding: {\n macos: 'shift+meta+p',\n windows: 'shift+alt+p',\n },\n },\n },\n ];\n },\n }),\n );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,SAASA,aAAkCC,cAAcC,oBAAoB;AAC7E,SAASC,uBAAkC;AAC3C,SAASC,oBAAoB;AAC7B,SAASC,sBAAsB;AAC/B,SAASC,wBAAwB;AAKjC,IAAA,4BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;EACdC,IAAIC;EACJC,QAAQ,CAACC,SAAAA;AACP,UAAMC,WAAWT,QACdU,oBAAoBR,aAAaS,aAAa,EAAE,CAAA,GAC/CC,SAAiCN,gBAAAA,GAAmBO;AACxD,WAAOJ,UAAUK,qBACbN,KAAKO,gBAAgBC,kBAAkBR,KAAKO,gBAAgBE,eAC5DT,KAAKO,gBAAgBE;EAC3B;EACAC,SAAS,CAAC,EAAEV,KAAI,MAAE;AAChB,UAAMW,SAASX,KAAKO;AACpB,UAAMV,KAAKe,iBAAiBD,MAAAA;AAC5B,WAAO;MACL;QACEd,IAAI,GAAGgB,gBAAgBC,mBAAmBC,IAAI,IAAIlB,EAAAA;;;QAGlDU,MAAM,YAAA;AACJ,gBAAM,EAAES,iBAAiBC,SAAQ,IAAKzB,QAAQ0B,kBAAkBxB,aAAayB,gBAAgB;AAC7F,gBAAMF,SAASG,aAAaP,gBAAgBC,oBAAoB;YAAEH;UAAO,CAAA,CAAA;QAC3E;QACAU,YAAY;UACVC,OAAO;YAAC;YAA6B;cAAEC,IAAIzB;YAAiB;;UAC5D0B,MAAM;UACNC,YAAY;YACVC,OAAO;YACPC,SAAS;UACX;QACF;MACF;;EAEJ;AACF,CAAA,CAAA;",
|
|
6
|
+
"names": ["contributes", "Capabilities", "createIntent", "createExtension", "DocumentType", "CollectionType", "fullyQualifiedId", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "PRESENTER_PLUGIN", "filter", "node", "settings", "requestCapabilities", "SettingsStore", "getStore", "value", "presentCollections", "data", "CollectionType", "DocumentType", "actions", "object", "fullyQualifiedId", "PresenterAction", "TogglePresentation", "_tag", "dispatchPromise", "dispatch", "requestCapability", "IntentDispatcher", "createIntent", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PRESENTER_PLUGIN
|
|
3
|
+
} from "./chunk-Q5U3VOZB.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-MSAMS5TA.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PRESENTER_PLUGIN
|
|
3
|
+
} from "./chunk-Q5U3VOZB.mjs";
|
|
4
|
+
|
|
5
|
+
// packages/plugins/plugin-presenter/src/components/PresenterSettings.tsx
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { Input, useTranslation } from "@dxos/react-ui";
|
|
8
|
+
import { DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
9
|
+
var PresenterSettings = ({ settings }) => {
|
|
10
|
+
const { t } = useTranslation(PRESENTER_PLUGIN);
|
|
11
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DeprecatedFormInput, {
|
|
12
|
+
label: t("present collections label")
|
|
13
|
+
}, /* @__PURE__ */ React.createElement(Input.Switch, {
|
|
14
|
+
checked: settings.presentCollections,
|
|
15
|
+
onCheckedChange: (checked) => settings.presentCollections = !!checked
|
|
16
|
+
})));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// packages/plugins/plugin-presenter/src/components/index.ts
|
|
20
|
+
import { lazy } from "react";
|
|
21
|
+
var RevealMain = lazy(() => import("./RevealMain-SWCWANYN.mjs"));
|
|
22
|
+
var PresenterMain = lazy(() => import("./PresenterMain-2RSALOUX.mjs"));
|
|
23
|
+
var MarkdownSlide = lazy(() => import("./MarkdownSlide-5NYXG5SC.mjs"));
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
PresenterSettings,
|
|
27
|
+
RevealMain,
|
|
28
|
+
PresenterMain,
|
|
29
|
+
MarkdownSlide
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=chunk-P2BIPL4V.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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 { DeprecatedFormInput } from '@dxos/react-ui-form';\n\nimport { PRESENTER_PLUGIN } from '../meta';\nimport { type PresenterSettingsProps } from '../types';\n\nexport const PresenterSettings = ({ settings }: { settings: PresenterSettingsProps }) => {\n const { t } = useTranslation(PRESENTER_PLUGIN);\n\n return (\n <>\n <DeprecatedFormInput label={t('present collections label')}>\n <Input.Switch\n checked={settings.presentCollections}\n onCheckedChange={(checked) => (settings.presentCollections = !!checked)}\n />\n </DeprecatedFormInput>\n </>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport * from './PresenterSettings';\n\nexport const RevealMain = lazy(() => import('./RevealMain'));\nexport const PresenterMain = lazy(() => import('./PresenterMain'));\nexport const MarkdownSlide = lazy(() => import('./MarkdownSlide'));\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,OAAOC,sBAAsB;AACtC,SAASC,2BAA2B;AAK7B,IAAMC,oBAAoB,CAAC,EAAEC,SAAQ,MAAwC;AAClF,QAAM,EAAEC,EAAC,IAAKC,eAAeC,gBAAAA;AAE7B,SACE,sBAAA,cAAA,MAAA,UAAA,MACE,sBAAA,cAACC,qBAAAA;IAAoBC,OAAOJ,EAAE,2BAAA;KAC5B,sBAAA,cAACK,MAAMC,QAAM;IACXC,SAASR,SAASS;IAClBC,iBAAiB,CAACF,YAAaR,SAASS,qBAAqB,CAAC,CAACD;;AAKzE;;;ACrBA,SAASG,YAAY;AAId,IAAMC,aAAaC,KAAK,MAAM,OAAO,2BAAA,CAAA;AACrC,IAAMC,gBAAgBD,KAAK,MAAM,OAAO,8BAAA,CAAA;AACxC,IAAME,gBAAgBF,KAAK,MAAM,OAAO,8BAAA,CAAA;",
|
|
6
|
+
"names": ["React", "Input", "useTranslation", "DeprecatedFormInput", "PresenterSettings", "settings", "t", "useTranslation", "PRESENTER_PLUGIN", "DeprecatedFormInput", "label", "Input", "Switch", "checked", "presentCollections", "onCheckedChange", "lazy", "RevealMain", "lazy", "PresenterMain", "MarkdownSlide"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// packages/plugins/plugin-presenter/src/meta.ts
|
|
2
2
|
var PRESENTER_PLUGIN = "dxos.org/plugin/presenter";
|
|
3
|
-
var
|
|
3
|
+
var meta = {
|
|
4
4
|
id: PRESENTER_PLUGIN,
|
|
5
5
|
name: "Presenter",
|
|
6
6
|
description: "Present documents as slideshows.",
|
|
@@ -10,6 +10,6 @@ var meta_default = {
|
|
|
10
10
|
|
|
11
11
|
export {
|
|
12
12
|
PRESENTER_PLUGIN,
|
|
13
|
-
|
|
13
|
+
meta
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-Q5U3VOZB.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const PRESENTER_PLUGIN = 'dxos.org/plugin/presenter';\n\nexport const meta = {\n id: PRESENTER_PLUGIN,\n name: 'Presenter',\n description: 'Present documents as slideshows.',\n icon: 'ph--presentation--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-presenter',\n} satisfies PluginMeta;\n"],
|
|
5
|
+
"mappings": ";AAMO,IAAMA,mBAAmB;AAEzB,IAAMC,OAAO;EAClBC,IAAIF;EACJG,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;AACV;",
|
|
6
|
+
"names": ["PRESENTER_PLUGIN", "meta", "id", "name", "description", "icon", "source"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PRESENTER_PLUGIN
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q5U3VOZB.mjs";
|
|
4
4
|
|
|
5
5
|
// packages/plugins/plugin-presenter/src/types.ts
|
|
6
6
|
import { createContext } from "react";
|
|
@@ -27,9 +27,13 @@ var PresenterContext = createContext({
|
|
|
27
27
|
stop: () => {
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
+
var PresenterSettingsSchema = S.mutable(S.Struct({
|
|
31
|
+
presentCollections: S.optional(S.Boolean)
|
|
32
|
+
}));
|
|
30
33
|
|
|
31
34
|
export {
|
|
32
35
|
PresenterAction,
|
|
33
|
-
PresenterContext
|
|
36
|
+
PresenterContext,
|
|
37
|
+
PresenterSettingsSchema
|
|
34
38
|
};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
39
|
+
//# sourceMappingURL=chunk-SFMK6EE3.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Context, createContext } from 'react';\n\nimport { S } from '@dxos/echo-schema';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { CollectionType } from '@dxos/plugin-space/types';\n\nimport { PRESENTER_PLUGIN } from './meta';\n\nexport namespace PresenterAction {\n const PRESENTER_ACTION = `${PRESENTER_PLUGIN}/action`;\n\n export class TogglePresentation extends S.TaggedClass<TogglePresentation>()(\n `${PRESENTER_ACTION}/toggle-presentation`,\n {\n input: S.Struct({\n object: S.Union(DocumentType, CollectionType),\n state: S.optional(S.Boolean),\n }),\n output: S.Void,\n },\n ) {}\n}\n\nexport type PresenterContextType = {\n running: boolean;\n start: () => void;\n stop: () => void;\n};\n\nexport const PresenterContext: Context<PresenterContextType> = createContext<PresenterContextType>({\n running: false,\n start: () => {},\n stop: () => {},\n});\n\nexport const PresenterSettingsSchema = S.mutable(\n S.Struct({\n presentCollections: S.optional(S.Boolean),\n }),\n);\n\nexport type PresenterSettingsProps = S.Schema.Type<typeof PresenterSettingsSchema>;\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAAuBA,qBAAqB;AAE5C,SAASC,SAAS;AAClB,SAASC,oBAAoB;AAC7B,SAASC,sBAAsB;;UAIdC,kBAAAA;AACf,QAAMC,mBAAmB,GAAGC,gBAAAA;EAErB,MAAMC,2BAA2BC,EAAEC,YAAW,EACnD,GAAGJ,gBAAAA,wBACH;IACEK,OAAOF,EAAEG,OAAO;MACdC,QAAQJ,EAAEK,MAAMC,cAAcC,cAAAA;MAC9BC,OAAOR,EAAES,SAAST,EAAEU,OAAO;IAC7B,CAAA;IACAC,QAAQX,EAAEY;EACZ,CAAA,EAAA;EACC;mBATUb,qBAAAA;AAUf,GAbiBH,oBAAAA,kBAAAA,CAAAA,EAAAA;AAqBV,IAAMiB,mBAAkDC,cAAoC;EACjGC,SAAS;EACTC,OAAO,MAAA;EAAO;EACdC,MAAM,MAAA;EAAO;AACf,CAAA;AAEO,IAAMC,0BAA0BlB,EAAEmB,QACvCnB,EAAEG,OAAO;EACPiB,oBAAoBpB,EAAES,SAAST,EAAEU,OAAO;AAC1C,CAAA,CAAA;",
|
|
6
|
+
"names": ["createContext", "S", "DocumentType", "CollectionType", "PresenterAction", "PRESENTER_ACTION", "PRESENTER_PLUGIN", "TogglePresentation", "S", "TaggedClass", "input", "Struct", "object", "Union", "DocumentType", "CollectionType", "state", "optional", "Boolean", "output", "Void", "PresenterContext", "createContext", "running", "start", "stop", "PresenterSettingsSchema", "mutable", "presentCollections"]
|
|
7
|
+
}
|
|
@@ -1,43 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
PresenterCapabilities
|
|
3
|
+
} from "./chunk-MSAMS5TA.mjs";
|
|
4
|
+
import {
|
|
5
|
+
MarkdownSlide,
|
|
6
|
+
PresenterMain,
|
|
7
|
+
PresenterSettings,
|
|
8
|
+
RevealMain
|
|
9
|
+
} from "./chunk-P2BIPL4V.mjs";
|
|
5
10
|
import {
|
|
6
11
|
PRESENTER_PLUGIN,
|
|
7
|
-
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
|
|
10
|
-
// packages/plugins/plugin-presenter/src/PresenterPlugin.tsx
|
|
11
|
-
import React2 from "react";
|
|
12
|
-
import { resolvePlugin, parseIntentPlugin, LayoutAction, NavigationAction, createSurface, createIntent, createResolver } from "@dxos/app-framework";
|
|
13
|
-
import { create } from "@dxos/live-object";
|
|
14
|
-
import { LocalStorageStore } from "@dxos/local-storage";
|
|
15
|
-
import { createExtension } from "@dxos/plugin-graph";
|
|
16
|
-
import { DocumentType } from "@dxos/plugin-markdown/types";
|
|
17
|
-
import { CollectionType } from "@dxos/plugin-space/types";
|
|
18
|
-
import { fullyQualifiedId } from "@dxos/react-client/echo";
|
|
19
|
-
|
|
20
|
-
// packages/plugins/plugin-presenter/src/components/index.ts
|
|
21
|
-
import { lazy } from "react";
|
|
12
|
+
meta
|
|
13
|
+
} from "./chunk-Q5U3VOZB.mjs";
|
|
22
14
|
|
|
23
|
-
// packages/plugins/plugin-presenter/src/
|
|
24
|
-
import
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}, /* @__PURE__ */ React.createElement(Input.Switch, {
|
|
32
|
-
checked: settings.presentCollections,
|
|
33
|
-
onCheckedChange: (checked) => settings.presentCollections = !!checked
|
|
34
|
-
})));
|
|
35
|
-
};
|
|
15
|
+
// packages/plugins/plugin-presenter/src/capabilities/index.ts
|
|
16
|
+
import { lazy } from "@dxos/app-framework";
|
|
17
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-6U7WTJKG.mjs"));
|
|
18
|
+
var IntentResolver = lazy(() => import("./intent-resolver-CAYS4SCJ.mjs"));
|
|
19
|
+
var ReactContext = lazy(() => import("./react-context-A3AXJRTF.mjs"));
|
|
20
|
+
var ReactSurface = lazy(() => import("./react-surface-U7AXT65E.mjs"));
|
|
21
|
+
var PresenterSettings2 = lazy(() => import("./settings-L73ZKGLV.mjs"));
|
|
22
|
+
var PresenterState = lazy(() => import("./state-IGJRHRIA.mjs"));
|
|
36
23
|
|
|
37
|
-
// packages/plugins/plugin-presenter/src/
|
|
38
|
-
|
|
39
|
-
var PresenterMain = lazy(() => import("./PresenterMain-TQE4OZK2.mjs"));
|
|
40
|
-
var MarkdownSlide = lazy(() => import("./MarkdownSlide-5NYXG5SC.mjs"));
|
|
24
|
+
// packages/plugins/plugin-presenter/src/PresenterPlugin.tsx
|
|
25
|
+
import { definePlugin, defineModule, Events, contributes, Capabilities } from "@dxos/app-framework";
|
|
41
26
|
|
|
42
27
|
// packages/plugins/plugin-presenter/src/translations.ts
|
|
43
28
|
var translations_default = [
|
|
@@ -53,148 +38,51 @@ var translations_default = [
|
|
|
53
38
|
];
|
|
54
39
|
|
|
55
40
|
// packages/plugins/plugin-presenter/src/PresenterPlugin.tsx
|
|
56
|
-
var PresenterPlugin = () =>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
],
|
|
95
|
-
icon: "ph--presentation--regular",
|
|
96
|
-
keyBinding: {
|
|
97
|
-
macos: "shift+meta+p",
|
|
98
|
-
windows: "shift+alt+p"
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
];
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
context: ({ children }) => {
|
|
108
|
-
return /* @__PURE__ */ React2.createElement(PresenterContext.Provider, {
|
|
109
|
-
value: {
|
|
110
|
-
running: state.presenting,
|
|
111
|
-
start: () => state.presenting = true,
|
|
112
|
-
stop: () => state.presenting = false
|
|
113
|
-
}
|
|
114
|
-
}, children);
|
|
115
|
-
},
|
|
116
|
-
surface: {
|
|
117
|
-
definitions: () => [
|
|
118
|
-
createSurface({
|
|
119
|
-
id: `${PRESENTER_PLUGIN}/document`,
|
|
120
|
-
role: "main",
|
|
121
|
-
disposition: "hoist",
|
|
122
|
-
filter: (data) => data.subject instanceof DocumentType,
|
|
123
|
-
component: ({ data }) => /* @__PURE__ */ React2.createElement(RevealMain, {
|
|
124
|
-
document: data.subject
|
|
125
|
-
})
|
|
126
|
-
}),
|
|
127
|
-
createSurface({
|
|
128
|
-
id: `${PRESENTER_PLUGIN}/collection`,
|
|
129
|
-
role: "main",
|
|
130
|
-
disposition: "hoist",
|
|
131
|
-
filter: (data) => data.subject instanceof CollectionType,
|
|
132
|
-
component: ({ data }) => /* @__PURE__ */ React2.createElement(PresenterMain, {
|
|
133
|
-
collection: data.subject
|
|
134
|
-
})
|
|
135
|
-
}),
|
|
136
|
-
createSurface({
|
|
137
|
-
id: `${PRESENTER_PLUGIN}/slide`,
|
|
138
|
-
role: "slide",
|
|
139
|
-
filter: (data) => data.subject instanceof DocumentType,
|
|
140
|
-
component: ({ data }) => /* @__PURE__ */ React2.createElement(MarkdownSlide, {
|
|
141
|
-
document: data.subject
|
|
142
|
-
})
|
|
143
|
-
}),
|
|
144
|
-
createSurface({
|
|
145
|
-
id: `${PRESENTER_PLUGIN}/settings`,
|
|
146
|
-
role: "settings",
|
|
147
|
-
filter: (data) => data.subject === PRESENTER_PLUGIN,
|
|
148
|
-
component: () => /* @__PURE__ */ React2.createElement(PresenterSettings, {
|
|
149
|
-
settings: settings.values
|
|
150
|
-
})
|
|
151
|
-
})
|
|
152
|
-
]
|
|
153
|
-
},
|
|
154
|
-
intent: {
|
|
155
|
-
resolvers: () => createResolver(PresenterAction.TogglePresentation, ({ object, state: next }) => {
|
|
156
|
-
state.presenting = next ?? !state.presenting;
|
|
157
|
-
if (state.presenting) {
|
|
158
|
-
return {
|
|
159
|
-
intents: [
|
|
160
|
-
createIntent(LayoutAction.SetLayoutMode, {
|
|
161
|
-
layoutMode: "fullscreen"
|
|
162
|
-
}),
|
|
163
|
-
createIntent(NavigationAction.Open, {
|
|
164
|
-
activeParts: {
|
|
165
|
-
fullScreen: fullyQualifiedId(object)
|
|
166
|
-
}
|
|
167
|
-
})
|
|
168
|
-
]
|
|
169
|
-
};
|
|
170
|
-
} else {
|
|
171
|
-
return {
|
|
172
|
-
intents: [
|
|
173
|
-
createIntent(LayoutAction.SetLayoutMode, {
|
|
174
|
-
revert: true
|
|
175
|
-
}),
|
|
176
|
-
createIntent(NavigationAction.Close, {
|
|
177
|
-
activeParts: {
|
|
178
|
-
fullScreen: fullyQualifiedId(object)
|
|
179
|
-
}
|
|
180
|
-
})
|
|
181
|
-
]
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
})
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
// packages/plugins/plugin-presenter/src/index.ts
|
|
191
|
-
var src_default = PresenterPlugin;
|
|
41
|
+
var PresenterPlugin = () => definePlugin(meta, [
|
|
42
|
+
defineModule({
|
|
43
|
+
id: `${meta.id}/module/settings`,
|
|
44
|
+
activatesOn: Events.SetupSettings,
|
|
45
|
+
activate: PresenterSettings2
|
|
46
|
+
}),
|
|
47
|
+
defineModule({
|
|
48
|
+
id: `${meta.id}/module/state`,
|
|
49
|
+
activatesOn: Events.Startup,
|
|
50
|
+
activate: PresenterState
|
|
51
|
+
}),
|
|
52
|
+
defineModule({
|
|
53
|
+
id: `${meta.id}/module/translations`,
|
|
54
|
+
activatesOn: Events.SetupTranslations,
|
|
55
|
+
activate: () => contributes(Capabilities.Translations, translations_default)
|
|
56
|
+
}),
|
|
57
|
+
defineModule({
|
|
58
|
+
id: `${meta.id}/module/react-context`,
|
|
59
|
+
activatesOn: Events.Startup,
|
|
60
|
+
activate: ReactContext
|
|
61
|
+
}),
|
|
62
|
+
defineModule({
|
|
63
|
+
id: `${meta.id}/module/react-surface`,
|
|
64
|
+
activatesOn: Events.Startup,
|
|
65
|
+
activate: ReactSurface
|
|
66
|
+
}),
|
|
67
|
+
defineModule({
|
|
68
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
69
|
+
activatesOn: Events.SetupIntents,
|
|
70
|
+
activate: IntentResolver
|
|
71
|
+
}),
|
|
72
|
+
defineModule({
|
|
73
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
74
|
+
activatesOn: Events.SetupAppGraph,
|
|
75
|
+
activate: AppGraphBuilder
|
|
76
|
+
})
|
|
77
|
+
]);
|
|
192
78
|
export {
|
|
193
79
|
MarkdownSlide,
|
|
80
|
+
PRESENTER_PLUGIN,
|
|
81
|
+
PresenterCapabilities,
|
|
194
82
|
PresenterMain,
|
|
195
83
|
PresenterPlugin,
|
|
196
84
|
PresenterSettings,
|
|
197
85
|
RevealMain,
|
|
198
|
-
|
|
86
|
+
meta
|
|
199
87
|
};
|
|
200
88
|
//# sourceMappingURL=index.mjs.map
|