@dxos/plugin-space 0.6.11 → 0.6.12-main.2d19bf1
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-LZEGRS7H.mjs → chunk-AVLRQF6L.mjs} +1 -1
- package/dist/lib/browser/chunk-AVLRQF6L.mjs.map +7 -0
- package/dist/lib/browser/{chunk-DTVUOG2C.mjs → chunk-QK5I2EPF.mjs} +23 -4
- package/dist/lib/browser/chunk-QK5I2EPF.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +581 -237
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/browser/types/index.mjs +7 -3
- package/dist/lib/node/{chunk-CVZPI2P3.cjs → chunk-HE2GHO6Z.cjs} +29 -8
- package/dist/lib/node/chunk-HE2GHO6Z.cjs.map +7 -0
- package/dist/lib/node/{chunk-6CNYF6YU.cjs → chunk-P4XUXM7Y.cjs} +4 -4
- package/dist/lib/node/chunk-P4XUXM7Y.cjs.map +7 -0
- package/dist/lib/node/index.cjs +802 -461
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.cjs +5 -5
- package/dist/lib/node/meta.cjs.map +1 -1
- 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-2TR4WD6U.mjs +116 -0
- package/dist/lib/node-esm/chunk-2TR4WD6U.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-YPQGKWHJ.mjs +37 -0
- package/dist/lib/node-esm/chunk-YPQGKWHJ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +2985 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/meta.mjs +14 -0
- package/dist/lib/node-esm/meta.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +26 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/components/FallbackSettings.d.ts +8 -0
- package/dist/types/src/components/FallbackSettings.d.ts.map +1 -0
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/SaveStatus.d.ts +3 -0
- package/dist/types/src/components/SaveStatus.d.ts.map +1 -0
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts +4 -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 +4 -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 +117 -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 +3 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +4 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/thread.d.ts +14 -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 +43 -36
- package/src/SpacePlugin.tsx +93 -36
- package/src/components/FallbackSettings.tsx +35 -0
- package/src/components/MenuFooter.tsx +1 -0
- package/src/components/SaveStatus.tsx +95 -0
- 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 +3 -2
- package/src/meta.ts +3 -1
- package/src/translations.ts +4 -0
- package/src/types/collection.ts +1 -1
- package/src/types/thread.ts +11 -1
- 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/browser/chunk-LZEGRS7H.mjs.map +0 -7
- package/dist/lib/node/chunk-6CNYF6YU.cjs.map +0 -7
- package/dist/lib/node/chunk-CVZPI2P3.cjs.map +0 -7
- package/dist/types/src/components/EmptySpace.d.ts +0 -3
- package/dist/types/src/components/EmptySpace.d.ts.map +0 -1
- package/dist/types/src/components/EmptyTree.d.ts +0 -3
- package/dist/types/src/components/EmptyTree.d.ts.map +0 -1
- package/src/components/EmptySpace.tsx +0 -25
- package/src/components/EmptyTree.tsx +0 -25
|
@@ -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,SAAS,kBAAkB,CAAC,GAAG,CAAC,gBAC9C,KAAK,GAAG,IAAI,WACjB,YAAY,CAAC,CAAC,CAAC,YACd,YAAY,KACrB,CAAC,EAaH,CAAC;AAEF,eAAO,MAAM,mBAAmB,UACvB,KAAK,6BACmB;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,KACzF,MAAM,GAAG,CAAC,MAAM,EAAE;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAQlC,CAAC;AAqFF,eAAO,MAAM,kBAAkB,8CAK5B;IACD,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,OAAO,EAAE,gBAAgB,CAAC;CAC3B;;;;;;gBAvG0B,MAAM;;;;;;;CA4HhC,CAAC;AAEF,eAAO,MAAM,0BAA0B,wBAAyB;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,gBAAgB,CAAA;CAAE,wCAkD3G,CAAC;AAEF,eAAO,MAAM,qBAAqB,8CAK/B;IACD,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,0BAiHA,CAAC;AAEF,eAAO,MAAM,gBAAgB,gCAI1B;IACD,MAAM,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,gBAAgB,CAAC;CAC3B;;;;;aA+BA,CAAC;AAEF,eAAO,MAAM,2BAA2B,0BAGrC;IACD,MAAM,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAChC,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,wCA+CA,CAAC;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.
|
|
3
|
+
"version": "0.6.12-main.2d19bf1",
|
|
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,21 +10,24 @@
|
|
|
10
10
|
".": {
|
|
11
11
|
"browser": "./dist/lib/browser/index.mjs",
|
|
12
12
|
"node": {
|
|
13
|
-
"
|
|
13
|
+
"require": "./dist/lib/node/index.cjs",
|
|
14
|
+
"default": "./dist/lib/node-esm/index.mjs"
|
|
14
15
|
},
|
|
15
16
|
"types": "./dist/types/src/index.d.ts"
|
|
16
17
|
},
|
|
17
18
|
"./meta": {
|
|
18
19
|
"browser": "./dist/lib/browser/meta.mjs",
|
|
19
20
|
"node": {
|
|
20
|
-
"
|
|
21
|
+
"require": "./dist/lib/node/meta.cjs",
|
|
22
|
+
"default": "./dist/lib/node-esm/meta.mjs"
|
|
21
23
|
},
|
|
22
24
|
"types": "./dist/types/src/meta.d.ts"
|
|
23
25
|
},
|
|
24
26
|
"./types": {
|
|
25
27
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
26
28
|
"node": {
|
|
27
|
-
"
|
|
29
|
+
"require": "./dist/lib/node/types/index.cjs",
|
|
30
|
+
"default": "./dist/lib/node-esm/types/index.mjs"
|
|
28
31
|
},
|
|
29
32
|
"types": "./dist/types/src/types/index.d.ts"
|
|
30
33
|
}
|
|
@@ -45,34 +48,39 @@
|
|
|
45
48
|
"src"
|
|
46
49
|
],
|
|
47
50
|
"dependencies": {
|
|
51
|
+
"@effect/schema": "^0.75.1",
|
|
48
52
|
"@preact/signals-core": "^1.6.0",
|
|
49
53
|
"jszip": "^3.10.1",
|
|
50
54
|
"localforage": "^1.10.0",
|
|
51
55
|
"lodash.get": "^4.4.2",
|
|
52
56
|
"react-drag-drop-files": "^2.3.8",
|
|
53
57
|
"react-is": "~18.2.0",
|
|
54
|
-
"@dxos/app-framework": "0.6.
|
|
55
|
-
"@dxos/async": "0.6.
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/plugin-
|
|
67
|
-
"@dxos/plugin-
|
|
68
|
-
"@dxos/plugin-
|
|
69
|
-
"@dxos/plugin-
|
|
70
|
-
"@dxos/plugin-
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/react-ui-
|
|
75
|
-
"@dxos/
|
|
58
|
+
"@dxos/app-framework": "0.6.12-main.2d19bf1",
|
|
59
|
+
"@dxos/async": "0.6.12-main.2d19bf1",
|
|
60
|
+
"@dxos/client": "0.6.12-main.2d19bf1",
|
|
61
|
+
"@dxos/context": "0.6.12-main.2d19bf1",
|
|
62
|
+
"@dxos/display-name": "0.6.12-main.2d19bf1",
|
|
63
|
+
"@dxos/automerge": "0.6.12-main.2d19bf1",
|
|
64
|
+
"@dxos/echo-schema": "0.6.12-main.2d19bf1",
|
|
65
|
+
"@dxos/invariant": "0.6.12-main.2d19bf1",
|
|
66
|
+
"@dxos/local-storage": "0.6.12-main.2d19bf1",
|
|
67
|
+
"@dxos/keys": "0.6.12-main.2d19bf1",
|
|
68
|
+
"@dxos/log": "0.6.12-main.2d19bf1",
|
|
69
|
+
"@dxos/migrations": "0.6.12-main.2d19bf1",
|
|
70
|
+
"@dxos/plugin-attention": "0.6.12-main.2d19bf1",
|
|
71
|
+
"@dxos/plugin-client": "0.6.12-main.2d19bf1",
|
|
72
|
+
"@dxos/plugin-graph": "0.6.12-main.2d19bf1",
|
|
73
|
+
"@dxos/plugin-metadata": "0.6.12-main.2d19bf1",
|
|
74
|
+
"@dxos/plugin-observability": "0.6.12-main.2d19bf1",
|
|
75
|
+
"@dxos/plugin-settings": "0.6.12-main.2d19bf1",
|
|
76
|
+
"@dxos/plugin-status-bar": "0.6.12-main.2d19bf1",
|
|
77
|
+
"@dxos/react-client": "0.6.12-main.2d19bf1",
|
|
78
|
+
"@dxos/react-ui-attention": "0.6.12-main.2d19bf1",
|
|
79
|
+
"@dxos/react-ui-syntax-highlighter": "0.6.12-main.2d19bf1",
|
|
80
|
+
"@dxos/protocols": "0.6.12-main.2d19bf1",
|
|
81
|
+
"@dxos/react-ui-editor": "0.6.12-main.2d19bf1",
|
|
82
|
+
"@dxos/shell": "0.6.12-main.2d19bf1",
|
|
83
|
+
"@dxos/util": "0.6.12-main.2d19bf1"
|
|
76
84
|
},
|
|
77
85
|
"devDependencies": {
|
|
78
86
|
"@babel/core": "^7.18.13",
|
|
@@ -82,18 +90,17 @@
|
|
|
82
90
|
"@types/react-dom": "~18.2.0",
|
|
83
91
|
"react": "~18.2.0",
|
|
84
92
|
"react-dom": "~18.2.0",
|
|
85
|
-
"vite": "
|
|
86
|
-
"@dxos/react-ui": "0.6.
|
|
87
|
-
"@dxos/
|
|
88
|
-
"@dxos/
|
|
93
|
+
"vite": "5.4.7",
|
|
94
|
+
"@dxos/react-ui-theme": "0.6.12-main.2d19bf1",
|
|
95
|
+
"@dxos/storybook-utils": "0.6.12-main.2d19bf1",
|
|
96
|
+
"@dxos/react-ui": "0.6.12-main.2d19bf1"
|
|
89
97
|
},
|
|
90
|
-
"
|
|
91
|
-
"@babel/core": "^7.18.13",
|
|
98
|
+
"peerDependencies": {
|
|
92
99
|
"@phosphor-icons/react": "^2.1.5",
|
|
93
|
-
"react": "
|
|
94
|
-
"react-dom": "
|
|
95
|
-
"@dxos/react-ui": "0.6.
|
|
96
|
-
"@dxos/react-ui-theme": "0.6.
|
|
100
|
+
"react": "~18.2.0",
|
|
101
|
+
"react-dom": "~18.2.0",
|
|
102
|
+
"@dxos/react-ui": "0.6.12-main.2d19bf1",
|
|
103
|
+
"@dxos/react-ui-theme": "0.6.12-main.2d19bf1"
|
|
97
104
|
},
|
|
98
105
|
"publishConfig": {
|
|
99
106
|
"access": "public"
|
package/src/SpacePlugin.tsx
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type IconProps, Plus, SignIn, CardsThree, Warning } from '@phosphor-icons/react';
|
|
6
5
|
import { effect, signal } from '@preact/signals-core';
|
|
7
6
|
import React from 'react';
|
|
8
7
|
|
|
@@ -10,66 +9,67 @@ import {
|
|
|
10
9
|
type IntentDispatcher,
|
|
11
10
|
type IntentPluginProvides,
|
|
12
11
|
LayoutAction,
|
|
13
|
-
Surface,
|
|
14
12
|
type LocationProvides,
|
|
15
13
|
NavigationAction,
|
|
16
14
|
type Plugin,
|
|
17
15
|
type PluginDefinition,
|
|
18
|
-
|
|
16
|
+
Surface,
|
|
19
17
|
firstIdInPart,
|
|
18
|
+
openIds,
|
|
19
|
+
parseGraphPlugin,
|
|
20
20
|
parseIntentPlugin,
|
|
21
|
-
parseNavigationPlugin,
|
|
22
21
|
parseMetadataResolverPlugin,
|
|
22
|
+
parseNavigationPlugin,
|
|
23
23
|
resolvePlugin,
|
|
24
|
-
parseGraphPlugin,
|
|
25
24
|
} from '@dxos/app-framework';
|
|
26
25
|
import { EventSubscriptions, type Trigger, type UnsubscribeCallback } from '@dxos/async';
|
|
27
|
-
import { type Identifiable, isReactiveObject
|
|
26
|
+
import { type EchoReactiveObject, type Identifiable, isReactiveObject } from '@dxos/echo-schema';
|
|
28
27
|
import { LocalStorageStore } from '@dxos/local-storage';
|
|
29
28
|
import { log } from '@dxos/log';
|
|
30
29
|
import { Migrations } from '@dxos/migrations';
|
|
31
30
|
import { type AttentionPluginProvides, parseAttentionPlugin } from '@dxos/plugin-attention';
|
|
32
31
|
import { type ClientPluginProvides, parseClientPlugin } from '@dxos/plugin-client';
|
|
33
|
-
import {
|
|
32
|
+
import { type Node, createExtension, memoize, toSignal } from '@dxos/plugin-graph';
|
|
34
33
|
import { ObservabilityAction } from '@dxos/plugin-observability/meta';
|
|
35
34
|
import { type Client, PublicKey } from '@dxos/react-client';
|
|
36
35
|
import {
|
|
36
|
+
Expando,
|
|
37
|
+
Filter,
|
|
37
38
|
type PropertiesTypeProps,
|
|
38
39
|
type Space,
|
|
40
|
+
SpaceState,
|
|
39
41
|
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,
|
|
49
48
|
} from '@dxos/react-client/echo';
|
|
50
49
|
import { Dialog } from '@dxos/react-ui';
|
|
51
|
-
import { InvitationManager, type InvitationManagerProps, osTranslations
|
|
50
|
+
import { ClipboardProvider, InvitationManager, type InvitationManagerProps, osTranslations } from '@dxos/shell/react';
|
|
52
51
|
import { ComplexMap, nonNullable, reduceGroupBy } from '@dxos/util';
|
|
53
52
|
|
|
54
53
|
import {
|
|
55
54
|
AwaitingObject,
|
|
56
55
|
CollectionMain,
|
|
57
56
|
CollectionSection,
|
|
58
|
-
|
|
59
|
-
EmptyTree,
|
|
57
|
+
FallbackSettings,
|
|
60
58
|
MenuFooter,
|
|
61
59
|
MissingObject,
|
|
62
60
|
PopoverRenameObject,
|
|
63
61
|
PopoverRenameSpace,
|
|
62
|
+
SaveStatus,
|
|
64
63
|
ShareSpaceButton,
|
|
65
64
|
SmallPresence,
|
|
66
65
|
SmallPresenceLive,
|
|
67
66
|
SpacePresence,
|
|
68
67
|
SpaceSettings,
|
|
68
|
+
SyncStatus,
|
|
69
69
|
} from './components';
|
|
70
70
|
import meta, { SPACE_PLUGIN, SpaceAction } from './meta';
|
|
71
71
|
import translations from './translations';
|
|
72
|
-
import { CollectionType, type
|
|
72
|
+
import { CollectionType, type PluginState, type SpacePluginProvides, type SpaceSettingsProps } from './types';
|
|
73
73
|
import {
|
|
74
74
|
COMPOSER_SPACE_LOCK,
|
|
75
75
|
SHARED,
|
|
@@ -118,7 +118,9 @@ export const SpacePlugin = ({
|
|
|
118
118
|
firstRun,
|
|
119
119
|
onFirstRun,
|
|
120
120
|
}: SpacePluginOptions = {}): PluginDefinition<SpacePluginProvides> => {
|
|
121
|
-
const settings = new LocalStorageStore<SpaceSettingsProps>(SPACE_PLUGIN
|
|
121
|
+
const settings = new LocalStorageStore<SpaceSettingsProps>(SPACE_PLUGIN, {
|
|
122
|
+
onSpaceCreate: 'dxos.org/plugin/markdown/action/create',
|
|
123
|
+
});
|
|
122
124
|
const state = new LocalStorageStore<PluginState>(SPACE_PLUGIN, {
|
|
123
125
|
awaiting: undefined,
|
|
124
126
|
spaceNames: {},
|
|
@@ -340,8 +342,7 @@ export const SpacePlugin = ({
|
|
|
340
342
|
records: {
|
|
341
343
|
[CollectionType.typename]: {
|
|
342
344
|
placeholder: ['unnamed collection label', { ns: SPACE_PLUGIN }],
|
|
343
|
-
icon:
|
|
344
|
-
iconSymbol: 'ph--cards-three--regular',
|
|
345
|
+
icon: 'ph--cards-three--regular',
|
|
345
346
|
// TODO(wittjosiah): Move out of metadata.
|
|
346
347
|
loadReferences: (collection: CollectionType) =>
|
|
347
348
|
loadObjectReferences(collection, (collection) => [
|
|
@@ -362,22 +363,18 @@ export const SpacePlugin = ({
|
|
|
362
363
|
case 'main':
|
|
363
364
|
// TODO(wittjosiah): Need to avoid shotgun parsing space state everywhere.
|
|
364
365
|
return isSpace(primary) && primary.state.get() === SpaceState.SPACE_READY ? (
|
|
365
|
-
<Surface
|
|
366
|
+
<Surface
|
|
367
|
+
data={{ active: primary.properties[CollectionType.typename], id: primary.id }}
|
|
368
|
+
role={role}
|
|
369
|
+
{...rest}
|
|
370
|
+
/>
|
|
366
371
|
) : primary instanceof CollectionType ? (
|
|
367
372
|
{ node: <CollectionMain collection={primary} />, disposition: 'fallback' }
|
|
368
373
|
) : typeof primary === 'string' && primary.length === OBJECT_ID_LENGTH ? (
|
|
369
374
|
<MissingObject id={primary} />
|
|
370
375
|
) : null;
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
switch (true) {
|
|
374
|
-
case data.plugin === SPACE_PLUGIN:
|
|
375
|
-
return <EmptyTree />;
|
|
376
|
-
case isGraphNode(data.activeNode) && isSpace(data.activeNode.data):
|
|
377
|
-
return <EmptySpace />;
|
|
378
|
-
default:
|
|
379
|
-
return null;
|
|
380
|
-
}
|
|
376
|
+
case 'complementary--settings':
|
|
377
|
+
return isEchoObject(data.subject) ? <FallbackSettings object={data.subject} /> : null;
|
|
381
378
|
case 'dialog':
|
|
382
379
|
if (data.component === 'dxos.org/plugin/space/InvitationManagerDialog') {
|
|
383
380
|
return (
|
|
@@ -398,6 +395,7 @@ export const SpacePlugin = ({
|
|
|
398
395
|
return <PopoverRenameObject object={data.subject} />;
|
|
399
396
|
}
|
|
400
397
|
return null;
|
|
398
|
+
// TODO(burdon): Add role name syntax to minimal plugin docs.
|
|
401
399
|
case 'presence--glyph': {
|
|
402
400
|
return isReactiveObject(data.object) ? (
|
|
403
401
|
<SmallPresenceLive viewers={state.values.viewersByObject[fullyQualifiedId(data.object)]} />
|
|
@@ -441,6 +439,14 @@ export const SpacePlugin = ({
|
|
|
441
439
|
} else {
|
|
442
440
|
return <MenuFooter object={data.object} />;
|
|
443
441
|
}
|
|
442
|
+
case 'status': {
|
|
443
|
+
return (
|
|
444
|
+
<>
|
|
445
|
+
<SyncStatus />
|
|
446
|
+
<SaveStatus />
|
|
447
|
+
</>
|
|
448
|
+
);
|
|
449
|
+
}
|
|
444
450
|
default:
|
|
445
451
|
return null;
|
|
446
452
|
}
|
|
@@ -540,8 +546,7 @@ export const SpacePlugin = ({
|
|
|
540
546
|
},
|
|
541
547
|
properties: {
|
|
542
548
|
label: ['create space label', { ns: SPACE_PLUGIN }],
|
|
543
|
-
icon:
|
|
544
|
-
iconSymbol: 'ph--plus--regular',
|
|
549
|
+
icon: 'ph--plus--regular',
|
|
545
550
|
disposition: 'toolbar',
|
|
546
551
|
testId: 'spacePlugin.createSpace',
|
|
547
552
|
},
|
|
@@ -561,8 +566,7 @@ export const SpacePlugin = ({
|
|
|
561
566
|
},
|
|
562
567
|
properties: {
|
|
563
568
|
label: ['join space label', { ns: SPACE_PLUGIN }],
|
|
564
|
-
icon:
|
|
565
|
-
iconSymbol: 'ph--sign-in--regular',
|
|
569
|
+
icon: 'ph--sign-in--regular',
|
|
566
570
|
testId: 'spacePlugin.joinSpace',
|
|
567
571
|
},
|
|
568
572
|
},
|
|
@@ -707,6 +711,52 @@ export const SpacePlugin = ({
|
|
|
707
711
|
.filter(nonNullable);
|
|
708
712
|
},
|
|
709
713
|
}),
|
|
714
|
+
|
|
715
|
+
// Create nodes for object settings.
|
|
716
|
+
createExtension({
|
|
717
|
+
id: `${SPACE_PLUGIN}/settings-for-subject`,
|
|
718
|
+
resolver: ({ id }) => {
|
|
719
|
+
if (!id.endsWith('~settings')) {
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// TODO(Zan): Find util (or make one).
|
|
724
|
+
const subjectId = id.split('~').at(0);
|
|
725
|
+
const [spaceId, objectId] = subjectId?.split(':') ?? [];
|
|
726
|
+
const space = client.spaces.get().find((space) => space.id === spaceId);
|
|
727
|
+
const object = toSignal(
|
|
728
|
+
(onChange) => {
|
|
729
|
+
const timeout = setTimeout(async () => {
|
|
730
|
+
await space?.db.loadObjectById(objectId);
|
|
731
|
+
onChange();
|
|
732
|
+
});
|
|
733
|
+
|
|
734
|
+
return () => clearTimeout(timeout);
|
|
735
|
+
},
|
|
736
|
+
() => space?.db.getObjectById(objectId),
|
|
737
|
+
subjectId,
|
|
738
|
+
);
|
|
739
|
+
if (!object || !subjectId) {
|
|
740
|
+
return;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
const meta = resolve(getTypename(object) ?? '');
|
|
744
|
+
const label = meta.label?.(object) ||
|
|
745
|
+
object.name ||
|
|
746
|
+
meta.placeholder || ['unnamed object settings label', { ns: SPACE_PLUGIN }];
|
|
747
|
+
|
|
748
|
+
return {
|
|
749
|
+
id,
|
|
750
|
+
type: 'orphan-settings-for-subject',
|
|
751
|
+
data: null,
|
|
752
|
+
properties: {
|
|
753
|
+
icon: 'ph--gear--regular',
|
|
754
|
+
label,
|
|
755
|
+
object,
|
|
756
|
+
},
|
|
757
|
+
};
|
|
758
|
+
},
|
|
759
|
+
}),
|
|
710
760
|
];
|
|
711
761
|
},
|
|
712
762
|
serializer: (plugins) => {
|
|
@@ -805,6 +855,15 @@ export const SpacePlugin = ({
|
|
|
805
855
|
data: { space, id: space.id, activeParts: { main: [space.id] } },
|
|
806
856
|
|
|
807
857
|
intents: [
|
|
858
|
+
...(settings.values.onSpaceCreate
|
|
859
|
+
? [
|
|
860
|
+
[
|
|
861
|
+
{ action: settings.values.onSpaceCreate, data: { space } },
|
|
862
|
+
{ action: SpaceAction.ADD_OBJECT, data: { target: space } },
|
|
863
|
+
{ action: NavigationAction.EXPOSE },
|
|
864
|
+
],
|
|
865
|
+
]
|
|
866
|
+
: []),
|
|
808
867
|
[
|
|
809
868
|
{
|
|
810
869
|
action: ObservabilityAction.SEND_EVENT,
|
|
@@ -1020,8 +1079,7 @@ export const SpacePlugin = ({
|
|
|
1020
1079
|
title: translations[0]['en-US'][SPACE_PLUGIN]['space limit label'],
|
|
1021
1080
|
description: translations[0]['en-US'][SPACE_PLUGIN]['space limit description'],
|
|
1022
1081
|
duration: 5_000,
|
|
1023
|
-
icon:
|
|
1024
|
-
iconSymbol: 'ph--warning--regular',
|
|
1082
|
+
icon: 'ph--warning--regular',
|
|
1025
1083
|
actionLabel: translations[0]['en-US'][SPACE_PLUGIN]['remove deleted objects label'],
|
|
1026
1084
|
actionAlt: translations[0]['en-US'][SPACE_PLUGIN]['remove deleted objects alt'],
|
|
1027
1085
|
// TODO(wittjosiah): Use OS namespace.
|
|
@@ -1060,7 +1118,7 @@ export const SpacePlugin = ({
|
|
|
1060
1118
|
}
|
|
1061
1119
|
|
|
1062
1120
|
return {
|
|
1063
|
-
data: { id: object
|
|
1121
|
+
data: { id: fullyQualifiedId(object), object, activeParts: { main: [fullyQualifiedId(object)] } },
|
|
1064
1122
|
intents: [
|
|
1065
1123
|
[
|
|
1066
1124
|
{
|
|
@@ -1115,7 +1173,6 @@ export const SpacePlugin = ({
|
|
|
1115
1173
|
activeParts: {
|
|
1116
1174
|
main: deletionData.wasActive,
|
|
1117
1175
|
sidebar: deletionData.wasActive,
|
|
1118
|
-
complementary: deletionData.wasActive,
|
|
1119
1176
|
},
|
|
1120
1177
|
},
|
|
1121
1178
|
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type EchoReactiveObject } from '@dxos/echo-schema';
|
|
8
|
+
import { Input, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
|
|
10
|
+
import { SPACE_PLUGIN } from '../meta';
|
|
11
|
+
|
|
12
|
+
type FallbackSettingsProps = {
|
|
13
|
+
object: EchoReactiveObject<any>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const FallbackSettings = ({ object }: FallbackSettingsProps) => {
|
|
17
|
+
const { t } = useTranslation(SPACE_PLUGIN);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div role='form' className='p-3 flex flex-col gap-2'>
|
|
21
|
+
<div role='none' className='space-b-1'>
|
|
22
|
+
<Input.Root>
|
|
23
|
+
<Input.Label>{t('name label')}</Input.Label>
|
|
24
|
+
<Input.TextInput
|
|
25
|
+
placeholder={t('name placeholder')}
|
|
26
|
+
value={object.name}
|
|
27
|
+
onChange={(event) => {
|
|
28
|
+
object.name = event.target.value;
|
|
29
|
+
}}
|
|
30
|
+
/>
|
|
31
|
+
</Input.Root>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useEffect, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type UnsubscribeCallback } from '@dxos/async';
|
|
8
|
+
import { type Client } from '@dxos/client';
|
|
9
|
+
import { type Space, type SpaceId } from '@dxos/client/echo';
|
|
10
|
+
import { Context } from '@dxos/context';
|
|
11
|
+
import { StatusBar } from '@dxos/plugin-status-bar';
|
|
12
|
+
import { useClient } from '@dxos/react-client';
|
|
13
|
+
import { Icon, useTranslation } from '@dxos/react-ui';
|
|
14
|
+
|
|
15
|
+
import { SPACE_PLUGIN } from '../meta';
|
|
16
|
+
|
|
17
|
+
export const SaveStatus = () => {
|
|
18
|
+
const { t } = useTranslation(SPACE_PLUGIN);
|
|
19
|
+
const client = useClient();
|
|
20
|
+
const [state, setState] = useState<'saved' | 'saving'>('saved');
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
return createClientSaveTracker(client, (state) => {
|
|
23
|
+
setState(state);
|
|
24
|
+
});
|
|
25
|
+
}, []);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<StatusBar.Item title={state === 'saving' ? t('saving label') : t('saved label')}>
|
|
29
|
+
<Icon icon={state === 'saving' ? 'ph--arrows-clockwise--regular' : 'ph--check-circle--regular'} size={4} />
|
|
30
|
+
</StatusBar.Item>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const createClientSaveTracker = (client: Client, cb: (state: 'saved' | 'saving') => void) => {
|
|
35
|
+
const unsubscribeCallbacks: Record<SpaceId, UnsubscribeCallback> = {};
|
|
36
|
+
const state: Record<SpaceId, 'saved' | 'saving'> = {};
|
|
37
|
+
|
|
38
|
+
const install = (spaces: Space[]) => {
|
|
39
|
+
for (const space of spaces) {
|
|
40
|
+
if (state[space.id]) {
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
state[space.id] = 'saved';
|
|
45
|
+
unsubscribeCallbacks[space.id] = createSpaceSaveTracker(space, (s) => {
|
|
46
|
+
state[space.id] = s;
|
|
47
|
+
cb(Object.values(state).some((s) => s === 'saving') ? 'saving' : 'saved');
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
client.spaces.subscribe((spaces) => {
|
|
52
|
+
install(spaces);
|
|
53
|
+
});
|
|
54
|
+
install(client.spaces.get());
|
|
55
|
+
|
|
56
|
+
return () => {
|
|
57
|
+
for (const unsubscribe of Object.values(unsubscribeCallbacks)) {
|
|
58
|
+
unsubscribe();
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const createSpaceSaveTracker = (space: Space, cb: (state: 'saved' | 'saving') => void): UnsubscribeCallback => {
|
|
64
|
+
const ctx = new Context();
|
|
65
|
+
|
|
66
|
+
void space.waitUntilReady().then(() => {
|
|
67
|
+
if (ctx.disposed) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
let hasUnsavedChanges = false;
|
|
72
|
+
let lastFlushPromise: Promise<void> | undefined;
|
|
73
|
+
space.crud.saveStateChanged.on(ctx, ({ unsavedDocuments }) => {
|
|
74
|
+
hasUnsavedChanges = unsavedDocuments.length > 0;
|
|
75
|
+
});
|
|
76
|
+
space.crud.saveStateChanged.debounce(500).on(ctx, () => {
|
|
77
|
+
if (hasUnsavedChanges) {
|
|
78
|
+
lastFlushPromise = undefined;
|
|
79
|
+
cb('saving');
|
|
80
|
+
} else {
|
|
81
|
+
const flushPromise = space.crud.flush();
|
|
82
|
+
lastFlushPromise = flushPromise;
|
|
83
|
+
void flushPromise.then(() => {
|
|
84
|
+
if (lastFlushPromise === flushPromise) {
|
|
85
|
+
cb('saved');
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
return () => {
|
|
93
|
+
void ctx.dispose();
|
|
94
|
+
};
|
|
95
|
+
};
|
|
@@ -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
|
};
|