@dxos/plugin-presenter 0.8.4-main.9be5663bfe → 0.8.4-main.abd8ff62ef
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/index.mjs +4 -530
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operations/index.mjs +1 -1
- package/dist/lib/browser/operations/index.mjs.map +3 -3
- package/dist/lib/browser/translations.mjs +19 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/types/src/PresenterPlugin.d.ts +1 -0
- package/dist/types/src/PresenterPlugin.d.ts.map +1 -1
- package/dist/types/src/PresenterPlugin.node.d.ts +4 -0
- package/dist/types/src/PresenterPlugin.node.d.ts.map +1 -0
- package/dist/types/src/PresenterPlugin.test.d.ts +2 -0
- package/dist/types/src/PresenterPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +2 -5
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Panel.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Panel.stories.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Slide.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Slide.stories.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/theme.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Layout.d.ts +1 -1
- package/dist/types/src/components/Presenter/Pager.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Pager.stories.d.ts.map +1 -1
- package/dist/types/src/components/PresenterSettings/PresenterSettings.d.ts +1 -1
- package/dist/types/src/components/PresenterSettings/PresenterSettings.d.ts.map +1 -1
- package/dist/types/src/components/PresenterSettings/PresenterSettings.stories.d.ts +4 -6
- package/dist/types/src/components/PresenterSettings/PresenterSettings.stories.d.ts.map +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts +5 -7
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.d.ts +1 -1
- package/dist/types/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.d.ts.map +1 -1
- package/dist/types/src/containers/MarkdownSlide/MarkdownSlide.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +4 -4
- package/dist/types/src/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/testing.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +4 -7
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +3 -2
- package/dist/types/src/types/Settings.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +2 -5
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/useExitPresenter.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +41 -31
- package/src/PresenterPlugin.node.ts +16 -0
- package/src/PresenterPlugin.test.ts +23 -0
- package/src/PresenterPlugin.tsx +3 -2
- package/src/capabilities/app-graph-builder.ts +1 -1
- package/src/capabilities/react-surface.tsx +22 -20
- package/src/components/PresenterSettings/PresenterSettings.stories.tsx +2 -1
- package/src/components/PresenterSettings/PresenterSettings.tsx +8 -9
- package/src/components/RevealPlayer/RevealPlayer.stories.tsx +2 -1
- package/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.tsx +9 -3
- package/src/index.ts +5 -2
- package/src/operations/definitions.ts +1 -1
- package/src/translations.ts +0 -2
- package/src/types/Settings.ts +7 -2
- package/dist/lib/browser/PresenterSettings-DZO2DC53.mjs +0 -29
- package/dist/lib/browser/PresenterSettings-DZO2DC53.mjs.map +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-presenter",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.abd8ff62ef",
|
|
4
4
|
"description": "Braneframe presenter plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -13,12 +13,18 @@
|
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
15
|
"imports": {
|
|
16
|
+
"#plugin": {
|
|
17
|
+
"browser": "./src/PresenterPlugin.tsx",
|
|
18
|
+
"node": "./src/PresenterPlugin.node.ts",
|
|
19
|
+
"default": "./src/PresenterPlugin.tsx"
|
|
20
|
+
},
|
|
16
21
|
"#capabilities": "./src/capabilities/index.ts",
|
|
17
22
|
"#components": "./src/components/index.ts",
|
|
18
23
|
"#containers": "./src/containers/index.ts",
|
|
19
24
|
"#meta": "./src/meta.ts",
|
|
20
25
|
"#operations": "./src/operations/index.ts",
|
|
21
26
|
"#testing": "./src/testing.ts",
|
|
27
|
+
"#translations": "./src/translations.ts",
|
|
22
28
|
"#types": "./src/types/index.ts"
|
|
23
29
|
},
|
|
24
30
|
"exports": {
|
|
@@ -31,12 +37,15 @@
|
|
|
31
37
|
"source": "./src/operations/index.ts",
|
|
32
38
|
"types": "./dist/types/src/operations/index.d.ts",
|
|
33
39
|
"browser": "./dist/lib/browser/operations/index.mjs"
|
|
40
|
+
},
|
|
41
|
+
"./translations": {
|
|
42
|
+
"source": "./src/translations.ts",
|
|
43
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
44
|
+
"browser": "./dist/lib/browser/translations.mjs",
|
|
45
|
+
"node": "./dist/lib/node-esm/translations.mjs"
|
|
34
46
|
}
|
|
35
47
|
},
|
|
36
48
|
"types": "dist/types/src/index.d.ts",
|
|
37
|
-
"typesVersions": {
|
|
38
|
-
"*": {}
|
|
39
|
-
},
|
|
40
49
|
"files": [
|
|
41
50
|
"dist",
|
|
42
51
|
"src"
|
|
@@ -54,26 +63,26 @@
|
|
|
54
63
|
"remark-frontmatter": "^5.0.0",
|
|
55
64
|
"remark-parse-frontmatter": "^1.0.3",
|
|
56
65
|
"reveal.js": "^5.1.0",
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/app-
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/plugin-deck": "0.8.4-main.
|
|
66
|
-
"@dxos/plugin-
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/plugin-
|
|
69
|
-
"@dxos/react-
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/react-ui-
|
|
72
|
-
"@dxos/react-ui-
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/util": "0.8.4-main.
|
|
66
|
+
"@dxos/async": "0.8.4-main.abd8ff62ef",
|
|
67
|
+
"@dxos/app-framework": "0.8.4-main.abd8ff62ef",
|
|
68
|
+
"@dxos/app-toolkit": "0.8.4-main.abd8ff62ef",
|
|
69
|
+
"@dxos/compute": "0.8.4-main.abd8ff62ef",
|
|
70
|
+
"@dxos/echo": "0.8.4-main.abd8ff62ef",
|
|
71
|
+
"@dxos/log": "0.8.4-main.abd8ff62ef",
|
|
72
|
+
"@dxos/effect": "0.8.4-main.abd8ff62ef",
|
|
73
|
+
"@dxos/plugin-client": "0.8.4-main.abd8ff62ef",
|
|
74
|
+
"@dxos/plugin-deck": "0.8.4-main.abd8ff62ef",
|
|
75
|
+
"@dxos/plugin-markdown": "0.8.4-main.abd8ff62ef",
|
|
76
|
+
"@dxos/react-client": "0.8.4-main.abd8ff62ef",
|
|
77
|
+
"@dxos/plugin-graph": "0.8.4-main.abd8ff62ef",
|
|
78
|
+
"@dxos/react-ui-attention": "0.8.4-main.abd8ff62ef",
|
|
79
|
+
"@dxos/plugin-stack": "0.8.4-main.abd8ff62ef",
|
|
80
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.abd8ff62ef",
|
|
81
|
+
"@dxos/react-ui-form": "0.8.4-main.abd8ff62ef",
|
|
82
|
+
"@dxos/react-ui-stack": "0.8.4-main.abd8ff62ef",
|
|
83
|
+
"@dxos/schema": "0.8.4-main.abd8ff62ef",
|
|
84
|
+
"@dxos/types": "0.8.4-main.abd8ff62ef",
|
|
85
|
+
"@dxos/util": "0.8.4-main.abd8ff62ef"
|
|
77
86
|
},
|
|
78
87
|
"devDependencies": {
|
|
79
88
|
"@effect-atom/atom-react": "^0.5.0",
|
|
@@ -84,11 +93,12 @@
|
|
|
84
93
|
"effect": "3.20.0",
|
|
85
94
|
"react": "~19.2.3",
|
|
86
95
|
"react-dom": "~19.2.3",
|
|
87
|
-
"vite": "^
|
|
88
|
-
"@dxos/random": "0.8.4-main.
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
91
|
-
"@dxos/
|
|
96
|
+
"vite": "^8.0.10",
|
|
97
|
+
"@dxos/random": "0.8.4-main.abd8ff62ef",
|
|
98
|
+
"@dxos/plugin-testing": "0.8.4-main.abd8ff62ef",
|
|
99
|
+
"@dxos/react-ui": "0.8.4-main.abd8ff62ef",
|
|
100
|
+
"@dxos/storybook-utils": "0.8.4-main.abd8ff62ef",
|
|
101
|
+
"@dxos/ui-theme": "0.8.4-main.abd8ff62ef"
|
|
92
102
|
},
|
|
93
103
|
"peerDependencies": {
|
|
94
104
|
"@effect-atom/atom-react": "^0.5.0",
|
|
@@ -96,8 +106,8 @@
|
|
|
96
106
|
"effect": "3.20.0",
|
|
97
107
|
"react": "~19.2.3",
|
|
98
108
|
"react-dom": "~19.2.3",
|
|
99
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
100
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
109
|
+
"@dxos/ui-theme": "0.8.4-main.abd8ff62ef",
|
|
110
|
+
"@dxos/react-ui": "0.8.4-main.abd8ff62ef"
|
|
101
111
|
},
|
|
102
112
|
"publishConfig": {
|
|
103
113
|
"access": "public"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
|
+
|
|
8
|
+
import { AppGraphBuilder } from '#capabilities';
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
|
|
11
|
+
export const PresenterPlugin = Plugin.define(meta).pipe(
|
|
12
|
+
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
13
|
+
Plugin.make,
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export default PresenterPlugin;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { createComposerTestApp } from '@dxos/plugin-testing/harness';
|
|
8
|
+
|
|
9
|
+
import { PresenterPlugin } from '#plugin';
|
|
10
|
+
|
|
11
|
+
import { meta } from './meta';
|
|
12
|
+
|
|
13
|
+
const moduleId = (name: string) => `${meta.id}.module.${name}`;
|
|
14
|
+
|
|
15
|
+
describe('PresenterPlugin', () => {
|
|
16
|
+
test('modules activate on the expected events', async ({ expect }) => {
|
|
17
|
+
await using harness = await createComposerTestApp({
|
|
18
|
+
plugins: [PresenterPlugin()],
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
expect(harness.manager.getActive()).toContain(moduleId('AppGraphBuilder'));
|
|
22
|
+
});
|
|
23
|
+
});
|
package/src/PresenterPlugin.tsx
CHANGED
|
@@ -7,8 +7,7 @@ import { AppPlugin } from '@dxos/app-toolkit';
|
|
|
7
7
|
|
|
8
8
|
import { AppGraphBuilder, PresenterSettings, ReactSurface } from '#capabilities';
|
|
9
9
|
import { meta } from '#meta';
|
|
10
|
-
|
|
11
|
-
import { translations } from './translations';
|
|
10
|
+
import { translations } from '#translations';
|
|
12
11
|
|
|
13
12
|
// TODO(burdon): Only scale markdown content.
|
|
14
13
|
// TODO(burdon): Map stack content; Slide content type (e.g., markdown, sketch, IPFS image, table, etc.)
|
|
@@ -20,3 +19,5 @@ export const PresenterPlugin = Plugin.define(meta).pipe(
|
|
|
20
19
|
AppPlugin.addTranslationsModule({ translations }),
|
|
21
20
|
Plugin.make,
|
|
22
21
|
);
|
|
22
|
+
|
|
23
|
+
export default PresenterPlugin;
|
|
@@ -7,9 +7,9 @@ import * as Option from 'effect/Option';
|
|
|
7
7
|
|
|
8
8
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
9
|
import { AppCapabilities, AppNode, LayoutOperation, getObjectPathFromObject, getSpacePath } from '@dxos/app-toolkit';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
10
11
|
import { Obj } from '@dxos/echo';
|
|
11
12
|
import { Collection } from '@dxos/echo';
|
|
12
|
-
import { Operation } from '@dxos/operation';
|
|
13
13
|
import { DeckCapabilities } from '@dxos/plugin-deck';
|
|
14
14
|
import { DeckOperation } from '@dxos/plugin-deck/operations';
|
|
15
15
|
import { GraphBuilder, type Node, NodeMatcher } from '@dxos/plugin-graph';
|
|
@@ -22,40 +22,42 @@ export default Capability.makeModule(() =>
|
|
|
22
22
|
Capability.contributes(Capabilities.ReactSurface, [
|
|
23
23
|
Surface.create({
|
|
24
24
|
id: 'document',
|
|
25
|
-
role: 'article',
|
|
26
25
|
position: 'hoist',
|
|
27
|
-
filter: (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
filter: AppSurface.predicate(
|
|
27
|
+
AppSurface.Article,
|
|
28
|
+
(data): data is AppSurface.ArticleData<{ type: typeof meta.id; object: Markdown.Document }> =>
|
|
29
|
+
!!data.subject &&
|
|
30
|
+
typeof data.subject === 'object' &&
|
|
31
|
+
'type' in data.subject &&
|
|
32
|
+
'object' in data.subject &&
|
|
33
|
+
data.subject.type === meta.id &&
|
|
34
|
+
Obj.instanceOf(Markdown.Document, data.subject.object),
|
|
35
|
+
),
|
|
34
36
|
component: ({ data }) => <DocumentPresenterContainer document={data.subject.object} />,
|
|
35
37
|
}),
|
|
36
38
|
Surface.create({
|
|
37
39
|
id: 'collection',
|
|
38
|
-
role: 'article',
|
|
39
40
|
position: 'hoist',
|
|
40
|
-
filter: (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
filter: AppSurface.predicate(
|
|
42
|
+
AppSurface.Article,
|
|
43
|
+
(data): data is AppSurface.ArticleData<{ type: typeof meta.id; object: Collection.Collection }> =>
|
|
44
|
+
!!data.subject &&
|
|
45
|
+
typeof data.subject === 'object' &&
|
|
46
|
+
'type' in data.subject &&
|
|
47
|
+
'object' in data.subject &&
|
|
48
|
+
data.subject.type === meta.id &&
|
|
49
|
+
Obj.instanceOf(Collection.Collection, data.subject.object),
|
|
50
|
+
),
|
|
47
51
|
component: ({ role, data }) => <CollectionPresenterContainer role={role} subject={data.subject.object} />,
|
|
48
52
|
}),
|
|
49
53
|
Surface.create({
|
|
50
54
|
id: 'slide',
|
|
51
|
-
|
|
52
|
-
filter: AppSurface.objectSection(Markdown.Document),
|
|
55
|
+
filter: AppSurface.object(AppSurface.Slide, Markdown.Document),
|
|
53
56
|
component: ({ data }) => <MarkdownSlide document={data.subject} />,
|
|
54
57
|
}),
|
|
55
58
|
Surface.create({
|
|
56
59
|
id: 'plugin-settings',
|
|
57
|
-
|
|
58
|
-
filter: AppSurface.settingsArticle(meta.id),
|
|
60
|
+
filter: AppSurface.settings(AppSurface.Article, meta.id),
|
|
59
61
|
component: ({ data: { subject } }) => {
|
|
60
62
|
const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);
|
|
61
63
|
return <PresenterSettings settings={settings} onSettingsChange={updateSettings} />;
|
|
@@ -6,7 +6,8 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
|
|
7
7
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
8
8
|
|
|
9
|
-
import { translations } from '
|
|
9
|
+
import { translations } from '#translations';
|
|
10
|
+
|
|
10
11
|
import { PresenterSettings } from './PresenterSettings';
|
|
11
12
|
|
|
12
13
|
const meta = {
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
-
import {
|
|
8
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import { Settings as SettingsForm } from '@dxos/react-ui-form';
|
|
10
10
|
|
|
11
11
|
import { meta } from '#meta';
|
|
12
|
-
import {
|
|
12
|
+
import { Settings } from '#types';
|
|
13
13
|
|
|
14
14
|
export type PresenterSettingsProps = AppSurface.SettingsArticleProps<Settings.Settings>;
|
|
15
15
|
|
|
@@ -19,13 +19,12 @@ export const PresenterSettings = ({ settings, onSettingsChange }: PresenterSetti
|
|
|
19
19
|
return (
|
|
20
20
|
<SettingsForm.Viewport>
|
|
21
21
|
<SettingsForm.Section title={t('settings.title', { ns: meta.id })}>
|
|
22
|
-
<SettingsForm.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</SettingsForm.Item>
|
|
22
|
+
<SettingsForm.FieldSet
|
|
23
|
+
readonly={!onSettingsChange}
|
|
24
|
+
schema={Settings.Settings}
|
|
25
|
+
values={settings}
|
|
26
|
+
onValuesChanged={(values) => onSettingsChange?.(() => values)}
|
|
27
|
+
/>
|
|
29
28
|
</SettingsForm.Section>
|
|
30
29
|
</SettingsForm.Viewport>
|
|
31
30
|
);
|
|
@@ -6,8 +6,9 @@ import { type Meta } from '@storybook/react-vite';
|
|
|
6
6
|
|
|
7
7
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
8
8
|
|
|
9
|
+
import { translations } from '#translations';
|
|
10
|
+
|
|
9
11
|
import CONTENT from '../../../testing/deck.md?raw';
|
|
10
|
-
import { translations } from '../../translations';
|
|
11
12
|
import { RevealPlayer } from './RevealPlayer';
|
|
12
13
|
|
|
13
14
|
// https://revealjs.com/markdown
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import React, { useContext, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Surface } from '@dxos/app-framework/ui';
|
|
8
|
-
import {
|
|
9
|
-
import { type Collection } from '@dxos/echo';
|
|
8
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
9
|
+
import { type Collection, Obj } from '@dxos/echo';
|
|
10
10
|
import { Panel } from '@dxos/react-ui';
|
|
11
11
|
|
|
12
12
|
import { PageNumber, Pager, Layout as PresenterLayout } from '#components';
|
|
@@ -36,7 +36,13 @@ export const CollectionPresenterContainer = ({ role, subject: collection }: Coll
|
|
|
36
36
|
/>
|
|
37
37
|
}
|
|
38
38
|
>
|
|
39
|
-
<Surface.Surface
|
|
39
|
+
<Surface.Surface
|
|
40
|
+
type={AppSurface.Slide}
|
|
41
|
+
data={{
|
|
42
|
+
subject: collection.objects[slide],
|
|
43
|
+
attendableId: Obj.getDXN(collection).toString(),
|
|
44
|
+
}}
|
|
45
|
+
/>
|
|
40
46
|
</PresenterLayout>
|
|
41
47
|
</Panel.Content>
|
|
42
48
|
</Panel.Root>
|
package/src/index.ts
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
6
8
|
|
|
7
9
|
export * from './meta';
|
|
8
|
-
|
|
10
|
+
|
|
11
|
+
export const PresenterPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
7
8
|
import { Collection } from '@dxos/echo';
|
|
8
|
-
import { Operation } from '@dxos/operation';
|
|
9
9
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
10
10
|
|
|
11
11
|
import { meta } from '#meta';
|
package/src/translations.ts
CHANGED
|
@@ -13,8 +13,6 @@ export const translations = [
|
|
|
13
13
|
'plugin.name': 'Presenter',
|
|
14
14
|
'settings.title': 'Presenter settings',
|
|
15
15
|
'toggle-presentation.label': 'Present',
|
|
16
|
-
'present-collections.label': 'Present collections (experimental)',
|
|
17
|
-
'present-collections.description': 'Enable presenting collections of documents as a slideshow.',
|
|
18
16
|
},
|
|
19
17
|
},
|
|
20
18
|
},
|
package/src/types/Settings.ts
CHANGED
|
@@ -8,8 +8,13 @@ import * as Schema from 'effect/Schema';
|
|
|
8
8
|
|
|
9
9
|
export const Settings = Schema.mutable(
|
|
10
10
|
Schema.Struct({
|
|
11
|
-
presentCollections: Schema.optional(
|
|
11
|
+
presentCollections: Schema.optional(
|
|
12
|
+
Schema.Boolean.annotations({
|
|
13
|
+
title: 'Present collections (experimental)',
|
|
14
|
+
description: 'Enable presenting collections of documents as a slideshow.',
|
|
15
|
+
}),
|
|
16
|
+
),
|
|
12
17
|
}),
|
|
13
18
|
);
|
|
14
19
|
|
|
15
|
-
export
|
|
20
|
+
export interface Settings extends Schema.Schema.Type<typeof Settings> {}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/components/PresenterSettings/PresenterSettings.tsx
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { Input, useTranslation } from "@dxos/react-ui";
|
|
6
|
-
import { Settings as SettingsForm } from "@dxos/react-ui-form";
|
|
7
|
-
import { meta } from "#meta";
|
|
8
|
-
var PresenterSettings = ({ settings, onSettingsChange }) => {
|
|
9
|
-
const { t } = useTranslation(meta.id);
|
|
10
|
-
return /* @__PURE__ */ React.createElement(SettingsForm.Viewport, null, /* @__PURE__ */ React.createElement(SettingsForm.Section, {
|
|
11
|
-
title: t("settings.title", {
|
|
12
|
-
ns: meta.id
|
|
13
|
-
})
|
|
14
|
-
}, /* @__PURE__ */ React.createElement(SettingsForm.Item, {
|
|
15
|
-
title: t("present-collections.label"),
|
|
16
|
-
description: t("present-collections.description")
|
|
17
|
-
}, /* @__PURE__ */ React.createElement(Input.Switch, {
|
|
18
|
-
disabled: !onSettingsChange,
|
|
19
|
-
checked: settings.presentCollections,
|
|
20
|
-
onCheckedChange: (checked) => onSettingsChange?.((s) => ({
|
|
21
|
-
...s,
|
|
22
|
-
presentCollections: !!checked
|
|
23
|
-
}))
|
|
24
|
-
}))));
|
|
25
|
-
};
|
|
26
|
-
export {
|
|
27
|
-
PresenterSettings as default
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=PresenterSettings-DZO2DC53.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/PresenterSettings/PresenterSettings.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { Input, useTranslation } from '@dxos/react-ui';\nimport { Settings as SettingsForm } from '@dxos/react-ui-form';\n\nimport { meta } from '#meta';\nimport { type Settings } from '#types';\n\nexport type PresenterSettingsProps = AppSurface.SettingsArticleProps<Settings.Settings>;\n\nexport const PresenterSettings = ({ settings, onSettingsChange }: PresenterSettingsProps) => {\n const { t } = useTranslation(meta.id);\n\n return (\n <SettingsForm.Viewport>\n <SettingsForm.Section title={t('settings.title', { ns: meta.id })}>\n <SettingsForm.Item title={t('present-collections.label')} description={t('present-collections.description')}>\n <Input.Switch\n disabled={!onSettingsChange}\n checked={settings.presentCollections}\n onCheckedChange={(checked) => onSettingsChange?.((s) => ({ ...s, presentCollections: !!checked }))}\n />\n </SettingsForm.Item>\n </SettingsForm.Section>\n </SettingsForm.Viewport>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,OAAOA,WAAW;AAGlB,SAASC,OAAOC,sBAAsB;AACtC,SAASC,YAAYC,oBAAoB;AAEzC,SAASC,YAAY;AAKd,IAAMC,oBAAoB,CAAC,EAAEC,UAAUC,iBAAgB,MAA0B;AACtF,QAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AAEpC,SACE,sBAAA,cAACC,aAAaC,UAAQ,MACpB,sBAAA,cAACD,aAAaE,SAAO;IAACC,OAAOP,EAAE,kBAAkB;MAAEQ,IAAIN,KAAKC;IAAG,CAAA;KAC7D,sBAAA,cAACC,aAAaK,MAAI;IAACF,OAAOP,EAAE,2BAAA;IAA8BU,aAAaV,EAAE,iCAAA;KACvE,sBAAA,cAACW,MAAMC,QAAM;IACXC,UAAU,CAACd;IACXe,SAAShB,SAASiB;IAClBC,iBAAiB,CAACF,YAAYf,mBAAmB,CAACkB,OAAO;MAAE,GAAGA;MAAGF,oBAAoB,CAAC,CAACD;IAAQ,EAAA;;AAM3G;",
|
|
6
|
-
"names": ["React", "Input", "useTranslation", "Settings", "SettingsForm", "meta", "PresenterSettings", "settings", "onSettingsChange", "t", "useTranslation", "meta", "id", "SettingsForm", "Viewport", "Section", "title", "ns", "Item", "description", "Input", "Switch", "disabled", "checked", "presentCollections", "onCheckedChange", "s"]
|
|
7
|
-
}
|