@dxos/plugin-space 0.6.12-main.f9d0246 → 0.6.12-staging.0b4bb48

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.
Files changed (69) hide show
  1. package/dist/lib/browser/{chunk-WBMH5WIP.mjs → chunk-DTVUOG2C.mjs} +2 -14
  2. package/dist/lib/browser/chunk-DTVUOG2C.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +185 -497
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/types/index.mjs +3 -7
  7. package/dist/lib/node/{chunk-GF3SRAQM.cjs → chunk-CVZPI2P3.cjs} +6 -20
  8. package/dist/lib/node/chunk-CVZPI2P3.cjs.map +7 -0
  9. package/dist/lib/node/index.cjs +278 -586
  10. package/dist/lib/node/index.cjs.map +4 -4
  11. package/dist/lib/node/meta.json +1 -1
  12. package/dist/lib/node/types/index.cjs +10 -14
  13. package/dist/lib/node/types/index.cjs.map +2 -2
  14. package/dist/types/src/SpacePlugin.d.ts.map +1 -1
  15. package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
  16. package/dist/types/src/components/ShareSpaceButton.stories.d.ts +0 -2
  17. package/dist/types/src/components/ShareSpaceButton.stories.d.ts.map +1 -1
  18. package/dist/types/src/components/SpaceMain/SpaceMain.d.ts.map +1 -1
  19. package/dist/types/src/components/SpacePresence.stories.d.ts +0 -2
  20. package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
  21. package/dist/types/src/components/SpaceSettings.d.ts.map +1 -1
  22. package/dist/types/src/components/index.d.ts +0 -2
  23. package/dist/types/src/components/index.d.ts.map +1 -1
  24. package/dist/types/src/translations.d.ts +0 -2
  25. package/dist/types/src/translations.d.ts.map +1 -1
  26. package/dist/types/src/types/thread.d.ts +0 -13
  27. package/dist/types/src/types/thread.d.ts.map +1 -1
  28. package/dist/types/src/types/types.d.ts +1 -18
  29. package/dist/types/src/types/types.d.ts.map +1 -1
  30. package/dist/types/src/util.d.ts +4 -1
  31. package/dist/types/src/util.d.ts.map +1 -1
  32. package/package.json +34 -41
  33. package/src/SpacePlugin.tsx +23 -38
  34. package/src/components/MenuFooter.tsx +0 -1
  35. package/src/components/SpaceMain/SpaceMain.tsx +22 -1
  36. package/src/components/SpaceSettings.tsx +3 -32
  37. package/src/components/index.ts +0 -2
  38. package/src/translations.ts +0 -2
  39. package/src/types/thread.ts +0 -9
  40. package/src/types/types.ts +1 -25
  41. package/src/util.tsx +50 -15
  42. package/dist/lib/browser/chunk-WBMH5WIP.mjs.map +0 -7
  43. package/dist/lib/node/chunk-GF3SRAQM.cjs.map +0 -7
  44. package/dist/lib/node-esm/chunk-GM2YUC77.mjs +0 -37
  45. package/dist/lib/node-esm/chunk-GM2YUC77.mjs.map +0 -7
  46. package/dist/lib/node-esm/chunk-N5VC55UM.mjs +0 -109
  47. package/dist/lib/node-esm/chunk-N5VC55UM.mjs.map +0 -7
  48. package/dist/lib/node-esm/index.mjs +0 -2953
  49. package/dist/lib/node-esm/index.mjs.map +0 -7
  50. package/dist/lib/node-esm/meta.json +0 -1
  51. package/dist/lib/node-esm/meta.mjs +0 -14
  52. package/dist/lib/node-esm/meta.mjs.map +0 -7
  53. package/dist/lib/node-esm/types/index.mjs +0 -26
  54. package/dist/lib/node-esm/types/index.mjs.map +0 -7
  55. package/dist/types/src/components/SaveStatus.d.ts +0 -3
  56. package/dist/types/src/components/SaveStatus.d.ts.map +0 -1
  57. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +0 -13
  58. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +0 -1
  59. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +0 -115
  60. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +0 -1
  61. package/dist/types/src/components/SyncStatus/index.d.ts +0 -2
  62. package/dist/types/src/components/SyncStatus/index.d.ts.map +0 -1
  63. package/dist/types/src/components/SyncStatus/types.d.ts +0 -14
  64. package/dist/types/src/components/SyncStatus/types.d.ts.map +0 -1
  65. package/src/components/SaveStatus.tsx +0 -95
  66. package/src/components/SyncStatus/SyncStatus.stories.tsx +0 -62
  67. package/src/components/SyncStatus/SyncStatus.tsx +0 -188
  68. package/src/components/SyncStatus/index.ts +0 -5
  69. package/src/components/SyncStatus/types.ts +0 -77
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-space",
3
- "version": "0.6.12-main.f9d0246",
3
+ "version": "0.6.12-staging.0b4bb48",
4
4
  "description": "DXOS Surface plugin for DXOS ECHO Spaces",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -10,24 +10,21 @@
