@dxos/plugin-settings 0.6.14-main.2b6a0f3 → 0.8.4-main.1068cf700f
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/app-graph-builder-CCZGWQMT.mjs +97 -0
- package/dist/lib/browser/app-graph-builder-CCZGWQMT.mjs.map +7 -0
- package/dist/lib/browser/chunk-ONAYSYBX.mjs +35 -0
- package/dist/lib/browser/chunk-ONAYSYBX.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +31 -242
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-IIUEJRBW.mjs +54 -0
- package/dist/lib/browser/operation-resolver-IIUEJRBW.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-LZWJ45UQ.mjs +98 -0
- package/dist/lib/node-esm/app-graph-builder-LZWJ45UQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TSHGTOLF.mjs +37 -0
- package/dist/lib/node-esm/chunk-TSHGTOLF.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +31 -242
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-QRFPVUSP.mjs +55 -0
- package/dist/lib/node-esm/operation-resolver-QRFPVUSP.mjs.map +7 -0
- package/dist/types/src/SettingsPlugin.d.ts +2 -6
- package/dist/types/src/SettingsPlugin.d.ts.map +1 -1
- package/dist/types/src/actions.d.ts +25 -0
- package/dist/types/src/actions.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +3 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -5
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +7 -9
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +21 -36
- package/src/SettingsPlugin.ts +17 -0
- package/src/actions.ts +24 -0
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +96 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/index.ts +6 -0
- package/src/capabilities/operation-resolver/index.ts +10 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +54 -0
- package/src/index.ts +2 -9
- package/src/meta.ts +6 -7
- package/src/translations.ts +9 -9
- package/README.md +0 -15
- package/dist/lib/browser/chunk-PD3C4TDW.mjs +0 -11
- package/dist/lib/browser/chunk-PD3C4TDW.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -9
- package/dist/lib/browser/meta.mjs.map +0 -7
- package/dist/lib/node/chunk-AHM6OLF2.cjs +0 -34
- package/dist/lib/node/chunk-AHM6OLF2.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -278
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/meta.cjs +0 -30
- package/dist/lib/node/meta.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node-esm/chunk-PPOEIFFE.mjs +0 -13
- package/dist/lib/node-esm/chunk-PPOEIFFE.mjs.map +0 -7
- package/dist/lib/node-esm/meta.mjs +0 -10
- package/dist/lib/node-esm/meta.mjs.map +0 -7
- package/dist/types/src/components/SettingsDialog.d.ts +0 -6
- package/dist/types/src/components/SettingsDialog.d.ts.map +0 -1
- package/dist/types/src/components/SettingsValue.d.ts +0 -9
- package/dist/types/src/components/SettingsValue.d.ts.map +0 -1
- package/dist/types/src/components/index.d.ts +0 -3
- package/dist/types/src/components/index.d.ts.map +0 -1
- package/src/SettingsPlugin.tsx +0 -122
- package/src/components/SettingsDialog.tsx +0 -126
- package/src/components/SettingsValue.tsx +0 -49
- package/src/components/index.ts +0 -6
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type PluginMeta, Surface, usePlugins } from '@dxos/app-framework';
|
|
8
|
-
import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { Tabs, type TabsActivePart } from '@dxos/react-ui-tabs';
|
|
10
|
-
import { getSize } from '@dxos/react-ui-theme';
|
|
11
|
-
import { nonNullable } from '@dxos/util';
|
|
12
|
-
|
|
13
|
-
import { SETTINGS_PLUGIN } from '../meta';
|
|
14
|
-
|
|
15
|
-
export const SettingsDialog = ({
|
|
16
|
-
selected,
|
|
17
|
-
onSelected,
|
|
18
|
-
}: {
|
|
19
|
-
selected: string;
|
|
20
|
-
onSelected: (plugin: string) => void;
|
|
21
|
-
}) => {
|
|
22
|
-
const { t } = useTranslation(SETTINGS_PLUGIN);
|
|
23
|
-
const { plugins, enabled } = usePlugins();
|
|
24
|
-
|
|
25
|
-
// TODO(burdon): Factor out common defs?
|
|
26
|
-
const core = [
|
|
27
|
-
'dxos.org/plugin/layout',
|
|
28
|
-
'dxos.org/plugin/deck',
|
|
29
|
-
'dxos.org/plugin/files',
|
|
30
|
-
'dxos.org/plugin/space',
|
|
31
|
-
'dxos.org/plugin/stack',
|
|
32
|
-
'dxos.org/plugin/observability',
|
|
33
|
-
'dxos.org/plugin/registry',
|
|
34
|
-
];
|
|
35
|
-
|
|
36
|
-
const sortPlugin = ({ name: a }: PluginMeta, { name: b }: PluginMeta) => a?.localeCompare(b ?? '') ?? 0;
|
|
37
|
-
|
|
38
|
-
const corePlugins = core
|
|
39
|
-
.map((id) => plugins.find((plugin) => plugin.meta.id === id)?.meta)
|
|
40
|
-
.filter(nonNullable)
|
|
41
|
-
.sort(sortPlugin);
|
|
42
|
-
|
|
43
|
-
const filteredPlugins = enabled
|
|
44
|
-
.filter((id) => !core.includes(id))
|
|
45
|
-
.map((id) => plugins.find((plugin) => plugin.meta.id === id))
|
|
46
|
-
.filter((plugin) => (plugin?.provides as any)?.settings)
|
|
47
|
-
.map((plugin) => plugin!.meta)
|
|
48
|
-
.sort(sortPlugin);
|
|
49
|
-
|
|
50
|
-
const [tabsActivePart, setTabsActivePart] = useState<TabsActivePart>('list');
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<Dialog.Content classNames='p-0 bs-content max-bs-full md:max-is-[40rem] overflow-hidden'>
|
|
54
|
-
<div role='none' className='flex justify-between mbe-1 pbs-3 pis-2 pie-3 @md:pbs-4 @md:pis-4 @md:pie-5'>
|
|
55
|
-
<Dialog.Title
|
|
56
|
-
onClick={() => setTabsActivePart('list')}
|
|
57
|
-
aria-description={t('click to return to tablist description')}
|
|
58
|
-
classNames='flex cursor-pointer items-center group/title'
|
|
59
|
-
>
|
|
60
|
-
<Icon
|
|
61
|
-
icon='ph--caret-left--regular'
|
|
62
|
-
classNames={['@md:hidden', getSize(4), tabsActivePart === 'list' && 'invisible']}
|
|
63
|
-
/>
|
|
64
|
-
<span
|
|
65
|
-
className={
|
|
66
|
-
tabsActivePart !== 'list'
|
|
67
|
-
? 'group-hover/title:underline @md:group-hover/title:no-underline underline-offset-4 decoration-1'
|
|
68
|
-
: ''
|
|
69
|
-
}
|
|
70
|
-
>
|
|
71
|
-
{t('settings dialog title')}
|
|
72
|
-
</span>
|
|
73
|
-
</Dialog.Title>
|
|
74
|
-
<Dialog.Close asChild>
|
|
75
|
-
<Button density='fine' variant='ghost' autoFocus>
|
|
76
|
-
<Icon icon='ph--x--regular' size={3} />
|
|
77
|
-
</Button>
|
|
78
|
-
</Dialog.Close>
|
|
79
|
-
</div>
|
|
80
|
-
|
|
81
|
-
<Tabs.Root
|
|
82
|
-
orientation='vertical'
|
|
83
|
-
value={selected}
|
|
84
|
-
onValueChange={(nextSelected) => onSelected(nextSelected)}
|
|
85
|
-
activePart={tabsActivePart}
|
|
86
|
-
onActivePartChange={setTabsActivePart}
|
|
87
|
-
classNames='flex flex-col flex-1 mbs-2'
|
|
88
|
-
>
|
|
89
|
-
<Tabs.Viewport classNames='flex-1 min-bs-0'>
|
|
90
|
-
<div role='none' className='overflow-y-auto pli-3 @md:pis-2 @md:pie-0 mbe-4 border-r border-separator'>
|
|
91
|
-
<Tabs.Tablist classNames='flex flex-col gap-4 max-bs-none overflow-y-visible'>
|
|
92
|
-
<PluginList title='Options' plugins={corePlugins} />
|
|
93
|
-
{filteredPlugins.length > 0 && <PluginList title='Plugins' plugins={filteredPlugins} />}
|
|
94
|
-
</Tabs.Tablist>
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
{corePlugins.map((plugin) => (
|
|
98
|
-
<Tabs.Tabpanel key={plugin.id} value={plugin.id} classNames='pli-3 @md:pli-5 max-bs-dvh overflow-y-auto'>
|
|
99
|
-
<Surface role='settings' data={{ plugin: plugin.id }} />
|
|
100
|
-
</Tabs.Tabpanel>
|
|
101
|
-
))}
|
|
102
|
-
{filteredPlugins.map((plugin) => (
|
|
103
|
-
<Tabs.Tabpanel key={plugin.id} value={plugin.id} classNames='pli-3 @md:pli-5 max-bs-dvh overflow-y-auto'>
|
|
104
|
-
<Surface role='settings' data={{ plugin: plugin.id }} />
|
|
105
|
-
</Tabs.Tabpanel>
|
|
106
|
-
))}
|
|
107
|
-
</Tabs.Viewport>
|
|
108
|
-
</Tabs.Root>
|
|
109
|
-
</Dialog.Content>
|
|
110
|
-
);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
const PluginList = ({ title, plugins }: { title: string; plugins: PluginMeta[] }) => {
|
|
114
|
-
return (
|
|
115
|
-
<div role='none'>
|
|
116
|
-
<Tabs.TabGroupHeading classNames={'pli-1 mlb-2 mbs-4 @md:mbs-2'}>{title}</Tabs.TabGroupHeading>
|
|
117
|
-
<div className='flex flex-col ml-1'>
|
|
118
|
-
{plugins.map((plugin) => (
|
|
119
|
-
<Tabs.Tab key={plugin.id} value={plugin.id}>
|
|
120
|
-
{plugin.name}
|
|
121
|
-
</Tabs.Tab>
|
|
122
|
-
))}
|
|
123
|
-
</div>
|
|
124
|
-
</div>
|
|
125
|
-
);
|
|
126
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type JSX, type PropsWithChildren } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Input } from '@dxos/react-ui';
|
|
8
|
-
|
|
9
|
-
type SettingValueProps = {
|
|
10
|
-
label: string;
|
|
11
|
-
description?: JSX.Element;
|
|
12
|
-
secondary?: JSX.Element;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const SettingsValue = ({ label, description, secondary, children }: PropsWithChildren<SettingValueProps>) => {
|
|
16
|
-
const primary = (
|
|
17
|
-
<div role='none' className='flex w-full gap-4 py-1'>
|
|
18
|
-
<Input.Root>
|
|
19
|
-
<div role='none' className='flex flex-col w-full'>
|
|
20
|
-
{/* TODO(burdon): Consistent height for controls (e.g., Select, Textbox, and Checkbox are all different). */}
|
|
21
|
-
<Input.Label classNames='flex min-h-[40px] items-center'>{label}</Input.Label>
|
|
22
|
-
{description && (
|
|
23
|
-
<Input.DescriptionAndValidation classNames='mbs-0.5'>
|
|
24
|
-
<Input.Description>{description}</Input.Description>
|
|
25
|
-
</Input.DescriptionAndValidation>
|
|
26
|
-
)}
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
<div role='none'>
|
|
30
|
-
<div role='none' className='flex min-h-[40px] items-center'>
|
|
31
|
-
{children}
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
</Input.Root>
|
|
35
|
-
</div>
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
if (secondary) {
|
|
39
|
-
// console.log(secondary);
|
|
40
|
-
return (
|
|
41
|
-
<div role='none' className='flex flex-col w-full'>
|
|
42
|
-
{primary}
|
|
43
|
-
{secondary}
|
|
44
|
-
</div>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return primary;
|
|
49
|
-
};
|