@dxos/plugin-presenter 0.8.4-main.72ec0f3 → 0.8.4-main.74a063c4e0
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/PresenterSettings-DZO2DC53.mjs +29 -0
- package/dist/lib/browser/PresenterSettings-DZO2DC53.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +533 -46
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operations/index.mjs +30 -0
- package/dist/lib/browser/operations/index.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.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +8 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +8 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Panel.d.ts +8 -0
- package/dist/types/src/components/Markdown/Panel.d.ts.map +1 -0
- package/dist/types/src/components/Markdown/{Container.stories.d.ts → Panel.stories.d.ts} +1 -1
- package/dist/types/src/components/Markdown/Panel.stories.d.ts.map +1 -0
- package/dist/types/src/components/Markdown/Slide.d.ts +1 -1
- package/dist/types/src/components/Markdown/Slide.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/index.d.ts +1 -1
- package/dist/types/src/components/Markdown/index.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Layout.d.ts +9 -5
- package/dist/types/src/components/Presenter/Layout.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/PresenterSettings.d.ts +6 -0
- package/dist/types/src/components/PresenterSettings/PresenterSettings.d.ts.map +1 -0
- package/dist/types/src/components/PresenterSettings/PresenterSettings.stories.d.ts +25 -0
- package/dist/types/src/components/PresenterSettings/PresenterSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/PresenterSettings/index.d.ts +2 -0
- package/dist/types/src/components/PresenterSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts +9 -4
- package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts.map +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts +12 -5
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +5 -27
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.d.ts +6 -0
- package/dist/types/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.d.ts.map +1 -0
- package/dist/types/src/containers/CollectionPresenterContainer/index.d.ts +2 -0
- package/dist/types/src/containers/CollectionPresenterContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components/MarkdownSlide.d.ts → containers/DocumentPresenterContainer/DocumentPresenterContainer.d.ts} +2 -3
- package/dist/types/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.d.ts.map +1 -0
- package/dist/types/src/containers/DocumentPresenterContainer/index.d.ts +2 -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 +2 -0
- package/dist/types/src/containers/MarkdownSlide/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +5 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +17 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +2 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +6 -5
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +6 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +18 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/useExitPresenter.d.ts +3 -4
- package/dist/types/src/useExitPresenter.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +62 -41
- package/src/PresenterPlugin.tsx +12 -25
- package/src/capabilities/app-graph-builder.ts +91 -104
- package/src/capabilities/index.ts +4 -4
- package/src/capabilities/react-surface.tsx +56 -53
- package/src/capabilities/settings.ts +24 -12
- package/src/components/Markdown/{Container.stories.tsx → Panel.stories.tsx} +7 -7
- package/src/components/Markdown/{Container.tsx → Panel.tsx} +6 -6
- package/src/components/Markdown/Slide.stories.tsx +4 -4
- package/src/components/Markdown/Slide.tsx +2 -2
- package/src/components/Markdown/index.ts +1 -1
- package/src/components/Markdown/theme.ts +6 -6
- package/src/components/Presenter/Layout.tsx +24 -23
- package/src/components/Presenter/Pager.stories.tsx +2 -2
- package/src/components/Presenter/Pager.tsx +2 -2
- package/src/components/PresenterSettings/PresenterSettings.stories.tsx +31 -0
- package/src/components/PresenterSettings/PresenterSettings.tsx +32 -0
- package/src/components/PresenterSettings/index.ts +5 -0
- package/src/components/RevealPlayer/RevealPlayer.stories.tsx +3 -4
- package/src/components/RevealPlayer/RevealPlayer.tsx +104 -102
- package/src/components/index.ts +5 -5
- package/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.tsx +44 -0
- package/src/containers/CollectionPresenterContainer/index.ts +5 -0
- package/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.tsx +24 -0
- package/src/containers/DocumentPresenterContainer/index.ts +5 -0
- package/src/{components → containers/MarkdownSlide}/MarkdownSlide.tsx +9 -7
- package/src/containers/MarkdownSlide/index.ts +5 -0
- package/src/containers/index.ts +9 -0
- package/src/meta.ts +3 -3
- package/src/operations/definitions.ts +23 -0
- package/src/operations/index.ts +5 -0
- package/src/testing.ts +6 -6
- package/src/translations.ts +6 -5
- package/src/types/Settings.ts +15 -0
- package/src/types/index.ts +30 -0
- package/src/useExitPresenter.ts +25 -25
- 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 +0 -223
- 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 +0 -18
- 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 +0 -57
- 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/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/Markdown/Container.d.ts +0 -8
- package/dist/types/src/components/Markdown/Container.d.ts.map +0 -1
- package/dist/types/src/components/Markdown/Container.stories.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownSlide.d.ts.map +0 -1
- package/dist/types/src/components/PresenterSettings.d.ts +0 -6
- package/dist/types/src/components/PresenterSettings.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -40
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/components/CollectionPresenterContainer.tsx +0 -44
- package/src/components/DocumentPresenterContainer.tsx +0 -23
- package/src/components/PresenterSettings.tsx +0 -30
- package/src/types.ts +0 -46
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
// src/components/MarkdownSlide.tsx
|
|
2
|
-
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
3
|
-
import React3 from "react";
|
|
4
|
-
|
|
5
|
-
// src/components/Markdown/Container.tsx
|
|
6
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
7
|
-
import React, { useState } from "react";
|
|
8
|
-
import { useResizeDetector } from "react-resize-detector";
|
|
9
|
-
import { mx } from "@dxos/react-ui-theme";
|
|
10
|
-
var Container = ({ children, classNames }) => {
|
|
11
|
-
var _effect = _useSignals();
|
|
12
|
-
try {
|
|
13
|
-
const [props, setProps] = useState({});
|
|
14
|
-
const { ref: containerRef, width, height } = useResizeDetector({
|
|
15
|
-
refreshMode: "debounce",
|
|
16
|
-
refreshRate: 200,
|
|
17
|
-
refreshOptions: {
|
|
18
|
-
leading: true
|
|
19
|
-
},
|
|
20
|
-
onResize: ({ width: width2, height: height2 }) => {
|
|
21
|
-
if (width2 && height2) {
|
|
22
|
-
setProps(createLayoutProps({
|
|
23
|
-
width: width2,
|
|
24
|
-
height: height2
|
|
25
|
-
}));
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
30
|
-
ref: containerRef,
|
|
31
|
-
className: mx("flex grow relative overflow-hidden bg-attention", classNames)
|
|
32
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
33
|
-
className: mx("flex is-full bs-full overflow-hidden absolute"),
|
|
34
|
-
style: props
|
|
35
|
-
}, width && height && children));
|
|
36
|
-
} finally {
|
|
37
|
-
_effect.f();
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
var createLayoutProps = ({ width, height }) => {
|
|
41
|
-
const aspectRatio = 16 / 9;
|
|
42
|
-
const nominalWidth = 2560;
|
|
43
|
-
const nominalHeight = nominalWidth / aspectRatio;
|
|
44
|
-
const scale = Math.min(width / nominalWidth, height / nominalHeight);
|
|
45
|
-
return {
|
|
46
|
-
left: (width - nominalWidth) / 2,
|
|
47
|
-
top: (height - nominalHeight) / 2,
|
|
48
|
-
width: nominalWidth,
|
|
49
|
-
height: nominalHeight,
|
|
50
|
-
transform: `scale(${scale})`
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
// src/components/Markdown/Slide.tsx
|
|
55
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
56
|
-
import { h } from "hastscript";
|
|
57
|
-
import React2 from "react";
|
|
58
|
-
import ReactMarkdown from "react-markdown";
|
|
59
|
-
import rehypeAddClasses from "rehype-add-classes";
|
|
60
|
-
import rehypeHighlight from "rehype-highlight";
|
|
61
|
-
import remarkFrontmatter from "remark-frontmatter";
|
|
62
|
-
import remarkParseFrontmatter from "remark-parse-frontmatter";
|
|
63
|
-
import "highlight.js/styles/github.css";
|
|
64
|
-
|
|
65
|
-
// raw-loader:/__w/dxos/dxos/packages/plugins/plugin-presenter/src/components/Markdown/styles.css?raw
|
|
66
|
-
var styles_default = "/*!\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";
|
|
67
|
-
|
|
68
|
-
// src/components/Markdown/theme.ts
|
|
69
|
-
var theme = {
|
|
70
|
-
root: "bg-attention leading-relaxed font-mono",
|
|
71
|
-
padding: "pli-40 plb-16 gap-8",
|
|
72
|
-
nodes: {
|
|
73
|
-
h1: "text-[80px] text-accentText",
|
|
74
|
-
h2: "text-[60px] text-accentText",
|
|
75
|
-
h3: "text-[48px] text-accentText",
|
|
76
|
-
p: "text-[48px]",
|
|
77
|
-
ul: "my-[16px] ml-12 leading-relaxed list-disc",
|
|
78
|
-
ol: "my-[16px] ml-24 leading-relaxed list-decimal",
|
|
79
|
-
li: "pl-6 text-[48px]",
|
|
80
|
-
pre: "is-full mx-0 my-[32px] p-0 __border-l-[16px] bg-inputSurface p-4 __whitespace-pre-line",
|
|
81
|
-
code: "p-0 text-[40px]"
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
// src/components/Markdown/Slide.tsx
|
|
86
|
-
var Slide = ({ content = "", classes = theme.nodes }) => {
|
|
87
|
-
var _effect = _useSignals2();
|
|
88
|
-
try {
|
|
89
|
-
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("style", null, styles_default), /* @__PURE__ */ React2.createElement(ReactMarkdown, {
|
|
90
|
-
components,
|
|
91
|
-
// Markdown to HTML.
|
|
92
|
-
remarkPlugins: [
|
|
93
|
-
[
|
|
94
|
-
remarkFrontmatter,
|
|
95
|
-
"yaml"
|
|
96
|
-
],
|
|
97
|
-
remarkParseFrontmatter
|
|
98
|
-
],
|
|
99
|
-
// HTML processing.
|
|
100
|
-
rehypePlugins: [
|
|
101
|
-
[
|
|
102
|
-
rehypeAddClasses,
|
|
103
|
-
classes
|
|
104
|
-
],
|
|
105
|
-
rehypeHighlight,
|
|
106
|
-
slideLayout
|
|
107
|
-
]
|
|
108
|
-
}, content));
|
|
109
|
-
} finally {
|
|
110
|
-
_effect.f();
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
var slideLayout = (_options = {}) => (tree, file) => {
|
|
114
|
-
const { data: { frontmatter = {} } } = file;
|
|
115
|
-
let content = tree.children;
|
|
116
|
-
const { layout, image } = frontmatter;
|
|
117
|
-
if (image) {
|
|
118
|
-
const img = h("div", {
|
|
119
|
-
class: "flex grow shrink-0 bg-cover bg-center bg-no-repeat",
|
|
120
|
-
style: {
|
|
121
|
-
backgroundImage: `url(${image})`
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
switch (layout) {
|
|
125
|
-
case "fullscreen": {
|
|
126
|
-
content = img;
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
case "columns": {
|
|
130
|
-
content = h("div", {
|
|
131
|
-
class: "flex grow grid grid-cols-2"
|
|
132
|
-
}, [
|
|
133
|
-
h("div", {
|
|
134
|
-
class: theme.padding
|
|
135
|
-
}, [
|
|
136
|
-
content
|
|
137
|
-
]),
|
|
138
|
-
img
|
|
139
|
-
]);
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
case "rows": {
|
|
143
|
-
content = h("div", {
|
|
144
|
-
class: "flex grow flex-col"
|
|
145
|
-
}, [
|
|
146
|
-
h("div", {
|
|
147
|
-
class: theme.padding
|
|
148
|
-
}, [
|
|
149
|
-
content
|
|
150
|
-
]),
|
|
151
|
-
h("div", {
|
|
152
|
-
class: [
|
|
153
|
-
"flex grow pt-0",
|
|
154
|
-
theme.padding
|
|
155
|
-
]
|
|
156
|
-
}, [
|
|
157
|
-
img
|
|
158
|
-
])
|
|
159
|
-
]);
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
} else {
|
|
164
|
-
content = h("div", {
|
|
165
|
-
class: [
|
|
166
|
-
"flex grow flex-col",
|
|
167
|
-
theme.padding
|
|
168
|
-
]
|
|
169
|
-
}, [
|
|
170
|
-
content
|
|
171
|
-
]);
|
|
172
|
-
}
|
|
173
|
-
const root = h("div", {
|
|
174
|
-
class: [
|
|
175
|
-
"flex flex-col grow",
|
|
176
|
-
theme.root
|
|
177
|
-
]
|
|
178
|
-
}, [
|
|
179
|
-
content
|
|
180
|
-
]);
|
|
181
|
-
tree.children = [
|
|
182
|
-
root
|
|
183
|
-
];
|
|
184
|
-
};
|
|
185
|
-
var ImageWrapper = ({ node: _, ...props }) => {
|
|
186
|
-
var _effect = _useSignals2();
|
|
187
|
-
try {
|
|
188
|
-
const { alt = "", src } = props;
|
|
189
|
-
return /* @__PURE__ */ React2.createElement("img", {
|
|
190
|
-
alt,
|
|
191
|
-
src
|
|
192
|
-
});
|
|
193
|
-
} finally {
|
|
194
|
-
_effect.f();
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
var components = {
|
|
198
|
-
img: ({ node, ...props }) => /* @__PURE__ */ React2.createElement(ImageWrapper, {
|
|
199
|
-
node,
|
|
200
|
-
...props
|
|
201
|
-
})
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
// src/components/MarkdownSlide.tsx
|
|
205
|
-
var MarkdownSlide = ({ document }) => {
|
|
206
|
-
var _effect = _useSignals3();
|
|
207
|
-
try {
|
|
208
|
-
const content = document.content.target?.content;
|
|
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();
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
var MarkdownSlide_default = MarkdownSlide;
|
|
220
|
-
export {
|
|
221
|
-
MarkdownSlide_default as default
|
|
222
|
-
};
|
|
223
|
-
//# sourceMappingURL=MarkdownSlide-MEXR54L5.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
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, { type FC } from 'react';\n\nimport { type Markdown } from '@dxos/plugin-markdown/types';\n\nimport { Container, Slide } from './Markdown';\n\nconst MarkdownSlide: FC<{ document: Markdown.Document }> = ({ document }) => {\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/react-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,YAAwB;;;;ACA/B,OAAOC,SAAiCC,gBAAgB;AACxD,SAASC,yBAAyB;AAGlC,SAASC,UAAU;AAOZ,IAAMC,YAAY,CAAC,EAAEC,UAAUC,WAAU,MAAkB;;;AAChE,UAAM,CAACC,OAAOC,QAAAA,IAAYC,SAAS,CAAC,CAAA;AACpC,UAAM,EACJC,KAAKC,cACLC,OACAC,OAAM,IACJC,kBAAkB;MACpBC,aAAa;MACbC,aAAa;MACbC,gBAAgB;QACdC,SAAS;MACX;MACAC,UAAU,CAAC,EAAEP,OAAAA,QAAOC,QAAAA,QAAM,MAAE;AAC1B,YAAID,UAASC,SAAQ;AACnBL,mBAASY,kBAAkB;YAAER,OAAAA;YAAOC,QAAAA;UAAO,CAAA,CAAA;QAC7C;MACF;IACF,CAAA;AAIA,WACE,sBAAA,cAACQ,OAAAA;MAAIX,KAAKC;MAAcW,WAAWC,GAAG,mDAAmDjB,UAAAA;OACvF,sBAAA,cAACe,OAAAA;MAAIC,WAAWC,GAAG,+CAAA;MAAkDC,OAAOjB;OACzEK,SAASC,UAAUR,QAAAA,CAAAA;;;;AAI5B;AAYA,IAAMe,oBAAoB,CAAC,EAAER,OAAOC,OAAM,MAAqC;AAE7E,QAAMY,cAAc,KAAK;AACzB,QAAMC,eAAe;AACrB,QAAMC,gBAAgBD,eAAeD;AAYrC,QAAMG,QAAQC,KAAKC,IAA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;;;;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
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PresenterAction
|
|
3
|
-
} from "./chunk-VRRPVTKA.mjs";
|
|
4
|
-
import {
|
|
5
|
-
meta
|
|
6
|
-
} from "./chunk-TMTUZQCK.mjs";
|
|
7
|
-
|
|
8
|
-
// src/capabilities/app-graph-builder.ts
|
|
9
|
-
import { Atom } from "@effect-atom/atom-react";
|
|
10
|
-
import * as Function from "effect/Function";
|
|
11
|
-
import * as Option from "effect/Option";
|
|
12
|
-
import { Capabilities, LayoutAction, contributes, createIntent } from "@dxos/app-framework";
|
|
13
|
-
import { Obj } from "@dxos/echo";
|
|
14
|
-
import { DeckCapabilities } from "@dxos/plugin-deck";
|
|
15
|
-
import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from "@dxos/plugin-deck/types";
|
|
16
|
-
import { atomFromSignal, createExtension } from "@dxos/plugin-graph";
|
|
17
|
-
import { Markdown } from "@dxos/plugin-markdown/types";
|
|
18
|
-
import { getSpace } from "@dxos/react-client/echo";
|
|
19
|
-
import { Collection } from "@dxos/schema";
|
|
20
|
-
var app_graph_builder_default = ((context) => contributes(Capabilities.AppGraphBuilder, createExtension({
|
|
21
|
-
id: `${meta.id}/root`,
|
|
22
|
-
// TODO(wittjosiah): This is a hack to work around presenter previously relying on "variant". Remove.
|
|
23
|
-
connector: (node) => Atom.make((get) => Function.pipe(get(node), Option.flatMap((node2) => {
|
|
24
|
-
const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
|
|
25
|
-
const settings = get(atomFromSignal(() => settingsStore?.getStore(meta.id)?.value));
|
|
26
|
-
const isPresentable = settings?.presentCollections ? Obj.instanceOf(Collection.Collection, node2.data) || Obj.instanceOf(Markdown.Document, node2.data) : Obj.instanceOf(Markdown.Document, node2.data);
|
|
27
|
-
return isPresentable ? Option.some(node2.data) : Option.none();
|
|
28
|
-
}), Option.map((object) => {
|
|
29
|
-
const id = Obj.getDXN(object).toString();
|
|
30
|
-
return [
|
|
31
|
-
{
|
|
32
|
-
id: [
|
|
33
|
-
id,
|
|
34
|
-
"presenter"
|
|
35
|
-
].join(ATTENDABLE_PATH_SEPARATOR),
|
|
36
|
-
data: {
|
|
37
|
-
type: meta.id,
|
|
38
|
-
object
|
|
39
|
-
},
|
|
40
|
-
type: meta.id,
|
|
41
|
-
properties: {
|
|
42
|
-
label: "Presenter",
|
|
43
|
-
icon: "ph--presentation--regular",
|
|
44
|
-
disposition: "hidden"
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
];
|
|
48
|
-
}), Option.getOrElse(() => []))),
|
|
49
|
-
actions: (node) => Atom.make((get) => Function.pipe(get(node), Option.flatMap((node2) => {
|
|
50
|
-
const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
|
|
51
|
-
const settings = get(atomFromSignal(() => settingsStore?.getStore(meta.id)?.value));
|
|
52
|
-
const isPresentable = settings?.presentCollections ? Obj.instanceOf(Collection.Collection, node2.data) || Obj.instanceOf(Markdown.Document, node2.data) : Obj.instanceOf(Markdown.Document, node2.data);
|
|
53
|
-
return isPresentable ? Option.some(node2.data) : Option.none();
|
|
54
|
-
}), Option.map((object) => {
|
|
55
|
-
const id = Obj.getDXN(object).toString();
|
|
56
|
-
const spaceId = getSpace(object)?.id;
|
|
57
|
-
return [
|
|
58
|
-
{
|
|
59
|
-
id: `${PresenterAction.TogglePresentation._tag}/${id}`,
|
|
60
|
-
// TODO(burdon): Allow function so can generate state when activated.
|
|
61
|
-
// So can set explicit fullscreen state coordinated with current presenter state.
|
|
62
|
-
data: async () => {
|
|
63
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
64
|
-
const layout = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
65
|
-
const presenterId = [
|
|
66
|
-
id,
|
|
67
|
-
"presenter"
|
|
68
|
-
].join(ATTENDABLE_PATH_SEPARATOR);
|
|
69
|
-
if (!layout.deck.fullscreen) {
|
|
70
|
-
void dispatch(createIntent(DeckAction.Adjust, {
|
|
71
|
-
type: "solo--fullscreen",
|
|
72
|
-
id: presenterId
|
|
73
|
-
}));
|
|
74
|
-
}
|
|
75
|
-
await dispatch(createIntent(LayoutAction.Open, {
|
|
76
|
-
part: "main",
|
|
77
|
-
subject: [
|
|
78
|
-
presenterId
|
|
79
|
-
],
|
|
80
|
-
options: {
|
|
81
|
-
workspace: spaceId
|
|
82
|
-
}
|
|
83
|
-
}));
|
|
84
|
-
},
|
|
85
|
-
properties: {
|
|
86
|
-
label: [
|
|
87
|
-
"toggle presentation label",
|
|
88
|
-
{
|
|
89
|
-
ns: meta.id
|
|
90
|
-
}
|
|
91
|
-
],
|
|
92
|
-
icon: "ph--presentation--regular",
|
|
93
|
-
disposition: "list-item",
|
|
94
|
-
keyBinding: {
|
|
95
|
-
macos: "shift+meta+p",
|
|
96
|
-
windows: "shift+alt+p"
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
];
|
|
101
|
-
}), Option.getOrElse(() => [])))
|
|
102
|
-
})));
|
|
103
|
-
export {
|
|
104
|
-
app_graph_builder_default as default
|
|
105
|
-
};
|
|
106
|
-
//# sourceMappingURL=app-graph-builder-UJEKUKAP.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as Function from 'effect/Function';\nimport * as Option from 'effect/Option';\n\nimport { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\nimport { DeckCapabilities } from '@dxos/plugin-deck';\nimport { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';\nimport { atomFromSignal, createExtension } from '@dxos/plugin-graph';\nimport { Markdown } from '@dxos/plugin-markdown/types';\nimport { getSpace } from '@dxos/react-client/echo';\nimport { Collection } from '@dxos/schema';\n\nimport { meta } from '../meta';\nimport { PresenterAction, type PresenterSettingsProps } from '../types';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: `${meta.id}/root`,\n // TODO(wittjosiah): This is a hack to work around presenter previously relying on \"variant\". Remove.\n connector: (node) =>\n Atom.make((get) =>\n Function.pipe(\n get(node),\n Option.flatMap((node) => {\n const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));\n const settings = get(\n atomFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(meta.id)?.value),\n );\n const isPresentable = settings?.presentCollections\n ? Obj.instanceOf(Collection.Collection, node.data) || Obj.instanceOf(Markdown.Document, node.data)\n : Obj.instanceOf(Markdown.Document, node.data);\n return isPresentable ? Option.some(node.data) : Option.none();\n }),\n Option.map((object) => {\n const id = Obj.getDXN(object).toString();\n return [\n {\n id: [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR),\n data: { type: meta.id, object },\n type: meta.id,\n properties: {\n label: 'Presenter',\n icon: 'ph--presentation--regular',\n disposition: 'hidden',\n },\n },\n ];\n }),\n Option.getOrElse(() => []),\n ),\n ),\n actions: (node) =>\n Atom.make((get) =>\n Function.pipe(\n get(node),\n Option.flatMap((node) => {\n const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));\n const settings = get(\n atomFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(meta.id)?.value),\n );\n const isPresentable = settings?.presentCollections\n ? Obj.instanceOf(Collection.Collection, node.data) || Obj.instanceOf(Markdown.Document, node.data)\n : Obj.instanceOf(Markdown.Document, node.data);\n return isPresentable ? Option.some(node.data) : Option.none();\n }),\n Option.map((object) => {\n const id = Obj.getDXN(object).toString();\n const spaceId = getSpace(object)?.id;\n return [\n {\n id: `${PresenterAction.TogglePresentation._tag}/${id}`,\n // TODO(burdon): Allow function so can generate state when activated.\n // So can set explicit fullscreen state coordinated with current presenter state.\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const layout = context.getCapability(DeckCapabilities.MutableDeckState);\n const presenterId = [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR);\n if (!layout.deck.fullscreen) {\n void dispatch(\n createIntent(DeckAction.Adjust, {\n type: 'solo--fullscreen',\n id: presenterId,\n }),\n );\n }\n await dispatch(\n createIntent(LayoutAction.Open, {\n part: 'main',\n subject: [presenterId],\n options: { workspace: spaceId },\n }),\n );\n },\n properties: {\n label: ['toggle presentation label', { ns: meta.id }],\n icon: 'ph--presentation--regular',\n disposition: 'list-item',\n keyBinding: {\n macos: 'shift+meta+p',\n windows: 'shift+alt+p',\n },\n },\n },\n ];\n }),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,SAASA,YAAY;AACrB,Y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AAI9D,KAAKD;YAAG;;UACnDmC,MAAM;UACNC,aAAa;UACb4B,YAAY;YACVC,OAAO;YACPC,SAAS;UACX;QACF;MACF;;EAEJ,CAAA,GACO7B,iBAAU,MAAM,CAAA,CAAE,CAAA,CAAA;AAGjC,CAAA,CAAA;",
|
|
6
|
-
"names": ["Atom", "Function", "Option", "Capabilities", "LayoutAction", "contributes", "createIntent", "Obj", "DeckCapabilities", "ATTENDABLE_PATH_SEPARATOR", "DeckAction", "atomFromSignal", "createExtension", "Markdown", "getSpace", "Collection", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "meta", "connector", "node", "Atom", "make", "get", "pipe", "flatMap", "settingsStore", "capabilities", "SettingsStore", "settings", "atomFromSignal", "getStore", "value", "isPresentable", "presentCollections", "Obj", "instanceOf", "Collection", "data", "Markdown", "Document", "some", "none", "map", "object", "getDXN", "toString", "join", "ATTENDABLE_PATH_SEPARATOR", "type", "properties", "label", "icon", "disposition", "getOrElse", "actions", "spaceId", "getSpace", "PresenterAction", "TogglePresentation", "_tag", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "layout", "DeckCapabilities", "MutableDeckState", "presenterId", "deck", "fullscreen", "createIntent", "DeckAction", "Adjust", "LayoutAction", "Open", "part", "subject", "options", "workspace", "ns", "keyBinding", "macos", "windows"]
|
|
7
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// src/useExitPresenter.ts
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { LayoutAction, createIntent } from "@dxos/app-framework";
|
|
4
|
-
import { useCapability, useIntentDispatcher } from "@dxos/app-framework/react";
|
|
5
|
-
import { Obj } from "@dxos/echo";
|
|
6
|
-
import { DeckCapabilities } from "@dxos/plugin-deck";
|
|
7
|
-
import { DeckAction } from "@dxos/plugin-deck/types";
|
|
8
|
-
import { getSpace } from "@dxos/react-client/echo";
|
|
9
|
-
var useExitPresenter = (object) => {
|
|
10
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
11
|
-
const layout = useCapability(DeckCapabilities.MutableDeckState);
|
|
12
|
-
return useCallback(() => {
|
|
13
|
-
const objectId = Obj.getDXN(object).toString();
|
|
14
|
-
if (layout.deck.fullscreen) {
|
|
15
|
-
void dispatch(createIntent(DeckAction.Adjust, {
|
|
16
|
-
type: "solo--fullscreen",
|
|
17
|
-
id: objectId
|
|
18
|
-
}));
|
|
19
|
-
}
|
|
20
|
-
return dispatch(createIntent(LayoutAction.Open, {
|
|
21
|
-
part: "main",
|
|
22
|
-
subject: [
|
|
23
|
-
objectId
|
|
24
|
-
],
|
|
25
|
-
options: {
|
|
26
|
-
workspace: getSpace(document)?.id
|
|
27
|
-
}
|
|
28
|
-
}));
|
|
29
|
-
}, [
|
|
30
|
-
dispatch,
|
|
31
|
-
object
|
|
32
|
-
]);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export {
|
|
36
|
-
useExitPresenter
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=chunk-BJWK5GQV.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/useExitPresenter.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { useCallback } from 'react';\n\nimport { LayoutAction, createIntent } from '@dxos/app-framework';\nimport { useCapability, useIntentDispatcher } from '@dxos/app-framework/react';\nimport { Obj } from '@dxos/echo';\nimport { type Live } from '@dxos/live-object';\nimport { DeckCapabilities } from '@dxos/plugin-deck';\nimport { DeckAction } from '@dxos/plugin-deck/types';\nimport { getSpace } from '@dxos/react-client/echo';\n\nexport const useExitPresenter = (object: Live<any>) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const layout = useCapability(DeckCapabilities.MutableDeckState);\n\n return useCallback(() => {\n const objectId = Obj.getDXN(object).toString();\n if (layout.deck.fullscreen) {\n void dispatch(\n createIntent(DeckAction.Adjust, {\n type: 'solo--fullscreen',\n id: objectId,\n }),\n );\n }\n return dispatch(\n createIntent(LayoutAction.Open, {\n part: 'main',\n subject: [objectId],\n options: { workspace: getSpace(document)?.id },\n }),\n );\n }, [dispatch, object]);\n};\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,mBAAmB;AAE5B,SAASC,cAAcC,oBAAoB;AAC3C,SAASC,eAAeC,2BAA2B;AACnD,SAASC,WAAW;AAEpB,SAASC,wBAAwB;AACjC,SAASC,kBAAkB;AAC3B,SAASC,gBAAgB;AAElB,IAAMC,mBAAmB,CAACC,WAAAA;AAC/B,QAAM,EAAEC,iBAAiBC,SAAQ,IAAKC,oBAAAA;AACtC,QAAMC,SAASC,cAAcC,iBAAiBC,gBAAgB;AAE9D,SAAOC,YAAY,MAAA;AACjB,UAAMC,WAAWC,IAAIC,OAAOX,MAAAA,EAAQY,SAAQ;AAC5C,QAAIR,OAAOS,KAAKC,YAAY;AAC1B,WAAKZ,SACHa,aAAaC,WAAWC,QAAQ;QAC9BC,MAAM;QACNC,IAAIV;MACN,CAAA,CAAA;IAEJ;AACA,WAAOP,SACLa,aAAaK,aAAaC,MAAM;MAC9BC,MAAM;MACNC,SAAS;QAACd;;MACVe,SAAS;QAAEC,WAAWC,SAASC,QAAAA,GAAWR;MAAG;IAC/C,CAAA,CAAA;EAEJ,GAAG;IAACjB;IAAUF;GAAO;AACvB;",
|
|
6
|
-
"names": ["useCallback", "LayoutAction", "createIntent", "useCapability", "useIntentDispatcher", "Obj", "DeckCapabilities", "DeckAction", "getSpace", "useExitPresenter", "object", "dispatchPromise", "dispatch", "useIntentDispatcher", "layout", "useCapability", "DeckCapabilities", "MutableDeckState", "useCallback", "objectId", "Obj", "getDXN", "toString", "deck", "fullscreen", "createIntent", "DeckAction", "Adjust", "type", "id", "LayoutAction", "Open", "part", "subject", "options", "workspace", "getSpace", "document"]
|
|
7
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
meta
|
|
3
|
-
} from "./chunk-TMTUZQCK.mjs";
|
|
4
|
-
|
|
5
|
-
// src/components/PresenterSettings.tsx
|
|
6
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
7
|
-
import React from "react";
|
|
8
|
-
import { Input, useTranslation } from "@dxos/react-ui";
|
|
9
|
-
import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from "@dxos/react-ui-form";
|
|
10
|
-
var PresenterSettings = ({ settings }) => {
|
|
11
|
-
var _effect = _useSignals();
|
|
12
|
-
try {
|
|
13
|
-
const { t } = useTranslation(meta.id);
|
|
14
|
-
return /* @__PURE__ */ React.createElement(ControlPage, null, /* @__PURE__ */ React.createElement(ControlSection, {
|
|
15
|
-
title: t("settings title", {
|
|
16
|
-
ns: meta.id
|
|
17
|
-
})
|
|
18
|
-
}, /* @__PURE__ */ React.createElement(ControlGroup, null, /* @__PURE__ */ React.createElement(ControlItemInput, {
|
|
19
|
-
title: t("present collections label")
|
|
20
|
-
}, /* @__PURE__ */ React.createElement(Input.Switch, {
|
|
21
|
-
checked: settings.presentCollections,
|
|
22
|
-
onCheckedChange: (checked) => settings.presentCollections = !!checked
|
|
23
|
-
})))));
|
|
24
|
-
} finally {
|
|
25
|
-
_effect.f();
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
// src/components/index.ts
|
|
30
|
-
import { lazy } from "react";
|
|
31
|
-
var MarkdownSlide = lazy(() => import("./MarkdownSlide-MEXR54L5.mjs"));
|
|
32
|
-
var DocumentPresenterContainer = lazy(() => import("./DocumentPresenterContainer-SX32NAEH.mjs"));
|
|
33
|
-
var CollectionPresenterContainer = lazy(() => import("./CollectionPresenterContainer-4JFW3EKV.mjs"));
|
|
34
|
-
|
|
35
|
-
export {
|
|
36
|
-
PresenterSettings,
|
|
37
|
-
MarkdownSlide,
|
|
38
|
-
DocumentPresenterContainer,
|
|
39
|
-
CollectionPresenterContainer
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=chunk-Q3H4KEFB.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/PresenterSettings.tsx", "../../../src/components/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Input, useTranslation } from '@dxos/react-ui';\nimport { ControlGroup, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';\n\nimport { meta } from '../meta';\nimport { type PresenterSettingsProps } from '../types';\n\nexport const PresenterSettings = ({ settings }: { settings: PresenterSettingsProps }) => {\n const { t } = useTranslation(meta.id);\n\n return (\n <ControlPage>\n <ControlSection title={t('settings title', { ns: meta.id })}>\n <ControlGroup>\n <ControlItemInput title={t('present collections label')}>\n <Input.Switch\n checked={settings.presentCollections}\n onCheckedChange={(checked) => (settings.presentCollections = !!checked)}\n />\n </ControlItemInput>\n </ControlGroup>\n </ControlSection>\n </ControlPage>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport * from './PresenterSettings';\n\nexport const MarkdownSlide = lazy(() => import('./MarkdownSlide'));\nexport const DocumentPresenterContainer = lazy(() => import('./DocumentPresenterContainer'));\nexport const CollectionPresenterContainer = lazy(() => import('./CollectionPresenterContainer'));\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,OAAOC,sBAAsB;AACtC,SAASC,cAAcC,kBAAkBC,aAAaC,sBAAsB;AAKrE,IAAMC,oBAAoB,CAAC,EAAEC,SAAQ,MAAwC;;;AAClF,UAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AAEpC,WACE,sBAAA,cAACC,aAAAA,MACC,sBAAA,cAACC,gBAAAA;MAAeC,OAAON,EAAE,kBAAkB;QAAEO,IAAIL,KAAKC;MAAG,CAAA;OACvD,sBAAA,cAACK,cAAAA,MACC,sBAAA,cAACC,kBAAAA;MAAiBH,OAAON,EAAE,2BAAA;OACzB,sBAAA,cAACU,MAAMC,QAAM;MACXC,SAASb,SAASc;MAClBC,iBAAiB,CAACF,YAAab,SAASc,qBAAqB,CAAC,CAACD;;;;;AAO7E;;;ACzBA,SAASG,YAAY;AAId,IAAMC,gBAAgBC,KAAK,MAAM,OAAO,8BAAA,CAAA;AACxC,IAAMC,6BAA6BD,KAAK,MAAM,OAAO,2CAAA,CAAA;AACrD,IAAME,+BAA+BF,KAAK,MAAM,OAAO,6CAAA,CAAA;",
|
|
6
|
-
"names": ["React", "Input", "useTranslation", "ControlGroup", "ControlItemInput", "ControlPage", "ControlSection", "PresenterSettings", "settings", "t", "useTranslation", "meta", "id", "ControlPage", "ControlSection", "title", "ns", "ControlGroup", "ControlItemInput", "Input", "Switch", "checked", "presentCollections", "onCheckedChange", "lazy", "MarkdownSlide", "lazy", "DocumentPresenterContainer", "CollectionPresenterContainer"]
|
|
7
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// src/meta.ts
|
|
2
|
-
import { trim } from "@dxos/util";
|
|
3
|
-
var meta = {
|
|
4
|
-
id: "dxos.org/plugin/presenter",
|
|
5
|
-
name: "Presenter",
|
|
6
|
-
description: trim`
|
|
7
|
-
Transform markdown documents into interactive presentation slideshows.
|
|
8
|
-
Navigate between slides with keyboard controls and present content in full-screen mode.
|
|
9
|
-
`,
|
|
10
|
-
icon: "ph--presentation--regular",
|
|
11
|
-
iconHue: "indigo",
|
|
12
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-presenter"
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
meta
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=chunk-TMTUZQCK.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/presenter',\n name: 'Presenter',\n description: trim`\n Transform markdown documents into interactive presentation slideshows.\n Navigate between slides with keyboard controls and present content in full-screen mode.\n `,\n icon: 'ph--presentation--regular',\n iconHue: 'indigo',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-presenter',\n};\n"],
|
|
5
|
-
"mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAmB;EAC9BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,SAAS;EACTC,QAAQ;AACV;",
|
|
6
|
-
"names": ["trim", "meta", "id", "name", "description", "trim", "icon", "iconHue", "source"]
|
|
7
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
meta
|
|
3
|
-
} from "./chunk-TMTUZQCK.mjs";
|
|
4
|
-
|
|
5
|
-
// src/types.ts
|
|
6
|
-
import * as Schema from "effect/Schema";
|
|
7
|
-
import { createContext } from "react";
|
|
8
|
-
import { Markdown } from "@dxos/plugin-markdown/types";
|
|
9
|
-
import { Collection } from "@dxos/schema";
|
|
10
|
-
(function(PresenterAction2) {
|
|
11
|
-
const PRESENTER_ACTION = `${meta.id}/action`;
|
|
12
|
-
class TogglePresentation extends Schema.TaggedClass()(`${PRESENTER_ACTION}/toggle-presentation`, {
|
|
13
|
-
input: Schema.Struct({
|
|
14
|
-
object: Schema.Union(Markdown.Document, Collection.Collection),
|
|
15
|
-
state: Schema.optional(Schema.Boolean)
|
|
16
|
-
}),
|
|
17
|
-
output: Schema.Void
|
|
18
|
-
}) {
|
|
19
|
-
}
|
|
20
|
-
PresenterAction2.TogglePresentation = TogglePresentation;
|
|
21
|
-
})(PresenterAction || (PresenterAction = {}));
|
|
22
|
-
var PresenterContext = createContext({
|
|
23
|
-
running: false,
|
|
24
|
-
start: () => {
|
|
25
|
-
},
|
|
26
|
-
stop: () => {
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
var PresenterSettingsSchema = Schema.mutable(Schema.Struct({
|
|
30
|
-
presentCollections: Schema.optional(Schema.Boolean)
|
|
31
|
-
}));
|
|
32
|
-
var PresenterAction;
|
|
33
|
-
|
|
34
|
-
export {
|
|
35
|
-
PresenterContext,
|
|
36
|
-
PresenterSettingsSchema,
|
|
37
|
-
PresenterAction
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=chunk-VRRPVTKA.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\nimport { type Context, createContext } from 'react';\n\nimport { Markdown } from '@dxos/plugin-markdown/types';\nimport { Collection } from '@dxos/schema';\n\nimport { meta } from './meta';\n\nexport namespace PresenterAction {\n const PRESENTER_ACTION = `${meta.id}/action`;\n\n export class TogglePresentation extends Schema.TaggedClass<TogglePresentation>()(\n `${PRESENTER_ACTION}/toggle-presentation`,\n {\n input: Schema.Struct({\n object: Schema.Union(Markdown.Document, Collection.Collection),\n state: Schema.optional(Schema.Boolean),\n }),\n output: Schema.Void,\n },\n ) {}\n}\n\nexport type PresenterContextType = {\n running: boolean;\n start: () => void;\n stop: () => void;\n};\n\nexport const PresenterContext: Context<PresenterContextType> = createContext<PresenterContextType>({\n running: false,\n start: () => {},\n stop: () => {},\n});\n\nexport const PresenterSettingsSchema = Schema.mutable(\n Schema.Struct({\n presentCollections: Schema.optional(Schema.Boolean),\n }),\n);\n\nexport type PresenterSettingsProps = Schema.Schema.Type<typeof PresenterSettingsSchema>;\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,YAAYA,YAAY;AACxB,SAAuBC,qBAAqB;AAE5C,SAASC,gBAAgB;AACzB,SAASC,kBAAkB;UAIVC,kBAAAA;AACf,QAAMC,mBAAmB,GAAGC,KAAKC,EAAE;EAE5B,MAAMC,2BAAkCC,mBAAW,EACxD,GAAGJ,gBAAAA,wBACH;IACEK,OAAcC,cAAO;MACnBC,QAAeC,aAAMC,SAASC,UAAUC,WAAWA,UAAU;MAC7DC,OAAcC,gBAAgBC,cAAO;IACvC,CAAA;IACAC,QAAeC;EACjB,CAAA,EAAA;EACC;mBATUb,qBAAAA;AAUf,GAbiBJ,oBAAAA,kBAAAA,CAAAA,EAAAA;AAqBV,IAAMkB,mBAAkDC,cAAoC;EACjGC,SAAS;EACTC,OAAO,MAAA;EAAO;EACdC,MAAM,MAAA;EAAO;AACf,CAAA;AAEO,IAAMC,0BAAiCC,eACrCjB,cAAO;EACZkB,oBAA2BX,gBAAgBC,cAAO;AACpD,CAAA,CAAA;;",
|
|
6
|
-
"names": ["Schema", "createContext", "Markdown", "Collection", "PresenterAction", "PRESENTER_ACTION", "meta", "id", "TogglePresentation", "TaggedClass", "input", "Struct", "object", "Union", "Markdown", "Document", "Collection", "state", "optional", "Boolean", "output", "Void", "PresenterContext", "createContext", "running", "start", "stop", "PresenterSettingsSchema", "mutable", "presentCollections"]
|
|
7
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CollectionPresenterContainer,
|
|
3
|
-
DocumentPresenterContainer,
|
|
4
|
-
MarkdownSlide,
|
|
5
|
-
PresenterSettings
|
|
6
|
-
} from "./chunk-Q3H4KEFB.mjs";
|
|
7
|
-
import {
|
|
8
|
-
meta
|
|
9
|
-
} from "./chunk-TMTUZQCK.mjs";
|
|
10
|
-
|
|
11
|
-
// src/capabilities/react-surface.tsx
|
|
12
|
-
import React from "react";
|
|
13
|
-
import { Capabilities, contributes, createSurface } from "@dxos/app-framework";
|
|
14
|
-
import { Obj } from "@dxos/echo";
|
|
15
|
-
import { SettingsStore } from "@dxos/local-storage";
|
|
16
|
-
import { Markdown } from "@dxos/plugin-markdown/types";
|
|
17
|
-
import { Collection } from "@dxos/schema";
|
|
18
|
-
var react_surface_default = (() => contributes(Capabilities.ReactSurface, [
|
|
19
|
-
createSurface({
|
|
20
|
-
id: `${meta.id}/document`,
|
|
21
|
-
role: "article",
|
|
22
|
-
position: "hoist",
|
|
23
|
-
filter: (data) => !!data.subject && typeof data.subject === "object" && "type" in data.subject && "object" in data.subject && data.subject.type === meta.id && Obj.instanceOf(Markdown.Document, data.subject.object),
|
|
24
|
-
component: ({ data }) => /* @__PURE__ */ React.createElement(DocumentPresenterContainer, {
|
|
25
|
-
document: data.subject.object
|
|
26
|
-
})
|
|
27
|
-
}),
|
|
28
|
-
createSurface({
|
|
29
|
-
id: `${meta.id}/collection`,
|
|
30
|
-
role: "article",
|
|
31
|
-
position: "hoist",
|
|
32
|
-
filter: (data) => !!data.subject && typeof data.subject === "object" && "type" in data.subject && "object" in data.subject && data.subject.type === meta.id && Obj.instanceOf(Collection.Collection, data.subject.object),
|
|
33
|
-
component: ({ data }) => /* @__PURE__ */ React.createElement(CollectionPresenterContainer, {
|
|
34
|
-
collection: data.subject.object
|
|
35
|
-
})
|
|
36
|
-
}),
|
|
37
|
-
createSurface({
|
|
38
|
-
id: `${meta.id}/slide`,
|
|
39
|
-
role: "slide",
|
|
40
|
-
filter: (data) => Obj.instanceOf(Markdown.Document, data.subject),
|
|
41
|
-
component: ({ data }) => /* @__PURE__ */ React.createElement(MarkdownSlide, {
|
|
42
|
-
document: data.subject
|
|
43
|
-
})
|
|
44
|
-
}),
|
|
45
|
-
createSurface({
|
|
46
|
-
id: `${meta.id}/plugin-settings`,
|
|
47
|
-
role: "article",
|
|
48
|
-
filter: (data) => data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
|
|
49
|
-
component: ({ data: { subject } }) => /* @__PURE__ */ React.createElement(PresenterSettings, {
|
|
50
|
-
settings: subject.value
|
|
51
|
-
})
|
|
52
|
-
})
|
|
53
|
-
]));
|
|
54
|
-
export {
|
|
55
|
-
react_surface_default as default
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=react-surface-S4T6X72R.mjs.map
|