@dxos/plugin-space 0.8.3 → 0.8.4-main.2e9d522
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-M2RH72VL.mjs → app-graph-builder-7CZZJS3S.mjs} +143 -27
- package/dist/lib/browser/app-graph-builder-7CZZJS3S.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-F7ISRRBV.mjs → app-graph-serializer-H6AW7KGS.mjs} +13 -13
- package/dist/lib/browser/app-graph-serializer-H6AW7KGS.mjs.map +7 -0
- package/dist/lib/browser/{chunk-BXNL6SDI.mjs → chunk-CEFHNVU7.mjs} +4 -3
- package/dist/lib/browser/chunk-CEFHNVU7.mjs.map +7 -0
- package/dist/lib/browser/{chunk-PTKYMZWO.mjs → chunk-FBCGT5YY.mjs} +2 -2
- package/dist/lib/browser/{chunk-YMCZR6EZ.mjs → chunk-JS3MMC42.mjs} +4 -3
- package/dist/lib/browser/{chunk-YMCZR6EZ.mjs.map → chunk-JS3MMC42.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-4ZKSFDXM.mjs → chunk-QACNNDOT.mjs} +73 -12
- package/dist/lib/browser/chunk-QACNNDOT.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TW7O2EPP.mjs → chunk-SGTQ52SU.mjs} +59 -5
- package/dist/lib/browser/chunk-SGTQ52SU.mjs.map +7 -0
- package/dist/lib/browser/{chunk-NFUKCRGE.mjs → chunk-V7MJSSBQ.mjs} +392 -324
- package/dist/lib/browser/chunk-V7MJSSBQ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-7Y4M7GXO.mjs → chunk-VLBRSGJ2.mjs} +4 -4
- package/dist/lib/browser/{chunk-V24VASAJ.mjs → chunk-XUYKJUU7.mjs} +128 -25
- package/dist/lib/browser/chunk-XUYKJUU7.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-PI7TKANR.mjs → identity-created-23XJJV2N.mjs} +4 -4
- package/dist/lib/browser/identity-created-23XJJV2N.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +105 -16
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-RWU6ZE4H.mjs → intent-resolver-TIXVDYN7.mjs} +171 -21
- 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-QIKHSNT2.mjs → react-root-N2J7TDRX.mjs} +8 -8
- package/dist/lib/browser/{react-surface-W56UD53I.mjs → react-surface-TPNLWJJH.mjs} +42 -21
- package/dist/lib/browser/react-surface-TPNLWJJH.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-WREJNMIC.mjs → schema-defs-Z6FC4AHC.mjs} +4 -4
- package/dist/lib/browser/{schema-tools-ILTVSSS3.mjs → schema-tools-BNP4JTD7.mjs} +3 -3
- package/dist/lib/browser/{settings-K54STC5A.mjs → settings-4IMP5RYT.mjs} +4 -4
- package/dist/lib/browser/{spaces-ready-3PDRDHPC.mjs → spaces-ready-TOPG6IV4.mjs} +7 -7
- package/dist/lib/browser/{state-HRZ4VRXU.mjs → state-QYZAB45H.mjs} +4 -4
- package/dist/lib/browser/types/index.mjs +2 -2
- 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-BCHVZ4OM.mjs → app-graph-builder-KGIGWC72.mjs} +143 -27
- package/dist/lib/node-esm/app-graph-builder-KGIGWC72.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-TXRGGNP2.mjs → app-graph-serializer-2ICUGQQT.mjs} +13 -13
- package/dist/lib/node-esm/app-graph-serializer-2ICUGQQT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HO7AIKQS.mjs → chunk-4AOMYKDE.mjs} +128 -25
- package/dist/lib/node-esm/chunk-4AOMYKDE.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3CP67AYY.mjs → chunk-5HHYE264.mjs} +4 -3
- package/dist/lib/node-esm/{chunk-3CP67AYY.mjs.map → chunk-5HHYE264.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-BSLREHIX.mjs → chunk-5T3ZH23B.mjs} +4 -3
- package/dist/lib/node-esm/chunk-5T3ZH23B.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-LA6AVVH6.mjs → chunk-6X5DLJM5.mjs} +392 -324
- package/dist/lib/node-esm/chunk-6X5DLJM5.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-MSWEFAPD.mjs → chunk-HWNG4MEU.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-D4QMPPS7.mjs → chunk-JH6F4C3I.mjs} +59 -5
- package/dist/lib/node-esm/chunk-JH6F4C3I.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JBQKU4K5.mjs → chunk-P442DOQ3.mjs} +73 -12
- package/dist/lib/node-esm/chunk-P442DOQ3.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GH2FGJXH.mjs → chunk-SSLBYZEY.mjs} +4 -4
- package/dist/lib/node-esm/{identity-created-35CTAQWI.mjs → identity-created-IJQO6GCR.mjs} +4 -4
- package/dist/lib/node-esm/identity-created-IJQO6GCR.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +105 -16
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-JO6L2VXC.mjs → intent-resolver-MHGHRGDT.mjs} +171 -21
- 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-YFGL3B4J.mjs → react-root-KW3TGJGY.mjs} +8 -8
- package/dist/lib/node-esm/{react-surface-CVAPDLEZ.mjs → react-surface-UUIUUD6P.mjs} +42 -21
- package/dist/lib/node-esm/react-surface-UUIUUD6P.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-4MEJETVX.mjs → schema-defs-WHJM7UZE.mjs} +4 -4
- package/dist/lib/node-esm/{schema-tools-SRLCRZ3B.mjs → schema-tools-KWW5PTML.mjs} +3 -3
- package/dist/lib/node-esm/{settings-TD76LTQS.mjs → settings-SAOBPND3.mjs} +4 -4
- package/dist/lib/node-esm/{spaces-ready-FJMGPAVV.mjs → spaces-ready-HIUKNDZK.mjs} +7 -7
- package/dist/lib/node-esm/{state-XQNDCN37.mjs → state-ZVEHQ4BJ.mjs} +4 -4
- package/dist/lib/node-esm/types/index.mjs +2 -2
- 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/app-graph-serializer.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/identity-created.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/CreateDialog/CreateObjectDialog.stories.d.ts +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.stories.d.ts +1 -1
- package/dist/types/src/components/MembersContainer.stories.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/SpacePresence.stories.d.ts +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +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 +212 -410
- 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 +50 -52
- package/src/SpacePlugin.ts +90 -7
- package/src/capabilities/app-graph-builder.ts +166 -7
- package/src/capabilities/app-graph-serializer.ts +6 -6
- package/src/capabilities/capabilities.ts +8 -3
- package/src/capabilities/identity-created.ts +2 -4
- package/src/capabilities/intent-resolver.ts +117 -8
- package/src/capabilities/react-surface.tsx +50 -13
- package/src/components/AwaitingObject.tsx +4 -6
- package/src/components/CollectionMain.tsx +2 -0
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +4 -4
- package/src/components/CreateDialog/CreateObjectDialog.tsx +29 -25
- package/src/components/MembersContainer.stories.tsx +4 -4
- package/src/components/MembersContainer.tsx +6 -5
- 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/SpacePresence.stories.tsx +2 -2
- package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +2 -2
- package/src/components/SyncStatus/SyncStatus.stories.tsx +8 -15
- package/src/components/SyncStatus/SyncStatus.tsx +1 -1
- package/src/components/SyncStatus/save-tracker.ts +3 -3
- 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 +71 -7
- package/src/types/types.ts +56 -3
- package/src/util.tsx +116 -21
- package/dist/lib/browser/app-graph-builder-M2RH72VL.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-F7ISRRBV.mjs.map +0 -7
- package/dist/lib/browser/chunk-4ZKSFDXM.mjs.map +0 -7
- package/dist/lib/browser/chunk-BXNL6SDI.mjs.map +0 -7
- package/dist/lib/browser/chunk-NFUKCRGE.mjs.map +0 -7
- package/dist/lib/browser/chunk-TW7O2EPP.mjs.map +0 -7
- package/dist/lib/browser/chunk-V24VASAJ.mjs.map +0 -7
- package/dist/lib/browser/identity-created-PI7TKANR.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-RWU6ZE4H.mjs.map +0 -7
- package/dist/lib/browser/react-surface-W56UD53I.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-6LK5HLLE.cjs +0 -364
- package/dist/lib/node/app-graph-builder-6LK5HLLE.cjs.map +0 -7
- package/dist/lib/node/app-graph-serializer-HKHBNHA3.cjs +0 -89
- package/dist/lib/node/app-graph-serializer-HKHBNHA3.cjs.map +0 -7
- package/dist/lib/node/chunk-3X4EA4XL.cjs +0 -37
- package/dist/lib/node/chunk-3X4EA4XL.cjs.map +0 -7
- package/dist/lib/node/chunk-5WLAXYE3.cjs +0 -125
- package/dist/lib/node/chunk-5WLAXYE3.cjs.map +0 -7
- package/dist/lib/node/chunk-6P2DB4QQ.cjs +0 -36
- package/dist/lib/node/chunk-6P2DB4QQ.cjs.map +0 -7
- package/dist/lib/node/chunk-DOC5XEZ4.cjs +0 -184
- package/dist/lib/node/chunk-DOC5XEZ4.cjs.map +0 -7
- package/dist/lib/node/chunk-NCHF433F.cjs +0 -1921
- package/dist/lib/node/chunk-NCHF433F.cjs.map +0 -7
- package/dist/lib/node/chunk-NL5Y4EDX.cjs +0 -38
- package/dist/lib/node/chunk-NL5Y4EDX.cjs.map +0 -7
- package/dist/lib/node/chunk-ULJZPATP.cjs +0 -312
- package/dist/lib/node/chunk-ULJZPATP.cjs.map +0 -7
- package/dist/lib/node/chunk-XHWVT7LW.cjs +0 -572
- package/dist/lib/node/chunk-XHWVT7LW.cjs.map +0 -7
- package/dist/lib/node/identity-created-FF4WZ2WY.cjs +0 -42
- package/dist/lib/node/identity-created-FF4WZ2WY.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -278
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-AV4CMM3Z.cjs +0 -609
- package/dist/lib/node/intent-resolver-AV4CMM3Z.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/react-root-RQUU3A45.cjs +0 -51
- package/dist/lib/node/react-root-RQUU3A45.cjs.map +0 -7
- package/dist/lib/node/react-surface-AZFJLE72.cjs +0 -351
- package/dist/lib/node/react-surface-AZFJLE72.cjs.map +0 -7
- package/dist/lib/node/schema-defs-OB2X2HBH.cjs +0 -42
- package/dist/lib/node/schema-defs-OB2X2HBH.cjs.map +0 -7
- package/dist/lib/node/schema-tools-IYREN4IH.cjs +0 -147
- package/dist/lib/node/schema-tools-IYREN4IH.cjs.map +0 -7
- package/dist/lib/node/settings-P2EQ7VKQ.cjs +0 -38
- package/dist/lib/node/settings-P2EQ7VKQ.cjs.map +0 -7
- package/dist/lib/node/spaces-ready-DXPOHYV7.cjs +0 -210
- package/dist/lib/node/spaces-ready-DXPOHYV7.cjs.map +0 -7
- package/dist/lib/node/state-M35DK75Z.cjs +0 -61
- package/dist/lib/node/state-M35DK75Z.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs +0 -48
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-BCHVZ4OM.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-TXRGGNP2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BSLREHIX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-D4QMPPS7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HO7AIKQS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JBQKU4K5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LA6AVVH6.mjs.map +0 -7
- package/dist/lib/node-esm/identity-created-35CTAQWI.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-JO6L2VXC.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-CVAPDLEZ.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-PTKYMZWO.mjs.map → chunk-FBCGT5YY.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-7Y4M7GXO.mjs.map → chunk-VLBRSGJ2.mjs.map} +0 -0
- /package/dist/lib/browser/{react-root-QIKHSNT2.mjs.map → react-root-N2J7TDRX.mjs.map} +0 -0
- /package/dist/lib/browser/{schema-defs-WREJNMIC.mjs.map → schema-defs-Z6FC4AHC.mjs.map} +0 -0
- /package/dist/lib/browser/{schema-tools-ILTVSSS3.mjs.map → schema-tools-BNP4JTD7.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-K54STC5A.mjs.map → settings-4IMP5RYT.mjs.map} +0 -0
- /package/dist/lib/browser/{spaces-ready-3PDRDHPC.mjs.map → spaces-ready-TOPG6IV4.mjs.map} +0 -0
- /package/dist/lib/browser/{state-HRZ4VRXU.mjs.map → state-QYZAB45H.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-MSWEFAPD.mjs.map → chunk-HWNG4MEU.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-GH2FGJXH.mjs.map → chunk-SSLBYZEY.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-root-YFGL3B4J.mjs.map → react-root-KW3TGJGY.mjs.map} +0 -0
- /package/dist/lib/node-esm/{schema-defs-4MEJETVX.mjs.map → schema-defs-WHJM7UZE.mjs.map} +0 -0
- /package/dist/lib/node-esm/{schema-tools-SRLCRZ3B.mjs.map → schema-tools-KWW5PTML.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-TD76LTQS.mjs.map → settings-SAOBPND3.mjs.map} +0 -0
- /package/dist/lib/node-esm/{spaces-ready-FJMGPAVV.mjs.map → spaces-ready-HIUKNDZK.mjs.map} +0 -0
- /package/dist/lib/node-esm/{state-XQNDCN37.mjs.map → state-ZVEHQ4BJ.mjs.map} +0 -0
|
@@ -2,32 +2,30 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import {
|
|
3
3
|
useInputSurfaceLookup,
|
|
4
4
|
usePath
|
|
5
|
-
} from "./chunk-
|
|
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
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-HWNG4MEU.mjs";
|
|
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
|
|
@@ -118,26 +120,26 @@ var AwaitingObject = ({ id }) => {
|
|
|
118
120
|
}
|
|
119
121
|
};
|
|
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";
|
|
134
136
|
|
|
135
|
-
//
|
|
137
|
+
// src/components/CreateDialog/CreateObjectPanel.tsx
|
|
136
138
|
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", {
|
|
@@ -287,24 +289,24 @@ var SelectSchema = ({ options, resolve, onChange }) => {
|
|
|
287
289
|
}
|
|
288
290
|
};
|
|
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 IdentityCreated = lazy(() => import("./identity-created-
|
|
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-
|
|
299
|
-
var SchemaTools = lazy(() => import("./schema-tools-
|
|
300
|
-
var SpaceSettings = lazy(() => import("./settings-
|
|
301
|
-
var SpaceState = lazy(() => import("./state-
|
|
302
|
-
var SpacesReady = lazy(() => import("./spaces-ready-
|
|
294
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-KGIGWC72.mjs"));
|
|
295
|
+
var AppGraphSerializer = lazy(() => import("./app-graph-serializer-2ICUGQQT.mjs"));
|
|
296
|
+
var IdentityCreated = lazy(() => import("./identity-created-IJQO6GCR.mjs"));
|
|
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"));
|
|
301
|
+
var SchemaTools = lazy(() => import("./schema-tools-KWW5PTML.mjs"));
|
|
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
|
-
//
|
|
305
|
-
var __dxlog_file = "/
|
|
306
|
+
// src/components/CreateDialog/CreateObjectDialog.tsx
|
|
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, {
|
|
@@ -405,12 +407,12 @@ var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, na
|
|
|
405
407
|
}
|
|
406
408
|
};
|
|
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
|
-
//
|
|
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
|
-
// packages/plugins/plugin-space/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 {
|
|
@@ -518,23 +498,23 @@ var CollectionSection = ({ collection }) => {
|
|
|
518
498
|
}
|
|
519
499
|
};
|
|
520
500
|
|
|
521
|
-
//
|
|
522
|
-
import { useSignals as
|
|
523
|
-
import
|
|
501
|
+
// src/components/JoinDialog.tsx
|
|
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
|
|
@@ -634,25 +614,22 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
634
614
|
}
|
|
635
615
|
};
|
|
636
616
|
|
|
637
|
-
//
|
|
638
|
-
import { useSignals as
|
|
639
|
-
import {
|
|
640
|
-
import React8, { useCallback as useCallback6, useMemo, useState as useState3 } from "react";
|
|
617
|
+
// src/components/MembersContainer.tsx
|
|
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
|
-
import { Type as Type3 } from "@dxos/echo";
|
|
644
622
|
import { log } from "@dxos/log";
|
|
645
623
|
import { useConfig } from "@dxos/react-client";
|
|
646
624
|
import { fullyQualifiedId as fullyQualifiedId2, useSpaceInvitations } from "@dxos/react-client/echo";
|
|
647
625
|
import { Invitation, InvitationEncoder } from "@dxos/react-client/invitations";
|
|
648
|
-
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";
|
|
649
627
|
import { ControlPage, ControlSection, ControlFrame, ControlFrameItem, ControlItemInput } from "@dxos/react-ui-form";
|
|
650
628
|
import { StackItem } from "@dxos/react-ui-stack";
|
|
651
|
-
import { getSize as getSize2, mx as mx3 } from "@dxos/react-ui-theme";
|
|
652
629
|
import { DataType as DataType2 } from "@dxos/schema";
|
|
653
630
|
import { AuthCode, BifurcatedAction, Centered, Emoji, InvitationList, SpaceMemberList, Viewport } from "@dxos/shell/react";
|
|
654
631
|
import { hexToEmoji } from "@dxos/util";
|
|
655
|
-
var __dxlog_file2 = "/
|
|
632
|
+
var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/MembersContainer.tsx";
|
|
656
633
|
var activeActionKey = "dxos:react-shell/space-manager/active-action";
|
|
657
634
|
var handleInvitationEvent = (invitation, subscription) => {
|
|
658
635
|
const invitationCode = InvitationEncoder.encode(invitation);
|
|
@@ -662,7 +639,7 @@ var handleInvitationEvent = (invitation, subscription) => {
|
|
|
662
639
|
authCode: invitation.authCode
|
|
663
640
|
}), void 0, {
|
|
664
641
|
F: __dxlog_file2,
|
|
665
|
-
L:
|
|
642
|
+
L: 39,
|
|
666
643
|
S: void 0,
|
|
667
644
|
C: (f, a) => f(...a)
|
|
668
645
|
});
|
|
@@ -670,9 +647,9 @@ var handleInvitationEvent = (invitation, subscription) => {
|
|
|
670
647
|
}
|
|
671
648
|
};
|
|
672
649
|
var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
673
|
-
var _effect =
|
|
650
|
+
var _effect = _useSignals7();
|
|
674
651
|
try {
|
|
675
|
-
const { t } =
|
|
652
|
+
const { t } = useTranslation7(SPACE_PLUGIN);
|
|
676
653
|
const config = useConfig();
|
|
677
654
|
const { dispatchPromise: dispatch } = useIntentDispatcher5();
|
|
678
655
|
const invitations = useSpaceInvitations(space.key);
|
|
@@ -684,7 +661,7 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
684
661
|
setInternalActiveAction(nextAction);
|
|
685
662
|
localStorage.setItem(activeActionKey, nextAction);
|
|
686
663
|
};
|
|
687
|
-
const target = space.properties[
|
|
664
|
+
const target = space.properties[DataType2.Collection.typename]?.target?.objects[0]?.target;
|
|
688
665
|
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
689
666
|
const handleChangeLocked = useCallback6(() => {
|
|
690
667
|
space.properties[COMPOSER_SPACE_LOCK] = !locked;
|
|
@@ -700,7 +677,7 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
700
677
|
description: t("invite one description", {
|
|
701
678
|
ns: "os"
|
|
702
679
|
}),
|
|
703
|
-
icon: () => /* @__PURE__ */
|
|
680
|
+
icon: () => /* @__PURE__ */ React7.createElement(Icon5, {
|
|
704
681
|
icon: "ph--user-plus--regular",
|
|
705
682
|
size: 5
|
|
706
683
|
}),
|
|
@@ -725,7 +702,7 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
725
702
|
description: t("invite many description", {
|
|
726
703
|
ns: "os"
|
|
727
704
|
}),
|
|
728
|
-
icon: () => /* @__PURE__ */
|
|
705
|
+
icon: () => /* @__PURE__ */ React7.createElement(Icon5, {
|
|
729
706
|
icon: "ph--users-three--regular",
|
|
730
707
|
size: 5
|
|
731
708
|
}),
|
|
@@ -755,44 +732,44 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
755
732
|
const handleBack = () => {
|
|
756
733
|
setSelectedInvitation(null);
|
|
757
734
|
};
|
|
758
|
-
return /* @__PURE__ */
|
|
735
|
+
return /* @__PURE__ */ React7.createElement(Clipboard.Provider, null, /* @__PURE__ */ React7.createElement(StackItem.Content, {
|
|
759
736
|
classNames: "block overflow-y-auto"
|
|
760
|
-
}, /* @__PURE__ */
|
|
737
|
+
}, /* @__PURE__ */ React7.createElement(ControlPage, null, /* @__PURE__ */ React7.createElement(ControlSection, {
|
|
761
738
|
title: t("members verbose label"),
|
|
762
739
|
description: t("members description")
|
|
763
|
-
}, /* @__PURE__ */
|
|
740
|
+
}, /* @__PURE__ */ React7.createElement(ControlFrame, null, /* @__PURE__ */ React7.createElement(ControlFrameItem, {
|
|
764
741
|
title: t("members label")
|
|
765
|
-
}, /* @__PURE__ */
|
|
742
|
+
}, /* @__PURE__ */ React7.createElement(SpaceMemberList, {
|
|
766
743
|
spaceKey: space.key,
|
|
767
744
|
includeSelf: true
|
|
768
|
-
})), locked && /* @__PURE__ */
|
|
745
|
+
})), locked && /* @__PURE__ */ React7.createElement(ControlFrameItem, {
|
|
769
746
|
title: t("invitations label")
|
|
770
|
-
}, /* @__PURE__ */
|
|
747
|
+
}, /* @__PURE__ */ React7.createElement("p", {
|
|
771
748
|
className: "text-description mbe-2"
|
|
772
|
-
}, t("locked space description"))), !locked && /* @__PURE__ */
|
|
749
|
+
}, t("locked space description"))), !locked && /* @__PURE__ */ React7.createElement(ControlFrameItem, {
|
|
773
750
|
title: t("invitations label")
|
|
774
|
-
}, selectedInvitation && /* @__PURE__ */
|
|
751
|
+
}, selectedInvitation && /* @__PURE__ */ React7.createElement(InvitationSection, {
|
|
775
752
|
...selectedInvitation,
|
|
776
753
|
onBack: handleBack
|
|
777
|
-
}), !selectedInvitation && /* @__PURE__ */
|
|
754
|
+
}), !selectedInvitation && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("p", {
|
|
778
755
|
className: "text-description mbe-2"
|
|
779
|
-
}, t("space invitation description")), /* @__PURE__ */
|
|
756
|
+
}, t("space invitation description")), /* @__PURE__ */ React7.createElement(InvitationList, {
|
|
780
757
|
className: "mb-2",
|
|
781
758
|
send: handleSend,
|
|
782
759
|
invitations: visibleInvitations ?? [],
|
|
783
760
|
onClickRemove: (invitation) => invitation.cancel(),
|
|
784
761
|
createInvitationUrl
|
|
785
|
-
}), /* @__PURE__ */
|
|
762
|
+
}), /* @__PURE__ */ React7.createElement(BifurcatedAction, {
|
|
786
763
|
actions: inviteActions,
|
|
787
764
|
activeAction,
|
|
788
765
|
onChangeActiveAction: setActiveAction,
|
|
789
766
|
"data-testid": "membersContainer.createInvitation"
|
|
790
|
-
})))), /* @__PURE__ */
|
|
767
|
+
})))), /* @__PURE__ */ React7.createElement("div", {
|
|
791
768
|
className: "justify-center gap-4 p-0 mbs-4 container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]"
|
|
792
|
-
}, /* @__PURE__ */
|
|
769
|
+
}, /* @__PURE__ */ React7.createElement(ControlItemInput, {
|
|
793
770
|
title: t("space locked label"),
|
|
794
771
|
description: t("space locked description")
|
|
795
|
-
}, /* @__PURE__ */
|
|
772
|
+
}, /* @__PURE__ */ React7.createElement(Input.Switch, {
|
|
796
773
|
checked: locked,
|
|
797
774
|
onCheckedChange: handleChangeLocked,
|
|
798
775
|
classNames: "justify-self-end"
|
|
@@ -802,26 +779,26 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
802
779
|
}
|
|
803
780
|
};
|
|
804
781
|
var InvitationSection = ({ state = Invitation.State.INIT, authCode, invitationId = "never", url = "never", onBack }) => {
|
|
805
|
-
var _effect =
|
|
782
|
+
var _effect = _useSignals7();
|
|
806
783
|
try {
|
|
807
784
|
const activeView = state < 0 ? "init" : state >= Invitation.State.CANCELLED ? "complete" : state >= Invitation.State.READY_FOR_AUTHENTICATION && authCode ? "auth-code" : "qr-code";
|
|
808
|
-
return /* @__PURE__ */
|
|
785
|
+
return /* @__PURE__ */ React7.createElement(Viewport.Root, {
|
|
809
786
|
activeView
|
|
810
|
-
}, /* @__PURE__ */
|
|
787
|
+
}, /* @__PURE__ */ React7.createElement(Viewport.Views, null, /* @__PURE__ */ React7.createElement(Viewport.View, {
|
|
811
788
|
id: "init"
|
|
812
|
-
}), /* @__PURE__ */
|
|
789
|
+
}), /* @__PURE__ */ React7.createElement(Viewport.View, {
|
|
813
790
|
id: "complete"
|
|
814
|
-
}, /* @__PURE__ */
|
|
791
|
+
}, /* @__PURE__ */ React7.createElement(InvitationComplete, {
|
|
815
792
|
statusValue: state
|
|
816
|
-
})), /* @__PURE__ */
|
|
793
|
+
})), /* @__PURE__ */ React7.createElement(Viewport.View, {
|
|
817
794
|
id: "auth-code"
|
|
818
|
-
}, /* @__PURE__ */
|
|
795
|
+
}, /* @__PURE__ */ React7.createElement(InvitationAuthCode, {
|
|
819
796
|
id: invitationId,
|
|
820
797
|
code: authCode ?? "never",
|
|
821
798
|
onCancel: onBack
|
|
822
|
-
})), /* @__PURE__ */
|
|
799
|
+
})), /* @__PURE__ */ React7.createElement(Viewport.View, {
|
|
823
800
|
id: "qr-code"
|
|
824
|
-
}, /* @__PURE__ */
|
|
801
|
+
}, /* @__PURE__ */ React7.createElement(InvitationQR, {
|
|
825
802
|
id: invitationId,
|
|
826
803
|
url,
|
|
827
804
|
onCancel: onBack
|
|
@@ -831,36 +808,36 @@ var InvitationSection = ({ state = Invitation.State.INIT, authCode, invitationId
|
|
|
831
808
|
}
|
|
832
809
|
};
|
|
833
810
|
var InvitationQR = ({ id, url, onCancel }) => {
|
|
834
|
-
var _effect =
|
|
811
|
+
var _effect = _useSignals7();
|
|
835
812
|
try {
|
|
836
|
-
const { t } =
|
|
813
|
+
const { t } = useTranslation7("os");
|
|
837
814
|
const qrLabel = useId("members-container__qr-code");
|
|
838
815
|
const emoji = hexToEmoji(id);
|
|
839
|
-
return /* @__PURE__ */
|
|
816
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("p", {
|
|
840
817
|
className: "text-description"
|
|
841
818
|
}, t("qr code description", {
|
|
842
819
|
ns: SPACE_PLUGIN
|
|
843
|
-
})), /* @__PURE__ */
|
|
820
|
+
})), /* @__PURE__ */ React7.createElement("div", {
|
|
844
821
|
role: "group",
|
|
845
822
|
className: "grid grid-cols-[1fr_min-content] mlb-2 gap-2"
|
|
846
|
-
}, /* @__PURE__ */
|
|
823
|
+
}, /* @__PURE__ */ React7.createElement("div", {
|
|
847
824
|
role: "none",
|
|
848
825
|
className: "is-full aspect-square relative text-description"
|
|
849
|
-
}, /* @__PURE__ */
|
|
826
|
+
}, /* @__PURE__ */ React7.createElement(QR, {
|
|
850
827
|
rounding: 100,
|
|
851
828
|
backgroundColor: "transparent",
|
|
852
829
|
color: "currentColor",
|
|
853
830
|
"aria-labelledby": qrLabel,
|
|
854
831
|
errorCorrectionLevel: "Q",
|
|
855
832
|
cutout: true
|
|
856
|
-
}, url ?? "never"), /* @__PURE__ */
|
|
833
|
+
}, url ?? "never"), /* @__PURE__ */ React7.createElement(Centered, null, /* @__PURE__ */ React7.createElement(Emoji, {
|
|
857
834
|
text: emoji
|
|
858
|
-
}))), /* @__PURE__ */
|
|
835
|
+
}))), /* @__PURE__ */ React7.createElement("span", {
|
|
859
836
|
id: qrLabel,
|
|
860
837
|
className: "sr-only"
|
|
861
|
-
}, t("qr label")), /* @__PURE__ */
|
|
838
|
+
}, t("qr label")), /* @__PURE__ */ React7.createElement(Clipboard.Button, {
|
|
862
839
|
value: url ?? "never"
|
|
863
|
-
})), /* @__PURE__ */
|
|
840
|
+
})), /* @__PURE__ */ React7.createElement(Button4, {
|
|
864
841
|
variant: "ghost",
|
|
865
842
|
onClick: onCancel
|
|
866
843
|
}, t("cancel label")));
|
|
@@ -869,22 +846,22 @@ var InvitationQR = ({ id, url, onCancel }) => {
|
|
|
869
846
|
}
|
|
870
847
|
};
|
|
871
848
|
var InvitationAuthCode = ({ id, code, onCancel }) => {
|
|
872
|
-
var _effect =
|
|
849
|
+
var _effect = _useSignals7();
|
|
873
850
|
try {
|
|
874
|
-
const { t } =
|
|
851
|
+
const { t } = useTranslation7("os");
|
|
875
852
|
const emoji = hexToEmoji(id);
|
|
876
|
-
return /* @__PURE__ */
|
|
853
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("p", {
|
|
877
854
|
className: "text-description"
|
|
878
|
-
}, t("auth other device emoji message")), emoji && /* @__PURE__ */
|
|
855
|
+
}, t("auth other device emoji message")), emoji && /* @__PURE__ */ React7.createElement(Emoji, {
|
|
879
856
|
text: emoji,
|
|
880
857
|
className: "mli-auto mlb-2 text-center"
|
|
881
|
-
}), /* @__PURE__ */
|
|
858
|
+
}), /* @__PURE__ */ React7.createElement("p", {
|
|
882
859
|
className: "text-description"
|
|
883
|
-
}, t("auth code message")), /* @__PURE__ */
|
|
860
|
+
}, t("auth code message")), /* @__PURE__ */ React7.createElement(AuthCode, {
|
|
884
861
|
code,
|
|
885
862
|
large: true,
|
|
886
863
|
classNames: "mli-auto mlb-2 text-center grow"
|
|
887
|
-
}), /* @__PURE__ */
|
|
864
|
+
}), /* @__PURE__ */ React7.createElement(Button4, {
|
|
888
865
|
variant: "ghost",
|
|
889
866
|
onClick: onCancel
|
|
890
867
|
}, t("cancel label")));
|
|
@@ -893,65 +870,69 @@ var InvitationAuthCode = ({ id, code, onCancel }) => {
|
|
|
893
870
|
}
|
|
894
871
|
};
|
|
895
872
|
var InvitationComplete = ({ statusValue }) => {
|
|
896
|
-
var _effect =
|
|
873
|
+
var _effect = _useSignals7();
|
|
897
874
|
try {
|
|
898
|
-
return statusValue > 0 ? /* @__PURE__ */
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
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"
|
|
902
883
|
});
|
|
903
884
|
} finally {
|
|
904
885
|
_effect.f();
|
|
905
886
|
}
|
|
906
887
|
};
|
|
907
888
|
|
|
908
|
-
//
|
|
909
|
-
import { useSignals as
|
|
910
|
-
import
|
|
911
|
-
import React9 from "react";
|
|
889
|
+
// src/components/MenuFooter.tsx
|
|
890
|
+
import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
|
|
891
|
+
import React8 from "react";
|
|
912
892
|
import { getSpace as getSpace2 } from "@dxos/client/echo";
|
|
913
893
|
import { useClient as useClient4 } from "@dxos/react-client";
|
|
914
|
-
import { DropdownMenu, toLocalizedString as toLocalizedString2, useTranslation as
|
|
894
|
+
import { DropdownMenu, Icon as Icon6, toLocalizedString as toLocalizedString2, useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
915
895
|
var MenuFooter = ({ object }) => {
|
|
916
|
-
var _effect =
|
|
896
|
+
var _effect = _useSignals8();
|
|
917
897
|
try {
|
|
918
|
-
const { t } =
|
|
898
|
+
const { t } = useTranslation8(SPACE_PLUGIN);
|
|
919
899
|
const client = useClient4();
|
|
920
900
|
const space = getSpace2(object);
|
|
921
901
|
const spaceName = space ? getSpaceDisplayName(space, {
|
|
922
902
|
personal: client.spaces.default === space
|
|
923
903
|
}) : "";
|
|
924
|
-
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", {
|
|
925
905
|
className: "pis-2 mbe-2 text-xs grid grid-cols-[max-content_1fr] gap-2"
|
|
926
|
-
}, /* @__PURE__ */
|
|
906
|
+
}, /* @__PURE__ */ React8.createElement("dt", {
|
|
927
907
|
className: "uppercase text-[.75em] tracking-wide font-medium mbs-px self-start"
|
|
928
|
-
}, t("location label")), /* @__PURE__ */
|
|
908
|
+
}, t("location label")), /* @__PURE__ */ React8.createElement("dd", {
|
|
929
909
|
className: "line-clamp-3"
|
|
930
|
-
}, /* @__PURE__ */
|
|
931
|
-
|
|
910
|
+
}, /* @__PURE__ */ React8.createElement(Icon6, {
|
|
911
|
+
icon: "ph--planet--regular",
|
|
912
|
+
classNames: "inline-block mie-1"
|
|
932
913
|
}), toLocalizedString2(spaceName, t)))) : null;
|
|
933
914
|
} finally {
|
|
934
915
|
_effect.f();
|
|
935
916
|
}
|
|
936
917
|
};
|
|
937
918
|
|
|
938
|
-
//
|
|
939
|
-
import { useSignals as
|
|
940
|
-
import
|
|
919
|
+
// src/components/ObjectSettings/ObjectSettingsContainer.tsx
|
|
920
|
+
import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
|
|
921
|
+
import React10, { useMemo as useMemo2 } from "react";
|
|
941
922
|
import { Surface } from "@dxos/app-framework";
|
|
942
923
|
import { Clipboard as Clipboard2 } from "@dxos/react-ui";
|
|
943
924
|
import { StackItem as StackItem2 } from "@dxos/react-ui-stack";
|
|
944
925
|
|
|
945
|
-
//
|
|
946
|
-
import { useSignals as
|
|
947
|
-
import
|
|
948
|
-
import { Input as Input2, useTranslation as
|
|
926
|
+
// src/components/ObjectSettings/BaseObjectSettings.tsx
|
|
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";
|
|
949
930
|
var BaseObjectSettings = ({ classNames, children, object }) => {
|
|
950
|
-
var _effect =
|
|
931
|
+
var _effect = _useSignals9();
|
|
951
932
|
try {
|
|
952
|
-
const { t } =
|
|
933
|
+
const { t } = useTranslation9(meta.id);
|
|
953
934
|
const inputRef = useRef3(null);
|
|
954
|
-
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, {
|
|
955
936
|
ref: inputRef,
|
|
956
937
|
placeholder: t("name placeholder"),
|
|
957
938
|
// TODO(burdon): Use annotation to get the name field.
|
|
@@ -970,26 +951,26 @@ var BaseObjectSettings = ({ classNames, children, object }) => {
|
|
|
970
951
|
}
|
|
971
952
|
};
|
|
972
953
|
|
|
973
|
-
//
|
|
954
|
+
// src/components/ObjectSettings/ObjectSettingsContainer.tsx
|
|
974
955
|
var ObjectSettingsContainer = ({ object, role }) => {
|
|
975
|
-
var _effect =
|
|
956
|
+
var _effect = _useSignals10();
|
|
976
957
|
try {
|
|
977
958
|
const data = useMemo2(() => ({
|
|
978
959
|
subject: object
|
|
979
960
|
}), [
|
|
980
961
|
object
|
|
981
962
|
]);
|
|
982
|
-
return /* @__PURE__ */
|
|
963
|
+
return /* @__PURE__ */ React10.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React10.createElement(StackItem2.Content, {
|
|
983
964
|
toolbar: false
|
|
984
|
-
}, /* @__PURE__ */
|
|
965
|
+
}, /* @__PURE__ */ React10.createElement("div", {
|
|
985
966
|
role: "none",
|
|
986
967
|
className: "overflow-y-auto pli-cardSpacingInline plb-cardSpacingBlock"
|
|
987
|
-
}, /* @__PURE__ */
|
|
968
|
+
}, /* @__PURE__ */ React10.createElement(BaseObjectSettings, {
|
|
988
969
|
object
|
|
989
|
-
}, /* @__PURE__ */
|
|
970
|
+
}, /* @__PURE__ */ React10.createElement(Surface, {
|
|
990
971
|
role: "base-object-settings",
|
|
991
972
|
data
|
|
992
|
-
})), /* @__PURE__ */
|
|
973
|
+
})), /* @__PURE__ */ React10.createElement(Surface, {
|
|
993
974
|
role: "object-settings",
|
|
994
975
|
data
|
|
995
976
|
}))));
|
|
@@ -998,17 +979,16 @@ var ObjectSettingsContainer = ({ object, role }) => {
|
|
|
998
979
|
}
|
|
999
980
|
};
|
|
1000
981
|
|
|
1001
|
-
//
|
|
1002
|
-
import { useSignals as
|
|
1003
|
-
import {
|
|
1004
|
-
import React12, { useEffect as useEffect2, useState as useState4 } from "react";
|
|
982
|
+
// src/components/PersistenceStatus.tsx
|
|
983
|
+
import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
|
|
984
|
+
import React11, { useEffect as useEffect2, useState as useState4 } from "react";
|
|
1005
985
|
import { debounce } from "@dxos/async";
|
|
1006
|
-
import { Tooltip, useTranslation as
|
|
1007
|
-
import {
|
|
986
|
+
import { Icon as Icon7, Tooltip, useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
987
|
+
import { mx, staticPlaceholderText, warningText } from "@dxos/react-ui-theme";
|
|
1008
988
|
var PersistenceStatus = ({ db }) => {
|
|
1009
|
-
var _effect =
|
|
989
|
+
var _effect = _useSignals11();
|
|
1010
990
|
try {
|
|
1011
|
-
const { t } =
|
|
991
|
+
const { t } = useTranslation10(SPACE_PLUGIN);
|
|
1012
992
|
const [displayMessage, setDisplayMessage] = useState4(false);
|
|
1013
993
|
const [status, naturalSetStatus] = useState4(0);
|
|
1014
994
|
const [prevStatus, setPrevStatus] = useState4(0);
|
|
@@ -1025,32 +1005,38 @@ var PersistenceStatus = ({ db }) => {
|
|
|
1025
1005
|
]);
|
|
1026
1006
|
switch (status) {
|
|
1027
1007
|
case 2:
|
|
1028
|
-
return /* @__PURE__ */
|
|
1008
|
+
return /* @__PURE__ */ React11.createElement("div", {
|
|
1029
1009
|
className: "flex items-center"
|
|
1030
|
-
}, /* @__PURE__ */
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
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)
|
|
1034
1016
|
}, t("persistence error label")));
|
|
1035
1017
|
case 1:
|
|
1036
|
-
return /* @__PURE__ */
|
|
1018
|
+
return /* @__PURE__ */ React11.createElement("div", {
|
|
1037
1019
|
className: "flex items-center"
|
|
1038
|
-
}, /* @__PURE__ */
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
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)
|
|
1042
1026
|
}, t("persistence pending label")));
|
|
1043
1027
|
case 0:
|
|
1044
1028
|
default:
|
|
1045
|
-
return /* @__PURE__ */
|
|
1029
|
+
return /* @__PURE__ */ React11.createElement(Tooltip.Trigger, {
|
|
1046
1030
|
delayDuration: 400,
|
|
1047
1031
|
role: "status",
|
|
1048
1032
|
content: t("persisted locally message"),
|
|
1049
1033
|
className: "flex items-center"
|
|
1050
|
-
}, /* @__PURE__ */
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
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)
|
|
1054
1040
|
}, t("persisted locally label")));
|
|
1055
1041
|
}
|
|
1056
1042
|
} finally {
|
|
@@ -1058,18 +1044,18 @@ var PersistenceStatus = ({ db }) => {
|
|
|
1058
1044
|
}
|
|
1059
1045
|
};
|
|
1060
1046
|
|
|
1061
|
-
//
|
|
1062
|
-
import { useSignals as
|
|
1063
|
-
import
|
|
1047
|
+
// src/components/PopoverRenameObject.tsx
|
|
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";
|
|
1064
1050
|
import { createIntent as createIntent6, LayoutAction as LayoutAction5, useIntentDispatcher as useIntentDispatcher6 } from "@dxos/app-framework";
|
|
1065
1051
|
import { log as log2 } from "@dxos/log";
|
|
1066
|
-
import { Button as Button5, Input as Input3, useTranslation as
|
|
1067
|
-
var __dxlog_file3 = "/
|
|
1052
|
+
import { Button as Button5, Input as Input3, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
1053
|
+
var __dxlog_file3 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
|
|
1068
1054
|
var POPOVER_RENAME_OBJECT = `${SPACE_PLUGIN}/PopoverRenameObject`;
|
|
1069
1055
|
var PopoverRenameObject = ({ object: obj }) => {
|
|
1070
|
-
var _effect =
|
|
1056
|
+
var _effect = _useSignals12();
|
|
1071
1057
|
try {
|
|
1072
|
-
const { t } =
|
|
1058
|
+
const { t } = useTranslation11(SPACE_PLUGIN);
|
|
1073
1059
|
const doneButton = useRef4(null);
|
|
1074
1060
|
const object = obj;
|
|
1075
1061
|
const [name, setName] = useState5(object.name || object.title || "");
|
|
@@ -1077,10 +1063,10 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
1077
1063
|
const handleDone = useCallback7(() => {
|
|
1078
1064
|
try {
|
|
1079
1065
|
object.name = name;
|
|
1080
|
-
} catch {
|
|
1066
|
+
} catch (err) {
|
|
1081
1067
|
try {
|
|
1082
1068
|
object.title = name;
|
|
1083
|
-
} catch
|
|
1069
|
+
} catch {
|
|
1084
1070
|
log2.error("Failed to rename object", {
|
|
1085
1071
|
err
|
|
1086
1072
|
}, {
|
|
@@ -1103,21 +1089,21 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
1103
1089
|
object,
|
|
1104
1090
|
name
|
|
1105
1091
|
]);
|
|
1106
|
-
return /* @__PURE__ */
|
|
1092
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
1107
1093
|
role: "none",
|
|
1108
1094
|
className: "p-2 flex gap-2"
|
|
1109
|
-
}, /* @__PURE__ */
|
|
1095
|
+
}, /* @__PURE__ */ React12.createElement("div", {
|
|
1110
1096
|
role: "none",
|
|
1111
1097
|
className: "flex-1"
|
|
1112
|
-
}, /* @__PURE__ */
|
|
1098
|
+
}, /* @__PURE__ */ React12.createElement(Input3.Root, null, /* @__PURE__ */ React12.createElement(Input3.Label, {
|
|
1113
1099
|
srOnly: true
|
|
1114
|
-
}, t("object name label")), /* @__PURE__ */
|
|
1100
|
+
}, t("object name label")), /* @__PURE__ */ React12.createElement(Input3.TextInput, {
|
|
1115
1101
|
placeholder: t("object placeholder"),
|
|
1116
1102
|
value: name,
|
|
1117
1103
|
"data-testid": "spacePlugin.renameObject.input",
|
|
1118
1104
|
onChange: ({ target: { value } }) => setName(value),
|
|
1119
1105
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1120
|
-
}))), /* @__PURE__ */
|
|
1106
|
+
}))), /* @__PURE__ */ React12.createElement(Button5, {
|
|
1121
1107
|
ref: doneButton,
|
|
1122
1108
|
classNames: "self-stretch",
|
|
1123
1109
|
onClick: handleDone
|
|
@@ -1129,16 +1115,16 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
1129
1115
|
}
|
|
1130
1116
|
};
|
|
1131
1117
|
|
|
1132
|
-
//
|
|
1133
|
-
import { useSignals as
|
|
1134
|
-
import
|
|
1118
|
+
// src/components/PopoverRenameSpace.tsx
|
|
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";
|
|
1135
1121
|
import { createIntent as createIntent7, LayoutAction as LayoutAction6, useIntentDispatcher as useIntentDispatcher7 } from "@dxos/app-framework";
|
|
1136
|
-
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";
|
|
1137
1123
|
var POPOVER_RENAME_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
|
|
1138
1124
|
var PopoverRenameSpace = ({ space }) => {
|
|
1139
|
-
var _effect =
|
|
1125
|
+
var _effect = _useSignals13();
|
|
1140
1126
|
try {
|
|
1141
|
-
const { t } =
|
|
1127
|
+
const { t } = useTranslation12(SPACE_PLUGIN);
|
|
1142
1128
|
const doneButton = useRef5(null);
|
|
1143
1129
|
const [name, setName] = useState6(space.properties.name ?? "");
|
|
1144
1130
|
const { dispatchPromise: dispatch } = useIntentDispatcher7();
|
|
@@ -1156,24 +1142,24 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
1156
1142
|
space,
|
|
1157
1143
|
name
|
|
1158
1144
|
]);
|
|
1159
|
-
return /* @__PURE__ */
|
|
1145
|
+
return /* @__PURE__ */ React13.createElement("div", {
|
|
1160
1146
|
role: "none",
|
|
1161
1147
|
className: "p-2 flex gap-2"
|
|
1162
|
-
}, /* @__PURE__ */
|
|
1148
|
+
}, /* @__PURE__ */ React13.createElement("div", {
|
|
1163
1149
|
role: "none",
|
|
1164
1150
|
className: "flex-1"
|
|
1165
|
-
}, /* @__PURE__ */
|
|
1151
|
+
}, /* @__PURE__ */ React13.createElement(Input4.Root, null, /* @__PURE__ */ React13.createElement(Input4.Label, {
|
|
1166
1152
|
srOnly: true
|
|
1167
|
-
}, t("space name label")), /* @__PURE__ */
|
|
1153
|
+
}, t("space name label")), /* @__PURE__ */ React13.createElement(Input4.TextInput, {
|
|
1168
1154
|
defaultValue: space.properties.name ?? "",
|
|
1169
1155
|
placeholder: t("unnamed space label"),
|
|
1170
1156
|
onChange: ({ target: { value } }) => setName(value),
|
|
1171
1157
|
// TODO(wittjosiah): Ideally this should access the popover context to close the popover.
|
|
1172
1158
|
// Currently this is not possible because Radix does not expose the popover context.
|
|
1173
1159
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1174
|
-
}))), /* @__PURE__ */
|
|
1160
|
+
}))), /* @__PURE__ */ React13.createElement(Popover.Close, {
|
|
1175
1161
|
asChild: true
|
|
1176
|
-
}, /* @__PURE__ */
|
|
1162
|
+
}, /* @__PURE__ */ React13.createElement(Button6, {
|
|
1177
1163
|
ref: doneButton,
|
|
1178
1164
|
classNames: "self-stretch",
|
|
1179
1165
|
onClick: handleDone
|
|
@@ -1185,10 +1171,10 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
1185
1171
|
}
|
|
1186
1172
|
};
|
|
1187
1173
|
|
|
1188
|
-
//
|
|
1189
|
-
import { useSignals as
|
|
1190
|
-
import
|
|
1191
|
-
import { useTranslation as
|
|
1174
|
+
// src/components/SchemaContainer.tsx
|
|
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";
|
|
1192
1178
|
import { controlItemClasses, ControlPage as ControlPage2, ControlSection as ControlSection2 } from "@dxos/react-ui-form";
|
|
1193
1179
|
import { StackItem as StackItem3 } from "@dxos/react-ui-stack";
|
|
1194
1180
|
var useQuerySpaceSchemas = (space) => {
|
|
@@ -1205,38 +1191,38 @@ var useQuerySpaceSchemas = (space) => {
|
|
|
1205
1191
|
return schemas;
|
|
1206
1192
|
};
|
|
1207
1193
|
var SchemaContainer = ({ space }) => {
|
|
1208
|
-
var _effect =
|
|
1194
|
+
var _effect = _useSignals14();
|
|
1209
1195
|
try {
|
|
1210
|
-
const { t } =
|
|
1196
|
+
const { t } = useTranslation13(SPACE_PLUGIN);
|
|
1211
1197
|
const schemas = useQuerySpaceSchemas(space);
|
|
1212
|
-
return /* @__PURE__ */
|
|
1198
|
+
return /* @__PURE__ */ React14.createElement(StackItem3.Content, {
|
|
1213
1199
|
classNames: "block overflow-y-auto"
|
|
1214
|
-
}, /* @__PURE__ */
|
|
1200
|
+
}, /* @__PURE__ */ React14.createElement(ControlPage2, null, /* @__PURE__ */ React14.createElement(ControlSection2, {
|
|
1215
1201
|
title: t("schema verbose label"),
|
|
1216
1202
|
description: t("schema description")
|
|
1217
|
-
}, /* @__PURE__ */
|
|
1203
|
+
}, /* @__PURE__ */ React14.createElement("div", {
|
|
1218
1204
|
role: "none",
|
|
1219
1205
|
className: controlItemClasses
|
|
1220
|
-
}, schemas.length === 0 && /* @__PURE__ */
|
|
1206
|
+
}, schemas.length === 0 && /* @__PURE__ */ React14.createElement("div", {
|
|
1221
1207
|
className: "text-center plb-4"
|
|
1222
|
-
}, t("no schemas found message")), schemas.map((schema) => /* @__PURE__ */
|
|
1208
|
+
}, t("no schemas found message")), schemas.map((schema) => /* @__PURE__ */ React14.createElement("div", {
|
|
1223
1209
|
key: schema.id
|
|
1224
|
-
}, /* @__PURE__ */
|
|
1210
|
+
}, /* @__PURE__ */ React14.createElement("div", null, schema.typename)))))));
|
|
1225
1211
|
} finally {
|
|
1226
1212
|
_effect.f();
|
|
1227
1213
|
}
|
|
1228
1214
|
};
|
|
1229
1215
|
|
|
1230
|
-
//
|
|
1231
|
-
import { useSignals as
|
|
1216
|
+
// src/components/SpacePresence.tsx
|
|
1217
|
+
import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
|
|
1232
1218
|
import { Option } from "effect";
|
|
1233
|
-
import
|
|
1219
|
+
import React15, { forwardRef, useCallback as useCallback9, useEffect as useEffect4, useState as useState8 } from "react";
|
|
1234
1220
|
import { useAppGraph as useAppGraph2, useCapability } from "@dxos/app-framework";
|
|
1235
1221
|
import { generateName } from "@dxos/display-name";
|
|
1236
1222
|
import { PublicKey, useClient as useClient5 } from "@dxos/react-client";
|
|
1237
1223
|
import { getSpace as getSpace3, useMembers, fullyQualifiedId as fullyQualifiedId3 } from "@dxos/react-client/echo";
|
|
1238
1224
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
1239
|
-
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";
|
|
1240
1226
|
import { AttentionGlyph, useAttended, useAttention } from "@dxos/react-ui-attention";
|
|
1241
1227
|
import { ComplexMap, keyToFallback } from "@dxos/util";
|
|
1242
1228
|
var REFRESH_INTERVAL = 5e3;
|
|
@@ -1244,7 +1230,7 @@ var ACTIVITY_DURATION = 3e4;
|
|
|
1244
1230
|
var noViewers = new ComplexMap(PublicKey.hash);
|
|
1245
1231
|
var getName = (identity) => identity.profile?.displayName ?? generateName(identity.identityKey.toHex());
|
|
1246
1232
|
var SpacePresence = ({ object, spaceKey }) => {
|
|
1247
|
-
var _effect =
|
|
1233
|
+
var _effect = _useSignals15();
|
|
1248
1234
|
try {
|
|
1249
1235
|
const spaceState = useCapability(SpaceCapabilities.MutableState);
|
|
1250
1236
|
const client = useClient5();
|
|
@@ -1274,7 +1260,7 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1274
1260
|
lastSeen
|
|
1275
1261
|
};
|
|
1276
1262
|
}).toSorted((a, b) => a.lastSeen - b.lastSeen);
|
|
1277
|
-
return /* @__PURE__ */
|
|
1263
|
+
return /* @__PURE__ */ React15.createElement(FullPresence, {
|
|
1278
1264
|
members: membersForObject
|
|
1279
1265
|
});
|
|
1280
1266
|
} finally {
|
|
@@ -1282,46 +1268,46 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1282
1268
|
}
|
|
1283
1269
|
};
|
|
1284
1270
|
var FullPresence = (props) => {
|
|
1285
|
-
var _effect =
|
|
1271
|
+
var _effect = _useSignals15();
|
|
1286
1272
|
try {
|
|
1287
1273
|
const { size = 9, onMemberClick } = props;
|
|
1288
1274
|
const members = useDefaultValue(props.members, () => []);
|
|
1289
1275
|
if (members.length === 0) {
|
|
1290
1276
|
return null;
|
|
1291
1277
|
}
|
|
1292
|
-
return /* @__PURE__ */
|
|
1278
|
+
return /* @__PURE__ */ React15.createElement("div", {
|
|
1293
1279
|
className: "dx-avatar-group",
|
|
1294
1280
|
"data-testid": "spacePlugin.presence"
|
|
1295
|
-
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */
|
|
1281
|
+
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */ React15.createElement(Tooltip2.Trigger, {
|
|
1296
1282
|
key: member.identity.identityKey.toHex(),
|
|
1297
1283
|
side: "bottom",
|
|
1298
1284
|
content: getName(member.identity),
|
|
1299
1285
|
className: "grid focus:outline-none"
|
|
1300
|
-
}, /* @__PURE__ */
|
|
1286
|
+
}, /* @__PURE__ */ React15.createElement(PresenceAvatar, {
|
|
1301
1287
|
identity: member.identity,
|
|
1302
1288
|
match: member.currentlyAttended,
|
|
1303
1289
|
index: members.length - i,
|
|
1304
1290
|
onClick: () => onMemberClick?.(member),
|
|
1305
1291
|
size
|
|
1306
|
-
}))), members.length > 3 && /* @__PURE__ */
|
|
1292
|
+
}))), members.length > 3 && /* @__PURE__ */ React15.createElement(Popover2.Root, null, /* @__PURE__ */ React15.createElement(Popover2.Trigger, {
|
|
1307
1293
|
className: "grid focus:outline-none"
|
|
1308
|
-
}, /* @__PURE__ */
|
|
1294
|
+
}, /* @__PURE__ */ React15.createElement(Avatar.Root, null, /* @__PURE__ */ React15.createElement(Avatar.Content, {
|
|
1309
1295
|
status: "inactive",
|
|
1310
1296
|
style: {
|
|
1311
1297
|
zIndex: members.length - 4
|
|
1312
1298
|
},
|
|
1313
1299
|
fallback: `+${members.length - 3}`,
|
|
1314
1300
|
size
|
|
1315
|
-
}))), /* @__PURE__ */
|
|
1301
|
+
}))), /* @__PURE__ */ React15.createElement(Popover2.Portal, null, /* @__PURE__ */ React15.createElement(Popover2.Content, {
|
|
1316
1302
|
side: "bottom"
|
|
1317
|
-
}, /* @__PURE__ */
|
|
1303
|
+
}, /* @__PURE__ */ React15.createElement(Popover2.Arrow, null), /* @__PURE__ */ React15.createElement(Popover2.Viewport, {
|
|
1318
1304
|
classNames: "max-bs-56"
|
|
1319
|
-
}, /* @__PURE__ */
|
|
1305
|
+
}, /* @__PURE__ */ React15.createElement(List, null, members.map((member) => /* @__PURE__ */ React15.createElement(ListItem.Root, {
|
|
1320
1306
|
key: member.identity.identityKey.toHex(),
|
|
1321
1307
|
classNames: "flex gap-2 items-center cursor-pointer mbe-2",
|
|
1322
1308
|
onClick: () => onMemberClick?.(member),
|
|
1323
1309
|
"data-testid": "identity-list-item"
|
|
1324
|
-
}, /* @__PURE__ */
|
|
1310
|
+
}, /* @__PURE__ */ React15.createElement(PresenceAvatar, {
|
|
1325
1311
|
identity: member.identity,
|
|
1326
1312
|
size,
|
|
1327
1313
|
showName: true,
|
|
@@ -1332,11 +1318,11 @@ var FullPresence = (props) => {
|
|
|
1332
1318
|
}
|
|
1333
1319
|
};
|
|
1334
1320
|
var PresenceAvatar = /* @__PURE__ */ forwardRef(({ identity, showName, match, index, onClick, size }, forwardedRef) => {
|
|
1335
|
-
var _effect =
|
|
1321
|
+
var _effect = _useSignals15();
|
|
1336
1322
|
try {
|
|
1337
1323
|
const status = match ? "current" : "active";
|
|
1338
1324
|
const fallbackValue = keyToFallback(identity.identityKey);
|
|
1339
|
-
return /* @__PURE__ */
|
|
1325
|
+
return /* @__PURE__ */ React15.createElement(Avatar.Root, null, /* @__PURE__ */ React15.createElement(Avatar.Content, {
|
|
1340
1326
|
status,
|
|
1341
1327
|
hue: identity.profile?.data?.hue || fallbackValue.hue,
|
|
1342
1328
|
"data-testid": "spacePlugin.presence.member",
|
|
@@ -1350,7 +1336,7 @@ var PresenceAvatar = /* @__PURE__ */ forwardRef(({ identity, showName, match, in
|
|
|
1350
1336
|
onClick,
|
|
1351
1337
|
fallback: identity.profile?.data?.emoji || fallbackValue.emoji,
|
|
1352
1338
|
ref: forwardedRef
|
|
1353
|
-
}), /* @__PURE__ */
|
|
1339
|
+
}), /* @__PURE__ */ React15.createElement(Avatar.Label, {
|
|
1354
1340
|
classNames: showName ? "text-sm truncate pli-2" : "sr-only"
|
|
1355
1341
|
}, getName(identity)));
|
|
1356
1342
|
} finally {
|
|
@@ -1358,7 +1344,7 @@ var PresenceAvatar = /* @__PURE__ */ forwardRef(({ identity, showName, match, in
|
|
|
1358
1344
|
}
|
|
1359
1345
|
});
|
|
1360
1346
|
var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
1361
|
-
var _effect =
|
|
1347
|
+
var _effect = _useSignals15();
|
|
1362
1348
|
try {
|
|
1363
1349
|
const { hasAttention, isAncestor, isRelated } = useAttention(id);
|
|
1364
1350
|
const isAttended = hasAttention || isAncestor || isRelated;
|
|
@@ -1383,7 +1369,7 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
|
1383
1369
|
}, [
|
|
1384
1370
|
viewers
|
|
1385
1371
|
]);
|
|
1386
|
-
return /* @__PURE__ */
|
|
1372
|
+
return /* @__PURE__ */ React15.createElement(SmallPresence, {
|
|
1387
1373
|
count: activeViewers.length,
|
|
1388
1374
|
attended: isAttended,
|
|
1389
1375
|
containsAttended
|
|
@@ -1393,16 +1379,16 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
|
1393
1379
|
}
|
|
1394
1380
|
};
|
|
1395
1381
|
var SmallPresence = ({ count = 0, attended, containsAttended }) => {
|
|
1396
|
-
var _effect =
|
|
1382
|
+
var _effect = _useSignals15();
|
|
1397
1383
|
try {
|
|
1398
|
-
const { t } =
|
|
1399
|
-
return /* @__PURE__ */
|
|
1384
|
+
const { t } = useTranslation14(SPACE_PLUGIN);
|
|
1385
|
+
return /* @__PURE__ */ React15.createElement(Tooltip2.Trigger, {
|
|
1400
1386
|
asChild: true,
|
|
1401
1387
|
content: t("presence label", {
|
|
1402
1388
|
count
|
|
1403
1389
|
}),
|
|
1404
1390
|
side: "bottom"
|
|
1405
|
-
}, /* @__PURE__ */
|
|
1391
|
+
}, /* @__PURE__ */ React15.createElement(AttentionGlyph, {
|
|
1406
1392
|
attended,
|
|
1407
1393
|
containsAttended,
|
|
1408
1394
|
presence: count > 1 ? "many" : count === 1 ? "one" : "none",
|
|
@@ -1413,46 +1399,46 @@ var SmallPresence = ({ count = 0, attended, containsAttended }) => {
|
|
|
1413
1399
|
}
|
|
1414
1400
|
};
|
|
1415
1401
|
|
|
1416
|
-
//
|
|
1417
|
-
import { useSignals as
|
|
1418
|
-
import
|
|
1402
|
+
// src/components/SpacePluginSettings.tsx
|
|
1403
|
+
import { useSignals as _useSignals16 } from "@preact-signals/safe-react/tracking";
|
|
1404
|
+
import React16 from "react";
|
|
1419
1405
|
import { createIntent as createIntent8, useIntentDispatcher as useIntentDispatcher8 } from "@dxos/app-framework";
|
|
1420
1406
|
import { useClient as useClient6 } from "@dxos/react-client";
|
|
1421
1407
|
import { useSpaces as useSpaces2 } from "@dxos/react-client/echo";
|
|
1422
|
-
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";
|
|
1423
1409
|
import { controlItemClasses as controlItemClasses2, ControlPage as ControlPage3, ControlSection as ControlSection3, DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
1424
1410
|
var SpacePluginSettings = ({ settings }) => {
|
|
1425
|
-
var _effect =
|
|
1411
|
+
var _effect = _useSignals16();
|
|
1426
1412
|
try {
|
|
1427
|
-
const { t } =
|
|
1413
|
+
const { t } = useTranslation15(SPACE_PLUGIN);
|
|
1428
1414
|
const client = useClient6();
|
|
1429
1415
|
const spaces = useSpaces2({
|
|
1430
1416
|
all: settings.showHidden
|
|
1431
1417
|
});
|
|
1432
1418
|
const { dispatchPromise: dispatch } = useIntentDispatcher8();
|
|
1433
|
-
return /* @__PURE__ */
|
|
1419
|
+
return /* @__PURE__ */ React16.createElement(ControlPage3, null, /* @__PURE__ */ React16.createElement(ControlSection3, {
|
|
1434
1420
|
title: t("space settings label"),
|
|
1435
1421
|
description: t("space settings description")
|
|
1436
|
-
}, /* @__PURE__ */
|
|
1422
|
+
}, /* @__PURE__ */ React16.createElement("div", {
|
|
1437
1423
|
className: "pli-trimMd container-max-width"
|
|
1438
|
-
}, /* @__PURE__ */
|
|
1424
|
+
}, /* @__PURE__ */ React16.createElement(DeprecatedFormInput, {
|
|
1439
1425
|
label: t("show hidden spaces label")
|
|
1440
|
-
}, /* @__PURE__ */
|
|
1426
|
+
}, /* @__PURE__ */ React16.createElement(Input5.Switch, {
|
|
1441
1427
|
checked: settings.showHidden,
|
|
1442
1428
|
onCheckedChange: (checked) => settings.showHidden = !!checked
|
|
1443
|
-
}))), /* @__PURE__ */
|
|
1429
|
+
}))), /* @__PURE__ */ React16.createElement(List2, {
|
|
1444
1430
|
classNames: [
|
|
1445
1431
|
controlItemClasses2,
|
|
1446
1432
|
"flex flex-col gap-trimSm"
|
|
1447
1433
|
]
|
|
1448
|
-
}, spaces.map((space) => /* @__PURE__ */
|
|
1434
|
+
}, spaces.map((space) => /* @__PURE__ */ React16.createElement(ListItem2.Root, {
|
|
1449
1435
|
key: space.id,
|
|
1450
1436
|
classNames: "is-full items-center"
|
|
1451
|
-
}, /* @__PURE__ */
|
|
1437
|
+
}, /* @__PURE__ */ React16.createElement(ListItem2.Heading, {
|
|
1452
1438
|
classNames: "grow truncate !min-bs-0"
|
|
1453
1439
|
}, toLocalizedString3(getSpaceDisplayName(space, {
|
|
1454
1440
|
personal: space === client.spaces.default
|
|
1455
|
-
}), t)), /* @__PURE__ */
|
|
1441
|
+
}), t)), /* @__PURE__ */ React16.createElement(IconButton, {
|
|
1456
1442
|
icon: "ph--faders--regular",
|
|
1457
1443
|
onClick: () => dispatch(createIntent8(SpaceAction.OpenSettings, {
|
|
1458
1444
|
space
|
|
@@ -1464,29 +1450,29 @@ var SpacePluginSettings = ({ settings }) => {
|
|
|
1464
1450
|
}
|
|
1465
1451
|
};
|
|
1466
1452
|
|
|
1467
|
-
//
|
|
1468
|
-
import { useSignals as
|
|
1453
|
+
// src/components/SpaceSettings/SpaceSettingsContainer.tsx
|
|
1454
|
+
import { useSignals as _useSignals17 } from "@preact-signals/safe-react/tracking";
|
|
1469
1455
|
import { pipe as pipe2, Schema } from "effect";
|
|
1470
|
-
import
|
|
1456
|
+
import React17, { useCallback as useCallback10, useMemo as useMemo3, useState as useState9 } from "react";
|
|
1471
1457
|
import { chain as chain2, createIntent as createIntent9, LayoutAction as LayoutAction7, useIntentDispatcher as useIntentDispatcher9 } from "@dxos/app-framework";
|
|
1472
1458
|
import { log as log3 } from "@dxos/log";
|
|
1473
1459
|
import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1474
1460
|
import { useClient as useClient7 } from "@dxos/react-client";
|
|
1475
1461
|
import { SpaceState as SpaceState2 } from "@dxos/react-client/echo";
|
|
1476
|
-
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";
|
|
1477
1463
|
import { Form as Form3, ControlItem, ControlItemInput as ControlItemInput2, ControlSection as ControlSection4, ControlPage as ControlPage4 } from "@dxos/react-ui-form";
|
|
1478
1464
|
import { HuePicker, IconPicker } from "@dxos/react-ui-pickers";
|
|
1479
1465
|
import { StackItem as StackItem4 } from "@dxos/react-ui-stack";
|
|
1480
|
-
var __dxlog_file4 = "/
|
|
1466
|
+
var __dxlog_file4 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsContainer.tsx";
|
|
1481
1467
|
var FormSchema = SpaceForm.pipe(Schema.extend(Schema.Struct({
|
|
1482
1468
|
archived: Schema.Boolean.annotations({
|
|
1483
1469
|
title: "Archive space"
|
|
1484
1470
|
})
|
|
1485
1471
|
})));
|
|
1486
1472
|
var SpaceSettingsContainer = ({ space }) => {
|
|
1487
|
-
var _effect =
|
|
1473
|
+
var _effect = _useSignals17();
|
|
1488
1474
|
try {
|
|
1489
|
-
const { t } =
|
|
1475
|
+
const { t } = useTranslation16(SPACE_PLUGIN);
|
|
1490
1476
|
const { dispatchPromise: dispatch } = useIntentDispatcher9();
|
|
1491
1477
|
const client = useClient7();
|
|
1492
1478
|
const archived = useMulticastObservable(space.state) === SpaceState2.SPACE_INACTIVE;
|
|
@@ -1552,10 +1538,10 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1552
1538
|
onValueChange,
|
|
1553
1539
|
type
|
|
1554
1540
|
]);
|
|
1555
|
-
return /* @__PURE__ */
|
|
1541
|
+
return /* @__PURE__ */ React17.createElement(ControlItemInput2, {
|
|
1556
1542
|
title: label,
|
|
1557
1543
|
description: t("display name description")
|
|
1558
|
-
}, /* @__PURE__ */
|
|
1544
|
+
}, /* @__PURE__ */ React17.createElement(Input6.TextInput, {
|
|
1559
1545
|
value: getValue(),
|
|
1560
1546
|
onChange: handleChange,
|
|
1561
1547
|
placeholder: t("display name input placeholder"),
|
|
@@ -1571,10 +1557,10 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1571
1557
|
onValueChange,
|
|
1572
1558
|
type
|
|
1573
1559
|
]);
|
|
1574
|
-
return /* @__PURE__ */
|
|
1560
|
+
return /* @__PURE__ */ React17.createElement(ControlItem, {
|
|
1575
1561
|
title: label,
|
|
1576
1562
|
description: t("icon description")
|
|
1577
|
-
}, /* @__PURE__ */
|
|
1563
|
+
}, /* @__PURE__ */ React17.createElement(IconPicker, {
|
|
1578
1564
|
value: getValue(),
|
|
1579
1565
|
onChange: handleChange,
|
|
1580
1566
|
onReset: handleEmojiReset,
|
|
@@ -1591,10 +1577,10 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1591
1577
|
onValueChange,
|
|
1592
1578
|
type
|
|
1593
1579
|
]);
|
|
1594
|
-
return /* @__PURE__ */
|
|
1580
|
+
return /* @__PURE__ */ React17.createElement(ControlItem, {
|
|
1595
1581
|
title: label,
|
|
1596
1582
|
description: t("hue description")
|
|
1597
|
-
}, /* @__PURE__ */
|
|
1583
|
+
}, /* @__PURE__ */ React17.createElement(HuePicker, {
|
|
1598
1584
|
value: getValue(),
|
|
1599
1585
|
onChange: handleChange,
|
|
1600
1586
|
onReset: handleHueReset,
|
|
@@ -1606,10 +1592,10 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1606
1592
|
onValueChange,
|
|
1607
1593
|
type
|
|
1608
1594
|
]);
|
|
1609
|
-
return /* @__PURE__ */
|
|
1595
|
+
return /* @__PURE__ */ React17.createElement(ControlItemInput2, {
|
|
1610
1596
|
title: label,
|
|
1611
1597
|
description: t("edge replication description")
|
|
1612
|
-
}, /* @__PURE__ */
|
|
1598
|
+
}, /* @__PURE__ */ React17.createElement(Input6.Switch, {
|
|
1613
1599
|
checked: getValue(),
|
|
1614
1600
|
onCheckedChange: handleChange,
|
|
1615
1601
|
classNames: "justify-self-end"
|
|
@@ -1621,10 +1607,10 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1621
1607
|
type,
|
|
1622
1608
|
getValue
|
|
1623
1609
|
]);
|
|
1624
|
-
return /* @__PURE__ */
|
|
1610
|
+
return /* @__PURE__ */ React17.createElement(ControlItemInput2, {
|
|
1625
1611
|
title: label,
|
|
1626
1612
|
description: t("archive space description")
|
|
1627
|
-
}, /* @__PURE__ */
|
|
1613
|
+
}, /* @__PURE__ */ React17.createElement(Button7, {
|
|
1628
1614
|
disabled: space === client.spaces.default,
|
|
1629
1615
|
onClick: handleChange
|
|
1630
1616
|
}, getValue() ? t("unarchive space label") : t("archive space label")));
|
|
@@ -1633,16 +1619,16 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1633
1619
|
t,
|
|
1634
1620
|
space
|
|
1635
1621
|
]);
|
|
1636
|
-
return /* @__PURE__ */
|
|
1622
|
+
return /* @__PURE__ */ React17.createElement(StackItem4.Content, {
|
|
1637
1623
|
classNames: "block overflow-y-auto pli-2"
|
|
1638
|
-
}, /* @__PURE__ */
|
|
1624
|
+
}, /* @__PURE__ */ React17.createElement(ControlPage4, null, /* @__PURE__ */ React17.createElement(ControlSection4, {
|
|
1639
1625
|
title: t("space properties settings verbose label", {
|
|
1640
1626
|
ns: SPACE_PLUGIN
|
|
1641
1627
|
}),
|
|
1642
1628
|
description: t("space properties settings description", {
|
|
1643
1629
|
ns: SPACE_PLUGIN
|
|
1644
1630
|
})
|
|
1645
|
-
}, /* @__PURE__ */
|
|
1631
|
+
}, /* @__PURE__ */ React17.createElement(Form3, {
|
|
1646
1632
|
schema: FormSchema,
|
|
1647
1633
|
values,
|
|
1648
1634
|
autoSave: true,
|
|
@@ -1656,16 +1642,16 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1656
1642
|
}
|
|
1657
1643
|
};
|
|
1658
1644
|
|
|
1659
|
-
//
|
|
1660
|
-
import { useSignals as
|
|
1645
|
+
// src/components/SyncStatus/InlineSyncStatus.tsx
|
|
1646
|
+
import { useSignals as _useSignals18 } from "@preact-signals/safe-react/tracking";
|
|
1661
1647
|
import { Option as Option2 } from "effect";
|
|
1662
|
-
import
|
|
1648
|
+
import React18, { useEffect as useEffect5, useState as useState10 } from "react";
|
|
1663
1649
|
import { useAppGraph as useAppGraph3 } from "@dxos/app-framework";
|
|
1664
1650
|
import { EdgeStatus } from "@dxos/protocols/proto/dxos/client/services";
|
|
1665
1651
|
import { EdgeReplicationSetting as EdgeReplicationSetting2 } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1666
1652
|
import { useClient as useClient8 } from "@dxos/react-client";
|
|
1667
1653
|
import { useSpaceSyncState } from "@dxos/react-client/echo";
|
|
1668
|
-
import { Tooltip as Tooltip3, useTranslation as
|
|
1654
|
+
import { Tooltip as Tooltip3, useTranslation as useTranslation17 } from "@dxos/react-ui";
|
|
1669
1655
|
import { AttentionGlyph as AttentionGlyph2, useAttended as useAttended2, useAttention as useAttention2 } from "@dxos/react-ui-attention";
|
|
1670
1656
|
var useEdgeStatus = () => {
|
|
1671
1657
|
const [status, setStatus] = useState10(EdgeStatus.NOT_CONNECTED);
|
|
@@ -1680,9 +1666,9 @@ var useEdgeStatus = () => {
|
|
|
1680
1666
|
return status;
|
|
1681
1667
|
};
|
|
1682
1668
|
var InlineSyncStatus = ({ space, open }) => {
|
|
1683
|
-
var _effect =
|
|
1669
|
+
var _effect = _useSignals18();
|
|
1684
1670
|
try {
|
|
1685
|
-
const { t } =
|
|
1671
|
+
const { t } = useTranslation17(SPACE_PLUGIN);
|
|
1686
1672
|
const id = space.id;
|
|
1687
1673
|
const { hasAttention, isAncestor, isRelated } = useAttention2(id);
|
|
1688
1674
|
const isAttended = hasAttention || isAncestor || isRelated;
|
|
@@ -1695,11 +1681,11 @@ var InlineSyncStatus = ({ space, open }) => {
|
|
|
1695
1681
|
const edgeSyncEnabled = space.internal.data.edgeReplication === EdgeReplicationSetting2.ENABLED;
|
|
1696
1682
|
const syncState = useSpaceSyncState(space);
|
|
1697
1683
|
const syncing = connectedToEdge && edgeSyncEnabled && syncState && syncState.missingOnLocal > 0;
|
|
1698
|
-
return /* @__PURE__ */
|
|
1684
|
+
return /* @__PURE__ */ React18.createElement(Tooltip3.Trigger, {
|
|
1699
1685
|
asChild: true,
|
|
1700
1686
|
content: t("syncing label"),
|
|
1701
1687
|
side: "bottom"
|
|
1702
|
-
}, /* @__PURE__ */
|
|
1688
|
+
}, /* @__PURE__ */ React18.createElement(AttentionGlyph2, {
|
|
1703
1689
|
syncing,
|
|
1704
1690
|
attended: isAttended,
|
|
1705
1691
|
containsAttended,
|
|
@@ -1710,17 +1696,17 @@ var InlineSyncStatus = ({ space, open }) => {
|
|
|
1710
1696
|
}
|
|
1711
1697
|
};
|
|
1712
1698
|
|
|
1713
|
-
//
|
|
1714
|
-
import { useSignals as
|
|
1715
|
-
import
|
|
1699
|
+
// src/components/SyncStatus/SyncStatus.tsx
|
|
1700
|
+
import { useSignals as _useSignals19 } from "@preact-signals/safe-react/tracking";
|
|
1701
|
+
import React19, { useEffect as useEffect6, useState as useState11 } from "react";
|
|
1716
1702
|
import { StatusBar } from "@dxos/plugin-status-bar";
|
|
1717
1703
|
import { useClient as useClient9 } from "@dxos/react-client";
|
|
1718
1704
|
import { getSyncSummary, useSyncState } from "@dxos/react-client/echo";
|
|
1719
|
-
import { Icon as
|
|
1705
|
+
import { Icon as Icon8, useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
1720
1706
|
|
|
1721
|
-
//
|
|
1707
|
+
// src/components/SyncStatus/save-tracker.ts
|
|
1722
1708
|
import { Context } from "@dxos/context";
|
|
1723
|
-
var __dxlog_file5 = "/
|
|
1709
|
+
var __dxlog_file5 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts";
|
|
1724
1710
|
var createClientSaveTracker = (client, cb) => {
|
|
1725
1711
|
const CleanupFns = {};
|
|
1726
1712
|
const state = {};
|
|
@@ -1757,15 +1743,15 @@ var createSpaceSaveTracker = (space, cb) => {
|
|
|
1757
1743
|
}
|
|
1758
1744
|
let hasUnsavedChanges = false;
|
|
1759
1745
|
let lastFlushPromise;
|
|
1760
|
-
space.
|
|
1746
|
+
space.db.saveStateChanged.on(ctx, ({ unsavedDocuments }) => {
|
|
1761
1747
|
hasUnsavedChanges = unsavedDocuments.length > 0;
|
|
1762
1748
|
});
|
|
1763
|
-
space.
|
|
1749
|
+
space.db.saveStateChanged.debounce(500).on(ctx, () => {
|
|
1764
1750
|
if (hasUnsavedChanges) {
|
|
1765
1751
|
lastFlushPromise = void 0;
|
|
1766
1752
|
cb("saving");
|
|
1767
1753
|
} else {
|
|
1768
|
-
const flushPromise = space.
|
|
1754
|
+
const flushPromise = space.db.flush();
|
|
1769
1755
|
lastFlushPromise = flushPromise;
|
|
1770
1756
|
void flushPromise.then(() => {
|
|
1771
1757
|
if (lastFlushPromise === flushPromise) {
|
|
@@ -1780,7 +1766,7 @@ var createSpaceSaveTracker = (space, cb) => {
|
|
|
1780
1766
|
};
|
|
1781
1767
|
};
|
|
1782
1768
|
|
|
1783
|
-
//
|
|
1769
|
+
// src/components/SyncStatus/status.ts
|
|
1784
1770
|
var getStatus = ({ offline, saved, needsToUpload, needsToDownload }) => {
|
|
1785
1771
|
if (!saved) {
|
|
1786
1772
|
return "saving locally";
|
|
@@ -1809,10 +1795,10 @@ var getIcon = (status) => {
|
|
|
1809
1795
|
}
|
|
1810
1796
|
};
|
|
1811
1797
|
|
|
1812
|
-
//
|
|
1798
|
+
// src/components/SyncStatus/SyncStatus.tsx
|
|
1813
1799
|
var SYNC_STALLED_TIMEOUT = 5e3;
|
|
1814
1800
|
var SyncStatus = () => {
|
|
1815
|
-
var _effect =
|
|
1801
|
+
var _effect = _useSignals19();
|
|
1816
1802
|
try {
|
|
1817
1803
|
const client = useClient9();
|
|
1818
1804
|
const state = useSyncState();
|
|
@@ -1822,7 +1808,7 @@ var SyncStatus = () => {
|
|
|
1822
1808
|
setSaved(state2 === "saved");
|
|
1823
1809
|
});
|
|
1824
1810
|
}, []);
|
|
1825
|
-
return /* @__PURE__ */
|
|
1811
|
+
return /* @__PURE__ */ React19.createElement(SyncStatusIndicator, {
|
|
1826
1812
|
state,
|
|
1827
1813
|
saved
|
|
1828
1814
|
});
|
|
@@ -1831,9 +1817,9 @@ var SyncStatus = () => {
|
|
|
1831
1817
|
}
|
|
1832
1818
|
};
|
|
1833
1819
|
var SyncStatusIndicator = ({ state, saved }) => {
|
|
1834
|
-
var _effect =
|
|
1820
|
+
var _effect = _useSignals19();
|
|
1835
1821
|
try {
|
|
1836
|
-
const { t } =
|
|
1822
|
+
const { t } = useTranslation18(SPACE_PLUGIN);
|
|
1837
1823
|
const summary = getSyncSummary(state);
|
|
1838
1824
|
const offline = Object.values(state).length === 0;
|
|
1839
1825
|
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
@@ -1860,12 +1846,12 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1860
1846
|
needsToDownload
|
|
1861
1847
|
]);
|
|
1862
1848
|
const title = t(`${status} label`);
|
|
1863
|
-
const icon = /* @__PURE__ */
|
|
1849
|
+
const icon = /* @__PURE__ */ React19.createElement(Icon8, {
|
|
1864
1850
|
icon: getIcon(status),
|
|
1865
1851
|
size: 4,
|
|
1866
1852
|
classNames
|
|
1867
1853
|
});
|
|
1868
|
-
return /* @__PURE__ */
|
|
1854
|
+
return /* @__PURE__ */ React19.createElement(StatusBar.Item, {
|
|
1869
1855
|
title
|
|
1870
1856
|
}, icon);
|
|
1871
1857
|
} finally {
|
|
@@ -1873,13 +1859,92 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1873
1859
|
}
|
|
1874
1860
|
};
|
|
1875
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
|
+
|
|
1876
1942
|
export {
|
|
1877
1943
|
AwaitingObject,
|
|
1878
1944
|
CREATE_OBJECT_DIALOG,
|
|
1879
1945
|
CreateObjectDialog,
|
|
1880
1946
|
CREATE_SPACE_DIALOG,
|
|
1881
1947
|
CreateSpaceDialog,
|
|
1882
|
-
CollectionMain,
|
|
1883
1948
|
CollectionSection,
|
|
1884
1949
|
JOIN_DIALOG,
|
|
1885
1950
|
JoinDialog,
|
|
@@ -1902,6 +1967,9 @@ export {
|
|
|
1902
1967
|
InlineSyncStatus,
|
|
1903
1968
|
SyncStatus,
|
|
1904
1969
|
SyncStatusIndicator,
|
|
1970
|
+
ViewEditor,
|
|
1971
|
+
CollectionMain,
|
|
1972
|
+
ObjectDetailsPanel,
|
|
1905
1973
|
AppGraphBuilder,
|
|
1906
1974
|
AppGraphSerializer,
|
|
1907
1975
|
IdentityCreated,
|
|
@@ -1914,4 +1982,4 @@ export {
|
|
|
1914
1982
|
SpaceState,
|
|
1915
1983
|
SpacesReady
|
|
1916
1984
|
};
|
|
1917
|
-
//# sourceMappingURL=chunk-
|
|
1985
|
+
//# sourceMappingURL=chunk-6X5DLJM5.mjs.map
|