@dxos/plugin-settings 0.6.12 → 0.6.13-main.09887cd

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-settings",
3
- "version": "0.6.12",
3
+ "version": "0.6.13-main.09887cd",
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
- "default": "./dist/lib/node/index.cjs"
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
- "default": "./dist/lib/node/meta.cjs"
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/local-storage": "0.6.12",
39
- "@dxos/app-framework": "0.6.12",
40
- "@dxos/plugin-graph": "0.6.12",
41
- "@dxos/util": "0.6.12",
42
- "@dxos/react-ui-tabs": "0.6.12"
40
+ "@dxos/app-framework": "0.6.13-main.09887cd",
41
+ "@dxos/local-storage": "0.6.13-main.09887cd",
42
+ "@dxos/react-ui-tabs": "0.6.13-main.09887cd",
43
+ "@dxos/plugin-graph": "0.6.13-main.09887cd",
44
+ "@dxos/util": "0.6.13-main.09887cd"
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": "^5.3.4",
49
- "@dxos/react-ui": "0.6.12",
50
- "@dxos/react-ui-theme": "0.6.12",
51
- "@dxos/storybook-utils": "0.6.12"
50
+ "vite": "5.4.7",
51
+ "@dxos/react-ui": "0.6.13-main.09887cd",
52
+ "@dxos/storybook-utils": "0.6.13-main.09887cd",
53
+ "@dxos/react-ui-theme": "0.6.13-main.09887cd"
52
54
  },
53
55
  "peerDependencies": {
54
56
  "@phosphor-icons/react": "^2.1.5",
55
57
  "react": "~18.2.0",
56
- "@dxos/react-ui": "0.6.12",
57
- "@dxos/react-ui-theme": "0.6.12"
58
+ "@dxos/react-ui": "0.6.13-main.09887cd",
59
+ "@dxos/react-ui-theme": "0.6.13-main.09887cd"
58
60
  },
59
61
  "publishConfig": {
60
62
  "access": "public"
@@ -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: (props: IconProps) => <Gear {...props} />,
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 Plugin, Surface, usePlugins } from '@dxos/app-framework';
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 corePlugins = core.map((id) => plugins.find((plugin) => plugin.meta.id === id)?.meta).filter(nonNullable);
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(({ name: a }, { name: b }) => a?.localeCompare(b ?? '') ?? 0);
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} gap />}
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, gap }: { title: string; plugins: Plugin['meta'][]; gap?: boolean }) => {
113
+ const PluginList = ({ title, plugins }: { title: string; plugins: PluginMeta[] }) => {
109
114
  return (
110
- <>
111
- <Tabs.TabGroupHeading classNames={gap ? 'mbs-4' : 'mbs-4 @md:mbs-2'}>{title}</Tabs.TabGroupHeading>
112
- {plugins.map((plugin) => (
113
- <Tabs.Tab key={plugin.id} value={plugin.id}>
114
- {plugin.name}
115
- </Tabs.Tab>
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
@@ -2,8 +2,10 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
+ import { type PluginMeta } from '@dxos/app-framework';
6
+
5
7
  export const SETTINGS_PLUGIN = 'dxos.org/plugin/settings';
6
8
 
7
9
  export default {
8
10
  id: SETTINGS_PLUGIN,
9
- };
11
+ } satisfies PluginMeta;
@@ -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
- }