@dxos/plugin-space 0.8.4-main.84f28bd → 0.8.4-main.a4bbb77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/CollectionMain-AX7KKXWP.mjs +31 -0
- package/dist/lib/browser/CollectionMain-AX7KKXWP.mjs.map +7 -0
- package/dist/lib/browser/ObjectDetailsPanel-ETI5YBTH.mjs +90 -0
- package/dist/lib/browser/ObjectDetailsPanel-ETI5YBTH.mjs.map +7 -0
- package/dist/lib/browser/RecordMain-TEBGAVSL.mjs +68 -0
- package/dist/lib/browser/RecordMain-TEBGAVSL.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-PMDF6PJV.mjs → app-graph-builder-W7RVDAUA.mjs} +202 -48
- package/dist/lib/browser/app-graph-builder-W7RVDAUA.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-UKYMBX4O.mjs → app-graph-serializer-VLHVTDX4.mjs} +14 -14
- package/dist/lib/browser/app-graph-serializer-VLHVTDX4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GVTXQCIW.mjs → chunk-2BFVC5K6.mjs} +431 -373
- package/dist/lib/browser/chunk-2BFVC5K6.mjs.map +7 -0
- package/dist/lib/browser/chunk-E2I747A7.mjs +20 -0
- package/dist/lib/browser/chunk-E2I747A7.mjs.map +7 -0
- package/dist/lib/browser/chunk-EIXZABXD.mjs +19 -0
- package/dist/lib/browser/chunk-EIXZABXD.mjs.map +7 -0
- package/dist/lib/browser/{chunk-VLBRSGJ2.mjs → chunk-ELJDGQTO.mjs} +3 -3
- package/dist/lib/browser/{chunk-VLBRSGJ2.mjs.map → chunk-ELJDGQTO.mjs.map} +3 -3
- package/dist/lib/browser/chunk-IRKDREHY.mjs +11 -0
- package/dist/lib/browser/chunk-IRKDREHY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-S6NY637J.mjs → chunk-JCHSUOPF.mjs} +70 -10
- package/dist/lib/browser/chunk-JCHSUOPF.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WBSEOLEM.mjs → chunk-PN27K4I7.mjs} +209 -54
- package/dist/lib/browser/chunk-PN27K4I7.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6VLSHG4A.mjs → chunk-ZIZ2JLW6.mjs} +71 -9
- package/dist/lib/browser/chunk-ZIZ2JLW6.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-23XJJV2N.mjs → identity-created-PW2BA46S.mjs} +4 -4
- package/dist/lib/browser/{identity-created-23XJJV2N.mjs.map → identity-created-PW2BA46S.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +95 -26
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-WK5WYFH3.mjs → intent-resolver-HA7DPAUE.mjs} +185 -30
- package/dist/lib/browser/intent-resolver-HA7DPAUE.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-7S6FIC5G.mjs → react-root-YQUJU64P.mjs} +11 -11
- package/dist/lib/browser/react-root-YQUJU64P.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-6C3YJNDK.mjs → react-surface-HTXYMRSW.mjs} +78 -46
- package/dist/lib/browser/react-surface-HTXYMRSW.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-K3B3OAH4.mjs → schema-defs-R56ZDBZ7.mjs} +5 -5
- package/dist/lib/browser/schema-defs-R56ZDBZ7.mjs.map +7 -0
- package/dist/lib/browser/{settings-XNWYRWNM.mjs → settings-5XPQMSPO.mjs} +5 -5
- package/dist/lib/browser/{settings-XNWYRWNM.mjs.map → settings-5XPQMSPO.mjs.map} +1 -1
- package/dist/lib/browser/{spaces-ready-K7NSNBHM.mjs → spaces-ready-YY77ANIF.mjs} +17 -15
- package/dist/lib/browser/spaces-ready-YY77ANIF.mjs.map +7 -0
- package/dist/lib/browser/{state-522XTUR4.mjs → state-Y4RVCG4A.mjs} +7 -7
- package/dist/lib/browser/state-Y4RVCG4A.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/CollectionMain-EU57SRYK.mjs +32 -0
- package/dist/lib/node-esm/CollectionMain-EU57SRYK.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-TQ5GN4QJ.mjs +91 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-TQ5GN4QJ.mjs.map +7 -0
- package/dist/lib/node-esm/RecordMain-WLYJMYER.mjs +70 -0
- package/dist/lib/node-esm/RecordMain-WLYJMYER.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-TO72W6MI.mjs → app-graph-builder-5ZJJUMQI.mjs} +202 -48
- package/dist/lib/node-esm/app-graph-builder-5ZJJUMQI.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-LA3IZDXJ.mjs → app-graph-serializer-EZJSGJUT.mjs} +14 -14
- package/dist/lib/node-esm/app-graph-serializer-EZJSGJUT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SXD6T2N4.mjs → chunk-5XRYHWL7.mjs} +71 -9
- package/dist/lib/node-esm/chunk-5XRYHWL7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2THX6G4C.mjs → chunk-6WNZW6KT.mjs} +70 -10
- package/dist/lib/node-esm/chunk-6WNZW6KT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OUBADVJE.mjs → chunk-BLPXWPLB.mjs} +431 -373
- package/dist/lib/node-esm/chunk-BLPXWPLB.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-IJVBBVCL.mjs +21 -0
- package/dist/lib/node-esm/chunk-IJVBBVCL.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HWNG4MEU.mjs → chunk-MWNATOXL.mjs} +2 -4
- package/dist/lib/node-esm/chunk-MWNATOXL.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SSLBYZEY.mjs → chunk-Q6AAQLQG.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-SSLBYZEY.mjs.map → chunk-Q6AAQLQG.mjs.map} +3 -3
- package/dist/lib/node-esm/chunk-SVFKU7EW.mjs +20 -0
- package/dist/lib/node-esm/chunk-SVFKU7EW.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HJJHLWKY.mjs → chunk-XDQXUZMK.mjs} +209 -54
- package/dist/lib/node-esm/chunk-XDQXUZMK.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-IJQO6GCR.mjs → identity-created-MWTLGQRU.mjs} +4 -4
- package/dist/lib/node-esm/{identity-created-IJQO6GCR.mjs.map → identity-created-MWTLGQRU.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +95 -26
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-HSR27ME4.mjs → intent-resolver-LQNHMPIX.mjs} +185 -30
- package/dist/lib/node-esm/intent-resolver-LQNHMPIX.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-HUK3ANLV.mjs → react-root-UTLJEIKE.mjs} +11 -11
- package/dist/lib/node-esm/react-root-UTLJEIKE.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-AGAWX7DD.mjs → react-surface-LYDYON3U.mjs} +78 -46
- package/dist/lib/node-esm/react-surface-LYDYON3U.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-4MCDG4DV.mjs → schema-defs-7IMJPIWS.mjs} +5 -5
- package/dist/lib/node-esm/schema-defs-7IMJPIWS.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-YGKHGFPH.mjs → settings-XBSK5KHH.mjs} +5 -5
- package/dist/lib/node-esm/{settings-YGKHGFPH.mjs.map → settings-XBSK5KHH.mjs.map} +1 -1
- package/dist/lib/node-esm/{spaces-ready-UM2P3DCR.mjs → spaces-ready-YX4IHT4P.mjs} +17 -15
- package/dist/lib/node-esm/spaces-ready-YX4IHT4P.mjs.map +7 -0
- package/dist/lib/node-esm/{state-C4IOXPZP.mjs → state-HOHAVPUO.mjs} +7 -7
- package/dist/lib/node-esm/state-HOHAVPUO.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/SpacePlugin.d.ts +1 -1
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-serializer.d.ts +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +11 -5
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +11 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts +2 -2
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts +1 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
- package/dist/types/src/components/CollectionMain.d.ts +1 -0
- package/dist/types/src/components/CollectionMain.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +5 -4
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +1584 -4
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +5 -3
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts +1 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.d.ts +3 -2
- package/dist/types/src/components/MembersContainer.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.stories.d.ts +1584 -5
- package/dist/types/src/components/MembersContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/ObjectDetailsPanel.d.ts +9 -0
- package/dist/types/src/components/ObjectDetailsPanel.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/PersistenceStatus.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameObject.d.ts +2 -2
- package/dist/types/src/components/PopoverRenameObject.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts +1 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts.map +1 -1
- package/dist/types/src/components/RecordMain.d.ts +7 -0
- package/dist/types/src/components/RecordMain.d.ts.map +1 -0
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +1412 -4
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +1417 -4
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +1418 -5
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/status.d.ts +5 -5
- package/dist/types/src/components/ViewEditor.d.ts +8 -0
- package/dist/types/src/components/ViewEditor.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +14 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +1 -0
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/hooks/useActiveSpace.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1262 -11
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +124 -64
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +34 -7
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +61 -60
- package/src/SpacePlugin.ts +205 -137
- package/src/capabilities/app-graph-builder.ts +249 -36
- package/src/capabilities/app-graph-serializer.ts +7 -7
- package/src/capabilities/capabilities.ts +15 -9
- package/src/capabilities/identity-created.ts +1 -1
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/intent-resolver.ts +140 -19
- package/src/capabilities/react-root.tsx +4 -3
- package/src/capabilities/react-surface.tsx +93 -42
- package/src/capabilities/schema-defs.ts +3 -2
- package/src/capabilities/spaces-ready.ts +10 -7
- package/src/capabilities/state.ts +5 -4
- package/src/components/AwaitingObject.tsx +7 -9
- package/src/components/CollectionMain.tsx +4 -2
- package/src/components/CollectionSection.tsx +2 -2
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +11 -10
- package/src/components/CreateDialog/CreateObjectDialog.tsx +50 -36
- package/src/components/CreateDialog/CreateObjectPanel.tsx +22 -11
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +4 -4
- package/src/components/JoinDialog.tsx +7 -7
- package/src/components/MembersContainer.stories.tsx +36 -10
- package/src/components/MembersContainer.tsx +17 -16
- package/src/components/MenuFooter.tsx +4 -5
- package/src/components/ObjectDetailsPanel.tsx +79 -0
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +3 -2
- package/src/components/ObjectSettings/ForeignKeys.tsx +2 -2
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +3 -2
- package/src/components/PersistenceStatus.tsx +7 -8
- package/src/components/PopoverRenameObject.tsx +10 -16
- package/src/components/PopoverRenameSpace.tsx +4 -4
- package/src/components/RecordMain.tsx +43 -0
- package/src/components/SchemaContainer.tsx +4 -4
- package/src/components/SpacePluginSettings.tsx +8 -9
- package/src/components/SpacePresence.stories.tsx +23 -22
- package/src/components/SpacePresence.tsx +9 -9
- package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +17 -9
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +17 -17
- package/src/components/SyncStatus/InlineSyncStatus.tsx +2 -2
- package/src/components/SyncStatus/SyncStatus.stories.tsx +6 -7
- package/src/components/SyncStatus/SyncStatus.tsx +5 -4
- package/src/components/SyncStatus/status.ts +4 -4
- package/src/components/ViewEditor.tsx +59 -0
- package/src/components/index.ts +7 -1
- package/src/events.ts +7 -6
- package/src/hooks/useActiveSpace.ts +2 -2
- package/src/hooks/useInputSurfaceLookup.tsx +1 -1
- package/src/meta.ts +1 -3
- package/src/translations.ts +68 -5
- package/src/types/types.ts +70 -12
- package/src/util.tsx +199 -55
- package/dist/lib/browser/app-graph-builder-PMDF6PJV.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-UKYMBX4O.mjs.map +0 -7
- package/dist/lib/browser/chunk-6VLSHG4A.mjs.map +0 -7
- package/dist/lib/browser/chunk-C7KGJTAL.mjs +0 -18
- package/dist/lib/browser/chunk-C7KGJTAL.mjs.map +0 -7
- package/dist/lib/browser/chunk-FBCGT5YY.mjs +0 -13
- package/dist/lib/browser/chunk-FBCGT5YY.mjs.map +0 -7
- package/dist/lib/browser/chunk-GVTXQCIW.mjs.map +0 -7
- package/dist/lib/browser/chunk-S6NY637J.mjs.map +0 -7
- package/dist/lib/browser/chunk-WBSEOLEM.mjs.map +0 -7
- package/dist/lib/browser/chunk-XXIPJLJF.mjs +0 -19
- package/dist/lib/browser/chunk-XXIPJLJF.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-WK5WYFH3.mjs.map +0 -7
- package/dist/lib/browser/react-root-7S6FIC5G.mjs.map +0 -7
- package/dist/lib/browser/react-surface-6C3YJNDK.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-K3B3OAH4.mjs.map +0 -7
- package/dist/lib/browser/schema-tools-BNP4JTD7.mjs +0 -124
- package/dist/lib/browser/schema-tools-BNP4JTD7.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-K7NSNBHM.mjs.map +0 -7
- package/dist/lib/browser/state-522XTUR4.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-TO72W6MI.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-LA3IZDXJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2THX6G4C.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-72QMMRKC.mjs +0 -19
- package/dist/lib/node-esm/chunk-72QMMRKC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AT7LGFER.mjs +0 -20
- package/dist/lib/node-esm/chunk-AT7LGFER.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HJJHLWKY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HWNG4MEU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OUBADVJE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SXD6T2N4.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-HSR27ME4.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-HUK3ANLV.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-AGAWX7DD.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-4MCDG4DV.mjs.map +0 -7
- package/dist/lib/node-esm/schema-tools-KWW5PTML.mjs +0 -126
- package/dist/lib/node-esm/schema-tools-KWW5PTML.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-UM2P3DCR.mjs.map +0 -7
- package/dist/lib/node-esm/state-C4IOXPZP.mjs.map +0 -7
- package/dist/types/src/capabilities/schema-tool.test.d.ts +0 -2
- package/dist/types/src/capabilities/schema-tool.test.d.ts.map +0 -1
- package/dist/types/src/capabilities/schema-tools.d.ts +0 -13
- package/dist/types/src/capabilities/schema-tools.d.ts.map +0 -1
- package/src/capabilities/schema-tool.test.ts +0 -44
- package/src/capabilities/schema-tools.ts +0 -125
|
@@ -2,37 +2,45 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
8
|
+
import { IntentPlugin } from '@dxos/app-framework';
|
|
9
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
10
|
import { useClientProvider, withClientProvider } from '@dxos/react-client/testing';
|
|
11
|
-
import { withTheme } from '@dxos/
|
|
11
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
12
12
|
|
|
13
|
-
import { SpaceSettingsContainer, type SpaceSettingsContainerProps } from './SpaceSettingsContainer';
|
|
14
13
|
import { translations } from '../../translations';
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
import { SpaceSettingsContainer, type SpaceSettingsContainerProps } from './SpaceSettingsContainer';
|
|
16
|
+
|
|
17
|
+
const Story = (props: Partial<SpaceSettingsContainerProps>) => {
|
|
17
18
|
const { space } = useClientProvider();
|
|
18
19
|
return (
|
|
19
20
|
<div role='none' className='p-2 border border-primary-500 rounded'>
|
|
20
|
-
<SpaceSettingsContainer {...
|
|
21
|
+
<SpaceSettingsContainer {...props} space={space!} />
|
|
21
22
|
</div>
|
|
22
23
|
);
|
|
23
24
|
};
|
|
24
25
|
|
|
25
|
-
const meta
|
|
26
|
+
const meta = {
|
|
26
27
|
title: 'plugins/plugin-space/SpaceSettingsContainer',
|
|
27
28
|
component: SpaceSettingsContainer,
|
|
28
29
|
render: Story,
|
|
29
|
-
decorators: [
|
|
30
|
+
decorators: [
|
|
31
|
+
withTheme,
|
|
32
|
+
withClientProvider({ createIdentity: true, createSpace: true }),
|
|
33
|
+
// TODO(wittjosiah): Try to write story which does not depend on plugin manager.
|
|
34
|
+
withPluginManager({ plugins: [IntentPlugin()] }),
|
|
35
|
+
],
|
|
30
36
|
parameters: {
|
|
31
37
|
translations,
|
|
32
38
|
layout: 'centered',
|
|
33
39
|
},
|
|
34
|
-
}
|
|
40
|
+
} satisfies Meta<typeof SpaceSettingsContainer>;
|
|
35
41
|
|
|
36
42
|
export default meta;
|
|
37
43
|
|
|
44
|
+
type Story = StoryObj<typeof meta>;
|
|
45
|
+
|
|
38
46
|
export const Default: StoryObj<typeof SpaceSettingsContainer> = {};
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Schema, pipe } from 'effect';
|
|
6
6
|
import React, { type ChangeEvent, useCallback, useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { chain, createIntent,
|
|
8
|
+
import { LayoutAction, chain, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
9
|
import { log } from '@dxos/log';
|
|
10
10
|
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
11
11
|
import { useClient } from '@dxos/react-client';
|
|
12
|
-
import {
|
|
12
|
+
import { type Space, SpaceState } from '@dxos/react-client/echo';
|
|
13
13
|
import { Button, Input, useMulticastObservable, useTranslation } from '@dxos/react-ui';
|
|
14
14
|
import {
|
|
15
|
-
Form,
|
|
16
|
-
type InputComponent,
|
|
17
15
|
ControlItem,
|
|
18
16
|
ControlItemInput,
|
|
19
|
-
ControlSection,
|
|
20
17
|
ControlPage,
|
|
18
|
+
ControlSection,
|
|
19
|
+
Form,
|
|
20
|
+
type InputComponent,
|
|
21
21
|
} from '@dxos/react-ui-form';
|
|
22
22
|
import { HuePicker, IconPicker } from '@dxos/react-ui-pickers';
|
|
23
23
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
24
24
|
|
|
25
|
-
import {
|
|
25
|
+
import { meta } from '../../meta';
|
|
26
26
|
import { SpaceAction, SpaceForm } from '../../types';
|
|
27
27
|
|
|
28
28
|
const FormSchema = SpaceForm.pipe(
|
|
@@ -35,7 +35,7 @@ export type SpaceSettingsContainerProps = {
|
|
|
35
35
|
|
|
36
36
|
// TODO(wittjosiah): Handle space migrations here?
|
|
37
37
|
export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) => {
|
|
38
|
-
const { t } = useTranslation(
|
|
38
|
+
const { t } = useTranslation(meta.id);
|
|
39
39
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
40
40
|
const client = useClient();
|
|
41
41
|
const archived = useMulticastObservable(space.state) === SpaceState.SPACE_INACTIVE;
|
|
@@ -111,14 +111,14 @@ export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) =
|
|
|
111
111
|
);
|
|
112
112
|
},
|
|
113
113
|
icon: ({ type, label, getValue, onValueChange }) => {
|
|
114
|
-
const handleChange = useCallback((
|
|
115
|
-
const
|
|
114
|
+
const handleChange = useCallback((icon: string) => onValueChange(type, icon), [onValueChange, type]);
|
|
115
|
+
const handleReset = useCallback(() => onValueChange(type, undefined), [onValueChange, type]);
|
|
116
116
|
return (
|
|
117
117
|
<ControlItem title={label} description={t('icon description')}>
|
|
118
118
|
<IconPicker
|
|
119
119
|
value={getValue()}
|
|
120
120
|
onChange={handleChange}
|
|
121
|
-
onReset={
|
|
121
|
+
onReset={handleReset}
|
|
122
122
|
classNames='justify-self-end'
|
|
123
123
|
iconSize={5}
|
|
124
124
|
/>
|
|
@@ -127,13 +127,13 @@ export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) =
|
|
|
127
127
|
},
|
|
128
128
|
hue: ({ type, label, getValue, onValueChange }) => {
|
|
129
129
|
const handleChange = useCallback((nextHue: string) => onValueChange(type, nextHue), [onValueChange, type]);
|
|
130
|
-
const
|
|
130
|
+
const handleReset = useCallback(() => onValueChange(type, undefined), [onValueChange, type]);
|
|
131
131
|
return (
|
|
132
132
|
<ControlItem title={label} description={t('hue description')}>
|
|
133
133
|
<HuePicker
|
|
134
134
|
value={getValue()}
|
|
135
135
|
onChange={handleChange}
|
|
136
|
-
onReset={
|
|
136
|
+
onReset={handleReset}
|
|
137
137
|
classNames='[--hue-preview-size:1.25rem] justify-self-end'
|
|
138
138
|
/>
|
|
139
139
|
</ControlItem>
|
|
@@ -162,11 +162,11 @@ export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) =
|
|
|
162
162
|
);
|
|
163
163
|
|
|
164
164
|
return (
|
|
165
|
-
<StackItem.Content classNames='block overflow-y-auto
|
|
165
|
+
<StackItem.Content classNames='block overflow-y-auto'>
|
|
166
166
|
<ControlPage>
|
|
167
167
|
<ControlSection
|
|
168
|
-
title={t('space properties settings verbose label', { ns:
|
|
169
|
-
description={t('space properties settings description', { ns:
|
|
168
|
+
title={t('space properties settings verbose label', { ns: meta.id })}
|
|
169
|
+
description={t('space properties settings description', { ns: meta.id })}
|
|
170
170
|
>
|
|
171
171
|
<Form
|
|
172
172
|
schema={FormSchema}
|
|
@@ -175,7 +175,7 @@ export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) =
|
|
|
175
175
|
onSave={handleSave}
|
|
176
176
|
Custom={customElements}
|
|
177
177
|
outerSpacing={false}
|
|
178
|
-
classNames='container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]
|
|
178
|
+
classNames='container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]'
|
|
179
179
|
/>
|
|
180
180
|
</ControlSection>
|
|
181
181
|
</ControlPage>
|
|
@@ -14,7 +14,7 @@ import { Tooltip, useTranslation } from '@dxos/react-ui';
|
|
|
14
14
|
import { AttentionGlyph, useAttended, useAttention } from '@dxos/react-ui-attention';
|
|
15
15
|
|
|
16
16
|
import { usePath } from '../../hooks';
|
|
17
|
-
import {
|
|
17
|
+
import { meta } from '../../meta';
|
|
18
18
|
|
|
19
19
|
const useEdgeStatus = (): EdgeStatus => {
|
|
20
20
|
const [status, setStatus] = useState(EdgeStatus.NOT_CONNECTED);
|
|
@@ -29,7 +29,7 @@ const useEdgeStatus = (): EdgeStatus => {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export const InlineSyncStatus = ({ space, open }: { space: Space; open?: boolean }) => {
|
|
32
|
-
const { t } = useTranslation(
|
|
32
|
+
const { t } = useTranslation(meta.id);
|
|
33
33
|
const id = space.id;
|
|
34
34
|
const { hasAttention, isAncestor, isRelated } = useAttention(id);
|
|
35
35
|
const isAttended = hasAttention || isAncestor || isRelated;
|
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
|
|
9
|
-
import { withTheme } from '@dxos/
|
|
7
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
10
8
|
|
|
11
|
-
import { SyncStatusIndicator } from './SyncStatus';
|
|
12
9
|
import { translations } from '../../translations';
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
import { SyncStatusIndicator } from './SyncStatus';
|
|
12
|
+
|
|
13
|
+
const meta = {
|
|
15
14
|
title: 'plugins/plugin-space/SyncStatusIndicator',
|
|
16
15
|
component: SyncStatusIndicator,
|
|
17
16
|
decorators: [withTheme],
|
|
@@ -19,11 +18,11 @@ const meta: Meta = {
|
|
|
19
18
|
translations,
|
|
20
19
|
layout: 'centered',
|
|
21
20
|
},
|
|
22
|
-
}
|
|
21
|
+
} satisfies Meta<typeof SyncStatusIndicator>;
|
|
23
22
|
|
|
24
23
|
export default meta;
|
|
25
24
|
|
|
26
|
-
type Story = StoryObj<typeof
|
|
25
|
+
type Story = StoryObj<typeof meta>;
|
|
27
26
|
|
|
28
27
|
export const Default: Story = {
|
|
29
28
|
args: {
|
|
@@ -6,12 +6,13 @@ import React, { useEffect, useState } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { StatusBar } from '@dxos/plugin-status-bar';
|
|
8
8
|
import { useClient } from '@dxos/react-client';
|
|
9
|
-
import {
|
|
9
|
+
import { type SpaceSyncStateMap, getSyncSummary, useSyncState } from '@dxos/react-client/echo';
|
|
10
10
|
import { Icon, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
|
|
12
|
+
import { meta } from '../../meta';
|
|
13
|
+
|
|
12
14
|
import { createClientSaveTracker } from './save-tracker';
|
|
13
15
|
import { getIcon, getStatus } from './status';
|
|
14
|
-
import { SPACE_PLUGIN } from '../../meta';
|
|
15
16
|
|
|
16
17
|
const SYNC_STALLED_TIMEOUT = 5_000;
|
|
17
18
|
|
|
@@ -29,8 +30,8 @@ export const SyncStatus = () => {
|
|
|
29
30
|
return <SyncStatusIndicator state={state} saved={saved} />;
|
|
30
31
|
};
|
|
31
32
|
|
|
32
|
-
export const SyncStatusIndicator = ({ state, saved }: { state: SpaceSyncStateMap; saved:
|
|
33
|
-
const { t } = useTranslation(
|
|
33
|
+
export const SyncStatusIndicator = ({ state, saved }: { state: SpaceSyncStateMap; saved: boolean }) => {
|
|
34
|
+
const { t } = useTranslation(meta.id);
|
|
34
35
|
const summary = getSyncSummary(state);
|
|
35
36
|
const offline = Object.values(state).length === 0;
|
|
36
37
|
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
@@ -10,10 +10,10 @@ export const getStatus = ({
|
|
|
10
10
|
needsToUpload,
|
|
11
11
|
needsToDownload,
|
|
12
12
|
}: {
|
|
13
|
-
offline:
|
|
14
|
-
saved:
|
|
15
|
-
needsToUpload:
|
|
16
|
-
needsToDownload:
|
|
13
|
+
offline: boolean;
|
|
14
|
+
saved: boolean;
|
|
15
|
+
needsToUpload: boolean;
|
|
16
|
+
needsToDownload: boolean;
|
|
17
17
|
}): Status => {
|
|
18
18
|
if (!saved) {
|
|
19
19
|
return 'saving locally';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useCallback } from 'react';
|
|
6
|
+
|
|
7
|
+
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
+
import { Filter, Query, Type } from '@dxos/echo';
|
|
9
|
+
import { invariant } from '@dxos/invariant';
|
|
10
|
+
import { useClient } from '@dxos/react-client';
|
|
11
|
+
import { getSpace, useSchema } from '@dxos/react-client/echo';
|
|
12
|
+
import { ViewEditor as NaturalViewEditor } from '@dxos/react-ui-form';
|
|
13
|
+
import { type DataType, typenameFromQuery } from '@dxos/schema';
|
|
14
|
+
|
|
15
|
+
import { SpaceAction } from '../types';
|
|
16
|
+
|
|
17
|
+
type ViewEditorProps = { view: DataType.View };
|
|
18
|
+
|
|
19
|
+
export const ViewEditor = ({ view }: ViewEditorProps) => {
|
|
20
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
21
|
+
const client = useClient();
|
|
22
|
+
const space = getSpace(view);
|
|
23
|
+
const typename = view.query ? typenameFromQuery(view.query.ast) : undefined;
|
|
24
|
+
const schema = useSchema(client, space, typename);
|
|
25
|
+
|
|
26
|
+
const handleUpdateQuery = useCallback(
|
|
27
|
+
(typename: string) => {
|
|
28
|
+
invariant(schema);
|
|
29
|
+
invariant(Type.isMutable(schema));
|
|
30
|
+
|
|
31
|
+
const newQuery = Query.select(Filter.typename(typename));
|
|
32
|
+
view.query.ast = newQuery.ast;
|
|
33
|
+
schema.updateTypename(typename);
|
|
34
|
+
},
|
|
35
|
+
[view, schema],
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const handleDelete = useCallback(
|
|
39
|
+
(fieldId: string) => {
|
|
40
|
+
void dispatch(createIntent(SpaceAction.DeleteField, { view, fieldId }));
|
|
41
|
+
},
|
|
42
|
+
[dispatch, view],
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
if (!space || !schema) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<NaturalViewEditor
|
|
51
|
+
registry={space.db.schemaRegistry}
|
|
52
|
+
schema={schema}
|
|
53
|
+
view={view}
|
|
54
|
+
onQueryChanged={Type.isMutable(schema) ? handleUpdateQuery : undefined}
|
|
55
|
+
onDelete={Type.isMutable(schema) ? handleDelete : undefined}
|
|
56
|
+
outerSpacing={false}
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
};
|
package/src/components/index.ts
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { lazy } from 'react';
|
|
6
|
+
|
|
5
7
|
export * from './AwaitingObject';
|
|
6
8
|
export * from './CreateDialog';
|
|
7
|
-
export * from './CollectionMain';
|
|
8
9
|
export * from './CollectionSection';
|
|
9
10
|
export * from './JoinDialog';
|
|
10
11
|
export * from './MembersContainer';
|
|
@@ -18,3 +19,8 @@ export * from './SpacePresence';
|
|
|
18
19
|
export * from './SpacePluginSettings';
|
|
19
20
|
export * from './SpaceSettings';
|
|
20
21
|
export * from './SyncStatus';
|
|
22
|
+
export * from './ViewEditor';
|
|
23
|
+
|
|
24
|
+
export const CollectionMain = lazy(() => import('./CollectionMain'));
|
|
25
|
+
export const ObjectDetailsPanel = lazy(() => import('./ObjectDetailsPanel'));
|
|
26
|
+
export const RecordMain = lazy(() => import('./RecordMain'));
|
package/src/events.ts
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Events, defineEvent } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { meta } from './meta';
|
|
8
8
|
|
|
9
9
|
export namespace SpaceEvents {
|
|
10
|
-
export const StateReady = Events.createStateEvent(`${
|
|
11
|
-
export const SetupSettingsPanel = defineEvent(`${
|
|
12
|
-
export const DefaultSpaceReady = defineEvent(`${
|
|
13
|
-
export const SpaceCreated = defineEvent(`${
|
|
10
|
+
export const StateReady = Events.createStateEvent(`${meta.id}/event/state-ready`);
|
|
11
|
+
export const SetupSettingsPanel = defineEvent(`${meta.id}/event/setup-settings-panel`);
|
|
12
|
+
export const DefaultSpaceReady = defineEvent(`${meta.id}/event/default-space-ready`);
|
|
13
|
+
export const SpaceCreated = defineEvent(`${meta.id}/event/space-created`);
|
|
14
|
+
export const SchemaAdded = defineEvent(`${meta.id}/event/schema-added`);
|
|
14
15
|
}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities,
|
|
5
|
+
import { Capabilities, type PluginContext, useLayout } from '@dxos/app-framework';
|
|
6
6
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
7
7
|
import { parseId, useSpace } from '@dxos/react-client/echo';
|
|
8
8
|
|
|
9
9
|
export const getActiveSpace = (context: PluginContext) => {
|
|
10
|
-
const layout = context.getCapability(Capabilities.Layout);
|
|
11
10
|
const client = context.getCapability(ClientCapabilities.Client);
|
|
11
|
+
const layout = context.getCapability(Capabilities.Layout);
|
|
12
12
|
const { spaceId } = parseId(layout.workspace);
|
|
13
13
|
return spaceId ? client.spaces.get(spaceId) : undefined;
|
|
14
14
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type Schema } from 'effect';
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Surface, isSurfaceAvailable, usePluginManager } from '@dxos/app-framework';
|
|
9
9
|
import { type InputProps } from '@dxos/react-ui-form';
|
|
10
10
|
|
|
11
11
|
// TODO(ZaymonFC): Move this if you find yourself needing it elsewhere.
|
package/src/meta.ts
CHANGED
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { type PluginMeta } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
export const SPACE_PLUGIN = 'dxos.org/plugin/space';
|
|
8
|
-
|
|
9
7
|
export const meta: PluginMeta = {
|
|
10
|
-
id:
|
|
8
|
+
id: 'dxos.org/plugin/space',
|
|
11
9
|
name: 'Spaces',
|
|
12
10
|
icon: 'ph--planet--regular',
|
|
13
11
|
};
|
package/src/translations.ts
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Type } from '@dxos/echo';
|
|
6
|
+
import { StoredSchema } from '@dxos/echo-schema';
|
|
5
7
|
import { type Resource } from '@dxos/react-ui';
|
|
6
8
|
import { DataType } from '@dxos/schema';
|
|
7
9
|
|
|
@@ -17,13 +19,70 @@ export const translations = [
|
|
|
17
19
|
'typename label_one': 'Collection',
|
|
18
20
|
'typename label_other': 'Collections',
|
|
19
21
|
'object name placeholder': 'New collection',
|
|
22
|
+
'rename object label': 'Rename collection',
|
|
23
|
+
'delete object label': 'Delete collection',
|
|
20
24
|
},
|
|
21
|
-
[DataType.QueryCollection
|
|
25
|
+
[Type.getTypename(DataType.QueryCollection)]: {
|
|
22
26
|
'typename label': 'Smart Collection',
|
|
23
27
|
'typename label_zero': 'Smart Collections',
|
|
24
28
|
'typename label_one': 'Smart Collection',
|
|
25
29
|
'typename label_other': 'Smart Collections',
|
|
26
30
|
'object name placeholder': 'New smart collection',
|
|
31
|
+
'rename object label': 'Rename smart collection',
|
|
32
|
+
'delete object label': 'Delete smart collection',
|
|
33
|
+
},
|
|
34
|
+
[StoredSchema.typename]: {
|
|
35
|
+
'typename label': 'Record',
|
|
36
|
+
'typename label_zero': 'Records',
|
|
37
|
+
'typename label_one': 'Record',
|
|
38
|
+
'typename label_other': 'Records',
|
|
39
|
+
'object name placeholder': 'New record type',
|
|
40
|
+
'rename object label': 'Rename record type',
|
|
41
|
+
'delete object label': 'Delete record type',
|
|
42
|
+
},
|
|
43
|
+
[Type.getTypename(DataType.View)]: {
|
|
44
|
+
'typename label': 'View',
|
|
45
|
+
'typename label_zero': 'Views',
|
|
46
|
+
'typename label_one': 'View',
|
|
47
|
+
'typename label_other': 'Views',
|
|
48
|
+
'object name placeholder': 'New view',
|
|
49
|
+
'rename object label': 'Rename view',
|
|
50
|
+
'delete object label': 'Delete view',
|
|
51
|
+
},
|
|
52
|
+
[DataType.Event.typename]: {
|
|
53
|
+
'typename label': 'Event',
|
|
54
|
+
'typename label_zero': 'Events',
|
|
55
|
+
'typename label_one': 'Event',
|
|
56
|
+
'typename label_other': 'Events',
|
|
57
|
+
'object name placeholder': 'New event',
|
|
58
|
+
},
|
|
59
|
+
[DataType.Organization.typename]: {
|
|
60
|
+
'typename label': 'Organization',
|
|
61
|
+
'typename label_zero': 'Organizations',
|
|
62
|
+
'typename label_one': 'Organization',
|
|
63
|
+
'typename label_other': 'Organizations',
|
|
64
|
+
'object name placeholder': 'New organization',
|
|
65
|
+
},
|
|
66
|
+
[DataType.Person.typename]: {
|
|
67
|
+
'typename label': 'Person',
|
|
68
|
+
'typename label_zero': 'People',
|
|
69
|
+
'typename label_one': 'Person',
|
|
70
|
+
'typename label_other': 'People',
|
|
71
|
+
'object name placeholder': 'New person',
|
|
72
|
+
},
|
|
73
|
+
[Type.getTypename(DataType.Project)]: {
|
|
74
|
+
'typename label': 'Project',
|
|
75
|
+
'typename label_zero': 'Projects',
|
|
76
|
+
'typename label_one': 'Project',
|
|
77
|
+
'typename label_other': 'Projects',
|
|
78
|
+
'object name placeholder': 'New project',
|
|
79
|
+
},
|
|
80
|
+
[DataType.Task.typename]: {
|
|
81
|
+
'typename label': 'Task',
|
|
82
|
+
'typename label_zero': 'Tasks',
|
|
83
|
+
'typename label_one': 'Task',
|
|
84
|
+
'typename label_other': 'Tasks',
|
|
85
|
+
'object name placeholder': 'New task',
|
|
27
86
|
},
|
|
28
87
|
[meta.id]: {
|
|
29
88
|
'plugin name': 'Spaces',
|
|
@@ -136,6 +195,10 @@ export const translations = [
|
|
|
136
195
|
'add key': 'Add Key',
|
|
137
196
|
'open space settings label': 'Open settings',
|
|
138
197
|
|
|
198
|
+
'row details no selection label': 'No objects selected',
|
|
199
|
+
'companion selected objects label': 'Selected',
|
|
200
|
+
'field deleted label': 'Field deleted',
|
|
201
|
+
|
|
139
202
|
'members panel label': 'Members',
|
|
140
203
|
'members verbose label': 'Manage space members',
|
|
141
204
|
'members description': 'You can view the current status of space members here as well as invite new members.',
|
|
@@ -152,10 +215,10 @@ export const translations = [
|
|
|
152
215
|
'space settings properties label': 'General settings',
|
|
153
216
|
'space properties settings verbose label': 'Manage space properties',
|
|
154
217
|
'space properties settings description': 'You can configure how this space is displayed in the app here.',
|
|
155
|
-
'space settings schema label': '
|
|
156
|
-
'schema verbose label': 'Manage
|
|
157
|
-
'schema description': 'You can manage all of the
|
|
158
|
-
'no schemas found message': 'No
|
|
218
|
+
'space settings schema label': 'Record types',
|
|
219
|
+
'schema verbose label': 'Manage record types',
|
|
220
|
+
'schema description': 'You can manage all of the record types stored within this space here.',
|
|
221
|
+
'no schemas found message': 'No record types found',
|
|
159
222
|
'display name input placeholder': 'Space name',
|
|
160
223
|
'display name description': 'Name of the space as it appears in the app.',
|
|
161
224
|
'icon description': 'Icon used to represent the space in the app.',
|
package/src/types/types.ts
CHANGED
|
@@ -5,18 +5,19 @@
|
|
|
5
5
|
import { Schema } from 'effect';
|
|
6
6
|
|
|
7
7
|
import { type AnyIntentChain } from '@dxos/app-framework';
|
|
8
|
-
import {
|
|
9
|
-
import { type BaseObject, type TypedObject } from '@dxos/echo-schema';
|
|
8
|
+
import { type Obj, Type } from '@dxos/echo';
|
|
9
|
+
import { type BaseObject, EchoSchema, StoredSchema, type TypedObject } from '@dxos/echo-schema';
|
|
10
10
|
import { type PublicKey } from '@dxos/react-client';
|
|
11
11
|
// TODO(wittjosiah): This pulls in full client.
|
|
12
12
|
import { EchoObjectSchema, ReactiveObjectSchema, type Space, SpaceSchema } from '@dxos/react-client/echo';
|
|
13
13
|
import { CancellableInvitationObservable, Invitation } from '@dxos/react-client/invitations';
|
|
14
|
-
import { DataType, TypenameAnnotationId } from '@dxos/schema';
|
|
14
|
+
import { DataType, FieldSchema, TypenameAnnotationId } from '@dxos/schema';
|
|
15
15
|
import { type ComplexMap } from '@dxos/util';
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { meta } from '../meta';
|
|
18
|
+
|
|
19
|
+
export const SPACE_DIRECTORY_HANDLE = `${meta.id}/directory`;
|
|
18
20
|
|
|
19
|
-
export const SPACE_DIRECTORY_HANDLE = 'dxos.org/plugin/space/directory';
|
|
20
21
|
export const SPACE_TYPE = 'dxos.org/type/Space';
|
|
21
22
|
|
|
22
23
|
export type ObjectViewerProps = {
|
|
@@ -114,7 +115,7 @@ export type ObjectForm<T extends BaseObject = BaseObject> = {
|
|
|
114
115
|
|
|
115
116
|
export const defineObjectForm = <T extends BaseObject>(form: ObjectForm<T>) => form;
|
|
116
117
|
|
|
117
|
-
export const SPACE_ACTION = `${
|
|
118
|
+
export const SPACE_ACTION = `${meta.id}/action`;
|
|
118
119
|
|
|
119
120
|
export namespace SpaceAction {
|
|
120
121
|
export class OpenCreateSpace extends Schema.TaggedClass<OpenCreateSpace>()(`${SPACE_ACTION}/open-create-space`, {
|
|
@@ -217,11 +218,68 @@ export namespace SpaceAction {
|
|
|
217
218
|
output: Schema.Boolean,
|
|
218
219
|
}) {}
|
|
219
220
|
|
|
221
|
+
export const StoredSchemaForm = Schema.Struct({
|
|
222
|
+
name: Schema.optional(Schema.String),
|
|
223
|
+
typename: Schema.optional(
|
|
224
|
+
Schema.String.annotations({
|
|
225
|
+
[TypenameAnnotationId]: ['unused-static'],
|
|
226
|
+
}),
|
|
227
|
+
),
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
export class UseStaticSchema extends Schema.TaggedClass<UseStaticSchema>()(`${SPACE_ACTION}/use-static-schema`, {
|
|
231
|
+
input: Schema.Struct({
|
|
232
|
+
space: SpaceSchema,
|
|
233
|
+
typename: Schema.String,
|
|
234
|
+
}),
|
|
235
|
+
output: Schema.Struct({}),
|
|
236
|
+
}) {}
|
|
237
|
+
|
|
238
|
+
export class AddSchema extends Schema.TaggedClass<AddSchema>()(`${SPACE_ACTION}/add-schema`, {
|
|
239
|
+
input: Schema.Struct({
|
|
240
|
+
space: SpaceSchema,
|
|
241
|
+
name: Schema.optional(Schema.String),
|
|
242
|
+
typename: Schema.optional(Schema.String),
|
|
243
|
+
// TODO(wittjosiah): Semantic version format.
|
|
244
|
+
version: Schema.optional(Schema.String),
|
|
245
|
+
// TODO(wittjosiah): Schema for schema?
|
|
246
|
+
schema: Schema.Any,
|
|
247
|
+
}),
|
|
248
|
+
output: Schema.Struct({
|
|
249
|
+
// TODO(wittjosiah): ObjectId.
|
|
250
|
+
id: Schema.String,
|
|
251
|
+
object: StoredSchema,
|
|
252
|
+
schema: Schema.instanceOf(EchoSchema),
|
|
253
|
+
}),
|
|
254
|
+
}) {}
|
|
255
|
+
|
|
256
|
+
export class DeleteField extends Schema.TaggedClass<DeleteField>()(`${SPACE_ACTION}/delete-field`, {
|
|
257
|
+
input: Schema.Struct({
|
|
258
|
+
view: DataType.View,
|
|
259
|
+
fieldId: Schema.String,
|
|
260
|
+
// TODO(wittjosiah): Separate fields for undo data?
|
|
261
|
+
deletionData: Schema.optional(
|
|
262
|
+
Schema.Struct({
|
|
263
|
+
field: FieldSchema,
|
|
264
|
+
// TODO(wittjosiah): This creates a type error.
|
|
265
|
+
// props: PropertySchema,
|
|
266
|
+
props: Schema.Any,
|
|
267
|
+
index: Schema.Number,
|
|
268
|
+
}),
|
|
269
|
+
),
|
|
270
|
+
}),
|
|
271
|
+
output: Schema.Void,
|
|
272
|
+
}) {}
|
|
273
|
+
|
|
220
274
|
export class OpenCreateObject extends Schema.TaggedClass<OpenCreateObject>()(`${SPACE_ACTION}/open-create-object`, {
|
|
221
275
|
input: Schema.Struct({
|
|
222
276
|
target: Schema.Union(SpaceSchema, DataType.Collection),
|
|
277
|
+
views: Schema.optional(Schema.Boolean),
|
|
223
278
|
typename: Schema.optional(Schema.String),
|
|
279
|
+
initialFormValues: Schema.optional(Schema.Any),
|
|
224
280
|
navigable: Schema.optional(Schema.Boolean),
|
|
281
|
+
// TODO(wittjosiah): This is a function, is there a better way to handle this?
|
|
282
|
+
onCreateObject: Schema.optional(Schema.Any),
|
|
225
283
|
}),
|
|
226
284
|
output: Schema.Void,
|
|
227
285
|
}) {}
|
|
@@ -233,6 +291,7 @@ export namespace SpaceAction {
|
|
|
233
291
|
hidden: Schema.optional(Schema.Boolean),
|
|
234
292
|
}),
|
|
235
293
|
output: Schema.Struct({
|
|
294
|
+
// TODO(wittjosiah): ObjectId.
|
|
236
295
|
id: Schema.String,
|
|
237
296
|
subject: Schema.Array(Schema.String),
|
|
238
297
|
object: EchoObjectSchema,
|
|
@@ -309,11 +368,9 @@ export namespace CollectionAction {
|
|
|
309
368
|
|
|
310
369
|
export const QueryCollectionForm = Schema.Struct({
|
|
311
370
|
name: Schema.optional(Schema.String),
|
|
312
|
-
typename: Schema.
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}),
|
|
316
|
-
),
|
|
371
|
+
typename: Schema.String.annotations({
|
|
372
|
+
[TypenameAnnotationId]: ['object-form'],
|
|
373
|
+
}),
|
|
317
374
|
});
|
|
318
375
|
|
|
319
376
|
export class CreateQueryCollection extends Schema.TaggedClass<CreateQueryCollection>()(
|
|
@@ -321,7 +378,8 @@ export namespace CollectionAction {
|
|
|
321
378
|
{
|
|
322
379
|
input: QueryCollectionForm,
|
|
323
380
|
output: Schema.Struct({
|
|
324
|
-
|
|
381
|
+
// TODO(wittjosiah): Remove cast.
|
|
382
|
+
object: EchoObjectSchema, // DataType.QueryCollection,
|
|
325
383
|
}),
|
|
326
384
|
},
|
|
327
385
|
) {}
|