@dxos/plugin-presenter 0.6.8-main.046e6cf

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 (97) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +3 -0
  3. package/dist/lib/browser/MarkdownSlide-RIKDY66R.mjs +313 -0
  4. package/dist/lib/browser/MarkdownSlide-RIKDY66R.mjs.map +7 -0
  5. package/dist/lib/browser/PresenterMain-J5Y5ND2S.mjs +228 -0
  6. package/dist/lib/browser/PresenterMain-J5Y5ND2S.mjs.map +7 -0
  7. package/dist/lib/browser/RevealMain-3KPVP35M.mjs +170 -0
  8. package/dist/lib/browser/RevealMain-3KPVP35M.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-KWRWOGSM.mjs +20 -0
  10. package/dist/lib/browser/chunk-KWRWOGSM.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-XDACGTXJ.mjs +18 -0
  12. package/dist/lib/browser/chunk-XDACGTXJ.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +216 -0
  14. package/dist/lib/browser/index.mjs.map +7 -0
  15. package/dist/lib/browser/meta.json +1 -0
  16. package/dist/lib/browser/meta.mjs +9 -0
  17. package/dist/lib/browser/meta.mjs.map +7 -0
  18. package/dist/types/src/PresenterPlugin.d.ts +4 -0
  19. package/dist/types/src/PresenterPlugin.d.ts.map +1 -0
  20. package/dist/types/src/components/Markdown/Container.d.ts +8 -0
  21. package/dist/types/src/components/Markdown/Container.d.ts.map +1 -0
  22. package/dist/types/src/components/Markdown/Container.stories.d.ts +34 -0
  23. package/dist/types/src/components/Markdown/Container.stories.d.ts.map +1 -0
  24. package/dist/types/src/components/Markdown/Slide.d.ts +10 -0
  25. package/dist/types/src/components/Markdown/Slide.d.ts.map +1 -0
  26. package/dist/types/src/components/Markdown/Slide.stories.d.ts +15 -0
  27. package/dist/types/src/components/Markdown/Slide.stories.d.ts.map +1 -0
  28. package/dist/types/src/components/Markdown/index.d.ts +3 -0
  29. package/dist/types/src/components/Markdown/index.d.ts.map +1 -0
  30. package/dist/types/src/components/Markdown/theme.d.ts +16 -0
  31. package/dist/types/src/components/Markdown/theme.d.ts.map +1 -0
  32. package/dist/types/src/components/MarkdownSlide.d.ts +7 -0
  33. package/dist/types/src/components/MarkdownSlide.d.ts.map +1 -0
  34. package/dist/types/src/components/Presenter/Layout.d.ts +11 -0
  35. package/dist/types/src/components/Presenter/Layout.d.ts.map +1 -0
  36. package/dist/types/src/components/Presenter/Pager.d.ts +19 -0
  37. package/dist/types/src/components/Presenter/Pager.d.ts.map +1 -0
  38. package/dist/types/src/components/Presenter/Pager.stories.d.ts +14 -0
  39. package/dist/types/src/components/Presenter/Pager.stories.d.ts.map +1 -0
  40. package/dist/types/src/components/Presenter/index.d.ts +3 -0
  41. package/dist/types/src/components/Presenter/index.d.ts.map +1 -0
  42. package/dist/types/src/components/PresenterMain.d.ts +7 -0
  43. package/dist/types/src/components/PresenterMain.d.ts.map +1 -0
  44. package/dist/types/src/components/PresenterSettings.d.ts +6 -0
  45. package/dist/types/src/components/PresenterSettings.d.ts.map +1 -0
  46. package/dist/types/src/components/Reveal/Reveal.d.ts +10 -0
  47. package/dist/types/src/components/Reveal/Reveal.d.ts.map +1 -0
  48. package/dist/types/src/components/Reveal/index.d.ts +2 -0
  49. package/dist/types/src/components/Reveal/index.d.ts.map +1 -0
  50. package/dist/types/src/components/Reveal.stories.d.ts +9 -0
  51. package/dist/types/src/components/Reveal.stories.d.ts.map +1 -0
  52. package/dist/types/src/components/RevealMain.d.ts +7 -0
  53. package/dist/types/src/components/RevealMain.d.ts.map +1 -0
  54. package/dist/types/src/components/index.d.ts +12 -0
  55. package/dist/types/src/components/index.d.ts.map +1 -0
  56. package/dist/types/src/hooks/index.d.ts +2 -0
  57. package/dist/types/src/hooks/index.d.ts.map +1 -0
  58. package/dist/types/src/hooks/useControlledValue.d.ts +3 -0
  59. package/dist/types/src/hooks/useControlledValue.d.ts.map +1 -0
  60. package/dist/types/src/index.d.ts +5 -0
  61. package/dist/types/src/index.d.ts.map +1 -0
  62. package/dist/types/src/meta.d.ts +15 -0
  63. package/dist/types/src/meta.d.ts.map +1 -0
  64. package/dist/types/src/testing.d.ts +10 -0
  65. package/dist/types/src/testing.d.ts.map +1 -0
  66. package/dist/types/src/translations.d.ts +11 -0
  67. package/dist/types/src/translations.d.ts.map +1 -0
  68. package/dist/types/src/types.d.ts +14 -0
  69. package/dist/types/src/types.d.ts.map +1 -0
  70. package/package.json +80 -0
  71. package/src/PresenterPlugin.tsx +158 -0
  72. package/src/components/Markdown/Container.stories.tsx +54 -0
  73. package/src/components/Markdown/Container.tsx +81 -0
  74. package/src/components/Markdown/Slide.stories.tsx +22 -0
  75. package/src/components/Markdown/Slide.tsx +218 -0
  76. package/src/components/Markdown/index.ts +6 -0
  77. package/src/components/Markdown/theme.ts +26 -0
  78. package/src/components/MarkdownSlide.tsx +24 -0
  79. package/src/components/Presenter/Layout.tsx +33 -0
  80. package/src/components/Presenter/Pager.stories.tsx +32 -0
  81. package/src/components/Presenter/Pager.tsx +124 -0
  82. package/src/components/Presenter/index.ts +6 -0
  83. package/src/components/PresenterMain.tsx +85 -0
  84. package/src/components/PresenterSettings.tsx +26 -0
  85. package/src/components/Reveal/Reveal.tsx +136 -0
  86. package/src/components/Reveal/index.ts +5 -0
  87. package/src/components/Reveal.stories.tsx +32 -0
  88. package/src/components/RevealMain.tsx +49 -0
  89. package/src/components/index.ts +12 -0
  90. package/src/hooks/index.ts +5 -0
  91. package/src/hooks/useControlledValue.ts +14 -0
  92. package/src/index.ts +11 -0
  93. package/src/meta.tsx +18 -0
  94. package/src/testing.ts +48 -0
  95. package/src/translations.ts +17 -0
  96. package/src/types.ts +39 -0
  97. package/src/typings.d.ts +15 -0
