@dxos/plugin-presenter 0.8.2-main.f081794 → 0.8.2-main.f11618f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/lib/browser/{PresenterMain-PQPWYIWU.mjs → CollectionPresenterContainer-5ETXRUWZ.mjs} +15 -42
  2. package/dist/lib/browser/CollectionPresenterContainer-5ETXRUWZ.mjs.map +7 -0
  3. package/dist/lib/browser/{RevealMain-B2PJXHND.mjs → DocumentPresenterContainer-CAPKSXNP.mjs} +13 -27
  4. package/dist/lib/browser/DocumentPresenterContainer-CAPKSXNP.mjs.map +7 -0
  5. package/dist/lib/browser/{app-graph-builder-CWMMBJTB.mjs → app-graph-builder-QS5KTYD3.mjs} +25 -5
  6. package/dist/lib/browser/app-graph-builder-QS5KTYD3.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-2RWWAQZK.mjs +36 -0
  8. package/dist/lib/browser/chunk-2RWWAQZK.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-3VVM67QE.mjs → chunk-VTBPPB5Z.mjs} +5 -5
  10. package/dist/lib/browser/{chunk-3VVM67QE.mjs.map → chunk-VTBPPB5Z.mjs.map} +3 -3
  11. package/dist/lib/browser/index.mjs +11 -30
  12. package/dist/lib/browser/index.mjs.map +4 -4
  13. package/dist/lib/browser/meta.json +1 -1
  14. package/dist/lib/browser/{react-surface-6JT4CB4B.mjs → react-surface-N23VEZ2O.mjs} +14 -29
  15. package/dist/lib/browser/react-surface-N23VEZ2O.mjs.map +7 -0
  16. package/dist/types/src/PresenterPlugin.d.ts.map +1 -1
  17. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  18. package/dist/types/src/capabilities/index.d.ts +0 -3
  19. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  20. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  21. package/dist/types/src/components/CollectionPresenterContainer.d.ts +7 -0
  22. package/dist/types/src/components/CollectionPresenterContainer.d.ts.map +1 -0
  23. package/dist/types/src/components/DocumentPresenterContainer.d.ts +7 -0
  24. package/dist/types/src/components/DocumentPresenterContainer.d.ts.map +1 -0
  25. package/dist/types/src/components/index.d.ts +2 -2
  26. package/dist/types/src/components/index.d.ts.map +1 -1
  27. package/dist/types/src/index.d.ts +0 -1
  28. package/dist/types/src/index.d.ts.map +1 -1
  29. package/dist/types/src/types.d.ts +120 -8
  30. package/dist/types/src/types.d.ts.map +1 -1
  31. package/dist/types/src/useExitPresenter.d.ts +6 -0
  32. package/dist/types/src/useExitPresenter.d.ts.map +1 -0
  33. package/package.json +24 -21
  34. package/src/PresenterPlugin.tsx +1 -14
  35. package/src/capabilities/app-graph-builder.ts +22 -3
  36. package/src/capabilities/index.ts +0 -4
  37. package/src/capabilities/react-surface.tsx +16 -24
  38. package/src/components/CollectionPresenterContainer.tsx +43 -0
  39. package/src/components/DocumentPresenterContainer.tsx +22 -0
  40. package/src/components/index.ts +2 -2
  41. package/src/index.ts +0 -1
  42. package/src/useExitPresenter.ts +35 -0
  43. package/dist/lib/browser/PresenterMain-PQPWYIWU.mjs.map +0 -7
  44. package/dist/lib/browser/RevealMain-B2PJXHND.mjs.map +0 -7
  45. package/dist/lib/browser/app-graph-builder-CWMMBJTB.mjs.map +0 -7
  46. package/dist/lib/browser/chunk-FK2KJZ73.mjs +0 -16
  47. package/dist/lib/browser/chunk-FK2KJZ73.mjs.map +0 -7
  48. package/dist/lib/browser/intent-resolver-TTGJCKQ5.mjs +0 -46
  49. package/dist/lib/browser/intent-resolver-TTGJCKQ5.mjs.map +0 -7
  50. package/dist/lib/browser/react-surface-6JT4CB4B.mjs.map +0 -7
  51. package/dist/lib/browser/state-W6VFHVB2.mjs +0 -18
  52. package/dist/lib/browser/state-W6VFHVB2.mjs.map +0 -7
  53. package/dist/types/src/capabilities/capabilities.d.ts +0 -8
  54. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  55. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  56. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  57. package/dist/types/src/capabilities/state.d.ts +0 -4
  58. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  59. package/dist/types/src/components/PresenterMain.d.ts +0 -7
  60. package/dist/types/src/components/PresenterMain.d.ts.map +0 -1
  61. package/dist/types/src/components/RevealMain.d.ts +0 -7
  62. package/dist/types/src/components/RevealMain.d.ts.map +0 -1
  63. package/src/capabilities/capabilities.ts +0 -13
  64. package/src/capabilities/intent-resolver.ts +0 -43
  65. package/src/capabilities/state.ts +0 -17
  66. package/src/components/PresenterMain.tsx +0 -63
  67. package/src/components/RevealMain.tsx +0 -38
