@embedpdf/plugin-bookmark 1.0.11 → 1.0.12
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 +2 -81
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -26
- package/dist/index.js +8 -12
- package/dist/index.js.map +1 -1
- package/dist/lib/bookmark-plugin.d.ts +11 -0
- package/dist/lib/index.d.ts +7 -0
- package/dist/lib/manifest.d.ts +4 -0
- package/dist/lib/types.d.ts +9 -0
- package/dist/preact/core.d.ts +1 -0
- package/dist/preact/index.cjs +2 -38
- package/dist/preact/index.cjs.map +1 -1
- package/dist/preact/index.d.ts +1 -15
- package/dist/preact/index.js +4 -5
- package/dist/preact/index.js.map +1 -1
- package/dist/react/core.d.ts +1 -0
- package/dist/react/index.cjs +2 -38
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.ts +1 -15
- package/dist/react/index.js +4 -5
- package/dist/react/index.js.map +1 -1
- package/dist/shared-preact/hooks/index.d.ts +1 -0
- package/dist/shared-preact/hooks/use-bookmark.d.ts +11 -0
- package/dist/shared-preact/index.d.ts +1 -0
- package/dist/shared-react/hooks/index.d.ts +1 -0
- package/dist/shared-react/hooks/use-bookmark.d.ts +11 -0
- package/dist/shared-react/index.d.ts +1 -0
- package/package.json +14 -12
- package/dist/index.d.cts +0 -26
- package/dist/preact/index.d.cts +0 -15
- package/dist/react/index.d.cts +0 -15
package/dist/index.cjs
CHANGED
|
@@ -1,81 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var index_exports = {};
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
BOOKMARK_PLUGIN_ID: () => BOOKMARK_PLUGIN_ID,
|
|
24
|
-
BookmarkPlugin: () => BookmarkPlugin,
|
|
25
|
-
BookmarkPluginPackage: () => BookmarkPluginPackage,
|
|
26
|
-
manifest: () => manifest
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(index_exports);
|
|
29
|
-
|
|
30
|
-
// src/lib/manifest.ts
|
|
31
|
-
var BOOKMARK_PLUGIN_ID = "bookmark";
|
|
32
|
-
var manifest = {
|
|
33
|
-
id: BOOKMARK_PLUGIN_ID,
|
|
34
|
-
name: "Bookmark Plugin",
|
|
35
|
-
version: "1.0.0",
|
|
36
|
-
provides: ["bookmark"],
|
|
37
|
-
requires: [],
|
|
38
|
-
optional: [],
|
|
39
|
-
defaultConfig: {
|
|
40
|
-
enabled: true
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
// src/lib/bookmark-plugin.ts
|
|
45
|
-
var import_core = require("@embedpdf/core");
|
|
46
|
-
var BookmarkPlugin = class extends import_core.BasePlugin {
|
|
47
|
-
constructor(id, registry, engine) {
|
|
48
|
-
super(id, registry);
|
|
49
|
-
this.engine = engine;
|
|
50
|
-
}
|
|
51
|
-
async initialize(_) {
|
|
52
|
-
}
|
|
53
|
-
buildCapability() {
|
|
54
|
-
return {
|
|
55
|
-
getBookmarks: this.getBookmarks.bind(this)
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
getBookmarks() {
|
|
59
|
-
const doc = this.coreState.core.document;
|
|
60
|
-
if (!doc) throw new Error("Document not open");
|
|
61
|
-
return this.engine.getBookmarks(doc);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
BookmarkPlugin.id = "bookmark";
|
|
65
|
-
|
|
66
|
-
// src/lib/index.ts
|
|
67
|
-
var BookmarkPluginPackage = {
|
|
68
|
-
manifest,
|
|
69
|
-
create: (registry, engine) => new BookmarkPlugin(BOOKMARK_PLUGIN_ID, registry, engine),
|
|
70
|
-
reducer: () => {
|
|
71
|
-
},
|
|
72
|
-
initialState: {}
|
|
73
|
-
};
|
|
74
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
-
0 && (module.exports = {
|
|
76
|
-
BOOKMARK_PLUGIN_ID,
|
|
77
|
-
BookmarkPlugin,
|
|
78
|
-
BookmarkPluginPackage,
|
|
79
|
-
manifest
|
|
80
|
-
});
|
|
81
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core"),o="bookmark",t={id:o,name:"Bookmark Plugin",version:"1.0.0",provides:["bookmark"],requires:[],optional:[],defaultConfig:{enabled:!0}},r=class extends e.BasePlugin{constructor(e,o,t){super(e,o),this.engine=t}async initialize(e){}buildCapability(){return{getBookmarks:this.getBookmarks.bind(this)}}getBookmarks(){const e=this.coreState.core.document;if(!e)throw new Error("Document not open");return this.engine.getBookmarks(e)}};r.id="bookmark";let i=r;const n={manifest:t,create:(e,t)=>new i(o,e,t),reducer:()=>{},initialState:{}};exports.BOOKMARK_PLUGIN_ID=o,exports.BookmarkPlugin=i,exports.BookmarkPluginPackage=n,exports.manifest=t;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/lib/manifest.ts","../src/lib/bookmark-plugin.ts","../src/lib/index.ts"],"sourcesContent":["import { PluginManifest } from '@embedpdf/core';\nimport { BookmarkPluginConfig } from './types';\n\nexport const BOOKMARK_PLUGIN_ID = 'bookmark';\n\nexport const manifest: PluginManifest<BookmarkPluginConfig> = {\n id: BOOKMARK_PLUGIN_ID,\n name: 'Bookmark Plugin',\n version: '1.0.0',\n provides: ['bookmark'],\n requires: [],\n optional: [],\n defaultConfig: {\n enabled: true,\n },\n};\n","import { BasePlugin, PluginRegistry } from '@embedpdf/core';\nimport { PdfBookmarkObject, PdfEngine, PdfErrorReason, Task } from '@embedpdf/models';\n\nimport { BookmarkCapability, BookmarkPluginConfig } from './types';\n\nexport class BookmarkPlugin extends BasePlugin<BookmarkPluginConfig, BookmarkCapability> {\n static readonly id = 'bookmark' as const;\n\n private engine: PdfEngine;\n\n constructor(id: string, registry: PluginRegistry, engine: PdfEngine) {\n super(id, registry);\n\n this.engine = engine;\n }\n\n async initialize(_: BookmarkPluginConfig): Promise<void> {}\n\n protected buildCapability(): BookmarkCapability {\n return {\n getBookmarks: this.getBookmarks.bind(this),\n };\n }\n\n private getBookmarks(): Task<{ bookmarks: PdfBookmarkObject[] }, PdfErrorReason> {\n const doc = this.coreState.core.document;\n if (!doc) throw new Error('Document not open');\n\n return this.engine.getBookmarks(doc);\n }\n}\n","import { PluginPackage } from '@embedpdf/core';\nimport { manifest, BOOKMARK_PLUGIN_ID } from './manifest';\nimport { BookmarkPluginConfig } from './types';\nimport { BookmarkPlugin } from './bookmark-plugin';\n\nexport const BookmarkPluginPackage: PluginPackage<BookmarkPlugin, BookmarkPluginConfig> = {\n manifest,\n create: (registry, engine) => new BookmarkPlugin(BOOKMARK_PLUGIN_ID, registry, engine),\n reducer: () => {},\n initialState: {},\n};\n\nexport * from './bookmark-plugin';\nexport * from './types';\nexport * from './manifest';\n"],"names":["BOOKMARK_PLUGIN_ID","manifest","id","name","version","provides","requires","optional","defaultConfig","enabled","_BookmarkPlugin","BasePlugin","constructor","registry","engine","super","this","initialize","_","buildCapability","getBookmarks","bind","doc","coreState","core","document","Error","BookmarkPlugin","BookmarkPluginPackage","create","reducer","initialState"],"mappings":"kHAGaA,EAAqB,WAErBC,EAAiD,CAC5DC,GAAIF,EACJG,KAAM,kBACNC,QAAS,QACTC,SAAU,CAAC,YACXC,SAAU,GACVC,SAAU,GACVC,cAAe,CACbC,SAAS,ICRAC,EAAN,cAA6BC,EAAAA,WAKlC,WAAAC,CAAYV,EAAYW,EAA0BC,GAChDC,MAAMb,EAAIW,GAEVG,KAAKF,OAASA,CAAA,CAGhB,gBAAMG,CAAWC,GAAwC,CAE/C,eAAAC,GACD,MAAA,CACLC,aAAcJ,KAAKI,aAAaC,KAAKL,MACvC,CAGM,YAAAI,GACA,MAAAE,EAAMN,KAAKO,UAAUC,KAAKC,SAChC,IAAKH,EAAW,MAAA,IAAII,MAAM,qBAEnB,OAAAV,KAAKF,OAAOM,aAAaE,EAAG,GAtBrCZ,EAAgBR,GAAK,WADhB,IAAMyB,EAANjB,ECAA,MAAMkB,EAA6E,CACxF3B,WACA4B,OAAQ,CAAChB,EAAUC,IAAW,IAAIa,EAAe3B,EAAoBa,EAAUC,GAC/EgB,QAAS,OACTC,aAAc,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { Task, PdfBookmarkObject, PdfErrorReason, PdfEngine } from '@embedpdf/models';
|
|
3
|
-
|
|
4
|
-
interface BookmarkPluginConfig extends BasePluginConfig {
|
|
5
|
-
}
|
|
6
|
-
interface BookmarkCapability {
|
|
7
|
-
getBookmarks: () => Task<{
|
|
8
|
-
bookmarks: PdfBookmarkObject[];
|
|
9
|
-
}, PdfErrorReason>;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
declare class BookmarkPlugin extends BasePlugin<BookmarkPluginConfig, BookmarkCapability> {
|
|
13
|
-
static readonly id: "bookmark";
|
|
14
|
-
private engine;
|
|
15
|
-
constructor(id: string, registry: PluginRegistry, engine: PdfEngine);
|
|
16
|
-
initialize(_: BookmarkPluginConfig): Promise<void>;
|
|
17
|
-
protected buildCapability(): BookmarkCapability;
|
|
18
|
-
private getBookmarks;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
declare const BOOKMARK_PLUGIN_ID = "bookmark";
|
|
22
|
-
declare const manifest: PluginManifest<BookmarkPluginConfig>;
|
|
23
|
-
|
|
24
|
-
declare const BookmarkPluginPackage: PluginPackage<BookmarkPlugin, BookmarkPluginConfig>;
|
|
25
|
-
|
|
26
|
-
export { BOOKMARK_PLUGIN_ID, type BookmarkCapability, BookmarkPlugin, type BookmarkPluginConfig, BookmarkPluginPackage, manifest };
|
|
1
|
+
export * from './lib';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { BasePlugin } from "@embedpdf/core";
|
|
2
|
+
const BOOKMARK_PLUGIN_ID = "bookmark";
|
|
3
|
+
const manifest = {
|
|
4
4
|
id: BOOKMARK_PLUGIN_ID,
|
|
5
5
|
name: "Bookmark Plugin",
|
|
6
6
|
version: "1.0.0",
|
|
@@ -11,10 +11,7 @@ var manifest = {
|
|
|
11
11
|
enabled: true
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
// src/lib/bookmark-plugin.ts
|
|
16
|
-
import { BasePlugin } from "@embedpdf/core";
|
|
17
|
-
var BookmarkPlugin = class extends BasePlugin {
|
|
14
|
+
const _BookmarkPlugin = class _BookmarkPlugin extends BasePlugin {
|
|
18
15
|
constructor(id, registry, engine) {
|
|
19
16
|
super(id, registry);
|
|
20
17
|
this.engine = engine;
|
|
@@ -32,10 +29,9 @@ var BookmarkPlugin = class extends BasePlugin {
|
|
|
32
29
|
return this.engine.getBookmarks(doc);
|
|
33
30
|
}
|
|
34
31
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var BookmarkPluginPackage = {
|
|
32
|
+
_BookmarkPlugin.id = "bookmark";
|
|
33
|
+
let BookmarkPlugin = _BookmarkPlugin;
|
|
34
|
+
const BookmarkPluginPackage = {
|
|
39
35
|
manifest,
|
|
40
36
|
create: (registry, engine) => new BookmarkPlugin(BOOKMARK_PLUGIN_ID, registry, engine),
|
|
41
37
|
reducer: () => {
|
|
@@ -48,4 +44,4 @@ export {
|
|
|
48
44
|
BookmarkPluginPackage,
|
|
49
45
|
manifest
|
|
50
46
|
};
|
|
51
|
-
//# sourceMappingURL=index.js.map
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/manifest.ts","../src/lib/bookmark-plugin.ts","../src/lib/index.ts"],"sourcesContent":["import { PluginManifest } from '@embedpdf/core';\nimport { BookmarkPluginConfig } from './types';\n\nexport const BOOKMARK_PLUGIN_ID = 'bookmark';\n\nexport const manifest: PluginManifest<BookmarkPluginConfig> = {\n id: BOOKMARK_PLUGIN_ID,\n name: 'Bookmark Plugin',\n version: '1.0.0',\n provides: ['bookmark'],\n requires: [],\n optional: [],\n defaultConfig: {\n enabled: true,\n },\n};\n","import { BasePlugin, PluginRegistry } from '@embedpdf/core';\nimport { PdfBookmarkObject, PdfEngine, PdfErrorReason, Task } from '@embedpdf/models';\n\nimport { BookmarkCapability, BookmarkPluginConfig } from './types';\n\nexport class BookmarkPlugin extends BasePlugin<BookmarkPluginConfig, BookmarkCapability> {\n static readonly id = 'bookmark' as const;\n\n private engine: PdfEngine;\n\n constructor(id: string, registry: PluginRegistry, engine: PdfEngine) {\n super(id, registry);\n\n this.engine = engine;\n }\n\n async initialize(_: BookmarkPluginConfig): Promise<void> {}\n\n protected buildCapability(): BookmarkCapability {\n return {\n getBookmarks: this.getBookmarks.bind(this),\n };\n }\n\n private getBookmarks(): Task<{ bookmarks: PdfBookmarkObject[] }, PdfErrorReason> {\n const doc = this.coreState.core.document;\n if (!doc) throw new Error('Document not open');\n\n return this.engine.getBookmarks(doc);\n }\n}\n","import { PluginPackage } from '@embedpdf/core';\nimport { manifest, BOOKMARK_PLUGIN_ID } from './manifest';\nimport { BookmarkPluginConfig } from './types';\nimport { BookmarkPlugin } from './bookmark-plugin';\n\nexport const BookmarkPluginPackage: PluginPackage<BookmarkPlugin, BookmarkPluginConfig> = {\n manifest,\n create: (registry, engine) => new BookmarkPlugin(BOOKMARK_PLUGIN_ID, registry, engine),\n reducer: () => {},\n initialState: {},\n};\n\nexport * from './bookmark-plugin';\nexport * from './types';\nexport * from './manifest';\n"],"mappings":";AAGO,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/lib/manifest.ts","../src/lib/bookmark-plugin.ts","../src/lib/index.ts"],"sourcesContent":["import { PluginManifest } from '@embedpdf/core';\nimport { BookmarkPluginConfig } from './types';\n\nexport const BOOKMARK_PLUGIN_ID = 'bookmark';\n\nexport const manifest: PluginManifest<BookmarkPluginConfig> = {\n id: BOOKMARK_PLUGIN_ID,\n name: 'Bookmark Plugin',\n version: '1.0.0',\n provides: ['bookmark'],\n requires: [],\n optional: [],\n defaultConfig: {\n enabled: true,\n },\n};\n","import { BasePlugin, PluginRegistry } from '@embedpdf/core';\nimport { PdfBookmarkObject, PdfEngine, PdfErrorReason, Task } from '@embedpdf/models';\n\nimport { BookmarkCapability, BookmarkPluginConfig } from './types';\n\nexport class BookmarkPlugin extends BasePlugin<BookmarkPluginConfig, BookmarkCapability> {\n static readonly id = 'bookmark' as const;\n\n private engine: PdfEngine;\n\n constructor(id: string, registry: PluginRegistry, engine: PdfEngine) {\n super(id, registry);\n\n this.engine = engine;\n }\n\n async initialize(_: BookmarkPluginConfig): Promise<void> {}\n\n protected buildCapability(): BookmarkCapability {\n return {\n getBookmarks: this.getBookmarks.bind(this),\n };\n }\n\n private getBookmarks(): Task<{ bookmarks: PdfBookmarkObject[] }, PdfErrorReason> {\n const doc = this.coreState.core.document;\n if (!doc) throw new Error('Document not open');\n\n return this.engine.getBookmarks(doc);\n }\n}\n","import { PluginPackage } from '@embedpdf/core';\nimport { manifest, BOOKMARK_PLUGIN_ID } from './manifest';\nimport { BookmarkPluginConfig } from './types';\nimport { BookmarkPlugin } from './bookmark-plugin';\n\nexport const BookmarkPluginPackage: PluginPackage<BookmarkPlugin, BookmarkPluginConfig> = {\n manifest,\n create: (registry, engine) => new BookmarkPlugin(BOOKMARK_PLUGIN_ID, registry, engine),\n reducer: () => {},\n initialState: {},\n};\n\nexport * from './bookmark-plugin';\nexport * from './types';\nexport * from './manifest';\n"],"names":[],"mappings":";AAGO,MAAM,qBAAqB;AAE3B,MAAM,WAAiD;AAAA,EAC5D,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU,CAAC,UAAU;AAAA,EACrB,UAAU,CAAC;AAAA,EACX,UAAU,CAAC;AAAA,EACX,eAAe;AAAA,IACb,SAAS;AAAA,EAAA;AAEb;ACVO,MAAM,kBAAN,MAAM,wBAAuB,WAAqD;AAAA,EAKvF,YAAY,IAAY,UAA0B,QAAmB;AACnE,UAAM,IAAI,QAAQ;AAElB,SAAK,SAAS;AAAA,EAAA;AAAA,EAGhB,MAAM,WAAW,GAAwC;AAAA,EAAA;AAAA,EAE/C,kBAAsC;AACvC,WAAA;AAAA,MACL,cAAc,KAAK,aAAa,KAAK,IAAI;AAAA,IAC3C;AAAA,EAAA;AAAA,EAGM,eAAyE;AACzE,UAAA,MAAM,KAAK,UAAU,KAAK;AAChC,QAAI,CAAC,IAAW,OAAA,IAAI,MAAM,mBAAmB;AAEtC,WAAA,KAAK,OAAO,aAAa,GAAG;AAAA,EAAA;AAEvC;AAxBE,gBAAgB,KAAK;AADhB,IAAM,iBAAN;ACAA,MAAM,wBAA6E;AAAA,EACxF;AAAA,EACA,QAAQ,CAAC,UAAU,WAAW,IAAI,eAAe,oBAAoB,UAAU,MAAM;AAAA,EACrF,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,cAAc,CAAA;AAChB;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BasePlugin, PluginRegistry } from '@embedpdf/core';
|
|
2
|
+
import { PdfEngine } from '@embedpdf/models';
|
|
3
|
+
import { BookmarkCapability, BookmarkPluginConfig } from './types';
|
|
4
|
+
export declare class BookmarkPlugin extends BasePlugin<BookmarkPluginConfig, BookmarkCapability> {
|
|
5
|
+
static readonly id: "bookmark";
|
|
6
|
+
private engine;
|
|
7
|
+
constructor(id: string, registry: PluginRegistry, engine: PdfEngine);
|
|
8
|
+
initialize(_: BookmarkPluginConfig): Promise<void>;
|
|
9
|
+
protected buildCapability(): BookmarkCapability;
|
|
10
|
+
private getBookmarks;
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PluginPackage } from '@embedpdf/core';
|
|
2
|
+
import { BookmarkPluginConfig } from './types';
|
|
3
|
+
import { BookmarkPlugin } from './bookmark-plugin';
|
|
4
|
+
export declare const BookmarkPluginPackage: PluginPackage<BookmarkPlugin, BookmarkPluginConfig>;
|
|
5
|
+
export * from './bookmark-plugin';
|
|
6
|
+
export * from './types';
|
|
7
|
+
export * from './manifest';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BasePluginConfig } from '@embedpdf/core';
|
|
2
|
+
import { Task, PdfBookmarkObject, PdfErrorReason } from '@embedpdf/models';
|
|
3
|
+
export interface BookmarkPluginConfig extends BasePluginConfig {
|
|
4
|
+
}
|
|
5
|
+
export interface BookmarkCapability {
|
|
6
|
+
getBookmarks: () => Task<{
|
|
7
|
+
bookmarks: PdfBookmarkObject[];
|
|
8
|
+
}, PdfErrorReason>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@embedpdf/core/preact';
|
package/dist/preact/index.cjs
CHANGED
|
@@ -1,38 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/preact/index.ts
|
|
21
|
-
var preact_exports = {};
|
|
22
|
-
__export(preact_exports, {
|
|
23
|
-
useBookmarkCapability: () => useBookmarkCapability,
|
|
24
|
-
useBookmarkPlugin: () => useBookmarkPlugin
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(preact_exports);
|
|
27
|
-
|
|
28
|
-
// src/preact/hooks/use-bookmark.ts
|
|
29
|
-
var import_preact = require("@embedpdf/core/preact");
|
|
30
|
-
var import_plugin_bookmark = require("@embedpdf/plugin-bookmark");
|
|
31
|
-
var useBookmarkPlugin = () => (0, import_preact.usePlugin)(import_plugin_bookmark.BookmarkPlugin.id);
|
|
32
|
-
var useBookmarkCapability = () => (0, import_preact.useCapability)(import_plugin_bookmark.BookmarkPlugin.id);
|
|
33
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
-
0 && (module.exports = {
|
|
35
|
-
useBookmarkCapability,
|
|
36
|
-
useBookmarkPlugin
|
|
37
|
-
});
|
|
38
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core/preact"),o=require("@embedpdf/plugin-bookmark");exports.useBookmarkCapability=()=>e.useCapability(o.BookmarkPlugin.id),exports.useBookmarkPlugin=()=>e.usePlugin(o.BookmarkPlugin.id);
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/shared/hooks/use-bookmark.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { BookmarkPlugin } from '@embedpdf/plugin-bookmark';\n\nexport const useBookmarkPlugin = () => usePlugin<BookmarkPlugin>(BookmarkPlugin.id);\nexport const useBookmarkCapability = () => useCapability<BookmarkPlugin>(BookmarkPlugin.id);\n"],"names":["useCapability","BookmarkPlugin","id","usePlugin"],"mappings":"8LAIqC,IAAMA,gBAA8BC,EAAAA,eAAeC,8BADvD,IAAMC,YAA0BF,EAAAA,eAAeC"}
|
package/dist/preact/index.d.ts
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { BookmarkPlugin } from '@embedpdf/plugin-bookmark';
|
|
3
|
-
|
|
4
|
-
declare const useBookmarkPlugin: () => {
|
|
5
|
-
plugin: BookmarkPlugin | null;
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
ready: Promise<void>;
|
|
8
|
-
};
|
|
9
|
-
declare const useBookmarkCapability: () => {
|
|
10
|
-
provides: Readonly<_embedpdf_plugin_bookmark.BookmarkCapability> | null;
|
|
11
|
-
isLoading: boolean;
|
|
12
|
-
ready: Promise<void>;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { useBookmarkCapability, useBookmarkPlugin };
|
|
1
|
+
export * from '../shared-preact';
|
package/dist/preact/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import { useCapability, usePlugin } from "@embedpdf/core/preact";
|
|
1
|
+
import { usePlugin, useCapability } from "@embedpdf/core/preact";
|
|
3
2
|
import { BookmarkPlugin } from "@embedpdf/plugin-bookmark";
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
const useBookmarkPlugin = () => usePlugin(BookmarkPlugin.id);
|
|
4
|
+
const useBookmarkCapability = () => useCapability(BookmarkPlugin.id);
|
|
6
5
|
export {
|
|
7
6
|
useBookmarkCapability,
|
|
8
7
|
useBookmarkPlugin
|
|
9
8
|
};
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
package/dist/preact/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/shared/hooks/use-bookmark.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { BookmarkPlugin } from '@embedpdf/plugin-bookmark';\n\nexport const useBookmarkPlugin = () => usePlugin<BookmarkPlugin>(BookmarkPlugin.id);\nexport const useBookmarkCapability = () => useCapability<BookmarkPlugin>(BookmarkPlugin.id);\n"],"names":[],"mappings":";;AAGO,MAAM,oBAAoB,MAAM,UAA0B,eAAe,EAAE;AAC3E,MAAM,wBAAwB,MAAM,cAA8B,eAAe,EAAE;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@embedpdf/core/react';
|
package/dist/react/index.cjs
CHANGED
|
@@ -1,38 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/react/index.ts
|
|
21
|
-
var react_exports = {};
|
|
22
|
-
__export(react_exports, {
|
|
23
|
-
useBookmarkCapability: () => useBookmarkCapability,
|
|
24
|
-
useBookmarkPlugin: () => useBookmarkPlugin
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(react_exports);
|
|
27
|
-
|
|
28
|
-
// src/react/hooks/use-bookmark.ts
|
|
29
|
-
var import_react = require("@embedpdf/core/react");
|
|
30
|
-
var import_plugin_bookmark = require("@embedpdf/plugin-bookmark");
|
|
31
|
-
var useBookmarkPlugin = () => (0, import_react.usePlugin)(import_plugin_bookmark.BookmarkPlugin.id);
|
|
32
|
-
var useBookmarkCapability = () => (0, import_react.useCapability)(import_plugin_bookmark.BookmarkPlugin.id);
|
|
33
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
-
0 && (module.exports = {
|
|
35
|
-
useBookmarkCapability,
|
|
36
|
-
useBookmarkPlugin
|
|
37
|
-
});
|
|
38
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core/react"),o=require("@embedpdf/plugin-bookmark");exports.useBookmarkCapability=()=>e.useCapability(o.BookmarkPlugin.id),exports.useBookmarkPlugin=()=>e.usePlugin(o.BookmarkPlugin.id);
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
package/dist/react/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/shared/hooks/use-bookmark.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { BookmarkPlugin } from '@embedpdf/plugin-bookmark';\n\nexport const useBookmarkPlugin = () => usePlugin<BookmarkPlugin>(BookmarkPlugin.id);\nexport const useBookmarkCapability = () => useCapability<BookmarkPlugin>(BookmarkPlugin.id);\n"],"names":["useCapability","BookmarkPlugin","id","usePlugin"],"mappings":"6LAIqC,IAAMA,gBAA8BC,EAAAA,eAAeC,8BADvD,IAAMC,YAA0BF,EAAAA,eAAeC"}
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { BookmarkPlugin } from '@embedpdf/plugin-bookmark';
|
|
3
|
-
|
|
4
|
-
declare const useBookmarkPlugin: () => {
|
|
5
|
-
plugin: BookmarkPlugin | null;
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
ready: Promise<void>;
|
|
8
|
-
};
|
|
9
|
-
declare const useBookmarkCapability: () => {
|
|
10
|
-
provides: Readonly<_embedpdf_plugin_bookmark.BookmarkCapability> | null;
|
|
11
|
-
isLoading: boolean;
|
|
12
|
-
ready: Promise<void>;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { useBookmarkCapability, useBookmarkPlugin };
|
|
1
|
+
export * from '../shared-react';
|
package/dist/react/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import { useCapability, usePlugin } from "@embedpdf/core/react";
|
|
1
|
+
import { usePlugin, useCapability } from "@embedpdf/core/react";
|
|
3
2
|
import { BookmarkPlugin } from "@embedpdf/plugin-bookmark";
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
const useBookmarkPlugin = () => usePlugin(BookmarkPlugin.id);
|
|
4
|
+
const useBookmarkCapability = () => useCapability(BookmarkPlugin.id);
|
|
6
5
|
export {
|
|
7
6
|
useBookmarkCapability,
|
|
8
7
|
useBookmarkPlugin
|
|
9
8
|
};
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
package/dist/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/shared/hooks/use-bookmark.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { BookmarkPlugin } from '@embedpdf/plugin-bookmark';\n\nexport const useBookmarkPlugin = () => usePlugin<BookmarkPlugin>(BookmarkPlugin.id);\nexport const useBookmarkCapability = () => useCapability<BookmarkPlugin>(BookmarkPlugin.id);\n"],"names":[],"mappings":";;AAGO,MAAM,oBAAoB,MAAM,UAA0B,eAAe,EAAE;AAC3E,MAAM,wBAAwB,MAAM,cAA8B,eAAe,EAAE;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-bookmark';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BookmarkPlugin } from '../../lib/index.ts';
|
|
2
|
+
export declare const useBookmarkPlugin: () => {
|
|
3
|
+
plugin: BookmarkPlugin | null;
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
ready: Promise<void>;
|
|
6
|
+
};
|
|
7
|
+
export declare const useBookmarkCapability: () => {
|
|
8
|
+
provides: Readonly<import('../../lib/index.ts').BookmarkCapability> | null;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
ready: Promise<void>;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './hooks';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-bookmark';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BookmarkPlugin } from '../../lib/index.ts';
|
|
2
|
+
export declare const useBookmarkPlugin: () => {
|
|
3
|
+
plugin: BookmarkPlugin | null;
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
ready: Promise<void>;
|
|
6
|
+
};
|
|
7
|
+
export declare const useBookmarkCapability: () => {
|
|
8
|
+
provides: Readonly<import('../../lib/index.ts').BookmarkCapability> | null;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
ready: Promise<void>;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './hooks';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embedpdf/plugin-bookmark",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -22,19 +22,20 @@
|
|
|
22
22
|
"require": "./dist/react/index.cjs"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
"dependencies": {
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@embedpdf/models": "1.0.12"
|
|
27
|
+
},
|
|
26
28
|
"devDependencies": {
|
|
27
29
|
"@types/react": "^18.2.0",
|
|
28
|
-
"tsup": "^8.0.0",
|
|
29
30
|
"typescript": "^5.0.0",
|
|
30
|
-
"@embedpdf/core": "1.0.
|
|
31
|
-
"@embedpdf/
|
|
31
|
+
"@embedpdf/core": "1.0.12",
|
|
32
|
+
"@embedpdf/build": "1.0.0"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
35
|
"react": ">=16.8.0",
|
|
35
36
|
"react-dom": ">=16.8.0",
|
|
36
37
|
"preact": "^10.26.4",
|
|
37
|
-
"@embedpdf/core": "1.0.
|
|
38
|
+
"@embedpdf/core": "1.0.12"
|
|
38
39
|
},
|
|
39
40
|
"files": [
|
|
40
41
|
"dist",
|
|
@@ -53,11 +54,12 @@
|
|
|
53
54
|
"access": "public"
|
|
54
55
|
},
|
|
55
56
|
"scripts": {
|
|
56
|
-
"build": "
|
|
57
|
-
"build:
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
57
|
+
"build:base": "vite build --mode base",
|
|
58
|
+
"build:react": "vite build --mode react",
|
|
59
|
+
"build:preact": "vite build --mode preact",
|
|
60
|
+
"build": "pnpm run clean && concurrently -c auto -n base,react,preact \"vite build --mode base\" \"vite build --mode react\" \"vite build --mode preact\"",
|
|
61
|
+
"clean": "rimraf dist",
|
|
62
|
+
"lint": "eslint src --color",
|
|
63
|
+
"lint:fix": "eslint src --color --fix"
|
|
62
64
|
}
|
|
63
65
|
}
|
package/dist/index.d.cts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { BasePluginConfig, BasePlugin, PluginRegistry, PluginManifest, PluginPackage } from '@embedpdf/core';
|
|
2
|
-
import { Task, PdfBookmarkObject, PdfErrorReason, PdfEngine } from '@embedpdf/models';
|
|
3
|
-
|
|
4
|
-
interface BookmarkPluginConfig extends BasePluginConfig {
|
|
5
|
-
}
|
|
6
|
-
interface BookmarkCapability {
|
|
7
|
-
getBookmarks: () => Task<{
|
|
8
|
-
bookmarks: PdfBookmarkObject[];
|
|
9
|
-
}, PdfErrorReason>;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
declare class BookmarkPlugin extends BasePlugin<BookmarkPluginConfig, BookmarkCapability> {
|
|
13
|
-
static readonly id: "bookmark";
|
|
14
|
-
private engine;
|
|
15
|
-
constructor(id: string, registry: PluginRegistry, engine: PdfEngine);
|
|
16
|
-
initialize(_: BookmarkPluginConfig): Promise<void>;
|
|
17
|
-
protected buildCapability(): BookmarkCapability;
|
|
18
|
-
private getBookmarks;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
declare const BOOKMARK_PLUGIN_ID = "bookmark";
|
|
22
|
-
declare const manifest: PluginManifest<BookmarkPluginConfig>;
|
|
23
|
-
|
|
24
|
-
declare const BookmarkPluginPackage: PluginPackage<BookmarkPlugin, BookmarkPluginConfig>;
|
|
25
|
-
|
|
26
|
-
export { BOOKMARK_PLUGIN_ID, type BookmarkCapability, BookmarkPlugin, type BookmarkPluginConfig, BookmarkPluginPackage, manifest };
|
package/dist/preact/index.d.cts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as _embedpdf_plugin_bookmark from '@embedpdf/plugin-bookmark';
|
|
2
|
-
import { BookmarkPlugin } from '@embedpdf/plugin-bookmark';
|
|
3
|
-
|
|
4
|
-
declare const useBookmarkPlugin: () => {
|
|
5
|
-
plugin: BookmarkPlugin | null;
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
ready: Promise<void>;
|
|
8
|
-
};
|
|
9
|
-
declare const useBookmarkCapability: () => {
|
|
10
|
-
provides: Readonly<_embedpdf_plugin_bookmark.BookmarkCapability> | null;
|
|
11
|
-
isLoading: boolean;
|
|
12
|
-
ready: Promise<void>;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { useBookmarkCapability, useBookmarkPlugin };
|
package/dist/react/index.d.cts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as _embedpdf_plugin_bookmark from '@embedpdf/plugin-bookmark';
|
|
2
|
-
import { BookmarkPlugin } from '@embedpdf/plugin-bookmark';
|
|
3
|
-
|
|
4
|
-
declare const useBookmarkPlugin: () => {
|
|
5
|
-
plugin: BookmarkPlugin | null;
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
ready: Promise<void>;
|
|
8
|
-
};
|
|
9
|
-
declare const useBookmarkCapability: () => {
|
|
10
|
-
provides: Readonly<_embedpdf_plugin_bookmark.BookmarkCapability> | null;
|
|
11
|
-
isLoading: boolean;
|
|
12
|
-
ready: Promise<void>;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { useBookmarkCapability, useBookmarkPlugin };
|