@dxos/plugin-space 0.7.2 → 0.7.3-staging.971cd8d

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 (95) hide show
  1. package/dist/lib/browser/{chunk-DJE2HYFV.mjs → chunk-FTKV32QZ.mjs} +9 -2
  2. package/dist/lib/browser/chunk-FTKV32QZ.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-OWZKSWMX.mjs → chunk-MWKXNS5S.mjs} +13 -3
  4. package/dist/lib/browser/{chunk-OWZKSWMX.mjs.map → chunk-MWKXNS5S.mjs.map} +3 -3
  5. package/dist/lib/browser/index.mjs +1056 -674
  6. package/dist/lib/browser/index.mjs.map +4 -4
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/browser/meta.mjs +3 -1
  9. package/dist/lib/browser/types/index.mjs +5 -3
  10. package/dist/lib/node/{chunk-FYWGZYJB.cjs → chunk-6SNOZF7Y.cjs} +18 -7
  11. package/dist/lib/node/chunk-6SNOZF7Y.cjs.map +7 -0
  12. package/dist/lib/node/{chunk-JFDDZI4Y.cjs → chunk-QNVEU2UD.cjs} +12 -4
  13. package/dist/lib/node/chunk-QNVEU2UD.cjs.map +7 -0
  14. package/dist/lib/node/index.cjs +1160 -789
  15. package/dist/lib/node/index.cjs.map +4 -4
  16. package/dist/lib/node/meta.cjs +7 -5
  17. package/dist/lib/node/meta.cjs.map +2 -2
  18. package/dist/lib/node/meta.json +1 -1
  19. package/dist/lib/node/types/index.cjs +14 -12
  20. package/dist/lib/node/types/index.cjs.map +2 -2
  21. package/dist/lib/node-esm/{chunk-MCEAI4CV.mjs → chunk-OHEAWSCA.mjs} +13 -3
  22. package/dist/lib/node-esm/{chunk-MCEAI4CV.mjs.map → chunk-OHEAWSCA.mjs.map} +3 -3
  23. package/dist/lib/node-esm/{chunk-DVUZ7A7G.mjs → chunk-UMV7XREB.mjs} +9 -2
  24. package/dist/lib/node-esm/chunk-UMV7XREB.mjs.map +7 -0
  25. package/dist/lib/node-esm/index.mjs +1056 -674
  26. package/dist/lib/node-esm/index.mjs.map +4 -4
  27. package/dist/lib/node-esm/meta.json +1 -1
  28. package/dist/lib/node-esm/meta.mjs +3 -1
  29. package/dist/lib/node-esm/types/index.mjs +5 -3
  30. package/dist/types/src/SpacePlugin.d.ts.map +1 -1
  31. package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +9 -0
  32. package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -0
  33. package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +10 -0
  34. package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -0
  35. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +22 -0
  36. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -0
  37. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts +3 -0
  38. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -0
  39. package/dist/types/src/components/CreateDialog/index.d.ts +3 -0
  40. package/dist/types/src/components/CreateDialog/index.d.ts.map +1 -0
  41. package/dist/types/src/components/PopoverRenameObject.d.ts +1 -1
  42. package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
  43. package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts.map +1 -1
  44. package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts +6 -0
  45. package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts.map +1 -0
  46. package/dist/types/src/components/SyncStatus/Space.d.ts +8 -3
  47. package/dist/types/src/components/SyncStatus/Space.d.ts.map +1 -1
  48. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +3 -2
  49. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
  50. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +1 -2
  51. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
  52. package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts +8 -0
  53. package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts.map +1 -0
  54. package/dist/types/src/components/SyncStatus/index.d.ts +1 -0
  55. package/dist/types/src/components/SyncStatus/index.d.ts.map +1 -1
  56. package/dist/types/src/components/SyncStatus/sync-state.d.ts +5 -1
  57. package/dist/types/src/components/SyncStatus/sync-state.d.ts.map +1 -1
  58. package/dist/types/src/components/index.d.ts +1 -0
  59. package/dist/types/src/components/index.d.ts.map +1 -1
  60. package/dist/types/src/meta.d.ts +5 -0
  61. package/dist/types/src/meta.d.ts.map +1 -1
  62. package/dist/types/src/translations.d.ts +224 -0
  63. package/dist/types/src/translations.d.ts.map +1 -1
  64. package/dist/types/src/types/types.d.ts +14 -14
  65. package/dist/types/src/types/types.d.ts.map +1 -1
  66. package/dist/types/src/util.d.ts +3 -13
  67. package/dist/types/src/util.d.ts.map +1 -1
  68. package/package.json +38 -35
  69. package/src/SpacePlugin.tsx +169 -75
  70. package/src/components/AwaitingObject.tsx +2 -2
  71. package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +83 -0
  72. package/src/components/CreateDialog/CreateObjectDialog.tsx +97 -0
  73. package/src/components/CreateDialog/CreateObjectPanel.tsx +169 -0
  74. package/src/components/CreateDialog/CreateSpaceDialog.tsx +57 -0
  75. package/src/components/CreateDialog/index.ts +6 -0
  76. package/src/components/PopoverRenameObject.tsx +1 -1
  77. package/src/components/SpacePluginSettings.tsx +3 -32
  78. package/src/components/SpaceSettings/SpaceSettingsDialog.tsx +1 -1
  79. package/src/components/SpaceSettings/SpaceSettingsPanel.tsx +2 -6
  80. package/src/components/SyncStatus/InlineSyncStatus.tsx +45 -0
  81. package/src/components/SyncStatus/Space.tsx +30 -6
  82. package/src/components/SyncStatus/SyncStatus.stories.tsx +3 -32
  83. package/src/components/SyncStatus/SyncStatus.tsx +32 -14
  84. package/src/components/SyncStatus/SyncStatusDetail.stories.tsx +83 -0
  85. package/src/components/SyncStatus/index.ts +1 -0
  86. package/src/components/SyncStatus/sync-state.ts +24 -0
  87. package/src/components/index.ts +1 -0
  88. package/src/meta.ts +6 -0
  89. package/src/translations.ts +15 -0
  90. package/src/types/types.ts +20 -16
  91. package/src/util.tsx +51 -141
  92. package/dist/lib/browser/chunk-DJE2HYFV.mjs.map +0 -7
  93. package/dist/lib/node/chunk-FYWGZYJB.cjs.map +0 -7
  94. package/dist/lib/node/chunk-JFDDZI4Y.cjs.map +0 -7
  95. package/dist/lib/node-esm/chunk-DVUZ7A7G.mjs.map +0 -7
