@dxos/plugin-space 0.6.13 → 0.6.14-main.1366248
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-WZAM3FNP.mjs} +24 -5
- package/dist/lib/browser/chunk-WZAM3FNP.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +852 -348
- 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-HTAM5LQD.cjs} +30 -9
- package/dist/lib/node/chunk-HTAM5LQD.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 +1046 -550
- 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-TRJKV4PK.mjs +116 -0
- package/dist/lib/node-esm/chunk-TRJKV4PK.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 +3145 -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/DefaultObjectSettings.d.ts +7 -0
- package/dist/types/src/components/DefaultObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/MenuFooter.d.ts +1 -1
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts +3 -91
- 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.d.ts +4 -2
- package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +4 -92
- 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/SpaceSettingsPanel.d.ts +7 -0
- package/dist/types/src/components/SpaceSettingsPanel.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/Space.d.ts +8 -0
- package/dist/types/src/components/SyncStatus/Space.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +14 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +9 -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/save-tracker.d.ts +3 -0
- package/dist/types/src/components/SyncStatus/save-tracker.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/status.d.ts +9 -0
- package/dist/types/src/components/SyncStatus/status.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/sync-state.d.ts +14 -0
- package/dist/types/src/components/SyncStatus/sync-state.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +3 -3
- 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 +14 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/thread.d.ts +15 -1
- package/dist/types/src/types/thread.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +23 -2
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +4 -7
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +46 -45
- package/src/SpacePlugin.tsx +275 -137
- package/src/components/DefaultObjectSettings.tsx +33 -0
- package/src/components/MenuFooter.tsx +2 -2
- package/src/components/ShareSpaceButton.stories.tsx +11 -7
- package/src/components/SpaceMain/SpaceMain.tsx +1 -22
- package/src/components/SpacePresence.stories.tsx +11 -9
- package/src/components/SpacePresence.tsx +34 -23
- package/src/components/SpaceSettings.tsx +35 -6
- package/src/components/SpaceSettingsPanel.tsx +69 -0
- package/src/components/SyncStatus/Space.tsx +109 -0
- package/src/components/SyncStatus/SyncStatus.stories.tsx +74 -0
- package/src/components/SyncStatus/SyncStatus.tsx +102 -0
- package/src/components/SyncStatus/index.ts +5 -0
- package/src/components/SyncStatus/save-tracker.ts +71 -0
- package/src/components/SyncStatus/status.ts +44 -0
- package/src/components/SyncStatus/sync-state.ts +77 -0
- package/src/components/index.ts +3 -3
- package/src/meta.ts +3 -1
- package/src/translations.ts +16 -2
- package/src/types/collection.ts +1 -1
- package/src/types/thread.ts +12 -2
- package/src/types/types.ts +31 -3
- package/src/util.tsx +23 -58
- 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/dist/types/src/components/MissingObject.d.ts +0 -5
- package/dist/types/src/components/MissingObject.d.ts.map +0 -1
- package/src/components/EmptySpace.tsx +0 -25
- package/src/components/EmptyTree.tsx +0 -25
- package/src/components/MissingObject.tsx +0 -54
package/dist/lib/node/index.cjs
CHANGED
|
@@ -28,40 +28,43 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var node_exports = {};
|
|
30
30
|
__export(node_exports, {
|
|
31
|
-
ActorSchema: () =>
|
|
31
|
+
ActorSchema: () => import_chunk_HTAM5LQD.ActorSchema,
|
|
32
32
|
AwaitingObject: () => AwaitingObject,
|
|
33
33
|
COMPOSER_SPACE_LOCK: () => COMPOSER_SPACE_LOCK,
|
|
34
|
-
ChannelType: () =>
|
|
34
|
+
ChannelType: () => import_chunk_HTAM5LQD.ChannelType,
|
|
35
35
|
CollectionMain: () => CollectionMain,
|
|
36
36
|
CollectionSection: () => CollectionSection,
|
|
37
|
-
CollectionType: () =>
|
|
38
|
-
ContactType: () =>
|
|
39
|
-
|
|
40
|
-
EmptyTree: () => EmptyTree,
|
|
37
|
+
CollectionType: () => import_chunk_HTAM5LQD.CollectionType,
|
|
38
|
+
ContactType: () => import_chunk_HTAM5LQD.ContactType,
|
|
39
|
+
DefaultObjectSettings: () => DefaultObjectSettings,
|
|
41
40
|
FullPresence: () => FullPresence,
|
|
42
41
|
MenuFooter: () => MenuFooter,
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
MessageState: () => import_chunk_HTAM5LQD.MessageState,
|
|
43
|
+
MessageType: () => import_chunk_HTAM5LQD.MessageType,
|
|
45
44
|
PersistenceStatus: () => PersistenceStatus,
|
|
46
45
|
PopoverRenameObject: () => PopoverRenameObject,
|
|
47
46
|
PopoverRenameSpace: () => PopoverRenameSpace,
|
|
48
47
|
SHARED: () => SHARED,
|
|
49
48
|
SPACES: () => SPACES,
|
|
50
|
-
SPACE_DIRECTORY_HANDLE: () =>
|
|
51
|
-
SPACE_PLUGIN: () =>
|
|
52
|
-
SPACE_PLUGIN_SHORT_ID: () =>
|
|
49
|
+
SPACE_DIRECTORY_HANDLE: () => import_chunk_HTAM5LQD.SPACE_DIRECTORY_HANDLE,
|
|
50
|
+
SPACE_PLUGIN: () => import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
51
|
+
SPACE_PLUGIN_SHORT_ID: () => import_chunk_P4XUXM7Y.SPACE_PLUGIN_SHORT_ID,
|
|
53
52
|
SPACE_TYPE: () => SPACE_TYPE,
|
|
54
53
|
ShareSpaceButton: () => ShareSpaceButton,
|
|
55
54
|
ShareSpaceButtonImpl: () => ShareSpaceButtonImpl,
|
|
56
55
|
SmallPresence: () => SmallPresence,
|
|
57
56
|
SmallPresenceLive: () => SmallPresenceLive,
|
|
58
|
-
SpaceAction: () =>
|
|
57
|
+
SpaceAction: () => import_chunk_P4XUXM7Y.SpaceAction,
|
|
59
58
|
SpaceMain: () => SpaceMain,
|
|
60
59
|
SpacePlugin: () => SpacePlugin,
|
|
61
60
|
SpacePresence: () => SpacePresence,
|
|
62
61
|
SpaceSettings: () => SpaceSettings,
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
SpaceSettingsPanel: () => SpaceSettingsPanel,
|
|
63
|
+
SyncStatus: () => SyncStatus,
|
|
64
|
+
SyncStatusDetail: () => SyncStatusDetail,
|
|
65
|
+
SyncStatusIndicator: () => SyncStatusIndicator,
|
|
66
|
+
ThreadStatus: () => import_chunk_HTAM5LQD.ThreadStatus,
|
|
67
|
+
ThreadType: () => import_chunk_HTAM5LQD.ThreadType,
|
|
65
68
|
cloneObject: () => cloneObject,
|
|
66
69
|
constructObjectActionGroups: () => constructObjectActionGroups,
|
|
67
70
|
constructObjectActions: () => constructObjectActions,
|
|
@@ -74,18 +77,19 @@ __export(node_exports, {
|
|
|
74
77
|
getNestedObjects: () => getNestedObjects,
|
|
75
78
|
getSpaceDisplayName: () => getSpaceDisplayName,
|
|
76
79
|
memoizeQuery: () => memoizeQuery,
|
|
80
|
+
parseSpaceInitPlugin: () => import_chunk_HTAM5LQD.parseSpaceInitPlugin,
|
|
77
81
|
parseSpacePlugin: () => parseSpacePlugin,
|
|
78
82
|
translations: () => translations_default
|
|
79
83
|
});
|
|
80
84
|
module.exports = __toCommonJS(node_exports);
|
|
81
|
-
var
|
|
82
|
-
var
|
|
83
|
-
var import_react = require("@phosphor-icons/react");
|
|
85
|
+
var import_chunk_P4XUXM7Y = require("./chunk-P4XUXM7Y.cjs");
|
|
86
|
+
var import_chunk_HTAM5LQD = require("./chunk-HTAM5LQD.cjs");
|
|
84
87
|
var import_signals_core = require("@preact/signals-core");
|
|
85
|
-
var
|
|
88
|
+
var import_react = __toESM(require("react"));
|
|
86
89
|
var import_app_framework = require("@dxos/app-framework");
|
|
87
90
|
var import_async = require("@dxos/async");
|
|
88
91
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
92
|
+
var import_core = require("@dxos/echo-signals/core");
|
|
89
93
|
var import_local_storage = require("@dxos/local-storage");
|
|
90
94
|
var import_log = require("@dxos/log");
|
|
91
95
|
var import_migrations = require("@dxos/migrations");
|
|
@@ -96,97 +100,107 @@ var import_meta = require("@dxos/plugin-observability/meta");
|
|
|
96
100
|
var import_react_client = require("@dxos/react-client");
|
|
97
101
|
var import_echo = require("@dxos/react-client/echo");
|
|
98
102
|
var import_react_ui = require("@dxos/react-ui");
|
|
99
|
-
var
|
|
103
|
+
var import_react2 = require("@dxos/shell/react");
|
|
100
104
|
var import_util = require("@dxos/util");
|
|
101
|
-
var
|
|
102
|
-
var
|
|
105
|
+
var import_react3 = require("@phosphor-icons/react");
|
|
106
|
+
var import_react4 = __toESM(require("react"));
|
|
103
107
|
var import_app_framework2 = require("@dxos/app-framework");
|
|
104
108
|
var import_react_client2 = require("@dxos/react-client");
|
|
105
109
|
var import_echo2 = require("@dxos/react-client/echo");
|
|
106
110
|
var import_react_ui2 = require("@dxos/react-ui");
|
|
107
111
|
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
108
|
-
var
|
|
112
|
+
var import_react5 = __toESM(require("react"));
|
|
109
113
|
var import_react_ui3 = require("@dxos/react-ui");
|
|
110
114
|
var import_react_ui_theme2 = require("@dxos/react-ui-theme");
|
|
111
|
-
var
|
|
115
|
+
var import_react6 = __toESM(require("react"));
|
|
112
116
|
var import_react_ui4 = require("@dxos/react-ui");
|
|
113
|
-
var
|
|
117
|
+
var import_react7 = __toESM(require("react"));
|
|
114
118
|
var import_react_ui5 = require("@dxos/react-ui");
|
|
115
|
-
var
|
|
119
|
+
var import_react8 = require("@phosphor-icons/react");
|
|
116
120
|
var import_react9 = __toESM(require("react"));
|
|
117
|
-
var import_react_ui6 = require("@dxos/react-ui");
|
|
118
|
-
var import_react_ui_theme4 = require("@dxos/react-ui-theme");
|
|
119
|
-
var import_react10 = require("@phosphor-icons/react");
|
|
120
|
-
var import_react11 = __toESM(require("react"));
|
|
121
121
|
var import_echo3 = require("@dxos/client/echo");
|
|
122
122
|
var import_react_client3 = require("@dxos/react-client");
|
|
123
|
-
var
|
|
124
|
-
var import_react12 = require("@phosphor-icons/react");
|
|
125
|
-
var import_react13 = __toESM(require("react"));
|
|
123
|
+
var import_react_ui6 = require("@dxos/react-ui");
|
|
126
124
|
var import_app_framework3 = require("@dxos/app-framework");
|
|
127
125
|
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
128
126
|
var import_invariant = require("@dxos/invariant");
|
|
129
127
|
var import_migrations2 = require("@dxos/migrations");
|
|
130
128
|
var import_plugin_graph2 = require("@dxos/plugin-graph");
|
|
131
129
|
var import_echo4 = require("@dxos/react-client/echo");
|
|
130
|
+
var import_react10 = require("@phosphor-icons/react");
|
|
131
|
+
var import_react11 = __toESM(require("react"));
|
|
132
|
+
var import_async2 = require("@dxos/async");
|
|
133
|
+
var import_react_ui7 = require("@dxos/react-ui");
|
|
134
|
+
var import_react_ui_theme3 = require("@dxos/react-ui-theme");
|
|
135
|
+
var import_react12 = __toESM(require("react"));
|
|
136
|
+
var import_log2 = require("@dxos/log");
|
|
137
|
+
var import_react_ui8 = require("@dxos/react-ui");
|
|
138
|
+
var import_react13 = __toESM(require("react"));
|
|
139
|
+
var import_react_ui9 = require("@dxos/react-ui");
|
|
132
140
|
var import_react14 = __toESM(require("react"));
|
|
133
141
|
var import_app_framework4 = require("@dxos/app-framework");
|
|
134
|
-
var
|
|
135
|
-
var import_react_ui_theme5 = require("@dxos/react-ui-theme");
|
|
142
|
+
var import_react_ui10 = require("@dxos/react-ui");
|
|
136
143
|
var import_react15 = require("@phosphor-icons/react");
|
|
137
144
|
var import_react16 = __toESM(require("react"));
|
|
138
|
-
var
|
|
139
|
-
var
|
|
140
|
-
var import_react_ui_theme6 = require("@dxos/react-ui-theme");
|
|
141
|
-
var import_react17 = __toESM(require("react"));
|
|
142
|
-
var import_log2 = require("@dxos/log");
|
|
143
|
-
var import_react_ui10 = require("@dxos/react-ui");
|
|
144
|
-
var import_react18 = __toESM(require("react"));
|
|
145
|
+
var import_app_framework5 = require("@dxos/app-framework");
|
|
146
|
+
var import_echo5 = require("@dxos/react-client/echo");
|
|
145
147
|
var import_react_ui11 = require("@dxos/react-ui");
|
|
148
|
+
var import_react_ui_theme4 = require("@dxos/react-ui-theme");
|
|
149
|
+
var import_react17 = require("@dxos/shell/react");
|
|
150
|
+
var import_react18 = require("@phosphor-icons/react");
|
|
146
151
|
var import_react19 = __toESM(require("react"));
|
|
147
|
-
var import_app_framework5 = require("@dxos/app-framework");
|
|
148
|
-
var import_react_ui12 = require("@dxos/react-ui");
|
|
149
|
-
var import_react20 = require("@phosphor-icons/react");
|
|
150
|
-
var import_react21 = __toESM(require("react"));
|
|
151
152
|
var import_app_framework6 = require("@dxos/app-framework");
|
|
152
|
-
var import_echo5 = require("@dxos/react-client/echo");
|
|
153
|
-
var import_react_ui13 = require("@dxos/react-ui");
|
|
154
|
-
var import_react_ui_theme7 = require("@dxos/react-ui-theme");
|
|
155
|
-
var import_react22 = require("@dxos/shell/react");
|
|
156
|
-
var import_react23 = require("@phosphor-icons/react");
|
|
157
|
-
var import_react24 = __toESM(require("react"));
|
|
158
|
-
var import_app_framework7 = require("@dxos/app-framework");
|
|
159
153
|
var import_echo6 = require("@dxos/react-client/echo");
|
|
160
154
|
var import_invitations = require("@dxos/react-client/invitations");
|
|
161
155
|
var import_invitations2 = require("@dxos/react-client/invitations");
|
|
162
|
-
var
|
|
163
|
-
var
|
|
164
|
-
var
|
|
165
|
-
var
|
|
166
|
-
var
|
|
156
|
+
var import_react_ui12 = require("@dxos/react-ui");
|
|
157
|
+
var import_react_ui_theme5 = require("@dxos/react-ui-theme");
|
|
158
|
+
var import_react20 = require("@dxos/shell/react");
|
|
159
|
+
var import_react21 = __toESM(require("react"));
|
|
160
|
+
var import_app_framework7 = require("@dxos/app-framework");
|
|
167
161
|
var import_display_name = require("@dxos/display-name");
|
|
168
162
|
var import_react_client4 = require("@dxos/react-client");
|
|
169
163
|
var import_echo7 = require("@dxos/react-client/echo");
|
|
170
164
|
var import_halo = require("@dxos/react-client/halo");
|
|
171
|
-
var
|
|
165
|
+
var import_react_ui13 = require("@dxos/react-ui");
|
|
172
166
|
var import_react_ui_attention = require("@dxos/react-ui-attention");
|
|
173
167
|
var import_util2 = require("@dxos/util");
|
|
174
|
-
var
|
|
175
|
-
var
|
|
176
|
-
var
|
|
168
|
+
var import_react22 = __toESM(require("react"));
|
|
169
|
+
var import_app_framework8 = require("@dxos/app-framework");
|
|
170
|
+
var import_react_ui14 = require("@dxos/react-ui");
|
|
171
|
+
var import_react_ui_data = require("@dxos/react-ui-data");
|
|
172
|
+
var import_react23 = __toESM(require("react"));
|
|
173
|
+
var import_log3 = require("@dxos/log");
|
|
174
|
+
var import_metadata = require("@dxos/protocols/proto/dxos/echo/metadata");
|
|
175
|
+
var import_react_client5 = require("@dxos/react-client");
|
|
176
|
+
var import_halo2 = require("@dxos/react-client/halo");
|
|
177
|
+
var import_react_ui15 = require("@dxos/react-ui");
|
|
178
|
+
var import_react24 = __toESM(require("react"));
|
|
179
|
+
var import_plugin_status_bar = require("@dxos/plugin-status-bar");
|
|
180
|
+
var import_react_client6 = require("@dxos/react-client");
|
|
177
181
|
var import_react_ui16 = require("@dxos/react-ui");
|
|
182
|
+
var import_react_ui_syntax_highlighter = require("@dxos/react-ui-syntax-highlighter");
|
|
183
|
+
var import_react_ui_theme6 = require("@dxos/react-ui-theme");
|
|
184
|
+
var import_react25 = __toESM(require("react"));
|
|
185
|
+
var import_react_ui17 = require("@dxos/react-ui");
|
|
186
|
+
var import_react_ui_theme7 = require("@dxos/react-ui-theme");
|
|
187
|
+
var import_context = require("@dxos/context");
|
|
188
|
+
var import_react26 = require("react");
|
|
189
|
+
var import_context2 = require("@dxos/context");
|
|
190
|
+
var import_protocols = require("@dxos/protocols");
|
|
191
|
+
var import_react_client7 = require("@dxos/react-client");
|
|
178
192
|
var WAIT_FOR_OBJECT_TIMEOUT = 18e4;
|
|
179
193
|
var TOAST_TIMEOUT = 24e4;
|
|
180
194
|
var AwaitingObject = ({ id }) => {
|
|
181
|
-
const [open, setOpen] = (0,
|
|
182
|
-
const [waiting, setWaiting] = (0,
|
|
183
|
-
const [found, setFound] = (0,
|
|
184
|
-
const { t } = (0, import_react_ui2.useTranslation)(
|
|
195
|
+
const [open, setOpen] = (0, import_react4.useState)(true);
|
|
196
|
+
const [waiting, setWaiting] = (0, import_react4.useState)(true);
|
|
197
|
+
const [found, setFound] = (0, import_react4.useState)(false);
|
|
198
|
+
const { t } = (0, import_react_ui2.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
185
199
|
const intentPlugin = (0, import_app_framework2.useResolvePlugin)(import_app_framework2.parseIntentPlugin);
|
|
186
200
|
const navigationPlugin = (0, import_app_framework2.useResolvePlugin)(import_app_framework2.parseNavigationPlugin);
|
|
187
201
|
const client = (0, import_react_client2.useClient)();
|
|
188
202
|
const objects = (0, import_echo2.useQuery)(client.spaces);
|
|
189
|
-
(0,
|
|
203
|
+
(0, import_react4.useEffect)(() => {
|
|
190
204
|
if (!id) {
|
|
191
205
|
return;
|
|
192
206
|
}
|
|
@@ -197,7 +211,7 @@ var AwaitingObject = ({ id }) => {
|
|
|
197
211
|
}, [
|
|
198
212
|
id
|
|
199
213
|
]);
|
|
200
|
-
(0,
|
|
214
|
+
(0, import_react4.useEffect)(() => {
|
|
201
215
|
if (objects.findIndex((object) => (0, import_echo2.fullyQualifiedId)(object) === id) > -1) {
|
|
202
216
|
setFound(true);
|
|
203
217
|
if (navigationPlugin?.provides.location.active === id) {
|
|
@@ -210,8 +224,8 @@ var AwaitingObject = ({ id }) => {
|
|
|
210
224
|
intentPlugin
|
|
211
225
|
]);
|
|
212
226
|
const handleClose = async () => intentPlugin?.provides.intent.dispatch({
|
|
213
|
-
plugin:
|
|
214
|
-
action:
|
|
227
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
228
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.WAIT_FOR_OBJECT,
|
|
215
229
|
data: {
|
|
216
230
|
id: void 0
|
|
217
231
|
}
|
|
@@ -229,73 +243,72 @@ var AwaitingObject = ({ id }) => {
|
|
|
229
243
|
});
|
|
230
244
|
void handleClose();
|
|
231
245
|
};
|
|
232
|
-
return /* @__PURE__ */
|
|
246
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Toast.Root, {
|
|
233
247
|
open,
|
|
234
248
|
duration: TOAST_TIMEOUT,
|
|
235
249
|
onOpenChange: setOpen
|
|
236
|
-
}, /* @__PURE__ */
|
|
250
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Toast.Body, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Toast.Title, {
|
|
237
251
|
classNames: "flex items-center gap-2"
|
|
238
|
-
}, found ? /* @__PURE__ */
|
|
252
|
+
}, found ? /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(import_react3.CheckCircle, {
|
|
239
253
|
className: (0, import_react_ui_theme.getSize)(5)
|
|
240
|
-
}), /* @__PURE__ */
|
|
254
|
+
}), /* @__PURE__ */ import_react4.default.createElement("span", null, t("found object label"))) : waiting ? /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(import_react3.CircleNotch, {
|
|
241
255
|
className: (0, import_react_ui_theme.mx)((0, import_react_ui_theme.getSize)(5), "animate-spin")
|
|
242
|
-
}), /* @__PURE__ */
|
|
256
|
+
}), /* @__PURE__ */ import_react4.default.createElement("span", null, t("waiting for object label"))) : /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(import_react3.CircleDashed, {
|
|
243
257
|
className: (0, import_react_ui_theme.getSize)(5)
|
|
244
|
-
}), /* @__PURE__ */
|
|
258
|
+
}), /* @__PURE__ */ import_react4.default.createElement("span", null, t("object not found label")))), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Toast.Description, null, t(found ? "found object description" : waiting ? "waiting for object description" : "object not found description"))), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Toast.Actions, null, found ? /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Toast.Action, {
|
|
245
259
|
altText: t("go to object alt"),
|
|
246
260
|
asChild: true
|
|
247
|
-
}, /* @__PURE__ */
|
|
261
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Button, {
|
|
248
262
|
variant: "primary",
|
|
249
263
|
onClick: handleNavigate
|
|
250
|
-
}, t("go to object label"))), /* @__PURE__ */
|
|
264
|
+
}, t("go to object label"))), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Toast.Close, {
|
|
251
265
|
asChild: true
|
|
252
|
-
}, /* @__PURE__ */
|
|
266
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Button, {
|
|
253
267
|
onClick: handleClose
|
|
254
268
|
}, t("close label", {
|
|
255
269
|
ns: "appkit"
|
|
256
|
-
})))) : /* @__PURE__ */
|
|
270
|
+
})))) : /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Toast.Close, {
|
|
257
271
|
asChild: true
|
|
258
|
-
}, /* @__PURE__ */
|
|
272
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Button, {
|
|
259
273
|
onClick: handleClose
|
|
260
274
|
}, t(waiting ? "close label" : "confirm label", {
|
|
261
275
|
ns: "appkit"
|
|
262
276
|
})))));
|
|
263
277
|
};
|
|
264
278
|
var CollectionMain = ({ collection }) => {
|
|
265
|
-
const { t } = (0, import_react_ui3.useTranslation)(
|
|
266
|
-
return /* @__PURE__ */
|
|
279
|
+
const { t } = (0, import_react_ui3.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
280
|
+
return /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
267
281
|
role: "none",
|
|
268
282
|
className: (0, import_react_ui_theme2.mx)(import_react_ui_theme2.baseSurface, "min-bs-screen is-full flex items-center justify-center p-8"),
|
|
269
283
|
"data-testid": "composer.firstRunMessage"
|
|
270
|
-
}, /* @__PURE__ */
|
|
284
|
+
}, /* @__PURE__ */ import_react5.default.createElement("p", {
|
|
271
285
|
role: "alert",
|
|
272
286
|
className: (0, import_react_ui_theme2.mx)(import_react_ui_theme2.descriptionText, "border border-dashed border-neutral-400/50 rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words")
|
|
273
287
|
}, collection.name ?? t("unnamed collection label")));
|
|
274
288
|
};
|
|
275
289
|
var CollectionSection = ({ collection }) => {
|
|
276
|
-
const { t } = (0, import_react_ui4.useTranslation)(
|
|
277
|
-
return /* @__PURE__ */
|
|
290
|
+
const { t } = (0, import_react_ui4.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
291
|
+
return /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
278
292
|
className: "min-bs-[3.5rem] grid grid-rows-subgrid grid-cols-subgrid items-center"
|
|
279
|
-
}, /* @__PURE__ */
|
|
293
|
+
}, /* @__PURE__ */ import_react6.default.createElement("span", {
|
|
280
294
|
className: "truncate"
|
|
281
295
|
}, collection.name ?? t("unnamed collection label")));
|
|
282
296
|
};
|
|
283
|
-
var
|
|
284
|
-
const { t } = (0, import_react_ui5.useTranslation)(
|
|
285
|
-
return /* @__PURE__ */
|
|
286
|
-
role: "
|
|
287
|
-
className:
|
|
288
|
-
}, t("
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}, t("empty tree message"));
|
|
297
|
+
var DefaultObjectSettings = ({ object }) => {
|
|
298
|
+
const { t } = (0, import_react_ui5.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
299
|
+
return /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
300
|
+
role: "form",
|
|
301
|
+
className: "flex flex-col w-full p-2 gap-1"
|
|
302
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui5.Input.Root, null, /* @__PURE__ */ import_react7.default.createElement(import_react_ui5.Input.Label, null, t("name label")), /* @__PURE__ */ import_react7.default.createElement(import_react_ui5.Input.TextInput, {
|
|
303
|
+
placeholder: t("name placeholder"),
|
|
304
|
+
value: object.name ?? "",
|
|
305
|
+
onChange: (event) => {
|
|
306
|
+
object.name = event.target.value;
|
|
307
|
+
}
|
|
308
|
+
})));
|
|
296
309
|
};
|
|
297
310
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/util.tsx";
|
|
298
|
-
var SPACES = `${
|
|
311
|
+
var SPACES = `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}-spaces`;
|
|
299
312
|
var SPACE_TYPE = "dxos.org/type/Space";
|
|
300
313
|
var COMPOSER_SPACE_LOCK = "dxos.org/plugin/space/lock";
|
|
301
314
|
var SHARED = "shared-spaces";
|
|
@@ -311,12 +324,12 @@ var getSpaceDisplayName = (space, { personal, namesCache = {} } = {}) => {
|
|
|
311
324
|
return space.state.get() === import_echo4.SpaceState.SPACE_READY && (space.properties.name?.length ?? 0) > 0 ? space.properties.name : namesCache[space.id] ? namesCache[space.id] : personal ? [
|
|
312
325
|
"personal space label",
|
|
313
326
|
{
|
|
314
|
-
ns:
|
|
327
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
315
328
|
}
|
|
316
329
|
] : [
|
|
317
330
|
"unnamed space label",
|
|
318
331
|
{
|
|
319
|
-
ns:
|
|
332
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
320
333
|
}
|
|
321
334
|
];
|
|
322
335
|
};
|
|
@@ -348,7 +361,7 @@ var getCollectionGraphNodePartials = ({ collection, space, resolve }) => {
|
|
|
348
361
|
}
|
|
349
362
|
},
|
|
350
363
|
onCopy: async (child, index) => {
|
|
351
|
-
const newObject = await cloneObject(child.data, resolve);
|
|
364
|
+
const newObject = await cloneObject(child.data, resolve, space);
|
|
352
365
|
space.db.add(newObject);
|
|
353
366
|
if (typeof index !== "undefined") {
|
|
354
367
|
collection.objects.splice(index, 0, newObject);
|
|
@@ -363,8 +376,8 @@ var checkPendingMigration = (space) => {
|
|
|
363
376
|
};
|
|
364
377
|
var constructSpaceNode = ({ space, personal, namesCache, resolve }) => {
|
|
365
378
|
const hasPendingMigration = checkPendingMigration(space);
|
|
366
|
-
const collection = space.state.get() === import_echo4.SpaceState.SPACE_READY && space.properties[
|
|
367
|
-
const partials = space.state.get() === import_echo4.SpaceState.SPACE_READY && collection instanceof
|
|
379
|
+
const collection = space.state.get() === import_echo4.SpaceState.SPACE_READY && space.properties[import_chunk_HTAM5LQD.CollectionType.typename];
|
|
380
|
+
const partials = space.state.get() === import_echo4.SpaceState.SPACE_READY && collection instanceof import_chunk_HTAM5LQD.CollectionType ? getCollectionGraphNodePartials({
|
|
368
381
|
collection,
|
|
369
382
|
space,
|
|
370
383
|
resolve
|
|
@@ -380,8 +393,7 @@ var constructSpaceNode = ({ space, personal, namesCache, resolve }) => {
|
|
|
380
393
|
namesCache
|
|
381
394
|
}),
|
|
382
395
|
description: space.state.get() === import_echo4.SpaceState.SPACE_READY && space.properties.description,
|
|
383
|
-
icon:
|
|
384
|
-
iconSymbol: "ph--planet--regular",
|
|
396
|
+
icon: "ph--planet--regular",
|
|
385
397
|
disabled: space.state.get() !== import_echo4.SpaceState.SPACE_READY || hasPendingMigration,
|
|
386
398
|
testId: "spacePlugin.space"
|
|
387
399
|
}
|
|
@@ -394,21 +406,20 @@ var constructSpaceActionGroups = ({ space, dispatch }) => {
|
|
|
394
406
|
if (state !== import_echo4.SpaceState.SPACE_READY || hasPendingMigration) {
|
|
395
407
|
return [];
|
|
396
408
|
}
|
|
397
|
-
const collection = space.properties[
|
|
409
|
+
const collection = space.properties[import_chunk_HTAM5LQD.CollectionType.typename];
|
|
398
410
|
const actions = [
|
|
399
411
|
{
|
|
400
|
-
id: getId(
|
|
412
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT),
|
|
401
413
|
type: import_plugin_graph2.ACTION_GROUP_TYPE,
|
|
402
414
|
data: import_plugin_graph2.actionGroupSymbol,
|
|
403
415
|
properties: {
|
|
404
416
|
label: [
|
|
405
417
|
"create object in space label",
|
|
406
418
|
{
|
|
407
|
-
ns:
|
|
419
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
408
420
|
}
|
|
409
421
|
],
|
|
410
|
-
icon:
|
|
411
|
-
iconSymbol: "ph--plus--regular",
|
|
422
|
+
icon: "ph--plus--regular",
|
|
412
423
|
disposition: "toolbar",
|
|
413
424
|
// TODO(wittjosiah): This is currently a navtree feature. Address this with cmd+k integration.
|
|
414
425
|
// mainAreaDisposition: 'in-flow',
|
|
@@ -417,15 +428,15 @@ var constructSpaceActionGroups = ({ space, dispatch }) => {
|
|
|
417
428
|
},
|
|
418
429
|
nodes: [
|
|
419
430
|
{
|
|
420
|
-
id: getId(
|
|
431
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT.replace("object", "collection")),
|
|
421
432
|
type: import_plugin_graph2.ACTION_TYPE,
|
|
422
433
|
data: () => dispatch([
|
|
423
434
|
{
|
|
424
|
-
plugin:
|
|
425
|
-
action:
|
|
435
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
436
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT,
|
|
426
437
|
data: {
|
|
427
438
|
target: collection,
|
|
428
|
-
object: (0, import_echo_schema2.create)(
|
|
439
|
+
object: (0, import_echo_schema2.create)(import_chunk_HTAM5LQD.CollectionType, {
|
|
429
440
|
objects: [],
|
|
430
441
|
views: {}
|
|
431
442
|
})
|
|
@@ -439,11 +450,10 @@ var constructSpaceActionGroups = ({ space, dispatch }) => {
|
|
|
439
450
|
label: [
|
|
440
451
|
"create collection label",
|
|
441
452
|
{
|
|
442
|
-
ns:
|
|
453
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
443
454
|
}
|
|
444
455
|
],
|
|
445
|
-
icon:
|
|
446
|
-
iconSymbol: "ph--cards-three--regular",
|
|
456
|
+
icon: "ph--cards-three--regular",
|
|
447
457
|
testId: "spacePlugin.createCollection"
|
|
448
458
|
}
|
|
449
459
|
}
|
|
@@ -459,12 +469,12 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
459
469
|
const actions = [];
|
|
460
470
|
if (hasPendingMigration) {
|
|
461
471
|
actions.push({
|
|
462
|
-
id: getId(
|
|
472
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.MIGRATE),
|
|
463
473
|
type: import_plugin_graph2.ACTION_GROUP_TYPE,
|
|
464
474
|
data: async () => {
|
|
465
475
|
await dispatch({
|
|
466
|
-
plugin:
|
|
467
|
-
action:
|
|
476
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
477
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.MIGRATE,
|
|
468
478
|
data: {
|
|
469
479
|
space
|
|
470
480
|
}
|
|
@@ -474,11 +484,10 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
474
484
|
label: [
|
|
475
485
|
"migrate space label",
|
|
476
486
|
{
|
|
477
|
-
ns:
|
|
487
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
478
488
|
}
|
|
479
489
|
],
|
|
480
|
-
icon:
|
|
481
|
-
iconSymbol: "ph--database--regular",
|
|
490
|
+
icon: "ph--database--regular",
|
|
482
491
|
disposition: "toolbar",
|
|
483
492
|
mainAreaDisposition: "in-flow",
|
|
484
493
|
disabled: migrating || import_migrations2.Migrations.running(space)
|
|
@@ -488,15 +497,15 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
488
497
|
if (state === import_echo4.SpaceState.SPACE_READY && !hasPendingMigration) {
|
|
489
498
|
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
490
499
|
actions.push({
|
|
491
|
-
id: getId(
|
|
500
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.SHARE),
|
|
492
501
|
type: import_plugin_graph2.ACTION_TYPE,
|
|
493
502
|
data: async () => {
|
|
494
503
|
if (locked) {
|
|
495
504
|
return;
|
|
496
505
|
}
|
|
497
506
|
await dispatch({
|
|
498
|
-
plugin:
|
|
499
|
-
action:
|
|
507
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
508
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.SHARE,
|
|
500
509
|
data: {
|
|
501
510
|
spaceId: space.id
|
|
502
511
|
}
|
|
@@ -506,11 +515,10 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
506
515
|
label: [
|
|
507
516
|
"share space label",
|
|
508
517
|
{
|
|
509
|
-
ns:
|
|
518
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
510
519
|
}
|
|
511
520
|
],
|
|
512
|
-
icon:
|
|
513
|
-
iconSymbol: "ph--users--regular",
|
|
521
|
+
icon: "ph--users--regular",
|
|
514
522
|
disabled: locked,
|
|
515
523
|
keyBinding: {
|
|
516
524
|
macos: "meta+.",
|
|
@@ -519,12 +527,12 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
519
527
|
mainAreaDisposition: "absent"
|
|
520
528
|
}
|
|
521
529
|
}, {
|
|
522
|
-
id: locked ? getId(
|
|
530
|
+
id: locked ? getId(import_chunk_P4XUXM7Y.SpaceAction.UNLOCK) : getId(import_chunk_P4XUXM7Y.SpaceAction.LOCK),
|
|
523
531
|
type: import_plugin_graph2.ACTION_TYPE,
|
|
524
532
|
data: async () => {
|
|
525
533
|
await dispatch({
|
|
526
|
-
plugin:
|
|
527
|
-
action: locked ?
|
|
534
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
535
|
+
action: locked ? import_chunk_P4XUXM7Y.SpaceAction.UNLOCK : import_chunk_P4XUXM7Y.SpaceAction.LOCK,
|
|
528
536
|
data: {
|
|
529
537
|
space
|
|
530
538
|
}
|
|
@@ -534,19 +542,18 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
534
542
|
label: [
|
|
535
543
|
locked ? "unlock space label" : "lock space label",
|
|
536
544
|
{
|
|
537
|
-
ns:
|
|
545
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
538
546
|
}
|
|
539
547
|
],
|
|
540
|
-
icon: locked ?
|
|
541
|
-
iconSymbol: locked ? "ph--lock-simple-open--regular" : "ph--lock-simple--regular"
|
|
548
|
+
icon: locked ? "ph--lock-simple-open--regular" : "ph--lock-simple--regular"
|
|
542
549
|
}
|
|
543
550
|
}, {
|
|
544
|
-
id: getId(
|
|
551
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.RENAME),
|
|
545
552
|
type: import_plugin_graph2.ACTION_TYPE,
|
|
546
553
|
data: async (params) => {
|
|
547
554
|
await dispatch({
|
|
548
|
-
plugin:
|
|
549
|
-
action:
|
|
555
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
556
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.RENAME,
|
|
550
557
|
data: {
|
|
551
558
|
space,
|
|
552
559
|
...params
|
|
@@ -557,11 +564,10 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
557
564
|
label: [
|
|
558
565
|
"rename space label",
|
|
559
566
|
{
|
|
560
|
-
ns:
|
|
567
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
561
568
|
}
|
|
562
569
|
],
|
|
563
|
-
icon:
|
|
564
|
-
iconSymbol: "ph--pencil-simple-line--regular",
|
|
570
|
+
icon: "ph--pencil-simple-line--regular",
|
|
565
571
|
keyBinding: {
|
|
566
572
|
macos: "shift+F6",
|
|
567
573
|
windows: "shift+F6"
|
|
@@ -572,12 +578,12 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
572
578
|
}
|
|
573
579
|
if (state !== import_echo4.SpaceState.SPACE_INACTIVE && !hasPendingMigration) {
|
|
574
580
|
actions.push({
|
|
575
|
-
id: getId(
|
|
581
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.CLOSE),
|
|
576
582
|
type: import_plugin_graph2.ACTION_TYPE,
|
|
577
583
|
data: async () => {
|
|
578
584
|
await dispatch({
|
|
579
|
-
plugin:
|
|
580
|
-
action:
|
|
585
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
586
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.CLOSE,
|
|
581
587
|
data: {
|
|
582
588
|
space
|
|
583
589
|
}
|
|
@@ -587,11 +593,10 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
587
593
|
label: [
|
|
588
594
|
"close space label",
|
|
589
595
|
{
|
|
590
|
-
ns:
|
|
596
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
591
597
|
}
|
|
592
598
|
],
|
|
593
|
-
icon:
|
|
594
|
-
iconSymbol: "ph--x--regular",
|
|
599
|
+
icon: "ph--x--regular",
|
|
595
600
|
mainAreaDisposition: "menu",
|
|
596
601
|
disabled: personal
|
|
597
602
|
}
|
|
@@ -599,12 +604,12 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
599
604
|
}
|
|
600
605
|
if (state === import_echo4.SpaceState.SPACE_INACTIVE) {
|
|
601
606
|
actions.push({
|
|
602
|
-
id: getId(
|
|
607
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.OPEN),
|
|
603
608
|
type: import_plugin_graph2.ACTION_TYPE,
|
|
604
609
|
data: async () => {
|
|
605
610
|
await dispatch({
|
|
606
|
-
plugin:
|
|
607
|
-
action:
|
|
611
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
612
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.OPEN,
|
|
608
613
|
data: {
|
|
609
614
|
space
|
|
610
615
|
}
|
|
@@ -614,11 +619,10 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
614
619
|
label: [
|
|
615
620
|
"open space label",
|
|
616
621
|
{
|
|
617
|
-
ns:
|
|
622
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
618
623
|
}
|
|
619
624
|
],
|
|
620
|
-
icon:
|
|
621
|
-
iconSymbol: "ph--clock-counter-clockwise--regular",
|
|
625
|
+
icon: "ph--clock-counter-clockwise--regular",
|
|
622
626
|
disposition: "toolbar",
|
|
623
627
|
mainAreaDisposition: "in-flow"
|
|
624
628
|
}
|
|
@@ -635,7 +639,7 @@ var createObjectNode = ({ object, space, resolve }) => {
|
|
|
635
639
|
if (Object.keys(metadata).length === 0) {
|
|
636
640
|
return void 0;
|
|
637
641
|
}
|
|
638
|
-
const partials = object instanceof
|
|
642
|
+
const partials = object instanceof import_chunk_HTAM5LQD.CollectionType ? getCollectionGraphNodePartials({
|
|
639
643
|
collection: object,
|
|
640
644
|
space,
|
|
641
645
|
resolve
|
|
@@ -649,11 +653,10 @@ var createObjectNode = ({ object, space, resolve }) => {
|
|
|
649
653
|
label: metadata.label?.(object) || object.name || metadata.placeholder || [
|
|
650
654
|
"unnamed object label",
|
|
651
655
|
{
|
|
652
|
-
ns:
|
|
656
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
653
657
|
}
|
|
654
658
|
],
|
|
655
|
-
icon: metadata.icon ??
|
|
656
|
-
iconSymbol: metadata.iconSymbol ?? "ph--placeholder--regular",
|
|
659
|
+
icon: metadata.icon ?? "ph--placeholder--regular",
|
|
657
660
|
testId: "spacePlugin.object",
|
|
658
661
|
persistenceClass: "echo",
|
|
659
662
|
persistenceKey: space?.id
|
|
@@ -661,25 +664,24 @@ var createObjectNode = ({ object, space, resolve }) => {
|
|
|
661
664
|
};
|
|
662
665
|
};
|
|
663
666
|
var constructObjectActionGroups = ({ object, dispatch }) => {
|
|
664
|
-
if (!(object instanceof
|
|
667
|
+
if (!(object instanceof import_chunk_HTAM5LQD.CollectionType)) {
|
|
665
668
|
return [];
|
|
666
669
|
}
|
|
667
670
|
const collection = object;
|
|
668
671
|
const getId = (id) => `${id}/${(0, import_echo4.fullyQualifiedId)(object)}`;
|
|
669
672
|
const actions = [
|
|
670
673
|
{
|
|
671
|
-
id: getId(
|
|
674
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT),
|
|
672
675
|
type: import_plugin_graph2.ACTION_GROUP_TYPE,
|
|
673
676
|
data: import_plugin_graph2.actionGroupSymbol,
|
|
674
677
|
properties: {
|
|
675
678
|
label: [
|
|
676
679
|
"create object in collection label",
|
|
677
680
|
{
|
|
678
|
-
ns:
|
|
681
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
679
682
|
}
|
|
680
683
|
],
|
|
681
|
-
icon:
|
|
682
|
-
iconSymbol: "ph--plus--regular",
|
|
684
|
+
icon: "ph--plus--regular",
|
|
683
685
|
disposition: "toolbar",
|
|
684
686
|
// TODO(wittjosiah): This is currently a navtree feature. Address this with cmd+k integration.
|
|
685
687
|
// mainAreaDisposition: 'in-flow',
|
|
@@ -688,15 +690,15 @@ var constructObjectActionGroups = ({ object, dispatch }) => {
|
|
|
688
690
|
},
|
|
689
691
|
nodes: [
|
|
690
692
|
{
|
|
691
|
-
id: getId(
|
|
693
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT.replace("object", "collection")),
|
|
692
694
|
type: import_plugin_graph2.ACTION_TYPE,
|
|
693
695
|
data: () => dispatch([
|
|
694
696
|
{
|
|
695
|
-
plugin:
|
|
696
|
-
action:
|
|
697
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
698
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT,
|
|
697
699
|
data: {
|
|
698
700
|
target: collection,
|
|
699
|
-
object: (0, import_echo_schema2.create)(
|
|
701
|
+
object: (0, import_echo_schema2.create)(import_chunk_HTAM5LQD.CollectionType, {
|
|
700
702
|
objects: [],
|
|
701
703
|
views: {}
|
|
702
704
|
})
|
|
@@ -710,11 +712,10 @@ var constructObjectActionGroups = ({ object, dispatch }) => {
|
|
|
710
712
|
label: [
|
|
711
713
|
"create collection label",
|
|
712
714
|
{
|
|
713
|
-
ns:
|
|
715
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
714
716
|
}
|
|
715
717
|
],
|
|
716
|
-
icon:
|
|
717
|
-
iconSymbol: "ph--cards-three--regular",
|
|
718
|
+
icon: "ph--cards-three--regular",
|
|
718
719
|
testId: "spacePlugin.createCollection"
|
|
719
720
|
}
|
|
720
721
|
}
|
|
@@ -728,11 +729,11 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
728
729
|
const getId = (id) => `${id}/${(0, import_echo4.fullyQualifiedId)(object)}`;
|
|
729
730
|
const actions = [
|
|
730
731
|
{
|
|
731
|
-
id: getId(
|
|
732
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.RENAME_OBJECT),
|
|
732
733
|
type: import_plugin_graph2.ACTION_TYPE,
|
|
733
734
|
data: async (params) => {
|
|
734
735
|
await dispatch({
|
|
735
|
-
action:
|
|
736
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.RENAME_OBJECT,
|
|
736
737
|
data: {
|
|
737
738
|
object,
|
|
738
739
|
...params
|
|
@@ -741,29 +742,28 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
741
742
|
},
|
|
742
743
|
properties: {
|
|
743
744
|
label: [
|
|
744
|
-
object instanceof
|
|
745
|
+
object instanceof import_chunk_HTAM5LQD.CollectionType ? "rename collection label" : "rename object label",
|
|
745
746
|
{
|
|
746
|
-
ns:
|
|
747
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
747
748
|
}
|
|
748
749
|
],
|
|
749
|
-
icon:
|
|
750
|
-
iconSymbol: "ph--pencil-simple-line--regular",
|
|
750
|
+
icon: "ph--pencil-simple-line--regular",
|
|
751
751
|
// TODO(wittjosiah): Doesn't work.
|
|
752
752
|
// keyBinding: 'shift+F6',
|
|
753
753
|
testId: "spacePlugin.renameObject"
|
|
754
754
|
}
|
|
755
755
|
},
|
|
756
756
|
{
|
|
757
|
-
id: getId(
|
|
757
|
+
id: getId(import_chunk_P4XUXM7Y.SpaceAction.REMOVE_OBJECT),
|
|
758
758
|
type: import_plugin_graph2.ACTION_TYPE,
|
|
759
759
|
data: async () => {
|
|
760
760
|
const graph = (0, import_plugin_graph2.getGraph)(node);
|
|
761
761
|
const collection = graph.nodes(node, {
|
|
762
762
|
relation: "inbound"
|
|
763
|
-
}).find(({ data }) => data instanceof
|
|
763
|
+
}).find(({ data }) => data instanceof import_chunk_HTAM5LQD.CollectionType)?.data;
|
|
764
764
|
await dispatch([
|
|
765
765
|
{
|
|
766
|
-
action:
|
|
766
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.REMOVE_OBJECT,
|
|
767
767
|
data: {
|
|
768
768
|
object,
|
|
769
769
|
collection
|
|
@@ -773,14 +773,13 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
773
773
|
},
|
|
774
774
|
properties: {
|
|
775
775
|
label: [
|
|
776
|
-
object instanceof
|
|
776
|
+
object instanceof import_chunk_HTAM5LQD.CollectionType ? "delete collection label" : "delete object label",
|
|
777
777
|
{
|
|
778
|
-
ns:
|
|
778
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
779
779
|
}
|
|
780
780
|
],
|
|
781
|
-
icon:
|
|
782
|
-
|
|
783
|
-
keyBinding: object instanceof import_chunk_CVZPI2P3.CollectionType ? void 0 : "shift+meta+Backspace",
|
|
781
|
+
icon: "ph--trash--regular",
|
|
782
|
+
keyBinding: object instanceof import_chunk_HTAM5LQD.CollectionType ? void 0 : "shift+meta+Backspace",
|
|
784
783
|
testId: "spacePlugin.deleteObject"
|
|
785
784
|
}
|
|
786
785
|
},
|
|
@@ -795,11 +794,10 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
795
794
|
label: [
|
|
796
795
|
"copy link label",
|
|
797
796
|
{
|
|
798
|
-
ns:
|
|
797
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
799
798
|
}
|
|
800
799
|
],
|
|
801
|
-
icon:
|
|
802
|
-
iconSymbol: "ph--link--regular",
|
|
800
|
+
icon: "ph--link--regular",
|
|
803
801
|
testId: "spacePlugin.copyLink"
|
|
804
802
|
}
|
|
805
803
|
}
|
|
@@ -833,14 +831,14 @@ var getNestedObjects = async (object, resolve) => {
|
|
|
833
831
|
...nested.flat()
|
|
834
832
|
];
|
|
835
833
|
};
|
|
836
|
-
var cloneObject = async (object, resolve) => {
|
|
834
|
+
var cloneObject = async (object, resolve, newSpace) => {
|
|
837
835
|
const schema = (0, import_echo_schema2.getSchema)(object);
|
|
838
|
-
const typename = schema ? (0, import_echo_schema2.
|
|
836
|
+
const typename = schema ? (0, import_echo_schema2.getObjectAnnotation)(schema)?.typename ?? import_echo_schema2.EXPANDO_TYPENAME : import_echo_schema2.EXPANDO_TYPENAME;
|
|
839
837
|
const metadata = resolve(typename);
|
|
840
838
|
const serializer = metadata.serializer;
|
|
841
839
|
(0, import_invariant.invariant)(serializer, `No serializer for type: ${typename}`, {
|
|
842
840
|
F: __dxlog_file,
|
|
843
|
-
L:
|
|
841
|
+
L: 604,
|
|
844
842
|
S: void 0,
|
|
845
843
|
A: [
|
|
846
844
|
"serializer",
|
|
@@ -852,74 +850,40 @@ var cloneObject = async (object, resolve) => {
|
|
|
852
850
|
});
|
|
853
851
|
return serializer.deserialize({
|
|
854
852
|
content,
|
|
853
|
+
space: newSpace,
|
|
855
854
|
newId: true
|
|
856
855
|
});
|
|
857
856
|
};
|
|
858
857
|
var MenuFooter = ({ object }) => {
|
|
859
|
-
const { t } = (0,
|
|
858
|
+
const { t } = (0, import_react_ui6.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
860
859
|
const client = (0, import_react_client3.useClient)();
|
|
861
860
|
const space = (0, import_echo3.getSpace)(object);
|
|
862
861
|
const spaceName = space ? getSpaceDisplayName(space, {
|
|
863
862
|
personal: client.spaces.default === space
|
|
864
863
|
}) : "";
|
|
865
|
-
return space ? /* @__PURE__ */
|
|
864
|
+
return space ? /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement(import_react_ui6.DropdownMenu.Separator, null), /* @__PURE__ */ import_react9.default.createElement(import_react_ui6.DropdownMenu.GroupLabel, null, t("menu footer label")), /* @__PURE__ */ import_react9.default.createElement("dl", {
|
|
866
865
|
className: "pis-2 mbe-2 text-xs grid grid-cols-[max-content_1fr] gap-2"
|
|
867
|
-
}, /* @__PURE__ */
|
|
866
|
+
}, /* @__PURE__ */ import_react9.default.createElement("dt", {
|
|
868
867
|
className: "uppercase text-[.75em] tracking-wide font-medium mbs-px self-start"
|
|
869
|
-
}, t("location label")), /* @__PURE__ */
|
|
868
|
+
}, t("location label")), /* @__PURE__ */ import_react9.default.createElement("dd", {
|
|
870
869
|
className: "line-clamp-3"
|
|
871
|
-
}, /* @__PURE__ */
|
|
870
|
+
}, /* @__PURE__ */ import_react9.default.createElement(import_react8.Planet, {
|
|
872
871
|
className: "inline-block mie-1"
|
|
873
|
-
}), (0,
|
|
874
|
-
};
|
|
875
|
-
var WAIT_FOR_OBJECT_TIMEOUT2 = 1e3;
|
|
876
|
-
var MissingObject = ({ id }) => {
|
|
877
|
-
const { t } = (0, import_react_ui8.useTranslation)(import_chunk_6CNYF6YU.SPACE_PLUGIN);
|
|
878
|
-
const [waiting, setWaiting] = (0, import_react14.useState)(false);
|
|
879
|
-
const intentPlugin = (0, import_app_framework4.useResolvePlugin)(import_app_framework4.parseIntentPlugin);
|
|
880
|
-
(0, import_react14.useEffect)(() => {
|
|
881
|
-
if (!intentPlugin) {
|
|
882
|
-
return;
|
|
883
|
-
}
|
|
884
|
-
const timeout = setTimeout(async () => {
|
|
885
|
-
setWaiting(true);
|
|
886
|
-
await intentPlugin.provides.intent.dispatch({
|
|
887
|
-
plugin: import_chunk_6CNYF6YU.SPACE_PLUGIN,
|
|
888
|
-
action: import_chunk_6CNYF6YU.SpaceAction.WAIT_FOR_OBJECT,
|
|
889
|
-
data: {
|
|
890
|
-
id
|
|
891
|
-
}
|
|
892
|
-
});
|
|
893
|
-
}, WAIT_FOR_OBJECT_TIMEOUT2);
|
|
894
|
-
return () => clearTimeout(timeout);
|
|
895
|
-
}, [
|
|
896
|
-
intentPlugin,
|
|
897
|
-
id
|
|
898
|
-
]);
|
|
899
|
-
return /* @__PURE__ */ import_react14.default.createElement("div", {
|
|
900
|
-
role: "none",
|
|
901
|
-
className: (0, import_react_ui_theme5.mx)(import_react_ui_theme5.baseSurface, "min-bs-screen is-full flex items-center justify-center p-8")
|
|
902
|
-
}, waiting ? /* @__PURE__ */ import_react14.default.createElement("p", {
|
|
903
|
-
role: "alert",
|
|
904
|
-
className: (0, import_react_ui_theme5.mx)(import_react_ui_theme5.descriptionText, "border border-dashed border-neutral-400/50 rounded-lg flex items-center justify-center p-8 font-normal text-lg")
|
|
905
|
-
}, t("missing object message")) : /* @__PURE__ */ import_react14.default.createElement(import_react_ui8.Status, {
|
|
906
|
-
indeterminate: true,
|
|
907
|
-
"aria-label": "Initializing"
|
|
908
|
-
}));
|
|
872
|
+
}), (0, import_react_ui6.toLocalizedString)(spaceName, t)))) : null;
|
|
909
873
|
};
|
|
910
|
-
var
|
|
911
|
-
(function(
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
})(
|
|
874
|
+
var Status;
|
|
875
|
+
(function(Status2) {
|
|
876
|
+
Status2[Status2["PERSISTED_LOCALLY"] = 0] = "PERSISTED_LOCALLY";
|
|
877
|
+
Status2[Status2["PENDING"] = 1] = "PENDING";
|
|
878
|
+
Status2[Status2["ERROR"] = 2] = "ERROR";
|
|
879
|
+
})(Status || (Status = {}));
|
|
916
880
|
var PersistenceStatus = ({ db }) => {
|
|
917
|
-
const { t } = (0,
|
|
918
|
-
const [displayMessage, setDisplayMessage] = (0,
|
|
919
|
-
const [status, naturalSetStatus] = (0,
|
|
920
|
-
const [prevStatus, setPrevStatus] = (0,
|
|
881
|
+
const { t } = (0, import_react_ui7.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
882
|
+
const [displayMessage, setDisplayMessage] = (0, import_react11.useState)(false);
|
|
883
|
+
const [status, naturalSetStatus] = (0, import_react11.useState)(0);
|
|
884
|
+
const [prevStatus, setPrevStatus] = (0, import_react11.useState)(0);
|
|
921
885
|
const _setStatus = (0, import_async2.debounce)(naturalSetStatus, 500);
|
|
922
|
-
(0,
|
|
886
|
+
(0, import_react11.useEffect)(() => {
|
|
923
887
|
setPrevStatus(status);
|
|
924
888
|
if (prevStatus !== status && status === 0) {
|
|
925
889
|
setDisplayMessage(true);
|
|
@@ -931,44 +895,44 @@ var PersistenceStatus = ({ db }) => {
|
|
|
931
895
|
]);
|
|
932
896
|
switch (status) {
|
|
933
897
|
case 2:
|
|
934
|
-
return /* @__PURE__ */
|
|
898
|
+
return /* @__PURE__ */ import_react11.default.createElement("div", {
|
|
935
899
|
className: "flex items-center"
|
|
936
|
-
}, /* @__PURE__ */
|
|
937
|
-
className: (0,
|
|
938
|
-
}), /* @__PURE__ */
|
|
939
|
-
className: (0,
|
|
900
|
+
}, /* @__PURE__ */ import_react11.default.createElement(import_react10.Warning, {
|
|
901
|
+
className: (0, import_react_ui_theme3.mx)((0, import_react_ui_theme3.getSize)(4), "me-1")
|
|
902
|
+
}), /* @__PURE__ */ import_react11.default.createElement("span", {
|
|
903
|
+
className: (0, import_react_ui_theme3.mx)("text-sm", import_react_ui_theme3.warningText)
|
|
940
904
|
}, t("persistence error label")));
|
|
941
905
|
case 1:
|
|
942
|
-
return /* @__PURE__ */
|
|
906
|
+
return /* @__PURE__ */ import_react11.default.createElement("div", {
|
|
943
907
|
className: "flex items-center"
|
|
944
|
-
}, /* @__PURE__ */
|
|
945
|
-
className: (0,
|
|
946
|
-
}), /* @__PURE__ */
|
|
947
|
-
className: (0,
|
|
908
|
+
}, /* @__PURE__ */ import_react11.default.createElement(import_react10.ArrowsCounterClockwise, {
|
|
909
|
+
className: (0, import_react_ui_theme3.mx)((0, import_react_ui_theme3.getSize)(4), "me-1")
|
|
910
|
+
}), /* @__PURE__ */ import_react11.default.createElement("span", {
|
|
911
|
+
className: (0, import_react_ui_theme3.mx)("text-sm", import_react_ui_theme3.staticPlaceholderText)
|
|
948
912
|
}, t("persistence pending label")));
|
|
949
913
|
case 0:
|
|
950
914
|
default:
|
|
951
|
-
return /* @__PURE__ */
|
|
915
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_react_ui7.Tooltip.Root, {
|
|
952
916
|
delayDuration: 400
|
|
953
|
-
}, /* @__PURE__ */
|
|
917
|
+
}, /* @__PURE__ */ import_react11.default.createElement(import_react_ui7.Tooltip.Trigger, {
|
|
954
918
|
role: "status",
|
|
955
919
|
className: "flex items-center"
|
|
956
|
-
}, /* @__PURE__ */
|
|
957
|
-
className: (0,
|
|
958
|
-
}), displayMessage && /* @__PURE__ */
|
|
959
|
-
className: (0,
|
|
960
|
-
}, t("persisted locally label"))), /* @__PURE__ */
|
|
920
|
+
}, /* @__PURE__ */ import_react11.default.createElement(import_react10.CheckCircle, {
|
|
921
|
+
className: (0, import_react_ui_theme3.mx)((0, import_react_ui_theme3.getSize)(4), "me-1")
|
|
922
|
+
}), displayMessage && /* @__PURE__ */ import_react11.default.createElement("span", {
|
|
923
|
+
className: (0, import_react_ui_theme3.mx)("text-sm", import_react_ui_theme3.staticPlaceholderText)
|
|
924
|
+
}, t("persisted locally label"))), /* @__PURE__ */ import_react11.default.createElement(import_react_ui7.Tooltip.Portal, null, /* @__PURE__ */ import_react11.default.createElement(import_react_ui7.Tooltip.Content, {
|
|
961
925
|
classNames: "z-10"
|
|
962
|
-
}, t("persisted locally message"), /* @__PURE__ */
|
|
926
|
+
}, t("persisted locally message"), /* @__PURE__ */ import_react11.default.createElement(import_react_ui7.Tooltip.Arrow, null))));
|
|
963
927
|
}
|
|
964
928
|
};
|
|
965
929
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
|
|
966
930
|
var PopoverRenameObject = ({ object: obj }) => {
|
|
967
|
-
const { t } = (0,
|
|
968
|
-
const doneButton = (0,
|
|
931
|
+
const { t } = (0, import_react_ui8.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
932
|
+
const doneButton = (0, import_react12.useRef)(null);
|
|
969
933
|
const object = obj;
|
|
970
|
-
const [name, setName] = (0,
|
|
971
|
-
const handleDone = (0,
|
|
934
|
+
const [name, setName] = (0, import_react12.useState)(object.name || object.title || "");
|
|
935
|
+
const handleDone = (0, import_react12.useCallback)(() => {
|
|
972
936
|
try {
|
|
973
937
|
object.name = name;
|
|
974
938
|
} catch {
|
|
@@ -989,23 +953,23 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
989
953
|
object,
|
|
990
954
|
name
|
|
991
955
|
]);
|
|
992
|
-
return /* @__PURE__ */
|
|
956
|
+
return /* @__PURE__ */ import_react12.default.createElement("div", {
|
|
993
957
|
role: "none",
|
|
994
958
|
className: "p-1 flex gap-2"
|
|
995
|
-
}, /* @__PURE__ */
|
|
959
|
+
}, /* @__PURE__ */ import_react12.default.createElement("div", {
|
|
996
960
|
role: "none",
|
|
997
961
|
className: "flex-1"
|
|
998
|
-
}, /* @__PURE__ */
|
|
962
|
+
}, /* @__PURE__ */ import_react12.default.createElement(import_react_ui8.Input.Root, null, /* @__PURE__ */ import_react12.default.createElement(import_react_ui8.Input.Label, {
|
|
999
963
|
srOnly: true
|
|
1000
|
-
}, t("object name label")), /* @__PURE__ */
|
|
964
|
+
}, t("object name label")), /* @__PURE__ */ import_react12.default.createElement(import_react_ui8.Input.TextInput, {
|
|
1001
965
|
placeholder: t("object title placeholder"),
|
|
1002
966
|
value: name,
|
|
1003
967
|
"data-testid": "spacePlugin.renameObject.input",
|
|
1004
968
|
onChange: ({ target: { value } }) => setName(value),
|
|
1005
969
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1006
|
-
}))), /* @__PURE__ */
|
|
970
|
+
}))), /* @__PURE__ */ import_react12.default.createElement(import_react_ui8.Popover.Close, {
|
|
1007
971
|
asChild: true
|
|
1008
|
-
}, /* @__PURE__ */
|
|
972
|
+
}, /* @__PURE__ */ import_react12.default.createElement(import_react_ui8.Button, {
|
|
1009
973
|
ref: doneButton,
|
|
1010
974
|
classNames: "self-stretch",
|
|
1011
975
|
onClick: handleDone
|
|
@@ -1014,33 +978,33 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
1014
978
|
}))));
|
|
1015
979
|
};
|
|
1016
980
|
var PopoverRenameSpace = ({ space }) => {
|
|
1017
|
-
const { t } = (0,
|
|
1018
|
-
const doneButton = (0,
|
|
1019
|
-
const [name, setName] = (0,
|
|
1020
|
-
const handleDone = (0,
|
|
981
|
+
const { t } = (0, import_react_ui9.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
982
|
+
const doneButton = (0, import_react13.useRef)(null);
|
|
983
|
+
const [name, setName] = (0, import_react13.useState)(space.properties.name ?? "");
|
|
984
|
+
const handleDone = (0, import_react13.useCallback)(() => {
|
|
1021
985
|
space.properties.name = name;
|
|
1022
986
|
}, [
|
|
1023
987
|
space,
|
|
1024
988
|
name
|
|
1025
989
|
]);
|
|
1026
|
-
return /* @__PURE__ */
|
|
990
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", {
|
|
1027
991
|
role: "none",
|
|
1028
992
|
className: "p-1 flex gap-2"
|
|
1029
|
-
}, /* @__PURE__ */
|
|
993
|
+
}, /* @__PURE__ */ import_react13.default.createElement("div", {
|
|
1030
994
|
role: "none",
|
|
1031
995
|
className: "flex-1"
|
|
1032
|
-
}, /* @__PURE__ */
|
|
996
|
+
}, /* @__PURE__ */ import_react13.default.createElement(import_react_ui9.Input.Root, null, /* @__PURE__ */ import_react13.default.createElement(import_react_ui9.Input.Label, {
|
|
1033
997
|
srOnly: true
|
|
1034
|
-
}, t("space name label")), /* @__PURE__ */
|
|
998
|
+
}, t("space name label")), /* @__PURE__ */ import_react13.default.createElement(import_react_ui9.Input.TextInput, {
|
|
1035
999
|
defaultValue: space.properties.name ?? "",
|
|
1036
1000
|
placeholder: t("unnamed space label"),
|
|
1037
1001
|
onChange: ({ target: { value } }) => setName(value),
|
|
1038
1002
|
// TODO(wittjosiah): Ideally this should access the popover context to close the popover.
|
|
1039
1003
|
// Currently this is not possible because Radix does not expose the popover context.
|
|
1040
1004
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1041
|
-
}))), /* @__PURE__ */
|
|
1005
|
+
}))), /* @__PURE__ */ import_react13.default.createElement(import_react_ui9.Popover.Close, {
|
|
1042
1006
|
asChild: true
|
|
1043
|
-
}, /* @__PURE__ */
|
|
1007
|
+
}, /* @__PURE__ */ import_react13.default.createElement(import_react_ui9.Button, {
|
|
1044
1008
|
ref: doneButton,
|
|
1045
1009
|
classNames: "self-stretch",
|
|
1046
1010
|
onClick: handleDone
|
|
@@ -1049,10 +1013,10 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
1049
1013
|
}))));
|
|
1050
1014
|
};
|
|
1051
1015
|
var ShareSpaceButton = ({ spaceId }) => {
|
|
1052
|
-
const dispatch = (0,
|
|
1053
|
-
return /* @__PURE__ */
|
|
1016
|
+
const dispatch = (0, import_app_framework4.useIntentDispatcher)();
|
|
1017
|
+
return /* @__PURE__ */ import_react14.default.createElement(ShareSpaceButtonImpl, {
|
|
1054
1018
|
onClick: () => dispatch({
|
|
1055
|
-
action:
|
|
1019
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.SHARE,
|
|
1056
1020
|
data: {
|
|
1057
1021
|
spaceId
|
|
1058
1022
|
}
|
|
@@ -1060,8 +1024,8 @@ var ShareSpaceButton = ({ spaceId }) => {
|
|
|
1060
1024
|
});
|
|
1061
1025
|
};
|
|
1062
1026
|
var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
1063
|
-
const { t } = (0,
|
|
1064
|
-
return /* @__PURE__ */
|
|
1027
|
+
const { t } = (0, import_react_ui10.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1028
|
+
return /* @__PURE__ */ import_react14.default.createElement(import_react_ui10.Button, {
|
|
1065
1029
|
"data-testid": "spacePlugin.shareSpaceButton",
|
|
1066
1030
|
onClick,
|
|
1067
1031
|
classNames: "mli-1"
|
|
@@ -1071,9 +1035,9 @@ var activeActionKeyStorageKey = "dxos:react-shell/space-manager/active-action";
|
|
|
1071
1035
|
var Presence = import_echo6.SpaceMember.PresenceState;
|
|
1072
1036
|
var handleCreateInvitationUrl = (invitationCode) => `${origin}?spaceInvitationCode=${invitationCode}`;
|
|
1073
1037
|
var SpaceMemberList = ({ members }) => {
|
|
1074
|
-
return members.length > 0 ? /* @__PURE__ */
|
|
1038
|
+
return members.length > 0 ? /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.List, {
|
|
1075
1039
|
classNames: "col-start-2 col-end-5 gap-y-1 grid grid-cols-subgrid items-center"
|
|
1076
|
-
}, members.map((member) => /* @__PURE__ */
|
|
1040
|
+
}, members.map((member) => /* @__PURE__ */ import_react19.default.createElement(import_react20.IdentityListItem, {
|
|
1077
1041
|
classNames: "contents",
|
|
1078
1042
|
key: member.identity.identityKey.toHex(),
|
|
1079
1043
|
identity: member.identity,
|
|
@@ -1081,11 +1045,11 @@ var SpaceMemberList = ({ members }) => {
|
|
|
1081
1045
|
}))) : null;
|
|
1082
1046
|
};
|
|
1083
1047
|
var SpaceMembersSection = ({ space }) => {
|
|
1084
|
-
const { t } = (0,
|
|
1048
|
+
const { t } = (0, import_react_ui12.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1085
1049
|
const invitations = (0, import_echo6.useSpaceInvitations)(space.key);
|
|
1086
|
-
const { dispatch } = (0,
|
|
1050
|
+
const { dispatch } = (0, import_app_framework6.useIntent)();
|
|
1087
1051
|
const handleCloseDialog = () => dispatch({
|
|
1088
|
-
action:
|
|
1052
|
+
action: import_app_framework6.LayoutAction.SET_LAYOUT,
|
|
1089
1053
|
data: {
|
|
1090
1054
|
element: "dialog",
|
|
1091
1055
|
state: false
|
|
@@ -1094,7 +1058,7 @@ var SpaceMembersSection = ({ space }) => {
|
|
|
1094
1058
|
const handleInvitationSelect = ({ invitation: invitationObservable }) => {
|
|
1095
1059
|
const invitation = invitationObservable.get();
|
|
1096
1060
|
void dispatch({
|
|
1097
|
-
action:
|
|
1061
|
+
action: import_app_framework6.LayoutAction.SET_LAYOUT,
|
|
1098
1062
|
data: {
|
|
1099
1063
|
element: "dialog",
|
|
1100
1064
|
component: "dxos.org/plugin/space/InvitationManagerDialog",
|
|
@@ -1117,8 +1081,8 @@ var SpaceMembersSection = ({ space }) => {
|
|
|
1117
1081
|
description: t("invite one description", {
|
|
1118
1082
|
ns: "os"
|
|
1119
1083
|
}),
|
|
1120
|
-
icon:
|
|
1121
|
-
onClick: (0,
|
|
1084
|
+
icon: import_react18.UserPlus,
|
|
1085
|
+
onClick: (0, import_react19.useCallback)(() => {
|
|
1122
1086
|
space.share?.({
|
|
1123
1087
|
type: import_invitations2.Invitation.Type.INTERACTIVE,
|
|
1124
1088
|
authMethod: import_invitations2.Invitation.AuthMethod.SHARED_SECRET
|
|
@@ -1134,8 +1098,8 @@ var SpaceMembersSection = ({ space }) => {
|
|
|
1134
1098
|
description: t("invite many description", {
|
|
1135
1099
|
ns: "os"
|
|
1136
1100
|
}),
|
|
1137
|
-
icon:
|
|
1138
|
-
onClick: (0,
|
|
1101
|
+
icon: import_react18.UsersThree,
|
|
1102
|
+
onClick: (0, import_react19.useCallback)(() => {
|
|
1139
1103
|
space.share?.({
|
|
1140
1104
|
type: import_invitations2.Invitation.Type.INTERACTIVE,
|
|
1141
1105
|
authMethod: import_invitations2.Invitation.AuthMethod.NONE,
|
|
@@ -1146,7 +1110,7 @@ var SpaceMembersSection = ({ space }) => {
|
|
|
1146
1110
|
])
|
|
1147
1111
|
}
|
|
1148
1112
|
};
|
|
1149
|
-
const [activeActionKey, setInternalActiveActionKey] = (0,
|
|
1113
|
+
const [activeActionKey, setInternalActiveActionKey] = (0, import_react19.useState)(localStorage.getItem(activeActionKeyStorageKey) ?? "inviteOne");
|
|
1150
1114
|
const setActiveActionKey = (nextKey) => {
|
|
1151
1115
|
setInternalActiveActionKey(nextKey);
|
|
1152
1116
|
localStorage.setItem(activeActionKeyStorageKey, nextKey);
|
|
@@ -1159,101 +1123,101 @@ var SpaceMembersSection = ({ space }) => {
|
|
|
1159
1123
|
[Presence.ONLINE]: [],
|
|
1160
1124
|
[Presence.OFFLINE]: []
|
|
1161
1125
|
});
|
|
1162
|
-
return /* @__PURE__ */
|
|
1126
|
+
return /* @__PURE__ */ import_react19.default.createElement("section", {
|
|
1163
1127
|
className: "mbe-4 col-span-3 grid gap-y-2 grid-cols-subgrid auto-rows-min"
|
|
1164
|
-
}, /* @__PURE__ */
|
|
1128
|
+
}, /* @__PURE__ */ import_react19.default.createElement("h2", {
|
|
1165
1129
|
className: "contents"
|
|
1166
|
-
}, /* @__PURE__ */
|
|
1130
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_react18.UsersThree, {
|
|
1167
1131
|
weight: "duotone",
|
|
1168
|
-
className: (0,
|
|
1169
|
-
}), /* @__PURE__ */
|
|
1132
|
+
className: (0, import_react_ui_theme5.mx)((0, import_react_ui_theme5.getSize)(5), "place-self-center")
|
|
1133
|
+
}), /* @__PURE__ */ import_react19.default.createElement("span", {
|
|
1170
1134
|
className: "text-lg col-span-2"
|
|
1171
|
-
}, t("space members label"))), /* @__PURE__ */
|
|
1135
|
+
}, t("space members label"))), /* @__PURE__ */ import_react19.default.createElement("h3", {
|
|
1172
1136
|
className: "col-start-2 col-span-3 text-sm italic text-description"
|
|
1173
|
-
}, t("invitations heading")), invitations.length > 0 && /* @__PURE__ */
|
|
1137
|
+
}, t("invitations heading")), invitations.length > 0 && /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.List, {
|
|
1174
1138
|
classNames: "col-start-2 col-span-2 gap-y-2 grid grid-cols-[var(--rail-size)_1fr_var(--rail-action)_var(--rail-action)]"
|
|
1175
|
-
}, invitations.map((invitation) => /* @__PURE__ */
|
|
1139
|
+
}, invitations.map((invitation) => /* @__PURE__ */ import_react19.default.createElement(import_react20.InvitationListItem, {
|
|
1176
1140
|
reverseEffects: true,
|
|
1177
1141
|
classNames: "pis-0 pie-0 gap-0 col-span-4 grid grid-cols-subgrid",
|
|
1178
1142
|
key: invitation.get().invitationId,
|
|
1179
1143
|
invitation,
|
|
1180
1144
|
send: handleInvitationSelect,
|
|
1181
1145
|
createInvitationUrl: handleCreateInvitationUrl
|
|
1182
|
-
}))), /* @__PURE__ */
|
|
1146
|
+
}))), /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.ButtonGroup, {
|
|
1183
1147
|
classNames: "col-start-2 col-end-4 grid grid-cols-[1fr_var(--rail-action)] place-self-grow gap-px"
|
|
1184
|
-
}, /* @__PURE__ */
|
|
1148
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.Button, {
|
|
1185
1149
|
classNames: "gap-2",
|
|
1186
1150
|
onClick: activeAction.onClick
|
|
1187
|
-
}, /* @__PURE__ */
|
|
1188
|
-
className: (0,
|
|
1189
|
-
}), /* @__PURE__ */
|
|
1151
|
+
}, /* @__PURE__ */ import_react19.default.createElement(activeAction.icon, {
|
|
1152
|
+
className: (0, import_react_ui_theme5.getSize)(5)
|
|
1153
|
+
}), /* @__PURE__ */ import_react19.default.createElement("span", null, t(activeAction.label, {
|
|
1190
1154
|
ns: "os"
|
|
1191
|
-
}))), /* @__PURE__ */
|
|
1155
|
+
}))), /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.DropdownMenu.Root, null, /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.DropdownMenu.Trigger, {
|
|
1192
1156
|
asChild: true
|
|
1193
|
-
}, /* @__PURE__ */
|
|
1157
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.Button, {
|
|
1194
1158
|
classNames: "pli-0"
|
|
1195
|
-
}, /* @__PURE__ */
|
|
1196
|
-
className: (0,
|
|
1197
|
-
}))), /* @__PURE__ */
|
|
1198
|
-
return /* @__PURE__ */
|
|
1159
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_react18.CaretDown, {
|
|
1160
|
+
className: (0, import_react_ui_theme5.getSize)(4)
|
|
1161
|
+
}))), /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.DropdownMenu.Content, null, /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.DropdownMenu.Viewport, null, Object.entries(inviteActions).map(([id, action]) => {
|
|
1162
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.DropdownMenu.CheckboxItem, {
|
|
1199
1163
|
key: id,
|
|
1200
1164
|
"aria-labelledby": `${id}__label`,
|
|
1201
1165
|
"aria-describedby": `${id}__description`,
|
|
1202
1166
|
checked: activeActionKey === id,
|
|
1203
1167
|
onCheckedChange: (checked) => checked && setActiveActionKey(id),
|
|
1204
1168
|
classNames: "gap-2"
|
|
1205
|
-
}, action.icon && /* @__PURE__ */
|
|
1206
|
-
className: (0,
|
|
1207
|
-
}), /* @__PURE__ */
|
|
1169
|
+
}, action.icon && /* @__PURE__ */ import_react19.default.createElement(action.icon, {
|
|
1170
|
+
className: (0, import_react_ui_theme5.getSize)(5)
|
|
1171
|
+
}), /* @__PURE__ */ import_react19.default.createElement("div", {
|
|
1208
1172
|
role: "none",
|
|
1209
1173
|
className: "flex-1 min-is-0 space-b-1"
|
|
1210
|
-
}, /* @__PURE__ */
|
|
1174
|
+
}, /* @__PURE__ */ import_react19.default.createElement("p", {
|
|
1211
1175
|
id: `${id}__label`
|
|
1212
1176
|
}, t(action.label, {
|
|
1213
1177
|
ns: "os"
|
|
1214
|
-
})), action.description && /* @__PURE__ */
|
|
1178
|
+
})), action.description && /* @__PURE__ */ import_react19.default.createElement("p", {
|
|
1215
1179
|
id: `${id}__description`,
|
|
1216
|
-
className:
|
|
1180
|
+
className: import_react_ui_theme5.descriptionText
|
|
1217
1181
|
}, t(action.description, {
|
|
1218
1182
|
ns: "os"
|
|
1219
|
-
}))), /* @__PURE__ */
|
|
1183
|
+
}))), /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.DropdownMenu.ItemIndicator, {
|
|
1220
1184
|
asChild: true
|
|
1221
|
-
}, /* @__PURE__ */
|
|
1222
|
-
className: (0,
|
|
1185
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_react18.Check, {
|
|
1186
|
+
className: (0, import_react_ui_theme5.getSize)(4)
|
|
1223
1187
|
})));
|
|
1224
|
-
})), /* @__PURE__ */
|
|
1225
|
-
className: (0,
|
|
1188
|
+
})), /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.DropdownMenu.Arrow, null)))), members[Presence.ONLINE].length + members[Presence.OFFLINE].length < 1 ? /* @__PURE__ */ import_react19.default.createElement("p", {
|
|
1189
|
+
className: (0, import_react_ui_theme5.mx)(import_react_ui_theme5.descriptionText, "text-center is-full mlb-2")
|
|
1226
1190
|
}, t("empty space members message", {
|
|
1227
1191
|
ns: "os"
|
|
1228
|
-
})) : /* @__PURE__ */
|
|
1192
|
+
})) : /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, /* @__PURE__ */ import_react19.default.createElement("h3", {
|
|
1229
1193
|
className: "col-start-2 col-end-5 text-sm italic text-description"
|
|
1230
1194
|
}, t("active space members heading", {
|
|
1231
1195
|
count: members[Presence.ONLINE].length
|
|
1232
|
-
})), /* @__PURE__ */
|
|
1196
|
+
})), /* @__PURE__ */ import_react19.default.createElement(SpaceMemberList, {
|
|
1233
1197
|
members: members[Presence.ONLINE]
|
|
1234
|
-
}), /* @__PURE__ */
|
|
1198
|
+
}), /* @__PURE__ */ import_react19.default.createElement("h3", {
|
|
1235
1199
|
className: "col-start-2 col-end-5 text-sm italic text-description"
|
|
1236
1200
|
}, t("inactive space members heading", {
|
|
1237
1201
|
count: members[Presence.OFFLINE].length
|
|
1238
|
-
})), /* @__PURE__ */
|
|
1202
|
+
})), /* @__PURE__ */ import_react19.default.createElement(SpaceMemberList, {
|
|
1239
1203
|
members: members[Presence.OFFLINE]
|
|
1240
1204
|
})));
|
|
1241
1205
|
};
|
|
1242
1206
|
var KeyShortcuts = () => {
|
|
1243
|
-
const { t } = (0,
|
|
1244
|
-
return /* @__PURE__ */
|
|
1207
|
+
const { t } = (0, import_react_ui11.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1208
|
+
return /* @__PURE__ */ import_react16.default.createElement("section", {
|
|
1245
1209
|
className: "mbe-4 col-span-4 md:col-start-5 md:col-end-7 grid grid-cols-subgrid gap-y-2 auto-rows-min"
|
|
1246
|
-
}, /* @__PURE__ */
|
|
1210
|
+
}, /* @__PURE__ */ import_react16.default.createElement("h2", {
|
|
1247
1211
|
className: "contents"
|
|
1248
|
-
}, /* @__PURE__ */
|
|
1212
|
+
}, /* @__PURE__ */ import_react16.default.createElement(import_react15.Command, {
|
|
1249
1213
|
weight: "duotone",
|
|
1250
|
-
className: (0,
|
|
1251
|
-
}), /* @__PURE__ */
|
|
1214
|
+
className: (0, import_react_ui_theme4.mx)((0, import_react_ui_theme4.getSize)(5), "place-self-center")
|
|
1215
|
+
}), /* @__PURE__ */ import_react16.default.createElement("span", {
|
|
1252
1216
|
className: "text-lg col-span-2 md:col-span-1"
|
|
1253
|
-
}, t("keyshortcuts label"))), /* @__PURE__ */
|
|
1217
|
+
}, t("keyshortcuts label"))), /* @__PURE__ */ import_react16.default.createElement("div", {
|
|
1254
1218
|
role: "none",
|
|
1255
1219
|
className: "col-start-2 col-end-4 md:col-end-5 pie-2"
|
|
1256
|
-
}, /* @__PURE__ */
|
|
1220
|
+
}, /* @__PURE__ */ import_react16.default.createElement(import_app_framework5.Surface, {
|
|
1257
1221
|
role: "keyshortcuts"
|
|
1258
1222
|
})));
|
|
1259
1223
|
};
|
|
@@ -1261,42 +1225,41 @@ var spaceMainLayout = "grid gap-y-2 auto-rows-min before:bs-2 before:col-span-5
|
|
|
1261
1225
|
var SpaceMain = ({ space, role }) => {
|
|
1262
1226
|
const state = space.state.get();
|
|
1263
1227
|
const ready = state === import_echo5.SpaceState.SPACE_READY;
|
|
1264
|
-
const Root = role === "main" ?
|
|
1265
|
-
return /* @__PURE__ */
|
|
1228
|
+
const Root = role === "main" ? import_react_ui11.Main.Content : "div";
|
|
1229
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react17.ClipboardProvider, null, /* @__PURE__ */ import_react16.default.createElement(Root, {
|
|
1266
1230
|
...role === "main" ? {
|
|
1267
1231
|
classNames: [
|
|
1268
|
-
|
|
1232
|
+
import_react_ui_theme4.topbarBlockPaddingStart,
|
|
1269
1233
|
"min-bs-dvh",
|
|
1270
1234
|
spaceMainLayout
|
|
1271
1235
|
]
|
|
1272
1236
|
} : {
|
|
1273
1237
|
role: "none",
|
|
1274
|
-
className: (0,
|
|
1238
|
+
className: (0, import_react_ui_theme4.mx)(import_react_ui_theme4.topbarBlockPaddingStart, "row-span-2", spaceMainLayout)
|
|
1275
1239
|
},
|
|
1276
1240
|
"data-testid": `spacePlugin.${role}`,
|
|
1277
1241
|
"data-isready": ready ? "true" : "false"
|
|
1278
|
-
}, ready && /* @__PURE__ */
|
|
1242
|
+
}, ready && /* @__PURE__ */ import_react16.default.createElement(SpaceMembersSection, {
|
|
1279
1243
|
space
|
|
1280
|
-
}), /* @__PURE__ */
|
|
1244
|
+
}), /* @__PURE__ */ import_react16.default.createElement(KeyShortcuts, null)));
|
|
1281
1245
|
};
|
|
1282
1246
|
var REFRESH_INTERVAL = 5e3;
|
|
1283
1247
|
var ACTIVITY_DURATION = 3e4;
|
|
1284
1248
|
var noViewers = new import_util2.ComplexMap(import_react_client4.PublicKey.hash);
|
|
1285
1249
|
var getName = (identity) => identity.profile?.displayName ?? (0, import_display_name.generateName)(identity.identityKey.toHex());
|
|
1286
1250
|
var SpacePresence = ({ object, spaceKey }) => {
|
|
1287
|
-
const
|
|
1288
|
-
const spacePlugin = (0, import_app_framework8.usePlugin)(import_chunk_6CNYF6YU.SPACE_PLUGIN);
|
|
1251
|
+
const spacePlugin = (0, import_app_framework7.usePlugin)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1289
1252
|
const client = (0, import_react_client4.useClient)();
|
|
1290
1253
|
const identity = (0, import_halo.useIdentity)();
|
|
1291
1254
|
const space = spaceKey ? client.spaces.get(spaceKey) : (0, import_echo7.getSpace)(object);
|
|
1292
1255
|
const spaceMembers = (0, import_echo7.useMembers)(space?.key);
|
|
1293
|
-
const [_moment, setMoment] = (0,
|
|
1294
|
-
(0,
|
|
1256
|
+
const [_moment, setMoment] = (0, import_react21.useState)(Date.now());
|
|
1257
|
+
(0, import_react21.useEffect)(() => {
|
|
1295
1258
|
const interval = setInterval(() => setMoment(Date.now()), REFRESH_INTERVAL);
|
|
1296
1259
|
return () => clearInterval(interval);
|
|
1297
1260
|
}, []);
|
|
1298
|
-
const memberOnline = (0,
|
|
1299
|
-
const memberIsNotSelf = (0,
|
|
1261
|
+
const memberOnline = (0, import_react21.useCallback)((member) => member.presence === 1, []);
|
|
1262
|
+
const memberIsNotSelf = (0, import_react21.useCallback)((member) => !identity?.identityKey.equals(member.identity.identityKey), [
|
|
1300
1263
|
identity?.identityKey
|
|
1301
1264
|
]);
|
|
1302
1265
|
if (!identity || !spacePlugin || !space) {
|
|
@@ -1314,63 +1277,61 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1314
1277
|
lastSeen
|
|
1315
1278
|
};
|
|
1316
1279
|
}).toSorted((a, b) => a.lastSeen - b.lastSeen);
|
|
1317
|
-
return
|
|
1318
|
-
count: membersForObject.length
|
|
1319
|
-
}) : /* @__PURE__ */ import_react26.default.createElement(FullPresence, {
|
|
1280
|
+
return /* @__PURE__ */ import_react21.default.createElement(FullPresence, {
|
|
1320
1281
|
members: membersForObject
|
|
1321
1282
|
});
|
|
1322
1283
|
};
|
|
1323
1284
|
var FullPresence = (props) => {
|
|
1324
1285
|
const { size = 9, onMemberClick } = props;
|
|
1325
|
-
const members = (0,
|
|
1286
|
+
const members = (0, import_react_ui13.useDefaultValue)(props.members, () => []);
|
|
1326
1287
|
if (members.length === 0) {
|
|
1327
1288
|
return null;
|
|
1328
1289
|
}
|
|
1329
|
-
return /* @__PURE__ */
|
|
1290
|
+
return /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.AvatarGroup.Root, {
|
|
1330
1291
|
size,
|
|
1331
1292
|
classNames: "mbs-2 mie-4",
|
|
1332
1293
|
"data-testid": "spacePlugin.presence"
|
|
1333
|
-
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */
|
|
1294
|
+
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Tooltip.Root, {
|
|
1334
1295
|
key: member.identity.identityKey.toHex()
|
|
1335
|
-
}, /* @__PURE__ */
|
|
1296
|
+
}, /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Tooltip.Trigger, null, /* @__PURE__ */ import_react21.default.createElement(PrensenceAvatar, {
|
|
1336
1297
|
identity: member.identity,
|
|
1337
1298
|
group: true,
|
|
1338
1299
|
match: member.currentlyAttended,
|
|
1339
1300
|
index: members.length - i,
|
|
1340
1301
|
onClick: () => onMemberClick?.(member)
|
|
1341
|
-
})), /* @__PURE__ */
|
|
1302
|
+
})), /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Tooltip.Portal, null, /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Tooltip.Content, {
|
|
1342
1303
|
side: "bottom"
|
|
1343
|
-
}, /* @__PURE__ */
|
|
1304
|
+
}, /* @__PURE__ */ import_react21.default.createElement("span", null, getName(member.identity)), /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Tooltip.Arrow, null))))), members.length > 3 && /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Tooltip.Root, null, /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Tooltip.Trigger, null, /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.AvatarGroupItem.Root, {
|
|
1344
1305
|
status: "inactive"
|
|
1345
|
-
}, /* @__PURE__ */
|
|
1306
|
+
}, /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Avatar.Frame, {
|
|
1346
1307
|
style: {
|
|
1347
1308
|
zIndex: members.length - 4
|
|
1348
1309
|
}
|
|
1349
|
-
}, /* @__PURE__ */
|
|
1310
|
+
}, /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Avatar.Fallback, {
|
|
1350
1311
|
text: `+${members.length - 3}`
|
|
1351
|
-
})))), /* @__PURE__ */
|
|
1312
|
+
})))), /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Tooltip.Portal, null, /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Tooltip.Content, {
|
|
1352
1313
|
side: "bottom"
|
|
1353
|
-
}, /* @__PURE__ */
|
|
1314
|
+
}, /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Tooltip.Arrow, null), /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.List, {
|
|
1354
1315
|
classNames: "max-h-56 overflow-y-auto"
|
|
1355
|
-
}, members.map((member) => /* @__PURE__ */
|
|
1316
|
+
}, members.map((member) => /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.ListItem.Root, {
|
|
1356
1317
|
key: member.identity.identityKey.toHex(),
|
|
1357
1318
|
classNames: "flex gap-2 items-center cursor-pointer mbe-2",
|
|
1358
1319
|
onClick: () => onMemberClick?.(member),
|
|
1359
1320
|
"data-testid": "identity-list-item"
|
|
1360
|
-
}, /* @__PURE__ */
|
|
1321
|
+
}, /* @__PURE__ */ import_react21.default.createElement(PrensenceAvatar, {
|
|
1361
1322
|
identity: member.identity,
|
|
1362
1323
|
showName: true,
|
|
1363
1324
|
match: member.currentlyAttended
|
|
1364
1325
|
}))))))));
|
|
1365
1326
|
};
|
|
1366
1327
|
var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) => {
|
|
1367
|
-
const Root = group ?
|
|
1328
|
+
const Root = group ? import_react_ui13.AvatarGroupItem.Root : import_react_ui13.Avatar.Root;
|
|
1368
1329
|
const status = match ? "current" : "active";
|
|
1369
1330
|
const fallbackValue = (0, import_util2.keyToFallback)(identity.identityKey);
|
|
1370
|
-
return /* @__PURE__ */
|
|
1331
|
+
return /* @__PURE__ */ import_react21.default.createElement(Root, {
|
|
1371
1332
|
status,
|
|
1372
1333
|
hue: identity.profile?.data?.hue || fallbackValue.hue
|
|
1373
|
-
}, /* @__PURE__ */
|
|
1334
|
+
}, /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Avatar.Frame, {
|
|
1374
1335
|
"data-testid": "spacePlugin.presence.member",
|
|
1375
1336
|
"data-status": status,
|
|
1376
1337
|
...index ? {
|
|
@@ -1379,61 +1340,439 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
|
|
|
1379
1340
|
}
|
|
1380
1341
|
} : {},
|
|
1381
1342
|
onClick: () => onClick?.()
|
|
1382
|
-
}, /* @__PURE__ */
|
|
1343
|
+
}, /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Avatar.Fallback, {
|
|
1383
1344
|
text: identity.profile?.data?.emoji || fallbackValue.emoji
|
|
1384
|
-
})), showName && /* @__PURE__ */
|
|
1345
|
+
})), showName && /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Avatar.Label, {
|
|
1385
1346
|
classNames: "text-sm truncate pli-2"
|
|
1386
1347
|
}, getName(identity)));
|
|
1387
1348
|
};
|
|
1388
|
-
var SmallPresenceLive = ({ viewers }) => {
|
|
1389
|
-
const
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1349
|
+
var SmallPresenceLive = ({ id, viewers }) => {
|
|
1350
|
+
const getActiveViewers = (viewers2) => {
|
|
1351
|
+
const moment = Date.now();
|
|
1352
|
+
return Array.from(viewers2.values()).filter(({ lastSeen }) => moment - lastSeen < ACTIVITY_DURATION);
|
|
1353
|
+
};
|
|
1354
|
+
const [activeViewers, setActiveViewers] = (0, import_react21.useState)(viewers ? getActiveViewers(viewers) : []);
|
|
1355
|
+
(0, import_react21.useEffect)(() => {
|
|
1356
|
+
if (viewers) {
|
|
1357
|
+
setActiveViewers(getActiveViewers(viewers));
|
|
1358
|
+
const interval = setInterval(() => {
|
|
1359
|
+
setActiveViewers(getActiveViewers(viewers));
|
|
1360
|
+
}, REFRESH_INTERVAL);
|
|
1361
|
+
return () => clearInterval(interval);
|
|
1362
|
+
}
|
|
1363
|
+
}, [
|
|
1364
|
+
viewers
|
|
1365
|
+
]);
|
|
1366
|
+
return /* @__PURE__ */ import_react21.default.createElement(SmallPresence, {
|
|
1367
|
+
id,
|
|
1396
1368
|
count: activeViewers.length
|
|
1397
1369
|
});
|
|
1398
1370
|
};
|
|
1399
|
-
var SmallPresence = ({ count }) => {
|
|
1400
|
-
const { t } = (0,
|
|
1401
|
-
|
|
1371
|
+
var SmallPresence = ({ id, count }) => {
|
|
1372
|
+
const { t } = (0, import_react_ui13.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1373
|
+
const { hasAttention, isAncestor, isRelated } = (0, import_react_ui_attention.useAttention)(id);
|
|
1374
|
+
const attention = hasAttention || isAncestor || isRelated;
|
|
1375
|
+
return /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Tooltip.Root, null, /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Tooltip.Trigger, {
|
|
1402
1376
|
asChild: true
|
|
1403
|
-
}, /* @__PURE__ */
|
|
1377
|
+
}, /* @__PURE__ */ import_react21.default.createElement("div", {
|
|
1378
|
+
role: "none",
|
|
1379
|
+
className: "flex",
|
|
1380
|
+
"data-attention": attention
|
|
1381
|
+
}, /* @__PURE__ */ import_react21.default.createElement(import_react_ui_attention.AttentionGlyph, {
|
|
1404
1382
|
presence: count > 1 ? "many" : count === 1 ? "one" : "none",
|
|
1405
1383
|
classNames: "self-center mie-1"
|
|
1406
|
-
})), /* @__PURE__ */
|
|
1384
|
+
}))), /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Tooltip.Portal, null, /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Tooltip.Content, {
|
|
1407
1385
|
side: "bottom",
|
|
1408
1386
|
classNames: "z-[70]"
|
|
1409
|
-
}, /* @__PURE__ */
|
|
1387
|
+
}, /* @__PURE__ */ import_react21.default.createElement("span", null, t("presence label", {
|
|
1410
1388
|
count
|
|
1411
|
-
})), /* @__PURE__ */
|
|
1389
|
+
})), /* @__PURE__ */ import_react21.default.createElement(import_react_ui13.Tooltip.Arrow, null))));
|
|
1412
1390
|
};
|
|
1413
1391
|
var SpaceSettings = ({ settings }) => {
|
|
1414
|
-
const { t } = (0,
|
|
1415
|
-
const dispatch = (0,
|
|
1416
|
-
|
|
1392
|
+
const { t } = (0, import_react_ui14.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1393
|
+
const dispatch = (0, import_app_framework8.useIntentDispatcher)();
|
|
1394
|
+
const plugins = (0, import_app_framework8.useResolvePlugins)(import_chunk_HTAM5LQD.parseSpaceInitPlugin);
|
|
1395
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, /* @__PURE__ */ import_react22.default.createElement(import_react_ui_data.DeprecatedFormInput, {
|
|
1417
1396
|
label: t("show hidden spaces label")
|
|
1418
|
-
}, /* @__PURE__ */
|
|
1397
|
+
}, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Input.Switch, {
|
|
1419
1398
|
checked: settings.showHidden,
|
|
1420
1399
|
onCheckedChange: (checked) => dispatch({
|
|
1421
|
-
plugin:
|
|
1422
|
-
action:
|
|
1400
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
1401
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.TOGGLE_HIDDEN,
|
|
1423
1402
|
data: {
|
|
1424
1403
|
state: !!checked
|
|
1425
1404
|
}
|
|
1426
1405
|
})
|
|
1427
|
-
}))
|
|
1406
|
+
})), /* @__PURE__ */ import_react22.default.createElement(import_react_ui_data.DeprecatedFormInput, {
|
|
1407
|
+
label: t("default on space create label")
|
|
1408
|
+
}, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Select.Root, {
|
|
1409
|
+
value: settings.onSpaceCreate,
|
|
1410
|
+
onValueChange: (value) => {
|
|
1411
|
+
settings.onSpaceCreate = value;
|
|
1412
|
+
}
|
|
1413
|
+
}, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Select.TriggerButton, null), /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Select.Portal, null, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Select.Content, null, /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Select.Viewport, null, plugins.map(({ provides: { space: { onSpaceCreate } } }) => /* @__PURE__ */ import_react22.default.createElement(import_react_ui14.Select.Option, {
|
|
1414
|
+
key: onSpaceCreate.action,
|
|
1415
|
+
value: onSpaceCreate.action
|
|
1416
|
+
}, (0, import_react_ui14.toLocalizedString)(onSpaceCreate.label, t)))))))));
|
|
1417
|
+
};
|
|
1418
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettingsPanel.tsx";
|
|
1419
|
+
var SpaceSettingsPanel = ({ space }) => {
|
|
1420
|
+
const { t } = (0, import_react_ui15.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1421
|
+
const client = (0, import_react_client5.useClient)();
|
|
1422
|
+
const devices = (0, import_halo2.useDevices)();
|
|
1423
|
+
const managedDeviceAvailable = devices.find((device) => device.profile?.type === import_halo2.DeviceType.AGENT_MANAGED);
|
|
1424
|
+
const edgeAgents = Boolean(client.config.values.runtime?.client?.edgeFeatures?.agents);
|
|
1425
|
+
const edgeReplicationAvailable = edgeAgents && managedDeviceAvailable;
|
|
1426
|
+
const [edgeReplication, setEdgeReplication] = (0, import_react23.useState)(space.internal.data.edgeReplication === import_metadata.EdgeReplicationSetting.ENABLED);
|
|
1427
|
+
const toggleEdgeReplication = (0, import_react23.useCallback)(async (next) => {
|
|
1428
|
+
setEdgeReplication(next);
|
|
1429
|
+
await space?.internal.setEdgeReplicationPreference(next ? import_metadata.EdgeReplicationSetting.ENABLED : import_metadata.EdgeReplicationSetting.DISABLED).catch((err) => {
|
|
1430
|
+
import_log3.log.catch(err, void 0, {
|
|
1431
|
+
F: __dxlog_file3,
|
|
1432
|
+
L: 38,
|
|
1433
|
+
S: void 0,
|
|
1434
|
+
C: (f, a) => f(...a)
|
|
1435
|
+
});
|
|
1436
|
+
setEdgeReplication(!next);
|
|
1437
|
+
});
|
|
1438
|
+
}, [
|
|
1439
|
+
space
|
|
1440
|
+
]);
|
|
1441
|
+
return /* @__PURE__ */ import_react23.default.createElement("div", {
|
|
1442
|
+
role: "form",
|
|
1443
|
+
className: "flex flex-col w-full p-2 gap-4"
|
|
1444
|
+
}, /* @__PURE__ */ import_react23.default.createElement(import_react_ui15.Input.Root, null, /* @__PURE__ */ import_react23.default.createElement("div", {
|
|
1445
|
+
role: "none",
|
|
1446
|
+
className: "flex flex-col gap-1"
|
|
1447
|
+
}, /* @__PURE__ */ import_react23.default.createElement(import_react_ui15.Input.Label, null, t("name label")), /* @__PURE__ */ import_react23.default.createElement(import_react_ui15.Input.TextInput, {
|
|
1448
|
+
placeholder: t("name placeholder"),
|
|
1449
|
+
value: space.properties.name ?? "",
|
|
1450
|
+
onChange: (event) => {
|
|
1451
|
+
space.properties.name = event.target.value;
|
|
1452
|
+
}
|
|
1453
|
+
}))), edgeReplicationAvailable && /* @__PURE__ */ import_react23.default.createElement(import_react_ui15.Input.Root, null, /* @__PURE__ */ import_react23.default.createElement("div", {
|
|
1454
|
+
role: "none",
|
|
1455
|
+
className: "flex justify-between"
|
|
1456
|
+
}, /* @__PURE__ */ import_react23.default.createElement(import_react_ui15.Input.Label, null, t("edge replication label")), /* @__PURE__ */ import_react23.default.createElement(import_react_ui15.Input.Switch, {
|
|
1457
|
+
checked: edgeReplication,
|
|
1458
|
+
onCheckedChange: toggleEdgeReplication
|
|
1459
|
+
}))));
|
|
1460
|
+
};
|
|
1461
|
+
var SYNC_STALLED_TIMEOUT = 5e3;
|
|
1462
|
+
var styles = {
|
|
1463
|
+
barBg: "bg-neutral-50 dark:bg-green-900 text-black",
|
|
1464
|
+
barFg: "bg-neutral-100 bg-green-500",
|
|
1465
|
+
barHover: "dark:hover:bg-green-500"
|
|
1466
|
+
};
|
|
1467
|
+
var useActive = (count) => {
|
|
1468
|
+
const [current, setCurrent] = (0, import_react25.useState)(count);
|
|
1469
|
+
const [active, setActive] = (0, import_react25.useState)(false);
|
|
1470
|
+
(0, import_react25.useEffect)(() => {
|
|
1471
|
+
let t;
|
|
1472
|
+
if (count !== current) {
|
|
1473
|
+
setActive(true);
|
|
1474
|
+
setCurrent(count);
|
|
1475
|
+
t && clearTimeout(t);
|
|
1476
|
+
t = setTimeout(() => {
|
|
1477
|
+
setActive(false);
|
|
1478
|
+
}, SYNC_STALLED_TIMEOUT);
|
|
1479
|
+
}
|
|
1480
|
+
return () => {
|
|
1481
|
+
setActive(false);
|
|
1482
|
+
clearTimeout(t);
|
|
1483
|
+
};
|
|
1484
|
+
}, [
|
|
1485
|
+
count,
|
|
1486
|
+
current
|
|
1487
|
+
]);
|
|
1488
|
+
return active;
|
|
1489
|
+
};
|
|
1490
|
+
var SpaceRow = ({ spaceId, state: { localDocumentCount, remoteDocumentCount, missingOnLocal, missingOnRemote } }) => {
|
|
1491
|
+
const downActive = useActive(localDocumentCount);
|
|
1492
|
+
const upActive = useActive(remoteDocumentCount);
|
|
1493
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1494
|
+
className: (0, import_react_ui_theme7.mx)("flex items-center mx-[2px] gap-[2px] cursor-pointer", styles.barHover),
|
|
1495
|
+
title: spaceId,
|
|
1496
|
+
onClick: () => {
|
|
1497
|
+
void navigator.clipboard.writeText(spaceId);
|
|
1498
|
+
}
|
|
1499
|
+
}, /* @__PURE__ */ import_react25.default.createElement(import_react_ui17.Icon, {
|
|
1500
|
+
icon: "ph--arrow-fat-line-left--regular",
|
|
1501
|
+
size: 3,
|
|
1502
|
+
classNames: (0, import_react_ui_theme7.mx)(downActive && "animate-[pulse_1s_infinite]")
|
|
1503
|
+
}), /* @__PURE__ */ import_react25.default.createElement(Candle, {
|
|
1504
|
+
up: {
|
|
1505
|
+
count: remoteDocumentCount,
|
|
1506
|
+
total: remoteDocumentCount + missingOnRemote
|
|
1507
|
+
},
|
|
1508
|
+
down: {
|
|
1509
|
+
count: localDocumentCount,
|
|
1510
|
+
total: localDocumentCount + missingOnLocal
|
|
1511
|
+
},
|
|
1512
|
+
title: spaceId
|
|
1513
|
+
}), /* @__PURE__ */ import_react25.default.createElement(import_react_ui17.Icon, {
|
|
1514
|
+
icon: "ph--arrow-fat-line-right--regular",
|
|
1515
|
+
size: 3,
|
|
1516
|
+
classNames: (0, import_react_ui_theme7.mx)(upActive && "animate-[pulse_1s_step-start_infinite]")
|
|
1517
|
+
}));
|
|
1518
|
+
};
|
|
1519
|
+
var Candle = ({ classNames, up, down }) => {
|
|
1520
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1521
|
+
className: (0, import_react_ui_theme7.mx)("grid grid-cols-[1fr_2rem_1fr] w-full h-3", classNames)
|
|
1522
|
+
}, /* @__PURE__ */ import_react25.default.createElement(Bar, {
|
|
1523
|
+
classNames: "justify-end",
|
|
1524
|
+
...up
|
|
1525
|
+
}), /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1526
|
+
className: "relative"
|
|
1527
|
+
}, /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1528
|
+
className: (0, import_react_ui_theme7.mx)("absolute inset-0 flex items-center justify-center text-xs", styles.barBg)
|
|
1529
|
+
}, up.total)), /* @__PURE__ */ import_react25.default.createElement(Bar, down));
|
|
1530
|
+
};
|
|
1531
|
+
var Bar = ({ classNames, count, total }) => {
|
|
1532
|
+
let p = count / total * 100;
|
|
1533
|
+
if (count < total) {
|
|
1534
|
+
p = Math.min(p, 95);
|
|
1535
|
+
}
|
|
1536
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1537
|
+
className: (0, import_react_ui_theme7.mx)("relative flex w-full", styles.barBg, classNames)
|
|
1538
|
+
}, /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1539
|
+
className: (0, import_react_ui_theme7.mx)("shrink-0", styles.barFg),
|
|
1540
|
+
style: {
|
|
1541
|
+
width: `${p}%`
|
|
1542
|
+
}
|
|
1543
|
+
}), count !== total && /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1544
|
+
className: "absolute top-0 bottom-0 flex items-center mx-0.5 text-black text-xs"
|
|
1545
|
+
}, count));
|
|
1546
|
+
};
|
|
1547
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts";
|
|
1548
|
+
var createClientSaveTracker = (client, cb) => {
|
|
1549
|
+
const unsubscribeCallbacks = {};
|
|
1550
|
+
const state = {};
|
|
1551
|
+
const install = (spaces) => {
|
|
1552
|
+
for (const space of spaces) {
|
|
1553
|
+
if (state[space.id]) {
|
|
1554
|
+
continue;
|
|
1555
|
+
}
|
|
1556
|
+
state[space.id] = "saved";
|
|
1557
|
+
unsubscribeCallbacks[space.id] = createSpaceSaveTracker(space, (s) => {
|
|
1558
|
+
state[space.id] = s;
|
|
1559
|
+
cb(Object.values(state).some((s2) => s2 === "saving") ? "saving" : "saved");
|
|
1560
|
+
});
|
|
1561
|
+
}
|
|
1562
|
+
};
|
|
1563
|
+
client.spaces.subscribe((spaces) => {
|
|
1564
|
+
install(spaces);
|
|
1565
|
+
});
|
|
1566
|
+
install(client.spaces.get());
|
|
1567
|
+
return () => {
|
|
1568
|
+
for (const unsubscribe of Object.values(unsubscribeCallbacks)) {
|
|
1569
|
+
unsubscribe();
|
|
1570
|
+
}
|
|
1571
|
+
};
|
|
1572
|
+
};
|
|
1573
|
+
var createSpaceSaveTracker = (space, cb) => {
|
|
1574
|
+
const ctx = new import_context.Context(void 0, {
|
|
1575
|
+
F: __dxlog_file4,
|
|
1576
|
+
L: 40
|
|
1577
|
+
});
|
|
1578
|
+
void space.waitUntilReady().then(() => {
|
|
1579
|
+
if (ctx.disposed) {
|
|
1580
|
+
return;
|
|
1581
|
+
}
|
|
1582
|
+
let hasUnsavedChanges = false;
|
|
1583
|
+
let lastFlushPromise;
|
|
1584
|
+
space.crud.saveStateChanged.on(ctx, ({ unsavedDocuments }) => {
|
|
1585
|
+
hasUnsavedChanges = unsavedDocuments.length > 0;
|
|
1586
|
+
});
|
|
1587
|
+
space.crud.saveStateChanged.debounce(500).on(ctx, () => {
|
|
1588
|
+
if (hasUnsavedChanges) {
|
|
1589
|
+
lastFlushPromise = void 0;
|
|
1590
|
+
cb("saving");
|
|
1591
|
+
} else {
|
|
1592
|
+
const flushPromise = space.crud.flush();
|
|
1593
|
+
lastFlushPromise = flushPromise;
|
|
1594
|
+
void flushPromise.then(() => {
|
|
1595
|
+
if (lastFlushPromise === flushPromise) {
|
|
1596
|
+
cb("saved");
|
|
1597
|
+
}
|
|
1598
|
+
});
|
|
1599
|
+
}
|
|
1600
|
+
});
|
|
1601
|
+
});
|
|
1602
|
+
return () => {
|
|
1603
|
+
void ctx.dispose();
|
|
1604
|
+
};
|
|
1605
|
+
};
|
|
1606
|
+
var getStatus = ({ offline, saved, needsToUpload, needsToDownload }) => {
|
|
1607
|
+
if (!saved) {
|
|
1608
|
+
return "saving locally";
|
|
1609
|
+
} else if (!offline && needsToDownload) {
|
|
1610
|
+
return "downloading";
|
|
1611
|
+
} else if (!offline && needsToUpload) {
|
|
1612
|
+
return "uploading";
|
|
1613
|
+
} else if (offline && !needsToUpload && !needsToDownload) {
|
|
1614
|
+
return "offline persisted";
|
|
1615
|
+
} else {
|
|
1616
|
+
return "remote synced";
|
|
1617
|
+
}
|
|
1618
|
+
};
|
|
1619
|
+
var getIcon = (status) => {
|
|
1620
|
+
switch (status) {
|
|
1621
|
+
case "saving locally":
|
|
1622
|
+
return "ph--download--regular";
|
|
1623
|
+
case "downloading":
|
|
1624
|
+
return "ph--cloud-arrow-down--regular";
|
|
1625
|
+
case "uploading":
|
|
1626
|
+
return "ph--cloud-arrow-up--regular";
|
|
1627
|
+
case "offline persisted":
|
|
1628
|
+
return "ph--check-circle--regular";
|
|
1629
|
+
case "remote synced":
|
|
1630
|
+
return "ph--cloud-check--regular";
|
|
1631
|
+
}
|
|
1632
|
+
};
|
|
1633
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts";
|
|
1634
|
+
var createEmptyEdgeSyncState = () => ({
|
|
1635
|
+
missingOnLocal: 0,
|
|
1636
|
+
missingOnRemote: 0,
|
|
1637
|
+
localDocumentCount: 0,
|
|
1638
|
+
remoteDocumentCount: 0,
|
|
1639
|
+
differentDocuments: 0
|
|
1640
|
+
});
|
|
1641
|
+
var getSyncSummary = (syncMap) => {
|
|
1642
|
+
return Object.entries(syncMap).reduce((summary, [_spaceId, peerState]) => {
|
|
1643
|
+
summary.missingOnLocal += peerState.missingOnLocal;
|
|
1644
|
+
summary.missingOnRemote += peerState.missingOnRemote;
|
|
1645
|
+
summary.localDocumentCount += peerState.localDocumentCount;
|
|
1646
|
+
summary.remoteDocumentCount += peerState.remoteDocumentCount;
|
|
1647
|
+
summary.differentDocuments += peerState.differentDocuments;
|
|
1648
|
+
return summary;
|
|
1649
|
+
}, createEmptyEdgeSyncState());
|
|
1650
|
+
};
|
|
1651
|
+
var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${import_protocols.EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
|
|
1652
|
+
var useSyncState = () => {
|
|
1653
|
+
const client = (0, import_react_client7.useClient)();
|
|
1654
|
+
const [spaceState, setSpaceState] = (0, import_react26.useState)({});
|
|
1655
|
+
(0, import_react26.useEffect)(() => {
|
|
1656
|
+
const ctx = new import_context2.Context(void 0, {
|
|
1657
|
+
F: __dxlog_file5,
|
|
1658
|
+
L: 48
|
|
1659
|
+
});
|
|
1660
|
+
const createSubscriptions = (spaces) => {
|
|
1661
|
+
for (const space of spaces) {
|
|
1662
|
+
if (spaceState[space.id]) {
|
|
1663
|
+
continue;
|
|
1664
|
+
}
|
|
1665
|
+
ctx.onDispose(space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
|
|
1666
|
+
const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
|
|
1667
|
+
if (syncState) {
|
|
1668
|
+
setSpaceState((spaceState2) => ({
|
|
1669
|
+
...spaceState2,
|
|
1670
|
+
[space.id]: syncState
|
|
1671
|
+
}));
|
|
1672
|
+
}
|
|
1673
|
+
}));
|
|
1674
|
+
}
|
|
1675
|
+
};
|
|
1676
|
+
createSubscriptions(client.spaces.get());
|
|
1677
|
+
client.spaces.subscribe((spaces) => {
|
|
1678
|
+
createSubscriptions(spaces);
|
|
1679
|
+
});
|
|
1680
|
+
return () => {
|
|
1681
|
+
void ctx.dispose();
|
|
1682
|
+
};
|
|
1683
|
+
}, [
|
|
1684
|
+
client
|
|
1685
|
+
]);
|
|
1686
|
+
return spaceState;
|
|
1687
|
+
};
|
|
1688
|
+
var SyncStatus = () => {
|
|
1689
|
+
const client = (0, import_react_client6.useClient)();
|
|
1690
|
+
const state = useSyncState();
|
|
1691
|
+
const [saved, setSaved] = (0, import_react24.useState)(true);
|
|
1692
|
+
(0, import_react24.useEffect)(() => {
|
|
1693
|
+
return createClientSaveTracker(client, (state2) => {
|
|
1694
|
+
setSaved(state2 === "saved");
|
|
1695
|
+
});
|
|
1696
|
+
}, []);
|
|
1697
|
+
return /* @__PURE__ */ import_react24.default.createElement(SyncStatusIndicator, {
|
|
1698
|
+
state,
|
|
1699
|
+
saved
|
|
1700
|
+
});
|
|
1701
|
+
};
|
|
1702
|
+
var SyncStatusIndicator = ({ state, saved }) => {
|
|
1703
|
+
const { t } = (0, import_react_ui16.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1704
|
+
const summary = getSyncSummary(state);
|
|
1705
|
+
const offline = Object.values(state).length === 0;
|
|
1706
|
+
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
1707
|
+
const needsToDownload = summary.differentDocuments > 0 || summary.missingOnLocal > 0;
|
|
1708
|
+
const status = getStatus({
|
|
1709
|
+
offline,
|
|
1710
|
+
saved,
|
|
1711
|
+
needsToUpload,
|
|
1712
|
+
needsToDownload
|
|
1713
|
+
});
|
|
1714
|
+
const [classNames, setClassNames] = (0, import_react24.useState)();
|
|
1715
|
+
(0, import_react24.useEffect)(() => {
|
|
1716
|
+
setClassNames(void 0);
|
|
1717
|
+
if (offline || !needsToUpload && !needsToDownload) {
|
|
1718
|
+
return;
|
|
1719
|
+
}
|
|
1720
|
+
const t2 = setTimeout(() => {
|
|
1721
|
+
setClassNames("text-orange-500");
|
|
1722
|
+
}, SYNC_STALLED_TIMEOUT);
|
|
1723
|
+
return () => clearTimeout(t2);
|
|
1724
|
+
}, [
|
|
1725
|
+
offline,
|
|
1726
|
+
needsToUpload,
|
|
1727
|
+
needsToDownload
|
|
1728
|
+
]);
|
|
1729
|
+
const title = t(`${status} label`);
|
|
1730
|
+
const icon = /* @__PURE__ */ import_react24.default.createElement(import_react_ui16.Icon, {
|
|
1731
|
+
icon: getIcon(status),
|
|
1732
|
+
size: 4,
|
|
1733
|
+
classNames
|
|
1734
|
+
});
|
|
1735
|
+
if (offline) {
|
|
1736
|
+
return /* @__PURE__ */ import_react24.default.createElement(import_plugin_status_bar.StatusBar.Item, {
|
|
1737
|
+
title
|
|
1738
|
+
}, icon);
|
|
1739
|
+
} else {
|
|
1740
|
+
return /* @__PURE__ */ import_react24.default.createElement(import_react_ui16.Popover.Root, null, /* @__PURE__ */ import_react24.default.createElement(import_react_ui16.Popover.Trigger, {
|
|
1741
|
+
asChild: true
|
|
1742
|
+
}, /* @__PURE__ */ import_react24.default.createElement(import_plugin_status_bar.StatusBar.Button, {
|
|
1743
|
+
title
|
|
1744
|
+
}, icon)), /* @__PURE__ */ import_react24.default.createElement(import_react_ui16.Popover.Portal, null, /* @__PURE__ */ import_react24.default.createElement(import_react_ui16.Popover.Content, {
|
|
1745
|
+
sideOffset: 16
|
|
1746
|
+
}, /* @__PURE__ */ import_react24.default.createElement(SyncStatusDetail, {
|
|
1747
|
+
state,
|
|
1748
|
+
summary,
|
|
1749
|
+
debug: false
|
|
1750
|
+
}))));
|
|
1751
|
+
}
|
|
1752
|
+
};
|
|
1753
|
+
var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
|
|
1754
|
+
const { t } = (0, import_react_ui16.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1755
|
+
const entries = Object.entries(state).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
1756
|
+
return /* @__PURE__ */ import_react24.default.createElement("div", {
|
|
1757
|
+
className: (0, import_react_ui_theme6.mx)("flex flex-col gap-3 p-2 text-xs min-w-[16rem]", classNames)
|
|
1758
|
+
}, /* @__PURE__ */ import_react24.default.createElement("h1", null, t("sync status title")), /* @__PURE__ */ import_react24.default.createElement("div", {
|
|
1759
|
+
className: "flex flex-col gap-2"
|
|
1760
|
+
}, entries.map(([spaceId, state2]) => /* @__PURE__ */ import_react24.default.createElement(SpaceRow, {
|
|
1761
|
+
key: spaceId,
|
|
1762
|
+
spaceId,
|
|
1763
|
+
state: state2
|
|
1764
|
+
}))), debug && /* @__PURE__ */ import_react24.default.createElement(import_react_ui_syntax_highlighter.SyntaxHighlighter, {
|
|
1765
|
+
language: "json"
|
|
1766
|
+
}, JSON.stringify(summary, null, 2)));
|
|
1428
1767
|
};
|
|
1429
1768
|
var translations_default = [
|
|
1430
1769
|
{
|
|
1431
1770
|
"en-US": {
|
|
1432
|
-
[
|
|
1771
|
+
[import_chunk_P4XUXM7Y.SPACE_PLUGIN]: {
|
|
1433
1772
|
"plugin name": "Spaces",
|
|
1434
1773
|
"first run message": "Nothing selected.",
|
|
1435
|
-
"create space label": "Create
|
|
1436
|
-
"join space label": "Join
|
|
1774
|
+
"create space label": "Create space",
|
|
1775
|
+
"join space label": "Join space",
|
|
1437
1776
|
"empty space message": "No documents",
|
|
1438
1777
|
"empty tree message": "No spaces",
|
|
1439
1778
|
"unnamed space label": "New space",
|
|
@@ -1504,23 +1843,39 @@ var translations_default = [
|
|
|
1504
1843
|
"space limit close label": "Close",
|
|
1505
1844
|
"remove deleted objects label": "Cleanup",
|
|
1506
1845
|
"remove deleted objects alt": "Permanently remove deleted objects to free up space.",
|
|
1507
|
-
"copy link label": "Copy link"
|
|
1846
|
+
"copy link label": "Copy link",
|
|
1847
|
+
"default on space create label": "On space create",
|
|
1848
|
+
"sync status title": "Sync status",
|
|
1849
|
+
"dismiss label": "Dismiss",
|
|
1850
|
+
"join success label": "Successfully joined space",
|
|
1851
|
+
"name label": "Name",
|
|
1852
|
+
"name placeholder": "Name",
|
|
1853
|
+
"unnamed object settings label": "Settings",
|
|
1854
|
+
"edge replication label": "Enable EDGE Replication",
|
|
1855
|
+
"saving locally label": "Writing to disk",
|
|
1856
|
+
"downloading label": "Replicating from peers",
|
|
1857
|
+
"uploading label": "Replicating to peers",
|
|
1858
|
+
"offline persisted label": "Saved to disk (offline)",
|
|
1859
|
+
"remote synced label": "Synced with peers",
|
|
1860
|
+
"open settings panel label": "Show Settings"
|
|
1508
1861
|
}
|
|
1509
1862
|
}
|
|
1510
1863
|
}
|
|
1511
1864
|
];
|
|
1512
|
-
var
|
|
1865
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/SpacePlugin.tsx";
|
|
1513
1866
|
var ACTIVE_NODE_BROADCAST_INTERVAL = 3e4;
|
|
1514
|
-
var OBJECT_ID_LENGTH = 60;
|
|
1515
1867
|
var SPACE_MAX_OBJECTS = 500;
|
|
1516
1868
|
var DIRECTORY_TYPE = "text/directory";
|
|
1517
1869
|
var parseSpacePlugin = (plugin) => Array.isArray(plugin?.provides.space?.enabled) ? plugin : void 0;
|
|
1518
1870
|
var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
1519
|
-
const settings = new import_local_storage.LocalStorageStore(
|
|
1520
|
-
|
|
1871
|
+
const settings = new import_local_storage.LocalStorageStore(import_chunk_P4XUXM7Y.SPACE_PLUGIN, {
|
|
1872
|
+
onSpaceCreate: "dxos.org/plugin/markdown/action/create"
|
|
1873
|
+
});
|
|
1874
|
+
const state = new import_local_storage.LocalStorageStore(import_chunk_P4XUXM7Y.SPACE_PLUGIN, {
|
|
1521
1875
|
awaiting: void 0,
|
|
1522
1876
|
spaceNames: {},
|
|
1523
1877
|
viewersByObject: {},
|
|
1878
|
+
// TODO(wittjosiah): Stop using (Complex)Map inside reactive object.
|
|
1524
1879
|
viewersByIdentity: new import_util.ComplexMap(import_react_client.PublicKey.hash),
|
|
1525
1880
|
sdkMigrationRunning: {}
|
|
1526
1881
|
});
|
|
@@ -1528,15 +1883,20 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1528
1883
|
const spaceSubscriptions = new import_async.EventSubscriptions();
|
|
1529
1884
|
const graphSubscriptions = /* @__PURE__ */ new Map();
|
|
1530
1885
|
let clientPlugin;
|
|
1886
|
+
let graphPlugin;
|
|
1531
1887
|
let intentPlugin;
|
|
1888
|
+
let layoutPlugin;
|
|
1532
1889
|
let navigationPlugin;
|
|
1533
1890
|
let attentionPlugin;
|
|
1534
1891
|
const onSpaceReady = async () => {
|
|
1535
|
-
if (!clientPlugin || !navigationPlugin || !attentionPlugin) {
|
|
1892
|
+
if (!clientPlugin || !intentPlugin || !graphPlugin || !navigationPlugin || !layoutPlugin || !attentionPlugin) {
|
|
1536
1893
|
return;
|
|
1537
1894
|
}
|
|
1538
1895
|
const client = clientPlugin.provides.client;
|
|
1896
|
+
const dispatch = intentPlugin.provides.intent.dispatch;
|
|
1897
|
+
const graph = graphPlugin.provides.graph;
|
|
1539
1898
|
const location = navigationPlugin.provides.location;
|
|
1899
|
+
const layout = layoutPlugin.provides.layout;
|
|
1540
1900
|
const attention = attentionPlugin.provides.attention;
|
|
1541
1901
|
const defaultSpace = client.spaces.default;
|
|
1542
1902
|
if (typeof defaultSpace.properties[COMPOSER_SPACE_LOCK] !== "boolean") {
|
|
@@ -1551,22 +1911,44 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1551
1911
|
order: []
|
|
1552
1912
|
}));
|
|
1553
1913
|
}
|
|
1914
|
+
subscriptions.add((0, import_core.scheduledEffect)(() => ({
|
|
1915
|
+
layoutMode: layout.layoutMode,
|
|
1916
|
+
soloPart: location.active.solo?.[0]
|
|
1917
|
+
}), ({ layoutMode, soloPart }) => {
|
|
1918
|
+
if (layoutMode !== "solo" || !soloPart) {
|
|
1919
|
+
return;
|
|
1920
|
+
}
|
|
1921
|
+
const node = graph.findNode(soloPart.id);
|
|
1922
|
+
if (!node && soloPart.id.length === import_echo.FQ_ID_LENGTH) {
|
|
1923
|
+
void dispatch({
|
|
1924
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
1925
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.WAIT_FOR_OBJECT,
|
|
1926
|
+
data: {
|
|
1927
|
+
id: soloPart.id
|
|
1928
|
+
}
|
|
1929
|
+
});
|
|
1930
|
+
}
|
|
1931
|
+
}));
|
|
1554
1932
|
subscriptions.add(client.spaces.subscribe(async (spaces) => {
|
|
1555
1933
|
if (defaultSpace.state.get() === import_echo.SpaceState.SPACE_REQUIRES_MIGRATION) {
|
|
1556
1934
|
await defaultSpace.internal.migrate();
|
|
1557
1935
|
}
|
|
1558
1936
|
spaces.filter((space) => space.state.get() === import_echo.SpaceState.SPACE_READY).forEach((space) => {
|
|
1559
|
-
subscriptions.add((0,
|
|
1560
|
-
|
|
1561
|
-
}));
|
|
1937
|
+
subscriptions.add((0, import_core.scheduledEffect)(() => ({
|
|
1938
|
+
name: space.properties.name
|
|
1939
|
+
}), ({ name }) => state.values.spaceNames[space.id] = name));
|
|
1562
1940
|
});
|
|
1563
1941
|
}).unsubscribe);
|
|
1564
|
-
subscriptions.add((0,
|
|
1942
|
+
subscriptions.add((0, import_core.scheduledEffect)(() => ({
|
|
1943
|
+
ids: (0, import_app_framework.openIds)(location.active),
|
|
1944
|
+
removed: location.closed ? [
|
|
1945
|
+
location.closed
|
|
1946
|
+
].flat() : []
|
|
1947
|
+
}), ({ ids, removed }) => {
|
|
1565
1948
|
const send = () => {
|
|
1566
1949
|
const spaces = client.spaces.get();
|
|
1567
1950
|
const identity = client.halo.identity.get();
|
|
1568
1951
|
if (identity && location.active) {
|
|
1569
|
-
const ids = (0, import_app_framework.openIds)(location.active);
|
|
1570
1952
|
const idsBySpace = (0, import_util.reduceGroupBy)(ids, (id) => {
|
|
1571
1953
|
const [spaceId] = id.split(":");
|
|
1572
1954
|
return spaceId;
|
|
@@ -1581,9 +1963,6 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1581
1963
|
if (!space) {
|
|
1582
1964
|
continue;
|
|
1583
1965
|
}
|
|
1584
|
-
const removed = location.closed ? [
|
|
1585
|
-
location.closed
|
|
1586
|
-
].flat() : [];
|
|
1587
1966
|
void space.postMessage("viewing", {
|
|
1588
1967
|
identityKey: identity.identityKey.toHex(),
|
|
1589
1968
|
attended: attention.attended ? [
|
|
@@ -1596,8 +1975,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1596
1975
|
import_log.log.warn("Failed to broadcast active node for presence.", {
|
|
1597
1976
|
err: err.message
|
|
1598
1977
|
}, {
|
|
1599
|
-
F:
|
|
1600
|
-
L:
|
|
1978
|
+
F: __dxlog_file6,
|
|
1979
|
+
L: 257,
|
|
1601
1980
|
S: void 0,
|
|
1602
1981
|
C: (f, a) => f(...a)
|
|
1603
1982
|
});
|
|
@@ -1643,20 +2022,20 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1643
2022
|
}).unsubscribe);
|
|
1644
2023
|
};
|
|
1645
2024
|
return {
|
|
1646
|
-
meta:
|
|
2025
|
+
meta: import_chunk_P4XUXM7Y.meta_default,
|
|
1647
2026
|
ready: async (plugins) => {
|
|
1648
2027
|
settings.prop({
|
|
1649
2028
|
key: "showHidden",
|
|
1650
|
-
storageKey: "show-hidden",
|
|
1651
2029
|
type: import_local_storage.LocalStorageStore.bool({
|
|
1652
2030
|
allowUndefined: true
|
|
1653
2031
|
})
|
|
1654
2032
|
});
|
|
1655
2033
|
state.prop({
|
|
1656
2034
|
key: "spaceNames",
|
|
1657
|
-
storageKey: "space-names",
|
|
1658
2035
|
type: import_local_storage.LocalStorageStore.json()
|
|
1659
2036
|
});
|
|
2037
|
+
graphPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseGraphPlugin);
|
|
2038
|
+
layoutPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseLayoutPlugin);
|
|
1660
2039
|
navigationPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseNavigationPlugin);
|
|
1661
2040
|
attentionPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_attention.parseAttentionPlugin);
|
|
1662
2041
|
clientPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_client.parseClientPlugin);
|
|
@@ -1668,7 +2047,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1668
2047
|
const dispatch = intentPlugin.provides.intent.dispatch;
|
|
1669
2048
|
const handleFirstRun = async () => {
|
|
1670
2049
|
const defaultSpace = client.spaces.default;
|
|
1671
|
-
defaultSpace.properties[
|
|
2050
|
+
defaultSpace.properties[import_chunk_HTAM5LQD.CollectionType.typename] = (0, import_echo.create)(import_chunk_HTAM5LQD.CollectionType, {
|
|
1672
2051
|
objects: [],
|
|
1673
2052
|
views: {}
|
|
1674
2053
|
});
|
|
@@ -1680,7 +2059,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1680
2059
|
dispatch
|
|
1681
2060
|
});
|
|
1682
2061
|
};
|
|
1683
|
-
client.spaces.isReady.subscribe(async (ready) => {
|
|
2062
|
+
subscriptions.add(client.spaces.isReady.subscribe(async (ready) => {
|
|
1684
2063
|
if (ready) {
|
|
1685
2064
|
await clientPlugin?.provides.client.spaces.default.waitUntilReady();
|
|
1686
2065
|
if (firstRun) {
|
|
@@ -1690,7 +2069,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1690
2069
|
}
|
|
1691
2070
|
await onSpaceReady();
|
|
1692
2071
|
}
|
|
1693
|
-
});
|
|
2072
|
+
}).unsubscribe);
|
|
1694
2073
|
},
|
|
1695
2074
|
unload: async () => {
|
|
1696
2075
|
settings.close();
|
|
@@ -1704,22 +2083,35 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1704
2083
|
settings: settings.values,
|
|
1705
2084
|
translations: [
|
|
1706
2085
|
...translations_default,
|
|
1707
|
-
|
|
2086
|
+
import_react2.osTranslations
|
|
1708
2087
|
],
|
|
1709
|
-
|
|
2088
|
+
complementary: {
|
|
2089
|
+
panels: [
|
|
2090
|
+
{
|
|
2091
|
+
id: "settings",
|
|
2092
|
+
label: [
|
|
2093
|
+
"open settings panel label",
|
|
2094
|
+
{
|
|
2095
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
2096
|
+
}
|
|
2097
|
+
],
|
|
2098
|
+
icon: "ph--gear--regular"
|
|
2099
|
+
}
|
|
2100
|
+
]
|
|
2101
|
+
},
|
|
2102
|
+
root: () => state.values.awaiting ? /* @__PURE__ */ import_react.default.createElement(AwaitingObject, {
|
|
1710
2103
|
id: state.values.awaiting
|
|
1711
2104
|
}) : null,
|
|
1712
2105
|
metadata: {
|
|
1713
2106
|
records: {
|
|
1714
|
-
[
|
|
2107
|
+
[import_chunk_HTAM5LQD.CollectionType.typename]: {
|
|
1715
2108
|
placeholder: [
|
|
1716
2109
|
"unnamed collection label",
|
|
1717
2110
|
{
|
|
1718
|
-
ns:
|
|
2111
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
1719
2112
|
}
|
|
1720
2113
|
],
|
|
1721
|
-
icon:
|
|
1722
|
-
iconSymbol: "ph--cards-three--regular",
|
|
2114
|
+
icon: "ph--cards-three--regular",
|
|
1723
2115
|
// TODO(wittjosiah): Move out of metadata.
|
|
1724
2116
|
loadReferences: (collection) => (0, import_echo.loadObjectReferences)(collection, (collection2) => [
|
|
1725
2117
|
...collection2.objects,
|
|
@@ -1730,64 +2122,63 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1730
2122
|
},
|
|
1731
2123
|
echo: {
|
|
1732
2124
|
schema: [
|
|
1733
|
-
|
|
2125
|
+
import_chunk_HTAM5LQD.CollectionType
|
|
1734
2126
|
]
|
|
1735
2127
|
},
|
|
1736
2128
|
surface: {
|
|
1737
2129
|
component: ({ data, role, ...rest }) => {
|
|
1738
|
-
const primary = data.active ?? data.object;
|
|
1739
2130
|
switch (role) {
|
|
1740
2131
|
case "article":
|
|
1741
|
-
|
|
1742
|
-
return (0, import_echo.isSpace)(primary) && primary.state.get() === import_echo.SpaceState.SPACE_READY ? /* @__PURE__ */ import_react2.default.createElement(import_app_framework.Surface, {
|
|
2132
|
+
return (0, import_echo.isSpace)(data.object) && data.object.state.get() === import_echo.SpaceState.SPACE_READY ? /* @__PURE__ */ import_react.default.createElement(import_app_framework.Surface, {
|
|
1743
2133
|
data: {
|
|
1744
|
-
|
|
2134
|
+
object: data.object.properties[import_chunk_HTAM5LQD.CollectionType.typename],
|
|
2135
|
+
id: data.object.id
|
|
1745
2136
|
},
|
|
1746
2137
|
role,
|
|
1747
2138
|
...rest
|
|
1748
|
-
}) :
|
|
1749
|
-
node: /* @__PURE__ */
|
|
1750
|
-
collection:
|
|
2139
|
+
}) : data.object instanceof import_chunk_HTAM5LQD.CollectionType ? {
|
|
2140
|
+
node: /* @__PURE__ */ import_react.default.createElement(CollectionMain, {
|
|
2141
|
+
collection: data.object
|
|
1751
2142
|
}),
|
|
1752
2143
|
disposition: "fallback"
|
|
1753
|
-
} :
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
default:
|
|
1764
|
-
return null;
|
|
1765
|
-
}
|
|
2144
|
+
} : null;
|
|
2145
|
+
case "complementary--settings":
|
|
2146
|
+
return (0, import_echo.isSpace)(data.subject) ? /* @__PURE__ */ import_react.default.createElement(SpaceSettingsPanel, {
|
|
2147
|
+
space: data.subject
|
|
2148
|
+
}) : (0, import_echo.isEchoObject)(data.subject) ? {
|
|
2149
|
+
node: /* @__PURE__ */ import_react.default.createElement(DefaultObjectSettings, {
|
|
2150
|
+
object: data.subject
|
|
2151
|
+
}),
|
|
2152
|
+
disposition: "fallback"
|
|
2153
|
+
} : null;
|
|
1766
2154
|
case "dialog":
|
|
1767
2155
|
if (data.component === "dxos.org/plugin/space/InvitationManagerDialog") {
|
|
1768
|
-
return /* @__PURE__ */
|
|
2156
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react_ui.Dialog.Content, null, /* @__PURE__ */ import_react.default.createElement(import_react2.ClipboardProvider, null, /* @__PURE__ */ import_react.default.createElement(import_react2.InvitationManager, {
|
|
1769
2157
|
active: true,
|
|
1770
2158
|
...data.subject
|
|
1771
2159
|
})));
|
|
1772
|
-
} else {
|
|
1773
|
-
return null;
|
|
1774
2160
|
}
|
|
1775
|
-
|
|
2161
|
+
return null;
|
|
2162
|
+
case "popover": {
|
|
1776
2163
|
if (data.component === "dxos.org/plugin/space/RenameSpacePopover" && (0, import_echo.isSpace)(data.subject)) {
|
|
1777
|
-
return /* @__PURE__ */
|
|
2164
|
+
return /* @__PURE__ */ import_react.default.createElement(PopoverRenameSpace, {
|
|
1778
2165
|
space: data.subject
|
|
1779
2166
|
});
|
|
1780
2167
|
}
|
|
1781
2168
|
if (data.component === "dxos.org/plugin/space/RenameObjectPopover" && (0, import_echo_schema.isReactiveObject)(data.subject)) {
|
|
1782
|
-
return /* @__PURE__ */
|
|
2169
|
+
return /* @__PURE__ */ import_react.default.createElement(PopoverRenameObject, {
|
|
1783
2170
|
object: data.subject
|
|
1784
2171
|
});
|
|
1785
2172
|
}
|
|
1786
2173
|
return null;
|
|
2174
|
+
}
|
|
2175
|
+
// TODO(burdon): Add role name syntax to minimal plugin docs.
|
|
1787
2176
|
case "presence--glyph": {
|
|
1788
|
-
return (0, import_echo_schema.isReactiveObject)(data.object) ? /* @__PURE__ */
|
|
2177
|
+
return (0, import_echo_schema.isReactiveObject)(data.object) ? /* @__PURE__ */ import_react.default.createElement(SmallPresenceLive, {
|
|
2178
|
+
id: data.id,
|
|
1789
2179
|
viewers: state.values.viewersByObject[(0, import_echo.fullyQualifiedId)(data.object)]
|
|
1790
|
-
}) : /* @__PURE__ */
|
|
2180
|
+
}) : /* @__PURE__ */ import_react.default.createElement(SmallPresence, {
|
|
2181
|
+
id: data.id,
|
|
1791
2182
|
count: 0
|
|
1792
2183
|
});
|
|
1793
2184
|
}
|
|
@@ -1799,32 +2190,35 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1799
2190
|
return null;
|
|
1800
2191
|
}
|
|
1801
2192
|
const space = (0, import_echo.isSpace)(data.object) ? data.object : (0, import_echo.getSpace)(data.object);
|
|
1802
|
-
const object = (0, import_echo.isSpace)(data.object) ? data.object.state.get() === import_echo.SpaceState.SPACE_READY ? space?.properties[
|
|
2193
|
+
const object = (0, import_echo.isSpace)(data.object) ? data.object.state.get() === import_echo.SpaceState.SPACE_READY ? space?.properties[import_chunk_HTAM5LQD.CollectionType.typename] : void 0 : data.object;
|
|
1803
2194
|
return space && object ? {
|
|
1804
|
-
node: /* @__PURE__ */
|
|
2195
|
+
node: /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(SpacePresence, {
|
|
1805
2196
|
object
|
|
1806
|
-
}), space.properties[COMPOSER_SPACE_LOCK] ? null : /* @__PURE__ */
|
|
2197
|
+
}), space.properties[COMPOSER_SPACE_LOCK] ? null : /* @__PURE__ */ import_react.default.createElement(ShareSpaceButton, {
|
|
1807
2198
|
spaceId: space.id
|
|
1808
2199
|
})),
|
|
1809
2200
|
disposition: "hoist"
|
|
1810
2201
|
} : null;
|
|
1811
2202
|
}
|
|
1812
2203
|
case "section":
|
|
1813
|
-
return data.object instanceof
|
|
2204
|
+
return data.object instanceof import_chunk_HTAM5LQD.CollectionType ? /* @__PURE__ */ import_react.default.createElement(CollectionSection, {
|
|
1814
2205
|
collection: data.object
|
|
1815
2206
|
}) : null;
|
|
1816
2207
|
case "settings":
|
|
1817
|
-
return data.plugin ===
|
|
2208
|
+
return data.plugin === import_chunk_P4XUXM7Y.meta_default.id ? /* @__PURE__ */ import_react.default.createElement(SpaceSettings, {
|
|
1818
2209
|
settings: settings.values
|
|
1819
2210
|
}) : null;
|
|
1820
2211
|
case "menu-footer":
|
|
1821
|
-
if (
|
|
1822
|
-
return
|
|
1823
|
-
} else {
|
|
1824
|
-
return /* @__PURE__ */ import_react2.default.createElement(MenuFooter, {
|
|
2212
|
+
if ((0, import_echo.isEchoObject)(data.object)) {
|
|
2213
|
+
return /* @__PURE__ */ import_react.default.createElement(MenuFooter, {
|
|
1825
2214
|
object: data.object
|
|
1826
2215
|
});
|
|
2216
|
+
} else {
|
|
2217
|
+
return null;
|
|
1827
2218
|
}
|
|
2219
|
+
case "status": {
|
|
2220
|
+
return /* @__PURE__ */ import_react.default.createElement(SyncStatus, null);
|
|
2221
|
+
}
|
|
1828
2222
|
default:
|
|
1829
2223
|
return null;
|
|
1830
2224
|
}
|
|
@@ -1834,18 +2228,18 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1834
2228
|
builder: (plugins) => {
|
|
1835
2229
|
const clientPlugin2 = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_client.parseClientPlugin);
|
|
1836
2230
|
const metadataPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin);
|
|
1837
|
-
const
|
|
2231
|
+
const graphPlugin2 = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseGraphPlugin);
|
|
1838
2232
|
const client = clientPlugin2?.provides.client;
|
|
1839
2233
|
const dispatch = intentPlugin?.provides.intent.dispatch;
|
|
1840
2234
|
const resolve = metadataPlugin?.provides.metadata.resolver;
|
|
1841
|
-
const graph =
|
|
1842
|
-
if (!
|
|
2235
|
+
const graph = graphPlugin2?.provides.graph;
|
|
2236
|
+
if (!client || !dispatch || !resolve || !graph) {
|
|
1843
2237
|
return [];
|
|
1844
2238
|
}
|
|
1845
2239
|
return [
|
|
1846
2240
|
// Create spaces group node.
|
|
1847
2241
|
(0, import_plugin_graph.createExtension)({
|
|
1848
|
-
id: `${
|
|
2242
|
+
id: `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}/root`,
|
|
1849
2243
|
filter: (node) => node.id === "root",
|
|
1850
2244
|
connector: () => {
|
|
1851
2245
|
const isReady = (0, import_plugin_graph.toSignal)((onChange) => {
|
|
@@ -1868,10 +2262,9 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1868
2262
|
label: [
|
|
1869
2263
|
"spaces label",
|
|
1870
2264
|
{
|
|
1871
|
-
ns:
|
|
2265
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
1872
2266
|
}
|
|
1873
2267
|
],
|
|
1874
|
-
palette: "teal",
|
|
1875
2268
|
testId: "spacePlugin.spaces",
|
|
1876
2269
|
role: "branch",
|
|
1877
2270
|
childrenPersistenceClass: "echo",
|
|
@@ -1884,8 +2277,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1884
2277
|
spacesOrder.order = nextOrder.map(({ id }) => id);
|
|
1885
2278
|
} else {
|
|
1886
2279
|
import_log.log.warn("spaces order object not found", void 0, {
|
|
1887
|
-
F:
|
|
1888
|
-
L:
|
|
2280
|
+
F: __dxlog_file6,
|
|
2281
|
+
L: 553,
|
|
1889
2282
|
S: void 0,
|
|
1890
2283
|
C: (f, a) => f(...a)
|
|
1891
2284
|
});
|
|
@@ -1902,12 +2295,12 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1902
2295
|
filter: (node) => node.id === SPACES,
|
|
1903
2296
|
actions: () => [
|
|
1904
2297
|
{
|
|
1905
|
-
id:
|
|
2298
|
+
id: import_chunk_P4XUXM7Y.SpaceAction.CREATE,
|
|
1906
2299
|
data: async () => {
|
|
1907
2300
|
await dispatch([
|
|
1908
2301
|
{
|
|
1909
|
-
plugin:
|
|
1910
|
-
action:
|
|
2302
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
2303
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.CREATE
|
|
1911
2304
|
},
|
|
1912
2305
|
{
|
|
1913
2306
|
action: import_app_framework.NavigationAction.OPEN
|
|
@@ -1918,22 +2311,22 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1918
2311
|
label: [
|
|
1919
2312
|
"create space label",
|
|
1920
2313
|
{
|
|
1921
|
-
ns:
|
|
2314
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
1922
2315
|
}
|
|
1923
2316
|
],
|
|
1924
|
-
icon:
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
2317
|
+
icon: "ph--plus--regular",
|
|
2318
|
+
disposition: "item",
|
|
2319
|
+
testId: "spacePlugin.createSpace",
|
|
2320
|
+
className: "pbs-4"
|
|
1928
2321
|
}
|
|
1929
2322
|
},
|
|
1930
2323
|
{
|
|
1931
|
-
id:
|
|
2324
|
+
id: import_chunk_P4XUXM7Y.SpaceAction.JOIN,
|
|
1932
2325
|
data: async () => {
|
|
1933
2326
|
await dispatch([
|
|
1934
2327
|
{
|
|
1935
|
-
plugin:
|
|
1936
|
-
action:
|
|
2328
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
2329
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.JOIN
|
|
1937
2330
|
},
|
|
1938
2331
|
{
|
|
1939
2332
|
action: import_app_framework.NavigationAction.OPEN
|
|
@@ -1944,12 +2337,13 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1944
2337
|
label: [
|
|
1945
2338
|
"join space label",
|
|
1946
2339
|
{
|
|
1947
|
-
ns:
|
|
2340
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
1948
2341
|
}
|
|
1949
2342
|
],
|
|
1950
|
-
icon:
|
|
1951
|
-
|
|
1952
|
-
testId: "spacePlugin.joinSpace"
|
|
2343
|
+
icon: "ph--sign-in--regular",
|
|
2344
|
+
disposition: "item",
|
|
2345
|
+
testId: "spacePlugin.joinSpace",
|
|
2346
|
+
className: "pbe-4"
|
|
1953
2347
|
}
|
|
1954
2348
|
}
|
|
1955
2349
|
],
|
|
@@ -1980,7 +2374,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1980
2374
|
}),
|
|
1981
2375
|
// Find an object by its fully qualified id.
|
|
1982
2376
|
(0, import_plugin_graph.createExtension)({
|
|
1983
|
-
id: `${
|
|
2377
|
+
id: `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}/objects`,
|
|
1984
2378
|
resolver: ({ id }) => {
|
|
1985
2379
|
const [spaceId, objectId] = id.split(":");
|
|
1986
2380
|
const space = client.spaces.get().find((space2) => space2.id === spaceId);
|
|
@@ -2010,7 +2404,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2010
2404
|
}),
|
|
2011
2405
|
// Create space actions and action groups.
|
|
2012
2406
|
(0, import_plugin_graph.createExtension)({
|
|
2013
|
-
id: `${
|
|
2407
|
+
id: `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}/actions`,
|
|
2014
2408
|
filter: (node) => (0, import_echo.isSpace)(node.data),
|
|
2015
2409
|
actionGroups: ({ node }) => constructSpaceActionGroups({
|
|
2016
2410
|
space: node.data,
|
|
@@ -2028,7 +2422,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2028
2422
|
}),
|
|
2029
2423
|
// Create nodes for objects in the root collection of a space.
|
|
2030
2424
|
(0, import_plugin_graph.createExtension)({
|
|
2031
|
-
id: `${
|
|
2425
|
+
id: `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}/root-collection`,
|
|
2032
2426
|
filter: (node) => (0, import_echo.isSpace)(node.data),
|
|
2033
2427
|
connector: ({ node }) => {
|
|
2034
2428
|
const space = node.data;
|
|
@@ -2036,7 +2430,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2036
2430
|
if (state2 !== import_echo.SpaceState.SPACE_READY) {
|
|
2037
2431
|
return;
|
|
2038
2432
|
}
|
|
2039
|
-
const collection = space.properties[
|
|
2433
|
+
const collection = space.properties[import_chunk_HTAM5LQD.CollectionType.typename];
|
|
2040
2434
|
if (!collection) {
|
|
2041
2435
|
return;
|
|
2042
2436
|
}
|
|
@@ -2049,7 +2443,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2049
2443
|
}),
|
|
2050
2444
|
// Create collection actions and action groups.
|
|
2051
2445
|
(0, import_plugin_graph.createExtension)({
|
|
2052
|
-
id: `${
|
|
2446
|
+
id: `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}/object-actions`,
|
|
2053
2447
|
filter: (node) => (0, import_echo.isEchoObject)(node.data),
|
|
2054
2448
|
actionGroups: ({ node }) => constructObjectActionGroups({
|
|
2055
2449
|
object: node.data,
|
|
@@ -2062,8 +2456,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2062
2456
|
}),
|
|
2063
2457
|
// Create nodes for objects in collections.
|
|
2064
2458
|
(0, import_plugin_graph.createExtension)({
|
|
2065
|
-
id: `${
|
|
2066
|
-
filter: (node) => node.data instanceof
|
|
2459
|
+
id: `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}/collection-objects`,
|
|
2460
|
+
filter: (node) => node.data instanceof import_chunk_HTAM5LQD.CollectionType,
|
|
2067
2461
|
connector: ({ node }) => {
|
|
2068
2462
|
const collection = node.data;
|
|
2069
2463
|
const space = (0, import_echo.getSpace)(collection);
|
|
@@ -2076,6 +2470,72 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2076
2470
|
resolve
|
|
2077
2471
|
})).filter(import_util.nonNullable);
|
|
2078
2472
|
}
|
|
2473
|
+
}),
|
|
2474
|
+
// Create nodes for object settings.
|
|
2475
|
+
(0, import_plugin_graph.createExtension)({
|
|
2476
|
+
id: `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}/settings-for-subject`,
|
|
2477
|
+
resolver: ({ id }) => {
|
|
2478
|
+
if (!id.endsWith("~settings")) {
|
|
2479
|
+
return;
|
|
2480
|
+
}
|
|
2481
|
+
const type = "orphan-settings-for-subject";
|
|
2482
|
+
const icon = "ph--gear--regular";
|
|
2483
|
+
const [subjectId] = id.split("~");
|
|
2484
|
+
const { spaceId, objectId } = (0, import_echo.parseId)(subjectId);
|
|
2485
|
+
const space = client.spaces.get().find((space2) => space2.id === spaceId);
|
|
2486
|
+
if (!objectId) {
|
|
2487
|
+
const label2 = space ? space.properties.name || [
|
|
2488
|
+
"unnamed space label",
|
|
2489
|
+
{
|
|
2490
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
2491
|
+
}
|
|
2492
|
+
] : [
|
|
2493
|
+
"unnamed object settings label",
|
|
2494
|
+
{
|
|
2495
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
2496
|
+
}
|
|
2497
|
+
];
|
|
2498
|
+
return {
|
|
2499
|
+
id,
|
|
2500
|
+
type,
|
|
2501
|
+
data: null,
|
|
2502
|
+
properties: {
|
|
2503
|
+
icon,
|
|
2504
|
+
label: label2,
|
|
2505
|
+
showResolvedThreads: false,
|
|
2506
|
+
object: null,
|
|
2507
|
+
space
|
|
2508
|
+
}
|
|
2509
|
+
};
|
|
2510
|
+
}
|
|
2511
|
+
const object = (0, import_plugin_graph.toSignal)((onChange) => {
|
|
2512
|
+
const timeout = setTimeout(async () => {
|
|
2513
|
+
await space?.db.loadObjectById(objectId);
|
|
2514
|
+
onChange();
|
|
2515
|
+
});
|
|
2516
|
+
return () => clearTimeout(timeout);
|
|
2517
|
+
}, () => space?.db.getObjectById(objectId), subjectId);
|
|
2518
|
+
if (!object || !subjectId) {
|
|
2519
|
+
return;
|
|
2520
|
+
}
|
|
2521
|
+
const meta = resolve((0, import_echo.getTypename)(object) ?? "");
|
|
2522
|
+
const label = meta.label?.(object) || object.name || meta.placeholder || [
|
|
2523
|
+
"unnamed object settings label",
|
|
2524
|
+
{
|
|
2525
|
+
ns: import_chunk_P4XUXM7Y.SPACE_PLUGIN
|
|
2526
|
+
}
|
|
2527
|
+
];
|
|
2528
|
+
return {
|
|
2529
|
+
id,
|
|
2530
|
+
type,
|
|
2531
|
+
data: null,
|
|
2532
|
+
properties: {
|
|
2533
|
+
icon,
|
|
2534
|
+
label,
|
|
2535
|
+
object
|
|
2536
|
+
}
|
|
2537
|
+
};
|
|
2538
|
+
}
|
|
2079
2539
|
})
|
|
2080
2540
|
];
|
|
2081
2541
|
},
|
|
@@ -2089,8 +2549,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2089
2549
|
inputType: SPACES,
|
|
2090
2550
|
outputType: DIRECTORY_TYPE,
|
|
2091
2551
|
serialize: (node) => ({
|
|
2092
|
-
name: translations_default[0]["en-US"][
|
|
2093
|
-
data: translations_default[0]["en-US"][
|
|
2552
|
+
name: translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["spaces label"],
|
|
2553
|
+
data: translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["spaces label"],
|
|
2094
2554
|
type: DIRECTORY_TYPE
|
|
2095
2555
|
}),
|
|
2096
2556
|
deserialize: () => {
|
|
@@ -2100,14 +2560,14 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2100
2560
|
inputType: SPACE_TYPE,
|
|
2101
2561
|
outputType: DIRECTORY_TYPE,
|
|
2102
2562
|
serialize: (node) => ({
|
|
2103
|
-
name: node.data.properties.name ?? translations_default[0]["en-US"][
|
|
2104
|
-
data: node.data.properties.name ?? translations_default[0]["en-US"][
|
|
2563
|
+
name: node.data.properties.name ?? translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["unnamed space label"],
|
|
2564
|
+
data: node.data.properties.name ?? translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["unnamed space label"],
|
|
2105
2565
|
type: DIRECTORY_TYPE
|
|
2106
2566
|
}),
|
|
2107
2567
|
deserialize: async (data) => {
|
|
2108
2568
|
const result = await dispatch({
|
|
2109
|
-
plugin:
|
|
2110
|
-
action:
|
|
2569
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
2570
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.CREATE,
|
|
2111
2571
|
data: {
|
|
2112
2572
|
name: data.name
|
|
2113
2573
|
}
|
|
@@ -2116,25 +2576,25 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2116
2576
|
}
|
|
2117
2577
|
},
|
|
2118
2578
|
{
|
|
2119
|
-
inputType:
|
|
2579
|
+
inputType: import_chunk_HTAM5LQD.CollectionType.typename,
|
|
2120
2580
|
outputType: DIRECTORY_TYPE,
|
|
2121
2581
|
serialize: (node) => ({
|
|
2122
|
-
name: node.data.name ?? translations_default[0]["en-US"][
|
|
2123
|
-
data: node.data.name ?? translations_default[0]["en-US"][
|
|
2582
|
+
name: node.data.name ?? translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["unnamed collection label"],
|
|
2583
|
+
data: node.data.name ?? translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["unnamed collection label"],
|
|
2124
2584
|
type: DIRECTORY_TYPE
|
|
2125
2585
|
}),
|
|
2126
2586
|
deserialize: async (data, ancestors) => {
|
|
2127
2587
|
const space = ancestors.find(import_echo.isSpace);
|
|
2128
|
-
const collection = ancestors.findLast((ancestor) => ancestor instanceof
|
|
2588
|
+
const collection = ancestors.findLast((ancestor) => ancestor instanceof import_chunk_HTAM5LQD.CollectionType) ?? space?.properties[import_chunk_HTAM5LQD.CollectionType.typename];
|
|
2129
2589
|
if (!space || !collection) {
|
|
2130
2590
|
return;
|
|
2131
2591
|
}
|
|
2132
2592
|
const result = await dispatch({
|
|
2133
|
-
plugin:
|
|
2134
|
-
action:
|
|
2593
|
+
plugin: import_chunk_P4XUXM7Y.SPACE_PLUGIN,
|
|
2594
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT,
|
|
2135
2595
|
data: {
|
|
2136
2596
|
target: collection,
|
|
2137
|
-
object: (0, import_echo.create)(
|
|
2597
|
+
object: (0, import_echo.create)(import_chunk_HTAM5LQD.CollectionType, {
|
|
2138
2598
|
name: data.name,
|
|
2139
2599
|
objects: [],
|
|
2140
2600
|
views: {}
|
|
@@ -2152,23 +2612,23 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2152
2612
|
const clientPlugin2 = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_client.parseClientPlugin);
|
|
2153
2613
|
const client = clientPlugin2?.provides.client;
|
|
2154
2614
|
switch (intent.action) {
|
|
2155
|
-
case
|
|
2615
|
+
case import_chunk_P4XUXM7Y.SpaceAction.WAIT_FOR_OBJECT: {
|
|
2156
2616
|
state.values.awaiting = intent.data?.id;
|
|
2157
2617
|
return {
|
|
2158
2618
|
data: true
|
|
2159
2619
|
};
|
|
2160
2620
|
}
|
|
2161
|
-
case
|
|
2621
|
+
case import_chunk_P4XUXM7Y.SpaceAction.CREATE: {
|
|
2162
2622
|
if (!client) {
|
|
2163
2623
|
return;
|
|
2164
2624
|
}
|
|
2165
2625
|
const space = await client.spaces.create(intent.data);
|
|
2166
2626
|
await space.waitUntilReady();
|
|
2167
|
-
const collection = (0, import_echo.create)(
|
|
2627
|
+
const collection = (0, import_echo.create)(import_chunk_HTAM5LQD.CollectionType, {
|
|
2168
2628
|
objects: [],
|
|
2169
2629
|
views: {}
|
|
2170
2630
|
});
|
|
2171
|
-
space.properties[
|
|
2631
|
+
space.properties[import_chunk_HTAM5LQD.CollectionType.typename] = collection;
|
|
2172
2632
|
if (import_migrations.Migrations.versionProperty) {
|
|
2173
2633
|
space.properties[import_migrations.Migrations.versionProperty] = import_migrations.Migrations.targetVersion;
|
|
2174
2634
|
}
|
|
@@ -2183,6 +2643,25 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2183
2643
|
}
|
|
2184
2644
|
},
|
|
2185
2645
|
intents: [
|
|
2646
|
+
...settings.values.onSpaceCreate ? [
|
|
2647
|
+
[
|
|
2648
|
+
{
|
|
2649
|
+
action: settings.values.onSpaceCreate,
|
|
2650
|
+
data: {
|
|
2651
|
+
space
|
|
2652
|
+
}
|
|
2653
|
+
},
|
|
2654
|
+
{
|
|
2655
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT,
|
|
2656
|
+
data: {
|
|
2657
|
+
target: space
|
|
2658
|
+
}
|
|
2659
|
+
},
|
|
2660
|
+
{
|
|
2661
|
+
action: import_app_framework.NavigationAction.EXPOSE
|
|
2662
|
+
}
|
|
2663
|
+
]
|
|
2664
|
+
] : [],
|
|
2186
2665
|
[
|
|
2187
2666
|
{
|
|
2188
2667
|
action: import_meta.ObservabilityAction.SEND_EVENT,
|
|
@@ -2197,7 +2676,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2197
2676
|
]
|
|
2198
2677
|
};
|
|
2199
2678
|
}
|
|
2200
|
-
case
|
|
2679
|
+
case import_chunk_P4XUXM7Y.SpaceAction.JOIN: {
|
|
2201
2680
|
if (client) {
|
|
2202
2681
|
const { space } = await client.shell.joinSpace({
|
|
2203
2682
|
invitationCode: intent.data?.invitationCode
|
|
@@ -2214,6 +2693,20 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2214
2693
|
}
|
|
2215
2694
|
},
|
|
2216
2695
|
intents: [
|
|
2696
|
+
[
|
|
2697
|
+
{
|
|
2698
|
+
action: import_app_framework.LayoutAction.SET_LAYOUT,
|
|
2699
|
+
data: {
|
|
2700
|
+
element: "toast",
|
|
2701
|
+
subject: {
|
|
2702
|
+
id: `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}/join-success`,
|
|
2703
|
+
duration: 1e4,
|
|
2704
|
+
title: translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["join success label"],
|
|
2705
|
+
closeLabel: translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["dismiss label"]
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2708
|
+
}
|
|
2709
|
+
],
|
|
2217
2710
|
[
|
|
2218
2711
|
{
|
|
2219
2712
|
action: import_meta.ObservabilityAction.SEND_EVENT,
|
|
@@ -2231,7 +2724,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2231
2724
|
}
|
|
2232
2725
|
break;
|
|
2233
2726
|
}
|
|
2234
|
-
case
|
|
2727
|
+
case import_chunk_P4XUXM7Y.SpaceAction.SHARE: {
|
|
2235
2728
|
const spaceId = intent.data?.spaceId;
|
|
2236
2729
|
if (clientPlugin2 && typeof spaceId === "string") {
|
|
2237
2730
|
if (!navigationPlugin?.provides.location.active) {
|
|
@@ -2264,7 +2757,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2264
2757
|
}
|
|
2265
2758
|
break;
|
|
2266
2759
|
}
|
|
2267
|
-
case
|
|
2760
|
+
case import_chunk_P4XUXM7Y.SpaceAction.LOCK: {
|
|
2268
2761
|
const space = intent.data?.space;
|
|
2269
2762
|
if ((0, import_echo.isSpace)(space)) {
|
|
2270
2763
|
space.properties[COMPOSER_SPACE_LOCK] = true;
|
|
@@ -2287,7 +2780,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2287
2780
|
}
|
|
2288
2781
|
break;
|
|
2289
2782
|
}
|
|
2290
|
-
case
|
|
2783
|
+
case import_chunk_P4XUXM7Y.SpaceAction.UNLOCK: {
|
|
2291
2784
|
const space = intent.data?.space;
|
|
2292
2785
|
if ((0, import_echo.isSpace)(space)) {
|
|
2293
2786
|
space.properties[COMPOSER_SPACE_LOCK] = false;
|
|
@@ -2310,7 +2803,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2310
2803
|
}
|
|
2311
2804
|
break;
|
|
2312
2805
|
}
|
|
2313
|
-
case
|
|
2806
|
+
case import_chunk_P4XUXM7Y.SpaceAction.RENAME: {
|
|
2314
2807
|
const { caller, space } = intent.data ?? {};
|
|
2315
2808
|
if (typeof caller === "string" && (0, import_echo.isSpace)(space)) {
|
|
2316
2809
|
return {
|
|
@@ -2331,7 +2824,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2331
2824
|
}
|
|
2332
2825
|
break;
|
|
2333
2826
|
}
|
|
2334
|
-
case
|
|
2827
|
+
case import_chunk_P4XUXM7Y.SpaceAction.OPEN: {
|
|
2335
2828
|
const space = intent.data?.space;
|
|
2336
2829
|
if ((0, import_echo.isSpace)(space)) {
|
|
2337
2830
|
await space.open();
|
|
@@ -2341,7 +2834,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2341
2834
|
}
|
|
2342
2835
|
break;
|
|
2343
2836
|
}
|
|
2344
|
-
case
|
|
2837
|
+
case import_chunk_P4XUXM7Y.SpaceAction.CLOSE: {
|
|
2345
2838
|
const space = intent.data?.space;
|
|
2346
2839
|
if ((0, import_echo.isSpace)(space)) {
|
|
2347
2840
|
await space.close();
|
|
@@ -2351,7 +2844,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2351
2844
|
}
|
|
2352
2845
|
break;
|
|
2353
2846
|
}
|
|
2354
|
-
case
|
|
2847
|
+
case import_chunk_P4XUXM7Y.SpaceAction.MIGRATE: {
|
|
2355
2848
|
const space = intent.data?.space;
|
|
2356
2849
|
if ((0, import_echo.isSpace)(space)) {
|
|
2357
2850
|
if (space.state.get() === import_echo.SpaceState.SPACE_REQUIRES_MIGRATION) {
|
|
@@ -2380,7 +2873,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2380
2873
|
}
|
|
2381
2874
|
break;
|
|
2382
2875
|
}
|
|
2383
|
-
case
|
|
2876
|
+
case import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT: {
|
|
2384
2877
|
const object = intent.data?.object ?? intent.data?.result;
|
|
2385
2878
|
if (!(0, import_echo_schema.isReactiveObject)(object)) {
|
|
2386
2879
|
return;
|
|
@@ -2399,16 +2892,15 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2399
2892
|
data: {
|
|
2400
2893
|
element: "toast",
|
|
2401
2894
|
subject: {
|
|
2402
|
-
id: `${
|
|
2403
|
-
title: translations_default[0]["en-US"][
|
|
2404
|
-
description: translations_default[0]["en-US"][
|
|
2895
|
+
id: `${import_chunk_P4XUXM7Y.SPACE_PLUGIN}/space-limit`,
|
|
2896
|
+
title: translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["space limit label"],
|
|
2897
|
+
description: translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["space limit description"],
|
|
2405
2898
|
duration: 5e3,
|
|
2406
|
-
icon:
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
actionAlt: translations_default[0]["en-US"][import_chunk_6CNYF6YU.SPACE_PLUGIN]["remove deleted objects alt"],
|
|
2899
|
+
icon: "ph--warning--regular",
|
|
2900
|
+
actionLabel: translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["remove deleted objects label"],
|
|
2901
|
+
actionAlt: translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["remove deleted objects alt"],
|
|
2410
2902
|
// TODO(wittjosiah): Use OS namespace.
|
|
2411
|
-
closeLabel: translations_default[0]["en-US"][
|
|
2903
|
+
closeLabel: translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN]["space limit close label"],
|
|
2412
2904
|
onAction: () => space.db.coreDatabase.unlinkDeletedObjects()
|
|
2413
2905
|
}
|
|
2414
2906
|
}
|
|
@@ -2428,25 +2920,25 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2428
2920
|
]
|
|
2429
2921
|
};
|
|
2430
2922
|
}
|
|
2431
|
-
if (intent.data?.target instanceof
|
|
2923
|
+
if (intent.data?.target instanceof import_chunk_HTAM5LQD.CollectionType) {
|
|
2432
2924
|
intent.data?.target.objects.push(object);
|
|
2433
2925
|
} else if ((0, import_echo.isSpace)(intent.data?.target)) {
|
|
2434
|
-
const collection = space.properties[
|
|
2435
|
-
if (collection instanceof
|
|
2926
|
+
const collection = space.properties[import_chunk_HTAM5LQD.CollectionType.typename];
|
|
2927
|
+
if (collection instanceof import_chunk_HTAM5LQD.CollectionType) {
|
|
2436
2928
|
collection.objects.push(object);
|
|
2437
2929
|
} else {
|
|
2438
|
-
const collection2 = (0, import_echo.create)(
|
|
2930
|
+
const collection2 = (0, import_echo.create)(import_chunk_HTAM5LQD.CollectionType, {
|
|
2439
2931
|
objects: [
|
|
2440
2932
|
object
|
|
2441
2933
|
],
|
|
2442
2934
|
views: {}
|
|
2443
2935
|
});
|
|
2444
|
-
space.properties[
|
|
2936
|
+
space.properties[import_chunk_HTAM5LQD.CollectionType.typename] = collection2;
|
|
2445
2937
|
}
|
|
2446
2938
|
}
|
|
2447
2939
|
return {
|
|
2448
2940
|
data: {
|
|
2449
|
-
id: object
|
|
2941
|
+
id: (0, import_echo.fullyQualifiedId)(object),
|
|
2450
2942
|
object,
|
|
2451
2943
|
activeParts: {
|
|
2452
2944
|
main: [
|
|
@@ -2471,7 +2963,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2471
2963
|
]
|
|
2472
2964
|
};
|
|
2473
2965
|
}
|
|
2474
|
-
case
|
|
2966
|
+
case import_chunk_P4XUXM7Y.SpaceAction.REMOVE_OBJECT: {
|
|
2475
2967
|
const object = intent.data?.object ?? intent.data?.result;
|
|
2476
2968
|
const space = (0, import_echo.getSpace)(object);
|
|
2477
2969
|
if (!((0, import_echo.isEchoObject)(object) && space)) {
|
|
@@ -2481,12 +2973,12 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2481
2973
|
const activeParts = navigationPlugin?.provides.location.active;
|
|
2482
2974
|
const openObjectIds = new Set((0, import_app_framework.openIds)(activeParts ?? {}));
|
|
2483
2975
|
if (!intent.undo && resolve) {
|
|
2484
|
-
const parentCollection = intent.data?.collection ?? space.properties[
|
|
2976
|
+
const parentCollection = intent.data?.collection ?? space.properties[import_chunk_HTAM5LQD.CollectionType.typename];
|
|
2485
2977
|
const nestedObjects = await getNestedObjects(object, resolve);
|
|
2486
2978
|
const deletionData = {
|
|
2487
2979
|
object,
|
|
2488
2980
|
parentCollection,
|
|
2489
|
-
index: parentCollection instanceof
|
|
2981
|
+
index: parentCollection instanceof import_chunk_HTAM5LQD.CollectionType ? parentCollection.objects.indexOf(object) : -1,
|
|
2490
2982
|
nestedObjects,
|
|
2491
2983
|
wasActive: [
|
|
2492
2984
|
object,
|
|
@@ -2499,13 +2991,12 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2499
2991
|
data: {
|
|
2500
2992
|
activeParts: {
|
|
2501
2993
|
main: deletionData.wasActive,
|
|
2502
|
-
sidebar: deletionData.wasActive
|
|
2503
|
-
complementary: deletionData.wasActive
|
|
2994
|
+
sidebar: deletionData.wasActive
|
|
2504
2995
|
}
|
|
2505
2996
|
}
|
|
2506
2997
|
});
|
|
2507
2998
|
}
|
|
2508
|
-
if (parentCollection instanceof
|
|
2999
|
+
if (parentCollection instanceof import_chunk_HTAM5LQD.CollectionType) {
|
|
2509
3000
|
const index = parentCollection.objects.indexOf(object);
|
|
2510
3001
|
if (index !== -1) {
|
|
2511
3002
|
parentCollection.objects.splice(index, 1);
|
|
@@ -2515,18 +3006,18 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2515
3006
|
space.db.remove(obj);
|
|
2516
3007
|
});
|
|
2517
3008
|
space.db.remove(object);
|
|
2518
|
-
const undoMessageKey = object instanceof
|
|
3009
|
+
const undoMessageKey = object instanceof import_chunk_HTAM5LQD.CollectionType ? "collection deleted label" : "object deleted label";
|
|
2519
3010
|
return {
|
|
2520
3011
|
data: true,
|
|
2521
3012
|
undoable: {
|
|
2522
3013
|
// Consider using a translation key here.
|
|
2523
|
-
message: translations_default[0]["en-US"][
|
|
3014
|
+
message: translations_default[0]["en-US"][import_chunk_P4XUXM7Y.SPACE_PLUGIN][undoMessageKey],
|
|
2524
3015
|
data: deletionData
|
|
2525
3016
|
}
|
|
2526
3017
|
};
|
|
2527
3018
|
} else {
|
|
2528
3019
|
const undoData = intent.data;
|
|
2529
|
-
if (undoData && (0, import_echo.isEchoObject)(undoData.object) && undoData.parentCollection instanceof
|
|
3020
|
+
if (undoData && (0, import_echo.isEchoObject)(undoData.object) && undoData.parentCollection instanceof import_chunk_HTAM5LQD.CollectionType) {
|
|
2530
3021
|
const restoredObject = space.db.add(undoData.object);
|
|
2531
3022
|
undoData.nestedObjects.forEach((obj) => {
|
|
2532
3023
|
space.db.add(obj);
|
|
@@ -2553,7 +3044,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2553
3044
|
};
|
|
2554
3045
|
}
|
|
2555
3046
|
}
|
|
2556
|
-
case
|
|
3047
|
+
case import_chunk_P4XUXM7Y.SpaceAction.RENAME_OBJECT: {
|
|
2557
3048
|
const object = intent.data?.object ?? intent.data?.result;
|
|
2558
3049
|
const caller = intent.data?.caller;
|
|
2559
3050
|
if ((0, import_echo_schema.isReactiveObject)(object) && caller) {
|
|
@@ -2575,18 +3066,19 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2575
3066
|
}
|
|
2576
3067
|
break;
|
|
2577
3068
|
}
|
|
2578
|
-
case
|
|
3069
|
+
case import_chunk_P4XUXM7Y.SpaceAction.DUPLICATE_OBJECT: {
|
|
2579
3070
|
const originalObject = intent.data?.object ?? intent.data?.result;
|
|
2580
3071
|
const resolve = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin)?.provides.metadata.resolver;
|
|
2581
|
-
|
|
3072
|
+
const space = (0, import_echo.isSpace)(intent.data?.target) ? intent.data?.target : (0, import_echo.getSpace)(intent.data?.target);
|
|
3073
|
+
if (!(0, import_echo.isEchoObject)(originalObject) || !resolve || !space) {
|
|
2582
3074
|
return;
|
|
2583
3075
|
}
|
|
2584
|
-
const newObject = await cloneObject(originalObject, resolve);
|
|
3076
|
+
const newObject = await cloneObject(originalObject, resolve, space);
|
|
2585
3077
|
return {
|
|
2586
3078
|
intents: [
|
|
2587
3079
|
[
|
|
2588
3080
|
{
|
|
2589
|
-
action:
|
|
3081
|
+
action: import_chunk_P4XUXM7Y.SpaceAction.ADD_OBJECT,
|
|
2590
3082
|
data: {
|
|
2591
3083
|
object: newObject,
|
|
2592
3084
|
target: intent.data?.target
|
|
@@ -2596,7 +3088,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2596
3088
|
]
|
|
2597
3089
|
};
|
|
2598
3090
|
}
|
|
2599
|
-
case
|
|
3091
|
+
case import_chunk_P4XUXM7Y.SpaceAction.TOGGLE_HIDDEN: {
|
|
2600
3092
|
settings.values.showHidden = intent.data?.state ?? !settings.values.showHidden;
|
|
2601
3093
|
return {
|
|
2602
3094
|
data: true
|
|
@@ -2619,12 +3111,11 @@ var src_default = SpacePlugin;
|
|
|
2619
3111
|
CollectionSection,
|
|
2620
3112
|
CollectionType,
|
|
2621
3113
|
ContactType,
|
|
2622
|
-
|
|
2623
|
-
EmptyTree,
|
|
3114
|
+
DefaultObjectSettings,
|
|
2624
3115
|
FullPresence,
|
|
2625
3116
|
MenuFooter,
|
|
3117
|
+
MessageState,
|
|
2626
3118
|
MessageType,
|
|
2627
|
-
MissingObject,
|
|
2628
3119
|
PersistenceStatus,
|
|
2629
3120
|
PopoverRenameObject,
|
|
2630
3121
|
PopoverRenameSpace,
|
|
@@ -2643,6 +3134,10 @@ var src_default = SpacePlugin;
|
|
|
2643
3134
|
SpacePlugin,
|
|
2644
3135
|
SpacePresence,
|
|
2645
3136
|
SpaceSettings,
|
|
3137
|
+
SpaceSettingsPanel,
|
|
3138
|
+
SyncStatus,
|
|
3139
|
+
SyncStatusDetail,
|
|
3140
|
+
SyncStatusIndicator,
|
|
2646
3141
|
ThreadStatus,
|
|
2647
3142
|
ThreadType,
|
|
2648
3143
|
cloneObject,
|
|
@@ -2656,6 +3151,7 @@ var src_default = SpacePlugin;
|
|
|
2656
3151
|
getNestedObjects,
|
|
2657
3152
|
getSpaceDisplayName,
|
|
2658
3153
|
memoizeQuery,
|
|
3154
|
+
parseSpaceInitPlugin,
|
|
2659
3155
|
parseSpacePlugin,
|
|
2660
3156
|
translations
|
|
2661
3157
|
});
|