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