@dxos/plugin-space 0.8.4-main.f9ba587 → 0.8.4-main.fffef41
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/CollectionArticle-WTHWY4YS.mjs +31 -0
- package/dist/lib/browser/CollectionArticle-WTHWY4YS.mjs.map +7 -0
- package/dist/lib/browser/ObjectDetailsPanel-2BRUBHP6.mjs +141 -0
- package/dist/lib/browser/ObjectDetailsPanel-2BRUBHP6.mjs.map +7 -0
- package/dist/lib/browser/ObjectSettings-5LLWCVEK.mjs +144 -0
- package/dist/lib/browser/ObjectSettings-5LLWCVEK.mjs.map +7 -0
- package/dist/lib/browser/RecordArticle-SXDRWTTU.mjs +116 -0
- package/dist/lib/browser/RecordArticle-SXDRWTTU.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-DTM7BJ6D.mjs +528 -0
- package/dist/lib/browser/app-graph-builder-DTM7BJ6D.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-UKYMBX4O.mjs → app-graph-serializer-TIKXF43P.mjs} +19 -19
- package/dist/lib/browser/app-graph-serializer-TIKXF43P.mjs.map +7 -0
- package/dist/lib/browser/chunk-AFUOMLX6.mjs +167 -0
- package/dist/lib/browser/chunk-AFUOMLX6.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GVTXQCIW.mjs → chunk-CKACGS7T.mjs} +714 -571
- package/dist/lib/browser/chunk-CKACGS7T.mjs.map +7 -0
- package/dist/lib/browser/chunk-K5J7ZB5P.mjs +20 -0
- package/dist/lib/browser/chunk-K5J7ZB5P.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WBSEOLEM.mjs → chunk-KFUMADZF.mjs} +301 -73
- package/dist/lib/browser/chunk-KFUMADZF.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6VLSHG4A.mjs → chunk-VGKOXAPE.mjs} +87 -12
- package/dist/lib/browser/chunk-VGKOXAPE.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/{chunk-S6NY637J.mjs → chunk-ZQMSGD5J.mjs} +95 -19
- package/dist/lib/browser/chunk-ZQMSGD5J.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-23XJJV2N.mjs → identity-created-NAXTPQXE.mjs} +6 -6
- package/dist/lib/browser/identity-created-NAXTPQXE.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +148 -59
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-WK5WYFH3.mjs → intent-resolver-3FNTO3VW.mjs} +236 -68
- package/dist/lib/browser/intent-resolver-3FNTO3VW.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-root-Q7VBWBES.mjs +30 -0
- package/dist/lib/browser/react-root-Q7VBWBES.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-6C3YJNDK.mjs → react-surface-TTHS332A.mjs} +98 -100
- package/dist/lib/browser/react-surface-TTHS332A.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-K3B3OAH4.mjs → schema-defs-QPI2JU3X.mjs} +6 -6
- package/dist/lib/browser/schema-defs-QPI2JU3X.mjs.map +7 -0
- package/dist/lib/browser/{settings-XNWYRWNM.mjs → settings-45PGPO2V.mjs} +5 -5
- package/dist/lib/browser/{settings-XNWYRWNM.mjs.map → settings-45PGPO2V.mjs.map} +1 -1
- package/dist/lib/browser/{spaces-ready-K7NSNBHM.mjs → spaces-ready-QCND4DVY.mjs} +21 -18
- package/dist/lib/browser/spaces-ready-QCND4DVY.mjs.map +7 -0
- package/dist/lib/browser/{state-522XTUR4.mjs → state-Q7YRE5KG.mjs} +7 -7
- package/dist/lib/browser/state-Q7YRE5KG.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/CollectionArticle-KHXYT3SH.mjs +32 -0
- package/dist/lib/node-esm/CollectionArticle-KHXYT3SH.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-6PZQIQG3.mjs +142 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-6PZQIQG3.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectSettings-OQSBOH7K.mjs +145 -0
- package/dist/lib/node-esm/ObjectSettings-OQSBOH7K.mjs.map +7 -0
- package/dist/lib/node-esm/RecordArticle-NACBH42P.mjs +117 -0
- package/dist/lib/node-esm/RecordArticle-NACBH42P.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-FBJFWI4H.mjs +529 -0
- package/dist/lib/node-esm/app-graph-builder-FBJFWI4H.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-LA3IZDXJ.mjs → app-graph-serializer-BESQZAYU.mjs} +19 -19
- package/dist/lib/node-esm/app-graph-serializer-BESQZAYU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2THX6G4C.mjs → chunk-6VEONPNZ.mjs} +95 -19
- package/dist/lib/node-esm/chunk-6VEONPNZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6ZQGZBEP.mjs +168 -0
- package/dist/lib/node-esm/chunk-6ZQGZBEP.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-H4JILUJK.mjs +20 -0
- package/dist/lib/node-esm/chunk-H4JILUJK.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HJJHLWKY.mjs → chunk-OK2L7N2F.mjs} +301 -73
- package/dist/lib/node-esm/chunk-OK2L7N2F.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SXD6T2N4.mjs → chunk-QBRPYAEL.mjs} +87 -12
- package/dist/lib/node-esm/chunk-QBRPYAEL.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OUBADVJE.mjs → chunk-XGAMJC5C.mjs} +714 -571
- package/dist/lib/node-esm/chunk-XGAMJC5C.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-Z7BB6HC2.mjs +21 -0
- package/dist/lib/node-esm/chunk-Z7BB6HC2.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-IJQO6GCR.mjs → identity-created-OXLKCJE3.mjs} +6 -6
- package/dist/lib/node-esm/identity-created-OXLKCJE3.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +148 -59
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-HSR27ME4.mjs → intent-resolver-6O5FSB7Z.mjs} +236 -68
- package/dist/lib/node-esm/intent-resolver-6O5FSB7Z.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-HUK3ANLV.mjs → react-root-K66W3FMA.mjs} +13 -12
- package/dist/lib/node-esm/react-root-K66W3FMA.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-AGAWX7DD.mjs → react-surface-Y7FTEIDF.mjs} +98 -100
- package/dist/lib/node-esm/react-surface-Y7FTEIDF.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-4MCDG4DV.mjs → schema-defs-ZS2D47XW.mjs} +6 -6
- package/dist/lib/node-esm/schema-defs-ZS2D47XW.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-YGKHGFPH.mjs → settings-6FO65BA6.mjs} +5 -5
- package/dist/lib/node-esm/{settings-YGKHGFPH.mjs.map → settings-6FO65BA6.mjs.map} +1 -1
- package/dist/lib/node-esm/{spaces-ready-UM2P3DCR.mjs → spaces-ready-P7CKVXBE.mjs} +21 -18
- package/dist/lib/node-esm/spaces-ready-P7CKVXBE.mjs.map +7 -0
- package/dist/lib/node-esm/{state-C4IOXPZP.mjs → state-362I5BMK.mjs} +7 -7
- package/dist/lib/node-esm/state-362I5BMK.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 +14 -7
- 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/CollectionArticle.d.ts +6 -0
- package/dist/types/src/components/CollectionArticle.d.ts.map +1 -0
- package/dist/types/src/components/CollectionSection.d.ts +3 -4
- package/dist/types/src/components/CollectionSection.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 +1704 -4
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +7 -5
- 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 → JoinDialog/JoinDialog.d.ts} +1 -1
- package/dist/types/src/components/JoinDialog/JoinDialog.d.ts.map +1 -0
- package/dist/types/src/components/JoinDialog/index.d.ts +2 -0
- package/dist/types/src/components/JoinDialog/index.d.ts.map +1 -0
- package/dist/types/src/components/{MembersContainer.d.ts → MembersContainer/MembersContainer.d.ts} +3 -2
- package/dist/types/src/components/MembersContainer/MembersContainer.d.ts.map +1 -0
- package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts +1707 -0
- package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/MembersContainer/index.d.ts +2 -0
- package/dist/types/src/components/MembersContainer/index.d.ts.map +1 -0
- 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/ObjectRenamePopover/ObjectRenamePopover.d.ts +7 -0
- package/dist/types/src/components/ObjectRenamePopover/ObjectRenamePopover.d.ts.map +1 -0
- package/dist/types/src/components/ObjectRenamePopover/index.d.ts +2 -0
- package/dist/types/src/components/ObjectRenamePopover/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 +1540 -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/RecordArticle.d.ts +5 -0
- package/dist/types/src/components/RecordArticle.d.ts.map +1 -0
- package/dist/types/src/components/RecordArticle.stories.d.ts +1707 -0
- package/dist/types/src/components/RecordArticle.stories.d.ts.map +1 -0
- package/dist/types/src/components/SchemaContainer.d.ts +1 -1
- package/dist/types/src/components/SchemaContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/{SpacePresence.d.ts → SpacePresence/SpacePresence.d.ts} +4 -3
- package/dist/types/src/components/SpacePresence/SpacePresence.d.ts.map +1 -0
- package/dist/types/src/components/SpacePresence/SpacePresence.stories.d.ts +1537 -0
- package/dist/types/src/components/SpacePresence/SpacePresence.stories.d.ts.map +1 -0
- package/dist/types/src/components/SpacePresence/index.d.ts +2 -0
- package/dist/types/src/components/SpacePresence/index.d.ts.map +1 -0
- package/dist/types/src/components/SpaceRenamePopover/SpaceRenamePopover.d.ts +7 -0
- package/dist/types/src/components/SpaceRenamePopover/SpaceRenamePopover.d.ts.map +1 -0
- package/dist/types/src/components/SpaceRenamePopover/index.d.ts +2 -0
- package/dist/types/src/components/SpaceRenamePopover/index.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +1537 -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 +1538 -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 +7 -0
- package/dist/types/src/components/ViewEditor.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +11 -5
- 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/helpers/index.d.ts +2 -0
- package/dist/types/src/helpers/index.d.ts.map +1 -0
- package/dist/types/src/helpers/query.d.ts +8 -0
- package/dist/types/src/helpers/query.d.ts.map +1 -0
- package/dist/types/src/helpers/query.test.d.ts +2 -0
- package/dist/types/src/helpers/query.test.d.ts.map +1 -0
- 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/index.d.ts +1 -0
- package/dist/types/src/index.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 +1382 -11
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +141 -66
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +40 -10
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +67 -61
- package/src/SpacePlugin.ts +232 -139
- package/src/capabilities/app-graph-builder.ts +335 -88
- package/src/capabilities/app-graph-serializer.ts +12 -12
- package/src/capabilities/capabilities.ts +21 -10
- package/src/capabilities/identity-created.ts +3 -3
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/intent-resolver.ts +191 -54
- package/src/capabilities/react-root.tsx +6 -4
- package/src/capabilities/react-surface.tsx +94 -119
- package/src/capabilities/schema-defs.ts +4 -3
- package/src/capabilities/spaces-ready.ts +16 -10
- package/src/capabilities/state.ts +5 -4
- package/src/components/AwaitingObject.tsx +16 -20
- package/src/components/{CollectionMain.tsx → CollectionArticle.tsx} +8 -5
- package/src/components/CollectionSection.tsx +8 -6
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +17 -16
- package/src/components/CreateDialog/CreateObjectDialog.tsx +76 -54
- package/src/components/CreateDialog/CreateObjectPanel.tsx +24 -13
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +30 -11
- package/src/components/{JoinDialog.tsx → JoinDialog/JoinDialog.tsx} +26 -10
- package/src/components/JoinDialog/index.ts +5 -0
- package/src/components/MembersContainer/MembersContainer.stories.tsx +56 -0
- package/src/components/{MembersContainer.tsx → MembersContainer/MembersContainer.tsx} +27 -24
- package/src/components/MembersContainer/index.ts +5 -0
- package/src/components/MenuFooter.tsx +4 -5
- package/src/components/ObjectDetailsPanel/ObjectDetailsPanel.tsx +51 -0
- package/src/components/ObjectDetailsPanel/ObjectForm.tsx +72 -0
- package/src/components/ObjectDetailsPanel/index.ts +7 -0
- package/src/components/{PopoverRenameObject.tsx → ObjectRenamePopover/ObjectRenamePopover.tsx} +11 -17
- package/src/components/ObjectRenamePopover/index.ts +5 -0
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +4 -3
- package/src/components/ObjectSettings/BaseObjectSettings.stories.tsx +63 -0
- package/src/components/ObjectSettings/BaseObjectSettings.tsx +90 -26
- package/src/components/ObjectSettings/ForeignKeys.tsx +4 -4
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +4 -3
- package/src/components/ObjectSettings/index.ts +3 -1
- package/src/components/RecordArticle.stories.tsx +115 -0
- package/src/components/RecordArticle.tsx +114 -0
- package/src/components/SchemaContainer.tsx +25 -28
- package/src/components/SpacePluginSettings.tsx +16 -11
- package/src/components/{SpacePresence.stories.tsx → SpacePresence/SpacePresence.stories.tsx} +24 -23
- package/src/components/{SpacePresence.tsx → SpacePresence/SpacePresence.tsx} +22 -17
- package/src/components/SpacePresence/index.ts +5 -0
- package/src/components/{PopoverRenameSpace.tsx → SpaceRenamePopover/SpaceRenamePopover.tsx} +7 -6
- package/src/components/SpaceRenamePopover/index.ts +5 -0
- package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +17 -9
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +49 -28
- package/src/components/SyncStatus/InlineSyncStatus.tsx +8 -8
- package/src/components/SyncStatus/SyncStatus.stories.tsx +9 -9
- package/src/components/SyncStatus/SyncStatus.tsx +110 -13
- package/src/components/SyncStatus/status.ts +4 -4
- package/src/components/ViewEditor.tsx +92 -0
- package/src/components/index.ts +10 -5
- package/src/events.ts +7 -6
- package/src/helpers/index.ts +5 -0
- package/src/helpers/query.test.ts +24 -0
- package/src/helpers/query.ts +158 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useActiveSpace.ts +3 -2
- package/src/hooks/useInputSurfaceLookup.tsx +8 -3
- package/src/hooks/usePath.ts +1 -1
- package/src/hooks/useTypeOptions.ts +59 -0
- package/src/index.ts +1 -0
- package/src/meta.ts +6 -3
- package/src/translations.ts +85 -7
- package/src/types/types.ts +94 -22
- package/src/util.tsx +297 -75
- 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/identity-created-23XJJV2N.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-WK5WYFH3.mjs.map +0 -7
- package/dist/lib/browser/react-root-7S6FIC5G.mjs +0 -29
- 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 +0 -364
- 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/identity-created-IJQO6GCR.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/dist/types/src/components/CollectionMain.d.ts +0 -6
- package/dist/types/src/components/CollectionMain.d.ts.map +0 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +0 -1
- package/dist/types/src/components/MembersContainer.d.ts.map +0 -1
- package/dist/types/src/components/MembersContainer.stories.d.ts +0 -8
- package/dist/types/src/components/MembersContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/PersistenceStatus.d.ts +0 -6
- package/dist/types/src/components/PersistenceStatus.d.ts.map +0 -1
- package/dist/types/src/components/PopoverRenameObject.d.ts +0 -7
- package/dist/types/src/components/PopoverRenameObject.d.ts.map +0 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts +0 -7
- package/dist/types/src/components/PopoverRenameSpace.d.ts.map +0 -1
- package/dist/types/src/components/SpacePresence.d.ts.map +0 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +0 -9
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +0 -1
- package/src/capabilities/schema-tool.test.ts +0 -44
- package/src/capabilities/schema-tools.ts +0 -125
- package/src/components/MembersContainer.stories.tsx +0 -30
- package/src/components/PersistenceStatus.tsx +0 -84
|
@@ -2,20 +2,20 @@
|
|
|
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
|
-
import { createIntent
|
|
8
|
+
import { createIntent } from '@dxos/app-framework';
|
|
9
|
+
import { useIntentDispatcher } from '@dxos/app-framework/react';
|
|
10
|
+
import { Obj } from '@dxos/echo';
|
|
10
11
|
import { log } from '@dxos/log';
|
|
11
12
|
import { useConfig } from '@dxos/react-client';
|
|
12
|
-
import {
|
|
13
|
+
import { type Space, useSpaceInvitations } from '@dxos/react-client/echo';
|
|
13
14
|
import { type CancellableInvitationObservable, Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
|
|
14
15
|
import { Button, Clipboard, Icon, Input, useId, useTranslation } from '@dxos/react-ui';
|
|
15
|
-
import {
|
|
16
|
+
import { ControlFrame, ControlFrameItem, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
16
17
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
17
|
-
import {
|
|
18
|
-
import { DataType } from '@dxos/schema';
|
|
18
|
+
import { Collection } from '@dxos/schema';
|
|
19
19
|
import {
|
|
20
20
|
type ActionMenuItem,
|
|
21
21
|
AuthCode,
|
|
@@ -28,9 +28,9 @@ import {
|
|
|
28
28
|
} from '@dxos/shell/react';
|
|
29
29
|
import { hexToEmoji } from '@dxos/util';
|
|
30
30
|
|
|
31
|
-
import {
|
|
32
|
-
import { SpaceAction } from '
|
|
33
|
-
import { COMPOSER_SPACE_LOCK } from '
|
|
31
|
+
import { meta } from '../../meta';
|
|
32
|
+
import { SpaceAction } from '../../types';
|
|
33
|
+
import { COMPOSER_SPACE_LOCK } from '../../util';
|
|
34
34
|
|
|
35
35
|
// TODO(wittjosiah): Copied from Shell.
|
|
36
36
|
const activeActionKey = 'dxos:react-shell/space-manager/active-action';
|
|
@@ -43,14 +43,13 @@ const handleInvitationEvent = (invitation: Invitation, subscription: ZenObservab
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
export
|
|
47
|
-
space,
|
|
48
|
-
createInvitationUrl,
|
|
49
|
-
}: {
|
|
46
|
+
export type MembersContainerProps = {
|
|
50
47
|
space: Space;
|
|
51
48
|
createInvitationUrl: (invitationCode: string) => string;
|
|
52
|
-
}
|
|
53
|
-
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const MembersContainer = ({ space, createInvitationUrl }: MembersContainerProps) => {
|
|
52
|
+
const { t } = useTranslation(meta.id);
|
|
54
53
|
const config = useConfig();
|
|
55
54
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
56
55
|
const invitations = useSpaceInvitations(space.key);
|
|
@@ -66,7 +65,7 @@ export const MembersContainer = ({
|
|
|
66
65
|
};
|
|
67
66
|
|
|
68
67
|
// TODO(wittjosiah): Track which was the most recently viewed object.
|
|
69
|
-
const target = space.properties[
|
|
68
|
+
const target = space.properties[Collection.Collection.typename]?.target?.objects[0]?.target;
|
|
70
69
|
|
|
71
70
|
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
72
71
|
const handleChangeLocked = useCallback(() => {
|
|
@@ -78,7 +77,7 @@ export const MembersContainer = ({
|
|
|
78
77
|
inviteOne: {
|
|
79
78
|
label: t('invite one label', { ns: 'os' }),
|
|
80
79
|
description: t('invite one description', { ns: 'os' }),
|
|
81
|
-
icon:
|
|
80
|
+
icon: 'ph--user-plus--regular',
|
|
82
81
|
testId: 'membersContainer.inviteOne',
|
|
83
82
|
onClick: async () => {
|
|
84
83
|
const { data: invitation } = await dispatch(
|
|
@@ -87,7 +86,7 @@ export const MembersContainer = ({
|
|
|
87
86
|
type: Invitation.Type.INTERACTIVE,
|
|
88
87
|
authMethod: Invitation.AuthMethod.SHARED_SECRET,
|
|
89
88
|
multiUse: false,
|
|
90
|
-
target: target &&
|
|
89
|
+
target: target && Obj.getDXN(target).toString(),
|
|
91
90
|
}),
|
|
92
91
|
);
|
|
93
92
|
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== 'production') {
|
|
@@ -100,7 +99,7 @@ export const MembersContainer = ({
|
|
|
100
99
|
inviteMany: {
|
|
101
100
|
label: t('invite many label', { ns: 'os' }),
|
|
102
101
|
description: t('invite many description', { ns: 'os' }),
|
|
103
|
-
icon:
|
|
102
|
+
icon: 'ph--users-three--regular',
|
|
104
103
|
testId: 'membersContainer.inviteMany',
|
|
105
104
|
onClick: async () => {
|
|
106
105
|
const { data: invitation } = await dispatch(
|
|
@@ -109,7 +108,7 @@ export const MembersContainer = ({
|
|
|
109
108
|
type: Invitation.Type.DELEGATED,
|
|
110
109
|
authMethod: Invitation.AuthMethod.KNOWN_PUBLIC_KEY,
|
|
111
110
|
multiUse: true,
|
|
112
|
-
target: target &&
|
|
111
|
+
target: target && Obj.getDXN(target).toString(),
|
|
113
112
|
}),
|
|
114
113
|
);
|
|
115
114
|
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== 'production') {
|
|
@@ -133,7 +132,7 @@ export const MembersContainer = ({
|
|
|
133
132
|
|
|
134
133
|
return (
|
|
135
134
|
<Clipboard.Provider>
|
|
136
|
-
<StackItem.Content
|
|
135
|
+
<StackItem.Content scrollable>
|
|
137
136
|
<ControlPage>
|
|
138
137
|
<ControlSection title={t('members verbose label')} description={t('members description')}>
|
|
139
138
|
<ControlFrame>
|
|
@@ -170,7 +169,7 @@ export const MembersContainer = ({
|
|
|
170
169
|
)}
|
|
171
170
|
</ControlFrame>
|
|
172
171
|
{/* TODO(wittjosiah): Make ControlItemInput & ControlFrame compatible. */}
|
|
173
|
-
<div className='justify-center
|
|
172
|
+
<div className='justify-center p-0 mbs-4 container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]'>
|
|
174
173
|
<ControlItemInput title={t('space locked label')} description={t('space locked description')}>
|
|
175
174
|
<Input.Switch checked={locked} onCheckedChange={handleChangeLocked} classNames='justify-self-end' />
|
|
176
175
|
</ControlItemInput>
|
|
@@ -233,7 +232,7 @@ const InvitationQR = ({ id, url, onCancel }: { id: string; url: string; onCancel
|
|
|
233
232
|
const emoji = hexToEmoji(id);
|
|
234
233
|
return (
|
|
235
234
|
<>
|
|
236
|
-
<p className='text-description'>{t('qr code description', { ns:
|
|
235
|
+
<p className='text-description'>{t('qr code description', { ns: meta.id })}</p>
|
|
237
236
|
<div role='group' className='grid grid-cols-[1fr_min-content] mlb-2 gap-2'>
|
|
238
237
|
<div role='none' className='is-full aspect-square relative text-description'>
|
|
239
238
|
<QR
|
|
@@ -280,5 +279,9 @@ const InvitationAuthCode = ({ id, code, onCancel }: { id: string; code: string;
|
|
|
280
279
|
};
|
|
281
280
|
|
|
282
281
|
const InvitationComplete = ({ statusValue }: { statusValue: number }) => {
|
|
283
|
-
return statusValue > 0 ?
|
|
282
|
+
return statusValue > 0 ? (
|
|
283
|
+
<Icon icon='ph--check--regular' size={6} classNames='m-1.5' />
|
|
284
|
+
) : (
|
|
285
|
+
<Icon icon='ph--x--regular' size={6} classNames='m-1.5' />
|
|
286
|
+
);
|
|
284
287
|
};
|
|
@@ -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,51 @@
|
|
|
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 View, getTypenameFromQuery } from '@dxos/schema';
|
|
12
|
+
import { isNonNullable } from '@dxos/util';
|
|
13
|
+
|
|
14
|
+
import { meta } from '../../meta';
|
|
15
|
+
|
|
16
|
+
import { ObjectForm } from './ObjectForm';
|
|
17
|
+
|
|
18
|
+
type RowDetailsPanelProps = { objectId: string; view: View.View };
|
|
19
|
+
|
|
20
|
+
export const ObjectDetailsPanel = ({ objectId, view }: RowDetailsPanelProps) => {
|
|
21
|
+
const { t } = useTranslation(meta.id);
|
|
22
|
+
const client = useClient();
|
|
23
|
+
const space = getSpace(view);
|
|
24
|
+
const typename = view.query ? getTypenameFromQuery(view.query.ast) : undefined;
|
|
25
|
+
const schema = useSchema(client, space, typename);
|
|
26
|
+
|
|
27
|
+
const queriedObjects = useQuery(space, schema ? Filter.type(schema) : Filter.nothing());
|
|
28
|
+
const selectedRows = useSelected(objectId, 'multi');
|
|
29
|
+
const selectedObjects = selectedRows.map((id) => queriedObjects.find((obj) => obj.id === id)).filter(isNonNullable);
|
|
30
|
+
|
|
31
|
+
if (selectedObjects.length === 0) {
|
|
32
|
+
return (
|
|
33
|
+
<div role='none' className='plb-cardSpacingBlock pli-cardSpacingInline'>
|
|
34
|
+
<Callout.Root classNames='is-full'>
|
|
35
|
+
<Callout.Title>{t('row details no selection label')}</Callout.Title>
|
|
36
|
+
</Callout.Root>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div role='none' className='bs-full is-full flex flex-col p-2 gap-1 overflow-y-auto'>
|
|
43
|
+
{schema &&
|
|
44
|
+
selectedObjects.map((object) => (
|
|
45
|
+
<div key={object.id} className='border border-separator rounded'>
|
|
46
|
+
<ObjectForm object={object} schema={schema} />
|
|
47
|
+
</div>
|
|
48
|
+
))}
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
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, type Ref, 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
|
+
import { isNonNullable } from '@dxos/util';
|
|
14
|
+
|
|
15
|
+
import { meta as pluginMeta } from '../../meta';
|
|
16
|
+
|
|
17
|
+
const TagSchema = Tag.Tag.pipe(Schema.omit('id'));
|
|
18
|
+
|
|
19
|
+
type ObjectFormProps = { object: Obj.Any; schema: Schema.Schema.AnyNoContext };
|
|
20
|
+
|
|
21
|
+
export const ObjectForm = ({ object, schema }: ObjectFormProps) => {
|
|
22
|
+
const space = getSpace(object);
|
|
23
|
+
const handleRefQueryLookup = useRefQueryLookupHandler({ space });
|
|
24
|
+
|
|
25
|
+
const formSchema = useMemo(
|
|
26
|
+
() => Schema.Struct({ tags: Schema.Array(Type.Ref(Tag.Tag)).pipe(Schema.optional) }).pipe(Schema.extend(schema)),
|
|
27
|
+
[schema],
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const meta = Obj.getMeta(object);
|
|
31
|
+
const tags = (meta.tags ?? []).map((tag) => space?.db.ref(DXN.parse(tag))).filter(isNonNullable);
|
|
32
|
+
const values = useMemo(() => ({ tags, ...object }), [object, tags]);
|
|
33
|
+
|
|
34
|
+
const handleCreateTag = useCallback((values: Schema.Schema.Type<typeof TagSchema>) => {
|
|
35
|
+
invariant(space);
|
|
36
|
+
const tag = space.db.add(Tag.make(values));
|
|
37
|
+
const meta = Obj.getMeta(object);
|
|
38
|
+
meta.tags = [...(meta.tags ?? []), Obj.getDXN(tag).toString()];
|
|
39
|
+
}, []);
|
|
40
|
+
|
|
41
|
+
const handleSave = useCallback(
|
|
42
|
+
({ tags, ...values }: any, { changed }: { changed: Record<JsonPath, boolean> }) => {
|
|
43
|
+
const changedPaths = Object.keys(changed).filter((path) => changed[path as JsonPath]) as JsonPath[];
|
|
44
|
+
for (const path of changedPaths) {
|
|
45
|
+
if (path === 'tags') {
|
|
46
|
+
const meta = Obj.getMeta(object);
|
|
47
|
+
meta.tags = tags?.map((tag: Ref.Ref<Tag.Tag>) => tag.dxn.toString()) ?? [];
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const value = values[path];
|
|
52
|
+
setValue(object, path, value);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
[object],
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<Form
|
|
60
|
+
autoSave
|
|
61
|
+
schema={formSchema}
|
|
62
|
+
values={values}
|
|
63
|
+
createSchema={TagSchema}
|
|
64
|
+
createOptionIcon='ph--plus--regular'
|
|
65
|
+
createOptionLabel={['add tag label', { ns: pluginMeta.id }]}
|
|
66
|
+
createInitialValuePath='label'
|
|
67
|
+
onCreate={handleCreateTag}
|
|
68
|
+
onSave={handleSave}
|
|
69
|
+
onQueryRefOptions={handleRefQueryLookup}
|
|
70
|
+
/>
|
|
71
|
+
);
|
|
72
|
+
};
|
package/src/components/{PopoverRenameObject.tsx → ObjectRenamePopover/ObjectRenamePopover.tsx}
RENAMED
|
@@ -4,33 +4,27 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent } from '@dxos/app-framework';
|
|
8
|
+
import { useIntentDispatcher } from '@dxos/app-framework/react';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
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
|
|
15
|
+
export const OBJECT_RENAME_POPOVER = `${meta.id}/ObjectRenamePopover`;
|
|
15
16
|
|
|
16
|
-
export const
|
|
17
|
-
const { t } = useTranslation(
|
|
17
|
+
export const ObjectRenamePopover = ({ object }: { object: Obj.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, {
|
|
@@ -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 { render } from '@dxos/storybook-utils';
|
|
12
|
+
import { Project } from '@dxos/types';
|
|
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(Project.make());
|
|
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: [Project.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,29 @@
|
|
|
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, type Ref, Tag, Type } from '@dxos/echo';
|
|
12
|
+
import { type JsonPath, setValue } from '@dxos/echo/internal';
|
|
13
|
+
import { invariant } from '@dxos/invariant';
|
|
14
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
15
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
16
|
+
import { Form, useRefQueryLookupHandler } from '@dxos/react-ui-form';
|
|
17
|
+
import { isNonNullable } from '@dxos/util';
|
|
9
18
|
|
|
10
|
-
import { meta } from '../../meta';
|
|
19
|
+
import { meta as pluginMeta } from '../../meta';
|
|
20
|
+
|
|
21
|
+
// TODO(wittjosiah): Would be nice to control order when extending so this isn't always first/last.
|
|
22
|
+
const BaseSchema = Schema.Struct({
|
|
23
|
+
tags: Schema.Array(Type.Ref(Tag.Tag)).pipe(Schema.optional),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// TODO(wittjosiah): Better way to support validation of object schemas?
|
|
27
|
+
const TagSchema = Tag.Tag.pipe(Schema.omit('id'));
|
|
11
28
|
|
|
12
29
|
export type BaseObjectSettingsProps = ThemedClassName<
|
|
13
30
|
PropsWithChildren<{
|
|
@@ -15,32 +32,79 @@ export type BaseObjectSettingsProps = ThemedClassName<
|
|
|
15
32
|
}>
|
|
16
33
|
>;
|
|
17
34
|
|
|
35
|
+
// TODO(wittjosiah): Reconcile w/ ObjectDetailsPanel.
|
|
18
36
|
export const BaseObjectSettings = ({ classNames, children, object }: BaseObjectSettingsProps) => {
|
|
19
|
-
const
|
|
20
|
-
const
|
|
37
|
+
const space = getSpace(object);
|
|
38
|
+
const handleRefQueryLookup = useRefQueryLookupHandler({ space });
|
|
39
|
+
|
|
40
|
+
const formSchema = useMemo(() => {
|
|
41
|
+
return Function.pipe(
|
|
42
|
+
Obj.getSchema(object),
|
|
43
|
+
Option.fromNullable,
|
|
44
|
+
Option.map((schema) => BaseSchema.pipe(Schema.extend(schema))),
|
|
45
|
+
Option.getOrUndefined,
|
|
46
|
+
);
|
|
47
|
+
}, [object]);
|
|
48
|
+
|
|
49
|
+
const meta = Obj.getMeta(object);
|
|
50
|
+
const tags = (meta.tags ?? []).map((tag) => space?.db.ref(DXN.parse(tag))).filter(isNonNullable);
|
|
51
|
+
const values = useMemo(
|
|
52
|
+
() => ({
|
|
53
|
+
tags,
|
|
54
|
+
...object,
|
|
55
|
+
}),
|
|
56
|
+
[object, tags],
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const handleCreateTag = useCallback((values: Schema.Schema.Type<typeof TagSchema>) => {
|
|
60
|
+
invariant(space);
|
|
61
|
+
const tag = space.db.add(Tag.make(values));
|
|
62
|
+
const meta = Obj.getMeta(object);
|
|
63
|
+
meta.tags = [...(meta.tags ?? []), Obj.getDXN(tag).toString()];
|
|
64
|
+
}, []);
|
|
65
|
+
|
|
66
|
+
const handleSave = useCallback(
|
|
67
|
+
(
|
|
68
|
+
{ tags, ...values }: Schema.Schema.Type<typeof formSchema>,
|
|
69
|
+
{ changed }: { changed: Record<JsonPath, boolean> },
|
|
70
|
+
) => {
|
|
71
|
+
const changedPaths = Object.keys(changed).filter((path) => changed[path as JsonPath]) as JsonPath[];
|
|
72
|
+
batch(() => {
|
|
73
|
+
for (const path of changedPaths) {
|
|
74
|
+
if (path === 'tags') {
|
|
75
|
+
const meta = Obj.getMeta(object);
|
|
76
|
+
meta.tags = tags?.map((tag: Ref.Ref<Tag.Tag>) => tag.dxn.toString()) ?? [];
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const value = values[path];
|
|
81
|
+
setValue(object, path, value);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
[object],
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
if (!formSchema) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
21
91
|
|
|
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
92
|
return (
|
|
26
93
|
<>
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}}
|
|
42
|
-
/>
|
|
43
|
-
</Input.Root>
|
|
94
|
+
<Form
|
|
95
|
+
classNames={classNames}
|
|
96
|
+
outerSpacing={false}
|
|
97
|
+
autoSave
|
|
98
|
+
schema={formSchema}
|
|
99
|
+
values={values}
|
|
100
|
+
createSchema={TagSchema}
|
|
101
|
+
createOptionIcon='ph--plus--regular'
|
|
102
|
+
createOptionLabel={['add tag label', { ns: pluginMeta.id }]}
|
|
103
|
+
createInitialValuePath='label'
|
|
104
|
+
onCreate={handleCreateTag}
|
|
105
|
+
onSave={handleSave}
|
|
106
|
+
onQueryRefOptions={handleRefQueryLookup}
|
|
107
|
+
/>
|
|
44
108
|
{children}
|
|
45
109
|
</>
|
|
46
110
|
);
|
|
@@ -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,14 +31,14 @@ 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);
|
|
38
38
|
}, [forignKey, onDelete]);
|
|
39
39
|
|
|
40
40
|
return (
|
|
41
|
-
<ListItem.Root classNames='
|
|
41
|
+
<ListItem.Root classNames='pli-2'>
|
|
42
42
|
<ListItem.Heading classNames='flex flex-col grow truncate'>
|
|
43
43
|
<div>{forignKey.source}</div>
|
|
44
44
|
<div className='text-description text-sm truncate'>{forignKey.id}</div>
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Surface } from '@dxos/app-framework';
|
|
7
|
+
import { Surface } from '@dxos/app-framework/react';
|
|
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} />
|