@embedpdf/plugin-rotate 1.0.25 → 1.1.0
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.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/dist/lib/rotate-plugin.d.ts +2 -1
- package/dist/lib/types.d.ts +6 -7
- package/dist/lib/utils.d.ts +16 -4
- package/dist/preact/index.cjs +1 -1
- package/dist/preact/index.cjs.map +1 -1
- package/dist/preact/index.js +16 -2
- package/dist/preact/index.js.map +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +15 -2
- package/dist/react/index.js.map +1 -1
- package/dist/shared-preact/hooks/use-rotate.d.ts +5 -0
- package/dist/shared-react/hooks/use-rotate.d.ts +5 -0
- package/dist/vue/hooks/use-rotate.d.ts +8 -0
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.js +20 -5
- package/dist/vue/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@embedpdf/core"),e="rotate",o={id:e,name:"Rotate Plugin",version:"1.0.0",provides:["rotate"],requires:["loader"],optional:["spread"],defaultConfig:{enabled:!0}};const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@embedpdf/core"),e="rotate",o={id:e,name:"Rotate Plugin",version:"1.0.0",provides:["rotate"],requires:["loader"],optional:["spread"],defaultConfig:{enabled:!0}};const r=class extends t.BasePlugin{constructor(e,o,r){super(e,o),this.rotate$=t.createBehaviorEmitter(),this.resetReady();const a=r.defaultRotation??this.coreState.core.rotation;this.setRotation(a),this.markReady()}async initialize(t){}setRotation(e){if(!this.coreState.core.pages)throw new Error("Pages not loaded");this.rotate$.emit(e),this.dispatchCoreAction(t.setRotation(e))}rotateForward(){const t=(this.coreState.core.rotation+1)%4;this.setRotation(t)}rotateBackward(){const t=(this.coreState.core.rotation+3)%4;this.setRotation(t)}buildCapability(){return{onRotateChange:this.rotate$.on,setRotation:t=>this.setRotation(t),getRotation:()=>this.coreState.core.rotation,rotateForward:()=>this.rotateForward(),rotateBackward:()=>this.rotateBackward()}}getMatrixAsString(t={w:0,h:0}){return function(t,e,o){const[r,a,i,s,n,c]=function(t,e,o){let r=1,a=0,i=0,s=1,n=0,c=0;switch(t){case 1:r=0,a=1,i=-1,s=0,n=o;break;case 2:r=-1,a=0,i=0,s=-1,n=e,c=o;break;case 3:r=0,a=-1,i=1,s=0,c=e}return[r,a,i,s,n,c]}(t,e,o);return`matrix(${r},${a},${i},${s},${n},${c})`}(this.coreState.core.rotation,t.w,t.h)}async destroy(){this.rotate$.clear(),super.destroy()}};r.id="rotate";let a=r;const i={manifest:o,create:(t,o)=>new a(e,t,o),reducer:()=>{},initialState:{}};exports.ROTATE_PLUGIN_ID=e,exports.RotatePlugin=a,exports.RotatePluginPackage=i,exports.manifest=o;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/lib/manifest.ts","../src/lib/rotate-plugin.ts","../src/lib/utils.ts","../src/lib/index.ts"],"sourcesContent":["import { PluginManifest } from '@embedpdf/core';\nimport { RotatePluginConfig } from './types';\n\nexport const ROTATE_PLUGIN_ID = 'rotate';\n\nexport const manifest: PluginManifest<RotatePluginConfig> = {\n id: ROTATE_PLUGIN_ID,\n name: 'Rotate Plugin',\n version: '1.0.0',\n provides: ['rotate'],\n requires: ['loader'],\n optional: ['spread'],\n defaultConfig: {\n enabled: true,\n },\n};\n","import { BasePlugin, createBehaviorEmitter, PluginRegistry, setRotation } from '@embedpdf/core';\nimport { Rotation } from '@embedpdf/models';\nimport { RotateCapability, RotatePluginConfig } from './types';\nimport {
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/lib/manifest.ts","../src/lib/rotate-plugin.ts","../src/lib/utils.ts","../src/lib/index.ts"],"sourcesContent":["import { PluginManifest } from '@embedpdf/core';\nimport { RotatePluginConfig } from './types';\n\nexport const ROTATE_PLUGIN_ID = 'rotate';\n\nexport const manifest: PluginManifest<RotatePluginConfig> = {\n id: ROTATE_PLUGIN_ID,\n name: 'Rotate Plugin',\n version: '1.0.0',\n provides: ['rotate'],\n requires: ['loader'],\n optional: ['spread'],\n defaultConfig: {\n enabled: true,\n },\n};\n","import { BasePlugin, createBehaviorEmitter, PluginRegistry, setRotation } from '@embedpdf/core';\nimport { Rotation } from '@embedpdf/models';\nimport { GetMatrixOptions, RotateCapability, RotatePluginConfig } from './types';\nimport { getNextRotation, getPreviousRotation, getRotationMatrixString } from './utils';\n\nexport class RotatePlugin extends BasePlugin<RotatePluginConfig, RotateCapability> {\n static readonly id = 'rotate' as const;\n private readonly rotate$ = createBehaviorEmitter<Rotation>();\n\n constructor(id: string, registry: PluginRegistry, cfg: RotatePluginConfig) {\n super(id, registry);\n this.resetReady();\n const rotation = cfg.defaultRotation ?? this.coreState.core.rotation;\n this.setRotation(rotation);\n this.markReady();\n }\n\n async initialize(_config: RotatePluginConfig): Promise<void> {}\n\n private setRotation(rotation: Rotation): void {\n const pages = this.coreState.core.pages;\n if (!pages) {\n throw new Error('Pages not loaded');\n }\n\n this.rotate$.emit(rotation);\n this.dispatchCoreAction(setRotation(rotation));\n }\n\n private rotateForward(): void {\n const rotation = getNextRotation(this.coreState.core.rotation);\n this.setRotation(rotation);\n }\n\n private rotateBackward(): void {\n const rotation = getPreviousRotation(this.coreState.core.rotation);\n this.setRotation(rotation);\n }\n\n protected buildCapability(): RotateCapability {\n return {\n onRotateChange: this.rotate$.on,\n setRotation: (rotation) => this.setRotation(rotation),\n getRotation: () => this.coreState.core.rotation,\n rotateForward: () => this.rotateForward(),\n rotateBackward: () => this.rotateBackward(),\n };\n }\n\n public getMatrixAsString(options: GetMatrixOptions = { w: 0, h: 0 }): string {\n return getRotationMatrixString(this.coreState.core.rotation, options.w, options.h);\n }\n\n async destroy(): Promise<void> {\n this.rotate$.clear();\n super.destroy();\n }\n}\n","import { Rotation } from '@embedpdf/models';\n\n/**\n * Returns the 6-tuple transformation matrix for rotation.\n * Rotation is clockwise, origin = top-left (0 0).\n *\n * ── Note on e,f ───────────────────────────────\n * For 0°/180° no translation is needed.\n * For 90°/270° you may want to pass the page\n * height / width so the page stays in positive\n * coordinates. Keep them 0 and handle layout\n * elsewhere if that's what you do today.\n */\nexport function getRotationMatrix(\n rotation: Rotation,\n w: number,\n h: number,\n): [number, number, number, number, number, number] {\n let a = 1,\n b = 0,\n c = 0,\n d = 1,\n e = 0,\n f = 0;\n\n switch (rotation) {\n case 1: // 90°\n a = 0;\n b = 1;\n c = -1;\n d = 0;\n e = h;\n break;\n case 2: // 180°\n a = -1;\n b = 0;\n c = 0;\n d = -1;\n e = w;\n f = h;\n break;\n case 3: // 270°\n a = 0;\n b = -1;\n c = 1;\n d = 0;\n f = w;\n break;\n }\n\n return [a, b, c, d, e, f];\n}\n\n/**\n * Returns the CSS matrix transformation string for rotation.\n * Rotation is clockwise, origin = top-left (0 0).\n */\nexport function getRotationMatrixString(rotation: Rotation, w: number, h: number): string {\n const [a, b, c, d, e, f] = getRotationMatrix(rotation, w, h);\n return `matrix(${a},${b},${c},${d},${e},${f})`;\n}\n\n/**\n * Returns the next rotation.\n */\nexport function getNextRotation(current: Rotation): Rotation {\n return ((current + 1) % 4) as Rotation;\n}\n\n/**\n * Returns the previous rotation.\n */\nexport function getPreviousRotation(current: Rotation): Rotation {\n return ((current + 3) % 4) as Rotation; // +3 is equivalent to -1 in modulo 4\n}\n","import { PluginPackage } from '@embedpdf/core';\nimport { manifest, ROTATE_PLUGIN_ID } from './manifest';\nimport { RotatePluginConfig } from './types';\nimport { RotatePlugin } from './rotate-plugin';\n\nexport const RotatePluginPackage: PluginPackage<RotatePlugin, RotatePluginConfig> = {\n manifest,\n create: (registry, config) => new RotatePlugin(ROTATE_PLUGIN_ID, registry, config),\n reducer: () => {},\n initialState: {},\n};\n\nexport * from './rotate-plugin';\nexport * from './types';\nexport * from './manifest';\n"],"names":["ROTATE_PLUGIN_ID","manifest","id","name","version","provides","requires","optional","defaultConfig","enabled","_RotatePlugin","BasePlugin","constructor","registry","cfg","super","this","rotate$","createBehaviorEmitter","resetReady","rotation","defaultRotation","coreState","core","setRotation","markReady","initialize","_config","pages","Error","emit","dispatchCoreAction","rotateForward","rotateBackward","buildCapability","onRotateChange","on","getRotation","getMatrixAsString","options","w","h","a","b","c","d","e","f","getRotationMatrix","getRotationMatrixString","destroy","clear","RotatePlugin","RotatePluginPackage","create","config","reducer","initialState"],"mappings":"kHAGaA,EAAmB,SAEnBC,EAA+C,CAC1DC,GAAIF,EACJG,KAAM,gBACNC,QAAS,QACTC,SAAU,CAAC,UACXC,SAAU,CAAC,UACXC,SAAU,CAAC,UACXC,cAAe,CACbC,SAAS,ICRN,MAAMC,EAAN,cAA2BC,EAAAA,WAIhC,WAAAC,CAAYV,EAAYW,EAA0BC,GAChDC,MAAMb,EAAIW,GAHKG,KAAAC,QAAUC,0BAIzBF,KAAKG,aACL,MAAMC,EAAWN,EAAIO,iBAAmBL,KAAKM,UAAUC,KAAKH,SAC5DJ,KAAKQ,YAAYJ,GACjBJ,KAAKS,WAAU,CAGjB,gBAAMC,CAAWC,GAA4C,CAErD,WAAAH,CAAYJ,GAElB,IADcJ,KAAKM,UAAUC,KAAKK,MAE1B,MAAA,IAAIC,MAAM,oBAGbb,KAAAC,QAAQa,KAAKV,GACbJ,KAAAe,mBAAmBP,cAAYJ,GAAS,CAGvC,aAAAY,GACN,MAAMZ,GAA2BJ,KAAKM,UAAUC,KAAKH,SCoCpC,GAAK,EDnCtBJ,KAAKQ,YAAYJ,EAAQ,CAGnB,cAAAa,GACN,MAAMb,GAA+BJ,KAAKM,UAAUC,KAAKH,SCsCxC,GAAK,EDrCtBJ,KAAKQ,YAAYJ,EAAQ,CAGjB,eAAAc,GACD,MAAA,CACLC,eAAgBnB,KAAKC,QAAQmB,GAC7BZ,YAAcJ,GAAaJ,KAAKQ,YAAYJ,GAC5CiB,YAAa,IAAMrB,KAAKM,UAAUC,KAAKH,SACvCY,cAAe,IAAMhB,KAAKgB,gBAC1BC,eAAgB,IAAMjB,KAAKiB,iBAC7B,CAGK,iBAAAK,CAAkBC,EAA4B,CAAEC,EAAG,EAAGC,EAAG,IACvD,OCOK,SAAwBrB,EAAoBoB,EAAWC,GAC/D,MAACC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,GA7CR,SACd3B,EACAoB,EACAC,GAEI,IAAAC,EAAI,EACNC,EAAI,EACJC,EAAI,EACJC,EAAI,EACJC,EAAI,EACJC,EAAI,EAEN,OAAQ3B,GACN,KAAK,EACCsB,EAAA,EACAC,EAAA,EACAC,GAAA,EACAC,EAAA,EACAC,EAAAL,EACJ,MACF,KAAK,EACCC,GAAA,EACAC,EAAA,EACAC,EAAA,EACAC,GAAA,EACAC,EAAAN,EACAO,EAAAN,EACJ,MACF,KAAK,EACCC,EAAA,EACAC,GAAA,EACAC,EAAA,EACAC,EAAA,EACAE,EAAAP,EAIR,MAAO,CAACE,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EACzB,CAO6BC,CAAkB5B,EAAUoB,EAAGC,GACnD,MAAA,UAAUC,KAAKC,KAAKC,KAAKC,KAAKC,KAAKC,IAC5C,CDVWE,CAAwBjC,KAAKM,UAAUC,KAAKH,SAAUmB,EAAQC,EAAGD,EAAQE,EAAC,CAGnF,aAAMS,GACJlC,KAAKC,QAAQkC,QACbpC,MAAMmC,SAAQ,GAjDhBxC,EAAgBR,GAAK,SADhB,IAAMkD,EAAN1C,EEAA,MAAM2C,EAAuE,CAClFpD,WACAqD,OAAQ,CAACzC,EAAU0C,IAAW,IAAIH,EAAapD,EAAkBa,EAAU0C,GAC3EC,QAAS,OACTC,aAAc,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ const manifest = {
|
|
|
11
11
|
enabled: true
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
|
-
function
|
|
14
|
+
function getRotationMatrix(rotation, w, h) {
|
|
15
15
|
let a = 1, b = 0, c = 0, d = 1, e = 0, f = 0;
|
|
16
16
|
switch (rotation) {
|
|
17
17
|
case 1:
|
|
@@ -37,7 +37,11 @@ function rotationMatrix(rotation, w, h, asString = true) {
|
|
|
37
37
|
f = w;
|
|
38
38
|
break;
|
|
39
39
|
}
|
|
40
|
-
return
|
|
40
|
+
return [a, b, c, d, e, f];
|
|
41
|
+
}
|
|
42
|
+
function getRotationMatrixString(rotation, w, h) {
|
|
43
|
+
const [a, b, c, d, e, f] = getRotationMatrix(rotation, w, h);
|
|
44
|
+
return `matrix(${a},${b},${c},${d},${e},${f})`;
|
|
41
45
|
}
|
|
42
46
|
function getNextRotation(current) {
|
|
43
47
|
return (current + 1) % 4;
|
|
@@ -61,6 +65,7 @@ const _RotatePlugin = class _RotatePlugin extends BasePlugin {
|
|
|
61
65
|
if (!pages) {
|
|
62
66
|
throw new Error("Pages not loaded");
|
|
63
67
|
}
|
|
68
|
+
this.rotate$.emit(rotation);
|
|
64
69
|
this.dispatchCoreAction(setRotation(rotation));
|
|
65
70
|
}
|
|
66
71
|
rotateForward() {
|
|
@@ -77,10 +82,12 @@ const _RotatePlugin = class _RotatePlugin extends BasePlugin {
|
|
|
77
82
|
setRotation: (rotation) => this.setRotation(rotation),
|
|
78
83
|
getRotation: () => this.coreState.core.rotation,
|
|
79
84
|
rotateForward: () => this.rotateForward(),
|
|
80
|
-
rotateBackward: () => this.rotateBackward()
|
|
81
|
-
getMatrix: ({ w = 0, h = 0, asString = true } = {}) => rotationMatrix(this.coreState.core.rotation, w, h, asString)
|
|
85
|
+
rotateBackward: () => this.rotateBackward()
|
|
82
86
|
};
|
|
83
87
|
}
|
|
88
|
+
getMatrixAsString(options = { w: 0, h: 0 }) {
|
|
89
|
+
return getRotationMatrixString(this.coreState.core.rotation, options.w, options.h);
|
|
90
|
+
}
|
|
84
91
|
async destroy() {
|
|
85
92
|
this.rotate$.clear();
|
|
86
93
|
super.destroy();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/lib/manifest.ts","../src/lib/utils.ts","../src/lib/rotate-plugin.ts","../src/lib/index.ts"],"sourcesContent":["import { PluginManifest } from '@embedpdf/core';\nimport { RotatePluginConfig } from './types';\n\nexport const ROTATE_PLUGIN_ID = 'rotate';\n\nexport const manifest: PluginManifest<RotatePluginConfig> = {\n id: ROTATE_PLUGIN_ID,\n name: 'Rotate Plugin',\n version: '1.0.0',\n provides: ['rotate'],\n requires: ['loader'],\n optional: ['spread'],\n defaultConfig: {\n enabled: true,\n },\n};\n","import { Rotation } from '@embedpdf/models';\n\n/**\n * Returns the 6-tuple
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/lib/manifest.ts","../src/lib/utils.ts","../src/lib/rotate-plugin.ts","../src/lib/index.ts"],"sourcesContent":["import { PluginManifest } from '@embedpdf/core';\nimport { RotatePluginConfig } from './types';\n\nexport const ROTATE_PLUGIN_ID = 'rotate';\n\nexport const manifest: PluginManifest<RotatePluginConfig> = {\n id: ROTATE_PLUGIN_ID,\n name: 'Rotate Plugin',\n version: '1.0.0',\n provides: ['rotate'],\n requires: ['loader'],\n optional: ['spread'],\n defaultConfig: {\n enabled: true,\n },\n};\n","import { Rotation } from '@embedpdf/models';\n\n/**\n * Returns the 6-tuple transformation matrix for rotation.\n * Rotation is clockwise, origin = top-left (0 0).\n *\n * ── Note on e,f ───────────────────────────────\n * For 0°/180° no translation is needed.\n * For 90°/270° you may want to pass the page\n * height / width so the page stays in positive\n * coordinates. Keep them 0 and handle layout\n * elsewhere if that's what you do today.\n */\nexport function getRotationMatrix(\n rotation: Rotation,\n w: number,\n h: number,\n): [number, number, number, number, number, number] {\n let a = 1,\n b = 0,\n c = 0,\n d = 1,\n e = 0,\n f = 0;\n\n switch (rotation) {\n case 1: // 90°\n a = 0;\n b = 1;\n c = -1;\n d = 0;\n e = h;\n break;\n case 2: // 180°\n a = -1;\n b = 0;\n c = 0;\n d = -1;\n e = w;\n f = h;\n break;\n case 3: // 270°\n a = 0;\n b = -1;\n c = 1;\n d = 0;\n f = w;\n break;\n }\n\n return [a, b, c, d, e, f];\n}\n\n/**\n * Returns the CSS matrix transformation string for rotation.\n * Rotation is clockwise, origin = top-left (0 0).\n */\nexport function getRotationMatrixString(rotation: Rotation, w: number, h: number): string {\n const [a, b, c, d, e, f] = getRotationMatrix(rotation, w, h);\n return `matrix(${a},${b},${c},${d},${e},${f})`;\n}\n\n/**\n * Returns the next rotation.\n */\nexport function getNextRotation(current: Rotation): Rotation {\n return ((current + 1) % 4) as Rotation;\n}\n\n/**\n * Returns the previous rotation.\n */\nexport function getPreviousRotation(current: Rotation): Rotation {\n return ((current + 3) % 4) as Rotation; // +3 is equivalent to -1 in modulo 4\n}\n","import { BasePlugin, createBehaviorEmitter, PluginRegistry, setRotation } from '@embedpdf/core';\nimport { Rotation } from '@embedpdf/models';\nimport { GetMatrixOptions, RotateCapability, RotatePluginConfig } from './types';\nimport { getNextRotation, getPreviousRotation, getRotationMatrixString } from './utils';\n\nexport class RotatePlugin extends BasePlugin<RotatePluginConfig, RotateCapability> {\n static readonly id = 'rotate' as const;\n private readonly rotate$ = createBehaviorEmitter<Rotation>();\n\n constructor(id: string, registry: PluginRegistry, cfg: RotatePluginConfig) {\n super(id, registry);\n this.resetReady();\n const rotation = cfg.defaultRotation ?? this.coreState.core.rotation;\n this.setRotation(rotation);\n this.markReady();\n }\n\n async initialize(_config: RotatePluginConfig): Promise<void> {}\n\n private setRotation(rotation: Rotation): void {\n const pages = this.coreState.core.pages;\n if (!pages) {\n throw new Error('Pages not loaded');\n }\n\n this.rotate$.emit(rotation);\n this.dispatchCoreAction(setRotation(rotation));\n }\n\n private rotateForward(): void {\n const rotation = getNextRotation(this.coreState.core.rotation);\n this.setRotation(rotation);\n }\n\n private rotateBackward(): void {\n const rotation = getPreviousRotation(this.coreState.core.rotation);\n this.setRotation(rotation);\n }\n\n protected buildCapability(): RotateCapability {\n return {\n onRotateChange: this.rotate$.on,\n setRotation: (rotation) => this.setRotation(rotation),\n getRotation: () => this.coreState.core.rotation,\n rotateForward: () => this.rotateForward(),\n rotateBackward: () => this.rotateBackward(),\n };\n }\n\n public getMatrixAsString(options: GetMatrixOptions = { w: 0, h: 0 }): string {\n return getRotationMatrixString(this.coreState.core.rotation, options.w, options.h);\n }\n\n async destroy(): Promise<void> {\n this.rotate$.clear();\n super.destroy();\n }\n}\n","import { PluginPackage } from '@embedpdf/core';\nimport { manifest, ROTATE_PLUGIN_ID } from './manifest';\nimport { RotatePluginConfig } from './types';\nimport { RotatePlugin } from './rotate-plugin';\n\nexport const RotatePluginPackage: PluginPackage<RotatePlugin, RotatePluginConfig> = {\n manifest,\n create: (registry, config) => new RotatePlugin(ROTATE_PLUGIN_ID, registry, config),\n reducer: () => {},\n initialState: {},\n};\n\nexport * from './rotate-plugin';\nexport * from './types';\nexport * from './manifest';\n"],"names":[],"mappings":";AAGO,MAAM,mBAAmB;AAEzB,MAAM,WAA+C;AAAA,EAC1D,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU,CAAC,QAAQ;AAAA,EACnB,UAAU,CAAC,QAAQ;AAAA,EACnB,UAAU,CAAC,QAAQ;AAAA,EACnB,eAAe;AAAA,IACb,SAAS;AAAA,EAAA;AAEb;ACFgB,SAAA,kBACd,UACA,GACA,GACkD;AAC9C,MAAA,IAAI,GACN,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI;AAEN,UAAQ,UAAU;AAAA,IAChB,KAAK;AACC,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACJ;AAAA,IACF,KAAK;AACC,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACJ;AAAA,IACF,KAAK;AACC,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACJ;AAAA,EAAA;AAGJ,SAAO,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAC1B;AAMgB,SAAA,wBAAwB,UAAoB,GAAW,GAAmB;AAClF,QAAA,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,IAAI,kBAAkB,UAAU,GAAG,CAAC;AACpD,SAAA,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AAC7C;AAKO,SAAS,gBAAgB,SAA6B;AAC3D,UAAS,UAAU,KAAK;AAC1B;AAKO,SAAS,oBAAoB,SAA6B;AAC/D,UAAS,UAAU,KAAK;AAC1B;ACrEO,MAAM,gBAAN,MAAM,sBAAqB,WAAiD;AAAA,EAIjF,YAAY,IAAY,UAA0B,KAAyB;AACzE,UAAM,IAAI,QAAQ;AAHpB,SAAiB,UAAU,sBAAgC;AAIzD,SAAK,WAAW;AAChB,UAAM,WAAW,IAAI,mBAAmB,KAAK,UAAU,KAAK;AAC5D,SAAK,YAAY,QAAQ;AACzB,SAAK,UAAU;AAAA,EAAA;AAAA,EAGjB,MAAM,WAAW,SAA4C;AAAA,EAAA;AAAA,EAErD,YAAY,UAA0B;AACtC,UAAA,QAAQ,KAAK,UAAU,KAAK;AAClC,QAAI,CAAC,OAAO;AACJ,YAAA,IAAI,MAAM,kBAAkB;AAAA,IAAA;AAG/B,SAAA,QAAQ,KAAK,QAAQ;AACrB,SAAA,mBAAmB,YAAY,QAAQ,CAAC;AAAA,EAAA;AAAA,EAGvC,gBAAsB;AAC5B,UAAM,WAAW,gBAAgB,KAAK,UAAU,KAAK,QAAQ;AAC7D,SAAK,YAAY,QAAQ;AAAA,EAAA;AAAA,EAGnB,iBAAuB;AAC7B,UAAM,WAAW,oBAAoB,KAAK,UAAU,KAAK,QAAQ;AACjE,SAAK,YAAY,QAAQ;AAAA,EAAA;AAAA,EAGjB,kBAAoC;AACrC,WAAA;AAAA,MACL,gBAAgB,KAAK,QAAQ;AAAA,MAC7B,aAAa,CAAC,aAAa,KAAK,YAAY,QAAQ;AAAA,MACpD,aAAa,MAAM,KAAK,UAAU,KAAK;AAAA,MACvC,eAAe,MAAM,KAAK,cAAc;AAAA,MACxC,gBAAgB,MAAM,KAAK,eAAe;AAAA,IAC5C;AAAA,EAAA;AAAA,EAGK,kBAAkB,UAA4B,EAAE,GAAG,GAAG,GAAG,KAAa;AACpE,WAAA,wBAAwB,KAAK,UAAU,KAAK,UAAU,QAAQ,GAAG,QAAQ,CAAC;AAAA,EAAA;AAAA,EAGnF,MAAM,UAAyB;AAC7B,SAAK,QAAQ,MAAM;AACnB,UAAM,QAAQ;AAAA,EAAA;AAElB;AAnDE,cAAgB,KAAK;AADhB,IAAM,eAAN;ACAA,MAAM,sBAAuE;AAAA,EAClF;AAAA,EACA,QAAQ,CAAC,UAAU,WAAW,IAAI,aAAa,kBAAkB,UAAU,MAAM;AAAA,EACjF,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,cAAc,CAAA;AAChB;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BasePlugin, PluginRegistry } from '@embedpdf/core';
|
|
2
|
-
import { RotateCapability, RotatePluginConfig } from './types';
|
|
2
|
+
import { GetMatrixOptions, RotateCapability, RotatePluginConfig } from './types';
|
|
3
3
|
export declare class RotatePlugin extends BasePlugin<RotatePluginConfig, RotateCapability> {
|
|
4
4
|
static readonly id: "rotate";
|
|
5
5
|
private readonly rotate$;
|
|
@@ -9,5 +9,6 @@ export declare class RotatePlugin extends BasePlugin<RotatePluginConfig, RotateC
|
|
|
9
9
|
private rotateForward;
|
|
10
10
|
private rotateBackward;
|
|
11
11
|
protected buildCapability(): RotateCapability;
|
|
12
|
+
getMatrixAsString(options?: GetMatrixOptions): string;
|
|
12
13
|
destroy(): Promise<void>;
|
|
13
14
|
}
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { BasePluginConfig } from '@embedpdf/core';
|
|
1
|
+
import { BasePluginConfig, EventHook } from '@embedpdf/core';
|
|
2
2
|
import { Rotation } from '@embedpdf/models';
|
|
3
3
|
export interface RotatePluginConfig extends BasePluginConfig {
|
|
4
4
|
defaultRotation?: Rotation;
|
|
5
5
|
}
|
|
6
|
+
export interface GetMatrixOptions {
|
|
7
|
+
w: number;
|
|
8
|
+
h: number;
|
|
9
|
+
}
|
|
6
10
|
export interface RotateCapability {
|
|
7
|
-
onRotateChange
|
|
11
|
+
onRotateChange: EventHook<Rotation>;
|
|
8
12
|
setRotation(rotation: Rotation): void;
|
|
9
13
|
getRotation(): Rotation;
|
|
10
14
|
rotateForward(): void;
|
|
11
15
|
rotateBackward(): void;
|
|
12
|
-
getMatrix(opts?: {
|
|
13
|
-
w?: number;
|
|
14
|
-
h?: number;
|
|
15
|
-
asString?: boolean;
|
|
16
|
-
}): string | [number, number, number, number, number, number];
|
|
17
16
|
}
|
|
18
17
|
export interface RotateState {
|
|
19
18
|
rotation: Rotation;
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Rotation } from '@embedpdf/models';
|
|
2
2
|
/**
|
|
3
|
-
* Returns the 6-tuple
|
|
4
|
-
* `matrix(a,b,c,d,e,f)` or a ready-made CSS string.
|
|
3
|
+
* Returns the 6-tuple transformation matrix for rotation.
|
|
5
4
|
* Rotation is clockwise, origin = top-left (0 0).
|
|
6
5
|
*
|
|
7
6
|
* ── Note on e,f ───────────────────────────────
|
|
@@ -9,6 +8,19 @@ import { Rotation } from '@embedpdf/models';
|
|
|
9
8
|
* For 90°/270° you may want to pass the page
|
|
10
9
|
* height / width so the page stays in positive
|
|
11
10
|
* coordinates. Keep them 0 and handle layout
|
|
12
|
-
* elsewhere if that
|
|
11
|
+
* elsewhere if that's what you do today.
|
|
13
12
|
*/
|
|
14
|
-
export declare function
|
|
13
|
+
export declare function getRotationMatrix(rotation: Rotation, w: number, h: number): [number, number, number, number, number, number];
|
|
14
|
+
/**
|
|
15
|
+
* Returns the CSS matrix transformation string for rotation.
|
|
16
|
+
* Rotation is clockwise, origin = top-left (0 0).
|
|
17
|
+
*/
|
|
18
|
+
export declare function getRotationMatrixString(rotation: Rotation, w: number, h: number): string;
|
|
19
|
+
/**
|
|
20
|
+
* Returns the next rotation.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getNextRotation(current: Rotation): Rotation;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the previous rotation.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getPreviousRotation(current: Rotation): Rotation;
|
package/dist/preact/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core/preact"),t=require("@embedpdf/plugin-rotate")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core/preact"),t=require("@embedpdf/plugin-rotate");require("preact");const r=require("preact/hooks"),o=require("preact/jsx-runtime"),i=()=>e.usePlugin(t.RotatePlugin.id),s=()=>e.useCapability(t.RotatePlugin.id);exports.Rotate=function({children:e,pageSize:t,style:r,...s}){const{plugin:a}=i(),n=(null==a?void 0:a.getMatrixAsString({w:t.width,h:t.height}))||"matrix(1, 0, 0, 1, 0, 0)";return o.jsx("div",{...s,style:{position:"absolute",transformOrigin:"0 0",transform:n,...r},children:e})},exports.useRotate=()=>{const{provides:e}=s(),[t,o]=r.useState(0);return r.useEffect((()=>null==e?void 0:e.onRotateChange((e=>o(e)))),[e]),{rotation:t,provides:e}},exports.useRotateCapability=s,exports.useRotatePlugin=i,Object.keys(t).forEach((e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})}));
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/shared/hooks/use-rotate.ts","../../src/shared/components/rotate.tsx"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\n\nexport const useRotatePlugin = () => usePlugin<RotatePlugin>(RotatePlugin.id);\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n","import { ReactNode, HTMLAttributes, CSSProperties } from '@framework';\nimport { Size } from '@embedpdf/models';\n\nimport {
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/shared/hooks/use-rotate.ts","../../src/shared/components/rotate.tsx"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { Rotation } from '@embedpdf/models';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\nimport { useEffect, useState } from '@framework';\n\nexport const useRotatePlugin = () => usePlugin<RotatePlugin>(RotatePlugin.id);\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n\nexport const useRotate = () => {\n const { provides } = useRotateCapability();\n const [rotation, setRotation] = useState<Rotation>(0);\n\n useEffect(() => {\n return provides?.onRotateChange((rotation) => setRotation(rotation));\n }, [provides]);\n\n return {\n rotation,\n provides,\n };\n};\n","import { ReactNode, HTMLAttributes, CSSProperties } from '@framework';\nimport { Size } from '@embedpdf/models';\n\nimport { useRotatePlugin } from '../hooks';\n\ntype RotateProps = Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {\n children: ReactNode;\n pageSize: Size;\n style?: CSSProperties;\n};\n\nexport function Rotate({ children, pageSize, style, ...props }: RotateProps) {\n const { plugin: rotate } = useRotatePlugin();\n const matrix =\n rotate?.getMatrixAsString({\n w: pageSize.width,\n h: pageSize.height,\n }) || '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 ...style,\n }}\n >\n {children}\n </div>\n );\n}\n"],"names":["useRotatePlugin","usePlugin","RotatePlugin","id","useRotateCapability","useCapability","children","pageSize","style","props","plugin","rotate","matrix","getMatrixAsString","w","width","h","height","jsxRuntime","jsx","position","transformOrigin","transform","provides","rotation","setRotation","useState","useEffect","onRotateChange"],"mappings":"gPAKaA,EAAkB,IAAMC,YAAwBC,EAAAA,aAAaC,IAC7DC,EAAsB,IAAMC,gBAA4BH,EAAAA,aAAaC,mBCK3E,UAAgBG,SAAEA,EAAAC,SAAUA,QAAUC,KAAUC,IACrD,MAAQC,OAAQC,GAAWX,IACrBY,SACJD,WAAQE,kBAAkB,CACxBC,EAAGP,EAASQ,MACZC,EAAGT,EAASU,WACR,2BAGN,OAAAC,EAAAC,IAAC,MAAA,IACKV,EACJD,MAAO,CACLY,SAAU,WACVC,gBAAiB,MACjBC,UAAWV,KACRJ,GAGJF,YAGP,oBDxByB,KACjB,MAAAiB,SAAEA,GAAanB,KACdoB,EAAUC,GAAeC,EAAAA,SAAmB,GAM5C,OAJPC,EAAAA,WAAU,IACS,MAAVJ,OAAU,EAAAA,EAAAK,gBAAgBJ,GAAaC,EAAYD,MACzD,CAACD,IAEG,CACLC,WACAD,WACF"}
|
package/dist/preact/index.js
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
import { usePlugin, useCapability } from "@embedpdf/core/preact";
|
|
2
2
|
import { RotatePlugin } from "@embedpdf/plugin-rotate";
|
|
3
3
|
export * from "@embedpdf/plugin-rotate";
|
|
4
|
+
import "preact";
|
|
5
|
+
import { useState, useEffect } from "preact/hooks";
|
|
4
6
|
import { jsx } from "preact/jsx-runtime";
|
|
5
7
|
const useRotatePlugin = () => usePlugin(RotatePlugin.id);
|
|
6
8
|
const useRotateCapability = () => useCapability(RotatePlugin.id);
|
|
9
|
+
const useRotate = () => {
|
|
10
|
+
const { provides } = useRotateCapability();
|
|
11
|
+
const [rotation, setRotation] = useState(0);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
return provides == null ? void 0 : provides.onRotateChange((rotation2) => setRotation(rotation2));
|
|
14
|
+
}, [provides]);
|
|
15
|
+
return {
|
|
16
|
+
rotation,
|
|
17
|
+
provides
|
|
18
|
+
};
|
|
19
|
+
};
|
|
7
20
|
function Rotate({ children, pageSize, style, ...props }) {
|
|
8
|
-
const {
|
|
9
|
-
const matrix = (rotate == null ? void 0 : rotate.
|
|
21
|
+
const { plugin: rotate } = useRotatePlugin();
|
|
22
|
+
const matrix = (rotate == null ? void 0 : rotate.getMatrixAsString({
|
|
10
23
|
w: pageSize.width,
|
|
11
24
|
h: pageSize.height
|
|
12
25
|
})) || "matrix(1, 0, 0, 1, 0, 0)";
|
|
@@ -26,6 +39,7 @@ function Rotate({ children, pageSize, style, ...props }) {
|
|
|
26
39
|
}
|
|
27
40
|
export {
|
|
28
41
|
Rotate,
|
|
42
|
+
useRotate,
|
|
29
43
|
useRotateCapability,
|
|
30
44
|
useRotatePlugin
|
|
31
45
|
};
|
package/dist/preact/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/shared/hooks/use-rotate.ts","../../src/shared/components/rotate.tsx"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\n\nexport const useRotatePlugin = () => usePlugin<RotatePlugin>(RotatePlugin.id);\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n","import { ReactNode, HTMLAttributes, CSSProperties } from '@framework';\nimport { Size } from '@embedpdf/models';\n\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/shared/hooks/use-rotate.ts","../../src/shared/components/rotate.tsx"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { Rotation } from '@embedpdf/models';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\nimport { useEffect, useState } from '@framework';\n\nexport const useRotatePlugin = () => usePlugin<RotatePlugin>(RotatePlugin.id);\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n\nexport const useRotate = () => {\n const { provides } = useRotateCapability();\n const [rotation, setRotation] = useState<Rotation>(0);\n\n useEffect(() => {\n return provides?.onRotateChange((rotation) => setRotation(rotation));\n }, [provides]);\n\n return {\n rotation,\n provides,\n };\n};\n","import { ReactNode, HTMLAttributes, CSSProperties } from '@framework';\nimport { Size } from '@embedpdf/models';\n\nimport { useRotatePlugin } from '../hooks';\n\ntype RotateProps = Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {\n children: ReactNode;\n pageSize: Size;\n style?: CSSProperties;\n};\n\nexport function Rotate({ children, pageSize, style, ...props }: RotateProps) {\n const { plugin: rotate } = useRotatePlugin();\n const matrix =\n rotate?.getMatrixAsString({\n w: pageSize.width,\n h: pageSize.height,\n }) || '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 ...style,\n }}\n >\n {children}\n </div>\n );\n}\n"],"names":["rotation"],"mappings":";;;;;;AAKO,MAAM,kBAAkB,MAAM,UAAwB,aAAa,EAAE;AACrE,MAAM,sBAAsB,MAAM,cAA4B,aAAa,EAAE;AAE7E,MAAM,YAAY,MAAM;AACvB,QAAA,EAAE,SAAS,IAAI,oBAAoB;AACzC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAmB,CAAC;AAEpD,YAAU,MAAM;AACd,WAAO,qCAAU,eAAe,CAACA,cAAa,YAAYA,SAAQ;AAAA,EAAC,GAClE,CAAC,QAAQ,CAAC;AAEN,SAAA;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;ACTO,SAAS,OAAO,EAAE,UAAU,UAAU,OAAO,GAAG,SAAsB;AAC3E,QAAM,EAAE,QAAQ,OAAO,IAAI,gBAAgB;AACrC,QAAA,UACJ,iCAAQ,kBAAkB;AAAA,IACxB,GAAG,SAAS;AAAA,IACZ,GAAG,SAAS;AAAA,EACb,OAAK;AAGN,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO;AAAA,QACL,UAAU;AAAA,QACV,iBAAiB;AAAA,QACjB,WAAW;AAAA,QACX,GAAG;AAAA,MACL;AAAA,MAEC;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
package/dist/react/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core/react"),t=require("@embedpdf/plugin-rotate"),r=require("react/jsx-runtime"),i=()=>e.useCapability(t.RotatePlugin.id);exports.Rotate=function({children:e,pageSize:t,style:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core/react"),t=require("@embedpdf/plugin-rotate"),r=require("react"),o=require("react/jsx-runtime"),i=()=>e.usePlugin(t.RotatePlugin.id),s=()=>e.useCapability(t.RotatePlugin.id);exports.Rotate=function({children:e,pageSize:t,style:r,...s}){const{plugin:a}=i(),n=(null==a?void 0:a.getMatrixAsString({w:t.width,h:t.height}))||"matrix(1, 0, 0, 1, 0, 0)";return o.jsx("div",{...s,style:{position:"absolute",transformOrigin:"0 0",transform:n,...r},children:e})},exports.useRotate=()=>{const{provides:e}=s(),[t,o]=r.useState(0);return r.useEffect((()=>null==e?void 0:e.onRotateChange((e=>o(e)))),[e]),{rotation:t,provides:e}},exports.useRotateCapability=s,exports.useRotatePlugin=i,Object.keys(t).forEach((e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})}));
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/react/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/shared/hooks/use-rotate.ts","../../src/shared/components/rotate.tsx"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\n\nexport const useRotatePlugin = () => usePlugin<RotatePlugin>(RotatePlugin.id);\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n","import { ReactNode, HTMLAttributes, CSSProperties } from '@framework';\nimport { Size } from '@embedpdf/models';\n\nimport {
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/shared/hooks/use-rotate.ts","../../src/shared/components/rotate.tsx"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { Rotation } from '@embedpdf/models';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\nimport { useEffect, useState } from '@framework';\n\nexport const useRotatePlugin = () => usePlugin<RotatePlugin>(RotatePlugin.id);\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n\nexport const useRotate = () => {\n const { provides } = useRotateCapability();\n const [rotation, setRotation] = useState<Rotation>(0);\n\n useEffect(() => {\n return provides?.onRotateChange((rotation) => setRotation(rotation));\n }, [provides]);\n\n return {\n rotation,\n provides,\n };\n};\n","import { ReactNode, HTMLAttributes, CSSProperties } from '@framework';\nimport { Size } from '@embedpdf/models';\n\nimport { useRotatePlugin } from '../hooks';\n\ntype RotateProps = Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {\n children: ReactNode;\n pageSize: Size;\n style?: CSSProperties;\n};\n\nexport function Rotate({ children, pageSize, style, ...props }: RotateProps) {\n const { plugin: rotate } = useRotatePlugin();\n const matrix =\n rotate?.getMatrixAsString({\n w: pageSize.width,\n h: pageSize.height,\n }) || '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 ...style,\n }}\n >\n {children}\n </div>\n );\n}\n"],"names":["useRotatePlugin","usePlugin","RotatePlugin","id","useRotateCapability","useCapability","children","pageSize","style","props","plugin","rotate","matrix","getMatrixAsString","w","width","h","height","jsxRuntime","jsx","position","transformOrigin","transform","provides","rotation","setRotation","useState","useEffect","onRotateChange"],"mappings":"+MAKaA,EAAkB,IAAMC,YAAwBC,EAAAA,aAAaC,IAC7DC,EAAsB,IAAMC,gBAA4BH,EAAAA,aAAaC,mBCK3E,UAAgBG,SAAEA,EAAAC,SAAUA,QAAUC,KAAUC,IACrD,MAAQC,OAAQC,GAAWX,IACrBY,SACJD,WAAQE,kBAAkB,CACxBC,EAAGP,EAASQ,MACZC,EAAGT,EAASU,WACR,2BAGN,OAAAC,EAAAC,IAAC,MAAA,IACKV,EACJD,MAAO,CACLY,SAAU,WACVC,gBAAiB,MACjBC,UAAWV,KACRJ,GAGJF,YAGP,oBDxByB,KACjB,MAAAiB,SAAEA,GAAanB,KACdoB,EAAUC,GAAeC,EAAAA,SAAmB,GAM5C,OAJPC,EAAAA,WAAU,IACS,MAAVJ,OAAU,EAAAA,EAAAK,gBAAgBJ,GAAaC,EAAYD,MACzD,CAACD,IAEG,CACLC,WACAD,WACF"}
|
package/dist/react/index.js
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import { usePlugin, useCapability } from "@embedpdf/core/react";
|
|
2
2
|
import { RotatePlugin } from "@embedpdf/plugin-rotate";
|
|
3
3
|
export * from "@embedpdf/plugin-rotate";
|
|
4
|
+
import { useState, useEffect } from "react";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
const useRotatePlugin = () => usePlugin(RotatePlugin.id);
|
|
6
7
|
const useRotateCapability = () => useCapability(RotatePlugin.id);
|
|
8
|
+
const useRotate = () => {
|
|
9
|
+
const { provides } = useRotateCapability();
|
|
10
|
+
const [rotation, setRotation] = useState(0);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
return provides == null ? void 0 : provides.onRotateChange((rotation2) => setRotation(rotation2));
|
|
13
|
+
}, [provides]);
|
|
14
|
+
return {
|
|
15
|
+
rotation,
|
|
16
|
+
provides
|
|
17
|
+
};
|
|
18
|
+
};
|
|
7
19
|
function Rotate({ children, pageSize, style, ...props }) {
|
|
8
|
-
const {
|
|
9
|
-
const matrix = (rotate == null ? void 0 : rotate.
|
|
20
|
+
const { plugin: rotate } = useRotatePlugin();
|
|
21
|
+
const matrix = (rotate == null ? void 0 : rotate.getMatrixAsString({
|
|
10
22
|
w: pageSize.width,
|
|
11
23
|
h: pageSize.height
|
|
12
24
|
})) || "matrix(1, 0, 0, 1, 0, 0)";
|
|
@@ -26,6 +38,7 @@ function Rotate({ children, pageSize, style, ...props }) {
|
|
|
26
38
|
}
|
|
27
39
|
export {
|
|
28
40
|
Rotate,
|
|
41
|
+
useRotate,
|
|
29
42
|
useRotateCapability,
|
|
30
43
|
useRotatePlugin
|
|
31
44
|
};
|
package/dist/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/shared/hooks/use-rotate.ts","../../src/shared/components/rotate.tsx"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\n\nexport const useRotatePlugin = () => usePlugin<RotatePlugin>(RotatePlugin.id);\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n","import { ReactNode, HTMLAttributes, CSSProperties } from '@framework';\nimport { Size } from '@embedpdf/models';\n\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/shared/hooks/use-rotate.ts","../../src/shared/components/rotate.tsx"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { Rotation } from '@embedpdf/models';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\nimport { useEffect, useState } from '@framework';\n\nexport const useRotatePlugin = () => usePlugin<RotatePlugin>(RotatePlugin.id);\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n\nexport const useRotate = () => {\n const { provides } = useRotateCapability();\n const [rotation, setRotation] = useState<Rotation>(0);\n\n useEffect(() => {\n return provides?.onRotateChange((rotation) => setRotation(rotation));\n }, [provides]);\n\n return {\n rotation,\n provides,\n };\n};\n","import { ReactNode, HTMLAttributes, CSSProperties } from '@framework';\nimport { Size } from '@embedpdf/models';\n\nimport { useRotatePlugin } from '../hooks';\n\ntype RotateProps = Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {\n children: ReactNode;\n pageSize: Size;\n style?: CSSProperties;\n};\n\nexport function Rotate({ children, pageSize, style, ...props }: RotateProps) {\n const { plugin: rotate } = useRotatePlugin();\n const matrix =\n rotate?.getMatrixAsString({\n w: pageSize.width,\n h: pageSize.height,\n }) || '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 ...style,\n }}\n >\n {children}\n </div>\n );\n}\n"],"names":["rotation"],"mappings":";;;;;AAKO,MAAM,kBAAkB,MAAM,UAAwB,aAAa,EAAE;AACrE,MAAM,sBAAsB,MAAM,cAA4B,aAAa,EAAE;AAE7E,MAAM,YAAY,MAAM;AACvB,QAAA,EAAE,SAAS,IAAI,oBAAoB;AACzC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAmB,CAAC;AAEpD,YAAU,MAAM;AACd,WAAO,qCAAU,eAAe,CAACA,cAAa,YAAYA,SAAQ;AAAA,EAAC,GAClE,CAAC,QAAQ,CAAC;AAEN,SAAA;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;ACTO,SAAS,OAAO,EAAE,UAAU,UAAU,OAAO,GAAG,SAAsB;AAC3E,QAAM,EAAE,QAAQ,OAAO,IAAI,gBAAgB;AACrC,QAAA,UACJ,iCAAQ,kBAAkB;AAAA,IACxB,GAAG,SAAS;AAAA,IACZ,GAAG,SAAS;AAAA,EACb,OAAK;AAGN,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO;AAAA,QACL,UAAU;AAAA,QACV,iBAAiB;AAAA,QACjB,WAAW;AAAA,QACX,GAAG;AAAA,MACL;AAAA,MAEC;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Rotation } from '@embedpdf/models';
|
|
1
2
|
import { RotatePlugin } from '../../lib/index.ts';
|
|
2
3
|
export declare const useRotatePlugin: () => {
|
|
3
4
|
plugin: RotatePlugin | null;
|
|
@@ -9,3 +10,7 @@ export declare const useRotateCapability: () => {
|
|
|
9
10
|
isLoading: boolean;
|
|
10
11
|
ready: Promise<void>;
|
|
11
12
|
};
|
|
13
|
+
export declare const useRotate: () => {
|
|
14
|
+
rotation: Rotation;
|
|
15
|
+
provides: Readonly<import('../../lib/index.ts').RotateCapability> | null;
|
|
16
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Rotation } from '@embedpdf/models';
|
|
1
2
|
import { RotatePlugin } from '../../lib/index.ts';
|
|
2
3
|
export declare const useRotatePlugin: () => {
|
|
3
4
|
plugin: RotatePlugin | null;
|
|
@@ -9,3 +10,7 @@ export declare const useRotateCapability: () => {
|
|
|
9
10
|
isLoading: boolean;
|
|
10
11
|
ready: Promise<void>;
|
|
11
12
|
};
|
|
13
|
+
export declare const useRotate: () => {
|
|
14
|
+
rotation: Rotation;
|
|
15
|
+
provides: Readonly<import('../../lib/index.ts').RotateCapability> | null;
|
|
16
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RotatePlugin } from '../../lib/index.ts';
|
|
2
|
+
import { Rotation } from '@embedpdf/models';
|
|
2
3
|
/**
|
|
3
4
|
* Hook to get the raw rotate plugin instance.
|
|
4
5
|
*/
|
|
@@ -8,3 +9,10 @@ export declare const useRotatePlugin: () => import('@embedpdf/core/vue').PluginS
|
|
|
8
9
|
* This provides methods for rotating the document.
|
|
9
10
|
*/
|
|
10
11
|
export declare const useRotateCapability: () => import('@embedpdf/core/vue').CapabilityState<Readonly<import('../../lib/index.ts').RotateCapability>>;
|
|
12
|
+
/**
|
|
13
|
+
* Hook that provides reactive rotation state and methods.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useRotate: () => {
|
|
16
|
+
rotation: import('vue').Ref<Rotation, Rotation>;
|
|
17
|
+
provides: import('vue').Ref<Readonly<import('../../lib/index.ts').RotateCapability> | null, Readonly<import('../../lib/index.ts').RotateCapability> | null>;
|
|
18
|
+
};
|
package/dist/vue/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core/vue"),t=require("@embedpdf/plugin-rotate"),r=require("vue"),o=()=>e.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core/vue"),t=require("@embedpdf/plugin-rotate"),r=require("vue"),o=()=>e.usePlugin(t.RotatePlugin.id),a=()=>e.useCapability(t.RotatePlugin.id),i=r.defineComponent({__name:"rotate",props:{pageSize:{}},setup(e){const t=e,{plugin:a}=o(),i=r.computed((()=>a.value?a.value.getMatrixAsString({w:t.pageSize.width,h:t.pageSize.height}):"matrix(1, 0, 0, 1, 0, 0)"));return(e,t)=>(r.openBlock(),r.createElementBlock("div",{style:r.normalizeStyle({position:"absolute",transformOrigin:"0 0",transform:i.value})},[r.renderSlot(e.$slots,"default")],4))}});exports.Rotate=i,exports.useRotate=()=>{const{provides:e}=a(),t=r.ref(0);return r.watchEffect((r=>{if(!e.value)return;r(e.value.onRotateChange((e=>{t.value=e})))})),{rotation:t,provides:e}},exports.useRotateCapability=a,exports.useRotatePlugin=o,Object.keys(t).forEach((e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})}));
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/vue/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/vue/hooks/use-rotate.ts","../../src/vue/components/rotate.vue"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/vue';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\n\n/**\n * Hook to get the raw rotate plugin instance.\n */\nexport const useRotatePlugin = () => usePlugin<RotatePlugin>(RotatePlugin.id);\n\n/**\n * Hook to get the rotate plugin's capability API.\n * This provides methods for rotating the document.\n */\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n","<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { Size } from '@embedpdf/models';\nimport {
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/vue/hooks/use-rotate.ts","../../src/vue/components/rotate.vue"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/vue';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\nimport { ref, watchEffect } from 'vue';\nimport { Rotation } from '@embedpdf/models';\n\n/**\n * Hook to get the raw rotate plugin instance.\n */\nexport const useRotatePlugin = () => usePlugin<RotatePlugin>(RotatePlugin.id);\n\n/**\n * Hook to get the rotate plugin's capability API.\n * This provides methods for rotating the document.\n */\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n\n/**\n * Hook that provides reactive rotation state and methods.\n */\nexport const useRotate = () => {\n const { provides } = useRotateCapability();\n const rotation = ref<Rotation>(0);\n\n watchEffect((onCleanup) => {\n if (!provides.value) return;\n\n const unsubscribe = provides.value.onRotateChange((newRotation) => {\n rotation.value = newRotation;\n });\n onCleanup(unsubscribe);\n });\n\n return {\n rotation,\n provides,\n };\n};\n","<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { Size } from '@embedpdf/models';\nimport { useRotatePlugin } from '../hooks';\n\ninterface Props {\n pageSize: Size;\n}\n\nconst props = defineProps<Props>();\n\nconst { plugin: rotate } = useRotatePlugin();\n\nconst transformMatrix = computed(() => {\n // If the capability is not yet available, return an identity matrix.\n if (!rotate.value) {\n return 'matrix(1, 0, 0, 1, 0, 0)';\n }\n\n // Get the CSS transform matrix string from the capability.\n return rotate.value.getMatrixAsString({\n w: props.pageSize.width,\n h: props.pageSize.height,\n });\n});\n</script>\n\n<template>\n <div\n :style=\"{\n position: 'absolute',\n transformOrigin: '0 0',\n transform: transformMatrix,\n }\"\n >\n <slot />\n </div>\n</template>\n"],"names":["useRotatePlugin","usePlugin","RotatePlugin","id","useRotateCapability","useCapability","props","__props","plugin","rotate","transformMatrix","computed","value","getMatrixAsString","w","pageSize","width","h","height","_createElementBlock","createElementBlock","style","_normalizeStyle","_renderSlot","_ctx","$slots","provides","rotation","ref","vue$1","watchEffect","onCleanup","onRotateChange","newRotation"],"mappings":"4KAQaA,EAAkB,IAAMC,YAAwBC,EAAAA,aAAaC,IAM7DC,EAAsB,IAAMC,gBAA4BH,EAAAA,aAAaC,sECLlF,MAAMG,EAAQC,GAENC,OAAQC,GAAWT,IAErBU,EAAkBC,EAAAA,UAAS,IAE1BF,EAAOG,MAKLH,EAAOG,MAAMC,kBAAkB,CACpCC,EAAGR,EAAMS,SAASC,MAClBC,EAAGX,EAAMS,SAASG,SANX,yDAYTC,EAAAC,mBAQM,MAAA,CAPHC,MAAKC,EAAAA,eAAA,qDAA+EZ,EAAeE,UAMpGW,aAAQC,EAAAC,OAAA,sDDhBa,KACjB,MAAAC,SAAEA,GAAatB,IACfuB,EAAWC,MAAc,GAWxB,OATPC,EAAAC,aAAaC,IACP,IAACL,EAASd,MAAO,OAKrBmB,EAHoBL,EAASd,MAAMoB,gBAAgBC,IACjDN,EAASf,MAAQqB,CAAA,IAEE,IAGhB,CACLN,WACAD,WACF"}
|
package/dist/vue/index.js
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
import { usePlugin, useCapability } from "@embedpdf/core/vue";
|
|
2
2
|
import { RotatePlugin } from "@embedpdf/plugin-rotate";
|
|
3
3
|
export * from "@embedpdf/plugin-rotate";
|
|
4
|
-
import { defineComponent, computed, createElementBlock, openBlock, normalizeStyle, renderSlot } from "vue";
|
|
4
|
+
import { ref, watchEffect, defineComponent, computed, createElementBlock, openBlock, normalizeStyle, renderSlot } from "vue";
|
|
5
5
|
const useRotatePlugin = () => usePlugin(RotatePlugin.id);
|
|
6
6
|
const useRotateCapability = () => useCapability(RotatePlugin.id);
|
|
7
|
+
const useRotate = () => {
|
|
8
|
+
const { provides } = useRotateCapability();
|
|
9
|
+
const rotation = ref(0);
|
|
10
|
+
watchEffect((onCleanup) => {
|
|
11
|
+
if (!provides.value) return;
|
|
12
|
+
const unsubscribe = provides.value.onRotateChange((newRotation) => {
|
|
13
|
+
rotation.value = newRotation;
|
|
14
|
+
});
|
|
15
|
+
onCleanup(unsubscribe);
|
|
16
|
+
});
|
|
17
|
+
return {
|
|
18
|
+
rotation,
|
|
19
|
+
provides
|
|
20
|
+
};
|
|
21
|
+
};
|
|
7
22
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
23
|
__name: "rotate",
|
|
9
24
|
props: {
|
|
@@ -11,15 +26,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11
26
|
},
|
|
12
27
|
setup(__props) {
|
|
13
28
|
const props = __props;
|
|
14
|
-
const {
|
|
29
|
+
const { plugin: rotate } = useRotatePlugin();
|
|
15
30
|
const transformMatrix = computed(() => {
|
|
16
31
|
if (!rotate.value) {
|
|
17
32
|
return "matrix(1, 0, 0, 1, 0, 0)";
|
|
18
33
|
}
|
|
19
|
-
return rotate.value.
|
|
34
|
+
return rotate.value.getMatrixAsString({
|
|
20
35
|
w: props.pageSize.width,
|
|
21
|
-
h: props.pageSize.height
|
|
22
|
-
asString: true
|
|
36
|
+
h: props.pageSize.height
|
|
23
37
|
});
|
|
24
38
|
});
|
|
25
39
|
return (_ctx, _cache) => {
|
|
@@ -37,6 +51,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
37
51
|
});
|
|
38
52
|
export {
|
|
39
53
|
_sfc_main as Rotate,
|
|
54
|
+
useRotate,
|
|
40
55
|
useRotateCapability,
|
|
41
56
|
useRotatePlugin
|
|
42
57
|
};
|
package/dist/vue/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/vue/hooks/use-rotate.ts","../../src/vue/components/rotate.vue"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/vue';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\n\n/**\n * Hook to get the raw rotate plugin instance.\n */\nexport const useRotatePlugin = () => usePlugin<RotatePlugin>(RotatePlugin.id);\n\n/**\n * Hook to get the rotate plugin's capability API.\n * This provides methods for rotating the document.\n */\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n","<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { Size } from '@embedpdf/models';\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/vue/hooks/use-rotate.ts","../../src/vue/components/rotate.vue"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/vue';\nimport { RotatePlugin } from '@embedpdf/plugin-rotate';\nimport { ref, watchEffect } from 'vue';\nimport { Rotation } from '@embedpdf/models';\n\n/**\n * Hook to get the raw rotate plugin instance.\n */\nexport const useRotatePlugin = () => usePlugin<RotatePlugin>(RotatePlugin.id);\n\n/**\n * Hook to get the rotate plugin's capability API.\n * This provides methods for rotating the document.\n */\nexport const useRotateCapability = () => useCapability<RotatePlugin>(RotatePlugin.id);\n\n/**\n * Hook that provides reactive rotation state and methods.\n */\nexport const useRotate = () => {\n const { provides } = useRotateCapability();\n const rotation = ref<Rotation>(0);\n\n watchEffect((onCleanup) => {\n if (!provides.value) return;\n\n const unsubscribe = provides.value.onRotateChange((newRotation) => {\n rotation.value = newRotation;\n });\n onCleanup(unsubscribe);\n });\n\n return {\n rotation,\n provides,\n };\n};\n","<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { Size } from '@embedpdf/models';\nimport { useRotatePlugin } from '../hooks';\n\ninterface Props {\n pageSize: Size;\n}\n\nconst props = defineProps<Props>();\n\nconst { plugin: rotate } = useRotatePlugin();\n\nconst transformMatrix = computed(() => {\n // If the capability is not yet available, return an identity matrix.\n if (!rotate.value) {\n return 'matrix(1, 0, 0, 1, 0, 0)';\n }\n\n // Get the CSS transform matrix string from the capability.\n return rotate.value.getMatrixAsString({\n w: props.pageSize.width,\n h: props.pageSize.height,\n });\n});\n</script>\n\n<template>\n <div\n :style=\"{\n position: 'absolute',\n transformOrigin: '0 0',\n transform: transformMatrix,\n }\"\n >\n <slot />\n </div>\n</template>\n"],"names":["_createElementBlock","_normalizeStyle","_renderSlot"],"mappings":";;;;AAQO,MAAM,kBAAkB,MAAM,UAAwB,aAAa,EAAE;AAMrE,MAAM,sBAAsB,MAAM,cAA4B,aAAa,EAAE;AAK7E,MAAM,YAAY,MAAM;AACvB,QAAA,EAAE,SAAS,IAAI,oBAAoB;AACnC,QAAA,WAAW,IAAc,CAAC;AAEhC,cAAY,CAAC,cAAc;AACrB,QAAA,CAAC,SAAS,MAAO;AAErB,UAAM,cAAc,SAAS,MAAM,eAAe,CAAC,gBAAgB;AACjE,eAAS,QAAQ;AAAA,IAAA,CAClB;AACD,cAAU,WAAW;AAAA,EAAA,CACtB;AAEM,SAAA;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;;;;;;;AC3BA,UAAM,QAAQ;AAEd,UAAM,EAAE,QAAQ,OAAO,IAAI,gBAAgB;AAErC,UAAA,kBAAkB,SAAS,MAAM;AAEjC,UAAA,CAAC,OAAO,OAAO;AACV,eAAA;AAAA,MAAA;AAIF,aAAA,OAAO,MAAM,kBAAkB;AAAA,QACpC,GAAG,MAAM,SAAS;AAAA,QAClB,GAAG,MAAM,SAAS;AAAA,MAAA,CACnB;AAAA,IAAA,CACF;;0BAICA,mBAQM,OAAA;AAAA,QAPH,OAAKC,eAAA;AAAA;;qBAA+E,gBAAe;AAAA;;QAMpGC,WAAQ,KAAA,QAAA,SAAA;AAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embedpdf/plugin-rotate",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@embedpdf/models": "1.0
|
|
31
|
+
"@embedpdf/models": "1.1.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/react": "^18.2.0",
|
|
35
35
|
"typescript": "^5.0.0",
|
|
36
|
-
"@embedpdf/core": "1.0
|
|
36
|
+
"@embedpdf/core": "1.1.0",
|
|
37
37
|
"@embedpdf/build": "1.0.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"react": ">=16.8.0",
|
|
42
42
|
"react-dom": ">=16.8.0",
|
|
43
43
|
"vue": ">=3.2.0",
|
|
44
|
-
"@embedpdf/core": "1.0
|
|
44
|
+
"@embedpdf/core": "1.1.0"
|
|
45
45
|
},
|
|
46
46
|
"files": [
|
|
47
47
|
"dist",
|