@dxos/app-framework 0.3.9-main.58adff6 → 0.3.9-main.ee9a520

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 (28) hide show
  1. package/dist/lib/browser/{chunk-WDA7VA54.mjs → chunk-MNFAM2GF.mjs} +1 -1
  2. package/dist/lib/browser/{chunk-WDA7VA54.mjs.map → chunk-MNFAM2GF.mjs.map} +2 -2
  3. package/dist/lib/browser/index.mjs +33 -7
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/{plugin-XEJ5RYCP.mjs → plugin-JDIMDLDU.mjs} +2 -2
  7. package/dist/lib/node/{chunk-YDKX45O3.cjs → chunk-DC3GU6QR.cjs} +4 -4
  8. package/dist/lib/node/chunk-DC3GU6QR.cjs.map +7 -0
  9. package/dist/lib/node/index.cjs +38 -13
  10. package/dist/lib/node/index.cjs.map +4 -4
  11. package/dist/lib/node/meta.json +1 -1
  12. package/dist/lib/node/{plugin-RCAOZKNL.cjs → plugin-JGSJGRMS.cjs} +8 -8
  13. package/dist/types/src/plugins/SurfacePlugin/Surface.d.ts +2 -0
  14. package/dist/types/src/plugins/SurfacePlugin/Surface.d.ts.map +1 -1
  15. package/dist/types/src/plugins/SurfacePlugin/SurfaceRootContext.d.ts +10 -2
  16. package/dist/types/src/plugins/SurfacePlugin/SurfaceRootContext.d.ts.map +1 -1
  17. package/dist/types/src/plugins/SurfacePlugin/helpers.d.ts +21 -0
  18. package/dist/types/src/plugins/SurfacePlugin/helpers.d.ts.map +1 -0
  19. package/dist/types/src/plugins/SurfacePlugin/index.d.ts +1 -0
  20. package/dist/types/src/plugins/SurfacePlugin/index.d.ts.map +1 -1
  21. package/package.json +7 -7
  22. package/src/plugins/SurfacePlugin/Surface.tsx +34 -5
  23. package/src/plugins/SurfacePlugin/SurfaceRootContext.tsx +15 -2
  24. package/src/plugins/SurfacePlugin/helpers.ts +22 -0
  25. package/src/plugins/SurfacePlugin/index.ts +1 -0
  26. package/dist/lib/node/chunk-YDKX45O3.cjs.map +0 -7
  27. /package/dist/lib/browser/{plugin-XEJ5RYCP.mjs.map → plugin-JDIMDLDU.mjs.map} +0 -0
  28. /package/dist/lib/node/{plugin-RCAOZKNL.cjs.map → plugin-JGSJGRMS.cjs.map} +0 -0
@@ -2,6 +2,7 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
+ export * from './helpers';
5
6
  export * from './provides';
6
7
 
7
8
  export * from './ErrorBoundary';
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/plugins/SurfacePlugin/provides.ts", "../../../src/plugins/SurfacePlugin/SurfaceRootContext.tsx", "../../../src/plugins/SurfacePlugin/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type SurfaceComponent, type SurfaceRootContext } from './SurfaceRootContext';\nimport { type Plugin } from '../PluginHost';\n\nexport type SurfaceProvides = {\n surface: {\n /**\n * Used by the `Surface` resolver to find a component to render.\n */\n component: SurfaceComponent;\n };\n};\n\nexport type SurfacePluginProvides = {\n surface: SurfaceRootContext;\n};\n\nexport const parseRootSurfacePlugin = (plugin?: Plugin) =>\n (plugin?.provides as any)?.surface?.components ? (plugin as Plugin<SurfacePluginProvides>) : undefined;\n\nexport const parseSurfacePlugin = (plugin?: Plugin) =>\n (plugin?.provides as any)?.surface?.component ? (plugin as Plugin<SurfaceProvides>) : undefined;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { createContext, useContext, type Context, type Provider, type ReactNode, type ForwardedRef } from 'react';\n\nimport { type SurfaceProps } from './Surface';\n\n// TODO(wittjosiah): Factor out.\ntype WithRequiredProperty<Type, Key extends keyof Type> = Type & {\n [Property in Key]-?: Type[Property];\n};\n\ntype SurfaceComponentProps = WithRequiredProperty<SurfaceProps, 'data'>;\n\n/**\n * Function which resolves a Surface.\n *\n * If a null value is returned, the rendering is deferred to other plugins.\n */\nexport type SurfaceComponent = (props: SurfaceComponentProps, forwardedRef: ForwardedRef<HTMLElement>) => ReactNode;\n\nexport type SurfaceRootContext = {\n components: Record<string, SurfaceComponent>;\n};\n\nconst SurfaceRootContext: Context<SurfaceRootContext> = createContext<SurfaceRootContext>({ components: {} });\n\nexport const useSurface = () => useContext(SurfaceRootContext);\n\nexport const SurfaceProvider: Provider<SurfaceRootContext> = SurfaceRootContext.Provider;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nconst SurfaceMeta = {\n id: 'dxos.org/plugin/surface',\n};\n\nexport default SurfaceMeta;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;ACIA,mBAA0G;ADgBnG,IAAMA,yBAAyB,CAACC,WACpCA,QAAQC,UAAkBC,SAASC,aAAcH,SAA2CI;AAExF,IAAMC,qBAAqB,CAACL,WAChCA,QAAQC,UAAkBC,SAASI,YAAaN,SAAqCI;ACExF,IAAMG,qBAAkDC,gDAAkC;EAAEL,YAAY,CAAC;AAAE,CAAA;AAEpG,IAAMM,aAAa,UAAMC,yBAAWH,kBAAAA;AAEpC,IAAMI,kBAAgDJ,mBAAmBK;AC1BhF,IAAMC,cAAc;EAClBC,IAAI;AACN;AAEA,IAAA,eAAeD;",
6
- "names": ["parseRootSurfacePlugin", "plugin", "provides", "surface", "components", "undefined", "parseSurfacePlugin", "component", "SurfaceRootContext", "createContext", "useSurface", "useContext", "SurfaceProvider", "Provider", "SurfaceMeta", "id"]
7
- }