@dxos/plugin-space 0.8.4-main.84f28bd → 0.8.4-main.c1de068
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/CollectionMain-D2B75XBS.mjs +31 -0
- package/dist/lib/browser/CollectionMain-D2B75XBS.mjs.map +7 -0
- package/dist/lib/browser/ObjectDetailsPanel-YPTDQKMG.mjs +88 -0
- package/dist/lib/browser/ObjectDetailsPanel-YPTDQKMG.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-PMDF6PJV.mjs → app-graph-builder-7CZZJS3S.mjs} +138 -22
- package/dist/lib/browser/app-graph-builder-7CZZJS3S.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-UKYMBX4O.mjs → app-graph-serializer-H6AW7KGS.mjs} +4 -4
- package/dist/lib/browser/{chunk-XXIPJLJF.mjs → chunk-CEFHNVU7.mjs} +2 -1
- package/dist/lib/browser/chunk-CEFHNVU7.mjs.map +7 -0
- package/dist/lib/browser/{chunk-C7KGJTAL.mjs → chunk-JS3MMC42.mjs} +2 -1
- package/dist/lib/browser/{chunk-C7KGJTAL.mjs.map → chunk-JS3MMC42.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-6VLSHG4A.mjs → chunk-QACNNDOT.mjs} +64 -3
- package/dist/lib/browser/chunk-QACNNDOT.mjs.map +7 -0
- package/dist/lib/browser/{chunk-S6NY637J.mjs → chunk-SGTQ52SU.mjs} +57 -3
- package/dist/lib/browser/chunk-SGTQ52SU.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GVTXQCIW.mjs → chunk-V7MJSSBQ.mjs} +355 -286
- package/dist/lib/browser/chunk-V7MJSSBQ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WBSEOLEM.mjs → chunk-XUYKJUU7.mjs} +124 -21
- package/dist/lib/browser/chunk-XUYKJUU7.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +98 -9
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-WK5WYFH3.mjs → intent-resolver-TIXVDYN7.mjs} +164 -14
- package/dist/lib/browser/intent-resolver-TIXVDYN7.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-7S6FIC5G.mjs → react-root-N2J7TDRX.mjs} +5 -5
- package/dist/lib/browser/{react-surface-6C3YJNDK.mjs → react-surface-TPNLWJJH.mjs} +35 -14
- package/dist/lib/browser/react-surface-TPNLWJJH.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-K3B3OAH4.mjs → schema-defs-Z6FC4AHC.mjs} +2 -2
- package/dist/lib/browser/{settings-XNWYRWNM.mjs → settings-4IMP5RYT.mjs} +2 -2
- package/dist/lib/browser/{spaces-ready-K7NSNBHM.mjs → spaces-ready-TOPG6IV4.mjs} +4 -4
- package/dist/lib/browser/{state-522XTUR4.mjs → state-QYZAB45H.mjs} +2 -2
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/CollectionMain-ZJIFCWKZ.mjs +32 -0
- package/dist/lib/node-esm/CollectionMain-ZJIFCWKZ.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-QKZEDSZK.mjs +89 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-QKZEDSZK.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-TO72W6MI.mjs → app-graph-builder-KGIGWC72.mjs} +138 -22
- package/dist/lib/node-esm/app-graph-builder-KGIGWC72.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-LA3IZDXJ.mjs → app-graph-serializer-2ICUGQQT.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-HJJHLWKY.mjs → chunk-4AOMYKDE.mjs} +124 -21
- package/dist/lib/node-esm/chunk-4AOMYKDE.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-72QMMRKC.mjs → chunk-5HHYE264.mjs} +2 -1
- package/dist/lib/node-esm/{chunk-72QMMRKC.mjs.map → chunk-5HHYE264.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-AT7LGFER.mjs → chunk-5T3ZH23B.mjs} +2 -1
- package/dist/lib/node-esm/chunk-5T3ZH23B.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OUBADVJE.mjs → chunk-6X5DLJM5.mjs} +355 -286
- package/dist/lib/node-esm/chunk-6X5DLJM5.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2THX6G4C.mjs → chunk-JH6F4C3I.mjs} +57 -3
- package/dist/lib/node-esm/chunk-JH6F4C3I.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SXD6T2N4.mjs → chunk-P442DOQ3.mjs} +64 -3
- package/dist/lib/node-esm/chunk-P442DOQ3.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +98 -9
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-HSR27ME4.mjs → intent-resolver-MHGHRGDT.mjs} +164 -14
- package/dist/lib/node-esm/intent-resolver-MHGHRGDT.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-HUK3ANLV.mjs → react-root-KW3TGJGY.mjs} +5 -5
- package/dist/lib/node-esm/{react-surface-AGAWX7DD.mjs → react-surface-UUIUUD6P.mjs} +35 -14
- package/dist/lib/node-esm/react-surface-UUIUUD6P.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-4MCDG4DV.mjs → schema-defs-WHJM7UZE.mjs} +2 -2
- package/dist/lib/node-esm/{settings-YGKHGFPH.mjs → settings-SAOBPND3.mjs} +2 -2
- package/dist/lib/node-esm/{spaces-ready-UM2P3DCR.mjs → spaces-ready-HIUKNDZK.mjs} +4 -4
- package/dist/lib/node-esm/{state-C4IOXPZP.mjs → state-ZVEHQ4BJ.mjs} +2 -2
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +9 -3
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
- package/dist/types/src/components/CollectionMain.d.ts +1 -0
- package/dist/types/src/components/CollectionMain.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +3 -2
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.d.ts.map +1 -1
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/ObjectDetailsPanel.d.ts +9 -0
- package/dist/types/src/components/ObjectDetailsPanel.d.ts.map +1 -0
- package/dist/types/src/components/PersistenceStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +1 -1
- package/dist/types/src/components/SyncStatus/status.d.ts +5 -5
- package/dist/types/src/components/ViewEditor.d.ts +8 -0
- package/dist/types/src/components/ViewEditor.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +8 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +1 -0
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +61 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +82 -2
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +27 -2
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +47 -49
- package/src/SpacePlugin.ts +87 -4
- package/src/capabilities/app-graph-builder.ts +165 -5
- package/src/capabilities/capabilities.ts +8 -3
- package/src/capabilities/intent-resolver.ts +114 -5
- package/src/capabilities/react-surface.tsx +47 -10
- package/src/components/AwaitingObject.tsx +4 -6
- package/src/components/CollectionMain.tsx +2 -0
- package/src/components/CreateDialog/CreateObjectDialog.tsx +29 -25
- package/src/components/MembersContainer.tsx +5 -3
- package/src/components/MenuFooter.tsx +2 -3
- package/src/components/ObjectDetailsPanel.tsx +77 -0
- package/src/components/PersistenceStatus.tsx +5 -6
- package/src/components/PopoverRenameObject.tsx +2 -2
- package/src/components/SyncStatus/SyncStatus.tsx +1 -1
- package/src/components/SyncStatus/status.ts +4 -4
- package/src/components/ViewEditor.tsx +64 -0
- package/src/components/index.ts +6 -1
- package/src/events.ts +1 -0
- package/src/translations.ts +62 -0
- package/src/types/types.ts +56 -3
- package/src/util.tsx +115 -20
- package/dist/lib/browser/app-graph-builder-PMDF6PJV.mjs.map +0 -7
- package/dist/lib/browser/chunk-6VLSHG4A.mjs.map +0 -7
- package/dist/lib/browser/chunk-GVTXQCIW.mjs.map +0 -7
- package/dist/lib/browser/chunk-S6NY637J.mjs.map +0 -7
- package/dist/lib/browser/chunk-WBSEOLEM.mjs.map +0 -7
- package/dist/lib/browser/chunk-XXIPJLJF.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-WK5WYFH3.mjs.map +0 -7
- package/dist/lib/browser/react-surface-6C3YJNDK.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-TO72W6MI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2THX6G4C.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AT7LGFER.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HJJHLWKY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OUBADVJE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SXD6T2N4.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-HSR27ME4.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-AGAWX7DD.mjs.map +0 -7
- /package/dist/lib/browser/{app-graph-serializer-UKYMBX4O.mjs.map → app-graph-serializer-H6AW7KGS.mjs.map} +0 -0
- /package/dist/lib/browser/{react-root-7S6FIC5G.mjs.map → react-root-N2J7TDRX.mjs.map} +0 -0
- /package/dist/lib/browser/{schema-defs-K3B3OAH4.mjs.map → schema-defs-Z6FC4AHC.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-XNWYRWNM.mjs.map → settings-4IMP5RYT.mjs.map} +0 -0
- /package/dist/lib/browser/{spaces-ready-K7NSNBHM.mjs.map → spaces-ready-TOPG6IV4.mjs.map} +0 -0
- /package/dist/lib/browser/{state-522XTUR4.mjs.map → state-QYZAB45H.mjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-serializer-LA3IZDXJ.mjs.map → app-graph-serializer-2ICUGQQT.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-root-HUK3ANLV.mjs.map → react-root-KW3TGJGY.mjs.map} +0 -0
- /package/dist/lib/node-esm/{schema-defs-4MCDG4DV.mjs.map → schema-defs-WHJM7UZE.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-YGKHGFPH.mjs.map → settings-SAOBPND3.mjs.map} +0 -0
- /package/dist/lib/node-esm/{spaces-ready-UM2P3DCR.mjs.map → spaces-ready-HIUKNDZK.mjs.map} +0 -0
- /package/dist/lib/node-esm/{state-C4IOXPZP.mjs.map → state-ZVEHQ4BJ.mjs.map} +0 -0
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
} from "./chunk-SSLBYZEY.mjs";
|
|
6
6
|
import {
|
|
7
7
|
SpaceCapabilities
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5T3ZH23B.mjs";
|
|
9
9
|
import {
|
|
10
10
|
COMPOSER_SPACE_LOCK,
|
|
11
11
|
getSpaceDisplayName
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4AOMYKDE.mjs";
|
|
13
13
|
import {
|
|
14
14
|
SpaceAction,
|
|
15
15
|
SpaceForm
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JH6F4C3I.mjs";
|
|
17
17
|
import {
|
|
18
18
|
SPACE_PLUGIN,
|
|
19
19
|
meta
|
|
@@ -21,13 +21,11 @@ import {
|
|
|
21
21
|
|
|
22
22
|
// src/components/AwaitingObject.tsx
|
|
23
23
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
24
|
-
import { CheckCircle, CircleDashed, CircleNotch } from "@phosphor-icons/react";
|
|
25
24
|
import React, { useCallback, useEffect, useState } from "react";
|
|
26
25
|
import { createIntent, LayoutAction, useIntentDispatcher, useLayout } from "@dxos/app-framework";
|
|
27
26
|
import { useClient } from "@dxos/react-client";
|
|
28
27
|
import { Filter, fullyQualifiedId, useQuery } from "@dxos/react-client/echo";
|
|
29
|
-
import { Button, Toast, useTranslation } from "@dxos/react-ui";
|
|
30
|
-
import { getSize, mx } from "@dxos/react-ui-theme";
|
|
28
|
+
import { Button, Icon, Toast, useTranslation } from "@dxos/react-ui";
|
|
31
29
|
var WAIT_FOR_OBJECT_TIMEOUT = 18e4;
|
|
32
30
|
var TOAST_TIMEOUT = 24e4;
|
|
33
31
|
var AwaitingObject = ({ id }) => {
|
|
@@ -88,12 +86,16 @@ var AwaitingObject = ({ id }) => {
|
|
|
88
86
|
onOpenChange: setOpen
|
|
89
87
|
}, /* @__PURE__ */ React.createElement(Toast.Body, null, /* @__PURE__ */ React.createElement(Toast.Title, {
|
|
90
88
|
classNames: "flex items-center gap-2"
|
|
91
|
-
}, found ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
89
|
+
}, found ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Icon, {
|
|
90
|
+
icon: "ph--check-circle--regular",
|
|
91
|
+
size: 5
|
|
92
|
+
}), /* @__PURE__ */ React.createElement("span", null, t("found object label"))) : waiting ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Icon, {
|
|
93
|
+
icon: "ph--circle-notch--regular",
|
|
94
|
+
size: 5,
|
|
95
|
+
classNames: "animate-spin"
|
|
96
|
+
}), /* @__PURE__ */ React.createElement("span", null, t("waiting for object label"))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Icon, {
|
|
97
|
+
icon: "ph--circle-dashed--regular",
|
|
98
|
+
size: 5
|
|
97
99
|
}), /* @__PURE__ */ React.createElement("span", null, t("object not found label")))), /* @__PURE__ */ React.createElement(Toast.Description, null, t(found ? "found object description" : waiting ? "waiting for object description" : "object not found description"))), /* @__PURE__ */ React.createElement(Toast.Actions, null, found ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Toast.Action, {
|
|
98
100
|
altText: t("go to object alt"),
|
|
99
101
|
asChild: true
|
|
@@ -120,14 +122,14 @@ var AwaitingObject = ({ id }) => {
|
|
|
120
122
|
|
|
121
123
|
// src/components/CreateDialog/CreateObjectDialog.tsx
|
|
122
124
|
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
123
|
-
import { pipe } from "effect";
|
|
125
|
+
import { Effect, pipe } from "effect";
|
|
124
126
|
import React3, { useCallback as useCallback3, useRef, useState as useState2 } from "react";
|
|
125
127
|
import { Capabilities, LayoutAction as LayoutAction2, chain, createIntent as createIntent2, useCapabilities, useIntentDispatcher as useIntentDispatcher2, usePluginManager } from "@dxos/app-framework";
|
|
126
|
-
import { Query, Type as Type2 } from "@dxos/echo";
|
|
128
|
+
import { Obj, Query, Type as Type2 } from "@dxos/echo";
|
|
127
129
|
import { invariant } from "@dxos/invariant";
|
|
128
130
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
129
131
|
import { getSpace, isLiveObject, isSpace, useQuery as useQuery2, useSpaces } from "@dxos/react-client/echo";
|
|
130
|
-
import { Button as Button2, Dialog, Icon as
|
|
132
|
+
import { Button as Button2, Dialog, Icon as Icon3, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
131
133
|
import { cardDialogContent, cardDialogHeader } from "@dxos/react-ui-stack";
|
|
132
134
|
import { DataType } from "@dxos/schema";
|
|
133
135
|
import { isNonNullable as isNonNullable2 } from "@dxos/util";
|
|
@@ -137,7 +139,7 @@ import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking"
|
|
|
137
139
|
import React2, { useCallback as useCallback2 } from "react";
|
|
138
140
|
import { Type } from "@dxos/echo";
|
|
139
141
|
import { getTypeAnnotation } from "@dxos/echo-schema";
|
|
140
|
-
import { Icon, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
142
|
+
import { Icon as Icon2, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
141
143
|
import { Form } from "@dxos/react-ui-form";
|
|
142
144
|
import { SearchList } from "@dxos/react-ui-searchlist";
|
|
143
145
|
import { cardDialogOverflow, cardDialogPaddedOverflow, cardDialogSearchListRoot } from "@dxos/react-ui-stack";
|
|
@@ -275,7 +277,7 @@ var SelectSchema = ({ options, resolve, onChange }) => {
|
|
|
275
277
|
classNames: "flex items-center gap-2"
|
|
276
278
|
}, /* @__PURE__ */ React2.createElement("span", {
|
|
277
279
|
className: "flex gap-2 items-center grow truncate"
|
|
278
|
-
}, /* @__PURE__ */ React2.createElement(
|
|
280
|
+
}, /* @__PURE__ */ React2.createElement(Icon2, {
|
|
279
281
|
icon: resolve?.(option.typename).icon ?? "ph--placeholder--regular",
|
|
280
282
|
size: 5
|
|
281
283
|
}), t("typename label", {
|
|
@@ -289,22 +291,22 @@ var SelectSchema = ({ options, resolve, onChange }) => {
|
|
|
289
291
|
|
|
290
292
|
// src/capabilities/index.ts
|
|
291
293
|
import { lazy } from "@dxos/app-framework";
|
|
292
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-
|
|
293
|
-
var AppGraphSerializer = lazy(() => import("./app-graph-serializer-
|
|
294
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-KGIGWC72.mjs"));
|
|
295
|
+
var AppGraphSerializer = lazy(() => import("./app-graph-serializer-2ICUGQQT.mjs"));
|
|
294
296
|
var IdentityCreated = lazy(() => import("./identity-created-IJQO6GCR.mjs"));
|
|
295
|
-
var IntentResolver = lazy(() => import("./intent-resolver-
|
|
296
|
-
var ReactRoot = lazy(() => import("./react-root-
|
|
297
|
-
var ReactSurface = lazy(() => import("./react-surface-
|
|
298
|
-
var SchemaDefs = lazy(() => import("./schema-defs-
|
|
297
|
+
var IntentResolver = lazy(() => import("./intent-resolver-MHGHRGDT.mjs"));
|
|
298
|
+
var ReactRoot = lazy(() => import("./react-root-KW3TGJGY.mjs"));
|
|
299
|
+
var ReactSurface = lazy(() => import("./react-surface-UUIUUD6P.mjs"));
|
|
300
|
+
var SchemaDefs = lazy(() => import("./schema-defs-WHJM7UZE.mjs"));
|
|
299
301
|
var SchemaTools = lazy(() => import("./schema-tools-KWW5PTML.mjs"));
|
|
300
|
-
var SpaceSettings = lazy(() => import("./settings-
|
|
301
|
-
var SpaceState = lazy(() => import("./state-
|
|
302
|
-
var SpacesReady = lazy(() => import("./spaces-ready-
|
|
302
|
+
var SpaceSettings = lazy(() => import("./settings-SAOBPND3.mjs"));
|
|
303
|
+
var SpaceState = lazy(() => import("./state-ZVEHQ4BJ.mjs"));
|
|
304
|
+
var SpacesReady = lazy(() => import("./spaces-ready-HIUKNDZK.mjs"));
|
|
303
305
|
|
|
304
306
|
// src/components/CreateDialog/CreateObjectDialog.tsx
|
|
305
307
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx";
|
|
306
308
|
var CREATE_OBJECT_DIALOG = `${SPACE_PLUGIN}/CreateObjectDialog`;
|
|
307
|
-
var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, name, shouldNavigate: _shouldNavigate }) => {
|
|
309
|
+
var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, name, onCreateObject, shouldNavigate: _shouldNavigate }) => {
|
|
308
310
|
var _effect = _useSignals3();
|
|
309
311
|
try {
|
|
310
312
|
const closeRef = useRef(null);
|
|
@@ -312,7 +314,7 @@ var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, na
|
|
|
312
314
|
const { t } = useTranslation3(SPACE_PLUGIN);
|
|
313
315
|
const client = useClient2();
|
|
314
316
|
const spaces = useSpaces();
|
|
315
|
-
const {
|
|
317
|
+
const { dispatch } = useIntentDispatcher2();
|
|
316
318
|
const forms = useCapabilities(SpaceCapabilities.ObjectForm);
|
|
317
319
|
const [target, setTarget] = useState2(initialTarget);
|
|
318
320
|
const [typename, setTypename] = useState2(initialTypename);
|
|
@@ -322,7 +324,7 @@ var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, na
|
|
|
322
324
|
const resolve = useCallback3((typename2) => manager.context.getCapabilities(Capabilities.Metadata).find(({ id }) => id === typename2)?.metadata ?? {}, [
|
|
323
325
|
manager
|
|
324
326
|
]);
|
|
325
|
-
const handleCreateObject = useCallback3(
|
|
327
|
+
const handleCreateObject = useCallback3(({ form, data = {} }) => Effect.gen(function* () {
|
|
326
328
|
if (!target) {
|
|
327
329
|
return;
|
|
328
330
|
}
|
|
@@ -330,18 +332,17 @@ var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, na
|
|
|
330
332
|
const space2 = isSpace(target) ? target : getSpace(target);
|
|
331
333
|
invariant(space2, "Missing space", {
|
|
332
334
|
F: __dxlog_file,
|
|
333
|
-
L:
|
|
334
|
-
S:
|
|
335
|
+
L: 76,
|
|
336
|
+
S: this,
|
|
335
337
|
A: [
|
|
336
338
|
"space",
|
|
337
339
|
"'Missing space'"
|
|
338
340
|
]
|
|
339
341
|
});
|
|
340
|
-
const
|
|
342
|
+
const { object } = yield* dispatch(form.getIntent(data, {
|
|
341
343
|
space: space2
|
|
342
344
|
}));
|
|
343
|
-
|
|
344
|
-
if (isLiveObject(object)) {
|
|
345
|
+
if (isLiveObject(object) && !Obj.instanceOf(DataType.StoredSchema, object)) {
|
|
345
346
|
const hidden = form.hidden || hiddenTypenames.includes(Type2.getTypename(form.objectSchema));
|
|
346
347
|
const addObjectIntent = createIntent2(SpaceAction.AddObject, {
|
|
347
348
|
target,
|
|
@@ -350,14 +351,15 @@ var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, na
|
|
|
350
351
|
});
|
|
351
352
|
const shouldNavigate = _shouldNavigate ?? (() => true);
|
|
352
353
|
if (shouldNavigate(object)) {
|
|
353
|
-
|
|
354
|
+
yield* dispatch(pipe(addObjectIntent, chain(LayoutAction2.Open, {
|
|
354
355
|
part: "main"
|
|
355
356
|
})));
|
|
356
357
|
} else {
|
|
357
|
-
|
|
358
|
+
yield* dispatch(addObjectIntent);
|
|
358
359
|
}
|
|
360
|
+
onCreateObject?.(object);
|
|
359
361
|
}
|
|
360
|
-
}, [
|
|
362
|
+
}).pipe(Effect.runPromise), [
|
|
361
363
|
dispatch,
|
|
362
364
|
target,
|
|
363
365
|
resolve,
|
|
@@ -384,7 +386,7 @@ var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, na
|
|
|
384
386
|
density: "fine",
|
|
385
387
|
variant: "ghost",
|
|
386
388
|
autoFocus: true
|
|
387
|
-
}, /* @__PURE__ */ React3.createElement(
|
|
389
|
+
}, /* @__PURE__ */ React3.createElement(Icon3, {
|
|
388
390
|
icon: "ph--x--regular",
|
|
389
391
|
size: 4
|
|
390
392
|
})))), /* @__PURE__ */ React3.createElement(CreateObjectPanel, {
|
|
@@ -407,10 +409,10 @@ var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, na
|
|
|
407
409
|
|
|
408
410
|
// src/components/CreateDialog/CreateSpaceDialog.tsx
|
|
409
411
|
import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
|
|
410
|
-
import { Effect } from "effect";
|
|
412
|
+
import { Effect as Effect2 } from "effect";
|
|
411
413
|
import React4, { useCallback as useCallback4, useRef as useRef2 } from "react";
|
|
412
414
|
import { createIntent as createIntent3, LayoutAction as LayoutAction3, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
|
|
413
|
-
import { Button as Button3, Dialog as Dialog2, Icon as
|
|
415
|
+
import { Button as Button3, Dialog as Dialog2, Icon as Icon4, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
414
416
|
import { Form as Form2 } from "@dxos/react-ui-form";
|
|
415
417
|
import { cardDialogContent as cardDialogContent2, cardDialogHeader as cardDialogHeader2 } from "@dxos/react-ui-stack";
|
|
416
418
|
var CREATE_SPACE_DIALOG = `${SPACE_PLUGIN}/CreateSpaceDialog`;
|
|
@@ -425,7 +427,7 @@ var CreateSpaceDialog = () => {
|
|
|
425
427
|
const { dispatch } = useIntentDispatcher3();
|
|
426
428
|
const inputSurfaceLookup = useInputSurfaceLookup();
|
|
427
429
|
const handleCreateSpace = useCallback4(async (data) => {
|
|
428
|
-
const program =
|
|
430
|
+
const program = Effect2.gen(function* () {
|
|
429
431
|
const { space } = yield* dispatch(createIntent3(SpaceAction.Create, data));
|
|
430
432
|
yield* dispatch(createIntent3(LayoutAction3.SwitchWorkspace, {
|
|
431
433
|
part: "workspace",
|
|
@@ -438,7 +440,7 @@ var CreateSpaceDialog = () => {
|
|
|
438
440
|
}
|
|
439
441
|
}));
|
|
440
442
|
});
|
|
441
|
-
await
|
|
443
|
+
await Effect2.runPromise(program);
|
|
442
444
|
}, [
|
|
443
445
|
dispatch
|
|
444
446
|
]);
|
|
@@ -457,7 +459,7 @@ var CreateSpaceDialog = () => {
|
|
|
457
459
|
density: "fine",
|
|
458
460
|
variant: "ghost",
|
|
459
461
|
autoFocus: true
|
|
460
|
-
}, /* @__PURE__ */ React4.createElement(
|
|
462
|
+
}, /* @__PURE__ */ React4.createElement(Icon4, {
|
|
461
463
|
icon: "ph--x--regular",
|
|
462
464
|
size: 4
|
|
463
465
|
})))), /* @__PURE__ */ React4.createElement("div", {
|
|
@@ -478,39 +480,17 @@ var CreateSpaceDialog = () => {
|
|
|
478
480
|
}
|
|
479
481
|
};
|
|
480
482
|
|
|
481
|
-
// src/components/
|
|
483
|
+
// src/components/CollectionSection.tsx
|
|
482
484
|
import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
|
|
483
485
|
import React5 from "react";
|
|
484
486
|
import { useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
485
|
-
|
|
486
|
-
var CollectionMain = ({ collection }) => {
|
|
487
|
+
var CollectionSection = ({ collection }) => {
|
|
487
488
|
var _effect = _useSignals5();
|
|
488
489
|
try {
|
|
489
490
|
const { t } = useTranslation5(SPACE_PLUGIN);
|
|
490
491
|
return /* @__PURE__ */ React5.createElement("div", {
|
|
491
|
-
role: "none",
|
|
492
|
-
className: mx2(baseSurface, "min-bs-screen is-full flex items-center justify-center p-8"),
|
|
493
|
-
"data-testid": "composer.firstRunMessage"
|
|
494
|
-
}, /* @__PURE__ */ React5.createElement("p", {
|
|
495
|
-
role: "alert",
|
|
496
|
-
className: mx2(descriptionMessage, "rounded-md p-8 font-normal text-lg max-is-[24rem] break-words")
|
|
497
|
-
}, collection.name ?? t("unnamed collection label")));
|
|
498
|
-
} finally {
|
|
499
|
-
_effect.f();
|
|
500
|
-
}
|
|
501
|
-
};
|
|
502
|
-
|
|
503
|
-
// src/components/CollectionSection.tsx
|
|
504
|
-
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
505
|
-
import React6 from "react";
|
|
506
|
-
import { useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
507
|
-
var CollectionSection = ({ collection }) => {
|
|
508
|
-
var _effect = _useSignals6();
|
|
509
|
-
try {
|
|
510
|
-
const { t } = useTranslation6(SPACE_PLUGIN);
|
|
511
|
-
return /* @__PURE__ */ React6.createElement("div", {
|
|
512
492
|
className: "min-bs-[3.5rem] grid grid-rows-subgrid grid-cols-subgrid items-center"
|
|
513
|
-
}, /* @__PURE__ */
|
|
493
|
+
}, /* @__PURE__ */ React5.createElement("span", {
|
|
514
494
|
className: "truncate"
|
|
515
495
|
}, collection.name ?? t("unnamed collection label")));
|
|
516
496
|
} finally {
|
|
@@ -519,22 +499,22 @@ var CollectionSection = ({ collection }) => {
|
|
|
519
499
|
};
|
|
520
500
|
|
|
521
501
|
// src/components/JoinDialog.tsx
|
|
522
|
-
import { useSignals as
|
|
523
|
-
import
|
|
502
|
+
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
503
|
+
import React6, { useCallback as useCallback5 } from "react";
|
|
524
504
|
import { createIntent as createIntent4, LayoutAction as LayoutAction4, useAppGraph, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
|
|
525
505
|
import { Trigger } from "@dxos/async";
|
|
526
506
|
import { ObservabilityAction } from "@dxos/plugin-observability/types";
|
|
527
507
|
import { useClient as useClient3 } from "@dxos/react-client";
|
|
528
|
-
import { Dialog as Dialog3, useTranslation as
|
|
508
|
+
import { Dialog as Dialog3, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
529
509
|
import { JoinPanel } from "@dxos/shell/react";
|
|
530
510
|
var JOIN_DIALOG = `${SPACE_PLUGIN}/JoinDialog`;
|
|
531
511
|
var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
532
|
-
var _effect =
|
|
512
|
+
var _effect = _useSignals6();
|
|
533
513
|
try {
|
|
534
514
|
const { dispatchPromise: dispatch } = useIntentDispatcher4();
|
|
535
515
|
const client = useClient3();
|
|
536
516
|
const { graph } = useAppGraph();
|
|
537
|
-
const { t } =
|
|
517
|
+
const { t } = useTranslation6(SPACE_PLUGIN);
|
|
538
518
|
const handleDone = useCallback5(async (result) => {
|
|
539
519
|
const spaceKey = result?.spaceKey;
|
|
540
520
|
if (!spaceKey) {
|
|
@@ -615,16 +595,16 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
615
595
|
client,
|
|
616
596
|
graph
|
|
617
597
|
]);
|
|
618
|
-
return /* @__PURE__ */
|
|
598
|
+
return /* @__PURE__ */ React6.createElement(Dialog3.Content, null, /* @__PURE__ */ React6.createElement(Dialog3.Title, {
|
|
619
599
|
classNames: "sr-only"
|
|
620
600
|
}, t("join space label", {
|
|
621
601
|
ns: "os"
|
|
622
|
-
})), /* @__PURE__ */
|
|
602
|
+
})), /* @__PURE__ */ React6.createElement(JoinPanel, {
|
|
623
603
|
...props,
|
|
624
|
-
exitActionParent: /* @__PURE__ */
|
|
604
|
+
exitActionParent: /* @__PURE__ */ React6.createElement(Dialog3.Close, {
|
|
625
605
|
asChild: true
|
|
626
606
|
}),
|
|
627
|
-
doneActionParent: /* @__PURE__ */
|
|
607
|
+
doneActionParent: /* @__PURE__ */ React6.createElement(Dialog3.Close, {
|
|
628
608
|
asChild: true
|
|
629
609
|
}),
|
|
630
610
|
onDone: handleDone
|
|
@@ -635,19 +615,17 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
635
615
|
};
|
|
636
616
|
|
|
637
617
|
// src/components/MembersContainer.tsx
|
|
638
|
-
import { useSignals as
|
|
639
|
-
import {
|
|
640
|
-
import React8, { useCallback as useCallback6, useMemo, useState as useState3 } from "react";
|
|
618
|
+
import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
|
|
619
|
+
import React7, { useCallback as useCallback6, useMemo, useState as useState3 } from "react";
|
|
641
620
|
import { QR } from "react-qr-rounded";
|
|
642
621
|
import { createIntent as createIntent5, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework";
|
|
643
622
|
import { log } from "@dxos/log";
|
|
644
623
|
import { useConfig } from "@dxos/react-client";
|
|
645
624
|
import { fullyQualifiedId as fullyQualifiedId2, useSpaceInvitations } from "@dxos/react-client/echo";
|
|
646
625
|
import { Invitation, InvitationEncoder } from "@dxos/react-client/invitations";
|
|
647
|
-
import { Button as Button4, Clipboard, Icon as
|
|
626
|
+
import { Button as Button4, Clipboard, Icon as Icon5, Input, useId, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
648
627
|
import { ControlPage, ControlSection, ControlFrame, ControlFrameItem, ControlItemInput } from "@dxos/react-ui-form";
|
|
649
628
|
import { StackItem } from "@dxos/react-ui-stack";
|
|
650
|
-
import { getSize as getSize2, mx as mx3 } from "@dxos/react-ui-theme";
|
|
651
629
|
import { DataType as DataType2 } from "@dxos/schema";
|
|
652
630
|
import { AuthCode, BifurcatedAction, Centered, Emoji, InvitationList, SpaceMemberList, Viewport } from "@dxos/shell/react";
|
|
653
631
|
import { hexToEmoji } from "@dxos/util";
|
|
@@ -661,7 +639,7 @@ var handleInvitationEvent = (invitation, subscription) => {
|
|
|
661
639
|
authCode: invitation.authCode
|
|
662
640
|
}), void 0, {
|
|
663
641
|
F: __dxlog_file2,
|
|
664
|
-
L:
|
|
642
|
+
L: 39,
|
|
665
643
|
S: void 0,
|
|
666
644
|
C: (f, a) => f(...a)
|
|
667
645
|
});
|
|
@@ -669,9 +647,9 @@ var handleInvitationEvent = (invitation, subscription) => {
|
|
|
669
647
|
}
|
|
670
648
|
};
|
|
671
649
|
var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
672
|
-
var _effect =
|
|
650
|
+
var _effect = _useSignals7();
|
|
673
651
|
try {
|
|
674
|
-
const { t } =
|
|
652
|
+
const { t } = useTranslation7(SPACE_PLUGIN);
|
|
675
653
|
const config = useConfig();
|
|
676
654
|
const { dispatchPromise: dispatch } = useIntentDispatcher5();
|
|
677
655
|
const invitations = useSpaceInvitations(space.key);
|
|
@@ -699,7 +677,7 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
699
677
|
description: t("invite one description", {
|
|
700
678
|
ns: "os"
|
|
701
679
|
}),
|
|
702
|
-
icon: () => /* @__PURE__ */
|
|
680
|
+
icon: () => /* @__PURE__ */ React7.createElement(Icon5, {
|
|
703
681
|
icon: "ph--user-plus--regular",
|
|
704
682
|
size: 5
|
|
705
683
|
}),
|
|
@@ -724,7 +702,7 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
724
702
|
description: t("invite many description", {
|
|
725
703
|
ns: "os"
|
|
726
704
|
}),
|
|
727
|
-
icon: () => /* @__PURE__ */
|
|
705
|
+
icon: () => /* @__PURE__ */ React7.createElement(Icon5, {
|
|
728
706
|
icon: "ph--users-three--regular",
|
|
729
707
|
size: 5
|
|
730
708
|
}),
|
|
@@ -754,44 +732,44 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
754
732
|
const handleBack = () => {
|
|
755
733
|
setSelectedInvitation(null);
|
|
756
734
|
};
|
|
757
|
-
return /* @__PURE__ */
|
|
735
|
+
return /* @__PURE__ */ React7.createElement(Clipboard.Provider, null, /* @__PURE__ */ React7.createElement(StackItem.Content, {
|
|
758
736
|
classNames: "block overflow-y-auto"
|
|
759
|
-
}, /* @__PURE__ */
|
|
737
|
+
}, /* @__PURE__ */ React7.createElement(ControlPage, null, /* @__PURE__ */ React7.createElement(ControlSection, {
|
|
760
738
|
title: t("members verbose label"),
|
|
761
739
|
description: t("members description")
|
|
762
|
-
}, /* @__PURE__ */
|
|
740
|
+
}, /* @__PURE__ */ React7.createElement(ControlFrame, null, /* @__PURE__ */ React7.createElement(ControlFrameItem, {
|
|
763
741
|
title: t("members label")
|
|
764
|
-
}, /* @__PURE__ */
|
|
742
|
+
}, /* @__PURE__ */ React7.createElement(SpaceMemberList, {
|
|
765
743
|
spaceKey: space.key,
|
|
766
744
|
includeSelf: true
|
|
767
|
-
})), locked && /* @__PURE__ */
|
|
745
|
+
})), locked && /* @__PURE__ */ React7.createElement(ControlFrameItem, {
|
|
768
746
|
title: t("invitations label")
|
|
769
|
-
}, /* @__PURE__ */
|
|
747
|
+
}, /* @__PURE__ */ React7.createElement("p", {
|
|
770
748
|
className: "text-description mbe-2"
|
|
771
|
-
}, t("locked space description"))), !locked && /* @__PURE__ */
|
|
749
|
+
}, t("locked space description"))), !locked && /* @__PURE__ */ React7.createElement(ControlFrameItem, {
|
|
772
750
|
title: t("invitations label")
|
|
773
|
-
}, selectedInvitation && /* @__PURE__ */
|
|
751
|
+
}, selectedInvitation && /* @__PURE__ */ React7.createElement(InvitationSection, {
|
|
774
752
|
...selectedInvitation,
|
|
775
753
|
onBack: handleBack
|
|
776
|
-
}), !selectedInvitation && /* @__PURE__ */
|
|
754
|
+
}), !selectedInvitation && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("p", {
|
|
777
755
|
className: "text-description mbe-2"
|
|
778
|
-
}, t("space invitation description")), /* @__PURE__ */
|
|
756
|
+
}, t("space invitation description")), /* @__PURE__ */ React7.createElement(InvitationList, {
|
|
779
757
|
className: "mb-2",
|
|
780
758
|
send: handleSend,
|
|
781
759
|
invitations: visibleInvitations ?? [],
|
|
782
760
|
onClickRemove: (invitation) => invitation.cancel(),
|
|
783
761
|
createInvitationUrl
|
|
784
|
-
}), /* @__PURE__ */
|
|
762
|
+
}), /* @__PURE__ */ React7.createElement(BifurcatedAction, {
|
|
785
763
|
actions: inviteActions,
|
|
786
764
|
activeAction,
|
|
787
765
|
onChangeActiveAction: setActiveAction,
|
|
788
766
|
"data-testid": "membersContainer.createInvitation"
|
|
789
|
-
})))), /* @__PURE__ */
|
|
767
|
+
})))), /* @__PURE__ */ React7.createElement("div", {
|
|
790
768
|
className: "justify-center gap-4 p-0 mbs-4 container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]"
|
|
791
|
-
}, /* @__PURE__ */
|
|
769
|
+
}, /* @__PURE__ */ React7.createElement(ControlItemInput, {
|
|
792
770
|
title: t("space locked label"),
|
|
793
771
|
description: t("space locked description")
|
|
794
|
-
}, /* @__PURE__ */
|
|
772
|
+
}, /* @__PURE__ */ React7.createElement(Input.Switch, {
|
|
795
773
|
checked: locked,
|
|
796
774
|
onCheckedChange: handleChangeLocked,
|
|
797
775
|
classNames: "justify-self-end"
|
|
@@ -801,26 +779,26 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
801
779
|
}
|
|
802
780
|
};
|
|
803
781
|
var InvitationSection = ({ state = Invitation.State.INIT, authCode, invitationId = "never", url = "never", onBack }) => {
|
|
804
|
-
var _effect =
|
|
782
|
+
var _effect = _useSignals7();
|
|
805
783
|
try {
|
|
806
784
|
const activeView = state < 0 ? "init" : state >= Invitation.State.CANCELLED ? "complete" : state >= Invitation.State.READY_FOR_AUTHENTICATION && authCode ? "auth-code" : "qr-code";
|
|
807
|
-
return /* @__PURE__ */
|
|
785
|
+
return /* @__PURE__ */ React7.createElement(Viewport.Root, {
|
|
808
786
|
activeView
|
|
809
|
-
}, /* @__PURE__ */
|
|
787
|
+
}, /* @__PURE__ */ React7.createElement(Viewport.Views, null, /* @__PURE__ */ React7.createElement(Viewport.View, {
|
|
810
788
|
id: "init"
|
|
811
|
-
}), /* @__PURE__ */
|
|
789
|
+
}), /* @__PURE__ */ React7.createElement(Viewport.View, {
|
|
812
790
|
id: "complete"
|
|
813
|
-
}, /* @__PURE__ */
|
|
791
|
+
}, /* @__PURE__ */ React7.createElement(InvitationComplete, {
|
|
814
792
|
statusValue: state
|
|
815
|
-
})), /* @__PURE__ */
|
|
793
|
+
})), /* @__PURE__ */ React7.createElement(Viewport.View, {
|
|
816
794
|
id: "auth-code"
|
|
817
|
-
}, /* @__PURE__ */
|
|
795
|
+
}, /* @__PURE__ */ React7.createElement(InvitationAuthCode, {
|
|
818
796
|
id: invitationId,
|
|
819
797
|
code: authCode ?? "never",
|
|
820
798
|
onCancel: onBack
|
|
821
|
-
})), /* @__PURE__ */
|
|
799
|
+
})), /* @__PURE__ */ React7.createElement(Viewport.View, {
|
|
822
800
|
id: "qr-code"
|
|
823
|
-
}, /* @__PURE__ */
|
|
801
|
+
}, /* @__PURE__ */ React7.createElement(InvitationQR, {
|
|
824
802
|
id: invitationId,
|
|
825
803
|
url,
|
|
826
804
|
onCancel: onBack
|
|
@@ -830,36 +808,36 @@ var InvitationSection = ({ state = Invitation.State.INIT, authCode, invitationId
|
|
|
830
808
|
}
|
|
831
809
|
};
|
|
832
810
|
var InvitationQR = ({ id, url, onCancel }) => {
|
|
833
|
-
var _effect =
|
|
811
|
+
var _effect = _useSignals7();
|
|
834
812
|
try {
|
|
835
|
-
const { t } =
|
|
813
|
+
const { t } = useTranslation7("os");
|
|
836
814
|
const qrLabel = useId("members-container__qr-code");
|
|
837
815
|
const emoji = hexToEmoji(id);
|
|
838
|
-
return /* @__PURE__ */
|
|
816
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("p", {
|
|
839
817
|
className: "text-description"
|
|
840
818
|
}, t("qr code description", {
|
|
841
819
|
ns: SPACE_PLUGIN
|
|
842
|
-
})), /* @__PURE__ */
|
|
820
|
+
})), /* @__PURE__ */ React7.createElement("div", {
|
|
843
821
|
role: "group",
|
|
844
822
|
className: "grid grid-cols-[1fr_min-content] mlb-2 gap-2"
|
|
845
|
-
}, /* @__PURE__ */
|
|
823
|
+
}, /* @__PURE__ */ React7.createElement("div", {
|
|
846
824
|
role: "none",
|
|
847
825
|
className: "is-full aspect-square relative text-description"
|
|
848
|
-
}, /* @__PURE__ */
|
|
826
|
+
}, /* @__PURE__ */ React7.createElement(QR, {
|
|
849
827
|
rounding: 100,
|
|
850
828
|
backgroundColor: "transparent",
|
|
851
829
|
color: "currentColor",
|
|
852
830
|
"aria-labelledby": qrLabel,
|
|
853
831
|
errorCorrectionLevel: "Q",
|
|
854
832
|
cutout: true
|
|
855
|
-
}, url ?? "never"), /* @__PURE__ */
|
|
833
|
+
}, url ?? "never"), /* @__PURE__ */ React7.createElement(Centered, null, /* @__PURE__ */ React7.createElement(Emoji, {
|
|
856
834
|
text: emoji
|
|
857
|
-
}))), /* @__PURE__ */
|
|
835
|
+
}))), /* @__PURE__ */ React7.createElement("span", {
|
|
858
836
|
id: qrLabel,
|
|
859
837
|
className: "sr-only"
|
|
860
|
-
}, t("qr label")), /* @__PURE__ */
|
|
838
|
+
}, t("qr label")), /* @__PURE__ */ React7.createElement(Clipboard.Button, {
|
|
861
839
|
value: url ?? "never"
|
|
862
|
-
})), /* @__PURE__ */
|
|
840
|
+
})), /* @__PURE__ */ React7.createElement(Button4, {
|
|
863
841
|
variant: "ghost",
|
|
864
842
|
onClick: onCancel
|
|
865
843
|
}, t("cancel label")));
|
|
@@ -868,22 +846,22 @@ var InvitationQR = ({ id, url, onCancel }) => {
|
|
|
868
846
|
}
|
|
869
847
|
};
|
|
870
848
|
var InvitationAuthCode = ({ id, code, onCancel }) => {
|
|
871
|
-
var _effect =
|
|
849
|
+
var _effect = _useSignals7();
|
|
872
850
|
try {
|
|
873
|
-
const { t } =
|
|
851
|
+
const { t } = useTranslation7("os");
|
|
874
852
|
const emoji = hexToEmoji(id);
|
|
875
|
-
return /* @__PURE__ */
|
|
853
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("p", {
|
|
876
854
|
className: "text-description"
|
|
877
|
-
}, t("auth other device emoji message")), emoji && /* @__PURE__ */
|
|
855
|
+
}, t("auth other device emoji message")), emoji && /* @__PURE__ */ React7.createElement(Emoji, {
|
|
878
856
|
text: emoji,
|
|
879
857
|
className: "mli-auto mlb-2 text-center"
|
|
880
|
-
}), /* @__PURE__ */
|
|
858
|
+
}), /* @__PURE__ */ React7.createElement("p", {
|
|
881
859
|
className: "text-description"
|
|
882
|
-
}, t("auth code message")), /* @__PURE__ */
|
|
860
|
+
}, t("auth code message")), /* @__PURE__ */ React7.createElement(AuthCode, {
|
|
883
861
|
code,
|
|
884
862
|
large: true,
|
|
885
863
|
classNames: "mli-auto mlb-2 text-center grow"
|
|
886
|
-
}), /* @__PURE__ */
|
|
864
|
+
}), /* @__PURE__ */ React7.createElement(Button4, {
|
|
887
865
|
variant: "ghost",
|
|
888
866
|
onClick: onCancel
|
|
889
867
|
}, t("cancel label")));
|
|
@@ -892,12 +870,16 @@ var InvitationAuthCode = ({ id, code, onCancel }) => {
|
|
|
892
870
|
}
|
|
893
871
|
};
|
|
894
872
|
var InvitationComplete = ({ statusValue }) => {
|
|
895
|
-
var _effect =
|
|
873
|
+
var _effect = _useSignals7();
|
|
896
874
|
try {
|
|
897
|
-
return statusValue > 0 ? /* @__PURE__ */
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
875
|
+
return statusValue > 0 ? /* @__PURE__ */ React7.createElement(Icon5, {
|
|
876
|
+
icon: "ph--check--regular",
|
|
877
|
+
size: 6,
|
|
878
|
+
classNames: "m-1.5"
|
|
879
|
+
}) : /* @__PURE__ */ React7.createElement(Icon5, {
|
|
880
|
+
icon: "ph--x--regular",
|
|
881
|
+
size: 6,
|
|
882
|
+
classNames: "m-1.5"
|
|
901
883
|
});
|
|
902
884
|
} finally {
|
|
903
885
|
_effect.f();
|
|
@@ -905,29 +887,29 @@ var InvitationComplete = ({ statusValue }) => {
|
|
|
905
887
|
};
|
|
906
888
|
|
|
907
889
|
// src/components/MenuFooter.tsx
|
|
908
|
-
import { useSignals as
|
|
909
|
-
import
|
|
910
|
-
import React9 from "react";
|
|
890
|
+
import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
|
|
891
|
+
import React8 from "react";
|
|
911
892
|
import { getSpace as getSpace2 } from "@dxos/client/echo";
|
|
912
893
|
import { useClient as useClient4 } from "@dxos/react-client";
|
|
913
|
-
import { DropdownMenu, toLocalizedString as toLocalizedString2, useTranslation as
|
|
894
|
+
import { DropdownMenu, Icon as Icon6, toLocalizedString as toLocalizedString2, useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
914
895
|
var MenuFooter = ({ object }) => {
|
|
915
|
-
var _effect =
|
|
896
|
+
var _effect = _useSignals8();
|
|
916
897
|
try {
|
|
917
|
-
const { t } =
|
|
898
|
+
const { t } = useTranslation8(SPACE_PLUGIN);
|
|
918
899
|
const client = useClient4();
|
|
919
900
|
const space = getSpace2(object);
|
|
920
901
|
const spaceName = space ? getSpaceDisplayName(space, {
|
|
921
902
|
personal: client.spaces.default === space
|
|
922
903
|
}) : "";
|
|
923
|
-
return space ? /* @__PURE__ */
|
|
904
|
+
return space ? /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(DropdownMenu.Separator, null), /* @__PURE__ */ React8.createElement(DropdownMenu.GroupLabel, null, t("menu footer label")), /* @__PURE__ */ React8.createElement("dl", {
|
|
924
905
|
className: "pis-2 mbe-2 text-xs grid grid-cols-[max-content_1fr] gap-2"
|
|
925
|
-
}, /* @__PURE__ */
|
|
906
|
+
}, /* @__PURE__ */ React8.createElement("dt", {
|
|
926
907
|
className: "uppercase text-[.75em] tracking-wide font-medium mbs-px self-start"
|
|
927
|
-
}, t("location label")), /* @__PURE__ */
|
|
908
|
+
}, t("location label")), /* @__PURE__ */ React8.createElement("dd", {
|
|
928
909
|
className: "line-clamp-3"
|
|
929
|
-
}, /* @__PURE__ */
|
|
930
|
-
|
|
910
|
+
}, /* @__PURE__ */ React8.createElement(Icon6, {
|
|
911
|
+
icon: "ph--planet--regular",
|
|
912
|
+
classNames: "inline-block mie-1"
|
|
931
913
|
}), toLocalizedString2(spaceName, t)))) : null;
|
|
932
914
|
} finally {
|
|
933
915
|
_effect.f();
|
|
@@ -935,22 +917,22 @@ var MenuFooter = ({ object }) => {
|
|
|
935
917
|
};
|
|
936
918
|
|
|
937
919
|
// src/components/ObjectSettings/ObjectSettingsContainer.tsx
|
|
938
|
-
import { useSignals as
|
|
939
|
-
import
|
|
920
|
+
import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
|
|
921
|
+
import React10, { useMemo as useMemo2 } from "react";
|
|
940
922
|
import { Surface } from "@dxos/app-framework";
|
|
941
923
|
import { Clipboard as Clipboard2 } from "@dxos/react-ui";
|
|
942
924
|
import { StackItem as StackItem2 } from "@dxos/react-ui-stack";
|
|
943
925
|
|
|
944
926
|
// src/components/ObjectSettings/BaseObjectSettings.tsx
|
|
945
|
-
import { useSignals as
|
|
946
|
-
import
|
|
947
|
-
import { Input as Input2, useTranslation as
|
|
927
|
+
import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
|
|
928
|
+
import React9, { useRef as useRef3 } from "react";
|
|
929
|
+
import { Input as Input2, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
948
930
|
var BaseObjectSettings = ({ classNames, children, object }) => {
|
|
949
|
-
var _effect =
|
|
931
|
+
var _effect = _useSignals9();
|
|
950
932
|
try {
|
|
951
|
-
const { t } =
|
|
933
|
+
const { t } = useTranslation9(meta.id);
|
|
952
934
|
const inputRef = useRef3(null);
|
|
953
|
-
return /* @__PURE__ */
|
|
935
|
+
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(Input2.Root, null, /* @__PURE__ */ React9.createElement(Input2.Label, null, t("name label")), /* @__PURE__ */ React9.createElement(Input2.TextInput, {
|
|
954
936
|
ref: inputRef,
|
|
955
937
|
placeholder: t("name placeholder"),
|
|
956
938
|
// TODO(burdon): Use annotation to get the name field.
|
|
@@ -971,24 +953,24 @@ var BaseObjectSettings = ({ classNames, children, object }) => {
|
|
|
971
953
|
|
|
972
954
|
// src/components/ObjectSettings/ObjectSettingsContainer.tsx
|
|
973
955
|
var ObjectSettingsContainer = ({ object, role }) => {
|
|
974
|
-
var _effect =
|
|
956
|
+
var _effect = _useSignals10();
|
|
975
957
|
try {
|
|
976
958
|
const data = useMemo2(() => ({
|
|
977
959
|
subject: object
|
|
978
960
|
}), [
|
|
979
961
|
object
|
|
980
962
|
]);
|
|
981
|
-
return /* @__PURE__ */
|
|
963
|
+
return /* @__PURE__ */ React10.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React10.createElement(StackItem2.Content, {
|
|
982
964
|
toolbar: false
|
|
983
|
-
}, /* @__PURE__ */
|
|
965
|
+
}, /* @__PURE__ */ React10.createElement("div", {
|
|
984
966
|
role: "none",
|
|
985
967
|
className: "overflow-y-auto pli-cardSpacingInline plb-cardSpacingBlock"
|
|
986
|
-
}, /* @__PURE__ */
|
|
968
|
+
}, /* @__PURE__ */ React10.createElement(BaseObjectSettings, {
|
|
987
969
|
object
|
|
988
|
-
}, /* @__PURE__ */
|
|
970
|
+
}, /* @__PURE__ */ React10.createElement(Surface, {
|
|
989
971
|
role: "base-object-settings",
|
|
990
972
|
data
|
|
991
|
-
})), /* @__PURE__ */
|
|
973
|
+
})), /* @__PURE__ */ React10.createElement(Surface, {
|
|
992
974
|
role: "object-settings",
|
|
993
975
|
data
|
|
994
976
|
}))));
|
|
@@ -998,16 +980,15 @@ var ObjectSettingsContainer = ({ object, role }) => {
|
|
|
998
980
|
};
|
|
999
981
|
|
|
1000
982
|
// src/components/PersistenceStatus.tsx
|
|
1001
|
-
import { useSignals as
|
|
1002
|
-
import {
|
|
1003
|
-
import React12, { useEffect as useEffect2, useState as useState4 } from "react";
|
|
983
|
+
import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
|
|
984
|
+
import React11, { useEffect as useEffect2, useState as useState4 } from "react";
|
|
1004
985
|
import { debounce } from "@dxos/async";
|
|
1005
|
-
import { Tooltip, useTranslation as
|
|
1006
|
-
import {
|
|
986
|
+
import { Icon as Icon7, Tooltip, useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
987
|
+
import { mx, staticPlaceholderText, warningText } from "@dxos/react-ui-theme";
|
|
1007
988
|
var PersistenceStatus = ({ db }) => {
|
|
1008
|
-
var _effect =
|
|
989
|
+
var _effect = _useSignals11();
|
|
1009
990
|
try {
|
|
1010
|
-
const { t } =
|
|
991
|
+
const { t } = useTranslation10(SPACE_PLUGIN);
|
|
1011
992
|
const [displayMessage, setDisplayMessage] = useState4(false);
|
|
1012
993
|
const [status, naturalSetStatus] = useState4(0);
|
|
1013
994
|
const [prevStatus, setPrevStatus] = useState4(0);
|
|
@@ -1024,32 +1005,38 @@ var PersistenceStatus = ({ db }) => {
|
|
|
1024
1005
|
]);
|
|
1025
1006
|
switch (status) {
|
|
1026
1007
|
case 2:
|
|
1027
|
-
return /* @__PURE__ */
|
|
1008
|
+
return /* @__PURE__ */ React11.createElement("div", {
|
|
1028
1009
|
className: "flex items-center"
|
|
1029
|
-
}, /* @__PURE__ */
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1010
|
+
}, /* @__PURE__ */ React11.createElement(Icon7, {
|
|
1011
|
+
icon: "ph--warning--regular",
|
|
1012
|
+
size: 4,
|
|
1013
|
+
classNames: "me-1"
|
|
1014
|
+
}), /* @__PURE__ */ React11.createElement("span", {
|
|
1015
|
+
className: mx("text-sm", warningText)
|
|
1033
1016
|
}, t("persistence error label")));
|
|
1034
1017
|
case 1:
|
|
1035
|
-
return /* @__PURE__ */
|
|
1018
|
+
return /* @__PURE__ */ React11.createElement("div", {
|
|
1036
1019
|
className: "flex items-center"
|
|
1037
|
-
}, /* @__PURE__ */
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1020
|
+
}, /* @__PURE__ */ React11.createElement(Icon7, {
|
|
1021
|
+
icon: "ph--arrows-counter-clockwise--regular",
|
|
1022
|
+
size: 4,
|
|
1023
|
+
classNames: "me-1"
|
|
1024
|
+
}), /* @__PURE__ */ React11.createElement("span", {
|
|
1025
|
+
className: mx("text-sm", staticPlaceholderText)
|
|
1041
1026
|
}, t("persistence pending label")));
|
|
1042
1027
|
case 0:
|
|
1043
1028
|
default:
|
|
1044
|
-
return /* @__PURE__ */
|
|
1029
|
+
return /* @__PURE__ */ React11.createElement(Tooltip.Trigger, {
|
|
1045
1030
|
delayDuration: 400,
|
|
1046
1031
|
role: "status",
|
|
1047
1032
|
content: t("persisted locally message"),
|
|
1048
1033
|
className: "flex items-center"
|
|
1049
|
-
}, /* @__PURE__ */
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1034
|
+
}, /* @__PURE__ */ React11.createElement(Icon7, {
|
|
1035
|
+
icon: "ph--check-circle--regular",
|
|
1036
|
+
size: 4,
|
|
1037
|
+
classNames: "me-1"
|
|
1038
|
+
}), displayMessage && /* @__PURE__ */ React11.createElement("span", {
|
|
1039
|
+
className: mx("text-sm", staticPlaceholderText)
|
|
1053
1040
|
}, t("persisted locally label")));
|
|
1054
1041
|
}
|
|
1055
1042
|
} finally {
|
|
@@ -1058,17 +1045,17 @@ var PersistenceStatus = ({ db }) => {
|
|
|
1058
1045
|
};
|
|
1059
1046
|
|
|
1060
1047
|
// src/components/PopoverRenameObject.tsx
|
|
1061
|
-
import { useSignals as
|
|
1062
|
-
import
|
|
1048
|
+
import { useSignals as _useSignals12 } from "@preact-signals/safe-react/tracking";
|
|
1049
|
+
import React12, { useCallback as useCallback7, useRef as useRef4, useState as useState5 } from "react";
|
|
1063
1050
|
import { createIntent as createIntent6, LayoutAction as LayoutAction5, useIntentDispatcher as useIntentDispatcher6 } from "@dxos/app-framework";
|
|
1064
1051
|
import { log as log2 } from "@dxos/log";
|
|
1065
|
-
import { Button as Button5, Input as Input3, useTranslation as
|
|
1052
|
+
import { Button as Button5, Input as Input3, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
1066
1053
|
var __dxlog_file3 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
|
|
1067
1054
|
var POPOVER_RENAME_OBJECT = `${SPACE_PLUGIN}/PopoverRenameObject`;
|
|
1068
1055
|
var PopoverRenameObject = ({ object: obj }) => {
|
|
1069
|
-
var _effect =
|
|
1056
|
+
var _effect = _useSignals12();
|
|
1070
1057
|
try {
|
|
1071
|
-
const { t } =
|
|
1058
|
+
const { t } = useTranslation11(SPACE_PLUGIN);
|
|
1072
1059
|
const doneButton = useRef4(null);
|
|
1073
1060
|
const object = obj;
|
|
1074
1061
|
const [name, setName] = useState5(object.name || object.title || "");
|
|
@@ -1076,10 +1063,10 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
1076
1063
|
const handleDone = useCallback7(() => {
|
|
1077
1064
|
try {
|
|
1078
1065
|
object.name = name;
|
|
1079
|
-
} catch {
|
|
1066
|
+
} catch (err) {
|
|
1080
1067
|
try {
|
|
1081
1068
|
object.title = name;
|
|
1082
|
-
} catch
|
|
1069
|
+
} catch {
|
|
1083
1070
|
log2.error("Failed to rename object", {
|
|
1084
1071
|
err
|
|
1085
1072
|
}, {
|
|
@@ -1102,21 +1089,21 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
1102
1089
|
object,
|
|
1103
1090
|
name
|
|
1104
1091
|
]);
|
|
1105
|
-
return /* @__PURE__ */
|
|
1092
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
1106
1093
|
role: "none",
|
|
1107
1094
|
className: "p-2 flex gap-2"
|
|
1108
|
-
}, /* @__PURE__ */
|
|
1095
|
+
}, /* @__PURE__ */ React12.createElement("div", {
|
|
1109
1096
|
role: "none",
|
|
1110
1097
|
className: "flex-1"
|
|
1111
|
-
}, /* @__PURE__ */
|
|
1098
|
+
}, /* @__PURE__ */ React12.createElement(Input3.Root, null, /* @__PURE__ */ React12.createElement(Input3.Label, {
|
|
1112
1099
|
srOnly: true
|
|
1113
|
-
}, t("object name label")), /* @__PURE__ */
|
|
1100
|
+
}, t("object name label")), /* @__PURE__ */ React12.createElement(Input3.TextInput, {
|
|
1114
1101
|
placeholder: t("object placeholder"),
|
|
1115
1102
|
value: name,
|
|
1116
1103
|
"data-testid": "spacePlugin.renameObject.input",
|
|
1117
1104
|
onChange: ({ target: { value } }) => setName(value),
|
|
1118
1105
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1119
|
-
}))), /* @__PURE__ */
|
|
1106
|
+
}))), /* @__PURE__ */ React12.createElement(Button5, {
|
|
1120
1107
|
ref: doneButton,
|
|
1121
1108
|
classNames: "self-stretch",
|
|
1122
1109
|
onClick: handleDone
|
|
@@ -1129,15 +1116,15 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
1129
1116
|
};
|
|
1130
1117
|
|
|
1131
1118
|
// src/components/PopoverRenameSpace.tsx
|
|
1132
|
-
import { useSignals as
|
|
1133
|
-
import
|
|
1119
|
+
import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
|
|
1120
|
+
import React13, { useCallback as useCallback8, useRef as useRef5, useState as useState6 } from "react";
|
|
1134
1121
|
import { createIntent as createIntent7, LayoutAction as LayoutAction6, useIntentDispatcher as useIntentDispatcher7 } from "@dxos/app-framework";
|
|
1135
|
-
import { Button as Button6, Input as Input4, Popover, useTranslation as
|
|
1122
|
+
import { Button as Button6, Input as Input4, Popover, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
1136
1123
|
var POPOVER_RENAME_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
|
|
1137
1124
|
var PopoverRenameSpace = ({ space }) => {
|
|
1138
|
-
var _effect =
|
|
1125
|
+
var _effect = _useSignals13();
|
|
1139
1126
|
try {
|
|
1140
|
-
const { t } =
|
|
1127
|
+
const { t } = useTranslation12(SPACE_PLUGIN);
|
|
1141
1128
|
const doneButton = useRef5(null);
|
|
1142
1129
|
const [name, setName] = useState6(space.properties.name ?? "");
|
|
1143
1130
|
const { dispatchPromise: dispatch } = useIntentDispatcher7();
|
|
@@ -1155,24 +1142,24 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
1155
1142
|
space,
|
|
1156
1143
|
name
|
|
1157
1144
|
]);
|
|
1158
|
-
return /* @__PURE__ */
|
|
1145
|
+
return /* @__PURE__ */ React13.createElement("div", {
|
|
1159
1146
|
role: "none",
|
|
1160
1147
|
className: "p-2 flex gap-2"
|
|
1161
|
-
}, /* @__PURE__ */
|
|
1148
|
+
}, /* @__PURE__ */ React13.createElement("div", {
|
|
1162
1149
|
role: "none",
|
|
1163
1150
|
className: "flex-1"
|
|
1164
|
-
}, /* @__PURE__ */
|
|
1151
|
+
}, /* @__PURE__ */ React13.createElement(Input4.Root, null, /* @__PURE__ */ React13.createElement(Input4.Label, {
|
|
1165
1152
|
srOnly: true
|
|
1166
|
-
}, t("space name label")), /* @__PURE__ */
|
|
1153
|
+
}, t("space name label")), /* @__PURE__ */ React13.createElement(Input4.TextInput, {
|
|
1167
1154
|
defaultValue: space.properties.name ?? "",
|
|
1168
1155
|
placeholder: t("unnamed space label"),
|
|
1169
1156
|
onChange: ({ target: { value } }) => setName(value),
|
|
1170
1157
|
// TODO(wittjosiah): Ideally this should access the popover context to close the popover.
|
|
1171
1158
|
// Currently this is not possible because Radix does not expose the popover context.
|
|
1172
1159
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1173
|
-
}))), /* @__PURE__ */
|
|
1160
|
+
}))), /* @__PURE__ */ React13.createElement(Popover.Close, {
|
|
1174
1161
|
asChild: true
|
|
1175
|
-
}, /* @__PURE__ */
|
|
1162
|
+
}, /* @__PURE__ */ React13.createElement(Button6, {
|
|
1176
1163
|
ref: doneButton,
|
|
1177
1164
|
classNames: "self-stretch",
|
|
1178
1165
|
onClick: handleDone
|
|
@@ -1185,9 +1172,9 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
1185
1172
|
};
|
|
1186
1173
|
|
|
1187
1174
|
// src/components/SchemaContainer.tsx
|
|
1188
|
-
import { useSignals as
|
|
1189
|
-
import
|
|
1190
|
-
import { useTranslation as
|
|
1175
|
+
import { useSignals as _useSignals14 } from "@preact-signals/safe-react/tracking";
|
|
1176
|
+
import React14, { useState as useState7, useEffect as useEffect3 } from "react";
|
|
1177
|
+
import { useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
1191
1178
|
import { controlItemClasses, ControlPage as ControlPage2, ControlSection as ControlSection2 } from "@dxos/react-ui-form";
|
|
1192
1179
|
import { StackItem as StackItem3 } from "@dxos/react-ui-stack";
|
|
1193
1180
|
var useQuerySpaceSchemas = (space) => {
|
|
@@ -1204,38 +1191,38 @@ var useQuerySpaceSchemas = (space) => {
|
|
|
1204
1191
|
return schemas;
|
|
1205
1192
|
};
|
|
1206
1193
|
var SchemaContainer = ({ space }) => {
|
|
1207
|
-
var _effect =
|
|
1194
|
+
var _effect = _useSignals14();
|
|
1208
1195
|
try {
|
|
1209
|
-
const { t } =
|
|
1196
|
+
const { t } = useTranslation13(SPACE_PLUGIN);
|
|
1210
1197
|
const schemas = useQuerySpaceSchemas(space);
|
|
1211
|
-
return /* @__PURE__ */
|
|
1198
|
+
return /* @__PURE__ */ React14.createElement(StackItem3.Content, {
|
|
1212
1199
|
classNames: "block overflow-y-auto"
|
|
1213
|
-
}, /* @__PURE__ */
|
|
1200
|
+
}, /* @__PURE__ */ React14.createElement(ControlPage2, null, /* @__PURE__ */ React14.createElement(ControlSection2, {
|
|
1214
1201
|
title: t("schema verbose label"),
|
|
1215
1202
|
description: t("schema description")
|
|
1216
|
-
}, /* @__PURE__ */
|
|
1203
|
+
}, /* @__PURE__ */ React14.createElement("div", {
|
|
1217
1204
|
role: "none",
|
|
1218
1205
|
className: controlItemClasses
|
|
1219
|
-
}, schemas.length === 0 && /* @__PURE__ */
|
|
1206
|
+
}, schemas.length === 0 && /* @__PURE__ */ React14.createElement("div", {
|
|
1220
1207
|
className: "text-center plb-4"
|
|
1221
|
-
}, t("no schemas found message")), schemas.map((schema) => /* @__PURE__ */
|
|
1208
|
+
}, t("no schemas found message")), schemas.map((schema) => /* @__PURE__ */ React14.createElement("div", {
|
|
1222
1209
|
key: schema.id
|
|
1223
|
-
}, /* @__PURE__ */
|
|
1210
|
+
}, /* @__PURE__ */ React14.createElement("div", null, schema.typename)))))));
|
|
1224
1211
|
} finally {
|
|
1225
1212
|
_effect.f();
|
|
1226
1213
|
}
|
|
1227
1214
|
};
|
|
1228
1215
|
|
|
1229
1216
|
// src/components/SpacePresence.tsx
|
|
1230
|
-
import { useSignals as
|
|
1217
|
+
import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
|
|
1231
1218
|
import { Option } from "effect";
|
|
1232
|
-
import
|
|
1219
|
+
import React15, { forwardRef, useCallback as useCallback9, useEffect as useEffect4, useState as useState8 } from "react";
|
|
1233
1220
|
import { useAppGraph as useAppGraph2, useCapability } from "@dxos/app-framework";
|
|
1234
1221
|
import { generateName } from "@dxos/display-name";
|
|
1235
1222
|
import { PublicKey, useClient as useClient5 } from "@dxos/react-client";
|
|
1236
1223
|
import { getSpace as getSpace3, useMembers, fullyQualifiedId as fullyQualifiedId3 } from "@dxos/react-client/echo";
|
|
1237
1224
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
1238
|
-
import { Avatar, Tooltip as Tooltip2, Popover as Popover2, useTranslation as
|
|
1225
|
+
import { Avatar, Tooltip as Tooltip2, Popover as Popover2, useTranslation as useTranslation14, List, ListItem, useDefaultValue } from "@dxos/react-ui";
|
|
1239
1226
|
import { AttentionGlyph, useAttended, useAttention } from "@dxos/react-ui-attention";
|
|
1240
1227
|
import { ComplexMap, keyToFallback } from "@dxos/util";
|
|
1241
1228
|
var REFRESH_INTERVAL = 5e3;
|
|
@@ -1243,7 +1230,7 @@ var ACTIVITY_DURATION = 3e4;
|
|
|
1243
1230
|
var noViewers = new ComplexMap(PublicKey.hash);
|
|
1244
1231
|
var getName = (identity) => identity.profile?.displayName ?? generateName(identity.identityKey.toHex());
|
|
1245
1232
|
var SpacePresence = ({ object, spaceKey }) => {
|
|
1246
|
-
var _effect =
|
|
1233
|
+
var _effect = _useSignals15();
|
|
1247
1234
|
try {
|
|
1248
1235
|
const spaceState = useCapability(SpaceCapabilities.MutableState);
|
|
1249
1236
|
const client = useClient5();
|
|
@@ -1273,7 +1260,7 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1273
1260
|
lastSeen
|
|
1274
1261
|
};
|
|
1275
1262
|
}).toSorted((a, b) => a.lastSeen - b.lastSeen);
|
|
1276
|
-
return /* @__PURE__ */
|
|
1263
|
+
return /* @__PURE__ */ React15.createElement(FullPresence, {
|
|
1277
1264
|
members: membersForObject
|
|
1278
1265
|
});
|
|
1279
1266
|
} finally {
|
|
@@ -1281,46 +1268,46 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1281
1268
|
}
|
|
1282
1269
|
};
|
|
1283
1270
|
var FullPresence = (props) => {
|
|
1284
|
-
var _effect =
|
|
1271
|
+
var _effect = _useSignals15();
|
|
1285
1272
|
try {
|
|
1286
1273
|
const { size = 9, onMemberClick } = props;
|
|
1287
1274
|
const members = useDefaultValue(props.members, () => []);
|
|
1288
1275
|
if (members.length === 0) {
|
|
1289
1276
|
return null;
|
|
1290
1277
|
}
|
|
1291
|
-
return /* @__PURE__ */
|
|
1278
|
+
return /* @__PURE__ */ React15.createElement("div", {
|
|
1292
1279
|
className: "dx-avatar-group",
|
|
1293
1280
|
"data-testid": "spacePlugin.presence"
|
|
1294
|
-
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */
|
|
1281
|
+
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */ React15.createElement(Tooltip2.Trigger, {
|
|
1295
1282
|
key: member.identity.identityKey.toHex(),
|
|
1296
1283
|
side: "bottom",
|
|
1297
1284
|
content: getName(member.identity),
|
|
1298
1285
|
className: "grid focus:outline-none"
|
|
1299
|
-
}, /* @__PURE__ */
|
|
1286
|
+
}, /* @__PURE__ */ React15.createElement(PresenceAvatar, {
|
|
1300
1287
|
identity: member.identity,
|
|
1301
1288
|
match: member.currentlyAttended,
|
|
1302
1289
|
index: members.length - i,
|
|
1303
1290
|
onClick: () => onMemberClick?.(member),
|
|
1304
1291
|
size
|
|
1305
|
-
}))), members.length > 3 && /* @__PURE__ */
|
|
1292
|
+
}))), members.length > 3 && /* @__PURE__ */ React15.createElement(Popover2.Root, null, /* @__PURE__ */ React15.createElement(Popover2.Trigger, {
|
|
1306
1293
|
className: "grid focus:outline-none"
|
|
1307
|
-
}, /* @__PURE__ */
|
|
1294
|
+
}, /* @__PURE__ */ React15.createElement(Avatar.Root, null, /* @__PURE__ */ React15.createElement(Avatar.Content, {
|
|
1308
1295
|
status: "inactive",
|
|
1309
1296
|
style: {
|
|
1310
1297
|
zIndex: members.length - 4
|
|
1311
1298
|
},
|
|
1312
1299
|
fallback: `+${members.length - 3}`,
|
|
1313
1300
|
size
|
|
1314
|
-
}))), /* @__PURE__ */
|
|
1301
|
+
}))), /* @__PURE__ */ React15.createElement(Popover2.Portal, null, /* @__PURE__ */ React15.createElement(Popover2.Content, {
|
|
1315
1302
|
side: "bottom"
|
|
1316
|
-
}, /* @__PURE__ */
|
|
1303
|
+
}, /* @__PURE__ */ React15.createElement(Popover2.Arrow, null), /* @__PURE__ */ React15.createElement(Popover2.Viewport, {
|
|
1317
1304
|
classNames: "max-bs-56"
|
|
1318
|
-
}, /* @__PURE__ */
|
|
1305
|
+
}, /* @__PURE__ */ React15.createElement(List, null, members.map((member) => /* @__PURE__ */ React15.createElement(ListItem.Root, {
|
|
1319
1306
|
key: member.identity.identityKey.toHex(),
|
|
1320
1307
|
classNames: "flex gap-2 items-center cursor-pointer mbe-2",
|
|
1321
1308
|
onClick: () => onMemberClick?.(member),
|
|
1322
1309
|
"data-testid": "identity-list-item"
|
|
1323
|
-
}, /* @__PURE__ */
|
|
1310
|
+
}, /* @__PURE__ */ React15.createElement(PresenceAvatar, {
|
|
1324
1311
|
identity: member.identity,
|
|
1325
1312
|
size,
|
|
1326
1313
|
showName: true,
|
|
@@ -1331,11 +1318,11 @@ var FullPresence = (props) => {
|
|
|
1331
1318
|
}
|
|
1332
1319
|
};
|
|
1333
1320
|
var PresenceAvatar = /* @__PURE__ */ forwardRef(({ identity, showName, match, index, onClick, size }, forwardedRef) => {
|
|
1334
|
-
var _effect =
|
|
1321
|
+
var _effect = _useSignals15();
|
|
1335
1322
|
try {
|
|
1336
1323
|
const status = match ? "current" : "active";
|
|
1337
1324
|
const fallbackValue = keyToFallback(identity.identityKey);
|
|
1338
|
-
return /* @__PURE__ */
|
|
1325
|
+
return /* @__PURE__ */ React15.createElement(Avatar.Root, null, /* @__PURE__ */ React15.createElement(Avatar.Content, {
|
|
1339
1326
|
status,
|
|
1340
1327
|
hue: identity.profile?.data?.hue || fallbackValue.hue,
|
|
1341
1328
|
"data-testid": "spacePlugin.presence.member",
|
|
@@ -1349,7 +1336,7 @@ var PresenceAvatar = /* @__PURE__ */ forwardRef(({ identity, showName, match, in
|
|
|
1349
1336
|
onClick,
|
|
1350
1337
|
fallback: identity.profile?.data?.emoji || fallbackValue.emoji,
|
|
1351
1338
|
ref: forwardedRef
|
|
1352
|
-
}), /* @__PURE__ */
|
|
1339
|
+
}), /* @__PURE__ */ React15.createElement(Avatar.Label, {
|
|
1353
1340
|
classNames: showName ? "text-sm truncate pli-2" : "sr-only"
|
|
1354
1341
|
}, getName(identity)));
|
|
1355
1342
|
} finally {
|
|
@@ -1357,7 +1344,7 @@ var PresenceAvatar = /* @__PURE__ */ forwardRef(({ identity, showName, match, in
|
|
|
1357
1344
|
}
|
|
1358
1345
|
});
|
|
1359
1346
|
var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
1360
|
-
var _effect =
|
|
1347
|
+
var _effect = _useSignals15();
|
|
1361
1348
|
try {
|
|
1362
1349
|
const { hasAttention, isAncestor, isRelated } = useAttention(id);
|
|
1363
1350
|
const isAttended = hasAttention || isAncestor || isRelated;
|
|
@@ -1382,7 +1369,7 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
|
1382
1369
|
}, [
|
|
1383
1370
|
viewers
|
|
1384
1371
|
]);
|
|
1385
|
-
return /* @__PURE__ */
|
|
1372
|
+
return /* @__PURE__ */ React15.createElement(SmallPresence, {
|
|
1386
1373
|
count: activeViewers.length,
|
|
1387
1374
|
attended: isAttended,
|
|
1388
1375
|
containsAttended
|
|
@@ -1392,16 +1379,16 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
|
1392
1379
|
}
|
|
1393
1380
|
};
|
|
1394
1381
|
var SmallPresence = ({ count = 0, attended, containsAttended }) => {
|
|
1395
|
-
var _effect =
|
|
1382
|
+
var _effect = _useSignals15();
|
|
1396
1383
|
try {
|
|
1397
|
-
const { t } =
|
|
1398
|
-
return /* @__PURE__ */
|
|
1384
|
+
const { t } = useTranslation14(SPACE_PLUGIN);
|
|
1385
|
+
return /* @__PURE__ */ React15.createElement(Tooltip2.Trigger, {
|
|
1399
1386
|
asChild: true,
|
|
1400
1387
|
content: t("presence label", {
|
|
1401
1388
|
count
|
|
1402
1389
|
}),
|
|
1403
1390
|
side: "bottom"
|
|
1404
|
-
}, /* @__PURE__ */
|
|
1391
|
+
}, /* @__PURE__ */ React15.createElement(AttentionGlyph, {
|
|
1405
1392
|
attended,
|
|
1406
1393
|
containsAttended,
|
|
1407
1394
|
presence: count > 1 ? "many" : count === 1 ? "one" : "none",
|
|
@@ -1413,45 +1400,45 @@ var SmallPresence = ({ count = 0, attended, containsAttended }) => {
|
|
|
1413
1400
|
};
|
|
1414
1401
|
|
|
1415
1402
|
// src/components/SpacePluginSettings.tsx
|
|
1416
|
-
import { useSignals as
|
|
1417
|
-
import
|
|
1403
|
+
import { useSignals as _useSignals16 } from "@preact-signals/safe-react/tracking";
|
|
1404
|
+
import React16 from "react";
|
|
1418
1405
|
import { createIntent as createIntent8, useIntentDispatcher as useIntentDispatcher8 } from "@dxos/app-framework";
|
|
1419
1406
|
import { useClient as useClient6 } from "@dxos/react-client";
|
|
1420
1407
|
import { useSpaces as useSpaces2 } from "@dxos/react-client/echo";
|
|
1421
|
-
import { Input as Input5, toLocalizedString as toLocalizedString3, useTranslation as
|
|
1408
|
+
import { Input as Input5, toLocalizedString as toLocalizedString3, useTranslation as useTranslation15, List as List2, ListItem as ListItem2, IconButton } from "@dxos/react-ui";
|
|
1422
1409
|
import { controlItemClasses as controlItemClasses2, ControlPage as ControlPage3, ControlSection as ControlSection3, DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
1423
1410
|
var SpacePluginSettings = ({ settings }) => {
|
|
1424
|
-
var _effect =
|
|
1411
|
+
var _effect = _useSignals16();
|
|
1425
1412
|
try {
|
|
1426
|
-
const { t } =
|
|
1413
|
+
const { t } = useTranslation15(SPACE_PLUGIN);
|
|
1427
1414
|
const client = useClient6();
|
|
1428
1415
|
const spaces = useSpaces2({
|
|
1429
1416
|
all: settings.showHidden
|
|
1430
1417
|
});
|
|
1431
1418
|
const { dispatchPromise: dispatch } = useIntentDispatcher8();
|
|
1432
|
-
return /* @__PURE__ */
|
|
1419
|
+
return /* @__PURE__ */ React16.createElement(ControlPage3, null, /* @__PURE__ */ React16.createElement(ControlSection3, {
|
|
1433
1420
|
title: t("space settings label"),
|
|
1434
1421
|
description: t("space settings description")
|
|
1435
|
-
}, /* @__PURE__ */
|
|
1422
|
+
}, /* @__PURE__ */ React16.createElement("div", {
|
|
1436
1423
|
className: "pli-trimMd container-max-width"
|
|
1437
|
-
}, /* @__PURE__ */
|
|
1424
|
+
}, /* @__PURE__ */ React16.createElement(DeprecatedFormInput, {
|
|
1438
1425
|
label: t("show hidden spaces label")
|
|
1439
|
-
}, /* @__PURE__ */
|
|
1426
|
+
}, /* @__PURE__ */ React16.createElement(Input5.Switch, {
|
|
1440
1427
|
checked: settings.showHidden,
|
|
1441
1428
|
onCheckedChange: (checked) => settings.showHidden = !!checked
|
|
1442
|
-
}))), /* @__PURE__ */
|
|
1429
|
+
}))), /* @__PURE__ */ React16.createElement(List2, {
|
|
1443
1430
|
classNames: [
|
|
1444
1431
|
controlItemClasses2,
|
|
1445
1432
|
"flex flex-col gap-trimSm"
|
|
1446
1433
|
]
|
|
1447
|
-
}, spaces.map((space) => /* @__PURE__ */
|
|
1434
|
+
}, spaces.map((space) => /* @__PURE__ */ React16.createElement(ListItem2.Root, {
|
|
1448
1435
|
key: space.id,
|
|
1449
1436
|
classNames: "is-full items-center"
|
|
1450
|
-
}, /* @__PURE__ */
|
|
1437
|
+
}, /* @__PURE__ */ React16.createElement(ListItem2.Heading, {
|
|
1451
1438
|
classNames: "grow truncate !min-bs-0"
|
|
1452
1439
|
}, toLocalizedString3(getSpaceDisplayName(space, {
|
|
1453
1440
|
personal: space === client.spaces.default
|
|
1454
|
-
}), t)), /* @__PURE__ */
|
|
1441
|
+
}), t)), /* @__PURE__ */ React16.createElement(IconButton, {
|
|
1455
1442
|
icon: "ph--faders--regular",
|
|
1456
1443
|
onClick: () => dispatch(createIntent8(SpaceAction.OpenSettings, {
|
|
1457
1444
|
space
|
|
@@ -1464,15 +1451,15 @@ var SpacePluginSettings = ({ settings }) => {
|
|
|
1464
1451
|
};
|
|
1465
1452
|
|
|
1466
1453
|
// src/components/SpaceSettings/SpaceSettingsContainer.tsx
|
|
1467
|
-
import { useSignals as
|
|
1454
|
+
import { useSignals as _useSignals17 } from "@preact-signals/safe-react/tracking";
|
|
1468
1455
|
import { pipe as pipe2, Schema } from "effect";
|
|
1469
|
-
import
|
|
1456
|
+
import React17, { useCallback as useCallback10, useMemo as useMemo3, useState as useState9 } from "react";
|
|
1470
1457
|
import { chain as chain2, createIntent as createIntent9, LayoutAction as LayoutAction7, useIntentDispatcher as useIntentDispatcher9 } from "@dxos/app-framework";
|
|
1471
1458
|
import { log as log3 } from "@dxos/log";
|
|
1472
1459
|
import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1473
1460
|
import { useClient as useClient7 } from "@dxos/react-client";
|
|
1474
1461
|
import { SpaceState as SpaceState2 } from "@dxos/react-client/echo";
|
|
1475
|
-
import { Button as Button7, Input as Input6, useMulticastObservable, useTranslation as
|
|
1462
|
+
import { Button as Button7, Input as Input6, useMulticastObservable, useTranslation as useTranslation16 } from "@dxos/react-ui";
|
|
1476
1463
|
import { Form as Form3, ControlItem, ControlItemInput as ControlItemInput2, ControlSection as ControlSection4, ControlPage as ControlPage4 } from "@dxos/react-ui-form";
|
|
1477
1464
|
import { HuePicker, IconPicker } from "@dxos/react-ui-pickers";
|
|
1478
1465
|
import { StackItem as StackItem4 } from "@dxos/react-ui-stack";
|
|
@@ -1483,9 +1470,9 @@ var FormSchema = SpaceForm.pipe(Schema.extend(Schema.Struct({
|
|
|
1483
1470
|
})
|
|
1484
1471
|
})));
|
|
1485
1472
|
var SpaceSettingsContainer = ({ space }) => {
|
|
1486
|
-
var _effect =
|
|
1473
|
+
var _effect = _useSignals17();
|
|
1487
1474
|
try {
|
|
1488
|
-
const { t } =
|
|
1475
|
+
const { t } = useTranslation16(SPACE_PLUGIN);
|
|
1489
1476
|
const { dispatchPromise: dispatch } = useIntentDispatcher9();
|
|
1490
1477
|
const client = useClient7();
|
|
1491
1478
|
const archived = useMulticastObservable(space.state) === SpaceState2.SPACE_INACTIVE;
|
|
@@ -1551,10 +1538,10 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1551
1538
|
onValueChange,
|
|
1552
1539
|
type
|
|
1553
1540
|
]);
|
|
1554
|
-
return /* @__PURE__ */
|
|
1541
|
+
return /* @__PURE__ */ React17.createElement(ControlItemInput2, {
|
|
1555
1542
|
title: label,
|
|
1556
1543
|
description: t("display name description")
|
|
1557
|
-
}, /* @__PURE__ */
|
|
1544
|
+
}, /* @__PURE__ */ React17.createElement(Input6.TextInput, {
|
|
1558
1545
|
value: getValue(),
|
|
1559
1546
|
onChange: handleChange,
|
|
1560
1547
|
placeholder: t("display name input placeholder"),
|
|
@@ -1570,10 +1557,10 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1570
1557
|
onValueChange,
|
|
1571
1558
|
type
|
|
1572
1559
|
]);
|
|
1573
|
-
return /* @__PURE__ */
|
|
1560
|
+
return /* @__PURE__ */ React17.createElement(ControlItem, {
|
|
1574
1561
|
title: label,
|
|
1575
1562
|
description: t("icon description")
|
|
1576
|
-
}, /* @__PURE__ */
|
|
1563
|
+
}, /* @__PURE__ */ React17.createElement(IconPicker, {
|
|
1577
1564
|
value: getValue(),
|
|
1578
1565
|
onChange: handleChange,
|
|
1579
1566
|
onReset: handleEmojiReset,
|
|
@@ -1590,10 +1577,10 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1590
1577
|
onValueChange,
|
|
1591
1578
|
type
|
|
1592
1579
|
]);
|
|
1593
|
-
return /* @__PURE__ */
|
|
1580
|
+
return /* @__PURE__ */ React17.createElement(ControlItem, {
|
|
1594
1581
|
title: label,
|
|
1595
1582
|
description: t("hue description")
|
|
1596
|
-
}, /* @__PURE__ */
|
|
1583
|
+
}, /* @__PURE__ */ React17.createElement(HuePicker, {
|
|
1597
1584
|
value: getValue(),
|
|
1598
1585
|
onChange: handleChange,
|
|
1599
1586
|
onReset: handleHueReset,
|
|
@@ -1605,10 +1592,10 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1605
1592
|
onValueChange,
|
|
1606
1593
|
type
|
|
1607
1594
|
]);
|
|
1608
|
-
return /* @__PURE__ */
|
|
1595
|
+
return /* @__PURE__ */ React17.createElement(ControlItemInput2, {
|
|
1609
1596
|
title: label,
|
|
1610
1597
|
description: t("edge replication description")
|
|
1611
|
-
}, /* @__PURE__ */
|
|
1598
|
+
}, /* @__PURE__ */ React17.createElement(Input6.Switch, {
|
|
1612
1599
|
checked: getValue(),
|
|
1613
1600
|
onCheckedChange: handleChange,
|
|
1614
1601
|
classNames: "justify-self-end"
|
|
@@ -1620,10 +1607,10 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1620
1607
|
type,
|
|
1621
1608
|
getValue
|
|
1622
1609
|
]);
|
|
1623
|
-
return /* @__PURE__ */
|
|
1610
|
+
return /* @__PURE__ */ React17.createElement(ControlItemInput2, {
|
|
1624
1611
|
title: label,
|
|
1625
1612
|
description: t("archive space description")
|
|
1626
|
-
}, /* @__PURE__ */
|
|
1613
|
+
}, /* @__PURE__ */ React17.createElement(Button7, {
|
|
1627
1614
|
disabled: space === client.spaces.default,
|
|
1628
1615
|
onClick: handleChange
|
|
1629
1616
|
}, getValue() ? t("unarchive space label") : t("archive space label")));
|
|
@@ -1632,16 +1619,16 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1632
1619
|
t,
|
|
1633
1620
|
space
|
|
1634
1621
|
]);
|
|
1635
|
-
return /* @__PURE__ */
|
|
1622
|
+
return /* @__PURE__ */ React17.createElement(StackItem4.Content, {
|
|
1636
1623
|
classNames: "block overflow-y-auto pli-2"
|
|
1637
|
-
}, /* @__PURE__ */
|
|
1624
|
+
}, /* @__PURE__ */ React17.createElement(ControlPage4, null, /* @__PURE__ */ React17.createElement(ControlSection4, {
|
|
1638
1625
|
title: t("space properties settings verbose label", {
|
|
1639
1626
|
ns: SPACE_PLUGIN
|
|
1640
1627
|
}),
|
|
1641
1628
|
description: t("space properties settings description", {
|
|
1642
1629
|
ns: SPACE_PLUGIN
|
|
1643
1630
|
})
|
|
1644
|
-
}, /* @__PURE__ */
|
|
1631
|
+
}, /* @__PURE__ */ React17.createElement(Form3, {
|
|
1645
1632
|
schema: FormSchema,
|
|
1646
1633
|
values,
|
|
1647
1634
|
autoSave: true,
|
|
@@ -1656,15 +1643,15 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1656
1643
|
};
|
|
1657
1644
|
|
|
1658
1645
|
// src/components/SyncStatus/InlineSyncStatus.tsx
|
|
1659
|
-
import { useSignals as
|
|
1646
|
+
import { useSignals as _useSignals18 } from "@preact-signals/safe-react/tracking";
|
|
1660
1647
|
import { Option as Option2 } from "effect";
|
|
1661
|
-
import
|
|
1648
|
+
import React18, { useEffect as useEffect5, useState as useState10 } from "react";
|
|
1662
1649
|
import { useAppGraph as useAppGraph3 } from "@dxos/app-framework";
|
|
1663
1650
|
import { EdgeStatus } from "@dxos/protocols/proto/dxos/client/services";
|
|
1664
1651
|
import { EdgeReplicationSetting as EdgeReplicationSetting2 } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1665
1652
|
import { useClient as useClient8 } from "@dxos/react-client";
|
|
1666
1653
|
import { useSpaceSyncState } from "@dxos/react-client/echo";
|
|
1667
|
-
import { Tooltip as Tooltip3, useTranslation as
|
|
1654
|
+
import { Tooltip as Tooltip3, useTranslation as useTranslation17 } from "@dxos/react-ui";
|
|
1668
1655
|
import { AttentionGlyph as AttentionGlyph2, useAttended as useAttended2, useAttention as useAttention2 } from "@dxos/react-ui-attention";
|
|
1669
1656
|
var useEdgeStatus = () => {
|
|
1670
1657
|
const [status, setStatus] = useState10(EdgeStatus.NOT_CONNECTED);
|
|
@@ -1679,9 +1666,9 @@ var useEdgeStatus = () => {
|
|
|
1679
1666
|
return status;
|
|
1680
1667
|
};
|
|
1681
1668
|
var InlineSyncStatus = ({ space, open }) => {
|
|
1682
|
-
var _effect =
|
|
1669
|
+
var _effect = _useSignals18();
|
|
1683
1670
|
try {
|
|
1684
|
-
const { t } =
|
|
1671
|
+
const { t } = useTranslation17(SPACE_PLUGIN);
|
|
1685
1672
|
const id = space.id;
|
|
1686
1673
|
const { hasAttention, isAncestor, isRelated } = useAttention2(id);
|
|
1687
1674
|
const isAttended = hasAttention || isAncestor || isRelated;
|
|
@@ -1694,11 +1681,11 @@ var InlineSyncStatus = ({ space, open }) => {
|
|
|
1694
1681
|
const edgeSyncEnabled = space.internal.data.edgeReplication === EdgeReplicationSetting2.ENABLED;
|
|
1695
1682
|
const syncState = useSpaceSyncState(space);
|
|
1696
1683
|
const syncing = connectedToEdge && edgeSyncEnabled && syncState && syncState.missingOnLocal > 0;
|
|
1697
|
-
return /* @__PURE__ */
|
|
1684
|
+
return /* @__PURE__ */ React18.createElement(Tooltip3.Trigger, {
|
|
1698
1685
|
asChild: true,
|
|
1699
1686
|
content: t("syncing label"),
|
|
1700
1687
|
side: "bottom"
|
|
1701
|
-
}, /* @__PURE__ */
|
|
1688
|
+
}, /* @__PURE__ */ React18.createElement(AttentionGlyph2, {
|
|
1702
1689
|
syncing,
|
|
1703
1690
|
attended: isAttended,
|
|
1704
1691
|
containsAttended,
|
|
@@ -1710,12 +1697,12 @@ var InlineSyncStatus = ({ space, open }) => {
|
|
|
1710
1697
|
};
|
|
1711
1698
|
|
|
1712
1699
|
// src/components/SyncStatus/SyncStatus.tsx
|
|
1713
|
-
import { useSignals as
|
|
1714
|
-
import
|
|
1700
|
+
import { useSignals as _useSignals19 } from "@preact-signals/safe-react/tracking";
|
|
1701
|
+
import React19, { useEffect as useEffect6, useState as useState11 } from "react";
|
|
1715
1702
|
import { StatusBar } from "@dxos/plugin-status-bar";
|
|
1716
1703
|
import { useClient as useClient9 } from "@dxos/react-client";
|
|
1717
1704
|
import { getSyncSummary, useSyncState } from "@dxos/react-client/echo";
|
|
1718
|
-
import { Icon as
|
|
1705
|
+
import { Icon as Icon8, useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
1719
1706
|
|
|
1720
1707
|
// src/components/SyncStatus/save-tracker.ts
|
|
1721
1708
|
import { Context } from "@dxos/context";
|
|
@@ -1811,7 +1798,7 @@ var getIcon = (status) => {
|
|
|
1811
1798
|
// src/components/SyncStatus/SyncStatus.tsx
|
|
1812
1799
|
var SYNC_STALLED_TIMEOUT = 5e3;
|
|
1813
1800
|
var SyncStatus = () => {
|
|
1814
|
-
var _effect =
|
|
1801
|
+
var _effect = _useSignals19();
|
|
1815
1802
|
try {
|
|
1816
1803
|
const client = useClient9();
|
|
1817
1804
|
const state = useSyncState();
|
|
@@ -1821,7 +1808,7 @@ var SyncStatus = () => {
|
|
|
1821
1808
|
setSaved(state2 === "saved");
|
|
1822
1809
|
});
|
|
1823
1810
|
}, []);
|
|
1824
|
-
return /* @__PURE__ */
|
|
1811
|
+
return /* @__PURE__ */ React19.createElement(SyncStatusIndicator, {
|
|
1825
1812
|
state,
|
|
1826
1813
|
saved
|
|
1827
1814
|
});
|
|
@@ -1830,9 +1817,9 @@ var SyncStatus = () => {
|
|
|
1830
1817
|
}
|
|
1831
1818
|
};
|
|
1832
1819
|
var SyncStatusIndicator = ({ state, saved }) => {
|
|
1833
|
-
var _effect =
|
|
1820
|
+
var _effect = _useSignals19();
|
|
1834
1821
|
try {
|
|
1835
|
-
const { t } =
|
|
1822
|
+
const { t } = useTranslation18(SPACE_PLUGIN);
|
|
1836
1823
|
const summary = getSyncSummary(state);
|
|
1837
1824
|
const offline = Object.values(state).length === 0;
|
|
1838
1825
|
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
@@ -1859,12 +1846,12 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1859
1846
|
needsToDownload
|
|
1860
1847
|
]);
|
|
1861
1848
|
const title = t(`${status} label`);
|
|
1862
|
-
const icon = /* @__PURE__ */
|
|
1849
|
+
const icon = /* @__PURE__ */ React19.createElement(Icon8, {
|
|
1863
1850
|
icon: getIcon(status),
|
|
1864
1851
|
size: 4,
|
|
1865
1852
|
classNames
|
|
1866
1853
|
});
|
|
1867
|
-
return /* @__PURE__ */
|
|
1854
|
+
return /* @__PURE__ */ React19.createElement(StatusBar.Item, {
|
|
1868
1855
|
title
|
|
1869
1856
|
}, icon);
|
|
1870
1857
|
} finally {
|
|
@@ -1872,13 +1859,92 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1872
1859
|
}
|
|
1873
1860
|
};
|
|
1874
1861
|
|
|
1862
|
+
// src/components/ViewEditor.tsx
|
|
1863
|
+
import { useSignals as _useSignals20 } from "@preact-signals/safe-react/tracking";
|
|
1864
|
+
import React20, { useCallback as useCallback11, useMemo as useMemo4 } from "react";
|
|
1865
|
+
import { createIntent as createIntent10, useIntentDispatcher as useIntentDispatcher10 } from "@dxos/app-framework";
|
|
1866
|
+
import { Type as Type3 } from "@dxos/echo";
|
|
1867
|
+
import { invariant as invariant2 } from "@dxos/invariant";
|
|
1868
|
+
import { useClient as useClient10 } from "@dxos/react-client";
|
|
1869
|
+
import { Filter as Filter2, getSpace as getSpace4, useQuery as useQuery3, useSchema } from "@dxos/react-client/echo";
|
|
1870
|
+
import { ViewEditor as NativeViewEditor } from "@dxos/react-ui-form";
|
|
1871
|
+
import { DataType as DataType3 } from "@dxos/schema";
|
|
1872
|
+
var __dxlog_file6 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/ViewEditor.tsx";
|
|
1873
|
+
var ViewEditor = ({ view }) => {
|
|
1874
|
+
var _effect = _useSignals20();
|
|
1875
|
+
try {
|
|
1876
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher10();
|
|
1877
|
+
const client = useClient10();
|
|
1878
|
+
const space = getSpace4(view);
|
|
1879
|
+
const schema = useSchema(client, space, view.query.typename);
|
|
1880
|
+
const views = useQuery3(space, Filter2.type(DataType3.View));
|
|
1881
|
+
const currentTypename = useMemo4(() => view.query?.typename, [
|
|
1882
|
+
view.query?.typename
|
|
1883
|
+
]);
|
|
1884
|
+
const handleUpdateTypename = useCallback11((typename) => {
|
|
1885
|
+
invariant2(schema, void 0, {
|
|
1886
|
+
F: __dxlog_file6,
|
|
1887
|
+
L: 30,
|
|
1888
|
+
S: void 0,
|
|
1889
|
+
A: [
|
|
1890
|
+
"schema",
|
|
1891
|
+
""
|
|
1892
|
+
]
|
|
1893
|
+
});
|
|
1894
|
+
invariant2(Type3.isMutable(schema), void 0, {
|
|
1895
|
+
F: __dxlog_file6,
|
|
1896
|
+
L: 31,
|
|
1897
|
+
S: void 0,
|
|
1898
|
+
A: [
|
|
1899
|
+
"Type.isMutable(schema)",
|
|
1900
|
+
""
|
|
1901
|
+
]
|
|
1902
|
+
});
|
|
1903
|
+
const matchingViews = views.filter((view2) => view2.query.typename === currentTypename);
|
|
1904
|
+
for (const view2 of matchingViews) {
|
|
1905
|
+
view2.query.typename = typename;
|
|
1906
|
+
}
|
|
1907
|
+
schema.updateTypename(typename);
|
|
1908
|
+
}, [
|
|
1909
|
+
views,
|
|
1910
|
+
schema
|
|
1911
|
+
]);
|
|
1912
|
+
const handleDelete = useCallback11((fieldId) => {
|
|
1913
|
+
void dispatch(createIntent10(SpaceAction.DeleteField, {
|
|
1914
|
+
view,
|
|
1915
|
+
fieldId
|
|
1916
|
+
}));
|
|
1917
|
+
}, [
|
|
1918
|
+
dispatch,
|
|
1919
|
+
view
|
|
1920
|
+
]);
|
|
1921
|
+
if (!space || !schema) {
|
|
1922
|
+
return null;
|
|
1923
|
+
}
|
|
1924
|
+
return /* @__PURE__ */ React20.createElement(NativeViewEditor, {
|
|
1925
|
+
registry: space.db.schemaRegistry,
|
|
1926
|
+
schema,
|
|
1927
|
+
view,
|
|
1928
|
+
onTypenameChanged: Type3.isMutable(schema) ? handleUpdateTypename : void 0,
|
|
1929
|
+
onDelete: Type3.isMutable(schema) ? handleDelete : void 0,
|
|
1930
|
+
outerSpacing: false
|
|
1931
|
+
});
|
|
1932
|
+
} finally {
|
|
1933
|
+
_effect.f();
|
|
1934
|
+
}
|
|
1935
|
+
};
|
|
1936
|
+
|
|
1937
|
+
// src/components/index.ts
|
|
1938
|
+
import { lazy as lazy2 } from "react";
|
|
1939
|
+
var CollectionMain = lazy2(() => import("./CollectionMain-ZJIFCWKZ.mjs"));
|
|
1940
|
+
var ObjectDetailsPanel = lazy2(() => import("./ObjectDetailsPanel-QKZEDSZK.mjs"));
|
|
1941
|
+
|
|
1875
1942
|
export {
|
|
1876
1943
|
AwaitingObject,
|
|
1877
1944
|
CREATE_OBJECT_DIALOG,
|
|
1878
1945
|
CreateObjectDialog,
|
|
1879
1946
|
CREATE_SPACE_DIALOG,
|
|
1880
1947
|
CreateSpaceDialog,
|
|
1881
|
-
CollectionMain,
|
|
1882
1948
|
CollectionSection,
|
|
1883
1949
|
JOIN_DIALOG,
|
|
1884
1950
|
JoinDialog,
|
|
@@ -1901,6 +1967,9 @@ export {
|
|
|
1901
1967
|
InlineSyncStatus,
|
|
1902
1968
|
SyncStatus,
|
|
1903
1969
|
SyncStatusIndicator,
|
|
1970
|
+
ViewEditor,
|
|
1971
|
+
CollectionMain,
|
|
1972
|
+
ObjectDetailsPanel,
|
|
1904
1973
|
AppGraphBuilder,
|
|
1905
1974
|
AppGraphSerializer,
|
|
1906
1975
|
IdentityCreated,
|
|
@@ -1913,4 +1982,4 @@ export {
|
|
|
1913
1982
|
SpaceState,
|
|
1914
1983
|
SpacesReady
|
|
1915
1984
|
};
|
|
1916
|
-
//# sourceMappingURL=chunk-
|
|
1985
|
+
//# sourceMappingURL=chunk-6X5DLJM5.mjs.map
|