@dxos/plugin-presenter 0.8.4-main.f9ba587 → 0.8.4-main.fcfe5033a5
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 -47
- 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 +4 -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 +5 -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/Panel.stories.d.ts +18 -0
- package/dist/types/src/components/Markdown/Panel.stories.d.ts.map +1 -0
- package/dist/types/src/components/Markdown/Slide.d.ts +2 -4
- package/dist/types/src/components/Markdown/Slide.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Slide.stories.d.ts +11 -12
- package/dist/types/src/components/Markdown/Slide.stories.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 +5 -5
- package/dist/types/src/components/Presenter/Layout.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Pager.d.ts +4 -4
- package/dist/types/src/components/Presenter/Pager.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Pager.stories.d.ts +12 -4
- package/dist/types/src/components/Presenter/Pager.stories.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 +5 -4
- package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts.map +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts +21 -2
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +5 -10
- 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/containers/DocumentPresenterContainer/DocumentPresenterContainer.d.ts +6 -0
- package/dist/types/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.d.ts.map +1 -0
- package/dist/types/src/containers/DocumentPresenterContainer/index.d.ts +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 -3
- 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 -4
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +7 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +15 -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 +64 -43
- package/src/PresenterPlugin.tsx +12 -26
- package/src/capabilities/app-graph-builder.ts +94 -72
- package/src/capabilities/index.ts +4 -4
- package/src/capabilities/react-surface.tsx +59 -44
- package/src/capabilities/settings.ts +24 -12
- package/src/components/Markdown/Panel.stories.tsx +58 -0
- package/src/components/Markdown/{Container.tsx → Panel.tsx} +6 -6
- package/src/components/Markdown/Slide.stories.tsx +12 -8
- package/src/components/Markdown/Slide.tsx +14 -130
- package/src/components/Markdown/index.ts +1 -1
- package/src/components/Markdown/styles.css +104 -0
- package/src/components/Markdown/theme.ts +5 -5
- package/src/components/Markdown/typings.d.ts +8 -0
- package/src/components/Presenter/Layout.tsx +24 -23
- package/src/components/Presenter/Pager.stories.tsx +10 -10
- package/src/components/Presenter/Pager.tsx +55 -22
- 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 +7 -6
- package/src/components/RevealPlayer/RevealPlayer.tsx +58 -52
- package/src/components/index.ts +5 -5
- package/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.tsx +50 -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/containers/MarkdownSlide/MarkdownSlide.tsx +26 -0
- package/src/containers/MarkdownSlide/index.ts +5 -0
- package/src/containers/index.ts +9 -0
- package/src/meta.ts +9 -6
- 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 -4
- package/src/types/Settings.ts +15 -0
- package/src/types/index.ts +30 -0
- package/src/useExitPresenter.ts +26 -24
- package/dist/lib/browser/CollectionPresenterContainer-CMHKK7TI.mjs +0 -189
- package/dist/lib/browser/CollectionPresenterContainer-CMHKK7TI.mjs.map +0 -7
- package/dist/lib/browser/DocumentPresenterContainer-E7RGK572.mjs +0 -185
- package/dist/lib/browser/DocumentPresenterContainer-E7RGK572.mjs.map +0 -7
- package/dist/lib/browser/MarkdownSlide-QHC3GZII.mjs +0 -336
- package/dist/lib/browser/MarkdownSlide-QHC3GZII.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-2ZLAWPF2.mjs +0 -77
- package/dist/lib/browser/app-graph-builder-2ZLAWPF2.mjs.map +0 -7
- package/dist/lib/browser/chunk-SW3HIRDA.mjs +0 -39
- package/dist/lib/browser/chunk-SW3HIRDA.mjs.map +0 -7
- package/dist/lib/browser/chunk-TANLITL2.mjs +0 -36
- package/dist/lib/browser/chunk-TANLITL2.mjs.map +0 -7
- package/dist/lib/browser/chunk-VSD5LSE5.mjs +0 -15
- package/dist/lib/browser/chunk-VSD5LSE5.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZUDP646V.mjs +0 -37
- package/dist/lib/browser/chunk-ZUDP646V.mjs.map +0 -7
- package/dist/lib/browser/react-surface-5WI73FAE.mjs +0 -57
- package/dist/lib/browser/react-surface-5WI73FAE.mjs.map +0 -7
- package/dist/lib/browser/settings-X7M27QCY.mjs +0 -22
- package/dist/lib/browser/settings-X7M27QCY.mjs.map +0 -7
- package/dist/lib/node-esm/CollectionPresenterContainer-VGIYRG3V.mjs +0 -190
- package/dist/lib/node-esm/CollectionPresenterContainer-VGIYRG3V.mjs.map +0 -7
- package/dist/lib/node-esm/DocumentPresenterContainer-RG4P7XA6.mjs +0 -186
- package/dist/lib/node-esm/DocumentPresenterContainer-RG4P7XA6.mjs.map +0 -7
- package/dist/lib/node-esm/MarkdownSlide-IDPOGD64.mjs +0 -338
- package/dist/lib/node-esm/MarkdownSlide-IDPOGD64.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-PNVMZBL6.mjs +0 -78
- package/dist/lib/node-esm/app-graph-builder-PNVMZBL6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GDG7Q5H4.mjs +0 -40
- package/dist/lib/node-esm/chunk-GDG7Q5H4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MVKQEF6Y.mjs +0 -17
- package/dist/lib/node-esm/chunk-MVKQEF6Y.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VZEWAW63.mjs +0 -38
- package/dist/lib/node-esm/chunk-VZEWAW63.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YI6PZYVI.mjs +0 -38
- package/dist/lib/node-esm/chunk-YI6PZYVI.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -67
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-JWLPKDCJ.mjs +0 -58
- package/dist/lib/node-esm/react-surface-JWLPKDCJ.mjs.map +0 -7
- package/dist/lib/node-esm/settings-G2PHYWSK.mjs +0 -23
- package/dist/lib/node-esm/settings-G2PHYWSK.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 +0 -26
- package/dist/types/src/components/Markdown/Container.stories.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownSlide.d.ts +0 -7
- 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 -39
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/components/CollectionPresenterContainer.tsx +0 -43
- package/src/components/DocumentPresenterContainer.tsx +0 -22
- package/src/components/Markdown/Container.stories.tsx +0 -57
- package/src/components/MarkdownSlide.tsx +0 -24
- package/src/components/PresenterSettings.tsx +0 -26
- package/src/types.ts +0 -46
|
@@ -1,338 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/components/MarkdownSlide.tsx
|
|
4
|
-
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
5
|
-
import React3 from "react";
|
|
6
|
-
|
|
7
|
-
// src/components/Markdown/Container.tsx
|
|
8
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
9
|
-
import React, { useState } from "react";
|
|
10
|
-
import { useResizeDetector } from "react-resize-detector";
|
|
11
|
-
import { mx } from "@dxos/react-ui-theme";
|
|
12
|
-
var Container = ({ children, classNames }) => {
|
|
13
|
-
var _effect = _useSignals();
|
|
14
|
-
try {
|
|
15
|
-
const [props, setProps] = useState({});
|
|
16
|
-
const { ref: containerRef, width, height } = useResizeDetector({
|
|
17
|
-
refreshMode: "debounce",
|
|
18
|
-
refreshRate: 200,
|
|
19
|
-
refreshOptions: {
|
|
20
|
-
leading: true
|
|
21
|
-
},
|
|
22
|
-
onResize: ({ width: width2, height: height2 }) => {
|
|
23
|
-
if (width2 && height2) {
|
|
24
|
-
setProps(createLayoutProps({
|
|
25
|
-
width: width2,
|
|
26
|
-
height: height2
|
|
27
|
-
}));
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
32
|
-
ref: containerRef,
|
|
33
|
-
className: mx("flex grow relative overflow-hidden bg-attention", classNames)
|
|
34
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
35
|
-
className: mx("flex w-full h-full overflow-hidden absolute"),
|
|
36
|
-
style: props
|
|
37
|
-
}, width && height && children));
|
|
38
|
-
} finally {
|
|
39
|
-
_effect.f();
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
var createLayoutProps = ({ width, height }) => {
|
|
43
|
-
const aspectRatio = 16 / 9;
|
|
44
|
-
const nominalWidth = 2560;
|
|
45
|
-
const nominalHeight = nominalWidth / aspectRatio;
|
|
46
|
-
const scale = Math.min(width / nominalWidth, height / nominalHeight);
|
|
47
|
-
return {
|
|
48
|
-
left: (width - nominalWidth) / 2,
|
|
49
|
-
top: (height - nominalHeight) / 2,
|
|
50
|
-
width: nominalWidth,
|
|
51
|
-
height: nominalHeight,
|
|
52
|
-
transform: `scale(${scale})`
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
// src/components/Markdown/Slide.tsx
|
|
57
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
58
|
-
import { h } from "hastscript";
|
|
59
|
-
import React2 from "react";
|
|
60
|
-
import ReactMarkdown from "react-markdown";
|
|
61
|
-
import addClasses from "rehype-add-classes";
|
|
62
|
-
import highlight from "rehype-highlight";
|
|
63
|
-
import remarkFrontmatter from "remark-frontmatter";
|
|
64
|
-
import remarkParseFrontmatter from "remark-parse-frontmatter";
|
|
65
|
-
import "highlight.js/styles/github.css";
|
|
66
|
-
|
|
67
|
-
// src/components/Markdown/theme.ts
|
|
68
|
-
var theme = {
|
|
69
|
-
root: "bg-attention leading-relaxed font-mono",
|
|
70
|
-
padding: "px-40 py-16 gap-8",
|
|
71
|
-
nodes: {
|
|
72
|
-
h1: "text-[80px] text-accentText",
|
|
73
|
-
h2: "text-[60px] text-accentText",
|
|
74
|
-
h3: "text-[48px] text-accentText",
|
|
75
|
-
p: "text-[48px]",
|
|
76
|
-
ul: "my-[16px] ml-12 leading-relaxed list-disc",
|
|
77
|
-
ol: "my-[16px] ml-24 leading-relaxed list-decimal",
|
|
78
|
-
li: "pl-6 text-[48px]",
|
|
79
|
-
pre: "w-full mx-0 my-[32px] p-0 __border-l-[16px] bg-inputSurface p-4 __whitespace-pre-line",
|
|
80
|
-
code: "p-0 text-[40px]"
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
// src/components/Markdown/Slide.tsx
|
|
85
|
-
var Slide = ({ content = "", classes = theme.nodes }) => {
|
|
86
|
-
var _effect = _useSignals2();
|
|
87
|
-
try {
|
|
88
|
-
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("style", null, `
|
|
89
|
-
.dark pre code.hljs {
|
|
90
|
-
display: block;
|
|
91
|
-
overflow-x: auto;
|
|
92
|
-
padding: 1em
|
|
93
|
-
}
|
|
94
|
-
.dark code.hljs {
|
|
95
|
-
padding: 3px 5px
|
|
96
|
-
}
|
|
97
|
-
/*!
|
|
98
|
-
Theme: GitHub Dark
|
|
99
|
-
Description: Dark theme as seen on github.com
|
|
100
|
-
Author: github.com
|
|
101
|
-
Maintainer: @Hirse
|
|
102
|
-
Updated: 2021-05-15
|
|
103
|
-
|
|
104
|
-
Outdated base version: https://github.com/primer/github-syntax-dark
|
|
105
|
-
Current colors taken from GitHub's CSS
|
|
106
|
-
*/
|
|
107
|
-
.dark .hljs {
|
|
108
|
-
color: #c9d1d9;
|
|
109
|
-
background: #0d1117
|
|
110
|
-
}
|
|
111
|
-
.dark .hljs-doctag,
|
|
112
|
-
.dark .hljs-keyword,
|
|
113
|
-
.dark .hljs-meta .hljs-keyword,
|
|
114
|
-
.dark .hljs-template-tag,
|
|
115
|
-
.dark .hljs-template-variable,
|
|
116
|
-
.dark .hljs-type,
|
|
117
|
-
.dark .hljs-variable.language_ {
|
|
118
|
-
/* prettylights-syntax-keyword */
|
|
119
|
-
color: #ff7b72
|
|
120
|
-
}
|
|
121
|
-
.dark .hljs-title,
|
|
122
|
-
.dark .hljs-title.class_,
|
|
123
|
-
.dark .hljs-title.class_.inherited__,
|
|
124
|
-
.dark .hljs-title.function_ {
|
|
125
|
-
/* prettylights-syntax-entity */
|
|
126
|
-
color: #d2a8ff
|
|
127
|
-
}
|
|
128
|
-
.dark .hljs-attr,
|
|
129
|
-
.dark .hljs-attribute,
|
|
130
|
-
.dark .hljs-literal,
|
|
131
|
-
.dark .hljs-meta,
|
|
132
|
-
.dark .hljs-number,
|
|
133
|
-
.dark .hljs-operator,
|
|
134
|
-
.dark .hljs-variable,
|
|
135
|
-
.dark .hljs-selector-attr,
|
|
136
|
-
.dark .hljs-selector-class,
|
|
137
|
-
.dark .hljs-selector-id {
|
|
138
|
-
/* prettylights-syntax-constant */
|
|
139
|
-
color: #79c0ff
|
|
140
|
-
}
|
|
141
|
-
.dark .hljs-regexp,
|
|
142
|
-
.dark .hljs-string,
|
|
143
|
-
.dark .hljs-meta .hljs-string {
|
|
144
|
-
/* prettylights-syntax-string */
|
|
145
|
-
color: #a5d6ff
|
|
146
|
-
}
|
|
147
|
-
.dark .hljs-built_in,
|
|
148
|
-
.dark .hljs-symbol {
|
|
149
|
-
/* prettylights-syntax-variable */
|
|
150
|
-
color: #ffa657
|
|
151
|
-
}
|
|
152
|
-
.dark .hljs-comment,
|
|
153
|
-
.dark .hljs-code,
|
|
154
|
-
.dark .hljs-formula {
|
|
155
|
-
/* prettylights-syntax-comment */
|
|
156
|
-
color: #8b949e
|
|
157
|
-
}
|
|
158
|
-
.dark .hljs-name,
|
|
159
|
-
.dark .hljs-quote,
|
|
160
|
-
.dark .hljs-selector-tag,
|
|
161
|
-
.dark .hljs-selector-pseudo {
|
|
162
|
-
/* prettylights-syntax-entity-tag */
|
|
163
|
-
color: #7ee787
|
|
164
|
-
}
|
|
165
|
-
.dark .hljs-subst {
|
|
166
|
-
/* prettylights-syntax-storage-modifier-import */
|
|
167
|
-
color: #c9d1d9
|
|
168
|
-
}
|
|
169
|
-
.dark .hljs-section {
|
|
170
|
-
/* prettylights-syntax-markup-heading */
|
|
171
|
-
color: #1f6feb;
|
|
172
|
-
font-weight: bold
|
|
173
|
-
}
|
|
174
|
-
.dark .hljs-bullet {
|
|
175
|
-
/* prettylights-syntax-markup-list */
|
|
176
|
-
color: #f2cc60
|
|
177
|
-
}
|
|
178
|
-
.dark .hljs-emphasis {
|
|
179
|
-
/* prettylights-syntax-markup-italic */
|
|
180
|
-
color: #c9d1d9;
|
|
181
|
-
font-style: italic
|
|
182
|
-
}
|
|
183
|
-
.dark .hljs-strong {
|
|
184
|
-
/* prettylights-syntax-markup-bold */
|
|
185
|
-
color: #c9d1d9;
|
|
186
|
-
font-weight: bold
|
|
187
|
-
}
|
|
188
|
-
.dark .hljs-addition {
|
|
189
|
-
/* prettylights-syntax-markup-inserted */
|
|
190
|
-
color: #aff5b4;
|
|
191
|
-
background-color: #033a16
|
|
192
|
-
}
|
|
193
|
-
.dark .hljs-deletion {
|
|
194
|
-
/* prettylights-syntax-markup-deleted */
|
|
195
|
-
color: #ffdcd7;
|
|
196
|
-
background-color: #67060c
|
|
197
|
-
}
|
|
198
|
-
.dark .hljs-char.escape_,
|
|
199
|
-
.dark .hljs-link,
|
|
200
|
-
.dark .hljs-params,
|
|
201
|
-
.dark .hljs-property,
|
|
202
|
-
.dark .hljs-punctuation,
|
|
203
|
-
.dark .hljs-tag {
|
|
204
|
-
/* purposely ignored */
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
`), /* @__PURE__ */ React2.createElement(ReactMarkdown, {
|
|
208
|
-
components,
|
|
209
|
-
// Markdown to HTML.
|
|
210
|
-
remarkPlugins: [
|
|
211
|
-
[
|
|
212
|
-
remarkFrontmatter,
|
|
213
|
-
"yaml"
|
|
214
|
-
],
|
|
215
|
-
remarkParseFrontmatter
|
|
216
|
-
],
|
|
217
|
-
// HTML processing.
|
|
218
|
-
rehypePlugins: [
|
|
219
|
-
highlight,
|
|
220
|
-
[
|
|
221
|
-
addClasses,
|
|
222
|
-
classes
|
|
223
|
-
],
|
|
224
|
-
slideLayout
|
|
225
|
-
]
|
|
226
|
-
}, content));
|
|
227
|
-
} finally {
|
|
228
|
-
_effect.f();
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
var slideLayout = (options = {}) => (tree, file) => {
|
|
232
|
-
const { data: { frontmatter = {} } } = file;
|
|
233
|
-
let content = tree.children;
|
|
234
|
-
const { layout, image } = frontmatter;
|
|
235
|
-
if (image) {
|
|
236
|
-
const img = h("div", {
|
|
237
|
-
class: "flex grow shrink-0 bg-cover bg-center bg-no-repeat",
|
|
238
|
-
style: {
|
|
239
|
-
backgroundImage: `url(${image})`
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
switch (layout) {
|
|
243
|
-
case "fullscreen": {
|
|
244
|
-
content = img;
|
|
245
|
-
break;
|
|
246
|
-
}
|
|
247
|
-
case "columns": {
|
|
248
|
-
content = h("div", {
|
|
249
|
-
class: "flex grow grid grid-cols-2"
|
|
250
|
-
}, [
|
|
251
|
-
h("div", {
|
|
252
|
-
class: theme.padding
|
|
253
|
-
}, [
|
|
254
|
-
content
|
|
255
|
-
]),
|
|
256
|
-
img
|
|
257
|
-
]);
|
|
258
|
-
break;
|
|
259
|
-
}
|
|
260
|
-
case "rows": {
|
|
261
|
-
content = h("div", {
|
|
262
|
-
class: "flex grow flex-col"
|
|
263
|
-
}, [
|
|
264
|
-
h("div", {
|
|
265
|
-
class: theme.padding
|
|
266
|
-
}, [
|
|
267
|
-
content
|
|
268
|
-
]),
|
|
269
|
-
h("div", {
|
|
270
|
-
class: [
|
|
271
|
-
"flex grow pt-0",
|
|
272
|
-
theme.padding
|
|
273
|
-
]
|
|
274
|
-
}, [
|
|
275
|
-
img
|
|
276
|
-
])
|
|
277
|
-
]);
|
|
278
|
-
break;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
} else {
|
|
282
|
-
content = h("div", {
|
|
283
|
-
class: [
|
|
284
|
-
"flex grow flex-col",
|
|
285
|
-
theme.padding
|
|
286
|
-
]
|
|
287
|
-
}, [
|
|
288
|
-
content
|
|
289
|
-
]);
|
|
290
|
-
}
|
|
291
|
-
const root = h("div", {
|
|
292
|
-
class: [
|
|
293
|
-
"flex flex-col grow",
|
|
294
|
-
theme.root
|
|
295
|
-
]
|
|
296
|
-
}, [
|
|
297
|
-
content
|
|
298
|
-
]);
|
|
299
|
-
tree.children = [
|
|
300
|
-
root
|
|
301
|
-
];
|
|
302
|
-
};
|
|
303
|
-
var ImageWrapper = ({ node, ...props }) => {
|
|
304
|
-
var _effect = _useSignals2();
|
|
305
|
-
try {
|
|
306
|
-
const { alt = "", src } = props;
|
|
307
|
-
return /* @__PURE__ */ React2.createElement("img", {
|
|
308
|
-
alt,
|
|
309
|
-
src
|
|
310
|
-
});
|
|
311
|
-
} finally {
|
|
312
|
-
_effect.f();
|
|
313
|
-
}
|
|
314
|
-
};
|
|
315
|
-
var components = {
|
|
316
|
-
img: ImageWrapper
|
|
317
|
-
};
|
|
318
|
-
|
|
319
|
-
// src/components/MarkdownSlide.tsx
|
|
320
|
-
var MarkdownSlide = ({ document }) => {
|
|
321
|
-
var _effect = _useSignals3();
|
|
322
|
-
try {
|
|
323
|
-
const content = document.content.target?.content;
|
|
324
|
-
if (!content) {
|
|
325
|
-
return null;
|
|
326
|
-
}
|
|
327
|
-
return /* @__PURE__ */ React3.createElement(Container, null, /* @__PURE__ */ React3.createElement(Slide, {
|
|
328
|
-
content
|
|
329
|
-
}));
|
|
330
|
-
} finally {
|
|
331
|
-
_effect.f();
|
|
332
|
-
}
|
|
333
|
-
};
|
|
334
|
-
var MarkdownSlide_default = MarkdownSlide;
|
|
335
|
-
export {
|
|
336
|
-
MarkdownSlide_default as default
|
|
337
|
-
};
|
|
338
|
-
//# sourceMappingURL=MarkdownSlide-IDPOGD64.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", "../../../src/components/Markdown/theme.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC } from 'react';\n\nimport { type DocumentType } from '@dxos/plugin-markdown/types';\n\nimport { Container, Slide } from './Markdown';\n\nconst MarkdownSlide: FC<{ document: DocumentType }> = ({ 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 w-full h-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 from 'react-markdown';\nimport addClasses from 'rehype-add-classes';\nimport highlight from 'rehype-highlight';\nimport remarkFrontmatter from 'remark-frontmatter';\nimport remarkParseFrontmatter from 'remark-parse-frontmatter';\n\nimport 'highlight.js/styles/github.css';\n\nimport { theme } from './theme';\n\nexport type SlideProps = {\n content?: string;\n classes?: { [selector: 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>{`\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/*!\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\n Outdated base version: https://github.com/primer/github-syntax-dark\n Current colors taken from GitHub's CSS\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 /* prettylights-syntax-keyword */\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 /* prettylights-syntax-entity */\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 /* prettylights-syntax-constant */\n color: #79c0ff\n}\n.dark .hljs-regexp,\n.dark .hljs-string,\n.dark .hljs-meta .hljs-string {\n /* prettylights-syntax-string */\n color: #a5d6ff\n}\n.dark .hljs-built_in,\n.dark .hljs-symbol {\n /* prettylights-syntax-variable */\n color: #ffa657\n}\n.dark .hljs-comment,\n.dark .hljs-code,\n.dark .hljs-formula {\n /* prettylights-syntax-comment */\n color: #8b949e\n}\n.dark .hljs-name,\n.dark .hljs-quote,\n.dark .hljs-selector-tag,\n.dark .hljs-selector-pseudo {\n /* prettylights-syntax-entity-tag */\n color: #7ee787\n}\n.dark .hljs-subst {\n /* prettylights-syntax-storage-modifier-import */\n color: #c9d1d9\n}\n.dark .hljs-section {\n /* prettylights-syntax-markup-heading */\n color: #1f6feb;\n font-weight: bold\n}\n.dark .hljs-bullet {\n /* prettylights-syntax-markup-list */\n color: #f2cc60\n}\n.dark .hljs-emphasis {\n /* prettylights-syntax-markup-italic */\n color: #c9d1d9;\n font-style: italic\n}\n.dark .hljs-strong {\n /* prettylights-syntax-markup-bold */\n color: #c9d1d9;\n font-weight: bold\n}\n.dark .hljs-addition {\n /* prettylights-syntax-markup-inserted */\n color: #aff5b4;\n background-color: #033a16\n}\n.dark .hljs-deletion {\n /* prettylights-syntax-markup-deleted */\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 \n}\n `}</style>\n <ReactMarkdown\n components={components}\n // Markdown to HTML.\n remarkPlugins={[[remarkFrontmatter, 'yaml'], remarkParseFrontmatter as any]}\n // HTML processing.\n rehypePlugins={[highlight, [addClasses, classes], 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 = { img: ImageWrapper };\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: 'px-40 py-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: 'w-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": "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",
|
|
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", "addClasses", "highlight", "remarkFrontmatter", "remarkParseFrontmatter", "theme", "root", "padding", "nodes", "h1", "h2", "h3", "p", "ul", "ol", "li", "pre", "code", "Slide", "content", "classes", "theme", "nodes", "React", "style", "ReactMarkdown", "components", "remarkPlugins", "remarkFrontmatter", "remarkParseFrontmatter", "rehypePlugins", "highlight", "addClasses", "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,78 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
PresenterAction
|
|
4
|
-
} from "./chunk-GDG7Q5H4.mjs";
|
|
5
|
-
import {
|
|
6
|
-
PRESENTER_PLUGIN
|
|
7
|
-
} from "./chunk-MVKQEF6Y.mjs";
|
|
8
|
-
|
|
9
|
-
// src/capabilities/app-graph-builder.ts
|
|
10
|
-
import { Rx } from "@effect-rx/rx-react";
|
|
11
|
-
import { Option, pipe } from "effect";
|
|
12
|
-
import { contributes, Capabilities, createIntent, LayoutAction } 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 { createExtension, rxFromSignal } from "@dxos/plugin-graph";
|
|
17
|
-
import { DocumentType } from "@dxos/plugin-markdown/types";
|
|
18
|
-
import { fullyQualifiedId, getSpace } from "@dxos/react-client/echo";
|
|
19
|
-
import { DataType } from "@dxos/schema";
|
|
20
|
-
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, createExtension({
|
|
21
|
-
id: PRESENTER_PLUGIN,
|
|
22
|
-
actions: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => {
|
|
23
|
-
const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
|
|
24
|
-
const settings = get(rxFromSignal(() => settingsStore?.getStore(PRESENTER_PLUGIN)?.value));
|
|
25
|
-
const isPresentable = settings?.presentCollections ? Obj.instanceOf(DataType.Collection, node2.data) || Obj.instanceOf(DocumentType, node2.data) : Obj.instanceOf(DocumentType, node2.data);
|
|
26
|
-
return isPresentable ? Option.some(node2.data) : Option.none();
|
|
27
|
-
}), Option.map((object) => {
|
|
28
|
-
const id = fullyQualifiedId(object);
|
|
29
|
-
const spaceId = getSpace(object)?.id;
|
|
30
|
-
return [
|
|
31
|
-
{
|
|
32
|
-
id: `${PresenterAction.TogglePresentation._tag}/${id}`,
|
|
33
|
-
// TODO(burdon): Allow function so can generate state when activated.
|
|
34
|
-
// So can set explicit fullscreen state coordinated with current presenter state.
|
|
35
|
-
data: async () => {
|
|
36
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
37
|
-
const layout = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
38
|
-
const presenterId = [
|
|
39
|
-
id,
|
|
40
|
-
"presenter"
|
|
41
|
-
].join(ATTENDABLE_PATH_SEPARATOR);
|
|
42
|
-
if (!layout.deck.fullscreen) {
|
|
43
|
-
void dispatch(createIntent(DeckAction.Adjust, {
|
|
44
|
-
type: "solo--fullscreen",
|
|
45
|
-
id: presenterId
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
48
|
-
await dispatch(createIntent(LayoutAction.Open, {
|
|
49
|
-
part: "main",
|
|
50
|
-
subject: [
|
|
51
|
-
presenterId
|
|
52
|
-
],
|
|
53
|
-
options: {
|
|
54
|
-
workspace: spaceId
|
|
55
|
-
}
|
|
56
|
-
}));
|
|
57
|
-
},
|
|
58
|
-
properties: {
|
|
59
|
-
label: [
|
|
60
|
-
"toggle presentation label",
|
|
61
|
-
{
|
|
62
|
-
ns: PRESENTER_PLUGIN
|
|
63
|
-
}
|
|
64
|
-
],
|
|
65
|
-
icon: "ph--presentation--regular",
|
|
66
|
-
keyBinding: {
|
|
67
|
-
macos: "shift+meta+p",
|
|
68
|
-
windows: "shift+alt+p"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
];
|
|
73
|
-
}), Option.getOrElse(() => [])))
|
|
74
|
-
}));
|
|
75
|
-
export {
|
|
76
|
-
app_graph_builder_default as default
|
|
77
|
-
};
|
|
78
|
-
//# sourceMappingURL=app-graph-builder-PNVMZBL6.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 { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { contributes, type PluginContext, Capabilities, createIntent, LayoutAction } 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 { createExtension, rxFromSignal } from '@dxos/plugin-graph';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { fullyQualifiedId, getSpace } from '@dxos/react-client/echo';\nimport { DataType } from '@dxos/schema';\n\nimport { PRESENTER_PLUGIN } from '../meta';\nimport { PresenterAction, type PresenterSettingsProps } from '../types';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: PRESENTER_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => {\n const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));\n const settings = get(\n rxFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(PRESENTER_PLUGIN)?.value),\n );\n const isPresentable = settings?.presentCollections\n ? Obj.instanceOf(DataType.Collection, node.data) || Obj.instanceOf(DocumentType, node.data)\n : Obj.instanceOf(DocumentType, node.data);\n return isPresentable ? Option.some(node.data) : Option.none();\n }),\n Option.map((object) => {\n const id = fullyQualifiedId(object);\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: PRESENTER_PLUGIN }],\n icon: 'ph--presentation--regular',\n keyBinding: {\n macos: 'shift+meta+p',\n windows: 'shift+alt+p',\n },\n },\n },\n ];\n }),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,SAASA,UAAU;AACnB,SAASC,QAAQC,YAAY;AAE7B,SAASC,aAAiCC,cAAcC,cAAcC,oBAAoB;AAC1F,SAASC,WAAW;AACpB,SAASC,wBAAwB;AACjC,SAASC,2BAA2BC,kBAAkB;AACtD,SAASC,iBAAiBC,oBAAoB;AAC9C,SAASC,oBAAoB;AAC7B,SAASC,kBAAkBC,gBAAgB;AAC3C,SAASC,gBAAgB;AAKzB,IAAA,4BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;EACdC,IAAIC;EACJC,SAAS,CAACC,SACRC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAAA;AACd,UAAM,CAACO,aAAAA,IAAiBJ,IAAIX,QAAQgB,aAAad,aAAae,aAAa,CAAA;AAC3E,UAAMC,WAAWP,IACfQ,aAAa,MAAMJ,eAAeK,SAAiCd,gBAAAA,GAAmBe,KAAAA,CAAAA;AAExF,UAAMC,gBAAgBJ,UAAUK,qBAC5BC,IAAIC,WAAWC,SAASC,YAAYnB,MAAKoB,IAAI,KAAKJ,IAAIC,WAAWI,cAAcrB,MAAKoB,IAAI,IACxFJ,IAAIC,WAAWI,cAAcrB,MAAKoB,IAAI;AAC1C,WAAON,gBAAgBT,OAAOiB,KAAKtB,MAAKoB,IAAI,IAAIf,OAAOkB,KAAI;EAC7D,CAAA,GACAlB,OAAOmB,IAAI,CAACC,WAAAA;AACV,UAAM5B,KAAK6B,iBAAiBD,MAAAA;AAC5B,UAAME,UAAUC,SAASH,MAAAA,GAAS5B;AAClC,WAAO;MACL;QACEA,IAAI,GAAGgC,gBAAgBC,mBAAmBC,IAAI,IAAIlC,EAAAA;;;QAGlDuB,MAAM,YAAA;AACJ,gBAAM,EAAEY,iBAAiBC,SAAQ,IAAKzC,QAAQ0C,cAAcxC,aAAayC,gBAAgB;AACzF,gBAAMC,SAAS5C,QAAQ0C,cAAcG,iBAAiBC,gBAAgB;AACtE,gBAAMC,cAAc;YAAC1C;YAAI;YAAa2C,KAAKC,yBAAAA;AAC3C,cAAI,CAACL,OAAOM,KAAKC,YAAY;AAC3B,iBAAKV,SACHW,aAAaC,WAAWC,QAAQ;cAC9BC,MAAM;cACNlD,IAAI0C;YACN,CAAA,CAAA;UAEJ;AACA,gBAAMN,SACJW,aAAaI,aAAaC,MAAM;YAC9BC,MAAM;YACNC,SAAS;cAACZ;;YACVa,SAAS;cAAEC,WAAW1B;YAAQ;UAChC,CAAA,CAAA;QAEJ;QACA2B,YAAY;UACVC,OAAO;YAAC;YAA6B;cAAEC,IAAI1D;YAAiB;;UAC5D2D,MAAM;UACNC,YAAY;YACVC,OAAO;YACPC,SAAS;UACX;QACF;MACF;;EAEJ,CAAA,GACAvD,OAAOwD,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;AAGjC,CAAA,CAAA;",
|
|
6
|
-
"names": ["Rx", "Option", "pipe", "contributes", "Capabilities", "createIntent", "LayoutAction", "Obj", "DeckCapabilities", "ATTENDABLE_PATH_SEPARATOR", "DeckAction", "createExtension", "rxFromSignal", "DocumentType", "fullyQualifiedId", "getSpace", "DataType", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "PRESENTER_PLUGIN", "actions", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "settingsStore", "capabilities", "SettingsStore", "settings", "rxFromSignal", "getStore", "value", "isPresentable", "presentCollections", "Obj", "instanceOf", "DataType", "Collection", "data", "DocumentType", "some", "none", "map", "object", "fullyQualifiedId", "spaceId", "getSpace", "PresenterAction", "TogglePresentation", "_tag", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "layout", "DeckCapabilities", "MutableDeckState", "presenterId", "join", "ATTENDABLE_PATH_SEPARATOR", "deck", "fullscreen", "createIntent", "DeckAction", "Adjust", "type", "LayoutAction", "Open", "part", "subject", "options", "workspace", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "getOrElse"]
|
|
7
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
PRESENTER_PLUGIN
|
|
4
|
-
} from "./chunk-MVKQEF6Y.mjs";
|
|
5
|
-
|
|
6
|
-
// src/types.ts
|
|
7
|
-
import { Schema } from "effect";
|
|
8
|
-
import { createContext } from "react";
|
|
9
|
-
import { DocumentType } from "@dxos/plugin-markdown/types";
|
|
10
|
-
import { DataType } from "@dxos/schema";
|
|
11
|
-
(function(PresenterAction2) {
|
|
12
|
-
const PRESENTER_ACTION = `${PRESENTER_PLUGIN}/action`;
|
|
13
|
-
class TogglePresentation extends Schema.TaggedClass()(`${PRESENTER_ACTION}/toggle-presentation`, {
|
|
14
|
-
input: Schema.Struct({
|
|
15
|
-
object: Schema.Union(DocumentType, DataType.Collection),
|
|
16
|
-
state: Schema.optional(Schema.Boolean)
|
|
17
|
-
}),
|
|
18
|
-
output: Schema.Void
|
|
19
|
-
}) {
|
|
20
|
-
}
|
|
21
|
-
PresenterAction2.TogglePresentation = TogglePresentation;
|
|
22
|
-
})(PresenterAction || (PresenterAction = {}));
|
|
23
|
-
var PresenterContext = createContext({
|
|
24
|
-
running: false,
|
|
25
|
-
start: () => {
|
|
26
|
-
},
|
|
27
|
-
stop: () => {
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
var PresenterSettingsSchema = Schema.mutable(Schema.Struct({
|
|
31
|
-
presentCollections: Schema.optional(Schema.Boolean)
|
|
32
|
-
}));
|
|
33
|
-
var PresenterAction;
|
|
34
|
-
|
|
35
|
-
export {
|
|
36
|
-
PresenterContext,
|
|
37
|
-
PresenterSettingsSchema,
|
|
38
|
-
PresenterAction
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=chunk-GDG7Q5H4.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 { Schema } from 'effect';\nimport { type Context, createContext } from 'react';\n\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { DataType } from '@dxos/schema';\n\nimport { PRESENTER_PLUGIN } from './meta';\n\nexport namespace PresenterAction {\n const PRESENTER_ACTION = `${PRESENTER_PLUGIN}/action`;\n\n export class TogglePresentation extends Schema.TaggedClass<TogglePresentation>()(\n `${PRESENTER_ACTION}/toggle-presentation`,\n {\n input: Schema.Struct({\n object: Schema.Union(DocumentType, DataType.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,SAASA,cAAc;AACvB,SAAuBC,qBAAqB;AAE5C,SAASC,oBAAoB;AAC7B,SAASC,gBAAgB;UAIRC,kBAAAA;AACf,QAAMC,mBAAmB,GAAGC,gBAAAA;EAErB,MAAMC,2BAA2BC,OAAOC,YAAW,EACxD,GAAGJ,gBAAAA,wBACH;IACEK,OAAOF,OAAOG,OAAO;MACnBC,QAAQJ,OAAOK,MAAMC,cAAcC,SAASC,UAAU;MACtDC,OAAOT,OAAOU,SAASV,OAAOW,OAAO;IACvC,CAAA;IACAC,QAAQZ,OAAOa;EACjB,CAAA,EAAA;EACC;mBATUd,qBAAAA;AAUf,GAbiBH,oBAAAA,kBAAAA,CAAAA,EAAAA;AAqBV,IAAMkB,mBAAkDC,cAAoC;EACjGC,SAAS;EACTC,OAAO,MAAA;EAAO;EACdC,MAAM,MAAA;EAAO;AACf,CAAA;AAEO,IAAMC,0BAA0BnB,OAAOoB,QAC5CpB,OAAOG,OAAO;EACZkB,oBAAoBrB,OAAOU,SAASV,OAAOW,OAAO;AACpD,CAAA,CAAA;;",
|
|
6
|
-
"names": ["Schema", "createContext", "DocumentType", "DataType", "PresenterAction", "PRESENTER_ACTION", "PRESENTER_PLUGIN", "TogglePresentation", "Schema", "TaggedClass", "input", "Struct", "object", "Union", "DocumentType", "DataType", "Collection", "state", "optional", "Boolean", "output", "Void", "PresenterContext", "createContext", "running", "start", "stop", "PresenterSettingsSchema", "mutable", "presentCollections"]
|
|
7
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/meta.ts
|
|
4
|
-
var PRESENTER_PLUGIN = "dxos.org/plugin/presenter";
|
|
5
|
-
var meta = {
|
|
6
|
-
id: PRESENTER_PLUGIN,
|
|
7
|
-
name: "Presenter",
|
|
8
|
-
description: "Present documents as slideshows.",
|
|
9
|
-
icon: "ph--presentation--regular",
|
|
10
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-presenter"
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
PRESENTER_PLUGIN,
|
|
15
|
-
meta
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=chunk-MVKQEF6Y.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';\n\nexport const PRESENTER_PLUGIN = 'dxos.org/plugin/presenter';\n\nexport const meta: PluginMeta = {\n id: PRESENTER_PLUGIN,\n name: 'Presenter',\n description: 'Present documents as slideshows.',\n icon: 'ph--presentation--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-presenter',\n};\n"],
|
|
5
|
-
"mappings": ";;;AAMO,IAAMA,mBAAmB;AAEzB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;AACV;",
|
|
6
|
-
"names": ["PRESENTER_PLUGIN", "meta", "id", "name", "description", "icon", "source"]
|
|
7
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
PRESENTER_PLUGIN
|
|
4
|
-
} from "./chunk-MVKQEF6Y.mjs";
|
|
5
|
-
|
|
6
|
-
// src/components/PresenterSettings.tsx
|
|
7
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
8
|
-
import React from "react";
|
|
9
|
-
import { Input, useTranslation } from "@dxos/react-ui";
|
|
10
|
-
import { DeprecatedFormContainer, DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
11
|
-
var PresenterSettings = ({ settings }) => {
|
|
12
|
-
var _effect = _useSignals();
|
|
13
|
-
try {
|
|
14
|
-
const { t } = useTranslation(PRESENTER_PLUGIN);
|
|
15
|
-
return /* @__PURE__ */ React.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React.createElement(DeprecatedFormInput, {
|
|
16
|
-
label: t("present collections label")
|
|
17
|
-
}, /* @__PURE__ */ React.createElement(Input.Switch, {
|
|
18
|
-
checked: settings.presentCollections,
|
|
19
|
-
onCheckedChange: (checked) => settings.presentCollections = !!checked
|
|
20
|
-
})));
|
|
21
|
-
} finally {
|
|
22
|
-
_effect.f();
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
// src/components/index.ts
|
|
27
|
-
import { lazy } from "react";
|
|
28
|
-
var MarkdownSlide = lazy(() => import("./MarkdownSlide-IDPOGD64.mjs"));
|
|
29
|
-
var DocumentPresenterContainer = lazy(() => import("./DocumentPresenterContainer-RG4P7XA6.mjs"));
|
|
30
|
-
var CollectionPresenterContainer = lazy(() => import("./CollectionPresenterContainer-VGIYRG3V.mjs"));
|
|
31
|
-
|
|
32
|
-
export {
|
|
33
|
-
PresenterSettings,
|
|
34
|
-
MarkdownSlide,
|
|
35
|
-
DocumentPresenterContainer,
|
|
36
|
-
CollectionPresenterContainer
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=chunk-VZEWAW63.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 { DeprecatedFormContainer, DeprecatedFormInput } from '@dxos/react-ui-form';\n\nimport { PRESENTER_PLUGIN } from '../meta';\nimport { type PresenterSettingsProps } from '../types';\n\nexport const PresenterSettings = ({ settings }: { settings: PresenterSettingsProps }) => {\n const { t } = useTranslation(PRESENTER_PLUGIN);\n\n return (\n <DeprecatedFormContainer>\n <DeprecatedFormInput label={t('present collections label')}>\n <Input.Switch\n checked={settings.presentCollections}\n onCheckedChange={(checked) => (settings.presentCollections = !!checked)}\n />\n </DeprecatedFormInput>\n </DeprecatedFormContainer>\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,yBAAyBC,2BAA2B;AAKtD,IAAMC,oBAAoB,CAAC,EAAEC,SAAQ,MAAwC;;;AAClF,UAAM,EAAEC,EAAC,IAAKC,eAAeC,gBAAAA;AAE7B,WACE,sBAAA,cAACC,yBAAAA,MACC,sBAAA,cAACC,qBAAAA;MAAoBC,OAAOL,EAAE,2BAAA;OAC5B,sBAAA,cAACM,MAAMC,QAAM;MACXC,SAAST,SAASU;MAClBC,iBAAiB,CAACF,YAAaT,SAASU,qBAAqB,CAAC,CAACD;;;;;AAKzE;;;ACrBA,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", "DeprecatedFormContainer", "DeprecatedFormInput", "PresenterSettings", "settings", "t", "useTranslation", "PRESENTER_PLUGIN", "DeprecatedFormContainer", "DeprecatedFormInput", "label", "Input", "Switch", "checked", "presentCollections", "onCheckedChange", "lazy", "MarkdownSlide", "lazy", "DocumentPresenterContainer", "CollectionPresenterContainer"]
|
|
7
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/useExitPresenter.ts
|
|
4
|
-
import { useCallback } from "react";
|
|
5
|
-
import { createIntent, LayoutAction, useCapability, useIntentDispatcher } from "@dxos/app-framework";
|
|
6
|
-
import { DeckCapabilities } from "@dxos/plugin-deck";
|
|
7
|
-
import { DeckAction } from "@dxos/plugin-deck/types";
|
|
8
|
-
import { fullyQualifiedId, 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 = fullyQualifiedId(object);
|
|
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-YI6PZYVI.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 { createIntent, LayoutAction, useCapability, useIntentDispatcher } from '@dxos/app-framework';\nimport { type Live } from '@dxos/live-object';\nimport { DeckCapabilities } from '@dxos/plugin-deck';\nimport { DeckAction } from '@dxos/plugin-deck/types';\nimport { fullyQualifiedId, 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 = fullyQualifiedId(object);\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,cAAcC,eAAeC,2BAA2B;AAE/E,SAASC,wBAAwB;AACjC,SAASC,kBAAkB;AAC3B,SAASC,kBAAkBC,gBAAgB;AAEpC,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,iBAAiBV,MAAAA;AAClC,QAAII,OAAOO,KAAKC,YAAY;AAC1B,WAAKV,SACHW,aAAaC,WAAWC,QAAQ;QAC9BC,MAAM;QACNC,IAAIR;MACN,CAAA,CAAA;IAEJ;AACA,WAAOP,SACLW,aAAaK,aAAaC,MAAM;MAC9BC,MAAM;MACNC,SAAS;QAACZ;;MACVa,SAAS;QAAEC,WAAWC,SAASC,QAAAA,GAAWR;MAAG;IAC/C,CAAA,CAAA;EAEJ,GAAG;IAACf;IAAUF;GAAO;AACvB;",
|
|
6
|
-
"names": ["useCallback", "createIntent", "LayoutAction", "useCapability", "useIntentDispatcher", "DeckCapabilities", "DeckAction", "fullyQualifiedId", "getSpace", "useExitPresenter", "object", "dispatchPromise", "dispatch", "useIntentDispatcher", "layout", "useCapability", "DeckCapabilities", "MutableDeckState", "useCallback", "objectId", "fullyQualifiedId", "deck", "fullscreen", "createIntent", "DeckAction", "Adjust", "type", "id", "LayoutAction", "Open", "part", "subject", "options", "workspace", "getSpace", "document"]
|
|
7
|
-
}
|