@dxos/plugin-space 0.8.4-main.c1de068 → 0.8.4-main.c4373fc
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-SJ4XUXXX.mjs} +11 -9
- package/dist/lib/browser/ObjectDetailsPanel-SJ4XUXXX.mjs.map +7 -0
- package/dist/lib/browser/RecordMain-FHPCS6GM.mjs +68 -0
- package/dist/lib/browser/RecordMain-FHPCS6GM.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-7CZZJS3S.mjs → app-graph-builder-Y2LBZX2G.mjs} +102 -61
- package/dist/lib/browser/app-graph-builder-Y2LBZX2G.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-H6AW7KGS.mjs → app-graph-serializer-425OVRTW.mjs} +14 -14
- package/dist/lib/browser/app-graph-serializer-425OVRTW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-V7MJSSBQ.mjs → chunk-6KVKMOGQ.mjs} +148 -157
- package/dist/lib/browser/chunk-6KVKMOGQ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-VLBRSGJ2.mjs → chunk-CVZAZRW4.mjs} +4 -4
- package/dist/lib/browser/chunk-CVZAZRW4.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-IRKDREHY.mjs +11 -0
- package/dist/lib/browser/chunk-IRKDREHY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SGTQ52SU.mjs → chunk-OYHC63NL.mjs} +16 -10
- package/dist/lib/browser/chunk-OYHC63NL.mjs.map +7 -0
- package/dist/lib/browser/chunk-PUF3B7XO.mjs +20 -0
- package/dist/lib/browser/chunk-PUF3B7XO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-XUYKJUU7.mjs → chunk-X6COEDOD.mjs} +99 -44
- package/dist/lib/browser/chunk-X6COEDOD.mjs.map +7 -0
- package/dist/lib/browser/{chunk-QACNNDOT.mjs → chunk-YZJWWMNB.mjs} +11 -10
- package/dist/lib/browser/chunk-YZJWWMNB.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 +20 -40
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-TIXVDYN7.mjs → intent-resolver-2TBYHOBA.mjs} +47 -42
- package/dist/lib/browser/intent-resolver-2TBYHOBA.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-N2J7TDRX.mjs → react-root-KMJXJ5VX.mjs} +11 -11
- package/dist/lib/browser/react-root-KMJXJ5VX.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-TPNLWJJH.mjs → react-surface-YAJUAMER.mjs} +53 -42
- package/dist/lib/browser/react-surface-YAJUAMER.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-Z6FC4AHC.mjs → schema-defs-2OCPV7JF.mjs} +5 -5
- package/dist/lib/browser/schema-defs-2OCPV7JF.mjs.map +7 -0
- package/dist/lib/browser/{settings-4IMP5RYT.mjs → settings-UYYJ225A.mjs} +5 -5
- package/dist/lib/browser/{settings-4IMP5RYT.mjs.map → settings-UYYJ225A.mjs.map} +1 -1
- package/dist/lib/browser/{spaces-ready-TOPG6IV4.mjs → spaces-ready-YNZPWXA3.mjs} +18 -16
- package/dist/lib/browser/spaces-ready-YNZPWXA3.mjs.map +7 -0
- package/dist/lib/browser/{state-QYZAB45H.mjs → state-BPU73TYO.mjs} +7 -7
- package/dist/lib/browser/state-BPU73TYO.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-P7D727OV.mjs} +11 -9
- package/dist/lib/node-esm/ObjectDetailsPanel-P7D727OV.mjs.map +7 -0
- package/dist/lib/node-esm/RecordMain-V73AEB6N.mjs +70 -0
- package/dist/lib/node-esm/RecordMain-V73AEB6N.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-KGIGWC72.mjs → app-graph-builder-DMNLDT7E.mjs} +102 -61
- package/dist/lib/node-esm/app-graph-builder-DMNLDT7E.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-2ICUGQQT.mjs → app-graph-serializer-ZEDSY77N.mjs} +14 -14
- package/dist/lib/node-esm/app-graph-serializer-ZEDSY77N.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-36TAYXV7.mjs +21 -0
- package/dist/lib/node-esm/chunk-36TAYXV7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-P442DOQ3.mjs → chunk-7UIEPBQJ.mjs} +11 -10
- package/dist/lib/node-esm/chunk-7UIEPBQJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JH6F4C3I.mjs → chunk-ADEZJQE3.mjs} +16 -10
- package/dist/lib/node-esm/chunk-ADEZJQE3.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SSLBYZEY.mjs → chunk-FLRC6XWU.mjs} +4 -4
- package/dist/lib/node-esm/chunk-FLRC6XWU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-6X5DLJM5.mjs → chunk-L26ZIGHA.mjs} +148 -157
- package/dist/lib/node-esm/chunk-L26ZIGHA.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-SVFKU7EW.mjs +20 -0
- package/dist/lib/node-esm/chunk-SVFKU7EW.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-4AOMYKDE.mjs → chunk-ZFCCFELA.mjs} +99 -44
- package/dist/lib/node-esm/chunk-ZFCCFELA.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 +20 -40
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-MHGHRGDT.mjs → intent-resolver-YOG27WOG.mjs} +47 -42
- package/dist/lib/node-esm/intent-resolver-YOG27WOG.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-KW3TGJGY.mjs → react-root-27QMJZD2.mjs} +11 -11
- package/dist/lib/node-esm/react-root-27QMJZD2.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-UUIUUD6P.mjs → react-surface-RC73GAN5.mjs} +53 -42
- package/dist/lib/node-esm/react-surface-RC73GAN5.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-WHJM7UZE.mjs → schema-defs-X2Z7F2EV.mjs} +5 -5
- package/dist/lib/node-esm/schema-defs-X2Z7F2EV.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-SAOBPND3.mjs → settings-Q736OQRP.mjs} +5 -5
- package/dist/lib/node-esm/{settings-SAOBPND3.mjs.map → settings-Q736OQRP.mjs.map} +1 -1
- package/dist/lib/node-esm/{spaces-ready-HIUKNDZK.mjs → spaces-ready-XZQD7Q65.mjs} +18 -16
- package/dist/lib/node-esm/spaces-ready-XZQD7Q65.mjs.map +7 -0
- package/dist/lib/node-esm/{state-ZVEHQ4BJ.mjs → state-BY75TM32.mjs} +7 -7
- package/dist/lib/node-esm/state-BY75TM32.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 +4 -4
- 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/ForeignKeys.d.ts +1 -1
- package/dist/types/src/components/ObjectSettings/ForeignKeys.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/hooks/useInputSurfaceLookup.d.ts +1 -1
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +1 -1
- package/dist/types/src/hooks/usePath.d.ts +1 -1
- package/dist/types/src/hooks/usePath.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 +76 -96
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +10 -7
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +60 -58
- package/src/SpacePlugin.ts +204 -219
- package/src/capabilities/app-graph-builder.ts +127 -69
- package/src/capabilities/app-graph-serializer.ts +7 -7
- package/src/capabilities/capabilities.ts +12 -11
- package/src/capabilities/identity-created.ts +1 -1
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/intent-resolver.ts +37 -25
- package/src/capabilities/react-root.tsx +4 -3
- package/src/capabilities/react-surface.tsx +52 -38
- package/src/capabilities/schema-defs.ts +3 -2
- package/src/capabilities/spaces-ready.ts +11 -8
- 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 +24 -13
- package/src/components/CreateDialog/CreateObjectPanel.tsx +22 -11
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +6 -5
- package/src/components/JoinDialog.tsx +7 -7
- package/src/components/MembersContainer.stories.tsx +36 -10
- package/src/components/MembersContainer.tsx +13 -14
- package/src/components/MenuFooter.tsx +2 -2
- package/src/components/ObjectDetailsPanel.tsx +7 -5
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +4 -3
- package/src/components/ObjectSettings/ForeignKeys.tsx +3 -3
- 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 +5 -5
- package/src/components/SpacePluginSettings.tsx +8 -9
- package/src/components/SpacePresence.stories.tsx +23 -22
- package/src/components/SpacePresence.tsx +10 -10
- package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +17 -9
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +19 -18
- package/src/components/SyncStatus/InlineSyncStatus.tsx +3 -3
- 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 +2 -2
- package/src/hooks/usePath.ts +1 -1
- package/src/meta.ts +1 -3
- package/src/translations.ts +9 -8
- package/src/types/types.ts +17 -13
- package/src/util.tsx +97 -40
- 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-7CZZJS3S.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-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-V7MJSSBQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-VLBRSGJ2.mjs.map +0 -7
- package/dist/lib/browser/chunk-XUYKJUU7.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-TIXVDYN7.mjs.map +0 -7
- package/dist/lib/browser/react-root-N2J7TDRX.mjs.map +0 -7
- package/dist/lib/browser/react-surface-TPNLWJJH.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-KGIGWC72.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-2ICUGQQT.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-6X5DLJM5.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/chunk-SSLBYZEY.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-MHGHRGDT.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-KW3TGJGY.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-UUIUUD6P.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
|
@@ -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/internal';
|
|
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,11 +37,11 @@ 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 (
|
|
44
|
-
<StackItem.Content
|
|
44
|
+
<StackItem.Content scrollable>
|
|
45
45
|
<ControlPage>
|
|
46
46
|
<ControlSection title={t('schema verbose label')} description={t('schema description')}>
|
|
47
47
|
<div role='none' className={controlItemClasses}>
|
|
@@ -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;
|
|
@@ -2,34 +2,34 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Option from 'effect/Option';
|
|
6
6
|
import React, { forwardRef, useCallback, useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { useAppGraph, useCapability } from '@dxos/app-framework';
|
|
9
9
|
import { generateName } from '@dxos/display-name';
|
|
10
10
|
import { type Type } from '@dxos/echo';
|
|
11
11
|
import { PublicKey, useClient } from '@dxos/react-client';
|
|
12
|
-
import {
|
|
12
|
+
import { type SpaceMember, fullyQualifiedId, getSpace, useMembers } from '@dxos/react-client/echo';
|
|
13
13
|
import { type Identity, useIdentity } from '@dxos/react-client/halo';
|
|
14
14
|
import {
|
|
15
15
|
Avatar,
|
|
16
16
|
type AvatarContentProps,
|
|
17
|
+
type DxAvatar,
|
|
18
|
+
List,
|
|
19
|
+
ListItem,
|
|
20
|
+
Popover,
|
|
17
21
|
type Size,
|
|
18
22
|
type ThemedClassName,
|
|
19
23
|
Tooltip,
|
|
20
|
-
Popover,
|
|
21
|
-
useTranslation,
|
|
22
|
-
List,
|
|
23
|
-
ListItem,
|
|
24
24
|
useDefaultValue,
|
|
25
|
-
|
|
25
|
+
useTranslation,
|
|
26
26
|
} from '@dxos/react-ui';
|
|
27
|
-
import { AttentionGlyph, useAttended, useAttention
|
|
27
|
+
import { AttentionGlyph, type AttentionGlyphProps, useAttended, useAttention } from '@dxos/react-ui-attention';
|
|
28
28
|
import { ComplexMap, keyToFallback } from '@dxos/util';
|
|
29
29
|
|
|
30
30
|
import { SpaceCapabilities } from '../capabilities';
|
|
31
31
|
import { usePath } from '../hooks';
|
|
32
|
-
import {
|
|
32
|
+
import { meta } from '../meta';
|
|
33
33
|
import type { ObjectViewerProps } from '../types';
|
|
34
34
|
|
|
35
35
|
// TODO(thure): Get/derive these values from protocol
|
|
@@ -254,7 +254,7 @@ export type SmallPresenceProps = {
|
|
|
254
254
|
} & Pick<AttentionGlyphProps, 'attended' | 'containsAttended'>;
|
|
255
255
|
|
|
256
256
|
export const SmallPresence = ({ count = 0, attended, containsAttended }: SmallPresenceProps) => {
|
|
257
|
-
const { t } = useTranslation(
|
|
257
|
+
const { t } = useTranslation(meta.id);
|
|
258
258
|
|
|
259
259
|
return (
|
|
260
260
|
<Tooltip.Trigger asChild content={t('presence label', { count })} side='bottom'>
|
|
@@ -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,28 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Function from 'effect/Function';
|
|
6
|
+
import * as Schema from 'effect/Schema';
|
|
6
7
|
import React, { type ChangeEvent, useCallback, useMemo, useState } from 'react';
|
|
7
8
|
|
|
8
|
-
import { chain, createIntent,
|
|
9
|
+
import { LayoutAction, chain, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
10
|
import { log } from '@dxos/log';
|
|
10
11
|
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
11
12
|
import { useClient } from '@dxos/react-client';
|
|
12
|
-
import {
|
|
13
|
+
import { type Space, SpaceState } from '@dxos/react-client/echo';
|
|
13
14
|
import { Button, Input, useMulticastObservable, useTranslation } from '@dxos/react-ui';
|
|
14
15
|
import {
|
|
15
|
-
Form,
|
|
16
|
-
type InputComponent,
|
|
17
16
|
ControlItem,
|
|
18
17
|
ControlItemInput,
|
|
19
|
-
ControlSection,
|
|
20
18
|
ControlPage,
|
|
19
|
+
ControlSection,
|
|
20
|
+
Form,
|
|
21
|
+
type InputComponent,
|
|
21
22
|
} from '@dxos/react-ui-form';
|
|
22
23
|
import { HuePicker, IconPicker } from '@dxos/react-ui-pickers';
|
|
23
24
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
24
25
|
|
|
25
|
-
import {
|
|
26
|
+
import { meta } from '../../meta';
|
|
26
27
|
import { SpaceAction, SpaceForm } from '../../types';
|
|
27
28
|
|
|
28
29
|
const FormSchema = SpaceForm.pipe(
|
|
@@ -35,7 +36,7 @@ export type SpaceSettingsContainerProps = {
|
|
|
35
36
|
|
|
36
37
|
// TODO(wittjosiah): Handle space migrations here?
|
|
37
38
|
export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) => {
|
|
38
|
-
const { t } = useTranslation(
|
|
39
|
+
const { t } = useTranslation(meta.id);
|
|
39
40
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
40
41
|
const client = useClient();
|
|
41
42
|
const archived = useMulticastObservable(space.state) === SpaceState.SPACE_INACTIVE;
|
|
@@ -69,7 +70,7 @@ export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) =
|
|
|
69
70
|
}
|
|
70
71
|
if (properties.archived && !archived) {
|
|
71
72
|
void dispatch(
|
|
72
|
-
pipe(
|
|
73
|
+
Function.pipe(
|
|
73
74
|
createIntent(SpaceAction.Close, { space }),
|
|
74
75
|
chain(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: client.spaces.default.id }),
|
|
75
76
|
),
|
|
@@ -111,14 +112,14 @@ export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) =
|
|
|
111
112
|
);
|
|
112
113
|
},
|
|
113
114
|
icon: ({ type, label, getValue, onValueChange }) => {
|
|
114
|
-
const handleChange = useCallback((
|
|
115
|
-
const
|
|
115
|
+
const handleChange = useCallback((icon: string) => onValueChange(type, icon), [onValueChange, type]);
|
|
116
|
+
const handleReset = useCallback(() => onValueChange(type, undefined), [onValueChange, type]);
|
|
116
117
|
return (
|
|
117
118
|
<ControlItem title={label} description={t('icon description')}>
|
|
118
119
|
<IconPicker
|
|
119
120
|
value={getValue()}
|
|
120
121
|
onChange={handleChange}
|
|
121
|
-
onReset={
|
|
122
|
+
onReset={handleReset}
|
|
122
123
|
classNames='justify-self-end'
|
|
123
124
|
iconSize={5}
|
|
124
125
|
/>
|
|
@@ -127,13 +128,13 @@ export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) =
|
|
|
127
128
|
},
|
|
128
129
|
hue: ({ type, label, getValue, onValueChange }) => {
|
|
129
130
|
const handleChange = useCallback((nextHue: string) => onValueChange(type, nextHue), [onValueChange, type]);
|
|
130
|
-
const
|
|
131
|
+
const handleReset = useCallback(() => onValueChange(type, undefined), [onValueChange, type]);
|
|
131
132
|
return (
|
|
132
133
|
<ControlItem title={label} description={t('hue description')}>
|
|
133
134
|
<HuePicker
|
|
134
135
|
value={getValue()}
|
|
135
136
|
onChange={handleChange}
|
|
136
|
-
onReset={
|
|
137
|
+
onReset={handleReset}
|
|
137
138
|
classNames='[--hue-preview-size:1.25rem] justify-self-end'
|
|
138
139
|
/>
|
|
139
140
|
</ControlItem>
|
|
@@ -162,11 +163,11 @@ export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) =
|
|
|
162
163
|
);
|
|
163
164
|
|
|
164
165
|
return (
|
|
165
|
-
<StackItem.Content
|
|
166
|
+
<StackItem.Content scrollable>
|
|
166
167
|
<ControlPage>
|
|
167
168
|
<ControlSection
|
|
168
|
-
title={t('space properties settings verbose label', { ns:
|
|
169
|
-
description={t('space properties settings description', { ns:
|
|
169
|
+
title={t('space properties settings verbose label', { ns: meta.id })}
|
|
170
|
+
description={t('space properties settings description', { ns: meta.id })}
|
|
170
171
|
>
|
|
171
172
|
<Form
|
|
172
173
|
schema={FormSchema}
|
|
@@ -175,7 +176,7 @@ export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) =
|
|
|
175
176
|
onSave={handleSave}
|
|
176
177
|
Custom={customElements}
|
|
177
178
|
outerSpacing={false}
|
|
178
|
-
classNames='container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]
|
|
179
|
+
classNames='container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]'
|
|
179
180
|
/>
|
|
180
181
|
</ControlSection>
|
|
181
182
|
</ControlPage>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Option from 'effect/Option';
|
|
6
6
|
import React, { useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { useAppGraph } from '@dxos/app-framework';
|
|
@@ -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
|
|
|
@@ -30,7 +31,7 @@ export const SyncStatus = () => {
|
|
|
30
31
|
};
|
|
31
32
|
|
|
32
33
|
export const SyncStatusIndicator = ({ state, saved }: { state: SpaceSyncStateMap; saved: boolean }) => {
|
|
33
|
-
const { t } = useTranslation(
|
|
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;
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { useCallback
|
|
5
|
+
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
7
|
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
-
import { Type } from '@dxos/echo';
|
|
8
|
+
import { Filter, Query, Type } from '@dxos/echo';
|
|
9
9
|
import { invariant } from '@dxos/invariant';
|
|
10
10
|
import { useClient } from '@dxos/react-client';
|
|
11
|
-
import {
|
|
12
|
-
import { ViewEditor as
|
|
13
|
-
import { DataType } from '@dxos/schema';
|
|
11
|
+
import { getSpace, useSchema } from '@dxos/react-client/echo';
|
|
12
|
+
import { ViewEditor as NaturalViewEditor } from '@dxos/react-ui-form';
|
|
13
|
+
import { type DataType, getTypenameFromQuery } from '@dxos/schema';
|
|
14
14
|
|
|
15
15
|
import { SpaceAction } from '../types';
|
|
16
16
|
|
|
@@ -20,24 +20,19 @@ export const ViewEditor = ({ view }: ViewEditorProps) => {
|
|
|
20
20
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
21
21
|
const client = useClient();
|
|
22
22
|
const space = getSpace(view);
|
|
23
|
-
const
|
|
23
|
+
const typename = view.query ? getTypenameFromQuery(view.query.ast) : undefined;
|
|
24
|
+
const schema = useSchema(client, space, typename);
|
|
24
25
|
|
|
25
|
-
const
|
|
26
|
-
const currentTypename = useMemo(() => view.query?.typename, [view.query?.typename]);
|
|
27
|
-
|
|
28
|
-
const handleUpdateTypename = useCallback(
|
|
26
|
+
const handleUpdateQuery = useCallback(
|
|
29
27
|
(typename: string) => {
|
|
30
28
|
invariant(schema);
|
|
31
29
|
invariant(Type.isMutable(schema));
|
|
32
30
|
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
view.query.typename = typename;
|
|
36
|
-
}
|
|
37
|
-
|
|
31
|
+
const newQuery = Query.select(Filter.typename(typename));
|
|
32
|
+
view.query.ast = newQuery.ast;
|
|
38
33
|
schema.updateTypename(typename);
|
|
39
34
|
},
|
|
40
|
-
[
|
|
35
|
+
[view, schema],
|
|
41
36
|
);
|
|
42
37
|
|
|
43
38
|
const handleDelete = useCallback(
|
|
@@ -52,11 +47,11 @@ export const ViewEditor = ({ view }: ViewEditorProps) => {
|
|
|
52
47
|
}
|
|
53
48
|
|
|
54
49
|
return (
|
|
55
|
-
<
|
|
50
|
+
<NaturalViewEditor
|
|
56
51
|
registry={space.db.schemaRegistry}
|
|
57
52
|
schema={schema}
|
|
58
53
|
view={view}
|
|
59
|
-
|
|
54
|
+
onQueryChanged={Type.isMutable(schema) ? handleUpdateQuery : undefined}
|
|
60
55
|
onDelete={Type.isMutable(schema) ? handleDelete : undefined}
|
|
61
56
|
outerSpacing={false}
|
|
62
57
|
/>
|
package/src/components/index.ts
CHANGED
package/src/events.ts
CHANGED
|
@@ -2,14 +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(`${
|
|
14
|
-
export const SchemaAdded = 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`);
|
|
15
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
|
};
|