@embedpdf/plugin-rotate 1.0.0 → 1.0.2

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.
@@ -21,15 +21,15 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var preact_exports = {};
22
22
  __export(preact_exports, {
23
23
  Rotate: () => Rotate,
24
- useRotate: () => useRotate,
25
- useRotateCapability: () => useRotateCapability
24
+ useRotateCapability: () => useRotateCapability,
25
+ useRotatePlugin: () => useRotatePlugin
26
26
  });
27
27
  module.exports = __toCommonJS(preact_exports);
28
28
 
29
29
  // src/preact/hooks/use-rotate.ts
30
30
  var import_preact = require("@embedpdf/core/preact");
31
31
  var import_plugin_rotate = require("@embedpdf/plugin-rotate");
32
- var useRotate = () => (0, import_preact.usePlugin)(import_plugin_rotate.RotatePlugin.id);
32
+ var useRotatePlugin = () => (0, import_preact.usePlugin)(import_plugin_rotate.RotatePlugin.id);
33
33
  var useRotateCapability = () => (0, import_preact.useCapability)(import_plugin_rotate.RotatePlugin.id);
34
34
 
35
35
  // src/preact/components/rotate.tsx
@@ -56,7 +56,7 @@ function Rotate({ children, pageSize, ...props }) {
56
56
  // Annotate the CommonJS export names for ESM import in node:
57
57
  0 && (module.exports = {
58
58
  Rotate,
59
- useRotate,
60
- useRotateCapability
59
+ useRotateCapability,
60
+ useRotatePlugin
61
61
  });
62
62
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/preact/index.ts","../../src/preact/hooks/use-rotate.ts","../../src/preact/components/rotate.tsx"],"sourcesContent":["export * from './hooks';\nexport * from './components';\n","import { useCapability, usePlugin } from '@embedpdf/core/preact';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\n\nexport const useRotate = () => usePlugin<RotatePlugin>(RotatePlugin.id);\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n","/** @jsxImportSource preact */\nimport { ComponentChildren, JSX } from 'preact';\nimport { Size } from '@embedpdf/models';\n\nimport { useRotateCapability } from '../hooks';\n\ntype RotateProps = JSX.HTMLAttributes<HTMLDivElement> & {\n children: ComponentChildren;\n pageSize: Size;\n};\n\nexport function Rotate({ children, pageSize, ...props }: RotateProps) {\n const { provides: rotate } = useRotateCapability();\n const matrix =\n (rotate?.getMatrix({\n w: pageSize.width,\n h: pageSize.height,\n }) as string) || 'matrix(1, 0, 0, 1, 0, 0)';\n\n return (\n <div\n {...props}\n style={{\n position: 'absolute',\n transformOrigin: '0 0',\n transform: matrix,\n }}\n >\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,oBAAyC;AACzC,2BAA6B;AAEtB,IAAM,YAAY,UAAM,yBAAwB,kCAAa,EAAE;AAC/D,IAAM,sBAAsB,UAAM,6BAA4B,kCAAa,EAAE;;;ACgBhF;AATG,SAAS,OAAO,EAAE,UAAU,UAAU,GAAG,MAAM,GAAgB;AACpE,QAAM,EAAE,UAAU,OAAO,IAAI,oBAAoB;AACjD,QAAM,SACH,QAAQ,UAAU;AAAA,IACjB,GAAG,SAAS;AAAA,IACZ,GAAG,SAAS;AAAA,EACd,CAAC,KAAgB;AAEnB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO;AAAA,QACL,UAAU;AAAA,QACV,iBAAiB;AAAA,QACjB,WAAW;AAAA,MACb;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/preact/index.ts","../../src/preact/hooks/use-rotate.ts","../../src/preact/components/rotate.tsx"],"sourcesContent":["export * from './hooks';\nexport * from './components';\n","import { useCapability, usePlugin } from '@embedpdf/core/preact';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\n\nexport const useRotatePlugin = () => usePlugin<RotatePlugin>(RotatePlugin.id);\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n","/** @jsxImportSource preact */\nimport { ComponentChildren, JSX } from 'preact';\nimport { Size } from '@embedpdf/models';\n\nimport { useRotateCapability } from '../hooks';\n\ntype RotateProps = JSX.HTMLAttributes<HTMLDivElement> & {\n children: ComponentChildren;\n pageSize: Size;\n};\n\nexport function Rotate({ children, pageSize, ...props }: RotateProps) {\n const { provides: rotate } = useRotateCapability();\n const matrix =\n (rotate?.getMatrix({\n w: pageSize.width,\n h: pageSize.height,\n }) as string) || 'matrix(1, 0, 0, 1, 0, 0)';\n\n return (\n <div\n {...props}\n style={{\n position: 'absolute',\n transformOrigin: '0 0',\n transform: matrix,\n }}\n >\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,oBAAyC;AACzC,2BAA6B;AAEtB,IAAM,kBAAkB,UAAM,yBAAwB,kCAAa,EAAE;AACrE,IAAM,sBAAsB,UAAM,6BAA4B,kCAAa,EAAE;;;ACgBhF;AATG,SAAS,OAAO,EAAE,UAAU,UAAU,GAAG,MAAM,GAAgB;AACpE,QAAM,EAAE,UAAU,OAAO,IAAI,oBAAoB;AACjD,QAAM,SACH,QAAQ,UAAU;AAAA,IACjB,GAAG,SAAS;AAAA,IACZ,GAAG,SAAS;AAAA,EACd,CAAC,KAAgB;AAEnB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO;AAAA,QACL,UAAU;AAAA,QACV,iBAAiB;AAAA,QACjB,WAAW;AAAA,MACb;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;","names":[]}
@@ -3,7 +3,7 @@ import { RotatePlugin } from '@embedpdf/plugin-rotate';
3
3
  import { JSX, ComponentChildren } from 'preact';
4
4
  import { Size } from '@embedpdf/models';
5
5
 
6
- declare const useRotate: () => {
6
+ declare const useRotatePlugin: () => {
7
7
  plugin: RotatePlugin | null;
8
8
  isLoading: boolean;
9
9
  ready: Promise<void>;
@@ -22,4 +22,4 @@ type RotateProps = JSX.HTMLAttributes<HTMLDivElement> & {
22
22
  };
23
23
  declare function Rotate({ children, pageSize, ...props }: RotateProps): JSX.Element;
24
24
 
25
- export { Rotate, useRotate, useRotateCapability };
25
+ export { Rotate, useRotateCapability, useRotatePlugin };
@@ -3,7 +3,7 @@ import { RotatePlugin } from '@embedpdf/plugin-rotate';
3
3
  import { JSX, ComponentChildren } from 'preact';
4
4
  import { Size } from '@embedpdf/models';
5
5
 
6
- declare const useRotate: () => {
6
+ declare const useRotatePlugin: () => {
7
7
  plugin: RotatePlugin | null;
8
8
  isLoading: boolean;
9
9
  ready: Promise<void>;
@@ -22,4 +22,4 @@ type RotateProps = JSX.HTMLAttributes<HTMLDivElement> & {
22
22
  };
23
23
  declare function Rotate({ children, pageSize, ...props }: RotateProps): JSX.Element;
24
24
 
25
- export { Rotate, useRotate, useRotateCapability };
25
+ export { Rotate, useRotateCapability, useRotatePlugin };
@@ -1,7 +1,7 @@
1
1
  // src/preact/hooks/use-rotate.ts
2
2
  import { useCapability, usePlugin } from "@embedpdf/core/preact";
3
3
  import { RotatePlugin } from "@embedpdf/plugin-rotate";
4
- var useRotate = () => usePlugin(RotatePlugin.id);
4
+ var useRotatePlugin = () => usePlugin(RotatePlugin.id);
5
5
  var useRotateCapability = () => useCapability(RotatePlugin.id);
6
6
 
7
7
  // src/preact/components/rotate.tsx
@@ -27,7 +27,7 @@ function Rotate({ children, pageSize, ...props }) {
27
27
  }
28
28
  export {
29
29
  Rotate,
30
- useRotate,
31
- useRotateCapability
30
+ useRotateCapability,
31
+ useRotatePlugin
32
32
  };
33
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/preact/hooks/use-rotate.ts","../../src/preact/components/rotate.tsx"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/preact';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\n\nexport const useRotate = () => usePlugin<RotatePlugin>(RotatePlugin.id);\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n","/** @jsxImportSource preact */\nimport { ComponentChildren, JSX } from 'preact';\nimport { Size } from '@embedpdf/models';\n\nimport { useRotateCapability } from '../hooks';\n\ntype RotateProps = JSX.HTMLAttributes<HTMLDivElement> & {\n children: ComponentChildren;\n pageSize: Size;\n};\n\nexport function Rotate({ children, pageSize, ...props }: RotateProps) {\n const { provides: rotate } = useRotateCapability();\n const matrix =\n (rotate?.getMatrix({\n w: pageSize.width,\n h: pageSize.height,\n }) as string) || 'matrix(1, 0, 0, 1, 0, 0)';\n\n return (\n <div\n {...props}\n style={{\n position: 'absolute',\n transformOrigin: '0 0',\n transform: matrix,\n }}\n >\n {children}\n </div>\n );\n}\n"],"mappings":";AAAA,SAAS,eAAe,iBAAiB;AACzC,SAAS,oBAAoB;AAEtB,IAAM,YAAY,MAAM,UAAwB,aAAa,EAAE;AAC/D,IAAM,sBAAsB,MAAM,cAA4B,aAAa,EAAE;;;ACgBhF;AATG,SAAS,OAAO,EAAE,UAAU,UAAU,GAAG,MAAM,GAAgB;AACpE,QAAM,EAAE,UAAU,OAAO,IAAI,oBAAoB;AACjD,QAAM,SACH,QAAQ,UAAU;AAAA,IACjB,GAAG,SAAS;AAAA,IACZ,GAAG,SAAS;AAAA,EACd,CAAC,KAAgB;AAEnB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO;AAAA,QACL,UAAU;AAAA,QACV,iBAAiB;AAAA,QACjB,WAAW;AAAA,MACb;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/preact/hooks/use-rotate.ts","../../src/preact/components/rotate.tsx"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/preact';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\n\nexport const useRotatePlugin = () => usePlugin<RotatePlugin>(RotatePlugin.id);\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n","/** @jsxImportSource preact */\nimport { ComponentChildren, JSX } from 'preact';\nimport { Size } from '@embedpdf/models';\n\nimport { useRotateCapability } from '../hooks';\n\ntype RotateProps = JSX.HTMLAttributes<HTMLDivElement> & {\n children: ComponentChildren;\n pageSize: Size;\n};\n\nexport function Rotate({ children, pageSize, ...props }: RotateProps) {\n const { provides: rotate } = useRotateCapability();\n const matrix =\n (rotate?.getMatrix({\n w: pageSize.width,\n h: pageSize.height,\n }) as string) || 'matrix(1, 0, 0, 1, 0, 0)';\n\n return (\n <div\n {...props}\n style={{\n position: 'absolute',\n transformOrigin: '0 0',\n transform: matrix,\n }}\n >\n {children}\n </div>\n );\n}\n"],"mappings":";AAAA,SAAS,eAAe,iBAAiB;AACzC,SAAS,oBAAoB;AAEtB,IAAM,kBAAkB,MAAM,UAAwB,aAAa,EAAE;AACrE,IAAM,sBAAsB,MAAM,cAA4B,aAAa,EAAE;;;ACgBhF;AATG,SAAS,OAAO,EAAE,UAAU,UAAU,GAAG,MAAM,GAAgB;AACpE,QAAM,EAAE,UAAU,OAAO,IAAI,oBAAoB;AACjD,QAAM,SACH,QAAQ,UAAU;AAAA,IACjB,GAAG,SAAS;AAAA,IACZ,GAAG,SAAS;AAAA,EACd,CAAC,KAAgB;AAEnB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO;AAAA,QACL,UAAU;AAAA,QACV,iBAAiB;AAAA,QACjB,WAAW;AAAA,MACb;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;","names":[]}
@@ -21,15 +21,15 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var react_exports = {};
22
22
  __export(react_exports, {
23
23
  Rotate: () => Rotate,
24
- useRotate: () => useRotate,
25
- useRotateCapability: () => useRotateCapability
24
+ useRotateCapability: () => useRotateCapability,
25
+ useRotatePlugin: () => useRotatePlugin
26
26
  });
27
27
  module.exports = __toCommonJS(react_exports);
28
28
 
29
29
  // src/react/hooks/use-rotate.ts
30
30
  var import_react = require("@embedpdf/core/react");
31
31
  var import_plugin_rotate = require("@embedpdf/plugin-rotate");
32
- var useRotate = () => (0, import_react.usePlugin)(import_plugin_rotate.RotatePlugin.id);
32
+ var useRotatePlugin = () => (0, import_react.usePlugin)(import_plugin_rotate.RotatePlugin.id);
33
33
  var useRotateCapability = () => (0, import_react.useCapability)(import_plugin_rotate.RotatePlugin.id);
34
34
 
35
35
  // src/react/components/rotate.tsx
@@ -56,7 +56,7 @@ function Rotate({ children, pageSize, ...props }) {
56
56
  // Annotate the CommonJS export names for ESM import in node:
57
57
  0 && (module.exports = {
58
58
  Rotate,
59
- useRotate,
60
- useRotateCapability
59
+ useRotateCapability,
60
+ useRotatePlugin
61
61
  });
62
62
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/index.ts","../../src/react/hooks/use-rotate.ts","../../src/react/components/rotate.tsx"],"sourcesContent":["export * from './hooks';\nexport * from './components';\n","import { useCapability, usePlugin } from '@embedpdf/core/react';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\n\nexport const useRotate = () => usePlugin<RotatePlugin>(RotatePlugin.id);\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n","import { ReactNode } from 'react';\nimport { Size } from '@embedpdf/models';\n\nimport { useRotateCapability } from '../hooks';\n\ntype RotateProps = React.HTMLAttributes<HTMLDivElement> & {\n children: ReactNode;\n pageSize: Size;\n};\n\nexport function Rotate({ children, pageSize, ...props }: RotateProps) {\n const { provides: rotate } = useRotateCapability();\n const matrix =\n (rotate?.getMatrix({\n w: pageSize.width,\n h: pageSize.height,\n }) as string) || 'matrix(1, 0, 0, 1, 0, 0)';\n\n return (\n <div\n {...props}\n style={{\n position: 'absolute',\n transformOrigin: '0 0',\n transform: matrix,\n }}\n >\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAyC;AACzC,2BAA6B;AAEtB,IAAM,YAAY,UAAM,wBAAwB,kCAAa,EAAE;AAC/D,IAAM,sBAAsB,UAAM,4BAA4B,kCAAa,EAAE;;;ACehF;AATG,SAAS,OAAO,EAAE,UAAU,UAAU,GAAG,MAAM,GAAgB;AACpE,QAAM,EAAE,UAAU,OAAO,IAAI,oBAAoB;AACjD,QAAM,SACH,QAAQ,UAAU;AAAA,IACjB,GAAG,SAAS;AAAA,IACZ,GAAG,SAAS;AAAA,EACd,CAAC,KAAgB;AAEnB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO;AAAA,QACL,UAAU;AAAA,QACV,iBAAiB;AAAA,QACjB,WAAW;AAAA,MACb;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/react/index.ts","../../src/react/hooks/use-rotate.ts","../../src/react/components/rotate.tsx"],"sourcesContent":["export * from './hooks';\nexport * from './components';\n","import { useCapability, usePlugin } from '@embedpdf/core/react';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\n\nexport const useRotatePlugin = () => usePlugin<RotatePlugin>(RotatePlugin.id);\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n","import { ReactNode } from 'react';\nimport { Size } from '@embedpdf/models';\n\nimport { useRotateCapability } from '../hooks';\n\ntype RotateProps = React.HTMLAttributes<HTMLDivElement> & {\n children: ReactNode;\n pageSize: Size;\n};\n\nexport function Rotate({ children, pageSize, ...props }: RotateProps) {\n const { provides: rotate } = useRotateCapability();\n const matrix =\n (rotate?.getMatrix({\n w: pageSize.width,\n h: pageSize.height,\n }) as string) || 'matrix(1, 0, 0, 1, 0, 0)';\n\n return (\n <div\n {...props}\n style={{\n position: 'absolute',\n transformOrigin: '0 0',\n transform: matrix,\n }}\n >\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAyC;AACzC,2BAA6B;AAEtB,IAAM,kBAAkB,UAAM,wBAAwB,kCAAa,EAAE;AACrE,IAAM,sBAAsB,UAAM,4BAA4B,kCAAa,EAAE;;;ACehF;AATG,SAAS,OAAO,EAAE,UAAU,UAAU,GAAG,MAAM,GAAgB;AACpE,QAAM,EAAE,UAAU,OAAO,IAAI,oBAAoB;AACjD,QAAM,SACH,QAAQ,UAAU;AAAA,IACjB,GAAG,SAAS;AAAA,IACZ,GAAG,SAAS;AAAA,EACd,CAAC,KAAgB;AAEnB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO;AAAA,QACL,UAAU;AAAA,QACV,iBAAiB;AAAA,QACjB,WAAW;AAAA,MACb;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;","names":[]}
@@ -4,7 +4,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode } from 'react';
5
5
  import { Size } from '@embedpdf/models';
6
6
 
7
- declare const useRotate: () => {
7
+ declare const useRotatePlugin: () => {
8
8
  plugin: RotatePlugin | null;
9
9
  isLoading: boolean;
10
10
  ready: Promise<void>;
@@ -21,4 +21,4 @@ type RotateProps = React.HTMLAttributes<HTMLDivElement> & {
21
21
  };
22
22
  declare function Rotate({ children, pageSize, ...props }: RotateProps): react_jsx_runtime.JSX.Element;
23
23
 
24
- export { Rotate, useRotate, useRotateCapability };
24
+ export { Rotate, useRotateCapability, useRotatePlugin };
@@ -4,7 +4,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode } from 'react';
5
5
  import { Size } from '@embedpdf/models';
6
6
 
7
- declare const useRotate: () => {
7
+ declare const useRotatePlugin: () => {
8
8
  plugin: RotatePlugin | null;
9
9
  isLoading: boolean;
10
10
  ready: Promise<void>;
@@ -21,4 +21,4 @@ type RotateProps = React.HTMLAttributes<HTMLDivElement> & {
21
21
  };
22
22
  declare function Rotate({ children, pageSize, ...props }: RotateProps): react_jsx_runtime.JSX.Element;
23
23
 
24
- export { Rotate, useRotate, useRotateCapability };
24
+ export { Rotate, useRotateCapability, useRotatePlugin };
@@ -1,7 +1,7 @@
1
1
  // src/react/hooks/use-rotate.ts
2
2
  import { useCapability, usePlugin } from "@embedpdf/core/react";
3
3
  import { RotatePlugin } from "@embedpdf/plugin-rotate";
4
- var useRotate = () => usePlugin(RotatePlugin.id);
4
+ var useRotatePlugin = () => usePlugin(RotatePlugin.id);
5
5
  var useRotateCapability = () => useCapability(RotatePlugin.id);
6
6
 
7
7
  // src/react/components/rotate.tsx
@@ -27,7 +27,7 @@ function Rotate({ children, pageSize, ...props }) {
27
27
  }
28
28
  export {
29
29
  Rotate,
30
- useRotate,
31
- useRotateCapability
30
+ useRotateCapability,
31
+ useRotatePlugin
32
32
  };
33
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/hooks/use-rotate.ts","../../src/react/components/rotate.tsx"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/react';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\n\nexport const useRotate = () => usePlugin<RotatePlugin>(RotatePlugin.id);\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n","import { ReactNode } from 'react';\nimport { Size } from '@embedpdf/models';\n\nimport { useRotateCapability } from '../hooks';\n\ntype RotateProps = React.HTMLAttributes<HTMLDivElement> & {\n children: ReactNode;\n pageSize: Size;\n};\n\nexport function Rotate({ children, pageSize, ...props }: RotateProps) {\n const { provides: rotate } = useRotateCapability();\n const matrix =\n (rotate?.getMatrix({\n w: pageSize.width,\n h: pageSize.height,\n }) as string) || 'matrix(1, 0, 0, 1, 0, 0)';\n\n return (\n <div\n {...props}\n style={{\n position: 'absolute',\n transformOrigin: '0 0',\n transform: matrix,\n }}\n >\n {children}\n </div>\n );\n}\n"],"mappings":";AAAA,SAAS,eAAe,iBAAiB;AACzC,SAAS,oBAAoB;AAEtB,IAAM,YAAY,MAAM,UAAwB,aAAa,EAAE;AAC/D,IAAM,sBAAsB,MAAM,cAA4B,aAAa,EAAE;;;ACehF;AATG,SAAS,OAAO,EAAE,UAAU,UAAU,GAAG,MAAM,GAAgB;AACpE,QAAM,EAAE,UAAU,OAAO,IAAI,oBAAoB;AACjD,QAAM,SACH,QAAQ,UAAU;AAAA,IACjB,GAAG,SAAS;AAAA,IACZ,GAAG,SAAS;AAAA,EACd,CAAC,KAAgB;AAEnB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO;AAAA,QACL,UAAU;AAAA,QACV,iBAAiB;AAAA,QACjB,WAAW;AAAA,MACb;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/react/hooks/use-rotate.ts","../../src/react/components/rotate.tsx"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/react';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\n\nexport const useRotatePlugin = () => usePlugin<RotatePlugin>(RotatePlugin.id);\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n","import { ReactNode } from 'react';\nimport { Size } from '@embedpdf/models';\n\nimport { useRotateCapability } from '../hooks';\n\ntype RotateProps = React.HTMLAttributes<HTMLDivElement> & {\n children: ReactNode;\n pageSize: Size;\n};\n\nexport function Rotate({ children, pageSize, ...props }: RotateProps) {\n const { provides: rotate } = useRotateCapability();\n const matrix =\n (rotate?.getMatrix({\n w: pageSize.width,\n h: pageSize.height,\n }) as string) || 'matrix(1, 0, 0, 1, 0, 0)';\n\n return (\n <div\n {...props}\n style={{\n position: 'absolute',\n transformOrigin: '0 0',\n transform: matrix,\n }}\n >\n {children}\n </div>\n );\n}\n"],"mappings":";AAAA,SAAS,eAAe,iBAAiB;AACzC,SAAS,oBAAoB;AAEtB,IAAM,kBAAkB,MAAM,UAAwB,aAAa,EAAE;AACrE,IAAM,sBAAsB,MAAM,cAA4B,aAAa,EAAE;;;ACehF;AATG,SAAS,OAAO,EAAE,UAAU,UAAU,GAAG,MAAM,GAAgB;AACpE,QAAM,EAAE,UAAU,OAAO,IAAI,oBAAoB;AACjD,QAAM,SACH,QAAQ,UAAU;AAAA,IACjB,GAAG,SAAS;AAAA,IACZ,GAAG,SAAS;AAAA,EACd,CAAC,KAAgB;AAEnB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO;AAAA,QACL,UAAU;AAAA,QACV,iBAAiB;AAAA,QACjB,WAAW;AAAA,MACb;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embedpdf/plugin-rotate",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -23,20 +23,20 @@
23
23
  }
24
24
  },
25
25
  "dependencies": {
26
- "@embedpdf/models": "1.0.0",
27
- "@embedpdf/plugin-loader": "1.0.0"
26
+ "@embedpdf/models": "1.0.2",
27
+ "@embedpdf/plugin-loader": "1.0.2"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/react": "^18.2.0",
31
31
  "tsup": "^8.0.0",
32
32
  "typescript": "^5.0.0",
33
- "@embedpdf/plugin-spread": "1.0.0"
33
+ "@embedpdf/plugin-spread": "1.0.2"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "react": ">=16.8.0",
37
37
  "react-dom": ">=16.8.0",
38
38
  "preact": "^10.26.4",
39
- "@embedpdf/core": "1.0.0"
39
+ "@embedpdf/core": "1.0.2"
40
40
  },
41
41
  "files": [
42
42
  "dist",