@dxos/plugin-space 0.6.11 → 0.6.12-main.5cc132e
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/index.mjs +119 -30
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +93 -5
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/chunk-DTVUOG2C.mjs +95 -0
- package/dist/lib/node-esm/chunk-DTVUOG2C.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-LZEGRS7H.mjs +35 -0
- package/dist/lib/node-esm/chunk-LZEGRS7H.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +2729 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/meta.mjs +13 -0
- package/dist/lib/node-esm/meta.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +21 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/SaveStatus.d.ts +3 -0
- package/dist/types/src/components/SaveStatus.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/package.json +37 -32
- package/src/SpacePlugin.tsx +16 -12
- package/src/components/MenuFooter.tsx +1 -0
- package/src/components/SaveStatus.tsx +98 -0
- package/src/components/index.ts +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-space/src/meta.ts":{"bytes":4308,"imports":[],"format":"esm"},"packages/plugins/plugin-space/src/components/AwaitingObject.tsx":{"bytes":13778,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-space/src/components/CollectionMain.tsx":{"bytes":3145,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-space/src/components/CollectionSection.tsx":{"bytes":2283,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-space/src/components/EmptySpace.tsx":{"bytes":2119,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-space/src/components/EmptyTree.tsx":{"bytes":2112,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-space/src/types/collection.ts":{"bytes":3094,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-space/src/types/thread.ts":{"bytes":9132,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-space/src/types/types.ts":{"bytes":3548,"imports":[],"format":"esm"},"packages/plugins/plugin-space/src/types/index.ts":{"bytes":680,"imports":[{"path":"packages/plugins/plugin-space/src/types/collection.ts","kind":"import-statement","original":"./collection"},{"path":"packages/plugins/plugin-space/src/types/thread.ts","kind":"import-statement","original":"./thread"},{"path":"packages/plugins/plugin-space/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-space/src/util.tsx":{"bytes":69090,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/migrations","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-space/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-space/src/components/MenuFooter.tsx":{"bytes":4727,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-space/src/util.tsx","kind":"import-statement","original":"../util"}],"format":"esm"},"packages/plugins/plugin-space/src/components/MissingObject.tsx":{"bytes":5838,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-space/src/components/PersistenceStatus.tsx":{"bytes":10909,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx":{"bytes":6883,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-space/src/components/PopoverRenameSpace.tsx":{"bytes":6155,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-space/src/components/ShareSpaceButton.tsx":{"bytes":3357,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-space/src/components/SpaceMain/SpaceMembersSection.tsx":{"bytes":28293,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/invitations","kind":"import-statement","external":true},{"path":"@dxos/react-client/invitations","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/plugin-space/src/components/SpaceMain/SpaceMain.tsx":{"bytes":11502,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-space/src/components/SpaceMain/SpaceMembersSection.tsx","kind":"import-statement","original":"./SpaceMembersSection"},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/plugin-space/src/components/SpaceMain/index.ts":{"bytes":523,"imports":[{"path":"packages/plugins/plugin-space/src/components/SpaceMain/SpaceMain.tsx","kind":"import-statement","original":"./SpaceMain"}],"format":"esm"},"packages/plugins/plugin-space/src/components/SpacePresence.tsx":{"bytes":27623,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-space/src/components/SpaceSettings.tsx":{"bytes":3551,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-space/src/components/SaveStatus.tsx":{"bytes":10462,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/plugin-status-bar","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-space/src/components/index.ts":{"bytes":1982,"imports":[{"path":"packages/plugins/plugin-space/src/components/AwaitingObject.tsx","kind":"import-statement","original":"./AwaitingObject"},{"path":"packages/plugins/plugin-space/src/components/CollectionMain.tsx","kind":"import-statement","original":"./CollectionMain"},{"path":"packages/plugins/plugin-space/src/components/CollectionSection.tsx","kind":"import-statement","original":"./CollectionSection"},{"path":"packages/plugins/plugin-space/src/components/EmptySpace.tsx","kind":"import-statement","original":"./EmptySpace"},{"path":"packages/plugins/plugin-space/src/components/EmptyTree.tsx","kind":"import-statement","original":"./EmptyTree"},{"path":"packages/plugins/plugin-space/src/components/MenuFooter.tsx","kind":"import-statement","original":"./MenuFooter"},{"path":"packages/plugins/plugin-space/src/components/MissingObject.tsx","kind":"import-statement","original":"./MissingObject"},{"path":"packages/plugins/plugin-space/src/components/PersistenceStatus.tsx","kind":"import-statement","original":"./PersistenceStatus"},{"path":"packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx","kind":"import-statement","original":"./PopoverRenameObject"},{"path":"packages/plugins/plugin-space/src/components/PopoverRenameSpace.tsx","kind":"import-statement","original":"./PopoverRenameSpace"},{"path":"packages/plugins/plugin-space/src/components/ShareSpaceButton.tsx","kind":"import-statement","original":"./ShareSpaceButton"},{"path":"packages/plugins/plugin-space/src/components/SpaceMain/index.ts","kind":"import-statement","original":"./SpaceMain"},{"path":"packages/plugins/plugin-space/src/components/SpacePresence.tsx","kind":"import-statement","original":"./SpacePresence"},{"path":"packages/plugins/plugin-space/src/components/SpaceSettings.tsx","kind":"import-statement","original":"./SpaceSettings"},{"path":"packages/plugins/plugin-space/src/components/SaveStatus.tsx","kind":"import-statement","original":"./SaveStatus"}],"format":"esm"},"packages/plugins/plugin-space/src/translations.ts":{"bytes":13238,"imports":[{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-space/src/SpacePlugin.tsx":{"bytes":174507,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/migrations","kind":"import-statement","external":true},{"path":"@dxos/plugin-attention","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/meta","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-space/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-space/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-space/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/plugin-space/src/util.tsx","kind":"import-statement","original":"./util"}],"format":"esm"},"packages/plugins/plugin-space/src/index.ts":{"bytes":1326,"imports":[{"path":"packages/plugins/plugin-space/src/SpacePlugin.tsx","kind":"import-statement","original":"./SpacePlugin"},{"path":"packages/plugins/plugin-space/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-space/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-space/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/plugin-space/src/util.tsx","kind":"import-statement","original":"./util"},{"path":"packages/plugins/plugin-space/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-space/src/SpacePlugin.tsx","kind":"import-statement","original":"./SpacePlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-space/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":190602},"packages/plugins/plugin-space/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/plugin-space/dist/lib/node-esm/chunk-LZEGRS7H.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-space/dist/lib/node-esm/chunk-DTVUOG2C.mjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/migrations","kind":"import-statement","external":true},{"path":"@dxos/plugin-attention","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/meta","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/migrations","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/invitations","kind":"import-statement","external":true},{"path":"@dxos/react-client/invitations","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/shell/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/plugin-status-bar","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["ActorSchema","AwaitingObject","COMPOSER_SPACE_LOCK","ChannelType","CollectionMain","CollectionSection","CollectionType","ContactType","EmptySpace","EmptyTree","FullPresence","MenuFooter","MessageType","MissingObject","PersistenceStatus","PopoverRenameObject","PopoverRenameSpace","SHARED","SPACES","SPACE_DIRECTORY_HANDLE","SPACE_PLUGIN","SPACE_PLUGIN_SHORT_ID","SPACE_TYPE","SaveStatus","ShareSpaceButton","ShareSpaceButtonImpl","SmallPresence","SmallPresenceLive","SpaceAction","SpaceMain","SpacePlugin","SpacePresence","SpaceSettings","ThreadStatus","ThreadType","cloneObject","constructObjectActionGroups","constructObjectActions","constructSpaceActionGroups","constructSpaceActions","constructSpaceNode","createObjectNode","default","getActiveSpace","getNestedObjects","getSpaceDisplayName","memoizeQuery","parseSpacePlugin","translations"],"entryPoint":"packages/plugins/plugin-space/src/index.ts","inputs":{"packages/plugins/plugin-space/src/SpacePlugin.tsx":{"bytesInOutput":45021},"packages/plugins/plugin-space/src/components/AwaitingObject.tsx":{"bytesInOutput":3833},"packages/plugins/plugin-space/src/components/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-space/src/components/CollectionMain.tsx":{"bytesInOutput":752},"packages/plugins/plugin-space/src/components/CollectionSection.tsx":{"bytesInOutput":469},"packages/plugins/plugin-space/src/components/EmptySpace.tsx":{"bytesInOutput":485},"packages/plugins/plugin-space/src/components/EmptyTree.tsx":{"bytesInOutput":483},"packages/plugins/plugin-space/src/components/MenuFooter.tsx":{"bytesInOutput":1307},"packages/plugins/plugin-space/src/util.tsx":{"bytesInOutput":17355},"packages/plugins/plugin-space/src/components/MissingObject.tsx":{"bytesInOutput":1590},"packages/plugins/plugin-space/src/components/PersistenceStatus.tsx":{"bytesInOutput":2741},"packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx":{"bytesInOutput":1871},"packages/plugins/plugin-space/src/components/PopoverRenameSpace.tsx":{"bytesInOutput":1619},"packages/plugins/plugin-space/src/components/ShareSpaceButton.tsx":{"bytesInOutput":721},"packages/plugins/plugin-space/src/components/SpaceMain/SpaceMain.tsx":{"bytesInOutput":2363},"packages/plugins/plugin-space/src/components/SpaceMain/SpaceMembersSection.tsx":{"bytesInOutput":7933},"packages/plugins/plugin-space/src/components/SpaceMain/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-space/src/components/SpacePresence.tsx":{"bytesInOutput":7031},"packages/plugins/plugin-space/src/components/SpaceSettings.tsx":{"bytesInOutput":824},"packages/plugins/plugin-space/src/components/SaveStatus.tsx":{"bytesInOutput":2715},"packages/plugins/plugin-space/src/translations.ts":{"bytesInOutput":4431},"packages/plugins/plugin-space/src/index.ts":{"bytesInOutput":31}},"bytes":106337},"packages/plugins/plugin-space/dist/lib/node-esm/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-space/dist/lib/node-esm/meta.mjs":{"imports":[{"path":"packages/plugins/plugin-space/dist/lib/node-esm/chunk-LZEGRS7H.mjs","kind":"import-statement"}],"exports":["SPACE_PLUGIN","SPACE_PLUGIN_SHORT_ID","SpaceAction","default"],"entryPoint":"packages/plugins/plugin-space/src/meta.ts","inputs":{},"bytes":239},"packages/plugins/plugin-space/dist/lib/node-esm/chunk-LZEGRS7H.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1793},"packages/plugins/plugin-space/dist/lib/node-esm/chunk-LZEGRS7H.mjs":{"imports":[],"exports":["SPACE_PLUGIN","SPACE_PLUGIN_SHORT_ID","SpaceAction","meta_default"],"inputs":{"packages/plugins/plugin-space/src/meta.ts":{"bytesInOutput":1584}},"bytes":1757},"packages/plugins/plugin-space/dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-space/dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"packages/plugins/plugin-space/dist/lib/node-esm/chunk-DTVUOG2C.mjs","kind":"import-statement"}],"exports":["ActorSchema","ChannelType","CollectionType","ContactType","MessageType","SPACE_DIRECTORY_HANDLE","ThreadStatus","ThreadType"],"entryPoint":"packages/plugins/plugin-space/src/types/index.ts","inputs":{},"bytes":354},"packages/plugins/plugin-space/dist/lib/node-esm/chunk-DTVUOG2C.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8416},"packages/plugins/plugin-space/dist/lib/node-esm/chunk-DTVUOG2C.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["ActorSchema","ChannelType","CollectionType","ContactType","MessageType","SPACE_DIRECTORY_HANDLE","ThreadStatus","ThreadType"],"inputs":{"packages/plugins/plugin-space/src/types/collection.ts":{"bytesInOutput":830},"packages/plugins/plugin-space/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-space/src/types/thread.ts":{"bytesInOutput":2294},"packages/plugins/plugin-space/src/types/types.ts":{"bytesInOutput":64}},"bytes":3542}}}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ActorSchema,
|
|
3
|
+
ChannelType,
|
|
4
|
+
CollectionType,
|
|
5
|
+
ContactType,
|
|
6
|
+
MessageType,
|
|
7
|
+
SPACE_DIRECTORY_HANDLE,
|
|
8
|
+
ThreadStatus,
|
|
9
|
+
ThreadType
|
|
10
|
+
} from "../chunk-DTVUOG2C.mjs";
|
|
11
|
+
export {
|
|
12
|
+
ActorSchema,
|
|
13
|
+
ChannelType,
|
|
14
|
+
CollectionType,
|
|
15
|
+
ContactType,
|
|
16
|
+
MessageType,
|
|
17
|
+
SPACE_DIRECTORY_HANDLE,
|
|
18
|
+
ThreadStatus,
|
|
19
|
+
ThreadType
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpacePlugin.d.ts","sourceRoot":"","sources":["../../../src/SpacePlugin.tsx"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"SpacePlugin.d.ts","sourceRoot":"","sources":["../../../src/SpacePlugin.tsx"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,gBAAgB,EAKrB,KAAK,MAAM,EACX,KAAK,gBAAgB,EAStB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAsB,KAAK,OAAO,EAA4B,MAAM,aAAa,CAAC;AASzF,OAAO,EAAE,KAAK,MAAM,EAAa,MAAM,oBAAoB,CAAC;AAsC5D,OAAO,EAAoC,KAAK,mBAAmB,EAA2B,MAAM,SAAS,CAAC;AAuB9G,eAAO,MAAM,gBAAgB,YAAa,MAAM,4CAC+D,CAAC;AAEhH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,gBAAgB,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACxF,CAAC;AAEF,eAAO,MAAM,WAAW,+BAGrB,kBAAkB,KAAQ,gBAAgB,CAAC,mBAAmB,CAslChE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuFooter.d.ts","sourceRoot":"","sources":["../../../../src/components/MenuFooter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MenuFooter.d.ts","sourceRoot":"","sources":["../../../../src/components/MenuFooter.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAO5D,eAAO,MAAM,UAAU,eAAgB;IAAE,MAAM,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAA;CAAE,6BAkBzE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SaveStatus.d.ts","sourceRoot":"","sources":["../../../../src/components/SaveStatus.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAazC,eAAO,MAAM,UAAU,yBAgBtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-space",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.12-main.5cc132e",
|
|
4
4
|
"description": "DXOS Surface plugin for DXOS ECHO Spaces",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,21 +10,24 @@
|
|
|
10
10
|
".": {
|
|
11
11
|
"browser": "./dist/lib/browser/index.mjs",
|
|
12
12
|
"node": {
|
|
13
|
-
"
|
|
13
|
+
"require": "./dist/lib/node/index.cjs",
|
|
14
|
+
"default": "./dist/lib/node-esm/index.mjs"
|
|
14
15
|
},
|
|
15
16
|
"types": "./dist/types/src/index.d.ts"
|
|
16
17
|
},
|
|
17
18
|
"./meta": {
|
|
18
19
|
"browser": "./dist/lib/browser/meta.mjs",
|
|
19
20
|
"node": {
|
|
20
|
-
"
|
|
21
|
+
"require": "./dist/lib/node/meta.cjs",
|
|
22
|
+
"default": "./dist/lib/node-esm/meta.mjs"
|
|
21
23
|
},
|
|
22
24
|
"types": "./dist/types/src/meta.d.ts"
|
|
23
25
|
},
|
|
24
26
|
"./types": {
|
|
25
27
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
26
28
|
"node": {
|
|
27
|
-
"
|
|
29
|
+
"require": "./dist/lib/node/types/index.cjs",
|
|
30
|
+
"default": "./dist/lib/node-esm/types/index.mjs"
|
|
28
31
|
},
|
|
29
32
|
"types": "./dist/types/src/types/index.d.ts"
|
|
30
33
|
}
|
|
@@ -51,28 +54,30 @@
|
|
|
51
54
|
"lodash.get": "^4.4.2",
|
|
52
55
|
"react-drag-drop-files": "^2.3.8",
|
|
53
56
|
"react-is": "~18.2.0",
|
|
54
|
-
"@dxos/app-framework": "0.6.
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/keys": "0.6.
|
|
63
|
-
"@dxos/log": "0.6.
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/plugin-
|
|
67
|
-
"@dxos/plugin-
|
|
68
|
-
"@dxos/plugin-
|
|
69
|
-
"@dxos/plugin-
|
|
70
|
-
"@dxos/plugin-settings": "0.6.
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/react-ui-
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/react-ui-
|
|
75
|
-
"@dxos/
|
|
57
|
+
"@dxos/app-framework": "0.6.12-main.5cc132e",
|
|
58
|
+
"@dxos/automerge": "0.6.12-main.5cc132e",
|
|
59
|
+
"@dxos/context": "0.6.12-main.5cc132e",
|
|
60
|
+
"@dxos/client": "0.6.12-main.5cc132e",
|
|
61
|
+
"@dxos/display-name": "0.6.12-main.5cc132e",
|
|
62
|
+
"@dxos/async": "0.6.12-main.5cc132e",
|
|
63
|
+
"@dxos/echo-schema": "0.6.12-main.5cc132e",
|
|
64
|
+
"@dxos/invariant": "0.6.12-main.5cc132e",
|
|
65
|
+
"@dxos/keys": "0.6.12-main.5cc132e",
|
|
66
|
+
"@dxos/log": "0.6.12-main.5cc132e",
|
|
67
|
+
"@dxos/local-storage": "0.6.12-main.5cc132e",
|
|
68
|
+
"@dxos/migrations": "0.6.12-main.5cc132e",
|
|
69
|
+
"@dxos/plugin-attention": "0.6.12-main.5cc132e",
|
|
70
|
+
"@dxos/plugin-client": "0.6.12-main.5cc132e",
|
|
71
|
+
"@dxos/plugin-graph": "0.6.12-main.5cc132e",
|
|
72
|
+
"@dxos/plugin-metadata": "0.6.12-main.5cc132e",
|
|
73
|
+
"@dxos/plugin-settings": "0.6.12-main.5cc132e",
|
|
74
|
+
"@dxos/plugin-status-bar": "0.6.12-main.5cc132e",
|
|
75
|
+
"@dxos/react-ui-editor": "0.6.12-main.5cc132e",
|
|
76
|
+
"@dxos/plugin-observability": "0.6.12-main.5cc132e",
|
|
77
|
+
"@dxos/react-ui-attention": "0.6.12-main.5cc132e",
|
|
78
|
+
"@dxos/react-client": "0.6.12-main.5cc132e",
|
|
79
|
+
"@dxos/shell": "0.6.12-main.5cc132e",
|
|
80
|
+
"@dxos/util": "0.6.12-main.5cc132e"
|
|
76
81
|
},
|
|
77
82
|
"devDependencies": {
|
|
78
83
|
"@babel/core": "^7.18.13",
|
|
@@ -82,18 +87,18 @@
|
|
|
82
87
|
"@types/react-dom": "~18.2.0",
|
|
83
88
|
"react": "~18.2.0",
|
|
84
89
|
"react-dom": "~18.2.0",
|
|
85
|
-
"vite": "
|
|
86
|
-
"@dxos/react-ui": "0.6.
|
|
87
|
-
"@dxos/
|
|
88
|
-
"@dxos/
|
|
90
|
+
"vite": "5.4.7",
|
|
91
|
+
"@dxos/react-ui": "0.6.12-main.5cc132e",
|
|
92
|
+
"@dxos/storybook-utils": "0.6.12-main.5cc132e",
|
|
93
|
+
"@dxos/react-ui-theme": "0.6.12-main.5cc132e"
|
|
89
94
|
},
|
|
90
95
|
"optionalDependencies": {
|
|
91
96
|
"@babel/core": "^7.18.13",
|
|
92
97
|
"@phosphor-icons/react": "^2.1.5",
|
|
93
98
|
"react": "^18.0.0",
|
|
94
99
|
"react-dom": "^18.0.0",
|
|
95
|
-
"@dxos/react-ui": "0.6.
|
|
96
|
-
"@dxos/react-ui-theme": "0.6.
|
|
100
|
+
"@dxos/react-ui": "0.6.12-main.5cc132e",
|
|
101
|
+
"@dxos/react-ui-theme": "0.6.12-main.5cc132e"
|
|
97
102
|
},
|
|
98
103
|
"publishConfig": {
|
|
99
104
|
"access": "public"
|
package/src/SpacePlugin.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type IconProps, Plus, SignIn,
|
|
5
|
+
import { CardsThree, type IconProps, Plus, SignIn, Warning } from '@phosphor-icons/react';
|
|
6
6
|
import { effect, signal } from '@preact/signals-core';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
@@ -10,45 +10,45 @@ import {
|
|
|
10
10
|
type IntentDispatcher,
|
|
11
11
|
type IntentPluginProvides,
|
|
12
12
|
LayoutAction,
|
|
13
|
-
Surface,
|
|
14
13
|
type LocationProvides,
|
|
15
14
|
NavigationAction,
|
|
16
15
|
type Plugin,
|
|
17
16
|
type PluginDefinition,
|
|
18
|
-
|
|
17
|
+
Surface,
|
|
19
18
|
firstIdInPart,
|
|
19
|
+
openIds,
|
|
20
|
+
parseGraphPlugin,
|
|
20
21
|
parseIntentPlugin,
|
|
21
|
-
parseNavigationPlugin,
|
|
22
22
|
parseMetadataResolverPlugin,
|
|
23
|
+
parseNavigationPlugin,
|
|
23
24
|
resolvePlugin,
|
|
24
|
-
parseGraphPlugin,
|
|
25
25
|
} from '@dxos/app-framework';
|
|
26
26
|
import { EventSubscriptions, type Trigger, type UnsubscribeCallback } from '@dxos/async';
|
|
27
|
-
import { type Identifiable, isReactiveObject
|
|
27
|
+
import { type EchoReactiveObject, type Identifiable, isReactiveObject } from '@dxos/echo-schema';
|
|
28
28
|
import { LocalStorageStore } from '@dxos/local-storage';
|
|
29
29
|
import { log } from '@dxos/log';
|
|
30
30
|
import { Migrations } from '@dxos/migrations';
|
|
31
31
|
import { type AttentionPluginProvides, parseAttentionPlugin } from '@dxos/plugin-attention';
|
|
32
32
|
import { type ClientPluginProvides, parseClientPlugin } from '@dxos/plugin-client';
|
|
33
|
-
import { createExtension, isGraphNode, memoize,
|
|
33
|
+
import { type Node, createExtension, isGraphNode, memoize, toSignal } from '@dxos/plugin-graph';
|
|
34
34
|
import { ObservabilityAction } from '@dxos/plugin-observability/meta';
|
|
35
35
|
import { type Client, PublicKey } from '@dxos/react-client';
|
|
36
36
|
import {
|
|
37
|
+
Expando,
|
|
38
|
+
Filter,
|
|
37
39
|
type PropertiesTypeProps,
|
|
38
40
|
type Space,
|
|
41
|
+
SpaceState,
|
|
39
42
|
create,
|
|
40
|
-
Expando,
|
|
41
|
-
Filter,
|
|
42
43
|
fullyQualifiedId,
|
|
43
44
|
getSpace,
|
|
44
45
|
getTypename,
|
|
45
46
|
isEchoObject,
|
|
46
47
|
isSpace,
|
|
47
48
|
loadObjectReferences,
|
|
48
|
-
SpaceState,
|
|
49
49
|
} from '@dxos/react-client/echo';
|
|
50
50
|
import { Dialog } from '@dxos/react-ui';
|
|
51
|
-
import { InvitationManager, type InvitationManagerProps, osTranslations
|
|
51
|
+
import { ClipboardProvider, InvitationManager, type InvitationManagerProps, osTranslations } from '@dxos/shell/react';
|
|
52
52
|
import { ComplexMap, nonNullable, reduceGroupBy } from '@dxos/util';
|
|
53
53
|
|
|
54
54
|
import {
|
|
@@ -61,6 +61,7 @@ import {
|
|
|
61
61
|
MissingObject,
|
|
62
62
|
PopoverRenameObject,
|
|
63
63
|
PopoverRenameSpace,
|
|
64
|
+
SaveStatus,
|
|
64
65
|
ShareSpaceButton,
|
|
65
66
|
SmallPresence,
|
|
66
67
|
SmallPresenceLive,
|
|
@@ -69,7 +70,7 @@ import {
|
|
|
69
70
|
} from './components';
|
|
70
71
|
import meta, { SPACE_PLUGIN, SpaceAction } from './meta';
|
|
71
72
|
import translations from './translations';
|
|
72
|
-
import { CollectionType, type
|
|
73
|
+
import { CollectionType, type PluginState, type SpacePluginProvides, type SpaceSettingsProps } from './types';
|
|
73
74
|
import {
|
|
74
75
|
COMPOSER_SPACE_LOCK,
|
|
75
76
|
SHARED,
|
|
@@ -441,6 +442,9 @@ export const SpacePlugin = ({
|
|
|
441
442
|
} else {
|
|
442
443
|
return <MenuFooter object={data.object} />;
|
|
443
444
|
}
|
|
445
|
+
case 'status': {
|
|
446
|
+
return <SaveStatus />;
|
|
447
|
+
}
|
|
444
448
|
default:
|
|
445
449
|
return null;
|
|
446
450
|
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { ArrowsClockwise, CheckCircle } from '@phosphor-icons/react';
|
|
6
|
+
import React, { useEffect } from 'react';
|
|
7
|
+
|
|
8
|
+
import type { UnsubscribeCallback } from '@dxos/async';
|
|
9
|
+
import type { Client } from '@dxos/client';
|
|
10
|
+
import { type Space, type SpaceId } from '@dxos/client/echo';
|
|
11
|
+
import { Context } from '@dxos/context';
|
|
12
|
+
import { StatusBar } from '@dxos/plugin-status-bar';
|
|
13
|
+
import { useClient } from '@dxos/react-client';
|
|
14
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
15
|
+
import { getSize } from '@dxos/react-ui-theme';
|
|
16
|
+
|
|
17
|
+
import { SPACE_PLUGIN } from '../meta';
|
|
18
|
+
|
|
19
|
+
export const SaveStatus = () => {
|
|
20
|
+
const { t } = useTranslation(SPACE_PLUGIN);
|
|
21
|
+
const client = useClient();
|
|
22
|
+
const [state, setState] = React.useState<'saved' | 'saving'>('saved');
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
return createClientSaveTracker(client, (state) => {
|
|
26
|
+
setState(state);
|
|
27
|
+
});
|
|
28
|
+
}, []);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<StatusBar.Item title={state === 'saving' ? t('saving label') : t('saved label')}>
|
|
32
|
+
{state === 'saving' ? <ArrowsClockwise className={getSize(3)} /> : <CheckCircle className={getSize(3)} />}
|
|
33
|
+
</StatusBar.Item>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const createClientSaveTracker = (client: Client, cb: (state: 'saved' | 'saving') => void) => {
|
|
38
|
+
const unsubscribeCallbacks: Record<SpaceId, UnsubscribeCallback> = {};
|
|
39
|
+
const state: Record<SpaceId, 'saved' | 'saving'> = {};
|
|
40
|
+
|
|
41
|
+
const install = (spaces: Space[]) => {
|
|
42
|
+
for (const space of spaces) {
|
|
43
|
+
if (state[space.id]) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
state[space.id] = 'saved';
|
|
48
|
+
unsubscribeCallbacks[space.id] = createSpaceSaveTracker(space, (s) => {
|
|
49
|
+
state[space.id] = s;
|
|
50
|
+
cb(Object.values(state).some((s) => s === 'saving') ? 'saving' : 'saved');
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
client.spaces.subscribe((spaces) => {
|
|
55
|
+
install(spaces);
|
|
56
|
+
});
|
|
57
|
+
install(client.spaces.get());
|
|
58
|
+
|
|
59
|
+
return () => {
|
|
60
|
+
for (const unsubscribe of Object.values(unsubscribeCallbacks)) {
|
|
61
|
+
unsubscribe();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const createSpaceSaveTracker = (space: Space, cb: (state: 'saved' | 'saving') => void): UnsubscribeCallback => {
|
|
67
|
+
const ctx = new Context();
|
|
68
|
+
|
|
69
|
+
void space.waitUntilReady().then(() => {
|
|
70
|
+
if (ctx.disposed) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
let hasUnsavedChanges = false;
|
|
75
|
+
let lastFlushPromise: Promise<void> | undefined;
|
|
76
|
+
space.crud.saveStateChanged.on(ctx, ({ unsavedDocuments }) => {
|
|
77
|
+
hasUnsavedChanges = unsavedDocuments.length > 0;
|
|
78
|
+
});
|
|
79
|
+
space.crud.saveStateChanged.debounce(500).on(ctx, () => {
|
|
80
|
+
if (hasUnsavedChanges) {
|
|
81
|
+
lastFlushPromise = undefined;
|
|
82
|
+
cb('saving');
|
|
83
|
+
} else {
|
|
84
|
+
const flushPromise = space.crud.flush();
|
|
85
|
+
lastFlushPromise = flushPromise;
|
|
86
|
+
void flushPromise.then(() => {
|
|
87
|
+
if (lastFlushPromise === flushPromise) {
|
|
88
|
+
cb('saved');
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
return () => {
|
|
96
|
+
void ctx.dispose();
|
|
97
|
+
};
|
|
98
|
+
};
|
package/src/components/index.ts
CHANGED