@@ -2,16 +2,17 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import React, { useEffect, useState } from 'react';
5
+ import React, { useCallback, useEffect, useState } from 'react';
6
6
 
7
7
  import { StatusBar } from '@dxos/plugin-status-bar';
8
8
  import { useClient } from '@dxos/react-client';
9
- import { Icon, Popover, useTranslation } from '@dxos/react-ui';
9
+ import { type SpaceId } from '@dxos/react-client/echo';
10
+ import { Icon, Input, Popover, useTranslation } from '@dxos/react-ui';
10
11
  import { type ThemedClassName } from '@dxos/react-ui';
11
12
  import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
12
13
  import { mx } from '@dxos/react-ui-theme';
13
14
 
14
- import { SpaceRow, SYNC_STALLED_TIMEOUT } from './Space';
15
+ import { SpaceRowContainer, SYNC_STALLED_TIMEOUT } from './Space';
15
16
  import { createClientSaveTracker } from './save-tracker';
16
17
  import { getIcon, getStatus } from './status';
17
18
  import { type PeerSyncState, type SpaceSyncStateMap, getSyncSummary, useSyncState } from './sync-state';
@@ -74,26 +75,43 @@ export const SyncStatusIndicator = ({ state, saved }: { state: SpaceSyncStateMap
74
75
  }
75
76
  };
76
77
 
