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