@dxos/plugin-space 0.8.4-main.67995b8 → 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-D2B75XBS.mjs → CollectionMain-AX7KKXWP.mjs} +4 -4
- package/dist/lib/browser/CollectionMain-AX7KKXWP.mjs.map +7 -0
- package/dist/lib/browser/{ObjectDetailsPanel-YPTDQKMG.mjs → ObjectDetailsPanel-ETI5YBTH.mjs} +10 -8
- 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-V3MP3CDK.mjs → app-graph-builder-W7RVDAUA.mjs} +80 -43
- package/dist/lib/browser/app-graph-builder-W7RVDAUA.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-H6AW7KGS.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-FBJEXW54.mjs → chunk-2BFVC5K6.mjs} +139 -150
- 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-SGTQ52SU.mjs → chunk-JCHSUOPF.mjs} +14 -8
- package/dist/lib/browser/chunk-JCHSUOPF.mjs.map +7 -0
- package/dist/lib/browser/{chunk-XUYKJUU7.mjs → chunk-PN27K4I7.mjs} +93 -41
- package/dist/lib/browser/chunk-PN27K4I7.mjs.map +7 -0
- package/dist/lib/browser/{chunk-QACNNDOT.mjs → chunk-ZIZ2JLW6.mjs} +10 -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 +19 -39
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-XHGD73WZ.mjs → intent-resolver-HA7DPAUE.mjs} +46 -41
- 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-CMWOGJG5.mjs → react-root-YQUJU64P.mjs} +11 -11
- package/dist/lib/browser/react-root-YQUJU64P.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-YWZZQF7H.mjs → react-surface-HTXYMRSW.mjs} +50 -40
- package/dist/lib/browser/react-surface-HTXYMRSW.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-Z6FC4AHC.mjs → schema-defs-R56ZDBZ7.mjs} +5 -5
- package/dist/lib/browser/schema-defs-R56ZDBZ7.mjs.map +7 -0
- package/dist/lib/browser/{settings-4IMP5RYT.mjs → settings-5XPQMSPO.mjs} +5 -5
- package/dist/lib/browser/{settings-4IMP5RYT.mjs.map → settings-5XPQMSPO.mjs.map} +1 -1
- package/dist/lib/browser/{spaces-ready-TOPG6IV4.mjs → spaces-ready-YY77ANIF.mjs} +17 -15
- package/dist/lib/browser/spaces-ready-YY77ANIF.mjs.map +7 -0
- package/dist/lib/browser/{state-QYZAB45H.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-ZJIFCWKZ.mjs → CollectionMain-EU57SRYK.mjs} +4 -4
- package/dist/lib/node-esm/CollectionMain-EU57SRYK.mjs.map +7 -0
- package/dist/lib/node-esm/{ObjectDetailsPanel-QKZEDSZK.mjs → ObjectDetailsPanel-TQ5GN4QJ.mjs} +10 -8
- 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-SG4VECBB.mjs → app-graph-builder-5ZJJUMQI.mjs} +80 -43
- package/dist/lib/node-esm/app-graph-builder-5ZJJUMQI.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-2ICUGQQT.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-P442DOQ3.mjs → chunk-5XRYHWL7.mjs} +10 -9
- package/dist/lib/node-esm/chunk-5XRYHWL7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JH6F4C3I.mjs → chunk-6WNZW6KT.mjs} +14 -8
- package/dist/lib/node-esm/chunk-6WNZW6KT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2A3VBXBP.mjs → chunk-BLPXWPLB.mjs} +139 -150
- 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-4AOMYKDE.mjs → chunk-XDQXUZMK.mjs} +93 -41
- 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 +19 -39
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-LEANKSKZ.mjs → intent-resolver-LQNHMPIX.mjs} +46 -41
- 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-5Y7LJRX6.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-YQFNIKYT.mjs → react-surface-LYDYON3U.mjs} +50 -40
- package/dist/lib/node-esm/react-surface-LYDYON3U.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-WHJM7UZE.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-SAOBPND3.mjs → settings-XBSK5KHH.mjs} +5 -5
- package/dist/lib/node-esm/{settings-SAOBPND3.mjs.map → settings-XBSK5KHH.mjs.map} +1 -1
- package/dist/lib/node-esm/{spaces-ready-HIUKNDZK.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-ZVEHQ4BJ.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 +3 -3
- 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/CreateDialog/CreateObjectDialog.d.ts +3 -3
- 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/ObjectDetailsPanel.d.ts.map +1 -1
- 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/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.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/ViewEditor.d.ts +1 -1
- package/dist/types/src/components/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +8 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- 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 +1216 -26
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +73 -93
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +8 -6
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +63 -62
- package/src/SpacePlugin.ts +203 -218
- package/src/capabilities/app-graph-builder.ts +100 -53
- package/src/capabilities/app-graph-serializer.ts +7 -7
- package/src/capabilities/capabilities.ts +11 -10
- package/src/capabilities/identity-created.ts +1 -1
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/intent-resolver.ts +36 -24
- package/src/capabilities/react-root.tsx +4 -3
- package/src/capabilities/react-surface.tsx +45 -36
- 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 +3 -3
- package/src/components/CollectionMain.tsx +2 -2
- package/src/components/CollectionSection.tsx +2 -2
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +11 -10
- package/src/components/CreateDialog/CreateObjectDialog.tsx +21 -11
- 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 +12 -13
- package/src/components/MenuFooter.tsx +2 -2
- package/src/components/ObjectDetailsPanel.tsx +6 -4
- 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 +2 -2
- package/src/components/PopoverRenameObject.tsx +9 -15
- 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 +4 -3
- package/src/components/ViewEditor.tsx +13 -18
- package/src/components/index.ts +1 -0
- package/src/events.ts +7 -7
- package/src/hooks/useActiveSpace.ts +2 -2
- package/src/hooks/useInputSurfaceLookup.tsx +1 -1
- package/src/meta.ts +1 -3
- package/src/translations.ts +8 -7
- package/src/types/types.ts +15 -10
- package/src/util.tsx +86 -37
- package/dist/lib/browser/CollectionMain-D2B75XBS.mjs.map +0 -7
- package/dist/lib/browser/ObjectDetailsPanel-YPTDQKMG.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-V3MP3CDK.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-H6AW7KGS.mjs.map +0 -7
- package/dist/lib/browser/chunk-CEFHNVU7.mjs +0 -20
- package/dist/lib/browser/chunk-CEFHNVU7.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-FBJEXW54.mjs.map +0 -7
- package/dist/lib/browser/chunk-JS3MMC42.mjs +0 -19
- package/dist/lib/browser/chunk-JS3MMC42.mjs.map +0 -7
- package/dist/lib/browser/chunk-QACNNDOT.mjs.map +0 -7
- package/dist/lib/browser/chunk-SGTQ52SU.mjs.map +0 -7
- package/dist/lib/browser/chunk-XUYKJUU7.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-XHGD73WZ.mjs.map +0 -7
- package/dist/lib/browser/react-root-CMWOGJG5.mjs.map +0 -7
- package/dist/lib/browser/react-surface-YWZZQF7H.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-Z6FC4AHC.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-TOPG6IV4.mjs.map +0 -7
- package/dist/lib/browser/state-QYZAB45H.mjs.map +0 -7
- package/dist/lib/node-esm/CollectionMain-ZJIFCWKZ.mjs.map +0 -7
- package/dist/lib/node-esm/ObjectDetailsPanel-QKZEDSZK.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-SG4VECBB.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-2ICUGQQT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2A3VBXBP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4AOMYKDE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5HHYE264.mjs +0 -20
- package/dist/lib/node-esm/chunk-5HHYE264.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5T3ZH23B.mjs +0 -21
- package/dist/lib/node-esm/chunk-5T3ZH23B.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HWNG4MEU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JH6F4C3I.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-P442DOQ3.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-LEANKSKZ.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-5Y7LJRX6.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-YQFNIKYT.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-WHJM7UZE.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-HIUKNDZK.mjs.map +0 -7
- package/dist/lib/node-esm/state-ZVEHQ4BJ.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
|
@@ -5,23 +5,23 @@
|
|
|
5
5
|
import { Effect, type Schema } from 'effect';
|
|
6
6
|
import React, { useCallback, useRef } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
9
|
import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { Form } from '@dxos/react-ui-form';
|
|
11
11
|
import { cardDialogContent, cardDialogHeader } from '@dxos/react-ui-stack';
|
|
12
12
|
|
|
13
13
|
import { useInputSurfaceLookup } from '../../hooks';
|
|
14
|
-
import {
|
|
14
|
+
import { meta } from '../../meta';
|
|
15
15
|
import { SpaceAction, SpaceForm } from '../../types';
|
|
16
16
|
|
|
17
|
-
export const CREATE_SPACE_DIALOG = `${
|
|
17
|
+
export const CREATE_SPACE_DIALOG = `${meta.id}/CreateSpaceDialog`;
|
|
18
18
|
|
|
19
19
|
type FormValues = Schema.Schema.Type<typeof SpaceForm>;
|
|
20
20
|
const initialValues: FormValues = { edgeReplication: true };
|
|
21
21
|
|
|
22
22
|
export const CreateSpaceDialog = () => {
|
|
23
23
|
const closeRef = useRef<HTMLButtonElement | null>(null);
|
|
24
|
-
const { t } = useTranslation(
|
|
24
|
+
const { t } = useTranslation(meta.id);
|
|
25
25
|
const { dispatch } = useIntentDispatcher();
|
|
26
26
|
|
|
27
27
|
const inputSurfaceLookup = useInputSurfaceLookup();
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent, useAppGraph, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { Trigger } from '@dxos/async';
|
|
9
9
|
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
10
10
|
import { useClient } from '@dxos/react-client';
|
|
@@ -13,9 +13,9 @@ import { type InvitationResult } from '@dxos/react-client/invitations';
|
|
|
13
13
|
import { Dialog, useTranslation } from '@dxos/react-ui';
|
|
14
14
|
import { JoinPanel, type JoinPanelProps } from '@dxos/shell/react';
|
|
15
15
|
|
|
16
|
-
import {
|
|
16
|
+
import { meta } from '../meta';
|
|
17
17
|
|
|
18
|
-
export const JOIN_DIALOG = `${
|
|
18
|
+
export const JOIN_DIALOG = `${meta.id}/JoinDialog`;
|
|
19
19
|
|
|
20
20
|
export type JoinDialogProps = JoinPanelProps & {
|
|
21
21
|
navigableCollections?: boolean;
|
|
@@ -25,7 +25,7 @@ export const JoinDialog = ({ navigableCollections, onDone, ...props }: JoinDialo
|
|
|
25
25
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
26
26
|
const client = useClient();
|
|
27
27
|
const { graph } = useAppGraph();
|
|
28
|
-
const { t } = useTranslation(
|
|
28
|
+
const { t } = useTranslation(meta.id);
|
|
29
29
|
|
|
30
30
|
const handleDone = useCallback(
|
|
31
31
|
async (result: InvitationResult | null) => {
|
|
@@ -39,10 +39,10 @@ export const JoinDialog = ({ navigableCollections, onDone, ...props }: JoinDialo
|
|
|
39
39
|
createIntent(LayoutAction.AddToast, {
|
|
40
40
|
part: 'toast',
|
|
41
41
|
subject: {
|
|
42
|
-
id: `${
|
|
42
|
+
id: `${meta.id}/join-success`,
|
|
43
43
|
duration: 5_000,
|
|
44
|
-
title: ['join success label', { ns:
|
|
45
|
-
closeLabel: ['dismiss label', { ns:
|
|
44
|
+
title: ['join success label', { ns: meta.id }],
|
|
45
|
+
closeLabel: ['dismiss label', { ns: meta.id }],
|
|
46
46
|
},
|
|
47
47
|
}),
|
|
48
48
|
),
|
|
@@ -2,29 +2,55 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type StoryObj, type Meta } from '@storybook/react-vite';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React from 'react';
|
|
8
7
|
|
|
8
|
+
import { IntentPlugin } from '@dxos/app-framework';
|
|
9
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { useSpace } from '@dxos/react-client/echo';
|
|
9
11
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
12
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
10
13
|
import { translations as shellTranslations } from '@dxos/shell/react';
|
|
11
|
-
import {
|
|
14
|
+
import { render } from '@dxos/storybook-utils';
|
|
12
15
|
|
|
13
|
-
import { MembersContainer } from './MembersContainer';
|
|
14
16
|
import { translations } from '../translations';
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
import { MembersContainer } from './MembersContainer';
|
|
19
|
+
|
|
20
|
+
const DefaultStory = () => {
|
|
21
|
+
const space = useSpace();
|
|
22
|
+
if (!space) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<MembersContainer
|
|
28
|
+
space={space}
|
|
29
|
+
createInvitationUrl={(invitationCode) => `https://dxos.org/invite/${invitationCode}`}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const meta = {
|
|
17
35
|
title: 'plugins/plugin-space/MembersContainer',
|
|
18
|
-
component: MembersContainer,
|
|
19
|
-
|
|
36
|
+
component: MembersContainer as any,
|
|
37
|
+
render: render(DefaultStory),
|
|
38
|
+
decorators: [
|
|
39
|
+
withTheme, // TODO(wittjosiah): Try to write story which does not depend on plugin manager.
|
|
40
|
+
withPluginManager({ plugins: [IntentPlugin()] }),
|
|
41
|
+
withClientProvider({
|
|
42
|
+
createIdentity: true,
|
|
43
|
+
createSpace: true,
|
|
44
|
+
}),
|
|
45
|
+
],
|
|
20
46
|
parameters: {
|
|
21
47
|
layout: 'fullscreen',
|
|
22
48
|
translations: [...translations, ...shellTranslations],
|
|
23
49
|
},
|
|
24
|
-
}
|
|
50
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
25
51
|
|
|
26
52
|
export default meta;
|
|
27
53
|
|
|
28
|
-
type Story = StoryObj<typeof
|
|
54
|
+
type Story = StoryObj<typeof meta>;
|
|
29
55
|
|
|
30
56
|
export const Default: Story = {};
|
|
@@ -8,10 +8,10 @@ import { QR } from 'react-qr-rounded';
|
|
|
8
8
|
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
9
|
import { log } from '@dxos/log';
|
|
10
10
|
import { useConfig } from '@dxos/react-client';
|
|
11
|
-
import { fullyQualifiedId, useSpaceInvitations
|
|
11
|
+
import { type Space, fullyQualifiedId, useSpaceInvitations } from '@dxos/react-client/echo';
|
|
12
12
|
import { type CancellableInvitationObservable, Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
|
|
13
13
|
import { Button, Clipboard, Icon, Input, useId, useTranslation } from '@dxos/react-ui';
|
|
14
|
-
import {
|
|
14
|
+
import { ControlFrame, ControlFrameItem, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
15
15
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
16
16
|
import { DataType } from '@dxos/schema';
|
|
17
17
|
import {
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from '@dxos/shell/react';
|
|
27
27
|
import { hexToEmoji } from '@dxos/util';
|
|
28
28
|
|
|
29
|
-
import {
|
|
29
|
+
import { meta } from '../meta';
|
|
30
30
|
import { SpaceAction } from '../types';
|
|
31
31
|
import { COMPOSER_SPACE_LOCK } from '../util';
|
|
32
32
|
|
|
@@ -41,14 +41,13 @@ const handleInvitationEvent = (invitation: Invitation, subscription: ZenObservab
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
export
|
|
45
|
-
space,
|
|
46
|
-
createInvitationUrl,
|
|
47
|
-
}: {
|
|
44
|
+
export type MembersContainerProps = {
|
|
48
45
|
space: Space;
|
|
49
46
|
createInvitationUrl: (invitationCode: string) => string;
|
|
50
|
-
}
|
|
51
|
-
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const MembersContainer = ({ space, createInvitationUrl }: MembersContainerProps) => {
|
|
50
|
+
const { t } = useTranslation(meta.id);
|
|
52
51
|
const config = useConfig();
|
|
53
52
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
54
53
|
const invitations = useSpaceInvitations(space.key);
|
|
@@ -76,7 +75,7 @@ export const MembersContainer = ({
|
|
|
76
75
|
inviteOne: {
|
|
77
76
|
label: t('invite one label', { ns: 'os' }),
|
|
78
77
|
description: t('invite one description', { ns: 'os' }),
|
|
79
|
-
icon:
|
|
78
|
+
icon: 'ph--user-plus--regular',
|
|
80
79
|
testId: 'membersContainer.inviteOne',
|
|
81
80
|
onClick: async () => {
|
|
82
81
|
const { data: invitation } = await dispatch(
|
|
@@ -98,7 +97,7 @@ export const MembersContainer = ({
|
|
|
98
97
|
inviteMany: {
|
|
99
98
|
label: t('invite many label', { ns: 'os' }),
|
|
100
99
|
description: t('invite many description', { ns: 'os' }),
|
|
101
|
-
icon:
|
|
100
|
+
icon: 'ph--users-three--regular',
|
|
102
101
|
testId: 'membersContainer.inviteMany',
|
|
103
102
|
onClick: async () => {
|
|
104
103
|
const { data: invitation } = await dispatch(
|
|
@@ -168,7 +167,7 @@ export const MembersContainer = ({
|
|
|
168
167
|
)}
|
|
169
168
|
</ControlFrame>
|
|
170
169
|
{/* TODO(wittjosiah): Make ControlItemInput & ControlFrame compatible. */}
|
|
171
|
-
<div className='justify-center
|
|
170
|
+
<div className='justify-center p-0 mbs-4 container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]'>
|
|
172
171
|
<ControlItemInput title={t('space locked label')} description={t('space locked description')}>
|
|
173
172
|
<Input.Switch checked={locked} onCheckedChange={handleChangeLocked} classNames='justify-self-end' />
|
|
174
173
|
</ControlItemInput>
|
|
@@ -231,7 +230,7 @@ const InvitationQR = ({ id, url, onCancel }: { id: string; url: string; onCancel
|
|
|
231
230
|
const emoji = hexToEmoji(id);
|
|
232
231
|
return (
|
|
233
232
|
<>
|
|
234
|
-
<p className='text-description'>{t('qr code description', { ns:
|
|
233
|
+
<p className='text-description'>{t('qr code description', { ns: meta.id })}</p>
|
|
235
234
|
<div role='group' className='grid grid-cols-[1fr_min-content] mlb-2 gap-2'>
|
|
236
235
|
<div role='none' className='is-full aspect-square relative text-description'>
|
|
237
236
|
<QR
|
|
@@ -9,11 +9,11 @@ import { type Obj } from '@dxos/echo';
|
|
|
9
9
|
import { useClient } from '@dxos/react-client';
|
|
10
10
|
import { DropdownMenu, Icon, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { meta } from '../meta';
|
|
13
13
|
import { getSpaceDisplayName } from '../util';
|
|
14
14
|
|
|
15
15
|
export const MenuFooter = ({ object }: { object: Obj.Any }) => {
|
|
16
|
-
const { t } = useTranslation(
|
|
16
|
+
const { t } = useTranslation(meta.id);
|
|
17
17
|
const client = useClient();
|
|
18
18
|
const space = getSpace(object);
|
|
19
19
|
const spaceName = space ? getSpaceDisplayName(space, { personal: client.spaces.default === space }) : '';
|
|
@@ -7,22 +7,24 @@ import React, { useCallback } from 'react';
|
|
|
7
7
|
import { type JsonPath, setValue } from '@dxos/echo-schema';
|
|
8
8
|
import { invariant } from '@dxos/invariant';
|
|
9
9
|
import { useClient } from '@dxos/react-client';
|
|
10
|
-
import {
|
|
10
|
+
import { Filter, getSpace, useQuery, useSchema } from '@dxos/react-client/echo';
|
|
11
11
|
import { Callout, useTranslation } from '@dxos/react-ui';
|
|
12
12
|
import { useSelected } from '@dxos/react-ui-attention';
|
|
13
13
|
import { Form, useRefQueryLookupHandler } from '@dxos/react-ui-form';
|
|
14
14
|
import { type DataType } from '@dxos/schema';
|
|
15
|
+
import { typenameFromQuery } from '@dxos/schema';
|
|
15
16
|
import { isNonNullable } from '@dxos/util';
|
|
16
17
|
|
|
17
|
-
import {
|
|
18
|
+
import { meta } from '../meta';
|
|
18
19
|
|
|
19
20
|
type RowDetailsPanelProps = { objectId: string; view: DataType.View };
|
|
20
21
|
|
|
21
22
|
const ObjectDetailsPanel = ({ objectId, view }: RowDetailsPanelProps) => {
|
|
22
|
-
const { t } = useTranslation(
|
|
23
|
+
const { t } = useTranslation(meta.id);
|
|
23
24
|
const client = useClient();
|
|
24
25
|
const space = getSpace(view);
|
|
25
|
-
const
|
|
26
|
+
const typename = view.query ? typenameFromQuery(view.query.ast) : undefined;
|
|
27
|
+
const schema = useSchema(client, space, typename);
|
|
26
28
|
|
|
27
29
|
const queriedObjects = useQuery(space, schema ? Filter.type(schema) : Filter.nothing());
|
|
28
30
|
const selectedRows = useSelected(objectId, 'multi');
|
|
@@ -9,8 +9,9 @@ import { ForeignKey } from '@dxos/echo-schema';
|
|
|
9
9
|
import { IconButton, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { Form } from '@dxos/react-ui-form';
|
|
11
11
|
|
|
12
|
+
import { meta } from '../../meta';
|
|
13
|
+
|
|
12
14
|
import { ForeignKeys } from './ForeignKeys';
|
|
13
|
-
import { SPACE_PLUGIN } from '../../meta';
|
|
14
15
|
|
|
15
16
|
const initialValues = {
|
|
16
17
|
source: '',
|
|
@@ -22,7 +23,7 @@ export type AdvancedObjectSettingsProps = {
|
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
export const AdvancedObjectSettings = ({ object }: AdvancedObjectSettingsProps) => {
|
|
25
|
-
const { t } = useTranslation(
|
|
26
|
+
const { t } = useTranslation(meta.id);
|
|
26
27
|
const [adding, setAdding] = useState(false);
|
|
27
28
|
const { keys } = Obj.getMeta(object);
|
|
28
29
|
|
|
@@ -7,7 +7,7 @@ import React, { useCallback } from 'react';
|
|
|
7
7
|
import { type ForeignKey } from '@dxos/echo-schema';
|
|
8
8
|
import { IconButton, List, ListItem, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { meta } from '../../meta';
|
|
11
11
|
|
|
12
12
|
export type ForeignKeysProps = {
|
|
13
13
|
keys: ForeignKey[];
|
|
@@ -31,7 +31,7 @@ type KeyItemProps = {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
const KeyItem = ({ forignKey, onDelete }: KeyItemProps) => {
|
|
34
|
-
const { t } = useTranslation(
|
|
34
|
+
const { t } = useTranslation(meta.id);
|
|
35
35
|
|
|
36
36
|
const handleDelete = useCallback(() => {
|
|
37
37
|
onDelete?.(forignKey);
|
|
@@ -6,7 +6,7 @@ import React, { useMemo } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { Surface } from '@dxos/app-framework';
|
|
8
8
|
import { type Obj } from '@dxos/echo';
|
|
9
|
-
import { Clipboard } from '@dxos/react-ui';
|
|
9
|
+
import { Clipboard, Toolbar } from '@dxos/react-ui';
|
|
10
10
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
11
11
|
|
|
12
12
|
import { BaseObjectSettings } from './BaseObjectSettings';
|
|
@@ -21,7 +21,8 @@ export const ObjectSettingsContainer = ({ object, role }: ObjectSettingsContaine
|
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
23
|
<Clipboard.Provider>
|
|
24
|
-
<StackItem.Content toolbar
|
|
24
|
+
<StackItem.Content toolbar>
|
|
25
|
+
<Toolbar.Root></Toolbar.Root>
|
|
25
26
|
<div role='none' className='overflow-y-auto pli-cardSpacingInline plb-cardSpacingBlock'>
|
|
26
27
|
<BaseObjectSettings object={object}>
|
|
27
28
|
<Surface role='base-object-settings' data={data} />
|
|
@@ -9,7 +9,7 @@ import { type EchoDatabase } from '@dxos/react-client/echo';
|
|
|
9
9
|
import { Icon, Tooltip, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { mx, staticPlaceholderText, warningText } from '@dxos/react-ui-theme';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { meta } from '../meta';
|
|
13
13
|
|
|
14
14
|
enum Status {
|
|
15
15
|
PERSISTED_LOCALLY = 0,
|
|
@@ -19,7 +19,7 @@ enum Status {
|
|
|
19
19
|
|
|
20
20
|
// TODO(zan): This now has no usages. Remove it?
|
|
21
21
|
export const PersistenceStatus = ({ db }: { db: EchoDatabase }) => {
|
|
22
|
-
const { t } = useTranslation(
|
|
22
|
+
const { t } = useTranslation(meta.id);
|
|
23
23
|
const [displayMessage, setDisplayMessage] = useState(false);
|
|
24
24
|
const [status, naturalSetStatus] = useState<Status>(Status.PERSISTED_LOCALLY);
|
|
25
25
|
const [prevStatus, setPrevStatus] = useState<Status>(Status.PERSISTED_LOCALLY);
|
|
@@ -4,33 +4,27 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
8
9
|
import { type Live } from '@dxos/live-object';
|
|
9
10
|
import { log } from '@dxos/log';
|
|
10
11
|
import { Button, Input, useTranslation } from '@dxos/react-ui';
|
|
11
12
|
|
|
12
|
-
import {
|
|
13
|
+
import { meta } from '../meta';
|
|
13
14
|
|
|
14
|
-
export const POPOVER_RENAME_OBJECT = `${
|
|
15
|
+
export const POPOVER_RENAME_OBJECT = `${meta.id}/PopoverRenameObject`;
|
|
15
16
|
|
|
16
|
-
export const PopoverRenameObject = ({ object
|
|
17
|
-
const { t } = useTranslation(
|
|
17
|
+
export const PopoverRenameObject = ({ object }: { object: Live<any> }) => {
|
|
18
|
+
const { t } = useTranslation(meta.id);
|
|
18
19
|
const doneButton = useRef<HTMLButtonElement>(null);
|
|
19
|
-
|
|
20
|
-
const object = obj as any;
|
|
21
|
-
// TODO(burdon): Field should not be hardcoded field.
|
|
22
|
-
const [name, setName] = useState(object.name || object.title || '');
|
|
20
|
+
const [name, setName] = useState(Obj.getLabel(object));
|
|
23
21
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
24
22
|
|
|
25
23
|
const handleDone = useCallback(() => {
|
|
26
24
|
try {
|
|
27
|
-
|
|
25
|
+
name && Obj.setLabel(object, name);
|
|
28
26
|
} catch (err) {
|
|
29
|
-
|
|
30
|
-
object.title = name;
|
|
31
|
-
} catch {
|
|
32
|
-
log.error('Failed to rename object', { err });
|
|
33
|
-
}
|
|
27
|
+
log.error('Failed to rename object', { err });
|
|
34
28
|
}
|
|
35
29
|
void dispatch(
|
|
36
30
|
createIntent(LayoutAction.UpdatePopover, {
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { type Space } from '@dxos/react-client/echo';
|
|
9
9
|
import { Button, Input, Popover, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { meta } from '../meta';
|
|
12
12
|
|
|
13
|
-
export const POPOVER_RENAME_SPACE = `${
|
|
13
|
+
export const POPOVER_RENAME_SPACE = `${meta.id}/PopoverRenameSpace`;
|
|
14
14
|
|
|
15
15
|
export const PopoverRenameSpace = ({ space }: { space: Space }) => {
|
|
16
|
-
const { t } = useTranslation(
|
|
16
|
+
const { t } = useTranslation(meta.id);
|
|
17
17
|
const doneButton = useRef<HTMLButtonElement>(null);
|
|
18
18
|
const [name, setName] = useState(space.properties.name ?? '');
|
|
19
19
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useCallback } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Obj } from '@dxos/echo';
|
|
8
|
+
import { type JsonPath, setValue } from '@dxos/echo-schema';
|
|
9
|
+
import { invariant } from '@dxos/invariant';
|
|
10
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
11
|
+
import { Form, useRefQueryLookupHandler } from '@dxos/react-ui-form';
|
|
12
|
+
|
|
13
|
+
export const RecordMain = ({ record }: { record: Obj.Any }) => {
|
|
14
|
+
const space = getSpace(record);
|
|
15
|
+
const schema = Obj.getSchema(record);
|
|
16
|
+
invariant(schema, 'Record has no schema.');
|
|
17
|
+
|
|
18
|
+
const handleRefQueryLookup = useRefQueryLookupHandler({ space });
|
|
19
|
+
|
|
20
|
+
const handleSave = useCallback(
|
|
21
|
+
(values: any, { changed }: { changed: Record<JsonPath, boolean> }) => {
|
|
22
|
+
const id = values.id;
|
|
23
|
+
invariant(typeof id === 'string');
|
|
24
|
+
|
|
25
|
+
const changedPaths = Object.keys(changed).filter((path) => changed[path as JsonPath]) as JsonPath[];
|
|
26
|
+
for (const path of changedPaths) {
|
|
27
|
+
const value = values[path];
|
|
28
|
+
setValue(record, path, value);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
[record],
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div role='none' className='container-max-width flex flex-col p-2 gap-1 overflow-y-auto'>
|
|
36
|
+
<div key={record.id} className='border border-separator rounded'>
|
|
37
|
+
<Form autoSave schema={schema} values={record} onSave={handleSave} onQueryRefOptions={handleRefQueryLookup} />
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default RecordMain;
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { type Type } from '@dxos/echo';
|
|
8
8
|
import { type Space } from '@dxos/react-client/echo';
|
|
9
9
|
import { useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import {
|
|
10
|
+
import { ControlPage, ControlSection, controlItemClasses } from '@dxos/react-ui-form';
|
|
11
11
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { meta } from '../meta';
|
|
14
14
|
|
|
15
15
|
type SchemaPanelProps = { space: Space };
|
|
16
16
|
|
|
@@ -37,7 +37,7 @@ export const useQuerySpaceSchemas = (space: Space): Type.Schema[] => {
|
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
export const SchemaContainer = ({ space }: SchemaPanelProps) => {
|
|
40
|
-
const { t } = useTranslation(
|
|
40
|
+
const { t } = useTranslation(meta.id);
|
|
41
41
|
const schemas = useQuerySpaceSchemas(space);
|
|
42
42
|
|
|
43
43
|
return (
|
|
@@ -7,31 +7,30 @@ import React from 'react';
|
|
|
7
7
|
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { useClient } from '@dxos/react-client';
|
|
9
9
|
import { useSpaces } from '@dxos/react-client/echo';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { IconButton, Input, List, ListItem, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
11
|
+
import { ControlGroup, ControlItemInput, ControlPage, ControlSection, controlItemClasses } from '@dxos/react-ui-form';
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { meta } from '../meta';
|
|
14
14
|
import { SpaceAction, type SpaceSettingsProps } from '../types';
|
|
15
15
|
import { getSpaceDisplayName } from '../util';
|
|
16
16
|
|
|
17
17
|
export const SpacePluginSettings = ({ settings }: { settings: SpaceSettingsProps }) => {
|
|
18
|
-
const { t } = useTranslation(
|
|
18
|
+
const { t } = useTranslation(meta.id);
|
|
19
19
|
const client = useClient();
|
|
20
20
|
const spaces = useSpaces({ all: settings.showHidden });
|
|
21
21
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
22
22
|
|
|
23
|
-
// TODO(wittjosiah): Migrate to new form container.
|
|
24
23
|
return (
|
|
25
24
|
<ControlPage>
|
|
26
25
|
<ControlSection title={t('space settings label')} description={t('space settings description')}>
|
|
27
|
-
<
|
|
28
|
-
<
|
|
26
|
+
<ControlGroup>
|
|
27
|
+
<ControlItemInput title={t('show hidden spaces label')}>
|
|
29
28
|
<Input.Switch
|
|
30
29
|
checked={settings.showHidden}
|
|
31
30
|
onCheckedChange={(checked) => (settings.showHidden = !!checked)}
|
|
32
31
|
/>
|
|
33
|
-
</
|
|
34
|
-
</
|
|
32
|
+
</ControlItemInput>
|
|
33
|
+
</ControlGroup>
|
|
35
34
|
<List classNames={[controlItemClasses, 'flex flex-col gap-trimSm']}>
|
|
36
35
|
{spaces.map((space) => (
|
|
37
36
|
<ListItem.Root key={space.id} classNames='is-full items-center'>
|
|
@@ -2,19 +2,18 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
8
|
import { IdentityDid, PublicKey } from '@dxos/keys';
|
|
11
9
|
import { HaloSpaceMember, SpaceMember } from '@dxos/react-client/echo';
|
|
12
|
-
import {
|
|
10
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
13
11
|
|
|
14
|
-
import { FullPresence, type MemberPresenceProps, SmallPresence, type Member } from './SpacePresence';
|
|
15
12
|
import { translations } from '../translations';
|
|
16
13
|
|
|
17
|
-
|
|
14
|
+
import { FullPresence, type Member, type MemberPresenceProps, SmallPresence } from './SpacePresence';
|
|
15
|
+
|
|
16
|
+
const viewers = (n: number, currentlyAttended = true): Member[] =>
|
|
18
17
|
Array.from({ length: n }, () => ({
|
|
19
18
|
role: HaloSpaceMember.Role.ADMIN,
|
|
20
19
|
identity: { did: IdentityDid.random(), identityKey: PublicKey.random() },
|
|
@@ -23,6 +22,16 @@ const nViewers = (n: number, currentlyAttended = true): Member[] =>
|
|
|
23
22
|
currentlyAttended,
|
|
24
23
|
}));
|
|
25
24
|
|
|
25
|
+
const meta = {
|
|
26
|
+
title: 'plugins/plugin-space/SpacePresence',
|
|
27
|
+
decorators: [withTheme],
|
|
28
|
+
parameters: {
|
|
29
|
+
translations,
|
|
30
|
+
},
|
|
31
|
+
} satisfies Meta<typeof IdentityDid>;
|
|
32
|
+
|
|
33
|
+
export default meta;
|
|
34
|
+
|
|
26
35
|
export const Full = (props: MemberPresenceProps) => {
|
|
27
36
|
const p: MemberPresenceProps = {
|
|
28
37
|
...props,
|
|
@@ -31,31 +40,31 @@ export const Full = (props: MemberPresenceProps) => {
|
|
|
31
40
|
return (
|
|
32
41
|
<div className='p-4'>
|
|
33
42
|
<div className='p-3'>
|
|
34
|
-
<FullPresence members={
|
|
43
|
+
<FullPresence members={viewers(1)} {...p} />
|
|
35
44
|
</div>
|
|
36
45
|
<div className='p-3'>
|
|
37
|
-
<FullPresence members={
|
|
46
|
+
<FullPresence members={viewers(2)} {...p} />
|
|
38
47
|
</div>
|
|
39
48
|
<div className='p-3'>
|
|
40
|
-
<FullPresence members={
|
|
49
|
+
<FullPresence members={viewers(3)} {...p} />
|
|
41
50
|
</div>
|
|
42
51
|
<div className='p-3'>
|
|
43
|
-
<FullPresence members={
|
|
52
|
+
<FullPresence members={viewers(3, false)} {...p} />
|
|
44
53
|
</div>
|
|
45
54
|
<div className='p-3'>
|
|
46
|
-
<FullPresence members={
|
|
55
|
+
<FullPresence members={viewers(4)} {...p} />
|
|
47
56
|
</div>
|
|
48
57
|
<div className='p-3'>
|
|
49
|
-
<FullPresence members={
|
|
58
|
+
<FullPresence members={viewers(5)} {...p} />
|
|
50
59
|
</div>
|
|
51
60
|
<div className='p-3'>
|
|
52
|
-
<FullPresence members={
|
|
61
|
+
<FullPresence members={viewers(5, false)} {...p} />
|
|
53
62
|
</div>
|
|
54
63
|
<div className='p-3'>
|
|
55
|
-
<FullPresence members={
|
|
64
|
+
<FullPresence members={viewers(10)} {...p} />
|
|
56
65
|
</div>
|
|
57
66
|
<div className='p-3'>
|
|
58
|
-
<FullPresence members={
|
|
67
|
+
<FullPresence members={viewers(100)} {...p} />
|
|
59
68
|
</div>
|
|
60
69
|
</div>
|
|
61
70
|
);
|
|
@@ -97,11 +106,3 @@ export const Small = () => {
|
|
|
97
106
|
</div>
|
|
98
107
|
);
|
|
99
108
|
};
|
|
100
|
-
|
|
101
|
-
const meta: Meta = {
|
|
102
|
-
title: 'plugins/plugin-space/SpacePresence',
|
|
103
|
-
decorators: [withTheme, withLayout()],
|
|
104
|
-
parameters: { translations },
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export default meta;
|