77
- export const SyncStatusDetail = ({
78
- classNames,
79
- state,
80
- summary,
81
- debug,
82
- }: ThemedClassName<{
78
+ export type SyncStatusDetailProps = ThemedClassName<{
83
79
  state: SpaceSyncStateMap;
84
80
  summary: PeerSyncState;
85
81
  debug?: boolean;
86
- }>) => {
82
+ }>;
83
+
84
+ // TODO(wittjosiah): This currently does not show `differentDocuments` at all.
85
+ export const SyncStatusDetail = ({ classNames, state, summary, debug }: SyncStatusDetailProps) => {
86
+ const [showAll, setShowAll] = useState(false);
87
87
  const { t } = useTranslation(SPACE_PLUGIN);
88
- const entries = Object.entries(state).sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
88
+ const entries = Object.entries(state)
89
+ .filter(([_, value]) => showAll || value.missingOnLocal + value.missingOnRemote > 0)
90
+ .toSorted(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
91
+
92
+ const handleCheckedChange = useCallback((state: boolean) => setShowAll(state), [setShowAll]);
89
93
 
90
94
  // TODO(burdon): Normalize to max document count?
91
95
  return (
92
- <div className={mx('flex flex-col gap-3 p-2 text-xs min-w-[16rem]', classNames)}>
93
- <h1>{t('sync status title')}</h1>
96
+ <div className={mx('flex flex-col gap-3 p-2 text-xs min-w-96', classNames)}>
97
+ <div role='none' className='flex items-center'>
98
+ <h1 className='flex-1'>{t('sync status title')}</h1>
99
+ <div className='flex items-center gap-2'>
100
+ <Input.Root>
101
+ <Input.Label classNames='text-xs'>{t('show all label')}</Input.Label>
102
+ <Input.Checkbox checked={showAll} onCheckedChange={handleCheckedChange} />
103
+ </Input.Root>
104
+ </div>
105
+ </div>
94
106
  <div className='flex flex-col gap-2'>
107
+ {entries.length === 0 && (
108
+ <div role='none' className='flex justify-center'>
109
+ {/* TODO(wittjosiah): This text should be updated once status includes different documents. */}
110
+ {t('no sync status label')}
111
+ </div>
112
+ )}
95
113
  {entries.map(([spaceId, state]) => (
96
- <SpaceRow key={spaceId} spaceId={spaceId} state={state} />
114
+ <SpaceRowContainer key={spaceId} spaceId={spaceId as SpaceId} state={state} />
97
115
  ))}
98
116
  </div>
99
117
  {debug && <SyntaxHighlighter language='json'>{JSON.stringify(summary, null, 2)}</SyntaxHighlighter>}
@@ -0,0 +1,83 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import '@dxos-theme';
6
+
7
+ import { type Meta, type StoryObj } from '@storybook/react';
8
+ import React from 'react';
9
+
10
+ import { faker } from '@dxos/random';
11
+ import { useStoryClientData, withClientProvider } from '@dxos/react-client/testing';
12
+ import { withTheme, withLayout } from '@dxos/storybook-utils';
13
+
14
+ import { SyncStatusDetail } from './SyncStatus';
15
+ import { getSyncSummary, type SpaceSyncStateMap } from './sync-state';
16
+ import translations from '../../translations';
17
+
18
+ const random = ({ min, max }: { min: number; max: number }) => min + Math.floor(Math.random() * (max - min));
19
+
20
+ export const Default: StoryObj<typeof SyncStatusDetail> = {};
21
+
22
+ export const Empty: StoryObj<typeof SyncStatusDetail> = {
23
+ render: (args) => {
24
+ return <SyncStatusDetail {...args} state={{}} />;
25
+ },
26
+ };
27
+
28
+ const meta: Meta = {
29
+ title: 'plugins/plugin-space/SyncStatusDetail',
30
+ component: SyncStatusDetail,
31
+ render: (args) => {
32
+ const { state } = useStoryClientData<{ state: SpaceSyncStateMap }>();
33
+
34
+ return <SyncStatusDetail {...args} state={state} summary={getSyncSummary(state)} />;
35
+ },
36
+ decorators: [
37
+ withTheme,
38
+ withLayout({ fullscreen: true }),
39
+ withClientProvider({
40
+ createIdentity: true,
41
+ onIdentityCreated: async ({ client }) => {
42
+ const spaces = await Promise.all(
43
+ Array.from({ length: 10 }).map(() => client.spaces.create({ name: faker.company.name() })),
44
+ );
45
+
46
+ const state: SpaceSyncStateMap = spaces.reduce<SpaceSyncStateMap>((map, space, i) => {
47
+ if (i > 4) {
48
+ const total = random({ min: 10, max: 500 });
49
+ map[space.id] = {
50
+ localDocumentCount: total,
51
+ remoteDocumentCount: total,
52
+ missingOnLocal: 0,
53
+ missingOnRemote: 0,
54
+ differentDocuments: 0,
55
+ };
56
+ return map;
57
+ }
58
+
59
+ const total = random({ min: 10, max: 500 });
60
+ const haveLocal = random({ min: 0, max: total });
61
+ const haveRemote = random({ min: 0, max: total });
62
+ map[space.id] = {
63
+ localDocumentCount: haveLocal,
64
+ remoteDocumentCount: haveRemote,
65
+ missingOnLocal: total - haveLocal,
66
+ missingOnRemote: total - haveRemote,
67
+ differentDocuments: 0,
68
+ };
69
+
70
+ return map;
71
+ }, {});
72
+
73
+ return { state };
74
+ },
75
+ }),
76
+ ],
77
+ parameters: { translations },
78
+ args: {
79
+ classNames: 'm-2 border border-separator rounded-md',
80
+ },
81
+ };
82
+
83
+ export default meta;
@@ -2,4 +2,5 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
+ export * from './InlineSyncStatus';
5
6
  export * from './SyncStatus';
@@ -75,3 +75,27 @@ export const useSyncState = (): SpaceSyncStateMap => {
75
75
 
76
76
  return spaceState;
77
77
  };
78
+
79
+ /**
80
+ * Hook Subscribes to sync state for a single space.
81
+ */
82
+ // TODO(wittjosiah): Reconcile w/ useSyncState.
83
+ export const useSpaceSyncState = (space: Space): PeerSyncState | undefined => {
84
+ const [spaceState, setSpaceState] = useState<PeerSyncState>();
85
+
86
+ useEffect(() => {
87
+ const ctx = new Context();
88
+ space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
89
+ const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
90
+ if (syncState) {
91
+ setSpaceState(syncState);
92
+ }
93
+ });
94
+
95
+ return () => {
96
+ void ctx.dispose();
97
+ };
98
+ }, [space]);
99
+
100
+ return spaceState;
101
+ };
@@ -3,6 +3,7 @@
3
3
  //
4
4
 
5
5
  export * from './AwaitingObject';
6
+ export * from './CreateDialog';
6
7
  export * from './CollectionMain';
7
8
  export * from './CollectionSection';
8
9
  export * from './DefaultObjectSettings';
package/src/meta.ts CHANGED
@@ -15,6 +15,7 @@ export default {
15
15
 
16
16
  const SPACE_ACTION = `${SPACE_PLUGIN}/action`;
17
17
  export enum SpaceAction {
18
+ OPEN_CREATE_SPACE = `${SPACE_ACTION}/open-create-space`,
18
19
  CREATE = `${SPACE_ACTION}/create`,
19
20
  JOIN = `${SPACE_ACTION}/join`,
20
21
  SHARE = `${SPACE_ACTION}/share`,
@@ -24,6 +25,7 @@ export enum SpaceAction {
24
25
  OPEN = `${SPACE_ACTION}/open`,
25
26
  CLOSE = `${SPACE_ACTION}/close`,
26
27
  MIGRATE = `${SPACE_ACTION}/migrate`,
28
+ OPEN_CREATE_OBJECT = `${SPACE_ACTION}/open-create-object`,
27
29
  ADD_OBJECT = `${SPACE_ACTION}/add-object`,
28
30
  REMOVE_OBJECTS = `${SPACE_ACTION}/remove-objects`,
29
31
  RENAME_OBJECT = `${SPACE_ACTION}/rename-object`,
@@ -32,3 +34,7 @@ export enum SpaceAction {
32
34
  TOGGLE_HIDDEN = `${SPACE_ACTION}/toggle-hidden`,
33
35
  OPEN_SETTINGS = `${SPACE_ACTION}/open-settings`,
34
36
  }
37
+
38
+ export enum CollectionAction {
39
+ CREATE = 'dxos.org/plugin/collection/action/create',
40
+ }
@@ -3,10 +3,14 @@
3
3
  //
4
4
 
5
5
  import { SPACE_PLUGIN } from './meta';
6
+ import { CollectionType } from './types';
6
7
 
7
8
  export default [
8
9
  {
9
10
  'en-US': {
11
+ [CollectionType.typename]: {
12
+ 'typename label': 'Collection',
13
+ },
10
14
  [SPACE_PLUGIN]: {
11
15
  'plugin name': 'Spaces',
12
16
  'first run message': 'Nothing selected.',
@@ -104,6 +108,17 @@ export default [
104
108
  'open space settings label': 'Space Settings',
105
109
  'members tab label': 'Members',
106
110
  'settings tab label': 'Settings',
111
+ 'syncing message': 'Space syncing',
112
+ 'show all label': 'Show all',
113
+ 'no sync status label': 'No space with missing objects.',
114
+ 'create space dialog title': 'Create Space',
115
+ 'create object dialog title': 'Create Object',
116
+ 'space input placeholder': 'Select space',
117
+ 'schema input placeholder': 'Select object type',
118
+ 'creating object type label': 'Type',
119
+ 'creating in space label': 'In Space',
120
+ 'creating in collection label': 'In Collection',
121
+ 'clear input label': 'Clear',
107
122
  },
108
123
  },
109
124
  },
@@ -12,12 +12,10 @@ import type {
12
12
  TranslationsProvides,
13
13
  Plugin,
14
14
  } from '@dxos/app-framework';
15
- import { type Expando } from '@dxos/echo-schema';
16
- import { type SchemaProvides } from '@dxos/plugin-client';
15
+ import { AST, S, type AbstractTypedObject, type Expando } from '@dxos/echo-schema';
17
16
  import { type PanelProvides } from '@dxos/plugin-deck/types';
18
17
  import { type PublicKey } from '@dxos/react-client';
19
18
  import { type Space } from '@dxos/react-client/echo';
20
- import { type Label } from '@dxos/react-ui';
21
19
  import { type ComplexMap } from '@dxos/util';
22
20
 
23
21
  export const SPACE_DIRECTORY_HANDLE = 'dxos.org/plugin/space/directory';
@@ -61,6 +59,12 @@ export type PluginState = {
61
59
  * Determined by whether or not there is an available plugin that can render a collection.
62
60
  */
63
61
  navigableCollections: boolean;
62
+
63
+ /**
64
+ * Tracks whether setting edge replication as default has been run on spaces.
65
+ */
66
+ // TODO(wittjosiah): Systematic way to handle migrations of state outside of spaces.
67
+ enabledEdgeReplication: boolean;
64
68
  };
65
69
 
66
70
  export type SpaceSettingsProps = {
@@ -68,24 +72,19 @@ export type SpaceSettingsProps = {
68
72
  * Show closed spaces.
69
73
  */
70
74
  showHidden?: boolean;
71
-
72
- /**
73
- * Action to perform when a space is created.
74
- */
75
- onSpaceCreate?: string;
76
75
  };
77
76
 
78
- export type SpaceInitProvides = {
79
- space: {
80
- onSpaceCreate: {
81
- label: Label;
82
- action: string;
83
- };
77
+ export type SchemaProvides = {
78
+ echo: {
79
+ schema?: AbstractTypedObject[];
80
+ system?: AbstractTypedObject[];
84
81
  };
85
82
  };
86
83
 
87
- export const parseSpaceInitPlugin = (plugin: Plugin) =>
88
- typeof (plugin.provides as any).space?.onSpaceCreate === 'object' ? (plugin as Plugin<SpaceInitProvides>) : undefined;
84
+ export const parseSchemaPlugin = (plugin?: Plugin) =>
85
+ Array.isArray((plugin?.provides as any).echo?.schema) || Array.isArray((plugin?.provides as any).echo?.system)
86
+ ? (plugin as Plugin<SchemaProvides>)
87
+ : undefined;
89
88
 
90
89
  export type SpacePluginProvides = SurfaceProvides &
91
90
  IntentResolverProvides &
@@ -113,3 +112,8 @@ export interface TypedObjectSerializer<T extends Expando = Expando> {
113
112
  */
114
113
  deserialize(params: { content: string; space: Space; newId?: boolean }): Promise<T>;
115
114
  }
115
+
116
+ export const SpaceForm = S.Struct({
117
+ name: S.optional(S.String.annotations({ [AST.TitleAnnotationId]: 'Name' })),
118
+ edgeReplication: S.Boolean.annotations({ [AST.TitleAnnotationId]: 'Enable EDGE Replication' }),
119
+ });
package/src/util.tsx CHANGED
@@ -2,46 +2,39 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type MetadataResolver, NavigationAction, type IntentDispatcher } from '@dxos/app-framework';
6
- import {
7
- create,
8
- isReactiveObject,
9
- getTypename,
10
- getSchema,
11
- getObjectAnnotation,
12
- type Expando,
13
- EXPANDO_TYPENAME,
14
- } from '@dxos/echo-schema';
5
+ import { type IntentDispatcher, type MetadataResolver } from '@dxos/app-framework';
6
+ import { EXPANDO_TYPENAME, getObjectAnnotation, getTypename, type Expando } from '@dxos/echo-schema';
15
7
  import { invariant } from '@dxos/invariant';
8
+ import { getSchema, isReactiveObject } from '@dxos/live-object';
16
9
  import { Migrations } from '@dxos/migrations';
17
10
  import {
18
- ACTION_TYPE,
19
11
  ACTION_GROUP_TYPE,
20
- actionGroupSymbol,
12
+ ACTION_TYPE,
13
+ cleanup,
14
+ getGraph,
15
+ memoize,
21
16
  type ActionData,
22
17
  type Graph,
23
- type Node,
24
18
  type InvokeParams,
19
+ type Node,
25
20
  type NodeArg,
26
- getGraph,
27
- cleanup,
28
- memoize,
29
21
  } from '@dxos/plugin-graph';
30
22
  import {
23
+ Filter,
31
24
  fullyQualifiedId,
32
25
  getSpace,
33
26
  isEchoObject,
34
27
  isSpace,
28
+ SpaceState,
35
29
  type Echo,
36
- type ReactiveEchoObject,
37
30
  type FilterSource,
38
31
  type Query,
39
32
  type QueryOptions,
33
+ type ReactiveEchoObject,
40
34
  type Space,
41
- SpaceState,
42
35
  } from '@dxos/react-client/echo';
43
36
 
44
- import { SpaceAction, SPACE_PLUGIN } from './meta';
37
+ import { SPACE_PLUGIN, SpaceAction } from './meta';
45
38
  import { CollectionType } from './types';
46
39
 
47
40
  export const SPACES = `${SPACE_PLUGIN}-spaces`;
@@ -64,7 +57,11 @@ export const memoizeQuery = <T extends ReactiveEchoObject<any>>(
64
57
  filter?: FilterSource<T>,
65
58
  options?: QueryOptions,
66
59
  ): T[] => {
67
- const key = isSpace(spaceOrEcho) ? spaceOrEcho.id : undefined;
60
+ const key = JSON.stringify({
61
+ space: isSpace(spaceOrEcho) ? spaceOrEcho.id : undefined,
62
+ filter: Filter.from(filter).toProto(),
63
+ });
64
+
68
65
  const query = memoize(
69
66
  () =>
70
67
  isSpace(spaceOrEcho)
@@ -213,68 +210,6 @@ export const constructSpaceNode = ({
213
210
  };
214
211
  };
215
212
 
216
- export const constructSpaceActionGroups = ({
217
- space,
218
- navigable,
219
- dispatch,
220
- }: {
221
- space: Space;
222
- navigable: boolean;
223
- dispatch: IntentDispatcher;
224
- }) => {
225
- const state = space.state.get();
226
- const hasPendingMigration = checkPendingMigration(space);
227
- const getId = (id: string) => `${id}/${space.id}`;
228
-
229
- if (state !== SpaceState.SPACE_READY || hasPendingMigration) {
230
- return [];
231
- }
232
-
233
- const collection = space.properties[CollectionType.typename];
234
- const actions: NodeArg<typeof actionGroupSymbol>[] = [
235
- {
236
- id: getId(SpaceAction.ADD_OBJECT),
237
- type: ACTION_GROUP_TYPE,
238
- data: actionGroupSymbol,
239
- properties: {
240
- label: ['create object in space label', { ns: SPACE_PLUGIN }],
241
- icon: 'ph--plus--regular',
242
- disposition: 'toolbar',
243
- menuType: 'searchList',
244
- testId: 'spacePlugin.createObject',
245
- },
246
- nodes: [
247
- {
248
- id: getId(SpaceAction.ADD_OBJECT.replace('object', 'collection')),
249
- type: ACTION_TYPE,
250
- data: () =>
251
- dispatch([
252
- {
253
- plugin: SPACE_PLUGIN,
254
- action: SpaceAction.ADD_OBJECT,
255
- data: { target: collection, object: create(CollectionType, { objects: [], views: {} }) },
256
- },
257
- ...(navigable
258
- ? [
259
- {
260
- action: NavigationAction.OPEN,
261
- },
262
- ]
263
- : []),
264
- ]),
265
- properties: {
266
- label: ['create collection label', { ns: SPACE_PLUGIN }],
267
- icon: 'ph--cards-three--regular',
268
- testId: 'spacePlugin.createCollection',
269
- },
270
- },
271
- ],
272
- },
273
- ];
274
-
275
- return actions;
276
- };
277
-
278
213
  export const constructSpaceActions = ({
279
214
  space,
280
215
  dispatch,
@@ -310,6 +245,19 @@ export const constructSpaceActions = ({
310
245
  if (state === SpaceState.SPACE_READY && !hasPendingMigration) {
311
246
  const locked = space.properties[COMPOSER_SPACE_LOCK];
312
247
  actions.push(
248
+ {
249
+ id: getId(SpaceAction.OPEN_CREATE_OBJECT),
250
+ type: ACTION_TYPE,
251
+ data: async () => {
252
+ await dispatch({ plugin: SPACE_PLUGIN, action: SpaceAction.OPEN_CREATE_OBJECT, data: { target: space } });
253
+ },
254
+ properties: {
255
+ label: ['create object in space label', { ns: SPACE_PLUGIN }],
256
+ icon: 'ph--plus--regular',
257
+ disposition: 'toolbar',
258
+ testId: 'spacePlugin.createObject',
259
+ },
260
+ },
313
261
  {
314
262
  id: getId(SpaceAction.SHARE),
315
263
  type: ACTION_TYPE,
@@ -451,65 +399,6 @@ export const createObjectNode = ({
451
399
  };
452
400
  };
453
401
 
454
- export const constructObjectActionGroups = ({
455
- object,
456
- navigable,
457
- dispatch,
458
- }: {
459
- object: ReactiveEchoObject<any>;
460
- navigable: boolean;
461
- dispatch: IntentDispatcher;
462
- }) => {
463
- if (!(object instanceof CollectionType)) {
464
- return [];
465
- }
466
-
467
- const collection = object;
468
- const getId = (id: string) => `${id}/${fullyQualifiedId(object)}`;
469
- const actions: NodeArg<typeof actionGroupSymbol>[] = [
470
- {
471
- id: getId(SpaceAction.ADD_OBJECT),
472
- type: ACTION_GROUP_TYPE,
473
- data: actionGroupSymbol,
474
- properties: {
475
- label: ['create object in collection label', { ns: SPACE_PLUGIN }],
476
- icon: 'ph--plus--regular',
477
- disposition: 'toolbar',
478
- menuType: 'searchList',
479
- testId: 'spacePlugin.createObject',
480
- },
481
- nodes: [
482
- {
483
- id: getId(SpaceAction.ADD_OBJECT.replace('object', 'collection')),
484
- type: ACTION_TYPE,
485
- data: () =>
486
- dispatch([
487
- {
488
- plugin: SPACE_PLUGIN,
489
- action: SpaceAction.ADD_OBJECT,
490
- data: { target: collection, object: create(CollectionType, { objects: [], views: {} }) },
491
- },
492
- ...(navigable
493
- ? [
494
- {
495
- action: NavigationAction.OPEN,
496
- },
497
- ]
498
- : []),
499
- ]),
500
- properties: {
501
- label: ['create collection label', { ns: SPACE_PLUGIN }],
502
- icon: 'ph--cards-three--regular',
503
- testId: 'spacePlugin.createCollection',
504
- },
505
- },
506
- ],
507
- },
508
- ];
509
-
510
- return actions;
511
- };
512
-
513
402
  export const constructObjectActions = ({
514
403
  node,
515
404
  dispatch,
@@ -520,6 +409,27 @@ export const constructObjectActions = ({
520
409
  const object = node.data;
521
410
  const getId = (id: string) => `${id}/${fullyQualifiedId(object)}`;
522
411
  const actions: NodeArg<ActionData>[] = [
412
+ ...(object instanceof CollectionType
413
+ ? [
414
+ {
415
+ id: getId(SpaceAction.ADD_OBJECT),
416
+ type: ACTION_TYPE,
417
+ data: async () => {
418
+ await dispatch({
419
+ plugin: SPACE_PLUGIN,
420
+ action: SpaceAction.OPEN_CREATE_OBJECT,
421
+ data: { target: object },
422
+ });
423
+ },
424
+ properties: {
425
+ label: ['create object in collection label', { ns: SPACE_PLUGIN }],
426
+ icon: 'ph--plus--regular',
427
+ disposition: 'toolbar',
428
+ testId: 'spacePlugin.createObject',
429
+ },
430
+ },
431
+ ]
432
+ : []),
523
433
  {
524
434
  id: getId(SpaceAction.RENAME_OBJECT),
525
435
  type: ACTION_TYPE,
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const SPACE_PLUGIN = 'dxos.org/plugin/space';\nexport const SPACE_PLUGIN_SHORT_ID = 'space';\n\nexport default {\n id: SPACE_PLUGIN,\n shortId: SPACE_PLUGIN_SHORT_ID,\n name: 'Spaces',\n} satisfies PluginMeta;\n\nconst SPACE_ACTION = `${SPACE_PLUGIN}/action`;\nexport enum SpaceAction {\n CREATE = `${SPACE_ACTION}/create`,\n JOIN = `${SPACE_ACTION}/join`,\n SHARE = `${SPACE_ACTION}/share`,\n LOCK = `${SPACE_ACTION}/lock`,\n UNLOCK = `${SPACE_ACTION}/unlock`,\n RENAME = `${SPACE_ACTION}/rename`,\n OPEN = `${SPACE_ACTION}/open`,\n CLOSE = `${SPACE_ACTION}/close`,\n MIGRATE = `${SPACE_ACTION}/migrate`,\n ADD_OBJECT = `${SPACE_ACTION}/add-object`,\n REMOVE_OBJECTS = `${SPACE_ACTION}/remove-objects`,\n RENAME_OBJECT = `${SPACE_ACTION}/rename-object`,\n DUPLICATE_OBJECT = `${SPACE_ACTION}/duplicate-object`,\n WAIT_FOR_OBJECT = `${SPACE_ACTION}/wait-for-object`,\n TOGGLE_HIDDEN = `${SPACE_ACTION}/toggle-hidden`,\n OPEN_SETTINGS = `${SPACE_ACTION}/open-settings`,\n}\n"],
5
- "mappings": ";AAMO,IAAMA,eAAe;AACrB,IAAMC,wBAAwB;AAErC,IAAA,eAAe;EACbC,IAAIF;EACJG,SAASF;EACTG,MAAM;AACR;AAEA,IAAMC,eAAe,GAAGL,YAAAA;;UACZM,cAAAA;wCACD,GAAGD,YAAAA,SAAqB,IAAA;sCAC1B,GAAGA,YAAAA,OAAmB,IAAA;uCACrB,GAAGA,YAAAA,QAAoB,IAAA;sCACxB,GAAGA,YAAAA,OAAmB,IAAA;wCACpB,GAAGA,YAAAA,SAAqB,IAAA;wCACxB,GAAGA,YAAAA,SAAqB,IAAA;sCAC1B,GAAGA,YAAAA,OAAmB,IAAA;uCACrB,GAAGA,YAAAA,QAAoB,IAAA;yCACrB,GAAGA,YAAAA,UAAsB,IAAA;4CACtB,GAAGA,YAAAA,aAAyB,IAAA;gDACxB,GAAGA,YAAAA,iBAA6B,IAAA;+CACjC,GAAGA,YAAAA,gBAA4B,IAAA;kDAC5B,GAAGA,YAAAA,mBAA+B,IAAA;iDACnC,GAAGA,YAAAA,kBAA8B,IAAA;+CACnC,GAAGA,YAAAA,gBAA4B,IAAA;+CAC/B,GAAGA,YAAAA,gBAA4B,IAAA;GAhBrCC,gBAAAA,cAAAA,CAAAA,EAAAA;",
6
- "names": ["SPACE_PLUGIN", "SPACE_PLUGIN_SHORT_ID", "id", "shortId", "name", "SPACE_ACTION", "SpaceAction"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/collection.ts", "../../../src/types/thread.ts", "../../../src/types/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\nexport class CollectionType extends TypedObject({ typename: 'dxos.org/type/Collection', version: '0.1.0' })({\n name: S.optional(S.String),\n objects: S.mutable(S.Array(ref(Expando))),\n // Key is schema typename and value is reference to a view object of the associated schema.\n // Having collection reference the views rather than vice versa ensures that the state converges to a single view per key (i.e. type).\n // This also leaves open a future where this key could be changed to allow for multiple stack views per section.\n // TODO(wittjosiah): Any way to make this more type safe?\n // TODO(wittjosiah): Should the views be separate objects or just be schemas for view data in this record?\n views: S.mutable(S.Record({ key: S.String, value: ref(Expando) })),\n}) {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(wittjosiah): These types were placed here rather than in @dxos/plugin-thread\n// in order to avoid a circular dependency between threads and other objects that use threads.\n\n// TODO(wittjosiah): Factor out to halo?\nexport class ContactType extends TypedObject({ typename: 'dxos.org/type/Contact', version: '0.1.0' })({\n name: S.optional(S.String),\n identifiers: S.mutable(\n S.Array(\n S.Struct({\n type: S.String,\n value: S.String,\n }),\n ),\n ),\n}) {}\n\nexport const ActorSchema = S.mutable(\n S.Struct({\n contact: S.optional(ref(ContactType)),\n // TODO(wittjosiah): Should the below fields just be the contact schema?\n // i.e. it should either be a reference to an existing contact or an inline contact schema.\n identityKey: S.optional(S.String),\n // TODO(burdon): Generalize to handle/identifier?\n email: S.optional(S.String),\n name: S.optional(S.String),\n }),\n);\n\nexport type ActorType = S.Schema.Type<typeof ActorSchema>;\n\nexport enum MessageState {\n NONE = 0,\n ARCHIVED = 1,\n DELETED = 2,\n SPAM = 3,\n}\n\nexport class MessageType extends TypedObject({ typename: 'dxos.org/type/Message', version: '0.1.0' })({\n /** ISO date string when the message was sent. */\n timestamp: S.String,\n /** Message state. */\n state: S.optional(S.Enums(MessageState)),\n /** Identity of the message sender. */\n sender: ActorSchema,\n /** Text content of the message. */\n text: S.String,\n /** Non-text content sent with a message (e.g., files, polls, etc.) */\n parts: S.optional(S.mutable(S.Array(ref(Expando)))),\n /** Custom properties for specific message types (e.g. email subject or cc fields). */\n properties: S.optional(S.mutable(S.Record({ key: S.String, value: S.Any }))),\n // TODO(wittjosiah): Add read status:\n // - Read receipts need to be per space member.\n // - Read receipts don't need to be added to schema until they being implemented.\n /** Context of the application when message was created. */\n // TODO(burdon): Evolve \"attention object\" to be current UX state? E.g., of Deck?\n context: S.optional(ref(Expando)),\n}) {}\n\nexport const ThreadStatus = S.Union(S.Literal('staged'), S.Literal('active'), S.Literal('resolved'));\n\nexport class ThreadType extends TypedObject({ typename: 'dxos.org/type/Thread', version: '0.1.0' })({\n name: S.optional(S.String),\n /** AM cursor-range: 'from:to'. */\n anchor: S.optional(S.String),\n status: S.optional(ThreadStatus),\n messages: S.mutable(S.Array(ref(MessageType))),\n}) {}\n\nexport class ChannelType extends TypedObject({ typename: 'dxos.org/type/Channel', version: '0.1.0' })({\n name: S.optional(S.String),\n threads: S.mutable(S.Array(ref(ThreadType))),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n GraphSerializerProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SettingsProvides,\n SurfaceProvides,\n TranslationsProvides,\n Plugin,\n} from '@dxos/app-framework';\nimport { type Expando } from '@dxos/echo-schema';\nimport { type SchemaProvides } from '@dxos/plugin-client';\nimport { type PanelProvides } from '@dxos/plugin-deck/types';\nimport { type PublicKey } from '@dxos/react-client';\nimport { type Space } from '@dxos/react-client/echo';\nimport { type Label } from '@dxos/react-ui';\nimport { type ComplexMap } from '@dxos/util';\n\nexport const SPACE_DIRECTORY_HANDLE = 'dxos.org/plugin/space/directory';\n\nexport type ObjectViewerProps = {\n lastSeen: number;\n currentlyAttended: boolean;\n};\n\nexport type ObjectId = string;\n\nexport type PluginState = {\n /**\n * Which objects are currently being viewed by which peers.\n */\n viewersByObject: Record<ObjectId, ComplexMap<PublicKey, ObjectViewerProps>>;\n\n /**\n * Which peers are currently viewing which objects.\n */\n viewersByIdentity: ComplexMap<PublicKey, Set<ObjectId>>;\n\n /**\n * Object that was linked to directly but not found and is being awaited.\n */\n awaiting: string | undefined;\n\n /**\n * Cached space names, used when spaces are closed or loading.\n */\n spaceNames: Record<string, string>;\n\n /**\n * Which spaces have an SDK migration running currently.\n */\n // TODO(wittjosiah): Factor out to sdk. Migration running should probably be a space state.\n sdkMigrationRunning: Record<string, boolean>;\n\n /**\n * Whether or not the user can navigate to collections in the graph.\n * Determined by whether or not there is an available plugin that can render a collection.\n */\n navigableCollections: boolean;\n};\n\nexport type SpaceSettingsProps = {\n /**\n * Show closed spaces.\n */\n showHidden?: boolean;\n\n /**\n * Action to perform when a space is created.\n */\n onSpaceCreate?: string;\n};\n\nexport type SpaceInitProvides = {\n space: {\n onSpaceCreate: {\n label: Label;\n action: string;\n };\n };\n};\n\nexport const parseSpaceInitPlugin = (plugin: Plugin) =>\n typeof (plugin.provides as any).space?.onSpaceCreate === 'object' ? (plugin as Plugin<SpaceInitProvides>) : undefined;\n\nexport type SpacePluginProvides = SurfaceProvides &\n IntentResolverProvides &\n GraphBuilderProvides &\n GraphSerializerProvides &\n MetadataRecordsProvides &\n SettingsProvides<SpaceSettingsProps> &\n TranslationsProvides &\n SchemaProvides &\n PanelProvides & {\n space: Readonly<PluginState>;\n };\n\n// TODO(wittjosiah): Reconcile with graph export serializers.\n\nexport type SerializerMap = Record<string, TypedObjectSerializer>;\n\nexport interface TypedObjectSerializer<T extends Expando = Expando> {\n serialize(params: { object: T }): Promise<string>;\n\n /**\n * @param params.content\n * @param params.space Space to use for deserializing schema references.\n * @param params.newId Generate new ID for deserialized object.\n */\n deserialize(params: { content: string; space: Space; newId?: boolean }): Promise<T>;\n}\n"],
5
- "mappings": "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",
6
- "names": ["import_echo_schema", "CollectionType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "objects", "mutable", "Array", "ref", "Expando", "views", "Record", "key", "value", "ContactType", "identifiers", "Struct", "type", "ActorSchema", "contact", "identityKey", "email", "MessageState", "MessageType", "timestamp", "state", "Enums", "sender", "text", "parts", "properties", "Any", "context", "ThreadStatus", "Union", "Literal", "ThreadType", "anchor", "status", "messages", "ChannelType", "threads", "SPACE_DIRECTORY_HANDLE", "parseSpaceInitPlugin", "plugin", "provides", "space", "onSpaceCreate", "undefined"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const SPACE_PLUGIN = 'dxos.org/plugin/space';\nexport const SPACE_PLUGIN_SHORT_ID = 'space';\n\nexport default {\n id: SPACE_PLUGIN,\n shortId: SPACE_PLUGIN_SHORT_ID,\n name: 'Spaces',\n} satisfies PluginMeta;\n\nconst SPACE_ACTION = `${SPACE_PLUGIN}/action`;\nexport enum SpaceAction {\n CREATE = `${SPACE_ACTION}/create`,\n JOIN = `${SPACE_ACTION}/join`,\n SHARE = `${SPACE_ACTION}/share`,\n LOCK = `${SPACE_ACTION}/lock`,\n UNLOCK = `${SPACE_ACTION}/unlock`,\n RENAME = `${SPACE_ACTION}/rename`,\n OPEN = `${SPACE_ACTION}/open`,\n CLOSE = `${SPACE_ACTION}/close`,\n MIGRATE = `${SPACE_ACTION}/migrate`,\n ADD_OBJECT = `${SPACE_ACTION}/add-object`,\n REMOVE_OBJECTS = `${SPACE_ACTION}/remove-objects`,\n RENAME_OBJECT = `${SPACE_ACTION}/rename-object`,\n DUPLICATE_OBJECT = `${SPACE_ACTION}/duplicate-object`,\n WAIT_FOR_OBJECT = `${SPACE_ACTION}/wait-for-object`,\n TOGGLE_HIDDEN = `${SPACE_ACTION}/toggle-hidden`,\n OPEN_SETTINGS = `${SPACE_ACTION}/open-settings`,\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAMA,eAAe;AACrB,IAAMC,wBAAwB;AAErC,IAAA,eAAe;EACbC,IAAIF;EACJG,SAASF;EACTG,MAAM;AACR;AAEA,IAAMC,eAAe,GAAGL,YAAAA;;UACZM,cAAAA;wCACD,GAAGD,YAAAA,SAAqB,IAAA;sCAC1B,GAAGA,YAAAA,OAAmB,IAAA;uCACrB,GAAGA,YAAAA,QAAoB,IAAA;sCACxB,GAAGA,YAAAA,OAAmB,IAAA;wCACpB,GAAGA,YAAAA,SAAqB,IAAA;wCACxB,GAAGA,YAAAA,SAAqB,IAAA;sCAC1B,GAAGA,YAAAA,OAAmB,IAAA;uCACrB,GAAGA,YAAAA,QAAoB,IAAA;yCACrB,GAAGA,YAAAA,UAAsB,IAAA;4CACtB,GAAGA,YAAAA,aAAyB,IAAA;gDACxB,GAAGA,YAAAA,iBAA6B,IAAA;+CACjC,GAAGA,YAAAA,gBAA4B,IAAA;kDAC5B,GAAGA,YAAAA,mBAA+B,IAAA;iDACnC,GAAGA,YAAAA,kBAA8B,IAAA;+CACnC,GAAGA,YAAAA,gBAA4B,IAAA;+CAC/B,GAAGA,YAAAA,gBAA4B,IAAA;GAhBrCC,gBAAAA,cAAAA,CAAAA,EAAAA;",
6
- "names": ["SPACE_PLUGIN", "SPACE_PLUGIN_SHORT_ID", "id", "shortId", "name", "SPACE_ACTION", "SpaceAction"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const SPACE_PLUGIN = 'dxos.org/plugin/space';\nexport const SPACE_PLUGIN_SHORT_ID = 'space';\n\nexport default {\n id: SPACE_PLUGIN,\n shortId: SPACE_PLUGIN_SHORT_ID,\n name: 'Spaces',\n} satisfies PluginMeta;\n\nconst SPACE_ACTION = `${SPACE_PLUGIN}/action`;\nexport enum SpaceAction {\n CREATE = `${SPACE_ACTION}/create`,\n JOIN = `${SPACE_ACTION}/join`,\n SHARE = `${SPACE_ACTION}/share`,\n LOCK = `${SPACE_ACTION}/lock`,\n UNLOCK = `${SPACE_ACTION}/unlock`,\n RENAME = `${SPACE_ACTION}/rename`,\n OPEN = `${SPACE_ACTION}/open`,\n CLOSE = `${SPACE_ACTION}/close`,\n MIGRATE = `${SPACE_ACTION}/migrate`,\n ADD_OBJECT = `${SPACE_ACTION}/add-object`,\n REMOVE_OBJECTS = `${SPACE_ACTION}/remove-objects`,\n RENAME_OBJECT = `${SPACE_ACTION}/rename-object`,\n DUPLICATE_OBJECT = `${SPACE_ACTION}/duplicate-object`,\n WAIT_FOR_OBJECT = `${SPACE_ACTION}/wait-for-object`,\n TOGGLE_HIDDEN = `${SPACE_ACTION}/toggle-hidden`,\n OPEN_SETTINGS = `${SPACE_ACTION}/open-settings`,\n}\n"],
5
- "mappings": ";;;AAMO,IAAMA,eAAe;AACrB,IAAMC,wBAAwB;AAErC,IAAA,eAAe;EACbC,IAAIF;EACJG,SAASF;EACTG,MAAM;AACR;AAEA,IAAMC,eAAe,GAAGL,YAAAA;;UACZM,cAAAA;wCACD,GAAGD,YAAAA,SAAqB,IAAA;sCAC1B,GAAGA,YAAAA,OAAmB,IAAA;uCACrB,GAAGA,YAAAA,QAAoB,IAAA;sCACxB,GAAGA,YAAAA,OAAmB,IAAA;wCACpB,GAAGA,YAAAA,SAAqB,IAAA;wCACxB,GAAGA,YAAAA,SAAqB,IAAA;sCAC1B,GAAGA,YAAAA,OAAmB,IAAA;uCACrB,GAAGA,YAAAA,QAAoB,IAAA;yCACrB,GAAGA,YAAAA,UAAsB,IAAA;4CACtB,GAAGA,YAAAA,aAAyB,IAAA;gDACxB,GAAGA,YAAAA,iBAA6B,IAAA;+CACjC,GAAGA,YAAAA,gBAA4B,IAAA;kDAC5B,GAAGA,YAAAA,mBAA+B,IAAA;iDACnC,GAAGA,YAAAA,kBAA8B,IAAA;+CACnC,GAAGA,YAAAA,gBAA4B,IAAA;+CAC/B,GAAGA,YAAAA,gBAA4B,IAAA;GAhBrCC,gBAAAA,cAAAA,CAAAA,EAAAA;",
6
- "names": ["SPACE_PLUGIN", "SPACE_PLUGIN_SHORT_ID", "id", "shortId", "name", "SPACE_ACTION", "SpaceAction"]
7
- }