@dxos/plugin-space 0.8.4-main.84f28bd → 0.8.4-main.ae835ea
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-HTKSZCRR.mjs +31 -0
- package/dist/lib/browser/CollectionMain-HTKSZCRR.mjs.map +7 -0
- package/dist/lib/browser/ObjectDetailsPanel-5B45G744.mjs +145 -0
- package/dist/lib/browser/ObjectDetailsPanel-5B45G744.mjs.map +7 -0
- package/dist/lib/browser/ObjectSettings-UFTKBP7B.mjs +146 -0
- package/dist/lib/browser/ObjectSettings-UFTKBP7B.mjs.map +7 -0
- package/dist/lib/browser/RecordMain-BCSXTSEB.mjs +99 -0
- package/dist/lib/browser/RecordMain-BCSXTSEB.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-QJFO4ANM.mjs +520 -0
- package/dist/lib/browser/app-graph-builder-QJFO4ANM.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-UKYMBX4O.mjs → app-graph-serializer-3R5NVV7U.mjs} +14 -14
- package/dist/lib/browser/app-graph-serializer-3R5NVV7U.mjs.map +7 -0
- package/dist/lib/browser/chunk-2NS3VPSY.mjs +20 -0
- package/dist/lib/browser/chunk-2NS3VPSY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6VLSHG4A.mjs → chunk-4V4JNJ33.mjs} +80 -10
- package/dist/lib/browser/chunk-4V4JNJ33.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GVTXQCIW.mjs → chunk-ENBBJSNE.mjs} +482 -448
- package/dist/lib/browser/chunk-ENBBJSNE.mjs.map +7 -0
- package/dist/lib/browser/chunk-HS2VD6DN.mjs +166 -0
- package/dist/lib/browser/chunk-HS2VD6DN.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WBSEOLEM.mjs → chunk-OWNBEI5J.mjs} +221 -57
- package/dist/lib/browser/chunk-OWNBEI5J.mjs.map +7 -0
- package/dist/lib/browser/{chunk-S6NY637J.mjs → chunk-SLDQWMQ2.mjs} +77 -12
- package/dist/lib/browser/chunk-SLDQWMQ2.mjs.map +7 -0
- package/dist/lib/browser/chunk-VZBIIYFM.mjs +16 -0
- package/dist/lib/browser/chunk-VZBIIYFM.mjs.map +7 -0
- package/dist/lib/browser/chunk-WJXU4GKV.mjs +19 -0
- package/dist/lib/browser/chunk-WJXU4GKV.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 +109 -40
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-WK5WYFH3.mjs → intent-resolver-MBVOLXFQ.mjs} +194 -32
- package/dist/lib/browser/intent-resolver-MBVOLXFQ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-7S6FIC5G.mjs → react-root-NKEKCEYM.mjs} +11 -11
- package/dist/lib/browser/react-root-NKEKCEYM.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-6C3YJNDK.mjs → react-surface-PYSN2MBY.mjs} +78 -77
- package/dist/lib/browser/react-surface-PYSN2MBY.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-K3B3OAH4.mjs → schema-defs-DWYK7TYW.mjs} +5 -5
- package/dist/lib/browser/schema-defs-DWYK7TYW.mjs.map +7 -0
- package/dist/lib/browser/{settings-XNWYRWNM.mjs → settings-ZUCC3ZLB.mjs} +5 -5
- package/dist/lib/browser/{settings-XNWYRWNM.mjs.map → settings-ZUCC3ZLB.mjs.map} +1 -1
- package/dist/lib/browser/{spaces-ready-K7NSNBHM.mjs → spaces-ready-HTWWJHLR.mjs} +18 -16
- package/dist/lib/browser/spaces-ready-HTWWJHLR.mjs.map +7 -0
- package/dist/lib/browser/{state-522XTUR4.mjs → state-ISVAKMO7.mjs} +7 -7
- package/dist/lib/browser/state-ISVAKMO7.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/CollectionMain-OUHGG6OC.mjs +32 -0
- package/dist/lib/node-esm/CollectionMain-OUHGG6OC.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-4SDHQVQU.mjs +146 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-4SDHQVQU.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectSettings-EU6F43RP.mjs +147 -0
- package/dist/lib/node-esm/ObjectSettings-EU6F43RP.mjs.map +7 -0
- package/dist/lib/node-esm/RecordMain-SD76DGOR.mjs +100 -0
- package/dist/lib/node-esm/RecordMain-SD76DGOR.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-TO72W6MI.mjs → app-graph-builder-B23W62HY.mjs} +215 -58
- package/dist/lib/node-esm/app-graph-builder-B23W62HY.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-LA3IZDXJ.mjs → app-graph-serializer-3Z3EXEEF.mjs} +14 -14
- package/dist/lib/node-esm/app-graph-serializer-3Z3EXEEF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-BDEFTL6K.mjs +18 -0
- package/dist/lib/node-esm/chunk-BDEFTL6K.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SXD6T2N4.mjs → chunk-G4PDWB7G.mjs} +80 -10
- package/dist/lib/node-esm/chunk-G4PDWB7G.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-H4JILUJK.mjs +20 -0
- package/dist/lib/node-esm/chunk-H4JILUJK.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OUBADVJE.mjs → chunk-KKPCCA5O.mjs} +482 -448
- package/dist/lib/node-esm/chunk-KKPCCA5O.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-PM4ZIGKC.mjs +167 -0
- package/dist/lib/node-esm/chunk-PM4ZIGKC.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HJJHLWKY.mjs → chunk-XEVIWD3O.mjs} +221 -57
- package/dist/lib/node-esm/chunk-XEVIWD3O.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2THX6G4C.mjs → chunk-YFQXFQGT.mjs} +77 -12
- package/dist/lib/node-esm/chunk-YFQXFQGT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZLMFLI7G.mjs +21 -0
- package/dist/lib/node-esm/chunk-ZLMFLI7G.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 +109 -40
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-HSR27ME4.mjs → intent-resolver-IWI47NTW.mjs} +194 -32
- package/dist/lib/node-esm/intent-resolver-IWI47NTW.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-HUK3ANLV.mjs → react-root-LX7SIG6M.mjs} +11 -11
- package/dist/lib/node-esm/react-root-LX7SIG6M.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-AGAWX7DD.mjs → react-surface-6SVGOZNJ.mjs} +78 -77
- package/dist/lib/node-esm/react-surface-6SVGOZNJ.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-4MCDG4DV.mjs → schema-defs-EOG2UPJU.mjs} +5 -5
- package/dist/lib/node-esm/schema-defs-EOG2UPJU.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-YGKHGFPH.mjs → settings-ZDJNLFGW.mjs} +5 -5
- package/dist/lib/node-esm/{settings-YGKHGFPH.mjs.map → settings-ZDJNLFGW.mjs.map} +1 -1
- package/dist/lib/node-esm/{spaces-ready-UM2P3DCR.mjs → spaces-ready-VUGYPF4L.mjs} +18 -16
- package/dist/lib/node-esm/spaces-ready-VUGYPF4L.mjs.map +7 -0
- package/dist/lib/node-esm/{state-C4IOXPZP.mjs → state-QZ4Q6ZRL.mjs} +7 -7
- package/dist/lib/node-esm/state-QZ4Q6ZRL.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 +12 -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 +1664 -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 +1664 -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/ObjectDetailsPanel.d.ts +9 -0
- package/dist/types/src/components/ObjectDetailsPanel/ObjectDetailsPanel.d.ts.map +1 -0
- package/dist/types/src/components/ObjectDetailsPanel/ObjectForm.d.ts +10 -0
- package/dist/types/src/components/ObjectDetailsPanel/ObjectForm.d.ts.map +1 -0
- package/dist/types/src/components/ObjectDetailsPanel/index.d.ts +3 -0
- package/dist/types/src/components/ObjectDetailsPanel/index.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts +2 -2
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.stories.d.ts +1500 -0
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.stories.d.ts.map +1 -0
- 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/ObjectSettings/index.d.ts +2 -1
- package/dist/types/src/components/ObjectSettings/index.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 +8 -0
- package/dist/types/src/components/RecordMain.d.ts.map +1 -0
- package/dist/types/src/components/RecordMain.stories.d.ts +1667 -0
- package/dist/types/src/components/RecordMain.stories.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 +1492 -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 +1497 -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 +1498 -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 +13 -2
- 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/index.d.ts +1 -0
- package/dist/types/src/hooks/index.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/hooks/useTypeOptions.d.ts +10 -0
- package/dist/types/src/hooks/useTypeOptions.d.ts.map +1 -0
- 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 +1342 -11
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +128 -66
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +37 -7
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +63 -60
- package/src/SpacePlugin.ts +201 -139
- package/src/capabilities/app-graph-builder.ts +265 -47
- package/src/capabilities/app-graph-serializer.ts +7 -7
- package/src/capabilities/capabilities.ts +20 -9
- package/src/capabilities/identity-created.ts +1 -1
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/intent-resolver.ts +147 -21
- package/src/capabilities/react-root.tsx +4 -3
- package/src/capabilities/react-surface.tsx +79 -99
- 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 +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 +51 -36
- 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 +18 -17
- package/src/components/MenuFooter.tsx +4 -5
- package/src/components/ObjectDetailsPanel/ObjectDetailsPanel.tsx +52 -0
- package/src/components/ObjectDetailsPanel/ObjectForm.tsx +75 -0
- package/src/components/ObjectDetailsPanel/index.ts +7 -0
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +4 -3
- package/src/components/ObjectSettings/BaseObjectSettings.stories.tsx +63 -0
- package/src/components/ObjectSettings/BaseObjectSettings.tsx +86 -26
- package/src/components/ObjectSettings/ForeignKeys.tsx +3 -3
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +3 -2
- package/src/components/ObjectSettings/index.ts +3 -1
- 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.stories.tsx +116 -0
- package/src/components/RecordMain.tsx +83 -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 +7 -7
- package/src/components/SyncStatus/SyncStatus.stories.tsx +9 -9
- package/src/components/SyncStatus/SyncStatus.tsx +98 -7
- package/src/components/SyncStatus/status.ts +4 -4
- package/src/components/ViewEditor.tsx +58 -0
- package/src/components/index.ts +8 -2
- package/src/events.ts +7 -6
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useActiveSpace.ts +2 -2
- package/src/hooks/useInputSurfaceLookup.tsx +2 -2
- package/src/hooks/usePath.ts +1 -1
- package/src/hooks/useTypeOptions.ts +59 -0
- package/src/meta.ts +6 -3
- package/src/translations.ts +77 -5
- package/src/types/types.ts +78 -16
- package/src/util.tsx +215 -57
- package/dist/lib/browser/app-graph-builder-PMDF6PJV.mjs +0 -363
- 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-VLBRSGJ2.mjs +0 -94
- package/dist/lib/browser/chunk-VLBRSGJ2.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 +0 -15
- 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-SSLBYZEY.mjs +0 -96
- package/dist/lib/node-esm/chunk-SSLBYZEY.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,19 +2,17 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Check, X } from '@phosphor-icons/react';
|
|
6
5
|
import React, { type Dispatch, type SetStateAction, useCallback, useMemo, useState } from 'react';
|
|
7
6
|
import { QR } from 'react-qr-rounded';
|
|
8
7
|
|
|
9
8
|
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
10
9
|
import { log } from '@dxos/log';
|
|
11
10
|
import { useConfig } from '@dxos/react-client';
|
|
12
|
-
import { fullyQualifiedId, useSpaceInvitations
|
|
11
|
+
import { type Space, fullyQualifiedId, useSpaceInvitations } from '@dxos/react-client/echo';
|
|
13
12
|
import { type CancellableInvitationObservable, Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
|
|
14
13
|
import { Button, Clipboard, Icon, Input, useId, useTranslation } from '@dxos/react-ui';
|
|
15
|
-
import {
|
|
14
|
+
import { ControlFrame, ControlFrameItem, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
16
15
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
17
|
-
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
18
16
|
import { DataType } from '@dxos/schema';
|
|
19
17
|
import {
|
|
20
18
|
type ActionMenuItem,
|
|
@@ -28,7 +26,7 @@ import {
|
|
|
28
26
|
} from '@dxos/shell/react';
|
|
29
27
|
import { hexToEmoji } from '@dxos/util';
|
|
30
28
|
|
|
31
|
-
import {
|
|
29
|
+
import { meta } from '../meta';
|
|
32
30
|
import { SpaceAction } from '../types';
|
|
33
31
|
import { COMPOSER_SPACE_LOCK } from '../util';
|
|
34
32
|
|
|
@@ -43,14 +41,13 @@ const handleInvitationEvent = (invitation: Invitation, subscription: ZenObservab
|
|
|
43
41
|
}
|
|
44
42
|
};
|
|
45
43
|
|
|
46
|
-
export
|
|
47
|
-
space,
|
|
48
|
-
createInvitationUrl,
|
|
49
|
-
}: {
|
|
44
|
+
export type MembersContainerProps = {
|
|
50
45
|
space: Space;
|
|
51
46
|
createInvitationUrl: (invitationCode: string) => string;
|
|
52
|
-
}
|
|
53
|
-
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const MembersContainer = ({ space, createInvitationUrl }: MembersContainerProps) => {
|
|
50
|
+
const { t } = useTranslation(meta.id);
|
|
54
51
|
const config = useConfig();
|
|
55
52
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
56
53
|
const invitations = useSpaceInvitations(space.key);
|
|
@@ -78,7 +75,7 @@ export const MembersContainer = ({
|
|
|
78
75
|
inviteOne: {
|
|
79
76
|
label: t('invite one label', { ns: 'os' }),
|
|
80
77
|
description: t('invite one description', { ns: 'os' }),
|
|
81
|
-
icon:
|
|
78
|
+
icon: 'ph--user-plus--regular',
|
|
82
79
|
testId: 'membersContainer.inviteOne',
|
|
83
80
|
onClick: async () => {
|
|
84
81
|
const { data: invitation } = await dispatch(
|
|
@@ -100,7 +97,7 @@ export const MembersContainer = ({
|
|
|
100
97
|
inviteMany: {
|
|
101
98
|
label: t('invite many label', { ns: 'os' }),
|
|
102
99
|
description: t('invite many description', { ns: 'os' }),
|
|
103
|
-
icon:
|
|
100
|
+
icon: 'ph--users-three--regular',
|
|
104
101
|
testId: 'membersContainer.inviteMany',
|
|
105
102
|
onClick: async () => {
|
|
106
103
|
const { data: invitation } = await dispatch(
|
|
@@ -133,7 +130,7 @@ export const MembersContainer = ({
|
|
|
133
130
|
|
|
134
131
|
return (
|
|
135
132
|
<Clipboard.Provider>
|
|
136
|
-
<StackItem.Content
|
|
133
|
+
<StackItem.Content scrollable>
|
|
137
134
|
<ControlPage>
|
|
138
135
|
<ControlSection title={t('members verbose label')} description={t('members description')}>
|
|
139
136
|
<ControlFrame>
|
|
@@ -170,7 +167,7 @@ export const MembersContainer = ({
|
|
|
170
167
|
)}
|
|
171
168
|
</ControlFrame>
|
|
172
169
|
{/* TODO(wittjosiah): Make ControlItemInput & ControlFrame compatible. */}
|
|
173
|
-
<div className='justify-center
|
|
170
|
+
<div className='justify-center p-0 mbs-4 container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]'>
|
|
174
171
|
<ControlItemInput title={t('space locked label')} description={t('space locked description')}>
|
|
175
172
|
<Input.Switch checked={locked} onCheckedChange={handleChangeLocked} classNames='justify-self-end' />
|
|
176
173
|
</ControlItemInput>
|
|
@@ -233,7 +230,7 @@ const InvitationQR = ({ id, url, onCancel }: { id: string; url: string; onCancel
|
|
|
233
230
|
const emoji = hexToEmoji(id);
|
|
234
231
|
return (
|
|
235
232
|
<>
|
|
236
|
-
<p className='text-description'>{t('qr code description', { ns:
|
|
233
|
+
<p className='text-description'>{t('qr code description', { ns: meta.id })}</p>
|
|
237
234
|
<div role='group' className='grid grid-cols-[1fr_min-content] mlb-2 gap-2'>
|
|
238
235
|
<div role='none' className='is-full aspect-square relative text-description'>
|
|
239
236
|
<QR
|
|
@@ -280,5 +277,9 @@ const InvitationAuthCode = ({ id, code, onCancel }: { id: string; code: string;
|
|
|
280
277
|
};
|
|
281
278
|
|
|
282
279
|
const InvitationComplete = ({ statusValue }: { statusValue: number }) => {
|
|
283
|
-
return statusValue > 0 ?
|
|
280
|
+
return statusValue > 0 ? (
|
|
281
|
+
<Icon icon='ph--check--regular' size={6} classNames='m-1.5' />
|
|
282
|
+
) : (
|
|
283
|
+
<Icon icon='ph--x--regular' size={6} classNames='m-1.5' />
|
|
284
|
+
);
|
|
284
285
|
};
|
|
@@ -2,19 +2,18 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Planet } from '@phosphor-icons/react';
|
|
6
5
|
import React from 'react';
|
|
7
6
|
|
|
8
7
|
import { getSpace } from '@dxos/client/echo';
|
|
9
8
|
import { type Obj } from '@dxos/echo';
|
|
10
9
|
import { useClient } from '@dxos/react-client';
|
|
11
|
-
import { DropdownMenu, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import { DropdownMenu, Icon, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
12
11
|
|
|
13
|
-
import {
|
|
12
|
+
import { meta } from '../meta';
|
|
14
13
|
import { getSpaceDisplayName } from '../util';
|
|
15
14
|
|
|
16
15
|
export const MenuFooter = ({ object }: { object: Obj.Any }) => {
|
|
17
|
-
const { t } = useTranslation(
|
|
16
|
+
const { t } = useTranslation(meta.id);
|
|
18
17
|
const client = useClient();
|
|
19
18
|
const space = getSpace(object);
|
|
20
19
|
const spaceName = space ? getSpaceDisplayName(space, { personal: client.spaces.default === space }) : '';
|
|
@@ -25,7 +24,7 @@ export const MenuFooter = ({ object }: { object: Obj.Any }) => {
|
|
|
25
24
|
<dl className='pis-2 mbe-2 text-xs grid grid-cols-[max-content_1fr] gap-2'>
|
|
26
25
|
<dt className='uppercase text-[.75em] tracking-wide font-medium mbs-px self-start'>{t('location label')}</dt>
|
|
27
26
|
<dd className='line-clamp-3'>
|
|
28
|
-
<
|
|
27
|
+
<Icon icon='ph--planet--regular' classNames='inline-block mie-1' />
|
|
29
28
|
{toLocalizedString(spaceName, t)}
|
|
30
29
|
</dd>
|
|
31
30
|
</dl>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { useClient } from '@dxos/react-client';
|
|
8
|
+
import { Filter, getSpace, useQuery, useSchema } from '@dxos/react-client/echo';
|
|
9
|
+
import { Callout, useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import { useSelected } from '@dxos/react-ui-attention';
|
|
11
|
+
import { type DataType } from '@dxos/schema';
|
|
12
|
+
import { getTypenameFromQuery } from '@dxos/schema';
|
|
13
|
+
import { isNonNullable } from '@dxos/util';
|
|
14
|
+
|
|
15
|
+
import { meta } from '../../meta';
|
|
16
|
+
|
|
17
|
+
import { ObjectForm } from './ObjectForm';
|
|
18
|
+
|
|
19
|
+
type RowDetailsPanelProps = { objectId: string; view: DataType.View };
|
|
20
|
+
|
|
21
|
+
export const ObjectDetailsPanel = ({ objectId, view }: RowDetailsPanelProps) => {
|
|
22
|
+
const { t } = useTranslation(meta.id);
|
|
23
|
+
const client = useClient();
|
|
24
|
+
const space = getSpace(view);
|
|
25
|
+
const typename = view.query ? getTypenameFromQuery(view.query.ast) : undefined;
|
|
26
|
+
const schema = useSchema(client, space, typename);
|
|
27
|
+
|
|
28
|
+
const queriedObjects = useQuery(space, schema ? Filter.type(schema) : Filter.nothing());
|
|
29
|
+
const selectedRows = useSelected(objectId, 'multi');
|
|
30
|
+
const selectedObjects = selectedRows.map((id) => queriedObjects.find((obj) => obj.id === id)).filter(isNonNullable);
|
|
31
|
+
|
|
32
|
+
if (selectedObjects.length === 0) {
|
|
33
|
+
return (
|
|
34
|
+
<div role='none' className='plb-cardSpacingBlock pli-cardSpacingInline'>
|
|
35
|
+
<Callout.Root classNames='is-full'>
|
|
36
|
+
<Callout.Title>{t('row details no selection label')}</Callout.Title>
|
|
37
|
+
</Callout.Root>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div role='none' className='bs-full is-full flex flex-col p-2 gap-1 overflow-y-auto'>
|
|
44
|
+
{schema &&
|
|
45
|
+
selectedObjects.map((object) => (
|
|
46
|
+
<div key={object.id} className='border border-separator rounded'>
|
|
47
|
+
<ObjectForm object={object} schema={schema} />
|
|
48
|
+
</div>
|
|
49
|
+
))}
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
import React, { useCallback, useMemo } from 'react';
|
|
7
|
+
|
|
8
|
+
import { DXN, Obj, Tag, Type } from '@dxos/echo';
|
|
9
|
+
import { type JsonPath, setValue } from '@dxos/echo/internal';
|
|
10
|
+
import { invariant } from '@dxos/invariant';
|
|
11
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
12
|
+
import { Form, useRefQueryLookupHandler } from '@dxos/react-ui-form';
|
|
13
|
+
|
|
14
|
+
import { meta as pluginMeta } from '../../meta';
|
|
15
|
+
|
|
16
|
+
const TagSchema = Tag.Tag.pipe(Schema.omit('id'));
|
|
17
|
+
|
|
18
|
+
type ObjectFormProps = { object: Obj.Any; schema: Schema.Schema.AnyNoContext };
|
|
19
|
+
|
|
20
|
+
export const ObjectForm = ({ object, schema }: ObjectFormProps) => {
|
|
21
|
+
const space = getSpace(object);
|
|
22
|
+
const handleRefQueryLookup = useRefQueryLookupHandler({ space });
|
|
23
|
+
|
|
24
|
+
const formSchema = useMemo(
|
|
25
|
+
() => Schema.Struct({ tag: Type.Ref(Tag.Tag).pipe(Schema.optional) }).pipe(Schema.extend(schema)),
|
|
26
|
+
[schema],
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const meta = Obj.getMeta(object);
|
|
30
|
+
const tag = meta.tags?.[0] ? space?.db.ref(DXN.parse(meta.tags?.[0])) : undefined;
|
|
31
|
+
const values = useMemo(() => ({ tag, ...object }), [object, tag]);
|
|
32
|
+
|
|
33
|
+
const handleCreateTag = useCallback((values: Schema.Schema.Type<typeof TagSchema>) => {
|
|
34
|
+
invariant(space);
|
|
35
|
+
const tag = space.db.add(Tag.make(values));
|
|
36
|
+
const meta = Obj.getMeta(object);
|
|
37
|
+
meta.tags = [Obj.getDXN(tag).toString()];
|
|
38
|
+
}, []);
|
|
39
|
+
|
|
40
|
+
const handleSave = useCallback(
|
|
41
|
+
(values: any, { changed }: { changed: Record<JsonPath, boolean> }) => {
|
|
42
|
+
const changedPaths = Object.keys(changed).filter((path) => changed[path as JsonPath]) as JsonPath[];
|
|
43
|
+
for (const path of changedPaths) {
|
|
44
|
+
if (path === 'tag') {
|
|
45
|
+
const tag = values[path];
|
|
46
|
+
const meta = Obj.getMeta(object);
|
|
47
|
+
const currentTag = meta.tags?.[0];
|
|
48
|
+
if (currentTag !== tag?.dxn.toString()) {
|
|
49
|
+
meta.tags = tag ? [tag.dxn.toString()] : [];
|
|
50
|
+
}
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const value = values[path];
|
|
55
|
+
setValue(object, path, value);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
[object],
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<Form
|
|
63
|
+
autoSave
|
|
64
|
+
schema={formSchema}
|
|
65
|
+
values={values}
|
|
66
|
+
createSchema={TagSchema}
|
|
67
|
+
createOptionIcon='ph--plus--regular'
|
|
68
|
+
createOptionLabel={['add tag label', { ns: pluginMeta.id }]}
|
|
69
|
+
createInitialValuePath='label'
|
|
70
|
+
onCreate={handleCreateTag}
|
|
71
|
+
onSave={handleSave}
|
|
72
|
+
onQueryRefOptions={handleRefQueryLookup}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
import React, { useCallback, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Obj } from '@dxos/echo';
|
|
8
|
-
import { ForeignKey } from '@dxos/echo
|
|
8
|
+
import { ForeignKey } from '@dxos/echo/internal';
|
|
9
9
|
import { IconButton, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { Form } from '@dxos/react-ui-form';
|
|
11
11
|
|
|
12
|
+
import { meta } from '../../meta';
|
|
13
|
+
|
|
12
14
|
import { ForeignKeys } from './ForeignKeys';
|
|
13
|
-
import { SPACE_PLUGIN } from '../../meta';
|
|
14
15
|
|
|
15
16
|
const initialValues = {
|
|
16
17
|
source: '',
|
|
@@ -22,7 +23,7 @@ export type AdvancedObjectSettingsProps = {
|
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
export const AdvancedObjectSettings = ({ object }: AdvancedObjectSettingsProps) => {
|
|
25
|
-
const { t } = useTranslation(
|
|
26
|
+
const { t } = useTranslation(meta.id);
|
|
26
27
|
const [adding, setAdding] = useState(false);
|
|
27
28
|
const { keys } = Obj.getMeta(object);
|
|
28
29
|
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React, { useEffect, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { type Obj, Tag } from '@dxos/echo';
|
|
9
|
+
import { useClientProvider, withClientProvider } from '@dxos/react-client/testing';
|
|
10
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
11
|
+
import { DataType } from '@dxos/schema';
|
|
12
|
+
import { render } from '@dxos/storybook-utils';
|
|
13
|
+
|
|
14
|
+
import { translations } from '../../translations';
|
|
15
|
+
|
|
16
|
+
import { BaseObjectSettings } from './BaseObjectSettings';
|
|
17
|
+
|
|
18
|
+
const DefaultStory = () => {
|
|
19
|
+
const { space } = useClientProvider();
|
|
20
|
+
const [object, setObject] = useState<Obj.Any>();
|
|
21
|
+
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (space && !object) {
|
|
24
|
+
const object = space.db.add(DataType.makeProject());
|
|
25
|
+
setObject(object as Obj.Any);
|
|
26
|
+
}
|
|
27
|
+
}, [space, object]);
|
|
28
|
+
|
|
29
|
+
if (!object) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return <BaseObjectSettings object={object} classNames='is-[20rem]' />;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const meta = {
|
|
37
|
+
title: 'plugins/plugin-space/BaseObjectSettings',
|
|
38
|
+
component: BaseObjectSettings as any,
|
|
39
|
+
render: render(DefaultStory),
|
|
40
|
+
decorators: [
|
|
41
|
+
withTheme,
|
|
42
|
+
withClientProvider({
|
|
43
|
+
createIdentity: true,
|
|
44
|
+
createSpace: true,
|
|
45
|
+
types: [DataType.Project, Tag.Tag],
|
|
46
|
+
onCreateSpace: async ({ space }) => {
|
|
47
|
+
space.db.add(Tag.make({ label: 'Tag 1' }));
|
|
48
|
+
space.db.add(Tag.make({ label: 'Tag 2' }));
|
|
49
|
+
space.db.add(Tag.make({ label: 'Tag 3' }));
|
|
50
|
+
},
|
|
51
|
+
}),
|
|
52
|
+
],
|
|
53
|
+
parameters: {
|
|
54
|
+
layout: 'centered',
|
|
55
|
+
translations,
|
|
56
|
+
},
|
|
57
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
58
|
+
|
|
59
|
+
export default meta;
|
|
60
|
+
|
|
61
|
+
type Story = StoryObj<typeof meta>;
|
|
62
|
+
|
|
63
|
+
export const Default: Story = {};
|
|
@@ -2,12 +2,28 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { batch } from '@preact/signals-core';
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
8
|
+
import * as Schema from 'effect/Schema';
|
|
9
|
+
import React, { type PropsWithChildren, useCallback, useMemo } from 'react';
|
|
6
10
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
11
|
+
import { DXN, Obj, Tag, Type } from '@dxos/echo';
|
|
12
|
+
import { invariant } from '@dxos/invariant';
|
|
13
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
14
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
15
|
+
import { Form, useRefQueryLookupHandler } from '@dxos/react-ui-form';
|
|
9
16
|
|
|
10
|
-
import { meta } from '../../meta';
|
|
17
|
+
import { meta as pluginMeta } from '../../meta';
|
|
18
|
+
|
|
19
|
+
// TODO(wittjosiah): Would be nice to control order when extending so this isn't always first/last.
|
|
20
|
+
const BaseSchema = Schema.Struct({
|
|
21
|
+
// TODO(wittjosiah): Support multiple tags.
|
|
22
|
+
tag: Type.Ref(Tag.Tag).pipe(Schema.optional),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// TODO(wittjosiah): Better way to support validation of object schemas?
|
|
26
|
+
const TagSchema = Tag.Tag.pipe(Schema.omit('id'));
|
|
11
27
|
|
|
12
28
|
export type BaseObjectSettingsProps = ThemedClassName<
|
|
13
29
|
PropsWithChildren<{
|
|
@@ -15,32 +31,76 @@ export type BaseObjectSettingsProps = ThemedClassName<
|
|
|
15
31
|
}>
|
|
16
32
|
>;
|
|
17
33
|
|
|
34
|
+
// TODO(wittjosiah): Reconcile w/ ObjectDetailsPanel.
|
|
18
35
|
export const BaseObjectSettings = ({ classNames, children, object }: BaseObjectSettingsProps) => {
|
|
19
|
-
const
|
|
20
|
-
const
|
|
36
|
+
const space = getSpace(object);
|
|
37
|
+
const handleRefQueryLookup = useRefQueryLookupHandler({ space });
|
|
38
|
+
|
|
39
|
+
const formSchema = useMemo(() => {
|
|
40
|
+
return Function.pipe(
|
|
41
|
+
Obj.getSchema(object),
|
|
42
|
+
Option.fromNullable,
|
|
43
|
+
Option.map((schema) => BaseSchema.pipe(Schema.extend(schema))),
|
|
44
|
+
Option.getOrUndefined,
|
|
45
|
+
);
|
|
46
|
+
}, [object]);
|
|
47
|
+
|
|
48
|
+
const meta = Obj.getMeta(object);
|
|
49
|
+
const tag = meta.tags?.[0] ? space?.db.ref(DXN.parse(meta.tags?.[0])) : undefined;
|
|
50
|
+
const values = useMemo(
|
|
51
|
+
() => ({
|
|
52
|
+
tag,
|
|
53
|
+
...object,
|
|
54
|
+
}),
|
|
55
|
+
[object, tag],
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const handleCreateTag = useCallback((values: Schema.Schema.Type<typeof TagSchema>) => {
|
|
59
|
+
invariant(space);
|
|
60
|
+
const tag = space.db.add(Tag.make(values));
|
|
61
|
+
const meta = Obj.getMeta(object);
|
|
62
|
+
meta.tags = [Obj.getDXN(tag).toString()];
|
|
63
|
+
}, []);
|
|
64
|
+
|
|
65
|
+
const handleSave = useCallback(
|
|
66
|
+
({ tag, ...values }: Schema.Schema.Type<typeof formSchema>) => {
|
|
67
|
+
batch(() => {
|
|
68
|
+
const meta = Obj.getMeta(object);
|
|
69
|
+
const currentTag = meta.tags?.[0];
|
|
70
|
+
if (tag !== undefined && currentTag !== tag?.dxn.toString()) {
|
|
71
|
+
meta.tags = [tag.dxn.toString()];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
Object.entries(values).forEach(([key, value]) => {
|
|
75
|
+
if (value !== undefined && value !== object[key as keyof Obj.Any]) {
|
|
76
|
+
Object.defineProperty(object, key, { value });
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
[object],
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
if (!formSchema) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
21
87
|
|
|
22
|
-
// TODO(wittjosiah): This should be a form based on the schema of the object.
|
|
23
|
-
// The form should only include fields with a specific settings annotation.
|
|
24
|
-
// Perhaps also including the field of the title annotation as well.
|
|
25
88
|
return (
|
|
26
89
|
<>
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}}
|
|
42
|
-
/>
|
|
43
|
-
</Input.Root>
|
|
90
|
+
<Form
|
|
91
|
+
classNames={classNames}
|
|
92
|
+
outerSpacing={false}
|
|
93
|
+
autoSave
|
|
94
|
+
schema={formSchema}
|
|
95
|
+
values={values}
|
|
96
|
+
createSchema={TagSchema}
|
|
97
|
+
createOptionIcon='ph--plus--regular'
|
|
98
|
+
createOptionLabel={['add tag label', { ns: pluginMeta.id }]}
|
|
99
|
+
createInitialValuePath='label'
|
|
100
|
+
onCreate={handleCreateTag}
|
|
101
|
+
onSave={handleSave}
|
|
102
|
+
onQueryRefOptions={handleRefQueryLookup}
|
|
103
|
+
/>
|
|
44
104
|
{children}
|
|
45
105
|
</>
|
|
46
106
|
);
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type ForeignKey } from '@dxos/echo
|
|
7
|
+
import { type ForeignKey } from '@dxos/echo/internal';
|
|
8
8
|
import { IconButton, List, ListItem, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { meta } from '../../meta';
|
|
11
11
|
|
|
12
12
|
export type ForeignKeysProps = {
|
|
13
13
|
keys: ForeignKey[];
|
|
@@ -31,7 +31,7 @@ type KeyItemProps = {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
const KeyItem = ({ forignKey, onDelete }: KeyItemProps) => {
|
|
34
|
-
const { t } = useTranslation(
|
|
34
|
+
const { t } = useTranslation(meta.id);
|
|
35
35
|
|
|
36
36
|
const handleDelete = useCallback(() => {
|
|
37
37
|
onDelete?.(forignKey);
|
|
@@ -6,7 +6,7 @@ import React, { useMemo } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { Surface } from '@dxos/app-framework';
|
|
8
8
|
import { type Obj } from '@dxos/echo';
|
|
9
|
-
import { Clipboard } from '@dxos/react-ui';
|
|
9
|
+
import { Clipboard, Toolbar } from '@dxos/react-ui';
|
|
10
10
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
11
11
|
|
|
12
12
|
import { BaseObjectSettings } from './BaseObjectSettings';
|
|
@@ -21,7 +21,8 @@ export const ObjectSettingsContainer = ({ object, role }: ObjectSettingsContaine
|
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
23
|
<Clipboard.Provider>
|
|
24
|
-
<StackItem.Content toolbar
|
|
24
|
+
<StackItem.Content toolbar>
|
|
25
|
+
<Toolbar.Root></Toolbar.Root>
|
|
25
26
|
<div role='none' className='overflow-y-auto pli-cardSpacingInline plb-cardSpacingBlock'>
|
|
26
27
|
<BaseObjectSettings object={object}>
|
|
27
28
|
<Surface role='base-object-settings' data={data} />
|
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { ArrowsCounterClockwise, CheckCircle, Warning } from '@phosphor-icons/react';
|
|
6
5
|
import React, { useEffect, useState } from 'react';
|
|
7
6
|
|
|
8
7
|
import { debounce } from '@dxos/async';
|
|
9
8
|
import { type EchoDatabase } from '@dxos/react-client/echo';
|
|
10
|
-
import { Tooltip, useTranslation } from '@dxos/react-ui';
|
|
11
|
-
import {
|
|
9
|
+
import { Icon, Tooltip, useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import { mx, staticPlaceholderText, warningText } from '@dxos/react-ui-theme';
|
|
12
11
|
|
|
13
|
-
import {
|
|
12
|
+
import { meta } from '../meta';
|
|
14
13
|
|
|
15
14
|
enum Status {
|
|
16
15
|
PERSISTED_LOCALLY = 0,
|
|
@@ -20,7 +19,7 @@ enum Status {
|
|
|
20
19
|
|
|
21
20
|
// TODO(zan): This now has no usages. Remove it?
|
|
22
21
|
export const PersistenceStatus = ({ db }: { db: EchoDatabase }) => {
|
|
23
|
-
const { t } = useTranslation(
|
|
22
|
+
const { t } = useTranslation(meta.id);
|
|
24
23
|
const [displayMessage, setDisplayMessage] = useState(false);
|
|
25
24
|
const [status, naturalSetStatus] = useState<Status>(Status.PERSISTED_LOCALLY);
|
|
26
25
|
const [prevStatus, setPrevStatus] = useState<Status>(Status.PERSISTED_LOCALLY);
|
|
@@ -54,14 +53,14 @@ export const PersistenceStatus = ({ db }: { db: EchoDatabase }) => {
|
|
|
54
53
|
case Status.ERROR:
|
|
55
54
|
return (
|
|
56
55
|
<div className='flex items-center'>
|
|
57
|
-
<
|
|
56
|
+
<Icon icon='ph--warning--regular' size={4} classNames='me-1' />
|
|
58
57
|
<span className={mx('text-sm', warningText)}>{t('persistence error label')}</span>
|
|
59
58
|
</div>
|
|
60
59
|
);
|
|
61
60
|
case Status.PENDING:
|
|
62
61
|
return (
|
|
63
62
|
<div className='flex items-center'>
|
|
64
|
-
<
|
|
63
|
+
<Icon icon='ph--arrows-counter-clockwise--regular' size={4} classNames='me-1' />
|
|
65
64
|
<span className={mx('text-sm', staticPlaceholderText)}>{t('persistence pending label')}</span>
|
|
66
65
|
</div>
|
|
67
66
|
);
|
|
@@ -74,7 +73,7 @@ export const PersistenceStatus = ({ db }: { db: EchoDatabase }) => {
|
|
|
74
73
|
content={t('persisted locally message')}
|
|
75
74
|
className='flex items-center'
|
|
76
75
|
>
|
|
77
|
-
<
|
|
76
|
+
<Icon icon='ph--check-circle--regular' size={4} classNames='me-1' />
|
|
78
77
|
{displayMessage && (
|
|
79
78
|
<span className={mx('text-sm', staticPlaceholderText)}>{t('persisted locally label')}</span>
|
|
80
79
|
)}
|
|
@@ -4,33 +4,27 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
8
9
|
import { type Live } from '@dxos/live-object';
|
|
9
10
|
import { log } from '@dxos/log';
|
|
10
11
|
import { Button, Input, useTranslation } from '@dxos/react-ui';
|
|
11
12
|
|
|
12
|
-
import {
|
|
13
|
+
import { meta } from '../meta';
|
|
13
14
|
|
|
14
|
-
export const POPOVER_RENAME_OBJECT = `${
|
|
15
|
+
export const POPOVER_RENAME_OBJECT = `${meta.id}/PopoverRenameObject`;
|
|
15
16
|
|
|
16
|
-
export const PopoverRenameObject = ({ object
|
|
17
|
-
const { t } = useTranslation(
|
|
17
|
+
export const PopoverRenameObject = ({ object }: { object: Live<any> }) => {
|
|
18
|
+
const { t } = useTranslation(meta.id);
|
|
18
19
|
const doneButton = useRef<HTMLButtonElement>(null);
|
|
19
|
-
|
|
20
|
-
const object = obj as any;
|
|
21
|
-
// TODO(burdon): Field should not be hardcoded field.
|
|
22
|
-
const [name, setName] = useState(object.name || object.title || '');
|
|
20
|
+
const [name, setName] = useState(Obj.getLabel(object));
|
|
23
21
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
24
22
|
|
|
25
23
|
const handleDone = useCallback(() => {
|
|
26
24
|
try {
|
|
27
|
-
|
|
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,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();
|