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