@dxos/plugin-presenter 0.8.4-main.3eb6e50203 → 0.8.4-main.4a85c3132b
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/{chunk-L7QYO6LF.mjs → PresenterSettings-WGQMXH4I.mjs} +5 -12
- package/dist/lib/browser/PresenterSettings-WGQMXH4I.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-OH6QU3DC.mjs → app-graph-builder-LNUGLW3H.mjs} +3 -3
- package/dist/lib/browser/app-graph-builder-LNUGLW3H.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-4PZXJXBO.mjs → chunk-PSOOAW44.mjs} +2 -2
- package/dist/lib/browser/chunk-PSOOAW44.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +19 -13
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-QY4ETW6S.mjs → react-surface-UCM2KRSP.mjs} +11 -8
- package/dist/lib/browser/react-surface-UCM2KRSP.mjs.map +7 -0
- package/dist/lib/browser/{settings-OLQ7QNLC.mjs → settings-GIQOCH6O.mjs} +2 -2
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -28
- 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/containers/DocumentPresenterContainer/DocumentPresenterContainer.d.ts +6 -0
- 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/{components → containers/PresenterSettings}/PresenterSettings.d.ts +1 -1
- 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/types.d.ts +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +28 -28
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +1 -1
- package/src/capabilities/react-surface/react-surface.tsx +2 -2
- 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 +6 -6
- package/src/components/Presenter/Layout.tsx +1 -1
- package/src/components/Presenter/Pager.stories.tsx +1 -1
- package/src/components/RevealPlayer/RevealPlayer.stories.tsx +3 -3
- package/src/components/RevealPlayer/RevealPlayer.tsx +3 -3
- 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 +2 -4
- package/src/containers/MarkdownSlide/index.ts +7 -0
- package/src/{components → containers/PresenterSettings}/PresenterSettings.tsx +2 -2
- package/src/containers/PresenterSettings/index.ts +7 -0
- package/src/containers/index.ts +10 -0
- package/src/types.ts +1 -1
- package/dist/lib/browser/CollectionPresenterContainer-WE7HOMFY.mjs +0 -176
- package/dist/lib/browser/CollectionPresenterContainer-WE7HOMFY.mjs.map +0 -7
- package/dist/lib/browser/DocumentPresenterContainer-3BU2DS5E.mjs +0 -173
- package/dist/lib/browser/DocumentPresenterContainer-3BU2DS5E.mjs.map +0 -7
- package/dist/lib/browser/MarkdownSlide-GIYJABHE.mjs +0 -200
- package/dist/lib/browser/MarkdownSlide-GIYJABHE.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-OH6QU3DC.mjs.map +0 -7
- package/dist/lib/browser/chunk-4PZXJXBO.mjs.map +0 -7
- package/dist/lib/browser/chunk-L7QYO6LF.mjs.map +0 -7
- package/dist/lib/browser/react-surface-QY4ETW6S.mjs.map +0 -7
- 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 +0 -8
- package/dist/types/src/components/MarkdownSlide.d.ts.map +0 -1
- package/dist/types/src/components/PresenterSettings.d.ts.map +0 -1
- package/src/components/CollectionPresenterContainer.tsx +0 -44
- package/src/components/DocumentPresenterContainer.tsx +0 -23
- /package/dist/lib/browser/{settings-OLQ7QNLC.mjs.map → settings-GIQOCH6O.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-presenter",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.4a85c3132b",
|
|
4
4
|
"description": "Braneframe presenter plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"type": "module",
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
|
-
"browser": "./dist/lib/browser/index.mjs",
|
|
18
17
|
"source": "./src/index.ts",
|
|
18
|
+
"browser": "./dist/lib/browser/index.mjs",
|
|
19
19
|
"types": "./dist/types/src/index.d.ts"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
@@ -40,25 +40,25 @@
|
|
|
40
40
|
"remark-frontmatter": "^5.0.0",
|
|
41
41
|
"remark-parse-frontmatter": "^1.0.3",
|
|
42
42
|
"reveal.js": "^5.1.0",
|
|
43
|
-
"@dxos/app-
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/app-
|
|
48
|
-
"@dxos/operation": "0.8.4-main.
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/plugin-
|
|
51
|
-
"@dxos/plugin-
|
|
52
|
-
"@dxos/plugin-
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/plugin-stack": "0.8.4-main.
|
|
55
|
-
"@dxos/react-ui-form": "0.8.4-main.
|
|
56
|
-
"@dxos/react-
|
|
57
|
-
"@dxos/react-ui-
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/types": "0.8.4-main.
|
|
60
|
-
"@dxos/schema": "0.8.4-main.
|
|
61
|
-
"@dxos/util": "0.8.4-main.
|
|
43
|
+
"@dxos/app-framework": "0.8.4-main.4a85c3132b",
|
|
44
|
+
"@dxos/async": "0.8.4-main.4a85c3132b",
|
|
45
|
+
"@dxos/echo": "0.8.4-main.4a85c3132b",
|
|
46
|
+
"@dxos/effect": "0.8.4-main.4a85c3132b",
|
|
47
|
+
"@dxos/app-toolkit": "0.8.4-main.4a85c3132b",
|
|
48
|
+
"@dxos/operation": "0.8.4-main.4a85c3132b",
|
|
49
|
+
"@dxos/log": "0.8.4-main.4a85c3132b",
|
|
50
|
+
"@dxos/plugin-deck": "0.8.4-main.4a85c3132b",
|
|
51
|
+
"@dxos/plugin-graph": "0.8.4-main.4a85c3132b",
|
|
52
|
+
"@dxos/plugin-client": "0.8.4-main.4a85c3132b",
|
|
53
|
+
"@dxos/plugin-markdown": "0.8.4-main.4a85c3132b",
|
|
54
|
+
"@dxos/plugin-stack": "0.8.4-main.4a85c3132b",
|
|
55
|
+
"@dxos/react-ui-form": "0.8.4-main.4a85c3132b",
|
|
56
|
+
"@dxos/react-client": "0.8.4-main.4a85c3132b",
|
|
57
|
+
"@dxos/react-ui-stack": "0.8.4-main.4a85c3132b",
|
|
58
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.4a85c3132b",
|
|
59
|
+
"@dxos/types": "0.8.4-main.4a85c3132b",
|
|
60
|
+
"@dxos/schema": "0.8.4-main.4a85c3132b",
|
|
61
|
+
"@dxos/util": "0.8.4-main.4a85c3132b"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@effect-atom/atom-react": "^0.5.0",
|
|
@@ -69,11 +69,11 @@
|
|
|
69
69
|
"effect": "3.19.16",
|
|
70
70
|
"react": "~19.2.3",
|
|
71
71
|
"react-dom": "~19.2.3",
|
|
72
|
-
"vite": "7.1.
|
|
73
|
-
"@dxos/random": "0.8.4-main.
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
72
|
+
"vite": "^7.1.11",
|
|
73
|
+
"@dxos/random": "0.8.4-main.4a85c3132b",
|
|
74
|
+
"@dxos/storybook-utils": "0.8.4-main.4a85c3132b",
|
|
75
|
+
"@dxos/react-ui": "0.8.4-main.4a85c3132b",
|
|
76
|
+
"@dxos/ui-theme": "0.8.4-main.4a85c3132b"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"@effect-atom/atom-react": "^0.5.0",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"effect": "3.19.16",
|
|
82
82
|
"react": "~19.2.3",
|
|
83
83
|
"react-dom": "~19.2.3",
|
|
84
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
85
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
84
|
+
"@dxos/react-ui": "0.8.4-main.4a85c3132b",
|
|
85
|
+
"@dxos/ui-theme": "0.8.4-main.4a85c3132b"
|
|
86
86
|
},
|
|
87
87
|
"publishConfig": {
|
|
88
88
|
"access": "public"
|
|
@@ -8,12 +8,12 @@ import * as Option from 'effect/Option';
|
|
|
8
8
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
9
|
import { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
|
|
10
10
|
import { Obj } from '@dxos/echo';
|
|
11
|
+
import { Collection } from '@dxos/echo';
|
|
11
12
|
import { Operation } from '@dxos/operation';
|
|
12
13
|
import { DeckCapabilities } from '@dxos/plugin-deck';
|
|
13
14
|
import { ATTENDABLE_PATH_SEPARATOR, DeckOperation } from '@dxos/plugin-deck/types';
|
|
14
15
|
import { GraphBuilder, type Node, NodeMatcher } from '@dxos/plugin-graph';
|
|
15
16
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
16
|
-
import { Collection } from '@dxos/schema';
|
|
17
17
|
|
|
18
18
|
import { meta } from '../../meta';
|
|
19
19
|
import { PresenterCapabilities, PresenterOperation } from '../../types';
|
|
@@ -9,15 +9,15 @@ import { Capabilities, Capability } from '@dxos/app-framework';
|
|
|
9
9
|
import { Surface, useSettingsState } from '@dxos/app-framework/ui';
|
|
10
10
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
11
11
|
import { Obj } from '@dxos/echo';
|
|
12
|
+
import { Collection } from '@dxos/echo';
|
|
12
13
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
13
|
-
import { Collection } from '@dxos/schema';
|
|
14
14
|
|
|
15
15
|
import {
|
|
16
16
|
CollectionPresenterContainer,
|
|
17
17
|
DocumentPresenterContainer,
|
|
18
18
|
MarkdownSlide,
|
|
19
19
|
PresenterSettings,
|
|
20
|
-
} from '../../
|
|
20
|
+
} from '../../containers';
|
|
21
21
|
import { meta } from '../../meta';
|
|
22
22
|
import { type PresenterSettingsProps } from '../../types';
|
|
23
23
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
8
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
9
9
|
|
|
10
10
|
import { createSlide } from '../../testing';
|
|
11
11
|
|
|
@@ -21,9 +21,9 @@ const DefaultStory = ({ content = '' }: SlideProps) => {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const meta = {
|
|
24
|
-
title: 'plugins/plugin-presenter/Container',
|
|
24
|
+
title: 'plugins/plugin-presenter/components/Container',
|
|
25
25
|
render: DefaultStory,
|
|
26
|
-
decorators: [withTheme()],
|
|
26
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
27
27
|
parameters: {
|
|
28
28
|
layout: 'fullscreen',
|
|
29
29
|
},
|
|
@@ -35,8 +35,8 @@ export const Container = ({ children, classNames }: ContainerProps) => {
|
|
|
35
35
|
// TODO(burdon): Reconcile highlight colors with markdown editor.
|
|
36
36
|
// https://www.npmjs.com/package/react-markdown
|
|
37
37
|
return (
|
|
38
|
-
<div ref={containerRef} className={mx('flex grow relative overflow-hidden bg-attention', classNames)}>
|
|
39
|
-
<div className={mx('flex
|
|
38
|
+
<div ref={containerRef} className={mx('flex grow relative overflow-hidden bg-attention-surface', classNames)}>
|
|
39
|
+
<div className={mx('flex w-full h-full overflow-hidden absolute')} style={props}>
|
|
40
40
|
{width && height && children}
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
|
|
7
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
7
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
8
8
|
|
|
9
9
|
import { createSlide } from '../../testing';
|
|
10
10
|
|
|
11
11
|
import { Slide } from './Slide';
|
|
12
12
|
|
|
13
13
|
const meta = {
|
|
14
|
-
title: 'plugins/plugin-presenter/Slide',
|
|
14
|
+
title: 'plugins/plugin-presenter/components/Slide',
|
|
15
15
|
component: Slide,
|
|
16
|
-
decorators: [withTheme()],
|
|
16
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
17
17
|
parameters: {
|
|
18
18
|
layout: 'fullscreen',
|
|
19
19
|
},
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
// TODO(burdon): Create theme type and picker.
|
|
6
6
|
|
|
7
7
|
export const theme = {
|
|
8
|
-
root: 'bg-attention leading-relaxed font-mono',
|
|
8
|
+
root: 'bg-attention-surface leading-relaxed font-mono',
|
|
9
9
|
|
|
10
|
-
padding: '
|
|
10
|
+
padding: 'px-40 py-16 gap-8',
|
|
11
11
|
|
|
12
12
|
nodes: {
|
|
13
|
-
h1: 'text-[80px] text-
|
|
14
|
-
h2: 'text-[60px] text-
|
|
15
|
-
h3: 'text-[48px] text-
|
|
13
|
+
h1: 'text-[80px] text-accent-text',
|
|
14
|
+
h2: 'text-[60px] text-accent-text',
|
|
15
|
+
h3: 'text-[48px] text-accent-text',
|
|
16
16
|
|
|
17
17
|
p: 'text-[48px]',
|
|
18
18
|
|
|
@@ -20,7 +20,7 @@ export const theme = {
|
|
|
20
20
|
ol: 'my-[16px] ml-24 leading-relaxed list-decimal',
|
|
21
21
|
li: 'pl-6 text-[48px]',
|
|
22
22
|
|
|
23
|
-
pre: '
|
|
23
|
+
pre: 'w-full mx-0 my-[32px] p-4 bg-input-surface',
|
|
24
24
|
code: 'p-0 text-[40px]',
|
|
25
25
|
},
|
|
26
26
|
};
|
|
@@ -19,7 +19,7 @@ export type LayoutProps = ThemedClassName<
|
|
|
19
19
|
|
|
20
20
|
export const Layout = ({ children, classNames, topLeft, topRight, bottomLeft, bottomRight }: LayoutProps) => {
|
|
21
21
|
return (
|
|
22
|
-
<div className={mx('flex grow relative overflow-hidden bg-attention', classNames)}>
|
|
22
|
+
<div className={mx('flex grow relative overflow-hidden bg-attention-surface', classNames)}>
|
|
23
23
|
<div className={mx('flex flex-col grow overflow-hidden')}>{children}</div>
|
|
24
24
|
|
|
25
25
|
<div className='z-[200]'>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Meta } from '@storybook/react-vite';
|
|
6
6
|
|
|
7
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
7
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
8
8
|
|
|
9
9
|
import CONTENT from '../../../testing/deck.md?raw';
|
|
10
10
|
import { translations } from '../../translations';
|
|
@@ -20,9 +20,9 @@ import { RevealPlayer } from './RevealPlayer';
|
|
|
20
20
|
// https://fonts.google.com
|
|
21
21
|
|
|
22
22
|
const meta = {
|
|
23
|
-
title: 'plugins/plugin-presenter/RevealPlayer',
|
|
23
|
+
title: 'plugins/plugin-presenter/components/RevealPlayer',
|
|
24
24
|
component: RevealPlayer,
|
|
25
|
-
decorators: [withTheme()],
|
|
25
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
26
26
|
parameters: {
|
|
27
27
|
layout: 'fullscreen',
|
|
28
28
|
translations,
|
|
@@ -149,12 +149,12 @@ export const RevealPlayer = ({ classNames, content, slide, fullscreen = true, on
|
|
|
149
149
|
return (
|
|
150
150
|
<div
|
|
151
151
|
className={mx(
|
|
152
|
-
'grid place-items-center
|
|
152
|
+
'grid place-items-center w-full h-full overflow-hidden bg-black',
|
|
153
153
|
fullscreen && 'absolute inset-0',
|
|
154
154
|
classNames,
|
|
155
155
|
)}
|
|
156
156
|
>
|
|
157
|
-
<div className='relative aspect-video
|
|
157
|
+
<div className='relative aspect-video w-full h-full h-auto max-h-full overflow-hidden'>
|
|
158
158
|
<div ref={deckDivRef} className='absolute inset-0 reveal'>
|
|
159
159
|
{/* NOTE: Must be in head. */}
|
|
160
160
|
<style>
|
|
@@ -166,7 +166,7 @@ export const RevealPlayer = ({ classNames, content, slide, fullscreen = true, on
|
|
|
166
166
|
/>
|
|
167
167
|
</style>
|
|
168
168
|
<div className='slides'>
|
|
169
|
-
<div className='
|
|
169
|
+
<div className='text-center!' />
|
|
170
170
|
<section {...{ 'data-markdown': [] }}>
|
|
171
171
|
<textarea {...{ 'data-template': true }} defaultValue={[styles, content].join('\n')}></textarea>
|
|
172
172
|
</section>
|
package/src/components/index.ts
CHANGED
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export * from './
|
|
8
|
-
|
|
9
|
-
export const MarkdownSlide = lazy(() => import('./MarkdownSlide'));
|
|
10
|
-
export const DocumentPresenterContainer = lazy(() => import('./DocumentPresenterContainer'));
|
|
11
|
-
export const CollectionPresenterContainer = lazy(() => import('./CollectionPresenterContainer'));
|
|
5
|
+
export * from './Markdown';
|
|
6
|
+
export * from './Presenter';
|
|
7
|
+
export * from './RevealPlayer';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useContext, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
8
|
+
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
9
|
+
import { type Collection } from '@dxos/echo';
|
|
10
|
+
import { Panel } from '@dxos/react-ui';
|
|
11
|
+
|
|
12
|
+
import { PageNumber, Pager, Layout as PresenterLayout } from '../../components';
|
|
13
|
+
import { PresenterContext } from '../../types';
|
|
14
|
+
import { useExitPresenter } from '../../useExitPresenter';
|
|
15
|
+
|
|
16
|
+
type CollectionPresenterContainerProps = SurfaceComponentProps<Collection.Collection>;
|
|
17
|
+
|
|
18
|
+
export const CollectionPresenterContainer = ({ role, subject: collection }: CollectionPresenterContainerProps) => {
|
|
19
|
+
const [slide, setSlide] = useState(0);
|
|
20
|
+
const { running } = useContext(PresenterContext);
|
|
21
|
+
const handleExit = useExitPresenter(collection);
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Panel.Root role={role} classNames='relative'>
|
|
25
|
+
<Panel.Content asChild>
|
|
26
|
+
<PresenterLayout
|
|
27
|
+
bottomRight={<PageNumber index={slide} count={collection.objects.length} />}
|
|
28
|
+
bottomLeft={
|
|
29
|
+
<Pager
|
|
30
|
+
index={slide}
|
|
31
|
+
count={collection.objects.length}
|
|
32
|
+
keys={running}
|
|
33
|
+
onChange={setSlide}
|
|
34
|
+
onExit={handleExit}
|
|
35
|
+
/>
|
|
36
|
+
}
|
|
37
|
+
>
|
|
38
|
+
<Surface.Surface role='slide' data={{ subject: collection.objects[slide] }} />
|
|
39
|
+
</PresenterLayout>
|
|
40
|
+
</Panel.Content>
|
|
41
|
+
</Panel.Root>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type FC } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type Markdown } from '@dxos/plugin-markdown/types';
|
|
8
|
+
import { Panel } from '@dxos/react-ui';
|
|
9
|
+
|
|
10
|
+
import { RevealPlayer } from '../../components';
|
|
11
|
+
import { useExitPresenter } from '../../useExitPresenter';
|
|
12
|
+
|
|
13
|
+
export const DocumentPresenterContainer: FC<{ document: Markdown.Document }> = ({ document }) => {
|
|
14
|
+
const handleExit = useExitPresenter(document);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<Panel.Root classNames='relative'>
|
|
18
|
+
<Panel.Content asChild>
|
|
19
|
+
<RevealPlayer content={document.content.target?.content ?? ''} onExit={handleExit} />
|
|
20
|
+
</Panel.Content>
|
|
21
|
+
</Panel.Root>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
@@ -6,13 +6,13 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { type Markdown } from '@dxos/plugin-markdown/types';
|
|
8
8
|
|
|
9
|
-
import { Container, Slide } from '
|
|
9
|
+
import { Container, Slide } from '../../components';
|
|
10
10
|
|
|
11
11
|
type MarkdownSlideProps = {
|
|
12
12
|
document: Markdown.Document;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
const MarkdownSlide = ({ document }: MarkdownSlideProps) => {
|
|
15
|
+
export const MarkdownSlide = ({ document }: MarkdownSlideProps) => {
|
|
16
16
|
const content = document.content.target?.content;
|
|
17
17
|
if (!content) {
|
|
18
18
|
return null;
|
|
@@ -24,5 +24,3 @@ const MarkdownSlide = ({ document }: MarkdownSlideProps) => {
|
|
|
24
24
|
</Container>
|
|
25
25
|
);
|
|
26
26
|
};
|
|
27
|
-
|
|
28
|
-
export default MarkdownSlide;
|
|
@@ -7,8 +7,8 @@ import React from 'react';
|
|
|
7
7
|
import { Input, useTranslation } from '@dxos/react-ui';
|
|
8
8
|
import { Settings } from '@dxos/react-ui-form';
|
|
9
9
|
|
|
10
|
-
import { meta } from '
|
|
11
|
-
import { type PresenterSettingsProps } from '
|
|
10
|
+
import { meta } from '../../meta';
|
|
11
|
+
import { type PresenterSettingsProps } from '../../types';
|
|
12
12
|
|
|
13
13
|
export type PresenterSettingsComponentProps = {
|
|
14
14
|
settings: PresenterSettingsProps;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentType, lazy } from 'react';
|
|
6
|
+
|
|
7
|
+
export const CollectionPresenterContainer: ComponentType<any> = lazy(() => import('./CollectionPresenterContainer'));
|
|
8
|
+
export const DocumentPresenterContainer: ComponentType<any> = lazy(() => import('./DocumentPresenterContainer'));
|
|
9
|
+
export const MarkdownSlide: ComponentType<any> = lazy(() => import('./MarkdownSlide'));
|
|
10
|
+
export const PresenterSettings: ComponentType<any> = lazy(() => import('./PresenterSettings'));
|
package/src/types.ts
CHANGED
|
@@ -7,9 +7,9 @@ import * as Schema from 'effect/Schema';
|
|
|
7
7
|
import { type Context, createContext } from 'react';
|
|
8
8
|
|
|
9
9
|
import { Capability } from '@dxos/app-framework';
|
|
10
|
+
import { Collection } from '@dxos/echo';
|
|
10
11
|
import { Operation } from '@dxos/operation';
|
|
11
12
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
12
|
-
import { Collection } from '@dxos/schema';
|
|
13
13
|
|
|
14
14
|
import { meta } from './meta';
|
|
15
15
|
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useExitPresenter
|
|
3
|
-
} from "./chunk-46CHA6Y5.mjs";
|
|
4
|
-
import {
|
|
5
|
-
PresenterContext
|
|
6
|
-
} from "./chunk-4PZXJXBO.mjs";
|
|
7
|
-
import "./chunk-VQVZVXPJ.mjs";
|
|
8
|
-
|
|
9
|
-
// src/components/CollectionPresenterContainer.tsx
|
|
10
|
-
import React3, { useContext, useState } from "react";
|
|
11
|
-
import { Surface } from "@dxos/app-framework/ui";
|
|
12
|
-
import { Layout as Layout2 } from "@dxos/react-ui";
|
|
13
|
-
|
|
14
|
-
// src/components/Presenter/Layout.tsx
|
|
15
|
-
import React from "react";
|
|
16
|
-
import { mx } from "@dxos/ui-theme";
|
|
17
|
-
var Layout = ({ children, classNames, topLeft, topRight, bottomLeft, bottomRight }) => {
|
|
18
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
19
|
-
className: mx("flex grow relative overflow-hidden bg-attention", classNames)
|
|
20
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
21
|
-
className: mx("flex flex-col grow overflow-hidden")
|
|
22
|
-
}, children), /* @__PURE__ */ React.createElement("div", {
|
|
23
|
-
className: "z-[200]"
|
|
24
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
25
|
-
className: "absolute top-4 left-4"
|
|
26
|
-
}, topLeft), /* @__PURE__ */ React.createElement("div", {
|
|
27
|
-
className: "absolute top-4 right-4"
|
|
28
|
-
}, topRight), /* @__PURE__ */ React.createElement("div", {
|
|
29
|
-
className: "absolute bottom-4 left-4"
|
|
30
|
-
}, bottomLeft), /* @__PURE__ */ React.createElement("div", {
|
|
31
|
-
className: "absolute bottom-4 right-4"
|
|
32
|
-
}, bottomRight)));
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// src/components/Presenter/Pager.tsx
|
|
36
|
-
import React2, { useEffect } from "react";
|
|
37
|
-
import { IconButton, useControlledState } from "@dxos/react-ui";
|
|
38
|
-
var Pager = ({ index: indexProp = 0, count = 0, keys, onChange, onExit }) => {
|
|
39
|
-
const [index, setIndex] = useControlledState(indexProp);
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
onChange?.(index);
|
|
42
|
-
}, [
|
|
43
|
-
index
|
|
44
|
-
]);
|
|
45
|
-
const handleChangeIndex = (dir) => {
|
|
46
|
-
setIndex((index2) => {
|
|
47
|
-
const next = index2 + dir;
|
|
48
|
-
return next >= 0 && next < count ? next : index2;
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
if (!keys) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
const keydownHandler = (event) => {
|
|
56
|
-
switch (event.key) {
|
|
57
|
-
case "Escape": {
|
|
58
|
-
onExit?.();
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
case "ArrowLeft": {
|
|
62
|
-
if (event.shiftKey) {
|
|
63
|
-
onChange?.(0);
|
|
64
|
-
} else {
|
|
65
|
-
handleChangeIndex(-1);
|
|
66
|
-
}
|
|
67
|
-
break;
|
|
68
|
-
}
|
|
69
|
-
case "ArrowRight": {
|
|
70
|
-
if (event.shiftKey) {
|
|
71
|
-
onChange?.(count - 1);
|
|
72
|
-
} else {
|
|
73
|
-
handleChangeIndex(1);
|
|
74
|
-
}
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
case "ArrowUp": {
|
|
78
|
-
onChange?.(0);
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
81
|
-
case "ArrowDown": {
|
|
82
|
-
onChange?.(count - 1);
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
window.addEventListener("keydown", keydownHandler);
|
|
88
|
-
return () => window.removeEventListener("keydown", keydownHandler);
|
|
89
|
-
}, [
|
|
90
|
-
keys,
|
|
91
|
-
count
|
|
92
|
-
]);
|
|
93
|
-
if (index === void 0 || !count) {
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
96
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
97
|
-
className: "flex items-center text-neutral-500"
|
|
98
|
-
}, /* @__PURE__ */ React2.createElement(IconButton, {
|
|
99
|
-
icon: "ph--caret-double-left--regular",
|
|
100
|
-
size: 6,
|
|
101
|
-
label: "Jump to first",
|
|
102
|
-
iconOnly: true,
|
|
103
|
-
noTooltip: true,
|
|
104
|
-
variant: "ghost",
|
|
105
|
-
classNames: "p-0",
|
|
106
|
-
onClick: () => onChange?.(0)
|
|
107
|
-
}), /* @__PURE__ */ React2.createElement(IconButton, {
|
|
108
|
-
icon: "ph--caret-left--regular",
|
|
109
|
-
size: 6,
|
|
110
|
-
label: "Previous",
|
|
111
|
-
iconOnly: true,
|
|
112
|
-
noTooltip: true,
|
|
113
|
-
variant: "ghost",
|
|
114
|
-
classNames: "p-0",
|
|
115
|
-
onClick: () => handleChangeIndex(-1)
|
|
116
|
-
}), /* @__PURE__ */ React2.createElement(IconButton, {
|
|
117
|
-
icon: "ph--caret-right--regular",
|
|
118
|
-
size: 6,
|
|
119
|
-
label: "Next",
|
|
120
|
-
iconOnly: true,
|
|
121
|
-
noTooltip: true,
|
|
122
|
-
variant: "ghost",
|
|
123
|
-
classNames: "p-0",
|
|
124
|
-
onClick: () => handleChangeIndex(1)
|
|
125
|
-
}), /* @__PURE__ */ React2.createElement(IconButton, {
|
|
126
|
-
icon: "ph--caret-double-right--regular",
|
|
127
|
-
size: 6,
|
|
128
|
-
label: "Jump to last",
|
|
129
|
-
iconOnly: true,
|
|
130
|
-
noTooltip: true,
|
|
131
|
-
variant: "ghost",
|
|
132
|
-
classNames: "p-0",
|
|
133
|
-
onClick: () => onChange?.(count - 1)
|
|
134
|
-
}));
|
|
135
|
-
};
|
|
136
|
-
var PageNumber = ({ index = 0, count = 1 }) => {
|
|
137
|
-
if (index === void 0 || !count) {
|
|
138
|
-
return null;
|
|
139
|
-
}
|
|
140
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
141
|
-
className: "flex items-center text-neutral-500 text-2xl"
|
|
142
|
-
}, /* @__PURE__ */ React2.createElement("div", null, index + 1, " / ", count));
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
// src/components/CollectionPresenterContainer.tsx
|
|
146
|
-
var CollectionPresenterContainer = ({ role, subject: collection }) => {
|
|
147
|
-
const [slide, setSlide] = useState(0);
|
|
148
|
-
const { running } = useContext(PresenterContext);
|
|
149
|
-
const handleExit = useExitPresenter(collection);
|
|
150
|
-
return /* @__PURE__ */ React3.createElement(Layout2.Main, {
|
|
151
|
-
role,
|
|
152
|
-
classNames: "relative"
|
|
153
|
-
}, /* @__PURE__ */ React3.createElement(Layout, {
|
|
154
|
-
bottomRight: /* @__PURE__ */ React3.createElement(PageNumber, {
|
|
155
|
-
index: slide,
|
|
156
|
-
count: collection.objects.length
|
|
157
|
-
}),
|
|
158
|
-
bottomLeft: /* @__PURE__ */ React3.createElement(Pager, {
|
|
159
|
-
index: slide,
|
|
160
|
-
count: collection.objects.length,
|
|
161
|
-
keys: running,
|
|
162
|
-
onChange: setSlide,
|
|
163
|
-
onExit: handleExit
|
|
164
|
-
})
|
|
165
|
-
}, /* @__PURE__ */ React3.createElement(Surface.Surface, {
|
|
166
|
-
role: "slide",
|
|
167
|
-
data: {
|
|
168
|
-
subject: collection.objects[slide]
|
|
169
|
-
}
|
|
170
|
-
})));
|
|
171
|
-
};
|
|
172
|
-
var CollectionPresenterContainer_default = CollectionPresenterContainer;
|
|
173
|
-
export {
|
|
174
|
-
CollectionPresenterContainer_default as default
|
|
175
|
-
};
|
|
176
|
-
//# sourceMappingURL=CollectionPresenterContainer-WE7HOMFY.mjs.map
|