@dxos/plugin-space 0.6.12 → 0.6.13-main.548ca8d
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 +592 -246
- 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 +812 -469
- 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 +2987 -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 +44 -36
- package/src/SpacePlugin.tsx +145 -83
- 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.13-main.548ca8d",
|
|
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,40 @@
|
|
|
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/
|
|
67
|
-
"@dxos/plugin-
|
|
68
|
-
"@dxos/plugin-
|
|
69
|
-
"@dxos/plugin-
|
|
70
|
-
"@dxos/plugin-
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
58
|
+
"@dxos/app-framework": "0.6.13-main.548ca8d",
|
|
59
|
+
"@dxos/async": "0.6.13-main.548ca8d",
|
|
60
|
+
"@dxos/client": "0.6.13-main.548ca8d",
|
|
61
|
+
"@dxos/automerge": "0.6.13-main.548ca8d",
|
|
62
|
+
"@dxos/context": "0.6.13-main.548ca8d",
|
|
63
|
+
"@dxos/display-name": "0.6.13-main.548ca8d",
|
|
64
|
+
"@dxos/invariant": "0.6.13-main.548ca8d",
|
|
65
|
+
"@dxos/echo-schema": "0.6.13-main.548ca8d",
|
|
66
|
+
"@dxos/echo-signals": "0.6.13-main.548ca8d",
|
|
67
|
+
"@dxos/local-storage": "0.6.13-main.548ca8d",
|
|
68
|
+
"@dxos/keys": "0.6.13-main.548ca8d",
|
|
69
|
+
"@dxos/migrations": "0.6.13-main.548ca8d",
|
|
70
|
+
"@dxos/log": "0.6.13-main.548ca8d",
|
|
71
|
+
"@dxos/plugin-attention": "0.6.13-main.548ca8d",
|
|
72
|
+
"@dxos/plugin-client": "0.6.13-main.548ca8d",
|
|
73
|
+
"@dxos/plugin-metadata": "0.6.13-main.548ca8d",
|
|
74
|
+
"@dxos/plugin-observability": "0.6.13-main.548ca8d",
|
|
75
|
+
"@dxos/plugin-graph": "0.6.13-main.548ca8d",
|
|
76
|
+
"@dxos/plugin-status-bar": "0.6.13-main.548ca8d",
|
|
77
|
+
"@dxos/plugin-settings": "0.6.13-main.548ca8d",
|
|
78
|
+
"@dxos/react-client": "0.6.13-main.548ca8d",
|
|
79
|
+
"@dxos/protocols": "0.6.13-main.548ca8d",
|
|
80
|
+
"@dxos/react-ui-attention": "0.6.13-main.548ca8d",
|
|
81
|
+
"@dxos/react-ui-syntax-highlighter": "0.6.13-main.548ca8d",
|
|
82
|
+
"@dxos/react-ui-editor": "0.6.13-main.548ca8d",
|
|
83
|
+
"@dxos/shell": "0.6.13-main.548ca8d",
|
|
84
|
+
"@dxos/util": "0.6.13-main.548ca8d"
|
|
76
85
|
},
|
|
77
86
|
"devDependencies": {
|
|
78
87
|
"@babel/core": "^7.18.13",
|
|
@@ -82,18 +91,17 @@
|
|
|
82
91
|
"@types/react-dom": "~18.2.0",
|
|
83
92
|
"react": "~18.2.0",
|
|
84
93
|
"react-dom": "~18.2.0",
|
|
85
|
-
"vite": "
|
|
86
|
-
"@dxos/react-ui": "0.6.
|
|
87
|
-
"@dxos/react-ui
|
|
88
|
-
"@dxos/storybook-utils": "0.6.
|
|
94
|
+
"vite": "5.4.7",
|
|
95
|
+
"@dxos/react-ui-theme": "0.6.13-main.548ca8d",
|
|
96
|
+
"@dxos/react-ui": "0.6.13-main.548ca8d",
|
|
97
|
+
"@dxos/storybook-utils": "0.6.13-main.548ca8d"
|
|
89
98
|
},
|
|
90
|
-
"
|
|
91
|
-
"@babel/core": "^7.18.13",
|
|
99
|
+
"peerDependencies": {
|
|
92
100
|
"@phosphor-icons/react": "^2.1.5",
|
|
93
|
-
"react": "
|
|
94
|
-
"react-dom": "
|
|
95
|
-
"@dxos/react-ui": "0.6.
|
|
96
|
-
"@dxos/react-ui-theme": "0.6.
|
|
101
|
+
"react": "~18.2.0",
|
|
102
|
+
"react-dom": "~18.2.0",
|
|
103
|
+
"@dxos/react-ui": "0.6.13-main.548ca8d",
|
|
104
|
+
"@dxos/react-ui-theme": "0.6.13-main.548ca8d"
|
|
97
105
|
},
|
|
98
106
|
"publishConfig": {
|
|
99
107
|
"access": "public"
|
package/src/SpacePlugin.tsx
CHANGED
|
@@ -2,74 +2,76 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import { effect, signal } from '@preact/signals-core';
|
|
5
|
+
import { signal } from '@preact/signals-core';
|
|
7
6
|
import React from 'react';
|
|
8
7
|
|
|
9
8
|
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';
|
|
27
|
+
import { scheduledEffect } from '@dxos/echo-signals/core';
|
|
28
28
|
import { LocalStorageStore } from '@dxos/local-storage';
|
|
29
29
|
import { log } from '@dxos/log';
|
|
30
30
|
import { Migrations } from '@dxos/migrations';
|
|
31
31
|
import { type AttentionPluginProvides, parseAttentionPlugin } from '@dxos/plugin-attention';
|
|
32
32
|
import { type ClientPluginProvides, parseClientPlugin } from '@dxos/plugin-client';
|
|
33
|
-
import {
|
|
33
|
+
import { type Node, createExtension, memoize, toSignal } from '@dxos/plugin-graph';
|
|
34
34
|
import { ObservabilityAction } from '@dxos/plugin-observability/meta';
|
|
35
35
|
import { type Client, PublicKey } from '@dxos/react-client';
|
|
36
36
|
import {
|
|
37
|
+
Expando,
|
|
38
|
+
Filter,
|
|
37
39
|
type PropertiesTypeProps,
|
|
38
40
|
type Space,
|
|
41
|
+
SpaceState,
|
|
39
42
|
create,
|
|
40
|
-
Expando,
|
|
41
|
-
Filter,
|
|
42
43
|
fullyQualifiedId,
|
|
43
44
|
getSpace,
|
|
44
45
|
getTypename,
|
|
45
46
|
isEchoObject,
|
|
46
47
|
isSpace,
|
|
47
48
|
loadObjectReferences,
|
|
48
|
-
|
|
49
|
+
parseFullyQualifiedId,
|
|
49
50
|
} from '@dxos/react-client/echo';
|
|
50
51
|
import { Dialog } from '@dxos/react-ui';
|
|
51
|
-
import { InvitationManager, type InvitationManagerProps, osTranslations
|
|
52
|
+
import { ClipboardProvider, InvitationManager, type InvitationManagerProps, osTranslations } from '@dxos/shell/react';
|
|
52
53
|
import { ComplexMap, nonNullable, reduceGroupBy } from '@dxos/util';
|
|
53
54
|
|
|
54
55
|
import {
|
|
55
56
|
AwaitingObject,
|
|
56
57
|
CollectionMain,
|
|
57
58
|
CollectionSection,
|
|
58
|
-
|
|
59
|
-
EmptyTree,
|
|
59
|
+
FallbackSettings,
|
|
60
60
|
MenuFooter,
|
|
61
61
|
MissingObject,
|
|
62
62
|
PopoverRenameObject,
|
|
63
63
|
PopoverRenameSpace,
|
|
64
|
+
SaveStatus,
|
|
64
65
|
ShareSpaceButton,
|
|
65
66
|
SmallPresence,
|
|
66
67
|
SmallPresenceLive,
|
|
67
68
|
SpacePresence,
|
|
68
69
|
SpaceSettings,
|
|
70
|
+
SyncStatus,
|
|
69
71
|
} from './components';
|
|
70
72
|
import meta, { SPACE_PLUGIN, SpaceAction } from './meta';
|
|
71
73
|
import translations from './translations';
|
|
72
|
-
import { CollectionType, type
|
|
74
|
+
import { CollectionType, type PluginState, type SpacePluginProvides, type SpaceSettingsProps } from './types';
|
|
73
75
|
import {
|
|
74
76
|
COMPOSER_SPACE_LOCK,
|
|
75
77
|
SHARED,
|
|
@@ -118,7 +120,9 @@ export const SpacePlugin = ({
|
|
|
118
120
|
firstRun,
|
|
119
121
|
onFirstRun,
|
|
120
122
|
}: SpacePluginOptions = {}): PluginDefinition<SpacePluginProvides> => {
|
|
121
|
-
const settings = new LocalStorageStore<SpaceSettingsProps>(SPACE_PLUGIN
|
|
123
|
+
const settings = new LocalStorageStore<SpaceSettingsProps>(SPACE_PLUGIN, {
|
|
124
|
+
onSpaceCreate: 'dxos.org/plugin/markdown/action/create',
|
|
125
|
+
});
|
|
122
126
|
const state = new LocalStorageStore<PluginState>(SPACE_PLUGIN, {
|
|
123
127
|
awaiting: undefined,
|
|
124
128
|
spaceNames: {},
|
|
@@ -171,9 +175,10 @@ export const SpacePlugin = ({
|
|
|
171
175
|
.filter((space) => space.state.get() === SpaceState.SPACE_READY)
|
|
172
176
|
.forEach((space) => {
|
|
173
177
|
subscriptions.add(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
178
|
+
scheduledEffect(
|
|
179
|
+
() => ({ name: space.properties.name }),
|
|
180
|
+
({ name }) => (state.values.spaceNames[space.id] = name),
|
|
181
|
+
),
|
|
177
182
|
);
|
|
178
183
|
});
|
|
179
184
|
}).unsubscribe,
|
|
@@ -181,54 +186,56 @@ export const SpacePlugin = ({
|
|
|
181
186
|
|
|
182
187
|
// Broadcast active node to other peers in the space.
|
|
183
188
|
subscriptions.add(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
189
|
+
scheduledEffect(
|
|
190
|
+
() => ({
|
|
191
|
+
ids: openIds(location.active),
|
|
192
|
+
removed: location.closed ? [location.closed].flat() : [],
|
|
193
|
+
}),
|
|
194
|
+
({ ids, removed }) => {
|
|
195
|
+
const send = () => {
|
|
196
|
+
const spaces = client.spaces.get();
|
|
197
|
+
const identity = client.halo.identity.get();
|
|
198
|
+
if (identity && location.active) {
|
|
199
|
+
// Group parts by space for efficient messaging.
|
|
200
|
+
const idsBySpace = reduceGroupBy(ids, (id) => {
|
|
201
|
+
const [spaceId] = id.split(':'); // TODO(burdon): Factor out.
|
|
202
|
+
return spaceId;
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
// NOTE: Ensure all spaces are included so that we send the correct `removed` object arrays.
|
|
206
|
+
for (const space of spaces) {
|
|
207
|
+
if (!idsBySpace.has(space.id)) {
|
|
208
|
+
idsBySpace.set(space.id, []);
|
|
209
|
+
}
|
|
201
210
|
}
|
|
202
|
-
}
|
|
203
211
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
212
|
+
for (const [spaceId, ids] of idsBySpace) {
|
|
213
|
+
const space = spaces.find((space) => space.id === spaceId);
|
|
214
|
+
if (!space) {
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
209
217
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
});
|
|
218
|
+
void space
|
|
219
|
+
.postMessage('viewing', {
|
|
220
|
+
identityKey: identity.identityKey.toHex(),
|
|
221
|
+
attended: attention.attended ? [...attention.attended] : [],
|
|
222
|
+
added: ids,
|
|
223
|
+
// TODO(Zan): When we re-open a part, we should remove it from the removed list in the navigation plugin.
|
|
224
|
+
removed: removed.filter((id) => !ids.includes(id)),
|
|
225
|
+
})
|
|
226
|
+
// TODO(burdon): This seems defensive; why would this fail? Backoff interval.
|
|
227
|
+
.catch((err) => {
|
|
228
|
+
log.warn('Failed to broadcast active node for presence.', { err: err.message });
|
|
229
|
+
});
|
|
230
|
+
}
|
|
224
231
|
}
|
|
225
|
-
}
|
|
226
|
-
};
|
|
232
|
+
};
|
|
227
233
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
234
|
+
send();
|
|
235
|
+
const interval = setInterval(() => send(), ACTIVE_NODE_BROADCAST_INTERVAL);
|
|
236
|
+
return () => clearInterval(interval);
|
|
237
|
+
},
|
|
238
|
+
),
|
|
232
239
|
);
|
|
233
240
|
|
|
234
241
|
// Listen for active nodes from other peers in the space.
|
|
@@ -340,8 +347,7 @@ export const SpacePlugin = ({
|
|
|
340
347
|
records: {
|
|
341
348
|
[CollectionType.typename]: {
|
|
342
349
|
placeholder: ['unnamed collection label', { ns: SPACE_PLUGIN }],
|
|
343
|
-
icon:
|
|
344
|
-
iconSymbol: 'ph--cards-three--regular',
|
|
350
|
+
icon: 'ph--cards-three--regular',
|
|
345
351
|
// TODO(wittjosiah): Move out of metadata.
|
|
346
352
|
loadReferences: (collection: CollectionType) =>
|
|
347
353
|
loadObjectReferences(collection, (collection) => [
|
|
@@ -362,22 +368,18 @@ export const SpacePlugin = ({
|
|
|
362
368
|
case 'main':
|
|
363
369
|
// TODO(wittjosiah): Need to avoid shotgun parsing space state everywhere.
|
|
364
370
|
return isSpace(primary) && primary.state.get() === SpaceState.SPACE_READY ? (
|
|
365
|
-
<Surface
|
|
371
|
+
<Surface
|
|
372
|
+
data={{ active: primary.properties[CollectionType.typename], id: primary.id }}
|
|
373
|
+
role={role}
|
|
374
|
+
{...rest}
|
|
375
|
+
/>
|
|
366
376
|
) : primary instanceof CollectionType ? (
|
|
367
377
|
{ node: <CollectionMain collection={primary} />, disposition: 'fallback' }
|
|
368
378
|
) : typeof primary === 'string' && primary.length === OBJECT_ID_LENGTH ? (
|
|
369
379
|
<MissingObject id={primary} />
|
|
370
380
|
) : 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
|
-
}
|
|
381
|
+
case 'complementary--settings':
|
|
382
|
+
return isEchoObject(data.subject) ? <FallbackSettings object={data.subject} /> : null;
|
|
381
383
|
case 'dialog':
|
|
382
384
|
if (data.component === 'dxos.org/plugin/space/InvitationManagerDialog') {
|
|
383
385
|
return (
|
|
@@ -398,6 +400,7 @@ export const SpacePlugin = ({
|
|
|
398
400
|
return <PopoverRenameObject object={data.subject} />;
|
|
399
401
|
}
|
|
400
402
|
return null;
|
|
403
|
+
// TODO(burdon): Add role name syntax to minimal plugin docs.
|
|
401
404
|
case 'presence--glyph': {
|
|
402
405
|
return isReactiveObject(data.object) ? (
|
|
403
406
|
<SmallPresenceLive viewers={state.values.viewersByObject[fullyQualifiedId(data.object)]} />
|
|
@@ -441,6 +444,14 @@ export const SpacePlugin = ({
|
|
|
441
444
|
} else {
|
|
442
445
|
return <MenuFooter object={data.object} />;
|
|
443
446
|
}
|
|
447
|
+
case 'status': {
|
|
448
|
+
return (
|
|
449
|
+
<>
|
|
450
|
+
<SyncStatus />
|
|
451
|
+
<SaveStatus />
|
|
452
|
+
</>
|
|
453
|
+
);
|
|
454
|
+
}
|
|
444
455
|
default:
|
|
445
456
|
return null;
|
|
446
457
|
}
|
|
@@ -540,8 +551,7 @@ export const SpacePlugin = ({
|
|
|
540
551
|
},
|
|
541
552
|
properties: {
|
|
542
553
|
label: ['create space label', { ns: SPACE_PLUGIN }],
|
|
543
|
-
icon:
|
|
544
|
-
iconSymbol: 'ph--plus--regular',
|
|
554
|
+
icon: 'ph--plus--regular',
|
|
545
555
|
disposition: 'toolbar',
|
|
546
556
|
testId: 'spacePlugin.createSpace',
|
|
547
557
|
},
|
|
@@ -561,8 +571,7 @@ export const SpacePlugin = ({
|
|
|
561
571
|
},
|
|
562
572
|
properties: {
|
|
563
573
|
label: ['join space label', { ns: SPACE_PLUGIN }],
|
|
564
|
-
icon:
|
|
565
|
-
iconSymbol: 'ph--sign-in--regular',
|
|
574
|
+
icon: 'ph--sign-in--regular',
|
|
566
575
|
testId: 'spacePlugin.joinSpace',
|
|
567
576
|
},
|
|
568
577
|
},
|
|
@@ -707,6 +716,52 @@ export const SpacePlugin = ({
|
|
|
707
716
|
.filter(nonNullable);
|
|
708
717
|
},
|
|
709
718
|
}),
|
|
719
|
+
|
|
720
|
+
// Create nodes for object settings.
|
|
721
|
+
createExtension({
|
|
722
|
+
id: `${SPACE_PLUGIN}/settings-for-subject`,
|
|
723
|
+
resolver: ({ id }) => {
|
|
724
|
+
// TODO(Zan): Find util (or make one).
|
|
725
|
+
if (!id.endsWith('~settings')) {
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
const [subjectId] = id.split('~');
|
|
730
|
+
const [spaceId, objectId] = parseFullyQualifiedId(subjectId);
|
|
731
|
+
const space = client.spaces.get().find((space) => space.id === spaceId);
|
|
732
|
+
const object = toSignal(
|
|
733
|
+
(onChange) => {
|
|
734
|
+
const timeout = setTimeout(async () => {
|
|
735
|
+
await space?.db.loadObjectById(objectId);
|
|
736
|
+
onChange();
|
|
737
|
+
});
|
|
738
|
+
|
|
739
|
+
return () => clearTimeout(timeout);
|
|
740
|
+
},
|
|
741
|
+
() => space?.db.getObjectById(objectId),
|
|
742
|
+
subjectId,
|
|
743
|
+
);
|
|
744
|
+
if (!object || !subjectId) {
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
const meta = resolve(getTypename(object) ?? '');
|
|
749
|
+
const label = meta.label?.(object) ||
|
|
750
|
+
object.name ||
|
|
751
|
+
meta.placeholder || ['unnamed object settings label', { ns: SPACE_PLUGIN }];
|
|
752
|
+
|
|
753
|
+
return {
|
|
754
|
+
id,
|
|
755
|
+
type: 'orphan-settings-for-subject',
|
|
756
|
+
data: null,
|
|
757
|
+
properties: {
|
|
758
|
+
icon: 'ph--gear--regular',
|
|
759
|
+
label,
|
|
760
|
+
object,
|
|
761
|
+
},
|
|
762
|
+
};
|
|
763
|
+
},
|
|
764
|
+
}),
|
|
710
765
|
];
|
|
711
766
|
},
|
|
712
767
|
serializer: (plugins) => {
|
|
@@ -805,6 +860,15 @@ export const SpacePlugin = ({
|
|
|
805
860
|
data: { space, id: space.id, activeParts: { main: [space.id] } },
|
|
806
861
|
|
|
807
862
|
intents: [
|
|
863
|
+
...(settings.values.onSpaceCreate
|
|
864
|
+
? [
|
|
865
|
+
[
|
|
866
|
+
{ action: settings.values.onSpaceCreate, data: { space } },
|
|
867
|
+
{ action: SpaceAction.ADD_OBJECT, data: { target: space } },
|
|
868
|
+
{ action: NavigationAction.EXPOSE },
|
|
869
|
+
],
|
|
870
|
+
]
|
|
871
|
+
: []),
|
|
808
872
|
[
|
|
809
873
|
{
|
|
810
874
|
action: ObservabilityAction.SEND_EVENT,
|
|
@@ -1020,8 +1084,7 @@ export const SpacePlugin = ({
|
|
|
1020
1084
|
title: translations[0]['en-US'][SPACE_PLUGIN]['space limit label'],
|
|
1021
1085
|
description: translations[0]['en-US'][SPACE_PLUGIN]['space limit description'],
|
|
1022
1086
|
duration: 5_000,
|
|
1023
|
-
icon:
|
|
1024
|
-
iconSymbol: 'ph--warning--regular',
|
|
1087
|
+
icon: 'ph--warning--regular',
|
|
1025
1088
|
actionLabel: translations[0]['en-US'][SPACE_PLUGIN]['remove deleted objects label'],
|
|
1026
1089
|
actionAlt: translations[0]['en-US'][SPACE_PLUGIN]['remove deleted objects alt'],
|
|
1027
1090
|
// TODO(wittjosiah): Use OS namespace.
|
|
@@ -1060,7 +1123,7 @@ export const SpacePlugin = ({
|
|
|
1060
1123
|
}
|
|
1061
1124
|
|
|
1062
1125
|
return {
|
|
1063
|
-
data: { id: object
|
|
1126
|
+
data: { id: fullyQualifiedId(object), object, activeParts: { main: [fullyQualifiedId(object)] } },
|
|
1064
1127
|
intents: [
|
|
1065
1128
|
[
|
|
1066
1129
|
{
|
|
@@ -1115,7 +1178,6 @@ export const SpacePlugin = ({
|
|
|
1115
1178
|
activeParts: {
|
|
1116
1179
|
main: deletionData.wasActive,
|
|
1117
1180
|
sidebar: deletionData.wasActive,
|
|
1118
|
-
complementary: deletionData.wasActive,
|
|
1119
1181
|
},
|
|
1120
1182
|
},
|
|
1121
1183
|
});
|
|
@@ -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
|
+
};
|