@dxos/plugin-space 0.7.2 → 0.7.3-main.2dd075e
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-DJE2HYFV.mjs → chunk-FTKV32QZ.mjs} +9 -2
- package/dist/lib/browser/chunk-FTKV32QZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-OWZKSWMX.mjs → chunk-MWKXNS5S.mjs} +13 -3
- package/dist/lib/browser/{chunk-OWZKSWMX.mjs.map → chunk-MWKXNS5S.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +1056 -674
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +3 -1
- package/dist/lib/browser/types/index.mjs +5 -3
- package/dist/lib/node/{chunk-FYWGZYJB.cjs → chunk-6SNOZF7Y.cjs} +18 -7
- package/dist/lib/node/chunk-6SNOZF7Y.cjs.map +7 -0
- package/dist/lib/node/{chunk-JFDDZI4Y.cjs → chunk-QNVEU2UD.cjs} +12 -4
- package/dist/lib/node/chunk-QNVEU2UD.cjs.map +7 -0
- package/dist/lib/node/index.cjs +1160 -789
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.cjs +7 -5
- package/dist/lib/node/meta.cjs.map +2 -2
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +14 -12
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/{chunk-MCEAI4CV.mjs → chunk-OHEAWSCA.mjs} +13 -3
- package/dist/lib/node-esm/{chunk-MCEAI4CV.mjs.map → chunk-OHEAWSCA.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-DVUZ7A7G.mjs → chunk-UMV7XREB.mjs} +9 -2
- package/dist/lib/node-esm/chunk-UMV7XREB.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1056 -674
- 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 +3 -1
- package/dist/lib/node-esm/types/index.mjs +5 -3
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +9 -0
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -0
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +10 -0
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +22 -0
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -0
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts +3 -0
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -0
- package/dist/types/src/components/CreateDialog/index.d.ts +3 -0
- package/dist/types/src/components/CreateDialog/index.d.ts.map +1 -0
- package/dist/types/src/components/PopoverRenameObject.d.ts +1 -1
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts +6 -0
- package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/Space.d.ts +8 -3
- package/dist/types/src/components/SyncStatus/Space.d.ts.map +1 -1
- 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 +1 -2
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts +8 -0
- package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/index.d.ts +1 -0
- package/dist/types/src/components/SyncStatus/index.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/sync-state.d.ts +5 -1
- package/dist/types/src/components/SyncStatus/sync-state.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +5 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +224 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +14 -14
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +3 -13
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +38 -35
- package/src/SpacePlugin.tsx +169 -75
- package/src/components/AwaitingObject.tsx +2 -2
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +83 -0
- package/src/components/CreateDialog/CreateObjectDialog.tsx +97 -0
- package/src/components/CreateDialog/CreateObjectPanel.tsx +169 -0
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +57 -0
- package/src/components/CreateDialog/index.ts +6 -0
- package/src/components/PopoverRenameObject.tsx +1 -1
- package/src/components/SpacePluginSettings.tsx +3 -32
- package/src/components/SpaceSettings/SpaceSettingsDialog.tsx +1 -1
- package/src/components/SpaceSettings/SpaceSettingsPanel.tsx +2 -6
- package/src/components/SyncStatus/InlineSyncStatus.tsx +45 -0
- package/src/components/SyncStatus/Space.tsx +30 -6
- package/src/components/SyncStatus/SyncStatus.stories.tsx +3 -32
- package/src/components/SyncStatus/SyncStatus.tsx +32 -14
- package/src/components/SyncStatus/SyncStatusDetail.stories.tsx +83 -0
- package/src/components/SyncStatus/index.ts +1 -0
- package/src/components/SyncStatus/sync-state.ts +24 -0
- package/src/components/index.ts +1 -0
- package/src/meta.ts +6 -0
- package/src/translations.ts +15 -0
- package/src/types/types.ts +20 -16
- package/src/util.tsx +51 -141
- package/dist/lib/browser/chunk-DJE2HYFV.mjs.map +0 -7
- package/dist/lib/node/chunk-FYWGZYJB.cjs.map +0 -7
- package/dist/lib/node/chunk-JFDDZI4Y.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-DVUZ7A7G.mjs.map +0 -7
package/dist/lib/node/index.cjs
CHANGED
|
@@ -28,34 +28,39 @@ 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_6SNOZF7Y.ActorSchema,
|
|
32
32
|
AwaitingObject: () => AwaitingObject,
|
|
33
33
|
COMPOSER_SPACE_LOCK: () => COMPOSER_SPACE_LOCK,
|
|
34
|
-
ChannelType: () =>
|
|
34
|
+
ChannelType: () => import_chunk_6SNOZF7Y.ChannelType,
|
|
35
|
+
CollectionAction: () => import_chunk_QNVEU2UD.CollectionAction,
|
|
35
36
|
CollectionMain: () => CollectionMain,
|
|
36
37
|
CollectionSection: () => CollectionSection,
|
|
37
|
-
CollectionType: () =>
|
|
38
|
-
ContactType: () =>
|
|
38
|
+
CollectionType: () => import_chunk_6SNOZF7Y.CollectionType,
|
|
39
|
+
ContactType: () => import_chunk_6SNOZF7Y.ContactType,
|
|
40
|
+
CreateObjectDialog: () => CreateObjectDialog,
|
|
41
|
+
CreateSpaceDialog: () => CreateSpaceDialog,
|
|
39
42
|
DefaultObjectSettings: () => DefaultObjectSettings,
|
|
40
43
|
FullPresence: () => FullPresence,
|
|
44
|
+
InlineSyncStatus: () => InlineSyncStatus,
|
|
41
45
|
JoinDialog: () => JoinDialog,
|
|
42
46
|
MenuFooter: () => MenuFooter,
|
|
43
|
-
MessageState: () =>
|
|
44
|
-
MessageType: () =>
|
|
47
|
+
MessageState: () => import_chunk_6SNOZF7Y.MessageState,
|
|
48
|
+
MessageType: () => import_chunk_6SNOZF7Y.MessageType,
|
|
45
49
|
PersistenceStatus: () => PersistenceStatus,
|
|
46
50
|
PopoverRenameObject: () => PopoverRenameObject,
|
|
47
51
|
PopoverRenameSpace: () => PopoverRenameSpace,
|
|
48
52
|
SHARED: () => SHARED,
|
|
49
53
|
SPACES: () => SPACES,
|
|
50
|
-
SPACE_DIRECTORY_HANDLE: () =>
|
|
51
|
-
SPACE_PLUGIN: () =>
|
|
52
|
-
SPACE_PLUGIN_SHORT_ID: () =>
|
|
54
|
+
SPACE_DIRECTORY_HANDLE: () => import_chunk_6SNOZF7Y.SPACE_DIRECTORY_HANDLE,
|
|
55
|
+
SPACE_PLUGIN: () => import_chunk_QNVEU2UD.SPACE_PLUGIN,
|
|
56
|
+
SPACE_PLUGIN_SHORT_ID: () => import_chunk_QNVEU2UD.SPACE_PLUGIN_SHORT_ID,
|
|
53
57
|
SPACE_TYPE: () => SPACE_TYPE,
|
|
54
58
|
ShareSpaceButton: () => ShareSpaceButton,
|
|
55
59
|
ShareSpaceButtonImpl: () => ShareSpaceButtonImpl,
|
|
56
60
|
SmallPresence: () => SmallPresence,
|
|
57
61
|
SmallPresenceLive: () => SmallPresenceLive,
|
|
58
|
-
SpaceAction: () =>
|
|
62
|
+
SpaceAction: () => import_chunk_QNVEU2UD.SpaceAction,
|
|
63
|
+
SpaceForm: () => import_chunk_6SNOZF7Y.SpaceForm,
|
|
59
64
|
SpacePlugin: () => SpacePlugin,
|
|
60
65
|
SpacePluginSettings: () => SpacePluginSettings,
|
|
61
66
|
SpacePresence: () => SpacePresence,
|
|
@@ -64,12 +69,10 @@ __export(node_exports, {
|
|
|
64
69
|
SyncStatus: () => SyncStatus,
|
|
65
70
|
SyncStatusDetail: () => SyncStatusDetail,
|
|
66
71
|
SyncStatusIndicator: () => SyncStatusIndicator,
|
|
67
|
-
ThreadStatus: () =>
|
|
68
|
-
ThreadType: () =>
|
|
72
|
+
ThreadStatus: () => import_chunk_6SNOZF7Y.ThreadStatus,
|
|
73
|
+
ThreadType: () => import_chunk_6SNOZF7Y.ThreadType,
|
|
69
74
|
cloneObject: () => cloneObject,
|
|
70
|
-
constructObjectActionGroups: () => constructObjectActionGroups,
|
|
71
75
|
constructObjectActions: () => constructObjectActions,
|
|
72
|
-
constructSpaceActionGroups: () => constructSpaceActionGroups,
|
|
73
76
|
constructSpaceActions: () => constructSpaceActions,
|
|
74
77
|
constructSpaceNode: () => constructSpaceNode,
|
|
75
78
|
createObjectNode: () => createObjectNode,
|
|
@@ -78,13 +81,13 @@ __export(node_exports, {
|
|
|
78
81
|
getNestedObjects: () => getNestedObjects,
|
|
79
82
|
getSpaceDisplayName: () => getSpaceDisplayName,
|
|
80
83
|
memoizeQuery: () => memoizeQuery,
|
|
81
|
-
|
|
84
|
+
parseSchemaPlugin: () => import_chunk_6SNOZF7Y.parseSchemaPlugin,
|
|
82
85
|
parseSpacePlugin: () => parseSpacePlugin,
|
|
83
86
|
translations: () => translations_default
|
|
84
87
|
});
|
|
85
88
|
module.exports = __toCommonJS(node_exports);
|
|
86
|
-
var
|
|
87
|
-
var
|
|
89
|
+
var import_chunk_QNVEU2UD = require("./chunk-QNVEU2UD.cjs");
|
|
90
|
+
var import_chunk_6SNOZF7Y = require("./chunk-6SNOZF7Y.cjs");
|
|
88
91
|
var import_signals_core = require("@preact/signals-core");
|
|
89
92
|
var import_react = __toESM(require("react"));
|
|
90
93
|
var import_app_framework = require("@dxos/app-framework");
|
|
@@ -92,6 +95,7 @@ var import_async = require("@dxos/async");
|
|
|
92
95
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
93
96
|
var import_core = require("@dxos/echo-signals/core");
|
|
94
97
|
var import_invariant = require("@dxos/invariant");
|
|
98
|
+
var import_live_object = require("@dxos/live-object");
|
|
95
99
|
var import_local_storage = require("@dxos/local-storage");
|
|
96
100
|
var import_log = require("@dxos/log");
|
|
97
101
|
var import_migrations = require("@dxos/migrations");
|
|
@@ -99,6 +103,7 @@ var import_plugin_attention = require("@dxos/plugin-attention");
|
|
|
99
103
|
var import_plugin_client = require("@dxos/plugin-client");
|
|
100
104
|
var import_plugin_graph = require("@dxos/plugin-graph");
|
|
101
105
|
var import_meta = require("@dxos/plugin-observability/meta");
|
|
106
|
+
var import_metadata = require("@dxos/protocols/proto/dxos/echo/metadata");
|
|
102
107
|
var import_react_client = require("@dxos/react-client");
|
|
103
108
|
var import_echo = require("@dxos/react-client/echo");
|
|
104
109
|
var import_react2 = require("@dxos/shell/react");
|
|
@@ -111,93 +116,115 @@ var import_echo2 = require("@dxos/react-client/echo");
|
|
|
111
116
|
var import_react_ui = require("@dxos/react-ui");
|
|
112
117
|
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
113
118
|
var import_react5 = __toESM(require("react"));
|
|
119
|
+
var import_app_framework3 = require("@dxos/app-framework");
|
|
120
|
+
var import_react_client3 = require("@dxos/react-client");
|
|
121
|
+
var import_echo3 = require("@dxos/react-client/echo");
|
|
114
122
|
var import_react_ui2 = require("@dxos/react-ui");
|
|
115
|
-
var import_react_ui_theme2 = require("@dxos/react-ui-theme");
|
|
116
123
|
var import_react6 = __toESM(require("react"));
|
|
124
|
+
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
125
|
+
var import_echo4 = require("@dxos/react-client/echo");
|
|
117
126
|
var import_react_ui3 = require("@dxos/react-ui");
|
|
127
|
+
var import_react_ui_form = require("@dxos/react-ui-form");
|
|
128
|
+
var import_react_ui_searchlist = require("@dxos/react-ui-searchlist");
|
|
129
|
+
var import_util2 = require("@dxos/util");
|
|
130
|
+
var import_echo_schema3 = require("@dxos/echo-schema");
|
|
131
|
+
var import_invariant2 = require("@dxos/invariant");
|
|
132
|
+
var import_live_object2 = require("@dxos/live-object");
|
|
133
|
+
var import_migrations2 = require("@dxos/migrations");
|
|
134
|
+
var import_plugin_graph2 = require("@dxos/plugin-graph");
|
|
135
|
+
var import_echo5 = require("@dxos/react-client/echo");
|
|
118
136
|
var import_react7 = __toESM(require("react"));
|
|
137
|
+
var import_app_framework4 = require("@dxos/app-framework");
|
|
119
138
|
var import_react_ui4 = require("@dxos/react-ui");
|
|
139
|
+
var import_react_ui_form2 = require("@dxos/react-ui-form");
|
|
120
140
|
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");
|
|
125
141
|
var import_react_ui5 = require("@dxos/react-ui");
|
|
126
|
-
var
|
|
127
|
-
var
|
|
128
|
-
var import_react11 = __toESM(require("react"));
|
|
129
|
-
var import_echo4 = require("@dxos/client/echo");
|
|
130
|
-
var import_react_client3 = require("@dxos/react-client");
|
|
142
|
+
var import_react_ui_theme2 = require("@dxos/react-ui-theme");
|
|
143
|
+
var import_react9 = __toESM(require("react"));
|
|
131
144
|
var import_react_ui6 = require("@dxos/react-ui");
|
|
132
|
-
var
|
|
133
|
-
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
134
|
-
var import_invariant2 = require("@dxos/invariant");
|
|
135
|
-
var import_migrations2 = require("@dxos/migrations");
|
|
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");
|
|
145
|
+
var import_react10 = __toESM(require("react"));
|
|
141
146
|
var import_react_ui7 = require("@dxos/react-ui");
|
|
142
|
-
var
|
|
143
|
-
var
|
|
144
|
-
var
|
|
147
|
+
var import_react11 = __toESM(require("react"));
|
|
148
|
+
var import_app_framework5 = require("@dxos/app-framework");
|
|
149
|
+
var import_plugin_graph3 = require("@dxos/plugin-graph");
|
|
150
|
+
var import_meta2 = require("@dxos/plugin-observability/meta");
|
|
151
|
+
var import_echo6 = require("@dxos/react-client/echo");
|
|
145
152
|
var import_react_ui8 = require("@dxos/react-ui");
|
|
146
|
-
var
|
|
153
|
+
var import_react12 = require("@dxos/shell/react");
|
|
154
|
+
var import_react13 = require("@phosphor-icons/react");
|
|
155
|
+
var import_react14 = __toESM(require("react"));
|
|
156
|
+
var import_echo7 = require("@dxos/client/echo");
|
|
157
|
+
var import_react_client4 = require("@dxos/react-client");
|
|
147
158
|
var import_react_ui9 = require("@dxos/react-ui");
|
|
159
|
+
var import_react15 = require("@phosphor-icons/react");
|
|
148
160
|
var import_react16 = __toESM(require("react"));
|
|
149
|
-
var
|
|
161
|
+
var import_async2 = require("@dxos/async");
|
|
150
162
|
var import_react_ui10 = require("@dxos/react-ui");
|
|
163
|
+
var import_react_ui_theme3 = require("@dxos/react-ui-theme");
|
|
151
164
|
var import_react17 = __toESM(require("react"));
|
|
152
|
-
var
|
|
153
|
-
var import_display_name = require("@dxos/display-name");
|
|
154
|
-
var import_react_client4 = require("@dxos/react-client");
|
|
155
|
-
var import_echo6 = require("@dxos/react-client/echo");
|
|
156
|
-
var import_halo = require("@dxos/react-client/halo");
|
|
165
|
+
var import_log2 = require("@dxos/log");
|
|
157
166
|
var import_react_ui11 = require("@dxos/react-ui");
|
|
158
|
-
var import_react_ui_attention = require("@dxos/react-ui-attention");
|
|
159
|
-
var import_util2 = require("@dxos/util");
|
|
160
167
|
var import_react18 = __toESM(require("react"));
|
|
161
|
-
var import_app_framework7 = require("@dxos/app-framework");
|
|
162
168
|
var import_react_ui12 = require("@dxos/react-ui");
|
|
163
|
-
var import_react_ui_form = require("@dxos/react-ui-form");
|
|
164
169
|
var import_react19 = __toESM(require("react"));
|
|
165
|
-
var
|
|
170
|
+
var import_app_framework6 = require("@dxos/app-framework");
|
|
166
171
|
var import_react_ui13 = require("@dxos/react-ui");
|
|
167
|
-
var
|
|
168
|
-
var
|
|
169
|
-
var
|
|
170
|
-
var
|
|
171
|
-
var
|
|
172
|
-
var
|
|
173
|
-
var import_halo2 = require("@dxos/react-client/halo");
|
|
172
|
+
var import_react20 = __toESM(require("react"));
|
|
173
|
+
var import_app_framework7 = require("@dxos/app-framework");
|
|
174
|
+
var import_display_name = require("@dxos/display-name");
|
|
175
|
+
var import_react_client5 = require("@dxos/react-client");
|
|
176
|
+
var import_echo8 = require("@dxos/react-client/echo");
|
|
177
|
+
var import_halo = require("@dxos/react-client/halo");
|
|
174
178
|
var import_react_ui14 = require("@dxos/react-ui");
|
|
175
|
-
var
|
|
179
|
+
var import_react_ui_attention = require("@dxos/react-ui-attention");
|
|
180
|
+
var import_util3 = require("@dxos/util");
|
|
181
|
+
var import_react21 = __toESM(require("react"));
|
|
182
|
+
var import_app_framework8 = require("@dxos/app-framework");
|
|
183
|
+
var import_react_ui15 = require("@dxos/react-ui");
|
|
184
|
+
var import_react_ui_form3 = require("@dxos/react-ui-form");
|
|
176
185
|
var import_react22 = __toESM(require("react"));
|
|
177
|
-
var
|
|
186
|
+
var import_react_client6 = require("@dxos/react-client");
|
|
187
|
+
var import_react_ui16 = require("@dxos/react-ui");
|
|
188
|
+
var import_react_ui_tabs = require("@dxos/react-ui-tabs");
|
|
189
|
+
var import_react23 = require("@dxos/shell/react");
|
|
190
|
+
var import_react24 = __toESM(require("react"));
|
|
191
|
+
var import_log3 = require("@dxos/log");
|
|
192
|
+
var import_metadata2 = require("@dxos/protocols/proto/dxos/echo/metadata");
|
|
178
193
|
var import_react_client7 = require("@dxos/react-client");
|
|
179
|
-
var
|
|
194
|
+
var import_react_ui17 = require("@dxos/react-ui");
|
|
195
|
+
var import_react_ui_form4 = require("@dxos/react-ui-form");
|
|
196
|
+
var import_react25 = __toESM(require("react"));
|
|
197
|
+
var import_services = require("@dxos/protocols/proto/dxos/client/services");
|
|
198
|
+
var import_metadata3 = require("@dxos/protocols/proto/dxos/echo/metadata");
|
|
199
|
+
var import_react_client8 = require("@dxos/react-client");
|
|
200
|
+
var import_react_ui18 = require("@dxos/react-ui");
|
|
201
|
+
var import_react26 = require("react");
|
|
202
|
+
var import_context = require("@dxos/context");
|
|
203
|
+
var import_protocols = require("@dxos/protocols");
|
|
204
|
+
var import_react_client9 = require("@dxos/react-client");
|
|
205
|
+
var import_react27 = __toESM(require("react"));
|
|
206
|
+
var import_plugin_status_bar = require("@dxos/plugin-status-bar");
|
|
207
|
+
var import_react_client10 = require("@dxos/react-client");
|
|
208
|
+
var import_react_ui19 = require("@dxos/react-ui");
|
|
180
209
|
var import_react_ui_syntax_highlighter = require("@dxos/react-ui-syntax-highlighter");
|
|
181
210
|
var import_react_ui_theme4 = require("@dxos/react-ui-theme");
|
|
182
|
-
var
|
|
183
|
-
var
|
|
211
|
+
var import_react28 = __toESM(require("react"));
|
|
212
|
+
var import_react_client11 = require("@dxos/react-client");
|
|
213
|
+
var import_echo9 = require("@dxos/react-client/echo");
|
|
214
|
+
var import_react_ui20 = require("@dxos/react-ui");
|
|
184
215
|
var import_react_ui_theme5 = require("@dxos/react-ui-theme");
|
|
185
|
-
var import_context = require("@dxos/context");
|
|
186
|
-
var import_react24 = require("react");
|
|
187
216
|
var import_context2 = require("@dxos/context");
|
|
188
|
-
var import_protocols = require("@dxos/protocols");
|
|
189
|
-
var import_react_client8 = require("@dxos/react-client");
|
|
190
217
|
var WAIT_FOR_OBJECT_TIMEOUT = 18e4;
|
|
191
218
|
var TOAST_TIMEOUT = 24e4;
|
|
192
219
|
var AwaitingObject = ({ id }) => {
|
|
193
220
|
const [open, setOpen] = (0, import_react4.useState)(true);
|
|
194
221
|
const [waiting, setWaiting] = (0, import_react4.useState)(true);
|
|
195
222
|
const [found, setFound] = (0, import_react4.useState)(false);
|
|
196
|
-
const { t } = (0, import_react_ui.useTranslation)(
|
|
223
|
+
const { t } = (0, import_react_ui.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
197
224
|
const intentPlugin = (0, import_app_framework2.useResolvePlugin)(import_app_framework2.parseIntentPlugin);
|
|
198
225
|
const navigationPlugin = (0, import_app_framework2.useResolvePlugin)(import_app_framework2.parseNavigationPlugin);
|
|
199
226
|
const client = (0, import_react_client2.useClient)();
|
|
200
|
-
const objects = (0, import_echo2.useQuery)(client.spaces);
|
|
227
|
+
const objects = (0, import_echo2.useQuery)(client.spaces, import_echo2.Filter.all());
|
|
201
228
|
(0, import_react4.useEffect)(() => {
|
|
202
229
|
if (!id) {
|
|
203
230
|
return;
|
|
@@ -222,8 +249,8 @@ var AwaitingObject = ({ id }) => {
|
|
|
222
249
|
intentPlugin
|
|
223
250
|
]);
|
|
224
251
|
const handleClose = async () => intentPlugin?.provides.intent.dispatch({
|
|
225
|
-
plugin:
|
|
226
|
-
action:
|
|
252
|
+
plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
|
|
253
|
+
action: import_chunk_QNVEU2UD.SpaceAction.WAIT_FOR_OBJECT,
|
|
227
254
|
data: {
|
|
228
255
|
id: void 0
|
|
229
256
|
}
|
|
@@ -273,142 +300,32 @@ var AwaitingObject = ({ id }) => {
|
|
|
273
300
|
ns: "appkit"
|
|
274
301
|
})))));
|
|
275
302
|
};
|
|
276
|
-
var CollectionMain = ({ collection }) => {
|
|
277
|
-
const { t } = (0, import_react_ui2.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
278
|
-
return /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
279
|
-
role: "none",
|
|
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"),
|
|
281
|
-
"data-testid": "composer.firstRunMessage"
|
|
282
|
-
}, /* @__PURE__ */ import_react5.default.createElement("p", {
|
|
283
|
-
role: "alert",
|
|
284
|
-
className: (0, import_react_ui_theme2.mx)(import_react_ui_theme2.descriptionText, "border border-dashed border-neutral-400/50 rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words")
|
|
285
|
-
}, collection.name ?? t("unnamed collection label")));
|
|
286
|
-
};
|
|
287
|
-
var CollectionSection = ({ collection }) => {
|
|
288
|
-
const { t } = (0, import_react_ui3.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
289
|
-
return /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
290
|
-
className: "min-bs-[3.5rem] grid grid-rows-subgrid grid-cols-subgrid items-center"
|
|
291
|
-
}, /* @__PURE__ */ import_react6.default.createElement("span", {
|
|
292
|
-
className: "truncate"
|
|
293
|
-
}, collection.name ?? t("unnamed collection label")));
|
|
294
|
-
};
|
|
295
|
-
var DefaultObjectSettings = ({ object }) => {
|
|
296
|
-
const { t } = (0, import_react_ui4.useTranslation)(import_chunk_JFDDZI4Y.SPACE_PLUGIN);
|
|
297
|
-
return /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
298
|
-
role: "form",
|
|
299
|
-
className: "flex flex-col w-full p-2 gap-1"
|
|
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, {
|
|
301
|
-
placeholder: t("name placeholder"),
|
|
302
|
-
value: object.name ?? "",
|
|
303
|
-
onChange: (event) => {
|
|
304
|
-
object.name = event.target.value;
|
|
305
|
-
}
|
|
306
|
-
})));
|
|
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
|
-
};
|
|
389
303
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/util.tsx";
|
|
390
|
-
var SPACES = `${
|
|
304
|
+
var SPACES = `${import_chunk_QNVEU2UD.SPACE_PLUGIN}-spaces`;
|
|
391
305
|
var SPACE_TYPE = "dxos.org/type/Space";
|
|
392
306
|
var COMPOSER_SPACE_LOCK = "dxos.org/plugin/space/lock";
|
|
393
307
|
var SHARED = "shared-spaces";
|
|
394
308
|
var EMPTY_ARRAY = [];
|
|
395
309
|
var memoizeQuery = (spaceOrEcho, filter, options) => {
|
|
396
|
-
const key =
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
310
|
+
const key = JSON.stringify({
|
|
311
|
+
space: (0, import_echo5.isSpace)(spaceOrEcho) ? spaceOrEcho.id : void 0,
|
|
312
|
+
filter: import_echo5.Filter.from(filter).toProto()
|
|
313
|
+
});
|
|
314
|
+
const query = (0, import_plugin_graph2.memoize)(() => (0, import_echo5.isSpace)(spaceOrEcho) ? spaceOrEcho.db.query(filter, options) : spaceOrEcho?.query(filter, options), key);
|
|
315
|
+
const unsubscribe = (0, import_plugin_graph2.memoize)(() => query?.subscribe(), key);
|
|
316
|
+
(0, import_plugin_graph2.cleanup)(() => unsubscribe?.());
|
|
400
317
|
return query?.objects ?? EMPTY_ARRAY;
|
|
401
318
|
};
|
|
402
319
|
var getSpaceDisplayName = (space, { personal, namesCache = {} } = {}) => {
|
|
403
320
|
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 ? [
|
|
404
321
|
"personal space label",
|
|
405
322
|
{
|
|
406
|
-
ns:
|
|
323
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
407
324
|
}
|
|
408
325
|
] : [
|
|
409
326
|
"unnamed space label",
|
|
410
327
|
{
|
|
411
|
-
ns:
|
|
328
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
412
329
|
}
|
|
413
330
|
];
|
|
414
331
|
};
|
|
@@ -456,8 +373,8 @@ var checkPendingMigration = (space) => {
|
|
|
456
373
|
};
|
|
457
374
|
var constructSpaceNode = ({ space, navigable = false, personal, namesCache, resolve }) => {
|
|
458
375
|
const hasPendingMigration = checkPendingMigration(space);
|
|
459
|
-
const collection = space.state.get() === import_echo5.SpaceState.SPACE_READY && space.properties[
|
|
460
|
-
const partials = space.state.get() === import_echo5.SpaceState.SPACE_READY && collection instanceof
|
|
376
|
+
const collection = space.state.get() === import_echo5.SpaceState.SPACE_READY && space.properties[import_chunk_6SNOZF7Y.CollectionType.typename];
|
|
377
|
+
const partials = space.state.get() === import_echo5.SpaceState.SPACE_READY && collection instanceof import_chunk_6SNOZF7Y.CollectionType ? getCollectionGraphNodePartials({
|
|
461
378
|
collection,
|
|
462
379
|
space,
|
|
463
380
|
resolve,
|
|
@@ -485,69 +402,6 @@ var constructSpaceNode = ({ space, navigable = false, personal, namesCache, reso
|
|
|
485
402
|
}
|
|
486
403
|
};
|
|
487
404
|
};
|
|
488
|
-
var constructSpaceActionGroups = ({ space, navigable, dispatch }) => {
|
|
489
|
-
const state = space.state.get();
|
|
490
|
-
const hasPendingMigration = checkPendingMigration(space);
|
|
491
|
-
const getId = (id) => `${id}/${space.id}`;
|
|
492
|
-
if (state !== import_echo5.SpaceState.SPACE_READY || hasPendingMigration) {
|
|
493
|
-
return [];
|
|
494
|
-
}
|
|
495
|
-
const collection = space.properties[import_chunk_FYWGZYJB.CollectionType.typename];
|
|
496
|
-
const actions = [
|
|
497
|
-
{
|
|
498
|
-
id: getId(import_chunk_JFDDZI4Y.SpaceAction.ADD_OBJECT),
|
|
499
|
-
type: import_plugin_graph3.ACTION_GROUP_TYPE,
|
|
500
|
-
data: import_plugin_graph3.actionGroupSymbol,
|
|
501
|
-
properties: {
|
|
502
|
-
label: [
|
|
503
|
-
"create object in space label",
|
|
504
|
-
{
|
|
505
|
-
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
506
|
-
}
|
|
507
|
-
],
|
|
508
|
-
icon: "ph--plus--regular",
|
|
509
|
-
disposition: "toolbar",
|
|
510
|
-
menuType: "searchList",
|
|
511
|
-
testId: "spacePlugin.createObject"
|
|
512
|
-
},
|
|
513
|
-
nodes: [
|
|
514
|
-
{
|
|
515
|
-
id: getId(import_chunk_JFDDZI4Y.SpaceAction.ADD_OBJECT.replace("object", "collection")),
|
|
516
|
-
type: import_plugin_graph3.ACTION_TYPE,
|
|
517
|
-
data: () => dispatch([
|
|
518
|
-
{
|
|
519
|
-
plugin: import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
520
|
-
action: import_chunk_JFDDZI4Y.SpaceAction.ADD_OBJECT,
|
|
521
|
-
data: {
|
|
522
|
-
target: collection,
|
|
523
|
-
object: (0, import_echo_schema2.create)(import_chunk_FYWGZYJB.CollectionType, {
|
|
524
|
-
objects: [],
|
|
525
|
-
views: {}
|
|
526
|
-
})
|
|
527
|
-
}
|
|
528
|
-
},
|
|
529
|
-
...navigable ? [
|
|
530
|
-
{
|
|
531
|
-
action: import_app_framework4.NavigationAction.OPEN
|
|
532
|
-
}
|
|
533
|
-
] : []
|
|
534
|
-
]),
|
|
535
|
-
properties: {
|
|
536
|
-
label: [
|
|
537
|
-
"create collection label",
|
|
538
|
-
{
|
|
539
|
-
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
540
|
-
}
|
|
541
|
-
],
|
|
542
|
-
icon: "ph--cards-three--regular",
|
|
543
|
-
testId: "spacePlugin.createCollection"
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
]
|
|
547
|
-
}
|
|
548
|
-
];
|
|
549
|
-
return actions;
|
|
550
|
-
};
|
|
551
405
|
var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
552
406
|
const state = space.state.get();
|
|
553
407
|
const hasPendingMigration = checkPendingMigration(space);
|
|
@@ -555,12 +409,12 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
555
409
|
const actions = [];
|
|
556
410
|
if (hasPendingMigration) {
|
|
557
411
|
actions.push({
|
|
558
|
-
id: getId(
|
|
559
|
-
type:
|
|
412
|
+
id: getId(import_chunk_QNVEU2UD.SpaceAction.MIGRATE),
|
|
413
|
+
type: import_plugin_graph2.ACTION_GROUP_TYPE,
|
|
560
414
|
data: async () => {
|
|
561
415
|
await dispatch({
|
|
562
|
-
plugin:
|
|
563
|
-
action:
|
|
416
|
+
plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
|
|
417
|
+
action: import_chunk_QNVEU2UD.SpaceAction.MIGRATE,
|
|
564
418
|
data: {
|
|
565
419
|
space
|
|
566
420
|
}
|
|
@@ -570,7 +424,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
570
424
|
label: [
|
|
571
425
|
"migrate space label",
|
|
572
426
|
{
|
|
573
|
-
ns:
|
|
427
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
574
428
|
}
|
|
575
429
|
],
|
|
576
430
|
icon: "ph--database--regular",
|
|
@@ -582,15 +436,38 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
582
436
|
if (state === import_echo5.SpaceState.SPACE_READY && !hasPendingMigration) {
|
|
583
437
|
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
584
438
|
actions.push({
|
|
585
|
-
id: getId(
|
|
586
|
-
type:
|
|
439
|
+
id: getId(import_chunk_QNVEU2UD.SpaceAction.OPEN_CREATE_OBJECT),
|
|
440
|
+
type: import_plugin_graph2.ACTION_TYPE,
|
|
441
|
+
data: async () => {
|
|
442
|
+
await dispatch({
|
|
443
|
+
plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
|
|
444
|
+
action: import_chunk_QNVEU2UD.SpaceAction.OPEN_CREATE_OBJECT,
|
|
445
|
+
data: {
|
|
446
|
+
target: space
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
},
|
|
450
|
+
properties: {
|
|
451
|
+
label: [
|
|
452
|
+
"create object in space label",
|
|
453
|
+
{
|
|
454
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
455
|
+
}
|
|
456
|
+
],
|
|
457
|
+
icon: "ph--plus--regular",
|
|
458
|
+
disposition: "toolbar",
|
|
459
|
+
testId: "spacePlugin.createObject"
|
|
460
|
+
}
|
|
461
|
+
}, {
|
|
462
|
+
id: getId(import_chunk_QNVEU2UD.SpaceAction.SHARE),
|
|
463
|
+
type: import_plugin_graph2.ACTION_TYPE,
|
|
587
464
|
data: async () => {
|
|
588
465
|
if (locked) {
|
|
589
466
|
return;
|
|
590
467
|
}
|
|
591
468
|
await dispatch({
|
|
592
|
-
plugin:
|
|
593
|
-
action:
|
|
469
|
+
plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
|
|
470
|
+
action: import_chunk_QNVEU2UD.SpaceAction.SHARE,
|
|
594
471
|
data: {
|
|
595
472
|
space
|
|
596
473
|
}
|
|
@@ -600,7 +477,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
600
477
|
label: [
|
|
601
478
|
"share space label",
|
|
602
479
|
{
|
|
603
|
-
ns:
|
|
480
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
604
481
|
}
|
|
605
482
|
],
|
|
606
483
|
icon: "ph--users--regular",
|
|
@@ -611,12 +488,12 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
611
488
|
}
|
|
612
489
|
}
|
|
613
490
|
}, {
|
|
614
|
-
id: locked ? getId(
|
|
615
|
-
type:
|
|
491
|
+
id: locked ? getId(import_chunk_QNVEU2UD.SpaceAction.UNLOCK) : getId(import_chunk_QNVEU2UD.SpaceAction.LOCK),
|
|
492
|
+
type: import_plugin_graph2.ACTION_TYPE,
|
|
616
493
|
data: async () => {
|
|
617
494
|
await dispatch({
|
|
618
|
-
plugin:
|
|
619
|
-
action: locked ?
|
|
495
|
+
plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
|
|
496
|
+
action: locked ? import_chunk_QNVEU2UD.SpaceAction.UNLOCK : import_chunk_QNVEU2UD.SpaceAction.LOCK,
|
|
620
497
|
data: {
|
|
621
498
|
space
|
|
622
499
|
}
|
|
@@ -626,18 +503,18 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
626
503
|
label: [
|
|
627
504
|
locked ? "unlock space label" : "lock space label",
|
|
628
505
|
{
|
|
629
|
-
ns:
|
|
506
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
630
507
|
}
|
|
631
508
|
],
|
|
632
509
|
icon: locked ? "ph--lock-simple-open--regular" : "ph--lock-simple--regular"
|
|
633
510
|
}
|
|
634
511
|
}, {
|
|
635
|
-
id: getId(
|
|
636
|
-
type:
|
|
512
|
+
id: getId(import_chunk_QNVEU2UD.SpaceAction.RENAME),
|
|
513
|
+
type: import_plugin_graph2.ACTION_TYPE,
|
|
637
514
|
data: async (params) => {
|
|
638
515
|
await dispatch({
|
|
639
|
-
plugin:
|
|
640
|
-
action:
|
|
516
|
+
plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
|
|
517
|
+
action: import_chunk_QNVEU2UD.SpaceAction.RENAME,
|
|
641
518
|
data: {
|
|
642
519
|
space,
|
|
643
520
|
...params
|
|
@@ -648,7 +525,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
648
525
|
label: [
|
|
649
526
|
"rename space label",
|
|
650
527
|
{
|
|
651
|
-
ns:
|
|
528
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
652
529
|
}
|
|
653
530
|
],
|
|
654
531
|
icon: "ph--pencil-simple-line--regular",
|
|
@@ -658,12 +535,12 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
658
535
|
}
|
|
659
536
|
}
|
|
660
537
|
}, {
|
|
661
|
-
id: getId(
|
|
662
|
-
type:
|
|
538
|
+
id: getId(import_chunk_QNVEU2UD.SpaceAction.OPEN_SETTINGS),
|
|
539
|
+
type: import_plugin_graph2.ACTION_TYPE,
|
|
663
540
|
data: async () => {
|
|
664
541
|
await dispatch({
|
|
665
|
-
plugin:
|
|
666
|
-
action:
|
|
542
|
+
plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
|
|
543
|
+
action: import_chunk_QNVEU2UD.SpaceAction.OPEN_SETTINGS,
|
|
667
544
|
data: {
|
|
668
545
|
space
|
|
669
546
|
}
|
|
@@ -673,7 +550,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
673
550
|
label: [
|
|
674
551
|
"open space settings label",
|
|
675
552
|
{
|
|
676
|
-
ns:
|
|
553
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
677
554
|
}
|
|
678
555
|
],
|
|
679
556
|
icon: "ph--gear--regular"
|
|
@@ -682,12 +559,12 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
682
559
|
}
|
|
683
560
|
if (state !== import_echo5.SpaceState.SPACE_INACTIVE && !hasPendingMigration) {
|
|
684
561
|
actions.push({
|
|
685
|
-
id: getId(
|
|
686
|
-
type:
|
|
562
|
+
id: getId(import_chunk_QNVEU2UD.SpaceAction.CLOSE),
|
|
563
|
+
type: import_plugin_graph2.ACTION_TYPE,
|
|
687
564
|
data: async () => {
|
|
688
565
|
await dispatch({
|
|
689
|
-
plugin:
|
|
690
|
-
action:
|
|
566
|
+
plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
|
|
567
|
+
action: import_chunk_QNVEU2UD.SpaceAction.CLOSE,
|
|
691
568
|
data: {
|
|
692
569
|
space
|
|
693
570
|
}
|
|
@@ -697,7 +574,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
697
574
|
label: [
|
|
698
575
|
"close space label",
|
|
699
576
|
{
|
|
700
|
-
ns:
|
|
577
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
701
578
|
}
|
|
702
579
|
],
|
|
703
580
|
icon: "ph--x--regular",
|
|
@@ -707,12 +584,12 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
707
584
|
}
|
|
708
585
|
if (state === import_echo5.SpaceState.SPACE_INACTIVE) {
|
|
709
586
|
actions.push({
|
|
710
|
-
id: getId(
|
|
711
|
-
type:
|
|
587
|
+
id: getId(import_chunk_QNVEU2UD.SpaceAction.OPEN),
|
|
588
|
+
type: import_plugin_graph2.ACTION_TYPE,
|
|
712
589
|
data: async () => {
|
|
713
590
|
await dispatch({
|
|
714
|
-
plugin:
|
|
715
|
-
action:
|
|
591
|
+
plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
|
|
592
|
+
action: import_chunk_QNVEU2UD.SpaceAction.OPEN,
|
|
716
593
|
data: {
|
|
717
594
|
space
|
|
718
595
|
}
|
|
@@ -722,7 +599,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
722
599
|
label: [
|
|
723
600
|
"open space label",
|
|
724
601
|
{
|
|
725
|
-
ns:
|
|
602
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
726
603
|
}
|
|
727
604
|
],
|
|
728
605
|
icon: "ph--clock-counter-clockwise--regular",
|
|
@@ -733,7 +610,7 @@ var constructSpaceActions = ({ space, dispatch, personal, migrating }) => {
|
|
|
733
610
|
return actions;
|
|
734
611
|
};
|
|
735
612
|
var createObjectNode = ({ object, space, navigable = false, resolve }) => {
|
|
736
|
-
const type = (0,
|
|
613
|
+
const type = (0, import_echo_schema3.getTypename)(object);
|
|
737
614
|
if (!type) {
|
|
738
615
|
return void 0;
|
|
739
616
|
}
|
|
@@ -741,7 +618,7 @@ var createObjectNode = ({ object, space, navigable = false, resolve }) => {
|
|
|
741
618
|
if (Object.keys(metadata).length === 0) {
|
|
742
619
|
return void 0;
|
|
743
620
|
}
|
|
744
|
-
const partials = object instanceof
|
|
621
|
+
const partials = object instanceof import_chunk_6SNOZF7Y.CollectionType ? getCollectionGraphNodePartials({
|
|
745
622
|
collection: object,
|
|
746
623
|
space,
|
|
747
624
|
resolve,
|
|
@@ -761,7 +638,7 @@ var createObjectNode = ({ object, space, navigable = false, resolve }) => {
|
|
|
761
638
|
label: metadata.label?.(object) || object.name || metadata.placeholder || [
|
|
762
639
|
"unnamed object label",
|
|
763
640
|
{
|
|
764
|
-
ns:
|
|
641
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
765
642
|
}
|
|
766
643
|
],
|
|
767
644
|
icon: metadata.icon ?? "ph--placeholder--regular",
|
|
@@ -771,77 +648,42 @@ var createObjectNode = ({ object, space, navigable = false, resolve }) => {
|
|
|
771
648
|
}
|
|
772
649
|
};
|
|
773
650
|
};
|
|
774
|
-
var constructObjectActionGroups = ({ object, navigable, dispatch }) => {
|
|
775
|
-
if (!(object instanceof import_chunk_FYWGZYJB.CollectionType)) {
|
|
776
|
-
return [];
|
|
777
|
-
}
|
|
778
|
-
const collection = object;
|
|
779
|
-
const getId = (id) => `${id}/${(0, import_echo5.fullyQualifiedId)(object)}`;
|
|
780
|
-
const actions = [
|
|
781
|
-
{
|
|
782
|
-
id: getId(import_chunk_JFDDZI4Y.SpaceAction.ADD_OBJECT),
|
|
783
|
-
type: import_plugin_graph3.ACTION_GROUP_TYPE,
|
|
784
|
-
data: import_plugin_graph3.actionGroupSymbol,
|
|
785
|
-
properties: {
|
|
786
|
-
label: [
|
|
787
|
-
"create object in collection label",
|
|
788
|
-
{
|
|
789
|
-
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
790
|
-
}
|
|
791
|
-
],
|
|
792
|
-
icon: "ph--plus--regular",
|
|
793
|
-
disposition: "toolbar",
|
|
794
|
-
menuType: "searchList",
|
|
795
|
-
testId: "spacePlugin.createObject"
|
|
796
|
-
},
|
|
797
|
-
nodes: [
|
|
798
|
-
{
|
|
799
|
-
id: getId(import_chunk_JFDDZI4Y.SpaceAction.ADD_OBJECT.replace("object", "collection")),
|
|
800
|
-
type: import_plugin_graph3.ACTION_TYPE,
|
|
801
|
-
data: () => dispatch([
|
|
802
|
-
{
|
|
803
|
-
plugin: import_chunk_JFDDZI4Y.SPACE_PLUGIN,
|
|
804
|
-
action: import_chunk_JFDDZI4Y.SpaceAction.ADD_OBJECT,
|
|
805
|
-
data: {
|
|
806
|
-
target: collection,
|
|
807
|
-
object: (0, import_echo_schema2.create)(import_chunk_FYWGZYJB.CollectionType, {
|
|
808
|
-
objects: [],
|
|
809
|
-
views: {}
|
|
810
|
-
})
|
|
811
|
-
}
|
|
812
|
-
},
|
|
813
|
-
...navigable ? [
|
|
814
|
-
{
|
|
815
|
-
action: import_app_framework4.NavigationAction.OPEN
|
|
816
|
-
}
|
|
817
|
-
] : []
|
|
818
|
-
]),
|
|
819
|
-
properties: {
|
|
820
|
-
label: [
|
|
821
|
-
"create collection label",
|
|
822
|
-
{
|
|
823
|
-
ns: import_chunk_JFDDZI4Y.SPACE_PLUGIN
|
|
824
|
-
}
|
|
825
|
-
],
|
|
826
|
-
icon: "ph--cards-three--regular",
|
|
827
|
-
testId: "spacePlugin.createCollection"
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
]
|
|
831
|
-
}
|
|
832
|
-
];
|
|
833
|
-
return actions;
|
|
834
|
-
};
|
|
835
651
|
var constructObjectActions = ({ node, dispatch }) => {
|
|
836
652
|
const object = node.data;
|
|
837
653
|
const getId = (id) => `${id}/${(0, import_echo5.fullyQualifiedId)(object)}`;
|
|
838
654
|
const actions = [
|
|
655
|
+
...object instanceof import_chunk_6SNOZF7Y.CollectionType ? [
|
|
656
|
+
{
|
|
657
|
+
id: getId(import_chunk_QNVEU2UD.SpaceAction.ADD_OBJECT),
|
|
658
|
+
type: import_plugin_graph2.ACTION_TYPE,
|
|
659
|
+
data: async () => {
|
|
660
|
+
await dispatch({
|
|
661
|
+
plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
|
|
662
|
+
action: import_chunk_QNVEU2UD.SpaceAction.OPEN_CREATE_OBJECT,
|
|
663
|
+
data: {
|
|
664
|
+
target: object
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
},
|
|
668
|
+
properties: {
|
|
669
|
+
label: [
|
|
670
|
+
"create object in collection label",
|
|
671
|
+
{
|
|
672
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
673
|
+
}
|
|
674
|
+
],
|
|
675
|
+
icon: "ph--plus--regular",
|
|
676
|
+
disposition: "toolbar",
|
|
677
|
+
testId: "spacePlugin.createObject"
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
] : [],
|
|
839
681
|
{
|
|
840
|
-
id: getId(
|
|
841
|
-
type:
|
|
682
|
+
id: getId(import_chunk_QNVEU2UD.SpaceAction.RENAME_OBJECT),
|
|
683
|
+
type: import_plugin_graph2.ACTION_TYPE,
|
|
842
684
|
data: async (params) => {
|
|
843
685
|
await dispatch({
|
|
844
|
-
action:
|
|
686
|
+
action: import_chunk_QNVEU2UD.SpaceAction.RENAME_OBJECT,
|
|
845
687
|
data: {
|
|
846
688
|
object,
|
|
847
689
|
...params
|
|
@@ -850,9 +692,9 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
850
692
|
},
|
|
851
693
|
properties: {
|
|
852
694
|
label: [
|
|
853
|
-
object instanceof
|
|
695
|
+
object instanceof import_chunk_6SNOZF7Y.CollectionType ? "rename collection label" : "rename object label",
|
|
854
696
|
{
|
|
855
|
-
ns:
|
|
697
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
856
698
|
}
|
|
857
699
|
],
|
|
858
700
|
icon: "ph--pencil-simple-line--regular",
|
|
@@ -862,16 +704,16 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
862
704
|
}
|
|
863
705
|
},
|
|
864
706
|
{
|
|
865
|
-
id: getId(
|
|
866
|
-
type:
|
|
707
|
+
id: getId(import_chunk_QNVEU2UD.SpaceAction.REMOVE_OBJECTS),
|
|
708
|
+
type: import_plugin_graph2.ACTION_TYPE,
|
|
867
709
|
data: async () => {
|
|
868
|
-
const graph = (0,
|
|
710
|
+
const graph = (0, import_plugin_graph2.getGraph)(node);
|
|
869
711
|
const collection = graph.nodes(node, {
|
|
870
712
|
relation: "inbound"
|
|
871
|
-
}).find(({ data }) => data instanceof
|
|
713
|
+
}).find(({ data }) => data instanceof import_chunk_6SNOZF7Y.CollectionType)?.data;
|
|
872
714
|
await dispatch([
|
|
873
715
|
{
|
|
874
|
-
action:
|
|
716
|
+
action: import_chunk_QNVEU2UD.SpaceAction.REMOVE_OBJECTS,
|
|
875
717
|
data: {
|
|
876
718
|
objects: [
|
|
877
719
|
object
|
|
@@ -883,19 +725,19 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
883
725
|
},
|
|
884
726
|
properties: {
|
|
885
727
|
label: [
|
|
886
|
-
object instanceof
|
|
728
|
+
object instanceof import_chunk_6SNOZF7Y.CollectionType ? "delete collection label" : "delete object label",
|
|
887
729
|
{
|
|
888
|
-
ns:
|
|
730
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
889
731
|
}
|
|
890
732
|
],
|
|
891
733
|
icon: "ph--trash--regular",
|
|
892
|
-
keyBinding: object instanceof
|
|
734
|
+
keyBinding: object instanceof import_chunk_6SNOZF7Y.CollectionType ? void 0 : "shift+meta+Backspace",
|
|
893
735
|
testId: "spacePlugin.deleteObject"
|
|
894
736
|
}
|
|
895
737
|
},
|
|
896
738
|
{
|
|
897
739
|
id: getId("copy-link"),
|
|
898
|
-
type:
|
|
740
|
+
type: import_plugin_graph2.ACTION_TYPE,
|
|
899
741
|
data: async () => {
|
|
900
742
|
const url = `${window.location.origin}/${(0, import_echo5.fullyQualifiedId)(object)}`;
|
|
901
743
|
await navigator.clipboard.writeText(url);
|
|
@@ -904,7 +746,7 @@ var constructObjectActions = ({ node, dispatch }) => {
|
|
|
904
746
|
label: [
|
|
905
747
|
"copy link label",
|
|
906
748
|
{
|
|
907
|
-
ns:
|
|
749
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
908
750
|
}
|
|
909
751
|
],
|
|
910
752
|
icon: "ph--link--regular",
|
|
@@ -919,13 +761,13 @@ var getActiveSpace = (graph, active) => {
|
|
|
919
761
|
return;
|
|
920
762
|
}
|
|
921
763
|
const node = graph.findNode(active);
|
|
922
|
-
if (!node || !(0,
|
|
764
|
+
if (!node || !(0, import_live_object2.isReactiveObject)(node.data)) {
|
|
923
765
|
return;
|
|
924
766
|
}
|
|
925
767
|
return (0, import_echo5.getSpace)(node.data);
|
|
926
768
|
};
|
|
927
769
|
var getNestedObjects = async (object, resolve) => {
|
|
928
|
-
const type = (0,
|
|
770
|
+
const type = (0, import_echo_schema3.getTypename)(object);
|
|
929
771
|
if (!type) {
|
|
930
772
|
return [];
|
|
931
773
|
}
|
|
@@ -942,13 +784,13 @@ var getNestedObjects = async (object, resolve) => {
|
|
|
942
784
|
];
|
|
943
785
|
};
|
|
944
786
|
var cloneObject = async (object, resolve, newSpace) => {
|
|
945
|
-
const schema = (0,
|
|
946
|
-
const typename = schema ? (0,
|
|
787
|
+
const schema = (0, import_live_object2.getSchema)(object);
|
|
788
|
+
const typename = schema ? (0, import_echo_schema3.getObjectAnnotation)(schema)?.typename ?? import_echo_schema3.EXPANDO_TYPENAME : import_echo_schema3.EXPANDO_TYPENAME;
|
|
947
789
|
const metadata = resolve(typename);
|
|
948
790
|
const serializer = metadata.serializer;
|
|
949
791
|
(0, import_invariant2.invariant)(serializer, `No serializer for type: ${typename}`, {
|
|
950
792
|
F: __dxlog_file,
|
|
951
|
-
L:
|
|
793
|
+
L: 544,
|
|
952
794
|
S: void 0,
|
|
953
795
|
A: [
|
|
954
796
|
"serializer",
|
|
@@ -964,22 +806,380 @@ var cloneObject = async (object, resolve, newSpace) => {
|
|
|
964
806
|
newId: true
|
|
965
807
|
});
|
|
966
808
|
};
|
|
809
|
+
var CreateObjectPanel = ({ schemas, spaces, typename: initialTypename, target: initialTarget, name: initialName, defaultSpaceId, resolve, onCreateObject }) => {
|
|
810
|
+
const { t } = (0, import_react_ui3.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
811
|
+
const [typename, setTypename] = (0, import_react6.useState)(initialTypename);
|
|
812
|
+
const [target, setTarget] = (0, import_react6.useState)(initialTarget);
|
|
813
|
+
const schema = schemas.find((schema2) => (0, import_echo_schema2.getObjectAnnotation)(schema2)?.typename === typename);
|
|
814
|
+
const options = schemas.map(import_echo_schema2.getObjectAnnotation).filter(import_util2.nonNullable);
|
|
815
|
+
const handleClearSchema = (0, import_react6.useCallback)(() => setTypename(void 0), []);
|
|
816
|
+
const handleClearTarget = (0, import_react6.useCallback)(() => setTarget(void 0), []);
|
|
817
|
+
const handleCreateObject = (0, import_react6.useCallback)(async ({ name }) => {
|
|
818
|
+
if (!schema || !target) {
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
await onCreateObject?.({
|
|
822
|
+
schema,
|
|
823
|
+
target,
|
|
824
|
+
name
|
|
825
|
+
});
|
|
826
|
+
}, [
|
|
827
|
+
onCreateObject,
|
|
828
|
+
schema,
|
|
829
|
+
target
|
|
830
|
+
]);
|
|
831
|
+
const schemaInput = /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Root, {
|
|
832
|
+
label: t("schema input label"),
|
|
833
|
+
classNames: "flex flex-col grow overflow-hidden my-2 px-2"
|
|
834
|
+
}, /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Input, {
|
|
835
|
+
autoFocus: true,
|
|
836
|
+
"data-testid": "create-object-form.schema-input",
|
|
837
|
+
placeholder: t("schema input placeholder"),
|
|
838
|
+
classNames: "px-1 my-2"
|
|
839
|
+
}), /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Content, {
|
|
840
|
+
classNames: "max-bs-[24rem] overflow-auto"
|
|
841
|
+
}, options.map((option) => /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Item, {
|
|
842
|
+
key: option.typename,
|
|
843
|
+
value: t("typename label", {
|
|
844
|
+
ns: option.typename,
|
|
845
|
+
defaultValue: option.typename
|
|
846
|
+
}),
|
|
847
|
+
onSelect: () => setTypename(option.typename),
|
|
848
|
+
classNames: "flex items-center gap-2"
|
|
849
|
+
}, /* @__PURE__ */ import_react6.default.createElement("span", {
|
|
850
|
+
className: "flex gap-2 items-center grow truncate"
|
|
851
|
+
}, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Icon, {
|
|
852
|
+
icon: resolve?.(option.typename).icon ?? "ph--placeholder--regular",
|
|
853
|
+
size: 5
|
|
854
|
+
}), t("typename label", {
|
|
855
|
+
ns: option.typename,
|
|
856
|
+
defaultValue: option.typename
|
|
857
|
+
}))))));
|
|
858
|
+
const spaceInput = /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Root, {
|
|
859
|
+
label: t("space input label"),
|
|
860
|
+
classNames: "flex flex-col grow overflow-hidden my-2 px-2"
|
|
861
|
+
}, /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Input, {
|
|
862
|
+
autoFocus: true,
|
|
863
|
+
"data-testid": "create-object-form.space-input",
|
|
864
|
+
placeholder: t("space input placeholder"),
|
|
865
|
+
classNames: "px-1 my-2"
|
|
866
|
+
}), /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Content, {
|
|
867
|
+
classNames: "max-bs-[24rem] overflow-auto"
|
|
868
|
+
}, spaces.map((space) => /* @__PURE__ */ import_react6.default.createElement(import_react_ui_searchlist.SearchList.Item, {
|
|
869
|
+
key: space.id,
|
|
870
|
+
value: (0, import_react_ui3.toLocalizedString)(getSpaceDisplayName(space, {
|
|
871
|
+
personal: space.id === defaultSpaceId
|
|
872
|
+
}), t),
|
|
873
|
+
onSelect: () => setTarget(space),
|
|
874
|
+
classNames: "flex items-center gap-2"
|
|
875
|
+
}, /* @__PURE__ */ import_react6.default.createElement("span", {
|
|
876
|
+
className: "grow truncate"
|
|
877
|
+
}, (0, import_react_ui3.toLocalizedString)(getSpaceDisplayName(space, {
|
|
878
|
+
personal: space.id === defaultSpaceId
|
|
879
|
+
}), t))))));
|
|
880
|
+
const form = /* @__PURE__ */ import_react6.default.createElement(import_react_ui_form.Form, {
|
|
881
|
+
autoFocus: true,
|
|
882
|
+
values: {
|
|
883
|
+
name: initialName
|
|
884
|
+
},
|
|
885
|
+
schema: import_echo_schema2.S.Struct({
|
|
886
|
+
name: import_echo_schema2.S.optional(import_echo_schema2.S.String)
|
|
887
|
+
}),
|
|
888
|
+
testId: "create-object-form",
|
|
889
|
+
onSave: handleCreateObject
|
|
890
|
+
});
|
|
891
|
+
return /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
892
|
+
role: "form",
|
|
893
|
+
className: "flex flex-col gap-2"
|
|
894
|
+
}, target && /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
895
|
+
role: "none",
|
|
896
|
+
className: "px-2"
|
|
897
|
+
}, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Input.Root, null, /* @__PURE__ */ import_react6.default.createElement(import_react_ui_form.InputHeader, null, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Input.Label, null, t((0, import_echo4.isSpace)(target) ? "creating in space label" : "creating in collection label"))), /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
898
|
+
role: "none",
|
|
899
|
+
className: "flex gap-2"
|
|
900
|
+
}, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Input.TextInput, {
|
|
901
|
+
disabled: true,
|
|
902
|
+
value: (0, import_echo4.isSpace)(target) ? (0, import_react_ui3.toLocalizedString)(getSpaceDisplayName(target, {
|
|
903
|
+
personal: target.id === defaultSpaceId
|
|
904
|
+
}), t) : target.name || t("unnamed collection label")
|
|
905
|
+
}), /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.IconButton, {
|
|
906
|
+
iconOnly: true,
|
|
907
|
+
icon: "ph--x--regular",
|
|
908
|
+
label: t("clear input label"),
|
|
909
|
+
onClick: handleClearTarget
|
|
910
|
+
})))), schema && /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
911
|
+
role: "none",
|
|
912
|
+
className: "px-2"
|
|
913
|
+
}, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Input.Root, null, /* @__PURE__ */ import_react6.default.createElement(import_react_ui_form.InputHeader, null, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Input.Label, null, t("creating object type label"))), /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
914
|
+
role: "none",
|
|
915
|
+
className: "flex gap-2"
|
|
916
|
+
}, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Input.TextInput, {
|
|
917
|
+
disabled: true,
|
|
918
|
+
value: t("typename label", {
|
|
919
|
+
ns: schema.typename,
|
|
920
|
+
defaultValue: schema.typename
|
|
921
|
+
})
|
|
922
|
+
}), /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.IconButton, {
|
|
923
|
+
iconOnly: true,
|
|
924
|
+
icon: "ph--x--regular",
|
|
925
|
+
label: t("clear input label"),
|
|
926
|
+
onClick: handleClearSchema
|
|
927
|
+
})))), !schema ? schemaInput : !target ? spaceInput : form);
|
|
928
|
+
};
|
|
929
|
+
var CreateObjectDialog = ({ schemas, target, typename, name, navigableCollections, resolve }) => {
|
|
930
|
+
const closeRef = (0, import_react5.useRef)(null);
|
|
931
|
+
const { t } = (0, import_react_ui2.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
932
|
+
const client = (0, import_react_client3.useClient)();
|
|
933
|
+
const spaces = (0, import_echo3.useSpaces)();
|
|
934
|
+
const dispatch = (0, import_app_framework3.useIntentDispatcher)();
|
|
935
|
+
const handleCreateObject = (0, import_react5.useCallback)(async ({ schema, target: _target, name: name2 }) => {
|
|
936
|
+
const target2 = (0, import_echo3.isSpace)(_target) ? _target.properties[import_chunk_6SNOZF7Y.CollectionType.typename] : _target;
|
|
937
|
+
const createObjectAction = resolve?.(schema.typename)?.createObject;
|
|
938
|
+
if (!createObjectAction || !target2) {
|
|
939
|
+
return;
|
|
940
|
+
}
|
|
941
|
+
closeRef.current?.click();
|
|
942
|
+
const result = await dispatch({
|
|
943
|
+
action: createObjectAction,
|
|
944
|
+
data: {
|
|
945
|
+
name: name2
|
|
946
|
+
}
|
|
947
|
+
});
|
|
948
|
+
const object = result?.data;
|
|
949
|
+
if ((0, import_echo3.isReactiveObject)(object)) {
|
|
950
|
+
await dispatch([
|
|
951
|
+
{
|
|
952
|
+
plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
|
|
953
|
+
action: import_chunk_QNVEU2UD.SpaceAction.ADD_OBJECT,
|
|
954
|
+
data: {
|
|
955
|
+
target: target2,
|
|
956
|
+
object
|
|
957
|
+
}
|
|
958
|
+
},
|
|
959
|
+
...!(object instanceof import_chunk_6SNOZF7Y.CollectionType) || navigableCollections ? [
|
|
960
|
+
{
|
|
961
|
+
action: import_app_framework3.NavigationAction.OPEN
|
|
962
|
+
}
|
|
963
|
+
] : []
|
|
964
|
+
]);
|
|
965
|
+
}
|
|
966
|
+
}, [
|
|
967
|
+
dispatch,
|
|
968
|
+
resolve
|
|
969
|
+
]);
|
|
970
|
+
return (
|
|
971
|
+
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
972
|
+
// Consider factoring it out to the tabs package.
|
|
973
|
+
/* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Dialog.Content, {
|
|
974
|
+
classNames: "p-0 bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
975
|
+
}, /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
976
|
+
role: "none",
|
|
977
|
+
className: "flex justify-between pbs-3 pis-2 pie-3 @md:pbs-4 @md:pis-4 @md:pie-5"
|
|
978
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Dialog.Title, null, t("create object dialog title")), /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Dialog.Close, {
|
|
979
|
+
asChild: true
|
|
980
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Button, {
|
|
981
|
+
ref: closeRef,
|
|
982
|
+
density: "fine",
|
|
983
|
+
variant: "ghost",
|
|
984
|
+
autoFocus: true
|
|
985
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui2.Icon, {
|
|
986
|
+
icon: "ph--x--regular",
|
|
987
|
+
size: 4
|
|
988
|
+
})))), /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
989
|
+
className: "p-4"
|
|
990
|
+
}, /* @__PURE__ */ import_react5.default.createElement(CreateObjectPanel, {
|
|
991
|
+
schemas,
|
|
992
|
+
spaces,
|
|
993
|
+
target,
|
|
994
|
+
typename,
|
|
995
|
+
name,
|
|
996
|
+
defaultSpaceId: client.spaces.default.id,
|
|
997
|
+
resolve,
|
|
998
|
+
onCreateObject: handleCreateObject
|
|
999
|
+
})))
|
|
1000
|
+
);
|
|
1001
|
+
};
|
|
1002
|
+
var initialValues = {
|
|
1003
|
+
edgeReplication: true
|
|
1004
|
+
};
|
|
1005
|
+
var CreateSpaceDialog = () => {
|
|
1006
|
+
const closeRef = (0, import_react7.useRef)(null);
|
|
1007
|
+
const { t } = (0, import_react_ui4.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1008
|
+
const dispatch = (0, import_app_framework4.useIntentDispatcher)();
|
|
1009
|
+
const handleCreateSpace = (0, import_react7.useCallback)(async (data) => {
|
|
1010
|
+
const result = await dispatch({
|
|
1011
|
+
action: import_chunk_QNVEU2UD.SpaceAction.CREATE,
|
|
1012
|
+
data
|
|
1013
|
+
});
|
|
1014
|
+
const target = result?.data.space;
|
|
1015
|
+
if (target) {
|
|
1016
|
+
await dispatch({
|
|
1017
|
+
action: import_chunk_QNVEU2UD.SpaceAction.OPEN_CREATE_OBJECT,
|
|
1018
|
+
data: {
|
|
1019
|
+
target
|
|
1020
|
+
}
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1023
|
+
}, [
|
|
1024
|
+
dispatch
|
|
1025
|
+
]);
|
|
1026
|
+
return (
|
|
1027
|
+
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
1028
|
+
// Consider factoring it out to the tabs package.
|
|
1029
|
+
/* @__PURE__ */ import_react7.default.createElement(import_react_ui4.Dialog.Content, {
|
|
1030
|
+
classNames: "p-0 bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
1031
|
+
}, /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
1032
|
+
role: "none",
|
|
1033
|
+
className: "flex justify-between pbs-3 pis-2 pie-3 @md:pbs-4 @md:pis-4 @md:pie-5"
|
|
1034
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui4.Dialog.Title, null, t("create space dialog title")), /* @__PURE__ */ import_react7.default.createElement(import_react_ui4.Dialog.Close, {
|
|
1035
|
+
asChild: true
|
|
1036
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui4.Button, {
|
|
1037
|
+
ref: closeRef,
|
|
1038
|
+
density: "fine",
|
|
1039
|
+
variant: "ghost",
|
|
1040
|
+
autoFocus: true
|
|
1041
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui4.Icon, {
|
|
1042
|
+
icon: "ph--x--regular",
|
|
1043
|
+
size: 4
|
|
1044
|
+
})))), /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
1045
|
+
className: "p-4"
|
|
1046
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui_form2.Form, {
|
|
1047
|
+
testId: "create-space-form",
|
|
1048
|
+
values: initialValues,
|
|
1049
|
+
schema: import_chunk_6SNOZF7Y.SpaceForm,
|
|
1050
|
+
onSave: handleCreateSpace
|
|
1051
|
+
})))
|
|
1052
|
+
);
|
|
1053
|
+
};
|
|
1054
|
+
var CollectionMain = ({ collection }) => {
|
|
1055
|
+
const { t } = (0, import_react_ui5.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1056
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
1057
|
+
role: "none",
|
|
1058
|
+
className: (0, import_react_ui_theme2.mx)(import_react_ui_theme2.baseSurface, "min-bs-screen is-full flex items-center justify-center p-8"),
|
|
1059
|
+
"data-testid": "composer.firstRunMessage"
|
|
1060
|
+
}, /* @__PURE__ */ import_react8.default.createElement("p", {
|
|
1061
|
+
role: "alert",
|
|
1062
|
+
className: (0, import_react_ui_theme2.mx)(import_react_ui_theme2.descriptionText, "border border-dashed border-neutral-400/50 rounded-lg p-8 font-normal text-lg max-is-[24rem] break-words")
|
|
1063
|
+
}, collection.name ?? t("unnamed collection label")));
|
|
1064
|
+
};
|
|
1065
|
+
var CollectionSection = ({ collection }) => {
|
|
1066
|
+
const { t } = (0, import_react_ui6.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1067
|
+
return /* @__PURE__ */ import_react9.default.createElement("div", {
|
|
1068
|
+
className: "min-bs-[3.5rem] grid grid-rows-subgrid grid-cols-subgrid items-center"
|
|
1069
|
+
}, /* @__PURE__ */ import_react9.default.createElement("span", {
|
|
1070
|
+
className: "truncate"
|
|
1071
|
+
}, collection.name ?? t("unnamed collection label")));
|
|
1072
|
+
};
|
|
1073
|
+
var DefaultObjectSettings = ({ object }) => {
|
|
1074
|
+
const { t } = (0, import_react_ui7.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1075
|
+
return /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
1076
|
+
role: "form",
|
|
1077
|
+
className: "flex flex-col w-full p-2 gap-1"
|
|
1078
|
+
}, /* @__PURE__ */ import_react10.default.createElement(import_react_ui7.Input.Root, null, /* @__PURE__ */ import_react10.default.createElement(import_react_ui7.Input.Label, null, t("name label")), /* @__PURE__ */ import_react10.default.createElement(import_react_ui7.Input.TextInput, {
|
|
1079
|
+
placeholder: t("name placeholder"),
|
|
1080
|
+
value: object.name ?? "",
|
|
1081
|
+
onChange: (event) => {
|
|
1082
|
+
object.name = event.target.value;
|
|
1083
|
+
}
|
|
1084
|
+
})));
|
|
1085
|
+
};
|
|
1086
|
+
var JoinDialog = ({ navigableCollections, ...props }) => {
|
|
1087
|
+
const { t } = (0, import_react_ui8.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1088
|
+
const dispatch = (0, import_app_framework5.useIntentDispatcher)();
|
|
1089
|
+
const spaces = (0, import_echo6.useSpaces)();
|
|
1090
|
+
const { graph } = (0, import_plugin_graph3.useGraph)();
|
|
1091
|
+
const handleDone = (0, import_react11.useCallback)(async (result) => {
|
|
1092
|
+
if (result?.spaceKey) {
|
|
1093
|
+
await Promise.all([
|
|
1094
|
+
dispatch({
|
|
1095
|
+
action: import_app_framework5.LayoutAction.SET_LAYOUT,
|
|
1096
|
+
data: {
|
|
1097
|
+
element: "toast",
|
|
1098
|
+
subject: {
|
|
1099
|
+
id: `${import_chunk_QNVEU2UD.SPACE_PLUGIN}/join-success`,
|
|
1100
|
+
duration: 5e3,
|
|
1101
|
+
title: t("join success label"),
|
|
1102
|
+
closeLabel: t("dismiss label")
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
}),
|
|
1106
|
+
dispatch({
|
|
1107
|
+
action: import_app_framework5.LayoutAction.SET_LAYOUT,
|
|
1108
|
+
data: {
|
|
1109
|
+
element: "dialog",
|
|
1110
|
+
state: false
|
|
1111
|
+
}
|
|
1112
|
+
})
|
|
1113
|
+
]);
|
|
1114
|
+
}
|
|
1115
|
+
const space = spaces.find(({ key }) => result?.spaceKey?.equals(key));
|
|
1116
|
+
const target = result?.target || (navigableCollections ? space?.id : void 0);
|
|
1117
|
+
if (target) {
|
|
1118
|
+
await graph.waitForPath({
|
|
1119
|
+
target
|
|
1120
|
+
}).catch(() => {
|
|
1121
|
+
});
|
|
1122
|
+
await Promise.all([
|
|
1123
|
+
dispatch({
|
|
1124
|
+
action: import_app_framework5.NavigationAction.OPEN,
|
|
1125
|
+
data: {
|
|
1126
|
+
activeParts: {
|
|
1127
|
+
main: [
|
|
1128
|
+
target
|
|
1129
|
+
]
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
}),
|
|
1133
|
+
dispatch({
|
|
1134
|
+
action: import_app_framework5.NavigationAction.EXPOSE,
|
|
1135
|
+
data: {
|
|
1136
|
+
id: target
|
|
1137
|
+
}
|
|
1138
|
+
})
|
|
1139
|
+
]);
|
|
1140
|
+
}
|
|
1141
|
+
if (space) {
|
|
1142
|
+
await dispatch({
|
|
1143
|
+
action: import_meta2.ObservabilityAction.SEND_EVENT,
|
|
1144
|
+
data: {
|
|
1145
|
+
name: "space.join",
|
|
1146
|
+
properties: {
|
|
1147
|
+
spaceId: space.id
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
});
|
|
1151
|
+
}
|
|
1152
|
+
}, [
|
|
1153
|
+
dispatch,
|
|
1154
|
+
spaces
|
|
1155
|
+
]);
|
|
1156
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_react_ui8.Dialog.Content, null, /* @__PURE__ */ import_react11.default.createElement(import_react12.JoinPanel, {
|
|
1157
|
+
...props,
|
|
1158
|
+
exitActionParent: /* @__PURE__ */ import_react11.default.createElement(import_react_ui8.Dialog.Close, {
|
|
1159
|
+
asChild: true
|
|
1160
|
+
}),
|
|
1161
|
+
doneActionParent: /* @__PURE__ */ import_react11.default.createElement(import_react_ui8.Dialog.Close, {
|
|
1162
|
+
asChild: true
|
|
1163
|
+
}),
|
|
1164
|
+
onDone: handleDone
|
|
1165
|
+
}));
|
|
1166
|
+
};
|
|
967
1167
|
var MenuFooter = ({ object }) => {
|
|
968
|
-
const { t } = (0,
|
|
969
|
-
const client = (0,
|
|
970
|
-
const space = (0,
|
|
1168
|
+
const { t } = (0, import_react_ui9.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1169
|
+
const client = (0, import_react_client4.useClient)();
|
|
1170
|
+
const space = (0, import_echo7.getSpace)(object);
|
|
971
1171
|
const spaceName = space ? getSpaceDisplayName(space, {
|
|
972
1172
|
personal: client.spaces.default === space
|
|
973
1173
|
}) : "";
|
|
974
|
-
return space ? /* @__PURE__ */
|
|
1174
|
+
return space ? /* @__PURE__ */ import_react14.default.createElement(import_react14.default.Fragment, null, /* @__PURE__ */ import_react14.default.createElement(import_react_ui9.DropdownMenu.Separator, null), /* @__PURE__ */ import_react14.default.createElement(import_react_ui9.DropdownMenu.GroupLabel, null, t("menu footer label")), /* @__PURE__ */ import_react14.default.createElement("dl", {
|
|
975
1175
|
className: "pis-2 mbe-2 text-xs grid grid-cols-[max-content_1fr] gap-2"
|
|
976
|
-
}, /* @__PURE__ */
|
|
1176
|
+
}, /* @__PURE__ */ import_react14.default.createElement("dt", {
|
|
977
1177
|
className: "uppercase text-[.75em] tracking-wide font-medium mbs-px self-start"
|
|
978
|
-
}, t("location label")), /* @__PURE__ */
|
|
1178
|
+
}, t("location label")), /* @__PURE__ */ import_react14.default.createElement("dd", {
|
|
979
1179
|
className: "line-clamp-3"
|
|
980
|
-
}, /* @__PURE__ */
|
|
1180
|
+
}, /* @__PURE__ */ import_react14.default.createElement(import_react13.Planet, {
|
|
981
1181
|
className: "inline-block mie-1"
|
|
982
|
-
}), (0,
|
|
1182
|
+
}), (0, import_react_ui9.toLocalizedString)(spaceName, t)))) : null;
|
|
983
1183
|
};
|
|
984
1184
|
var Status;
|
|
985
1185
|
(function(Status2) {
|
|
@@ -988,12 +1188,12 @@ var Status;
|
|
|
988
1188
|
Status2[Status2["ERROR"] = 2] = "ERROR";
|
|
989
1189
|
})(Status || (Status = {}));
|
|
990
1190
|
var PersistenceStatus = ({ db }) => {
|
|
991
|
-
const { t } = (0,
|
|
992
|
-
const [displayMessage, setDisplayMessage] = (0,
|
|
993
|
-
const [status, naturalSetStatus] = (0,
|
|
994
|
-
const [prevStatus, setPrevStatus] = (0,
|
|
1191
|
+
const { t } = (0, import_react_ui10.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1192
|
+
const [displayMessage, setDisplayMessage] = (0, import_react16.useState)(false);
|
|
1193
|
+
const [status, naturalSetStatus] = (0, import_react16.useState)(0);
|
|
1194
|
+
const [prevStatus, setPrevStatus] = (0, import_react16.useState)(0);
|
|
995
1195
|
const _setStatus = (0, import_async2.debounce)(naturalSetStatus, 500);
|
|
996
|
-
(0,
|
|
1196
|
+
(0, import_react16.useEffect)(() => {
|
|
997
1197
|
setPrevStatus(status);
|
|
998
1198
|
if (prevStatus !== status && status === 0) {
|
|
999
1199
|
setDisplayMessage(true);
|
|
@@ -1005,44 +1205,44 @@ var PersistenceStatus = ({ db }) => {
|
|
|
1005
1205
|
]);
|
|
1006
1206
|
switch (status) {
|
|
1007
1207
|
case 2:
|
|
1008
|
-
return /* @__PURE__ */
|
|
1208
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", {
|
|
1009
1209
|
className: "flex items-center"
|
|
1010
|
-
}, /* @__PURE__ */
|
|
1210
|
+
}, /* @__PURE__ */ import_react16.default.createElement(import_react15.Warning, {
|
|
1011
1211
|
className: (0, import_react_ui_theme3.mx)((0, import_react_ui_theme3.getSize)(4), "me-1")
|
|
1012
|
-
}), /* @__PURE__ */
|
|
1212
|
+
}), /* @__PURE__ */ import_react16.default.createElement("span", {
|
|
1013
1213
|
className: (0, import_react_ui_theme3.mx)("text-sm", import_react_ui_theme3.warningText)
|
|
1014
1214
|
}, t("persistence error label")));
|
|
1015
1215
|
case 1:
|
|
1016
|
-
return /* @__PURE__ */
|
|
1216
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", {
|
|
1017
1217
|
className: "flex items-center"
|
|
1018
|
-
}, /* @__PURE__ */
|
|
1218
|
+
}, /* @__PURE__ */ import_react16.default.createElement(import_react15.ArrowsCounterClockwise, {
|
|
1019
1219
|
className: (0, import_react_ui_theme3.mx)((0, import_react_ui_theme3.getSize)(4), "me-1")
|
|
1020
|
-
}), /* @__PURE__ */
|
|
1220
|
+
}), /* @__PURE__ */ import_react16.default.createElement("span", {
|
|
1021
1221
|
className: (0, import_react_ui_theme3.mx)("text-sm", import_react_ui_theme3.staticPlaceholderText)
|
|
1022
1222
|
}, t("persistence pending label")));
|
|
1023
1223
|
case 0:
|
|
1024
1224
|
default:
|
|
1025
|
-
return /* @__PURE__ */
|
|
1225
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react_ui10.Tooltip.Root, {
|
|
1026
1226
|
delayDuration: 400
|
|
1027
|
-
}, /* @__PURE__ */
|
|
1227
|
+
}, /* @__PURE__ */ import_react16.default.createElement(import_react_ui10.Tooltip.Trigger, {
|
|
1028
1228
|
role: "status",
|
|
1029
1229
|
className: "flex items-center"
|
|
1030
|
-
}, /* @__PURE__ */
|
|
1230
|
+
}, /* @__PURE__ */ import_react16.default.createElement(import_react15.CheckCircle, {
|
|
1031
1231
|
className: (0, import_react_ui_theme3.mx)((0, import_react_ui_theme3.getSize)(4), "me-1")
|
|
1032
|
-
}), displayMessage && /* @__PURE__ */
|
|
1232
|
+
}), displayMessage && /* @__PURE__ */ import_react16.default.createElement("span", {
|
|
1033
1233
|
className: (0, import_react_ui_theme3.mx)("text-sm", import_react_ui_theme3.staticPlaceholderText)
|
|
1034
|
-
}, t("persisted locally label"))), /* @__PURE__ */
|
|
1234
|
+
}, t("persisted locally label"))), /* @__PURE__ */ import_react16.default.createElement(import_react_ui10.Tooltip.Portal, null, /* @__PURE__ */ import_react16.default.createElement(import_react_ui10.Tooltip.Content, {
|
|
1035
1235
|
classNames: "z-10"
|
|
1036
|
-
}, t("persisted locally message"), /* @__PURE__ */
|
|
1236
|
+
}, t("persisted locally message"), /* @__PURE__ */ import_react16.default.createElement(import_react_ui10.Tooltip.Arrow, null))));
|
|
1037
1237
|
}
|
|
1038
1238
|
};
|
|
1039
1239
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
|
|
1040
1240
|
var PopoverRenameObject = ({ object: obj }) => {
|
|
1041
|
-
const { t } = (0,
|
|
1042
|
-
const doneButton = (0,
|
|
1241
|
+
const { t } = (0, import_react_ui11.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1242
|
+
const doneButton = (0, import_react17.useRef)(null);
|
|
1043
1243
|
const object = obj;
|
|
1044
|
-
const [name, setName] = (0,
|
|
1045
|
-
const handleDone = (0,
|
|
1244
|
+
const [name, setName] = (0, import_react17.useState)(object.name || object.title || "");
|
|
1245
|
+
const handleDone = (0, import_react17.useCallback)(() => {
|
|
1046
1246
|
try {
|
|
1047
1247
|
object.name = name;
|
|
1048
1248
|
} catch {
|
|
@@ -1063,23 +1263,23 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
1063
1263
|
object,
|
|
1064
1264
|
name
|
|
1065
1265
|
]);
|
|
1066
|
-
return /* @__PURE__ */
|
|
1266
|
+
return /* @__PURE__ */ import_react17.default.createElement("div", {
|
|
1067
1267
|
role: "none",
|
|
1068
1268
|
className: "p-1 flex gap-2"
|
|
1069
|
-
}, /* @__PURE__ */
|
|
1269
|
+
}, /* @__PURE__ */ import_react17.default.createElement("div", {
|
|
1070
1270
|
role: "none",
|
|
1071
1271
|
className: "flex-1"
|
|
1072
|
-
}, /* @__PURE__ */
|
|
1272
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Input.Root, null, /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Input.Label, {
|
|
1073
1273
|
srOnly: true
|
|
1074
|
-
}, t("object name label")), /* @__PURE__ */
|
|
1274
|
+
}, t("object name label")), /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Input.TextInput, {
|
|
1075
1275
|
placeholder: t("object title placeholder"),
|
|
1076
1276
|
value: name,
|
|
1077
1277
|
"data-testid": "spacePlugin.renameObject.input",
|
|
1078
1278
|
onChange: ({ target: { value } }) => setName(value),
|
|
1079
1279
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1080
|
-
}))), /* @__PURE__ */
|
|
1280
|
+
}))), /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Popover.Close, {
|
|
1081
1281
|
asChild: true
|
|
1082
|
-
}, /* @__PURE__ */
|
|
1282
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react_ui11.Button, {
|
|
1083
1283
|
ref: doneButton,
|
|
1084
1284
|
classNames: "self-stretch",
|
|
1085
1285
|
onClick: handleDone
|
|
@@ -1088,33 +1288,33 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
1088
1288
|
}))));
|
|
1089
1289
|
};
|
|
1090
1290
|
var PopoverRenameSpace = ({ space }) => {
|
|
1091
|
-
const { t } = (0,
|
|
1092
|
-
const doneButton = (0,
|
|
1093
|
-
const [name, setName] = (0,
|
|
1094
|
-
const handleDone = (0,
|
|
1291
|
+
const { t } = (0, import_react_ui12.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1292
|
+
const doneButton = (0, import_react18.useRef)(null);
|
|
1293
|
+
const [name, setName] = (0, import_react18.useState)(space.properties.name ?? "");
|
|
1294
|
+
const handleDone = (0, import_react18.useCallback)(() => {
|
|
1095
1295
|
space.properties.name = name;
|
|
1096
1296
|
}, [
|
|
1097
1297
|
space,
|
|
1098
1298
|
name
|
|
1099
1299
|
]);
|
|
1100
|
-
return /* @__PURE__ */
|
|
1300
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", {
|
|
1101
1301
|
role: "none",
|
|
1102
1302
|
className: "p-1 flex gap-2"
|
|
1103
|
-
}, /* @__PURE__ */
|
|
1303
|
+
}, /* @__PURE__ */ import_react18.default.createElement("div", {
|
|
1104
1304
|
role: "none",
|
|
1105
1305
|
className: "flex-1"
|
|
1106
|
-
}, /* @__PURE__ */
|
|
1306
|
+
}, /* @__PURE__ */ import_react18.default.createElement(import_react_ui12.Input.Root, null, /* @__PURE__ */ import_react18.default.createElement(import_react_ui12.Input.Label, {
|
|
1107
1307
|
srOnly: true
|
|
1108
|
-
}, t("space name label")), /* @__PURE__ */
|
|
1308
|
+
}, t("space name label")), /* @__PURE__ */ import_react18.default.createElement(import_react_ui12.Input.TextInput, {
|
|
1109
1309
|
defaultValue: space.properties.name ?? "",
|
|
1110
1310
|
placeholder: t("unnamed space label"),
|
|
1111
1311
|
onChange: ({ target: { value } }) => setName(value),
|
|
1112
1312
|
// TODO(wittjosiah): Ideally this should access the popover context to close the popover.
|
|
1113
1313
|
// Currently this is not possible because Radix does not expose the popover context.
|
|
1114
1314
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1115
|
-
}))), /* @__PURE__ */
|
|
1315
|
+
}))), /* @__PURE__ */ import_react18.default.createElement(import_react_ui12.Popover.Close, {
|
|
1116
1316
|
asChild: true
|
|
1117
|
-
}, /* @__PURE__ */
|
|
1317
|
+
}, /* @__PURE__ */ import_react18.default.createElement(import_react_ui12.Button, {
|
|
1118
1318
|
ref: doneButton,
|
|
1119
1319
|
classNames: "self-stretch",
|
|
1120
1320
|
onClick: handleDone
|
|
@@ -1123,10 +1323,10 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
1123
1323
|
}))));
|
|
1124
1324
|
};
|
|
1125
1325
|
var ShareSpaceButton = ({ space }) => {
|
|
1126
|
-
const dispatch = (0,
|
|
1127
|
-
return /* @__PURE__ */
|
|
1326
|
+
const dispatch = (0, import_app_framework6.useIntentDispatcher)();
|
|
1327
|
+
return /* @__PURE__ */ import_react19.default.createElement(ShareSpaceButtonImpl, {
|
|
1128
1328
|
onClick: () => dispatch({
|
|
1129
|
-
action:
|
|
1329
|
+
action: import_chunk_QNVEU2UD.SpaceAction.SHARE,
|
|
1130
1330
|
data: {
|
|
1131
1331
|
space
|
|
1132
1332
|
}
|
|
@@ -1134,8 +1334,8 @@ var ShareSpaceButton = ({ space }) => {
|
|
|
1134
1334
|
});
|
|
1135
1335
|
};
|
|
1136
1336
|
var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
1137
|
-
const { t } = (0,
|
|
1138
|
-
return /* @__PURE__ */
|
|
1337
|
+
const { t } = (0, import_react_ui13.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1338
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_react_ui13.IconButton, {
|
|
1139
1339
|
"data-testid": "spacePlugin.shareSpaceButton",
|
|
1140
1340
|
icon: "ph--users--regular",
|
|
1141
1341
|
label: t("share space label"),
|
|
@@ -1144,28 +1344,28 @@ var ShareSpaceButtonImpl = ({ onClick }) => {
|
|
|
1144
1344
|
};
|
|
1145
1345
|
var REFRESH_INTERVAL = 5e3;
|
|
1146
1346
|
var ACTIVITY_DURATION = 3e4;
|
|
1147
|
-
var noViewers = new
|
|
1347
|
+
var noViewers = new import_util3.ComplexMap(import_react_client5.PublicKey.hash);
|
|
1148
1348
|
var getName = (identity) => identity.profile?.displayName ?? (0, import_display_name.generateName)(identity.identityKey.toHex());
|
|
1149
1349
|
var SpacePresence = ({ object, spaceKey }) => {
|
|
1150
|
-
const spacePlugin = (0,
|
|
1151
|
-
const client = (0,
|
|
1350
|
+
const spacePlugin = (0, import_app_framework7.usePlugin)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1351
|
+
const client = (0, import_react_client5.useClient)();
|
|
1152
1352
|
const identity = (0, import_halo.useIdentity)();
|
|
1153
|
-
const space = spaceKey ? client.spaces.get(spaceKey) : (0,
|
|
1154
|
-
const spaceMembers = (0,
|
|
1155
|
-
const [_moment, setMoment] = (0,
|
|
1156
|
-
(0,
|
|
1353
|
+
const space = spaceKey ? client.spaces.get(spaceKey) : (0, import_echo8.getSpace)(object);
|
|
1354
|
+
const spaceMembers = (0, import_echo8.useMembers)(space?.key);
|
|
1355
|
+
const [_moment, setMoment] = (0, import_react20.useState)(Date.now());
|
|
1356
|
+
(0, import_react20.useEffect)(() => {
|
|
1157
1357
|
const interval = setInterval(() => setMoment(Date.now()), REFRESH_INTERVAL);
|
|
1158
1358
|
return () => clearInterval(interval);
|
|
1159
1359
|
}, []);
|
|
1160
|
-
const memberOnline = (0,
|
|
1161
|
-
const memberIsNotSelf = (0,
|
|
1360
|
+
const memberOnline = (0, import_react20.useCallback)((member) => member.presence === 1, []);
|
|
1361
|
+
const memberIsNotSelf = (0, import_react20.useCallback)((member) => !identity?.identityKey.equals(member.identity.identityKey), [
|
|
1162
1362
|
identity?.identityKey
|
|
1163
1363
|
]);
|
|
1164
1364
|
if (!identity || !spacePlugin || !space) {
|
|
1165
1365
|
return null;
|
|
1166
1366
|
}
|
|
1167
1367
|
const spaceState = spacePlugin.provides.space;
|
|
1168
|
-
const currentObjectViewers = spaceState.viewersByObject[(0,
|
|
1368
|
+
const currentObjectViewers = spaceState.viewersByObject[(0, import_echo8.fullyQualifiedId)(object)] ?? noViewers;
|
|
1169
1369
|
const membersForObject = spaceMembers.filter((member) => memberOnline(member) && memberIsNotSelf(member)).filter((member) => currentObjectViewers.has(member.identity.identityKey)).map((member) => {
|
|
1170
1370
|
const objectView = currentObjectViewers.get(member.identity.identityKey);
|
|
1171
1371
|
const lastSeen = objectView?.lastSeen ?? -Infinity;
|
|
@@ -1176,61 +1376,61 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1176
1376
|
lastSeen
|
|
1177
1377
|
};
|
|
1178
1378
|
}).toSorted((a, b) => a.lastSeen - b.lastSeen);
|
|
1179
|
-
return /* @__PURE__ */
|
|
1379
|
+
return /* @__PURE__ */ import_react20.default.createElement(FullPresence, {
|
|
1180
1380
|
members: membersForObject
|
|
1181
1381
|
});
|
|
1182
1382
|
};
|
|
1183
1383
|
var FullPresence = (props) => {
|
|
1184
1384
|
const { size = 9, onMemberClick } = props;
|
|
1185
|
-
const members = (0,
|
|
1385
|
+
const members = (0, import_react_ui14.useDefaultValue)(props.members, () => []);
|
|
1186
1386
|
if (members.length === 0) {
|
|
1187
1387
|
return null;
|
|
1188
1388
|
}
|
|
1189
|
-
return /* @__PURE__ */
|
|
1389
|
+
return /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.AvatarGroup.Root, {
|
|
1190
1390
|
size,
|
|
1191
1391
|
classNames: "mbs-2 mie-4",
|
|
1192
1392
|
"data-testid": "spacePlugin.presence"
|
|
1193
|
-
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */
|
|
1393
|
+
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Root, {
|
|
1194
1394
|
key: member.identity.identityKey.toHex()
|
|
1195
|
-
}, /* @__PURE__ */
|
|
1395
|
+
}, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Trigger, null, /* @__PURE__ */ import_react20.default.createElement(PrensenceAvatar, {
|
|
1196
1396
|
identity: member.identity,
|
|
1197
1397
|
group: true,
|
|
1198
1398
|
match: member.currentlyAttended,
|
|
1199
1399
|
index: members.length - i,
|
|
1200
1400
|
onClick: () => onMemberClick?.(member)
|
|
1201
|
-
})), /* @__PURE__ */
|
|
1401
|
+
})), /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Portal, null, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Content, {
|
|
1202
1402
|
side: "bottom"
|
|
1203
|
-
}, /* @__PURE__ */
|
|
1403
|
+
}, /* @__PURE__ */ import_react20.default.createElement("span", null, getName(member.identity)), /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Arrow, null))))), members.length > 3 && /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Root, null, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Trigger, null, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.AvatarGroupItem.Root, {
|
|
1204
1404
|
status: "inactive"
|
|
1205
|
-
}, /* @__PURE__ */
|
|
1405
|
+
}, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Avatar.Frame, {
|
|
1206
1406
|
style: {
|
|
1207
1407
|
zIndex: members.length - 4
|
|
1208
1408
|
}
|
|
1209
|
-
}, /* @__PURE__ */
|
|
1409
|
+
}, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Avatar.Fallback, {
|
|
1210
1410
|
text: `+${members.length - 3}`
|
|
1211
|
-
})))), /* @__PURE__ */
|
|
1411
|
+
})))), /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Portal, null, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Content, {
|
|
1212
1412
|
side: "bottom"
|
|
1213
|
-
}, /* @__PURE__ */
|
|
1413
|
+
}, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Arrow, null), /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.List, {
|
|
1214
1414
|
classNames: "max-h-56 overflow-y-auto"
|
|
1215
|
-
}, members.map((member) => /* @__PURE__ */
|
|
1415
|
+
}, members.map((member) => /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.ListItem.Root, {
|
|
1216
1416
|
key: member.identity.identityKey.toHex(),
|
|
1217
1417
|
classNames: "flex gap-2 items-center cursor-pointer mbe-2",
|
|
1218
1418
|
onClick: () => onMemberClick?.(member),
|
|
1219
1419
|
"data-testid": "identity-list-item"
|
|
1220
|
-
}, /* @__PURE__ */
|
|
1420
|
+
}, /* @__PURE__ */ import_react20.default.createElement(PrensenceAvatar, {
|
|
1221
1421
|
identity: member.identity,
|
|
1222
1422
|
showName: true,
|
|
1223
1423
|
match: member.currentlyAttended
|
|
1224
1424
|
}))))))));
|
|
1225
1425
|
};
|
|
1226
1426
|
var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) => {
|
|
1227
|
-
const Root = group ?
|
|
1427
|
+
const Root = group ? import_react_ui14.AvatarGroupItem.Root : import_react_ui14.Avatar.Root;
|
|
1228
1428
|
const status = match ? "current" : "active";
|
|
1229
|
-
const fallbackValue = (0,
|
|
1230
|
-
return /* @__PURE__ */
|
|
1429
|
+
const fallbackValue = (0, import_util3.keyToFallback)(identity.identityKey);
|
|
1430
|
+
return /* @__PURE__ */ import_react20.default.createElement(Root, {
|
|
1231
1431
|
status,
|
|
1232
1432
|
hue: identity.profile?.data?.hue || fallbackValue.hue
|
|
1233
|
-
}, /* @__PURE__ */
|
|
1433
|
+
}, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Avatar.Frame, {
|
|
1234
1434
|
"data-testid": "spacePlugin.presence.member",
|
|
1235
1435
|
"data-status": status,
|
|
1236
1436
|
...index ? {
|
|
@@ -1239,9 +1439,9 @@ var PrensenceAvatar = ({ identity, showName, match, group, index, onClick }) =>
|
|
|
1239
1439
|
}
|
|
1240
1440
|
} : {},
|
|
1241
1441
|
onClick: () => onClick?.()
|
|
1242
|
-
}, /* @__PURE__ */
|
|
1442
|
+
}, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Avatar.Fallback, {
|
|
1243
1443
|
text: identity.profile?.data?.emoji || fallbackValue.emoji
|
|
1244
|
-
})), showName && /* @__PURE__ */
|
|
1444
|
+
})), showName && /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Avatar.Label, {
|
|
1245
1445
|
classNames: "text-sm truncate pli-2"
|
|
1246
1446
|
}, getName(identity)));
|
|
1247
1447
|
};
|
|
@@ -1250,8 +1450,8 @@ var SmallPresenceLive = ({ id, viewers }) => {
|
|
|
1250
1450
|
const moment = Date.now();
|
|
1251
1451
|
return Array.from(viewers2.values()).filter(({ lastSeen }) => moment - lastSeen < ACTIVITY_DURATION);
|
|
1252
1452
|
};
|
|
1253
|
-
const [activeViewers, setActiveViewers] = (0,
|
|
1254
|
-
(0,
|
|
1453
|
+
const [activeViewers, setActiveViewers] = (0, import_react20.useState)(viewers ? getActiveViewers(viewers) : []);
|
|
1454
|
+
(0, import_react20.useEffect)(() => {
|
|
1255
1455
|
if (viewers) {
|
|
1256
1456
|
setActiveViewers(getActiveViewers(viewers));
|
|
1257
1457
|
const interval = setInterval(() => {
|
|
@@ -1262,73 +1462,59 @@ var SmallPresenceLive = ({ id, viewers }) => {
|
|
|
1262
1462
|
}, [
|
|
1263
1463
|
viewers
|
|
1264
1464
|
]);
|
|
1265
|
-
return /* @__PURE__ */
|
|
1465
|
+
return /* @__PURE__ */ import_react20.default.createElement(SmallPresence, {
|
|
1266
1466
|
id,
|
|
1267
1467
|
count: activeViewers.length
|
|
1268
1468
|
});
|
|
1269
1469
|
};
|
|
1270
1470
|
var SmallPresence = ({ id, count }) => {
|
|
1271
|
-
const { t } = (0,
|
|
1471
|
+
const { t } = (0, import_react_ui14.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1272
1472
|
const { hasAttention, isAncestor, isRelated } = (0, import_react_ui_attention.useAttention)(id);
|
|
1273
1473
|
const attention = hasAttention || isAncestor || isRelated;
|
|
1274
|
-
return /* @__PURE__ */
|
|
1474
|
+
return /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Root, null, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Trigger, {
|
|
1275
1475
|
asChild: true
|
|
1276
|
-
}, /* @__PURE__ */
|
|
1476
|
+
}, /* @__PURE__ */ import_react20.default.createElement("div", {
|
|
1277
1477
|
role: "none",
|
|
1278
1478
|
className: "flex",
|
|
1279
1479
|
"data-attention": attention
|
|
1280
|
-
}, /* @__PURE__ */
|
|
1480
|
+
}, /* @__PURE__ */ import_react20.default.createElement(import_react_ui_attention.AttentionGlyph, {
|
|
1281
1481
|
presence: count > 1 ? "many" : count === 1 ? "one" : "none",
|
|
1282
1482
|
classNames: "self-center mie-1"
|
|
1283
|
-
}))), /* @__PURE__ */
|
|
1483
|
+
}))), /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Portal, null, /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Content, {
|
|
1284
1484
|
side: "bottom",
|
|
1285
1485
|
classNames: "z-[70]"
|
|
1286
|
-
}, /* @__PURE__ */
|
|
1486
|
+
}, /* @__PURE__ */ import_react20.default.createElement("span", null, t("presence label", {
|
|
1287
1487
|
count
|
|
1288
|
-
})), /* @__PURE__ */
|
|
1488
|
+
})), /* @__PURE__ */ import_react20.default.createElement(import_react_ui14.Tooltip.Arrow, null))));
|
|
1289
1489
|
};
|
|
1290
1490
|
var SpacePluginSettings = ({ settings }) => {
|
|
1291
|
-
const { t } = (0,
|
|
1292
|
-
const dispatch = (0,
|
|
1293
|
-
|
|
1294
|
-
return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement(import_react_ui_form.DeprecatedFormInput, {
|
|
1491
|
+
const { t } = (0, import_react_ui15.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1492
|
+
const dispatch = (0, import_app_framework8.useIntentDispatcher)();
|
|
1493
|
+
return /* @__PURE__ */ import_react21.default.createElement(import_react21.default.Fragment, null, /* @__PURE__ */ import_react21.default.createElement(import_react_ui_form3.DeprecatedFormInput, {
|
|
1295
1494
|
label: t("show hidden spaces label")
|
|
1296
|
-
}, /* @__PURE__ */
|
|
1495
|
+
}, /* @__PURE__ */ import_react21.default.createElement(import_react_ui15.Input.Switch, {
|
|
1297
1496
|
checked: settings.showHidden,
|
|
1298
1497
|
onCheckedChange: (checked) => dispatch({
|
|
1299
|
-
plugin:
|
|
1300
|
-
action:
|
|
1498
|
+
plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
|
|
1499
|
+
action: import_chunk_QNVEU2UD.SpaceAction.TOGGLE_HIDDEN,
|
|
1301
1500
|
data: {
|
|
1302
1501
|
state: !!checked
|
|
1303
1502
|
}
|
|
1304
1503
|
})
|
|
1305
|
-
}))
|
|
1306
|
-
label: t("default on space create label")
|
|
1307
|
-
}, /* @__PURE__ */ import_react18.default.createElement(import_react_ui12.Select.Root, {
|
|
1308
|
-
value: settings.onSpaceCreate,
|
|
1309
|
-
onValueChange: (value) => {
|
|
1310
|
-
settings.onSpaceCreate = value;
|
|
1311
|
-
}
|
|
1312
|
-
}, /* @__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, {
|
|
1313
|
-
key: onSpaceCreate.action,
|
|
1314
|
-
value: onSpaceCreate.action
|
|
1315
|
-
}, (0, import_react_ui12.toLocalizedString)(onSpaceCreate.label, t)))))))));
|
|
1504
|
+
})));
|
|
1316
1505
|
};
|
|
1317
1506
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsPanel.tsx";
|
|
1318
1507
|
var SpaceSettingsPanel = ({ space }) => {
|
|
1319
|
-
const { t } = (0,
|
|
1320
|
-
const client = (0,
|
|
1321
|
-
const
|
|
1322
|
-
const
|
|
1323
|
-
const
|
|
1324
|
-
const edgeReplicationAvailable = edgeAgents && managedDeviceAvailable;
|
|
1325
|
-
const [edgeReplication, setEdgeReplication] = (0, import_react21.useState)(space.internal.data.edgeReplication === import_metadata.EdgeReplicationSetting.ENABLED);
|
|
1326
|
-
const toggleEdgeReplication = (0, import_react21.useCallback)(async (next) => {
|
|
1508
|
+
const { t } = (0, import_react_ui17.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1509
|
+
const client = (0, import_react_client7.useClient)();
|
|
1510
|
+
const edgeEnabled = Boolean(client.config.values.runtime?.client?.edgeFeatures?.echoReplicator);
|
|
1511
|
+
const [edgeReplication, setEdgeReplication] = (0, import_react24.useState)(space.internal.data.edgeReplication === import_metadata2.EdgeReplicationSetting.ENABLED);
|
|
1512
|
+
const toggleEdgeReplication = (0, import_react24.useCallback)(async (next) => {
|
|
1327
1513
|
setEdgeReplication(next);
|
|
1328
|
-
await space?.internal.setEdgeReplicationPreference(next ?
|
|
1514
|
+
await space?.internal.setEdgeReplicationPreference(next ? import_metadata2.EdgeReplicationSetting.ENABLED : import_metadata2.EdgeReplicationSetting.DISABLED).catch((err) => {
|
|
1329
1515
|
import_log3.log.catch(err, void 0, {
|
|
1330
1516
|
F: __dxlog_file3,
|
|
1331
|
-
L:
|
|
1517
|
+
L: 35,
|
|
1332
1518
|
S: void 0,
|
|
1333
1519
|
C: (f, a) => f(...a)
|
|
1334
1520
|
});
|
|
@@ -1337,29 +1523,29 @@ var SpaceSettingsPanel = ({ space }) => {
|
|
|
1337
1523
|
}, [
|
|
1338
1524
|
space
|
|
1339
1525
|
]);
|
|
1340
|
-
return /* @__PURE__ */
|
|
1526
|
+
return /* @__PURE__ */ import_react24.default.createElement("div", {
|
|
1341
1527
|
role: "form",
|
|
1342
1528
|
className: "flex flex-col"
|
|
1343
|
-
}, /* @__PURE__ */
|
|
1529
|
+
}, /* @__PURE__ */ import_react24.default.createElement(import_react_ui_form4.DeprecatedFormInput, {
|
|
1344
1530
|
label: t("name label")
|
|
1345
|
-
}, /* @__PURE__ */
|
|
1531
|
+
}, /* @__PURE__ */ import_react24.default.createElement(import_react_ui17.Input.TextInput, {
|
|
1346
1532
|
placeholder: t("unnamed space label"),
|
|
1347
1533
|
value: space.properties.name ?? "",
|
|
1348
1534
|
onChange: (event) => {
|
|
1349
1535
|
space.properties.name = event.target.value;
|
|
1350
1536
|
}
|
|
1351
|
-
})),
|
|
1537
|
+
})), edgeEnabled && /* @__PURE__ */ import_react24.default.createElement(import_react_ui_form4.DeprecatedFormInput, {
|
|
1352
1538
|
label: t("edge replication label")
|
|
1353
|
-
}, /* @__PURE__ */
|
|
1539
|
+
}, /* @__PURE__ */ import_react24.default.createElement(import_react_ui17.Input.Switch, {
|
|
1354
1540
|
checked: edgeReplication,
|
|
1355
1541
|
onCheckedChange: toggleEdgeReplication
|
|
1356
1542
|
})));
|
|
1357
1543
|
};
|
|
1358
1544
|
var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "members", namesCache }) => {
|
|
1359
|
-
const { t } = (0,
|
|
1360
|
-
const client = (0,
|
|
1361
|
-
const [tabsActivePart, setTabsActivePart] = (0,
|
|
1362
|
-
const [selected, setSelected] = (0,
|
|
1545
|
+
const { t } = (0, import_react_ui16.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1546
|
+
const client = (0, import_react_client6.useClient)();
|
|
1547
|
+
const [tabsActivePart, setTabsActivePart] = (0, import_react22.useState)("list");
|
|
1548
|
+
const [selected, setSelected] = (0, import_react22.useState)(initialTab);
|
|
1363
1549
|
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
1364
1550
|
const name = getSpaceDisplayName(space, {
|
|
1365
1551
|
personal: client.spaces.default === space,
|
|
@@ -1368,64 +1554,64 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
|
|
|
1368
1554
|
return (
|
|
1369
1555
|
// TODO(wittjosiah): The tablist dialog pattern is copied from @dxos/plugin-manager.
|
|
1370
1556
|
// Consider factoring it out to the tabs package.
|
|
1371
|
-
/* @__PURE__ */
|
|
1557
|
+
/* @__PURE__ */ import_react22.default.createElement(import_react_ui16.Dialog.Content, {
|
|
1372
1558
|
classNames: "p-0 bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
1373
|
-
}, /* @__PURE__ */
|
|
1559
|
+
}, /* @__PURE__ */ import_react22.default.createElement("div", {
|
|
1374
1560
|
role: "none",
|
|
1375
1561
|
className: "flex justify-between pbs-3 pis-2 pie-3 @md:pbs-4 @md:pis-4 @md:pie-5"
|
|
1376
|
-
}, /* @__PURE__ */
|
|
1562
|
+
}, /* @__PURE__ */ import_react22.default.createElement(import_react_ui16.Dialog.Title, {
|
|
1377
1563
|
onClick: () => setTabsActivePart("list"),
|
|
1378
1564
|
"aria-description": t("click to return to tablist description"),
|
|
1379
1565
|
classNames: "flex cursor-pointer items-center group/title"
|
|
1380
|
-
}, /* @__PURE__ */
|
|
1566
|
+
}, /* @__PURE__ */ import_react22.default.createElement(import_react_ui16.Icon, {
|
|
1381
1567
|
icon: "ph--caret-left--regular",
|
|
1382
1568
|
size: 4,
|
|
1383
1569
|
classNames: [
|
|
1384
1570
|
"@md:hidden",
|
|
1385
1571
|
tabsActivePart === "list" && "invisible"
|
|
1386
1572
|
]
|
|
1387
|
-
}), /* @__PURE__ */
|
|
1573
|
+
}), /* @__PURE__ */ import_react22.default.createElement("span", {
|
|
1388
1574
|
className: tabsActivePart !== "list" ? "group-hover/title:underline @md:group-hover/title:no-underline underline-offset-4 decoration-1" : ""
|
|
1389
|
-
}, (0,
|
|
1575
|
+
}, (0, import_react_ui16.toLocalizedString)(name, t))), /* @__PURE__ */ import_react22.default.createElement(import_react_ui16.Dialog.Close, {
|
|
1390
1576
|
asChild: true
|
|
1391
|
-
}, /* @__PURE__ */
|
|
1577
|
+
}, /* @__PURE__ */ import_react22.default.createElement(import_react_ui16.Button, {
|
|
1392
1578
|
density: "fine",
|
|
1393
1579
|
variant: "ghost",
|
|
1394
1580
|
autoFocus: true
|
|
1395
|
-
}, /* @__PURE__ */
|
|
1581
|
+
}, /* @__PURE__ */ import_react22.default.createElement(import_react_ui16.Icon, {
|
|
1396
1582
|
icon: "ph--x--regular",
|
|
1397
|
-
size:
|
|
1398
|
-
})))), /* @__PURE__ */
|
|
1583
|
+
size: 4
|
|
1584
|
+
})))), /* @__PURE__ */ import_react22.default.createElement(import_react_ui_tabs.Tabs.Root, {
|
|
1399
1585
|
orientation: "vertical",
|
|
1400
1586
|
value: selected,
|
|
1401
1587
|
onValueChange: setSelected,
|
|
1402
1588
|
activePart: tabsActivePart,
|
|
1403
1589
|
onActivePartChange: setTabsActivePart,
|
|
1404
1590
|
classNames: "flex flex-col flex-1 mbs-2"
|
|
1405
|
-
}, /* @__PURE__ */
|
|
1591
|
+
}, /* @__PURE__ */ import_react22.default.createElement(import_react_ui_tabs.Tabs.Viewport, {
|
|
1406
1592
|
classNames: "flex-1 min-bs-0"
|
|
1407
|
-
}, /* @__PURE__ */
|
|
1593
|
+
}, /* @__PURE__ */ import_react22.default.createElement("div", {
|
|
1408
1594
|
role: "none",
|
|
1409
1595
|
className: "overflow-y-auto pli-3 @md:pis-2 @md:pie-0 mbe-4 border-r border-separator"
|
|
1410
|
-
}, /* @__PURE__ */
|
|
1596
|
+
}, /* @__PURE__ */ import_react22.default.createElement(import_react_ui_tabs.Tabs.Tablist, {
|
|
1411
1597
|
classNames: "flex flex-col max-bs-none min-is-[200px] gap-4 overflow-y-auto"
|
|
1412
|
-
}, /* @__PURE__ */
|
|
1598
|
+
}, /* @__PURE__ */ import_react22.default.createElement("div", {
|
|
1413
1599
|
role: "none",
|
|
1414
1600
|
className: "flex flex-col ml-1"
|
|
1415
|
-
}, /* @__PURE__ */
|
|
1601
|
+
}, /* @__PURE__ */ import_react22.default.createElement(import_react_ui_tabs.Tabs.Tab, {
|
|
1416
1602
|
value: "settings"
|
|
1417
|
-
}, t("settings tab label")), /* @__PURE__ */
|
|
1603
|
+
}, t("settings tab label")), /* @__PURE__ */ import_react22.default.createElement(import_react_ui_tabs.Tabs.Tab, {
|
|
1418
1604
|
value: "members",
|
|
1419
1605
|
disabled: locked
|
|
1420
|
-
}, t("members tab label"))))), /* @__PURE__ */
|
|
1606
|
+
}, t("members tab label"))))), /* @__PURE__ */ import_react22.default.createElement(import_react_ui_tabs.Tabs.Tabpanel, {
|
|
1421
1607
|
value: "settings",
|
|
1422
1608
|
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
1423
|
-
}, /* @__PURE__ */
|
|
1609
|
+
}, /* @__PURE__ */ import_react22.default.createElement(SpaceSettingsPanel, {
|
|
1424
1610
|
space
|
|
1425
|
-
})), /* @__PURE__ */
|
|
1611
|
+
})), /* @__PURE__ */ import_react22.default.createElement(import_react_ui_tabs.Tabs.Tabpanel, {
|
|
1426
1612
|
value: "members",
|
|
1427
1613
|
classNames: "pli-3 @md:pli-5 max-bs-dvh overflow-y-auto"
|
|
1428
|
-
}, /* @__PURE__ */
|
|
1614
|
+
}, /* @__PURE__ */ import_react22.default.createElement(import_react23.ClipboardProvider, null, /* @__PURE__ */ import_react22.default.createElement(import_react23.SpacePanel, {
|
|
1429
1615
|
space,
|
|
1430
1616
|
hideHeading: true,
|
|
1431
1617
|
target,
|
|
@@ -1433,6 +1619,112 @@ var SpaceSettingsDialog = ({ space, target, createInvitationUrl, initialTab = "m
|
|
|
1433
1619
|
}))))))
|
|
1434
1620
|
);
|
|
1435
1621
|
};
|
|
1622
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts";
|
|
1623
|
+
var createEmptyEdgeSyncState = () => ({
|
|
1624
|
+
missingOnLocal: 0,
|
|
1625
|
+
missingOnRemote: 0,
|
|
1626
|
+
localDocumentCount: 0,
|
|
1627
|
+
remoteDocumentCount: 0,
|
|
1628
|
+
differentDocuments: 0
|
|
1629
|
+
});
|
|
1630
|
+
var getSyncSummary = (syncMap) => {
|
|
1631
|
+
return Object.entries(syncMap).reduce((summary, [_spaceId, peerState]) => {
|
|
1632
|
+
summary.missingOnLocal += peerState.missingOnLocal;
|
|
1633
|
+
summary.missingOnRemote += peerState.missingOnRemote;
|
|
1634
|
+
summary.localDocumentCount += peerState.localDocumentCount;
|
|
1635
|
+
summary.remoteDocumentCount += peerState.remoteDocumentCount;
|
|
1636
|
+
summary.differentDocuments += peerState.differentDocuments;
|
|
1637
|
+
return summary;
|
|
1638
|
+
}, createEmptyEdgeSyncState());
|
|
1639
|
+
};
|
|
1640
|
+
var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${import_protocols.EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
|
|
1641
|
+
var useSyncState = () => {
|
|
1642
|
+
const client = (0, import_react_client9.useClient)();
|
|
1643
|
+
const [spaceState, setSpaceState] = (0, import_react26.useState)({});
|
|
1644
|
+
(0, import_react26.useEffect)(() => {
|
|
1645
|
+
const ctx = new import_context.Context(void 0, {
|
|
1646
|
+
F: __dxlog_file4,
|
|
1647
|
+
L: 48
|
|
1648
|
+
});
|
|
1649
|
+
const createSubscriptions = (spaces) => {
|
|
1650
|
+
for (const space of spaces) {
|
|
1651
|
+
if (spaceState[space.id]) {
|
|
1652
|
+
continue;
|
|
1653
|
+
}
|
|
1654
|
+
ctx.onDispose(space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
|
|
1655
|
+
const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
|
|
1656
|
+
if (syncState) {
|
|
1657
|
+
setSpaceState((spaceState2) => ({
|
|
1658
|
+
...spaceState2,
|
|
1659
|
+
[space.id]: syncState
|
|
1660
|
+
}));
|
|
1661
|
+
}
|
|
1662
|
+
}));
|
|
1663
|
+
}
|
|
1664
|
+
};
|
|
1665
|
+
createSubscriptions(client.spaces.get());
|
|
1666
|
+
client.spaces.subscribe((spaces) => {
|
|
1667
|
+
createSubscriptions(spaces);
|
|
1668
|
+
});
|
|
1669
|
+
return () => {
|
|
1670
|
+
void ctx.dispose();
|
|
1671
|
+
};
|
|
1672
|
+
}, [
|
|
1673
|
+
client
|
|
1674
|
+
]);
|
|
1675
|
+
return spaceState;
|
|
1676
|
+
};
|
|
1677
|
+
var useSpaceSyncState = (space) => {
|
|
1678
|
+
const [spaceState, setSpaceState] = (0, import_react26.useState)();
|
|
1679
|
+
(0, import_react26.useEffect)(() => {
|
|
1680
|
+
const ctx = new import_context.Context(void 0, {
|
|
1681
|
+
F: __dxlog_file4,
|
|
1682
|
+
L: 87
|
|
1683
|
+
});
|
|
1684
|
+
space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
|
|
1685
|
+
const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
|
|
1686
|
+
if (syncState) {
|
|
1687
|
+
setSpaceState(syncState);
|
|
1688
|
+
}
|
|
1689
|
+
});
|
|
1690
|
+
return () => {
|
|
1691
|
+
void ctx.dispose();
|
|
1692
|
+
};
|
|
1693
|
+
}, [
|
|
1694
|
+
space
|
|
1695
|
+
]);
|
|
1696
|
+
return spaceState;
|
|
1697
|
+
};
|
|
1698
|
+
var useEdgeStatus = () => {
|
|
1699
|
+
const [status, setStatus] = (0, import_react25.useState)(import_services.QueryEdgeStatusResponse.EdgeStatus.NOT_CONNECTED);
|
|
1700
|
+
const client = (0, import_react_client8.useClient)();
|
|
1701
|
+
(0, import_react25.useEffect)(() => {
|
|
1702
|
+
client.services.services.EdgeAgentService?.queryEdgeStatus().subscribe(({ status: status2 }) => {
|
|
1703
|
+
setStatus(status2);
|
|
1704
|
+
});
|
|
1705
|
+
}, [
|
|
1706
|
+
client
|
|
1707
|
+
]);
|
|
1708
|
+
return status;
|
|
1709
|
+
};
|
|
1710
|
+
var InlineSyncStatus = ({ space }) => {
|
|
1711
|
+
const { t } = (0, import_react_ui18.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1712
|
+
const connectedToEdge = useEdgeStatus() === import_services.QueryEdgeStatusResponse.EdgeStatus.CONNECTED;
|
|
1713
|
+
const edgeSyncEnabled = space.internal.data.edgeReplication === import_metadata3.EdgeReplicationSetting.ENABLED;
|
|
1714
|
+
const syncState = useSpaceSyncState(space);
|
|
1715
|
+
if (!connectedToEdge || !edgeSyncEnabled || !syncState || syncState.missingOnLocal === 0) {
|
|
1716
|
+
return null;
|
|
1717
|
+
}
|
|
1718
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1719
|
+
role: "status",
|
|
1720
|
+
"aria-label": t("syncing message"),
|
|
1721
|
+
className: "flex items-center"
|
|
1722
|
+
}, /* @__PURE__ */ import_react25.default.createElement(import_react_ui18.Icon, {
|
|
1723
|
+
icon: "ph--arrows-clockwise--regular",
|
|
1724
|
+
size: 3,
|
|
1725
|
+
classNames: "animate-spin"
|
|
1726
|
+
}));
|
|
1727
|
+
};
|
|
1436
1728
|
var SYNC_STALLED_TIMEOUT = 5e3;
|
|
1437
1729
|
var styles = {
|
|
1438
1730
|
barBg: "bg-neutral-50 dark:bg-green-900 text-black",
|
|
@@ -1440,9 +1732,9 @@ var styles = {
|
|
|
1440
1732
|
barHover: "dark:hover:bg-green-500"
|
|
1441
1733
|
};
|
|
1442
1734
|
var useActive = (count) => {
|
|
1443
|
-
const [current, setCurrent] = (0,
|
|
1444
|
-
const [active, setActive] = (0,
|
|
1445
|
-
(0,
|
|
1735
|
+
const [current, setCurrent] = (0, import_react28.useState)(count);
|
|
1736
|
+
const [active, setActive] = (0, import_react28.useState)(false);
|
|
1737
|
+
(0, import_react28.useEffect)(() => {
|
|
1446
1738
|
let t;
|
|
1447
1739
|
if (count !== current) {
|
|
1448
1740
|
setActive(true);
|
|
@@ -1462,20 +1754,38 @@ var useActive = (count) => {
|
|
|
1462
1754
|
]);
|
|
1463
1755
|
return active;
|
|
1464
1756
|
};
|
|
1465
|
-
var
|
|
1757
|
+
var SpaceRowContainer = ({ spaceId, state }) => {
|
|
1758
|
+
const { t } = (0, import_react_ui20.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1759
|
+
const client = (0, import_react_client11.useClient)();
|
|
1760
|
+
const space = (0, import_echo9.useSpace)(spaceId);
|
|
1761
|
+
if (!space) {
|
|
1762
|
+
return null;
|
|
1763
|
+
}
|
|
1764
|
+
const spaceName = (0, import_react_ui20.toLocalizedString)(getSpaceDisplayName(space, {
|
|
1765
|
+
personal: space === client.spaces.default
|
|
1766
|
+
}), t);
|
|
1767
|
+
return /* @__PURE__ */ import_react28.default.createElement(SpaceRow, {
|
|
1768
|
+
spaceId,
|
|
1769
|
+
spaceName,
|
|
1770
|
+
state
|
|
1771
|
+
});
|
|
1772
|
+
};
|
|
1773
|
+
var SpaceRow = ({ spaceId, spaceName, state: { localDocumentCount, remoteDocumentCount, missingOnLocal, missingOnRemote } }) => {
|
|
1466
1774
|
const downActive = useActive(localDocumentCount);
|
|
1467
1775
|
const upActive = useActive(remoteDocumentCount);
|
|
1468
|
-
return /* @__PURE__ */
|
|
1469
|
-
className:
|
|
1776
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", {
|
|
1777
|
+
className: "flex items-center mx-0.5 gap-0.5 cursor-pointer",
|
|
1470
1778
|
title: spaceId,
|
|
1471
1779
|
onClick: () => {
|
|
1472
1780
|
void navigator.clipboard.writeText(spaceId);
|
|
1473
1781
|
}
|
|
1474
|
-
}, /* @__PURE__ */
|
|
1782
|
+
}, /* @__PURE__ */ import_react28.default.createElement("span", {
|
|
1783
|
+
className: "is-1/2 truncate"
|
|
1784
|
+
}, spaceName), /* @__PURE__ */ import_react28.default.createElement(import_react_ui20.Icon, {
|
|
1475
1785
|
icon: "ph--arrow-fat-line-left--regular",
|
|
1476
1786
|
size: 3,
|
|
1477
1787
|
classNames: (0, import_react_ui_theme5.mx)(downActive && "animate-[pulse_1s_infinite]")
|
|
1478
|
-
}), /* @__PURE__ */
|
|
1788
|
+
}), /* @__PURE__ */ import_react28.default.createElement(Candle, {
|
|
1479
1789
|
up: {
|
|
1480
1790
|
count: remoteDocumentCount,
|
|
1481
1791
|
total: remoteDocumentCount + missingOnRemote
|
|
@@ -1485,41 +1795,41 @@ var SpaceRow = ({ spaceId, state: { localDocumentCount, remoteDocumentCount, mis
|
|
|
1485
1795
|
total: localDocumentCount + missingOnLocal
|
|
1486
1796
|
},
|
|
1487
1797
|
title: spaceId
|
|
1488
|
-
}), /* @__PURE__ */
|
|
1798
|
+
}), /* @__PURE__ */ import_react28.default.createElement(import_react_ui20.Icon, {
|
|
1489
1799
|
icon: "ph--arrow-fat-line-right--regular",
|
|
1490
1800
|
size: 3,
|
|
1491
1801
|
classNames: (0, import_react_ui_theme5.mx)(upActive && "animate-[pulse_1s_step-start_infinite]")
|
|
1492
1802
|
}));
|
|
1493
1803
|
};
|
|
1494
1804
|
var Candle = ({ classNames, up, down }) => {
|
|
1495
|
-
return /* @__PURE__ */
|
|
1805
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", {
|
|
1496
1806
|
className: (0, import_react_ui_theme5.mx)("grid grid-cols-[1fr_2rem_1fr] w-full h-3", classNames)
|
|
1497
|
-
}, /* @__PURE__ */
|
|
1807
|
+
}, /* @__PURE__ */ import_react28.default.createElement(Bar, {
|
|
1498
1808
|
classNames: "justify-end",
|
|
1499
1809
|
...up
|
|
1500
|
-
}), /* @__PURE__ */
|
|
1810
|
+
}), /* @__PURE__ */ import_react28.default.createElement("div", {
|
|
1501
1811
|
className: "relative"
|
|
1502
|
-
}, /* @__PURE__ */
|
|
1812
|
+
}, /* @__PURE__ */ import_react28.default.createElement("div", {
|
|
1503
1813
|
className: (0, import_react_ui_theme5.mx)("absolute inset-0 flex items-center justify-center text-xs", styles.barBg)
|
|
1504
|
-
}, up.total)), /* @__PURE__ */
|
|
1814
|
+
}, up.total)), /* @__PURE__ */ import_react28.default.createElement(Bar, down));
|
|
1505
1815
|
};
|
|
1506
1816
|
var Bar = ({ classNames, count, total }) => {
|
|
1507
1817
|
let p = count / total * 100;
|
|
1508
1818
|
if (count < total) {
|
|
1509
1819
|
p = Math.min(p, 95);
|
|
1510
1820
|
}
|
|
1511
|
-
return /* @__PURE__ */
|
|
1821
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", {
|
|
1512
1822
|
className: (0, import_react_ui_theme5.mx)("relative flex w-full", styles.barBg, classNames)
|
|
1513
|
-
}, /* @__PURE__ */
|
|
1823
|
+
}, /* @__PURE__ */ import_react28.default.createElement("div", {
|
|
1514
1824
|
className: (0, import_react_ui_theme5.mx)("shrink-0", styles.barFg),
|
|
1515
1825
|
style: {
|
|
1516
1826
|
width: `${p}%`
|
|
1517
1827
|
}
|
|
1518
|
-
}), count !== total && /* @__PURE__ */
|
|
1828
|
+
}), count !== total && /* @__PURE__ */ import_react28.default.createElement("div", {
|
|
1519
1829
|
className: "absolute top-0 bottom-0 flex items-center mx-0.5 text-black text-xs"
|
|
1520
1830
|
}, count));
|
|
1521
1831
|
};
|
|
1522
|
-
var
|
|
1832
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts";
|
|
1523
1833
|
var createClientSaveTracker = (client, cb) => {
|
|
1524
1834
|
const unsubscribeCallbacks = {};
|
|
1525
1835
|
const state = {};
|
|
@@ -1546,8 +1856,8 @@ var createClientSaveTracker = (client, cb) => {
|
|
|
1546
1856
|
};
|
|
1547
1857
|
};
|
|
1548
1858
|
var createSpaceSaveTracker = (space, cb) => {
|
|
1549
|
-
const ctx = new
|
|
1550
|
-
F:
|
|
1859
|
+
const ctx = new import_context2.Context(void 0, {
|
|
1860
|
+
F: __dxlog_file5,
|
|
1551
1861
|
L: 40
|
|
1552
1862
|
});
|
|
1553
1863
|
void space.waitUntilReady().then(() => {
|
|
@@ -1605,77 +1915,22 @@ var getIcon = (status) => {
|
|
|
1605
1915
|
return "ph--cloud-check--regular";
|
|
1606
1916
|
}
|
|
1607
1917
|
};
|
|
1608
|
-
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/sync-state.ts";
|
|
1609
|
-
var createEmptyEdgeSyncState = () => ({
|
|
1610
|
-
missingOnLocal: 0,
|
|
1611
|
-
missingOnRemote: 0,
|
|
1612
|
-
localDocumentCount: 0,
|
|
1613
|
-
remoteDocumentCount: 0,
|
|
1614
|
-
differentDocuments: 0
|
|
1615
|
-
});
|
|
1616
|
-
var getSyncSummary = (syncMap) => {
|
|
1617
|
-
return Object.entries(syncMap).reduce((summary, [_spaceId, peerState]) => {
|
|
1618
|
-
summary.missingOnLocal += peerState.missingOnLocal;
|
|
1619
|
-
summary.missingOnRemote += peerState.missingOnRemote;
|
|
1620
|
-
summary.localDocumentCount += peerState.localDocumentCount;
|
|
1621
|
-
summary.remoteDocumentCount += peerState.remoteDocumentCount;
|
|
1622
|
-
summary.differentDocuments += peerState.differentDocuments;
|
|
1623
|
-
return summary;
|
|
1624
|
-
}, createEmptyEdgeSyncState());
|
|
1625
|
-
};
|
|
1626
|
-
var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${import_protocols.EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
|
|
1627
|
-
var useSyncState = () => {
|
|
1628
|
-
const client = (0, import_react_client8.useClient)();
|
|
1629
|
-
const [spaceState, setSpaceState] = (0, import_react24.useState)({});
|
|
1630
|
-
(0, import_react24.useEffect)(() => {
|
|
1631
|
-
const ctx = new import_context2.Context(void 0, {
|
|
1632
|
-
F: __dxlog_file5,
|
|
1633
|
-
L: 48
|
|
1634
|
-
});
|
|
1635
|
-
const createSubscriptions = (spaces) => {
|
|
1636
|
-
for (const space of spaces) {
|
|
1637
|
-
if (spaceState[space.id]) {
|
|
1638
|
-
continue;
|
|
1639
|
-
}
|
|
1640
|
-
ctx.onDispose(space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
|
|
1641
|
-
const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
|
|
1642
|
-
if (syncState) {
|
|
1643
|
-
setSpaceState((spaceState2) => ({
|
|
1644
|
-
...spaceState2,
|
|
1645
|
-
[space.id]: syncState
|
|
1646
|
-
}));
|
|
1647
|
-
}
|
|
1648
|
-
}));
|
|
1649
|
-
}
|
|
1650
|
-
};
|
|
1651
|
-
createSubscriptions(client.spaces.get());
|
|
1652
|
-
client.spaces.subscribe((spaces) => {
|
|
1653
|
-
createSubscriptions(spaces);
|
|
1654
|
-
});
|
|
1655
|
-
return () => {
|
|
1656
|
-
void ctx.dispose();
|
|
1657
|
-
};
|
|
1658
|
-
}, [
|
|
1659
|
-
client
|
|
1660
|
-
]);
|
|
1661
|
-
return spaceState;
|
|
1662
|
-
};
|
|
1663
1918
|
var SyncStatus = () => {
|
|
1664
|
-
const client = (0,
|
|
1919
|
+
const client = (0, import_react_client10.useClient)();
|
|
1665
1920
|
const state = useSyncState();
|
|
1666
|
-
const [saved, setSaved] = (0,
|
|
1667
|
-
(0,
|
|
1921
|
+
const [saved, setSaved] = (0, import_react27.useState)(true);
|
|
1922
|
+
(0, import_react27.useEffect)(() => {
|
|
1668
1923
|
return createClientSaveTracker(client, (state2) => {
|
|
1669
1924
|
setSaved(state2 === "saved");
|
|
1670
1925
|
});
|
|
1671
1926
|
}, []);
|
|
1672
|
-
return /* @__PURE__ */
|
|
1927
|
+
return /* @__PURE__ */ import_react27.default.createElement(SyncStatusIndicator, {
|
|
1673
1928
|
state,
|
|
1674
1929
|
saved
|
|
1675
1930
|
});
|
|
1676
1931
|
};
|
|
1677
1932
|
var SyncStatusIndicator = ({ state, saved }) => {
|
|
1678
|
-
const { t } = (0,
|
|
1933
|
+
const { t } = (0, import_react_ui19.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1679
1934
|
const summary = getSyncSummary(state);
|
|
1680
1935
|
const offline = Object.values(state).length === 0;
|
|
1681
1936
|
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
@@ -1686,8 +1941,8 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1686
1941
|
needsToUpload,
|
|
1687
1942
|
needsToDownload
|
|
1688
1943
|
});
|
|
1689
|
-
const [classNames, setClassNames] = (0,
|
|
1690
|
-
(0,
|
|
1944
|
+
const [classNames, setClassNames] = (0, import_react27.useState)();
|
|
1945
|
+
(0, import_react27.useEffect)(() => {
|
|
1691
1946
|
setClassNames(void 0);
|
|
1692
1947
|
if (offline || !needsToUpload && !needsToDownload) {
|
|
1693
1948
|
return;
|
|
@@ -1702,23 +1957,23 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1702
1957
|
needsToDownload
|
|
1703
1958
|
]);
|
|
1704
1959
|
const title = t(`${status} label`);
|
|
1705
|
-
const icon = /* @__PURE__ */
|
|
1960
|
+
const icon = /* @__PURE__ */ import_react27.default.createElement(import_react_ui19.Icon, {
|
|
1706
1961
|
icon: getIcon(status),
|
|
1707
1962
|
size: 4,
|
|
1708
1963
|
classNames
|
|
1709
1964
|
});
|
|
1710
1965
|
if (offline) {
|
|
1711
|
-
return /* @__PURE__ */
|
|
1966
|
+
return /* @__PURE__ */ import_react27.default.createElement(import_plugin_status_bar.StatusBar.Item, {
|
|
1712
1967
|
title
|
|
1713
1968
|
}, icon);
|
|
1714
1969
|
} else {
|
|
1715
|
-
return /* @__PURE__ */
|
|
1970
|
+
return /* @__PURE__ */ import_react27.default.createElement(import_react_ui19.Popover.Root, null, /* @__PURE__ */ import_react27.default.createElement(import_react_ui19.Popover.Trigger, {
|
|
1716
1971
|
asChild: true
|
|
1717
|
-
}, /* @__PURE__ */
|
|
1972
|
+
}, /* @__PURE__ */ import_react27.default.createElement(import_plugin_status_bar.StatusBar.Button, {
|
|
1718
1973
|
title
|
|
1719
|
-
}, icon)), /* @__PURE__ */
|
|
1974
|
+
}, icon)), /* @__PURE__ */ import_react27.default.createElement(import_react_ui19.Popover.Portal, null, /* @__PURE__ */ import_react27.default.createElement(import_react_ui19.Popover.Content, {
|
|
1720
1975
|
sideOffset: 16
|
|
1721
|
-
}, /* @__PURE__ */
|
|
1976
|
+
}, /* @__PURE__ */ import_react27.default.createElement(SyncStatusDetail, {
|
|
1722
1977
|
state,
|
|
1723
1978
|
summary,
|
|
1724
1979
|
debug: false
|
|
@@ -1726,24 +1981,46 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1726
1981
|
}
|
|
1727
1982
|
};
|
|
1728
1983
|
var SyncStatusDetail = ({ classNames, state, summary, debug }) => {
|
|
1729
|
-
const
|
|
1730
|
-
const
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1984
|
+
const [showAll, setShowAll] = (0, import_react27.useState)(false);
|
|
1985
|
+
const { t } = (0, import_react_ui19.useTranslation)(import_chunk_QNVEU2UD.SPACE_PLUGIN);
|
|
1986
|
+
const entries = Object.entries(state).filter(([_, value]) => showAll || value.missingOnLocal + value.missingOnRemote > 0).toSorted(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
1987
|
+
const handleCheckedChange = (0, import_react27.useCallback)((state2) => setShowAll(state2), [
|
|
1988
|
+
setShowAll
|
|
1989
|
+
]);
|
|
1990
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", {
|
|
1991
|
+
className: (0, import_react_ui_theme4.mx)("flex flex-col gap-3 p-2 text-xs min-w-96", classNames)
|
|
1992
|
+
}, /* @__PURE__ */ import_react27.default.createElement("div", {
|
|
1993
|
+
role: "none",
|
|
1994
|
+
className: "flex items-center"
|
|
1995
|
+
}, /* @__PURE__ */ import_react27.default.createElement("h1", {
|
|
1996
|
+
className: "flex-1"
|
|
1997
|
+
}, t("sync status title")), /* @__PURE__ */ import_react27.default.createElement("div", {
|
|
1998
|
+
className: "flex items-center gap-2"
|
|
1999
|
+
}, /* @__PURE__ */ import_react27.default.createElement(import_react_ui19.Input.Root, null, /* @__PURE__ */ import_react27.default.createElement(import_react_ui19.Input.Label, {
|
|
2000
|
+
classNames: "text-xs"
|
|
2001
|
+
}, t("show all label")), /* @__PURE__ */ import_react27.default.createElement(import_react_ui19.Input.Checkbox, {
|
|
2002
|
+
checked: showAll,
|
|
2003
|
+
onCheckedChange: handleCheckedChange
|
|
2004
|
+
})))), /* @__PURE__ */ import_react27.default.createElement("div", {
|
|
1734
2005
|
className: "flex flex-col gap-2"
|
|
1735
|
-
}, entries.
|
|
2006
|
+
}, entries.length === 0 && /* @__PURE__ */ import_react27.default.createElement("div", {
|
|
2007
|
+
role: "none",
|
|
2008
|
+
className: "flex justify-center"
|
|
2009
|
+
}, t("no sync status label")), entries.map(([spaceId, state2]) => /* @__PURE__ */ import_react27.default.createElement(SpaceRowContainer, {
|
|
1736
2010
|
key: spaceId,
|
|
1737
2011
|
spaceId,
|
|
1738
2012
|
state: state2
|
|
1739
|
-
}))), debug && /* @__PURE__ */
|
|
2013
|
+
}))), debug && /* @__PURE__ */ import_react27.default.createElement(import_react_ui_syntax_highlighter.SyntaxHighlighter, {
|
|
1740
2014
|
language: "json"
|
|
1741
2015
|
}, JSON.stringify(summary, null, 2)));
|
|
1742
2016
|
};
|
|
1743
2017
|
var translations_default = [
|
|
1744
2018
|
{
|
|
1745
2019
|
"en-US": {
|
|
1746
|
-
[
|
|
2020
|
+
[import_chunk_6SNOZF7Y.CollectionType.typename]: {
|
|
2021
|
+
"typename label": "Collection"
|
|
2022
|
+
},
|
|
2023
|
+
[import_chunk_QNVEU2UD.SPACE_PLUGIN]: {
|
|
1747
2024
|
"plugin name": "Spaces",
|
|
1748
2025
|
"first run message": "Nothing selected.",
|
|
1749
2026
|
"create space label": "Create space",
|
|
@@ -1836,7 +2113,18 @@ var translations_default = [
|
|
|
1836
2113
|
"open settings panel label": "Show Settings",
|
|
1837
2114
|
"open space settings label": "Space Settings",
|
|
1838
2115
|
"members tab label": "Members",
|
|
1839
|
-
"settings tab label": "Settings"
|
|
2116
|
+
"settings tab label": "Settings",
|
|
2117
|
+
"syncing message": "Space syncing",
|
|
2118
|
+
"show all label": "Show all",
|
|
2119
|
+
"no sync status label": "No space with missing objects.",
|
|
2120
|
+
"create space dialog title": "Create Space",
|
|
2121
|
+
"create object dialog title": "Create Object",
|
|
2122
|
+
"space input placeholder": "Select space",
|
|
2123
|
+
"schema input placeholder": "Select object type",
|
|
2124
|
+
"creating object type label": "Type",
|
|
2125
|
+
"creating in space label": "In Space",
|
|
2126
|
+
"creating in collection label": "In Collection",
|
|
2127
|
+
"clear input label": "Clear"
|
|
1840
2128
|
}
|
|
1841
2129
|
}
|
|
1842
2130
|
}
|
|
@@ -1848,27 +2136,28 @@ var SPACE_MAX_OBJECTS = 500;
|
|
|
1848
2136
|
var DIRECTORY_TYPE = "text/directory";
|
|
1849
2137
|
var parseSpacePlugin = (plugin) => Array.isArray(plugin?.provides.space?.enabled) ? plugin : void 0;
|
|
1850
2138
|
var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "spaceInvitationCode", firstRun, onFirstRun } = {}) => {
|
|
1851
|
-
const settings = new import_local_storage.LocalStorageStore(
|
|
1852
|
-
|
|
1853
|
-
});
|
|
1854
|
-
const state = new import_local_storage.LocalStorageStore(import_chunk_JFDDZI4Y.SPACE_PLUGIN, {
|
|
2139
|
+
const settings = new import_local_storage.LocalStorageStore(import_chunk_QNVEU2UD.SPACE_PLUGIN, {});
|
|
2140
|
+
const state = new import_local_storage.LocalStorageStore(import_chunk_QNVEU2UD.SPACE_PLUGIN, {
|
|
1855
2141
|
awaiting: void 0,
|
|
1856
2142
|
spaceNames: {},
|
|
1857
2143
|
viewersByObject: {},
|
|
1858
2144
|
// TODO(wittjosiah): Stop using (Complex)Map inside reactive object.
|
|
1859
2145
|
viewersByIdentity: new import_util.ComplexMap(import_react_client.PublicKey.hash),
|
|
1860
2146
|
sdkMigrationRunning: {},
|
|
1861
|
-
navigableCollections: false
|
|
2147
|
+
navigableCollections: false,
|
|
2148
|
+
enabledEdgeReplication: false
|
|
1862
2149
|
});
|
|
1863
2150
|
const subscriptions = new import_async.EventSubscriptions();
|
|
1864
2151
|
const spaceSubscriptions = new import_async.EventSubscriptions();
|
|
1865
2152
|
const graphSubscriptions = /* @__PURE__ */ new Map();
|
|
2153
|
+
const schemas = [];
|
|
1866
2154
|
let clientPlugin;
|
|
1867
2155
|
let graphPlugin;
|
|
1868
2156
|
let intentPlugin;
|
|
1869
2157
|
let layoutPlugin;
|
|
1870
2158
|
let navigationPlugin;
|
|
1871
2159
|
let attentionPlugin;
|
|
2160
|
+
let metadataPlugin;
|
|
1872
2161
|
const createSpaceInvitationUrl = (invitationCode) => {
|
|
1873
2162
|
const baseUrl = new URL(invitationUrl);
|
|
1874
2163
|
baseUrl.searchParams.set(invitationParam, invitationCode);
|
|
@@ -1892,7 +2181,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
1892
2181
|
key: SHARED
|
|
1893
2182
|
})).run();
|
|
1894
2183
|
if (!spacesOrder) {
|
|
1895
|
-
defaultSpace.db.add((0,
|
|
2184
|
+
defaultSpace.db.add((0, import_live_object.create)({
|
|
1896
2185
|
key: SHARED,
|
|
1897
2186
|
order: []
|
|
1898
2187
|
}));
|
|
@@ -1910,8 +2199,8 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
1910
2199
|
const node2 = graph.findNode(soloPart.id);
|
|
1911
2200
|
if (!node2) {
|
|
1912
2201
|
await dispatch({
|
|
1913
|
-
plugin:
|
|
1914
|
-
action:
|
|
2202
|
+
plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
|
|
2203
|
+
action: import_chunk_QNVEU2UD.SpaceAction.WAIT_FOR_OBJECT,
|
|
1915
2204
|
data: {
|
|
1916
2205
|
id: soloPart.id
|
|
1917
2206
|
}
|
|
@@ -1932,25 +2221,42 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
1932
2221
|
});
|
|
1933
2222
|
}).unsubscribe);
|
|
1934
2223
|
subscriptions.add((0, import_core.scheduledEffect)(() => ({
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
2224
|
+
open: (0, import_app_framework.openIds)(location.active, layout.layoutMode === "solo" ? [
|
|
2225
|
+
"solo"
|
|
2226
|
+
] : [
|
|
2227
|
+
"main"
|
|
2228
|
+
]),
|
|
2229
|
+
closed: [
|
|
2230
|
+
...location.closed
|
|
2231
|
+
]
|
|
2232
|
+
}), ({ open, closed }) => {
|
|
1940
2233
|
const send = () => {
|
|
1941
2234
|
const spaces = client.spaces.get();
|
|
1942
2235
|
const identity = client.halo.identity.get();
|
|
1943
2236
|
if (identity && location.active) {
|
|
1944
|
-
const idsBySpace = (0, import_util.reduceGroupBy)(
|
|
1945
|
-
|
|
1946
|
-
|
|
2237
|
+
const idsBySpace = (0, import_util.reduceGroupBy)(open, (id) => {
|
|
2238
|
+
try {
|
|
2239
|
+
const [spaceId] = (0, import_echo.parseFullyQualifiedId)(id);
|
|
2240
|
+
return spaceId;
|
|
2241
|
+
} catch {
|
|
2242
|
+
return null;
|
|
2243
|
+
}
|
|
2244
|
+
});
|
|
2245
|
+
const removedBySpace = (0, import_util.reduceGroupBy)(closed, (id) => {
|
|
2246
|
+
try {
|
|
2247
|
+
const [spaceId] = (0, import_echo.parseFullyQualifiedId)(id);
|
|
2248
|
+
return spaceId;
|
|
2249
|
+
} catch {
|
|
2250
|
+
return null;
|
|
2251
|
+
}
|
|
1947
2252
|
});
|
|
1948
2253
|
for (const space of spaces) {
|
|
1949
2254
|
if (!idsBySpace.has(space.id)) {
|
|
1950
2255
|
idsBySpace.set(space.id, []);
|
|
1951
2256
|
}
|
|
1952
2257
|
}
|
|
1953
|
-
for (const [spaceId,
|
|
2258
|
+
for (const [spaceId, added] of idsBySpace) {
|
|
2259
|
+
const removed = removedBySpace.get(spaceId) ?? [];
|
|
1954
2260
|
const space = spaces.find((space2) => space2.id === spaceId);
|
|
1955
2261
|
if (!space) {
|
|
1956
2262
|
continue;
|
|
@@ -1960,15 +2266,14 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
1960
2266
|
attended: attention.attended ? [
|
|
1961
2267
|
...attention.attended
|
|
1962
2268
|
] : [],
|
|
1963
|
-
added
|
|
1964
|
-
|
|
1965
|
-
removed: removed.filter((id) => !ids2.includes(id))
|
|
2269
|
+
added,
|
|
2270
|
+
removed
|
|
1966
2271
|
}).catch((err) => {
|
|
1967
2272
|
import_log.log.warn("Failed to broadcast active node for presence.", {
|
|
1968
2273
|
err: err.message
|
|
1969
2274
|
}, {
|
|
1970
2275
|
F: __dxlog_file6,
|
|
1971
|
-
L:
|
|
2276
|
+
L: 320,
|
|
1972
2277
|
S: void 0,
|
|
1973
2278
|
C: (f, a) => f(...a)
|
|
1974
2279
|
});
|
|
@@ -1986,7 +2291,8 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
1986
2291
|
spaceSubscriptions.add(space.listen("viewing", (message) => {
|
|
1987
2292
|
const { added, removed, attended } = message.payload;
|
|
1988
2293
|
const identityKey = import_react_client.PublicKey.safeFrom(message.payload.identityKey);
|
|
1989
|
-
|
|
2294
|
+
const currentIdentity = client.halo.identity.get();
|
|
2295
|
+
if (identityKey && !currentIdentity?.identityKey.equals(identityKey) && Array.isArray(added) && Array.isArray(removed)) {
|
|
1990
2296
|
added.forEach((id) => {
|
|
1991
2297
|
if (typeof id === "string") {
|
|
1992
2298
|
if (!(id in state.values.viewersByObject)) {
|
|
@@ -2013,8 +2319,21 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2013
2319
|
});
|
|
2014
2320
|
}).unsubscribe);
|
|
2015
2321
|
};
|
|
2322
|
+
const setEdgeReplicationDefault = async (client) => {
|
|
2323
|
+
try {
|
|
2324
|
+
await Promise.all(client.spaces.get().map((space) => space.internal.setEdgeReplicationPreference(import_metadata.EdgeReplicationSetting.ENABLED)));
|
|
2325
|
+
state.values.enabledEdgeReplication = true;
|
|
2326
|
+
} catch (err) {
|
|
2327
|
+
import_log.log.catch(err, void 0, {
|
|
2328
|
+
F: __dxlog_file6,
|
|
2329
|
+
L: 389,
|
|
2330
|
+
S: void 0,
|
|
2331
|
+
C: (f, a) => f(...a)
|
|
2332
|
+
});
|
|
2333
|
+
}
|
|
2334
|
+
};
|
|
2016
2335
|
return {
|
|
2017
|
-
meta:
|
|
2336
|
+
meta: import_chunk_QNVEU2UD.meta_default,
|
|
2018
2337
|
ready: async (plugins) => {
|
|
2019
2338
|
settings.prop({
|
|
2020
2339
|
key: "showHidden",
|
|
@@ -2025,12 +2344,16 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2025
2344
|
state.prop({
|
|
2026
2345
|
key: "spaceNames",
|
|
2027
2346
|
type: import_local_storage.LocalStorageStore.json()
|
|
2347
|
+
}).prop({
|
|
2348
|
+
key: "enabledEdgeReplication",
|
|
2349
|
+
type: import_local_storage.LocalStorageStore.bool()
|
|
2028
2350
|
});
|
|
2029
2351
|
if ((0, import_app_framework.findPlugin)(plugins, "dxos.org/plugin/stack")) {
|
|
2030
2352
|
state.values.navigableCollections = true;
|
|
2031
2353
|
}
|
|
2032
2354
|
graphPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseGraphPlugin);
|
|
2033
2355
|
layoutPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseLayoutPlugin);
|
|
2356
|
+
metadataPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin);
|
|
2034
2357
|
navigationPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseNavigationPlugin);
|
|
2035
2358
|
attentionPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_attention.parseAttentionPlugin);
|
|
2036
2359
|
clientPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_client.parseClientPlugin);
|
|
@@ -2040,9 +2363,21 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2040
2363
|
}
|
|
2041
2364
|
const client = clientPlugin.provides.client;
|
|
2042
2365
|
const dispatch = intentPlugin.provides.intent.dispatch;
|
|
2366
|
+
schemas.push(...(0, import_app_framework.filterPlugins)(plugins, import_chunk_6SNOZF7Y.parseSchemaPlugin).map((plugin) => plugin.provides.echo.schema).filter(import_util.nonNullable).reduce((acc, schema) => {
|
|
2367
|
+
return [
|
|
2368
|
+
...acc,
|
|
2369
|
+
...schema
|
|
2370
|
+
];
|
|
2371
|
+
}));
|
|
2372
|
+
client.addTypes(schemas);
|
|
2373
|
+
(0, import_app_framework.filterPlugins)(plugins, import_chunk_6SNOZF7Y.parseSchemaPlugin).forEach((plugin) => {
|
|
2374
|
+
if (plugin.provides.echo.system) {
|
|
2375
|
+
client.addTypes(plugin.provides.echo.system);
|
|
2376
|
+
}
|
|
2377
|
+
});
|
|
2043
2378
|
const handleFirstRun = async () => {
|
|
2044
2379
|
const defaultSpace = client.spaces.default;
|
|
2045
|
-
defaultSpace.properties[
|
|
2380
|
+
defaultSpace.properties[import_chunk_6SNOZF7Y.CollectionType.typename] = (0, import_live_object.create)(import_chunk_6SNOZF7Y.CollectionType, {
|
|
2046
2381
|
objects: [],
|
|
2047
2382
|
views: {}
|
|
2048
2383
|
});
|
|
@@ -2063,6 +2398,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2063
2398
|
await handleFirstRun();
|
|
2064
2399
|
}
|
|
2065
2400
|
await onSpaceReady();
|
|
2401
|
+
await setEdgeReplicationDefault(client);
|
|
2066
2402
|
}
|
|
2067
2403
|
}).unsubscribe);
|
|
2068
2404
|
},
|
|
@@ -2087,7 +2423,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2087
2423
|
label: [
|
|
2088
2424
|
"open settings panel label",
|
|
2089
2425
|
{
|
|
2090
|
-
ns:
|
|
2426
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
2091
2427
|
}
|
|
2092
2428
|
],
|
|
2093
2429
|
icon: "ph--gear--regular"
|
|
@@ -2099,11 +2435,12 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2099
2435
|
}) : null,
|
|
2100
2436
|
metadata: {
|
|
2101
2437
|
records: {
|
|
2102
|
-
[
|
|
2438
|
+
[import_chunk_6SNOZF7Y.CollectionType.typename]: {
|
|
2439
|
+
createObject: import_chunk_QNVEU2UD.CollectionAction.CREATE,
|
|
2103
2440
|
placeholder: [
|
|
2104
2441
|
"unnamed collection label",
|
|
2105
2442
|
{
|
|
2106
|
-
ns:
|
|
2443
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
2107
2444
|
}
|
|
2108
2445
|
],
|
|
2109
2446
|
icon: "ph--cards-three--regular",
|
|
@@ -2117,7 +2454,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2117
2454
|
},
|
|
2118
2455
|
echo: {
|
|
2119
2456
|
schema: [
|
|
2120
|
-
|
|
2457
|
+
import_chunk_6SNOZF7Y.CollectionType
|
|
2121
2458
|
]
|
|
2122
2459
|
},
|
|
2123
2460
|
surface: {
|
|
@@ -2126,17 +2463,18 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2126
2463
|
case "article":
|
|
2127
2464
|
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, {
|
|
2128
2465
|
data: {
|
|
2129
|
-
object: data.object.properties[
|
|
2466
|
+
object: data.object.properties[import_chunk_6SNOZF7Y.CollectionType.typename],
|
|
2130
2467
|
id: data.object.id
|
|
2131
2468
|
},
|
|
2132
2469
|
role,
|
|
2133
2470
|
...rest
|
|
2134
|
-
}) : data.object instanceof
|
|
2471
|
+
}) : data.object instanceof import_chunk_6SNOZF7Y.CollectionType ? {
|
|
2135
2472
|
node: /* @__PURE__ */ import_react.default.createElement(CollectionMain, {
|
|
2136
2473
|
collection: data.object
|
|
2137
2474
|
}),
|
|
2138
2475
|
disposition: "fallback"
|
|
2139
2476
|
} : null;
|
|
2477
|
+
// TODO(burdon): Add role name syntax to minimal plugin docs.
|
|
2140
2478
|
case "complementary--settings":
|
|
2141
2479
|
return (0, import_echo.isSpace)(data.subject) ? /* @__PURE__ */ import_react.default.createElement(SpaceSettingsPanel, {
|
|
2142
2480
|
space: data.subject
|
|
@@ -2154,6 +2492,15 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2154
2492
|
});
|
|
2155
2493
|
} else if (data.component === "dxos.org/plugin/space/JoinDialog") {
|
|
2156
2494
|
return /* @__PURE__ */ import_react.default.createElement(JoinDialog, data.subject);
|
|
2495
|
+
} else if (data.component === "dxos.org/plugin/space/CreateSpaceDialog") {
|
|
2496
|
+
return /* @__PURE__ */ import_react.default.createElement(CreateSpaceDialog, null);
|
|
2497
|
+
} else if (data.component === "dxos.org/plugin/space/CreateObjectDialog") {
|
|
2498
|
+
return /* @__PURE__ */ import_react.default.createElement(CreateObjectDialog, {
|
|
2499
|
+
...data.subject,
|
|
2500
|
+
schemas,
|
|
2501
|
+
navigableCollections: state.values.navigableCollections,
|
|
2502
|
+
resolve: metadataPlugin?.provides.metadata.resolver
|
|
2503
|
+
});
|
|
2157
2504
|
}
|
|
2158
2505
|
return null;
|
|
2159
2506
|
case "popover": {
|
|
@@ -2162,32 +2509,33 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2162
2509
|
space: data.subject
|
|
2163
2510
|
});
|
|
2164
2511
|
}
|
|
2165
|
-
if (data.component === "dxos.org/plugin/space/RenameObjectPopover" && (0,
|
|
2512
|
+
if (data.component === "dxos.org/plugin/space/RenameObjectPopover" && (0, import_live_object.isReactiveObject)(data.subject)) {
|
|
2166
2513
|
return /* @__PURE__ */ import_react.default.createElement(PopoverRenameObject, {
|
|
2167
2514
|
object: data.subject
|
|
2168
2515
|
});
|
|
2169
2516
|
}
|
|
2170
2517
|
return null;
|
|
2171
2518
|
}
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
return (0, import_echo_schema.isReactiveObject)(data.object) ? /* @__PURE__ */ import_react.default.createElement(SmallPresenceLive, {
|
|
2519
|
+
case "navtree-item-end": {
|
|
2520
|
+
return (0, import_live_object.isReactiveObject)(data.object) ? /* @__PURE__ */ import_react.default.createElement(SmallPresenceLive, {
|
|
2175
2521
|
id: data.id,
|
|
2176
2522
|
viewers: state.values.viewersByObject[(0, import_echo.fullyQualifiedId)(data.object)]
|
|
2177
|
-
}) : /* @__PURE__ */ import_react.default.createElement(
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2523
|
+
}) : (0, import_echo.isSpace)(data.object) ? /* @__PURE__ */ import_react.default.createElement(InlineSyncStatus, {
|
|
2524
|
+
space: data.object
|
|
2525
|
+
}) : (
|
|
2526
|
+
// TODO(wittjosiah): Attention glyph for non-echo items should be handled elsewhere.
|
|
2527
|
+
/* @__PURE__ */ import_react.default.createElement(SmallPresence, {
|
|
2528
|
+
id: data.id,
|
|
2529
|
+
count: 0
|
|
2530
|
+
})
|
|
2531
|
+
);
|
|
2184
2532
|
}
|
|
2185
2533
|
case "navbar-end": {
|
|
2186
2534
|
if (!(0, import_echo.isEchoObject)(data.object) && !(0, import_echo.isSpace)(data.object)) {
|
|
2187
2535
|
return null;
|
|
2188
2536
|
}
|
|
2189
2537
|
const space = (0, import_echo.isSpace)(data.object) ? data.object : (0, import_echo.getSpace)(data.object);
|
|
2190
|
-
const object = (0, import_echo.isSpace)(data.object) ? data.object.state.get() === import_echo.SpaceState.SPACE_READY ? space?.properties[
|
|
2538
|
+
const object = (0, import_echo.isSpace)(data.object) ? data.object.state.get() === import_echo.SpaceState.SPACE_READY ? space?.properties[import_chunk_6SNOZF7Y.CollectionType.typename] : void 0 : data.object;
|
|
2191
2539
|
return space && object ? {
|
|
2192
2540
|
node: /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(SpacePresence, {
|
|
2193
2541
|
object
|
|
@@ -2198,11 +2546,11 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2198
2546
|
} : null;
|
|
2199
2547
|
}
|
|
2200
2548
|
case "section":
|
|
2201
|
-
return data.object instanceof
|
|
2549
|
+
return data.object instanceof import_chunk_6SNOZF7Y.CollectionType ? /* @__PURE__ */ import_react.default.createElement(CollectionSection, {
|
|
2202
2550
|
collection: data.object
|
|
2203
2551
|
}) : null;
|
|
2204
2552
|
case "settings":
|
|
2205
|
-
return data.plugin ===
|
|
2553
|
+
return data.plugin === import_chunk_QNVEU2UD.meta_default.id ? /* @__PURE__ */ import_react.default.createElement(SpacePluginSettings, {
|
|
2206
2554
|
settings: settings.values
|
|
2207
2555
|
}) : null;
|
|
2208
2556
|
case "menu-footer":
|
|
@@ -2224,11 +2572,11 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2224
2572
|
graph: {
|
|
2225
2573
|
builder: (plugins) => {
|
|
2226
2574
|
const clientPlugin2 = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_client.parseClientPlugin);
|
|
2227
|
-
const
|
|
2575
|
+
const metadataPlugin2 = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin);
|
|
2228
2576
|
const graphPlugin2 = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseGraphPlugin);
|
|
2229
2577
|
const client = clientPlugin2?.provides.client;
|
|
2230
2578
|
const dispatch = intentPlugin?.provides.intent.dispatch;
|
|
2231
|
-
const resolve =
|
|
2579
|
+
const resolve = metadataPlugin2?.provides.metadata.resolver;
|
|
2232
2580
|
const graph = graphPlugin2?.provides.graph;
|
|
2233
2581
|
if (!client || !dispatch || !resolve || !graph) {
|
|
2234
2582
|
return [];
|
|
@@ -2236,7 +2584,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2236
2584
|
return [
|
|
2237
2585
|
// Create spaces group node.
|
|
2238
2586
|
(0, import_plugin_graph.createExtension)({
|
|
2239
|
-
id: `${
|
|
2587
|
+
id: `${import_chunk_QNVEU2UD.SPACE_PLUGIN}/root`,
|
|
2240
2588
|
filter: (node) => node.id === "root",
|
|
2241
2589
|
connector: () => {
|
|
2242
2590
|
const isReady = (0, import_plugin_graph.toSignal)((onChange) => {
|
|
@@ -2263,7 +2611,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2263
2611
|
label: [
|
|
2264
2612
|
"spaces label",
|
|
2265
2613
|
{
|
|
2266
|
-
ns:
|
|
2614
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
2267
2615
|
}
|
|
2268
2616
|
],
|
|
2269
2617
|
testId: "spacePlugin.spaces",
|
|
@@ -2280,7 +2628,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2280
2628
|
} else {
|
|
2281
2629
|
import_log.log.warn("spaces order object not found", void 0, {
|
|
2282
2630
|
F: __dxlog_file6,
|
|
2283
|
-
L:
|
|
2631
|
+
L: 674,
|
|
2284
2632
|
S: void 0,
|
|
2285
2633
|
C: (f, a) => f(...a)
|
|
2286
2634
|
});
|
|
@@ -2297,44 +2645,44 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2297
2645
|
filter: (node) => node.id === SPACES,
|
|
2298
2646
|
actions: () => [
|
|
2299
2647
|
{
|
|
2300
|
-
id:
|
|
2648
|
+
id: import_chunk_QNVEU2UD.SpaceAction.OPEN_CREATE_SPACE,
|
|
2301
2649
|
data: async () => {
|
|
2302
2650
|
await dispatch({
|
|
2303
|
-
plugin:
|
|
2304
|
-
action:
|
|
2651
|
+
plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
|
|
2652
|
+
action: import_chunk_QNVEU2UD.SpaceAction.OPEN_CREATE_SPACE
|
|
2305
2653
|
});
|
|
2306
2654
|
},
|
|
2307
2655
|
properties: {
|
|
2308
2656
|
label: [
|
|
2309
2657
|
"create space label",
|
|
2310
2658
|
{
|
|
2311
|
-
ns:
|
|
2659
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
2312
2660
|
}
|
|
2313
2661
|
],
|
|
2314
2662
|
icon: "ph--plus--regular",
|
|
2315
|
-
disposition: "item",
|
|
2316
2663
|
testId: "spacePlugin.createSpace",
|
|
2664
|
+
disposition: "item",
|
|
2317
2665
|
className: "border-t border-separator"
|
|
2318
2666
|
}
|
|
2319
2667
|
},
|
|
2320
2668
|
{
|
|
2321
|
-
id:
|
|
2669
|
+
id: import_chunk_QNVEU2UD.SpaceAction.JOIN,
|
|
2322
2670
|
data: async () => {
|
|
2323
2671
|
await dispatch({
|
|
2324
|
-
plugin:
|
|
2325
|
-
action:
|
|
2672
|
+
plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
|
|
2673
|
+
action: import_chunk_QNVEU2UD.SpaceAction.JOIN
|
|
2326
2674
|
});
|
|
2327
2675
|
},
|
|
2328
2676
|
properties: {
|
|
2329
2677
|
label: [
|
|
2330
2678
|
"join space label",
|
|
2331
2679
|
{
|
|
2332
|
-
ns:
|
|
2680
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
2333
2681
|
}
|
|
2334
2682
|
],
|
|
2335
2683
|
icon: "ph--sign-in--regular",
|
|
2336
|
-
|
|
2337
|
-
|
|
2684
|
+
testId: "spacePlugin.joinSpace",
|
|
2685
|
+
disposition: "item"
|
|
2338
2686
|
}
|
|
2339
2687
|
}
|
|
2340
2688
|
],
|
|
@@ -2392,15 +2740,10 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2392
2740
|
}
|
|
2393
2741
|
}
|
|
2394
2742
|
}),
|
|
2395
|
-
// Create space actions
|
|
2743
|
+
// Create space actions.
|
|
2396
2744
|
(0, import_plugin_graph.createExtension)({
|
|
2397
|
-
id: `${
|
|
2745
|
+
id: `${import_chunk_QNVEU2UD.SPACE_PLUGIN}/actions`,
|
|
2398
2746
|
filter: (node) => (0, import_echo.isSpace)(node.data),
|
|
2399
|
-
actionGroups: ({ node }) => constructSpaceActionGroups({
|
|
2400
|
-
space: node.data,
|
|
2401
|
-
dispatch,
|
|
2402
|
-
navigable: state.values.navigableCollections
|
|
2403
|
-
}),
|
|
2404
2747
|
actions: ({ node }) => {
|
|
2405
2748
|
const space = node.data;
|
|
2406
2749
|
return constructSpaceActions({
|
|
@@ -2413,7 +2756,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2413
2756
|
}),
|
|
2414
2757
|
// Create nodes for objects in the root collection of a space.
|
|
2415
2758
|
(0, import_plugin_graph.createExtension)({
|
|
2416
|
-
id: `${
|
|
2759
|
+
id: `${import_chunk_QNVEU2UD.SPACE_PLUGIN}/root-collection`,
|
|
2417
2760
|
filter: (node) => (0, import_echo.isSpace)(node.data),
|
|
2418
2761
|
connector: ({ node }) => {
|
|
2419
2762
|
const space = node.data;
|
|
@@ -2421,7 +2764,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2421
2764
|
if (spaceState !== import_echo.SpaceState.SPACE_READY) {
|
|
2422
2765
|
return;
|
|
2423
2766
|
}
|
|
2424
|
-
const collection = space.properties[
|
|
2767
|
+
const collection = space.properties[import_chunk_6SNOZF7Y.CollectionType.typename];
|
|
2425
2768
|
if (!collection) {
|
|
2426
2769
|
return;
|
|
2427
2770
|
}
|
|
@@ -2435,8 +2778,8 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2435
2778
|
}),
|
|
2436
2779
|
// Create nodes for objects in a collection or by its fully qualified id.
|
|
2437
2780
|
(0, import_plugin_graph.createExtension)({
|
|
2438
|
-
id: `${
|
|
2439
|
-
filter: (node) => node.data instanceof
|
|
2781
|
+
id: `${import_chunk_QNVEU2UD.SPACE_PLUGIN}/objects`,
|
|
2782
|
+
filter: (node) => node.data instanceof import_chunk_6SNOZF7Y.CollectionType,
|
|
2440
2783
|
connector: ({ node }) => {
|
|
2441
2784
|
const collection = node.data;
|
|
2442
2785
|
const space = (0, import_echo.getSpace)(collection);
|
|
@@ -2471,14 +2814,21 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2471
2814
|
if (!store.value) {
|
|
2472
2815
|
void space.db.query({
|
|
2473
2816
|
id: objectId
|
|
2474
|
-
}).first().then((o) => store.value = o)
|
|
2817
|
+
}).first().then((o) => store.value = o).catch((err) => import_log.log.catch(err, {
|
|
2818
|
+
objectId
|
|
2819
|
+
}, {
|
|
2820
|
+
F: __dxlog_file6,
|
|
2821
|
+
L: 891,
|
|
2822
|
+
S: void 0,
|
|
2823
|
+
C: (f, a) => f(...a)
|
|
2824
|
+
}));
|
|
2475
2825
|
}
|
|
2476
2826
|
}, id);
|
|
2477
2827
|
const object = store.value;
|
|
2478
2828
|
if (!object) {
|
|
2479
2829
|
return;
|
|
2480
2830
|
}
|
|
2481
|
-
if ((0,
|
|
2831
|
+
if ((0, import_live_object.isDeleted)(object)) {
|
|
2482
2832
|
return false;
|
|
2483
2833
|
} else {
|
|
2484
2834
|
return createObjectNode({
|
|
@@ -2492,13 +2842,8 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2492
2842
|
}),
|
|
2493
2843
|
// Create collection actions and action groups.
|
|
2494
2844
|
(0, import_plugin_graph.createExtension)({
|
|
2495
|
-
id: `${
|
|
2845
|
+
id: `${import_chunk_QNVEU2UD.SPACE_PLUGIN}/object-actions`,
|
|
2496
2846
|
filter: (node) => (0, import_echo.isEchoObject)(node.data),
|
|
2497
|
-
actionGroups: ({ node }) => constructObjectActionGroups({
|
|
2498
|
-
object: node.data,
|
|
2499
|
-
dispatch,
|
|
2500
|
-
navigable: state.values.navigableCollections
|
|
2501
|
-
}),
|
|
2502
2847
|
actions: ({ node }) => constructObjectActions({
|
|
2503
2848
|
node,
|
|
2504
2849
|
dispatch
|
|
@@ -2506,7 +2851,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2506
2851
|
}),
|
|
2507
2852
|
// Create nodes for object settings.
|
|
2508
2853
|
(0, import_plugin_graph.createExtension)({
|
|
2509
|
-
id: `${
|
|
2854
|
+
id: `${import_chunk_QNVEU2UD.SPACE_PLUGIN}/settings-for-subject`,
|
|
2510
2855
|
resolver: ({ id }) => {
|
|
2511
2856
|
if (!id.endsWith("~settings")) {
|
|
2512
2857
|
return;
|
|
@@ -2521,12 +2866,12 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2521
2866
|
const label2 = space ? space.properties.name || [
|
|
2522
2867
|
"unnamed space label",
|
|
2523
2868
|
{
|
|
2524
|
-
ns:
|
|
2869
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
2525
2870
|
}
|
|
2526
2871
|
] : [
|
|
2527
2872
|
"unnamed object settings label",
|
|
2528
2873
|
{
|
|
2529
|
-
ns:
|
|
2874
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
2530
2875
|
}
|
|
2531
2876
|
];
|
|
2532
2877
|
return {
|
|
@@ -2542,15 +2887,9 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2542
2887
|
}
|
|
2543
2888
|
};
|
|
2544
2889
|
}
|
|
2545
|
-
const object = (
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
id: objectId
|
|
2549
|
-
}).first();
|
|
2550
|
-
onChange();
|
|
2551
|
-
});
|
|
2552
|
-
return () => clearTimeout(timeout);
|
|
2553
|
-
}, () => space?.db.getObjectById(objectId), subjectId);
|
|
2890
|
+
const [object] = memoizeQuery(space, {
|
|
2891
|
+
id: objectId
|
|
2892
|
+
});
|
|
2554
2893
|
if (!object || !subjectId) {
|
|
2555
2894
|
return;
|
|
2556
2895
|
}
|
|
@@ -2558,7 +2897,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2558
2897
|
const label = meta.label?.(object) || object.name || meta.placeholder || [
|
|
2559
2898
|
"unnamed object settings label",
|
|
2560
2899
|
{
|
|
2561
|
-
ns:
|
|
2900
|
+
ns: import_chunk_QNVEU2UD.SPACE_PLUGIN
|
|
2562
2901
|
}
|
|
2563
2902
|
];
|
|
2564
2903
|
return {
|
|
@@ -2585,8 +2924,8 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2585
2924
|
inputType: SPACES,
|
|
2586
2925
|
outputType: DIRECTORY_TYPE,
|
|
2587
2926
|
serialize: (node) => ({
|
|
2588
|
-
name: translations_default[0]["en-US"][
|
|
2589
|
-
data: translations_default[0]["en-US"][
|
|
2927
|
+
name: translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["spaces label"],
|
|
2928
|
+
data: translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["spaces label"],
|
|
2590
2929
|
type: DIRECTORY_TYPE
|
|
2591
2930
|
}),
|
|
2592
2931
|
deserialize: () => {
|
|
@@ -2596,14 +2935,14 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2596
2935
|
inputType: SPACE_TYPE,
|
|
2597
2936
|
outputType: DIRECTORY_TYPE,
|
|
2598
2937
|
serialize: (node) => ({
|
|
2599
|
-
name: node.data.properties.name ?? translations_default[0]["en-US"][
|
|
2600
|
-
data: node.data.properties.name ?? translations_default[0]["en-US"][
|
|
2938
|
+
name: node.data.properties.name ?? translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["unnamed space label"],
|
|
2939
|
+
data: node.data.properties.name ?? translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["unnamed space label"],
|
|
2601
2940
|
type: DIRECTORY_TYPE
|
|
2602
2941
|
}),
|
|
2603
2942
|
deserialize: async (data) => {
|
|
2604
2943
|
const result = await dispatch({
|
|
2605
|
-
plugin:
|
|
2606
|
-
action:
|
|
2944
|
+
plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
|
|
2945
|
+
action: import_chunk_QNVEU2UD.SpaceAction.CREATE,
|
|
2607
2946
|
data: {
|
|
2608
2947
|
name: data.name
|
|
2609
2948
|
}
|
|
@@ -2612,25 +2951,25 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2612
2951
|
}
|
|
2613
2952
|
},
|
|
2614
2953
|
{
|
|
2615
|
-
inputType:
|
|
2954
|
+
inputType: import_chunk_6SNOZF7Y.CollectionType.typename,
|
|
2616
2955
|
outputType: DIRECTORY_TYPE,
|
|
2617
2956
|
serialize: (node) => ({
|
|
2618
|
-
name: node.data.name ?? translations_default[0]["en-US"][
|
|
2619
|
-
data: node.data.name ?? translations_default[0]["en-US"][
|
|
2957
|
+
name: node.data.name ?? translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["unnamed collection label"],
|
|
2958
|
+
data: node.data.name ?? translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["unnamed collection label"],
|
|
2620
2959
|
type: DIRECTORY_TYPE
|
|
2621
2960
|
}),
|
|
2622
2961
|
deserialize: async (data, ancestors) => {
|
|
2623
2962
|
const space = ancestors.find(import_echo.isSpace);
|
|
2624
|
-
const collection = ancestors.findLast((ancestor) => ancestor instanceof
|
|
2963
|
+
const collection = ancestors.findLast((ancestor) => ancestor instanceof import_chunk_6SNOZF7Y.CollectionType) ?? space?.properties[import_chunk_6SNOZF7Y.CollectionType.typename];
|
|
2625
2964
|
if (!space || !collection) {
|
|
2626
2965
|
return;
|
|
2627
2966
|
}
|
|
2628
2967
|
const result = await dispatch({
|
|
2629
|
-
plugin:
|
|
2630
|
-
action:
|
|
2968
|
+
plugin: import_chunk_QNVEU2UD.SPACE_PLUGIN,
|
|
2969
|
+
action: import_chunk_QNVEU2UD.SpaceAction.ADD_OBJECT,
|
|
2631
2970
|
data: {
|
|
2632
2971
|
target: collection,
|
|
2633
|
-
object: (0,
|
|
2972
|
+
object: (0, import_live_object.create)(import_chunk_6SNOZF7Y.CollectionType, {
|
|
2634
2973
|
name: data.name,
|
|
2635
2974
|
objects: [],
|
|
2636
2975
|
views: {}
|
|
@@ -2648,23 +2987,46 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2648
2987
|
const clientPlugin2 = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_client.parseClientPlugin);
|
|
2649
2988
|
const client = clientPlugin2?.provides.client;
|
|
2650
2989
|
switch (intent.action) {
|
|
2651
|
-
case
|
|
2990
|
+
case import_chunk_QNVEU2UD.SpaceAction.WAIT_FOR_OBJECT: {
|
|
2652
2991
|
state.values.awaiting = intent.data?.id;
|
|
2653
2992
|
return {
|
|
2654
2993
|
data: true
|
|
2655
2994
|
};
|
|
2656
2995
|
}
|
|
2657
|
-
case
|
|
2658
|
-
|
|
2996
|
+
case import_chunk_QNVEU2UD.SpaceAction.OPEN_CREATE_SPACE: {
|
|
2997
|
+
return {
|
|
2998
|
+
data: true,
|
|
2999
|
+
intents: [
|
|
3000
|
+
[
|
|
3001
|
+
{
|
|
3002
|
+
action: import_app_framework.LayoutAction.SET_LAYOUT,
|
|
3003
|
+
data: {
|
|
3004
|
+
element: "dialog",
|
|
3005
|
+
component: "dxos.org/plugin/space/CreateSpaceDialog",
|
|
3006
|
+
dialogBlockAlign: "start",
|
|
3007
|
+
subject: intent.data
|
|
3008
|
+
}
|
|
3009
|
+
}
|
|
3010
|
+
]
|
|
3011
|
+
]
|
|
3012
|
+
};
|
|
3013
|
+
}
|
|
3014
|
+
case import_chunk_QNVEU2UD.SpaceAction.CREATE: {
|
|
3015
|
+
if (!client || !import_echo_schema.S.is(import_chunk_6SNOZF7Y.SpaceForm)(intent.data)) {
|
|
2659
3016
|
return;
|
|
2660
3017
|
}
|
|
2661
|
-
const space = await client.spaces.create(
|
|
3018
|
+
const space = await client.spaces.create({
|
|
3019
|
+
name: intent.data.name
|
|
3020
|
+
});
|
|
3021
|
+
if (intent.data.edgeReplication) {
|
|
3022
|
+
await space.internal.setEdgeReplicationPreference(import_metadata.EdgeReplicationSetting.ENABLED);
|
|
3023
|
+
}
|
|
2662
3024
|
await space.waitUntilReady();
|
|
2663
|
-
const collection = (0,
|
|
3025
|
+
const collection = (0, import_live_object.create)(import_chunk_6SNOZF7Y.CollectionType, {
|
|
2664
3026
|
objects: [],
|
|
2665
3027
|
views: {}
|
|
2666
3028
|
});
|
|
2667
|
-
space.properties[
|
|
3029
|
+
space.properties[import_chunk_6SNOZF7Y.CollectionType.typename] = collection;
|
|
2668
3030
|
if (import_migrations.Migrations.versionProperty) {
|
|
2669
3031
|
space.properties[import_migrations.Migrations.versionProperty] = import_migrations.Migrations.targetVersion;
|
|
2670
3032
|
}
|
|
@@ -2679,28 +3041,6 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2679
3041
|
}
|
|
2680
3042
|
},
|
|
2681
3043
|
intents: [
|
|
2682
|
-
...settings.values.onSpaceCreate ? [
|
|
2683
|
-
[
|
|
2684
|
-
{
|
|
2685
|
-
action: settings.values.onSpaceCreate,
|
|
2686
|
-
data: {
|
|
2687
|
-
space
|
|
2688
|
-
}
|
|
2689
|
-
},
|
|
2690
|
-
{
|
|
2691
|
-
action: import_chunk_JFDDZI4Y.SpaceAction.ADD_OBJECT,
|
|
2692
|
-
data: {
|
|
2693
|
-
target: space
|
|
2694
|
-
}
|
|
2695
|
-
},
|
|
2696
|
-
{
|
|
2697
|
-
action: import_app_framework.NavigationAction.OPEN
|
|
2698
|
-
},
|
|
2699
|
-
{
|
|
2700
|
-
action: import_app_framework.NavigationAction.EXPOSE
|
|
2701
|
-
}
|
|
2702
|
-
]
|
|
2703
|
-
] : [],
|
|
2704
3044
|
[
|
|
2705
3045
|
{
|
|
2706
3046
|
action: import_meta.ObservabilityAction.SEND_EVENT,
|
|
@@ -2715,7 +3055,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2715
3055
|
]
|
|
2716
3056
|
};
|
|
2717
3057
|
}
|
|
2718
|
-
case
|
|
3058
|
+
case import_chunk_QNVEU2UD.SpaceAction.JOIN: {
|
|
2719
3059
|
return {
|
|
2720
3060
|
data: true,
|
|
2721
3061
|
intents: [
|
|
@@ -2735,7 +3075,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2735
3075
|
]
|
|
2736
3076
|
};
|
|
2737
3077
|
}
|
|
2738
|
-
case
|
|
3078
|
+
case import_chunk_QNVEU2UD.SpaceAction.SHARE: {
|
|
2739
3079
|
const space = intent.data?.space;
|
|
2740
3080
|
if ((0, import_echo.isSpace)(space) && !space.properties[COMPOSER_SPACE_LOCK]) {
|
|
2741
3081
|
const active = navigationPlugin?.provides.location.active;
|
|
@@ -2777,7 +3117,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2777
3117
|
}
|
|
2778
3118
|
break;
|
|
2779
3119
|
}
|
|
2780
|
-
case
|
|
3120
|
+
case import_chunk_QNVEU2UD.SpaceAction.LOCK: {
|
|
2781
3121
|
const space = intent.data?.space;
|
|
2782
3122
|
if ((0, import_echo.isSpace)(space)) {
|
|
2783
3123
|
space.properties[COMPOSER_SPACE_LOCK] = true;
|
|
@@ -2800,7 +3140,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2800
3140
|
}
|
|
2801
3141
|
break;
|
|
2802
3142
|
}
|
|
2803
|
-
case
|
|
3143
|
+
case import_chunk_QNVEU2UD.SpaceAction.UNLOCK: {
|
|
2804
3144
|
const space = intent.data?.space;
|
|
2805
3145
|
if ((0, import_echo.isSpace)(space)) {
|
|
2806
3146
|
space.properties[COMPOSER_SPACE_LOCK] = false;
|
|
@@ -2823,7 +3163,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2823
3163
|
}
|
|
2824
3164
|
break;
|
|
2825
3165
|
}
|
|
2826
|
-
case
|
|
3166
|
+
case import_chunk_QNVEU2UD.SpaceAction.RENAME: {
|
|
2827
3167
|
const { caller, space } = intent.data ?? {};
|
|
2828
3168
|
if (typeof caller === "string" && (0, import_echo.isSpace)(space)) {
|
|
2829
3169
|
return {
|
|
@@ -2844,7 +3184,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2844
3184
|
}
|
|
2845
3185
|
break;
|
|
2846
3186
|
}
|
|
2847
|
-
case
|
|
3187
|
+
case import_chunk_QNVEU2UD.SpaceAction.OPEN_SETTINGS: {
|
|
2848
3188
|
const space = intent.data?.space;
|
|
2849
3189
|
if ((0, import_echo.isSpace)(space)) {
|
|
2850
3190
|
return {
|
|
@@ -2870,7 +3210,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2870
3210
|
}
|
|
2871
3211
|
break;
|
|
2872
3212
|
}
|
|
2873
|
-
case
|
|
3213
|
+
case import_chunk_QNVEU2UD.SpaceAction.OPEN: {
|
|
2874
3214
|
const space = intent.data?.space;
|
|
2875
3215
|
if ((0, import_echo.isSpace)(space)) {
|
|
2876
3216
|
await space.open();
|
|
@@ -2880,7 +3220,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2880
3220
|
}
|
|
2881
3221
|
break;
|
|
2882
3222
|
}
|
|
2883
|
-
case
|
|
3223
|
+
case import_chunk_QNVEU2UD.SpaceAction.CLOSE: {
|
|
2884
3224
|
const space = intent.data?.space;
|
|
2885
3225
|
if ((0, import_echo.isSpace)(space)) {
|
|
2886
3226
|
await space.close();
|
|
@@ -2890,7 +3230,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2890
3230
|
}
|
|
2891
3231
|
break;
|
|
2892
3232
|
}
|
|
2893
|
-
case
|
|
3233
|
+
case import_chunk_QNVEU2UD.SpaceAction.MIGRATE: {
|
|
2894
3234
|
const space = intent.data?.space;
|
|
2895
3235
|
if ((0, import_echo.isSpace)(space)) {
|
|
2896
3236
|
if (space.state.get() === import_echo.SpaceState.SPACE_REQUIRES_MIGRATION) {
|
|
@@ -2919,9 +3259,27 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2919
3259
|
}
|
|
2920
3260
|
break;
|
|
2921
3261
|
}
|
|
2922
|
-
case
|
|
3262
|
+
case import_chunk_QNVEU2UD.SpaceAction.OPEN_CREATE_OBJECT: {
|
|
3263
|
+
return {
|
|
3264
|
+
data: true,
|
|
3265
|
+
intents: [
|
|
3266
|
+
[
|
|
3267
|
+
{
|
|
3268
|
+
action: import_app_framework.LayoutAction.SET_LAYOUT,
|
|
3269
|
+
data: {
|
|
3270
|
+
element: "dialog",
|
|
3271
|
+
component: "dxos.org/plugin/space/CreateObjectDialog",
|
|
3272
|
+
dialogBlockAlign: "start",
|
|
3273
|
+
subject: intent.data
|
|
3274
|
+
}
|
|
3275
|
+
}
|
|
3276
|
+
]
|
|
3277
|
+
]
|
|
3278
|
+
};
|
|
3279
|
+
}
|
|
3280
|
+
case import_chunk_QNVEU2UD.SpaceAction.ADD_OBJECT: {
|
|
2923
3281
|
const object = intent.data?.object ?? intent.data?.result;
|
|
2924
|
-
if (!(0,
|
|
3282
|
+
if (!(0, import_live_object.isReactiveObject)(object)) {
|
|
2925
3283
|
return;
|
|
2926
3284
|
}
|
|
2927
3285
|
const space = (0, import_echo.isSpace)(intent.data?.target) ? intent.data?.target : (0, import_echo.getSpace)(intent.data?.target);
|
|
@@ -2938,15 +3296,15 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2938
3296
|
data: {
|
|
2939
3297
|
element: "toast",
|
|
2940
3298
|
subject: {
|
|
2941
|
-
id: `${
|
|
2942
|
-
title: translations_default[0]["en-US"][
|
|
2943
|
-
description: translations_default[0]["en-US"][
|
|
3299
|
+
id: `${import_chunk_QNVEU2UD.SPACE_PLUGIN}/space-limit`,
|
|
3300
|
+
title: translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["space limit label"],
|
|
3301
|
+
description: translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["space limit description"],
|
|
2944
3302
|
duration: 5e3,
|
|
2945
3303
|
icon: "ph--warning--regular",
|
|
2946
|
-
actionLabel: translations_default[0]["en-US"][
|
|
2947
|
-
actionAlt: translations_default[0]["en-US"][
|
|
3304
|
+
actionLabel: translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["remove deleted objects label"],
|
|
3305
|
+
actionAlt: translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["remove deleted objects alt"],
|
|
2948
3306
|
// TODO(wittjosiah): Use OS namespace.
|
|
2949
|
-
closeLabel: translations_default[0]["en-US"][
|
|
3307
|
+
closeLabel: translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN]["space limit close label"],
|
|
2950
3308
|
onAction: () => space.db.coreDatabase.unlinkDeletedObjects()
|
|
2951
3309
|
}
|
|
2952
3310
|
}
|
|
@@ -2966,20 +3324,20 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
2966
3324
|
]
|
|
2967
3325
|
};
|
|
2968
3326
|
}
|
|
2969
|
-
if (intent.data?.target instanceof
|
|
3327
|
+
if (intent.data?.target instanceof import_chunk_6SNOZF7Y.CollectionType) {
|
|
2970
3328
|
intent.data?.target.objects.push(object);
|
|
2971
3329
|
} else if ((0, import_echo.isSpace)(intent.data?.target)) {
|
|
2972
|
-
const collection = space.properties[
|
|
2973
|
-
if (collection instanceof
|
|
3330
|
+
const collection = space.properties[import_chunk_6SNOZF7Y.CollectionType.typename];
|
|
3331
|
+
if (collection instanceof import_chunk_6SNOZF7Y.CollectionType) {
|
|
2974
3332
|
collection.objects.push(object);
|
|
2975
3333
|
} else {
|
|
2976
|
-
const collection2 = (0,
|
|
3334
|
+
const collection2 = (0, import_live_object.create)(import_chunk_6SNOZF7Y.CollectionType, {
|
|
2977
3335
|
objects: [
|
|
2978
3336
|
object
|
|
2979
3337
|
],
|
|
2980
3338
|
views: {}
|
|
2981
3339
|
});
|
|
2982
|
-
space.properties[
|
|
3340
|
+
space.properties[import_chunk_6SNOZF7Y.CollectionType.typename] = collection2;
|
|
2983
3341
|
}
|
|
2984
3342
|
}
|
|
2985
3343
|
return {
|
|
@@ -3009,11 +3367,11 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
3009
3367
|
]
|
|
3010
3368
|
};
|
|
3011
3369
|
}
|
|
3012
|
-
case
|
|
3370
|
+
case import_chunk_QNVEU2UD.SpaceAction.REMOVE_OBJECTS: {
|
|
3013
3371
|
const objects = intent.data?.objects ?? intent.data?.result;
|
|
3014
3372
|
(0, import_invariant.invariant)(Array.isArray(objects), void 0, {
|
|
3015
3373
|
F: __dxlog_file6,
|
|
3016
|
-
L:
|
|
3374
|
+
L: 1430,
|
|
3017
3375
|
S: void 0,
|
|
3018
3376
|
A: [
|
|
3019
3377
|
"Array.isArray(objects)",
|
|
@@ -3028,12 +3386,12 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
3028
3386
|
const activeParts = navigationPlugin?.provides.location.active;
|
|
3029
3387
|
const openObjectIds = new Set((0, import_app_framework.openIds)(activeParts ?? {}));
|
|
3030
3388
|
if (!intent.undo && resolve) {
|
|
3031
|
-
const parentCollection = intent.data?.collection ?? space.properties[
|
|
3389
|
+
const parentCollection = intent.data?.collection ?? space.properties[import_chunk_6SNOZF7Y.CollectionType.typename];
|
|
3032
3390
|
const nestedObjectsList = await Promise.all(objects.map((obj) => getNestedObjects(obj, resolve)));
|
|
3033
3391
|
const deletionData = {
|
|
3034
3392
|
objects,
|
|
3035
3393
|
parentCollection,
|
|
3036
|
-
indices: objects.map((obj) => parentCollection instanceof
|
|
3394
|
+
indices: objects.map((obj) => parentCollection instanceof import_chunk_6SNOZF7Y.CollectionType ? parentCollection.objects.indexOf(obj) : -1),
|
|
3037
3395
|
nestedObjectsList,
|
|
3038
3396
|
wasActive: objects.flatMap((obj, i) => [
|
|
3039
3397
|
obj,
|
|
@@ -3051,7 +3409,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
3051
3409
|
}
|
|
3052
3410
|
});
|
|
3053
3411
|
}
|
|
3054
|
-
if (deletionData.parentCollection instanceof
|
|
3412
|
+
if (deletionData.parentCollection instanceof import_chunk_6SNOZF7Y.CollectionType) {
|
|
3055
3413
|
[
|
|
3056
3414
|
...deletionData.indices
|
|
3057
3415
|
].sort((a, b) => b - a).forEach((index) => {
|
|
@@ -3064,18 +3422,18 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
3064
3422
|
space.db.remove(obj);
|
|
3065
3423
|
});
|
|
3066
3424
|
objects.forEach((obj) => space.db.remove(obj));
|
|
3067
|
-
const undoMessageKey = objects.some((obj) => obj instanceof
|
|
3425
|
+
const undoMessageKey = objects.some((obj) => obj instanceof import_chunk_6SNOZF7Y.CollectionType) ? "collection deleted label" : objects.length > 1 ? "objects deleted label" : "object deleted label";
|
|
3068
3426
|
return {
|
|
3069
3427
|
data: true,
|
|
3070
3428
|
undoable: {
|
|
3071
3429
|
// TODO(ZaymonFC): Pluralize if more than one object.
|
|
3072
|
-
message: translations_default[0]["en-US"][
|
|
3430
|
+
message: translations_default[0]["en-US"][import_chunk_QNVEU2UD.SPACE_PLUGIN][undoMessageKey],
|
|
3073
3431
|
data: deletionData
|
|
3074
3432
|
}
|
|
3075
3433
|
};
|
|
3076
3434
|
} else {
|
|
3077
3435
|
const undoData = intent.data;
|
|
3078
|
-
if (undoData?.objects?.length && undoData.objects.every(import_echo.isEchoObject) && undoData.parentCollection instanceof
|
|
3436
|
+
if (undoData?.objects?.length && undoData.objects.every(import_echo.isEchoObject) && undoData.parentCollection instanceof import_chunk_6SNOZF7Y.CollectionType) {
|
|
3079
3437
|
const restoredObjects = undoData.objects.map((obj) => space.db.add(obj));
|
|
3080
3438
|
undoData.nestedObjectsList.flat().forEach((obj) => {
|
|
3081
3439
|
space.db.add(obj);
|
|
@@ -3104,10 +3462,10 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
3104
3462
|
};
|
|
3105
3463
|
}
|
|
3106
3464
|
}
|
|
3107
|
-
case
|
|
3465
|
+
case import_chunk_QNVEU2UD.SpaceAction.RENAME_OBJECT: {
|
|
3108
3466
|
const object = intent.data?.object ?? intent.data?.result;
|
|
3109
3467
|
const caller = intent.data?.caller;
|
|
3110
|
-
if ((0,
|
|
3468
|
+
if ((0, import_live_object.isReactiveObject)(object) && caller) {
|
|
3111
3469
|
return {
|
|
3112
3470
|
intents: [
|
|
3113
3471
|
[
|
|
@@ -3126,7 +3484,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
3126
3484
|
}
|
|
3127
3485
|
break;
|
|
3128
3486
|
}
|
|
3129
|
-
case
|
|
3487
|
+
case import_chunk_QNVEU2UD.SpaceAction.DUPLICATE_OBJECT: {
|
|
3130
3488
|
const originalObject = intent.data?.object ?? intent.data?.result;
|
|
3131
3489
|
const resolve = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin)?.provides.metadata.resolver;
|
|
3132
3490
|
const space = (0, import_echo.isSpace)(intent.data?.target) ? intent.data?.target : (0, import_echo.getSpace)(intent.data?.target);
|
|
@@ -3138,7 +3496,7 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
3138
3496
|
intents: [
|
|
3139
3497
|
[
|
|
3140
3498
|
{
|
|
3141
|
-
action:
|
|
3499
|
+
action: import_chunk_QNVEU2UD.SpaceAction.ADD_OBJECT,
|
|
3142
3500
|
data: {
|
|
3143
3501
|
object: newObject,
|
|
3144
3502
|
target: intent.data?.target
|
|
@@ -3148,12 +3506,22 @@ var SpacePlugin = ({ invitationUrl = window.location.origin, invitationParam = "
|
|
|
3148
3506
|
]
|
|
3149
3507
|
};
|
|
3150
3508
|
}
|
|
3151
|
-
case
|
|
3509
|
+
case import_chunk_QNVEU2UD.SpaceAction.TOGGLE_HIDDEN: {
|
|
3152
3510
|
settings.values.showHidden = intent.data?.state ?? !settings.values.showHidden;
|
|
3153
3511
|
return {
|
|
3154
3512
|
data: true
|
|
3155
3513
|
};
|
|
3156
3514
|
}
|
|
3515
|
+
case import_chunk_QNVEU2UD.CollectionAction.CREATE: {
|
|
3516
|
+
const collection = (0, import_live_object.create)(import_chunk_6SNOZF7Y.CollectionType, {
|
|
3517
|
+
name: intent.data?.name,
|
|
3518
|
+
objects: [],
|
|
3519
|
+
views: {}
|
|
3520
|
+
});
|
|
3521
|
+
return {
|
|
3522
|
+
data: collection
|
|
3523
|
+
};
|
|
3524
|
+
}
|
|
3157
3525
|
}
|
|
3158
3526
|
}
|
|
3159
3527
|
}
|
|
@@ -3167,12 +3535,16 @@ var src_default = SpacePlugin;
|
|
|
3167
3535
|
AwaitingObject,
|
|
3168
3536
|
COMPOSER_SPACE_LOCK,
|
|
3169
3537
|
ChannelType,
|
|
3538
|
+
CollectionAction,
|
|
3170
3539
|
CollectionMain,
|
|
3171
3540
|
CollectionSection,
|
|
3172
3541
|
CollectionType,
|
|
3173
3542
|
ContactType,
|
|
3543
|
+
CreateObjectDialog,
|
|
3544
|
+
CreateSpaceDialog,
|
|
3174
3545
|
DefaultObjectSettings,
|
|
3175
3546
|
FullPresence,
|
|
3547
|
+
InlineSyncStatus,
|
|
3176
3548
|
JoinDialog,
|
|
3177
3549
|
MenuFooter,
|
|
3178
3550
|
MessageState,
|
|
@@ -3191,6 +3563,7 @@ var src_default = SpacePlugin;
|
|
|
3191
3563
|
SmallPresence,
|
|
3192
3564
|
SmallPresenceLive,
|
|
3193
3565
|
SpaceAction,
|
|
3566
|
+
SpaceForm,
|
|
3194
3567
|
SpacePlugin,
|
|
3195
3568
|
SpacePluginSettings,
|
|
3196
3569
|
SpacePresence,
|
|
@@ -3202,9 +3575,7 @@ var src_default = SpacePlugin;
|
|
|
3202
3575
|
ThreadStatus,
|
|
3203
3576
|
ThreadType,
|
|
3204
3577
|
cloneObject,
|
|
3205
|
-
constructObjectActionGroups,
|
|
3206
3578
|
constructObjectActions,
|
|
3207
|
-
constructSpaceActionGroups,
|
|
3208
3579
|
constructSpaceActions,
|
|
3209
3580
|
constructSpaceNode,
|
|
3210
3581
|
createObjectNode,
|
|
@@ -3212,7 +3583,7 @@ var src_default = SpacePlugin;
|
|
|
3212
3583
|
getNestedObjects,
|
|
3213
3584
|
getSpaceDisplayName,
|
|
3214
3585
|
memoizeQuery,
|
|
3215
|
-
|
|
3586
|
+
parseSchemaPlugin,
|
|
3216
3587
|
parseSpacePlugin,
|
|
3217
3588
|
translations
|
|
3218
3589
|
});
|