@embedpdf/plugin-spread 1.4.0 → 1.4.1
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.
|
@@ -22,6 +22,6 @@ export declare const useSpreadPlugin: () => {
|
|
|
22
22
|
* Returns the capability provider and reactive spread mode.
|
|
23
23
|
*/
|
|
24
24
|
export declare const useSpread: () => {
|
|
25
|
-
readonly spreadMode: SpreadMode;
|
|
26
25
|
readonly provides: Readonly<import('../../lib/index.ts').SpreadCapability> | null;
|
|
26
|
+
spreadMode: SpreadMode;
|
|
27
27
|
};
|
package/dist/svelte/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("svelte/internal/client"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("svelte/internal/client"),r=require("@embedpdf/core/svelte"),t=require("@embedpdf/plugin-spread");function o(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)}const p=o(e),d=()=>r.useCapability(t.SpreadPlugin.id);exports.useSpread=()=>{const e=d(),r=p.proxy({get provides(){return e.provides},spreadMode:t.SpreadMode.None});return p.user_effect((()=>{if(!e.provides)return;r.spreadMode=e.provides.getSpreadMode();return e.provides.onSpreadChange((e=>{r.spreadMode=e}))})),r},exports.useSpreadCapability=d,exports.useSpreadPlugin=()=>r.usePlugin(t.SpreadPlugin.id),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/svelte/hooks/use-spread.svelte.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/svelte';\nimport { SpreadMode, SpreadPlugin } from '@embedpdf/plugin-spread';\n\n/**\n * Hook to get the spread plugin's capability API.\n * This provides methods for controlling spread mode.\n */\nexport const useSpreadCapability = () => useCapability<SpreadPlugin>(SpreadPlugin.id);\n\n/**\n * Hook to get the raw spread plugin instance.\n * Useful for accessing plugin-specific properties or methods not exposed in the capability.\n */\nexport const useSpreadPlugin = () => usePlugin<SpreadPlugin>(SpreadPlugin.id);\n\n/**\n * Hook to manage spread mode state and listen to changes.\n * Returns the capability provider and reactive spread mode.\n */\nexport const useSpread = () => {\n const
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/svelte/hooks/use-spread.svelte.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/svelte';\nimport { SpreadMode, SpreadPlugin } from '@embedpdf/plugin-spread';\n\n/**\n * Hook to get the spread plugin's capability API.\n * This provides methods for controlling spread mode.\n */\nexport const useSpreadCapability = () => useCapability<SpreadPlugin>(SpreadPlugin.id);\n\n/**\n * Hook to get the raw spread plugin instance.\n * Useful for accessing plugin-specific properties or methods not exposed in the capability.\n */\nexport const useSpreadPlugin = () => usePlugin<SpreadPlugin>(SpreadPlugin.id);\n\n/**\n * Hook to manage spread mode state and listen to changes.\n * Returns the capability provider and reactive spread mode.\n */\nexport const useSpread = () => {\n const capability = useSpreadCapability();\n\n const state = $state({\n get provides() {\n return capability.provides;\n },\n spreadMode: SpreadMode.None as SpreadMode,\n });\n\n $effect(() => {\n if (!capability.provides) return;\n\n // Set initial spread mode\n state.spreadMode = capability.provides.getSpreadMode();\n\n // Subscribe to spread mode changes\n const unsubscribe = capability.provides.onSpreadChange((newSpreadMode) => {\n state.spreadMode = newSpreadMode;\n });\n\n return unsubscribe;\n });\n\n return state;\n};\n"],"names":["useSpreadCapability","useCapability","SpreadPlugin","id","capability","state","provides","spreadMode","SpreadMode","None","$","user_effect","getSpreadMode","onSpreadChange","newSpreadMode","usePlugin"],"mappings":"0dAOaA,EAA4B,IAAAC,gBAA4BC,EAAAA,aAAaC,2BAa1E,MAAAC,EAAaJ,IAEbK,WACA,YAAAC,GACK,OAAAF,EAAWE,QACpB,EACAC,WAAYC,EAAAA,WAAWC,OAiBlB,OAdPC,EAAAC,kBACO,IAAAP,EAAWE,SAAU,OAGpBD,EAAAE,WAAaH,EAAWE,SAASM,gBAOhC,OAJaR,EAAWE,SAASO,gBAAgBC,IACtDT,EAAME,WAAaO,CAAA,GAGd,IAGFT,CAAA,wDA9B4B,IAAAU,YAAwBb,EAAAA,aAAaC"}
|
package/dist/svelte/index.js
CHANGED
|
@@ -5,24 +5,22 @@ export * from "@embedpdf/plugin-spread";
|
|
|
5
5
|
const useSpreadCapability = () => useCapability(SpreadPlugin.id);
|
|
6
6
|
const useSpreadPlugin = () => usePlugin(SpreadPlugin.id);
|
|
7
7
|
const useSpread = () => {
|
|
8
|
-
const
|
|
9
|
-
|
|
8
|
+
const capability = useSpreadCapability();
|
|
9
|
+
const state = $.proxy({
|
|
10
|
+
get provides() {
|
|
11
|
+
return capability.provides;
|
|
12
|
+
},
|
|
13
|
+
spreadMode: SpreadMode.None
|
|
14
|
+
});
|
|
10
15
|
$.user_effect(() => {
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
const unsubscribe =
|
|
14
|
-
|
|
16
|
+
if (!capability.provides) return;
|
|
17
|
+
state.spreadMode = capability.provides.getSpreadMode();
|
|
18
|
+
const unsubscribe = capability.provides.onSpreadChange((newSpreadMode) => {
|
|
19
|
+
state.spreadMode = newSpreadMode;
|
|
15
20
|
});
|
|
16
21
|
return unsubscribe;
|
|
17
22
|
});
|
|
18
|
-
return
|
|
19
|
-
get spreadMode() {
|
|
20
|
-
return $.get(spreadMode);
|
|
21
|
-
},
|
|
22
|
-
get provides() {
|
|
23
|
-
return $.get(provides);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
23
|
+
return state;
|
|
26
24
|
};
|
|
27
25
|
export {
|
|
28
26
|
useSpread,
|
package/dist/svelte/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/svelte/hooks/use-spread.svelte.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/svelte';\nimport { SpreadMode, SpreadPlugin } from '@embedpdf/plugin-spread';\n\n/**\n * Hook to get the spread plugin's capability API.\n * This provides methods for controlling spread mode.\n */\nexport const useSpreadCapability = () => useCapability<SpreadPlugin>(SpreadPlugin.id);\n\n/**\n * Hook to get the raw spread plugin instance.\n * Useful for accessing plugin-specific properties or methods not exposed in the capability.\n */\nexport const useSpreadPlugin = () => usePlugin<SpreadPlugin>(SpreadPlugin.id);\n\n/**\n * Hook to manage spread mode state and listen to changes.\n * Returns the capability provider and reactive spread mode.\n */\nexport const useSpread = () => {\n const
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/svelte/hooks/use-spread.svelte.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/svelte';\nimport { SpreadMode, SpreadPlugin } from '@embedpdf/plugin-spread';\n\n/**\n * Hook to get the spread plugin's capability API.\n * This provides methods for controlling spread mode.\n */\nexport const useSpreadCapability = () => useCapability<SpreadPlugin>(SpreadPlugin.id);\n\n/**\n * Hook to get the raw spread plugin instance.\n * Useful for accessing plugin-specific properties or methods not exposed in the capability.\n */\nexport const useSpreadPlugin = () => usePlugin<SpreadPlugin>(SpreadPlugin.id);\n\n/**\n * Hook to manage spread mode state and listen to changes.\n * Returns the capability provider and reactive spread mode.\n */\nexport const useSpread = () => {\n const capability = useSpreadCapability();\n\n const state = $state({\n get provides() {\n return capability.provides;\n },\n spreadMode: SpreadMode.None as SpreadMode,\n });\n\n $effect(() => {\n if (!capability.provides) return;\n\n // Set initial spread mode\n state.spreadMode = capability.provides.getSpreadMode();\n\n // Subscribe to spread mode changes\n const unsubscribe = capability.provides.onSpreadChange((newSpreadMode) => {\n state.spreadMode = newSpreadMode;\n });\n\n return unsubscribe;\n });\n\n return state;\n};\n"],"names":[],"mappings":";;;;AAOa,MAAA,sBAA4B,MAAA,cAA4B,aAAa,EAAE;AAMvE,MAAA,kBAAwB,MAAA,UAAwB,aAAa,EAAE;AAM/D,MAAA,kBAAkB;AACvB,QAAA,aAAa,oBAAoB;QAEjC;IACA,IAAA,WAAW;AACN,aAAA,WAAW;AAAA,IACpB;AAAA,IACA,YAAY,WAAW;AAAA;AAGzB,IAAA,kBAAc;AACP,QAAA,CAAA,WAAW,SAAU;AAGpB,UAAA,aAAa,WAAW,SAAS,cAAc;UAG/C,cAAc,WAAW,SAAS,eAAA,CAAgB,kBAAkB;AACxE,YAAM,aAAa;AAAA,KACpB;WAEM;AAAA,GACR;SAEM;AACT;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embedpdf/plugin-spread",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@embedpdf/models": "1.4.
|
|
37
|
+
"@embedpdf/models": "1.4.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/react": "^18.2.0",
|
|
41
41
|
"typescript": "^5.0.0",
|
|
42
|
+
"@embedpdf/core": "1.4.1",
|
|
42
43
|
"@embedpdf/build": "1.1.0",
|
|
43
|
-
"@embedpdf/
|
|
44
|
-
"@embedpdf/plugin-loader": "1.4.0"
|
|
44
|
+
"@embedpdf/plugin-loader": "1.4.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"react": ">=16.8.0",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"preact": "^10.26.4",
|
|
50
50
|
"vue": ">=3.2.0",
|
|
51
51
|
"svelte": ">=5 <6",
|
|
52
|
-
"@embedpdf/core": "1.4.
|
|
53
|
-
"@embedpdf/plugin-loader": "1.4.
|
|
52
|
+
"@embedpdf/core": "1.4.1",
|
|
53
|
+
"@embedpdf/plugin-loader": "1.4.1"
|
|
54
54
|
},
|
|
55
55
|
"files": [
|
|
56
56
|
"dist",
|