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