@mdgate/keynote 0.5.2 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{documentToMarkdown as B}from"@mdgate/document";import{detectIWorkKind as C}from"@mdgate/iwork-common";import{fileExtension as D}from"@mdgate/utils";import{emptyDocument as R,heading as U,inlinesAreEmpty as V,inlinesToPlainText as X,plain as Y}from"@mdgate/document";import{keynoteSlides as Z,openIWork as _,slideToBlocks as $}from"@mdgate/iwork-common";function O(z){let q=_(z,"keynote"),F=R(),H=Z(q);for(let G=0;G<H.length;G+=1){let Q=H[G],L=$(q,Q),N=A(L);if(N!==void 0)F.blocks.push(N);else if(H.length>1)F.blocks.push(U(2,[Y(`Slide ${G+1}`)]));F.blocks.push(...L)}return F}function A(z){if(z.length===0)return;let q=z[0];if(q.type==="heading")return z.shift(),q;if(q.type==="paragraph"&&!V(q.inlines))return z.shift(),{type:"heading",level:2,anchor:X(q.inlines),content:q.inlines};return}function J(){return{id:"keynote",sniff(z,q){if(C(z)==="keynote")return 2;if(q?.path!==void 0&&D(q.path)==="key")return 1;return 0},convert(z){return{markdown:B(O(z))}}}}import{create as K}from"@mdgate/core";var M=K([J()]);function S(z,q){return M(z,q)}export{S as toMarkdown,J as keynote};
1
+ import{documentToMarkdown as K}from"@mdgate/document";import{detectIWorkKind as M}from"@mdgate/iwork-common";import{fileExtension as S}from"@mdgate/utils";import{ConvertError as R}from"@mdgate/core";import{emptyDocument as U,heading as V,inlinesAreEmpty as X,inlinesToPlainText as Y,plain as Z}from"@mdgate/document";import{keynoteSlides as _,openIWork as $,parsePreIwa as A,slideToBlocks as B}from"@mdgate/iwork-common";function O(z){let q;try{q=$(z,"keynote")}catch(F){if(F instanceof R&&F.code==="encrypted")throw F;return A(z,"keynote")}let G=U(),H=_(q);for(let F=0;F<H.length;F+=1){let Q=H[F],L=B(q,Q),N=D(L);if(N!==void 0)G.blocks.push(N);else if(H.length>1)G.blocks.push(V(2,[Z(`Slide ${F+1}`)]));G.blocks.push(...L)}return G}function D(z){if(z.length===0)return;let q=z[0];if(q.type==="heading")return z.shift(),q;if(q.type==="paragraph"&&!X(q.inlines))return z.shift(),{type:"heading",level:2,anchor:Y(q.inlines),content:q.inlines};return}function J(){return{id:"keynote",sniff(z,q){if(M(z)==="keynote")return 2;if(q?.path!==void 0&&S(q.path)==="key")return 1;return 0},convert(z){return{markdown:K(O(z))}}}}import{create as j}from"@mdgate/core";var x=j([J()]);function C(z,q){return x(z,q)}export{C as toMarkdown,J as keynote};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdgate/keynote",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "description": "mdgate Apple Keynote converter",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -22,10 +22,10 @@
22
22
  "prepublishOnly": "bun run build"
23
23
  },
24
24
  "dependencies": {
25
- "@mdgate/core": "0.5.2",
26
- "@mdgate/document": "0.5.2",
27
- "@mdgate/iwork-common": "0.5.2",
28
- "@mdgate/utils": "0.5.2"
25
+ "@mdgate/core": "0.5.4",
26
+ "@mdgate/document": "0.5.4",
27
+ "@mdgate/iwork-common": "0.5.4",
28
+ "@mdgate/utils": "0.5.4"
29
29
  },
30
30
  "publishConfig": {
31
31
  "access": "public"