10
10
  ".": {
11
11
  "browser": "./dist/lib/browser/index.mjs",
12
12
  "node": {
13
- "require": "./dist/lib/node/index.cjs",
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
- "require": "./dist/lib/node/meta.cjs",
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
  },
26
24
  "./types": {
27
25
  "browser": "./dist/lib/browser/types/index.mjs",
28
26
  "node": {
29
- "require": "./dist/lib/node/types/index.cjs",
30
- "default": "./dist/lib/node-esm/types/index.mjs"
27
+ "default": "./dist/lib/node/types/index.cjs"
31
28
  },
32
29
  "types": "./dist/types/src/types/index.d.ts"
33
30
  }
@@ -54,32 +51,28 @@
54
51
  "lodash.get": "^4.4.2",
55
52
  "react-drag-drop-files": "^2.3.8",
56
53
  "react-is": "~18.2.0",
57
- "@dxos/app-framework": "0.6.12-main.f9d0246",
58
- "@dxos/automerge": "0.6.12-main.f9d0246",
59
- "@dxos/client": "0.6.12-main.f9d0246",
60
- "@dxos/async": "0.6.12-main.f9d0246",
61
- "@dxos/context": "0.6.12-main.f9d0246",
62
- "@dxos/display-name": "0.6.12-main.f9d0246",
63
- "@dxos/invariant": "0.6.12-main.f9d0246",
64
- "@dxos/echo-schema": "0.6.12-main.f9d0246",
65
- "@dxos/keys": "0.6.12-main.f9d0246",
66
- "@dxos/local-storage": "0.6.12-main.f9d0246",
67
- "@dxos/log": "0.6.12-main.f9d0246",
68
- "@dxos/plugin-attention": "0.6.12-main.f9d0246",
69
- "@dxos/migrations": "0.6.12-main.f9d0246",
70
- "@dxos/plugin-client": "0.6.12-main.f9d0246",
71
- "@dxos/plugin-graph": "0.6.12-main.f9d0246",
72
- "@dxos/plugin-metadata": "0.6.12-main.f9d0246",
73
- "@dxos/plugin-observability": "0.6.12-main.f9d0246",
74
- "@dxos/plugin-status-bar": "0.6.12-main.f9d0246",
75
- "@dxos/plugin-settings": "0.6.12-main.f9d0246",
76
- "@dxos/protocols": "0.6.12-main.f9d0246",
77
- "@dxos/react-client": "0.6.12-main.f9d0246",
78
- "@dxos/react-ui-attention": "0.6.12-main.f9d0246",
79
- "@dxos/react-ui-editor": "0.6.12-main.f9d0246",
80
- "@dxos/shell": "0.6.12-main.f9d0246",
81
- "@dxos/util": "0.6.12-main.f9d0246",
82
- "@dxos/react-ui-syntax-highlighter": "0.6.12-main.f9d0246"
54
+ "@dxos/async": "0.6.12-staging.0b4bb48",
55
+ "@dxos/app-framework": "0.6.12-staging.0b4bb48",
56
+ "@dxos/client": "0.6.12-staging.0b4bb48",
57
+ "@dxos/automerge": "0.6.12-staging.0b4bb48",
58
+ "@dxos/display-name": "0.6.12-staging.0b4bb48",
59
+ "@dxos/echo-schema": "0.6.12-staging.0b4bb48",
60
+ "@dxos/invariant": "0.6.12-staging.0b4bb48",
61
+ "@dxos/local-storage": "0.6.12-staging.0b4bb48",
62
+ "@dxos/keys": "0.6.12-staging.0b4bb48",
63
+ "@dxos/log": "0.6.12-staging.0b4bb48",
64
+ "@dxos/migrations": "0.6.12-staging.0b4bb48",
65
+ "@dxos/plugin-attention": "0.6.12-staging.0b4bb48",
66
+ "@dxos/plugin-client": "0.6.12-staging.0b4bb48",
67
+ "@dxos/plugin-graph": "0.6.12-staging.0b4bb48",
68
+ "@dxos/plugin-metadata": "0.6.12-staging.0b4bb48",
69
+ "@dxos/plugin-observability": "0.6.12-staging.0b4bb48",
70
+ "@dxos/plugin-settings": "0.6.12-staging.0b4bb48",
71
+ "@dxos/react-ui-attention": "0.6.12-staging.0b4bb48",
72
+ "@dxos/react-client": "0.6.12-staging.0b4bb48",
73
+ "@dxos/shell": "0.6.12-staging.0b4bb48",
74
+ "@dxos/react-ui-editor": "0.6.12-staging.0b4bb48",
75
+ "@dxos/util": "0.6.12-staging.0b4bb48"
83
76
  },