@@ -0,0 +1,34 @@
1
+ import '@dxosTheme';
2
+ import React from 'react';
3
+ declare const _default: {
4
+ title: string;
5
+ render: React.FC<{
6
+ content: string;
7
+ }>;
8
+ decorators: import("@storybook/react/*").Decorator[];
9
+ parameters: {
10
+ layout: string;
11
+ };
12
+ };
13
+ export default _default;
14
+ export declare const Default: {
15
+ args: {
16
+ content: string;
17
+ };
18
+ };
19
+ export declare const Code: {
20
+ args: {
21
+ content: string;
22
+ };
23
+ };
24
+ export declare const List: {
25
+ args: {
26
+ content: string;
27
+ };
28
+ };
29
+ export declare const Ordered: {
30
+ args: {
31
+ content: string;
32
+ };
33
+ };
34
+ //# sourceMappingURL=Container.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Container.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Markdown/Container.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAkB,MAAM,OAAO,CAAC;;;;iBAQZ,MAAM;;;;;;;AAQjC,wBAOE;AAEF,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAEF,eAAO,MAAM,IAAI;;;;CAIhB,CAAC;AAEF,eAAO,MAAM,IAAI;;;;CAIhB,CAAC;AAEF,eAAO,MAAM,OAAO;;;;CAInB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import 'highlight.js/styles/github.css';
3
+ export type SlideProps = {
4
+ content?: string;
5
+ classes?: {
6
+ [selector: string]: string;
7
+ };
8
+ };
9
+ export declare const Slide: ({ content, classes }: SlideProps) => React.JSX.Element;
10
+ //# sourceMappingURL=Slide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Slide.d.ts","sourceRoot":"","sources":["../../../../../src/components/Markdown/Slide.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,gCAAgC,CAAC;AAIxC,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,KAAK,yBAA6C,UAAU,sBAwIxE,CAAC"}
@@ -0,0 +1,15 @@
1
+ import '@dxosTheme';
2
+ declare const _default: {
3
+ title: string;
4
+ component: ({ content, classes }: import("./Slide").SlideProps) => import("react").JSX.Element;
5
+ parameters: {
6
+ layout: string;
7
+ };
8
+ };
9
+ export default _default;
10
+ export declare const Default: {
11
+ args: {
12
+ content: string;
13
+ };
14
+ };
15
+ //# sourceMappingURL=Slide.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Slide.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Markdown/Slide.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;;;;;;;;AAKpB,wBAME;AAEF,eAAO,MAAM,OAAO;;;;CAInB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './Container';
2
+ export * from './Slide';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Markdown/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,16 @@
1
+ export declare const theme: {
2
+ root: string;
3
+ padding: string;
4
+ nodes: {
5
+ h1: string;
6
+ h2: string;
7
+ h3: string;
8
+ p: string;
9
+ ul: string;
10
+ ol: string;
11
+ li: string;
12
+ pre: string;
13
+ code: string;
14
+ };
15
+ };
16
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../src/components/Markdown/theme.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;CAmBjB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type FC } from 'react';
2
+ import { type DocumentType } from '@dxos/plugin-markdown/types';
3
+ declare const MarkdownSlide: FC<{
4
+ document: DocumentType;
5
+ }>;
6
+ export default MarkdownSlide;
7
+ //# sourceMappingURL=MarkdownSlide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarkdownSlide.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownSlide.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAIhE,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC;IAAE,QAAQ,EAAE,YAAY,CAAA;CAAE,CAWjD,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React, { type PropsWithChildren, type ReactNode } from 'react';
2
+ import { type ThemedClassName } from '@dxos/react-ui';
3
+ export type LayoutProps = ThemedClassName<PropsWithChildren<{
4
+ className?: string;
5
+ topLeft?: ReactNode;
6
+ topRight?: ReactNode;
7
+ bottomLeft?: ReactNode;
8
+ bottomRight?: ReactNode;
9
+ }>>;
10
+ export declare const Layout: ({ children, classNames, topLeft, topRight, bottomLeft, bottomRight }: LayoutProps) => React.JSX.Element;
11
+ //# sourceMappingURL=Layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../../src/components/Presenter/Layout.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,MAAM,MAAM,WAAW,GAAG,eAAe,CACvC,iBAAiB,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB,CAAC,CACH,CAAC;AAEF,eAAO,MAAM,MAAM,yEAA0E,WAAW,sBAavG,CAAC"}
@@ -0,0 +1,19 @@
1
+ import React, { type FC } from 'react';
2
+ export type PagerProps = {
3
+ index?: number;
4
+ count?: number;
5
+ keys?: boolean;
6
+ onChange?: (index: number) => void;
7
+ onExit?: () => void;
8
+ };
9
+ export declare const Pager: ({ index: controlledIndex, count, keys, onChange, onExit }: PagerProps) => React.JSX.Element | null;
10
+ export type PageNumberProps = {
11
+ index?: number;
12
+ count?: number;
13
+ };
14
+ export declare const PageNumber: ({ index, count }: PageNumberProps) => React.JSX.Element | null;
15
+ export declare const StartButton: FC<{
16
+ running?: boolean;
17
+ onClick?: (start: boolean) => void;
18
+ }>;
19
+ //# sourceMappingURL=Pager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pager.d.ts","sourceRoot":"","sources":["../../../../../src/components/Presenter/Pager.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAa,MAAM,OAAO,CAAC;AAOlD,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,KAAK,8DAAuE,UAAU,6BA4ElG,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,UAAU,qBAA8B,eAAe,6BAYnE,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;CAAE,CAMrF,CAAC"}
@@ -0,0 +1,14 @@
1
+ import '@dxosTheme';
2
+ import React from 'react';
3
+ declare const _default: {
4
+ title: string;
5
+ render: React.FC<{
6
+ count?: number;
7
+ }>;
8
+ parameters: {
9
+ layout: string;
10
+ };
11
+ };
12
+ export default _default;
13
+ export declare const Default: {};
14
+ //# sourceMappingURL=Pager.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pager.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Presenter/Pager.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAEpB,OAAO,KAA4B,MAAM,OAAO,CAAC;;;;gBAIvB,MAAM;;;;;;AAahC,wBAME;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './Layout';
2
+ export * from './Pager';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Presenter/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type FC } from 'react';
2
+ import { type CollectionType } from '@dxos/plugin-space/types';
3
+ declare const PresenterMain: FC<{
4
+ collection: CollectionType;
5
+ }>;
6
+ export default PresenterMain;
7
+ //# sourceMappingURL=PresenterMain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PresenterMain.d.ts","sourceRoot":"","sources":["../../../../src/components/PresenterMain.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAwB,MAAM,OAAO,CAAC;AAS7D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAc/D,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC;IAAE,UAAU,EAAE,cAAc,CAAA;CAAE,CAuDrD,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { type PresenterSettingsProps } from '../types';
3
+ export declare const PresenterSettings: ({ settings }: {
4
+ settings: PresenterSettingsProps;
5
+ }) => React.JSX.Element;
6
+ //# sourceMappingURL=PresenterSettings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PresenterSettings.d.ts","sourceRoot":"","sources":["../../../../src/components/PresenterSettings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD,eAAO,MAAM,iBAAiB,iBAAkB;IAAE,QAAQ,EAAE,sBAAsB,CAAA;CAAE,sBAanF,CAAC"}
@@ -0,0 +1,10 @@
1
+ import 'reveal.js/dist/reveal.css';
2
+ import 'reveal.js/dist/theme/black.css';
3
+ import React from 'react';
4
+ export type RevealProps = {
5
+ content: string;
6
+ slide?: number;
7
+ onExit?: () => void;
8
+ };
9
+ export declare const RevealPlayer: ({ content, slide, onExit }: RevealProps) => React.JSX.Element;
10
+ //# sourceMappingURL=Reveal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Reveal.d.ts","sourceRoot":"","sources":["../../../../../src/components/Reveal/Reveal.tsx"],"names":[],"mappings":"AAKA,OAAO,2BAA2B,CAAC;AAEnC,OAAO,gCAAgC,CAAC;AAExC,OAAO,KAA4B,MAAM,OAAO,CAAC;AAqCjD,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAGF,eAAO,MAAM,YAAY,+BAAgC,WAAW,sBAkFnE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './Reveal';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Reveal/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,9 @@
1
+ import '@dxosTheme';
2
+ import React from 'react';
3
+ declare const _default: {
4
+ title: string;
5
+ render: () => React.JSX.Element;
6
+ };
7
+ export default _default;
8
+ export declare const Default: {};
9
+ //# sourceMappingURL=Reveal.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Reveal.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Reveal.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;AAoB1B,wBAGE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type FC } from 'react';
2
+ import { type DocumentType } from '@dxos/plugin-markdown/types';
3
+ declare const PresenterMain: FC<{
4
+ document: DocumentType;
5
+ }>;
6
+ export default PresenterMain;
7
+ //# sourceMappingURL=RevealMain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RevealMain.d.ts","sourceRoot":"","sources":["../../../../src/components/RevealMain.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAShE,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC;IAAE,QAAQ,EAAE,YAAY,CAAA;CAAE,CA8BjD,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export * from './PresenterSettings';
3
+ export declare const RevealMain: React.LazyExoticComponent<React.FC<{
4
+ document: import("packages/plugins/plugin-markdown/dist/types/src/types").DocumentType;
5
+ }>>;
6
+ export declare const PresenterMain: React.LazyExoticComponent<React.FC<{
7
+ collection: import("packages/plugins/plugin-space/dist/types/src/types").CollectionType;
8
+ }>>;
9
+ export declare const MarkdownSlide: React.LazyExoticComponent<React.FC<{
10
+ document: import("packages/plugins/plugin-markdown/dist/types/src/types").DocumentType;
11
+ }>>;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,cAAc,qBAAqB,CAAC;AAGpC,eAAO,MAAM,UAAU;;GAA2C,CAAC;AACnE,eAAO,MAAM,aAAa;;GAA8C,CAAC;AACzE,eAAO,MAAM,aAAa;;GAA8C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './useControlledValue';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type Dispatch, type SetStateAction } from 'react';
2
+ export declare const useControlledValue: <TValue>(controlledValue: TValue) => [TValue, Dispatch<SetStateAction<TValue>>];
3
+ //# sourceMappingURL=useControlledValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useControlledValue.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useControlledValue.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAuB,MAAM,OAAO,CAAC;AAGhF,eAAO,MAAM,kBAAkB,GAAI,MAAM,mBAAmB,MAAM,KAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAM7G,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { PresenterPlugin } from './PresenterPlugin';
2
+ export default PresenterPlugin;
3
+ export * from './components';
4
+ export * from './PresenterPlugin';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,eAAe,eAAe,CAAC;AAE/B,cAAc,cAAc,CAAC;AAE7B,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { type IconProps } from '@phosphor-icons/react';
2
+ import React from 'react';
3
+ export declare const PRESENTER_PLUGIN = "dxos.org/plugin/presenter";
4
+ declare const _default: {
5
+ id: string;
6
+ shortId?: string;
7
+ name?: string;
8
+ description?: string;
9
+ homePage?: string;
10
+ tags?: string[];
11
+ iconComponent?: React.FC<IconProps>;
12
+ iconSymbol?: string;
13
+ };
14
+ export default _default;
15
+ //# sourceMappingURL=meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,gBAAgB,8BAA8B,CAAC;;;;;;;;;;;AAE5D,wBAMG"}
@@ -0,0 +1,10 @@
1
+ type SlideOptions = {
2
+ number?: number;
3
+ code?: boolean;
4
+ list?: number;
5
+ ordered?: number;
6
+ };
7
+ export declare const createSlide: (options?: SlideOptions) => string;
8
+ export declare const createSlides: (length?: number) => string[];
9
+ export {};
10
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/testing.ts"],"names":[],"mappings":"AAMA,KAAK,YAAY,GAAG;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,WAAW,aAAa,YAAY,WAgChD,CAAC;AAEF,eAAO,MAAM,YAAY,+BAAuF,CAAC"}
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ 'en-US': {
3
+ "dxos.org/plugin/presenter": {
4
+ 'plugin name': string;
5
+ 'toggle presentation label': string;
6
+ 'present collections label': string;
7
+ };
8
+ };
9
+ }[];
10
+ export default _default;
11
+ //# sourceMappingURL=translations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;;;AAMA,wBAUE"}
@@ -0,0 +1,14 @@
1
+ import { type Context } from 'react';
2
+ import type { GraphBuilderProvides, IntentResolverProvides, SettingsProvides, SurfaceProvides, TranslationsProvides } from '@dxos/app-framework';
3
+ export type PresenterContextType = {
4
+ running: boolean;
5
+ start: () => void;
6
+ stop: () => void;
7
+ };
8
+ export declare const PresenterContext: Context<PresenterContextType>;
9
+ export type PresenterSettingsProps = {
10
+ presentCollections?: boolean;
11
+ };
12
+ export type PresenterPluginProvides = SurfaceProvides & IntentResolverProvides & GraphBuilderProvides & TranslationsProvides & SettingsProvides<PresenterSettingsProps>;
13
+ export declare const TOGGLE_PRESENTATION = "dxos.org/plugin/presenter/toggle-presentation";
14
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,OAAO,CAAC;AAEpD,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAI7B,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,OAAO,CAAC,oBAAoB,CAIzD,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG;IACnC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,eAAe,GACnD,sBAAsB,GACtB,oBAAoB,GACpB,oBAAoB,GACpB,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;AAE3C,eAAO,MAAM,mBAAmB,kDAA4C,CAAC"}
package/package.json ADDED
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "@dxos/plugin-presenter",
3
+ "version": "0.6.8-main.046e6cf",
4
+ "description": "Braneframe presenter plugin",
5
+ "homepage": "https://dxos.org",
6
+ "bugs": "https://github.com/dxos/dxos/issues",
7
+ "license": "MIT",
8
+ "author": "DXOS.org",
9
+ "exports": {
10
+ ".": {
11
+ "browser": "./dist/lib/browser/index.mjs",
12
+ "types": "./dist/types/src/index.d.ts"
13
+ },
14
+ "./meta": {
15
+ "browser": "./dist/lib/browser/meta.mjs",
16
+ "types": "./dist/types/src/meta.d.ts"
17
+ }
18
+ },
19
+ "types": "dist/types/src/index.d.ts",
20
+ "typesVersions": {
21
+ "*": {
22
+ "meta": [
23
+ "dist/types/src/meta.d.ts"
24
+ ]
25
+ }
26
+ },
27
+ "files": [
28
+ "dist",
29
+ "src"
30
+ ],
31
+ "dependencies": {
32
+ "@preact/signals-core": "^1.6.0",
33
+ "hastscript": "^7.1.0",
34
+ "highlight.js": "^11.9.0",
35
+ "marked": "^12.0.2",
36
+ "react-markdown": "^8.0.5",
37
+ "react-resize-detector": "^11.0.1",
38
+ "rehype-add-classes": "^1.0.0",
39
+ "rehype-highlight": "^6.0.0",
40
+ "remark-frontmatter": "^5.0.0",
41
+ "remark-parse-frontmatter": "^1.0.3",
42
+ "reveal.js": "^5.1.0",
43
+ "@dxos/app-framework": "0.6.8-main.046e6cf",
44
+ "@dxos/async": "0.6.8-main.046e6cf",
45
+ "@dxos/echo-schema": "0.6.8-main.046e6cf",
46
+ "@dxos/local-storage": "0.6.8-main.046e6cf",
47
+ "@dxos/plugin-client": "0.6.8-main.046e6cf",
48
+ "@dxos/log": "0.6.8-main.046e6cf",
49
+ "@dxos/plugin-graph": "0.6.8-main.046e6cf",
50
+ "@dxos/plugin-markdown": "0.6.8-main.046e6cf",
51
+ "@dxos/plugin-settings": "0.6.8-main.046e6cf",
52
+ "@dxos/plugin-stack": "0.6.8-main.046e6cf",
53
+ "@dxos/plugin-space": "0.6.8-main.046e6cf",
54
+ "@dxos/react-client": "0.6.8-main.046e6cf"
55
+ },
56
+ "devDependencies": {
57
+ "@phosphor-icons/react": "^2.1.5",
58
+ "@types/lodash.get": "^4.4.7",
59
+ "@types/react": "~18.2.0",
60
+ "@types/react-dom": "~18.2.0",
61
+ "@types/reveal.js": "^5.0.3",
62
+ "react": "~18.2.0",
63
+ "react-dom": "~18.2.0",
64
+ "vite": "^5.3.4",
65
+ "@dxos/random": "0.6.8-main.046e6cf",
66
+ "@dxos/react-ui": "0.6.8-main.046e6cf",
67
+ "@dxos/react-ui-theme": "0.6.8-main.046e6cf",
68
+ "@dxos/storybook-utils": "0.6.8-main.046e6cf"
69
+ },
70
+ "peerDependencies": {
71
+ "@phosphor-icons/react": "^2.1.5",
72
+ "react": "^18.0.0",
73
+ "react-dom": "^18.0.0",
74
+ "@dxos/react-ui": "0.6.8-main.046e6cf",
75
+ "@dxos/react-ui-theme": "0.6.8-main.046e6cf"
76
+ },
77
+ "publishConfig": {
78
+ "access": "public"
79
+ }
80
+ }
@@ -0,0 +1,158 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { type IconProps, Presentation } from '@phosphor-icons/react';
6
+ import React from 'react';
7
+
8
+ import {
9
+ resolvePlugin,
10
+ type PluginDefinition,
11
+ parseIntentPlugin,
12
+ LayoutAction,
13
+ NavigationAction,
14
+ type Intent,
15
+ } from '@dxos/app-framework';
16
+ import { create } from '@dxos/echo-schema';
17
+ import { LocalStorageStore } from '@dxos/local-storage';
18
+ import { parseClientPlugin } from '@dxos/plugin-client';
19
+ import { createExtension, type Node } from '@dxos/plugin-graph';
20
+ import { DocumentType } from '@dxos/plugin-markdown/types';
21
+ import { CollectionType } from '@dxos/plugin-space/types';
22
+ import { fullyQualifiedId } from '@dxos/react-client/echo';
23
+
24
+ import { PresenterMain, PresenterSettings, MarkdownSlide, RevealMain } from './components';
25
+ import meta, { PRESENTER_PLUGIN } from './meta';
26
+ import translations from './translations';
27
+ import {
28
+ PresenterContext,
29
+ type PresenterSettingsProps,
30
+ TOGGLE_PRESENTATION,
31
+ type PresenterPluginProvides,
32
+ } from './types';
33
+
34
+ // TODO(burdon): Only scale markdown content.
35
+ // TODO(burdon): Map stack content; Slide content type (e.g., markdown, sketch, IPFS image, table, etc.)
36
+
37
+ type PresenterState = {
38
+ presenting: boolean;
39
+ };
40
+
41
+ export const PresenterPlugin = (): PluginDefinition<PresenterPluginProvides> => {
42
+ const settings = new LocalStorageStore<PresenterSettingsProps>(PRESENTER_PLUGIN, {});
43
+
44
+ // TODO(burdon): Do we need context providers if we can get the state from the plugin?
45
+ const state = create<PresenterState>({ presenting: false });
46
+
47
+ return {
48
+ meta,
49
+ provides: {
50
+ translations,
51
+ settings: settings.values,
52
+ graph: {
53
+ builder: (plugins) => {
54
+ const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;
55
+ const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatch;
56
+ if (!client || !dispatch) {
57
+ return [];
58
+ }
59
+
60
+ return createExtension({
61
+ id: PRESENTER_PLUGIN,
62
+ filter: (node): node is Node<CollectionType | DocumentType> =>
63
+ settings.values.presentCollections
64
+ ? node.data instanceof CollectionType || node.data instanceof DocumentType
65
+ : node.data instanceof DocumentType,
66
+ actions: ({ node }) => {
67
+ const object = node.data;
68
+ const id = fullyQualifiedId(object);
69
+ return [
70
+ {
71
+ id: `${TOGGLE_PRESENTATION}/${id}`,
72
+ // TODO(burdon): Allow function so can generate state when activated.
73
+ // So can set explicit fullscreen state coordinated with current presenter state.
74
+ data: async () => {
75
+ await dispatch([
76
+ {
77
+ plugin: PRESENTER_PLUGIN,
78
+ action: TOGGLE_PRESENTATION,
79
+ data: { object },
80
+ },
81
+ {
82
+ action: NavigationAction.OPEN,
83
+ data: { activeParts: { fullScreen: id } },
84
+ },
85
+ ]);
86
+ },
87
+ properties: {
88
+ label: ['toggle presentation label', { ns: PRESENTER_PLUGIN }],
89
+ icon: (props: IconProps) => <Presentation {...props} />,
90
+ iconSymbol: 'ph--presentation--regular',
91
+ keyBinding: {
92
+ macos: 'shift+meta+p',
93
+ windows: 'shift+alt+p',
94
+ },
95
+ },
96
+ },
97
+ ];
98
+ },
99
+ });
100
+ },
101
+ },
102
+ context: ({ children }) => {
103
+ return (
104
+ <PresenterContext.Provider
105
+ value={{
106
+ running: state.presenting,
107
+ start: () => (state.presenting = true),
108
+ stop: () => (state.presenting = false),
109
+ }}
110
+ >
111
+ {children}
112
+ </PresenterContext.Provider>
113
+ );
114
+ },
115
+ surface: {
116
+ component: ({ data, role }) => {
117
+ switch (role) {
118
+ case 'main': {
119
+ if (state.presenting) {
120
+ if (data.active instanceof CollectionType) {
121
+ return { node: <PresenterMain collection={data.active} />, disposition: 'hoist' };
122
+ } else if (data.active instanceof DocumentType) {
123
+ return { node: <RevealMain document={data.active} />, disposition: 'hoist' };
124
+ }
125
+ }
126
+ return null;
127
+ }
128
+ case 'slide':
129
+ return data.slide instanceof DocumentType ? <MarkdownSlide document={data.slide} /> : null;
130
+
131
+ case 'settings':
132
+ return data.plugin === meta.id ? <PresenterSettings settings={settings.values} /> : null;
133
+ }
134
+
135
+ return null;
136
+ },
137
+ },
138
+ intent: {
139
+ resolver: (intent) => {
140
+ switch (intent.action) {
141
+ case TOGGLE_PRESENTATION: {
142
+ state.presenting = intent.data?.state ?? !state.presenting;
143
+
144
+ const intents = [] as Intent[][];
145
+ if (state.presenting) {
146
+ intents.push([{ action: LayoutAction.SET_LAYOUT_MODE, data: { layoutMode: 'fullscreen' } }]);
147
+ } else {
148
+ intents.push([{ action: LayoutAction.SET_LAYOUT_MODE, data: { revert: true } }]);
149
+ }
150
+
151
+ return { data: state.presenting, intents };
152
+ }
153
+ }
154
+ },
155
+ },
156
+ },
157
+ };
158
+ };