@dxos/plugin-settings 0.6.13 → 0.6.14-main.7bd9c89
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/{chunk-JKQMH66V.mjs → chunk-PD3C4TDW.mjs} +1 -1
- package/dist/lib/browser/chunk-PD3C4TDW.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +16 -14
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/node/{chunk-LZVHLML4.cjs → chunk-AHM6OLF2.cjs} +4 -4
- package/dist/lib/node/chunk-AHM6OLF2.cjs.map +7 -0
- package/dist/lib/node/index.cjs +56 -54
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.cjs +3 -3
- package/dist/lib/node/meta.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/chunk-PPOEIFFE.mjs +13 -0
- package/dist/lib/node-esm/chunk-PPOEIFFE.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +258 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/meta.mjs +10 -0
- package/dist/lib/node-esm/meta.mjs.map +7 -0
- package/dist/types/src/SettingsPlugin.d.ts.map +1 -1
- package/dist/types/src/components/SettingsDialog.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/package.json +16 -14
- package/src/SettingsPlugin.tsx +1 -3
- package/src/components/SettingsDialog.tsx +21 -14
- package/src/meta.ts +3 -1
- package/dist/lib/browser/chunk-JKQMH66V.mjs.map +0 -7
- package/dist/lib/node/chunk-LZVHLML4.cjs.map +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-settings",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.14-main.7bd9c89",
|
|
4
4
|
"description": "DXOS app plugin for aggregating and rendering plugin settings.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,14 +10,16 @@
|
|
|
10
10
|
".": {
|
|
11
11
|
"browser": "./dist/lib/browser/index.mjs",
|
|
12
12
|
"node": {
|
|
13
|
-
"
|
|
13
|
+
"require": "./dist/lib/node/index.cjs",
|
|
14
|
+
"default": "./dist/lib/node-esm/index.mjs"
|
|
14
15
|
},
|
|
15
16
|
"types": "./dist/types/src/index.d.ts"
|
|
16
17
|
},
|
|
17
18
|
"./meta": {
|
|
18
19
|
"browser": "./dist/lib/browser/meta.mjs",
|
|
19
20
|
"node": {
|
|
20
|
-
"
|
|
21
|
+
"require": "./dist/lib/node/meta.cjs",
|
|
22
|
+
"default": "./dist/lib/node-esm/meta.mjs"
|
|
21
23
|
},
|
|
22
24
|
"types": "./dist/types/src/meta.d.ts"
|
|
23
25
|
}
|
|
@@ -35,26 +37,26 @@
|
|
|
35
37
|
"src"
|
|
36
38
|
],
|
|
37
39
|
"dependencies": {
|
|
38
|
-
"@dxos/app-framework": "0.6.
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/util": "0.6.
|
|
40
|
+
"@dxos/app-framework": "0.6.14-main.7bd9c89",
|
|
41
|
+
"@dxos/local-storage": "0.6.14-main.7bd9c89",
|
|
42
|
+
"@dxos/react-ui-tabs": "0.6.14-main.7bd9c89",
|
|
43
|
+
"@dxos/plugin-graph": "0.6.14-main.7bd9c89",
|
|
44
|
+
"@dxos/util": "0.6.14-main.7bd9c89"
|
|
43
45
|
},
|
|
44
46
|
"devDependencies": {
|
|
45
47
|
"@phosphor-icons/react": "^2.1.5",
|
|
46
48
|
"@types/react": "~18.2.0",
|
|
47
49
|
"react": "~18.2.0",
|
|
48
|
-
"vite": "
|
|
49
|
-
"@dxos/react-ui": "0.6.
|
|
50
|
-
"@dxos/react-ui-theme": "0.6.
|
|
51
|
-
"@dxos/storybook-utils": "0.6.
|
|
50
|
+
"vite": "5.4.7",
|
|
51
|
+
"@dxos/react-ui": "0.6.14-main.7bd9c89",
|
|
52
|
+
"@dxos/react-ui-theme": "0.6.14-main.7bd9c89",
|
|
53
|
+
"@dxos/storybook-utils": "0.6.14-main.7bd9c89"
|
|
52
54
|
},
|
|
53
55
|
"peerDependencies": {
|
|
54
56
|
"@phosphor-icons/react": "^2.1.5",
|
|
55
57
|
"react": "~18.2.0",
|
|
56
|
-
"@dxos/react-ui
|
|
57
|
-
"@dxos/react-ui": "0.6.
|
|
58
|
+
"@dxos/react-ui": "0.6.14-main.7bd9c89",
|
|
59
|
+
"@dxos/react-ui-theme": "0.6.14-main.7bd9c89"
|
|
58
60
|
},
|
|
59
61
|
"publishConfig": {
|
|
60
62
|
"access": "public"
|
package/src/SettingsPlugin.tsx
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Gear, type IconProps } from '@phosphor-icons/react';
|
|
6
5
|
import React from 'react';
|
|
7
6
|
|
|
8
7
|
import {
|
|
@@ -106,8 +105,7 @@ export const SettingsPlugin = (): PluginDefinition<SettingsPluginProvides> => {
|
|
|
106
105
|
},
|
|
107
106
|
properties: {
|
|
108
107
|
label: ['open settings label', { ns: SETTINGS_PLUGIN }],
|
|
109
|
-
icon:
|
|
110
|
-
iconSymbol: 'ph--gear--regular',
|
|
108
|
+
icon: 'ph--gear--regular',
|
|
111
109
|
keyBinding: {
|
|
112
110
|
macos: 'meta+,',
|
|
113
111
|
windows: 'alt+,',
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type PluginMeta, Surface, usePlugins } from '@dxos/app-framework';
|
|
8
8
|
import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import { Tabs, type TabsActivePart } from '@dxos/react-ui-tabs';
|
|
10
10
|
import { getSize } from '@dxos/react-ui-theme';
|
|
@@ -33,14 +33,19 @@ export const SettingsDialog = ({
|
|
|
33
33
|
'dxos.org/plugin/registry',
|
|
34
34
|
];
|
|
35
35
|
|
|
36
|
-
const
|
|
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);
|
|
37
42
|
|
|
38
43
|
const filteredPlugins = enabled
|
|
39
44
|
.filter((id) => !core.includes(id))
|
|
40
45
|
.map((id) => plugins.find((plugin) => plugin.meta.id === id))
|
|
41
46
|
.filter((plugin) => (plugin?.provides as any)?.settings)
|
|
42
47
|
.map((plugin) => plugin!.meta)
|
|
43
|
-
.sort(
|
|
48
|
+
.sort(sortPlugin);
|
|
44
49
|
|
|
45
50
|
const [tabsActivePart, setTabsActivePart] = useState<TabsActivePart>('list');
|
|
46
51
|
|
|
@@ -83,9 +88,9 @@ export const SettingsDialog = ({
|
|
|
83
88
|
>
|
|
84
89
|
<Tabs.Viewport classNames='flex-1 min-bs-0'>
|
|
85
90
|
<div role='none' className='overflow-y-auto pli-3 @md:pis-2 @md:pie-0 mbe-4 border-r border-separator'>
|
|
86
|
-
<Tabs.Tablist classNames='max-bs-none overflow-y-visible'>
|
|
91
|
+
<Tabs.Tablist classNames='flex flex-col gap-4 max-bs-none overflow-y-visible'>
|
|
87
92
|
<PluginList title='Options' plugins={corePlugins} />
|
|
88
|
-
{filteredPlugins.length > 0 && <PluginList title='Plugins' plugins={filteredPlugins}
|
|
93
|
+
{filteredPlugins.length > 0 && <PluginList title='Plugins' plugins={filteredPlugins} />}
|
|
89
94
|
</Tabs.Tablist>
|
|
90
95
|
</div>
|
|
91
96
|
|
|
@@ -105,15 +110,17 @@ export const SettingsDialog = ({
|
|
|
105
110
|
);
|
|
106
111
|
};
|
|
107
112
|
|
|
108
|
-
const PluginList = ({ title, plugins
|
|
113
|
+
const PluginList = ({ title, plugins }: { title: string; plugins: PluginMeta[] }) => {
|
|
109
114
|
return (
|
|
110
|
-
|
|
111
|
-
<Tabs.TabGroupHeading classNames={
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
{plugin.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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>
|
|
118
125
|
);
|
|
119
126
|
};
|
package/src/meta.ts
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport const SETTINGS_PLUGIN = 'dxos.org/plugin/settings';\n\nexport default {\n id: SETTINGS_PLUGIN,\n};\n"],
|
|
5
|
-
"mappings": ";AAIO,IAAMA,kBAAkB;AAE/B,IAAA,eAAe;EACbC,IAAID;AACN;",
|
|
6
|
-
"names": ["SETTINGS_PLUGIN", "id"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport const SETTINGS_PLUGIN = 'dxos.org/plugin/settings';\n\nexport default {\n id: SETTINGS_PLUGIN,\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIO,IAAMA,kBAAkB;AAE/B,IAAA,eAAe;EACbC,IAAID;AACN;",
|
|
6
|
-
"names": ["SETTINGS_PLUGIN", "id"]
|
|
7
|
-
}
|