@@ -1 +0,0 @@
1
- {"version":3,"file":"PresenterMain.d.ts","sourceRoot":"","sources":["../../../../src/components/PresenterMain.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAwB,MAAM,OAAO,CAAC;AAG7D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAY/D,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC;IAAE,UAAU,EAAE,cAAc,CAAA;CAAE,CAyCrD,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,7 +0,0 @@
1
- import { type FC } from 'react';
2
- import { type DocumentType } from '@dxos/plugin-markdown/types';
3
- declare const PresenterMain: FC<{
4
- document: DocumentType;
5
- }>;
6
- export default PresenterMain;
7
- //# sourceMappingURL=RevealMain.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RevealMain.d.ts","sourceRoot":"","sources":["../../../../src/components/RevealMain.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAOhE,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC;IAAE,QAAQ,EAAE,YAAY,CAAA;CAAE,CAqBjD,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,13 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { defineCapability } from '@dxos/app-framework';
6
-
7
- import { PRESENTER_PLUGIN } from '../meta';
8
-
9
- export namespace PresenterCapabilities {
10
- export type State = { presenting: boolean };
11
- export const State = defineCapability<Readonly<State>>(`${PRESENTER_PLUGIN}/capability/state`);
12
- export const MutableState = defineCapability<State>(`${PRESENTER_PLUGIN}/capability/state`);
13
- }
@@ -1,43 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import {
6
- Capabilities,
7
- contributes,
8
- createIntent,
9
- createResolver,
10
- LayoutAction,
11
- type PluginsContext,
12
- } from '@dxos/app-framework';
13
- import { fullyQualifiedId } from '@dxos/react-client/echo';
14
-
15
- import { PresenterCapabilities } from './capabilities';
16
- import { PresenterAction } from '../types';
17
-
18
- export default (context: PluginsContext) =>
19
- contributes(
20
- Capabilities.IntentResolver,
21
- createResolver({
22
- intent: PresenterAction.TogglePresentation,
23
- resolve: ({ object, state: next }) => {
24
- const state = context.requestCapability(PresenterCapabilities.MutableState);
25
- state.presenting = next ?? !state.presenting;
26
- if (state.presenting) {
27
- return {
28
- intents: [
29
- createIntent(LayoutAction.SetLayoutMode, {
30
- part: 'mode',
31
- subject: fullyQualifiedId(object),
32
- options: { mode: 'fullscreen' },
33
- }),
34
- ],
35
- };
36
- } else {
37
- return {
38
- intents: [createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { revert: true } })],
39
- };
40
- }
41
- },
42
- }),
43
- );
@@ -1,17 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { contributes } from '@dxos/app-framework';
6
- import { live } from '@dxos/live-object';
7
-
8
- import { PresenterCapabilities } from './capabilities';
9
-
10
- export default () => {
11
- // TODO(burdon): Do we need context providers if we can get the state from the plugin?
12
- // No, the main reason would be compability with existing apis.
13
- // For anything made specifically for the plugin framework they can depend on `useCapabilities`.
14
- const state = live<PresenterCapabilities.State>({ presenting: false });
15
-
16
- return contributes(PresenterCapabilities.State, state);
17
- };
@@ -1,63 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React, { type FC, useContext, useState } from 'react';
6
-
7
- import { Surface, createIntent, useLayout, useIntentDispatcher } from '@dxos/app-framework';
8
- import { type CollectionType } from '@dxos/plugin-space/types';
9
- import { Main } from '@dxos/react-ui';
10
- import {
11
- baseSurface,
12
- topbarBlockPaddingStart,
13
- fixedInsetFlexLayout,
14
- bottombarBlockPaddingEnd,
15
- } from '@dxos/react-ui-theme';
16
-
17
- import { Layout, PageNumber, Pager, StartButton } from './Presenter';
18
- import { PresenterContext, PresenterAction } from '../types';
19
-
20
- const PresenterMain: FC<{ collection: CollectionType }> = ({ collection }) => {
21
- const [slide, setSlide] = useState(0);
22
-
23
- // TODO(burdon): Should not depend on split screen.
24
- const layout = useLayout();
25
- const fullscreen = layout.mode === 'fullscreen';
26
- const { running } = useContext(PresenterContext);
27
-
28
- // TODO(burdon): Currently conflates fullscreen and running.
29
- const { dispatchPromise: dispatch } = useIntentDispatcher();
30
- const handleSetRunning = (running: boolean) => {
31
- void dispatch(createIntent(PresenterAction.TogglePresentation, { object: collection, state: running }));
32
- };
33
-
34
- return (
35
- <Main.Content
36
- classNames={[
37
- baseSurface,
38
- fixedInsetFlexLayout,
39
- !fullscreen && topbarBlockPaddingStart,
40
- !fullscreen && bottombarBlockPaddingEnd,
41
- ]}
42
- >
43
- <Layout
44
- topRight={<StartButton running={running} onClick={(running) => handleSetRunning(running)} />}
45
- bottomRight={<PageNumber index={slide} count={collection.objects.length} />}
46
- bottomLeft={
47
- <Pager
48
- index={slide}
49
- count={collection.objects.length}
50
- keys={running}
51
- onChange={setSlide}
52
- onExit={() => handleSetRunning(false)}
53
- />
54
- }
55
- >
56
- {/* TODO(wittjosiah): Better slide placeholder. */}
57
- <Surface role='slide' data={{ subject: collection.objects[slide] }} placeholder={<></>} />
58
- </Layout>
59
- </Main.Content>
60
- );
61
- };
62
-
63
- export default PresenterMain;
@@ -1,38 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React, { type FC } from 'react';
6
-
7
- import { createIntent, useLayout, useIntentDispatcher } from '@dxos/app-framework';
8
- import { type DocumentType } from '@dxos/plugin-markdown/types';
9
- import { Main } from '@dxos/react-ui';
10
- import { topbarBlockPaddingStart, fixedInsetFlexLayout, bottombarBlockPaddingEnd } from '@dxos/react-ui-theme';
11
-
12
- import { RevealPlayer } from './RevealPlayer';
13
- import { PresenterAction } from '../types';
14
-
15
- const PresenterMain: FC<{ document: DocumentType }> = ({ document }) => {
16
- const layout = useLayout();
17
- const fullscreen = layout.mode === 'fullscreen';
18
- const { dispatchPromise: dispatch } = useIntentDispatcher();
19
-
20
- return (
21
- <Main.Content
22
- classNames={[
23
- fixedInsetFlexLayout,
24
- !fullscreen && topbarBlockPaddingStart,
25
- !fullscreen && bottombarBlockPaddingEnd,
26
- ]}
27
- >
28
- <RevealPlayer
29
- content={document.content.target?.content ?? ''}
30
- onExit={() => {
31
- void dispatch(createIntent(PresenterAction.TogglePresentation, { object: document, state: false }));
32
- }}
33
- />
34
- </Main.Content>
35
- );
36
- };
37
-
38
- export default PresenterMain;