@netless/fastboard-react 0.3.2-canary.0 → 0.3.2-canary.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from '@netless/fastboard-core';
2
2
  import { RedoUndoProps, ZoomControlProps, PageControlProps, ToolbarProps, FastboardProps, ReplayFastboardProps } from '@netless/fastboard-ui';
3
- export { AppInToolbar, AppsInToolbar, FastboardProps, GenericIcon, Language, PageControlProps, RedoUndoProps, ReplayFastboardProps, Theme, ToolbarProps, ZoomControlProps, apps } from '@netless/fastboard-ui';
3
+ export { AppInToolbar, AppsInToolbar, FastboardProps, FastboardUIConfig, GenericIcon, Language, PageControlProps, RedoUndoProps, ReplayFastboardProps, Theme, ToolbarProps, ZoomControlProps, apps } from '@netless/fastboard-ui';
4
4
  import * as react from 'react';
5
5
 
6
6
  declare const RedoUndo: react.FunctionComponent<RedoUndoProps>;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.tsx","../src/RedoUndo.tsx","../src/hooks.tsx","../src/ZoomControl.tsx","../src/PageControl.tsx","../src/Toolbar.tsx","../src/Fastboard.tsx"],"sourcesContent":["export * from \"@netless/fastboard-core\";\nexport { apps } from \"@netless/fastboard-ui\";\nexport type { Theme, Language, GenericIcon, AppInToolbar, AppsInToolbar } from \"@netless/fastboard-ui\";\nexport * from \"./RedoUndo\";\nexport * from \"./ZoomControl\";\nexport * from \"./PageControl\";\nexport * from \"./Toolbar\";\nexport * from \"./Fastboard\";\n\nimport \"./style.scss\";\n\n// Caution about Export Namespace (Star)\n// esbuild can not handle nested `export *`, i.e. given two files:\n//\n// foo: export * from './bar'\n// bar: export * from 'baz' (external: baz)\n//\n// the result of bundling foo will be broken.\n// `export * from external-module` works and only works at the entry points.\n// ref: https://github.com/evanw/esbuild/issues/1737\n","import type { RedoUndoProps } from \"@netless/fastboard-ui\";\n\nimport { RedoUndo as RedoUndoImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { RedoUndoProps };\n\nexport const RedoUndo = /* @__PURE__ */ wrapReactComponent<RedoUndoProps>(RedoUndoImpl, \"RedoUndo\");\n","import type { SvelteComponent as SvelteComponentType } from \"svelte\";\nimport type { DependencyList, EffectCallback, FunctionComponent } from \"react\";\n\nimport React, { useEffect, useLayoutEffect, useRef, useState } from \"react\";\n\nexport const useIsomorphicLayoutEffect = typeof document !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport function useUpdateEffect(effect: EffectCallback, deps?: DependencyList) {\n const isFirst = useRef(true);\n\n useIsomorphicLayoutEffect(() => {\n if (isFirst.current) {\n isFirst.current = false;\n return;\n }\n\n return effect();\n }, deps);\n}\n\nexport function wrapReactComponent<Props>(\n SvelteComponent: typeof SvelteComponentType,\n name: string\n): FunctionComponent<Props> {\n function ReactComponent(props: Props) {\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n const component = useRef<SvelteComponentType | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n if (container) {\n component.current = new SvelteComponent({ target: container, props });\n\n return () => {\n if (component.current) {\n component.current.$destroy();\n }\n };\n }\n }, [container]);\n\n useUpdateEffect(() => {\n if (component.current) {\n component.current.$set(props);\n }\n }, [props]);\n\n return <div className=\"fastboard-react-div\" ref={setContainer} />;\n }\n\n ReactComponent.displayName = name;\n\n return ReactComponent;\n}\n","import type { ZoomControlProps } from \"@netless/fastboard-ui\";\n\nimport { ZoomControl as ZoomControlImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { ZoomControlProps };\n\nexport const ZoomControl = /* @__PURE__ */ wrapReactComponent<ZoomControlProps>(\n ZoomControlImpl,\n \"ZoomControl\"\n);\n","import type { PageControlProps } from \"@netless/fastboard-ui\";\n\nimport { PageControl as PageControlImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { PageControlProps };\n\nexport const PageControl = /* @__PURE__ */ wrapReactComponent<PageControlProps>(\n PageControlImpl,\n \"PageControl\"\n);\n","import type { ToolbarProps } from \"@netless/fastboard-ui\";\n\nimport { Toolbar as ToolbarImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { ToolbarProps };\n\nexport const Toolbar = /* @__PURE__ */ wrapReactComponent<ToolbarProps>(ToolbarImpl, \"Toolbar\");\n","import type { FastboardProps, ReplayFastboardProps } from \"@netless/fastboard-ui\";\n\nimport { Fastboard as FastboardImpl, ReplayFastboard as ReplayFastboardImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { FastboardProps, ReplayFastboardProps };\n\nexport const Fastboard = /* @__PURE__ */ wrapReactComponent<FastboardProps>(FastboardImpl, \"Fastboard\");\nexport const ReplayFastboard = /* @__PURE__ */ wrapReactComponent<ReplayFastboardProps>(\n ReplayFastboardImpl,\n \"ReplayFastboard\"\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,oCAAd;AACA,2BAAqB;;;ACCrB,0BAAyC;;;ACCzC,mBAAoE;AAE7D,IAAM,4BAA4B,OAAO,aAAa,cAAc,+BAAkB;AAEtF,yBAAyB,QAAwB,MAAuB;AAC7E,QAAM,UAAU,yBAAO,IAAI;AAE3B,4BAA0B,MAAM;AAC9B,QAAI,QAAQ,SAAS;AACnB,cAAQ,UAAU;AAClB;AAAA,IACF;AAEA,WAAO,OAAO;AAAA,EAChB,GAAG,IAAI;AACT;AAEO,4BACL,iBACA,MAC0B;AAC1B,0BAAwB,OAAc;AACpC,UAAM,CAAC,WAAW,gBAAgB,2BAAgC,IAAI;AACtE,UAAM,YAAY,yBAAmC,IAAI;AAEzD,8BAA0B,MAAM;AAC9B,UAAI,WAAW;AACb,kBAAU,UAAU,IAAI,gBAAgB,EAAE,QAAQ,WAAW,MAAM,CAAC;AAEpE,eAAO,MAAM;AACX,cAAI,UAAU,SAAS;AACrB,sBAAU,QAAQ,SAAS;AAAA,UAC7B;AAAA,QACF;AAAA,MACF;AAAA,IACF,GAAG,CAAC,SAAS,CAAC;AAEd,oBAAgB,MAAM;AACpB,UAAI,UAAU,SAAS;AACrB,kBAAU,QAAQ,KAAK,KAAK;AAAA,MAC9B;AAAA,IACF,GAAG,CAAC,KAAK,CAAC;AAEV,WAAO,mDAAC;AAAA,MAAI,WAAU;AAAA,MAAsB,KAAK;AAAA,KAAc;AAAA,EACjE;AAEA,iBAAe,cAAc;AAE7B,SAAO;AACT;;;AD7CO,IAAM,WAA2B,mCAAkC,8BAAc,UAAU;;;AELlG,2BAA+C;AAKxC,IAAM,cAA8B,mCACzC,kCACA,aACF;;;ACRA,2BAA+C;AAKxC,IAAM,cAA8B,mCACzC,kCACA,aACF;;;ACRA,2BAAuC;AAKhC,IAAM,UAA0B,mCAAiC,8BAAa,SAAS;;;ACL9F,2BAAmF;AAK5E,IAAM,YAA4B,mCAAmC,gCAAe,WAAW;AAC/F,IAAM,kBAAkC,mCAC7C,sCACA,iBACF;","names":[]}
