@dxos/plugin-stack 0.8.4-main.c85a9c8dae → 0.8.4-main.d9fc60f731

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.
Files changed (127) hide show
  1. package/LICENSE +102 -5
  2. package/PLUGIN.mdl +326 -0
  3. package/README.md +1 -1
  4. package/dist/lib/neutral/StackArticle-M7AYNDZN.mjs +125 -0
  5. package/dist/lib/neutral/StackArticle-M7AYNDZN.mjs.map +7 -0
  6. package/dist/lib/neutral/StackPlugin.mjs +34 -0
  7. package/dist/lib/neutral/StackPlugin.mjs.map +7 -0
  8. package/dist/lib/neutral/capabilities/index.mjs +7 -0
  9. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  10. package/dist/lib/neutral/chunk-RGJSGQGF.mjs +36 -0
  11. package/dist/lib/neutral/chunk-RGJSGQGF.mjs.map +7 -0
  12. package/dist/lib/{browser/chunk-CD32XYEB.mjs → neutral/chunk-T4NSFSPH.mjs} +3 -6
  13. package/dist/lib/neutral/chunk-T4NSFSPH.mjs.map +7 -0
  14. package/dist/lib/neutral/components/index.mjs +182 -0
  15. package/dist/lib/neutral/components/index.mjs.map +7 -0
  16. package/dist/lib/neutral/containers/index.mjs +7 -0
  17. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  18. package/dist/lib/neutral/index.mjs +15 -0
  19. package/dist/lib/neutral/meta.json +1 -0
  20. package/dist/lib/neutral/meta.mjs +9 -0
  21. package/dist/lib/neutral/plugin.mjs +11 -0
  22. package/dist/lib/neutral/plugin.mjs.map +7 -0
  23. package/dist/lib/neutral/react-surface-MD3CVY2N.mjs +23 -0
  24. package/dist/lib/neutral/react-surface-MD3CVY2N.mjs.map +7 -0
  25. package/dist/lib/neutral/translations.mjs +37 -0
  26. package/dist/lib/neutral/translations.mjs.map +7 -0
  27. package/dist/lib/{browser → neutral}/types/index.mjs +1 -1
  28. package/dist/lib/neutral/types/index.mjs.map +7 -0
  29. package/dist/types/src/StackPlugin.d.ts +1 -0
  30. package/dist/types/src/StackPlugin.d.ts.map +1 -1
  31. package/dist/types/src/capabilities/index.d.ts +2 -1
  32. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  33. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  34. package/dist/types/src/components/{StackContext.d.ts → StackContext/StackContext.d.ts} +2 -1
  35. package/dist/types/src/components/StackContext/StackContext.d.ts.map +1 -0
  36. package/dist/types/src/components/StackContext/index.d.ts +2 -0
  37. package/dist/types/src/components/StackContext/index.d.ts.map +1 -0
  38. package/dist/types/src/components/{CaretDownUp.d.ts → StackSection/CaretDownUp.d.ts} +1 -1
  39. package/dist/types/src/components/StackSection/CaretDownUp.d.ts.map +1 -0
  40. package/dist/types/src/components/{StackSection.d.ts → StackSection/StackSection.d.ts} +1 -1
  41. package/dist/types/src/components/StackSection/StackSection.d.ts.map +1 -0
  42. package/dist/types/src/components/StackSection/index.d.ts +2 -0
  43. package/dist/types/src/components/StackSection/index.d.ts.map +1 -0
  44. package/dist/types/src/components/{StackSettings.d.ts → StackSettings/StackSettings.d.ts} +1 -1
  45. package/dist/types/src/components/StackSettings/StackSettings.d.ts.map +1 -0
  46. package/dist/types/src/components/StackSettings/index.d.ts +2 -0
  47. package/dist/types/src/components/StackSettings/index.d.ts.map +1 -0
  48. package/dist/types/src/containers/StackArticle/StackArticle.d.ts +7 -0
  49. package/dist/types/src/containers/StackArticle/StackArticle.d.ts.map +1 -0
  50. package/dist/types/src/containers/StackArticle/index.d.ts +2 -0
  51. package/dist/types/src/containers/StackArticle/index.d.ts.map +1 -0
  52. package/dist/types/src/containers/index.d.ts +1 -1
  53. package/dist/types/src/containers/index.d.ts.map +1 -1
  54. package/dist/types/src/index.d.ts +1 -1
  55. package/dist/types/src/index.d.ts.map +1 -1
  56. package/dist/types/src/meta.d.ts +3 -2
  57. package/dist/types/src/meta.d.ts.map +1 -1
  58. package/dist/types/src/plugin.d.ts +3 -0
  59. package/dist/types/src/plugin.d.ts.map +1 -0
  60. package/dist/types/src/translations.d.ts +30 -30
  61. package/dist/types/src/translations.d.ts.map +1 -1
  62. package/dist/types/src/types/stack.d.ts +1 -2
  63. package/dist/types/src/types/stack.d.ts.map +1 -1
  64. package/dist/types/src/types/types.d.ts +1 -2
  65. package/dist/types/src/types/types.d.ts.map +1 -1
  66. package/dist/types/tsconfig.tsbuildinfo +1 -1
  67. package/package.json +76 -48
  68. package/src/StackPlugin.ts +12 -22
  69. package/src/capabilities/index.ts +3 -1
  70. package/src/capabilities/react-surface.tsx +28 -0
  71. package/src/components/{StackContext.tsx → StackContext/StackContext.tsx} +3 -1
  72. package/src/components/StackContext/index.ts +5 -0
  73. package/src/components/{StackSection.tsx → StackSection/StackSection.tsx} +24 -21
  74. package/src/components/StackSection/index.ts +5 -0
  75. package/src/components/StackSettings/StackSettings.tsx +28 -0
  76. package/src/components/StackSettings/index.ts +5 -0
  77. package/src/containers/{StackContainer/StackContainer.tsx → StackArticle/StackArticle.tsx} +38 -42
  78. package/src/containers/StackArticle/index.ts +5 -0
  79. package/src/containers/index.ts +1 -1
  80. package/src/index.ts +1 -1
  81. package/src/meta.ts +21 -7
  82. package/src/plugin.ts +9 -0
  83. package/src/translations.ts +23 -22
  84. package/src/types/stack.ts +3 -8
  85. package/src/types/types.ts +1 -2
  86. package/src/vite-env.d.ts +10 -0
  87. package/dist/lib/browser/StackContainer-BIFUBD3Y.mjs +0 -289
  88. package/dist/lib/browser/StackContainer-BIFUBD3Y.mjs.map +0 -7
  89. package/dist/lib/browser/chunk-4X7CK6FM.mjs +0 -21
  90. package/dist/lib/browser/chunk-4X7CK6FM.mjs.map +0 -7
  91. package/dist/lib/browser/chunk-CD32XYEB.mjs.map +0 -7
  92. package/dist/lib/browser/index.mjs +0 -84
  93. package/dist/lib/browser/index.mjs.map +0 -7
  94. package/dist/lib/browser/meta.json +0 -1
  95. package/dist/lib/browser/react-surface-PVND4UCN.mjs +0 -34
  96. package/dist/lib/browser/react-surface-PVND4UCN.mjs.map +0 -7
  97. package/dist/lib/node-esm/StackContainer-7XVJHW4D.mjs +0 -290
  98. package/dist/lib/node-esm/StackContainer-7XVJHW4D.mjs.map +0 -7
  99. package/dist/lib/node-esm/chunk-26XWE7UY.mjs +0 -29
  100. package/dist/lib/node-esm/chunk-26XWE7UY.mjs.map +0 -7
  101. package/dist/lib/node-esm/chunk-HEEGXPSW.mjs +0 -23
  102. package/dist/lib/node-esm/chunk-HEEGXPSW.mjs.map +0 -7
  103. package/dist/lib/node-esm/index.mjs +0 -85
  104. package/dist/lib/node-esm/index.mjs.map +0 -7
  105. package/dist/lib/node-esm/meta.json +0 -1
  106. package/dist/lib/node-esm/react-surface-SZETVRAZ.mjs +0 -35
  107. package/dist/lib/node-esm/react-surface-SZETVRAZ.mjs.map +0 -7
  108. package/dist/lib/node-esm/types/index.mjs +0 -10
  109. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  110. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  111. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  112. package/dist/types/src/components/CaretDownUp.d.ts.map +0 -1
  113. package/dist/types/src/components/StackContext.d.ts.map +0 -1
  114. package/dist/types/src/components/StackSection.d.ts.map +0 -1
  115. package/dist/types/src/components/StackSettings.d.ts.map +0 -1
  116. package/dist/types/src/containers/StackContainer/StackContainer.d.ts +0 -9
  117. package/dist/types/src/containers/StackContainer/StackContainer.d.ts.map +0 -1
  118. package/dist/types/src/containers/StackContainer/index.d.ts +0 -3
  119. package/dist/types/src/containers/StackContainer/index.d.ts.map +0 -1
  120. package/src/capabilities/react-surface/index.ts +0 -7
  121. package/src/capabilities/react-surface/react-surface.tsx +0 -34
  122. package/src/components/StackSettings.tsx +0 -30
  123. package/src/containers/StackContainer/index.ts +0 -7
  124. /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
  125. /package/dist/lib/{node-esm/types/index.mjs.map → neutral/meta.mjs.map} +0 -0
  126. /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
  127. /package/src/components/{CaretDownUp.tsx → StackSection/CaretDownUp.tsx} +0 -0
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/StackPlugin.ts", "../../../src/capabilities/react-surface/index.ts", "../../../src/translations.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { type Obj } from '@dxos/echo';\n\nimport { ReactSurface } from './capabilities';\nimport { SECTION_IDENTIFIER, meta } from './meta';\nimport { translations } from './translations';\nimport { StackViewType } from './types';\n\nexport const StackPlugin = Plugin.define(meta).pipe(\n AppPlugin.addMetadataModule({\n metadata: {\n id: SECTION_IDENTIFIER,\n metadata: {\n parse: (section: { object: Obj.Unknown }, type: string) => {\n switch (type) {\n case 'node':\n return { id: section.object.id, label: (section.object as any).title, data: section.object };\n case 'object':\n return section.object;\n case 'view-object':\n return section;\n }\n },\n },\n },\n }),\n AppPlugin.addSchemaModule({ schema: [StackViewType] }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.make,\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\nimport { translations as stackTranslations } from '@dxos/react-ui-stack';\n\nimport { meta } from './meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'plugin name': 'Stacks',\n 'settings title': 'Stack plugin settings',\n 'settings separation label': 'Separate sections',\n 'add section beforeAll dialog title': 'Add a section to the start',\n 'add section afterAll dialog title': 'Add a section to the end',\n 'add section before dialog title': 'Add a section',\n 'add section after dialog title': 'Add a section',\n 'add section input placeholder': 'Find the type of section to add',\n 'upload file label': 'Add file',\n 'add section label': 'Add section',\n 'empty stack message': 'Drag objects into the stack.',\n 'remove section label': 'Delete',\n 'navigate to section label': 'Navigate to object',\n 'untitled section title': 'Untitled section',\n 'add section before label': 'Add before',\n 'add section after label': 'Add after',\n 'expand label': 'Expand',\n 'collapse label': 'Collapse',\n 'open chat thread label': 'Open chat thread',\n 'drag handle label': 'Press space or enter to begin dragging this object.',\n },\n },\n },\n ...stackTranslations,\n] as const satisfies Resource[];\n"],
5
- "mappings": ";;;;;;;;;AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;;;ACD1B,SAASC,kBAAkB;AAEpB,IAAMC,eAAeC,WAAWC,KAAK,gBAAgB,MAAM,OAAO,8BAAA,CAAA;;;ACDzE,SAASC,gBAAgBC,yBAAyB;AAI3C,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,eAAe;QACf,kBAAkB;QAClB,6BAA6B;QAC7B,sCAAsC;QACtC,qCAAqC;QACrC,mCAAmC;QACnC,kCAAkC;QAClC,iCAAiC;QACjC,qBAAqB;QACrB,qBAAqB;QACrB,uBAAuB;QACvB,wBAAwB;QACxB,6BAA6B;QAC7B,0BAA0B;QAC1B,4BAA4B;QAC5B,2BAA2B;QAC3B,gBAAgB;QAChB,kBAAkB;QAClB,0BAA0B;QAC1B,qBAAqB;MACvB;IACF;EACF;KACGC;;;;AFvBE,IAAMC,cAAcC,OAAOC,OAAOC,IAAAA,EAAMC,KAC7CC,UAAUC,kBAAkB;EAC1BC,UAAU;IACRC,IAAIC;IACJF,UAAU;MACRG,OAAO,CAACC,SAAkCC,SAAAA;AACxC,gBAAQA,MAAAA;UACN,KAAK;AACH,mBAAO;cAAEJ,IAAIG,QAAQE,OAAOL;cAAIM,OAAQH,QAAQE,OAAeE;cAAOC,MAAML,QAAQE;YAAO;UAC7F,KAAK;AACH,mBAAOF,QAAQE;UACjB,KAAK;AACH,mBAAOF;QACX;MACF;IACF;EACF;AACF,CAAA,GACAN,UAAUY,gBAAgB;EAAEC,QAAQ;IAACC;;AAAe,CAAA,GACpDd,UAAUe,iBAAiB;EAAEC,UAAUC;AAAa,CAAA,GACpDjB,UAAUkB,sBAAsB;EAAEC;AAAa,CAAA,GAC/CvB,OAAOwB,IAAI;",
6
- "names": ["Plugin", "AppPlugin", "Capability", "ReactSurface", "Capability", "lazy", "translations", "stackTranslations", "translations", "meta", "id", "stackTranslations", "StackPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addMetadataModule", "metadata", "id", "SECTION_IDENTIFIER", "parse", "section", "type", "object", "label", "title", "data", "addSchemaModule", "schema", "StackViewType", "addSurfaceModule", "activate", "ReactSurface", "addTranslationsModule", "translations", "make"]
7
- }
@@ -1 +0,0 @@
1
- {"inputs":{"src/meta.ts":{"bytes":2522,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/components/StackContext.tsx":{"bytes":1834,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/CaretDownUp.tsx":{"bytes":2962,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/StackSection.tsx":{"bytes":17327,"imports":[{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","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/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/components/CaretDownUp.tsx","kind":"import-statement","original":"./CaretDownUp"},{"path":"src/components/StackContext.tsx","kind":"import-statement","original":"./StackContext"}],"format":"esm"},"src/components/StackSettings.tsx":{"bytes":3224,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/components/index.ts":{"bytes":684,"imports":[{"path":"src/components/StackContext.tsx","kind":"import-statement","original":"./StackContext"},{"path":"src/components/StackSection.tsx","kind":"import-statement","original":"./StackSection"},{"path":"src/components/StackSettings.tsx","kind":"import-statement","original":"./StackSettings"}],"format":"esm"},"src/containers/StackContainer/StackContainer.tsx":{"bytes":19926,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-atom","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","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/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../../components"},{"path":"src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"src/containers/StackContainer/index.ts":{"bytes":676,"imports":[{"path":"src/containers/StackContainer/StackContainer.tsx","kind":"import-statement","original":"./StackContainer"}],"format":"esm"},"src/containers/index.ts":{"bytes":809,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/containers/StackContainer/index.ts","kind":"dynamic-import","original":"./StackContainer"}],"format":"esm"},"src/capabilities/react-surface/react-surface.tsx":{"bytes":4498,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/containers/index.ts","kind":"import-statement","original":"../../containers"},{"path":"src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"src/capabilities/react-surface/index.ts":{"bytes":909,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/react-surface/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":486,"imports":[{"path":"src/capabilities/react-surface/index.ts","kind":"import-statement","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":4451,"imports":[{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/types/stack.ts":{"bytes":3750,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":499,"imports":[{"path":"src/types/stack.ts","kind":"import-statement","original":"./stack"}],"format":"esm"},"src/StackPlugin.ts":{"bytes":4334,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/index.ts":{"bytes":547,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/StackPlugin.ts","kind":"import-statement","original":"./StackPlugin"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4449},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-CD32XYEB.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-4X7CK6FM.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/react-surface-PVND4UCN.mjs","kind":"dynamic-import"},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"exports":["SECTION_IDENTIFIER","StackPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/StackPlugin.ts":{"bytesInOutput":797},"src/capabilities/react-surface/index.ts":{"bytesInOutput":148},"src/capabilities/index.ts":{"bytesInOutput":0},"src/translations.ts":{"bytesInOutput":1274}},"bytes":2549},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-CD32XYEB.mjs","kind":"import-statement"}],"exports":["SectionSchema","StackViewType"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":154},"dist/lib/browser/chunk-CD32XYEB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1761},"dist/lib/browser/chunk-CD32XYEB.mjs":{"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["SectionSchema","StackViewType"],"inputs":{"src/types/stack.ts":{"bytesInOutput":575},"src/types/index.ts":{"bytesInOutput":0}},"bytes":687},"dist/lib/browser/StackContainer-BIFUBD3Y.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23640},"dist/lib/browser/StackContainer-BIFUBD3Y.mjs":{"imports":[{"path":"dist/lib/browser/chunk-4X7CK6FM.mjs","kind":"import-statement"},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-atom","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","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/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","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/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"react","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-form","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/containers/StackContainer/index.ts","inputs":{"src/containers/StackContainer/StackContainer.tsx":{"bytesInOutput":4379},"src/components/StackContext.tsx":{"bytesInOutput":265},"src/components/index.ts":{"bytesInOutput":0},"src/components/StackSection.tsx":{"bytesInOutput":5062},"src/components/CaretDownUp.tsx":{"bytesInOutput":771},"src/components/StackSettings.tsx":{"bytesInOutput":151},"src/containers/StackContainer/index.ts":{"bytesInOutput":45}},"bytes":11150},"dist/lib/browser/react-surface-PVND4UCN.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2585},"dist/lib/browser/react-surface-PVND4UCN.mjs":{"imports":[{"path":"dist/lib/browser/chunk-4X7CK6FM.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/browser/StackContainer-BIFUBD3Y.mjs","kind":"dynamic-import"}],"exports":["default"],"entryPoint":"src/capabilities/react-surface/react-surface.tsx","inputs":{"src/capabilities/react-surface/react-surface.tsx":{"bytesInOutput":790},"src/containers/index.ts":{"bytesInOutput":104}},"bytes":1174},"dist/lib/browser/chunk-4X7CK6FM.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1165},"dist/lib/browser/chunk-4X7CK6FM.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["SECTION_IDENTIFIER","meta"],"inputs":{"src/meta.ts":{"bytesInOutput":695}},"bytes":796}}}
@@ -1,34 +0,0 @@
1
- import {
2
- meta
3
- } from "./chunk-4X7CK6FM.mjs";
4
-
5
- // src/capabilities/react-surface/react-surface.tsx
6
- import * as Effect from "effect/Effect";
7
- import React from "react";
8
- import { Capabilities, Capability } from "@dxos/app-framework";
9
- import { Surface } from "@dxos/app-framework/ui";
10
- import { Obj } from "@dxos/echo";
11
- import { Collection } from "@dxos/echo";
12
-
13
- // src/containers/index.ts
14
- import { lazy } from "react";
15
- var StackContainer = lazy(() => import("./StackContainer-BIFUBD3Y.mjs"));
16
-
17
- // src/capabilities/react-surface/react-surface.tsx
18
- var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, Surface.create({
19
- id: `${meta.id}/article`,
20
- role: "article",
21
- filter: (data) => Obj.instanceOf(Collection.Collection, data.subject),
22
- component: ({ role, data }) => {
23
- const id = typeof data.id === "string" ? data.id : void 0;
24
- return /* @__PURE__ */ React.createElement(StackContainer, {
25
- id: id ?? Obj.getDXN(data.subject).toString(),
26
- role,
27
- subject: data.subject
28
- });
29
- }
30
- }))));
31
- export {
32
- react_surface_default as default
33
- };
34
- //# sourceMappingURL=react-surface-PVND4UCN.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/react-surface/react-surface.tsx", "../../../src/containers/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { Obj } from '@dxos/echo';\nimport { Collection } from '@dxos/echo';\n\nimport { StackContainer } from '../../containers';\nimport { meta } from '../../meta';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(\n Capabilities.ReactSurface,\n Surface.create({\n id: `${meta.id}/article`,\n role: 'article',\n filter: (data): data is { id?: string; subject: Collection.Collection } =>\n Obj.instanceOf(Collection.Collection, data.subject),\n component: ({ role, data }) => {\n // This allows the id to be overridden by the surface for situations where the id of the collection\n // is not the same as the id of what is being represented (e.g., a space with a root collection).\n const id = typeof data.id === 'string' ? data.id : undefined;\n return <StackContainer id={id ?? Obj.getDXN(data.subject).toString()} role={role} subject={data.subject} />;\n },\n }),\n ),\n ),\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const StackContainer: ComponentType<any> = lazy(() => import('./StackContainer'));\n"],
5
- "mappings": ";;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,eAAe;AACxB,SAASC,WAAW;AACpB,SAASC,kBAAkB;;;ACN3B,SAA6BC,YAAY;AAElC,IAAMC,iBAAqCC,KAAK,MAAM,OAAO,+BAAA,CAAA;;;ADSpE,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YACTC,aAAaC,cACbC,QAAQC,OAAO;EACbC,IAAI,GAAGC,KAAKD,EAAE;EACdE,MAAM;EACNC,QAAQ,CAACC,SACPC,IAAIC,WAAWC,WAAWA,YAAYH,KAAKI,OAAO;EACpDC,WAAW,CAAC,EAAEP,MAAME,KAAI,MAAE;AAGxB,UAAMJ,KAAK,OAAOI,KAAKJ,OAAO,WAAWI,KAAKJ,KAAKU;AACnD,WAAO,sBAAA,cAACC,gBAAAA;MAAeX,IAAIA,MAAMK,IAAIO,OAAOR,KAAKI,OAAO,EAAEK,SAAQ;MAAIX;MAAYM,SAASJ,KAAKI;;EAClG;AACF,CAAA,CAAA,CAAA,CAAA;",
6
- "names": ["Effect", "React", "Capabilities", "Capability", "Surface", "Obj", "Collection", "lazy", "StackContainer", "lazy", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactSurface", "Surface", "create", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "Collection", "subject", "component", "undefined", "StackContainer", "getDXN", "toString"]
7
- }
@@ -1,290 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- meta
4
- } from "./chunk-HEEGXPSW.mjs";
5
-
6
- // src/containers/StackContainer/StackContainer.tsx
7
- import { Atom, useAtomValue } from "@effect-atom/atom-react";
8
- import * as Option from "effect/Option";
9
- import React4, { useCallback, useState as useState2 } from "react";
10
- import { useCapabilities, useOperationInvoker } from "@dxos/app-framework/ui";
11
- import { AppCapabilities, LayoutOperation } from "@dxos/app-toolkit";
12
- import { useAppGraph } from "@dxos/app-toolkit/ui";
13
- import { Obj } from "@dxos/echo";
14
- import { AtomObj } from "@dxos/echo-atom";
15
- import { Graph } from "@dxos/plugin-graph";
16
- import { SpaceOperation } from "@dxos/plugin-space/types";
17
- import { Toolbar, toLocalizedString, useTranslation as useTranslation3 } from "@dxos/react-ui";
18
- import { AttentionProvider } from "@dxos/react-ui-attention";
19
- import { Stack, StackItem as StackItem2 } from "@dxos/react-ui-stack";
20
- import { isNonNullable } from "@dxos/util";
21
-
22
- // src/components/StackContext.tsx
23
- import { createContext, useContext } from "react";
24
- var StackContext = /* @__PURE__ */ createContext({
25
- onCollapse: () => {
26
- },
27
- onNavigate: async () => {
28
- },
29
- onDelete: async () => {
30
- },
31
- onAdd: () => {
32
- }
33
- });
34
- var useStack = () => useContext(StackContext);
35
-
36
- // src/components/StackSection.tsx
37
- import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
38
- import React2, { useMemo, useState } from "react";
39
- import { Surface } from "@dxos/app-framework/ui";
40
- import { DropdownMenu, Icon, IconButton, useTranslation } from "@dxos/react-ui";
41
- import { useAttentionAttributes } from "@dxos/react-ui-attention";
42
- import { StackItem } from "@dxos/react-ui-stack";
43
- import { getSize, mx, textBlockWidth } from "@dxos/ui-theme";
44
-
45
- // src/components/CaretDownUp.tsx
46
- import React from "react";
47
- var CaretDownUp = ({ children, ...props }) => {
48
- return /* @__PURE__ */ React.createElement("svg", {
49
- xmlns: "http://www.w3.org/2000/svg",
50
- viewBox: "0 0 256 256",
51
- ...props
52
- }, /* @__PURE__ */ React.createElement("rect", {
53
- width: "256",
54
- height: "256",
55
- fill: "none"
56
- }), /* @__PURE__ */ React.createElement("polyline", {
57
- points: "80 224 128 176 176 224",
58
- fill: "none",
59
- stroke: "currentColor",
60
- strokeLinecap: "round",
61
- strokeLinejoin: "round",
62
- strokeWidth: "16"
63
- }), /* @__PURE__ */ React.createElement("polyline", {
64
- points: "80 32 128 80 176 32",
65
- fill: "none",
66
- stroke: "currentColor",
67
- strokeLinecap: "round",
68
- strokeLinejoin: "round",
69
- strokeWidth: "16"
70
- }), children);
71
- };
72
-
73
- // src/components/StackSection.tsx
74
- var sectionActionDimensions = "p-1 my-1 shrink-0 min-h-0 w-(--dx-rail-action) h-min";
75
- var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--regular" } }) => {
76
- const { t } = useTranslation(meta.id);
77
- const { onNavigate, onAdd, onCollapse, onDelete } = useStack();
78
- const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);
79
- const attentionAttrs = useAttentionAttributes(id);
80
- const stackItem = useMemo(() => ({
81
- id
82
- }), [
83
- id
84
- ]);
85
- return /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Root, {
86
- asChild: true,
87
- open: !view.collapsed,
88
- onOpenChange: (nextOpen) => onCollapse?.(id, !nextOpen)
89
- }, /* @__PURE__ */ React2.createElement(StackItem.Root, {
90
- item: stackItem,
91
- role: "section",
92
- ...attentionAttrs
93
- }, /* @__PURE__ */ React2.createElement(StackItem.Heading, {
94
- classNames: "dx-attention-surface"
95
- }, /* @__PURE__ */ React2.createElement("span", {
96
- className: "sr-only"
97
- }, view.title), /* @__PURE__ */ React2.createElement(StackItem.HeadingStickyContent, null, /* @__PURE__ */ React2.createElement(DropdownMenu.Root, {
98
- open: optionsMenuOpen,
99
- onOpenChange: setOptionsMenuOpen
100
- }, /* @__PURE__ */ React2.createElement(DropdownMenu.Trigger, {
101
- asChild: true
102
- }, /* @__PURE__ */ React2.createElement(StackItem.SigilButton, null, /* @__PURE__ */ React2.createElement(Icon, {
103
- icon,
104
- size: 5,
105
- classNames: "transition-opacity"
106
- }))), /* @__PURE__ */ React2.createElement(DropdownMenu.Portal, null, /* @__PURE__ */ React2.createElement(DropdownMenu.Content, null, /* @__PURE__ */ React2.createElement(DropdownMenu.Viewport, null, view.collapsed ? /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
107
- onClick: () => onNavigate(id),
108
- "data-testid": "section.navigate-to"
109
- }, /* @__PURE__ */ React2.createElement(Icon, {
110
- icon: "ph--arrow-right--regular",
111
- size: 5
112
- }), /* @__PURE__ */ React2.createElement("span", {
113
- className: "ms-2 grow"
114
- }, t("navigate to section label"))) : /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Trigger, {
115
- asChild: true
116
- }, /* @__PURE__ */ React2.createElement(DropdownMenu.Item, null, /* @__PURE__ */ React2.createElement(CaretDownUp, {
117
- className: getSize(5)
118
- }), /* @__PURE__ */ React2.createElement("span", {
119
- className: "ms-2 grow"
120
- }, t("collapse label")))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
121
- onClick: () => onAdd(id, "before"),
122
- "data-testid": "section.add-before"
123
- }, /* @__PURE__ */ React2.createElement(Icon, {
124
- icon: "ph--arrow-line-up--regular",
125
- size: 5
126
- }), /* @__PURE__ */ React2.createElement("span", {
127
- className: "ms-2 grow"
128
- }, t("add section before label"))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
129
- onClick: () => onAdd(id, "after"),
130
- "data-testid": "section.add-after"
131
- }, /* @__PURE__ */ React2.createElement(Icon, {
132
- icon: "ph--arrow-line-down--regular",
133
- size: 5
134
- }), /* @__PURE__ */ React2.createElement("span", {
135
- className: "ms-2 grow"
136
- }, t("add section after label"))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
137
- onClick: () => onDelete(id),
138
- "data-testid": "section.remove"
139
- }, /* @__PURE__ */ React2.createElement(Icon, {
140
- icon: "ph--trash--regular",
141
- size: 5
142
- }), /* @__PURE__ */ React2.createElement("span", {
143
- className: "ms-2 grow"
144
- }, t("remove section label")))), /* @__PURE__ */ React2.createElement(DropdownMenu.Arrow, null)))), view.collapsed ? /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Trigger, {
145
- asChild: true
146
- }, /* @__PURE__ */ React2.createElement(IconButton, {
147
- iconOnly: true,
148
- variant: "ghost",
149
- label: t("expand label"),
150
- icon: "ph--caret-up-down--regular",
151
- classNames: sectionActionDimensions
152
- })) : /* @__PURE__ */ React2.createElement(IconButton, {
153
- iconOnly: true,
154
- variant: "ghost",
155
- onClick: () => onNavigate(id),
156
- label: t("navigate to section label"),
157
- icon: "ph--arrow-right--regular",
158
- "data-testid": "section.navigate-to",
159
- classNames: sectionActionDimensions
160
- }))), /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Content, null, /* @__PURE__ */ React2.createElement(Surface.Surface, {
161
- role: "section",
162
- data: {
163
- subject: object
164
- },
165
- limit: 1,
166
- placeholder: /* @__PURE__ */ React2.createElement(React2.Fragment, null)
167
- })), view.collapsed && /* @__PURE__ */ React2.createElement(StackItem.Content, {
168
- classNames: "dx-attention-surface"
169
- }, /* @__PURE__ */ React2.createElement("h2", {
170
- className: mx("flex items-center p-4 font-medium", textBlockWidth)
171
- }, view.title))));
172
- };
173
-
174
- // src/components/StackSettings.tsx
175
- import React3 from "react";
176
- import { Input, useTranslation as useTranslation2 } from "@dxos/react-ui";
177
- import { Settings } from "@dxos/react-ui-form";
178
-
179
- // src/containers/StackContainer/StackContainer.tsx
180
- var collectionObjectsFamily = Atom.family((collection) => Atom.make((get) => {
181
- const snapshot = get(AtomObj.make(collection));
182
- return snapshot.objects.map((ref) => get(AtomObj.makeWithReactive(ref))).filter(isNonNullable);
183
- }));
184
- var StackContainer = ({ id, subject: collection }) => {
185
- const { invokePromise } = useOperationInvoker();
186
- const { graph } = useAppGraph();
187
- const { t } = useTranslation3(meta.id);
188
- const allMetadata = useCapabilities(AppCapabilities.Metadata);
189
- const [collapsedSections, setCollapsedSections] = useState2({});
190
- const collectionObjects = useAtomValue(collectionObjectsFamily(collection));
191
- const items = collectionObjects.map((object) => {
192
- const metadata = allMetadata.find((m) => m.id === (Obj.getTypename(object) ?? "never"))?.metadata;
193
- const view = {
194
- // ...stack.sections[object.id],
195
- collapsed: collapsedSections[Obj.getDXN(object).toString()],
196
- title: object?.title ?? // TODO(wittjosiah): `getNode` is not reactive.
197
- toLocalizedString(Graph.getNode(graph, Obj.getDXN(object).toString()).pipe(Option.getOrNull)?.properties.label, t)
198
- };
199
- return {
200
- id: Obj.getDXN(object).toString(),
201
- object,
202
- metadata,
203
- view
204
- };
205
- });
206
- const handleDelete = useCallback(async (id2) => {
207
- const index = collection.objects.map((object2) => object2.target).filter(isNonNullable).findIndex((section) => Obj.getDXN(section).toString() === id2);
208
- const object = collection.objects[index].target;
209
- if (Obj.isObject(object)) {
210
- await invokePromise(SpaceOperation.RemoveObjects, {
211
- objects: [
212
- object
213
- ],
214
- target: collection
215
- });
216
- }
217
- }, [
218
- collection,
219
- invokePromise
220
- ]);
221
- const handleAdd = useCallback(async (id2, position) => {
222
- await invokePromise(LayoutOperation.UpdateDialog, {
223
- subject: `${meta.id}/AddSectionDialog`,
224
- blockAlign: "start",
225
- props: {
226
- path: id2,
227
- position,
228
- collection
229
- }
230
- });
231
- }, [
232
- collection,
233
- invokePromise
234
- ]);
235
- const handleNavigate = useCallback(async (id2) => {
236
- await invokePromise(LayoutOperation.Open, {
237
- subject: [
238
- id2
239
- ]
240
- });
241
- }, [
242
- invokePromise
243
- ]);
244
- const handleCollapse = useCallback((id2, collapsed) => setCollapsedSections((prev) => ({
245
- ...prev,
246
- [id2]: collapsed
247
- })), []);
248
- const handleAddSection = useCallback(() => invokePromise(SpaceOperation.OpenCreateObject, {
249
- target: collection,
250
- navigable: false
251
- }), [
252
- collection,
253
- invokePromise
254
- ]);
255
- return /* @__PURE__ */ React4.createElement(StackItem2.Content, {
256
- toolbar: true,
257
- classNames: "dx-article overflow-hidden border-l border-r border-subdued-separator"
258
- }, /* @__PURE__ */ React4.createElement(Toolbar.Root, null, /* @__PURE__ */ React4.createElement(Toolbar.IconButton, {
259
- icon: "ph--plus--regular",
260
- iconOnly: true,
261
- label: "Add section",
262
- "data-testid": "stack.addSection",
263
- onClick: handleAddSection
264
- })), /* @__PURE__ */ React4.createElement(AttentionProvider, {
265
- id
266
- }, /* @__PURE__ */ React4.createElement(StackContext.Provider, {
267
- value: {
268
- onCollapse: handleCollapse,
269
- onNavigate: handleNavigate,
270
- onDelete: handleDelete,
271
- onAdd: handleAdd
272
- }
273
- }, /* @__PURE__ */ React4.createElement(Stack, {
274
- orientation: "vertical",
275
- size: "intrinsic",
276
- id,
277
- "data-testid": "main.stack",
278
- classNames: "overflow-y-auto"
279
- }, items.map((item) => /* @__PURE__ */ React4.createElement(StackSection, {
280
- key: item.id,
281
- ...item
282
- }))))));
283
- };
284
-
285
- // src/containers/StackContainer/index.ts
286
- var StackContainer_default = StackContainer;
287
- export {
288
- StackContainer_default as default
289
- };
290
- //# sourceMappingURL=StackContainer-7XVJHW4D.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/containers/StackContainer/StackContainer.tsx", "../../../src/components/StackContext.tsx", "../../../src/components/StackSection.tsx", "../../../src/components/CaretDownUp.tsx", "../../../src/components/StackSettings.tsx", "../../../src/containers/StackContainer/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Atom, useAtomValue } from '@effect-atom/atom-react';\nimport * as Option from 'effect/Option';\nimport React, { useCallback, useState } from 'react';\n\nimport { useCapabilities, useOperationInvoker } from '@dxos/app-framework/ui';\nimport { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { useAppGraph } from '@dxos/app-toolkit/ui';\nimport { Obj, type Ref } from '@dxos/echo';\nimport { type Collection } from '@dxos/echo';\nimport { AtomObj } from '@dxos/echo-atom';\nimport { Graph } from '@dxos/plugin-graph';\nimport { SpaceOperation } from '@dxos/plugin-space/types';\nimport { Toolbar, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { AttentionProvider } from '@dxos/react-ui-attention';\nimport { Stack, StackItem } from '@dxos/react-ui-stack';\nimport { isNonNullable } from '@dxos/util';\n\nimport { StackContext, StackSection } from '../../components';\nimport { meta } from '../../meta';\nimport {\n type AddSectionPosition,\n type CollapsedSections,\n type StackSectionItem,\n type StackSectionMetadata,\n type StackSectionView,\n} from '../../types';\n\nconst collectionObjectsFamily = Atom.family((collection: Collection.Collection) =>\n Atom.make((get) => {\n const snapshot = get(AtomObj.make(collection));\n return (\n snapshot.objects\n // TODO(wittjosiah): Why isn't this type inferred correctly?\n .map((ref: Ref.Ref<Obj.Unknown>) => get(AtomObj.makeWithReactive(ref)))\n .filter(isNonNullable)\n );\n }),\n);\n\ntype StackContainerProps = SurfaceComponentProps<Collection.Collection> & {\n id: string;\n};\n\nexport const StackContainer = ({ id, subject: collection }: StackContainerProps) => {\n const { invokePromise } = useOperationInvoker();\n const { graph } = useAppGraph();\n const { t } = useTranslation(meta.id);\n const allMetadata = useCapabilities(AppCapabilities.Metadata);\n const [collapsedSections, setCollapsedSections] = useState<CollapsedSections>({});\n\n // TODO(wittjosiah): Re-implement stack views with relations.\n // const defaultStack = useMemo(() => Obj.make(StackViewType, { sections: {} }), [collection]);\n // const stack = (collection.views[StackViewType.typename]?.target as StackViewType | undefined) ?? defaultStack;\n // useEffect(() => {\n // if (!collection.views[StackViewType.typename]) {\n // collection.views[StackViewType.typename] = Ref.make(stack);\n // }\n // }, [collection, stack]);\n\n const collectionObjects = useAtomValue(collectionObjectsFamily(collection));\n const items = collectionObjects.map((object: Obj.Unknown) => {\n const metadata = allMetadata.find((m) => m.id === (Obj.getTypename(object) ?? 'never'))\n ?.metadata as StackSectionMetadata;\n const view = {\n // ...stack.sections[object.id],\n collapsed: collapsedSections[Obj.getDXN(object).toString()],\n title:\n (object as any)?.title ??\n // TODO(wittjosiah): `getNode` is not reactive.\n toLocalizedString(\n Graph.getNode(graph, Obj.getDXN(object).toString()).pipe(Option.getOrNull)?.properties.label,\n t,\n ),\n } as StackSectionView;\n return { id: Obj.getDXN(object).toString(), object, metadata, view } satisfies StackSectionItem;\n });\n\n const handleDelete = useCallback(\n async (id: string) => {\n const index = collection.objects\n .map((object) => object.target)\n .filter(isNonNullable)\n .findIndex((section) => Obj.getDXN(section).toString() === id);\n const object = collection.objects[index].target;\n if (Obj.isObject(object)) {\n await invokePromise(SpaceOperation.RemoveObjects, {\n objects: [object],\n target: collection,\n });\n\n // TODO(wittjosiah): The section should also be removed, but needs to be restored if the action is undone.\n // delete stack.sections[Path.last(path)];\n }\n },\n [collection, invokePromise],\n );\n\n const handleAdd = useCallback(\n async (id: string, position: AddSectionPosition) => {\n // TODO(wittjosiah): Use object creation dialog.\n await invokePromise(LayoutOperation.UpdateDialog, {\n subject: `${meta.id}/AddSectionDialog`,\n blockAlign: 'start',\n props: {\n path: id,\n position,\n collection,\n },\n });\n },\n [collection, invokePromise],\n );\n\n const handleNavigate = useCallback(\n async (id: string) => {\n await invokePromise(LayoutOperation.Open, { subject: [id] });\n },\n [invokePromise],\n );\n\n const handleCollapse = useCallback(\n (id: string, collapsed: boolean) => setCollapsedSections((prev) => ({ ...prev, [id]: collapsed })),\n [],\n );\n\n const handleAddSection = useCallback(\n () =>\n invokePromise(SpaceOperation.OpenCreateObject, {\n target: collection,\n navigable: false,\n }),\n [collection, invokePromise],\n );\n\n return (\n <StackItem.Content toolbar classNames='dx-article overflow-hidden border-l border-r border-subdued-separator'>\n <Toolbar.Root>\n <Toolbar.IconButton\n icon='ph--plus--regular'\n iconOnly\n label='Add section'\n data-testid='stack.addSection'\n onClick={handleAddSection}\n />\n </Toolbar.Root>\n <AttentionProvider id={id}>\n <StackContext.Provider\n value={{\n onCollapse: handleCollapse,\n onNavigate: handleNavigate,\n onDelete: handleDelete,\n onAdd: handleAdd,\n }}\n >\n <Stack orientation='vertical' size='intrinsic' id={id} data-testid='main.stack' classNames='overflow-y-auto'>\n {items.map((item) => (\n <StackSection key={item.id} {...item} />\n ))}\n </Stack>\n </StackContext.Provider>\n </AttentionProvider>\n </StackItem.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { createContext, useContext } from 'react';\n\nimport { type AddSectionPosition } from '../types';\n\nexport type StackContextValue = {\n onCollapse: (id: string, collapsed: boolean) => void;\n onNavigate: (id: string) => Promise<void>;\n onDelete: (id: string) => Promise<void>;\n onAdd: (id: string, position: AddSectionPosition) => void;\n};\n\nexport const StackContext = createContext<StackContextValue>({\n onCollapse: () => {},\n onNavigate: async () => {},\n onDelete: async () => {},\n onAdd: () => {},\n});\n\nexport const useStack = () => useContext(StackContext);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as CollapsiblePrimitive from '@radix-ui/react-collapsible';\nimport React, { useMemo, useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework/ui';\nimport { DropdownMenu, Icon, IconButton, useTranslation } from '@dxos/react-ui';\nimport { useAttentionAttributes } from '@dxos/react-ui-attention';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { getSize, mx, textBlockWidth } from '@dxos/ui-theme';\n\nimport { meta } from '../meta';\nimport { type StackSectionItem } from '../types';\n\nimport { CaretDownUp } from './CaretDownUp';\nimport { useStack } from './StackContext';\n\nconst sectionActionDimensions = 'p-1 my-1 shrink-0 min-h-0 w-(--dx-rail-action) h-min';\n\nexport type StackSectionProps = StackSectionItem;\n\nexport const StackSection = ({\n id,\n view,\n object,\n metadata: { icon = 'ph--placeholder--regular' },\n}: StackSectionProps) => {\n const { t } = useTranslation(meta.id);\n const { onNavigate, onAdd, onCollapse, onDelete } = useStack();\n const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);\n const attentionAttrs = useAttentionAttributes(id);\n const stackItem = useMemo(() => ({ id }), [id]);\n\n return (\n <CollapsiblePrimitive.Root asChild open={!view.collapsed} onOpenChange={(nextOpen) => onCollapse?.(id, !nextOpen)}>\n <StackItem.Root item={stackItem} role='section' {...attentionAttrs}>\n <StackItem.Heading classNames='dx-attention-surface'>\n <span className='sr-only'>{view.title}</span>\n <StackItem.HeadingStickyContent>\n <DropdownMenu.Root\n {...{\n open: optionsMenuOpen,\n onOpenChange: setOptionsMenuOpen,\n }}\n >\n <DropdownMenu.Trigger asChild>\n <StackItem.SigilButton>\n <Icon icon={icon} size={5} classNames='transition-opacity' />\n </StackItem.SigilButton>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content>\n <DropdownMenu.Viewport>\n {view.collapsed ? (\n <DropdownMenu.Item onClick={() => onNavigate(id)} data-testid='section.navigate-to'>\n <Icon icon='ph--arrow-right--regular' size={5} />\n <span className='ms-2 grow'>{t('navigate to section label')}</span>\n </DropdownMenu.Item>\n ) : (\n <CollapsiblePrimitive.Trigger asChild>\n <DropdownMenu.Item>\n <CaretDownUp className={getSize(5)} />\n <span className='ms-2 grow'>{t('collapse label')}</span>\n </DropdownMenu.Item>\n </CollapsiblePrimitive.Trigger>\n )}\n <DropdownMenu.Item onClick={() => onAdd(id, 'before')} data-testid='section.add-before'>\n <Icon icon='ph--arrow-line-up--regular' size={5} />\n <span className='ms-2 grow'>{t('add section before label')}</span>\n </DropdownMenu.Item>\n <DropdownMenu.Item onClick={() => onAdd(id, 'after')} data-testid='section.add-after'>\n <Icon icon='ph--arrow-line-down--regular' size={5} />\n <span className='ms-2 grow'>{t('add section after label')}</span>\n </DropdownMenu.Item>\n <DropdownMenu.Item onClick={() => onDelete(id)} data-testid='section.remove'>\n <Icon icon='ph--trash--regular' size={5} />\n <span className='ms-2 grow'>{t('remove section label')}</span>\n </DropdownMenu.Item>\n </DropdownMenu.Viewport>\n <DropdownMenu.Arrow />\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n {view.collapsed ? (\n <CollapsiblePrimitive.Trigger asChild>\n <IconButton\n iconOnly\n variant='ghost'\n label={t('expand label')}\n icon='ph--caret-up-down--regular'\n classNames={sectionActionDimensions}\n />\n </CollapsiblePrimitive.Trigger>\n ) : (\n <IconButton\n iconOnly\n variant='ghost'\n onClick={() => onNavigate(id)}\n label={t('navigate to section label')}\n icon='ph--arrow-right--regular'\n data-testid='section.navigate-to'\n classNames={sectionActionDimensions}\n />\n )}\n </StackItem.HeadingStickyContent>\n </StackItem.Heading>\n <CollapsiblePrimitive.Content>\n <Surface.Surface role='section' data={{ subject: object }} limit={1} placeholder={<></>} />\n </CollapsiblePrimitive.Content>\n {view.collapsed && (\n <StackItem.Content classNames='dx-attention-surface'>\n <h2 className={mx('flex items-center p-4 font-medium', textBlockWidth)}>{view.title}</h2>\n </StackItem.Content>\n )}\n </StackItem.Root>\n </CollapsiblePrimitive.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type ComponentPropsWithoutRef } from 'react';\n\nexport const CaretDownUp = ({ children, ...props }: ComponentPropsWithoutRef<'svg'>) => {\n return (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' {...props}>\n <rect width='256' height='256' fill='none' />\n <polyline\n points='80 224 128 176 176 224'\n fill='none'\n stroke='currentColor'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='16'\n />\n <polyline\n points='80 32 128 80 176 32'\n fill='none'\n stroke='currentColor'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='16'\n />\n {children}\n </svg>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Input, useTranslation } from '@dxos/react-ui';\nimport { Settings } from '@dxos/react-ui-form';\n\nimport { meta } from '../meta';\nimport { type StackSettingsProps } from '../types';\n\nexport const StackSettings = ({ settings }: { settings: StackSettingsProps }) => {\n const { t } = useTranslation(meta.id);\n\n return (\n <Settings.Root>\n <Settings.Section title={t('settings title', { ns: meta.id })}>\n <Settings.Group>\n <Settings.ItemInput title={t('settings separation label')}>\n <Input.Switch\n checked={settings.separation}\n onCheckedChange={(checked) => (settings.separation = !!checked)}\n />\n </Settings.ItemInput>\n </Settings.Group>\n </Settings.Section>\n </Settings.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { StackContainer } from './StackContainer';\n\nexport default StackContainer;\n"],
5
- "mappings": ";;;;;;AAIA,SAASA,MAAMC,oBAAoB;AACnC,YAAYC,YAAY;AACxB,OAAOC,UAASC,aAAaC,YAAAA,iBAAgB;AAE7C,SAASC,iBAAiBC,2BAA2B;AACrD,SAASC,iBAAiBC,uBAAuB;AAEjD,SAASC,mBAAmB;AAC5B,SAASC,WAAqB;AAE9B,SAASC,eAAe;AACxB,SAASC,aAAa;AACtB,SAASC,sBAAsB;AAC/B,SAASC,SAASC,mBAAmBC,kBAAAA,uBAAsB;AAC3D,SAASC,yBAAyB;AAClC,SAASC,OAAOC,aAAAA,kBAAiB;AACjC,SAASC,qBAAqB;;;AChB9B,SAASC,eAAeC,kBAAkB;AAWnC,IAAMC,eAAeC,8BAAiC;EAC3DC,YAAY,MAAA;EAAO;EACnBC,YAAY,YAAA;EAAa;EACzBC,UAAU,YAAA;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c0C,eAAec,kBAAkB;IAC7ClB,QAAQpD;IACRuE,WAAW;EACb,CAAA,GACF;IAACvE;IAAYc;GAAc;AAG7B,SACE,gBAAA0D,OAAA,cAACC,WAAUC,SAAO;IAACC,SAAAA;IAAQC,YAAW;KACpC,gBAAAJ,OAAA,cAACK,QAAQC,MAAI,MACX,gBAAAN,OAAA,cAACK,QAAQE,YAAU;IACjBC,MAAK;IACLC,UAAAA;IACAjC,OAAM;IACNkC,eAAY;IACZC,SAASd;OAGb,gBAAAG,OAAA,cAACY,mBAAAA;IAAkBxE;KACjB,gBAAA4D,OAAA,cAACa,aAAaC,UAAQ;IACpBC,OAAO;MACLC,YAAYrB;MACZsB,YAAYxB;MACZyB,UAAUzC;MACV0C,OAAOjC;IACT;KAEA,gBAAAc,OAAA,cAACoB,OAAAA;IAAMC,aAAY;IAAWC,MAAK;IAAYlF;IAAQsE,eAAY;IAAaN,YAAW;KACxF9C,MAAMxB,IAAI,CAACyF,SACV,gBAAAvB,OAAA,cAACwB,cAAAA;IAAaC,KAAKF,KAAKnF;IAAK,GAAGmF;;AAO9C;;;AKlKA,IAAA,yBAAeG;",
6
- "names": ["Atom", "useAtomValue", "Option", "React", "useCallback", "useState", "useCapabilities", "useOperationInvoker", "AppCapabilities", "LayoutOperation", "useAppGraph", "Obj", "AtomObj", "Graph", "SpaceOperation", "Toolbar", "toLocalizedString", "useTranslation", "AttentionProvider", "Stack", "StackItem", "isNonNullable", "createContext", "useContext", "StackContext", "createContext", "onCollapse", "onNavigate", "onDelete", "onAdd", "useStack", "useContext", "CollapsiblePrimitive", "React", "useMemo", "useState", "Surface", "DropdownMenu", "Icon", "IconButton", "useTranslation", "useAttentionAttributes", "StackItem", "getSize", "mx", "textBlockWidth", "React", "CaretDownUp", "children", "props", "svg", "xmlns", "viewBox", "rect", "width", "height", "fill", "polyline", "points", "stroke", "strokeLinecap", "strokeLinejoin", "strokeWidth", "sectionActionDimensions", "StackSection", "id", "view", "object", "metadata", "icon", "t", "useTranslation", "meta", "onNavigate", "onAdd", "onCollapse", "onDelete", "useStack", "optionsMenuOpen", "setOptionsMenuOpen", "useState", "attentionAttrs", "useAttentionAttributes", "stackItem", "useMemo", "React", "Root", "asChild", "open", "collapsed", "onOpenChange", "nextOpen", "StackItem", "item", "role", "Heading", "classNames", "span", "className", "title", "HeadingStickyContent", "DropdownMenu", "Trigger", "SigilButton", "Icon", "size", "Portal", "Content", "Viewport", "Item", "onClick", "data-testid", "CaretDownUp", "getSize", "Arrow", "IconButton", "iconOnly", "variant", "label", "Surface", "data", "subject", "limit", "placeholder", "h2", "mx", "textBlockWidth", "React", "Input", "useTranslation", "Settings", "collectionObjectsFamily", "Atom", "family", "collection", "make", "get", "snapshot", "AtomObj", "objects", "map", "ref", "makeWithReactive", "filter", "isNonNullable", "StackContainer", "id", "subject", "invokePromise", "useOperationInvoker", "graph", "useAppGraph", "t", "useTranslation", "meta", "allMetadata", "useCapabilities", "AppCapabilities", "Metadata", "collapsedSections", "setCollapsedSections", "useState", "collectionObjects", "useAtomValue", "items", "object", "metadata", "find", "m", "Obj", "getTypename", "view", "collapsed", "getDXN", "toString", "title", "toLocalizedString", "Graph", "getNode", "pipe", "getOrNull", "properties", "label", "handleDelete", "useCallback", "index", "target", "findIndex", "section", "isObject", "SpaceOperation", "RemoveObjects", "handleAdd", "position", "LayoutOperation", "UpdateDialog", "blockAlign", "props", "path", "handleNavigate", "Open", "handleCollapse", "prev", "handleAddSection", "OpenCreateObject", "navigable", "React", "StackItem", "Content", "toolbar", "classNames", "Toolbar", "Root", "IconButton", "icon", "iconOnly", "data-testid", "onClick", "AttentionProvider", "StackContext", "Provider", "value", "onCollapse", "onNavigate", "onDelete", "onAdd", "Stack", "orientation", "size", "item", "StackSection", "key", "StackContainer"]
7
- }
@@ -1,29 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
-
3
- // src/types/stack.ts
4
- import * as Schema from "effect/Schema";
5
- import { Type } from "@dxos/echo";
6
- var SectionSchema = Schema.Struct({
7
- height: Schema.optional(Schema.Number),
8
- // Space for data that isn't stack-specific but is specific to this view instance.
9
- // e.g. cover/fill for an image
10
- custom: Schema.optional(Schema.Record({
11
- key: Schema.String,
12
- value: Schema.Any
13
- }))
14
- });
15
- var StackViewType = Schema.Struct({
16
- sections: Schema.Record({
17
- key: Schema.String,
18
- value: SectionSchema
19
- })
20
- }).pipe(Type.object({
21
- typename: "dxos.org/type/StackView",
22
- version: "0.1.0"
23
- }));
24
-
25
- export {
26
- SectionSchema,
27
- StackViewType
28
- };
29
- //# sourceMappingURL=chunk-26XWE7UY.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/stack.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Type } from '@dxos/echo';\n\n// All section metadata needs to be optional/have defaults.\n// Any objects added to the collection will start with the section defaults.\n// If an object is removed from the collection without removing the section metadata this is fine.\n// Stack components should clean-up the superfluous data on future edits.\n\nexport const SectionSchema = Schema.Struct({\n height: Schema.optional(Schema.Number),\n // Space for data that isn't stack-specific but is specific to this view instance.\n // e.g. cover/fill for an image\n custom: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n});\n\n// TODO(wittjosiah): This needs a relation to be connected to a stack.\nexport const StackViewType = Schema.Struct({\n sections: Schema.Record({ key: Schema.String, value: SectionSchema }),\n}).pipe(\n Type.object({\n typename: 'dxos.org/type/StackView',\n version: '0.1.0',\n }),\n);\n\nexport interface StackViewType extends Schema.Schema.Type<typeof StackViewType> {}\n"],
5
- "mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAY;AAOd,IAAMC,gBAAuBC,cAAO;EACzCC,QAAeC,gBAAgBC,aAAM;;;EAGrCC,QAAeF,gBAAgBG,cAAO;IAAEC,KAAYC;IAAQC,OAAcC;EAAI,CAAA,CAAA;AAChF,CAAA;AAGO,IAAMC,gBAAuBV,cAAO;EACzCW,UAAiBN,cAAO;IAAEC,KAAYC;IAAQC,OAAOT;EAAc,CAAA;AACrE,CAAA,EAAGa,KACDC,KAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,CAAA;",
6
- "names": ["Schema", "Type", "SectionSchema", "Struct", "height", "optional", "Number", "custom", "Record", "key", "String", "value", "Any", "StackViewType", "sections", "pipe", "Type", "object", "typename", "version"]
7
- }
@@ -1,23 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
-
3
- // src/meta.ts
4
- import { trim } from "@dxos/util";
5
- var SECTION_IDENTIFIER = "dxos.org/type/StackSection";
6
- var meta = {
7
- id: "dxos.org/plugin/stack",
8
- // TODO(wittjosiah): Prevents "stacks" language from being exposed to users in settings panel.
9
- // Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.
10
- name: "Collections",
11
- description: trim`
12
- Organize and view curated collections of workspace objects in customizable layouts.
13
- Group related items together and manage collections with sections and filtering.
14
- `,
15
- icon: "ph--stack-simple--regular",
16
- source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack"
17
- };
18
-
19
- export {
20
- SECTION_IDENTIFIER,
21
- meta
22
- };
23
- //# sourceMappingURL=chunk-HEEGXPSW.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const SECTION_IDENTIFIER = 'dxos.org/type/StackSection';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/stack',\n // TODO(wittjosiah): Prevents \"stacks\" language from being exposed to users in settings panel.\n // Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.\n name: 'Collections',\n description: trim`\n Organize and view curated collections of workspace objects in customizable layouts.\n Group related items together and manage collections with sections and filtering.\n `,\n icon: 'ph--stack-simple--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack',\n};\n"],
5
- "mappings": ";;;AAKA,SAASA,YAAY;AAEd,IAAMC,qBAAqB;AAE3B,IAAMC,OAAoB;EAC/BC,IAAI;;;EAGJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,QAAQ;AACV;",
6
- "names": ["trim", "SECTION_IDENTIFIER", "meta", "id", "name", "description", "trim", "icon", "source"]
7
- }
@@ -1,85 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- StackViewType
4
- } from "./chunk-26XWE7UY.mjs";
5
- import {
6
- SECTION_IDENTIFIER,
7
- meta
8
- } from "./chunk-HEEGXPSW.mjs";
9
-
10
- // src/StackPlugin.ts
11
- import { Plugin } from "@dxos/app-framework";
12
- import { AppPlugin } from "@dxos/app-toolkit";
13
-
14
- // src/capabilities/react-surface/index.ts
15
- import { Capability } from "@dxos/app-framework";
16
- var ReactSurface = Capability.lazy("ReactSurface", () => import("./react-surface-SZETVRAZ.mjs"));
17
-
18
- // src/translations.ts
19
- import { translations as stackTranslations } from "@dxos/react-ui-stack";
20
- var translations = [
21
- {
22
- "en-US": {
23
- [meta.id]: {
24
- "plugin name": "Stacks",
25
- "settings title": "Stack plugin settings",
26
- "settings separation label": "Separate sections",
27
- "add section beforeAll dialog title": "Add a section to the start",
28
- "add section afterAll dialog title": "Add a section to the end",
29
- "add section before dialog title": "Add a section",
30
- "add section after dialog title": "Add a section",
31
- "add section input placeholder": "Find the type of section to add",
32
- "upload file label": "Add file",
33
- "add section label": "Add section",
34
- "empty stack message": "Drag objects into the stack.",
35
- "remove section label": "Delete",
36
- "navigate to section label": "Navigate to object",
37
- "untitled section title": "Untitled section",
38
- "add section before label": "Add before",
39
- "add section after label": "Add after",
40
- "expand label": "Expand",
41
- "collapse label": "Collapse",
42
- "open chat thread label": "Open chat thread",
43
- "drag handle label": "Press space or enter to begin dragging this object."
44
- }
45
- }
46
- },
47
- ...stackTranslations
48
- ];
49
-
50
- // src/StackPlugin.ts
51
- var StackPlugin = Plugin.define(meta).pipe(AppPlugin.addMetadataModule({
52
- metadata: {
53
- id: SECTION_IDENTIFIER,
54
- metadata: {
55
- parse: (section, type) => {
56
- switch (type) {
57
- case "node":
58
- return {
59
- id: section.object.id,
60
- label: section.object.title,
61
- data: section.object
62
- };
63
- case "object":
64
- return section.object;
65
- case "view-object":
66
- return section;
67
- }
68
- }
69
- }
70
- }
71
- }), AppPlugin.addSchemaModule({
72
- schema: [
73
- StackViewType
74
- ]
75
- }), AppPlugin.addSurfaceModule({
76
- activate: ReactSurface
77
- }), AppPlugin.addTranslationsModule({
78
- translations
79
- }), Plugin.make);
80
- export {
81
- SECTION_IDENTIFIER,
82
- StackPlugin,
83
- meta
84
- };
85
- //# sourceMappingURL=index.mjs.map