84
77
  "devDependencies": {
85
78
  "@babel/core": "^7.18.13",
@@ -89,18 +82,18 @@
89
82
  "@types/react-dom": "~18.2.0",
90
83
  "react": "~18.2.0",
91
84
  "react-dom": "~18.2.0",
92
- "vite": "5.4.7",
93
- "@dxos/react-ui": "0.6.12-main.f9d0246",
94
- "@dxos/storybook-utils": "0.6.12-main.f9d0246",
95
- "@dxos/react-ui-theme": "0.6.12-main.f9d0246"
85
+ "vite": "^5.3.4",
86
+ "@dxos/react-ui": "0.6.12-staging.0b4bb48",
87
+ "@dxos/react-ui-theme": "0.6.12-staging.0b4bb48",
88
+ "@dxos/storybook-utils": "0.6.12-staging.0b4bb48"
96
89
  },
97
90
  "optionalDependencies": {
98
91
  "@babel/core": "^7.18.13",
99
92
  "@phosphor-icons/react": "^2.1.5",
100
- "react": "~18.2.0",
101
- "react-dom": "~18.2.0",
102
- "@dxos/react-ui": "0.6.12-main.f9d0246",
103
- "@dxos/react-ui-theme": "0.6.12-main.f9d0246"
93
+ "react": "^18.0.0",
94
+ "react-dom": "^18.0.0",
95
+ "@dxos/react-ui": "0.6.12-staging.0b4bb48",
96
+ "@dxos/react-ui-theme": "0.6.12-staging.0b4bb48"
104
97
  },
