@dxos/plugin-space 0.6.14-staging.77003c1 → 0.6.14-staging.7b35391
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-AVLRQF6L.mjs → chunk-DJE2HYFV.mjs} +3 -2
- package/dist/lib/browser/{chunk-AVLRQF6L.mjs.map → chunk-DJE2HYFV.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-WZAM3FNP.mjs → chunk-OWZKSWMX.mjs} +1 -1
- package/dist/lib/browser/{chunk-WZAM3FNP.mjs.map → chunk-OWZKSWMX.mjs.map} +2 -2
- package/dist/lib/browser/index.mjs +586 -576
- 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 +1 -1
- package/dist/lib/node/{chunk-HTAM5LQD.cjs → chunk-FYWGZYJB.cjs} +4 -4
- package/dist/lib/node/{chunk-HTAM5LQD.cjs.map → chunk-FYWGZYJB.cjs.map} +2 -2
- package/dist/lib/node/{chunk-P4XUXM7Y.cjs → chunk-JFDDZI4Y.cjs} +6 -5
- package/dist/lib/node/{chunk-P4XUXM7Y.cjs.map → chunk-JFDDZI4Y.cjs.map} +2 -2
- package/dist/lib/node/index.cjs +816 -805
- 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 +11 -11
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{chunk-YPQGKWHJ.mjs → chunk-DVUZ7A7G.mjs} +3 -2
- package/dist/lib/node-esm/{chunk-YPQGKWHJ.mjs.map → chunk-DVUZ7A7G.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-TRJKV4PK.mjs → chunk-MCEAI4CV.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-TRJKV4PK.mjs.map → chunk-MCEAI4CV.mjs.map} +2 -2
- package/dist/lib/node-esm/index.mjs +586 -576
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/meta.mjs +1 -1
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/SpacePlugin.d.ts +9 -1
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts +7 -0
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -0
- package/dist/types/src/components/ShareSpaceButton.d.ts +3 -2
- package/dist/types/src/components/ShareSpaceButton.d.ts.map +1 -1
- package/dist/types/src/components/{SpaceSettings.d.ts → SpacePluginSettings.d.ts} +2 -2
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.d.ts +10 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.stories.d.ts +7 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.stories.d.ts +7 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.stories.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/index.d.ts +3 -0
- package/dist/types/src/components/SpaceSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +2 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +3 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +4 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +5 -0
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +8 -4
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +35 -34
- package/src/SpacePlugin.tsx +225 -146
- package/src/components/AwaitingObject.tsx +1 -1
- package/src/components/JoinDialog.tsx +100 -0
- package/src/components/ShareSpaceButton.tsx +10 -6
- package/src/components/{SpaceSettings.tsx → SpacePluginSettings.tsx} +1 -1
- package/src/components/SpaceSettings/SpaceSettingsDialog.stories.tsx +44 -0
- package/src/components/SpaceSettings/SpaceSettingsDialog.tsx +103 -0
- package/src/components/SpaceSettings/SpaceSettingsPanel.stories.tsx +32 -0
- package/src/components/{SpaceSettingsPanel.tsx → SpaceSettings/SpaceSettingsPanel.tsx} +15 -20
- package/src/components/SpaceSettings/index.ts +6 -0
- package/src/components/index.ts +2 -2
- package/src/meta.ts +2 -1
- package/src/translations.ts +4 -0
- package/src/types/types.ts +6 -0
- package/src/util.tsx +51 -23
- package/dist/types/src/components/SpaceMain/SpaceMain.d.ts +0 -10
- package/dist/types/src/components/SpaceMain/SpaceMain.d.ts.map +0 -1
- package/dist/types/src/components/SpaceMain/SpaceMembersSection.d.ts +0 -6
- package/dist/types/src/components/SpaceMain/SpaceMembersSection.d.ts.map +0 -1
- package/dist/types/src/components/SpaceMain/index.d.ts +0 -2
- package/dist/types/src/components/SpaceMain/index.d.ts.map +0 -1
- package/dist/types/src/components/SpaceSettings.d.ts.map +0 -1
- package/dist/types/src/components/SpaceSettingsPanel.d.ts.map +0 -1
- package/src/components/SpaceMain/SpaceMain.tsx +0 -60
- package/src/components/SpaceMain/SpaceMembersSection.tsx +0 -205
- package/src/components/SpaceMain/index.ts +0 -5
- /package/dist/types/src/components/{SpaceSettingsPanel.d.ts → SpaceSettings/SpaceSettingsPanel.d.ts} +0 -0
package/dist/lib/node/index.cjs
CHANGED
|
@@ -28,43 +28,44 @@ 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_FYWGZYJB.ActorSchema,
|
|
32
32
|
AwaitingObject: () => AwaitingObject,
|
|
33
33
|
COMPOSER_SPACE_LOCK: () => COMPOSER_SPACE_LOCK,
|
|
34
|
-
ChannelType: () =>
|
|
34
|
+
ChannelType: () => import_chunk_FYWGZYJB.ChannelType,
|
|
35
35
|
CollectionMain: () => CollectionMain,
|
|
36
36
|
CollectionSection: () => CollectionSection,
|
|
37
|
-
CollectionType: () =>
|
|
38
|
-
ContactType: () =>
|
|
37
|
+
CollectionType: () => import_chunk_FYWGZYJB.CollectionType,
|
|
38
|
+
ContactType: () => import_chunk_FYWGZYJB.ContactType,
|
|
39
39
|
DefaultObjectSettings: () => DefaultObjectSettings,
|
|
40
40
|
FullPresence: () => FullPresence,
|
|
41
|
+
JoinDialog: () => JoinDialog,
|
|
41
42
|
MenuFooter: () => MenuFooter,
|
|
42
|
-
MessageState: () =>
|
|
43
|
-
MessageType: () =>
|
|
43
|
+
MessageState: () => import_chunk_FYWGZYJB.MessageState,
|
|
44
|
+
MessageType: () => import_chunk_FYWGZYJB.MessageType,
|
|
44
45
|
PersistenceStatus: () => PersistenceStatus,
|
|
45
46
|
PopoverRenameObject: () => PopoverRenameObject,
|
|
46
47
|
PopoverRenameSpace: () => PopoverRenameSpace,
|
|
47
48
|
SHARED: () => SHARED,
|
|
48
49
|
SPACES: () => SPACES,
|
|
49
|
-
SPACE_DIRECTORY_HANDLE: () =>
|
|
50
|
-
SPACE_PLUGIN: () =>
|
|
51
|
-
SPACE_PLUGIN_SHORT_ID: () =>
|
|
50
|
+
SPACE_DIRECTORY_HANDLE: () => import_chunk_FYWGZYJB.SPACE_DIRECTORY_HANDLE,
|
|
51
|
+
SPACE_PLUGIN: () => import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
52
|
+
SPACE_PLUGIN_SHORT_ID: () => import_chunk_JFDDZI4Y.SPACE_PLUGIN_SHORT_ID,
|
|
52
53
|
SPACE_TYPE: () => SPACE_TYPE,
|
|
53
54
|
ShareSpaceButton: () => ShareSpaceButton,
|
|
54
55
|
ShareSpaceButtonImpl: () => ShareSpaceButtonImpl,
|
|
55
56
|
SmallPresence: () => SmallPresence,
|
|
56
57
|
SmallPresenceLive: () => SmallPresenceLive,
|
|
57
|
-
SpaceAction: () =>
|
|
58
|
-
SpaceMain: () => SpaceMain,
|
|
58
|
+
SpaceAction: () => import_chunk_JFDDZI4Y.SpaceAction,
|
|
59
59
|
SpacePlugin: () => SpacePlugin,
|
|
60
|
+
SpacePluginSettings: () => SpacePluginSettings,
|
|
60
61
|
SpacePresence: () => SpacePresence,
|
|
61
|
-
|
|
62
|
+
SpaceSettingsDialog: () => SpaceSettingsDialog,
|
|
62
63
|
SpaceSettingsPanel: () => SpaceSettingsPanel,
|
|
63
64
|
SyncStatus: () => SyncStatus,
|
|
64
65
|
SyncStatusDetail: () => SyncStatusDetail,
|
|
65
66
|
SyncStatusIndicator: () => SyncStatusIndicator,
|
|
66
|
-
ThreadStatus: () =>
|
|
67
|
-
ThreadType: () =>
|
|
67
|
+
ThreadStatus: () => import_chunk_FYWGZYJB.ThreadStatus,
|
|
68
|
+
ThreadType: () => import_chunk_FYWGZYJB.ThreadType,
|
|
68
69
|
cloneObject: () => cloneObject,
|
|
69
70
|
constructObjectActionGroups: () => constructObjectActionGroups,
|
|
70
71
|
constructObjectActions: () => constructObjectActions,
|
|
@@ -77,19 +78,20 @@ __export(node_exports, {
|
|
|
77
78
|
getNestedObjects: () => getNestedObjects,
|
|
78
79
|
getSpaceDisplayName: () => getSpaceDisplayName,
|
|
79
80
|
memoizeQuery: () => memoizeQuery,
|
|
80
|
-
parseSpaceInitPlugin: () =>
|
|
81
|
+
parseSpaceInitPlugin: () => import_chunk_FYWGZYJB.parseSpaceInitPlugin,
|
|
81
82
|
parseSpacePlugin: () => parseSpacePlugin,
|
|
82
83
|
translations: () => translations_default
|
|
83
84
|
});
|
|
84
85
|
module.exports = __toCommonJS(node_exports);
|
|
85
|
-
var
|
|
86
|
-
var
|
|
86
|
+
var import_chunk_JFDDZI4Y = require("./chunk-JFDDZI4Y.cjs");
|
|
87
|
+
var import_chunk_FYWGZYJB = require("./chunk-FYWGZYJB.cjs");
|
|
87
88
|
var import_signals_core = require("@preact/signals-core");
|
|
88
89
|
var import_react = __toESM(require("react"));
|
|
89
90
|
var import_app_framework = require("@dxos/app-framework");
|
|
90
91
|
var import_async = require("@dxos/async");
|
|
91
92
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
92
93
|
var import_core = require("@dxos/echo-signals/core");
|
|
94
|
+
var import_invariant = require("@dxos/invariant");
|
|
93
95
|
var import_local_storage = require("@dxos/local-storage");
|
|
94
96
|
var import_log = require("@dxos/log");
|
|
95
97
|
var import_migrations = require("@dxos/migrations");
|
|
@@ -99,7 +101,6 @@ var import_plugin_graph = require("@dxos/plugin-graph");
|
|
|
99
101
|
var import_meta = require("@dxos/plugin-observability/meta");
|
|
100
102
|
var import_react_client = require("@dxos/react-client");
|
|
101
103
|
var import_echo = require("@dxos/react-client/echo");
|
|
102
|
-
var import_react_ui = require("@dxos/react-ui");
|
|
103
104
|
var import_react2 = require("@dxos/shell/react");
|
|
104
105
|
var import_util = require("@dxos/util");
|
|
105
106
|
var import_react3 = require("@phosphor-icons/react");
|
|
@@ -107,95 +108,92 @@ var import_react4 = __toESM(require("react"));
|
|
|
107
108
|
var import_app_framework2 = require("@dxos/app-framework");
|
|
108
109
|
var import_react_client2 = require("@dxos/react-client");
|
|
109
110
|
var import_echo2 = require("@dxos/react-client/echo");
|
|
110
|
-
var
|
|
111
|
+
var import_react_ui = require("@dxos/react-ui");
|
|
111
112
|
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
112
113
|
var import_react5 = __toESM(require("react"));
|
|
113
|
-
var
|
|
114
|
+
var import_react_ui2 = require("@dxos/react-ui");
|
|
114
115
|
var import_react_ui_theme2 = require("@dxos/react-ui-theme");
|
|
115
116
|
var import_react6 = __toESM(require("react"));
|
|
116
|
-
var
|
|
117
|
+
var import_react_ui3 = require("@dxos/react-ui");
|
|
117
118
|
var import_react7 = __toESM(require("react"));
|
|
119
|
+
var import_react_ui4 = require("@dxos/react-ui");
|
|
120
|
+
var import_react8 = __toESM(require("react"));
|
|
121
|
+
var import_app_framework3 = require("@dxos/app-framework");
|
|
122
|
+
var import_plugin_graph2 = require("@dxos/plugin-graph");
|
|
123
|
+
var import_meta2 = require("@dxos/plugin-observability/meta");
|
|
124
|
+
var import_echo3 = require("@dxos/react-client/echo");
|
|
118
125
|
var import_react_ui5 = require("@dxos/react-ui");
|
|
119
|
-
var
|
|
120
|
-
var
|
|
121
|
-
var
|
|
126
|
+
var import_react9 = require("@dxos/shell/react");
|
|
127
|
+
var import_react10 = require("@phosphor-icons/react");
|
|
128
|
+
var import_react11 = __toESM(require("react"));
|
|
129
|
+
var import_echo4 = require("@dxos/client/echo");
|
|
122
130
|
var import_react_client3 = require("@dxos/react-client");
|
|
123
131
|
var import_react_ui6 = require("@dxos/react-ui");
|
|
124
|
-
var
|
|
132
|
+
var import_app_framework4 = require("@dxos/app-framework");
|
|
125
133
|
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
126
|
-
var
|
|
134
|
+
var import_invariant2 = require("@dxos/invariant");
|
|
127
135
|
var import_migrations2 = require("@dxos/migrations");
|
|
128
|
-
var
|
|
129
|
-
var
|
|
130
|
-
var
|
|
131
|
-
var
|
|
136
|
+
var import_plugin_graph3 = require("@dxos/plugin-graph");
|
|
137
|
+
var import_echo5 = require("@dxos/react-client/echo");
|
|
138
|
+
var import_react12 = require("@phosphor-icons/react");
|
|
139
|
+
var import_react13 = __toESM(require("react"));
|
|
132
140
|
var import_async2 = require("@dxos/async");
|
|
133
141
|
var import_react_ui7 = require("@dxos/react-ui");
|
|
134
142
|
var import_react_ui_theme3 = require("@dxos/react-ui-theme");
|
|
135
|
-
var
|
|
143
|
+
var import_react14 = __toESM(require("react"));
|
|
136
144
|
var import_log2 = require("@dxos/log");
|
|
137
145
|
var import_react_ui8 = require("@dxos/react-ui");
|
|
138
|
-
var
|
|
146
|
+
var import_react15 = __toESM(require("react"));
|
|
139
147
|
var import_react_ui9 = require("@dxos/react-ui");
|
|
140
|
-
var import_react14 = __toESM(require("react"));
|
|
141
|
-
var import_app_framework4 = require("@dxos/app-framework");
|
|
142
|
-
var import_react_ui10 = require("@dxos/react-ui");
|
|
143
|
-
var import_react15 = require("@phosphor-icons/react");
|
|
144
148
|
var import_react16 = __toESM(require("react"));
|
|
145
149
|
var import_app_framework5 = require("@dxos/app-framework");
|
|
146
|
-
var
|
|
147
|
-
var
|
|
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");
|
|
151
|
-
var import_react19 = __toESM(require("react"));
|
|
150
|
+
var import_react_ui10 = require("@dxos/react-ui");
|
|
151
|
+
var import_react17 = __toESM(require("react"));
|
|
152
152
|
var import_app_framework6 = require("@dxos/app-framework");
|
|
153
|
-
var import_echo6 = require("@dxos/react-client/echo");
|
|
154
|
-
var import_invitations = require("@dxos/react-client/invitations");
|
|
155
|
-
var import_invitations2 = require("@dxos/react-client/invitations");
|
|
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");
|
|
161
153
|
var import_display_name = require("@dxos/display-name");
|
|
162
154
|
var import_react_client4 = require("@dxos/react-client");
|
|
163
|
-
var
|
|
155
|
+
var import_echo6 = require("@dxos/react-client/echo");
|
|
164
156
|
var import_halo = require("@dxos/react-client/halo");
|
|
165
|
-
var
|
|
157
|
+
var import_react_ui11 = require("@dxos/react-ui");
|
|
166
158
|
var import_react_ui_attention = require("@dxos/react-ui-attention");
|
|
167
159
|
var import_util2 = require("@dxos/util");
|
|
168
|
-
var
|
|
169
|
-
var
|
|
170
|
-
var
|
|
160
|
+
var import_react18 = __toESM(require("react"));
|
|
161
|
+
var import_app_framework7 = require("@dxos/app-framework");
|
|
162
|
+
var import_react_ui12 = require("@dxos/react-ui");
|
|
171
163
|
var import_react_ui_data = require("@dxos/react-ui-data");
|
|
172
|
-
var
|
|
164
|
+
var import_react19 = __toESM(require("react"));
|
|
165
|
+
var import_react_client5 = require("@dxos/react-client");
|
|
166
|
+
var import_react_ui13 = require("@dxos/react-ui");
|
|
167
|
+
var import_react_ui_tabs = require("@dxos/react-ui-tabs");
|
|
168
|
+
var import_react20 = require("@dxos/shell/react");
|
|
169
|
+
var import_react21 = __toESM(require("react"));
|
|
173
170
|
var import_log3 = require("@dxos/log");
|
|
174
171
|
var import_metadata = require("@dxos/protocols/proto/dxos/echo/metadata");
|
|
175
|
-
var
|
|
172
|
+
var import_react_client6 = require("@dxos/react-client");
|
|
176
173
|
var import_halo2 = require("@dxos/react-client/halo");
|
|
177
|
-
var
|
|
178
|
-
var
|
|
174
|
+
var import_react_ui14 = require("@dxos/react-ui");
|
|
175
|
+
var import_react_ui_data2 = require("@dxos/react-ui-data");
|
|
176
|
+
var import_react22 = __toESM(require("react"));
|
|
179
177
|
var import_plugin_status_bar = require("@dxos/plugin-status-bar");
|
|
180
|
-
var
|
|
181
|
-
var
|
|
178
|
+
var import_react_client7 = require("@dxos/react-client");
|
|
179
|
+
var import_react_ui15 = require("@dxos/react-ui");
|
|
182
180
|
var import_react_ui_syntax_highlighter = require("@dxos/react-ui-syntax-highlighter");
|
|
183
|
-
var
|
|
184
|
-
var
|
|
185
|
-
var
|
|
186
|
-
var
|
|
181
|
+
var import_react_ui_theme4 = require("@dxos/react-ui-theme");
|
|
182
|
+
var import_react23 = __toESM(require("react"));
|
|
183
|
+
var import_react_ui16 = require("@dxos/react-ui");
|
|
184
|
+
var import_react_ui_theme5 = require("@dxos/react-ui-theme");
|
|
187
185
|
var import_context = require("@dxos/context");
|
|
188
|
-
var
|
|
186
|
+
var import_react24 = require("react");
|
|
189
187
|
var import_context2 = require("@dxos/context");
|
|
190
188
|
var import_protocols = require("@dxos/protocols");
|
|
191
|
-
var
|
|
189
|
+
var import_react_client8 = require("@dxos/react-client");
|
|
192
190
|
var WAIT_FOR_OBJECT_TIMEOUT = 18e4;
|
|
193
191
|
var TOAST_TIMEOUT = 24e4;
|
|
194
192
|
var AwaitingObject = ({ id }) => {
|
|
195
193
|
const [open, setOpen] = (0, import_react4.useState)(true);
|
|
196
194
|
const [waiting, setWaiting] = (0, import_react4.useState)(true);
|
|
197
195
|
const [found, setFound] = (0, import_react4.useState)(false);
|
|
198
|
-
const { t } = (0,
|
|
196
|
+
const { t } = (0, import_react_ui.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
199
197
|
const intentPlugin = (0, import_app_framework2.useResolvePlugin)(import_app_framework2.parseIntentPlugin);
|
|
200
198
|
const navigationPlugin = (0, import_app_framework2.useResolvePlugin)(import_app_framework2.parseNavigationPlugin);
|
|
201
199
|
const client = (0, import_react_client2.useClient)();
|
|
@@ -214,7 +212,7 @@ var AwaitingObject = ({ id }) => {
|
|
|
214
212
|
(0, import_react4.useEffect)(() => {
|
|
215
213
|
if (objects.findIndex((object) => (0, import_echo2.fullyQualifiedId)(object) === id) > -1) {
|
|
216
214
|
setFound(true);
|
|
217
|
-
if (navigationPlugin?.provides.location.active === id) {
|
|
215
|
+
if (navigationPlugin?.provides.location.active.solo?.[0].id === id) {
|
|
218
216
|
setOpen(false);
|
|
219
217
|
}
|
|
220
218
|
}
|
|
@@ -224,8 +222,8 @@ var AwaitingObject = ({ id }) => {
|
|
|
224
222
|
intentPlugin
|
|
225
223
|
]);
|
|
226
224
|
const handleClose = async () => intentPlugin?.provides.intent.dispatch({
|
|
227
|
-
plugin:
|
|
228
|
-
action:
|
|
225
|
+
plugin: import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
226
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.WAIT_FOR_OBJECT,
|
|
229
227
|
data: {
|
|
230
228
|
id: void 0
|
|
231
229
|
}
|
|
@@ -243,11 +241,11 @@ var AwaitingObject = ({ id }) => {
|
|
|
243
241
|
});
|
|
244
242
|
void handleClose();
|
|
245
243
|
};
|
|
246
|
-
return /* @__PURE__ */ import_react4.default.createElement(
|
|
244
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Toast.Root, {
|
|
247
245
|
open,
|
|
248
246
|
duration: TOAST_TIMEOUT,
|
|
249
247
|
onOpenChange: setOpen
|
|
250
|
-
}, /* @__PURE__ */ import_react4.default.createElement(
|
|
248
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Toast.Body, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Toast.Title, {
|
|
251
249
|
classNames: "flex items-center gap-2"
|
|
252
250
|
}, found ? /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(import_react3.CheckCircle, {
|
|
253
251
|
className: (0, import_react_ui_theme.getSize)(5)
|
|
@@ -255,28 +253,28 @@ var AwaitingObject = ({ id }) => {
|
|
|
255
253
|
className: (0, import_react_ui_theme.mx)((0, import_react_ui_theme.getSize)(5), "animate-spin")
|
|
256
254
|
}), /* @__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, {
|
|
257
255
|
className: (0, import_react_ui_theme.getSize)(5)
|
|
258
|
-
}), /* @__PURE__ */ import_react4.default.createElement("span", null, t("object not found label")))), /* @__PURE__ */ import_react4.default.createElement(
|
|
256
|
+
}), /* @__PURE__ */ import_react4.default.createElement("span", null, t("object not found label")))), /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Toast.Description, null, t(found ? "found object description" : waiting ? "waiting for object description" : "object not found description"))), /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Toast.Actions, null, found ? /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Toast.Action, {
|
|
259
257
|
altText: t("go to object alt"),
|
|
260
258
|
asChild: true
|
|
261
|
-
}, /* @__PURE__ */ import_react4.default.createElement(
|
|
259
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Button, {
|
|
262
260
|
variant: "primary",
|
|
263
261
|
onClick: handleNavigate
|
|
264
|
-
}, t("go to object label"))), /* @__PURE__ */ import_react4.default.createElement(
|
|
262
|
+
}, t("go to object label"))), /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Toast.Close, {
|
|
265
263
|
asChild: true
|
|
266
|
-
}, /* @__PURE__ */ import_react4.default.createElement(
|
|
264
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Button, {
|
|
267
265
|
onClick: handleClose
|
|
268
266
|
}, t("close label", {
|
|
269
267
|
ns: "appkit"
|
|
270
|
-
})))) : /* @__PURE__ */ import_react4.default.createElement(
|
|
268
|
+
})))) : /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Toast.Close, {
|
|
271
269
|
asChild: true
|
|
272
|
-
}, /* @__PURE__ */ import_react4.default.createElement(
|
|
270
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui.Button, {
|
|
273
271
|
onClick: handleClose
|
|
274
272
|
}, t(waiting ? "close label" : "confirm label", {
|
|
275
273
|
ns: "appkit"
|
|
276
274
|
})))));
|
|
277
275
|
};
|
|
278
276
|
var CollectionMain = ({ collection }) => {
|
|
279
|
-
const { t } = (0,
|
|
277
|
+
const { t } = (0, import_react_ui2.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
280
278
|
return /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
281
279
|
role: "none",
|
|
282
280
|
className: (0, import_react_ui_theme2.mx)(import_react_ui_theme2.baseSurface, "min-bs-screen is-full flex items-center justify-center p-8"),
|
|
@@ -287,7 +285,7 @@ var CollectionMain = ({ collection }) => {
|
|
|
287
285
|
}, collection.name ?? t("unnamed collection label")));
|
|
288
286
|
};
|
|
289
287
|
var CollectionSection = ({ collection }) => {
|
|
290
|
-
const { t } = (0,
|
|
288
|
+
const { t } = (0, import_react_ui3.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
291
289
|
return /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
292
290
|
className: "min-bs-[3.5rem] grid grid-rows-subgrid grid-cols-subgrid items-center"
|
|
293
291
|
}, /* @__PURE__ */ import_react6.default.createElement("span", {
|
|
@@ -295,11 +293,11 @@ var CollectionSection = ({ collection }) => {
|
|
|
295
293
|
}, collection.name ?? t("unnamed collection label")));
|
|
296
294
|
};
|
|
297
295
|
var DefaultObjectSettings = ({ object }) => {
|
|
298
|
-
const { t } = (0,
|
|
296
|
+
const { t } = (0, import_react_ui4.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
299
297
|
return /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
300
298
|
role: "form",
|
|
301
299
|
className: "flex flex-col w-full p-2 gap-1"
|
|
302
|
-
}, /* @__PURE__ */ import_react7.default.createElement(
|
|
300
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui4.Input.Root, null, /* @__PURE__ */ import_react7.default.createElement(import_react_ui4.Input.Label, null, t("name label")), /* @__PURE__ */ import_react7.default.createElement(import_react_ui4.Input.TextInput, {
|
|
303
301
|
placeholder: t("name placeholder"),
|
|
304
302
|
value: object.name ?? "",
|
|
305
303
|
onChange: (event) => {
|
|
@@ -307,34 +305,116 @@ var DefaultObjectSettings = ({ object }) => {
|
|
|
307
305
|
}
|
|
308
306
|
})));
|
|
309
307
|
};
|
|
308
|
+
var JoinDialog = ({ navigableCollections, ...props }) => {
|
|
309
|
+
const { t } = (0, import_react_ui5.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
310
|
+
const dispatch = (0, import_app_framework3.useIntentDispatcher)();
|
|
311
|
+
const spaces = (0, import_echo3.useSpaces)();
|
|
312
|
+
const { graph } = (0, import_plugin_graph2.useGraph)();
|
|
313
|
+
const handleDone = (0, import_react8.useCallback)(async (result) => {
|
|
314
|
+
if (result?.spaceKey) {
|
|
315
|
+
await Promise.all([
|
|
316
|
+
dispatch({
|
|
317
|
+
action: import_app_framework3.LayoutAction.SET_LAYOUT,
|
|
318
|
+
data: {
|
|
319
|
+
element: "toast",
|
|
320
|
+
subject: {
|
|
321
|
+
id: `${import_chunk_JFDDZI4Y.SPACE_PLUGIN}/join-success`,
|
|
322
|
+
duration: 5e3,
|
|
323
|
+
title: t("join success label"),
|
|
324
|
+
closeLabel: t("dismiss label")
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}),
|
|
328
|
+
dispatch({
|
|
329
|
+
action: import_app_framework3.LayoutAction.SET_LAYOUT,
|
|
330
|
+
data: {
|
|
331
|
+
element: "dialog",
|
|
332
|
+
state: false
|
|
333
|
+
}
|
|
334
|
+
})
|
|
335
|
+
]);
|
|
336
|
+
}
|
|
337
|
+
const space = spaces.find(({ key }) => result?.spaceKey?.equals(key));
|
|
338
|
+
const target = result?.target || (navigableCollections ? space?.id : void 0);
|
|
339
|
+
if (target) {
|
|
340
|
+
await graph.waitForPath({
|
|
341
|
+
target
|
|
342
|
+
}).catch(() => {
|
|
343
|
+
});
|
|
344
|
+
await Promise.all([
|
|
345
|
+
dispatch({
|
|
346
|
+
action: import_app_framework3.NavigationAction.OPEN,
|
|
347
|
+
data: {
|
|
348
|
+
activeParts: {
|
|
349
|
+
main: [
|
|
350
|
+
target
|
|
351
|
+
]
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}),
|
|
355
|
+
dispatch({
|
|
356
|
+
action: import_app_framework3.NavigationAction.EXPOSE,
|
|
357
|
+
data: {
|
|
358
|
+
id: target
|
|
359
|
+
}
|
|
360
|
+
})
|
|
361
|
+
]);
|
|
362
|
+
}
|
|
363
|
+
if (space) {
|
|
364
|
+
await dispatch({
|
|
365
|
+
action: import_meta2.ObservabilityAction.SEND_EVENT,
|
|
366
|
+
data: {
|
|
367
|
+
name: "space.join",
|
|
368
|
+
properties: {
|
|
369
|
+
spaceId: space.id
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
}, [
|
|
375
|
+
dispatch,
|
|
376
|
+
spaces
|
|
377
|
+
]);
|
|
378
|
+
return /* @__PURE__ */ import_react8.default.createElement(import_react_ui5.Dialog.Content, null, /* @__PURE__ */ import_react8.default.createElement(import_react9.JoinPanel, {
|
|
379
|
+
...props,
|
|
380
|
+
exitActionParent: /* @__PURE__ */ import_react8.default.createElement(import_react_ui5.Dialog.Close, {
|
|
381
|
+
asChild: true
|
|
382
|
+
}),
|
|
383
|
+
doneActionParent: /* @__PURE__ */ import_react8.default.createElement(import_react_ui5.Dialog.Close, {
|
|
384
|
+
asChild: true
|
|
385
|
+
}),
|
|
386
|
+
onDone: handleDone
|
|
387
|
+
}));
|
|
388
|
+
};
|
|
310
389
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/util.tsx";
|
|
311
|
-
var SPACES = `${
|
|
390
|
+
var SPACES = `${import_chunk_JFDDZI4Y.SPACE_PLUGIN}-spaces`;
|
|
312
391
|
var SPACE_TYPE = "dxos.org/type/Space";
|
|
313
392
|
var COMPOSER_SPACE_LOCK = "dxos.org/plugin/space/lock";
|
|
314
393
|
var SHARED = "shared-spaces";
|
|
315
394
|
var EMPTY_ARRAY = [];
|
|
316
395
|
var memoizeQuery = (spaceOrEcho, filter, options) => {
|
|
317
|
-
const key = (0,
|
|
318
|
-
const query = (0,
|
|
319
|
-
const unsubscribe = (0,
|
|
320
|
-
(0,
|
|
396
|
+
const key = (0, import_echo5.isSpace)(spaceOrEcho) ? spaceOrEcho.id : void 0;
|
|
397
|
+
const query = (0, import_plugin_graph3.memoize)(() => (0, import_echo5.isSpace)(spaceOrEcho) ? spaceOrEcho.db.query(filter, options) : spaceOrEcho?.query(filter, options), key);
|
|
398
|
+
const unsubscribe = (0, import_plugin_graph3.memoize)(() => query?.subscribe(), key);
|
|
399
|
+
(0, import_plugin_graph3.cleanup)(() => unsubscribe?.());
|
|
321
400
|
return query?.objects ?? EMPTY_ARRAY;
|
|
322
401
|
};
|
|
323
402
|
var getSpaceDisplayName = (space, { personal, namesCache = {} } = {}) => {
|
|
324
|
-
return space.state.get() ===
|
|
403
|
+
return space.state.get() === import_echo5.SpaceState.SPACE_READY && (space.properties.name?.length ?? 0) > 0 ? space.properties.name : namesCache[space.id] ? namesCache[space.id] : personal ? [
|
|
325
404
|
"personal space label",
|
|
326
405
|
{
|
|
327
|
-
ns:
|
|
406
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
328
407
|
}
|
|
329
408
|
] : [
|
|
330
409
|
"unnamed space label",
|
|
331
410
|
{
|
|
332
|
-
ns:
|
|
411
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
333
412
|
}
|
|
334
413
|
];
|
|
335
414
|
};
|
|
336
|
-
var getCollectionGraphNodePartials = ({ collection, space, resolve }) => {
|
|
415
|
+
var getCollectionGraphNodePartials = ({ navigable, collection, space, resolve }) => {
|
|
337
416
|
return {
|
|
417
|
+
disabled: !navigable,
|
|
338
418
|
acceptPersistenceClass: /* @__PURE__ */ new Set([
|
|
339
419
|
"echo"
|
|
340
420
|
]),
|
|
@@ -343,7 +423,7 @@ var getCollectionGraphNodePartials = ({ collection, space, resolve }) => {
|
|
|
343
423
|
]),
|
|
344
424
|
role: "branch",
|
|
345
425
|
onRearrangeChildren: (nextOrder) => {
|
|
346
|
-
collection.objects = nextOrder.filter(
|
|
426
|
+
collection.objects = nextOrder.filter(import_echo5.isEchoObject);
|
|
347
427
|
},
|
|
348
428
|
onTransferStart: (child, index) => {
|
|
349
429
|
if (!collection.objects.includes(child.data)) {
|
|
@@ -372,15 +452,16 @@ var getCollectionGraphNodePartials = ({ collection, space, resolve }) => {
|
|
|
372
452
|
};
|
|
373
453
|
};
|
|
374
454
|
var checkPendingMigration = (space) => {
|
|
375
|
-
return space.state.get() ===
|
|
455
|
+
return space.state.get() === import_echo5.SpaceState.SPACE_REQUIRES_MIGRATION || space.state.get() === import_echo5.SpaceState.SPACE_READY && !!import_migrations2.Migrations.versionProperty && space.properties[import_migrations2.Migrations.versionProperty] !== import_migrations2.Migrations.targetVersion;
|
|
376
456
|
};
|
|
377
|
-
var constructSpaceNode = ({ space, personal, namesCache, resolve }) => {
|
|
457
|
+
var constructSpaceNode = ({ space, navigable = false, personal, namesCache, resolve }) => {
|
|
378
458
|
const hasPendingMigration = checkPendingMigration(space);
|
|
379
|
-
const collection = space.state.get() ===
|
|
380
|
-
const partials = space.state.get() ===
|
|
459
|
+
const collection = space.state.get() === import_echo5.SpaceState.SPACE_READY && space.properties[import_chunk_FYWGZYJB.CollectionType.typename];
|
|
460
|
+
const partials = space.state.get() === import_echo5.SpaceState.SPACE_READY && collection instanceof import_chunk_FYWGZYJB.CollectionType ? getCollectionGraphNodePartials({
|
|
381
461
|
collection,
|
|
382
462
|
space,
|
|
383
|
-
resolve
|
|
463
|
+
resolve,
|
|
464
|
+
navigable
|
|
384
465
|
}) : {};
|
|
385
466
|
return {
|
|
386
467
|
id: space.id,
|
|
@@ -392,65 +473,65 @@ var constructSpaceNode = ({ space, personal, namesCache, resolve }) => {
|
|
|
392
473
|
personal,
|
|
393
474
|
namesCache
|
|
394
475
|
}),
|
|
395
|
-
description: space.state.get() ===
|
|
476
|
+
description: space.state.get() === import_echo5.SpaceState.SPACE_READY && space.properties.description,
|
|
396
477
|
icon: "ph--planet--regular",
|
|
397
|
-
disabled: space.state.get() !==
|
|
478
|
+
disabled: !navigable || space.state.get() !== import_echo5.SpaceState.SPACE_READY || hasPendingMigration,
|
|
398
479
|
testId: "spacePlugin.space"
|
|
399
480
|
}
|
|
400
481
|
};
|
|
401
482
|
};
|
|
402
|
-
var constructSpaceActionGroups = ({ space, dispatch }) => {
|
|
483
|
+
var constructSpaceActionGroups = ({ space, navigable, dispatch }) => {
|
|
403
484
|
const state = space.state.get();
|
|
404
485
|
const hasPendingMigration = checkPendingMigration(space);
|
|
405
486
|
const getId = (id) => `${id}/${space.id}`;
|
|
406
|
-
if (state !==
|
|
487
|
+
if (state !== import_echo5.SpaceState.SPACE_READY || hasPendingMigration) {
|
|
407
488
|
return [];
|
|
408
489
|
}
|
|
409
|
-
const collection = space.properties[
|
|
490
|
+
const collection = space.properties[import_chunk_FYWGZYJB.CollectionType.typename];
|
|
410
491
|
const actions = [
|
|
411
492
|
{
|
|
412
|
-
id: getId(
|
|
413
|
-
type:
|
|
414
|
-
data:
|
|
493
|
+
id: getId(import_chunk_JFDDZI4Y.SpaceAction.ADD_OBJECT),
|
|
494
|
+
type: import_plugin_graph3.ACTION_GROUP_TYPE,
|
|
495
|
+
data: import_plugin_graph3.actionGroupSymbol,
|
|
415
496
|
properties: {
|
|
416
497
|
label: [
|
|
417
498
|
"create object in space label",
|
|
418
499
|
{
|
|
419
|
-
ns:
|
|
500
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
420
501
|
}
|
|
421
502
|
],
|
|
422
503
|
icon: "ph--plus--regular",
|
|
423
504
|
disposition: "toolbar",
|
|
424
|
-
// TODO(wittjosiah): This is currently a navtree feature. Address this with cmd+k integration.
|
|
425
|
-
// mainAreaDisposition: 'in-flow',
|
|
426
505
|
menuType: "searchList",
|
|
427
506
|
testId: "spacePlugin.createObject"
|
|
428
507
|
},
|
|
429
508
|
nodes: [
|
|
430
509
|
{
|
|
431
|
-
id: getId(
|
|
432
|
-
type:
|
|
510
|
+
id: getId(import_chunk_JFDDZI4Y.SpaceAction.ADD_OBJECT.replace("object", "collection")),
|
|
511
|
+
type: import_plugin_graph3.ACTION_TYPE,
|
|
433
512
|
data: () => dispatch([
|
|
434
513
|
{
|
|
435
|
-
plugin:
|
|
436
|
-
action:
|
|
514
|
+
plugin: import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
515
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.ADD_OBJECT,
|
|
437
516
|
data: {
|
|
438
517
|
target: collection,
|
|
439
|
-
object: (0, import_echo_schema2.create)(
|
|
518
|
+
object: (0, import_echo_schema2.create)(import_chunk_FYWGZYJB.CollectionType, {
|
|
440
519
|
objects: [],
|
|
441
520
|
views: {}
|
|
442
521
|
})
|
|
443
522
|
}
|
|
444
523
|
},
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
524
|
+
...navigable ? [
|
|
525
|
+
{
|
|
526
|
+
action: import_app_framework4.NavigationAction.OPEN
|
|
527
|
+
}
|
|
528
|
+
] : []
|
|
448
529
|
]),
|
|
449
530
|
properties: {
|
|
450
531
|
label: [
|
|
451
532
|
"create collection label",
|
|
452
533
|
{
|
|
453
|
-
ns:
|
|
534
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
454
535
|
}
|
|
455
536
|
],
|
|
456
537
|
icon: "ph--cards-three--regular",
|
|
@@ -469,12 +550,12 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
469
550
|
const actions = [];
|
|
470
551
|
if (hasPendingMigration) {
|
|
471
552
|
actions.push({
|
|
472
|
-
id: getId(
|
|
473
|
-
type:
|
|
553
|
+
id: getId(import_chunk_JFDDZI4Y.SpaceAction.MIGRATE),
|
|
554
|
+
type: import_plugin_graph3.ACTION_GROUP_TYPE,
|
|
474
555
|
data: async () => {
|
|
475
556
|
await dispatch({
|
|
476
|
-
plugin:
|
|
477
|
-
action:
|
|
557
|
+
plugin: import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
558
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.MIGRATE,
|
|
478
559
|
data: {
|
|
479
560
|
space
|
|
480
561
|
}
|
|
@@ -484,30 +565,29 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
484
565
|
label: [
|
|
485
566
|
"migrate space label",
|
|
486
567
|
{
|
|
487
|
-
ns:
|
|
568
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
488
569
|
}
|
|
489
570
|
],
|
|
490
571
|
icon: "ph--database--regular",
|
|
491
572
|
disposition: "toolbar",
|
|
492
|
-
mainAreaDisposition: "in-flow",
|
|
493
573
|
disabled: migrating || import_migrations2.Migrations.running(space)
|
|
494
574
|
}
|
|
495
575
|
});
|
|
496
576
|
}
|
|
497
|
-
if (state ===
|
|
577
|
+
if (state === import_echo5.SpaceState.SPACE_READY && !hasPendingMigration) {
|
|
498
578
|
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
499
579
|
actions.push({
|
|
500
|
-
id: getId(
|
|
501
|
-
type:
|
|
580
|
+
id: getId(import_chunk_JFDDZI4Y.SpaceAction.SHARE),
|
|
581
|
+
type: import_plugin_graph3.ACTION_TYPE,
|
|
502
582
|
data: async () => {
|
|
503
583
|
if (locked) {
|
|
504
584
|
return;
|
|
505
585
|
}
|
|
506
586
|
await dispatch({
|
|
507
|
-
plugin:
|
|
508
|
-
action:
|
|
587
|
+
plugin: import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
588
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.SHARE,
|
|
509
589
|
data: {
|
|
510
|
-
|
|
590
|
+
space
|
|
511
591
|
}
|
|
512
592
|
});
|
|
513
593
|
},
|
|
@@ -515,7 +595,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
515
595
|
label: [
|
|
516
596
|
"share space label",
|
|
517
597
|
{
|
|
518
|
-
ns:
|
|
598
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
519
599
|
}
|
|
520
600
|
],
|
|
521
601
|
icon: "ph--users--regular",
|
|
@@ -523,16 +603,15 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
523
603
|
keyBinding: {
|
|
524
604
|
macos: "meta+.",
|
|
525
605
|
windows: "alt+."
|
|
526
|
-
}
|
|
527
|
-
mainAreaDisposition: "absent"
|
|
606
|
+
}
|
|
528
607
|
}
|
|
529
608
|
}, {
|
|
530
|
-
id: locked ? getId(
|
|
531
|
-
type:
|
|
609
|
+
id: locked ? getId(import_chunk_JFDDZI4Y.SpaceAction.UNLOCK) : getId(import_chunk_JFDDZI4Y.SpaceAction.LOCK),
|
|
610
|
+
type: import_plugin_graph3.ACTION_TYPE,
|
|
532
611
|
data: async () => {
|
|
533
612
|
await dispatch({
|
|
534
|
-
plugin:
|
|
535
|
-
action: locked ?
|
|
613
|
+
plugin: import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
614
|
+
action: locked ? import_chunk_JFDDZI4Y.SpaceAction.UNLOCK : import_chunk_JFDDZI4Y.SpaceAction.LOCK,
|
|
536
615
|
data: {
|
|
537
616
|
space
|
|
538
617
|
}
|
|
@@ -542,18 +621,18 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
542
621
|
label: [
|
|
543
622
|
locked ? "unlock space label" : "lock space label",
|
|
544
623
|
{
|
|
545
|
-
ns:
|
|
624
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
546
625
|
}
|
|
547
626
|
],
|
|
548
627
|
icon: locked ? "ph--lock-simple-open--regular" : "ph--lock-simple--regular"
|
|
549
628
|
}
|
|
550
629
|
}, {
|
|
551
|
-
id: getId(
|
|
552
|
-
type:
|
|
630
|
+
id: getId(import_chunk_JFDDZI4Y.SpaceAction.RENAME),
|
|
631
|
+
type: import_plugin_graph3.ACTION_TYPE,
|
|
553
632
|
data: async (params) => {
|
|
554
633
|
await dispatch({
|
|
555
|
-
plugin:
|
|
556
|
-
action:
|
|
634
|
+
plugin: import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
635
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.RENAME,
|
|
557
636
|
data: {
|
|
558
637
|
space,
|
|
559
638
|
...params
|
|
@@ -564,26 +643,46 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
564
643
|
label: [
|
|
565
644
|
"rename space label",
|
|
566
645
|
{
|
|
567
|
-
ns:
|
|
646
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
568
647
|
}
|
|
569
648
|
],
|
|
570
649
|
icon: "ph--pencil-simple-line--regular",
|
|
571
650
|
keyBinding: {
|
|
572
651
|
macos: "shift+F6",
|
|
573
652
|
windows: "shift+F6"
|
|
574
|
-
}
|
|
575
|
-
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}, {
|
|
656
|
+
id: getId(import_chunk_JFDDZI4Y.SpaceAction.OPEN_SETTINGS),
|
|
657
|
+
type: import_plugin_graph3.ACTION_TYPE,
|
|
658
|
+
data: async () => {
|
|
659
|
+
await dispatch({
|
|
660
|
+
plugin: import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
661
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.OPEN_SETTINGS,
|
|
662
|
+
data: {
|
|
663
|
+
space
|
|
664
|
+
}
|
|
665
|
+
});
|
|
666
|
+
},
|
|
667
|
+
properties: {
|
|
668
|
+
label: [
|
|
669
|
+
"open space settings label",
|
|
670
|
+
{
|
|
671
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
672
|
+
}
|
|
673
|
+
],
|
|
674
|
+
icon: "ph--gear--regular"
|
|
576
675
|
}
|
|
577
676
|
});
|
|
578
677
|
}
|
|
579
|
-
if (state !==
|
|
678
|
+
if (state !== import_echo5.SpaceState.SPACE_INACTIVE && !hasPendingMigration) {
|
|
580
679
|
actions.push({
|
|
581
|
-
id: getId(
|
|
582
|
-
type:
|
|
680
|
+
id: getId(import_chunk_JFDDZI4Y.SpaceAction.CLOSE),
|
|
681
|
+
type: import_plugin_graph3.ACTION_TYPE,
|
|
583
682
|
data: async () => {
|
|
584
683
|
await dispatch({
|
|
585
|
-
plugin:
|
|
586
|
-
action:
|
|
684
|
+
plugin: import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
685
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.CLOSE,
|
|
587
686
|
data: {
|
|
588
687
|
space
|
|
589
688
|
}
|
|
@@ -593,23 +692,22 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
593
692
|
label: [
|
|
594
693
|
"close space label",
|
|
595
694
|
{
|
|
596
|
-
ns:
|
|
695
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
597
696
|
}
|
|
598
697
|
],
|
|
599
698
|
icon: "ph--x--regular",
|
|
600
|
-
mainAreaDisposition: "menu",
|
|
601
699
|
disabled: personal
|
|
602
700
|
}
|
|
603
701
|
});
|
|
604
702
|
}
|
|
605
|
-
if (state ===
|
|
703
|
+
if (state === import_echo5.SpaceState.SPACE_INACTIVE) {
|
|
606
704
|
actions.push({
|
|
607
|
-
id: getId(
|
|
608
|
-
type:
|
|
705
|
+
id: getId(import_chunk_JFDDZI4Y.SpaceAction.OPEN),
|
|
706
|
+
type: import_plugin_graph3.ACTION_TYPE,
|
|
609
707
|
data: async () => {
|
|
610
708
|
await dispatch({
|
|
611
|
-
plugin:
|
|
612
|
-
action:
|
|
709
|
+
plugin: import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
710
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.OPEN,
|
|
613
711
|
data: {
|
|
614
712
|
space
|
|
615
713
|
}
|
|
@@ -619,18 +717,17 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
619
717
|
label: [
|
|
620
718
|
"open space label",
|
|
621
719
|
{
|
|
622
|
-
ns:
|
|
720
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
623
721
|
}
|
|
624
722
|
],
|
|
625
723
|
icon: "ph--clock-counter-clockwise--regular",
|
|
626
|
-
disposition: "toolbar"
|
|
627
|
-
mainAreaDisposition: "in-flow"
|
|
724
|
+
disposition: "toolbar"
|
|
628
725
|
}
|
|
629
726
|
});
|
|
630
727
|
}
|
|
631
728
|
return actions;
|
|
632
729
|
};
|
|
633
|
-
var createObjectNode = ({ object, space, resolve }) => {
|
|
730
|
+
var createObjectNode = ({ object, space, navigable = false, resolve }) => {
|
|
634
731
|
const type = (0, import_echo_schema2.getTypename)(object);
|
|
635
732
|
if (!type) {
|
|
636
733
|
return void 0;
|
|
@@ -639,13 +736,14 @@ var createObjectNode = ({ object, space, resolve }) => {
|
|
|
639
736
|
if (Object.keys(metadata).length === 0) {
|
|
640
737
|
return void 0;
|
|
641
738
|
}
|
|
642
|
-
const partials = object instanceof
|
|
739
|
+
const partials = object instanceof import_chunk_FYWGZYJB.CollectionType ? getCollectionGraphNodePartials({
|
|
643
740
|
collection: object,
|
|
644
741
|
space,
|
|
645
|
-
resolve
|
|
742
|
+
resolve,
|
|
743
|
+
navigable
|
|
646
744
|
}) : metadata.graphProps;
|
|
647
745
|
return {
|
|
648
|
-
id: (0,
|
|
746
|
+
id: (0, import_echo5.fullyQualifiedId)(object),
|
|
649
747
|
type,
|
|
650
748
|
data: object,
|
|
651
749
|
properties: {
|
|
@@ -653,7 +751,7 @@ var createObjectNode = ({ object, space, resolve }) => {
|
|
|
653
751
|
label: metadata.label?.(object) || object.name || metadata.placeholder || [
|
|
654
752
|
"unnamed object label",
|
|
655
753
|
{
|
|
656
|
-
ns:
|
|
754
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
657
755
|
}
|
|
658
756
|
],
|
|
659
757
|
icon: metadata.icon ?? "ph--placeholder--regular",
|
|
@@ -663,56 +761,56 @@ var createObjectNode = ({ object, space, resolve }) => {
|
|
|
663
761
|
}
|
|
664
762
|
};
|
|
665
763
|
};
|
|
666
|
-
var constructObjectActionGroups = ({ object, dispatch }) => {
|
|
667
|
-
if (!(object instanceof
|
|
764
|
+
var constructObjectActionGroups = ({ object, navigable, dispatch }) => {
|
|
765
|
+
if (!(object instanceof import_chunk_FYWGZYJB.CollectionType)) {
|
|
668
766
|
return [];
|
|
669
767
|
}
|
|
670
768
|
const collection = object;
|
|
671
|
-
const getId = (id) => `${id}/${(0,
|
|
769
|
+
const getId = (id) => `${id}/${(0, import_echo5.fullyQualifiedId)(object)}`;
|
|
672
770
|
const actions = [
|
|
673
771
|
{
|
|
674
|
-
id: getId(
|
|
675
|
-
type:
|
|
676
|
-
data:
|
|
772
|
+
id: getId(import_chunk_JFDDZI4Y.SpaceAction.ADD_OBJECT),
|
|
773
|
+
type: import_plugin_graph3.ACTION_GROUP_TYPE,
|
|
774
|
+
data: import_plugin_graph3.actionGroupSymbol,
|
|
677
775
|
properties: {
|
|
678
776
|
label: [
|
|
679
777
|
"create object in collection label",
|
|
680
778
|
{
|
|
681
|
-
ns:
|
|
779
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
682
780
|
}
|
|
683
781
|
],
|
|
684
782
|
icon: "ph--plus--regular",
|
|
685
783
|
disposition: "toolbar",
|
|
686
|
-
// TODO(wittjosiah): This is currently a navtree feature. Address this with cmd+k integration.
|
|
687
|
-
// mainAreaDisposition: 'in-flow',
|
|
688
784
|
menuType: "searchList",
|
|
689
785
|
testId: "spacePlugin.createObject"
|
|
690
786
|
},
|
|
691
787
|
nodes: [
|
|
692
788
|
{
|
|
693
|
-
id: getId(
|
|
694
|
-
type:
|
|
789
|
+
id: getId(import_chunk_JFDDZI4Y.SpaceAction.ADD_OBJECT.replace("object", "collection")),
|
|
790
|
+
type: import_plugin_graph3.ACTION_TYPE,
|
|
695
791
|
data: () => dispatch([
|
|
696
792
|
{
|
|
697
|
-
plugin:
|
|
698
|
-
action:
|
|
793
|
+
plugin: import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
794
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.ADD_OBJECT,
|
|
699
795
|
data: {
|
|
700
796
|
target: collection,
|
|
701
|
-
object: (0, import_echo_schema2.create)(
|
|
797
|
+
object: (0, import_echo_schema2.create)(import_chunk_FYWGZYJB.CollectionType, {
|
|
702
798
|
objects: [],
|
|
703
799
|
views: {}
|
|
704
800
|
})
|
|
705
801
|
}
|
|
706
802
|
},
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
803
|
+
...navigable ? [
|
|
804
|
+
{
|
|
805
|
+
action: import_app_framework4.NavigationAction.OPEN
|
|
806
|
+
}
|
|
807
|
+
] : []
|
|
710
808
|
]),
|
|
711
809
|
properties: {
|
|
712
810
|
label: [
|
|
713
811
|
"create collection label",
|
|
714
812
|
{
|
|
715
|
-
ns:
|
|
813
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
716
814
|
}
|
|
717
815
|
],
|
|
718
816
|
icon: "ph--cards-three--regular",
|
|
@@ -726,14 +824,14 @@ var constructObjectActionGroups = ({ object, dispatch }) => {
|
|
|
726
824
|
};
|
|
727
825
|
var constructObjectActions = ({ node, dispatch }) => {
|
|
728
826
|
const object = node.data;
|
|
729
|
-
const getId = (id) => `${id}/${(0,
|
|
827
|
+
const getId = (id) => `${id}/${(0, import_echo5.fullyQualifiedId)(object)}`;
|
|
730
828
|
const actions = [
|
|
731
829
|
{
|
|
732
|
-
id: getId(
|
|
733
|
-
type:
|
|
830
|
+
id: getId(import_chunk_JFDDZI4Y.SpaceAction.RENAME_OBJECT),
|
|
831
|
+
type: import_plugin_graph3.ACTION_TYPE,
|
|
734
832
|
data: async (params) => {
|
|
735
833
|
await dispatch({
|
|
736
|
-
action:
|
|
834
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.RENAME_OBJECT,
|
|
737
835
|
data: {
|
|
738
836
|
object,
|
|
739
837
|
...params
|
|
@@ -742,9 +840,9 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
742
840
|
},
|
|
743
841
|
properties: {
|
|
744
842
|
label: [
|
|
745
|
-
object instanceof
|
|
843
|
+
object instanceof import_chunk_FYWGZYJB.CollectionType ? "rename collection label" : "rename object label",
|
|
746
844
|
{
|
|
747
|
-
ns:
|
|
845
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
748
846
|
}
|
|
749
847
|
],
|
|
750
848
|
icon: "ph--pencil-simple-line--regular",
|
|
@@ -754,18 +852,20 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
754
852
|
}
|
|
755
853
|
},
|
|
756
854
|
{
|
|
757
|
-
id: getId(
|
|
758
|
-
type:
|
|
855
|
+
id: getId(import_chunk_JFDDZI4Y.SpaceAction.REMOVE_OBJECTS),
|
|
856
|
+
type: import_plugin_graph3.ACTION_TYPE,
|
|
759
857
|
data: async () => {
|
|
760
|
-
const graph = (0,
|
|
858
|
+
const graph = (0, import_plugin_graph3.getGraph)(node);
|
|
761
859
|
const collection = graph.nodes(node, {
|
|
762
860
|
relation: "inbound"
|
|
763
|
-
}).find(({ data }) => data instanceof
|
|
861
|
+
}).find(({ data }) => data instanceof import_chunk_FYWGZYJB.CollectionType)?.data;
|
|
764
862
|
await dispatch([
|
|
765
863
|
{
|
|
766
|
-
action:
|
|
864
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.REMOVE_OBJECTS,
|
|
767
865
|
data: {
|
|
768
|
-
|
|
866
|
+
objects: [
|
|
867
|
+
object
|
|
868
|
+
],
|
|
769
869
|
collection
|
|
770
870
|
}
|
|
771
871
|
}
|
|
@@ -773,28 +873,28 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
773
873
|
},
|
|
774
874
|
properties: {
|
|
775
875
|
label: [
|
|
776
|
-
object instanceof
|
|
876
|
+
object instanceof import_chunk_FYWGZYJB.CollectionType ? "delete collection label" : "delete object label",
|
|
777
877
|
{
|
|
778
|
-
ns:
|
|
878
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
779
879
|
}
|
|
780
880
|
],
|
|
781
881
|
icon: "ph--trash--regular",
|
|
782
|
-
keyBinding: object instanceof
|
|
882
|
+
keyBinding: object instanceof import_chunk_FYWGZYJB.CollectionType ? void 0 : "shift+meta+Backspace",
|
|
783
883
|
testId: "spacePlugin.deleteObject"
|
|
784
884
|
}
|
|
785
885
|
},
|
|
786
886
|
{
|
|
787
887
|
id: getId("copy-link"),
|
|
788
|
-
type:
|
|
888
|
+
type: import_plugin_graph3.ACTION_TYPE,
|
|
789
889
|
data: async () => {
|
|
790
|
-
const url = `${window.location.origin}/${(0,
|
|
890
|
+
const url = `${window.location.origin}/${(0, import_echo5.fullyQualifiedId)(object)}`;
|
|
791
891
|
await navigator.clipboard.writeText(url);
|
|
792
892
|
},
|
|
793
893
|
properties: {
|
|
794
894
|
label: [
|
|
795
895
|
"copy link label",
|
|
796
896
|
{
|
|
797
|
-
ns:
|
|
897
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
798
898
|
}
|
|
799
899
|
],
|
|
800
900
|
icon: "ph--link--regular",
|
|
@@ -812,7 +912,7 @@ var getActiveSpace = (graph, active) => {
|
|
|
812
912
|
if (!node || !(0, import_echo_schema2.isReactiveObject)(node.data)) {
|
|
813
913
|
return;
|
|
814
914
|
}
|
|
815
|
-
return (0,
|
|
915
|
+
return (0, import_echo5.getSpace)(node.data);
|
|
816
916
|
};
|
|
817
917
|
var getNestedObjects = async (object, resolve) => {
|
|
818
918
|
const type = (0, import_echo_schema2.getTypename)(object);
|
|
@@ -836,9 +936,9 @@ var cloneObject = async (object, resolve, newSpace) => {
|
|
|
836
936
|
const typename = schema ? (0, import_echo_schema2.getObjectAnnotation)(schema)?.typename ?? import_echo_schema2.EXPANDO_TYPENAME : import_echo_schema2.EXPANDO_TYPENAME;
|
|
837
937
|
const metadata = resolve(typename);
|
|
838
938
|
const serializer = metadata.serializer;
|
|
839
|
-
(0,
|
|
939
|
+
(0, import_invariant2.invariant)(serializer, `No serializer for type: ${typename}`, {
|
|
840
940
|
F: __dxlog_file,
|
|
841
|
-
L:
|
|
941
|
+
L: 632,
|
|
842
942
|
S: void 0,
|
|
843
943
|
A: [
|
|
844
944
|
"serializer",
|
|
@@ -855,19 +955,19 @@ var cloneObject = async (object, resolve, newSpace) => {
|
|
|
855
955
|
});
|
|
856
956
|
};
|
|
857
957
|
var MenuFooter = ({ object }) => {
|
|
858
|
-
const { t } = (0, import_react_ui6.useTranslation)(
|
|
958
|
+
const { t } = (0, import_react_ui6.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
859
959
|
const client = (0, import_react_client3.useClient)();
|
|
860
|
-
const space = (0,
|
|
960
|
+
const space = (0, import_echo4.getSpace)(object);
|
|
861
961
|
const spaceName = space ? getSpaceDisplayName(space, {
|
|
862
962
|
personal: client.spaces.default === space
|
|
863
963
|
}) : "";
|
|
864
|
-
return space ? /* @__PURE__ */
|
|
964
|
+
return space ? /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement(import_react_ui6.DropdownMenu.Separator, null), /* @__PURE__ */ import_react11.default.createElement(import_react_ui6.DropdownMenu.GroupLabel, null, t("menu footer label")), /* @__PURE__ */ import_react11.default.createElement("dl", {
|
|
865
965
|
className: "pis-2 mbe-2 text-xs grid grid-cols-[max-content_1fr] gap-2"
|
|
866
|
-
}, /* @__PURE__ */
|
|
966
|
+
}, /* @__PURE__ */ import_react11.default.createElement("dt", {
|
|
867
967
|
className: "uppercase text-[.75em] tracking-wide font-medium mbs-px self-start"
|
|
868
|
-
}, t("location label")), /* @__PURE__ */
|
|
968
|
+
}, t("location label")), /* @__PURE__ */ import_react11.default.createElement("dd", {
|
|
869
969
|
className: "line-clamp-3"
|
|
870
|
-
}, /* @__PURE__ */
|
|
970
|
+
}, /* @__PURE__ */ import_react11.default.createElement(import_react10.Planet, {
|
|
871
971
|
className: "inline-block mie-1"
|
|
872
972
|
}), (0, import_react_ui6.toLocalizedString)(spaceName, t)))) : null;
|
|
873
973
|
};
|
|
@@ -878,12 +978,12 @@ var Status;
|
|
|
878
978
|
Status2[Status2["ERROR"] = 2] = "ERROR";
|
|
879
979
|
})(Status || (Status = {}));
|
|
880
980
|
var PersistenceStatus = ({ db }) => {
|
|
881
|
-
const { t } = (0, import_react_ui7.useTranslation)(
|
|
882
|
-
const [displayMessage, setDisplayMessage] = (0,
|
|
883
|
-
const [status, naturalSetStatus] = (0,
|
|
884
|
-
const [prevStatus, setPrevStatus] = (0,
|
|
981
|
+
const { t } = (0, import_react_ui7.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
982
|
+
const [displayMessage, setDisplayMessage] = (0, import_react13.useState)(false);
|
|
983
|
+
const [status, naturalSetStatus] = (0, import_react13.useState)(0);
|
|
984
|
+
const [prevStatus, setPrevStatus] = (0, import_react13.useState)(0);
|
|
885
985
|
const _setStatus = (0, import_async2.debounce)(naturalSetStatus, 500);
|
|
886
|
-
(0,
|
|
986
|
+
(0, import_react13.useEffect)(() => {
|
|
887
987
|
setPrevStatus(status);
|
|
888
988
|
if (prevStatus !== status && status === 0) {
|
|
889
989
|
setDisplayMessage(true);
|
|
@@ -895,44 +995,44 @@ var PersistenceStatus = ({ db }) => {
|
|
|
895
995
|
]);
|
|
896
996
|
switch (status) {
|
|
897
997
|
case 2:
|
|
898
|
-
return /* @__PURE__ */
|
|
998
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", {
|
|
899
999
|
className: "flex items-center"
|
|
900
|
-
}, /* @__PURE__ */
|
|
1000
|
+
}, /* @__PURE__ */ import_react13.default.createElement(import_react12.Warning, {
|
|
901
1001
|
className: (0, import_react_ui_theme3.mx)((0, import_react_ui_theme3.getSize)(4), "me-1")
|
|
902
|
-
}), /* @__PURE__ */
|
|
1002
|
+
}), /* @__PURE__ */ import_react13.default.createElement("span", {
|
|
903
1003
|
className: (0, import_react_ui_theme3.mx)("text-sm", import_react_ui_theme3.warningText)
|
|
904
1004
|
}, t("persistence error label")));
|
|
905
1005
|
case 1:
|
|
906
|
-
return /* @__PURE__ */
|
|
1006
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", {
|
|
907
1007
|
className: "flex items-center"
|
|
908
|
-
}, /* @__PURE__ */
|
|
1008
|
+
}, /* @__PURE__ */ import_react13.default.createElement(import_react12.ArrowsCounterClockwise, {
|
|
909
1009
|
className: (0, import_react_ui_theme3.mx)((0, import_react_ui_theme3.getSize)(4), "me-1")
|
|
910
|
-
}), /* @__PURE__ */
|
|
1010
|
+
}), /* @__PURE__ */ import_react13.default.createElement("span", {
|
|
911
1011
|
className: (0, import_react_ui_theme3.mx)("text-sm", import_react_ui_theme3.staticPlaceholderText)
|
|
912
1012
|
}, t("persistence pending label")));
|
|
913
1013
|
case 0:
|
|
914
1014
|
default:
|
|
915
|
-
return /* @__PURE__ */
|
|
1015
|
+
return /* @__PURE__ */ import_react13.default.createElement(import_react_ui7.Tooltip.Root, {
|
|
916
1016
|
delayDuration: 400
|
|
917
|
-
}, /* @__PURE__ */
|
|
1017
|
+
}, /* @__PURE__ */ import_react13.default.createElement(import_react_ui7.Tooltip.Trigger, {
|
|
918
1018
|
role: "status",
|
|
919
1019
|
className: "flex items-center"
|
|
920
|
-
}, /* @__PURE__ */
|
|
1020
|
+
}, /* @__PURE__ */ import_react13.default.createElement(import_react12.CheckCircle, {
|
|
921
1021
|
className: (0, import_react_ui_theme3.mx)((0, import_react_ui_theme3.getSize)(4), "me-1")
|
|
922
|
-
}), displayMessage && /* @__PURE__ */
|
|
1022
|
+
}), displayMessage && /* @__PURE__ */ import_react13.default.createElement("span", {
|
|
923
1023
|
className: (0, import_react_ui_theme3.mx)("text-sm", import_react_ui_theme3.staticPlaceholderText)
|
|
924
|
-
}, t("persisted locally label"))), /* @__PURE__ */
|
|
1024
|
+
}, t("persisted locally label"))), /* @__PURE__ */ import_react13.default.createElement(import_react_ui7.Tooltip.Portal, null, /* @__PURE__ */ import_react13.default.createElement(import_react_ui7.Tooltip.Content, {
|
|
925
1025
|
classNames: "z-10"
|
|
926
|
-
}, t("persisted locally message"), /* @__PURE__ */
|
|
1026
|
+
}, t("persisted locally message"), /* @__PURE__ */ import_react13.default.createElement(import_react_ui7.Tooltip.Arrow, null))));
|
|
927
1027
|
}
|
|
928
1028
|
};
|
|
929
1029
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
|
|
930
1030
|
var PopoverRenameObject = ({ object: obj }) => {
|
|
931
|
-
const { t } = (0, import_react_ui8.useTranslation)(
|
|
932
|
-
const doneButton = (0,
|
|
1031
|
+
const { t } = (0, import_react_ui8.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
1032
|
+
const doneButton = (0, import_react14.useRef)(null);
|
|
933
1033
|
const object = obj;
|
|
934
|
-
const [name, setName] = (0,
|
|
935
|
-
const handleDone = (0,
|
|
1034
|
+
const [name, setName] = (0, import_react14.useState)(object.name || object.title || "");
|
|
1035
|
+
const handleDone = (0, import_react14.useCallback)(() => {
|
|
936
1036
|
try {
|
|
937
1037
|
object.name = name;
|
|
938
1038
|
} catch {
|
|
@@ -953,23 +1053,23 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
953
1053
|
object,
|
|
954
1054
|
name
|
|
955
1055
|
]);
|
|
956
|
-
return /* @__PURE__ */
|
|
1056
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", {
|
|
957
1057
|
role: "none",
|
|
958
1058
|
className: "p-1 flex gap-2"
|
|
959
|
-
}, /* @__PURE__ */
|
|
1059
|
+
}, /* @__PURE__ */ import_react14.default.createElement("div", {
|
|
960
1060
|
role: "none",
|
|
961
1061
|
className: "flex-1"
|
|
962
|
-
}, /* @__PURE__ */
|
|
1062
|
+
}, /* @__PURE__ */ import_react14.default.createElement(import_react_ui8.Input.Root, null, /* @__PURE__ */ import_react14.default.createElement(import_react_ui8.Input.Label, {
|
|
963
1063
|
srOnly: true
|
|
964
|
-
}, t("object name label")), /* @__PURE__ */
|
|
1064
|
+
}, t("object name label")), /* @__PURE__ */ import_react14.default.createElement(import_react_ui8.Input.TextInput, {
|
|
965
1065
|
placeholder: t("object title placeholder"),
|
|
966
1066
|
value: name,
|
|
967
1067
|
"data-testid": "spacePlugin.renameObject.input",
|
|
968
1068
|
onChange: ({ target: { value } }) => setName(value),
|
|
969
1069
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
970
|
-
}))), /* @__PURE__ */
|
|
1070
|
+
}))), /* @__PURE__ */ import_react14.default.createElement(import_react_ui8.Popover.Close, {
|
|
971
1071
|
asChild: true
|
|
972
|
-
}, /* @__PURE__ */
|
|
1072
|
+
}, /* @__PURE__ */ import_react14.default.createElement(import_react_ui8.Button, {
|
|
973
1073
|
ref: doneButton,
|
|
974
1074
|
classNames: "self-stretch",
|
|
975
1075
|
onClick: handleDone
|
|
@@ -978,33 +1078,33 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
978
1078
|
}))));
|
|
979
1079
|
};
|
|
980
1080
|
var PopoverRenameSpace = ({ space }) => {
|
|
981
|
-
const { t } = (0, import_react_ui9.useTranslation)(
|
|
982
|
-
const doneButton = (0,
|
|
983
|
-
const [name, setName] = (0,
|
|
984
|
-
const handleDone = (0,
|
|
1081
|
+
const { t } = (0, import_react_ui9.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
1082
|
+
const doneButton = (0, import_react15.useRef)(null);
|
|
1083
|
+
const [name, setName] = (0, import_react15.useState)(space.properties.name ?? "");
|
|
1084
|
+
const handleDone = (0, import_react15.useCallback)(() => {
|
|
985
1085
|
space.properties.name = name;
|
|
986
1086
|
}, [
|
|
987
1087
|
space,
|
|
988
1088
|
name
|
|
989
1089
|
]);
|
|
990
|
-
return /* @__PURE__ */
|
|
1090
|
+
return /* @__PURE__ */ import_react15.default.createElement("div", {
|
|
991
1091
|
role: "none",
|
|
992
1092
|
className: "p-1 flex gap-2"
|
|
993
|
-
}, /* @__PURE__ */
|
|
1093
|
+
}, /* @__PURE__ */ import_react15.default.createElement("div", {
|
|
994
1094
|
role: "none",
|
|
995
1095
|
className: "flex-1"
|
|
996
|
-
}, /* @__PURE__ */
|
|
1096
|
+
}, /* @__PURE__ */ import_react15.default.createElement(import_react_ui9.Input.Root, null, /* @__PURE__ */ import_react15.default.createElement(import_react_ui9.Input.Label, {
|
|
997
1097
|
srOnly: true
|
|
998
|
-
}, t("space name label")), /* @__PURE__ */
|
|
1098
|
+
}, t("space name label")), /* @__PURE__ */ import_react15.default.createElement(import_react_ui9.Input.TextInput, {
|
|
999
1099
|
defaultValue: space.properties.name ?? "",
|
|
1000
1100
|
placeholder: t("unnamed space label"),
|
|
1001
1101
|
onChange: ({ target: { value } }) => setName(value),
|
|
1002
1102
|
// TODO(wittjosiah): Ideally this should access the popover context to close the popover.
|
|
1003
1103
|
// Currently this is not possible because Radix does not expose the popover context.
|
|
1004
1104
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1005
|
-
}))), /* @__PURE__ */
|
|
1105
|
+
}))), /* @__PURE__ */ import_react15.default.createElement(import_react_ui9.Popover.Close, {
|
|
1006
1106
|
asChild: true
|
|
1007
|
-
}, /* @__PURE__ */
|
|
1107
|
+
}, /* @__PURE__ */ import_react15.default.createElement(import_react_ui9.Button, {
|
|
1008
1108
|
ref: doneButton,
|
|
1009
1109
|
classNames: "self-stretch",
|
|
1010
1110
|
onClick: handleDone
|
|
@@ -1012,261 +1112,50 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
1012
1112
|
ns: "os"
|
|
1013
1113
|
}))));
|
|
1014
1114
|
};
|
|
1015
|
-
var ShareSpaceButton = ({
|
|
1016
|
-
const dispatch = (0,
|
|
1017
|
-
return /* @__PURE__ */
|
|
1115
|
+
var ShareSpaceButton = ({ space }) => {
|
|
1116
|
+
const dispatch = (0, import_app_framework5.useIntentDispatcher)();
|
|
1117
|
+
return /* @__PURE__ */ import_react16.default.createElement(ShareSpaceButtonImpl, {
|
|
1018
1118
|
onClick: () => dispatch({
|
|
1019
|
-
action:
|
|
1119
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.SHARE,
|
|
1020
1120
|
data: {
|
|
1021
|
-
|
|
1121
|
+
space
|
|
1022
1122
|
}
|
|
1023
1123
|
})
|
|
1024
1124
|
});
|
|
1025
1125
|
};
|
|
1026
1126
|
var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
1027
|
-
const { t } = (0, import_react_ui10.useTranslation)(
|
|
1028
|
-
return /* @__PURE__ */
|
|
1127
|
+
const { t } = (0, import_react_ui10.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
1128
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react_ui10.IconButton, {
|
|
1029
1129
|
"data-testid": "spacePlugin.shareSpaceButton",
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
};
|
|
1034
|
-
var activeActionKeyStorageKey = "dxos:react-shell/space-manager/active-action";
|
|
1035
|
-
var Presence = import_echo6.SpaceMember.PresenceState;
|
|
1036
|
-
var handleCreateInvitationUrl = (invitationCode) => `${origin}?spaceInvitationCode=${invitationCode}`;
|
|
1037
|
-
var SpaceMemberList = ({ members }) => {
|
|
1038
|
-
return members.length > 0 ? /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.List, {
|
|
1039
|
-
classNames: "col-start-2 col-end-5 gap-y-1 grid grid-cols-subgrid items-center"
|
|
1040
|
-
}, members.map((member) => /* @__PURE__ */ import_react19.default.createElement(import_react20.IdentityListItem, {
|
|
1041
|
-
classNames: "contents",
|
|
1042
|
-
key: member.identity.identityKey.toHex(),
|
|
1043
|
-
identity: member.identity,
|
|
1044
|
-
presence: member.presence
|
|
1045
|
-
}))) : null;
|
|
1046
|
-
};
|
|
1047
|
-
var SpaceMembersSection = ({ space }) => {
|
|
1048
|
-
const { t } = (0, import_react_ui12.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1049
|
-
const invitations = (0, import_echo6.useSpaceInvitations)(space.key);
|
|
1050
|
-
const { dispatch } = (0, import_app_framework6.useIntent)();
|
|
1051
|
-
const handleCloseDialog = () => dispatch({
|
|
1052
|
-
action: import_app_framework6.LayoutAction.SET_LAYOUT,
|
|
1053
|
-
data: {
|
|
1054
|
-
element: "dialog",
|
|
1055
|
-
state: false
|
|
1056
|
-
}
|
|
1057
|
-
});
|
|
1058
|
-
const handleInvitationSelect = ({ invitation: invitationObservable }) => {
|
|
1059
|
-
const invitation = invitationObservable.get();
|
|
1060
|
-
void dispatch({
|
|
1061
|
-
action: import_app_framework6.LayoutAction.SET_LAYOUT,
|
|
1062
|
-
data: {
|
|
1063
|
-
element: "dialog",
|
|
1064
|
-
component: "dxos.org/plugin/space/InvitationManagerDialog",
|
|
1065
|
-
subject: {
|
|
1066
|
-
invitationUrl: handleCreateInvitationUrl(import_invitations.InvitationEncoder.encode(invitation)),
|
|
1067
|
-
send: handleCloseDialog,
|
|
1068
|
-
status: invitation.state,
|
|
1069
|
-
type: invitation.type,
|
|
1070
|
-
authCode: invitation.authCode,
|
|
1071
|
-
id: invitation.invitationId
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
});
|
|
1075
|
-
};
|
|
1076
|
-
const inviteActions = {
|
|
1077
|
-
inviteOne: {
|
|
1078
|
-
label: t("invite one label", {
|
|
1079
|
-
ns: "os"
|
|
1080
|
-
}),
|
|
1081
|
-
description: t("invite one description", {
|
|
1082
|
-
ns: "os"
|
|
1083
|
-
}),
|
|
1084
|
-
icon: import_react18.UserPlus,
|
|
1085
|
-
onClick: (0, import_react19.useCallback)(() => {
|
|
1086
|
-
space.share?.({
|
|
1087
|
-
type: import_invitations2.Invitation.Type.INTERACTIVE,
|
|
1088
|
-
authMethod: import_invitations2.Invitation.AuthMethod.SHARED_SECRET
|
|
1089
|
-
});
|
|
1090
|
-
}, [
|
|
1091
|
-
space
|
|
1092
|
-
])
|
|
1093
|
-
},
|
|
1094
|
-
inviteMany: {
|
|
1095
|
-
label: t("invite many label", {
|
|
1096
|
-
ns: "os"
|
|
1097
|
-
}),
|
|
1098
|
-
description: t("invite many description", {
|
|
1099
|
-
ns: "os"
|
|
1100
|
-
}),
|
|
1101
|
-
icon: import_react18.UsersThree,
|
|
1102
|
-
onClick: (0, import_react19.useCallback)(() => {
|
|
1103
|
-
space.share?.({
|
|
1104
|
-
type: import_invitations2.Invitation.Type.INTERACTIVE,
|
|
1105
|
-
authMethod: import_invitations2.Invitation.AuthMethod.NONE,
|
|
1106
|
-
multiUse: true
|
|
1107
|
-
});
|
|
1108
|
-
}, [
|
|
1109
|
-
space
|
|
1110
|
-
])
|
|
1111
|
-
}
|
|
1112
|
-
};
|
|
1113
|
-
const [activeActionKey, setInternalActiveActionKey] = (0, import_react19.useState)(localStorage.getItem(activeActionKeyStorageKey) ?? "inviteOne");
|
|
1114
|
-
const setActiveActionKey = (nextKey) => {
|
|
1115
|
-
setInternalActiveActionKey(nextKey);
|
|
1116
|
-
localStorage.setItem(activeActionKeyStorageKey, nextKey);
|
|
1117
|
-
};
|
|
1118
|
-
const activeAction = inviteActions[activeActionKey] ?? {};
|
|
1119
|
-
const members = (0, import_echo6.useMembers)(space.key).reduce((acc, member) => {
|
|
1120
|
-
acc[member.presence].push(member);
|
|
1121
|
-
return acc;
|
|
1122
|
-
}, {
|
|
1123
|
-
[Presence.ONLINE]: [],
|
|
1124
|
-
[Presence.OFFLINE]: []
|
|
1130
|
+
icon: "ph--users--regular",
|
|
1131
|
+
label: t("share space label"),
|
|
1132
|
+
onClick
|
|
1125
1133
|
});
|
|
1126
|
-
return /* @__PURE__ */ import_react19.default.createElement("section", {
|
|
1127
|
-
className: "mbe-4 col-span-3 grid gap-y-2 grid-cols-subgrid auto-rows-min"
|
|
1128
|
-
}, /* @__PURE__ */ import_react19.default.createElement("h2", {
|
|
1129
|
-
className: "contents"
|
|
1130
|
-
}, /* @__PURE__ */ import_react19.default.createElement(import_react18.UsersThree, {
|
|
1131
|
-
weight: "duotone",
|
|
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", {
|
|
1134
|
-
className: "text-lg col-span-2"
|
|
1135
|
-
}, t("space members label"))), /* @__PURE__ */ import_react19.default.createElement("h3", {
|
|
1136
|
-
className: "col-start-2 col-span-3 text-sm italic text-description"
|
|
1137
|
-
}, t("invitations heading")), invitations.length > 0 && /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.List, {
|
|
1138
|
-
classNames: "col-start-2 col-span-2 gap-y-2 grid grid-cols-[var(--rail-size)_1fr_var(--rail-action)_var(--rail-action)]"
|
|
1139
|
-
}, invitations.map((invitation) => /* @__PURE__ */ import_react19.default.createElement(import_react20.InvitationListItem, {
|
|
1140
|
-
reverseEffects: true,
|
|
1141
|
-
classNames: "pis-0 pie-0 gap-0 col-span-4 grid grid-cols-subgrid",
|
|
1142
|
-
key: invitation.get().invitationId,
|
|
1143
|
-
invitation,
|
|
1144
|
-
send: handleInvitationSelect,
|
|
1145
|
-
createInvitationUrl: handleCreateInvitationUrl
|
|
1146
|
-
}))), /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.ButtonGroup, {
|
|
1147
|
-
classNames: "col-start-2 col-end-4 grid grid-cols-[1fr_var(--rail-action)] place-self-grow gap-px"
|
|
1148
|
-
}, /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.Button, {
|
|
1149
|
-
classNames: "gap-2",
|
|
1150
|
-
onClick: activeAction.onClick
|
|
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, {
|
|
1154
|
-
ns: "os"
|
|
1155
|
-
}))), /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.DropdownMenu.Root, null, /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.DropdownMenu.Trigger, {
|
|
1156
|
-
asChild: true
|
|
1157
|
-
}, /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.Button, {
|
|
1158
|
-
classNames: "pli-0"
|
|
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, {
|
|
1163
|
-
key: id,
|
|
1164
|
-
"aria-labelledby": `${id}__label`,
|
|
1165
|
-
"aria-describedby": `${id}__description`,
|
|
1166
|
-
checked: activeActionKey === id,
|
|
1167
|
-
onCheckedChange: (checked) => checked && setActiveActionKey(id),
|
|
1168
|
-
classNames: "gap-2"
|
|
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", {
|
|
1172
|
-
role: "none",
|
|
1173
|
-
className: "flex-1 min-is-0 space-b-1"
|
|
1174
|
-
}, /* @__PURE__ */ import_react19.default.createElement("p", {
|
|
1175
|
-
id: `${id}__label`
|
|
1176
|
-
}, t(action.label, {
|
|
1177
|
-
ns: "os"
|
|
1178
|
-
})), action.description && /* @__PURE__ */ import_react19.default.createElement("p", {
|
|
1179
|
-
id: `${id}__description`,
|
|
1180
|
-
className: import_react_ui_theme5.descriptionText
|
|
1181
|
-
}, t(action.description, {
|
|
1182
|
-
ns: "os"
|
|
1183
|
-
}))), /* @__PURE__ */ import_react19.default.createElement(import_react_ui12.DropdownMenu.ItemIndicator, {
|
|
1184
|
-
asChild: true
|
|
1185
|
-
}, /* @__PURE__ */ import_react19.default.createElement(import_react18.Check, {
|
|
1186
|
-
className: (0, import_react_ui_theme5.getSize)(4)
|
|
1187
|
-
})));
|
|
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")
|
|
1190
|
-
}, t("empty space members message", {
|
|
1191
|
-
ns: "os"
|
|
1192
|
-
})) : /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, /* @__PURE__ */ import_react19.default.createElement("h3", {
|
|
1193
|
-
className: "col-start-2 col-end-5 text-sm italic text-description"
|
|
1194
|
-
}, t("active space members heading", {
|
|
1195
|
-
count: members[Presence.ONLINE].length
|
|
1196
|
-
})), /* @__PURE__ */ import_react19.default.createElement(SpaceMemberList, {
|
|
1197
|
-
members: members[Presence.ONLINE]
|
|
1198
|
-
}), /* @__PURE__ */ import_react19.default.createElement("h3", {
|
|
1199
|
-
className: "col-start-2 col-end-5 text-sm italic text-description"
|
|
1200
|
-
}, t("inactive space members heading", {
|
|
1201
|
-
count: members[Presence.OFFLINE].length
|
|
1202
|
-
})), /* @__PURE__ */ import_react19.default.createElement(SpaceMemberList, {
|
|
1203
|
-
members: members[Presence.OFFLINE]
|
|
1204
|
-
})));
|
|
1205
|
-
};
|
|
1206
|
-
var KeyShortcuts = () => {
|
|
1207
|
-
const { t } = (0, import_react_ui11.useTranslation)(import_chunk_P4XUXM7Y.SPACE_PLUGIN);
|
|
1208
|
-
return /* @__PURE__ */ import_react16.default.createElement("section", {
|
|
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"
|
|
1210
|
-
}, /* @__PURE__ */ import_react16.default.createElement("h2", {
|
|
1211
|
-
className: "contents"
|
|
1212
|
-
}, /* @__PURE__ */ import_react16.default.createElement(import_react15.Command, {
|
|
1213
|
-
weight: "duotone",
|
|
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", {
|
|
1216
|
-
className: "text-lg col-span-2 md:col-span-1"
|
|
1217
|
-
}, t("keyshortcuts label"))), /* @__PURE__ */ import_react16.default.createElement("div", {
|
|
1218
|
-
role: "none",
|
|
1219
|
-
className: "col-start-2 col-end-4 md:col-end-5 pie-2"
|
|
1220
|
-
}, /* @__PURE__ */ import_react16.default.createElement(import_app_framework5.Surface, {
|
|
1221
|
-
role: "keyshortcuts"
|
|
1222
|
-
})));
|
|
1223
|
-
};
|
|
1224
|
-
var spaceMainLayout = "grid gap-y-2 auto-rows-min before:bs-2 before:col-span-5 grid-cols-[var(--rail-size)_var(--rail-size)_1fr_var(--rail-size)] md:grid-cols-[var(--rail-size)_var(--rail-size)_minmax(max-content,1fr)_var(--rail-size)_var(--rail-size)_minmax(max-content,2fr)_var(--rail-size)]";
|
|
1225
|
-
var SpaceMain = ({ space, role }) => {
|
|
1226
|
-
const state = space.state.get();
|
|
1227
|
-
const ready = state === import_echo5.SpaceState.SPACE_READY;
|
|
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, {
|
|
1230
|
-
...role === "main" ? {
|
|
1231
|
-
classNames: [
|
|
1232
|
-
import_react_ui_theme4.topbarBlockPaddingStart,
|
|
1233
|
-
"min-bs-dvh",
|
|
1234
|
-
spaceMainLayout
|
|
1235
|
-
]
|
|
1236
|
-
} : {
|
|
1237
|
-
role: "none",
|
|
1238
|
-
className: (0, import_react_ui_theme4.mx)(import_react_ui_theme4.topbarBlockPaddingStart, "row-span-2", spaceMainLayout)
|
|
1239
|
-
},
|
|
1240
|
-
"data-testid": `spacePlugin.${role}`,
|
|
1241
|
-
"data-isready": ready ? "true" : "false"
|
|
1242
|
-
}, ready && /* @__PURE__ */ import_react16.default.createElement(SpaceMembersSection, {
|
|
1243
|
-
space
|
|
1244
|
-
}), /* @__PURE__ */ import_react16.default.createElement(KeyShortcuts, null)));
|
|
1245
1134
|
};
|
|
1246
1135
|
var REFRESH_INTERVAL = 5e3;
|
|
1247
1136
|
var ACTIVITY_DURATION = 3e4;
|
|
1248
1137
|
var noViewers = new import_util2.ComplexMap(import_react_client4.PublicKey.hash);
|
|
1249
1138
|
var getName = (identity) => identity.profile?.displayName ?? (0, import_display_name.generateName)(identity.identityKey.toHex());
|
|
1250
1139
|
var SpacePresence = ({ object, spaceKey }) => {
|
|
1251
|
-
const spacePlugin = (0,
|
|
1140
|
+
const spacePlugin = (0, import_app_framework6.usePlugin)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
1252
1141
|
const client = (0, import_react_client4.useClient)();
|
|
1253
1142
|
const identity = (0, import_halo.useIdentity)();
|
|
1254
|
-
const space = spaceKey ? client.spaces.get(spaceKey) : (0,
|
|
1255
|
-
const spaceMembers = (0,
|
|
1256
|
-
const [_moment, setMoment] = (0,
|
|
1257
|
-
(0,
|
|
1143
|
+
const space = spaceKey ? client.spaces.get(spaceKey) : (0, import_echo6.getSpace)(object);
|
|
1144
|
+
const spaceMembers = (0, import_echo6.useMembers)(space?.key);
|
|
1145
|
+
const [_moment, setMoment] = (0, import_react17.useState)(Date.now());
|
|
1146
|
+
(0, import_react17.useEffect)(() => {
|
|
1258
1147
|
const interval = setInterval(() => setMoment(Date.now()), REFRESH_INTERVAL);
|
|
1259
1148
|
return () => clearInterval(interval);
|
|
1260
1149
|
}, []);
|
|
1261
|
-
const memberOnline = (0,
|
|
1262
|
-
const memberIsNotSelf = (0,
|
|
1150
|
+
const memberOnline = (0, import_react17.useCallback)((member) => member.presence === 1, []);
|
|
1151
|
+
const memberIsNotSelf = (0, import_react17.useCallback)((member) => !identity?.identityKey.equals(member.identity.identityKey), [
|
|
1263
1152
|
identity?.identityKey
|
|
1264
1153
|
]);
|
|
1265
1154
|
if (!identity || !spacePlugin || !space) {
|
|
1266
1155
|
return null;
|
|
1267
1156
|
}
|
|
1268
1157
|
const spaceState = spacePlugin.provides.space;
|
|
1269
|
-
const currentObjectViewers = spaceState.viewersByObject[(0,
|
|
1158
|
+
const currentObjectViewers = spaceState.viewersByObject[(0, import_echo6.fullyQualifiedId)(object)] ?? noViewers;
|
|
1270
1159
|
const membersForObject = spaceMembers.filter((member) => memberOnline(member) && memberIsNotSelf(member)).filter((member) => currentObjectViewers.has(member.identity.identityKey)).map((member) => {
|
|
1271
1160
|
const objectView = currentObjectViewers.get(member.identity.identityKey);
|
|
1272
1161
|
const lastSeen = objectView?.lastSeen ?? -Infinity;
|
|
@@ -1277,61 +1166,61 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1277
1166
|
lastSeen
|
|
1278
1167
|
};
|
|
1279
1168
|
}).toSorted((a, b) => a.lastSeen - b.lastSeen);
|
|
1280
|
-
return /* @__PURE__ */
|
|
1169
|
+
return /* @__PURE__ */ import_react17.default.createElement(FullPresence, {
|
|
1281
1170
|
members: membersForObject
|
|
1282
1171
|
});
|
|
1283
1172
|
};
|
|
1284
1173
|
var FullPresence = (props) => {
|
|
1285
1174
|
const { size = 9, onMemberClick } = props;
|
|
1286
|
-
const members = (0,
|
|
1175
|
+
const members = (0, import_react_ui11.useDefaultValue)(props.members, () => []);
|
|
1287
1176
|
if (members.length === 0) {
|
|
1288
1177
|
return null;
|
|
1289
1178
|
}
|
|
1290
|
-
return /* @__PURE__ */
|
|
1179
|
+
return /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.AvatarGroup.Root, {
|
|
1291
1180
|
size,
|
|
1292
1181
|
classNames: "mbs-2 mie-4",
|
|
1293
1182
|
"data-testid": "spacePlugin.presence"
|
|
1294
|
-
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */
|
|
1183
|
+
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Tooltip.Root, {
|
|
1295
1184
|
key: member.identity.identityKey.toHex()
|
|
1296
|
-
}, /* @__PURE__ */
|
|
1185
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Tooltip.Trigger, null, /* @__PURE__ */ import_react17.default.createElement(PrensenceAvatar, {
|
|
1297
1186
|
identity: member.identity,
|
|
1298
1187
|
group: true,
|
|
1299
1188
|
match: member.currentlyAttended,
|
|
1300
1189
|
index: members.length - i,
|
|
1301
1190
|
onClick: () => onMemberClick?.(member)
|
|
1302
|
-
})), /* @__PURE__ */
|
|
1191
|
+
})), /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Tooltip.Portal, null, /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Tooltip.Content, {
|
|
1303
1192
|
side: "bottom"
|
|
1304
|
-
}, /* @__PURE__ */
|
|
1193
|
+
}, /* @__PURE__ */ import_react17.default.createElement("span", null, getName(member.identity)), /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Tooltip.Arrow, null))))), members.length > 3 && /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Tooltip.Root, null, /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Tooltip.Trigger, null, /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.AvatarGroupItem.Root, {
|
|
1305
1194
|
status: "inactive"
|
|
1306
|
-
}, /* @__PURE__ */
|
|
1195
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Avatar.Frame, {
|
|
1307
1196
|
style: {
|
|
1308
1197
|
zIndex: members.length - 4
|
|
1309
1198
|
}
|
|
1310
|
-
}, /* @__PURE__ */
|
|
1199
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Avatar.Fallback, {
|
|
1311
1200
|
text: `+${members.length - 3}`
|
|
1312
|
-
})))), /* @__PURE__ */
|
|
1201
|
+
})))), /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Tooltip.Portal, null, /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Tooltip.Content, {
|
|
1313
1202
|
side: "bottom"
|
|
1314
|
-
}, /* @__PURE__ */
|
|
1203
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Tooltip.Arrow, null), /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.List, {
|
|
1315
1204
|
classNames: "max-h-56 overflow-y-auto"
|
|
1316
|
-
}, members.map((member) => /* @__PURE__ */
|
|
1205
|
+
}, members.map((member) => /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.ListItem.Root, {
|
|
1317
1206
|
key: member.identity.identityKey.toHex(),
|
|
1318
1207
|
classNames: "flex gap-2 items-center cursor-pointer mbe-2",
|
|
1319
1208
|
onClick: () => onMemberClick?.(member),
|
|
1320
1209
|
"data-testid": "identity-list-item"
|
|
1321
|
-
}, /* @__PURE__ */
|
|
1210
|
+
}, /* @__PURE__ */ import_react17.default.createElement(PrensenceAvatar, {
|
|
1322
1211
|
identity: member.identity,
|
|
1323
1212
|
showName: true,
|
|
1324
1213
|
match: member.currentlyAttended
|
|
1325
1214
|
}))))))));
|
|
1326
1215
|
};
|
|
1327
1216
|
var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) => {
|
|
1328
|
-
const Root = group ?
|
|
1217
|
+
const Root = group ? import_react_ui11.AvatarGroupItem.Root : import_react_ui11.Avatar.Root;
|
|
1329
1218
|
const status = match ? "current" : "active";
|
|
1330
1219
|
const fallbackValue = (0, import_util2.keyToFallback)(identity.identityKey);
|
|
1331
|
-
return /* @__PURE__ */
|
|
1220
|
+
return /* @__PURE__ */ import_react17.default.createElement(Root, {
|
|
1332
1221
|
status,
|
|
1333
1222
|
hue: identity.profile?.data?.hue || fallbackValue.hue
|
|
1334
|
-
}, /* @__PURE__ */
|
|
1223
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Avatar.Frame, {
|
|
1335
1224
|
"data-testid": "spacePlugin.presence.member",
|
|
1336
1225
|
"data-status": status,
|
|
1337
1226
|
...index ? {
|
|
@@ -1340,9 +1229,9 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
|
|
|
1340
1229
|
}
|
|
1341
1230
|
} : {},
|
|
1342
1231
|
onClick: () => onClick?.()
|
|
1343
|
-
}, /* @__PURE__ */
|
|
1232
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Avatar.Fallback, {
|
|
1344
1233
|
text: identity.profile?.data?.emoji || fallbackValue.emoji
|
|
1345
|
-
})), showName && /* @__PURE__ */
|
|
1234
|
+
})), showName && /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Avatar.Label, {
|
|
1346
1235
|
classNames: "text-sm truncate pli-2"
|
|
1347
1236
|
}, getName(identity)));
|
|
1348
1237
|
};
|
|
@@ -1351,8 +1240,8 @@ var SmallPresenceLive = ({ id, viewers }) => {
|
|
|
1351
1240
|
const moment = Date.now();
|
|
1352
1241
|
return Array.from(viewers2.values()).filter(({ lastSeen }) => moment - lastSeen < ACTIVITY_DURATION);
|
|
1353
1242
|
};
|
|
1354
|
-
const [activeViewers, setActiveViewers] = (0,
|
|
1355
|
-
(0,
|
|
1243
|
+
const [activeViewers, setActiveViewers] = (0, import_react17.useState)(viewers ? getActiveViewers(viewers) : []);
|
|
1244
|
+
(0, import_react17.useEffect)(() => {
|
|
1356
1245
|
if (viewers) {
|
|
1357
1246
|
setActiveViewers(getActiveViewers(viewers));
|
|
1358
1247
|
const interval = setInterval(() => {
|
|
@@ -1363,73 +1252,73 @@ var SmallPresenceLive = ({ id, viewers }) => {
|
|
|
1363
1252
|
}, [
|
|
1364
1253
|
viewers
|
|
1365
1254
|
]);
|
|
1366
|
-
return /* @__PURE__ */
|
|
1255
|
+
return /* @__PURE__ */ import_react17.default.createElement(SmallPresence, {
|
|
1367
1256
|
id,
|
|
1368
1257
|
count: activeViewers.length
|
|
1369
1258
|
});
|
|
1370
1259
|
};
|
|
1371
1260
|
var SmallPresence = ({ id, count }) => {
|
|
1372
|
-
const { t } = (0,
|
|
1261
|
+
const { t } = (0, import_react_ui11.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
1373
1262
|
const { hasAttention, isAncestor, isRelated } = (0, import_react_ui_attention.useAttention)(id);
|
|
1374
1263
|
const attention = hasAttention || isAncestor || isRelated;
|
|
1375
|
-
return /* @__PURE__ */
|
|
1264
|
+
return /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Tooltip.Root, null, /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Tooltip.Trigger, {
|
|
1376
1265
|
asChild: true
|
|
1377
|
-
}, /* @__PURE__ */
|
|
1266
|
+
}, /* @__PURE__ */ import_react17.default.createElement("div", {
|
|
1378
1267
|
role: "none",
|
|
1379
1268
|
className: "flex",
|
|
1380
1269
|
"data-attention": attention
|
|
1381
|
-
}, /* @__PURE__ */
|
|
1270
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react_ui_attention.AttentionGlyph, {
|
|
1382
1271
|
presence: count > 1 ? "many" : count === 1 ? "one" : "none",
|
|
1383
1272
|
classNames: "self-center mie-1"
|
|
1384
|
-
}))), /* @__PURE__ */
|
|
1273
|
+
}))), /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Tooltip.Portal, null, /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Tooltip.Content, {
|
|
1385
1274
|
side: "bottom",
|
|
1386
1275
|
classNames: "z-[70]"
|
|
1387
|
-
}, /* @__PURE__ */
|
|
1276
|
+
}, /* @__PURE__ */ import_react17.default.createElement("span", null, t("presence label", {
|
|
1388
1277
|
count
|
|
1389
|
-
})), /* @__PURE__ */
|
|
1278
|
+
})), /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Tooltip.Arrow, null))));
|
|
1390
1279
|
};
|
|
1391
|
-
var
|
|
1392
|
-
const { t } = (0,
|
|
1393
|
-
const dispatch = (0,
|
|
1394
|
-
const plugins = (0,
|
|
1395
|
-
return /* @__PURE__ */
|
|
1280
|
+
var SpacePluginSettings = ({ settings }) => {
|
|
1281
|
+
const { t } = (0, import_react_ui12.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
1282
|
+
const dispatch = (0, import_app_framework7.useIntentDispatcher)();
|
|
1283
|
+
const plugins = (0, import_app_framework7.useResolvePlugins)(import_chunk_FYWGZYJB.parseSpaceInitPlugin);
|
|
1284
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement(import_react_ui_data.DeprecatedFormInput, {
|
|
1396
1285
|
label: t("show hidden spaces label")
|
|
1397
|
-
}, /* @__PURE__ */
|
|
1286
|
+
}, /* @__PURE__ */ import_react18.default.createElement(import_react_ui12.Input.Switch, {
|
|
1398
1287
|
checked: settings.showHidden,
|
|
1399
1288
|
onCheckedChange: (checked) => dispatch({
|
|
1400
|
-
plugin:
|
|
1401
|
-
action:
|
|
1289
|
+
plugin: import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
1290
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.TOGGLE_HIDDEN,
|
|
1402
1291
|
data: {
|
|
1403
1292
|
state: !!checked
|
|
1404
1293
|
}
|
|
1405
1294
|
})
|
|
1406
|
-
})), /* @__PURE__ */
|
|
1295
|
+
})), /* @__PURE__ */ import_react18.default.createElement(import_react_ui_data.DeprecatedFormInput, {
|
|
1407
1296
|
label: t("default on space create label")
|
|
1408
|
-
}, /* @__PURE__ */
|
|
1297
|
+
}, /* @__PURE__ */ import_react18.default.createElement(import_react_ui12.Select.Root, {
|
|
1409
1298
|
value: settings.onSpaceCreate,
|
|
1410
1299
|
onValueChange: (value) => {
|
|
1411
1300
|
settings.onSpaceCreate = value;
|
|
1412
1301
|
}
|
|
1413
|
-
}, /* @__PURE__ */
|
|
1302
|
+
}, /* @__PURE__ */ import_react18.default.createElement(import_react_ui12.Select.TriggerButton, null), /* @__PURE__ */ import_react18.default.createElement(import_react_ui12.Select.Portal, null, /* @__PURE__ */ import_react18.default.createElement(import_react_ui12.Select.Content, null, /* @__PURE__ */ import_react18.default.createElement(import_react_ui12.Select.Viewport, null, plugins.map(({ provides: { space: { onSpaceCreate } } }) => /* @__PURE__ */ import_react18.default.createElement(import_react_ui12.Select.Option, {
|
|
1414
1303
|
key: onSpaceCreate.action,
|
|
1415
1304
|
value: onSpaceCreate.action
|
|
1416
|
-
}, (0,
|
|
1305
|
+
}, (0, import_react_ui12.toLocalizedString)(onSpaceCreate.label, t)))))))));
|
|
1417
1306
|
};
|
|
1418
|
-
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettingsPanel.tsx";
|
|
1307
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx";
|
|
1419
1308
|
var SpaceSettingsPanel = ({ space }) => {
|
|
1420
|
-
const { t } = (0,
|
|
1421
|
-
const client = (0,
|
|
1309
|
+
const { t } = (0, import_react_ui14.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
1310
|
+
const client = (0, import_react_client6.useClient)();
|
|
1422
1311
|
const devices = (0, import_halo2.useDevices)();
|
|
1423
1312
|
const managedDeviceAvailable = devices.find((device) => device.profile?.type === import_halo2.DeviceType.AGENT_MANAGED);
|
|
1424
1313
|
const edgeAgents = Boolean(client.config.values.runtime?.client?.edgeFeatures?.agents);
|
|
1425
1314
|
const edgeReplicationAvailable = edgeAgents && managedDeviceAvailable;
|
|
1426
|
-
const [edgeReplication, setEdgeReplication] = (0,
|
|
1427
|
-
const toggleEdgeReplication = (0,
|
|
1315
|
+
const [edgeReplication, setEdgeReplication] = (0, import_react21.useState)(space.internal.data.edgeReplication === import_metadata.EdgeReplicationSetting.ENABLED);
|
|
1316
|
+
const toggleEdgeReplication = (0, import_react21.useCallback)(async (next) => {
|
|
1428
1317
|
setEdgeReplication(next);
|
|
1429
1318
|
await space?.internal.setEdgeReplicationPreference(next ? import_metadata.EdgeReplicationSetting.ENABLED : import_metadata.EdgeReplicationSetting.DISABLED).catch((err) => {
|
|
1430
1319
|
import_log3.log.catch(err, void 0, {
|
|
1431
1320
|
F: __dxlog_file3,
|
|
1432
|
-
L:
|
|
1321
|
+
L: 39,
|
|
1433
1322
|
S: void 0,
|
|
1434
1323
|
C: (f, a) => f(...a)
|
|
1435
1324
|
});
|
|
@@ -1438,25 +1327,101 @@ var SpaceSettingsPanel = ({ space }) => {
|
|
|
1438
1327
|
}, [
|
|
1439
1328
|
space
|
|
1440
1329
|
]);
|
|
1441
|
-
return /* @__PURE__ */
|
|
1330
|
+
return /* @__PURE__ */ import_react21.default.createElement("div", {
|
|
1442
1331
|
role: "form",
|
|
1443
|
-
className: "flex flex-col
|
|
1444
|
-
}, /* @__PURE__ */
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
placeholder: t("name placeholder"),
|
|
1332
|
+
className: "flex flex-col"
|
|
1333
|
+
}, /* @__PURE__ */ import_react21.default.createElement(import_react_ui_data2.DeprecatedFormInput, {
|
|
1334
|
+
label: t("name label")
|
|
1335
|
+
}, /* @__PURE__ */ import_react21.default.createElement(import_react_ui14.Input.TextInput, {
|
|
1336
|
+
placeholder: t("unnamed space label"),
|
|
1449
1337
|
value: space.properties.name ?? "",
|
|
1450
1338
|
onChange: (event) => {
|
|
1451
1339
|
space.properties.name = event.target.value;
|
|
1452
1340
|
}
|
|
1453
|
-
}))
|
|
1454
|
-
|
|
1455
|
-
|
|
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, {
|
|
1341
|
+
})), edgeReplicationAvailable && /* @__PURE__ */ import_react21.default.createElement(import_react_ui_data2.DeprecatedFormInput, {
|
|
1342
|
+
label: t("edge replication label")
|
|
1343
|
+
}, /* @__PURE__ */ import_react21.default.createElement(import_react_ui14.Input.Switch, {
|
|
1457
1344
|
checked: edgeReplication,
|
|
1458
1345
|
onCheckedChange: toggleEdgeReplication
|
|
1459
|
-
})))
|
|
1346
|
+
})));
|
|
1347
|
+
};
|
|
1348
|
+
var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "members", namesCache }) => {
|
|
1349
|
+
const { t } = (0, import_react_ui13.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
1350
|
+
const client = (0, import_react_client5.useClient)();
|
|
1351
|
+
const [tabsActivePart, setTabsActivePart] = (0, import_react19.useState)("list");
|
|
1352
|
+
const [selected, setSelected] = (0, import_react19.useState)(initialTab);
|
|
1353
|
+
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
1354
|
+
const name = getSpaceDisplayName(space, {
|
|
1355
|
+
personal: client.spaces.default === space,
|
|
1356
|
+
namesCache
|
|
1357
|
+
});
|
|
1358
|
+
return (
|
|
1359
|
+
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
1360
|
+
// Consider factoring it out to the tabs package.
|
|
1361
|
+
/* @__PURE__ */ import_react19.default.createElement(import_react_ui13.Dialog.Content, {
|
|
1362
|
+
classNames: "p-0 bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
1363
|
+
}, /* @__PURE__ */ import_react19.default.createElement("div", {
|
|
1364
|
+
role: "none",
|
|
1365
|
+
className: "flex justify-between pbs-3 pis-2 pie-3 @md:pbs-4 @md:pis-4 @md:pie-5"
|
|
1366
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_react_ui13.Dialog.Title, {
|
|
1367
|
+
onClick: () => setTabsActivePart("list"),
|
|
1368
|
+
"aria-description": t("click to return to tablist description"),
|
|
1369
|
+
classNames: "flex cursor-pointer items-center group/title"
|
|
1370
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_react_ui13.Icon, {
|
|
1371
|
+
icon: "ph--caret-left--regular",
|
|
1372
|
+
size: 4,
|
|
1373
|
+
classNames: [
|
|
1374
|
+
"@md:hidden",
|
|
1375
|
+
tabsActivePart === "list" && "invisible"
|
|
1376
|
+
]
|
|
1377
|
+
}), /* @__PURE__ */ import_react19.default.createElement("span", {
|
|
1378
|
+
className: tabsActivePart !== "list" ? "group-hover/title:underline @md:group-hover/title:no-underline underline-offset-4 decoration-1" : ""
|
|
1379
|
+
}, (0, import_react_ui13.toLocalizedString)(name, t))), /* @__PURE__ */ import_react19.default.createElement(import_react_ui13.Dialog.Close, {
|
|
1380
|
+
asChild: true
|
|
1381
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_react_ui13.Button, {
|
|
1382
|
+
density: "fine",
|
|
1383
|
+
variant: "ghost",
|
|
1384
|
+
autoFocus: true
|
|
1385
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_react_ui13.Icon, {
|
|
1386
|
+
icon: "ph--x--regular",
|
|
1387
|
+
size: 3
|
|
1388
|
+
})))), /* @__PURE__ */ import_react19.default.createElement(import_react_ui_tabs.Tabs.Root, {
|
|
1389
|
+
orientation: "vertical",
|
|
1390
|
+
value: selected,
|
|
1391
|
+
onValueChange: setSelected,
|
|
1392
|
+
activePart: tabsActivePart,
|
|
1393
|
+
onActivePartChange: setTabsActivePart,
|
|
1394
|
+
classNames: "flex flex-col flex-1 mbs-2"
|
|
1395
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_react_ui_tabs.Tabs.Viewport, {
|
|
1396
|
+
classNames: "flex-1 min-bs-0"
|
|
1397
|
+
}, /* @__PURE__ */ import_react19.default.createElement("div", {
|
|
1398
|
+
role: "none",
|
|
1399
|
+
className: "overflow-y-auto pli-3 @md:pis-2 @md:pie-0 mbe-4 border-r border-separator"
|
|
1400
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_react_ui_tabs.Tabs.Tablist, {
|
|
1401
|
+
classNames: "flex flex-col max-bs-none min-is-[200px] gap-4 overflow-y-auto"
|
|
1402
|
+
}, /* @__PURE__ */ import_react19.default.createElement("div", {
|
|
1403
|
+
role: "none",
|
|
1404
|
+
className: "flex flex-col ml-1"
|
|
1405
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_react_ui_tabs.Tabs.Tab, {
|
|
1406
|
+
value: "settings"
|
|
1407
|
+
}, t("settings tab label")), /* @__PURE__ */ import_react19.default.createElement(import_react_ui_tabs.Tabs.Tab, {
|
|
1408
|
+
value: "members",
|
|
1409
|
+
disabled: locked
|
|
1410
|
+
}, t("members tab label"))))), /* @__PURE__ */ import_react19.default.createElement(import_react_ui_tabs.Tabs.Tabpanel, {
|
|
1411
|
+
value: "settings",
|
|
1412
|
+
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
1413
|
+
}, /* @__PURE__ */ import_react19.default.createElement(SpaceSettingsPanel, {
|
|
1414
|
+
space
|
|
1415
|
+
})), /* @__PURE__ */ import_react19.default.createElement(import_react_ui_tabs.Tabs.Tabpanel, {
|
|
1416
|
+
value: "members",
|
|
1417
|
+
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
1418
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_react20.ClipboardProvider, null, /* @__PURE__ */ import_react19.default.createElement(import_react20.SpacePanel, {
|
|
1419
|
+
space,
|
|
1420
|
+
hideHeading: true,
|
|
1421
|
+
target,
|
|
1422
|
+
createInvitationUrl
|
|
1423
|
+
}))))))
|
|
1424
|
+
);
|
|
1460
1425
|
};
|
|
1461
1426
|
var SYNC_STALLED_TIMEOUT = 5e3;
|
|
1462
1427
|
var styles = {
|
|
@@ -1465,9 +1430,9 @@ var styles = {
|
|
|
1465
1430
|
barHover: "dark:hover:bg-green-500"
|
|
1466
1431
|
};
|
|
1467
1432
|
var useActive = (count) => {
|
|
1468
|
-
const [current, setCurrent] = (0,
|
|
1469
|
-
const [active, setActive] = (0,
|
|
1470
|
-
(0,
|
|
1433
|
+
const [current, setCurrent] = (0, import_react23.useState)(count);
|
|
1434
|
+
const [active, setActive] = (0, import_react23.useState)(false);
|
|
1435
|
+
(0, import_react23.useEffect)(() => {
|
|
1471
1436
|
let t;
|
|
1472
1437
|
if (count !== current) {
|
|
1473
1438
|
setActive(true);
|
|
@@ -1490,17 +1455,17 @@ var useActive = (count) => {
|
|
|
1490
1455
|
var SpaceRow = ({ spaceId, state: { localDocumentCount, remoteDocumentCount, missingOnLocal, missingOnRemote } }) => {
|
|
1491
1456
|
const downActive = useActive(localDocumentCount);
|
|
1492
1457
|
const upActive = useActive(remoteDocumentCount);
|
|
1493
|
-
return /* @__PURE__ */
|
|
1494
|
-
className: (0,
|
|
1458
|
+
return /* @__PURE__ */ import_react23.default.createElement("div", {
|
|
1459
|
+
className: (0, import_react_ui_theme5.mx)("flex items-center mx-[2px] gap-[2px] cursor-pointer", styles.barHover),
|
|
1495
1460
|
title: spaceId,
|
|
1496
1461
|
onClick: () => {
|
|
1497
1462
|
void navigator.clipboard.writeText(spaceId);
|
|
1498
1463
|
}
|
|
1499
|
-
}, /* @__PURE__ */
|
|
1464
|
+
}, /* @__PURE__ */ import_react23.default.createElement(import_react_ui16.Icon, {
|
|
1500
1465
|
icon: "ph--arrow-fat-line-left--regular",
|
|
1501
1466
|
size: 3,
|
|
1502
|
-
classNames: (0,
|
|
1503
|
-
}), /* @__PURE__ */
|
|
1467
|
+
classNames: (0, import_react_ui_theme5.mx)(downActive && "animate-[pulse_1s_infinite]")
|
|
1468
|
+
}), /* @__PURE__ */ import_react23.default.createElement(Candle, {
|
|
1504
1469
|
up: {
|
|
1505
1470
|
count: remoteDocumentCount,
|
|
1506
1471
|
total: remoteDocumentCount + missingOnRemote
|
|
@@ -1510,37 +1475,37 @@ var SpaceRow = ({ spaceId, state: { localDocumentCount, remoteDocumentCount, mis
|
|
|
1510
1475
|
total: localDocumentCount + missingOnLocal
|
|
1511
1476
|
},
|
|
1512
1477
|
title: spaceId
|
|
1513
|
-
}), /* @__PURE__ */
|
|
1478
|
+
}), /* @__PURE__ */ import_react23.default.createElement(import_react_ui16.Icon, {
|
|
1514
1479
|
icon: "ph--arrow-fat-line-right--regular",
|
|
1515
1480
|
size: 3,
|
|
1516
|
-
classNames: (0,
|
|
1481
|
+
classNames: (0, import_react_ui_theme5.mx)(upActive && "animate-[pulse_1s_step-start_infinite]")
|
|
1517
1482
|
}));
|
|
1518
1483
|
};
|
|
1519
1484
|
var Candle = ({ classNames, up, down }) => {
|
|
1520
|
-
return /* @__PURE__ */
|
|
1521
|
-
className: (0,
|
|
1522
|
-
}, /* @__PURE__ */
|
|
1485
|
+
return /* @__PURE__ */ import_react23.default.createElement("div", {
|
|
1486
|
+
className: (0, import_react_ui_theme5.mx)("grid grid-cols-[1fr_2rem_1fr] w-full h-3", classNames)
|
|
1487
|
+
}, /* @__PURE__ */ import_react23.default.createElement(Bar, {
|
|
1523
1488
|
classNames: "justify-end",
|
|
1524
1489
|
...up
|
|
1525
|
-
}), /* @__PURE__ */
|
|
1490
|
+
}), /* @__PURE__ */ import_react23.default.createElement("div", {
|
|
1526
1491
|
className: "relative"
|
|
1527
|
-
}, /* @__PURE__ */
|
|
1528
|
-
className: (0,
|
|
1529
|
-
}, up.total)), /* @__PURE__ */
|
|
1492
|
+
}, /* @__PURE__ */ import_react23.default.createElement("div", {
|
|
1493
|
+
className: (0, import_react_ui_theme5.mx)("absolute inset-0 flex items-center justify-center text-xs", styles.barBg)
|
|
1494
|
+
}, up.total)), /* @__PURE__ */ import_react23.default.createElement(Bar, down));
|
|
1530
1495
|
};
|
|
1531
1496
|
var Bar = ({ classNames, count, total }) => {
|
|
1532
1497
|
let p = count / total * 100;
|
|
1533
1498
|
if (count < total) {
|
|
1534
1499
|
p = Math.min(p, 95);
|
|
1535
1500
|
}
|
|
1536
|
-
return /* @__PURE__ */
|
|
1537
|
-
className: (0,
|
|
1538
|
-
}, /* @__PURE__ */
|
|
1539
|
-
className: (0,
|
|
1501
|
+
return /* @__PURE__ */ import_react23.default.createElement("div", {
|
|
1502
|
+
className: (0, import_react_ui_theme5.mx)("relative flex w-full", styles.barBg, classNames)
|
|
1503
|
+
}, /* @__PURE__ */ import_react23.default.createElement("div", {
|
|
1504
|
+
className: (0, import_react_ui_theme5.mx)("shrink-0", styles.barFg),
|
|
1540
1505
|
style: {
|
|
1541
1506
|
width: `${p}%`
|
|
1542
1507
|
}
|
|
1543
|
-
}), count !== total && /* @__PURE__ */
|
|
1508
|
+
}), count !== total && /* @__PURE__ */ import_react23.default.createElement("div", {
|
|
1544
1509
|
className: "absolute top-0 bottom-0 flex items-center mx-0.5 text-black text-xs"
|
|
1545
1510
|
}, count));
|
|
1546
1511
|
};
|
|
@@ -1650,9 +1615,9 @@ var getSyncSummary = (syncMap) => {
|
|
|
1650
1615
|
};
|
|
1651
1616
|
var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${import_protocols.EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
|
|
1652
1617
|
var useSyncState = () => {
|
|
1653
|
-
const client = (0,
|
|
1654
|
-
const [spaceState, setSpaceState] = (0,
|
|
1655
|
-
(0,
|
|
1618
|
+
const client = (0, import_react_client8.useClient)();
|
|
1619
|
+
const [spaceState, setSpaceState] = (0, import_react24.useState)({});
|
|
1620
|
+
(0, import_react24.useEffect)(() => {
|
|
1656
1621
|
const ctx = new import_context2.Context(void 0, {
|
|
1657
1622
|
F: __dxlog_file5,
|
|
1658
1623
|
L: 48
|
|
@@ -1686,21 +1651,21 @@ var useSyncState = () => {
|
|
|
1686
1651
|
return spaceState;
|
|
1687
1652
|
};
|
|
1688
1653
|
var SyncStatus = () => {
|
|
1689
|
-
const client = (0,
|
|
1654
|
+
const client = (0, import_react_client7.useClient)();
|
|
1690
1655
|
const state = useSyncState();
|
|
1691
|
-
const [saved, setSaved] = (0,
|
|
1692
|
-
(0,
|
|
1656
|
+
const [saved, setSaved] = (0, import_react22.useState)(true);
|
|
1657
|
+
(0, import_react22.useEffect)(() => {
|
|
1693
1658
|
return createClientSaveTracker(client, (state2) => {
|
|
1694
1659
|
setSaved(state2 === "saved");
|
|
1695
1660
|
});
|
|
1696
1661
|
}, []);
|
|
1697
|
-
return /* @__PURE__ */
|
|
1662
|
+
return /* @__PURE__ */ import_react22.default.createElement(SyncStatusIndicator, {
|
|
1698
1663
|
state,
|
|
1699
1664
|
saved
|
|
1700
1665
|
});
|
|
1701
1666
|
};
|
|
1702
1667
|
var SyncStatusIndicator = ({ state, saved }) => {
|
|
1703
|
-
const { t } = (0,
|
|
1668
|
+
const { t } = (0, import_react_ui15.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
1704
1669
|
const summary = getSyncSummary(state);
|
|
1705
1670
|
const offline = Object.values(state).length === 0;
|
|
1706
1671
|
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
@@ -1711,8 +1676,8 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1711
1676
|
needsToUpload,
|
|
1712
1677
|
needsToDownload
|
|
1713
1678
|
});
|
|
1714
|
-
const [classNames, setClassNames] = (0,
|
|
1715
|
-
(0,
|
|
1679
|
+
const [classNames, setClassNames] = (0, import_react22.useState)();
|
|
1680
|
+
(0, import_react22.useEffect)(() => {
|
|
1716
1681
|
setClassNames(void 0);
|
|
1717
1682
|
if (offline || !needsToUpload && !needsToDownload) {
|
|
1718
1683
|
return;
|
|
@@ -1727,23 +1692,23 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1727
1692
|
needsToDownload
|
|
1728
1693
|
]);
|
|
1729
1694
|
const title = t(`${status} label`);
|
|
1730
|
-
const icon = /* @__PURE__ */
|
|
1695
|
+
const icon = /* @__PURE__ */ import_react22.default.createElement(import_react_ui15.Icon, {
|
|
1731
1696
|
icon: getIcon(status),
|
|
1732
1697
|
size: 4,
|
|
1733
1698
|
classNames
|
|
1734
1699
|
});
|
|
1735
1700
|
if (offline) {
|
|
1736
|
-
return /* @__PURE__ */
|
|
1701
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_plugin_status_bar.StatusBar.Item, {
|
|
1737
1702
|
title
|
|
1738
1703
|
}, icon);
|
|
1739
1704
|
} else {
|
|
1740
|
-
return /* @__PURE__ */
|
|
1705
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_react_ui15.Popover.Root, null, /* @__PURE__ */ import_react22.default.createElement(import_react_ui15.Popover.Trigger, {
|
|
1741
1706
|
asChild: true
|
|
1742
|
-
}, /* @__PURE__ */
|
|
1707
|
+
}, /* @__PURE__ */ import_react22.default.createElement(import_plugin_status_bar.StatusBar.Button, {
|
|
1743
1708
|
title
|
|
1744
|
-
}, icon)), /* @__PURE__ */
|
|
1709
|
+
}, icon)), /* @__PURE__ */ import_react22.default.createElement(import_react_ui15.Popover.Portal, null, /* @__PURE__ */ import_react22.default.createElement(import_react_ui15.Popover.Content, {
|
|
1745
1710
|
sideOffset: 16
|
|
1746
|
-
}, /* @__PURE__ */
|
|
1711
|
+
}, /* @__PURE__ */ import_react22.default.createElement(SyncStatusDetail, {
|
|
1747
1712
|
state,
|
|
1748
1713
|
summary,
|
|
1749
1714
|
debug: false
|
|
@@ -1751,24 +1716,24 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1751
1716
|
}
|
|
1752
1717
|
};
|
|
1753
1718
|
var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
|
|
1754
|
-
const { t } = (0,
|
|
1719
|
+
const { t } = (0, import_react_ui15.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
1755
1720
|
const entries = Object.entries(state).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
1756
|
-
return /* @__PURE__ */
|
|
1757
|
-
className: (0,
|
|
1758
|
-
}, /* @__PURE__ */
|
|
1721
|
+
return /* @__PURE__ */ import_react22.default.createElement("div", {
|
|
1722
|
+
className: (0, import_react_ui_theme4.mx)("flex flex-col gap-3 p-2 text-xs min-w-[16rem]", classNames)
|
|
1723
|
+
}, /* @__PURE__ */ import_react22.default.createElement("h1", null, t("sync status title")), /* @__PURE__ */ import_react22.default.createElement("div", {
|
|
1759
1724
|
className: "flex flex-col gap-2"
|
|
1760
|
-
}, entries.map(([spaceId, state2]) => /* @__PURE__ */
|
|
1725
|
+
}, entries.map(([spaceId, state2]) => /* @__PURE__ */ import_react22.default.createElement(SpaceRow, {
|
|
1761
1726
|
key: spaceId,
|
|
1762
1727
|
spaceId,
|
|
1763
1728
|
state: state2
|
|
1764
|
-
}))), debug && /* @__PURE__ */
|
|
1729
|
+
}))), debug && /* @__PURE__ */ import_react22.default.createElement(import_react_ui_syntax_highlighter.SyntaxHighlighter, {
|
|
1765
1730
|
language: "json"
|
|
1766
1731
|
}, JSON.stringify(summary, null, 2)));
|
|
1767
1732
|
};
|
|
1768
1733
|
var translations_default = [
|
|
1769
1734
|
{
|
|
1770
1735
|
"en-US": {
|
|
1771
|
-
[
|
|
1736
|
+
[import_chunk_JFDDZI4Y.SPACE_PLUGIN]: {
|
|
1772
1737
|
"plugin name": "Spaces",
|
|
1773
1738
|
"first run message": "Nothing selected.",
|
|
1774
1739
|
"create space label": "Create space",
|
|
@@ -1808,6 +1773,7 @@ var translations_default = [
|
|
|
1808
1773
|
"delete object label": "Delete item",
|
|
1809
1774
|
"collection deleted label": "Collection deleted",
|
|
1810
1775
|
"object deleted label": "Item deleted",
|
|
1776
|
+
"objects deleted label": "Items deleted",
|
|
1811
1777
|
"go to object label": "Open item",
|
|
1812
1778
|
"found object label": "Ready.",
|
|
1813
1779
|
"found object description": "The requested object is now available.",
|
|
@@ -1857,27 +1823,32 @@ var translations_default = [
|
|
|
1857
1823
|
"uploading label": "Replicating to peers",
|
|
1858
1824
|
"offline persisted label": "Saved to disk (offline)",
|
|
1859
1825
|
"remote synced label": "Synced with peers",
|
|
1860
|
-
"open settings panel label": "Show Settings"
|
|
1826
|
+
"open settings panel label": "Show Settings",
|
|
1827
|
+
"open space settings label": "Space Settings",
|
|
1828
|
+
"members tab label": "Members",
|
|
1829
|
+
"settings tab label": "Settings"
|
|
1861
1830
|
}
|
|
1862
1831
|
}
|
|
1863
1832
|
}
|
|
1864
1833
|
];
|
|
1865
1834
|
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/SpacePlugin.tsx";
|
|
1866
1835
|
var ACTIVE_NODE_BROADCAST_INTERVAL = 3e4;
|
|
1836
|
+
var WAIT_FOR_OBJECT_TIMEOUT2 = 1e3;
|
|
1867
1837
|
var SPACE_MAX_OBJECTS = 500;
|
|
1868
1838
|
var DIRECTORY_TYPE = "text/directory";
|
|
1869
1839
|
var parseSpacePlugin = (plugin) => Array.isArray(plugin?.provides.space?.enabled) ? plugin : void 0;
|
|
1870
|
-
var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
1871
|
-
const settings = new import_local_storage.LocalStorageStore(
|
|
1840
|
+
var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "spaceInvitationCode", firstRun, onFirstRun } = {}) => {
|
|
1841
|
+
const settings = new import_local_storage.LocalStorageStore(import_chunk_JFDDZI4Y.SPACE_PLUGIN, {
|
|
1872
1842
|
onSpaceCreate: "dxos.org/plugin/markdown/action/create"
|
|
1873
1843
|
});
|
|
1874
|
-
const state = new import_local_storage.LocalStorageStore(
|
|
1844
|
+
const state = new import_local_storage.LocalStorageStore(import_chunk_JFDDZI4Y.SPACE_PLUGIN, {
|
|
1875
1845
|
awaiting: void 0,
|
|
1876
1846
|
spaceNames: {},
|
|
1877
1847
|
viewersByObject: {},
|
|
1878
1848
|
// TODO(wittjosiah): Stop using (Complex)Map inside reactive object.
|
|
1879
1849
|
viewersByIdentity: new import_util.ComplexMap(import_react_client.PublicKey.hash),
|
|
1880
|
-
sdkMigrationRunning: {}
|
|
1850
|
+
sdkMigrationRunning: {},
|
|
1851
|
+
navigableCollections: false
|
|
1881
1852
|
});
|
|
1882
1853
|
const subscriptions = new import_async.EventSubscriptions();
|
|
1883
1854
|
const spaceSubscriptions = new import_async.EventSubscriptions();
|
|
@@ -1888,6 +1859,11 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1888
1859
|
let layoutPlugin;
|
|
1889
1860
|
let navigationPlugin;
|
|
1890
1861
|
let attentionPlugin;
|
|
1862
|
+
const createSpaceInvitationUrl = (invitationCode) => {
|
|
1863
|
+
const baseUrl = new URL(invitationUrl);
|
|
1864
|
+
baseUrl.searchParams.set(invitationParam, invitationCode);
|
|
1865
|
+
return baseUrl.toString();
|
|
1866
|
+
};
|
|
1891
1867
|
const onSpaceReady = async () => {
|
|
1892
1868
|
if (!clientPlugin || !intentPlugin || !graphPlugin || !navigationPlugin || !layoutPlugin || !attentionPlugin) {
|
|
1893
1869
|
return;
|
|
@@ -1920,13 +1896,19 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1920
1896
|
}
|
|
1921
1897
|
const node = graph.findNode(soloPart.id);
|
|
1922
1898
|
if (!node && soloPart.id.length === import_echo.FQ_ID_LENGTH) {
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1899
|
+
const timeout = setTimeout(async () => {
|
|
1900
|
+
const node2 = graph.findNode(soloPart.id);
|
|
1901
|
+
if (!node2) {
|
|
1902
|
+
await dispatch({
|
|
1903
|
+
plugin: import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
1904
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.WAIT_FOR_OBJECT,
|
|
1905
|
+
data: {
|
|
1906
|
+
id: soloPart.id
|
|
1907
|
+
}
|
|
1908
|
+
});
|
|
1928
1909
|
}
|
|
1929
|
-
});
|
|
1910
|
+
}, WAIT_FOR_OBJECT_TIMEOUT2);
|
|
1911
|
+
return () => clearTimeout(timeout);
|
|
1930
1912
|
}
|
|
1931
1913
|
}));
|
|
1932
1914
|
subscriptions.add(client.spaces.subscribe(async (spaces) => {
|
|
@@ -1976,7 +1958,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1976
1958
|
err: err.message
|
|
1977
1959
|
}, {
|
|
1978
1960
|
F: __dxlog_file6,
|
|
1979
|
-
L:
|
|
1961
|
+
L: 292,
|
|
1980
1962
|
S: void 0,
|
|
1981
1963
|
C: (f, a) => f(...a)
|
|
1982
1964
|
});
|
|
@@ -2022,7 +2004,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2022
2004
|
}).unsubscribe);
|
|
2023
2005
|
};
|
|
2024
2006
|
return {
|
|
2025
|
-
meta:
|
|
2007
|
+
meta: import_chunk_JFDDZI4Y.meta_default,
|
|
2026
2008
|
ready: async (plugins) => {
|
|
2027
2009
|
settings.prop({
|
|
2028
2010
|
key: "showHidden",
|
|
@@ -2034,6 +2016,9 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2034
2016
|
key: "spaceNames",
|
|
2035
2017
|
type: import_local_storage.LocalStorageStore.json()
|
|
2036
2018
|
});
|
|
2019
|
+
if ((0, import_app_framework.findPlugin)(plugins, "dxos.org/plugin/stack")) {
|
|
2020
|
+
state.values.navigableCollections = true;
|
|
2021
|
+
}
|
|
2037
2022
|
graphPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseGraphPlugin);
|
|
2038
2023
|
layoutPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseLayoutPlugin);
|
|
2039
2024
|
navigationPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseNavigationPlugin);
|
|
@@ -2047,7 +2032,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2047
2032
|
const dispatch = intentPlugin.provides.intent.dispatch;
|
|
2048
2033
|
const handleFirstRun = async () => {
|
|
2049
2034
|
const defaultSpace = client.spaces.default;
|
|
2050
|
-
defaultSpace.properties[
|
|
2035
|
+
defaultSpace.properties[import_chunk_FYWGZYJB.CollectionType.typename] = (0, import_echo.create)(import_chunk_FYWGZYJB.CollectionType, {
|
|
2051
2036
|
objects: [],
|
|
2052
2037
|
views: {}
|
|
2053
2038
|
});
|
|
@@ -2092,7 +2077,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2092
2077
|
label: [
|
|
2093
2078
|
"open settings panel label",
|
|
2094
2079
|
{
|
|
2095
|
-
ns:
|
|
2080
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
2096
2081
|
}
|
|
2097
2082
|
],
|
|
2098
2083
|
icon: "ph--gear--regular"
|
|
@@ -2104,11 +2089,11 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2104
2089
|
}) : null,
|
|
2105
2090
|
metadata: {
|
|
2106
2091
|
records: {
|
|
2107
|
-
[
|
|
2092
|
+
[import_chunk_FYWGZYJB.CollectionType.typename]: {
|
|
2108
2093
|
placeholder: [
|
|
2109
2094
|
"unnamed collection label",
|
|
2110
2095
|
{
|
|
2111
|
-
ns:
|
|
2096
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
2112
2097
|
}
|
|
2113
2098
|
],
|
|
2114
2099
|
icon: "ph--cards-three--regular",
|
|
@@ -2122,7 +2107,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2122
2107
|
},
|
|
2123
2108
|
echo: {
|
|
2124
2109
|
schema: [
|
|
2125
|
-
|
|
2110
|
+
import_chunk_FYWGZYJB.CollectionType
|
|
2126
2111
|
]
|
|
2127
2112
|
},
|
|
2128
2113
|
surface: {
|
|
@@ -2131,12 +2116,12 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2131
2116
|
case "article":
|
|
2132
2117
|
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, {
|
|
2133
2118
|
data: {
|
|
2134
|
-
object: data.object.properties[
|
|
2119
|
+
object: data.object.properties[import_chunk_FYWGZYJB.CollectionType.typename],
|
|
2135
2120
|
id: data.object.id
|
|
2136
2121
|
},
|
|
2137
2122
|
role,
|
|
2138
2123
|
...rest
|
|
2139
|
-
}) : data.object instanceof
|
|
2124
|
+
}) : data.object instanceof import_chunk_FYWGZYJB.CollectionType ? {
|
|
2140
2125
|
node: /* @__PURE__ */ import_react.default.createElement(CollectionMain, {
|
|
2141
2126
|
collection: data.object
|
|
2142
2127
|
}),
|
|
@@ -2152,11 +2137,13 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2152
2137
|
disposition: "fallback"
|
|
2153
2138
|
} : null;
|
|
2154
2139
|
case "dialog":
|
|
2155
|
-
if (data.component === "dxos.org/plugin/space/
|
|
2156
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
})
|
|
2140
|
+
if (data.component === "dxos.org/plugin/space/SpaceSettingsDialog") {
|
|
2141
|
+
return /* @__PURE__ */ import_react.default.createElement(SpaceSettingsDialog, {
|
|
2142
|
+
...data.subject,
|
|
2143
|
+
createInvitationUrl: createSpaceInvitationUrl
|
|
2144
|
+
});
|
|
2145
|
+
} else if (data.component === "dxos.org/plugin/space/JoinDialog") {
|
|
2146
|
+
return /* @__PURE__ */ import_react.default.createElement(JoinDialog, data.subject);
|
|
2160
2147
|
}
|
|
2161
2148
|
return null;
|
|
2162
2149
|
case "popover": {
|
|
@@ -2190,22 +2177,22 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2190
2177
|
return null;
|
|
2191
2178
|
}
|
|
2192
2179
|
const space = (0, import_echo.isSpace)(data.object) ? data.object : (0, import_echo.getSpace)(data.object);
|
|
2193
|
-
const object = (0, import_echo.isSpace)(data.object) ? data.object.state.get() === import_echo.SpaceState.SPACE_READY ? space?.properties[
|
|
2180
|
+
const object = (0, import_echo.isSpace)(data.object) ? data.object.state.get() === import_echo.SpaceState.SPACE_READY ? space?.properties[import_chunk_FYWGZYJB.CollectionType.typename] : void 0 : data.object;
|
|
2194
2181
|
return space && object ? {
|
|
2195
2182
|
node: /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(SpacePresence, {
|
|
2196
2183
|
object
|
|
2197
2184
|
}), space.properties[COMPOSER_SPACE_LOCK] ? null : /* @__PURE__ */ import_react.default.createElement(ShareSpaceButton, {
|
|
2198
|
-
|
|
2185
|
+
space
|
|
2199
2186
|
})),
|
|
2200
2187
|
disposition: "hoist"
|
|
2201
2188
|
} : null;
|
|
2202
2189
|
}
|
|
2203
2190
|
case "section":
|
|
2204
|
-
return data.object instanceof
|
|
2191
|
+
return data.object instanceof import_chunk_FYWGZYJB.CollectionType ? /* @__PURE__ */ import_react.default.createElement(CollectionSection, {
|
|
2205
2192
|
collection: data.object
|
|
2206
2193
|
}) : null;
|
|
2207
2194
|
case "settings":
|
|
2208
|
-
return data.plugin ===
|
|
2195
|
+
return data.plugin === import_chunk_JFDDZI4Y.meta_default.id ? /* @__PURE__ */ import_react.default.createElement(SpacePluginSettings, {
|
|
2209
2196
|
settings: settings.values
|
|
2210
2197
|
}) : null;
|
|
2211
2198
|
case "menu-footer":
|
|
@@ -2239,7 +2226,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2239
2226
|
return [
|
|
2240
2227
|
// Create spaces group node.
|
|
2241
2228
|
(0, import_plugin_graph.createExtension)({
|
|
2242
|
-
id: `${
|
|
2229
|
+
id: `${import_chunk_JFDDZI4Y.SPACE_PLUGIN}/root`,
|
|
2243
2230
|
filter: (node) => node.id === "root",
|
|
2244
2231
|
connector: () => {
|
|
2245
2232
|
const isReady = (0, import_plugin_graph.toSignal)((onChange) => {
|
|
@@ -2262,11 +2249,12 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2262
2249
|
label: [
|
|
2263
2250
|
"spaces label",
|
|
2264
2251
|
{
|
|
2265
|
-
ns:
|
|
2252
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
2266
2253
|
}
|
|
2267
2254
|
],
|
|
2268
2255
|
testId: "spacePlugin.spaces",
|
|
2269
2256
|
role: "branch",
|
|
2257
|
+
disabled: true,
|
|
2270
2258
|
childrenPersistenceClass: "echo",
|
|
2271
2259
|
onRearrangeChildren: async (nextOrder) => {
|
|
2272
2260
|
graph._sortEdges(SPACES, "outbound", nextOrder.map(({ id }) => id));
|
|
@@ -2278,7 +2266,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2278
2266
|
} else {
|
|
2279
2267
|
import_log.log.warn("spaces order object not found", void 0, {
|
|
2280
2268
|
F: __dxlog_file6,
|
|
2281
|
-
L:
|
|
2269
|
+
L: 596,
|
|
2282
2270
|
S: void 0,
|
|
2283
2271
|
C: (f, a) => f(...a)
|
|
2284
2272
|
});
|
|
@@ -2295,55 +2283,44 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2295
2283
|
filter: (node) => node.id === SPACES,
|
|
2296
2284
|
actions: () => [
|
|
2297
2285
|
{
|
|
2298
|
-
id:
|
|
2286
|
+
id: import_chunk_JFDDZI4Y.SpaceAction.CREATE,
|
|
2299
2287
|
data: async () => {
|
|
2300
|
-
await dispatch(
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
},
|
|
2305
|
-
{
|
|
2306
|
-
action: import_app_framework.NavigationAction.OPEN
|
|
2307
|
-
}
|
|
2308
|
-
]);
|
|
2288
|
+
await dispatch({
|
|
2289
|
+
plugin: import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
2290
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.CREATE
|
|
2291
|
+
});
|
|
2309
2292
|
},
|
|
2310
2293
|
properties: {
|
|
2311
2294
|
label: [
|
|
2312
2295
|
"create space label",
|
|
2313
2296
|
{
|
|
2314
|
-
ns:
|
|
2297
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
2315
2298
|
}
|
|
2316
2299
|
],
|
|
2317
2300
|
icon: "ph--plus--regular",
|
|
2318
2301
|
disposition: "item",
|
|
2319
2302
|
testId: "spacePlugin.createSpace",
|
|
2320
|
-
className: "
|
|
2303
|
+
className: "border-t border-separator"
|
|
2321
2304
|
}
|
|
2322
2305
|
},
|
|
2323
2306
|
{
|
|
2324
|
-
id:
|
|
2307
|
+
id: import_chunk_JFDDZI4Y.SpaceAction.JOIN,
|
|
2325
2308
|
data: async () => {
|
|
2326
|
-
await dispatch(
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
},
|
|
2331
|
-
{
|
|
2332
|
-
action: import_app_framework.NavigationAction.OPEN
|
|
2333
|
-
}
|
|
2334
|
-
]);
|
|
2309
|
+
await dispatch({
|
|
2310
|
+
plugin: import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
2311
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.JOIN
|
|
2312
|
+
});
|
|
2335
2313
|
},
|
|
2336
2314
|
properties: {
|
|
2337
2315
|
label: [
|
|
2338
2316
|
"join space label",
|
|
2339
2317
|
{
|
|
2340
|
-
ns:
|
|
2318
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
2341
2319
|
}
|
|
2342
2320
|
],
|
|
2343
2321
|
icon: "ph--sign-in--regular",
|
|
2344
2322
|
disposition: "item",
|
|
2345
|
-
testId: "spacePlugin.joinSpace"
|
|
2346
|
-
className: "pbe-4"
|
|
2323
|
+
testId: "spacePlugin.joinSpace"
|
|
2347
2324
|
}
|
|
2348
2325
|
}
|
|
2349
2326
|
],
|
|
@@ -2353,36 +2330,40 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2353
2330
|
if (!spaces || !isReady) {
|
|
2354
2331
|
return;
|
|
2355
2332
|
}
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
id,
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
space
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2333
|
+
try {
|
|
2334
|
+
const [spacesOrder] = memoizeQuery(client.spaces.default, import_echo.Filter.schema(import_echo.Expando, {
|
|
2335
|
+
key: SHARED
|
|
2336
|
+
}));
|
|
2337
|
+
const order = spacesOrder?.order ?? [];
|
|
2338
|
+
const orderMap = new Map(order.map((id, index) => [
|
|
2339
|
+
id,
|
|
2340
|
+
index
|
|
2341
|
+
]));
|
|
2342
|
+
return [
|
|
2343
|
+
...spaces.filter((space) => orderMap.has(space.id)).sort((a, b) => orderMap.get(a.id) - orderMap.get(b.id)),
|
|
2344
|
+
...spaces.filter((space) => !orderMap.has(space.id))
|
|
2345
|
+
].filter((space) => settings.values.showHidden ? true : space.state.get() !== import_echo.SpaceState.SPACE_INACTIVE).map((space) => constructSpaceNode({
|
|
2346
|
+
space,
|
|
2347
|
+
navigable: state.values.navigableCollections,
|
|
2348
|
+
personal: space === client.spaces.default,
|
|
2349
|
+
namesCache: state.values.spaceNames,
|
|
2350
|
+
resolve
|
|
2351
|
+
}));
|
|
2352
|
+
} catch {
|
|
2353
|
+
}
|
|
2373
2354
|
}
|
|
2374
2355
|
}),
|
|
2375
2356
|
// Find an object by its fully qualified id.
|
|
2376
2357
|
(0, import_plugin_graph.createExtension)({
|
|
2377
|
-
id: `${
|
|
2358
|
+
id: `${import_chunk_JFDDZI4Y.SPACE_PLUGIN}/objects`,
|
|
2378
2359
|
resolver: ({ id }) => {
|
|
2379
2360
|
const [spaceId, objectId] = id.split(":");
|
|
2380
2361
|
const space = client.spaces.get().find((space2) => space2.id === spaceId);
|
|
2381
2362
|
if (!space) {
|
|
2382
2363
|
return;
|
|
2383
2364
|
}
|
|
2384
|
-
const
|
|
2385
|
-
if (
|
|
2365
|
+
const spaceState = (0, import_plugin_graph.toSignal)((onChange) => space.state.subscribe(() => onChange()).unsubscribe, () => space.state.get(), space.id);
|
|
2366
|
+
if (spaceState !== import_echo.SpaceState.SPACE_READY) {
|
|
2386
2367
|
return;
|
|
2387
2368
|
}
|
|
2388
2369
|
const store = (0, import_plugin_graph.memoize)(() => (0, import_signals_core.signal)(space.db.getObjectById(objectId)), id);
|
|
@@ -2398,17 +2379,19 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2398
2379
|
return createObjectNode({
|
|
2399
2380
|
object,
|
|
2400
2381
|
space,
|
|
2401
|
-
resolve
|
|
2382
|
+
resolve,
|
|
2383
|
+
navigable: state.values.navigableCollections
|
|
2402
2384
|
});
|
|
2403
2385
|
}
|
|
2404
2386
|
}),
|
|
2405
2387
|
// Create space actions and action groups.
|
|
2406
2388
|
(0, import_plugin_graph.createExtension)({
|
|
2407
|
-
id: `${
|
|
2389
|
+
id: `${import_chunk_JFDDZI4Y.SPACE_PLUGIN}/actions`,
|
|
2408
2390
|
filter: (node) => (0, import_echo.isSpace)(node.data),
|
|
2409
2391
|
actionGroups: ({ node }) => constructSpaceActionGroups({
|
|
2410
2392
|
space: node.data,
|
|
2411
|
-
dispatch
|
|
2393
|
+
dispatch,
|
|
2394
|
+
navigable: state.values.navigableCollections
|
|
2412
2395
|
}),
|
|
2413
2396
|
actions: ({ node }) => {
|
|
2414
2397
|
const space = node.data;
|
|
@@ -2422,32 +2405,34 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2422
2405
|
}),
|
|
2423
2406
|
// Create nodes for objects in the root collection of a space.
|
|
2424
2407
|
(0, import_plugin_graph.createExtension)({
|
|
2425
|
-
id: `${
|
|
2408
|
+
id: `${import_chunk_JFDDZI4Y.SPACE_PLUGIN}/root-collection`,
|
|
2426
2409
|
filter: (node) => (0, import_echo.isSpace)(node.data),
|
|
2427
2410
|
connector: ({ node }) => {
|
|
2428
2411
|
const space = node.data;
|
|
2429
|
-
const
|
|
2430
|
-
if (
|
|
2412
|
+
const spaceState = (0, import_plugin_graph.toSignal)((onChange) => space.state.subscribe(() => onChange()).unsubscribe, () => space.state.get(), space.id);
|
|
2413
|
+
if (spaceState !== import_echo.SpaceState.SPACE_READY) {
|
|
2431
2414
|
return;
|
|
2432
2415
|
}
|
|
2433
|
-
const collection = space.properties[
|
|
2416
|
+
const collection = space.properties[import_chunk_FYWGZYJB.CollectionType.typename];
|
|
2434
2417
|
if (!collection) {
|
|
2435
2418
|
return;
|
|
2436
2419
|
}
|
|
2437
2420
|
return collection.objects.filter(import_util.nonNullable).map((object) => createObjectNode({
|
|
2438
2421
|
object,
|
|
2439
2422
|
space,
|
|
2440
|
-
resolve
|
|
2423
|
+
resolve,
|
|
2424
|
+
navigable: state.values.navigableCollections
|
|
2441
2425
|
})).filter(import_util.nonNullable);
|
|
2442
2426
|
}
|
|
2443
2427
|
}),
|
|
2444
2428
|
// Create collection actions and action groups.
|
|
2445
2429
|
(0, import_plugin_graph.createExtension)({
|
|
2446
|
-
id: `${
|
|
2430
|
+
id: `${import_chunk_JFDDZI4Y.SPACE_PLUGIN}/object-actions`,
|
|
2447
2431
|
filter: (node) => (0, import_echo.isEchoObject)(node.data),
|
|
2448
2432
|
actionGroups: ({ node }) => constructObjectActionGroups({
|
|
2449
2433
|
object: node.data,
|
|
2450
|
-
dispatch
|
|
2434
|
+
dispatch,
|
|
2435
|
+
navigable: state.values.navigableCollections
|
|
2451
2436
|
}),
|
|
2452
2437
|
actions: ({ node }) => constructObjectActions({
|
|
2453
2438
|
node,
|
|
@@ -2456,8 +2441,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2456
2441
|
}),
|
|
2457
2442
|
// Create nodes for objects in collections.
|
|
2458
2443
|
(0, import_plugin_graph.createExtension)({
|
|
2459
|
-
id: `${
|
|
2460
|
-
filter: (node) => node.data instanceof
|
|
2444
|
+
id: `${import_chunk_JFDDZI4Y.SPACE_PLUGIN}/collection-objects`,
|
|
2445
|
+
filter: (node) => node.data instanceof import_chunk_FYWGZYJB.CollectionType,
|
|
2461
2446
|
connector: ({ node }) => {
|
|
2462
2447
|
const collection = node.data;
|
|
2463
2448
|
const space = (0, import_echo.getSpace)(collection);
|
|
@@ -2467,13 +2452,14 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2467
2452
|
return collection.objects.filter(import_util.nonNullable).map((object) => createObjectNode({
|
|
2468
2453
|
object,
|
|
2469
2454
|
space,
|
|
2470
|
-
resolve
|
|
2455
|
+
resolve,
|
|
2456
|
+
navigable: state.values.navigableCollections
|
|
2471
2457
|
})).filter(import_util.nonNullable);
|
|
2472
2458
|
}
|
|
2473
2459
|
}),
|
|
2474
2460
|
// Create nodes for object settings.
|
|
2475
2461
|
(0, import_plugin_graph.createExtension)({
|
|
2476
|
-
id: `${
|
|
2462
|
+
id: `${import_chunk_JFDDZI4Y.SPACE_PLUGIN}/settings-for-subject`,
|
|
2477
2463
|
resolver: ({ id }) => {
|
|
2478
2464
|
if (!id.endsWith("~settings")) {
|
|
2479
2465
|
return;
|
|
@@ -2487,12 +2473,12 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2487
2473
|
const label2 = space ? space.properties.name || [
|
|
2488
2474
|
"unnamed space label",
|
|
2489
2475
|
{
|
|
2490
|
-
ns:
|
|
2476
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
2491
2477
|
}
|
|
2492
2478
|
] : [
|
|
2493
2479
|
"unnamed object settings label",
|
|
2494
2480
|
{
|
|
2495
|
-
ns:
|
|
2481
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
2496
2482
|
}
|
|
2497
2483
|
];
|
|
2498
2484
|
return {
|
|
@@ -2522,7 +2508,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2522
2508
|
const label = meta.label?.(object) || object.name || meta.placeholder || [
|
|
2523
2509
|
"unnamed object settings label",
|
|
2524
2510
|
{
|
|
2525
|
-
ns:
|
|
2511
|
+
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
2526
2512
|
}
|
|
2527
2513
|
];
|
|
2528
2514
|
return {
|
|
@@ -2549,8 +2535,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2549
2535
|
inputType: SPACES,
|
|
2550
2536
|
outputType: DIRECTORY_TYPE,
|
|
2551
2537
|
serialize: (node) => ({
|
|
2552
|
-
name: translations_default[0]["en-US"][
|
|
2553
|
-
data: translations_default[0]["en-US"][
|
|
2538
|
+
name: translations_default[0]["en-US"][import_chunk_JFDDZI4Y.SPACE_PLUGIN]["spaces label"],
|
|
2539
|
+
data: translations_default[0]["en-US"][import_chunk_JFDDZI4Y.SPACE_PLUGIN]["spaces label"],
|
|
2554
2540
|
type: DIRECTORY_TYPE
|
|
2555
2541
|
}),
|
|
2556
2542
|
deserialize: () => {
|
|
@@ -2560,14 +2546,14 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2560
2546
|
inputType: SPACE_TYPE,
|
|
2561
2547
|
outputType: DIRECTORY_TYPE,
|
|
2562
2548
|
serialize: (node) => ({
|
|
2563
|
-
name: node.data.properties.name ?? translations_default[0]["en-US"][
|
|
2564
|
-
data: node.data.properties.name ?? translations_default[0]["en-US"][
|
|
2549
|
+
name: node.data.properties.name ?? translations_default[0]["en-US"][import_chunk_JFDDZI4Y.SPACE_PLUGIN]["unnamed space label"],
|
|
2550
|
+
data: node.data.properties.name ?? translations_default[0]["en-US"][import_chunk_JFDDZI4Y.SPACE_PLUGIN]["unnamed space label"],
|
|
2565
2551
|
type: DIRECTORY_TYPE
|
|
2566
2552
|
}),
|
|
2567
2553
|
deserialize: async (data) => {
|
|
2568
2554
|
const result = await dispatch({
|
|
2569
|
-
plugin:
|
|
2570
|
-
action:
|
|
2555
|
+
plugin: import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
2556
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.CREATE,
|
|
2571
2557
|
data: {
|
|
2572
2558
|
name: data.name
|
|
2573
2559
|
}
|
|
@@ -2576,25 +2562,25 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2576
2562
|
}
|
|
2577
2563
|
},
|
|
2578
2564
|
{
|
|
2579
|
-
inputType:
|
|
2565
|
+
inputType: import_chunk_FYWGZYJB.CollectionType.typename,
|
|
2580
2566
|
outputType: DIRECTORY_TYPE,
|
|
2581
2567
|
serialize: (node) => ({
|
|
2582
|
-
name: node.data.name ?? translations_default[0]["en-US"][
|
|
2583
|
-
data: node.data.name ?? translations_default[0]["en-US"][
|
|
2568
|
+
name: node.data.name ?? translations_default[0]["en-US"][import_chunk_JFDDZI4Y.SPACE_PLUGIN]["unnamed collection label"],
|
|
2569
|
+
data: node.data.name ?? translations_default[0]["en-US"][import_chunk_JFDDZI4Y.SPACE_PLUGIN]["unnamed collection label"],
|
|
2584
2570
|
type: DIRECTORY_TYPE
|
|
2585
2571
|
}),
|
|
2586
2572
|
deserialize: async (data, ancestors) => {
|
|
2587
2573
|
const space = ancestors.find(import_echo.isSpace);
|
|
2588
|
-
const collection = ancestors.findLast((ancestor) => ancestor instanceof
|
|
2574
|
+
const collection = ancestors.findLast((ancestor) => ancestor instanceof import_chunk_FYWGZYJB.CollectionType) ?? space?.properties[import_chunk_FYWGZYJB.CollectionType.typename];
|
|
2589
2575
|
if (!space || !collection) {
|
|
2590
2576
|
return;
|
|
2591
2577
|
}
|
|
2592
2578
|
const result = await dispatch({
|
|
2593
|
-
plugin:
|
|
2594
|
-
action:
|
|
2579
|
+
plugin: import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
2580
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.ADD_OBJECT,
|
|
2595
2581
|
data: {
|
|
2596
2582
|
target: collection,
|
|
2597
|
-
object: (0, import_echo.create)(
|
|
2583
|
+
object: (0, import_echo.create)(import_chunk_FYWGZYJB.CollectionType, {
|
|
2598
2584
|
name: data.name,
|
|
2599
2585
|
objects: [],
|
|
2600
2586
|
views: {}
|
|
@@ -2612,23 +2598,23 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2612
2598
|
const clientPlugin2 = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_client.parseClientPlugin);
|
|
2613
2599
|
const client = clientPlugin2?.provides.client;
|
|
2614
2600
|
switch (intent.action) {
|
|
2615
|
-
case
|
|
2601
|
+
case import_chunk_JFDDZI4Y.SpaceAction.WAIT_FOR_OBJECT: {
|
|
2616
2602
|
state.values.awaiting = intent.data?.id;
|
|
2617
2603
|
return {
|
|
2618
2604
|
data: true
|
|
2619
2605
|
};
|
|
2620
2606
|
}
|
|
2621
|
-
case
|
|
2607
|
+
case import_chunk_JFDDZI4Y.SpaceAction.CREATE: {
|
|
2622
2608
|
if (!client) {
|
|
2623
2609
|
return;
|
|
2624
2610
|
}
|
|
2625
2611
|
const space = await client.spaces.create(intent.data);
|
|
2626
2612
|
await space.waitUntilReady();
|
|
2627
|
-
const collection = (0, import_echo.create)(
|
|
2613
|
+
const collection = (0, import_echo.create)(import_chunk_FYWGZYJB.CollectionType, {
|
|
2628
2614
|
objects: [],
|
|
2629
2615
|
views: {}
|
|
2630
2616
|
});
|
|
2631
|
-
space.properties[
|
|
2617
|
+
space.properties[import_chunk_FYWGZYJB.CollectionType.typename] = collection;
|
|
2632
2618
|
if (import_migrations.Migrations.versionProperty) {
|
|
2633
2619
|
space.properties[import_migrations.Migrations.versionProperty] = import_migrations.Migrations.targetVersion;
|
|
2634
2620
|
}
|
|
@@ -2652,11 +2638,14 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2652
2638
|
}
|
|
2653
2639
|
},
|
|
2654
2640
|
{
|
|
2655
|
-
action:
|
|
2641
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.ADD_OBJECT,
|
|
2656
2642
|
data: {
|
|
2657
2643
|
target: space
|
|
2658
2644
|
}
|
|
2659
2645
|
},
|
|
2646
|
+
{
|
|
2647
|
+
action: import_app_framework.NavigationAction.OPEN
|
|
2648
|
+
},
|
|
2660
2649
|
{
|
|
2661
2650
|
action: import_app_framework.NavigationAction.EXPOSE
|
|
2662
2651
|
}
|
|
@@ -2676,78 +2665,59 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2676
2665
|
]
|
|
2677
2666
|
};
|
|
2678
2667
|
}
|
|
2679
|
-
case
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
]
|
|
2693
|
-
}
|
|
2694
|
-
},
|
|
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
|
-
],
|
|
2710
|
-
[
|
|
2711
|
-
{
|
|
2712
|
-
action: import_meta.ObservabilityAction.SEND_EVENT,
|
|
2713
|
-
data: {
|
|
2714
|
-
name: "space.join",
|
|
2715
|
-
properties: {
|
|
2716
|
-
spaceId: space.id
|
|
2717
|
-
}
|
|
2718
|
-
}
|
|
2668
|
+
case import_chunk_JFDDZI4Y.SpaceAction.JOIN: {
|
|
2669
|
+
return {
|
|
2670
|
+
data: true,
|
|
2671
|
+
intents: [
|
|
2672
|
+
[
|
|
2673
|
+
{
|
|
2674
|
+
action: import_app_framework.LayoutAction.SET_LAYOUT,
|
|
2675
|
+
data: {
|
|
2676
|
+
element: "dialog",
|
|
2677
|
+
component: "dxos.org/plugin/space/JoinDialog",
|
|
2678
|
+
dialogBlockAlign: "start",
|
|
2679
|
+
subject: {
|
|
2680
|
+
initialInvitationCode: intent.data?.invitationCode
|
|
2719
2681
|
}
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
}
|
|
2682
|
+
}
|
|
2683
|
+
}
|
|
2684
|
+
]
|
|
2685
|
+
]
|
|
2686
|
+
};
|
|
2725
2687
|
break;
|
|
2726
2688
|
}
|
|
2727
|
-
case
|
|
2728
|
-
const
|
|
2729
|
-
if (
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
const target = (0, import_app_framework.firstIdInPart)(navigationPlugin?.provides.location.active, "main");
|
|
2734
|
-
const result = await clientPlugin2.provides.client.shell.shareSpace({
|
|
2735
|
-
spaceId,
|
|
2736
|
-
target
|
|
2737
|
-
});
|
|
2689
|
+
case import_chunk_JFDDZI4Y.SpaceAction.SHARE: {
|
|
2690
|
+
const space = intent.data?.space;
|
|
2691
|
+
if ((0, import_echo.isSpace)(space) && !space.properties[COMPOSER_SPACE_LOCK]) {
|
|
2692
|
+
const active = navigationPlugin?.provides.location.active;
|
|
2693
|
+
const mode = layoutPlugin?.provides.layout.layoutMode;
|
|
2694
|
+
const target = active ? (0, import_app_framework.firstIdInPart)(active, mode === "solo" ? "solo" : "main") : void 0;
|
|
2738
2695
|
return {
|
|
2739
|
-
data:
|
|
2696
|
+
data: true,
|
|
2740
2697
|
intents: [
|
|
2698
|
+
[
|
|
2699
|
+
{
|
|
2700
|
+
action: import_app_framework.LayoutAction.SET_LAYOUT,
|
|
2701
|
+
data: {
|
|
2702
|
+
element: "dialog",
|
|
2703
|
+
component: "dxos.org/plugin/space/SpaceSettingsDialog",
|
|
2704
|
+
dialogBlockAlign: "start",
|
|
2705
|
+
subject: {
|
|
2706
|
+
space,
|
|
2707
|
+
target,
|
|
2708
|
+
initialTab: "members",
|
|
2709
|
+
createInvitationUrl: createSpaceInvitationUrl
|
|
2710
|
+
}
|
|
2711
|
+
}
|
|
2712
|
+
}
|
|
2713
|
+
],
|
|
2741
2714
|
[
|
|
2742
2715
|
{
|
|
2743
2716
|
action: import_meta.ObservabilityAction.SEND_EVENT,
|
|
2744
2717
|
data: {
|
|
2745
2718
|
name: "space.share",
|
|
2746
2719
|
properties: {
|
|
2747
|
-
|
|
2748
|
-
members: result.members?.length,
|
|
2749
|
-
error: result.error?.message,
|
|
2750
|
-
cancelled: result.cancelled
|
|
2720
|
+
space: space.id
|
|
2751
2721
|
}
|
|
2752
2722
|
}
|
|
2753
2723
|
}
|
|
@@ -2757,7 +2727,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2757
2727
|
}
|
|
2758
2728
|
break;
|
|
2759
2729
|
}
|
|
2760
|
-
case
|
|
2730
|
+
case import_chunk_JFDDZI4Y.SpaceAction.LOCK: {
|
|
2761
2731
|
const space = intent.data?.space;
|
|
2762
2732
|
if ((0, import_echo.isSpace)(space)) {
|
|
2763
2733
|
space.properties[COMPOSER_SPACE_LOCK] = true;
|
|
@@ -2780,7 +2750,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2780
2750
|
}
|
|
2781
2751
|
break;
|
|
2782
2752
|
}
|
|
2783
|
-
case
|
|
2753
|
+
case import_chunk_JFDDZI4Y.SpaceAction.UNLOCK: {
|
|
2784
2754
|
const space = intent.data?.space;
|
|
2785
2755
|
if ((0, import_echo.isSpace)(space)) {
|
|
2786
2756
|
space.properties[COMPOSER_SPACE_LOCK] = false;
|
|
@@ -2803,7 +2773,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2803
2773
|
}
|
|
2804
2774
|
break;
|
|
2805
2775
|
}
|
|
2806
|
-
case
|
|
2776
|
+
case import_chunk_JFDDZI4Y.SpaceAction.RENAME: {
|
|
2807
2777
|
const { caller, space } = intent.data ?? {};
|
|
2808
2778
|
if (typeof caller === "string" && (0, import_echo.isSpace)(space)) {
|
|
2809
2779
|
return {
|
|
@@ -2824,7 +2794,33 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2824
2794
|
}
|
|
2825
2795
|
break;
|
|
2826
2796
|
}
|
|
2827
|
-
case
|
|
2797
|
+
case import_chunk_JFDDZI4Y.SpaceAction.OPEN_SETTINGS: {
|
|
2798
|
+
const space = intent.data?.space;
|
|
2799
|
+
if ((0, import_echo.isSpace)(space)) {
|
|
2800
|
+
return {
|
|
2801
|
+
data: true,
|
|
2802
|
+
intents: [
|
|
2803
|
+
[
|
|
2804
|
+
{
|
|
2805
|
+
action: import_app_framework.LayoutAction.SET_LAYOUT,
|
|
2806
|
+
data: {
|
|
2807
|
+
element: "dialog",
|
|
2808
|
+
component: "dxos.org/plugin/space/SpaceSettingsDialog",
|
|
2809
|
+
dialogBlockAlign: "start",
|
|
2810
|
+
subject: {
|
|
2811
|
+
space,
|
|
2812
|
+
initialTab: "settings",
|
|
2813
|
+
createInvitationUrl: createSpaceInvitationUrl
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
}
|
|
2817
|
+
]
|
|
2818
|
+
]
|
|
2819
|
+
};
|
|
2820
|
+
}
|
|
2821
|
+
break;
|
|
2822
|
+
}
|
|
2823
|
+
case import_chunk_JFDDZI4Y.SpaceAction.OPEN: {
|
|
2828
2824
|
const space = intent.data?.space;
|
|
2829
2825
|
if ((0, import_echo.isSpace)(space)) {
|
|
2830
2826
|
await space.open();
|
|
@@ -2834,7 +2830,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2834
2830
|
}
|
|
2835
2831
|
break;
|
|
2836
2832
|
}
|
|
2837
|
-
case
|
|
2833
|
+
case import_chunk_JFDDZI4Y.SpaceAction.CLOSE: {
|
|
2838
2834
|
const space = intent.data?.space;
|
|
2839
2835
|
if ((0, import_echo.isSpace)(space)) {
|
|
2840
2836
|
await space.close();
|
|
@@ -2844,7 +2840,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2844
2840
|
}
|
|
2845
2841
|
break;
|
|
2846
2842
|
}
|
|
2847
|
-
case
|
|
2843
|
+
case import_chunk_JFDDZI4Y.SpaceAction.MIGRATE: {
|
|
2848
2844
|
const space = intent.data?.space;
|
|
2849
2845
|
if ((0, import_echo.isSpace)(space)) {
|
|
2850
2846
|
if (space.state.get() === import_echo.SpaceState.SPACE_REQUIRES_MIGRATION) {
|
|
@@ -2873,7 +2869,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2873
2869
|
}
|
|
2874
2870
|
break;
|
|
2875
2871
|
}
|
|
2876
|
-
case
|
|
2872
|
+
case import_chunk_JFDDZI4Y.SpaceAction.ADD_OBJECT: {
|
|
2877
2873
|
const object = intent.data?.object ?? intent.data?.result;
|
|
2878
2874
|
if (!(0, import_echo_schema.isReactiveObject)(object)) {
|
|
2879
2875
|
return;
|
|
@@ -2892,15 +2888,15 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2892
2888
|
data: {
|
|
2893
2889
|
element: "toast",
|
|
2894
2890
|
subject: {
|
|
2895
|
-
id: `${
|
|
2896
|
-
title: translations_default[0]["en-US"][
|
|
2897
|
-
description: translations_default[0]["en-US"][
|
|
2891
|
+
id: `${import_chunk_JFDDZI4Y.SPACE_PLUGIN}/space-limit`,
|
|
2892
|
+
title: translations_default[0]["en-US"][import_chunk_JFDDZI4Y.SPACE_PLUGIN]["space limit label"],
|
|
2893
|
+
description: translations_default[0]["en-US"][import_chunk_JFDDZI4Y.SPACE_PLUGIN]["space limit description"],
|
|
2898
2894
|
duration: 5e3,
|
|
2899
2895
|
icon: "ph--warning--regular",
|
|
2900
|
-
actionLabel: translations_default[0]["en-US"][
|
|
2901
|
-
actionAlt: translations_default[0]["en-US"][
|
|
2896
|
+
actionLabel: translations_default[0]["en-US"][import_chunk_JFDDZI4Y.SPACE_PLUGIN]["remove deleted objects label"],
|
|
2897
|
+
actionAlt: translations_default[0]["en-US"][import_chunk_JFDDZI4Y.SPACE_PLUGIN]["remove deleted objects alt"],
|
|
2902
2898
|
// TODO(wittjosiah): Use OS namespace.
|
|
2903
|
-
closeLabel: translations_default[0]["en-US"][
|
|
2899
|
+
closeLabel: translations_default[0]["en-US"][import_chunk_JFDDZI4Y.SPACE_PLUGIN]["space limit close label"],
|
|
2904
2900
|
onAction: () => space.db.coreDatabase.unlinkDeletedObjects()
|
|
2905
2901
|
}
|
|
2906
2902
|
}
|
|
@@ -2920,20 +2916,20 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2920
2916
|
]
|
|
2921
2917
|
};
|
|
2922
2918
|
}
|
|
2923
|
-
if (intent.data?.target instanceof
|
|
2919
|
+
if (intent.data?.target instanceof import_chunk_FYWGZYJB.CollectionType) {
|
|
2924
2920
|
intent.data?.target.objects.push(object);
|
|
2925
2921
|
} else if ((0, import_echo.isSpace)(intent.data?.target)) {
|
|
2926
|
-
const collection = space.properties[
|
|
2927
|
-
if (collection instanceof
|
|
2922
|
+
const collection = space.properties[import_chunk_FYWGZYJB.CollectionType.typename];
|
|
2923
|
+
if (collection instanceof import_chunk_FYWGZYJB.CollectionType) {
|
|
2928
2924
|
collection.objects.push(object);
|
|
2929
2925
|
} else {
|
|
2930
|
-
const collection2 = (0, import_echo.create)(
|
|
2926
|
+
const collection2 = (0, import_echo.create)(import_chunk_FYWGZYJB.CollectionType, {
|
|
2931
2927
|
objects: [
|
|
2932
2928
|
object
|
|
2933
2929
|
],
|
|
2934
2930
|
views: {}
|
|
2935
2931
|
});
|
|
2936
|
-
space.properties[
|
|
2932
|
+
space.properties[import_chunk_FYWGZYJB.CollectionType.typename] = collection2;
|
|
2937
2933
|
}
|
|
2938
2934
|
}
|
|
2939
2935
|
return {
|
|
@@ -2963,27 +2959,36 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2963
2959
|
]
|
|
2964
2960
|
};
|
|
2965
2961
|
}
|
|
2966
|
-
case
|
|
2967
|
-
const
|
|
2968
|
-
|
|
2969
|
-
|
|
2962
|
+
case import_chunk_JFDDZI4Y.SpaceAction.REMOVE_OBJECTS: {
|
|
2963
|
+
const objects = intent.data?.objects ?? intent.data?.result;
|
|
2964
|
+
(0, import_invariant.invariant)(Array.isArray(objects), void 0, {
|
|
2965
|
+
F: __dxlog_file6,
|
|
2966
|
+
L: 1291,
|
|
2967
|
+
S: void 0,
|
|
2968
|
+
A: [
|
|
2969
|
+
"Array.isArray(objects)",
|
|
2970
|
+
""
|
|
2971
|
+
]
|
|
2972
|
+
});
|
|
2973
|
+
const space = (0, import_echo.getSpace)(objects[0]);
|
|
2974
|
+
if (!space || !objects.every((obj) => (0, import_echo.isEchoObject)(obj) && (0, import_echo.getSpace)(obj) === space)) {
|
|
2970
2975
|
return;
|
|
2971
2976
|
}
|
|
2972
2977
|
const resolve = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin)?.provides.metadata.resolver;
|
|
2973
2978
|
const activeParts = navigationPlugin?.provides.location.active;
|
|
2974
2979
|
const openObjectIds = new Set((0, import_app_framework.openIds)(activeParts ?? {}));
|
|
2975
2980
|
if (!intent.undo && resolve) {
|
|
2976
|
-
const parentCollection = intent.data?.collection ?? space.properties[
|
|
2977
|
-
const
|
|
2981
|
+
const parentCollection = intent.data?.collection ?? space.properties[import_chunk_FYWGZYJB.CollectionType.typename];
|
|
2982
|
+
const nestedObjectsList = await Promise.all(objects.map((obj) => getNestedObjects(obj, resolve)));
|
|
2978
2983
|
const deletionData = {
|
|
2979
|
-
|
|
2984
|
+
objects,
|
|
2980
2985
|
parentCollection,
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
wasActive: [
|
|
2984
|
-
|
|
2985
|
-
...
|
|
2986
|
-
].map((obj) => (0, import_echo.fullyQualifiedId)(obj)).filter((id) => openObjectIds.has(id))
|
|
2986
|
+
indices: objects.map((obj) => parentCollection instanceof import_chunk_FYWGZYJB.CollectionType ? parentCollection.objects.indexOf(obj) : -1),
|
|
2987
|
+
nestedObjectsList,
|
|
2988
|
+
wasActive: objects.flatMap((obj, i) => [
|
|
2989
|
+
obj,
|
|
2990
|
+
...nestedObjectsList[i]
|
|
2991
|
+
]).map((obj) => (0, import_echo.fullyQualifiedId)(obj)).filter((id) => openObjectIds.has(id))
|
|
2987
2992
|
};
|
|
2988
2993
|
if (deletionData.wasActive.length > 0) {
|
|
2989
2994
|
await intentPlugin?.provides.intent.dispatch({
|
|
@@ -2996,35 +3001,40 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2996
3001
|
}
|
|
2997
3002
|
});
|
|
2998
3003
|
}
|
|
2999
|
-
if (parentCollection instanceof
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
+
if (deletionData.parentCollection instanceof import_chunk_FYWGZYJB.CollectionType) {
|
|
3005
|
+
[
|
|
3006
|
+
...deletionData.indices
|
|
3007
|
+
].sort((a, b) => b - a).forEach((index) => {
|
|
3008
|
+
if (index !== -1) {
|
|
3009
|
+
deletionData.parentCollection.objects.splice(index, 1);
|
|
3010
|
+
}
|
|
3011
|
+
});
|
|
3004
3012
|
}
|
|
3005
|
-
deletionData.
|
|
3013
|
+
deletionData.nestedObjectsList.flat().forEach((obj) => {
|
|
3006
3014
|
space.db.remove(obj);
|
|
3007
3015
|
});
|
|
3008
|
-
space.db.remove(
|
|
3009
|
-
const undoMessageKey =
|
|
3016
|
+
objects.forEach((obj) => space.db.remove(obj));
|
|
3017
|
+
const undoMessageKey = objects.some((obj) => obj instanceof import_chunk_FYWGZYJB.CollectionType) ? "collection deleted label" : objects.length > 1 ? "objects deleted label" : "object deleted label";
|
|
3010
3018
|
return {
|
|
3011
3019
|
data: true,
|
|
3012
3020
|
undoable: {
|
|
3013
|
-
//
|
|
3014
|
-
message: translations_default[0]["en-US"][
|
|
3021
|
+
// TODO(ZaymonFC): Pluralize if more than one object.
|
|
3022
|
+
message: translations_default[0]["en-US"][import_chunk_JFDDZI4Y.SPACE_PLUGIN][undoMessageKey],
|
|
3015
3023
|
data: deletionData
|
|
3016
3024
|
}
|
|
3017
3025
|
};
|
|
3018
3026
|
} else {
|
|
3019
3027
|
const undoData = intent.data;
|
|
3020
|
-
if (undoData && (
|
|
3021
|
-
const
|
|
3022
|
-
undoData.
|
|
3028
|
+
if (undoData?.objects?.length && undoData.objects.every(import_echo.isEchoObject) && undoData.parentCollection instanceof import_chunk_FYWGZYJB.CollectionType) {
|
|
3029
|
+
const restoredObjects = undoData.objects.map((obj) => space.db.add(obj));
|
|
3030
|
+
undoData.nestedObjectsList.flat().forEach((obj) => {
|
|
3023
3031
|
space.db.add(obj);
|
|
3024
3032
|
});
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3033
|
+
undoData.indices.forEach((index, i) => {
|
|
3034
|
+
if (index !== -1) {
|
|
3035
|
+
undoData.parentCollection.objects.splice(index, 0, restoredObjects[i]);
|
|
3036
|
+
}
|
|
3037
|
+
});
|
|
3028
3038
|
if (undoData.wasActive.length > 0) {
|
|
3029
3039
|
await intentPlugin?.provides.intent.dispatch({
|
|
3030
3040
|
action: import_app_framework.NavigationAction.OPEN,
|
|
@@ -3044,7 +3054,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
3044
3054
|
};
|
|
3045
3055
|
}
|
|
3046
3056
|
}
|
|
3047
|
-
case
|
|
3057
|
+
case import_chunk_JFDDZI4Y.SpaceAction.RENAME_OBJECT: {
|
|
3048
3058
|
const object = intent.data?.object ?? intent.data?.result;
|
|
3049
3059
|
const caller = intent.data?.caller;
|
|
3050
3060
|
if ((0, import_echo_schema.isReactiveObject)(object) && caller) {
|
|
@@ -3066,7 +3076,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
3066
3076
|
}
|
|
3067
3077
|
break;
|
|
3068
3078
|
}
|
|
3069
|
-
case
|
|
3079
|
+
case import_chunk_JFDDZI4Y.SpaceAction.DUPLICATE_OBJECT: {
|
|
3070
3080
|
const originalObject = intent.data?.object ?? intent.data?.result;
|
|
3071
3081
|
const resolve = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin)?.provides.metadata.resolver;
|
|
3072
3082
|
const space = (0, import_echo.isSpace)(intent.data?.target) ? intent.data?.target : (0, import_echo.getSpace)(intent.data?.target);
|
|
@@ -3078,7 +3088,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
3078
3088
|
intents: [
|
|
3079
3089
|
[
|
|
3080
3090
|
{
|
|
3081
|
-
action:
|
|
3091
|
+
action: import_chunk_JFDDZI4Y.SpaceAction.ADD_OBJECT,
|
|
3082
3092
|
data: {
|
|
3083
3093
|
object: newObject,
|
|
3084
3094
|
target: intent.data?.target
|
|
@@ -3088,7 +3098,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
3088
3098
|
]
|
|
3089
3099
|
};
|
|
3090
3100
|
}
|
|
3091
|
-
case
|
|
3101
|
+
case import_chunk_JFDDZI4Y.SpaceAction.TOGGLE_HIDDEN: {
|
|
3092
3102
|
settings.values.showHidden = intent.data?.state ?? !settings.values.showHidden;
|
|
3093
3103
|
return {
|
|
3094
3104
|
data: true
|
|
@@ -3113,6 +3123,7 @@ var src_default = SpacePlugin;
|
|
|
3113
3123
|
ContactType,
|
|
3114
3124
|
DefaultObjectSettings,
|
|
3115
3125
|
FullPresence,
|
|
3126
|
+
JoinDialog,
|
|
3116
3127
|
MenuFooter,
|
|
3117
3128
|
MessageState,
|
|
3118
3129
|
MessageType,
|
|
@@ -3130,10 +3141,10 @@ var src_default = SpacePlugin;
|
|
|
3130
3141
|
SmallPresence,
|
|
3131
3142
|
SmallPresenceLive,
|
|
3132
3143
|
SpaceAction,
|
|
3133
|
-
SpaceMain,
|
|
3134
3144
|
SpacePlugin,
|
|
3145
|
+
SpacePluginSettings,
|
|
3135
3146
|
SpacePresence,
|
|
3136
|
-
|
|
3147
|
+
SpaceSettingsDialog,
|
|
3137
3148
|
SpaceSettingsPanel,
|
|
3138
3149
|
SyncStatus,
|
|
3139
3150
|
SyncStatusDetail,
|