@dxos/plugin-presenter 0.8.4-main.7ace549 → 0.8.4-main.937b3ca
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-IHDZWP3U.mjs +176 -0
- package/dist/lib/browser/CollectionPresenterContainer-IHDZWP3U.mjs.map +7 -0
- package/dist/lib/browser/DocumentPresenterContainer-74M6XAAI.mjs +173 -0
- package/dist/lib/browser/DocumentPresenterContainer-74M6XAAI.mjs.map +7 -0
- package/dist/lib/browser/{MarkdownSlide-MEXR54L5.mjs → MarkdownSlide-GIYJABHE.mjs} +54 -77
- package/dist/lib/browser/MarkdownSlide-GIYJABHE.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-2QAQR34J.mjs +112 -0
- package/dist/lib/browser/app-graph-builder-2QAQR34J.mjs.map +7 -0
- package/dist/lib/browser/chunk-4PZXJXBO.mjs +50 -0
- package/dist/lib/browser/chunk-4PZXJXBO.mjs.map +7 -0
- package/dist/lib/browser/chunk-5MC4V23G.mjs +38 -0
- package/dist/lib/browser/chunk-5MC4V23G.mjs.map +7 -0
- package/dist/lib/browser/chunk-GM4KOXJY.mjs +41 -0
- package/dist/lib/browser/chunk-GM4KOXJY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TMTUZQCK.mjs → chunk-VQVZVXPJ.mjs} +1 -1
- package/dist/lib/browser/chunk-VQVZVXPJ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +23 -30
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-S4T6X72R.mjs → react-surface-2VP2M4Z7.mjs} +24 -18
- package/dist/lib/browser/react-surface-2VP2M4Z7.mjs.map +7 -0
- package/dist/lib/browser/settings-RDHXCCT4.mjs +31 -0
- package/dist/lib/browser/settings-RDHXCCT4.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 +9 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/components/CollectionPresenterContainer.d.ts +4 -4
- package/dist/types/src/components/CollectionPresenterContainer.d.ts.map +1 -1
- package/dist/types/src/components/MarkdownSlide.d.ts +4 -3
- package/dist/types/src/components/MarkdownSlide.d.ts.map +1 -1
- 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/PresenterSettings.d.ts +4 -2
- package/dist/types/src/components/PresenterSettings.d.ts.map +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +18 -17
- package/dist/types/src/components/index.d.ts.map +1 -1
- 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 -23
- 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 +45 -40
- package/src/PresenterPlugin.tsx +8 -23
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +105 -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 +70 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +30 -0
- package/src/components/CollectionPresenterContainer.tsx +12 -13
- package/src/components/DocumentPresenterContainer.tsx +3 -3
- package/src/components/Markdown/Container.tsx +1 -1
- package/src/components/MarkdownSlide.tsx +6 -2
- package/src/components/Presenter/Layout.tsx +1 -1
- package/src/components/Presenter/Pager.tsx +2 -2
- package/src/components/PresenterSettings.tsx +7 -2
- package/src/components/RevealPlayer/RevealPlayer.tsx +4 -1
- package/src/meta.ts +2 -2
- package/src/types.ts +14 -6
- package/src/useExitPresenter.ts +22 -24
- package/dist/lib/browser/CollectionPresenterContainer-4JFW3EKV.mjs +0 -199
- package/dist/lib/browser/CollectionPresenterContainer-4JFW3EKV.mjs.map +0 -7
- package/dist/lib/browser/DocumentPresenterContainer-SX32NAEH.mjs +0 -183
- package/dist/lib/browser/DocumentPresenterContainer-SX32NAEH.mjs.map +0 -7
- package/dist/lib/browser/MarkdownSlide-MEXR54L5.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-UJEKUKAP.mjs +0 -106
- package/dist/lib/browser/app-graph-builder-UJEKUKAP.mjs.map +0 -7
- package/dist/lib/browser/chunk-BJWK5GQV.mjs +0 -38
- package/dist/lib/browser/chunk-BJWK5GQV.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q3H4KEFB.mjs +0 -41
- package/dist/lib/browser/chunk-Q3H4KEFB.mjs.map +0 -7
- package/dist/lib/browser/chunk-TMTUZQCK.mjs.map +0 -7
- package/dist/lib/browser/chunk-VRRPVTKA.mjs +0 -39
- package/dist/lib/browser/chunk-VRRPVTKA.mjs.map +0 -7
- package/dist/lib/browser/react-surface-S4T6X72R.mjs.map +0 -7
- package/dist/lib/browser/settings-57TUVRW3.mjs +0 -22
- package/dist/lib/browser/settings-57TUVRW3.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/src/capabilities/app-graph-builder.ts +0 -117
- package/src/capabilities/react-surface.tsx +0 -63
- package/src/capabilities/settings.ts +0 -19
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useExitPresenter
|
|
3
|
+
} from "./chunk-GM4KOXJY.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/react";
|
|
12
|
+
import { Layout as Layout2 } from "@dxos/react-ui-mosaic";
|
|
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, {
|
|
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-IHDZWP3U.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/CollectionPresenterContainer.tsx", "../../../src/components/Presenter/Layout.tsx", "../../../src/components/Presenter/Pager.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useContext, useState } from 'react';\n\nimport { Surface, type SurfaceComponentProps } from '@dxos/app-framework/react';\nimport { Layout } from '@dxos/react-ui-mosaic';\nimport { type Collection } from '@dxos/schema';\n\nimport { PresenterContext } from '../types';\nimport { useExitPresenter } from '../useExitPresenter';\n\nimport { PageNumber, Pager, Layout as PresenterLayout } from './Presenter';\n\ntype CollectionPresenterContainerProps = SurfaceComponentProps<Collection.Collection>;\n\nconst CollectionPresenterContainer = ({ role, subject: collection }: CollectionPresenterContainerProps) => {\n const [slide, setSlide] = useState(0);\n const { running } = useContext(PresenterContext);\n const handleExit = useExitPresenter(collection);\n\n return (\n <Layout.Main role={role} classNames='relative'>\n <PresenterLayout\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={handleExit}\n />\n }\n >\n <Surface role='slide' data={{ subject: collection.objects[slide] }} />\n </PresenterLayout>\n </Layout.Main>\n );\n};\n\nexport default CollectionPresenterContainer;\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/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 React, { useEffect } from 'react';\n\nimport { IconButton, useControlledState } from '@dxos/react-ui';\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: indexProp = 0, count = 0, keys, onChange, onExit }: PagerProps) => {\n const [index, setIndex] = useControlledState(indexProp);\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 <IconButton\n icon='ph--caret-double-left--regular'\n size={6}\n label='Jump to first'\n iconOnly\n noTooltip\n variant='ghost'\n classNames='p-0'\n onClick={() => onChange?.(0)}\n />\n <IconButton\n icon='ph--caret-left--regular'\n size={6}\n label='Previous'\n iconOnly\n noTooltip\n variant='ghost'\n classNames='p-0'\n onClick={() => handleChangeIndex(-1)}\n />\n <IconButton\n icon='ph--caret-right--regular'\n size={6}\n label='Next'\n iconOnly\n noTooltip\n variant='ghost'\n classNames='p-0'\n onClick={() => handleChangeIndex(1)}\n />\n <IconButton\n icon='ph--caret-double-right--regular'\n size={6}\n label='Jump to last'\n iconOnly\n noTooltip\n variant='ghost'\n classNames='p-0'\n onClick={() => onChange?.(count - 1)}\n />\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 = ({ running, onClick }: { running?: boolean; onClick?: (start: boolean) => void }) => {\n return (\n <IconButton\n icon={running ? 'ph--x--regular' : 'ph--play--regular'}\n size={6}\n label={running ? 'Stop' : 'Play'}\n iconOnly\n noTooltip\n variant='ghost'\n classNames='p-0'\n onClick={() => onClick?.(!running)}\n />\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIA,OAAOA,UAASC,YAAYC,gBAAgB;AAE5C,SAASC,eAA2C;AACpD,SAASC,UAAAA,eAAc;;;ACHvB,OAAOC,WAAuD;AAG9D,SAASC,UAAU;AAYZ,IAAMC,SAAS,CAAC,EAAEC,UAAUC,YAAYC,SAASC,UAAUC,YAAYC,YAAW,MAAe;AACtG,SAC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,CAAAA;AAIvB;;;AF1HA,IAAM+B,+BAA+B,CAAC,EAAEC,MAAMC,SAASC,WAAU,MAAqC;AACpG,QAAM,CAACC,OAAOC,QAAAA,IAAYC,SAAS,CAAA;AACnC,QAAM,EAAEC,QAAO,IAAKC,WAAWC,gBAAAA;AAC/B,QAAMC,aAAaC,iBAAiBR,UAAAA;AAEpC,SACE,gBAAAS,OAAA,cAACC,QAAOC,MAAI;IAACb;IAAYc,YAAW;KAClC,gBAAAH,OAAA,cAACI,QAAAA;IACCC,aAAa,gBAAAL,OAAA,cAACM,YAAAA;MAAWC,OAAOf;MAAOgB,OAAOjB,WAAWkB,QAAQC;;IACjEC,YACE,gBAAAX,OAAA,cAACY,OAAAA;MACCL,OAAOf;MACPgB,OAAOjB,WAAWkB,QAAQC;MAC1BG,MAAMlB;MACNmB,UAAUrB;MACVsB,QAAQjB;;KAIZ,gBAAAE,OAAA,cAACgB,SAAAA;IAAQ3B,MAAK;IAAQ4B,MAAM;MAAE3B,SAASC,WAAWkB,QAAQjB,KAAAA;IAAO;;AAIzE;AAEA,IAAA,uCAAeJ;",
|
|
6
|
+
"names": ["React", "useContext", "useState", "Surface", "Layout", "React", "mx", "Layout", "children", "classNames", "topLeft", "topRight", "bottomLeft", "bottomRight", "div", "className", "mx", "React", "useEffect", "IconButton", "useControlledState", "Pager", "index", "indexProp", "count", "keys", "onChange", "onExit", "setIndex", "useControlledState", "useEffect", "handleChangeIndex", "dir", "next", "keydownHandler", "event", "key", "shiftKey", "window", "addEventListener", "removeEventListener", "undefined", "React", "div", "className", "IconButton", "icon", "size", "label", "iconOnly", "noTooltip", "variant", "classNames", "onClick", "PageNumber", "CollectionPresenterContainer", "role", "subject", "collection", "slide", "setSlide", "useState", "running", "useContext", "PresenterContext", "handleExit", "useExitPresenter", "React", "Layout", "Main", "classNames", "PresenterLayout", "bottomRight", "PageNumber", "index", "count", "objects", "length", "bottomLeft", "Pager", "keys", "onChange", "onExit", "Surface", "data"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useExitPresenter
|
|
3
|
+
} from "./chunk-GM4KOXJY.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/DocumentPresenterContainer.tsx
|
|
6
|
+
import React2 from "react";
|
|
7
|
+
import { Layout } from "@dxos/react-ui-mosaic";
|
|
8
|
+
|
|
9
|
+
// src/components/RevealPlayer/RevealPlayer.tsx
|
|
10
|
+
import "reveal.js/dist/reveal.css";
|
|
11
|
+
import "reveal.js/dist/theme/black.css";
|
|
12
|
+
import "highlight.js/styles/tokyo-night-dark.css";
|
|
13
|
+
import hljs from "highlight.js";
|
|
14
|
+
import typescript from "highlight.js/lib/languages/typescript";
|
|
15
|
+
import React, { useRef } from "react";
|
|
16
|
+
import Reveal from "reveal.js";
|
|
17
|
+
import RevealHighlight from "reveal.js/plugin/highlight/highlight";
|
|
18
|
+
import RevealMarkdown from "reveal.js/plugin/markdown/plugin.js";
|
|
19
|
+
import { useAsyncEffect } from "@dxos/react-ui";
|
|
20
|
+
import { mx } from "@dxos/ui-theme";
|
|
21
|
+
var styles = `
|
|
22
|
+
<style type="text/css">
|
|
23
|
+
.reveal h1 {
|
|
24
|
+
font-weight: 100;
|
|
25
|
+
font-size: 60px;
|
|
26
|
+
opacity: 0.5;
|
|
27
|
+
}
|
|
28
|
+
.reveal h2 {
|
|
29
|
+
font-weight: 100;
|
|
30
|
+
padding-top: 60px;
|
|
31
|
+
padding-left: 40px;
|
|
32
|
+
font-size: 48px;
|
|
33
|
+
opacity: 0.3;
|
|
34
|
+
}
|
|
35
|
+
.reveal h1, h2, p {
|
|
36
|
+
font-family: "Raleway", sans-serif;
|
|
37
|
+
text-align: left;
|
|
38
|
+
font-weight: 200;
|
|
39
|
+
}
|
|
40
|
+
.reveal ul {
|
|
41
|
+
font-family: "Raleway", sans-serif;
|
|
42
|
+
display: block;
|
|
43
|
+
list-style: "- ";
|
|
44
|
+
}
|
|
45
|
+
.reveal blockquote p {
|
|
46
|
+
text-align: center;
|
|
47
|
+
font-weight: 100;
|
|
48
|
+
padding: 32px;
|
|
49
|
+
}
|
|
50
|
+
.reveal pre {
|
|
51
|
+
margin-left: 0;
|
|
52
|
+
}
|
|
53
|
+
.reveal code {
|
|
54
|
+
font-size: 20px;
|
|
55
|
+
background: #111111;
|
|
56
|
+
color: #eeeeee;
|
|
57
|
+
max-height: unset !important;
|
|
58
|
+
}
|
|
59
|
+
</style>
|
|
60
|
+
`;
|
|
61
|
+
var RevealPlayer = ({ classNames, content, slide, fullscreen = true, onExit }) => {
|
|
62
|
+
const deckDivRef = useRef(null);
|
|
63
|
+
const deckRef = useRef(null);
|
|
64
|
+
useAsyncEffect(async () => {
|
|
65
|
+
if (deckRef.current) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
hljs.registerLanguage("typescript", typescript);
|
|
69
|
+
deckRef.current = new Reveal(deckDivRef.current, {
|
|
70
|
+
// view: 'scroll',
|
|
71
|
+
progress: false,
|
|
72
|
+
transition: "none",
|
|
73
|
+
slideNumber: false,
|
|
74
|
+
embedded: true,
|
|
75
|
+
// Disable autoplay to prevent errors in headless environments (e.g., CI).
|
|
76
|
+
autoPlayMedia: false,
|
|
77
|
+
// TODO(burdon): Speaker view requires server to serve popout window.
|
|
78
|
+
// https://revealjs.com/speaker-view
|
|
79
|
+
showNotes: false,
|
|
80
|
+
// width: 1600,
|
|
81
|
+
// height: 900,
|
|
82
|
+
margin: 0.1,
|
|
83
|
+
// center: false,
|
|
84
|
+
// minScale: 0.1,
|
|
85
|
+
// maxScale: 1.4,
|
|
86
|
+
// https://revealjs.com/markdown
|
|
87
|
+
// TODO(burdon): Requires server to serve popout window.
|
|
88
|
+
plugins: [
|
|
89
|
+
RevealMarkdown,
|
|
90
|
+
RevealHighlight
|
|
91
|
+
],
|
|
92
|
+
// See https://marked.js.org/using_advanced#options
|
|
93
|
+
markdown: {
|
|
94
|
+
gfm: true,
|
|
95
|
+
smartypants: true,
|
|
96
|
+
highlight: (code, language) => {
|
|
97
|
+
if (language) {
|
|
98
|
+
return hljs.highlight(code, {
|
|
99
|
+
language
|
|
100
|
+
}).value;
|
|
101
|
+
}
|
|
102
|
+
return hljs.highlightAuto(code).value;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
await deckRef.current.initialize();
|
|
107
|
+
if (slide !== void 0) {
|
|
108
|
+
deckRef.current.slide(slide < 0 ? deckRef.current?.getTotalSlides() + slide : slide - 1);
|
|
109
|
+
}
|
|
110
|
+
deckRef.current.addKeyBinding({
|
|
111
|
+
keyCode: 27,
|
|
112
|
+
key: "Escape",
|
|
113
|
+
description: "Exit full screen"
|
|
114
|
+
}, () => {
|
|
115
|
+
onExit?.();
|
|
116
|
+
});
|
|
117
|
+
return () => {
|
|
118
|
+
try {
|
|
119
|
+
if (deckRef.current) {
|
|
120
|
+
deckRef.current.destroy();
|
|
121
|
+
deckRef.current = null;
|
|
122
|
+
}
|
|
123
|
+
} catch {
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
128
|
+
className: mx("grid place-items-center is-full bs-full overflow-hidden bg-black", fullscreen && "absolute inset-0", classNames)
|
|
129
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
130
|
+
className: "relative aspect-video is-full bs-full bs-auto max-bs-full overflow-hidden"
|
|
131
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
132
|
+
ref: deckDivRef,
|
|
133
|
+
className: "absolute inset-0 reveal"
|
|
134
|
+
}, /* @__PURE__ */ React.createElement("style", null, /* @__PURE__ */ React.createElement("link", {
|
|
135
|
+
rel: "preconnect",
|
|
136
|
+
href: "https://fonts.googleapis.com"
|
|
137
|
+
}), /* @__PURE__ */ React.createElement("link", {
|
|
138
|
+
rel: "preconnect",
|
|
139
|
+
href: "https://fonts.gstatic.com",
|
|
140
|
+
crossOrigin: ""
|
|
141
|
+
}), /* @__PURE__ */ React.createElement("link", {
|
|
142
|
+
rel: "stylesheet",
|
|
143
|
+
href: "https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap"
|
|
144
|
+
})), /* @__PURE__ */ React.createElement("div", {
|
|
145
|
+
className: "slides"
|
|
146
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
147
|
+
className: "!text-center"
|
|
148
|
+
}), /* @__PURE__ */ React.createElement("section", {
|
|
149
|
+
"data-markdown": []
|
|
150
|
+
}, /* @__PURE__ */ React.createElement("textarea", {
|
|
151
|
+
"data-template": true,
|
|
152
|
+
defaultValue: [
|
|
153
|
+
styles,
|
|
154
|
+
content
|
|
155
|
+
].join("\n")
|
|
156
|
+
}))))));
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
// src/components/DocumentPresenterContainer.tsx
|
|
160
|
+
var DocumentPresenterContainer = ({ document }) => {
|
|
161
|
+
const handleExit = useExitPresenter(document);
|
|
162
|
+
return /* @__PURE__ */ React2.createElement(Layout.Main, {
|
|
163
|
+
classNames: "relative"
|
|
164
|
+
}, /* @__PURE__ */ React2.createElement(RevealPlayer, {
|
|
165
|
+
content: document.content.target?.content ?? "",
|
|
166
|
+
onExit: handleExit
|
|
167
|
+
}));
|
|
168
|
+
};
|
|
169
|
+
var DocumentPresenterContainer_default = DocumentPresenterContainer;
|
|
170
|
+
export {
|
|
171
|
+
DocumentPresenterContainer_default as default
|
|
172
|
+
};
|
|
173
|
+
//# sourceMappingURL=DocumentPresenterContainer-74M6XAAI.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/DocumentPresenterContainer.tsx", "../../../src/components/RevealPlayer/RevealPlayer.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\nimport React, { type FC } from 'react';\n\nimport { type Markdown } from '@dxos/plugin-markdown/types';\nimport { Layout } from '@dxos/react-ui-mosaic';\n\nimport { useExitPresenter } from '../useExitPresenter';\n\nimport { RevealPlayer } from './RevealPlayer';\n\nconst DocumentPresenterContainer: FC<{ document: Markdown.Document }> = ({ document }) => {\n const handleExit = useExitPresenter(document);\n\n return (\n <Layout.Main classNames='relative'>\n <RevealPlayer content={document.content.target?.content ?? ''} onExit={handleExit} />\n </Layout.Main>\n );\n};\n\nexport default DocumentPresenterContainer;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport 'reveal.js/dist/reveal.css';\n\nimport 'reveal.js/dist/theme/black.css';\n\n// https://github.com/highlightjs/highlight.js/tree/main/src/styles\n// import 'highlight.js/styles/github-dark.css';\nimport 'highlight.js/styles/tokyo-night-dark.css';\n\nimport hljs from 'highlight.js';\nimport typescript from 'highlight.js/lib/languages/typescript';\nimport React, { useRef } from 'react';\nimport Reveal from 'reveal.js';\nimport RevealHighlight from 'reveal.js/plugin/highlight/highlight';\nimport RevealMarkdown from 'reveal.js/plugin/markdown/plugin.js';\n\nimport { type ThemedClassName, useAsyncEffect } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nconst styles = `\n<style type=\"text/css\">\n .reveal h1 {\n font-weight: 100;\n font-size: 60px;\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 .reveal pre {\n margin-left: 0;\n }\n .reveal code {\n font-size: 20px;\n background: #111111;\n color: #eeeeee;\n max-height: unset !important;\n }\n</style>\n`;\n\nexport type RevealProps = ThemedClassName<{\n content: string;\n slide?: number;\n fullscreen?: boolean;\n onExit?: () => void;\n}>;\n\nexport const RevealPlayer = ({ classNames, content, slide, fullscreen = true, onExit }: RevealProps) => {\n const deckDivRef = useRef<HTMLDivElement>(null);\n const deckRef = useRef<Reveal.Api | null>(null);\n\n useAsyncEffect(async () => {\n if (deckRef.current) {\n return;\n }\n\n // Required for syntax highlighting.\n hljs.registerLanguage('typescript', typescript);\n\n // https://revealjs.com/react\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\n // Disable autoplay to prevent errors in headless environments (e.g., CI).\n autoPlayMedia: false,\n\n // TODO(burdon): Speaker view requires server to serve popout window.\n // https://revealjs.com/speaker-view\n showNotes: false,\n\n // width: 1600,\n // height: 900,\n margin: 0.1,\n // center: false,\n // minScale: 0.1,\n // maxScale: 1.4,\n\n // https://revealjs.com/markdown\n // TODO(burdon): Requires server to serve popout window.\n plugins: [RevealMarkdown, RevealHighlight],\n\n // See https://marked.js.org/using_advanced#options\n markdown: {\n gfm: true,\n smartypants: true,\n highlight: (code, language) => {\n if (language) {\n return hljs.highlight(code, { language }).value;\n }\n\n return hljs.highlightAuto(code).value;\n },\n },\n });\n\n await deckRef.current.initialize();\n\n if (slide !== undefined) {\n deckRef.current.slide(slide < 0 ? deckRef.current?.getTotalSlides() + slide : slide - 1);\n }\n\n deckRef.current.addKeyBinding({ keyCode: 27, key: 'Escape', description: 'Exit full screen' }, () => {\n onExit?.();\n });\n\n return () => {\n try {\n if (deckRef.current) {\n deckRef.current.destroy();\n deckRef.current = null;\n }\n } catch {\n // Ignore.\n }\n };\n });\n\n // TOOD(burdon): Trap cursor keys (otherwise tabster grabs focus.)\n return (\n <div\n className={mx(\n 'grid place-items-center is-full bs-full overflow-hidden bg-black',\n fullscreen && 'absolute inset-0',\n classNames,\n )}\n >\n <div className='relative aspect-video is-full bs-full bs-auto max-bs-full overflow-hidden'>\n <div ref={deckDivRef} className='absolute inset-0 reveal'>\n {/* NOTE: 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 rel='stylesheet'\n href='https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap'\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 </div>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;AAGA,OAAOA,YAAwB;AAG/B,SAASC,cAAc;;;ACFvB,OAAO;AAEP,OAAO;AAIP,OAAO;AAEP,OAAOC,UAAU;AACjB,OAAOC,gBAAgB;AACvB,OAAOC,SAASC,cAAc;AAC9B,OAAOC,YAAY;AACnB,OAAOC,qBAAqB;AAC5B,OAAOC,oBAAoB;AAE3B,SAA+BC,sBAAsB;AACrD,SAASC,UAAU;AAEnB,IAAMC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDR,IAAMC,eAAe,CAAC,EAAEC,YAAYC,SAASC,OAAOC,aAAa,MAAMC,OAAM,MAAe;AACjG,QAAMC,aAAaC,OAAuB,IAAA;AAC1C,QAAMC,UAAUD,OAA0B,IAAA;AAE1CE,iBAAe,YAAA;AACb,QAAID,QAAQE,SAAS;AACnB;IACF;AAGAC,SAAKC,iBAAiB,cAAcC,UAAAA;AAMpCL,YAAQE,UAAU,IAAII,OAAOR,WAAWI,SAAU;;MAEhDK,UAAU;MACVC,YAAY;MACZC,aAAa;MACbC,UAAU;;MAGVC,eAAe;;;MAIfC,WAAW;;;MAIXC,QAAQ;;;;;;MAORC,SAAS;QAACC;QAAgBC;;;MAG1BC,UAAU;QACRC,KAAK;QACLC,aAAa;QACbC,WAAW,CAACC,MAAMC,aAAAA;AAChB,cAAIA,UAAU;AACZ,mBAAOnB,K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iBF,QAAAA;AAEpC,SACE,gBAAAG,OAAA,cAACC,OAAOC,MAAI;IAACC,YAAW;KACtB,gBAAAH,OAAA,cAACI,cAAAA;IAAaC,SAASR,SAASQ,QAAQC,QAAQD,WAAW;IAAIE,QAAQT;;AAG7E;AAEA,IAAA,qCAAeF;",
|
|
6
|
+
"names": ["React", "Layout", "hljs", "typescript", "React", "useRef", "Reveal", "RevealHighlight", "RevealMarkdown", "useAsyncEffect", "mx", "styles", "RevealPlayer", "classNames", "content", "slide", "fullscreen", "onExit", "deckDivRef", "useRef", "deckRef", "useAsyncEffect", "current", "hljs", "registerLanguage", "typescript", "Reveal", "progress", "transition", "slideNumber", "embedded", "autoPlayMedia", "showNotes", "margin", "plugins", "RevealMarkdown", "RevealHighlight", "markdown", "gfm", "smartypants", "highlight", "code", "language", "value", "highlightAuto", "initialize", "undefined", "getTotalSlides", "addKeyBinding", "keyCode", "key", "description", "destroy", "div", "className", "mx", "ref", "style", "link", "rel", "href", "crossOrigin", "section", "textarea", "defaultValue", "join", "DocumentPresenterContainer", "document", "handleExit", "useExitPresenter", "React", "Layout", "Main", "classNames", "RevealPlayer", "content", "target", "onExit"]
|
|
7
|
+
}
|
|
@@ -1,41 +1,34 @@
|
|
|
1
1
|
// src/components/MarkdownSlide.tsx
|
|
2
|
-
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
3
2
|
import React3 from "react";
|
|
4
3
|
|
|
5
4
|
// src/components/Markdown/Container.tsx
|
|
6
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
7
5
|
import React, { useState } from "react";
|
|
8
6
|
import { useResizeDetector } from "react-resize-detector";
|
|
9
|
-
import { mx } from "@dxos/
|
|
7
|
+
import { mx } from "@dxos/ui-theme";
|
|
10
8
|
var Container = ({ children, classNames }) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
height: height2
|
|
25
|
-
}));
|
|
26
|
-
}
|
|
9
|
+
const [props, setProps] = useState({});
|
|
10
|
+
const { ref: containerRef, width, height } = useResizeDetector({
|
|
11
|
+
refreshMode: "debounce",
|
|
12
|
+
refreshRate: 200,
|
|
13
|
+
refreshOptions: {
|
|
14
|
+
leading: true
|
|
15
|
+
},
|
|
16
|
+
onResize: ({ width: width2, height: height2 }) => {
|
|
17
|
+
if (width2 && height2) {
|
|
18
|
+
setProps(createLayoutProps({
|
|
19
|
+
width: width2,
|
|
20
|
+
height: height2
|
|
21
|
+
}));
|
|
27
22
|
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
_effect.f();
|
|
38
|
-
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
26
|
+
ref: containerRef,
|
|
27
|
+
className: mx("flex grow relative overflow-hidden bg-attention", classNames)
|
|
28
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
29
|
+
className: mx("flex is-full bs-full overflow-hidden absolute"),
|
|
30
|
+
style: props
|
|
31
|
+
}, width && height && children));
|
|
39
32
|
};
|
|
40
33
|
var createLayoutProps = ({ width, height }) => {
|
|
41
34
|
const aspectRatio = 16 / 9;
|
|
@@ -52,7 +45,6 @@ var createLayoutProps = ({ width, height }) => {
|
|
|
52
45
|
};
|
|
53
46
|
|
|
54
47
|
// src/components/Markdown/Slide.tsx
|
|
55
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
56
48
|
import { h } from "hastscript";
|
|
57
49
|
import React2 from "react";
|
|
58
50
|
import ReactMarkdown from "react-markdown";
|
|
@@ -84,31 +76,26 @@ var theme = {
|
|
|
84
76
|
|
|
85
77
|
// src/components/Markdown/Slide.tsx
|
|
86
78
|
var Slide = ({ content = "", classes = theme.nodes }) => {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
remarkFrontmatter,
|
|
95
|
-
"yaml"
|
|
96
|
-
],
|
|
97
|
-
remarkParseFrontmatter
|
|
79
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("style", null, styles_default), /* @__PURE__ */ React2.createElement(ReactMarkdown, {
|
|
80
|
+
components,
|
|
81
|
+
// Markdown to HTML.
|
|
82
|
+
remarkPlugins: [
|
|
83
|
+
[
|
|
84
|
+
remarkFrontmatter,
|
|
85
|
+
"yaml"
|
|
98
86
|
],
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
87
|
+
remarkParseFrontmatter
|
|
88
|
+
],
|
|
89
|
+
// HTML processing.
|
|
90
|
+
rehypePlugins: [
|
|
91
|
+
[
|
|
92
|
+
rehypeAddClasses,
|
|
93
|
+
classes
|
|
94
|
+
],
|
|
95
|
+
rehypeHighlight,
|
|
96
|
+
slideLayout
|
|
97
|
+
]
|
|
98
|
+
}, content));
|
|
112
99
|
};
|
|
113
100
|
var slideLayout = (_options = {}) => (tree, file) => {
|
|
114
101
|
const { data: { frontmatter = {} } } = file;
|
|
@@ -183,16 +170,11 @@ var slideLayout = (_options = {}) => (tree, file) => {
|
|
|
183
170
|
];
|
|
184
171
|
};
|
|
185
172
|
var ImageWrapper = ({ node: _, ...props }) => {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
src
|
|
192
|
-
});
|
|
193
|
-
} finally {
|
|
194
|
-
_effect.f();
|
|
195
|
-
}
|
|
173
|
+
const { alt = "", src } = props;
|
|
174
|
+
return /* @__PURE__ */ React2.createElement("img", {
|
|
175
|
+
alt,
|
|
176
|
+
src
|
|
177
|
+
});
|
|
196
178
|
};
|
|
197
179
|
var components = {
|
|
198
180
|
img: ({ node, ...props }) => /* @__PURE__ */ React2.createElement(ImageWrapper, {
|
|
@@ -203,21 +185,16 @@ var components = {
|
|
|
203
185
|
|
|
204
186
|
// src/components/MarkdownSlide.tsx
|
|
205
187
|
var MarkdownSlide = ({ document }) => {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
if (!content) {
|
|
210
|
-
return null;
|
|
211
|
-
}
|
|
212
|
-
return /* @__PURE__ */ React3.createElement(Container, null, /* @__PURE__ */ React3.createElement(Slide, {
|
|
213
|
-
content
|
|
214
|
-
}));
|
|
215
|
-
} finally {
|
|
216
|
-
_effect.f();
|
|
188
|
+
const content = document.content.target?.content;
|
|
189
|
+
if (!content) {
|
|
190
|
+
return null;
|
|
217
191
|
}
|
|
192
|
+
return /* @__PURE__ */ React3.createElement(Container, null, /* @__PURE__ */ React3.createElement(Slide, {
|
|
193
|
+
content
|
|
194
|
+
}));
|
|
218
195
|
};
|
|
219
196
|
var MarkdownSlide_default = MarkdownSlide;
|
|
220
197
|
export {
|
|
221
198
|
MarkdownSlide_default as default
|
|
222
199
|
};
|
|
223
|
-
//# sourceMappingURL=MarkdownSlide-
|
|
200
|
+
//# sourceMappingURL=MarkdownSlide-GIYJABHE.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/MarkdownSlide.tsx", "../../../src/components/Markdown/Container.tsx", "../../../src/components/Markdown/Slide.tsx", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-presenter/src/components/Markdown/styles.css?raw", "../../../src/components/Markdown/theme.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Markdown } from '@dxos/plugin-markdown/types';\n\nimport { Container, Slide } from './Markdown';\n\ntype MarkdownSlideProps = {\n document: Markdown.Document;\n};\n\nconst MarkdownSlide = ({ document }: MarkdownSlideProps) => {\n const content = document.content.target?.content;\n if (!content) {\n return null;\n }\n\n return (\n <Container>\n <Slide content={content} />\n </Container>\n );\n};\n\nexport default MarkdownSlide;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type PropsWithChildren, useState } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nexport type ContainerProps = ThemedClassName<PropsWithChildren<{}>>;\n\n/**\n * Scaled markdown container.\n */\nexport const Container = ({ children, classNames }: ContainerProps) => {\n const [props, setProps] = useState({});\n const {\n ref: containerRef,\n width,\n height,\n } = useResizeDetector({\n refreshMode: 'debounce',\n refreshRate: 200,\n refreshOptions: {\n leading: true,\n },\n onResize: ({ width, height }) => {\n if (width && height) {\n setProps(createLayoutProps({ width, height }));\n }\n },\n });\n\n // TODO(burdon): Reconcile highlight colors with markdown editor.\n // https://www.npmjs.com/package/react-markdown\n return (\n <div ref={containerRef} className={mx('flex grow relative overflow-hidden bg-attention', classNames)}>\n <div className={mx('flex is-full bs-full overflow-hidden absolute')} style={props}>\n {width && height && children}\n </div>\n </div>\n );\n};\n\n/**\n * Compute CSS properties to transform DIV to be full screen.\n *\n * Display resolutions:\n * window.screen.{availWidth, availHeight}\n * 5K Studio 16.2-inch Macbook Pro\n * Max 5120 x 2880 3456 x 2234\n * Default 2560 x 1440 1728 x 1117 (Actual height 1080 - 37 pixel notch)\n * Aspect 1.77 (16/9) 1.54\n */\nconst createLayoutProps = ({ width, height }: { width: number; height: number }) => {\n // Config.\n const aspectRatio = 16 / 9;\n const nominalWidth = 2560;\n const nominalHeight = nominalWidth / aspectRatio;\n\n // NOTE: Hack to detect full height on Macbook Pro due to notch.\n // const macIntelNotch = 1117 - 1080;\n // const fullscreen =\n // height === screen.availHeight ||\n // (window.navigator.platform === 'MacIntel' && height === screen.availHeight - macIntelNotch);\n\n // If not fullscreen then make scale slightly smaller so there's a natural border.\n // const scaleFactor = fullscreen ? 1 : 0.95;\n\n // Compute scaling factor required.\n const scale = Math.min(width / nominalWidth, height / nominalHeight);\n\n return {\n left: (width - nominalWidth) / 2,\n top: (height - nominalHeight) / 2,\n width: nominalWidth,\n height: nominalHeight,\n transform: `scale(${scale})`,\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { h } from 'hastscript';\nimport React from 'react';\nimport ReactMarkdown, { type Options as ReactMarkdownOptions } from 'react-markdown';\nimport rehypeAddClasses from 'rehype-add-classes';\nimport rehypeHighlight from 'rehype-highlight';\nimport remarkFrontmatter from 'remark-frontmatter';\nimport remarkParseFrontmatter from 'remark-parse-frontmatter';\n\nimport 'highlight.js/styles/github.css';\n\nimport styles from './styles.css?raw';\nimport { theme } from './theme';\n\nexport type SlideProps = {\n content?: string;\n classes?: Record<string, string>;\n};\n\nexport const Slide = ({ content = '', classes = theme.nodes }: SlideProps) => {\n // TODO(thure): `rehype-highlight` ends up using `github.css` from `highlight.js`, but this does not appear to be\n // configurable. Find a way to remove the literal stylesheet here.\n return (\n <>\n <style>{styles}</style>\n <ReactMarkdown\n components={components}\n // Markdown to HTML.\n remarkPlugins={[[remarkFrontmatter, 'yaml'], remarkParseFrontmatter as any]}\n // HTML processing.\n rehypePlugins={[[rehypeAddClasses, classes], rehypeHighlight as any, slideLayout]}\n >\n {content}\n </ReactMarkdown>\n </>\n );\n};\n\n/**\n * Rehype plugin to format DOM based on frontmatter.\n * https://github.com/unifiedjs/unified#plugin\n * TODO(burdon): See tools/presenter: remarkPluginLayout\n * E.g., layout image from front-matter.\n */\nconst slideLayout =\n (_options = {}) =>\n (tree: any, file: any) => {\n const {\n data: { frontmatter = {} },\n } = file;\n\n let content = tree.children;\n const { layout, image } = frontmatter;\n if (image) {\n const img = h('div', {\n class: 'flex grow shrink-0 bg-cover bg-center bg-no-repeat',\n style: {\n backgroundImage: `url(${image})`,\n },\n });\n\n switch (layout) {\n case 'fullscreen': {\n content = img;\n break;\n }\n\n case 'columns': {\n content = h('div', { class: 'flex grow grid grid-cols-2' }, [\n h('div', { class: theme.padding }, [content]),\n img,\n ]);\n break;\n }\n\n case 'rows': {\n content = h('div', { class: 'flex grow flex-col' }, [\n h('div', { class: theme.padding }, [content]),\n h('div', { class: ['flex grow pt-0', theme.padding] }, [img]),\n ]);\n break;\n }\n }\n } else {\n content = h('div', { class: ['flex grow flex-col', theme.padding] }, [content]);\n }\n\n const root = h('div', { class: ['flex flex-col grow', theme.root] }, [content]);\n tree.children = [root];\n };\n\nconst ImageWrapper = ({ node: _, ...props }: { node: any }) => {\n const { alt = '', src } = props as { alt: string; src: string };\n return <img alt={alt} src={src} />;\n};\n\nconst components: ReactMarkdownOptions['components'] = {\n img: ({ node, ...props }) => <ImageWrapper node={node} {...props} />,\n};\n", "/*!\n Theme: GitHub Dark\n Description: Dark theme as seen on github.com\n Author: github.com\n Maintainer: @Hirse\n Updated: 2021-05-15\n Outdated base version: https://github.com/primer/github-syntax-dark\n Current colors taken from GitHub's CSS\n*/\n/* TODO(burdon): Use tokens. */\n.dark pre code.hljs {\n display: block;\n overflow-x: auto;\n padding: 1em;\n}\n.dark code.hljs {\n padding: 3px 5px;\n}\n.dark .hljs {\n color: #c9d1d9;\n background: #0d1117;\n}\n.dark .hljs-doctag,\n.dark .hljs-keyword,\n.dark .hljs-meta .hljs-keyword,\n.dark .hljs-template-tag,\n.dark .hljs-template-variable,\n.dark .hljs-type,\n.dark .hljs-variable.language_ {\n color: #ff7b72;\n}\n.dark .hljs-title,\n.dark .hljs-title.class_,\n.dark .hljs-title.class_.inherited__,\n.dark .hljs-title.function_ {\n color: #d2a8ff;\n}\n.dark .hljs-attr,\n.dark .hljs-attribute,\n.dark .hljs-literal,\n.dark .hljs-meta,\n.dark .hljs-number,\n.dark .hljs-operator,\n.dark .hljs-variable,\n.dark .hljs-selector-attr,\n.dark .hljs-selector-class,\n.dark .hljs-selector-id {\n color: #79c0ff;\n}\n.dark .hljs-regexp,\n.dark .hljs-string,\n.dark .hljs-meta .hljs-string {\n color: #a5d6ff;\n}\n.dark .hljs-built_in,\n.dark .hljs-symbol {\n color: #ffa657;\n}\n.dark .hljs-comment,\n.dark .hljs-code,\n.dark .hljs-formula {\n color: #8b949e;\n}\n.dark .hljs-name,\n.dark .hljs-quote,\n.dark .hljs-selector-tag,\n.dark .hljs-selector-pseudo {\n color: #7ee787;\n}\n.dark .hljs-subst {\n color: #c9d1d9;\n}\n.dark .hljs-section {\n color: #1f6feb;\n font-weight: bold;\n}\n.dark .hljs-bullet {\n color: #f2cc60;\n}\n.dark .hljs-emphasis {\n color: #c9d1d9;\n font-style: italic;\n}\n.dark .hljs-strong {\n color: #c9d1d9;\n font-weight: bold;\n}\n.dark .hljs-addition {\n color: #aff5b4;\n background-color: #033a16;\n}\n.dark .hljs-deletion {\n color: #ffdcd7;\n background-color: #67060c;\n}\n.dark .hljs-char.escape_,\n.dark .hljs-link,\n.dark .hljs-params,\n.dark .hljs-property,\n.dark .hljs-punctuation,\n.dark .hljs-tag {\n /* purposely ignored */\n all: unset;\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// TODO(burdon): Create theme type and picker.\n\nexport const theme = {\n root: 'bg-attention leading-relaxed font-mono',\n\n padding: 'pli-40 plb-16 gap-8',\n\n nodes: {\n h1: 'text-[80px] text-accentText',\n h2: 'text-[60px] text-accentText',\n h3: 'text-[48px] text-accentText',\n\n p: 'text-[48px]',\n\n ul: 'my-[16px] ml-12 leading-relaxed list-disc',\n ol: 'my-[16px] ml-24 leading-relaxed list-decimal',\n li: 'pl-6 text-[48px]',\n\n pre: 'is-full mx-0 my-[32px] p-0 __border-l-[16px] bg-inputSurface p-4 __whitespace-pre-line',\n code: 'p-0 text-[40px]',\n },\n};\n"],
|
|
5
|
+
"mappings": ";AAIA,OAAOA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M0B;;UAAS,GAAG;YAACJ;WAAI;SAC7D;AACD;MACF;IACF;EACF,OAAO;AACLxB,cAAUyB,EAAE,OAAO;MAAEC,OAAO;QAAC;QAAsBxB,MAAM0B;;IAAS,GAAG;MAAC5B;KAAQ;EAChF;AAEA,QAAM6B,OAAOJ,EAAE,OAAO;IAAEC,OAAO;MAAC;MAAsBxB,MAAM2B;;EAAM,GAAG;IAAC7B;GAAQ;AAC9EiB,OAAKI,WAAW;IAACQ;;AACnB;AAEF,IAAMC,eAAe,CAAC,EAAEC,MAAMC,GAAG,GAAGC,MAAAA,MAAsB;AACxD,QAAM,EAAEC,MAAM,IAAIC,IAAG,IAAKF;AAC1B,SAAO,gBAAA7B,OAAA,cAACoB,OAAAA;IAAIU;IAAUC;;AACxB;AAEA,IAAM3B,aAAiD;EACrDgB,KAAK,CAAC,EAAEO,MAAM,GAAGE,MAAAA,MAAY,gBAAA7B,OAAA,cAAC0B,cAAAA;IAAaC;IAAa,GAAGE;;AAC7D;;;AFvFA,IAAMG,gBAAgB,CAAC,EAAEC,SAAQ,MAAsB;AACrD,QAAMC,UAAUD,SAASC,QAAQC,QAAQD;AACzC,MAAI,CAACA,SAAS;AACZ,WAAO;EACT;AAEA,SACE,gBAAAE,OAAA,cAACC,WAAAA,MACC,gBAAAD,OAAA,cAACE,OAAAA;IAAMJ;;AAGb;AAEA,IAAA,wBAAeF;",
|
|
6
|
+
"names": ["React", "React", "useState", "useResizeDetector", "mx", "Container", "children", "classNames", "props", "setProps", "useState", "ref", "containerRef", "width", "height", "useResizeDetector", "refreshMode", "refreshRate", "refreshOptions", "leading", "onResize", "createLayoutProps", "div", "className", "mx", "style", "aspectRatio", "nominalWidth", "nominalHeight", "scale", "Math", "min", "left", "top", "transform", "h", "React", "ReactMarkdown", "rehypeAddClasses", "rehypeHighlight", "remarkFrontmatter", "remarkParseFrontmatter", "theme", "root", "padding", "nodes", "h1", "h2", "h3", "p", "ul", "ol", "li", "pre", "code", "Slide", "content", "classes", "theme", "nodes", "React", "style", "styles", "ReactMarkdown", "components", "remarkPlugins", "remarkFrontmatter", "remarkParseFrontmatter", "rehypePlugins", "rehypeAddClasses", "rehypeHighlight", "slideLayout", "_options", "tree", "file", "data", "frontmatter", "children", "layout", "image", "img", "h", "class", "backgroundImage", "padding", "root", "ImageWrapper", "node", "_", "props", "alt", "src", "MarkdownSlide", "document", "content", "target", "React", "Container", "Slide"]
|
|
7
|
+
}
|