@dxos/plugin-space 0.6.12-main.5cc132e → 0.6.12-main.89e9959
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{chunk-DTVUOG2C.mjs → chunk-WBMH5WIP.mjs} +14 -2
- package/dist/lib/browser/chunk-WBMH5WIP.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +403 -179
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types/index.mjs +7 -3
- package/dist/lib/node/{chunk-CVZPI2P3.cjs → chunk-GF3SRAQM.cjs} +20 -6
- package/dist/lib/node/chunk-GF3SRAQM.cjs.map +7 -0
- package/dist/lib/node/index.cjs +511 -290
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +14 -10
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/{chunk-LZEGRS7H.mjs → chunk-GM2YUC77.mjs} +3 -1
- package/dist/lib/node-esm/{chunk-LZEGRS7H.mjs.map → chunk-GM2YUC77.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-DTVUOG2C.mjs → chunk-N5VC55UM.mjs} +16 -2
- package/dist/lib/node-esm/chunk-N5VC55UM.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +405 -180
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/meta.mjs +2 -1
- package/dist/lib/node-esm/types/index.mjs +8 -3
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/components/SaveStatus.d.ts.map +1 -1
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts +2 -0
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceMain/SpaceMain.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +2 -0
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +13 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +115 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/index.d.ts +2 -0
- package/dist/types/src/components/SyncStatus/index.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/types.d.ts +14 -0
- package/dist/types/src/components/SyncStatus/types.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/thread.d.ts +13 -0
- package/dist/types/src/types/thread.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +18 -1
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +1 -4
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +36 -34
- package/src/SpacePlugin.tsx +29 -14
- package/src/components/SaveStatus.tsx +6 -9
- package/src/components/SpaceMain/SpaceMain.tsx +1 -22
- package/src/components/SpacePresence.tsx +1 -1
- package/src/components/SpaceSettings.tsx +32 -3
- package/src/components/SyncStatus/SyncStatus.stories.tsx +62 -0
- package/src/components/SyncStatus/SyncStatus.tsx +188 -0
- package/src/components/SyncStatus/index.ts +5 -0
- package/src/components/SyncStatus/types.ts +77 -0
- package/src/components/index.ts +1 -0
- package/src/translations.ts +2 -0
- package/src/types/thread.ts +9 -0
- package/src/types/types.ts +25 -1
- package/src/util.tsx +15 -50
- package/dist/lib/browser/chunk-DTVUOG2C.mjs.map +0 -7
- package/dist/lib/node/chunk-CVZPI2P3.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-DTVUOG2C.mjs.map +0 -7
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { GraphBuilderProvides, GraphSerializerProvides, IntentResolverProvides, MetadataRecordsProvides, SettingsProvides, SurfaceProvides, TranslationsProvides } from '@dxos/app-framework';
|
|
1
|
+
import type { GraphBuilderProvides, GraphSerializerProvides, IntentResolverProvides, MetadataRecordsProvides, SettingsProvides, SurfaceProvides, TranslationsProvides, Plugin } from '@dxos/app-framework';
|
|
2
2
|
import { type Expando } from '@dxos/echo-schema';
|
|
3
3
|
import { type SchemaProvides } from '@dxos/plugin-client';
|
|
4
4
|
import { type PublicKey } from '@dxos/react-client';
|
|
5
|
+
import { type Label } from '@dxos/react-ui';
|
|
5
6
|
import { type ComplexMap } from '@dxos/util';
|
|
6
7
|
export declare const SPACE_DIRECTORY_HANDLE = "dxos.org/plugin/space/directory";
|
|
7
8
|
export type ObjectViewerProps = {
|
|
@@ -32,8 +33,24 @@ export type PluginState = {
|
|
|
32
33
|
sdkMigrationRunning: Record<string, boolean>;
|
|
33
34
|
};
|
|
34
35
|
export type SpaceSettingsProps = {
|
|
36
|
+
/**
|
|
37
|
+
* Show closed spaces.
|
|
38
|
+
*/
|
|
35
39
|
showHidden?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Action to perform when a space is created.
|
|
42
|
+
*/
|
|
43
|
+
onSpaceCreate?: string;
|
|
44
|
+
};
|
|
45
|
+
export type SpaceInitProvides = {
|
|
46
|
+
space: {
|
|
47
|
+
onSpaceCreate: {
|
|
48
|
+
label: Label;
|
|
49
|
+
action: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
36
52
|
};
|
|
53
|
+
export declare const parseSpaceInitPlugin: (plugin: Plugin) => Plugin<SpaceInitProvides> | undefined;
|
|
37
54
|
export type SpacePluginProvides = SurfaceProvides & IntentResolverProvides & GraphBuilderProvides & GraphSerializerProvides & MetadataRecordsProvides & SettingsProvides<SpaceSettingsProps> & TranslationsProvides & SchemaProvides & {
|
|
38
55
|
space: Readonly<PluginState>;
|
|
39
56
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,MAAM,EACP,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,eAAO,MAAM,sBAAsB,oCAAoC,CAAC;AAExE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAE5E;;OAEG;IACH,iBAAiB,EAAE,UAAU,CAAC,SAAS,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;IAExD;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,SA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phosphor-icons/react';
|
|
2
|
-
import React from 'react';
|
|
3
1
|
import { type MetadataResolver, type IntentDispatcher } from '@dxos/app-framework';
|
|
4
2
|
import { type EchoReactiveObject, type Expando } from '@dxos/echo-schema';
|
|
5
3
|
import { actionGroupSymbol, type ActionData, type Graph, type Node, type NodeArg } from '@dxos/plugin-graph';
|
|
@@ -36,8 +34,7 @@ export declare const constructSpaceNode: ({ space, personal, namesCache, resolve
|
|
|
36
34
|
ns: string;
|
|
37
35
|
}];
|
|
38
36
|
description: any;
|
|
39
|
-
icon:
|
|
40
|
-
iconSymbol: string;
|
|
37
|
+
icon: string;
|
|
41
38
|
disabled: boolean;
|
|
42
39
|
testId: string;
|
|
43
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/util.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/util.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,gBAAgB,EAAoB,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACrG,OAAO,EACL,KAAK,kBAAkB,EAIvB,KAAK,OAAO,EAIb,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAGL,iBAAiB,EACjB,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,IAAI,EAET,KAAK,OAAO,EAIb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAML,KAAK,IAAI,EACT,KAAK,YAAY,EAEjB,KAAK,YAAY,EACjB,KAAK,KAAK,EACX,MAAM,yBAAyB,CAAC;AAKjC,eAAO,MAAM,MAAM,iCAA2B,CAAC;AAC/C,eAAO,MAAM,UAAU,wBAAwB,CAAC;AAChD,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAEhE,eAAO,MAAM,MAAM,kBAAkB,CAAC;AAItC;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,S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AC;AAEF,eAAO,MAAM,sBAAsB,wBAGhC;IACD,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,0BAiEA,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,UAAW,KAAK,WAAW,MAAM,sBAW3D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,WACnB,kBAAkB,CAAC,GAAG,CAAC,WACtB,gBAAgB,KACxB,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAenC,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,WAAW,WAAkB,OAAO,WAAW,gBAAgB,KAAG,OAAO,CAAC,OAAO,CAQ7F,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-space",
|
|
3
|
-
"version": "0.6.12-main.
|
|
3
|
+
"version": "0.6.12-main.89e9959",
|
|
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",
|
|
@@ -48,36 +48,39 @@
|
|
|
48
48
|
"src"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
+
"@effect/schema": "^0.67.16",
|
|
51
52
|
"@preact/signals-core": "^1.6.0",
|
|
52
53
|
"jszip": "^3.10.1",
|
|
53
54
|
"localforage": "^1.10.0",
|
|
54
55
|
"lodash.get": "^4.4.2",
|
|
55
56
|
"react-drag-drop-files": "^2.3.8",
|
|
56
57
|
"react-is": "~18.2.0",
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/client": "0.6.12-main.
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/keys": "0.6.12-main.
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/migrations": "0.6.12-main.
|
|
69
|
-
"@dxos/plugin-attention": "0.6.12-main.
|
|
70
|
-
"@dxos/plugin-client": "0.6.12-main.
|
|
71
|
-
"@dxos/plugin-graph": "0.6.12-main.
|
|
72
|
-
"@dxos/plugin-metadata": "0.6.12-main.
|
|
73
|
-
"@dxos/plugin-settings": "0.6.12-main.
|
|
74
|
-
"@dxos/plugin-status-bar": "0.6.12-main.
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/react-
|
|
78
|
-
"@dxos/react-
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/
|
|
58
|
+
"@dxos/async": "0.6.12-main.89e9959",
|
|
59
|
+
"@dxos/app-framework": "0.6.12-main.89e9959",
|
|
60
|
+
"@dxos/automerge": "0.6.12-main.89e9959",
|
|
61
|
+
"@dxos/client": "0.6.12-main.89e9959",
|
|
62
|
+
"@dxos/context": "0.6.12-main.89e9959",
|
|
63
|
+
"@dxos/display-name": "0.6.12-main.89e9959",
|
|
64
|
+
"@dxos/invariant": "0.6.12-main.89e9959",
|
|
65
|
+
"@dxos/echo-schema": "0.6.12-main.89e9959",
|
|
66
|
+
"@dxos/keys": "0.6.12-main.89e9959",
|
|
67
|
+
"@dxos/local-storage": "0.6.12-main.89e9959",
|
|
68
|
+
"@dxos/log": "0.6.12-main.89e9959",
|
|
69
|
+
"@dxos/migrations": "0.6.12-main.89e9959",
|
|
70
|
+
"@dxos/plugin-attention": "0.6.12-main.89e9959",
|
|
71
|
+
"@dxos/plugin-client": "0.6.12-main.89e9959",
|
|
72
|
+
"@dxos/plugin-graph": "0.6.12-main.89e9959",
|
|
73
|
+
"@dxos/plugin-metadata": "0.6.12-main.89e9959",
|
|
74
|
+
"@dxos/plugin-settings": "0.6.12-main.89e9959",
|
|
75
|
+
"@dxos/plugin-status-bar": "0.6.12-main.89e9959",
|
|
76
|
+
"@dxos/plugin-observability": "0.6.12-main.89e9959",
|
|
77
|
+
"@dxos/protocols": "0.6.12-main.89e9959",
|
|
78
|
+
"@dxos/react-client": "0.6.12-main.89e9959",
|
|
79
|
+
"@dxos/react-ui-attention": "0.6.12-main.89e9959",
|
|
80
|
+
"@dxos/react-ui-editor": "0.6.12-main.89e9959",
|
|
81
|
+
"@dxos/react-ui-syntax-highlighter": "0.6.12-main.89e9959",
|
|
82
|
+
"@dxos/shell": "0.6.12-main.89e9959",
|
|
83
|
+
"@dxos/util": "0.6.12-main.89e9959"
|
|
81
84
|
},
|
|
82
85
|
"devDependencies": {
|
|
83
86
|
"@babel/core": "^7.18.13",
|
|
@@ -88,17 +91,16 @@
|
|
|
88
91
|
"react": "~18.2.0",
|
|
89
92
|
"react-dom": "~18.2.0",
|
|
90
93
|
"vite": "5.4.7",
|
|
91
|
-
"@dxos/react-ui": "0.6.12-main.
|
|
92
|
-
"@dxos/
|
|
93
|
-
"@dxos/
|
|
94
|
+
"@dxos/react-ui": "0.6.12-main.89e9959",
|
|
95
|
+
"@dxos/react-ui-theme": "0.6.12-main.89e9959",
|
|
96
|
+
"@dxos/storybook-utils": "0.6.12-main.89e9959"
|
|
94
97
|
},
|
|
95
|
-
"
|
|
96
|
-
"@babel/core": "^7.18.13",
|
|
98
|
+
"peerDependencies": {
|
|
97
99
|
"@phosphor-icons/react": "^2.1.5",
|
|
98
|
-
"react": "
|
|
99
|
-
"react-dom": "
|
|
100
|
-
"@dxos/react-ui": "0.6.12-main.
|
|
101
|
-
"@dxos/react-ui-theme": "0.6.12-main.
|
|
100
|
+
"react": "~18.2.0",
|
|
101
|
+
"react-dom": "~18.2.0",
|
|
102
|
+
"@dxos/react-ui": "0.6.12-main.89e9959",
|
|
103
|
+
"@dxos/react-ui-theme": "0.6.12-main.89e9959"
|
|
102
104
|
},
|
|
103
105
|
"publishConfig": {
|
|
104
106
|
"access": "public"
|
package/src/SpacePlugin.tsx
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { CardsThree, type IconProps, Plus, SignIn, Warning } from '@phosphor-icons/react';
|
|
6
5
|
import { effect, signal } from '@preact/signals-core';
|
|
7
6
|
import React from 'react';
|
|
8
7
|
|
|
@@ -67,6 +66,7 @@ import {
|
|
|
67
66
|
SmallPresenceLive,
|
|
68
67
|
SpacePresence,
|
|
69
68
|
SpaceSettings,
|
|
69
|
+
SyncStatus,
|
|
70
70
|
} from './components';
|
|
71
71
|
import meta, { SPACE_PLUGIN, SpaceAction } from './meta';
|
|
72
72
|
import translations from './translations';
|
|
@@ -119,7 +119,9 @@ export const SpacePlugin = ({
|
|
|
119
119
|
firstRun,
|
|
120
120
|
onFirstRun,
|
|
121
121
|
}: SpacePluginOptions = {}): PluginDefinition<SpacePluginProvides> => {
|
|
122
|
-
const settings = new LocalStorageStore<SpaceSettingsProps>(SPACE_PLUGIN
|
|
122
|
+
const settings = new LocalStorageStore<SpaceSettingsProps>(SPACE_PLUGIN, {
|
|
123
|
+
onSpaceCreate: 'dxos.org/plugin/markdown/action/create',
|
|
124
|
+
});
|
|
123
125
|
const state = new LocalStorageStore<PluginState>(SPACE_PLUGIN, {
|
|
124
126
|
awaiting: undefined,
|
|
125
127
|
spaceNames: {},
|
|
@@ -341,8 +343,7 @@ export const SpacePlugin = ({
|
|
|
341
343
|
records: {
|
|
342
344
|
[CollectionType.typename]: {
|
|
343
345
|
placeholder: ['unnamed collection label', { ns: SPACE_PLUGIN }],
|
|
344
|
-
icon:
|
|
345
|
-
iconSymbol: 'ph--cards-three--regular',
|
|
346
|
+
icon: 'ph--cards-three--regular',
|
|
346
347
|
// TODO(wittjosiah): Move out of metadata.
|
|
347
348
|
loadReferences: (collection: CollectionType) =>
|
|
348
349
|
loadObjectReferences(collection, (collection) => [
|
|
@@ -363,7 +364,11 @@ export const SpacePlugin = ({
|
|
|
363
364
|
case 'main':
|
|
364
365
|
// TODO(wittjosiah): Need to avoid shotgun parsing space state everywhere.
|
|
365
366
|
return isSpace(primary) && primary.state.get() === SpaceState.SPACE_READY ? (
|
|
366
|
-
<Surface
|
|
367
|
+
<Surface
|
|
368
|
+
data={{ active: primary.properties[CollectionType.typename], id: primary.id }}
|
|
369
|
+
role={role}
|
|
370
|
+
{...rest}
|
|
371
|
+
/>
|
|
367
372
|
) : primary instanceof CollectionType ? (
|
|
368
373
|
{ node: <CollectionMain collection={primary} />, disposition: 'fallback' }
|
|
369
374
|
) : typeof primary === 'string' && primary.length === OBJECT_ID_LENGTH ? (
|
|
@@ -443,7 +448,12 @@ export const SpacePlugin = ({
|
|
|
443
448
|
return <MenuFooter object={data.object} />;
|
|
444
449
|
}
|
|
445
450
|
case 'status': {
|
|
446
|
-
return
|
|
451
|
+
return (
|
|
452
|
+
<>
|
|
453
|
+
<SyncStatus />
|
|
454
|
+
<SaveStatus />
|
|
455
|
+
</>
|
|
456
|
+
);
|
|
447
457
|
}
|
|
448
458
|
default:
|
|
449
459
|
return null;
|
|
@@ -544,8 +554,7 @@ export const SpacePlugin = ({
|
|
|
544
554
|
},
|
|
545
555
|
properties: {
|
|
546
556
|
label: ['create space label', { ns: SPACE_PLUGIN }],
|
|
547
|
-
icon:
|
|
548
|
-
iconSymbol: 'ph--plus--regular',
|
|
557
|
+
icon: 'ph--plus--regular',
|
|
549
558
|
disposition: 'toolbar',
|
|
550
559
|
testId: 'spacePlugin.createSpace',
|
|
551
560
|
},
|
|
@@ -565,8 +574,7 @@ export const SpacePlugin = ({
|
|
|
565
574
|
},
|
|
566
575
|
properties: {
|
|
567
576
|
label: ['join space label', { ns: SPACE_PLUGIN }],
|
|
568
|
-
icon:
|
|
569
|
-
iconSymbol: 'ph--sign-in--regular',
|
|
577
|
+
icon: 'ph--sign-in--regular',
|
|
570
578
|
testId: 'spacePlugin.joinSpace',
|
|
571
579
|
},
|
|
572
580
|
},
|
|
@@ -809,6 +817,15 @@ export const SpacePlugin = ({
|
|
|
809
817
|
data: { space, id: space.id, activeParts: { main: [space.id] } },
|
|
810
818
|
|
|
811
819
|
intents: [
|
|
820
|
+
...(settings.values.onSpaceCreate
|
|
821
|
+
? [
|
|
822
|
+
[
|
|
823
|
+
{ action: settings.values.onSpaceCreate, data: { space } },
|
|
824
|
+
{ action: SpaceAction.ADD_OBJECT, data: { target: space } },
|
|
825
|
+
{ action: NavigationAction.EXPOSE },
|
|
826
|
+
],
|
|
827
|
+
]
|
|
828
|
+
: []),
|
|
812
829
|
[
|
|
813
830
|
{
|
|
814
831
|
action: ObservabilityAction.SEND_EVENT,
|
|
@@ -1024,8 +1041,7 @@ export const SpacePlugin = ({
|
|
|
1024
1041
|
title: translations[0]['en-US'][SPACE_PLUGIN]['space limit label'],
|
|
1025
1042
|
description: translations[0]['en-US'][SPACE_PLUGIN]['space limit description'],
|
|
1026
1043
|
duration: 5_000,
|
|
1027
|
-
icon:
|
|
1028
|
-
iconSymbol: 'ph--warning--regular',
|
|
1044
|
+
icon: 'ph--warning--regular',
|
|
1029
1045
|
actionLabel: translations[0]['en-US'][SPACE_PLUGIN]['remove deleted objects label'],
|
|
1030
1046
|
actionAlt: translations[0]['en-US'][SPACE_PLUGIN]['remove deleted objects alt'],
|
|
1031
1047
|
// TODO(wittjosiah): Use OS namespace.
|
|
@@ -1064,7 +1080,7 @@ export const SpacePlugin = ({
|
|
|
1064
1080
|
}
|
|
1065
1081
|
|
|
1066
1082
|
return {
|
|
1067
|
-
data: { id: object
|
|
1083
|
+
data: { id: fullyQualifiedId(object), object, activeParts: { main: [fullyQualifiedId(object)] } },
|
|
1068
1084
|
intents: [
|
|
1069
1085
|
[
|
|
1070
1086
|
{
|
|
@@ -1119,7 +1135,6 @@ export const SpacePlugin = ({
|
|
|
1119
1135
|
activeParts: {
|
|
1120
1136
|
main: deletionData.wasActive,
|
|
1121
1137
|
sidebar: deletionData.wasActive,
|
|
1122
|
-
complementary: deletionData.wasActive,
|
|
1123
1138
|
},
|
|
1124
1139
|
},
|
|
1125
1140
|
});
|
|
@@ -2,25 +2,22 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import React, { useEffect } from 'react';
|
|
5
|
+
import React, { useEffect, useState } from 'react';
|
|
7
6
|
|
|
8
|
-
import type
|
|
9
|
-
import type
|
|
7
|
+
import { type UnsubscribeCallback } from '@dxos/async';
|
|
8
|
+
import { type Client } from '@dxos/client';
|
|
10
9
|
import { type Space, type SpaceId } from '@dxos/client/echo';
|
|
11
10
|
import { Context } from '@dxos/context';
|
|
12
11
|
import { StatusBar } from '@dxos/plugin-status-bar';
|
|
13
12
|
import { useClient } from '@dxos/react-client';
|
|
14
|
-
import { useTranslation } from '@dxos/react-ui';
|
|
15
|
-
import { getSize } from '@dxos/react-ui-theme';
|
|
13
|
+
import { Icon, useTranslation } from '@dxos/react-ui';
|
|
16
14
|
|
|
17
15
|
import { SPACE_PLUGIN } from '../meta';
|
|
18
16
|
|
|
19
17
|
export const SaveStatus = () => {
|
|
20
18
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
21
19
|
const client = useClient();
|
|
22
|
-
const [state, setState] =
|
|
23
|
-
|
|
20
|
+
const [state, setState] = useState<'saved' | 'saving'>('saved');
|
|
24
21
|
useEffect(() => {
|
|
25
22
|
return createClientSaveTracker(client, (state) => {
|
|
26
23
|
setState(state);
|
|
@@ -29,7 +26,7 @@ export const SaveStatus = () => {
|
|
|
29
26
|
|
|
30
27
|
return (
|
|
31
28
|
<StatusBar.Item title={state === 'saving' ? t('saving label') : t('saved label')}>
|
|
32
|
-
{state === 'saving' ?
|
|
29
|
+
<Icon icon={state === 'saving' ? 'ph--arrows-clockwise--regular' : 'ph--check-circle--regular'} size={4} />
|
|
33
30
|
</StatusBar.Item>
|
|
34
31
|
);
|
|
35
32
|
};
|
|
@@ -6,35 +6,14 @@ 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';
|
|
10
9
|
import { SpaceState, type Space } from '@dxos/react-client/echo';
|
|
11
|
-
import {
|
|
10
|
+
import { Main, useTranslation } from '@dxos/react-ui';
|
|
12
11
|
import { getSize, mx, topbarBlockPaddingStart } from '@dxos/react-ui-theme';
|
|
13
12
|
import { ClipboardProvider } from '@dxos/shell/react';
|
|
14
13
|
|
|
15
14
|
import { SpaceMembersSection } from './SpaceMembersSection';
|
|
16
15
|
import { SPACE_PLUGIN } from '../../meta';
|
|
17
16
|
|
|
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
|
-
|
|
38
17
|
const KeyShortcuts = () => {
|
|
39
18
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
40
19
|
return (
|
|
@@ -110,7 +110,7 @@ export type MemberPresenceProps = ThemedClassName<{
|
|
|
110
110
|
|
|
111
111
|
export const FullPresence = (props: MemberPresenceProps) => {
|
|
112
112
|
const { size = 9, onMemberClick } = props;
|
|
113
|
-
const members = useDefaultValue(props.members, []);
|
|
113
|
+
const members = useDefaultValue(props.members, () => []);
|
|
114
114
|
|
|
115
115
|
if (members.length === 0) {
|
|
116
116
|
return null;
|
|
@@ -4,16 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { useIntentDispatcher } from '@dxos/app-framework';
|
|
7
|
+
import { useIntentDispatcher, useResolvePlugins } from '@dxos/app-framework';
|
|
8
8
|
import { SettingsValue } from '@dxos/plugin-settings';
|
|
9
|
-
import { Input, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { Input, Select, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
|
|
11
11
|
import { SpaceAction, SPACE_PLUGIN } from '../meta';
|
|
12
|
-
import { type SpaceSettingsProps } from '../types';
|
|
12
|
+
import { parseSpaceInitPlugin, 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);
|
|
17
18
|
|
|
18
19
|
return (
|
|
19
20
|
<>
|
|
@@ -29,6 +30,34 @@ export const SpaceSettings = ({ settings }: { settings: SpaceSettingsProps }) =>
|
|
|
29
30
|
}
|
|
30
31
|
/>
|
|
31
32
|
</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>
|
|
32
61
|
</>
|
|
33
62
|
);
|
|
34
63
|
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
import { SpaceId } from '@dxos/keys';
|
|
10
|
+
import { withTheme, withLayout } from '@dxos/storybook-utils';
|
|
11
|
+
|
|
12
|
+
import { SyncStatusDetail, SyncStatusIndicator } from './SyncStatus';
|
|
13
|
+
import { getSyncSummary, type SpaceSyncStateMap } from './types';
|
|
14
|
+
import translations from '../../translations';
|
|
15
|
+
|
|
16
|
+
const Story = (props: any) => {
|
|
17
|
+
return (
|
|
18
|
+
<div className='flex flex-col-reverse p-4 '>
|
|
19
|
+
<SyncStatusIndicator {...props} />
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
title: 'plugin-space/SyncStatusIndicator',
|
|
26
|
+
decorators: [withTheme, withLayout({ fullscreen: true })],
|
|
27
|
+
component: SyncStatusIndicator,
|
|
28
|
+
parameters: { translations },
|
|
29
|
+
render: Story,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const random = ({ min, max }: { min: number; max: number }) => min + Math.floor(Math.random() * (max - min));
|
|
33
|
+
|
|
34
|
+
const state: SpaceSyncStateMap = Array.from({ length: 5 }).reduce<SpaceSyncStateMap>((map) => {
|
|
35
|
+
const total = random({ min: 10, max: 500 });
|
|
36
|
+
const haveLocal = random({ min: 0, max: total });
|
|
37
|
+
const haveRemote = random({ min: 0, max: total });
|
|
38
|
+
map[SpaceId.random()] = {
|
|
39
|
+
localDocumentCount: haveLocal,
|
|
40
|
+
remoteDocumentCount: haveRemote,
|
|
41
|
+
missingOnLocal: total - haveLocal,
|
|
42
|
+
missingOnRemote: total - haveRemote,
|
|
43
|
+
differentDocuments: 0,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return map;
|
|
47
|
+
}, {});
|
|
48
|
+
|
|
49
|
+
export const Default = {
|
|
50
|
+
args: {
|
|
51
|
+
state,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const Detail = {
|
|
56
|
+
render: SyncStatusDetail,
|
|
57
|
+
args: {
|
|
58
|
+
state,
|
|
59
|
+
summary: getSyncSummary(state),
|
|
60
|
+
classNames: 'm-2 w-[200px] border border-separator rounded-md',
|
|
61
|
+
},
|
|
62
|
+
};
|