1
+ {"version":3,"sources":["../src/index.tsx","../src/RedoUndo.tsx","../src/hooks.tsx","../src/ZoomControl.tsx","../src/PageControl.tsx","../src/Toolbar.tsx","../src/Fastboard.tsx"],"sourcesContent":["export * from \"@netless/fastboard-core\";\nexport { apps } from \"@netless/fastboard-ui\";\nexport type {\n Theme,\n Language,\n GenericIcon,\n AppInToolbar,\n AppsInToolbar,\n FastboardUIConfig,\n} from \"@netless/fastboard-ui\";\nexport * from \"./RedoUndo\";\nexport * from \"./ZoomControl\";\nexport * from \"./PageControl\";\nexport * from \"./Toolbar\";\nexport * from \"./Fastboard\";\n\nimport \"./style.scss\";\n\n// Caution about Export Namespace (Star)\n// esbuild can not handle nested `export *`, i.e. given two files:\n//\n// foo: export * from './bar'\n// bar: export * from 'baz' (external: baz)\n//\n// the result of bundling foo will be broken.\n// `export * from external-module` works and only works at the entry points.\n// ref: https://github.com/evanw/esbuild/issues/1737\n","import type { RedoUndoProps } from \"@netless/fastboard-ui\";\n\nimport { RedoUndo as RedoUndoImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { RedoUndoProps };\n\nexport const RedoUndo = /* @__PURE__ */ wrapReactComponent<RedoUndoProps>(RedoUndoImpl, \"RedoUndo\");\n","import type { SvelteComponent as SvelteComponentType } from \"svelte\";\nimport type { DependencyList, EffectCallback, FunctionComponent } from \"react\";\n\nimport React, { useEffect, useLayoutEffect, useRef, useState } from \"react\";\n\nexport const useIsomorphicLayoutEffect = typeof document !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport function useUpdateEffect(effect: EffectCallback, deps?: DependencyList) {\n const isFirst = useRef(true);\n\n useIsomorphicLayoutEffect(() => {\n if (isFirst.current) {\n isFirst.current = false;\n return;\n }\n\n return effect();\n }, deps);\n}\n\nexport function wrapReactComponent<Props>(\n SvelteComponent: typeof SvelteComponentType,\n name: string\n): FunctionComponent<Props> {\n function ReactComponent(props: Props) {\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n const component = useRef<SvelteComponentType | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n if (container) {\n component.current = new SvelteComponent({ target: container, props });\n\n return () => {\n if (component.current) {\n component.current.$destroy();\n }\n };\n }\n }, [container]);\n\n useUpdateEffect(() => {\n if (component.current) {\n component.current.$set(props);\n }\n }, [props]);\n\n return <div className=\"fastboard-react-div\" ref={setContainer} />;\n }\n\n ReactComponent.displayName = name;\n\n return ReactComponent;\n}\n","import type { ZoomControlProps } from \"@netless/fastboard-ui\";\n\nimport { ZoomControl as ZoomControlImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { ZoomControlProps };\n\nexport const ZoomControl = /* @__PURE__ */ wrapReactComponent<ZoomControlProps>(\n ZoomControlImpl,\n \"ZoomControl\"\n);\n","import type { PageControlProps } from \"@netless/fastboard-ui\";\n\nimport { PageControl as PageControlImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { PageControlProps };\n\nexport const PageControl = /* @__PURE__ */ wrapReactComponent<PageControlProps>(\n PageControlImpl,\n \"PageControl\"\n);\n","import type { ToolbarProps } from \"@netless/fastboard-ui\";\n\nimport { Toolbar as ToolbarImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { ToolbarProps };\n\nexport const Toolbar = /* @__PURE__ */ wrapReactComponent<ToolbarProps>(ToolbarImpl, \"Toolbar\");\n","import type { FastboardProps, ReplayFastboardProps } from \"@netless/fastboard-ui\";\n\nimport { Fastboard as FastboardImpl, ReplayFastboard as ReplayFastboardImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { FastboardProps, ReplayFastboardProps };\n\nexport const Fastboard = /* @__PURE__ */ wrapReactComponent<FastboardProps>(FastboardImpl, \"Fastboard\");\nexport const ReplayFastboard = /* @__PURE__ */ wrapReactComponent<ReplayFastboardProps>(\n ReplayFastboardImpl,\n \"ReplayFastboard\"\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,oCAAd;AACA,2BAAqB;;;ACCrB,0BAAyC;;;ACCzC,mBAAoE;AAE7D,IAAM,4BAA4B,OAAO,aAAa,cAAc,+BAAkB;AAEtF,yBAAyB,QAAwB,MAAuB;AAC7E,QAAM,UAAU,yBAAO,IAAI;AAE3B,4BAA0B,MAAM;AAC9B,QAAI,QAAQ,SAAS;AACnB,cAAQ,UAAU;AAClB;AAAA,IACF;AAEA,WAAO,OAAO;AAAA,EAChB,GAAG,IAAI;AACT;AAEO,4BACL,iBACA,MAC0B;AAC1B,0BAAwB,OAAc;AACpC,UAAM,CAAC,WAAW,gBAAgB,2BAAgC,IAAI;AACtE,UAAM,YAAY,yBAAmC,IAAI;AAEzD,8BAA0B,MAAM;AAC9B,UAAI,WAAW;AACb,kBAAU,UAAU,IAAI,gBAAgB,EAAE,QAAQ,WAAW,MAAM,CAAC;AAEpE,eAAO,MAAM;AACX,cAAI,UAAU,SAAS;AACrB,sBAAU,QAAQ,SAAS;AAAA,UAC7B;AAAA,QACF;AAAA,MACF;AAAA,IACF,GAAG,CAAC,SAAS,CAAC;AAEd,oBAAgB,MAAM;AACpB,UAAI,UAAU,SAAS;AACrB,kBAAU,QAAQ,KAAK,KAAK;AAAA,MAC9B;AAAA,IACF,GAAG,CAAC,KAAK,CAAC;AAEV,WAAO,mDAAC;AAAA,MAAI,WAAU;AAAA,MAAsB,KAAK;AAAA,KAAc;AAAA,EACjE;AAEA,iBAAe,cAAc;AAE7B,SAAO;AACT;;;AD7CO,IAAM,WAA2B,mCAAkC,8BAAc,UAAU;;;AELlG,2BAA+C;AAKxC,IAAM,cAA8B,mCACzC,kCACA,aACF;;;ACRA,2BAA+C;AAKxC,IAAM,cAA8B,mCACzC,kCACA,aACF;;;ACRA,2BAAuC;AAKhC,IAAM,UAA0B,mCAAiC,8BAAa,SAAS;;;ACL9F,2BAAmF;AAK5E,IAAM,YAA4B,mCAAmC,gCAAe,WAAW;AAC/F,IAAM,kBAAkC,mCAC7C,sCACA,iBACF;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.tsx","../src/RedoUndo.tsx","../src/hooks.tsx","../src/ZoomControl.tsx","../src/PageControl.tsx","../src/Toolbar.tsx","../src/Fastboard.tsx"],"sourcesContent":["export * from \"@netless/fastboard-core\";\nexport { apps } from \"@netless/fastboard-ui\";\nexport type { Theme, Language, GenericIcon, AppInToolbar, AppsInToolbar } from \"@netless/fastboard-ui\";\nexport * from \"./RedoUndo\";\nexport * from \"./ZoomControl\";\nexport * from \"./PageControl\";\nexport * from \"./Toolbar\";\nexport * from \"./Fastboard\";\n\nimport \"./style.scss\";\n\n// Caution about Export Namespace (Star)\n// esbuild can not handle nested `export *`, i.e. given two files:\n//\n// foo: export * from './bar'\n// bar: export * from 'baz' (external: baz)\n//\n// the result of bundling foo will be broken.\n// `export * from external-module` works and only works at the entry points.\n// ref: https://github.com/evanw/esbuild/issues/1737\n","import type { RedoUndoProps } from \"@netless/fastboard-ui\";\n\nimport { RedoUndo as RedoUndoImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { RedoUndoProps };\n\nexport const RedoUndo = /* @__PURE__ */ wrapReactComponent<RedoUndoProps>(RedoUndoImpl, \"RedoUndo\");\n","import type { SvelteComponent as SvelteComponentType } from \"svelte\";\nimport type { DependencyList, EffectCallback, FunctionComponent } from \"react\";\n\nimport React, { useEffect, useLayoutEffect, useRef, useState } from \"react\";\n\nexport const useIsomorphicLayoutEffect = typeof document !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport function useUpdateEffect(effect: EffectCallback, deps?: DependencyList) {\n const isFirst = useRef(true);\n\n useIsomorphicLayoutEffect(() => {\n if (isFirst.current) {\n isFirst.current = false;\n return;\n }\n\n return effect();\n }, deps);\n}\n\nexport function wrapReactComponent<Props>(\n SvelteComponent: typeof SvelteComponentType,\n name: string\n): FunctionComponent<Props> {\n function ReactComponent(props: Props) {\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n const component = useRef<SvelteComponentType | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n if (container) {\n component.current = new SvelteComponent({ target: container, props });\n\n return () => {\n if (component.current) {\n component.current.$destroy();\n }\n };\n }\n }, [container]);\n\n useUpdateEffect(() => {\n if (component.current) {\n component.current.$set(props);\n }\n }, [props]);\n\n return <div className=\"fastboard-react-div\" ref={setContainer} />;\n }\n\n ReactComponent.displayName = name;\n\n return ReactComponent;\n}\n","import type { ZoomControlProps } from \"@netless/fastboard-ui\";\n\nimport { ZoomControl as ZoomControlImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { ZoomControlProps };\n\nexport const ZoomControl = /* @__PURE__ */ wrapReactComponent<ZoomControlProps>(\n ZoomControlImpl,\n \"ZoomControl\"\n);\n","import type { PageControlProps } from \"@netless/fastboard-ui\";\n\nimport { PageControl as PageControlImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { PageControlProps };\n\nexport const PageControl = /* @__PURE__ */ wrapReactComponent<PageControlProps>(\n PageControlImpl,\n \"PageControl\"\n);\n","import type { ToolbarProps } from \"@netless/fastboard-ui\";\n\nimport { Toolbar as ToolbarImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { ToolbarProps };\n\nexport const Toolbar = /* @__PURE__ */ wrapReactComponent<ToolbarProps>(ToolbarImpl, \"Toolbar\");\n","import type { FastboardProps, ReplayFastboardProps } from \"@netless/fastboard-ui\";\n\nimport { Fastboard as FastboardImpl, ReplayFastboard as ReplayFastboardImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { FastboardProps, ReplayFastboardProps };\n\nexport const Fastboard = /* @__PURE__ */ wrapReactComponent<FastboardProps>(FastboardImpl, \"Fastboard\");\nexport const ReplayFastboard = /* @__PURE__ */ wrapReactComponent<ReplayFastboardProps>(\n ReplayFastboardImpl,\n \"ReplayFastboard\"\n);\n"],"mappings":";AAAA;AACA;;;ACCA;;;ACCA;AAEO,IAAM,4BAA4B,OAAO,aAAa,cAAc,kBAAkB;AAEtF,yBAAyB,QAAwB,MAAuB;AAC7E,QAAM,UAAU,OAAO,IAAI;AAE3B,4BAA0B,MAAM;AAC9B,QAAI,QAAQ,SAAS;AACnB,cAAQ,UAAU;AAClB;AAAA,IACF;AAEA,WAAO,OAAO;AAAA,EAChB,GAAG,IAAI;AACT;AAEO,4BACL,iBACA,MAC0B;AAC1B,0BAAwB,OAAc;AACpC,UAAM,CAAC,WAAW,gBAAgB,SAAgC,IAAI;AACtE,UAAM,YAAY,OAAmC,IAAI;AAEzD,8BAA0B,MAAM;AAC9B,UAAI,WAAW;AACb,kBAAU,UAAU,IAAI,gBAAgB,EAAE,QAAQ,WAAW,MAAM,CAAC;AAEpE,eAAO,MAAM;AACX,cAAI,UAAU,SAAS;AACrB,sBAAU,QAAQ,SAAS;AAAA,UAC7B;AAAA,QACF;AAAA,MACF;AAAA,IACF,GAAG,CAAC,SAAS,CAAC;AAEd,oBAAgB,MAAM;AACpB,UAAI,UAAU,SAAS;AACrB,kBAAU,QAAQ,KAAK,KAAK;AAAA,MAC9B;AAAA,IACF,GAAG,CAAC,KAAK,CAAC;AAEV,WAAO,oCAAC;AAAA,MAAI,WAAU;AAAA,MAAsB,KAAK;AAAA,KAAc;AAAA,EACjE;AAEA,iBAAe,cAAc;AAE7B,SAAO;AACT;;;AD7CO,IAAM,WAA2B,mCAAkC,cAAc,UAAU;;;AELlG;AAKO,IAAM,cAA8B,mCACzC,iBACA,aACF;;;ACRA;AAKO,IAAM,cAA8B,mCACzC,iBACA,aACF;;;ACRA;AAKO,IAAM,UAA0B,mCAAiC,aAAa,SAAS;;;ACL9F;AAKO,IAAM,YAA4B,mCAAmC,eAAe,WAAW;AAC/F,IAAM,kBAAkC,mCAC7C,qBACA,iBACF;","names":[]}
1
+ {"version":3,"sources":["../src/index.tsx","../src/RedoUndo.tsx","../src/hooks.tsx","../src/ZoomControl.tsx","../src/PageControl.tsx","../src/Toolbar.tsx","../src/Fastboard.tsx"],"sourcesContent":["export * from \"@netless/fastboard-core\";\nexport { apps } from \"@netless/fastboard-ui\";\nexport type {\n Theme,\n Language,\n GenericIcon,\n AppInToolbar,\n AppsInToolbar,\n FastboardUIConfig,\n} from \"@netless/fastboard-ui\";\nexport * from \"./RedoUndo\";\nexport * from \"./ZoomControl\";\nexport * from \"./PageControl\";\nexport * from \"./Toolbar\";\nexport * from \"./Fastboard\";\n\nimport \"./style.scss\";\n\n// Caution about Export Namespace (Star)\n// esbuild can not handle nested `export *`, i.e. given two files:\n//\n// foo: export * from './bar'\n// bar: export * from 'baz' (external: baz)\n//\n// the result of bundling foo will be broken.\n// `export * from external-module` works and only works at the entry points.\n// ref: https://github.com/evanw/esbuild/issues/1737\n","import type { RedoUndoProps } from \"@netless/fastboard-ui\";\n\nimport { RedoUndo as RedoUndoImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { RedoUndoProps };\n\nexport const RedoUndo = /* @__PURE__ */ wrapReactComponent<RedoUndoProps>(RedoUndoImpl, \"RedoUndo\");\n","import type { SvelteComponent as SvelteComponentType } from \"svelte\";\nimport type { DependencyList, EffectCallback, FunctionComponent } from \"react\";\n\nimport React, { useEffect, useLayoutEffect, useRef, useState } from \"react\";\n\nexport const useIsomorphicLayoutEffect = typeof document !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport function useUpdateEffect(effect: EffectCallback, deps?: DependencyList) {\n const isFirst = useRef(true);\n\n useIsomorphicLayoutEffect(() => {\n if (isFirst.current) {\n isFirst.current = false;\n return;\n }\n\n return effect();\n }, deps);\n}\n\nexport function wrapReactComponent<Props>(\n SvelteComponent: typeof SvelteComponentType,\n name: string\n): FunctionComponent<Props> {\n function ReactComponent(props: Props) {\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n const component = useRef<SvelteComponentType | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n if (container) {\n component.current = new SvelteComponent({ target: container, props });\n\n return () => {\n if (component.current) {\n component.current.$destroy();\n }\n };\n }\n }, [container]);\n\n useUpdateEffect(() => {\n if (component.current) {\n component.current.$set(props);\n }\n }, [props]);\n\n return <div className=\"fastboard-react-div\" ref={setContainer} />;\n }\n\n ReactComponent.displayName = name;\n\n return ReactComponent;\n}\n","import type { ZoomControlProps } from \"@netless/fastboard-ui\";\n\nimport { ZoomControl as ZoomControlImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { ZoomControlProps };\n\nexport const ZoomControl = /* @__PURE__ */ wrapReactComponent<ZoomControlProps>(\n ZoomControlImpl,\n \"ZoomControl\"\n);\n","import type { PageControlProps } from \"@netless/fastboard-ui\";\n\nimport { PageControl as PageControlImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { PageControlProps };\n\nexport const PageControl = /* @__PURE__ */ wrapReactComponent<PageControlProps>(\n PageControlImpl,\n \"PageControl\"\n);\n","import type { ToolbarProps } from \"@netless/fastboard-ui\";\n\nimport { Toolbar as ToolbarImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { ToolbarProps };\n\nexport const Toolbar = /* @__PURE__ */ wrapReactComponent<ToolbarProps>(ToolbarImpl, \"Toolbar\");\n","import type { FastboardProps, ReplayFastboardProps } from \"@netless/fastboard-ui\";\n\nimport { Fastboard as FastboardImpl, ReplayFastboard as ReplayFastboardImpl } from \"@netless/fastboard-ui\";\nimport { wrapReactComponent } from \"./hooks\";\n\nexport type { FastboardProps, ReplayFastboardProps };\n\nexport const Fastboard = /* @__PURE__ */ wrapReactComponent<FastboardProps>(FastboardImpl, \"Fastboard\");\nexport const ReplayFastboard = /* @__PURE__ */ wrapReactComponent<ReplayFastboardProps>(\n ReplayFastboardImpl,\n \"ReplayFastboard\"\n);\n"],"mappings":";AAAA;AACA;;;ACCA;;;ACCA;AAEO,IAAM,4BAA4B,OAAO,aAAa,cAAc,kBAAkB;AAEtF,yBAAyB,QAAwB,MAAuB;AAC7E,QAAM,UAAU,OAAO,IAAI;AAE3B,4BAA0B,MAAM;AAC9B,QAAI,QAAQ,SAAS;AACnB,cAAQ,UAAU;AAClB;AAAA,IACF;AAEA,WAAO,OAAO;AAAA,EAChB,GAAG,IAAI;AACT;AAEO,4BACL,iBACA,MAC0B;AAC1B,0BAAwB,OAAc;AACpC,UAAM,CAAC,WAAW,gBAAgB,SAAgC,IAAI;AACtE,UAAM,YAAY,OAAmC,IAAI;AAEzD,8BAA0B,MAAM;AAC9B,UAAI,WAAW;AACb,kBAAU,UAAU,IAAI,gBAAgB,EAAE,QAAQ,WAAW,MAAM,CAAC;AAEpE,eAAO,MAAM;AACX,cAAI,UAAU,SAAS;AACrB,sBAAU,QAAQ,SAAS;AAAA,UAC7B;AAAA,QACF;AAAA,MACF;AAAA,IACF,GAAG,CAAC,SAAS,CAAC;AAEd,oBAAgB,MAAM;AACpB,UAAI,UAAU,SAAS;AACrB,kBAAU,QAAQ,KAAK,KAAK;AAAA,MAC9B;AAAA,IACF,GAAG,CAAC,KAAK,CAAC;AAEV,WAAO,oCAAC;AAAA,MAAI,WAAU;AAAA,MAAsB,KAAK;AAAA,KAAc;AAAA,EACjE;AAEA,iBAAe,cAAc;AAE7B,SAAO;AACT;;;AD7CO,IAAM,WAA2B,mCAAkC,cAAc,UAAU;;;AELlG;AAKO,IAAM,cAA8B,mCACzC,iBACA,aACF;;;ACRA;AAKO,IAAM,cAA8B,mCACzC,iBACA,aACF;;;ACRA;AAKO,IAAM,UAA0B,mCAAiC,aAAa,SAAS;;;ACL9F;AAKO,IAAM,YAA4B,mCAAmC,eAAe,WAAW;AAC/F,IAAM,kBAAkC,mCAC7C,qBACA,iBACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netless/fastboard-react",
3
- "version": "0.3.2-canary.0",
3
+ "version": "0.3.2-canary.3",
4
4
  "description": "React components of @netless/fastboard.",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -12,12 +12,12 @@
12
12
  "react": "*"
13
13
  },
