@dxos/plugin-space 0.8.3 → 0.8.4-main.1da679c
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 +31 -0
- package/dist/lib/browser/CollectionMain-D2B75XBS.mjs.map +7 -0
- package/dist/lib/browser/ObjectDetailsPanel-J7KGPJJK.mjs +90 -0
- package/dist/lib/browser/ObjectDetailsPanel-J7KGPJJK.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-M2RH72VL.mjs → app-graph-builder-FC4D5PF6.mjs} +190 -36
- package/dist/lib/browser/app-graph-builder-FC4D5PF6.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-F7ISRRBV.mjs → app-graph-serializer-NI4BCIQO.mjs} +15 -15
- package/dist/lib/browser/app-graph-serializer-NI4BCIQO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-YMCZR6EZ.mjs → chunk-CBYL62HG.mjs} +5 -4
- package/dist/lib/browser/chunk-CBYL62HG.mjs.map +7 -0
- package/dist/lib/browser/{chunk-7Y4M7GXO.mjs → chunk-ELJDGQTO.mjs} +6 -6
- package/dist/lib/browser/{chunk-7Y4M7GXO.mjs.map → chunk-ELJDGQTO.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-PTKYMZWO.mjs → chunk-FBCGT5YY.mjs} +2 -2
- package/dist/lib/browser/{chunk-NFUKCRGE.mjs → chunk-IIY4XVBZ.mjs} +440 -376
- package/dist/lib/browser/chunk-IIY4XVBZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-V24VASAJ.mjs → chunk-S33AYKSS.mjs} +189 -34
- package/dist/lib/browser/chunk-S33AYKSS.mjs.map +7 -0
- package/dist/lib/browser/{chunk-BXNL6SDI.mjs → chunk-TUQZO5P4.mjs} +4 -3
- package/dist/lib/browser/chunk-TUQZO5P4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TW7O2EPP.mjs → chunk-URST7EEN.mjs} +68 -8
- package/dist/lib/browser/chunk-URST7EEN.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4ZKSFDXM.mjs → chunk-WZYRDFW7.mjs} +76 -14
- package/dist/lib/browser/chunk-WZYRDFW7.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-PI7TKANR.mjs → identity-created-PW2BA46S.mjs} +7 -7
- package/dist/lib/browser/identity-created-PW2BA46S.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +95 -24
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-RWU6ZE4H.mjs → intent-resolver-2RWP2F23.mjs} +183 -28
- package/dist/lib/browser/intent-resolver-2RWP2F23.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-QIKHSNT2.mjs → react-root-QUDHNVV5.mjs} +10 -10
- package/dist/lib/browser/{react-root-QIKHSNT2.mjs.map → react-root-QUDHNVV5.mjs.map} +2 -2
- package/dist/lib/browser/{react-surface-W56UD53I.mjs → react-surface-S47ZR44T.mjs} +59 -27
- package/dist/lib/browser/react-surface-S47ZR44T.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-WREJNMIC.mjs → schema-defs-ATNBAQEU.mjs} +6 -6
- package/dist/lib/browser/schema-defs-ATNBAQEU.mjs.map +7 -0
- package/dist/lib/browser/{settings-K54STC5A.mjs → settings-NTC766QW.mjs} +6 -6
- package/dist/lib/browser/{settings-K54STC5A.mjs.map → settings-NTC766QW.mjs.map} +1 -1
- package/dist/lib/browser/{spaces-ready-3PDRDHPC.mjs → spaces-ready-NX7NRVSB.mjs} +19 -17
- package/dist/lib/browser/spaces-ready-NX7NRVSB.mjs.map +7 -0
- package/dist/lib/browser/{state-HRZ4VRXU.mjs → state-LAGTPHDQ.mjs} +6 -6
- package/dist/lib/browser/state-LAGTPHDQ.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/CollectionMain-ZJIFCWKZ.mjs +32 -0
- package/dist/lib/node-esm/CollectionMain-ZJIFCWKZ.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-7ADOXZ5W.mjs +91 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-7ADOXZ5W.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-BCHVZ4OM.mjs → app-graph-builder-KREU52XR.mjs} +190 -36
- package/dist/lib/node-esm/app-graph-builder-KREU52XR.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-TXRGGNP2.mjs → app-graph-serializer-L3IXSQ2I.mjs} +15 -15
- package/dist/lib/node-esm/app-graph-serializer-L3IXSQ2I.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3CP67AYY.mjs → chunk-FJZNSJC4.mjs} +5 -4
- package/dist/lib/node-esm/chunk-FJZNSJC4.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-BSLREHIX.mjs → chunk-HC677WUJ.mjs} +4 -3
- package/dist/lib/node-esm/chunk-HC677WUJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-MSWEFAPD.mjs → chunk-HWNG4MEU.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-JBQKU4K5.mjs → chunk-LGNPMOXU.mjs} +76 -14
- package/dist/lib/node-esm/chunk-LGNPMOXU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GH2FGJXH.mjs → chunk-Q6AAQLQG.mjs} +6 -6
- package/dist/lib/node-esm/{chunk-GH2FGJXH.mjs.map → chunk-Q6AAQLQG.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-LA6AVVH6.mjs → chunk-QUPBTNWJ.mjs} +440 -376
- package/dist/lib/node-esm/chunk-QUPBTNWJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-D4QMPPS7.mjs → chunk-RXDT5LA5.mjs} +68 -8
- package/dist/lib/node-esm/chunk-RXDT5LA5.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HO7AIKQS.mjs → chunk-TEUN2E4F.mjs} +189 -34
- package/dist/lib/node-esm/chunk-TEUN2E4F.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-35CTAQWI.mjs → identity-created-MWTLGQRU.mjs} +7 -7
- package/dist/lib/node-esm/identity-created-MWTLGQRU.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +95 -24
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-JO6L2VXC.mjs → intent-resolver-ORRPXJMN.mjs} +183 -28
- package/dist/lib/node-esm/intent-resolver-ORRPXJMN.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-YFGL3B4J.mjs → react-root-2WBNW4VQ.mjs} +10 -10
- package/dist/lib/node-esm/{react-root-YFGL3B4J.mjs.map → react-root-2WBNW4VQ.mjs.map} +2 -2
- package/dist/lib/node-esm/{react-surface-CVAPDLEZ.mjs → react-surface-MI5G3TD6.mjs} +59 -27
- package/dist/lib/node-esm/react-surface-MI5G3TD6.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-4MEJETVX.mjs → schema-defs-7LEPK3R6.mjs} +6 -6
- package/dist/lib/node-esm/schema-defs-7LEPK3R6.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-TD76LTQS.mjs → settings-RWOW2SE5.mjs} +6 -6
- package/dist/lib/node-esm/{settings-TD76LTQS.mjs.map → settings-RWOW2SE5.mjs.map} +1 -1
- package/dist/lib/node-esm/{spaces-ready-FJMGPAVV.mjs → spaces-ready-KD57IOYI.mjs} +19 -17
- package/dist/lib/node-esm/spaces-ready-KD57IOYI.mjs.map +7 -0
- package/dist/lib/node-esm/{state-XQNDCN37.mjs → state-JKO4JKA2.mjs} +6 -6
- package/dist/lib/node-esm/state-JKO4JKA2.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- 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/app-graph-serializer.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +9 -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/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 +4 -3
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +1584 -3
- 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/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 -4
- 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 +1 -1
- package/dist/types/src/components/PopoverRenameObject.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 +1411 -2
- 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 -3
- 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 -4
- 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/translations.d.ts +1402 -410
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +82 -22
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +32 -5
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +54 -53
- package/src/SpacePlugin.ts +81 -16
- package/src/capabilities/app-graph-builder.ts +232 -22
- package/src/capabilities/app-graph-serializer.ts +6 -6
- package/src/capabilities/capabilities.ts +9 -3
- package/src/capabilities/identity-created.ts +3 -5
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/intent-resolver.ts +136 -15
- package/src/capabilities/react-root.tsx +2 -1
- package/src/capabilities/react-surface.tsx +73 -22
- package/src/capabilities/schema-defs.ts +3 -2
- package/src/capabilities/spaces-ready.ts +10 -7
- package/src/capabilities/state.ts +3 -2
- package/src/components/AwaitingObject.tsx +5 -7
- package/src/components/CollectionMain.tsx +2 -0
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +9 -8
- package/src/components/CreateDialog/CreateObjectDialog.tsx +47 -33
- package/src/components/CreateDialog/CreateObjectPanel.tsx +18 -7
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +1 -1
- package/src/components/JoinDialog.tsx +1 -1
- package/src/components/MembersContainer.stories.tsx +35 -10
- package/src/components/MembersContainer.tsx +13 -13
- package/src/components/MenuFooter.tsx +2 -3
- package/src/components/ObjectDetailsPanel.tsx +79 -0
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +2 -1
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +3 -2
- package/src/components/PersistenceStatus.tsx +5 -6
- package/src/components/PopoverRenameObject.tsx +7 -13
- package/src/components/PopoverRenameSpace.tsx +1 -1
- package/src/components/RecordMain.tsx +43 -0
- package/src/components/SchemaContainer.tsx +2 -2
- package/src/components/SpacePluginSettings.tsx +6 -7
- package/src/components/SpacePresence.stories.tsx +8 -5
- package/src/components/SpacePresence.tsx +7 -7
- package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +9 -6
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +8 -8
- package/src/components/SyncStatus/SyncStatus.stories.tsx +12 -18
- package/src/components/SyncStatus/SyncStatus.tsx +4 -3
- package/src/components/SyncStatus/save-tracker.ts +3 -3
- 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 +2 -1
- package/src/hooks/useActiveSpace.ts +2 -2
- package/src/hooks/useInputSurfaceLookup.tsx +1 -1
- package/src/translations.ts +74 -9
- package/src/types/types.ts +66 -9
- package/src/util.tsx +177 -33
- package/dist/lib/browser/app-graph-builder-M2RH72VL.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-F7ISRRBV.mjs.map +0 -7
- package/dist/lib/browser/chunk-4ZKSFDXM.mjs.map +0 -7
- package/dist/lib/browser/chunk-BXNL6SDI.mjs.map +0 -7
- package/dist/lib/browser/chunk-NFUKCRGE.mjs.map +0 -7
- package/dist/lib/browser/chunk-TW7O2EPP.mjs.map +0 -7
- package/dist/lib/browser/chunk-V24VASAJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-YMCZR6EZ.mjs.map +0 -7
- package/dist/lib/browser/identity-created-PI7TKANR.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-RWU6ZE4H.mjs.map +0 -7
- package/dist/lib/browser/react-surface-W56UD53I.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-WREJNMIC.mjs.map +0 -7
- package/dist/lib/browser/schema-tools-ILTVSSS3.mjs +0 -124
- package/dist/lib/browser/schema-tools-ILTVSSS3.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-3PDRDHPC.mjs.map +0 -7
- package/dist/lib/browser/state-HRZ4VRXU.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-6LK5HLLE.cjs +0 -364
- package/dist/lib/node/app-graph-builder-6LK5HLLE.cjs.map +0 -7
- package/dist/lib/node/app-graph-serializer-HKHBNHA3.cjs +0 -89
- package/dist/lib/node/app-graph-serializer-HKHBNHA3.cjs.map +0 -7
- package/dist/lib/node/chunk-3X4EA4XL.cjs +0 -37
- package/dist/lib/node/chunk-3X4EA4XL.cjs.map +0 -7
- package/dist/lib/node/chunk-5WLAXYE3.cjs +0 -125
- package/dist/lib/node/chunk-5WLAXYE3.cjs.map +0 -7
- package/dist/lib/node/chunk-6P2DB4QQ.cjs +0 -36
- package/dist/lib/node/chunk-6P2DB4QQ.cjs.map +0 -7
- package/dist/lib/node/chunk-DOC5XEZ4.cjs +0 -184
- package/dist/lib/node/chunk-DOC5XEZ4.cjs.map +0 -7
- package/dist/lib/node/chunk-NCHF433F.cjs +0 -1921
- package/dist/lib/node/chunk-NCHF433F.cjs.map +0 -7
- package/dist/lib/node/chunk-NL5Y4EDX.cjs +0 -38
- package/dist/lib/node/chunk-NL5Y4EDX.cjs.map +0 -7
- package/dist/lib/node/chunk-ULJZPATP.cjs +0 -312
- package/dist/lib/node/chunk-ULJZPATP.cjs.map +0 -7
- package/dist/lib/node/chunk-XHWVT7LW.cjs +0 -572
- package/dist/lib/node/chunk-XHWVT7LW.cjs.map +0 -7
- package/dist/lib/node/identity-created-FF4WZ2WY.cjs +0 -42
- package/dist/lib/node/identity-created-FF4WZ2WY.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -278
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-AV4CMM3Z.cjs +0 -609
- package/dist/lib/node/intent-resolver-AV4CMM3Z.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/react-root-RQUU3A45.cjs +0 -51
- package/dist/lib/node/react-root-RQUU3A45.cjs.map +0 -7
- package/dist/lib/node/react-surface-AZFJLE72.cjs +0 -351
- package/dist/lib/node/react-surface-AZFJLE72.cjs.map +0 -7
- package/dist/lib/node/schema-defs-OB2X2HBH.cjs +0 -42
- package/dist/lib/node/schema-defs-OB2X2HBH.cjs.map +0 -7
- package/dist/lib/node/schema-tools-IYREN4IH.cjs +0 -147
- package/dist/lib/node/schema-tools-IYREN4IH.cjs.map +0 -7
- package/dist/lib/node/settings-P2EQ7VKQ.cjs +0 -38
- package/dist/lib/node/settings-P2EQ7VKQ.cjs.map +0 -7
- package/dist/lib/node/spaces-ready-DXPOHYV7.cjs +0 -210
- package/dist/lib/node/spaces-ready-DXPOHYV7.cjs.map +0 -7
- package/dist/lib/node/state-M35DK75Z.cjs +0 -61
- package/dist/lib/node/state-M35DK75Z.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs +0 -48
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-BCHVZ4OM.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-TXRGGNP2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3CP67AYY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BSLREHIX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-D4QMPPS7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HO7AIKQS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JBQKU4K5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LA6AVVH6.mjs.map +0 -7
- package/dist/lib/node-esm/identity-created-35CTAQWI.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-JO6L2VXC.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-CVAPDLEZ.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-4MEJETVX.mjs.map +0 -7
- package/dist/lib/node-esm/schema-tools-SRLCRZ3B.mjs +0 -126
- package/dist/lib/node-esm/schema-tools-SRLCRZ3B.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-FJMGPAVV.mjs.map +0 -7
- package/dist/lib/node-esm/state-XQNDCN37.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
- /package/dist/lib/browser/{chunk-PTKYMZWO.mjs.map → chunk-FBCGT5YY.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-MSWEFAPD.mjs.map → chunk-HWNG4MEU.mjs.map} +0 -0
|
@@ -4,7 +4,8 @@
|
|
|
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';
|
|
@@ -13,24 +14,17 @@ import { SPACE_PLUGIN } from '../meta';
|
|
|
13
14
|
|
|
14
15
|
export const POPOVER_RENAME_OBJECT = `${SPACE_PLUGIN}/PopoverRenameObject`;
|
|
15
16
|
|
|
16
|
-
export const PopoverRenameObject = ({ object
|
|
17
|
+
export const PopoverRenameObject = ({ object }: { object: Live<any> }) => {
|
|
17
18
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
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
|
-
|
|
28
|
-
} catch {
|
|
29
|
-
|
|
30
|
-
object.title = name;
|
|
31
|
-
} catch (err) {
|
|
32
|
-
log.error('Failed to rename object', { err });
|
|
33
|
-
}
|
|
25
|
+
name && Obj.setLabel(object, name);
|
|
26
|
+
} catch (err) {
|
|
27
|
+
log.error('Failed to rename object', { err });
|
|
34
28
|
}
|
|
35
29
|
void dispatch(
|
|
36
30
|
createIntent(LayoutAction.UpdatePopover, {
|
|
@@ -4,7 +4,7 @@
|
|
|
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
|
|
|
@@ -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,12 +2,12 @@
|
|
|
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
13
|
import { SPACE_PLUGIN } from '../meta';
|
|
@@ -7,8 +7,8 @@ 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
13
|
import { SPACE_PLUGIN } from '../meta';
|
|
14
14
|
import { SpaceAction, type SpaceSettingsProps } from '../types';
|
|
@@ -20,18 +20,17 @@ export const SpacePluginSettings = ({ settings }: { settings: SpaceSettingsProps
|
|
|
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'>
|
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta } from '@storybook/react';
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
10
|
import { IdentityDid, PublicKey } from '@dxos/keys';
|
|
11
11
|
import { HaloSpaceMember, SpaceMember } from '@dxos/react-client/echo';
|
|
12
12
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
13
13
|
|
|
14
|
-
import {
|
|
15
|
-
|
|
14
|
+
import { translations } from '../translations';
|
|
15
|
+
|
|
16
|
+
import { FullPresence, type Member, type MemberPresenceProps, SmallPresence } from './SpacePresence';
|
|
16
17
|
|
|
17
18
|
const nViewers = (n: number, currentlyAttended = true): Member[] =>
|
|
18
19
|
Array.from({ length: n }, () => ({
|
|
@@ -98,10 +99,12 @@ export const Small = () => {
|
|
|
98
99
|
);
|
|
99
100
|
};
|
|
100
101
|
|
|
101
|
-
const meta
|
|
102
|
+
const meta = {
|
|
102
103
|
title: 'plugins/plugin-space/SpacePresence',
|
|
103
104
|
decorators: [withTheme, withLayout()],
|
|
104
105
|
parameters: { translations },
|
|
105
|
-
}
|
|
106
|
+
} satisfies Meta<typeof IdentityDid>;
|
|
106
107
|
|
|
107
108
|
export default meta;
|
|
109
|
+
|
|
110
|
+
type Story = StoryObj<typeof meta>;
|
|
@@ -9,22 +9,22 @@ 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';
|
|
@@ -4,25 +4,26 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta, type StoryObj } from '@storybook/react';
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
10
|
import { useClientProvider, withClientProvider } from '@dxos/react-client/testing';
|
|
11
11
|
import { withTheme } from '@dxos/storybook-utils';
|
|
12
12
|
|
|
13
|
+
import { translations } from '../../translations';
|
|
14
|
+
|
|
13
15
|
import { SpaceSettingsContainer, type SpaceSettingsContainerProps } from './SpaceSettingsContainer';
|
|
14
|
-
import translations from '../../translations';
|
|
15
16
|
|
|
16
|
-
const Story = (
|
|
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,
|
|
@@ -31,8 +32,10 @@ const meta: Meta = {
|
|
|
31
32
|
translations,
|
|
32
33
|
layout: 'centered',
|
|
33
34
|
},
|
|
34
|
-
}
|
|
35
|
+
} satisfies Meta<typeof SpaceSettingsContainer>;
|
|
35
36
|
|
|
36
37
|
export default meta;
|
|
37
38
|
|
|
39
|
+
type Story = StoryObj<typeof meta>;
|
|
40
|
+
|
|
38
41
|
export const Default: StoryObj<typeof SpaceSettingsContainer> = {};
|
|
@@ -2,22 +2,22 @@
|
|
|
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';
|
|
@@ -162,7 +162,7 @@ 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
168
|
title={t('space properties settings verbose label', { ns: SPACE_PLUGIN })}
|
|
@@ -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>
|
|
@@ -4,33 +4,27 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta, type StoryObj } from '@storybook/react';
|
|
8
|
-
import React from 'react';
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
9
8
|
|
|
10
|
-
import { withTheme
|
|
9
|
+
import { withTheme } from '@dxos/storybook-utils';
|
|
10
|
+
|
|
11
|
+
import { translations } from '../../translations';
|
|
11
12
|
|
|
12
13
|
import { SyncStatusIndicator } from './SyncStatus';
|
|
13
|
-
import translations from '../../translations';
|
|
14
|
-
|
|
15
|
-
const DefaultStory = (props: any) => {
|
|
16
|
-
return (
|
|
17
|
-
<div className='flex flex-col-reverse p-4'>
|
|
18
|
-
<SyncStatusIndicator {...props} />
|
|
19
|
-
</div>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
14
|
|
|
23
|
-
const meta
|
|
15
|
+
const meta = {
|
|
24
16
|
title: 'plugins/plugin-space/SyncStatusIndicator',
|
|
25
17
|
component: SyncStatusIndicator,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
decorators: [withTheme],
|
|
19
|
+
parameters: {
|
|
20
|
+
translations,
|
|
21
|
+
layout: 'centered',
|
|
22
|
+
},
|
|
23
|
+
} satisfies Meta<typeof SyncStatusIndicator>;
|
|
30
24
|
|
|
31
25
|
export default meta;
|
|
32
26
|
|
|
33
|
-
type Story = StoryObj<typeof
|
|
27
|
+
type Story = StoryObj<typeof meta>;
|
|
34
28
|
|
|
35
29
|
export const Default: Story = {
|
|
36
30
|
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 { SPACE_PLUGIN } 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,7 +30,7 @@ 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
|
+
export const SyncStatusIndicator = ({ state, saved }: { state: SpaceSyncStateMap; saved: boolean }) => {
|
|
33
34
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
34
35
|
const summary = getSyncSummary(state);
|
|
35
36
|
const offline = Object.values(state).length === 0;
|
|
@@ -46,15 +46,15 @@ const createSpaceSaveTracker = (space: Space, cb: (state: 'saved' | 'saving') =>
|
|
|
46
46
|
|
|
47
47
|
let hasUnsavedChanges = false;
|
|
48
48
|
let lastFlushPromise: Promise<void> | undefined;
|
|
49
|
-
space.
|
|
49
|
+
space.db.saveStateChanged.on(ctx, ({ unsavedDocuments }) => {
|
|
50
50
|
hasUnsavedChanges = unsavedDocuments.length > 0;
|
|
51
51
|
});
|
|
52
|
-
space.
|
|
52
|
+
space.db.saveStateChanged.debounce(500).on(ctx, () => {
|
|
53
53
|
if (hasUnsavedChanges) {
|
|
54
54
|
lastFlushPromise = undefined;
|
|
55
55
|
cb('saving');
|
|
56
56
|
} else {
|
|
57
|
-
const flushPromise = space.
|
|
57
|
+
const flushPromise = space.db.flush();
|
|
58
58
|
lastFlushPromise = flushPromise;
|
|
59
59
|
void flushPromise.then(() => {
|
|
60
60
|
if (lastFlushPromise === flushPromise) {
|
|
@@ -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) : 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 = 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,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Events, defineEvent } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
7
|
import { SPACE_PLUGIN } from './meta';
|
|
8
8
|
|
|
@@ -11,4 +11,5 @@ export namespace SpaceEvents {
|
|
|
11
11
|
export const SetupSettingsPanel = defineEvent(`${SPACE_PLUGIN}/event/setup-settings-panel`);
|
|
12
12
|
export const DefaultSpaceReady = defineEvent(`${SPACE_PLUGIN}/event/default-space-ready`);
|
|
13
13
|
export const SpaceCreated = defineEvent(`${SPACE_PLUGIN}/event/space-created`);
|
|
14
|
+
export const SchemaAdded = defineEvent(`${SPACE_PLUGIN}/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.
|