105
98
  "publishConfig": {
106
99
  "access": "public"
@@ -2,6 +2,7 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
+ import { type IconProps, Plus, SignIn, CardsThree, Warning } from '@phosphor-icons/react';
5
6
  import { effect, signal } from '@preact/signals-core';
6
7
  import React from 'react';
7
8
 
@@ -9,45 +10,45 @@ import {
9
10
  type IntentDispatcher,
10
11
  type IntentPluginProvides,
11
12
  LayoutAction,
13
+ Surface,
12
14
  type LocationProvides,
13
15
  NavigationAction,
14
16
  type Plugin,
15
17
  type PluginDefinition,
16
- Surface,
17
- firstIdInPart,
18
18
  openIds,
19
- parseGraphPlugin,
19
+ firstIdInPart,
20
20
  parseIntentPlugin,
21
- parseMetadataResolverPlugin,
22
21
  parseNavigationPlugin,
22
+ parseMetadataResolverPlugin,
23
23
  resolvePlugin,
24
+ parseGraphPlugin,
24
25
  } from '@dxos/app-framework';
25
26
  import { EventSubscriptions, type Trigger, type UnsubscribeCallback } from '@dxos/async';
26
- import { type EchoReactiveObject, type Identifiable, isReactiveObject } from '@dxos/echo-schema';
27
+ import { type Identifiable, isReactiveObject, type EchoReactiveObject } from '@dxos/echo-schema';
27
28
  import { LocalStorageStore } from '@dxos/local-storage';
28
29
  import { log } from '@dxos/log';
29
30
  import { Migrations } from '@dxos/migrations';
30
31
  import { type AttentionPluginProvides, parseAttentionPlugin } from '@dxos/plugin-attention';
31
32
  import { type ClientPluginProvides, parseClientPlugin } from '@dxos/plugin-client';
32
- import { type Node, createExtension, isGraphNode, memoize, toSignal } from '@dxos/plugin-graph';
33
+ import { createExtension, isGraphNode, memoize, type Node, toSignal } from '@dxos/plugin-graph';
33
34
  import { ObservabilityAction } from '@dxos/plugin-observability/meta';
34
35
  import { type Client, PublicKey } from '@dxos/react-client';
35
36
  import {
36
- Expando,
37
- Filter,
38
37
  type PropertiesTypeProps,
39
38
  type Space,
40
- SpaceState,
41
39
  create,
40
+ Expando,
41
+ Filter,
42
42
  fullyQualifiedId,
43
43
  getSpace,
44
44
  getTypename,
45
45
  isEchoObject,
46
46
  isSpace,
47
47
  loadObjectReferences,
48
+ SpaceState,
48
49
  } from '@dxos/react-client/echo';
49
50
  import { Dialog } from '@dxos/react-ui';
50
- import { ClipboardProvider, InvitationManager, type InvitationManagerProps, osTranslations } from '@dxos/shell/react';
51
+ import { InvitationManager, type InvitationManagerProps, osTranslations, ClipboardProvider } from '@dxos/shell/react';
51
52
  import { ComplexMap, nonNullable, reduceGroupBy } from '@dxos/util';
52
53
 
53
54
  import {
@@ -60,17 +61,15 @@ import {
60
61
  MissingObject,
61
62
  PopoverRenameObject,
62
63
  PopoverRenameSpace,
63
- SaveStatus,
64
64
  ShareSpaceButton,
65
65
  SmallPresence,
66
66
  SmallPresenceLive,
67
67
  SpacePresence,
68
68
  SpaceSettings,
69
- SyncStatus,
70
69
  } from './components';
71
70
  import meta, { SPACE_PLUGIN, SpaceAction } from './meta';
72
71
  import translations from './translations';
73
- import { CollectionType, type PluginState, type SpacePluginProvides, type SpaceSettingsProps } from './types';
72
+ import { CollectionType, type SpacePluginProvides, type SpaceSettingsProps, type PluginState } from './types';
74
73
  import {
75
74
  COMPOSER_SPACE_LOCK,
76
75
  SHARED,
@@ -119,9 +118,7 @@ export const SpacePlugin = ({
119
118
  firstRun,
120
119
  onFirstRun,
121
120
  }: SpacePluginOptions = {}): PluginDefinition<SpacePluginProvides> => {
122
- const settings = new LocalStorageStore<SpaceSettingsProps>(SPACE_PLUGIN, {
123
- onSpaceCreate: 'dxos.org/plugin/markdown/action/create',
124
- });
121
+ const settings = new LocalStorageStore<SpaceSettingsProps>(SPACE_PLUGIN);
125
122
  const state = new LocalStorageStore<PluginState>(SPACE_PLUGIN, {
126
123
  awaiting: undefined,
127
124
  spaceNames: {},
@@ -343,7 +340,8 @@ export const SpacePlugin = ({
343
340
  records: {
344
341
  [CollectionType.typename]: {
345
342
  placeholder: ['unnamed collection label', { ns: SPACE_PLUGIN }],
346
- icon: 'ph--cards-three--regular',
343
+ icon: (props: IconProps) => <CardsThree {...props} />,
344
+ iconSymbol: 'ph--cards-three--regular',
347
345
  // TODO(wittjosiah): Move out of metadata.
348
346
  loadReferences: (collection: CollectionType) =>
349
347
  loadObjectReferences(collection, (collection) => [
@@ -443,14 +441,6 @@ export const SpacePlugin = ({
443
441
  } else {
444
442
  return <MenuFooter object={data.object} />;
445
443
  }
446
- case 'status': {
447
- return (
448
- <>
449
- <SyncStatus />
450
- <SaveStatus />
451
- </>
452
- );
453
- }
454
444
  default:
455
445
  return null;
456
446
  }
@@ -550,7 +540,8 @@ export const SpacePlugin = ({
550
540
  },
551
541
  properties: {
552
542
  label: ['create space label', { ns: SPACE_PLUGIN }],
553
- icon: 'ph--plus--regular',
543
+ icon: (props: IconProps) => <Plus {...props} />,
544
+ iconSymbol: 'ph--plus--regular',
554
545
  disposition: 'toolbar',
555
546
  testId: 'spacePlugin.createSpace',
556
547
  },
@@ -570,7 +561,8 @@ export const SpacePlugin = ({
570
561
  },
571
562
  properties: {
572
563
  label: ['join space label', { ns: SPACE_PLUGIN }],
573
- icon: 'ph--sign-in--regular',
564
+ icon: (props: IconProps) => <SignIn {...props} />,
565
+ iconSymbol: 'ph--sign-in--regular',
574
566
  testId: 'spacePlugin.joinSpace',
575
567
  },
576
568
  },
@@ -813,15 +805,6 @@ export const SpacePlugin = ({
813
805
  data: { space, id: space.id, activeParts: { main: [space.id] } },
814
806
 
815
807
  intents: [
816
- ...(settings.values.onSpaceCreate
817
- ? [
818
- [
819
- { action: settings.values.onSpaceCreate, data: { space } },
820
- { action: SpaceAction.ADD_OBJECT, data: { target: space } },
821
- { action: NavigationAction.EXPOSE },
822
- ],
823
- ]
824
- : []),
825
808
  [
826
809
  {
827
810
  action: ObservabilityAction.SEND_EVENT,
@@ -1037,7 +1020,8 @@ export const SpacePlugin = ({
1037
1020
  title: translations[0]['en-US'][SPACE_PLUGIN]['space limit label'],
1038
1021
  description: translations[0]['en-US'][SPACE_PLUGIN]['space limit description'],
1039
1022
  duration: 5_000,
1040
- icon: 'ph--warning--regular',
1023
+ icon: (props: IconProps) => <Warning {...props} />,
1024
+ iconSymbol: 'ph--warning--regular',
1041
1025
  actionLabel: translations[0]['en-US'][SPACE_PLUGIN]['remove deleted objects label'],
1042
1026
  actionAlt: translations[0]['en-US'][SPACE_PLUGIN]['remove deleted objects alt'],
1043
1027
  // TODO(wittjosiah): Use OS namespace.
@@ -1076,7 +1060,7 @@ export const SpacePlugin = ({
1076
1060
  }
1077
1061
 
1078
1062
  return {
1079
- data: { id: fullyQualifiedId(object), object, activeParts: { main: [fullyQualifiedId(object)] } },
1063
+ data: { id: object.id, object, activeParts: { main: [fullyQualifiedId(object)] } },
1080
1064
  intents: [
1081
1065
  [
1082
1066
  {
@@ -1131,6 +1115,7 @@ export const SpacePlugin = ({
1131
1115
  activeParts: {
1132
1116
  main: deletionData.wasActive,
1133
1117
  sidebar: deletionData.wasActive,
1118
+ complementary: deletionData.wasActive,
1134
1119
  },
1135
1120
  },
1136
1121
  });
@@ -1,7 +1,6 @@
1
1
  //
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
-
5
4
  import { Planet } from '@phosphor-icons/react';
6
5
  import React from 'react';
7
6
 
@@ -6,14 +6,35 @@ import { Command } from '@phosphor-icons/react';
6
6
  import React from 'react';
7
7
 
8
8
  import { Surface } from '@dxos/app-framework';
9
+ import { type Action } from '@dxos/plugin-graph';
9
10
  import { SpaceState, type Space } from '@dxos/react-client/echo';
10
- import { Main, useTranslation } from '@dxos/react-ui';
11
+ import { Button, Main, useTranslation, toLocalizedString } from '@dxos/react-ui';
11
12
  import { getSize, mx, topbarBlockPaddingStart } from '@dxos/react-ui-theme';
12
13
  import { ClipboardProvider } from '@dxos/shell/react';
13
14
 
14
15
  import { SpaceMembersSection } from './SpaceMembersSection';
15
16
  import { SPACE_PLUGIN } from '../../meta';
16
17
 
18
+ const _InFlowSpaceActions = ({ actionsMap }: { actionsMap: Record<string, Action> }) => {
19
+ const { t } = useTranslation(SPACE_PLUGIN);
20
+ return (
21
+ <section className='mbe-4 col-start-2 col-end-4 md:col-end-7 grid gap-2 auto-rows-min grid-cols-[repeat(auto-fill,minmax(8rem,1fr))]'>
22
+ {Object.entries(actionsMap)
23
+ .filter(([_, { properties }]) => properties?.mainAreaDisposition === 'in-flow')
24
+ .map(([actionId, { data: invoke, properties }]) => {
25
+ const Icon = properties?.icon;
26
+ const label = properties?.label;
27
+ return (
28
+ <Button key={actionId} classNames='block text-center plb-2 font-normal'>
29
+ {Icon && <Icon size={5} className='mli-auto' />}
30
+ <p>{toLocalizedString(label, t)}</p>
31
+ </Button>
32
+ );
33
+ })}
34
+ </section>
35
+ );
36
+ };
37
+
17
38
  const KeyShortcuts = () => {
18
39
  const { t } = useTranslation(SPACE_PLUGIN);
19
40
  return (
@@ -4,17 +4,16 @@
4
4
 
5
5
  import React from 'react';
6
6
 
7
- import { useIntentDispatcher, useResolvePlugins } from '@dxos/app-framework';
7
+ import { useIntentDispatcher } from '@dxos/app-framework';
8
8
  import { SettingsValue } from '@dxos/plugin-settings';
9
- import { Input, Select, toLocalizedString, useTranslation } from '@dxos/react-ui';
9
+ import { Input, useTranslation } from '@dxos/react-ui';
10
10
 
11
11
  import { SpaceAction, SPACE_PLUGIN } from '../meta';
12
- import { parseSpaceInitPlugin, type SpaceSettingsProps } from '../types';
12
+ import { type SpaceSettingsProps } from '../types';
13
13
 
14
14
  export const SpaceSettings = ({ settings }: { settings: SpaceSettingsProps }) => {
15
15
  const { t } = useTranslation(SPACE_PLUGIN);
16
16
  const dispatch = useIntentDispatcher();
17
- const plugins = useResolvePlugins(parseSpaceInitPlugin);
18
17
 
19
18
  return (
20
19
  <>
@@ -30,34 +29,6 @@ export const SpaceSettings = ({ settings }: { settings: SpaceSettingsProps }) =>
30
29
  }
31
30
  />
32
31
  </SettingsValue>
33
-
34
- <SettingsValue label={t('default on space create label')}>
35
- <Select.Root
36
- value={settings.onSpaceCreate}
37
- onValueChange={(value) => {
38
- settings.onSpaceCreate = value;
39
- }}
40
- >
41
- <Select.TriggerButton />
42
- <Select.Portal>
43
- <Select.Content>
44
- <Select.Viewport>
45
- {plugins.map(
46
- ({
47
- provides: {
48
- space: { onSpaceCreate },
49
- },
50
- }) => (
51
- <Select.Option key={onSpaceCreate.action} value={onSpaceCreate.action}>
52
- {toLocalizedString(onSpaceCreate.label, t)}
53
- </Select.Option>
54
- ),
55
- )}
56
- </Select.Viewport>
57
- </Select.Content>
58
- </Select.Portal>
59
- </Select.Root>
60
- </SettingsValue>
61
32
  </>
62
33
  );
63
34
  };
@@ -16,5 +16,3 @@ export * from './ShareSpaceButton';
16
16
  export * from './SpaceMain';
17
17
  export * from './SpacePresence';
18
18
  export * from './SpaceSettings';
19
- export * from './SaveStatus';
20
- export * from './SyncStatus';
@@ -86,8 +86,6 @@ export default [
86
86
  'remove deleted objects label': 'Cleanup',
87
87
  'remove deleted objects alt': 'Permanently remove deleted objects to free up space.',
88
88
  'copy link label': 'Copy link',
89
- 'default on space create label': 'On space create',
90
- 'sync status title': 'Sync status',
91
89
  },
92
90
  },
93
91
  },
@@ -34,18 +34,9 @@ export const ActorSchema = S.mutable(
34
34
 
35
35
  export type ActorType = S.Schema.Type<typeof ActorSchema>;
36
36
 
37
- export enum MessageState {
38
- NONE = 0,
39
- ARCHIVED = 1,
40
- DELETED = 2,
41
- SPAM = 3,
42
- }
43
-
44
37
  export class MessageType extends TypedObject({ typename: 'dxos.org/type/Message', version: '0.1.0' })({
45
38
  /** ISO date string when the message was sent. */
46
39
  timestamp: S.String,
47
- /** Message state. */
48
- state: S.optional(S.Enums(MessageState)),
49
40
  /** Identity of the message sender. */
50
41
  sender: ActorSchema,
51
42
  /** Text content of the message. */
@@ -10,12 +10,10 @@ import type {
10
10
  SettingsProvides,
11
11
  SurfaceProvides,
12
12
  TranslationsProvides,
13
- Plugin,
14
13
  } from '@dxos/app-framework';
15
14
  import { type Expando } from '@dxos/echo-schema';
16
15
  import { type SchemaProvides } from '@dxos/plugin-client';
17
16
  import { type PublicKey } from '@dxos/react-client';
18
- import { type Label } from '@dxos/react-ui';
19
17
  import { type ComplexMap } from '@dxos/util';
20
18
 
21
19
  export const SPACE_DIRECTORY_HANDLE = 'dxos.org/plugin/space/directory';
@@ -55,29 +53,7 @@ export type PluginState = {
55
53
  sdkMigrationRunning: Record<string, boolean>;
56
54
  };
57
55
 
58
- export type SpaceSettingsProps = {
59
- /**
60
- * Show closed spaces.
61
- */
62
- showHidden?: boolean;
63
-
64
- /**
65
- * Action to perform when a space is created.
66
- */
67
- onSpaceCreate?: string;
68
- };
69
-
70
- export type SpaceInitProvides = {
71
- space: {
72
- onSpaceCreate: {
73
- label: Label;
74
- action: string;
75
- };
76
- };
77
- };
78
-
79
- export const parseSpaceInitPlugin = (plugin: Plugin) =>
80
- typeof (plugin.provides as any).space?.onSpaceCreate === 'object' ? (plugin as Plugin<SpaceInitProvides>) : undefined;
56
+ export type SpaceSettingsProps = { showHidden?: boolean };
81
57
 
82
58
  export type SpacePluginProvides = SurfaceProvides &
83
59
  IntentResolverProvides &
package/src/util.tsx CHANGED
@@ -2,6 +2,24 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
+ import {
6
+ CardsThree,
7
+ Database,
8
+ PencilSimpleLine,
9
+ Planet,
10
+ Plus,
11
+ Trash,
12
+ Users,
13
+ X,
14
+ ClockCounterClockwise,
15
+ type IconProps,
16
+ LockSimpleOpen,
17
+ LockSimple,
18
+ Placeholder,
19
+ Link,
20
+ } from '@phosphor-icons/react';
21
+ import React from 'react';
22
+
5
23
  import { type MetadataResolver, NavigationAction, type IntentDispatcher } from '@dxos/app-framework';
6
24
  import {
7
25
  type EchoReactiveObject,
@@ -200,7 +218,8 @@ export const constructSpaceNode = ({
200
218
  ...partials,
201
219
  label: getSpaceDisplayName(space, { personal, namesCache }),
202
220
  description: space.state.get() === SpaceState.SPACE_READY && space.properties.description,
203
- icon: 'ph--planet--regular',
221
+ icon: (props: IconProps) => <Planet {...props} />,
222
+ iconSymbol: 'ph--planet--regular',
204
223
  disabled: space.state.get() !== SpaceState.SPACE_READY || hasPendingMigration,
205
224
  testId: 'spacePlugin.space',
206
225
  },
@@ -224,7 +243,8 @@ export const constructSpaceActionGroups = ({ space, dispatch }: { space: Space;
224
243
  data: actionGroupSymbol,
225
244
  properties: {
226
245
  label: ['create object in space label', { ns: SPACE_PLUGIN }],
227
- icon: 'ph--plus--regular',
246
+ icon: (props: IconProps) => <Plus {...props} />,
247
+ iconSymbol: 'ph--plus--regular',
228
248
  disposition: 'toolbar',
229
249
  // TODO(wittjosiah): This is currently a navtree feature. Address this with cmd+k integration.
230
250
  // mainAreaDisposition: 'in-flow',
@@ -248,7 +268,8 @@ export const constructSpaceActionGroups = ({ space, dispatch }: { space: Space;
248
268
  ]),
249
269
  properties: {
250
270
  label: ['create collection label', { ns: SPACE_PLUGIN }],
251
- icon: 'ph--cards-three--regular',
271
+ icon: (props: IconProps) => <CardsThree {...props} />,
272
+ iconSymbol: 'ph--cards-three--regular',
252
273
  testId: 'spacePlugin.createCollection',
253
274
  },
254
275
  },
@@ -284,7 +305,8 @@ export const constructSpaceActions = ({
284
305
  },
285
306
  properties: {
286
307
  label: ['migrate space label', { ns: SPACE_PLUGIN }],
287
- icon: 'ph--database--regular',
308
+ icon: (props: IconProps) => <Database {...props} />,
309
+ iconSymbol: 'ph--database--regular',
288
310
  disposition: 'toolbar',
289
311
  mainAreaDisposition: 'in-flow',
290
312
  disabled: migrating || Migrations.running(space),
@@ -306,7 +328,8 @@ export const constructSpaceActions = ({
306
328
  },
307
329
  properties: {
308
330
  label: ['share space label', { ns: SPACE_PLUGIN }],
309
- icon: 'ph--users--regular',
331
+ icon: (props: IconProps) => <Users {...props} />,
332
+ iconSymbol: 'ph--users--regular',
310
333
  disabled: locked,
311
334
  keyBinding: {
312
335
  macos: 'meta+.',
@@ -327,7 +350,10 @@ export const constructSpaceActions = ({
327
350
  },
328
351
  properties: {
329
352
  label: [locked ? 'unlock space label' : 'lock space label', { ns: SPACE_PLUGIN }],
330
- icon: locked ? 'ph--lock-simple-open--regular' : 'ph--lock-simple--regular',
353
+ icon: locked
354
+ ? (props: IconProps) => <LockSimpleOpen {...props} />
355
+ : (props: IconProps) => <LockSimple {...props} />,
356
+ iconSymbol: locked ? 'ph--lock-simple-open--regular' : 'ph--lock-simple--regular',
331
357
  },
332
358
  },
333
359
  {
@@ -338,7 +364,8 @@ export const constructSpaceActions = ({
338
364
  },
339
365
  properties: {
340
366
  label: ['rename space label', { ns: SPACE_PLUGIN }],
341
- icon: 'ph--pencil-simple-line--regular',
367
+ icon: (props: IconProps) => <PencilSimpleLine {...props} />,
368
+ iconSymbol: 'ph--pencil-simple-line--regular',
342
369
  keyBinding: {
343
370
  macos: 'shift+F6',
344
371
  windows: 'shift+F6',
@@ -358,7 +385,8 @@ export const constructSpaceActions = ({
358
385
  },
359
386
  properties: {
360
387
  label: ['close space label', { ns: SPACE_PLUGIN }],
361
- icon: 'ph--x--regular',
388
+ icon: (props: IconProps) => <X {...props} />,
389
+ iconSymbol: 'ph--x--regular',
362
390
  mainAreaDisposition: 'menu',
363
391
  disabled: personal,
364
392
  },
@@ -374,7 +402,8 @@ export const constructSpaceActions = ({
374
402
  },
375
403
  properties: {
376
404
  label: ['open space label', { ns: SPACE_PLUGIN }],
377
- icon: 'ph--clock-counter-clockwise--regular',
405
+ icon: (props: IconProps) => <ClockCounterClockwise {...props} />,
406
+ iconSymbol: 'ph--clock-counter-clockwise--regular',
378
407
  disposition: 'toolbar',
379
408
  mainAreaDisposition: 'in-flow',
380
409
  },
@@ -417,7 +446,8 @@ export const createObjectNode = ({
417
446
  label: metadata.label?.(object) ||
418
447
  object.name ||
419
448
  metadata.placeholder || ['unnamed object label', { ns: SPACE_PLUGIN }],
420
- icon: metadata.icon ?? 'ph--placeholder--regular',
449
+ icon: metadata.icon ?? (() => <Placeholder />),
450
+ iconSymbol: metadata.iconSymbol ?? 'ph--placeholder--regular',
421
451
  testId: 'spacePlugin.object',
422
452
  persistenceClass: 'echo',
423
453
  persistenceKey: space?.id,
@@ -445,7 +475,8 @@ export const constructObjectActionGroups = ({
445
475
  data: actionGroupSymbol,
446
476
  properties: {
447
477
  label: ['create object in collection label', { ns: SPACE_PLUGIN }],
448
- icon: 'ph--plus--regular',
478
+ icon: (props: IconProps) => <Plus {...props} />,
479
+ iconSymbol: 'ph--plus--regular',
449
480
  disposition: 'toolbar',
450
481
  // TODO(wittjosiah): This is currently a navtree feature. Address this with cmd+k integration.
451
482
  // mainAreaDisposition: 'in-flow',
@@ -469,7 +500,8 @@ export const constructObjectActionGroups = ({
469
500
  ]),
470
501
  properties: {
471
502
  label: ['create collection label', { ns: SPACE_PLUGIN }],
472
- icon: 'ph--cards-three--regular',
503
+ icon: (props: IconProps) => <CardsThree {...props} />,
504
+ iconSymbol: 'ph--cards-three--regular',
473
505
  testId: 'spacePlugin.createCollection',
474
506
  },
475
507
  },
@@ -504,7 +536,8 @@ export const constructObjectActions = ({
504
536
  object instanceof CollectionType ? 'rename collection label' : 'rename object label',
505
537
  { ns: SPACE_PLUGIN },
506
538
  ],
507
- icon: 'ph--pencil-simple-line--regular',
539
+ icon: (props: IconProps) => <PencilSimpleLine {...props} />,
540
+ iconSymbol: 'ph--pencil-simple-line--regular',
508
541
  // TODO(wittjosiah): Doesn't work.
509
542
  // keyBinding: 'shift+F6',
510
543
  testId: 'spacePlugin.renameObject',
@@ -530,7 +563,8 @@ export const constructObjectActions = ({
530
563
  object instanceof CollectionType ? 'delete collection label' : 'delete object label',
531
564
  { ns: SPACE_PLUGIN },
532
565
  ],
533
- icon: 'ph--trash--regular',
566
+ icon: (props: IconProps) => <Trash {...props} />,
567
+ iconSymbol: 'ph--trash--regular',
534
568
  keyBinding: object instanceof CollectionType ? undefined : 'shift+meta+Backspace',
535
569
  testId: 'spacePlugin.deleteObject',
536
570
  },
@@ -544,7 +578,8 @@ export const constructObjectActions = ({
544
578
  },
545
579
  properties: {
546
580
  label: ['copy link label', { ns: SPACE_PLUGIN }],
547
- icon: 'ph--link--regular',
581
+ icon: (props: IconProps) => <Link {...props} />,
582
+ iconSymbol: 'ph--link--regular',
548
583
  testId: 'spacePlugin.copyLink',
549
584
  },
550
585
  },