14
14
  "dependencies": {
15
- "@netless/fastboard-core": "0.3.2-canary.0",
16
- "@netless/fastboard-ui": "0.3.2-canary.0"
15
+ "@netless/fastboard-core": "0.3.2-canary.3",
16
+ "@netless/fastboard-ui": "0.3.2-canary.3"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@netless/esbuild-plugin-inline-sass": "0.1.0",
20
- "@types/react": "^17.0.41",
20
+ "@types/react": "^17.0.43",
21
21
  "@types/react-dom": "^17.0.14",
22
22
  "react": "^17.0.2",
23
23
  "react-dom": "^17.0.2"
package/src/index.tsx CHANGED
@@ -1,6 +1,13 @@
1
1
  export * from "@netless/fastboard-core";
2
2
  export { apps } from "@netless/fastboard-ui";
3
- export type { Theme, Language, GenericIcon, AppInToolbar, AppsInToolbar } from "@netless/fastboard-ui";
3
+ export type {
4
+ Theme,
5
+ Language,
6
+ GenericIcon,
7
+ AppInToolbar,
8
+ AppsInToolbar,
9
+ FastboardUIConfig,
10
+ } from "@netless/fastboard-ui";
4
11
  export * from "./RedoUndo";
5
12
  export * from "./ZoomControl";
6
13
  export * from "./PageControl";