@dxos/plugin-settings 0.6.12-staging.e11e696 → 0.6.12
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 +13 -15
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +43 -45
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/types/src/SettingsPlugin.d.ts.map +1 -1
- package/dist/types/src/components/SettingsDialog.d.ts.map +1 -1
- package/package.json +14 -16
- package/src/SettingsPlugin.tsx +3 -1
- package/src/components/SettingsDialog.tsx +13 -20
- package/dist/lib/node-esm/chunk-CHPB3YX5.mjs +0 -13
- package/dist/lib/node-esm/chunk-CHPB3YX5.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -258
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/meta.mjs +0 -10
- package/dist/lib/node-esm/meta.mjs.map +0 -7
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-JKQMH66V.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/plugins/plugin-settings/src/SettingsPlugin.tsx
|
|
7
|
+
import { Gear } from "@phosphor-icons/react";
|
|
7
8
|
import React3 from "react";
|
|
8
9
|
import { parseIntentPlugin, resolvePlugin, LayoutAction, SettingsAction } from "@dxos/app-framework";
|
|
9
10
|
import { LocalStorageStore } from "@dxos/local-storage";
|
|
@@ -28,9 +29,8 @@ var SettingsDialog = ({ selected, onSelected }) => {
|
|
|
28
29
|
"dxos.org/plugin/observability",
|
|
29
30
|
"dxos.org/plugin/registry"
|
|
30
31
|
];
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const filteredPlugins = enabled.filter((id) => !core.includes(id)).map((id) => plugins.find((plugin) => plugin.meta.id === id)).filter((plugin) => plugin?.provides?.settings).map((plugin) => plugin.meta).sort(sortPlugin);
|
|
32
|
+
const corePlugins = core.map((id) => plugins.find((plugin) => plugin.meta.id === id)?.meta).filter(nonNullable);
|
|
33
|
+
const filteredPlugins = enabled.filter((id) => !core.includes(id)).map((id) => plugins.find((plugin) => plugin.meta.id === id)).filter((plugin) => plugin?.provides?.settings).map((plugin) => plugin.meta).sort(({ name: a }, { name: b }) => a?.localeCompare(b ?? "") ?? 0);
|
|
34
34
|
const [tabsActivePart, setTabsActivePart] = useState("list");
|
|
35
35
|
return /* @__PURE__ */ React.createElement(Dialog.Content, {
|
|
36
36
|
classNames: "p-0 bs-content max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
@@ -72,13 +72,14 @@ var SettingsDialog = ({ selected, onSelected }) => {
|
|
|
72
72
|
role: "none",
|
|
73
73
|
className: "overflow-y-auto pli-3 @md:pis-2 @md:pie-0 mbe-4 border-r border-separator"
|
|
74
74
|
}, /* @__PURE__ */ React.createElement(Tabs.Tablist, {
|
|
75
|
-
classNames: "
|
|
75
|
+
classNames: "max-bs-none overflow-y-visible"
|
|
76
76
|
}, /* @__PURE__ */ React.createElement(PluginList, {
|
|
77
77
|
title: "Options",
|
|
78
78
|
plugins: corePlugins
|
|
79
79
|
}), filteredPlugins.length > 0 && /* @__PURE__ */ React.createElement(PluginList, {
|
|
80
80
|
title: "Plugins",
|
|
81
|
-
plugins: filteredPlugins
|
|
81
|
+
plugins: filteredPlugins,
|
|
82
|
+
gap: true
|
|
82
83
|
}))), corePlugins.map((plugin) => /* @__PURE__ */ React.createElement(Tabs.Tabpanel, {
|
|
83
84
|
key: plugin.id,
|
|
84
85
|
value: plugin.id,
|
|
@@ -99,17 +100,13 @@ var SettingsDialog = ({ selected, onSelected }) => {
|
|
|
99
100
|
}
|
|
100
101
|
}))))));
|
|
101
102
|
};
|
|
102
|
-
var PluginList = ({ title, plugins }) => {
|
|
103
|
-
return /* @__PURE__ */ React.createElement(
|
|
104
|
-
|
|
105
|
-
}, /* @__PURE__ */ React.createElement(Tabs.
|
|
106
|
-
classNames: "pli-1 mlb-2 mbs-4 @md:mbs-2"
|
|
107
|
-
}, title), /* @__PURE__ */ React.createElement("div", {
|
|
108
|
-
className: "flex flex-col ml-1"
|
|
109
|
-
}, plugins.map((plugin) => /* @__PURE__ */ React.createElement(Tabs.Tab, {
|
|
103
|
+
var PluginList = ({ title, plugins, gap }) => {
|
|
104
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Tabs.TabGroupHeading, {
|
|
105
|
+
classNames: gap ? "mbs-4" : "mbs-4 @md:mbs-2"
|
|
106
|
+
}, title), plugins.map((plugin) => /* @__PURE__ */ React.createElement(Tabs.Tab, {
|
|
110
107
|
key: plugin.id,
|
|
111
108
|
value: plugin.id
|
|
112
|
-
}, plugin.name)))
|
|
109
|
+
}, plugin.name)));
|
|
113
110
|
};
|
|
114
111
|
|
|
115
112
|
// packages/plugins/plugin-settings/src/components/SettingsValue.tsx
|
|
@@ -230,7 +227,8 @@ var SettingsPlugin = () => {
|
|
|
230
227
|
ns: SETTINGS_PLUGIN
|
|
231
228
|
}
|
|
232
229
|
],
|
|
233
|
-
icon:
|
|
230
|
+
icon: (props) => /* @__PURE__ */ React3.createElement(Gear, props),
|
|
231
|
+
iconSymbol: "ph--gear--regular",
|
|
234
232
|
keyBinding: {
|
|
235
233
|
macos: "meta+,",
|
|
236
234
|
windows: "alt+,"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/SettingsPlugin.tsx", "../../../src/components/SettingsDialog.tsx", "../../../src/components/SettingsValue.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport {\n type IntentResolverProvides,\n type PluginDefinition,\n type SurfaceProvides,\n parseIntentPlugin,\n resolvePlugin,\n LayoutAction,\n SettingsAction,\n type GraphBuilderProvides,\n type TranslationsProvides,\n} from '@dxos/app-framework';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\n\nimport { SettingsDialog } from './components';\nimport meta, { SETTINGS_PLUGIN } from './meta';\nimport translations from './translations';\n\nconst DEFAULT_PLUGIN = 'dxos.org/plugin/registry';\n\nexport type SettingsPluginProvides = SurfaceProvides &\n IntentResolverProvides &\n GraphBuilderProvides &\n TranslationsProvides;\n\ntype SettingsSettingsProps = {\n selected: string;\n};\n\n/**\n * Plugin for aggregating and rendering plugin settings.\n */\nexport const SettingsPlugin = (): PluginDefinition<SettingsPluginProvides> => {\n const settings = new LocalStorageStore<SettingsSettingsProps>(SETTINGS_PLUGIN, { selected: DEFAULT_PLUGIN });\n\n return {\n meta,\n ready: async () => {\n settings.prop({ key: 'selected', type: LocalStorageStore.string() });\n },\n provides: {\n surface: {\n component: ({ data }) => {\n switch (data.component) {\n case `${SETTINGS_PLUGIN}/Settings`:\n return (\n <SettingsDialog\n selected={settings.values.selected}\n onSelected={(selected) => (settings.values.selected = selected)}\n />\n );\n\n default:\n return null;\n }\n },\n },\n intent: {\n resolver: (intent) => {\n switch (intent.action) {\n case SettingsAction.OPEN: {\n if (intent.data?.plugin) {\n settings.values.selected = intent.data?.plugin;\n }\n\n return {\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: `${SETTINGS_PLUGIN}/Settings`,\n dialogBlockAlign: 'start',\n },\n },\n ],\n ],\n };\n }\n }\n },\n },\n graph: {\n builder: (plugins) => {\n const intentPlugin = resolvePlugin(plugins, parseIntentPlugin);\n\n return createExtension({\n id: SETTINGS_PLUGIN,\n filter: (node): node is Node<null> => node.id === 'root',\n actions: () => [\n {\n id: SETTINGS_PLUGIN,\n data: async () => {\n await intentPlugin?.provides.intent.dispatch({\n plugin: SETTINGS_PLUGIN,\n action: SettingsAction.OPEN,\n });\n },\n properties: {\n label: ['open settings label', { ns: SETTINGS_PLUGIN }],\n icon: 'ph--gear--regular',\n keyBinding: {\n macos: 'meta+,',\n windows: 'alt+,',\n },\n },\n },\n ],\n });\n },\n },\n translations,\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { type Plugin, Surface, usePlugins } from '@dxos/app-framework';\nimport { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';\nimport { Tabs, type TabsActivePart } from '@dxos/react-ui-tabs';\nimport { getSize } from '@dxos/react-ui-theme';\nimport { nonNullable } from '@dxos/util';\n\nimport { SETTINGS_PLUGIN } from '../meta';\n\nexport const SettingsDialog = ({\n selected,\n onSelected,\n}: {\n selected: string;\n onSelected: (plugin: string) => void;\n}) => {\n const { t } = useTranslation(SETTINGS_PLUGIN);\n const { plugins, enabled } = usePlugins();\n\n // TODO(burdon): Factor out common defs?\n const core = [\n 'dxos.org/plugin/layout',\n 'dxos.org/plugin/deck',\n 'dxos.org/plugin/files',\n 'dxos.org/plugin/space',\n 'dxos.org/plugin/stack',\n 'dxos.org/plugin/observability',\n 'dxos.org/plugin/registry',\n ];\n\n const sortPlugin = ({ name: a }: Plugin['meta'], { name: b }: Plugin['meta']) => a?.localeCompare(b ?? '') ?? 0;\n\n const corePlugins = core\n .map((id) => plugins.find((plugin) => plugin.meta.id === id)?.meta)\n .filter(nonNullable)\n .sort(sortPlugin);\n\n const filteredPlugins = enabled\n .filter((id) => !core.includes(id))\n .map((id) => plugins.find((plugin) => plugin.meta.id === id))\n .filter((plugin) => (plugin?.provides as any)?.settings)\n .map((plugin) => plugin!.meta)\n .sort(sortPlugin);\n\n const [tabsActivePart, setTabsActivePart] = useState<TabsActivePart>('list');\n\n return (\n <Dialog.Content classNames='p-0 bs-content max-bs-full md:max-is-[40rem] overflow-hidden'>\n <div role='none' className='flex justify-between mbe-1 pbs-3 pis-2 pie-3 @md:pbs-4 @md:pis-4 @md:pie-5'>\n <Dialog.Title\n onClick={() => setTabsActivePart('list')}\n aria-description={t('click to return to tablist description')}\n classNames='flex cursor-pointer items-center group/title'\n >\n <Icon\n icon='ph--caret-left--regular'\n classNames={['@md:hidden', getSize(4), tabsActivePart === 'list' && 'invisible']}\n />\n <span\n className={\n tabsActivePart !== 'list'\n ? 'group-hover/title:underline @md:group-hover/title:no-underline underline-offset-4 decoration-1'\n : ''\n }\n >\n {t('settings dialog title')}\n </span>\n </Dialog.Title>\n <Dialog.Close asChild>\n <Button density='fine' variant='ghost' autoFocus>\n <Icon icon='ph--x--regular' size={3} />\n </Button>\n </Dialog.Close>\n </div>\n\n <Tabs.Root\n orientation='vertical'\n value={selected}\n onValueChange={(nextSelected) => onSelected(nextSelected)}\n activePart={tabsActivePart}\n onActivePartChange={setTabsActivePart}\n classNames='flex flex-col flex-1 mbs-2'\n >\n <Tabs.Viewport classNames='flex-1 min-bs-0'>\n <div role='none' className='overflow-y-auto pli-3 @md:pis-2 @md:pie-0 mbe-4 border-r border-separator'>\n <Tabs.Tablist classNames='flex flex-col gap-4 max-bs-none overflow-y-visible'>\n <PluginList title='Options' plugins={corePlugins} />\n {filteredPlugins.length > 0 && <PluginList title='Plugins' plugins={filteredPlugins} />}\n </Tabs.Tablist>\n </div>\n\n {corePlugins.map((plugin) => (\n <Tabs.Tabpanel key={plugin.id} value={plugin.id} classNames='pli-3 @md:pli-5 max-bs-dvh overflow-y-auto'>\n <Surface role='settings' data={{ plugin: plugin.id }} />\n </Tabs.Tabpanel>\n ))}\n {filteredPlugins.map((plugin) => (\n <Tabs.Tabpanel key={plugin.id} value={plugin.id} classNames='pli-3 @md:pli-5 max-bs-dvh overflow-y-auto'>\n <Surface role='settings' data={{ plugin: plugin.id }} />\n </Tabs.Tabpanel>\n ))}\n </Tabs.Viewport>\n </Tabs.Root>\n </Dialog.Content>\n );\n};\n\nconst PluginList = ({ title, plugins }: { title: string; plugins: Plugin['meta'][] }) => {\n return (\n <div role='none'>\n <Tabs.TabGroupHeading classNames={'pli-1 mlb-2 mbs-4 @md:mbs-2'}>{title}</Tabs.TabGroupHeading>\n <div className='flex flex-col ml-1'>\n {plugins.map((plugin) => (\n <Tabs.Tab key={plugin.id} value={plugin.id}>\n {plugin.name}\n </Tabs.Tab>\n ))}\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type JSX, type PropsWithChildren } from 'react';\n\nimport { Input } from '@dxos/react-ui';\n\ntype SettingValueProps = {\n label: string;\n description?: JSX.Element;\n secondary?: JSX.Element;\n};\n\nexport const SettingsValue = ({ label, description, secondary, children }: PropsWithChildren<SettingValueProps>) => {\n const primary = (\n <div role='none' className='flex w-full gap-4 py-1'>\n <Input.Root>\n <div role='none' className='flex flex-col w-full'>\n {/* TODO(burdon): Consistent height for controls (e.g., Select, Textbox, and Checkbox are all different). */}\n <Input.Label classNames='flex min-h-[40px] items-center'>{label}</Input.Label>\n {description && (\n <Input.DescriptionAndValidation classNames='mbs-0.5'>\n <Input.Description>{description}</Input.Description>\n </Input.DescriptionAndValidation>\n )}\n </div>\n\n <div role='none'>\n <div role='none' className='flex min-h-[40px] items-center'>\n {children}\n </div>\n </div>\n </Input.Root>\n </div>\n );\n\n if (secondary) {\n // console.log(secondary);\n return (\n <div role='none' className='flex flex-col w-full'>\n {primary}\n {secondary}\n </div>\n );\n }\n\n return primary;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { SETTINGS_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [SETTINGS_PLUGIN]: {\n 'open settings label': 'Show settings',\n 'settings dialog title': 'Settings',\n 'back label': 'Back',\n 'click to return to tablist description': 'Click the title to return to the settings menu',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { SettingsPlugin } from './SettingsPlugin';\n\nexport default SettingsPlugin;\n\nexport * from './SettingsPlugin';\n\n// TODO(wittjosiah): Remove.\n// Settings should be exposed from plugins as state and intents rather than components.\nexport * from './components';\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,
|
|
6
|
-
"names": ["React", "parseIntentPlugin", "resolvePlugin", "LayoutAction", "SettingsAction", "LocalStorageStore", "createExtension", "React", "useState", "Surface", "usePlugins", "Button", "Dialog", "Icon", "useTranslation", "Tabs", "getSize", "nonNullable", "SettingsDialog", "selected", "onSelected", "t", "useTranslation", "SETTINGS_PLUGIN", "plugins", "enabled", "usePlugins", "core", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Gear, type IconProps } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport {\n type IntentResolverProvides,\n type PluginDefinition,\n type SurfaceProvides,\n parseIntentPlugin,\n resolvePlugin,\n LayoutAction,\n SettingsAction,\n type GraphBuilderProvides,\n type TranslationsProvides,\n} from '@dxos/app-framework';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\n\nimport { SettingsDialog } from './components';\nimport meta, { SETTINGS_PLUGIN } from './meta';\nimport translations from './translations';\n\nconst DEFAULT_PLUGIN = 'dxos.org/plugin/registry';\n\nexport type SettingsPluginProvides = SurfaceProvides &\n IntentResolverProvides &\n GraphBuilderProvides &\n TranslationsProvides;\n\ntype SettingsSettingsProps = {\n selected: string;\n};\n\n/**\n * Plugin for aggregating and rendering plugin settings.\n */\nexport const SettingsPlugin = (): PluginDefinition<SettingsPluginProvides> => {\n const settings = new LocalStorageStore<SettingsSettingsProps>(SETTINGS_PLUGIN, { selected: DEFAULT_PLUGIN });\n\n return {\n meta,\n ready: async () => {\n settings.prop({ key: 'selected', type: LocalStorageStore.string() });\n },\n provides: {\n surface: {\n component: ({ data }) => {\n switch (data.component) {\n case `${SETTINGS_PLUGIN}/Settings`:\n return (\n <SettingsDialog\n selected={settings.values.selected}\n onSelected={(selected) => (settings.values.selected = selected)}\n />\n );\n\n default:\n return null;\n }\n },\n },\n intent: {\n resolver: (intent) => {\n switch (intent.action) {\n case SettingsAction.OPEN: {\n if (intent.data?.plugin) {\n settings.values.selected = intent.data?.plugin;\n }\n\n return {\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: `${SETTINGS_PLUGIN}/Settings`,\n dialogBlockAlign: 'start',\n },\n },\n ],\n ],\n };\n }\n }\n },\n },\n graph: {\n builder: (plugins) => {\n const intentPlugin = resolvePlugin(plugins, parseIntentPlugin);\n\n return createExtension({\n id: SETTINGS_PLUGIN,\n filter: (node): node is Node<null> => node.id === 'root',\n actions: () => [\n {\n id: SETTINGS_PLUGIN,\n data: async () => {\n await intentPlugin?.provides.intent.dispatch({\n plugin: SETTINGS_PLUGIN,\n action: SettingsAction.OPEN,\n });\n },\n properties: {\n label: ['open settings label', { ns: SETTINGS_PLUGIN }],\n icon: (props: IconProps) => <Gear {...props} />,\n iconSymbol: 'ph--gear--regular',\n keyBinding: {\n macos: 'meta+,',\n windows: 'alt+,',\n },\n },\n },\n ],\n });\n },\n },\n translations,\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { type Plugin, Surface, usePlugins } from '@dxos/app-framework';\nimport { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';\nimport { Tabs, type TabsActivePart } from '@dxos/react-ui-tabs';\nimport { getSize } from '@dxos/react-ui-theme';\nimport { nonNullable } from '@dxos/util';\n\nimport { SETTINGS_PLUGIN } from '../meta';\n\nexport const SettingsDialog = ({\n selected,\n onSelected,\n}: {\n selected: string;\n onSelected: (plugin: string) => void;\n}) => {\n const { t } = useTranslation(SETTINGS_PLUGIN);\n const { plugins, enabled } = usePlugins();\n\n // TODO(burdon): Factor out common defs?\n const core = [\n 'dxos.org/plugin/layout',\n 'dxos.org/plugin/deck',\n 'dxos.org/plugin/files',\n 'dxos.org/plugin/space',\n 'dxos.org/plugin/stack',\n 'dxos.org/plugin/observability',\n 'dxos.org/plugin/registry',\n ];\n\n const corePlugins = core.map((id) => plugins.find((plugin) => plugin.meta.id === id)?.meta).filter(nonNullable);\n\n const filteredPlugins = enabled\n .filter((id) => !core.includes(id))\n .map((id) => plugins.find((plugin) => plugin.meta.id === id))\n .filter((plugin) => (plugin?.provides as any)?.settings)\n .map((plugin) => plugin!.meta)\n .sort(({ name: a }, { name: b }) => a?.localeCompare(b ?? '') ?? 0);\n\n const [tabsActivePart, setTabsActivePart] = useState<TabsActivePart>('list');\n\n return (\n <Dialog.Content classNames='p-0 bs-content max-bs-full md:max-is-[40rem] overflow-hidden'>\n <div role='none' className='flex justify-between mbe-1 pbs-3 pis-2 pie-3 @md:pbs-4 @md:pis-4 @md:pie-5'>\n <Dialog.Title\n onClick={() => setTabsActivePart('list')}\n aria-description={t('click to return to tablist description')}\n classNames='flex cursor-pointer items-center group/title'\n >\n <Icon\n icon='ph--caret-left--regular'\n classNames={['@md:hidden', getSize(4), tabsActivePart === 'list' && 'invisible']}\n />\n <span\n className={\n tabsActivePart !== 'list'\n ? 'group-hover/title:underline @md:group-hover/title:no-underline underline-offset-4 decoration-1'\n : ''\n }\n >\n {t('settings dialog title')}\n </span>\n </Dialog.Title>\n <Dialog.Close asChild>\n <Button density='fine' variant='ghost' autoFocus>\n <Icon icon='ph--x--regular' size={3} />\n </Button>\n </Dialog.Close>\n </div>\n\n <Tabs.Root\n orientation='vertical'\n value={selected}\n onValueChange={(nextSelected) => onSelected(nextSelected)}\n activePart={tabsActivePart}\n onActivePartChange={setTabsActivePart}\n classNames='flex flex-col flex-1 mbs-2'\n >\n <Tabs.Viewport classNames='flex-1 min-bs-0'>\n <div role='none' className='overflow-y-auto pli-3 @md:pis-2 @md:pie-0 mbe-4 border-r border-separator'>\n <Tabs.Tablist classNames='max-bs-none overflow-y-visible'>\n <PluginList title='Options' plugins={corePlugins} />\n {filteredPlugins.length > 0 && <PluginList title='Plugins' plugins={filteredPlugins} gap />}\n </Tabs.Tablist>\n </div>\n\n {corePlugins.map((plugin) => (\n <Tabs.Tabpanel key={plugin.id} value={plugin.id} classNames='pli-3 @md:pli-5 max-bs-dvh overflow-y-auto'>\n <Surface role='settings' data={{ plugin: plugin.id }} />\n </Tabs.Tabpanel>\n ))}\n {filteredPlugins.map((plugin) => (\n <Tabs.Tabpanel key={plugin.id} value={plugin.id} classNames='pli-3 @md:pli-5 max-bs-dvh overflow-y-auto'>\n <Surface role='settings' data={{ plugin: plugin.id }} />\n </Tabs.Tabpanel>\n ))}\n </Tabs.Viewport>\n </Tabs.Root>\n </Dialog.Content>\n );\n};\n\nconst PluginList = ({ title, plugins, gap }: { title: string; plugins: Plugin['meta'][]; gap?: boolean }) => {\n return (\n <>\n <Tabs.TabGroupHeading classNames={gap ? 'mbs-4' : 'mbs-4 @md:mbs-2'}>{title}</Tabs.TabGroupHeading>\n {plugins.map((plugin) => (\n <Tabs.Tab key={plugin.id} value={plugin.id}>\n {plugin.name}\n </Tabs.Tab>\n ))}\n </>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type JSX, type PropsWithChildren } from 'react';\n\nimport { Input } from '@dxos/react-ui';\n\ntype SettingValueProps = {\n label: string;\n description?: JSX.Element;\n secondary?: JSX.Element;\n};\n\nexport const SettingsValue = ({ label, description, secondary, children }: PropsWithChildren<SettingValueProps>) => {\n const primary = (\n <div role='none' className='flex w-full gap-4 py-1'>\n <Input.Root>\n <div role='none' className='flex flex-col w-full'>\n {/* TODO(burdon): Consistent height for controls (e.g., Select, Textbox, and Checkbox are all different). */}\n <Input.Label classNames='flex min-h-[40px] items-center'>{label}</Input.Label>\n {description && (\n <Input.DescriptionAndValidation classNames='mbs-0.5'>\n <Input.Description>{description}</Input.Description>\n </Input.DescriptionAndValidation>\n )}\n </div>\n\n <div role='none'>\n <div role='none' className='flex min-h-[40px] items-center'>\n {children}\n </div>\n </div>\n </Input.Root>\n </div>\n );\n\n if (secondary) {\n // console.log(secondary);\n return (\n <div role='none' className='flex flex-col w-full'>\n {primary}\n {secondary}\n </div>\n );\n }\n\n return primary;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { SETTINGS_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [SETTINGS_PLUGIN]: {\n 'open settings label': 'Show settings',\n 'settings dialog title': 'Settings',\n 'back label': 'Back',\n 'click to return to tablist description': 'Click the title to return to the settings menu',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { SettingsPlugin } from './SettingsPlugin';\n\nexport default SettingsPlugin;\n\nexport * from './SettingsPlugin';\n\n// TODO(wittjosiah): Remove.\n// Settings should be exposed from plugins as state and intents rather than components.\nexport * from './components';\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,SAASA,YAA4B;AACrC,OAAOC,YAAW;AAElB,SAIEC,mBACAC,eACAC,cACAC,sBAGK;AACP,SAASC,yBAAyB;AAClC,SAASC,uBAAkC;;;ACf3C,OAAOC,SAASC,gBAAgB;AAEhC,SAAsBC,SAASC,kBAAkB;AACjD,SAASC,QAAQC,QAAQC,MAAMC,sBAAsB;AACrD,SAASC,YAAiC;AAC1C,SAASC,eAAe;AACxB,SAASC,mBAAmB;AAIrB,IAAMC,iBAAiB,CAAC,EAC7BC,UACAC,WAAU,MAIX;AACC,QAAM,EAAEC,EAAC,IAAKC,eAAeC,eAAAA;AAC7B,QAAM,EAAEC,SAASC,QAAO,IAAKC,WAAAA;AAG7B,QAAMC,OAAO;IACX;IACA;IACA;IACA;IACA;IACA;IACA;;AAGF,QAAMC,cAAcD,KAAKE,IAAI,CAACC,OAAON,QAAQO,KAAK,CAACC,WAAWA,OAAOC,KAAKH,OAAOA,EAAAA,GAAKG,IAAAA,EAAMC,OAAOC,WAAAA;AAEnG,QAAMC,kBAAkBX,QACrBS,OAAO,CAACJ,OAAO,CAACH,KAAKU,SAASP,EAAAA,CAAAA,EAC9BD,IAAI,CAACC,OAAON,QAAQO,KAAK,CAACC,WAAWA,OAAOC,KAAKH,OAAOA,EAAAA,CAAAA,EACxDI,OAAO,CAACF,WAAYA,QAAQM,UAAkBC,QAAAA,EAC9CV,IAAI,CAACG,WA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sBACpB;oBACF;;;cAGN;YACF;UACF;QACF;MACF;MACAC,OAAO;QACLC,SAAS,CAACC,YAAAA;AACR,gBAAMC,eAAeC,cAAcF,SAASG,iBAAAA;AAE5C,iBAAOC,gBAAgB;YACrBC,IAAIlC;YACJmC,QAAQ,CAACC,SAA6BA,KAAKF,OAAO;YAClDG,SAAS,MAAM;cACb;gBACEH,IAAIlC;gBACJW,MAAM,YAAA;AACJ,wBAAMmB,cAActB,SAASQ,OAAOsB,SAAS;oBAC3CjB,QAAQrB;oBACRkB,QAAQC,eAAeC;kBACzB,CAAA;gBACF;gBACAmB,YAAY;kBACVC,OAAO;oBAAC;oBAAuB;sBAAEC,IAAIzC;oBAAgB;;kBACrD0C,MAAM,CAACC,UAAqB,gBAAA/B,OAAA,cAACgC,MAASD,KAAAA;kBACtCE,YAAY;kBACZC,YAAY;oBACVC,OAAO;oBACPC,SAAS;kBACX;gBACF;cACF;;UAEJ,CAAA;QACF;MACF;MACAC;IACF;EACF;AACF;;;AIrHA,IAAA,cAAeC;",
|
|
6
|
+
"names": ["Gear", "React", "parseIntentPlugin", "resolvePlugin", "LayoutAction", "SettingsAction", "LocalStorageStore", "createExtension", "React", "useState", "Surface", "usePlugins", "Button", "Dialog", "Icon", "useTranslation", "Tabs", "getSize", "nonNullable", "SettingsDialog", "selected", "onSelected", "t", "useTranslation", "SETTINGS_PLUGIN", "plugins", "enabled", "usePlugins", "core", "corePlugins", "map", "id", "find", "plugin", "meta", "filter", "nonNullable", "filteredPlugins", "includes", "provides", "settings", "sort", "name", "a", "b", "localeCompare", "tabsActivePart", "setTabsActivePart", "useState", "Dialog", "Content", "classNames", "div", "role", "className", "Title", "onClick", "aria-description", "Icon", "icon", "getSize", "span", "Close", "asChild", "Button", "density", "variant", "autoFocus", "size", "Tabs", "Root", "orientation", "value", "onValueChange", "nextSelected", "activePart", "onActivePartChange", "Viewport", "Tablist", "PluginList", "title", "length", "gap", "Tabpanel", "key", "Surface", "data", "TabGroupHeading", "Tab", "React", "Input", "SettingsValue", "label", "description", "secondary", "children", "primary", "React", "div", "role", "className", "Input", "Root", "Label", "classNames", "DescriptionAndValidation", "Description", "SETTINGS_PLUGIN", "DEFAULT_PLUGIN", "SettingsPlugin", "settings", "LocalStorageStore", "SETTINGS_PLUGIN", "selected", "meta", "ready", "prop", "key", "type", "string", "provides", "surface", "component", "data", "React", "SettingsDialog", "values", "onSelected", "intent", "resolver", "action", "SettingsAction", "OPEN", "plugin", "intents", "LayoutAction", "SET_LAYOUT", "element", "dialogBlockAlign", "graph", "builder", "plugins", "intentPlugin", "resolvePlugin", "parseIntentPlugin", "createExtension", "id", "filter", "node", "actions", "dispatch", "properties", "label", "ns", "icon", "props", "Gear", "iconSymbol", "keyBinding", "macos", "windows", "translations", "SettingsPlugin"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/plugin-settings/src/meta.ts":{"bytes":778,"imports":[],"format":"esm"},"packages/plugins/plugin-settings/src/components/SettingsDialog.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-settings/src/meta.ts":{"bytes":778,"imports":[],"format":"esm"},"packages/plugins/plugin-settings/src/components/SettingsDialog.tsx":{"bytes":15320,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-tabs","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-settings/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-settings/src/components/SettingsValue.tsx":{"bytes":4471,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-settings/src/components/index.ts":{"bytes":634,"imports":[{"path":"packages/plugins/plugin-settings/src/components/SettingsDialog.tsx","kind":"import-statement","original":"./SettingsDialog"},{"path":"packages/plugins/plugin-settings/src/components/SettingsValue.tsx","kind":"import-statement","original":"./SettingsValue"}],"format":"esm"},"packages/plugins/plugin-settings/src/translations.ts":{"bytes":1571,"imports":[{"path":"packages/plugins/plugin-settings/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-settings/src/SettingsPlugin.tsx":{"bytes":12747,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-settings/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-settings/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-settings/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/plugin-settings/src/index.ts":{"bytes":1216,"imports":[{"path":"packages/plugins/plugin-settings/src/SettingsPlugin.tsx","kind":"import-statement","original":"./SettingsPlugin"},{"path":"packages/plugins/plugin-settings/src/SettingsPlugin.tsx","kind":"import-statement","original":"./SettingsPlugin"},{"path":"packages/plugins/plugin-settings/src/components/index.ts","kind":"import-statement","original":"./components"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-settings/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":16980},"packages/plugins/plugin-settings/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-settings/dist/lib/browser/chunk-JKQMH66V.mjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-tabs","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["SettingsDialog","SettingsPlugin","SettingsValue","default"],"entryPoint":"packages/plugins/plugin-settings/src/index.ts","inputs":{"packages/plugins/plugin-settings/src/SettingsPlugin.tsx":{"bytesInOutput":2968},"packages/plugins/plugin-settings/src/components/SettingsDialog.tsx":{"bytesInOutput":4288},"packages/plugins/plugin-settings/src/components/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-settings/src/components/SettingsValue.tsx":{"bytesInOutput":1125},"packages/plugins/plugin-settings/src/translations.ts":{"bytesInOutput":318},"packages/plugins/plugin-settings/src/index.ts":{"bytesInOutput":34}},"bytes":9300},"packages/plugins/plugin-settings/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-settings/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/plugin-settings/dist/lib/browser/chunk-JKQMH66V.mjs","kind":"import-statement"}],"exports":["SETTINGS_PLUGIN","default"],"entryPoint":"packages/plugins/plugin-settings/src/meta.ts","inputs":{},"bytes":165},"packages/plugins/plugin-settings/dist/lib/browser/chunk-JKQMH66V.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":338},"packages/plugins/plugin-settings/dist/lib/browser/chunk-JKQMH66V.mjs":{"imports":[],"exports":["SETTINGS_PLUGIN","meta_default"],"inputs":{"packages/plugins/plugin-settings/src/meta.ts":{"bytesInOutput":96}},"bytes":235}}}
|
package/dist/lib/node/index.cjs
CHANGED
|
@@ -35,17 +35,18 @@ __export(node_exports, {
|
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(node_exports);
|
|
37
37
|
var import_chunk_LZVHLML4 = require("./chunk-LZVHLML4.cjs");
|
|
38
|
-
var import_react =
|
|
38
|
+
var import_react = require("@phosphor-icons/react");
|
|
39
|
+
var import_react2 = __toESM(require("react"));
|
|
39
40
|
var import_app_framework = require("@dxos/app-framework");
|
|
40
41
|
var import_local_storage = require("@dxos/local-storage");
|
|
41
42
|
var import_plugin_graph = require("@dxos/plugin-graph");
|
|
42
|
-
var
|
|
43
|
+
var import_react3 = __toESM(require("react"));
|
|
43
44
|
var import_app_framework2 = require("@dxos/app-framework");
|
|
44
45
|
var import_react_ui = require("@dxos/react-ui");
|
|
45
46
|
var import_react_ui_tabs = require("@dxos/react-ui-tabs");
|
|
46
47
|
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
47
48
|
var import_util = require("@dxos/util");
|
|
48
|
-
var
|
|
49
|
+
var import_react4 = __toESM(require("react"));
|
|
49
50
|
var import_react_ui2 = require("@dxos/react-ui");
|
|
50
51
|
var SettingsDialog = ({ selected, onSelected }) => {
|
|
51
52
|
const { t } = (0, import_react_ui.useTranslation)(import_chunk_LZVHLML4.SETTINGS_PLUGIN);
|
|
@@ -59,108 +60,104 @@ var SettingsDialog = ({ selected, onSelected }) => {
|
|
|
59
60
|
"dxos.org/plugin/observability",
|
|
60
61
|
"dxos.org/plugin/registry"
|
|
61
62
|
];
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
return /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Dialog.Content, {
|
|
63
|
+
const corePlugins = core.map((id) => plugins.find((plugin) => plugin.meta.id === id)?.meta).filter(import_util.nonNullable);
|
|
64
|
+
const filteredPlugins = enabled.filter((id) => !core.includes(id)).map((id) => plugins.find((plugin) => plugin.meta.id === id)).filter((plugin) => plugin?.provides?.settings).map((plugin) => plugin.meta).sort(({ name: a }, { name: b }) => a?.localeCompare(b ?? "") ?? 0);
|
|
65
|
+
const [tabsActivePart, setTabsActivePart] = (0, import_react3.useState)("list");
|
|
66
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Dialog.Content, {
|
|
67
67
|
classNames: "p-0 bs-content max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
68
|
-
}, /* @__PURE__ */
|
|
68
|
+
}, /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
69
69
|
role: "none",
|
|
70
70
|
className: "flex justify-between mbe-1 pbs-3 pis-2 pie-3 @md:pbs-4 @md:pis-4 @md:pie-5"
|
|
71
|
-
}, /* @__PURE__ */
|
|
71
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Dialog.Title, {
|
|
72
72
|
onClick: () => setTabsActivePart("list"),
|
|
73
73
|
"aria-description": t("click to return to tablist description"),
|
|
74
74
|
classNames: "flex cursor-pointer items-center group/title"
|
|
75
|
-
}, /* @__PURE__ */
|
|
75
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Icon, {
|
|
76
76
|
icon: "ph--caret-left--regular",
|
|
77
77
|
classNames: [
|
|
78
78
|
"@md:hidden",
|
|
79
79
|
(0, import_react_ui_theme.getSize)(4),
|
|
80
80
|
tabsActivePart === "list" && "invisible"
|
|
81
81
|
]
|
|
82
|
-
}), /* @__PURE__ */
|
|
82
|
+
}), /* @__PURE__ */ import_react3.default.createElement("span", {
|
|
83
83
|
className: tabsActivePart !== "list" ? "group-hover/title:underline @md:group-hover/title:no-underline underline-offset-4 decoration-1" : ""
|
|
84
|
-
}, t("settings dialog title"))), /* @__PURE__ */
|
|
84
|
+
}, t("settings dialog title"))), /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Dialog.Close, {
|
|
85
85
|
asChild: true
|
|
86
|
-
}, /* @__PURE__ */
|
|
86
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Button, {
|
|
87
87
|
density: "fine",
|
|
88
88
|
variant: "ghost",
|
|
89
89
|
autoFocus: true
|
|
90
|
-
}, /* @__PURE__ */
|
|
90
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Icon, {
|
|
91
91
|
icon: "ph--x--regular",
|
|
92
92
|
size: 3
|
|
93
|
-
})))), /* @__PURE__ */
|
|
93
|
+
})))), /* @__PURE__ */ import_react3.default.createElement(import_react_ui_tabs.Tabs.Root, {
|
|
94
94
|
orientation: "vertical",
|
|
95
95
|
value: selected,
|
|
96
96
|
onValueChange: (nextSelected) => onSelected(nextSelected),
|
|
97
97
|
activePart: tabsActivePart,
|
|
98
98
|
onActivePartChange: setTabsActivePart,
|
|
99
99
|
classNames: "flex flex-col flex-1 mbs-2"
|
|
100
|
-
}, /* @__PURE__ */
|
|
100
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui_tabs.Tabs.Viewport, {
|
|
101
101
|
classNames: "flex-1 min-bs-0"
|
|
102
|
-
}, /* @__PURE__ */
|
|
102
|
+
}, /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
103
103
|
role: "none",
|
|
104
104
|
className: "overflow-y-auto pli-3 @md:pis-2 @md:pie-0 mbe-4 border-r border-separator"
|
|
105
|
-
}, /* @__PURE__ */
|
|
106
|
-
classNames: "
|
|
107
|
-
}, /* @__PURE__ */
|
|
105
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui_tabs.Tabs.Tablist, {
|
|
106
|
+
classNames: "max-bs-none overflow-y-visible"
|
|
107
|
+
}, /* @__PURE__ */ import_react3.default.createElement(PluginList, {
|
|
108
108
|
title: "Options",
|
|
109
109
|
plugins: corePlugins
|
|
110
|
-
}), filteredPlugins.length > 0 && /* @__PURE__ */
|
|
110
|
+
}), filteredPlugins.length > 0 && /* @__PURE__ */ import_react3.default.createElement(PluginList, {
|
|
111
111
|
title: "Plugins",
|
|
112
|
-
plugins: filteredPlugins
|
|
113
|
-
|
|
112
|
+
plugins: filteredPlugins,
|
|
113
|
+
gap: true
|
|
114
|
+
}))), corePlugins.map((plugin) => /* @__PURE__ */ import_react3.default.createElement(import_react_ui_tabs.Tabs.Tabpanel, {
|
|
114
115
|
key: plugin.id,
|
|
115
116
|
value: plugin.id,
|
|
116
117
|
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
117
|
-
}, /* @__PURE__ */
|
|
118
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_app_framework2.Surface, {
|
|
118
119
|
role: "settings",
|
|
119
120
|
data: {
|
|
120
121
|
plugin: plugin.id
|
|
121
122
|
}
|
|
122
|
-
}))), filteredPlugins.map((plugin) => /* @__PURE__ */
|
|
123
|
+
}))), filteredPlugins.map((plugin) => /* @__PURE__ */ import_react3.default.createElement(import_react_ui_tabs.Tabs.Tabpanel, {
|
|
123
124
|
key: plugin.id,
|
|
124
125
|
value: plugin.id,
|
|
125
126
|
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
126
|
-
}, /* @__PURE__ */
|
|
127
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_app_framework2.Surface, {
|
|
127
128
|
role: "settings",
|
|
128
129
|
data: {
|
|
129
130
|
plugin: plugin.id
|
|
130
131
|
}
|
|
131
132
|
}))))));
|
|
132
133
|
};
|
|
133
|
-
var PluginList = ({ title, plugins }) => {
|
|
134
|
-
return /* @__PURE__ */
|
|
135
|
-
|
|
136
|
-
}, /* @__PURE__ */
|
|
137
|
-
classNames: "pli-1 mlb-2 mbs-4 @md:mbs-2"
|
|
138
|
-
}, title), /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
139
|
-
className: "flex flex-col ml-1"
|
|
140
|
-
}, plugins.map((plugin) => /* @__PURE__ */ import_react2.default.createElement(import_react_ui_tabs.Tabs.Tab, {
|
|
134
|
+
var PluginList = ({ title, plugins, gap }) => {
|
|
135
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, /* @__PURE__ */ import_react3.default.createElement(import_react_ui_tabs.Tabs.TabGroupHeading, {
|
|
136
|
+
classNames: gap ? "mbs-4" : "mbs-4 @md:mbs-2"
|
|
137
|
+
}, title), plugins.map((plugin) => /* @__PURE__ */ import_react3.default.createElement(import_react_ui_tabs.Tabs.Tab, {
|
|
141
138
|
key: plugin.id,
|
|
142
139
|
value: plugin.id
|
|
143
|
-
}, plugin.name)))
|
|
140
|
+
}, plugin.name)));
|
|
144
141
|
};
|
|
145
142
|
var SettingsValue = ({ label, description, secondary, children }) => {
|
|
146
|
-
const primary = /* @__PURE__ */
|
|
143
|
+
const primary = /* @__PURE__ */ import_react4.default.createElement("div", {
|
|
147
144
|
role: "none",
|
|
148
145
|
className: "flex w-full gap-4 py-1"
|
|
149
|
-
}, /* @__PURE__ */
|
|
146
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.Root, null, /* @__PURE__ */ import_react4.default.createElement("div", {
|
|
150
147
|
role: "none",
|
|
151
148
|
className: "flex flex-col w-full"
|
|
152
|
-
}, /* @__PURE__ */
|
|
149
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.Label, {
|
|
153
150
|
classNames: "flex min-h-[40px] items-center"
|
|
154
|
-
}, label), description && /* @__PURE__ */
|
|
151
|
+
}, label), description && /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.DescriptionAndValidation, {
|
|
155
152
|
classNames: "mbs-0.5"
|
|
156
|
-
}, /* @__PURE__ */
|
|
153
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Input.Description, null, description))), /* @__PURE__ */ import_react4.default.createElement("div", {
|
|
157
154
|
role: "none"
|
|
158
|
-
}, /* @__PURE__ */
|
|
155
|
+
}, /* @__PURE__ */ import_react4.default.createElement("div", {
|
|
159
156
|
role: "none",
|
|
160
157
|
className: "flex min-h-[40px] items-center"
|
|
161
158
|
}, children))));
|
|
162
159
|
if (secondary) {
|
|
163
|
-
return /* @__PURE__ */
|
|
160
|
+
return /* @__PURE__ */ import_react4.default.createElement("div", {
|
|
164
161
|
role: "none",
|
|
165
162
|
className: "flex flex-col w-full"
|
|
166
163
|
}, primary, secondary);
|
|
@@ -197,7 +194,7 @@ var SettingsPlugin = () => {
|
|
|
197
194
|
component: ({ data }) => {
|
|
198
195
|
switch (data.component) {
|
|
199
196
|
case `${import_chunk_LZVHLML4.SETTINGS_PLUGIN}/Settings`:
|
|
200
|
-
return /* @__PURE__ */
|
|
197
|
+
return /* @__PURE__ */ import_react2.default.createElement(SettingsDialog, {
|
|
201
198
|
selected: settings.values.selected,
|
|
202
199
|
onSelected: (selected) => settings.values.selected = selected
|
|
203
200
|
});
|
|
@@ -253,7 +250,8 @@ var SettingsPlugin = () => {
|
|
|
253
250
|
ns: import_chunk_LZVHLML4.SETTINGS_PLUGIN
|
|
254
251
|
}
|
|
255
252
|
],
|
|
256
|
-
icon:
|
|
253
|
+
icon: (props) => /* @__PURE__ */ import_react2.default.createElement(import_react.Gear, props),
|
|
254
|
+
iconSymbol: "ph--gear--regular",
|
|
257
255
|
keyBinding: {
|
|
258
256
|
macos: "meta+,",
|
|
259
257
|
windows: "alt+,"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/SettingsPlugin.tsx", "../../../src/components/SettingsDialog.tsx", "../../../src/components/SettingsValue.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport {\n type IntentResolverProvides,\n type PluginDefinition,\n type SurfaceProvides,\n parseIntentPlugin,\n resolvePlugin,\n LayoutAction,\n SettingsAction,\n type GraphBuilderProvides,\n type TranslationsProvides,\n} from '@dxos/app-framework';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\n\nimport { SettingsDialog } from './components';\nimport meta, { SETTINGS_PLUGIN } from './meta';\nimport translations from './translations';\n\nconst DEFAULT_PLUGIN = 'dxos.org/plugin/registry';\n\nexport type SettingsPluginProvides = SurfaceProvides &\n IntentResolverProvides &\n GraphBuilderProvides &\n TranslationsProvides;\n\ntype SettingsSettingsProps = {\n selected: string;\n};\n\n/**\n * Plugin for aggregating and rendering plugin settings.\n */\nexport const SettingsPlugin = (): PluginDefinition<SettingsPluginProvides> => {\n const settings = new LocalStorageStore<SettingsSettingsProps>(SETTINGS_PLUGIN, { selected: DEFAULT_PLUGIN });\n\n return {\n meta,\n ready: async () => {\n settings.prop({ key: 'selected', type: LocalStorageStore.string() });\n },\n provides: {\n surface: {\n component: ({ data }) => {\n switch (data.component) {\n case `${SETTINGS_PLUGIN}/Settings`:\n return (\n <SettingsDialog\n selected={settings.values.selected}\n onSelected={(selected) => (settings.values.selected = selected)}\n />\n );\n\n default:\n return null;\n }\n },\n },\n intent: {\n resolver: (intent) => {\n switch (intent.action) {\n case SettingsAction.OPEN: {\n if (intent.data?.plugin) {\n settings.values.selected = intent.data?.plugin;\n }\n\n return {\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: `${SETTINGS_PLUGIN}/Settings`,\n dialogBlockAlign: 'start',\n },\n },\n ],\n ],\n };\n }\n }\n },\n },\n graph: {\n builder: (plugins) => {\n const intentPlugin = resolvePlugin(plugins, parseIntentPlugin);\n\n return createExtension({\n id: SETTINGS_PLUGIN,\n filter: (node): node is Node<null> => node.id === 'root',\n actions: () => [\n {\n id: SETTINGS_PLUGIN,\n data: async () => {\n await intentPlugin?.provides.intent.dispatch({\n plugin: SETTINGS_PLUGIN,\n action: SettingsAction.OPEN,\n });\n },\n properties: {\n label: ['open settings label', { ns: SETTINGS_PLUGIN }],\n icon: 'ph--gear--regular',\n keyBinding: {\n macos: 'meta+,',\n windows: 'alt+,',\n },\n },\n },\n ],\n });\n },\n },\n translations,\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { type Plugin, Surface, usePlugins } from '@dxos/app-framework';\nimport { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';\nimport { Tabs, type TabsActivePart } from '@dxos/react-ui-tabs';\nimport { getSize } from '@dxos/react-ui-theme';\nimport { nonNullable } from '@dxos/util';\n\nimport { SETTINGS_PLUGIN } from '../meta';\n\nexport const SettingsDialog = ({\n selected,\n onSelected,\n}: {\n selected: string;\n onSelected: (plugin: string) => void;\n}) => {\n const { t } = useTranslation(SETTINGS_PLUGIN);\n const { plugins, enabled } = usePlugins();\n\n // TODO(burdon): Factor out common defs?\n const core = [\n 'dxos.org/plugin/layout',\n 'dxos.org/plugin/deck',\n 'dxos.org/plugin/files',\n 'dxos.org/plugin/space',\n 'dxos.org/plugin/stack',\n 'dxos.org/plugin/observability',\n 'dxos.org/plugin/registry',\n ];\n\n const sortPlugin = ({ name: a }: Plugin['meta'], { name: b }: Plugin['meta']) => a?.localeCompare(b ?? '') ?? 0;\n\n const corePlugins = core\n .map((id) => plugins.find((plugin) => plugin.meta.id === id)?.meta)\n .filter(nonNullable)\n .sort(sortPlugin);\n\n const filteredPlugins = enabled\n .filter((id) => !core.includes(id))\n .map((id) => plugins.find((plugin) => plugin.meta.id === id))\n .filter((plugin) => (plugin?.provides as any)?.settings)\n .map((plugin) => plugin!.meta)\n .sort(sortPlugin);\n\n const [tabsActivePart, setTabsActivePart] = useState<TabsActivePart>('list');\n\n return (\n <Dialog.Content classNames='p-0 bs-content max-bs-full md:max-is-[40rem] overflow-hidden'>\n <div role='none' className='flex justify-between mbe-1 pbs-3 pis-2 pie-3 @md:pbs-4 @md:pis-4 @md:pie-5'>\n <Dialog.Title\n onClick={() => setTabsActivePart('list')}\n aria-description={t('click to return to tablist description')}\n classNames='flex cursor-pointer items-center group/title'\n >\n <Icon\n icon='ph--caret-left--regular'\n classNames={['@md:hidden', getSize(4), tabsActivePart === 'list' && 'invisible']}\n />\n <span\n className={\n tabsActivePart !== 'list'\n ? 'group-hover/title:underline @md:group-hover/title:no-underline underline-offset-4 decoration-1'\n : ''\n }\n >\n {t('settings dialog title')}\n </span>\n </Dialog.Title>\n <Dialog.Close asChild>\n <Button density='fine' variant='ghost' autoFocus>\n <Icon icon='ph--x--regular' size={3} />\n </Button>\n </Dialog.Close>\n </div>\n\n <Tabs.Root\n orientation='vertical'\n value={selected}\n onValueChange={(nextSelected) => onSelected(nextSelected)}\n activePart={tabsActivePart}\n onActivePartChange={setTabsActivePart}\n classNames='flex flex-col flex-1 mbs-2'\n >\n <Tabs.Viewport classNames='flex-1 min-bs-0'>\n <div role='none' className='overflow-y-auto pli-3 @md:pis-2 @md:pie-0 mbe-4 border-r border-separator'>\n <Tabs.Tablist classNames='flex flex-col gap-4 max-bs-none overflow-y-visible'>\n <PluginList title='Options' plugins={corePlugins} />\n {filteredPlugins.length > 0 && <PluginList title='Plugins' plugins={filteredPlugins} />}\n </Tabs.Tablist>\n </div>\n\n {corePlugins.map((plugin) => (\n <Tabs.Tabpanel key={plugin.id} value={plugin.id} classNames='pli-3 @md:pli-5 max-bs-dvh overflow-y-auto'>\n <Surface role='settings' data={{ plugin: plugin.id }} />\n </Tabs.Tabpanel>\n ))}\n {filteredPlugins.map((plugin) => (\n <Tabs.Tabpanel key={plugin.id} value={plugin.id} classNames='pli-3 @md:pli-5 max-bs-dvh overflow-y-auto'>\n <Surface role='settings' data={{ plugin: plugin.id }} />\n </Tabs.Tabpanel>\n ))}\n </Tabs.Viewport>\n </Tabs.Root>\n </Dialog.Content>\n );\n};\n\nconst PluginList = ({ title, plugins }: { title: string; plugins: Plugin['meta'][] }) => {\n return (\n <div role='none'>\n <Tabs.TabGroupHeading classNames={'pli-1 mlb-2 mbs-4 @md:mbs-2'}>{title}</Tabs.TabGroupHeading>\n <div className='flex flex-col ml-1'>\n {plugins.map((plugin) => (\n <Tabs.Tab key={plugin.id} value={plugin.id}>\n {plugin.name}\n </Tabs.Tab>\n ))}\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type JSX, type PropsWithChildren } from 'react';\n\nimport { Input } from '@dxos/react-ui';\n\ntype SettingValueProps = {\n label: string;\n description?: JSX.Element;\n secondary?: JSX.Element;\n};\n\nexport const SettingsValue = ({ label, description, secondary, children }: PropsWithChildren<SettingValueProps>) => {\n const primary = (\n <div role='none' className='flex w-full gap-4 py-1'>\n <Input.Root>\n <div role='none' className='flex flex-col w-full'>\n {/* TODO(burdon): Consistent height for controls (e.g., Select, Textbox, and Checkbox are all different). */}\n <Input.Label classNames='flex min-h-[40px] items-center'>{label}</Input.Label>\n {description && (\n <Input.DescriptionAndValidation classNames='mbs-0.5'>\n <Input.Description>{description}</Input.Description>\n </Input.DescriptionAndValidation>\n )}\n </div>\n\n <div role='none'>\n <div role='none' className='flex min-h-[40px] items-center'>\n {children}\n </div>\n </div>\n </Input.Root>\n </div>\n );\n\n if (secondary) {\n // console.log(secondary);\n return (\n <div role='none' className='flex flex-col w-full'>\n {primary}\n {secondary}\n </div>\n );\n }\n\n return primary;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { SETTINGS_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [SETTINGS_PLUGIN]: {\n 'open settings label': 'Show settings',\n 'settings dialog title': 'Settings',\n 'back label': 'Back',\n 'click to return to tablist description': 'Click the title to return to the settings menu',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { SettingsPlugin } from './SettingsPlugin';\n\nexport default SettingsPlugin;\n\nexport * from './SettingsPlugin';\n\n// TODO(wittjosiah): Remove.\n// Settings should be exposed from plugins as state and intents rather than components.\nexport * from './components';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,
|
|
6
|
-
"names": ["import_react", "import_app_framework", "import_react_ui", "SettingsDialog", "selected", "onSelected", "t", "useTranslation", "SETTINGS_PLUGIN", "plugins", "enabled", "usePlugins", "core", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Gear, type IconProps } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport {\n type IntentResolverProvides,\n type PluginDefinition,\n type SurfaceProvides,\n parseIntentPlugin,\n resolvePlugin,\n LayoutAction,\n SettingsAction,\n type GraphBuilderProvides,\n type TranslationsProvides,\n} from '@dxos/app-framework';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\n\nimport { SettingsDialog } from './components';\nimport meta, { SETTINGS_PLUGIN } from './meta';\nimport translations from './translations';\n\nconst DEFAULT_PLUGIN = 'dxos.org/plugin/registry';\n\nexport type SettingsPluginProvides = SurfaceProvides &\n IntentResolverProvides &\n GraphBuilderProvides &\n TranslationsProvides;\n\ntype SettingsSettingsProps = {\n selected: string;\n};\n\n/**\n * Plugin for aggregating and rendering plugin settings.\n */\nexport const SettingsPlugin = (): PluginDefinition<SettingsPluginProvides> => {\n const settings = new LocalStorageStore<SettingsSettingsProps>(SETTINGS_PLUGIN, { selected: DEFAULT_PLUGIN });\n\n return {\n meta,\n ready: async () => {\n settings.prop({ key: 'selected', type: LocalStorageStore.string() });\n },\n provides: {\n surface: {\n component: ({ data }) => {\n switch (data.component) {\n case `${SETTINGS_PLUGIN}/Settings`:\n return (\n <SettingsDialog\n selected={settings.values.selected}\n onSelected={(selected) => (settings.values.selected = selected)}\n />\n );\n\n default:\n return null;\n }\n },\n },\n intent: {\n resolver: (intent) => {\n switch (intent.action) {\n case SettingsAction.OPEN: {\n if (intent.data?.plugin) {\n settings.values.selected = intent.data?.plugin;\n }\n\n return {\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: `${SETTINGS_PLUGIN}/Settings`,\n dialogBlockAlign: 'start',\n },\n },\n ],\n ],\n };\n }\n }\n },\n },\n graph: {\n builder: (plugins) => {\n const intentPlugin = resolvePlugin(plugins, parseIntentPlugin);\n\n return createExtension({\n id: SETTINGS_PLUGIN,\n filter: (node): node is Node<null> => node.id === 'root',\n actions: () => [\n {\n id: SETTINGS_PLUGIN,\n data: async () => {\n await intentPlugin?.provides.intent.dispatch({\n plugin: SETTINGS_PLUGIN,\n action: SettingsAction.OPEN,\n });\n },\n properties: {\n label: ['open settings label', { ns: SETTINGS_PLUGIN }],\n icon: (props: IconProps) => <Gear {...props} />,\n iconSymbol: 'ph--gear--regular',\n keyBinding: {\n macos: 'meta+,',\n windows: 'alt+,',\n },\n },\n },\n ],\n });\n },\n },\n translations,\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { type Plugin, Surface, usePlugins } from '@dxos/app-framework';\nimport { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';\nimport { Tabs, type TabsActivePart } from '@dxos/react-ui-tabs';\nimport { getSize } from '@dxos/react-ui-theme';\nimport { nonNullable } from '@dxos/util';\n\nimport { SETTINGS_PLUGIN } from '../meta';\n\nexport const SettingsDialog = ({\n selected,\n onSelected,\n}: {\n selected: string;\n onSelected: (plugin: string) => void;\n}) => {\n const { t } = useTranslation(SETTINGS_PLUGIN);\n const { plugins, enabled } = usePlugins();\n\n // TODO(burdon): Factor out common defs?\n const core = [\n 'dxos.org/plugin/layout',\n 'dxos.org/plugin/deck',\n 'dxos.org/plugin/files',\n 'dxos.org/plugin/space',\n 'dxos.org/plugin/stack',\n 'dxos.org/plugin/observability',\n 'dxos.org/plugin/registry',\n ];\n\n const corePlugins = core.map((id) => plugins.find((plugin) => plugin.meta.id === id)?.meta).filter(nonNullable);\n\n const filteredPlugins = enabled\n .filter((id) => !core.includes(id))\n .map((id) => plugins.find((plugin) => plugin.meta.id === id))\n .filter((plugin) => (plugin?.provides as any)?.settings)\n .map((plugin) => plugin!.meta)\n .sort(({ name: a }, { name: b }) => a?.localeCompare(b ?? '') ?? 0);\n\n const [tabsActivePart, setTabsActivePart] = useState<TabsActivePart>('list');\n\n return (\n <Dialog.Content classNames='p-0 bs-content max-bs-full md:max-is-[40rem] overflow-hidden'>\n <div role='none' className='flex justify-between mbe-1 pbs-3 pis-2 pie-3 @md:pbs-4 @md:pis-4 @md:pie-5'>\n <Dialog.Title\n onClick={() => setTabsActivePart('list')}\n aria-description={t('click to return to tablist description')}\n classNames='flex cursor-pointer items-center group/title'\n >\n <Icon\n icon='ph--caret-left--regular'\n classNames={['@md:hidden', getSize(4), tabsActivePart === 'list' && 'invisible']}\n />\n <span\n className={\n tabsActivePart !== 'list'\n ? 'group-hover/title:underline @md:group-hover/title:no-underline underline-offset-4 decoration-1'\n : ''\n }\n >\n {t('settings dialog title')}\n </span>\n </Dialog.Title>\n <Dialog.Close asChild>\n <Button density='fine' variant='ghost' autoFocus>\n <Icon icon='ph--x--regular' size={3} />\n </Button>\n </Dialog.Close>\n </div>\n\n <Tabs.Root\n orientation='vertical'\n value={selected}\n onValueChange={(nextSelected) => onSelected(nextSelected)}\n activePart={tabsActivePart}\n onActivePartChange={setTabsActivePart}\n classNames='flex flex-col flex-1 mbs-2'\n >\n <Tabs.Viewport classNames='flex-1 min-bs-0'>\n <div role='none' className='overflow-y-auto pli-3 @md:pis-2 @md:pie-0 mbe-4 border-r border-separator'>\n <Tabs.Tablist classNames='max-bs-none overflow-y-visible'>\n <PluginList title='Options' plugins={corePlugins} />\n {filteredPlugins.length > 0 && <PluginList title='Plugins' plugins={filteredPlugins} gap />}\n </Tabs.Tablist>\n </div>\n\n {corePlugins.map((plugin) => (\n <Tabs.Tabpanel key={plugin.id} value={plugin.id} classNames='pli-3 @md:pli-5 max-bs-dvh overflow-y-auto'>\n <Surface role='settings' data={{ plugin: plugin.id }} />\n </Tabs.Tabpanel>\n ))}\n {filteredPlugins.map((plugin) => (\n <Tabs.Tabpanel key={plugin.id} value={plugin.id} classNames='pli-3 @md:pli-5 max-bs-dvh overflow-y-auto'>\n <Surface role='settings' data={{ plugin: plugin.id }} />\n </Tabs.Tabpanel>\n ))}\n </Tabs.Viewport>\n </Tabs.Root>\n </Dialog.Content>\n );\n};\n\nconst PluginList = ({ title, plugins, gap }: { title: string; plugins: Plugin['meta'][]; gap?: boolean }) => {\n return (\n <>\n <Tabs.TabGroupHeading classNames={gap ? 'mbs-4' : 'mbs-4 @md:mbs-2'}>{title}</Tabs.TabGroupHeading>\n {plugins.map((plugin) => (\n <Tabs.Tab key={plugin.id} value={plugin.id}>\n {plugin.name}\n </Tabs.Tab>\n ))}\n </>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type JSX, type PropsWithChildren } from 'react';\n\nimport { Input } from '@dxos/react-ui';\n\ntype SettingValueProps = {\n label: string;\n description?: JSX.Element;\n secondary?: JSX.Element;\n};\n\nexport const SettingsValue = ({ label, description, secondary, children }: PropsWithChildren<SettingValueProps>) => {\n const primary = (\n <div role='none' className='flex w-full gap-4 py-1'>\n <Input.Root>\n <div role='none' className='flex flex-col w-full'>\n {/* TODO(burdon): Consistent height for controls (e.g., Select, Textbox, and Checkbox are all different). */}\n <Input.Label classNames='flex min-h-[40px] items-center'>{label}</Input.Label>\n {description && (\n <Input.DescriptionAndValidation classNames='mbs-0.5'>\n <Input.Description>{description}</Input.Description>\n </Input.DescriptionAndValidation>\n )}\n </div>\n\n <div role='none'>\n <div role='none' className='flex min-h-[40px] items-center'>\n {children}\n </div>\n </div>\n </Input.Root>\n </div>\n );\n\n if (secondary) {\n // console.log(secondary);\n return (\n <div role='none' className='flex flex-col w-full'>\n {primary}\n {secondary}\n </div>\n );\n }\n\n return primary;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { SETTINGS_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [SETTINGS_PLUGIN]: {\n 'open settings label': 'Show settings',\n 'settings dialog title': 'Settings',\n 'back label': 'Back',\n 'click to return to tablist description': 'Click the title to return to the settings menu',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { SettingsPlugin } from './SettingsPlugin';\n\nexport default SettingsPlugin;\n\nexport * from './SettingsPlugin';\n\n// TODO(wittjosiah): Remove.\n// Settings should be exposed from plugins as state and intents rather than components.\nexport * from './components';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;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ACrB9F,IAAIP;YACJW,QAAQ,CAAC2F,SAA6BA,KAAK/F,OAAO;YAClDgG,SAAS,MAAM;cACb;gBACEhG,IAAIP;gBACJ+D,MAAM,YAAA;AACJ,wBAAMmC,cAAcnF,SAASuE,OAAOkB,SAAS;oBAC3C/F,QAAQT;oBACRwF,QAAQC,oCAAeC;kBACzB,CAAA;gBACF;gBACAe,YAAY;kBACVtC,OAAO;oBAAC;oBAAuB;sBAAEuC,IAAI1G;oBAAgB;;kBACrDoC,MAAM,CAACuE,UAAqBlF,8BAAAA,QAAA,cAACmF,mBAASD,KAAAA;kBACtCE,YAAY;kBACZC,YAAY;oBACVC,OAAO;oBACPC,SAAS;kBACX;gBACF;cACF;;UAEJ,CAAA;QACF;MACF;MACAC,cAAAA;IACF;EACF;AACF;AIrHA,IAAA,cAAepC;",
|
|
6
|
+
"names": ["import_react", "import_app_framework", "import_react_ui", "SettingsDialog", "selected", "onSelected", "t", "useTranslation", "SETTINGS_PLUGIN", "plugins", "enabled", "usePlugins", "core", "corePlugins", "map", "id", "find", "plugin", "meta", "filter", "nonNullable", "filteredPlugins", "includes", "provides", "settings", "sort", "name", "a", "b", "localeCompare", "tabsActivePart", "setTabsActivePart", "useState", "React", "Dialog", "Content", "classNames", "div", "role", "className", "Title", "onClick", "aria-description", "Icon", "icon", "getSize", "span", "Close", "asChild", "Button", "density", "variant", "autoFocus", "size", "Tabs", "Root", "orientation", "value", "onValueChange", "nextSelected", "activePart", "onActivePartChange", "Viewport", "Tablist", "PluginList", "title", "length", "gap", "Tabpanel", "key", "Surface", "data", "TabGroupHeading", "Tab", "SettingsValue", "label", "description", "secondary", "children", "primary", "Input", "Label", "DescriptionAndValidation", "Description", "DEFAULT_PLUGIN", "SettingsPlugin", "LocalStorageStore", "ready", "prop", "type", "string", "surface", "component", "values", "intent", "resolver", "action", "SettingsAction", "OPEN", "intents", "LayoutAction", "SET_LAYOUT", "element", "dialogBlockAlign", "graph", "builder", "intentPlugin", "resolvePlugin", "parseIntentPlugin", "createExtension", "node", "actions", "dispatch", "properties", "ns", "props", "Gear", "iconSymbol", "keyBinding", "macos", "windows", "translations"]
|
|
7
7
|
}
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/plugin-settings/src/meta.ts":{"bytes":778,"imports":[],"format":"esm"},"packages/plugins/plugin-settings/src/components/SettingsDialog.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-settings/src/meta.ts":{"bytes":778,"imports":[],"format":"esm"},"packages/plugins/plugin-settings/src/components/SettingsDialog.tsx":{"bytes":15320,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-tabs","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-settings/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-settings/src/components/SettingsValue.tsx":{"bytes":4471,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-settings/src/components/index.ts":{"bytes":634,"imports":[{"path":"packages/plugins/plugin-settings/src/components/SettingsDialog.tsx","kind":"import-statement","original":"./SettingsDialog"},{"path":"packages/plugins/plugin-settings/src/components/SettingsValue.tsx","kind":"import-statement","original":"./SettingsValue"}],"format":"esm"},"packages/plugins/plugin-settings/src/translations.ts":{"bytes":1571,"imports":[{"path":"packages/plugins/plugin-settings/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-settings/src/SettingsPlugin.tsx":{"bytes":12747,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-settings/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-settings/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-settings/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/plugin-settings/src/index.ts":{"bytes":1216,"imports":[{"path":"packages/plugins/plugin-settings/src/SettingsPlugin.tsx","kind":"import-statement","original":"./SettingsPlugin"},{"path":"packages/plugins/plugin-settings/src/SettingsPlugin.tsx","kind":"import-statement","original":"./SettingsPlugin"},{"path":"packages/plugins/plugin-settings/src/components/index.ts","kind":"import-statement","original":"./components"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-settings/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":16980},"packages/plugins/plugin-settings/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/plugin-settings/dist/lib/node/chunk-LZVHLML4.cjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-tabs","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["SettingsDialog","SettingsPlugin","SettingsValue","default"],"entryPoint":"packages/plugins/plugin-settings/src/index.ts","inputs":{"packages/plugins/plugin-settings/src/SettingsPlugin.tsx":{"bytesInOutput":2968},"packages/plugins/plugin-settings/src/components/SettingsDialog.tsx":{"bytesInOutput":4288},"packages/plugins/plugin-settings/src/components/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-settings/src/components/SettingsValue.tsx":{"bytesInOutput":1125},"packages/plugins/plugin-settings/src/translations.ts":{"bytesInOutput":318},"packages/plugins/plugin-settings/src/index.ts":{"bytesInOutput":34}},"bytes":9300},"packages/plugins/plugin-settings/dist/lib/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-settings/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/plugin-settings/dist/lib/node/chunk-LZVHLML4.cjs","kind":"import-statement"}],"exports":["SETTINGS_PLUGIN","default"],"entryPoint":"packages/plugins/plugin-settings/src/meta.ts","inputs":{},"bytes":165},"packages/plugins/plugin-settings/dist/lib/node/chunk-LZVHLML4.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":338},"packages/plugins/plugin-settings/dist/lib/node/chunk-LZVHLML4.cjs":{"imports":[],"exports":["SETTINGS_PLUGIN","meta_default"],"inputs":{"packages/plugins/plugin-settings/src/meta.ts":{"bytesInOutput":96}},"bytes":235}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsPlugin.d.ts","sourceRoot":"","sources":["../../../src/SettingsPlugin.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SettingsPlugin.d.ts","sourceRoot":"","sources":["../../../src/SettingsPlugin.tsx"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,eAAe,EAKpB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;AAU7B,MAAM,MAAM,sBAAsB,GAAG,eAAe,GAClD,sBAAsB,GACtB,oBAAoB,GACpB,oBAAoB,CAAC;AAMvB;;GAEG;AACH,eAAO,MAAM,cAAc,QAAO,gBAAgB,CAAC,sBAAsB,CAoFxE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/SettingsDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAUxC,eAAO,MAAM,cAAc,8BAGxB;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,
|
|
1
|
+
{"version":3,"file":"SettingsDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/SettingsDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAUxC,eAAO,MAAM,cAAc,8BAGxB;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,sBAqFA,CAAC"}
|
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.12",
|
|
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,16 +10,14 @@
|
|
|
10
10
|
".": {
|
|
11
11
|
"browser": "./dist/lib/browser/index.mjs",
|
|
12
12
|
"node": {
|
|
13
|
-
"
|
|
14
|
-
"default": "./dist/lib/node-esm/index.mjs"
|
|
13
|
+
"default": "./dist/lib/node/index.cjs"
|
|
15
14
|
},
|
|
16
15
|
"types": "./dist/types/src/index.d.ts"
|
|
17
16
|
},
|
|
18
17
|
"./meta": {
|
|
19
18
|
"browser": "./dist/lib/browser/meta.mjs",
|
|
20
19
|
"node": {
|
|
21
|
-
"
|
|
22
|
-
"default": "./dist/lib/node-esm/meta.mjs"
|
|
20
|
+
"default": "./dist/lib/node/meta.cjs"
|
|
23
21
|
},
|
|
24
22
|
"types": "./dist/types/src/meta.d.ts"
|
|
25
23
|
}
|
|
@@ -37,26 +35,26 @@
|
|
|
37
35
|
"src"
|
|
38
36
|
],
|
|
39
37
|
"dependencies": {
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/plugin-graph": "0.6.12
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
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"
|
|
45
43
|
},
|
|
46
44
|
"devDependencies": {
|
|
47
45
|
"@phosphor-icons/react": "^2.1.5",
|
|
48
46
|
"@types/react": "~18.2.0",
|
|
49
47
|
"react": "~18.2.0",
|
|
50
|
-
"vite": "5.4
|
|
51
|
-
"@dxos/react-ui": "0.6.12
|
|
52
|
-
"@dxos/react-ui-theme": "0.6.12
|
|
53
|
-
"@dxos/storybook-utils": "0.6.12
|
|
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"
|
|
54
52
|
},
|
|
55
53
|
"peerDependencies": {
|
|
56
54
|
"@phosphor-icons/react": "^2.1.5",
|
|
57
55
|
"react": "~18.2.0",
|
|
58
|
-
"@dxos/react-ui": "0.6.12
|
|
59
|
-
"@dxos/react-ui-theme": "0.6.12
|
|
56
|
+
"@dxos/react-ui": "0.6.12",
|
|
57
|
+
"@dxos/react-ui-theme": "0.6.12"
|
|
60
58
|
},
|
|
61
59
|
"publishConfig": {
|
|
62
60
|
"access": "public"
|
package/src/SettingsPlugin.tsx
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Gear, type IconProps } from '@phosphor-icons/react';
|
|
5
6
|
import React from 'react';
|
|
6
7
|
|
|
7
8
|
import {
|
|
@@ -105,7 +106,8 @@ export const SettingsPlugin = (): PluginDefinition<SettingsPluginProvides> => {
|
|
|
105
106
|
},
|
|
106
107
|
properties: {
|
|
107
108
|
label: ['open settings label', { ns: SETTINGS_PLUGIN }],
|
|
108
|
-
icon:
|
|
109
|
+
icon: (props: IconProps) => <Gear {...props} />,
|
|
110
|
+
iconSymbol: 'ph--gear--regular',
|
|
109
111
|
keyBinding: {
|
|
110
112
|
macos: 'meta+,',
|
|
111
113
|
windows: 'alt+,',
|
|
@@ -33,19 +33,14 @@ export const SettingsDialog = ({
|
|
|
33
33
|
'dxos.org/plugin/registry',
|
|
34
34
|
];
|
|
35
35
|
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const corePlugins = core
|
|
39
|
-
.map((id) => plugins.find((plugin) => plugin.meta.id === id)?.meta)
|
|
40
|
-
.filter(nonNullable)
|
|
41
|
-
.sort(sortPlugin);
|
|
36
|
+
const corePlugins = core.map((id) => plugins.find((plugin) => plugin.meta.id === id)?.meta).filter(nonNullable);
|
|
42
37
|
|
|
43
38
|
const filteredPlugins = enabled
|
|
44
39
|
.filter((id) => !core.includes(id))
|
|
45
40
|
.map((id) => plugins.find((plugin) => plugin.meta.id === id))
|
|
46
41
|
.filter((plugin) => (plugin?.provides as any)?.settings)
|
|
47
42
|
.map((plugin) => plugin!.meta)
|
|
48
|
-
.sort(
|
|
43
|
+
.sort(({ name: a }, { name: b }) => a?.localeCompare(b ?? '') ?? 0);
|
|
49
44
|
|
|
50
45
|
const [tabsActivePart, setTabsActivePart] = useState<TabsActivePart>('list');
|
|
51
46
|
|
|
@@ -88,9 +83,9 @@ export const SettingsDialog = ({
|
|
|
88
83
|
>
|
|
89
84
|
<Tabs.Viewport classNames='flex-1 min-bs-0'>
|
|
90
85
|
<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='
|
|
86
|
+
<Tabs.Tablist classNames='max-bs-none overflow-y-visible'>
|
|
92
87
|
<PluginList title='Options' plugins={corePlugins} />
|
|
93
|
-
{filteredPlugins.length > 0 && <PluginList title='Plugins' plugins={filteredPlugins} />}
|
|
88
|
+
{filteredPlugins.length > 0 && <PluginList title='Plugins' plugins={filteredPlugins} gap />}
|
|
94
89
|
</Tabs.Tablist>
|
|
95
90
|
</div>
|
|
96
91
|
|
|
@@ -110,17 +105,15 @@ export const SettingsDialog = ({
|
|
|
110
105
|
);
|
|
111
106
|
};
|
|
112
107
|
|
|
113
|
-
const PluginList = ({ title, plugins }: { title: string; plugins: Plugin['meta'][] }) => {
|
|
108
|
+
const PluginList = ({ title, plugins, gap }: { title: string; plugins: Plugin['meta'][]; gap?: boolean }) => {
|
|
114
109
|
return (
|
|
115
|
-
|
|
116
|
-
<Tabs.TabGroupHeading classNames={'
|
|
117
|
-
|
|
118
|
-
{
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
</div>
|
|
124
|
-
</div>
|
|
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
|
+
</>
|
|
125
118
|
);
|
|
126
119
|
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// packages/plugins/plugin-settings/src/meta.ts
|
|
4
|
-
var SETTINGS_PLUGIN = "dxos.org/plugin/settings";
|
|
5
|
-
var meta_default = {
|
|
6
|
-
id: SETTINGS_PLUGIN
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export {
|
|
10
|
-
SETTINGS_PLUGIN,
|
|
11
|
-
meta_default
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=chunk-CHPB3YX5.mjs.map
|
|
@@ -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,258 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
SETTINGS_PLUGIN,
|
|
4
|
-
meta_default
|
|
5
|
-
} from "./chunk-CHPB3YX5.mjs";
|
|
6
|
-
|
|
7
|
-
// packages/plugins/plugin-settings/src/SettingsPlugin.tsx
|
|
8
|
-
import React3 from "react";
|
|
9
|
-
import { parseIntentPlugin, resolvePlugin, LayoutAction, SettingsAction } from "@dxos/app-framework";
|
|
10
|
-
import { LocalStorageStore } from "@dxos/local-storage";
|
|
11
|
-
import { createExtension } from "@dxos/plugin-graph";
|
|
12
|
-
|
|
13
|
-
// packages/plugins/plugin-settings/src/components/SettingsDialog.tsx
|
|
14
|
-
import React, { useState } from "react";
|
|
15
|
-
import { Surface, usePlugins } from "@dxos/app-framework";
|
|
16
|
-
import { Button, Dialog, Icon, useTranslation } from "@dxos/react-ui";
|
|
17
|
-
import { Tabs } from "@dxos/react-ui-tabs";
|
|
18
|
-
import { getSize } from "@dxos/react-ui-theme";
|
|
19
|
-
import { nonNullable } from "@dxos/util";
|
|
20
|
-
var SettingsDialog = ({ selected, onSelected }) => {
|
|
21
|
-
const { t } = useTranslation(SETTINGS_PLUGIN);
|
|
22
|
-
const { plugins, enabled } = usePlugins();
|
|
23
|
-
const core = [
|
|
24
|
-
"dxos.org/plugin/layout",
|
|
25
|
-
"dxos.org/plugin/deck",
|
|
26
|
-
"dxos.org/plugin/files",
|
|
27
|
-
"dxos.org/plugin/space",
|
|
28
|
-
"dxos.org/plugin/stack",
|
|
29
|
-
"dxos.org/plugin/observability",
|
|
30
|
-
"dxos.org/plugin/registry"
|
|
31
|
-
];
|
|
32
|
-
const sortPlugin = ({ name: a }, { name: b }) => a?.localeCompare(b ?? "") ?? 0;
|
|
33
|
-
const corePlugins = core.map((id) => plugins.find((plugin) => plugin.meta.id === id)?.meta).filter(nonNullable).sort(sortPlugin);
|
|
34
|
-
const filteredPlugins = enabled.filter((id) => !core.includes(id)).map((id) => plugins.find((plugin) => plugin.meta.id === id)).filter((plugin) => plugin?.provides?.settings).map((plugin) => plugin.meta).sort(sortPlugin);
|
|
35
|
-
const [tabsActivePart, setTabsActivePart] = useState("list");
|
|
36
|
-
return /* @__PURE__ */ React.createElement(Dialog.Content, {
|
|
37
|
-
classNames: "p-0 bs-content max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
38
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
39
|
-
role: "none",
|
|
40
|
-
className: "flex justify-between mbe-1 pbs-3 pis-2 pie-3 @md:pbs-4 @md:pis-4 @md:pie-5"
|
|
41
|
-
}, /* @__PURE__ */ React.createElement(Dialog.Title, {
|
|
42
|
-
onClick: () => setTabsActivePart("list"),
|
|
43
|
-
"aria-description": t("click to return to tablist description"),
|
|
44
|
-
classNames: "flex cursor-pointer items-center group/title"
|
|
45
|
-
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
46
|
-
icon: "ph--caret-left--regular",
|
|
47
|
-
classNames: [
|
|
48
|
-
"@md:hidden",
|
|
49
|
-
getSize(4),
|
|
50
|
-
tabsActivePart === "list" && "invisible"
|
|
51
|
-
]
|
|
52
|
-
}), /* @__PURE__ */ React.createElement("span", {
|
|
53
|
-
className: tabsActivePart !== "list" ? "group-hover/title:underline @md:group-hover/title:no-underline underline-offset-4 decoration-1" : ""
|
|
54
|
-
}, t("settings dialog title"))), /* @__PURE__ */ React.createElement(Dialog.Close, {
|
|
55
|
-
asChild: true
|
|
56
|
-
}, /* @__PURE__ */ React.createElement(Button, {
|
|
57
|
-
density: "fine",
|
|
58
|
-
variant: "ghost",
|
|
59
|
-
autoFocus: true
|
|
60
|
-
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
61
|
-
icon: "ph--x--regular",
|
|
62
|
-
size: 3
|
|
63
|
-
})))), /* @__PURE__ */ React.createElement(Tabs.Root, {
|
|
64
|
-
orientation: "vertical",
|
|
65
|
-
value: selected,
|
|
66
|
-
onValueChange: (nextSelected) => onSelected(nextSelected),
|
|
67
|
-
activePart: tabsActivePart,
|
|
68
|
-
onActivePartChange: setTabsActivePart,
|
|
69
|
-
classNames: "flex flex-col flex-1 mbs-2"
|
|
70
|
-
}, /* @__PURE__ */ React.createElement(Tabs.Viewport, {
|
|
71
|
-
classNames: "flex-1 min-bs-0"
|
|
72
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
73
|
-
role: "none",
|
|
74
|
-
className: "overflow-y-auto pli-3 @md:pis-2 @md:pie-0 mbe-4 border-r border-separator"
|
|
75
|
-
}, /* @__PURE__ */ React.createElement(Tabs.Tablist, {
|
|
76
|
-
classNames: "flex flex-col gap-4 max-bs-none overflow-y-visible"
|
|
77
|
-
}, /* @__PURE__ */ React.createElement(PluginList, {
|
|
78
|
-
title: "Options",
|
|
79
|
-
plugins: corePlugins
|
|
80
|
-
}), filteredPlugins.length > 0 && /* @__PURE__ */ React.createElement(PluginList, {
|
|
81
|
-
title: "Plugins",
|
|
82
|
-
plugins: filteredPlugins
|
|
83
|
-
}))), corePlugins.map((plugin) => /* @__PURE__ */ React.createElement(Tabs.Tabpanel, {
|
|
84
|
-
key: plugin.id,
|
|
85
|
-
value: plugin.id,
|
|
86
|
-
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
87
|
-
}, /* @__PURE__ */ React.createElement(Surface, {
|
|
88
|
-
role: "settings",
|
|
89
|
-
data: {
|
|
90
|
-
plugin: plugin.id
|
|
91
|
-
}
|
|
92
|
-
}))), filteredPlugins.map((plugin) => /* @__PURE__ */ React.createElement(Tabs.Tabpanel, {
|
|
93
|
-
key: plugin.id,
|
|
94
|
-
value: plugin.id,
|
|
95
|
-
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
96
|
-
}, /* @__PURE__ */ React.createElement(Surface, {
|
|
97
|
-
role: "settings",
|
|
98
|
-
data: {
|
|
99
|
-
plugin: plugin.id
|
|
100
|
-
}
|
|
101
|
-
}))))));
|
|
102
|
-
};
|
|
103
|
-
var PluginList = ({ title, plugins }) => {
|
|
104
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
105
|
-
role: "none"
|
|
106
|
-
}, /* @__PURE__ */ React.createElement(Tabs.TabGroupHeading, {
|
|
107
|
-
classNames: "pli-1 mlb-2 mbs-4 @md:mbs-2"
|
|
108
|
-
}, title), /* @__PURE__ */ React.createElement("div", {
|
|
109
|
-
className: "flex flex-col ml-1"
|
|
110
|
-
}, plugins.map((plugin) => /* @__PURE__ */ React.createElement(Tabs.Tab, {
|
|
111
|
-
key: plugin.id,
|
|
112
|
-
value: plugin.id
|
|
113
|
-
}, plugin.name))));
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
// packages/plugins/plugin-settings/src/components/SettingsValue.tsx
|
|
117
|
-
import React2 from "react";
|
|
118
|
-
import { Input } from "@dxos/react-ui";
|
|
119
|
-
var SettingsValue = ({ label, description, secondary, children }) => {
|
|
120
|
-
const primary = /* @__PURE__ */ React2.createElement("div", {
|
|
121
|
-
role: "none",
|
|
122
|
-
className: "flex w-full gap-4 py-1"
|
|
123
|
-
}, /* @__PURE__ */ React2.createElement(Input.Root, null, /* @__PURE__ */ React2.createElement("div", {
|
|
124
|
-
role: "none",
|
|
125
|
-
className: "flex flex-col w-full"
|
|
126
|
-
}, /* @__PURE__ */ React2.createElement(Input.Label, {
|
|
127
|
-
classNames: "flex min-h-[40px] items-center"
|
|
128
|
-
}, label), description && /* @__PURE__ */ React2.createElement(Input.DescriptionAndValidation, {
|
|
129
|
-
classNames: "mbs-0.5"
|
|
130
|
-
}, /* @__PURE__ */ React2.createElement(Input.Description, null, description))), /* @__PURE__ */ React2.createElement("div", {
|
|
131
|
-
role: "none"
|
|
132
|
-
}, /* @__PURE__ */ React2.createElement("div", {
|
|
133
|
-
role: "none",
|
|
134
|
-
className: "flex min-h-[40px] items-center"
|
|
135
|
-
}, children))));
|
|
136
|
-
if (secondary) {
|
|
137
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
138
|
-
role: "none",
|
|
139
|
-
className: "flex flex-col w-full"
|
|
140
|
-
}, primary, secondary);
|
|
141
|
-
}
|
|
142
|
-
return primary;
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
// packages/plugins/plugin-settings/src/translations.ts
|
|
146
|
-
var translations_default = [
|
|
147
|
-
{
|
|
148
|
-
"en-US": {
|
|
149
|
-
[SETTINGS_PLUGIN]: {
|
|
150
|
-
"open settings label": "Show settings",
|
|
151
|
-
"settings dialog title": "Settings",
|
|
152
|
-
"back label": "Back",
|
|
153
|
-
"click to return to tablist description": "Click the title to return to the settings menu"
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
];
|
|
158
|
-
|
|
159
|
-
// packages/plugins/plugin-settings/src/SettingsPlugin.tsx
|
|
160
|
-
var DEFAULT_PLUGIN = "dxos.org/plugin/registry";
|
|
161
|
-
var SettingsPlugin = () => {
|
|
162
|
-
const settings = new LocalStorageStore(SETTINGS_PLUGIN, {
|
|
163
|
-
selected: DEFAULT_PLUGIN
|
|
164
|
-
});
|
|
165
|
-
return {
|
|
166
|
-
meta: meta_default,
|
|
167
|
-
ready: async () => {
|
|
168
|
-
settings.prop({
|
|
169
|
-
key: "selected",
|
|
170
|
-
type: LocalStorageStore.string()
|
|
171
|
-
});
|
|
172
|
-
},
|
|
173
|
-
provides: {
|
|
174
|
-
surface: {
|
|
175
|
-
component: ({ data }) => {
|
|
176
|
-
switch (data.component) {
|
|
177
|
-
case `${SETTINGS_PLUGIN}/Settings`:
|
|
178
|
-
return /* @__PURE__ */ React3.createElement(SettingsDialog, {
|
|
179
|
-
selected: settings.values.selected,
|
|
180
|
-
onSelected: (selected) => settings.values.selected = selected
|
|
181
|
-
});
|
|
182
|
-
default:
|
|
183
|
-
return null;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
intent: {
|
|
188
|
-
resolver: (intent) => {
|
|
189
|
-
switch (intent.action) {
|
|
190
|
-
case SettingsAction.OPEN: {
|
|
191
|
-
if (intent.data?.plugin) {
|
|
192
|
-
settings.values.selected = intent.data?.plugin;
|
|
193
|
-
}
|
|
194
|
-
return {
|
|
195
|
-
intents: [
|
|
196
|
-
[
|
|
197
|
-
{
|
|
198
|
-
action: LayoutAction.SET_LAYOUT,
|
|
199
|
-
data: {
|
|
200
|
-
element: "dialog",
|
|
201
|
-
component: `${SETTINGS_PLUGIN}/Settings`,
|
|
202
|
-
dialogBlockAlign: "start"
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
]
|
|
206
|
-
]
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
graph: {
|
|
213
|
-
builder: (plugins) => {
|
|
214
|
-
const intentPlugin = resolvePlugin(plugins, parseIntentPlugin);
|
|
215
|
-
return createExtension({
|
|
216
|
-
id: SETTINGS_PLUGIN,
|
|
217
|
-
filter: (node) => node.id === "root",
|
|
218
|
-
actions: () => [
|
|
219
|
-
{
|
|
220
|
-
id: SETTINGS_PLUGIN,
|
|
221
|
-
data: async () => {
|
|
222
|
-
await intentPlugin?.provides.intent.dispatch({
|
|
223
|
-
plugin: SETTINGS_PLUGIN,
|
|
224
|
-
action: SettingsAction.OPEN
|
|
225
|
-
});
|
|
226
|
-
},
|
|
227
|
-
properties: {
|
|
228
|
-
label: [
|
|
229
|
-
"open settings label",
|
|
230
|
-
{
|
|
231
|
-
ns: SETTINGS_PLUGIN
|
|
232
|
-
}
|
|
233
|
-
],
|
|
234
|
-
icon: "ph--gear--regular",
|
|
235
|
-
keyBinding: {
|
|
236
|
-
macos: "meta+,",
|
|
237
|
-
windows: "alt+,"
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
]
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
},
|
|
245
|
-
translations: translations_default
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
// packages/plugins/plugin-settings/src/index.ts
|
|
251
|
-
var src_default = SettingsPlugin;
|
|
252
|
-
export {
|
|
253
|
-
SettingsDialog,
|
|
254
|
-
SettingsPlugin,
|
|
255
|
-
SettingsValue,
|
|
256
|
-
src_default as default
|
|
257
|
-
};
|
|
258
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/SettingsPlugin.tsx", "../../../src/components/SettingsDialog.tsx", "../../../src/components/SettingsValue.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport {\n type IntentResolverProvides,\n type PluginDefinition,\n type SurfaceProvides,\n parseIntentPlugin,\n resolvePlugin,\n LayoutAction,\n SettingsAction,\n type GraphBuilderProvides,\n type TranslationsProvides,\n} from '@dxos/app-framework';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\n\nimport { SettingsDialog } from './components';\nimport meta, { SETTINGS_PLUGIN } from './meta';\nimport translations from './translations';\n\nconst DEFAULT_PLUGIN = 'dxos.org/plugin/registry';\n\nexport type SettingsPluginProvides = SurfaceProvides &\n IntentResolverProvides &\n GraphBuilderProvides &\n TranslationsProvides;\n\ntype SettingsSettingsProps = {\n selected: string;\n};\n\n/**\n * Plugin for aggregating and rendering plugin settings.\n */\nexport const SettingsPlugin = (): PluginDefinition<SettingsPluginProvides> => {\n const settings = new LocalStorageStore<SettingsSettingsProps>(SETTINGS_PLUGIN, { selected: DEFAULT_PLUGIN });\n\n return {\n meta,\n ready: async () => {\n settings.prop({ key: 'selected', type: LocalStorageStore.string() });\n },\n provides: {\n surface: {\n component: ({ data }) => {\n switch (data.component) {\n case `${SETTINGS_PLUGIN}/Settings`:\n return (\n <SettingsDialog\n selected={settings.values.selected}\n onSelected={(selected) => (settings.values.selected = selected)}\n />\n );\n\n default:\n return null;\n }\n },\n },\n intent: {\n resolver: (intent) => {\n switch (intent.action) {\n case SettingsAction.OPEN: {\n if (intent.data?.plugin) {\n settings.values.selected = intent.data?.plugin;\n }\n\n return {\n intents: [\n [\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: `${SETTINGS_PLUGIN}/Settings`,\n dialogBlockAlign: 'start',\n },\n },\n ],\n ],\n };\n }\n }\n },\n },\n graph: {\n builder: (plugins) => {\n const intentPlugin = resolvePlugin(plugins, parseIntentPlugin);\n\n return createExtension({\n id: SETTINGS_PLUGIN,\n filter: (node): node is Node<null> => node.id === 'root',\n actions: () => [\n {\n id: SETTINGS_PLUGIN,\n data: async () => {\n await intentPlugin?.provides.intent.dispatch({\n plugin: SETTINGS_PLUGIN,\n action: SettingsAction.OPEN,\n });\n },\n properties: {\n label: ['open settings label', { ns: SETTINGS_PLUGIN }],\n icon: 'ph--gear--regular',\n keyBinding: {\n macos: 'meta+,',\n windows: 'alt+,',\n },\n },\n },\n ],\n });\n },\n },\n translations,\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { type Plugin, Surface, usePlugins } from '@dxos/app-framework';\nimport { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';\nimport { Tabs, type TabsActivePart } from '@dxos/react-ui-tabs';\nimport { getSize } from '@dxos/react-ui-theme';\nimport { nonNullable } from '@dxos/util';\n\nimport { SETTINGS_PLUGIN } from '../meta';\n\nexport const SettingsDialog = ({\n selected,\n onSelected,\n}: {\n selected: string;\n onSelected: (plugin: string) => void;\n}) => {\n const { t } = useTranslation(SETTINGS_PLUGIN);\n const { plugins, enabled } = usePlugins();\n\n // TODO(burdon): Factor out common defs?\n const core = [\n 'dxos.org/plugin/layout',\n 'dxos.org/plugin/deck',\n 'dxos.org/plugin/files',\n 'dxos.org/plugin/space',\n 'dxos.org/plugin/stack',\n 'dxos.org/plugin/observability',\n 'dxos.org/plugin/registry',\n ];\n\n const sortPlugin = ({ name: a }: Plugin['meta'], { name: b }: Plugin['meta']) => a?.localeCompare(b ?? '') ?? 0;\n\n const corePlugins = core\n .map((id) => plugins.find((plugin) => plugin.meta.id === id)?.meta)\n .filter(nonNullable)\n .sort(sortPlugin);\n\n const filteredPlugins = enabled\n .filter((id) => !core.includes(id))\n .map((id) => plugins.find((plugin) => plugin.meta.id === id))\n .filter((plugin) => (plugin?.provides as any)?.settings)\n .map((plugin) => plugin!.meta)\n .sort(sortPlugin);\n\n const [tabsActivePart, setTabsActivePart] = useState<TabsActivePart>('list');\n\n return (\n <Dialog.Content classNames='p-0 bs-content max-bs-full md:max-is-[40rem] overflow-hidden'>\n <div role='none' className='flex justify-between mbe-1 pbs-3 pis-2 pie-3 @md:pbs-4 @md:pis-4 @md:pie-5'>\n <Dialog.Title\n onClick={() => setTabsActivePart('list')}\n aria-description={t('click to return to tablist description')}\n classNames='flex cursor-pointer items-center group/title'\n >\n <Icon\n icon='ph--caret-left--regular'\n classNames={['@md:hidden', getSize(4), tabsActivePart === 'list' && 'invisible']}\n />\n <span\n className={\n tabsActivePart !== 'list'\n ? 'group-hover/title:underline @md:group-hover/title:no-underline underline-offset-4 decoration-1'\n : ''\n }\n >\n {t('settings dialog title')}\n </span>\n </Dialog.Title>\n <Dialog.Close asChild>\n <Button density='fine' variant='ghost' autoFocus>\n <Icon icon='ph--x--regular' size={3} />\n </Button>\n </Dialog.Close>\n </div>\n\n <Tabs.Root\n orientation='vertical'\n value={selected}\n onValueChange={(nextSelected) => onSelected(nextSelected)}\n activePart={tabsActivePart}\n onActivePartChange={setTabsActivePart}\n classNames='flex flex-col flex-1 mbs-2'\n >\n <Tabs.Viewport classNames='flex-1 min-bs-0'>\n <div role='none' className='overflow-y-auto pli-3 @md:pis-2 @md:pie-0 mbe-4 border-r border-separator'>\n <Tabs.Tablist classNames='flex flex-col gap-4 max-bs-none overflow-y-visible'>\n <PluginList title='Options' plugins={corePlugins} />\n {filteredPlugins.length > 0 && <PluginList title='Plugins' plugins={filteredPlugins} />}\n </Tabs.Tablist>\n </div>\n\n {corePlugins.map((plugin) => (\n <Tabs.Tabpanel key={plugin.id} value={plugin.id} classNames='pli-3 @md:pli-5 max-bs-dvh overflow-y-auto'>\n <Surface role='settings' data={{ plugin: plugin.id }} />\n </Tabs.Tabpanel>\n ))}\n {filteredPlugins.map((plugin) => (\n <Tabs.Tabpanel key={plugin.id} value={plugin.id} classNames='pli-3 @md:pli-5 max-bs-dvh overflow-y-auto'>\n <Surface role='settings' data={{ plugin: plugin.id }} />\n </Tabs.Tabpanel>\n ))}\n </Tabs.Viewport>\n </Tabs.Root>\n </Dialog.Content>\n );\n};\n\nconst PluginList = ({ title, plugins }: { title: string; plugins: Plugin['meta'][] }) => {\n return (\n <div role='none'>\n <Tabs.TabGroupHeading classNames={'pli-1 mlb-2 mbs-4 @md:mbs-2'}>{title}</Tabs.TabGroupHeading>\n <div className='flex flex-col ml-1'>\n {plugins.map((plugin) => (\n <Tabs.Tab key={plugin.id} value={plugin.id}>\n {plugin.name}\n </Tabs.Tab>\n ))}\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type JSX, type PropsWithChildren } from 'react';\n\nimport { Input } from '@dxos/react-ui';\n\ntype SettingValueProps = {\n label: string;\n description?: JSX.Element;\n secondary?: JSX.Element;\n};\n\nexport const SettingsValue = ({ label, description, secondary, children }: PropsWithChildren<SettingValueProps>) => {\n const primary = (\n <div role='none' className='flex w-full gap-4 py-1'>\n <Input.Root>\n <div role='none' className='flex flex-col w-full'>\n {/* TODO(burdon): Consistent height for controls (e.g., Select, Textbox, and Checkbox are all different). */}\n <Input.Label classNames='flex min-h-[40px] items-center'>{label}</Input.Label>\n {description && (\n <Input.DescriptionAndValidation classNames='mbs-0.5'>\n <Input.Description>{description}</Input.Description>\n </Input.DescriptionAndValidation>\n )}\n </div>\n\n <div role='none'>\n <div role='none' className='flex min-h-[40px] items-center'>\n {children}\n </div>\n </div>\n </Input.Root>\n </div>\n );\n\n if (secondary) {\n // console.log(secondary);\n return (\n <div role='none' className='flex flex-col w-full'>\n {primary}\n {secondary}\n </div>\n );\n }\n\n return primary;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { SETTINGS_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [SETTINGS_PLUGIN]: {\n 'open settings label': 'Show settings',\n 'settings dialog title': 'Settings',\n 'back label': 'Back',\n 'click to return to tablist description': 'Click the title to return to the settings menu',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { SettingsPlugin } from './SettingsPlugin';\n\nexport default SettingsPlugin;\n\nexport * from './SettingsPlugin';\n\n// TODO(wittjosiah): Remove.\n// Settings should be exposed from plugins as state and intents rather than components.\nexport * from './components';\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,OAAOA,YAAW;AAElB,SAIEC,mBACAC,eACAC,cACAC,sBAGK;AACP,SAASC,yBAAyB;AAClC,S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AC;oBAAuB;sBAAEC,IAAIzC;oBAAgB;;kBACrD0C,MAAM;kBACNC,YAAY;oBACVC,OAAO;oBACPC,SAAS;kBACX;gBACF;cACF;;UAEJ,CAAA;QACF;MACF;MACAC;IACF;EACF;AACF;;;AInHA,IAAA,cAAeC;",
|
|
6
|
-
"names": ["React", "parseIntentPlugin", "resolvePlugin", "LayoutAction", "SettingsAction", "LocalStorageStore", "createExtension", "React", "useState", "Surface", "usePlugins", "Button", "Dialog", "Icon", "useTranslation", "Tabs", "getSize", "nonNullable", "SettingsDialog", "selected", "onSelected", "t", "useTranslation", "SETTINGS_PLUGIN", "plugins", "enabled", "usePlugins", "core", "sortPlugin", "name", "a", "b", "localeCompare", "corePlugins", "map", "id", "find", "plugin", "meta", "filter", "nonNullable", "sort", "filteredPlugins", "includes", "provides", "settings", "tabsActivePart", "setTabsActivePart", "useState", "Dialog", "Content", "classNames", "div", "role", "className", "Title", "onClick", "aria-description", "Icon", "icon", "getSize", "span", "Close", "asChild", "Button", "density", "variant", "autoFocus", "size", "Tabs", "Root", "orientation", "value", "onValueChange", "nextSelected", "activePart", "onActivePartChange", "Viewport", "Tablist", "PluginList", "title", "length", "Tabpanel", "key", "Surface", "data", "TabGroupHeading", "Tab", "React", "Input", "SettingsValue", "label", "description", "secondary", "children", "primary", "React", "div", "role", "className", "Input", "Root", "Label", "classNames", "DescriptionAndValidation", "Description", "SETTINGS_PLUGIN", "DEFAULT_PLUGIN", "SettingsPlugin", "settings", "LocalStorageStore", "SETTINGS_PLUGIN", "selected", "meta", "ready", "prop", "key", "type", "string", "provides", "surface", "component", "data", "React", "SettingsDialog", "values", "onSelected", "intent", "resolver", "action", "SettingsAction", "OPEN", "plugin", "intents", "LayoutAction", "SET_LAYOUT", "element", "dialogBlockAlign", "graph", "builder", "plugins", "intentPlugin", "resolvePlugin", "parseIntentPlugin", "createExtension", "id", "filter", "node", "actions", "dispatch", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "translations", "SettingsPlugin"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/plugin-settings/src/meta.ts":{"bytes":778,"imports":[],"format":"esm"},"packages/plugins/plugin-settings/src/components/SettingsDialog.tsx":{"bytes":15790,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-tabs","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-settings/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-settings/src/components/SettingsValue.tsx":{"bytes":4471,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-settings/src/components/index.ts":{"bytes":634,"imports":[{"path":"packages/plugins/plugin-settings/src/components/SettingsDialog.tsx","kind":"import-statement","original":"./SettingsDialog"},{"path":"packages/plugins/plugin-settings/src/components/SettingsValue.tsx","kind":"import-statement","original":"./SettingsValue"}],"format":"esm"},"packages/plugins/plugin-settings/src/translations.ts":{"bytes":1571,"imports":[{"path":"packages/plugins/plugin-settings/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-settings/src/SettingsPlugin.tsx":{"bytes":12272,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-settings/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-settings/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-settings/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/plugin-settings/src/index.ts":{"bytes":1216,"imports":[{"path":"packages/plugins/plugin-settings/src/SettingsPlugin.tsx","kind":"import-statement","original":"./SettingsPlugin"},{"path":"packages/plugins/plugin-settings/src/SettingsPlugin.tsx","kind":"import-statement","original":"./SettingsPlugin"},{"path":"packages/plugins/plugin-settings/src/components/index.ts","kind":"import-statement","original":"./components"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-settings/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":16978},"packages/plugins/plugin-settings/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/plugin-settings/dist/lib/node-esm/chunk-CHPB3YX5.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-tabs","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["SettingsDialog","SettingsPlugin","SettingsValue","default"],"entryPoint":"packages/plugins/plugin-settings/src/index.ts","inputs":{"packages/plugins/plugin-settings/src/SettingsPlugin.tsx":{"bytesInOutput":2830},"packages/plugins/plugin-settings/src/components/SettingsDialog.tsx":{"bytesInOutput":4430},"packages/plugins/plugin-settings/src/components/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-settings/src/components/SettingsValue.tsx":{"bytesInOutput":1125},"packages/plugins/plugin-settings/src/translations.ts":{"bytesInOutput":318},"packages/plugins/plugin-settings/src/index.ts":{"bytesInOutput":34}},"bytes":9396},"packages/plugins/plugin-settings/dist/lib/node-esm/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-settings/dist/lib/node-esm/meta.mjs":{"imports":[{"path":"packages/plugins/plugin-settings/dist/lib/node-esm/chunk-CHPB3YX5.mjs","kind":"import-statement"}],"exports":["SETTINGS_PLUGIN","default"],"entryPoint":"packages/plugins/plugin-settings/src/meta.ts","inputs":{},"bytes":257},"packages/plugins/plugin-settings/dist/lib/node-esm/chunk-CHPB3YX5.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":340},"packages/plugins/plugin-settings/dist/lib/node-esm/chunk-CHPB3YX5.mjs":{"imports":[],"exports":["SETTINGS_PLUGIN","meta_default"],"inputs":{"packages/plugins/plugin-settings/src/meta.ts":{"bytesInOutput":96}},"bytes":328}}}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
SETTINGS_PLUGIN,
|
|
4
|
-
meta_default
|
|
5
|
-
} from "./chunk-CHPB3YX5.mjs";
|
|
6
|
-
export {
|
|
7
|
-
SETTINGS_PLUGIN,
|
|
8
|
-
meta_default as default
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=meta.mjs.map
|