web-annotation-renderer 0.3.0 → 0.5.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 +49 -42
- package/dist/index.js.map +1 -1
- package/dist/index10.cjs +1 -1
- package/dist/index10.cjs.map +1 -1
- package/dist/index10.js +172 -17
- package/dist/index10.js.map +1 -1
- package/dist/index11.cjs +1 -1
- package/dist/index11.cjs.map +1 -1
- package/dist/index11.js +13 -20
- package/dist/index11.js.map +1 -1
- package/dist/index12.cjs +1 -1
- package/dist/index12.cjs.map +1 -1
- package/dist/index12.js +167 -124
- package/dist/index12.js.map +1 -1
- package/dist/index13.cjs +1 -1
- package/dist/index13.cjs.map +1 -1
- package/dist/index13.js +29 -198
- package/dist/index13.js.map +1 -1
- package/dist/index14.cjs +1 -1
- package/dist/index14.cjs.map +1 -1
- package/dist/index14.js +78 -15
- package/dist/index14.js.map +1 -1
- package/dist/index15.cjs +1 -1
- package/dist/index15.cjs.map +1 -1
- package/dist/index15.js +115 -120
- package/dist/index15.js.map +1 -1
- package/dist/index16.cjs +1 -1
- package/dist/index16.cjs.map +1 -1
- package/dist/index16.js +100 -212
- package/dist/index16.js.map +1 -1
- package/dist/index17.cjs +1 -1
- package/dist/index17.cjs.map +1 -1
- package/dist/index17.js +55 -37
- package/dist/index17.js.map +1 -1
- package/dist/index18.cjs +1 -1
- package/dist/index18.cjs.map +1 -1
- package/dist/index18.js +139 -35
- package/dist/index18.js.map +1 -1
- package/dist/index19.cjs +1 -1
- package/dist/index19.cjs.map +1 -1
- package/dist/index19.js +37 -37
- package/dist/index19.js.map +1 -1
- package/dist/index2.cjs +1 -1
- package/dist/index2.cjs.map +1 -1
- package/dist/index2.js +95 -73
- package/dist/index2.js.map +1 -1
- package/dist/index20.cjs +1 -1
- package/dist/index20.cjs.map +1 -1
- package/dist/index20.js +29 -39
- package/dist/index20.js.map +1 -1
- package/dist/index21.cjs +1 -1
- package/dist/index21.cjs.map +1 -1
- package/dist/index21.js +38 -32
- package/dist/index21.js.map +1 -1
- package/dist/index22.cjs +1 -1
- package/dist/index22.cjs.map +1 -1
- package/dist/index22.js +22 -5
- package/dist/index22.js.map +1 -1
- package/dist/index23.cjs +2 -0
- package/dist/index23.cjs.map +1 -0
- package/dist/index23.js +8 -0
- package/dist/index23.js.map +1 -0
- package/dist/index24.cjs +2 -0
- package/dist/index24.cjs.map +1 -0
- package/dist/index24.js +8 -0
- package/dist/index24.js.map +1 -0
- package/dist/index3.cjs +1 -1
- package/dist/index3.cjs.map +1 -1
- package/dist/index3.js +1 -1
- package/dist/index4.cjs +1 -1
- package/dist/index4.cjs.map +1 -1
- package/dist/index4.js +72 -71
- package/dist/index4.js.map +1 -1
- package/dist/index5.cjs +1 -1
- package/dist/index5.cjs.map +1 -1
- package/dist/index5.js +217 -65
- package/dist/index5.js.map +1 -1
- package/dist/index6.cjs +1 -1
- package/dist/index6.cjs.map +1 -1
- package/dist/index6.js +60 -114
- package/dist/index6.js.map +1 -1
- package/dist/index7.cjs +1 -1
- package/dist/index7.cjs.map +1 -1
- package/dist/index7.js +19 -91
- package/dist/index7.js.map +1 -1
- package/dist/index8.cjs +1 -1
- package/dist/index8.cjs.map +1 -1
- package/dist/index8.js +19 -105
- package/dist/index8.js.map +1 -1
- package/dist/index9.cjs +1 -1
- package/dist/index9.cjs.map +1 -1
- package/dist/index9.js +123 -98
- package/dist/index9.js.map +1 -1
- package/package.json +4 -3
package/dist/index21.js
CHANGED
|
@@ -1,35 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import { generateId as o } from "./index24.js";
|
|
2
|
+
function i(e) {
|
|
3
|
+
if (!e.content || typeof e.content != "string" || e.content.trim().length === 0)
|
|
4
|
+
throw new Error("Text annotation requires non-empty content");
|
|
5
|
+
if (typeof e.x != "number" || e.x < 0 || e.x > 1)
|
|
6
|
+
throw new Error("Text annotation x position must be between 0 and 1");
|
|
7
|
+
if (typeof e.y != "number" || e.y < 0 || e.y > 1)
|
|
8
|
+
throw new Error("Text annotation y position must be between 0 and 1");
|
|
9
|
+
if (typeof e.w != "number" || e.w < 0 || e.w > 1)
|
|
10
|
+
throw new Error("Text annotation width (w) must be between 0 and 1");
|
|
11
|
+
if (typeof e.h != "number" || e.h < 0 || e.h > 1)
|
|
12
|
+
throw new Error("Text annotation height (h) must be between 0 and 1");
|
|
13
|
+
if (!e.page || typeof e.page != "number" || e.page < 1)
|
|
14
|
+
throw new Error("Text annotation requires a valid page number (>= 1)");
|
|
15
|
+
if (!e.sentence_ref || typeof e.sentence_ref != "string")
|
|
16
|
+
throw new Error("Text annotation requires a sentence_ref for timing");
|
|
17
|
+
const t = e.textColor || "#1f2937", n = e.bgColor || "transparent";
|
|
18
|
+
return {
|
|
19
|
+
id: o("text"),
|
|
20
|
+
type: "text",
|
|
21
|
+
// Type name is 'text', not 'text_annotation'
|
|
22
|
+
page: e.page,
|
|
23
|
+
content: e.content.trim(),
|
|
24
|
+
x: e.x,
|
|
25
|
+
// Direct properties, not in position object
|
|
26
|
+
y: e.y,
|
|
27
|
+
w: e.w,
|
|
28
|
+
h: e.h,
|
|
29
|
+
style: {
|
|
30
|
+
// Colors wrapped in style object
|
|
31
|
+
bg: n,
|
|
32
|
+
color: t
|
|
33
|
+
},
|
|
34
|
+
sentence_ref: e.sentence_ref
|
|
35
|
+
// Note: start/end will be added during timing sync phase
|
|
36
|
+
};
|
|
37
|
+
}
|
|
29
38
|
export {
|
|
30
|
-
|
|
31
|
-
t as HIGHLIGHT_DEFAULTS,
|
|
32
|
-
e as INK_DEFAULTS,
|
|
33
|
-
s as TEXT_DEFAULTS
|
|
39
|
+
i as createText
|
|
34
40
|
};
|
|
35
41
|
//# sourceMappingURL=index21.js.map
|
package/dist/index21.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index21.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index21.js","sources":["../src/ai-tools/creators/createText.js"],"sourcesContent":["/**\n * Text Annotation Creator\n *\n * Converts AI-generated tool call arguments into valid text annotation objects\n * compatible with web-annotation-renderer library format.\n *\n * @module ai-tools/creators/createText\n */\n\nimport { generateId } from '../../utils/idGenerator.js';\n\n/**\n * Create a text annotation from tool call arguments\n *\n * @param {Object} args - Tool call arguments from AI\n * @param {string} args.content - Text content\n * @param {number} args.x - Horizontal position (0-1)\n * @param {number} args.y - Vertical position (0-1)\n * @param {number} args.w - Width (0-1)\n * @param {number} args.h - Height (0-1)\n * @param {number} args.page - Page number (1-indexed)\n * @param {string} [args.textColor='#1f2937'] - Text color in hex format\n * @param {string} [args.bgColor='transparent'] - Background color (transparent by default, or rgba format)\n * @param {string} args.sentence_ref - Sentence reference for timing (e.g., 'S1')\n * @returns {Object} Valid text annotation object\n * @example\n * ```javascript\n * const textNote = createText({\n * content: 'This is important',\n * x: 0.1,\n * y: 0.5,\n * w: 0.3,\n * h: 0.1,\n * page: 1,\n * textColor: '#000000',\n * bgColor: 'transparent', // or use rgba format like 'rgba(255, 255, 255, 0.9)'\n * sentence_ref: 'S3'\n * });\n * ```\n */\nexport function createText(args) {\n // Validate required fields\n if (!args.content || typeof args.content !== 'string' || args.content.trim().length === 0) {\n throw new Error('Text annotation requires non-empty content');\n }\n\n if (typeof args.x !== 'number' || args.x < 0 || args.x > 1) {\n throw new Error('Text annotation x position must be between 0 and 1');\n }\n\n if (typeof args.y !== 'number' || args.y < 0 || args.y > 1) {\n throw new Error('Text annotation y position must be between 0 and 1');\n }\n\n if (typeof args.w !== 'number' || args.w < 0 || args.w > 1) {\n throw new Error('Text annotation width (w) must be between 0 and 1');\n }\n\n if (typeof args.h !== 'number' || args.h < 0 || args.h > 1) {\n throw new Error('Text annotation height (h) must be between 0 and 1');\n }\n\n if (!args.page || typeof args.page !== 'number' || args.page < 1) {\n throw new Error('Text annotation requires a valid page number (>= 1)');\n }\n\n if (!args.sentence_ref || typeof args.sentence_ref !== 'string') {\n throw new Error('Text annotation requires a sentence_ref for timing');\n }\n\n // Get colors with defaults (transparent background for better visibility)\n const textColor = args.textColor || '#1f2937';\n const bgColor = args.bgColor || 'transparent';\n\n // Create annotation object matching library format\n return {\n id: generateId('text'),\n type: 'text', // Type name is 'text', not 'text_annotation'\n page: args.page,\n content: args.content.trim(),\n x: args.x, // Direct properties, not in position object\n y: args.y,\n w: args.w,\n h: args.h,\n style: { // Colors wrapped in style object\n bg: bgColor,\n color: textColor\n },\n sentence_ref: args.sentence_ref,\n // Note: start/end will be added during timing sync phase\n };\n}\n"],"names":["createText","args","textColor","bgColor","generateId"],"mappings":";AAwCO,SAASA,EAAWC,GAAM;AAE/B,MAAI,CAACA,EAAK,WAAW,OAAOA,EAAK,WAAY,YAAYA,EAAK,QAAQ,OAAO,WAAW;AACtF,UAAM,IAAI,MAAM,4CAA4C;AAG9D,MAAI,OAAOA,EAAK,KAAM,YAAYA,EAAK,IAAI,KAAKA,EAAK,IAAI;AACvD,UAAM,IAAI,MAAM,oDAAoD;AAGtE,MAAI,OAAOA,EAAK,KAAM,YAAYA,EAAK,IAAI,KAAKA,EAAK,IAAI;AACvD,UAAM,IAAI,MAAM,oDAAoD;AAGtE,MAAI,OAAOA,EAAK,KAAM,YAAYA,EAAK,IAAI,KAAKA,EAAK,IAAI;AACvD,UAAM,IAAI,MAAM,mDAAmD;AAGrE,MAAI,OAAOA,EAAK,KAAM,YAAYA,EAAK,IAAI,KAAKA,EAAK,IAAI;AACvD,UAAM,IAAI,MAAM,oDAAoD;AAGtE,MAAI,CAACA,EAAK,QAAQ,OAAOA,EAAK,QAAS,YAAYA,EAAK,OAAO;AAC7D,UAAM,IAAI,MAAM,qDAAqD;AAGvE,MAAI,CAACA,EAAK,gBAAgB,OAAOA,EAAK,gBAAiB;AACrD,UAAM,IAAI,MAAM,oDAAoD;AAItE,QAAMC,IAAYD,EAAK,aAAa,WAC9BE,IAAUF,EAAK,WAAW;AAGhC,SAAO;AAAA,IACL,IAAIG,EAAW,MAAM;AAAA,IACrB,MAAM;AAAA;AAAA,IACN,MAAMH,EAAK;AAAA,IACX,SAASA,EAAK,QAAQ,KAAI;AAAA,IAC1B,GAAGA,EAAK;AAAA;AAAA,IACR,GAAGA,EAAK;AAAA,IACR,GAAGA,EAAK;AAAA,IACR,GAAGA,EAAK;AAAA,IACR,OAAO;AAAA;AAAA,MACL,IAAIE;AAAA,MACJ,OAAOD;AAAA,IACb;AAAA,IACI,cAAcD,EAAK;AAAA;AAAA,EAEvB;AACA;"}
|
package/dist/index22.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={page:1,start:0,end:0},o={mode:"quads",quads:[{x:.1,y:.1,w:.8,h:.05}],style:{color:"rgba(255, 255, 0, 0.3)"}},e={content:"[No content]",x:.1,y:.1,w:.3,h:.1,style:{bg:"rgba(255, 255, 255, 0.9)",color:"#000000"}};exports.BASE_DEFAULTS=t;exports.HIGHLIGHT_DEFAULTS=o;exports.TEXT_DEFAULTS=e;
|
|
2
2
|
//# sourceMappingURL=index22.cjs.map
|
package/dist/index22.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index22.cjs","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index22.cjs","sources":["../src/types/defaults.js"],"sourcesContent":["/**\n * Default Values for Annotation Normalization\n *\n * This module defines default values used when annotation fields are missing\n * or invalid. These defaults ensure annotations render visibly and safely.\n *\n * @module types/defaults\n */\n\n/**\n * Default values for base annotation fields (common to all types)\n *\n * @constant {Object}\n * @property {number} page - Default page number (first page)\n * @property {number} start - Default start time (display immediately)\n * @property {number} end - Default end time (static display, no animation)\n */\nexport const BASE_DEFAULTS = {\n page: 1,\n start: 0,\n end: 0\n};\n\n/**\n * Default values for highlight annotations\n *\n * Creates a visible yellow highlight near the top of the page.\n *\n * @constant {Object}\n * @property {string} mode - Highlight mode (only 'quads' supported)\n * @property {Array<Object>} quads - Default rectangular regions\n * @property {Object} style - Default styling\n */\nexport const HIGHLIGHT_DEFAULTS = {\n mode: 'quads',\n quads: [{ x: 0.1, y: 0.1, w: 0.8, h: 0.05 }],\n style: { color: 'rgba(255, 255, 0, 0.3)' }\n};\n\n/**\n * Default values for text annotations\n *\n * Creates a visible text box in the top-left with placeholder content.\n *\n * @constant {Object}\n * @property {string} content - Placeholder text\n * @property {number} x - Normalized x position (10% from left)\n * @property {number} y - Normalized y position (10% from top)\n * @property {number} w - Normalized width (30% of page width)\n * @property {number} h - Normalized height (10% of page height)\n * @property {Object} style - Default styling with white background and black text\n */\nexport const TEXT_DEFAULTS = {\n content: '[No content]',\n x: 0.1,\n y: 0.1,\n w: 0.3,\n h: 0.1,\n style: {\n bg: 'rgba(255, 255, 255, 0.9)',\n color: '#000000'\n }\n};\n"],"names":["BASE_DEFAULTS","HIGHLIGHT_DEFAULTS","TEXT_DEFAULTS"],"mappings":"gFAiBY,MAACA,EAAgB,CAC3B,KAAM,EACN,MAAO,EACP,IAAK,CACP,EAYaC,EAAqB,CAChC,KAAM,QACN,MAAO,CAAC,CAAE,EAAG,GAAK,EAAG,GAAK,EAAG,GAAK,EAAG,IAAM,EAC3C,MAAO,CAAE,MAAO,wBAAwB,CAC1C,EAeaC,EAAgB,CAC3B,QAAS,eACT,EAAG,GACH,EAAG,GACH,EAAG,GACH,EAAG,GACH,MAAO,CACL,GAAI,2BACJ,MAAO,SACX,CACA"}
|
package/dist/index22.js
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const o = {
|
|
2
|
+
page: 1,
|
|
3
|
+
start: 0,
|
|
4
|
+
end: 0
|
|
5
|
+
}, t = {
|
|
6
|
+
mode: "quads",
|
|
7
|
+
quads: [{ x: 0.1, y: 0.1, w: 0.8, h: 0.05 }],
|
|
8
|
+
style: { color: "rgba(255, 255, 0, 0.3)" }
|
|
9
|
+
}, e = {
|
|
10
|
+
content: "[No content]",
|
|
11
|
+
x: 0.1,
|
|
12
|
+
y: 0.1,
|
|
13
|
+
w: 0.3,
|
|
14
|
+
h: 0.1,
|
|
15
|
+
style: {
|
|
16
|
+
bg: "rgba(255, 255, 255, 0.9)",
|
|
17
|
+
color: "#000000"
|
|
18
|
+
}
|
|
19
|
+
};
|
|
5
20
|
export {
|
|
6
|
-
|
|
21
|
+
o as BASE_DEFAULTS,
|
|
22
|
+
t as HIGHLIGHT_DEFAULTS,
|
|
23
|
+
e as TEXT_DEFAULTS
|
|
7
24
|
};
|
|
8
25
|
//# sourceMappingURL=index22.js.map
|
package/dist/index22.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index22.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index22.js","sources":["../src/types/defaults.js"],"sourcesContent":["/**\n * Default Values for Annotation Normalization\n *\n * This module defines default values used when annotation fields are missing\n * or invalid. These defaults ensure annotations render visibly and safely.\n *\n * @module types/defaults\n */\n\n/**\n * Default values for base annotation fields (common to all types)\n *\n * @constant {Object}\n * @property {number} page - Default page number (first page)\n * @property {number} start - Default start time (display immediately)\n * @property {number} end - Default end time (static display, no animation)\n */\nexport const BASE_DEFAULTS = {\n page: 1,\n start: 0,\n end: 0\n};\n\n/**\n * Default values for highlight annotations\n *\n * Creates a visible yellow highlight near the top of the page.\n *\n * @constant {Object}\n * @property {string} mode - Highlight mode (only 'quads' supported)\n * @property {Array<Object>} quads - Default rectangular regions\n * @property {Object} style - Default styling\n */\nexport const HIGHLIGHT_DEFAULTS = {\n mode: 'quads',\n quads: [{ x: 0.1, y: 0.1, w: 0.8, h: 0.05 }],\n style: { color: 'rgba(255, 255, 0, 0.3)' }\n};\n\n/**\n * Default values for text annotations\n *\n * Creates a visible text box in the top-left with placeholder content.\n *\n * @constant {Object}\n * @property {string} content - Placeholder text\n * @property {number} x - Normalized x position (10% from left)\n * @property {number} y - Normalized y position (10% from top)\n * @property {number} w - Normalized width (30% of page width)\n * @property {number} h - Normalized height (10% of page height)\n * @property {Object} style - Default styling with white background and black text\n */\nexport const TEXT_DEFAULTS = {\n content: '[No content]',\n x: 0.1,\n y: 0.1,\n w: 0.3,\n h: 0.1,\n style: {\n bg: 'rgba(255, 255, 255, 0.9)',\n color: '#000000'\n }\n};\n"],"names":["BASE_DEFAULTS","HIGHLIGHT_DEFAULTS","TEXT_DEFAULTS"],"mappings":"AAiBY,MAACA,IAAgB;AAAA,EAC3B,MAAM;AAAA,EACN,OAAO;AAAA,EACP,KAAK;AACP,GAYaC,IAAqB;AAAA,EAChC,MAAM;AAAA,EACN,OAAO,CAAC,EAAE,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM;AAAA,EAC3C,OAAO,EAAE,OAAO,yBAAwB;AAC1C,GAeaC,IAAgB;AAAA,EAC3B,SAAS;AAAA,EACT,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,OAAO;AAAA,IACL,IAAI;AAAA,IACJ,OAAO;AAAA,EACX;AACA;"}
|
package/dist/index23.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=JSON.parse(`{"0":{"width":0.5,"paths":[{"points":[[0.25,0],[0.1,0],[0,0.15],[0,0.85],[0.1,1],[0.4,1],[0.5,0.85],[0.5,0.15],[0.4,0],[0.25,0]]}]},"1":{"width":0.3,"paths":[{"points":[[0,0.2],[0.15,0],[0.15,1]]},{"points":[[0,1],[0.3,1]]}],"pathTiming":"sequential"},"2":{"width":0.5,"paths":[{"points":[[0,0.15],[0.1,0],[0.4,0],[0.5,0.15],[0.5,0.35],[0,1],[0.5,1]]}]},"3":{"width":0.5,"paths":[{"points":[[0,0.1],[0.15,0],[0.35,0],[0.5,0.15],[0.5,0.35],[0.35,0.5],[0.15,0.5]]},{"points":[[0.15,0.5],[0.35,0.5],[0.5,0.65],[0.5,0.85],[0.35,1],[0.15,1],[0,0.9]]}],"pathTiming":"sequential"},"4":{"width":0.5,"paths":[{"points":[[0.4,0],[0,0.7],[0.5,0.7]]},{"points":[[0.4,0],[0.4,1]]}],"pathTiming":"sequential"},"5":{"width":0.5,"paths":[{"points":[[0.5,0],[0,0],[0,0.45],[0.3,0.45],[0.5,0.6],[0.5,0.85],[0.35,1],[0.15,1],[0,0.9]]}]},"6":{"width":0.5,"paths":[{"points":[[0.4,0],[0.15,0],[0,0.2],[0,0.85],[0.15,1],[0.35,1],[0.5,0.85],[0.5,0.6],[0.35,0.45],[0.15,0.45],[0,0.6]]}]},"7":{"width":0.5,"paths":[{"points":[[0,0],[0.5,0],[0.2,1]]}]},"8":{"width":0.5,"paths":[{"points":[[0.25,0.5],[0.1,0.5],[0,0.4],[0,0.15],[0.1,0],[0.4,0],[0.5,0.15],[0.5,0.4],[0.4,0.5],[0.25,0.5]]},{"points":[[0.25,0.5],[0.4,0.5],[0.5,0.6],[0.5,0.85],[0.4,1],[0.1,1],[0,0.85],[0,0.6],[0.1,0.5],[0.25,0.5]]}],"pathTiming":"sequential"},"9":{"width":0.5,"paths":[{"points":[[0.5,0.4],[0.35,0.55],[0.15,0.55],[0,0.4],[0,0.15],[0.15,0],[0.35,0],[0.5,0.15],[0.5,0.8],[0.35,1],[0.1,1]]}]},"A":{"width":0.7,"paths":[{"points":[[0,1],[0.35,0],[0.7,1]]},{"points":[[0.12,0.65],[0.58,0.65]]}],"pathTiming":"sequential"},"B":{"width":0.6,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0,0],[0.4,0],[0.55,0.1],[0.55,0.4],[0.4,0.5],[0,0.5]]},{"points":[[0,0.5],[0.45,0.5],[0.6,0.6],[0.6,0.9],[0.45,1],[0,1]]}],"pathTiming":"sequential"},"C":{"width":0.6,"paths":[{"points":[[0.6,0.15],[0.45,0],[0.15,0],[0,0.15],[0,0.85],[0.15,1],[0.45,1],[0.6,0.85]]}]},"D":{"width":0.6,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0,0],[0.35,0],[0.55,0.15],[0.6,0.5],[0.55,0.85],[0.35,1],[0,1]]}],"pathTiming":"sequential"},"E":{"width":0.55,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0,0],[0.55,0]]},{"points":[[0,0.5],[0.4,0.5]]},{"points":[[0,1],[0.55,1]]}],"pathTiming":"sequential"},"F":{"width":0.5,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0,0],[0.5,0]]},{"points":[[0,0.5],[0.35,0.5]]}],"pathTiming":"sequential"},"G":{"width":0.65,"paths":[{"points":[[0.65,0.15],[0.5,0],[0.15,0],[0,0.15],[0,0.85],[0.15,1],[0.5,1],[0.65,0.85],[0.65,0.55]]},{"points":[[0.35,0.55],[0.65,0.55]]}],"pathTiming":"sequential"},"H":{"width":0.6,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0,0.5],[0.6,0.5]]},{"points":[[0.6,0],[0.6,1]]}],"pathTiming":"sequential"},"I":{"width":0.35,"paths":[{"points":[[0,0],[0.35,0]]},{"points":[[0.175,0],[0.175,1]]},{"points":[[0,1],[0.35,1]]}],"pathTiming":"sequential"},"J":{"width":0.45,"paths":[{"points":[[0.1,0],[0.45,0]]},{"points":[[0.3,0],[0.3,0.85],[0.2,1],[0.08,1],[0,0.9]]}],"pathTiming":"sequential"},"K":{"width":0.6,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0.6,0],[0,0.55]]},{"points":[[0.2,0.4],[0.6,1]]}],"pathTiming":"sequential"},"L":{"width":0.5,"paths":[{"points":[[0,0],[0,1],[0.5,1]]}]},"M":{"width":0.75,"paths":[{"points":[[0,1],[0,0],[0.375,0.6],[0.75,0],[0.75,1]]}]},"N":{"width":0.6,"paths":[{"points":[[0,1],[0,0],[0.6,1],[0.6,0]]}]},"O":{"width":0.65,"paths":[{"points":[[0.325,0],[0.15,0],[0,0.15],[0,0.85],[0.15,1],[0.5,1],[0.65,0.85],[0.65,0.15],[0.5,0],[0.325,0]]}]},"P":{"width":0.55,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0,0],[0.4,0],[0.55,0.12],[0.55,0.38],[0.4,0.5],[0,0.5]]}],"pathTiming":"sequential"},"Q":{"width":0.65,"paths":[{"points":[[0.325,0],[0.15,0],[0,0.15],[0,0.85],[0.15,1],[0.5,1],[0.65,0.85],[0.65,0.15],[0.5,0],[0.325,0]]},{"points":[[0.4,0.75],[0.65,1.05]]}],"pathTiming":"sequential"},"R":{"width":0.6,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0,0],[0.4,0],[0.55,0.12],[0.55,0.38],[0.4,0.5],[0,0.5]]},{"points":[[0.3,0.5],[0.6,1]]}],"pathTiming":"sequential"},"S":{"width":0.55,"paths":[{"points":[[0.55,0.12],[0.4,0],[0.15,0],[0,0.12],[0,0.38],[0.15,0.5],[0.4,0.5],[0.55,0.62],[0.55,0.88],[0.4,1],[0.15,1],[0,0.88]]}]},"T":{"width":0.55,"paths":[{"points":[[0,0],[0.55,0]]},{"points":[[0.275,0],[0.275,1]]}],"pathTiming":"sequential"},"U":{"width":0.6,"paths":[{"points":[[0,0],[0,0.85],[0.15,1],[0.45,1],[0.6,0.85],[0.6,0]]}]},"V":{"width":0.65,"paths":[{"points":[[0,0],[0.325,1],[0.65,0]]}]},"W":{"width":0.85,"paths":[{"points":[[0,0],[0.2,1],[0.425,0.4],[0.65,1],[0.85,0]]}]},"X":{"width":0.6,"paths":[{"points":[[0,0],[0.6,1]]},{"points":[[0.6,0],[0,1]]}],"pathTiming":"sequential"},"Y":{"width":0.6,"paths":[{"points":[[0,0],[0.3,0.5]]},{"points":[[0.6,0],[0.3,0.5],[0.3,1]]}],"pathTiming":"sequential"},"Z":{"width":0.55,"paths":[{"points":[[0,0],[0.55,0],[0,1],[0.55,1]]}]},"a":{"width":0.5,"paths":[{"points":[[0.5,0.4],[0.5,1]]},{"points":[[0.5,0.55],[0.35,0.4],[0.15,0.4],[0,0.55],[0,0.85],[0.15,1],[0.35,1],[0.5,0.85]]}],"pathTiming":"sequential"},"b":{"width":0.5,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0,0.55],[0.15,0.4],[0.35,0.4],[0.5,0.55],[0.5,0.85],[0.35,1],[0.15,1],[0,0.85]]}],"pathTiming":"sequential"},"c":{"width":0.45,"paths":[{"points":[[0.45,0.5],[0.3,0.4],[0.15,0.4],[0,0.55],[0,0.85],[0.15,1],[0.3,1],[0.45,0.9]]}]},"d":{"width":0.5,"paths":[{"points":[[0.5,0],[0.5,1]]},{"points":[[0.5,0.55],[0.35,0.4],[0.15,0.4],[0,0.55],[0,0.85],[0.15,1],[0.35,1],[0.5,0.85]]}],"pathTiming":"sequential"},"e":{"width":0.45,"paths":[{"points":[[0,0.7],[0.45,0.7],[0.45,0.55],[0.3,0.4],[0.15,0.4],[0,0.55],[0,0.85],[0.15,1],[0.3,1],[0.45,0.9]]}]},"f":{"width":0.35,"paths":[{"points":[[0.35,0.1],[0.25,0],[0.15,0],[0.1,0.1],[0.1,1]]},{"points":[[0,0.4],[0.3,0.4]]}],"pathTiming":"sequential"},"g":{"width":0.5,"paths":[{"points":[[0.5,0.4],[0.5,1.15],[0.35,1.3],[0.15,1.3],[0,1.15]]},{"points":[[0.5,0.55],[0.35,0.4],[0.15,0.4],[0,0.55],[0,0.85],[0.15,1],[0.35,1],[0.5,0.85]]}],"pathTiming":"sequential"},"h":{"width":0.45,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0,0.55],[0.15,0.4],[0.3,0.4],[0.45,0.55],[0.45,1]]}],"pathTiming":"sequential"},"i":{"width":0.15,"paths":[{"points":[[0.075,0.2],[0.075,0.25]]},{"points":[[0.075,0.4],[0.075,1]]}],"pathTiming":"sequential"},"j":{"width":0.2,"paths":[{"points":[[0.15,0.2],[0.15,0.25]]},{"points":[[0.15,0.4],[0.15,1.15],[0.05,1.3],[0,1.3]]}],"pathTiming":"sequential"},"k":{"width":0.45,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0.45,0.4],[0,0.7]]},{"points":[[0.15,0.6],[0.45,1]]}],"pathTiming":"sequential"},"l":{"width":0.15,"paths":[{"points":[[0.075,0],[0.075,1]]}]},"m":{"width":0.7,"paths":[{"points":[[0,0.4],[0,1]]},{"points":[[0,0.55],[0.1,0.4],[0.25,0.4],[0.35,0.55],[0.35,1]]},{"points":[[0.35,0.55],[0.45,0.4],[0.6,0.4],[0.7,0.55],[0.7,1]]}],"pathTiming":"sequential"},"n":{"width":0.45,"paths":[{"points":[[0,0.4],[0,1]]},{"points":[[0,0.55],[0.15,0.4],[0.3,0.4],[0.45,0.55],[0.45,1]]}],"pathTiming":"sequential"},"o":{"width":0.5,"paths":[{"points":[[0.25,0.4],[0.1,0.4],[0,0.55],[0,0.85],[0.1,1],[0.4,1],[0.5,0.85],[0.5,0.55],[0.4,0.4],[0.25,0.4]]}]},"p":{"width":0.5,"paths":[{"points":[[0,0.4],[0,1.3]]},{"points":[[0,0.55],[0.15,0.4],[0.35,0.4],[0.5,0.55],[0.5,0.85],[0.35,1],[0.15,1],[0,0.85]]}],"pathTiming":"sequential"},"q":{"width":0.5,"paths":[{"points":[[0.5,0.4],[0.5,1.3]]},{"points":[[0.5,0.55],[0.35,0.4],[0.15,0.4],[0,0.55],[0,0.85],[0.15,1],[0.35,1],[0.5,0.85]]}],"pathTiming":"sequential"},"r":{"width":0.3,"paths":[{"points":[[0,0.4],[0,1]]},{"points":[[0,0.55],[0.1,0.4],[0.3,0.4]]}],"pathTiming":"sequential"},"s":{"width":0.4,"paths":[{"points":[[0.4,0.5],[0.3,0.4],[0.1,0.4],[0,0.5],[0,0.6],[0.1,0.7],[0.3,0.7],[0.4,0.8],[0.4,0.9],[0.3,1],[0.1,1],[0,0.9]]}]},"t":{"width":0.3,"paths":[{"points":[[0.1,0.15],[0.1,0.9],[0.2,1],[0.3,1]]},{"points":[[0,0.4],[0.25,0.4]]}],"pathTiming":"sequential"},"u":{"width":0.45,"paths":[{"points":[[0,0.4],[0,0.85],[0.15,1],[0.3,1],[0.45,0.85]]},{"points":[[0.45,0.4],[0.45,1]]}],"pathTiming":"sequential"},"v":{"width":0.45,"paths":[{"points":[[0,0.4],[0.225,1],[0.45,0.4]]}]},"w":{"width":0.65,"paths":[{"points":[[0,0.4],[0.15,1],[0.325,0.6],[0.5,1],[0.65,0.4]]}]},"x":{"width":0.4,"paths":[{"points":[[0,0.4],[0.4,1]]},{"points":[[0.4,0.4],[0,1]]}],"pathTiming":"sequential"},"y":{"width":0.45,"paths":[{"points":[[0,0.4],[0.225,0.85]]},{"points":[[0.45,0.4],[0.15,1],[0.05,1.2],[0,1.3]]}],"pathTiming":"sequential"},"z":{"width":0.4,"paths":[{"points":[[0,0.4],[0.4,0.4],[0,1],[0.4,1]]}]},".":{"width":0.12,"paths":[{"points":[[0.06,0.9],[0.06,0.92],[0.06,0.95],[0.06,1]]}]},",":{"width":0.12,"paths":[{"points":[[0.08,0.9],[0.06,1],[0,1.15]]}]},"!":{"width":0.12,"paths":[{"points":[[0.06,0],[0.06,0.7]]},{"points":[[0.06,0.9],[0.06,0.92],[0.06,0.95],[0.06,1]]}],"pathTiming":"sequential"},"?":{"width":0.45,"paths":[{"points":[[0,0.15],[0.1,0],[0.35,0],[0.45,0.15],[0.45,0.35],[0.3,0.5],[0.225,0.5],[0.225,0.7]]},{"points":[[0.225,0.9],[0.225,0.92],[0.225,0.95],[0.225,1]]}],"pathTiming":"sequential"},"'":{"width":0.1,"paths":[{"points":[[0.05,0],[0.05,0.1],[0.05,0.2]]}]},"\\"":{"width":0.25,"paths":[{"points":[[0.05,0],[0.05,0.1],[0.05,0.2]]},{"points":[[0.2,0],[0.2,0.1],[0.2,0.2]]}],"pathTiming":"parallel"},"-":{"width":0.3,"paths":[{"points":[[0,0.5],[0.1,0.5],[0.2,0.5],[0.3,0.5]]}]},"_":{"width":0.5,"paths":[{"points":[[0,1.05],[0.25,1.05],[0.5,1.05]]}]},":":{"width":0.12,"paths":[{"points":[[0.06,0.45],[0.06,0.48],[0.06,0.5]]},{"points":[[0.06,0.9],[0.06,0.93],[0.06,0.96],[0.06,1]]}],"pathTiming":"sequential"},";":{"width":0.12,"paths":[{"points":[[0.06,0.45],[0.06,0.48],[0.06,0.5]]},{"points":[[0.08,0.9],[0.06,1],[0,1.15]]}],"pathTiming":"sequential"},"(":{"width":0.25,"paths":[{"points":[[0.25,-0.1],[0.1,0.1],[0,0.35],[0,0.65],[0.1,0.9],[0.25,1.1]]}]},")":{"width":0.25,"paths":[{"points":[[0,-0.1],[0.15,0.1],[0.25,0.35],[0.25,0.65],[0.15,0.9],[0,1.1]]}]},"/":{"width":0.4,"paths":[{"points":[[0.4,-0.1],[0.2,0.5],[0,1.1]]}]},"+":{"width":0.45,"paths":[{"points":[[0.225,0.3],[0.225,0.7]]},{"points":[[0,0.5],[0.45,0.5]]}],"pathTiming":"sequential"},"=":{"width":0.45,"paths":[{"points":[[0,0.4],[0.45,0.4]]},{"points":[[0,0.6],[0.45,0.6]]}],"pathTiming":"sequential"}," ":{"width":0.3,"paths":[]}}`),i={glyphs:t};exports.default=i;exports.glyphs=t;
|
|
2
|
+
//# sourceMappingURL=index23.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index23.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/index23.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const t = /* @__PURE__ */ JSON.parse(`{"0":{"width":0.5,"paths":[{"points":[[0.25,0],[0.1,0],[0,0.15],[0,0.85],[0.1,1],[0.4,1],[0.5,0.85],[0.5,0.15],[0.4,0],[0.25,0]]}]},"1":{"width":0.3,"paths":[{"points":[[0,0.2],[0.15,0],[0.15,1]]},{"points":[[0,1],[0.3,1]]}],"pathTiming":"sequential"},"2":{"width":0.5,"paths":[{"points":[[0,0.15],[0.1,0],[0.4,0],[0.5,0.15],[0.5,0.35],[0,1],[0.5,1]]}]},"3":{"width":0.5,"paths":[{"points":[[0,0.1],[0.15,0],[0.35,0],[0.5,0.15],[0.5,0.35],[0.35,0.5],[0.15,0.5]]},{"points":[[0.15,0.5],[0.35,0.5],[0.5,0.65],[0.5,0.85],[0.35,1],[0.15,1],[0,0.9]]}],"pathTiming":"sequential"},"4":{"width":0.5,"paths":[{"points":[[0.4,0],[0,0.7],[0.5,0.7]]},{"points":[[0.4,0],[0.4,1]]}],"pathTiming":"sequential"},"5":{"width":0.5,"paths":[{"points":[[0.5,0],[0,0],[0,0.45],[0.3,0.45],[0.5,0.6],[0.5,0.85],[0.35,1],[0.15,1],[0,0.9]]}]},"6":{"width":0.5,"paths":[{"points":[[0.4,0],[0.15,0],[0,0.2],[0,0.85],[0.15,1],[0.35,1],[0.5,0.85],[0.5,0.6],[0.35,0.45],[0.15,0.45],[0,0.6]]}]},"7":{"width":0.5,"paths":[{"points":[[0,0],[0.5,0],[0.2,1]]}]},"8":{"width":0.5,"paths":[{"points":[[0.25,0.5],[0.1,0.5],[0,0.4],[0,0.15],[0.1,0],[0.4,0],[0.5,0.15],[0.5,0.4],[0.4,0.5],[0.25,0.5]]},{"points":[[0.25,0.5],[0.4,0.5],[0.5,0.6],[0.5,0.85],[0.4,1],[0.1,1],[0,0.85],[0,0.6],[0.1,0.5],[0.25,0.5]]}],"pathTiming":"sequential"},"9":{"width":0.5,"paths":[{"points":[[0.5,0.4],[0.35,0.55],[0.15,0.55],[0,0.4],[0,0.15],[0.15,0],[0.35,0],[0.5,0.15],[0.5,0.8],[0.35,1],[0.1,1]]}]},"A":{"width":0.7,"paths":[{"points":[[0,1],[0.35,0],[0.7,1]]},{"points":[[0.12,0.65],[0.58,0.65]]}],"pathTiming":"sequential"},"B":{"width":0.6,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0,0],[0.4,0],[0.55,0.1],[0.55,0.4],[0.4,0.5],[0,0.5]]},{"points":[[0,0.5],[0.45,0.5],[0.6,0.6],[0.6,0.9],[0.45,1],[0,1]]}],"pathTiming":"sequential"},"C":{"width":0.6,"paths":[{"points":[[0.6,0.15],[0.45,0],[0.15,0],[0,0.15],[0,0.85],[0.15,1],[0.45,1],[0.6,0.85]]}]},"D":{"width":0.6,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0,0],[0.35,0],[0.55,0.15],[0.6,0.5],[0.55,0.85],[0.35,1],[0,1]]}],"pathTiming":"sequential"},"E":{"width":0.55,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0,0],[0.55,0]]},{"points":[[0,0.5],[0.4,0.5]]},{"points":[[0,1],[0.55,1]]}],"pathTiming":"sequential"},"F":{"width":0.5,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0,0],[0.5,0]]},{"points":[[0,0.5],[0.35,0.5]]}],"pathTiming":"sequential"},"G":{"width":0.65,"paths":[{"points":[[0.65,0.15],[0.5,0],[0.15,0],[0,0.15],[0,0.85],[0.15,1],[0.5,1],[0.65,0.85],[0.65,0.55]]},{"points":[[0.35,0.55],[0.65,0.55]]}],"pathTiming":"sequential"},"H":{"width":0.6,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0,0.5],[0.6,0.5]]},{"points":[[0.6,0],[0.6,1]]}],"pathTiming":"sequential"},"I":{"width":0.35,"paths":[{"points":[[0,0],[0.35,0]]},{"points":[[0.175,0],[0.175,1]]},{"points":[[0,1],[0.35,1]]}],"pathTiming":"sequential"},"J":{"width":0.45,"paths":[{"points":[[0.1,0],[0.45,0]]},{"points":[[0.3,0],[0.3,0.85],[0.2,1],[0.08,1],[0,0.9]]}],"pathTiming":"sequential"},"K":{"width":0.6,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0.6,0],[0,0.55]]},{"points":[[0.2,0.4],[0.6,1]]}],"pathTiming":"sequential"},"L":{"width":0.5,"paths":[{"points":[[0,0],[0,1],[0.5,1]]}]},"M":{"width":0.75,"paths":[{"points":[[0,1],[0,0],[0.375,0.6],[0.75,0],[0.75,1]]}]},"N":{"width":0.6,"paths":[{"points":[[0,1],[0,0],[0.6,1],[0.6,0]]}]},"O":{"width":0.65,"paths":[{"points":[[0.325,0],[0.15,0],[0,0.15],[0,0.85],[0.15,1],[0.5,1],[0.65,0.85],[0.65,0.15],[0.5,0],[0.325,0]]}]},"P":{"width":0.55,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0,0],[0.4,0],[0.55,0.12],[0.55,0.38],[0.4,0.5],[0,0.5]]}],"pathTiming":"sequential"},"Q":{"width":0.65,"paths":[{"points":[[0.325,0],[0.15,0],[0,0.15],[0,0.85],[0.15,1],[0.5,1],[0.65,0.85],[0.65,0.15],[0.5,0],[0.325,0]]},{"points":[[0.4,0.75],[0.65,1.05]]}],"pathTiming":"sequential"},"R":{"width":0.6,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0,0],[0.4,0],[0.55,0.12],[0.55,0.38],[0.4,0.5],[0,0.5]]},{"points":[[0.3,0.5],[0.6,1]]}],"pathTiming":"sequential"},"S":{"width":0.55,"paths":[{"points":[[0.55,0.12],[0.4,0],[0.15,0],[0,0.12],[0,0.38],[0.15,0.5],[0.4,0.5],[0.55,0.62],[0.55,0.88],[0.4,1],[0.15,1],[0,0.88]]}]},"T":{"width":0.55,"paths":[{"points":[[0,0],[0.55,0]]},{"points":[[0.275,0],[0.275,1]]}],"pathTiming":"sequential"},"U":{"width":0.6,"paths":[{"points":[[0,0],[0,0.85],[0.15,1],[0.45,1],[0.6,0.85],[0.6,0]]}]},"V":{"width":0.65,"paths":[{"points":[[0,0],[0.325,1],[0.65,0]]}]},"W":{"width":0.85,"paths":[{"points":[[0,0],[0.2,1],[0.425,0.4],[0.65,1],[0.85,0]]}]},"X":{"width":0.6,"paths":[{"points":[[0,0],[0.6,1]]},{"points":[[0.6,0],[0,1]]}],"pathTiming":"sequential"},"Y":{"width":0.6,"paths":[{"points":[[0,0],[0.3,0.5]]},{"points":[[0.6,0],[0.3,0.5],[0.3,1]]}],"pathTiming":"sequential"},"Z":{"width":0.55,"paths":[{"points":[[0,0],[0.55,0],[0,1],[0.55,1]]}]},"a":{"width":0.5,"paths":[{"points":[[0.5,0.4],[0.5,1]]},{"points":[[0.5,0.55],[0.35,0.4],[0.15,0.4],[0,0.55],[0,0.85],[0.15,1],[0.35,1],[0.5,0.85]]}],"pathTiming":"sequential"},"b":{"width":0.5,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0,0.55],[0.15,0.4],[0.35,0.4],[0.5,0.55],[0.5,0.85],[0.35,1],[0.15,1],[0,0.85]]}],"pathTiming":"sequential"},"c":{"width":0.45,"paths":[{"points":[[0.45,0.5],[0.3,0.4],[0.15,0.4],[0,0.55],[0,0.85],[0.15,1],[0.3,1],[0.45,0.9]]}]},"d":{"width":0.5,"paths":[{"points":[[0.5,0],[0.5,1]]},{"points":[[0.5,0.55],[0.35,0.4],[0.15,0.4],[0,0.55],[0,0.85],[0.15,1],[0.35,1],[0.5,0.85]]}],"pathTiming":"sequential"},"e":{"width":0.45,"paths":[{"points":[[0,0.7],[0.45,0.7],[0.45,0.55],[0.3,0.4],[0.15,0.4],[0,0.55],[0,0.85],[0.15,1],[0.3,1],[0.45,0.9]]}]},"f":{"width":0.35,"paths":[{"points":[[0.35,0.1],[0.25,0],[0.15,0],[0.1,0.1],[0.1,1]]},{"points":[[0,0.4],[0.3,0.4]]}],"pathTiming":"sequential"},"g":{"width":0.5,"paths":[{"points":[[0.5,0.4],[0.5,1.15],[0.35,1.3],[0.15,1.3],[0,1.15]]},{"points":[[0.5,0.55],[0.35,0.4],[0.15,0.4],[0,0.55],[0,0.85],[0.15,1],[0.35,1],[0.5,0.85]]}],"pathTiming":"sequential"},"h":{"width":0.45,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0,0.55],[0.15,0.4],[0.3,0.4],[0.45,0.55],[0.45,1]]}],"pathTiming":"sequential"},"i":{"width":0.15,"paths":[{"points":[[0.075,0.2],[0.075,0.25]]},{"points":[[0.075,0.4],[0.075,1]]}],"pathTiming":"sequential"},"j":{"width":0.2,"paths":[{"points":[[0.15,0.2],[0.15,0.25]]},{"points":[[0.15,0.4],[0.15,1.15],[0.05,1.3],[0,1.3]]}],"pathTiming":"sequential"},"k":{"width":0.45,"paths":[{"points":[[0,0],[0,1]]},{"points":[[0.45,0.4],[0,0.7]]},{"points":[[0.15,0.6],[0.45,1]]}],"pathTiming":"sequential"},"l":{"width":0.15,"paths":[{"points":[[0.075,0],[0.075,1]]}]},"m":{"width":0.7,"paths":[{"points":[[0,0.4],[0,1]]},{"points":[[0,0.55],[0.1,0.4],[0.25,0.4],[0.35,0.55],[0.35,1]]},{"points":[[0.35,0.55],[0.45,0.4],[0.6,0.4],[0.7,0.55],[0.7,1]]}],"pathTiming":"sequential"},"n":{"width":0.45,"paths":[{"points":[[0,0.4],[0,1]]},{"points":[[0,0.55],[0.15,0.4],[0.3,0.4],[0.45,0.55],[0.45,1]]}],"pathTiming":"sequential"},"o":{"width":0.5,"paths":[{"points":[[0.25,0.4],[0.1,0.4],[0,0.55],[0,0.85],[0.1,1],[0.4,1],[0.5,0.85],[0.5,0.55],[0.4,0.4],[0.25,0.4]]}]},"p":{"width":0.5,"paths":[{"points":[[0,0.4],[0,1.3]]},{"points":[[0,0.55],[0.15,0.4],[0.35,0.4],[0.5,0.55],[0.5,0.85],[0.35,1],[0.15,1],[0,0.85]]}],"pathTiming":"sequential"},"q":{"width":0.5,"paths":[{"points":[[0.5,0.4],[0.5,1.3]]},{"points":[[0.5,0.55],[0.35,0.4],[0.15,0.4],[0,0.55],[0,0.85],[0.15,1],[0.35,1],[0.5,0.85]]}],"pathTiming":"sequential"},"r":{"width":0.3,"paths":[{"points":[[0,0.4],[0,1]]},{"points":[[0,0.55],[0.1,0.4],[0.3,0.4]]}],"pathTiming":"sequential"},"s":{"width":0.4,"paths":[{"points":[[0.4,0.5],[0.3,0.4],[0.1,0.4],[0,0.5],[0,0.6],[0.1,0.7],[0.3,0.7],[0.4,0.8],[0.4,0.9],[0.3,1],[0.1,1],[0,0.9]]}]},"t":{"width":0.3,"paths":[{"points":[[0.1,0.15],[0.1,0.9],[0.2,1],[0.3,1]]},{"points":[[0,0.4],[0.25,0.4]]}],"pathTiming":"sequential"},"u":{"width":0.45,"paths":[{"points":[[0,0.4],[0,0.85],[0.15,1],[0.3,1],[0.45,0.85]]},{"points":[[0.45,0.4],[0.45,1]]}],"pathTiming":"sequential"},"v":{"width":0.45,"paths":[{"points":[[0,0.4],[0.225,1],[0.45,0.4]]}]},"w":{"width":0.65,"paths":[{"points":[[0,0.4],[0.15,1],[0.325,0.6],[0.5,1],[0.65,0.4]]}]},"x":{"width":0.4,"paths":[{"points":[[0,0.4],[0.4,1]]},{"points":[[0.4,0.4],[0,1]]}],"pathTiming":"sequential"},"y":{"width":0.45,"paths":[{"points":[[0,0.4],[0.225,0.85]]},{"points":[[0.45,0.4],[0.15,1],[0.05,1.2],[0,1.3]]}],"pathTiming":"sequential"},"z":{"width":0.4,"paths":[{"points":[[0,0.4],[0.4,0.4],[0,1],[0.4,1]]}]},".":{"width":0.12,"paths":[{"points":[[0.06,0.9],[0.06,0.92],[0.06,0.95],[0.06,1]]}]},",":{"width":0.12,"paths":[{"points":[[0.08,0.9],[0.06,1],[0,1.15]]}]},"!":{"width":0.12,"paths":[{"points":[[0.06,0],[0.06,0.7]]},{"points":[[0.06,0.9],[0.06,0.92],[0.06,0.95],[0.06,1]]}],"pathTiming":"sequential"},"?":{"width":0.45,"paths":[{"points":[[0,0.15],[0.1,0],[0.35,0],[0.45,0.15],[0.45,0.35],[0.3,0.5],[0.225,0.5],[0.225,0.7]]},{"points":[[0.225,0.9],[0.225,0.92],[0.225,0.95],[0.225,1]]}],"pathTiming":"sequential"},"'":{"width":0.1,"paths":[{"points":[[0.05,0],[0.05,0.1],[0.05,0.2]]}]},"\\"":{"width":0.25,"paths":[{"points":[[0.05,0],[0.05,0.1],[0.05,0.2]]},{"points":[[0.2,0],[0.2,0.1],[0.2,0.2]]}],"pathTiming":"parallel"},"-":{"width":0.3,"paths":[{"points":[[0,0.5],[0.1,0.5],[0.2,0.5],[0.3,0.5]]}]},"_":{"width":0.5,"paths":[{"points":[[0,1.05],[0.25,1.05],[0.5,1.05]]}]},":":{"width":0.12,"paths":[{"points":[[0.06,0.45],[0.06,0.48],[0.06,0.5]]},{"points":[[0.06,0.9],[0.06,0.93],[0.06,0.96],[0.06,1]]}],"pathTiming":"sequential"},";":{"width":0.12,"paths":[{"points":[[0.06,0.45],[0.06,0.48],[0.06,0.5]]},{"points":[[0.08,0.9],[0.06,1],[0,1.15]]}],"pathTiming":"sequential"},"(":{"width":0.25,"paths":[{"points":[[0.25,-0.1],[0.1,0.1],[0,0.35],[0,0.65],[0.1,0.9],[0.25,1.1]]}]},")":{"width":0.25,"paths":[{"points":[[0,-0.1],[0.15,0.1],[0.25,0.35],[0.25,0.65],[0.15,0.9],[0,1.1]]}]},"/":{"width":0.4,"paths":[{"points":[[0.4,-0.1],[0.2,0.5],[0,1.1]]}]},"+":{"width":0.45,"paths":[{"points":[[0.225,0.3],[0.225,0.7]]},{"points":[[0,0.5],[0.45,0.5]]}],"pathTiming":"sequential"},"=":{"width":0.45,"paths":[{"points":[[0,0.4],[0.45,0.4]]},{"points":[[0,0.6],[0.45,0.6]]}],"pathTiming":"sequential"}," ":{"width":0.3,"paths":[]}}`), i = {
|
|
2
|
+
glyphs: t
|
|
3
|
+
};
|
|
4
|
+
export {
|
|
5
|
+
i as default,
|
|
6
|
+
t as glyphs
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=index23.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index23.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
package/dist/index24.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index24.cjs","sources":["../src/utils/idGenerator.js"],"sourcesContent":["/**\n * ID Generator Utility\n *\n * Generates unique IDs for annotations.\n *\n * @module utils/idGenerator\n */\n\n/**\n * Generate a unique ID for an annotation\n *\n * @param {string} [prefix='anno'] - ID prefix (e.g., 'highlight', 'text', 'ink')\n * @returns {string} Unique annotation ID\n * @example\n * ```javascript\n * const id = generateId('highlight');\n * // Returns: \"highlight-1234567890abc\"\n * ```\n */\nexport function generateId(prefix = 'anno') {\n const timestamp = Date.now().toString(36);\n const random = Math.random().toString(36).substring(2, 9);\n return `${prefix}-${timestamp}${random}`;\n}\n"],"names":["generateId","prefix","timestamp","random"],"mappings":"gFAmBO,SAASA,EAAWC,EAAS,OAAQ,CAC1C,MAAMC,EAAY,KAAK,IAAG,EAAG,SAAS,EAAE,EAClCC,EAAS,KAAK,SAAS,SAAS,EAAE,EAAE,UAAU,EAAG,CAAC,EACxD,MAAO,GAAGF,CAAM,IAAIC,CAAS,GAAGC,CAAM,EACxC"}
|
package/dist/index24.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index24.js","sources":["../src/utils/idGenerator.js"],"sourcesContent":["/**\n * ID Generator Utility\n *\n * Generates unique IDs for annotations.\n *\n * @module utils/idGenerator\n */\n\n/**\n * Generate a unique ID for an annotation\n *\n * @param {string} [prefix='anno'] - ID prefix (e.g., 'highlight', 'text', 'ink')\n * @returns {string} Unique annotation ID\n * @example\n * ```javascript\n * const id = generateId('highlight');\n * // Returns: \"highlight-1234567890abc\"\n * ```\n */\nexport function generateId(prefix = 'anno') {\n const timestamp = Date.now().toString(36);\n const random = Math.random().toString(36).substring(2, 9);\n return `${prefix}-${timestamp}${random}`;\n}\n"],"names":["generateId","prefix","timestamp","random"],"mappings":"AAmBO,SAASA,EAAWC,IAAS,QAAQ;AAC1C,QAAMC,IAAY,KAAK,IAAG,EAAG,SAAS,EAAE,GAClCC,IAAS,KAAK,SAAS,SAAS,EAAE,EAAE,UAAU,GAAG,CAAC;AACxD,SAAO,GAAGF,CAAM,IAAIC,CAAS,GAAGC,CAAM;AACxC;"}
|
package/dist/index3.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("pdfjs-dist"),l=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("pdfjs-dist"),l=require("./index8.cjs");function d(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,t.get?t:{enumerable:!0,get:()=>n[r]})}}return e.default=n,Object.freeze(e)}const u=d(i);class f{constructor(){this.pdfDoc=null,this.renderTask=null}async loadDocument(e){try{if(!e||typeof e!="string")return{success:!1,error:"Invalid PDF URL provided"};const t=await u.getDocument(e).promise;return this.pdfDoc=t,{success:!0,pageCount:t.numPages}}catch(r){return console.error("PDF loading error:",r),{success:!1,error:`Failed to load PDF: ${r.message}`}}}async renderPage(e,r,t){try{if(!this.pdfDoc)return{success:!1,error:"No PDF document loaded"};if(!r||!(r instanceof HTMLCanvasElement))return{success:!1,error:"Invalid canvas element provided"};if(e<1||e>this.pdfDoc.numPages)return{success:!1,error:`Invalid page number: ${e}. Document has ${this.pdfDoc.numPages} pages.`};this.renderTask&&(this.renderTask.cancel(),this.renderTask=null);const s=await this.pdfDoc.getPage(e),o=l.calculateViewport(s,t);r.width=o.width,r.height=o.height;const c=r.getContext("2d");if(!c)return{success:!1,error:"Failed to get canvas 2d context"};const a={canvasContext:c,viewport:o};return this.renderTask=s.render(a),await this.renderTask.promise,this.renderTask=null,{success:!0,viewport:o}}catch(s){return s.name==="RenderingCancelledException"?(console.log("Rendering cancelled"),{success:!1,error:"Rendering was cancelled"}):(console.error("Page rendering error:",s),{success:!1,error:`Failed to render page: ${s.message}`})}finally{this.renderTask=null}}getPageCount(){return this.pdfDoc?this.pdfDoc.numPages:0}cancelRender(){if(this.renderTask)try{this.renderTask.cancel()}catch(e){console.log("Render cancellation error (ignored):",e)}finally{this.renderTask=null}}destroy(){this.cancelRender(),this.pdfDoc&&(this.pdfDoc=null),this.renderTask=null}}exports.PDFRenderer=f;
|
|
2
2
|
//# sourceMappingURL=index3.cjs.map
|
package/dist/index3.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index3.cjs","sources":["../src/core/PDFRenderer.js"],"sourcesContent":["/**\n * PDFRenderer - Framework-agnostic PDF rendering subsystem\n *\n * This module encapsulates all pdf.js operations including document loading,\n * page rendering, viewport calculations, and rendering task management.\n *\n * @module core/PDFRenderer\n */\n\nimport * as pdfjsLib from \"pdfjs-dist\";\nimport { calculateViewport } from \"../utils/viewportUtils.js\";\n\n/**\n * PDFRenderer class\n *\n * Provides framework-agnostic PDF rendering capabilities.\n * Abstracts pdf.js complexity and provides clean interface for engine.\n *\n * @class\n * @example\n * const renderer = new PDFRenderer();\n * await renderer.loadDocument('/path/to/doc.pdf');\n * const result = await renderer.renderPage(1, canvasElement, 1.5);\n */\nexport class PDFRenderer {\n constructor() {\n /**\n * @private\n * @type {PDFDocumentProxy|null}\n */\n this.pdfDoc = null;\n\n /**\n * @private\n * @type {RenderTask|null}\n */\n this.renderTask = null;\n }\n\n /**\n * Load PDF document from URL\n *\n * @param {string} url - URL or path to PDF file\n * @returns {Promise<{success: boolean, pageCount?: number, error?: string}>}\n */\n async loadDocument(url) {\n try {\n if (!url || typeof url !== \"string\") {\n return {\n success: false,\n error: \"Invalid PDF URL provided\",\n };\n }\n\n const loadingTask = pdfjsLib.getDocument(url);\n const pdf = await loadingTask.promise;\n\n this.pdfDoc = pdf;\n\n return {\n success: true,\n pageCount: pdf.numPages,\n };\n } catch (err) {\n console.error(\"PDF loading error:\", err);\n return {\n success: false,\n error: `Failed to load PDF: ${err.message}`,\n };\n }\n }\n\n /**\n * Render PDF page to canvas element\n *\n * @param {number} pageNum - Page number (1-indexed)\n * @param {HTMLCanvasElement} canvas - Canvas element to render to\n * @param {number} scale - Scale factor for rendering\n * @returns {Promise<{success: boolean, viewport?: Object, error?: string}>}\n */\n async renderPage(pageNum, canvas, scale) {\n try {\n if (!this.pdfDoc) {\n return {\n success: false,\n error: \"No PDF document loaded\",\n };\n }\n\n if (!canvas || !(canvas instanceof HTMLCanvasElement)) {\n return {\n success: false,\n error: \"Invalid canvas element provided\",\n };\n }\n\n if (pageNum < 1 || pageNum > this.pdfDoc.numPages) {\n return {\n success: false,\n error: `Invalid page number: ${pageNum}. Document has ${this.pdfDoc.numPages} pages.`,\n };\n }\n\n // Cancel any in-progress rendering\n if (this.renderTask) {\n this.renderTask.cancel();\n this.renderTask = null;\n }\n\n const page = await this.pdfDoc.getPage(pageNum);\n const viewport = calculateViewport(page, scale);\n\n canvas.width = viewport.width;\n canvas.height = viewport.height;\n\n const context = canvas.getContext(\"2d\");\n if (!context) {\n return {\n success: false,\n error: \"Failed to get canvas 2d context\",\n };\n }\n\n const renderContext = {\n canvasContext: context,\n viewport: viewport,\n };\n\n this.renderTask = page.render(renderContext);\n await this.renderTask.promise;\n\n this.renderTask = null;\n\n return {\n success: true,\n viewport: viewport,\n };\n } catch (err) {\n if (err.name === \"RenderingCancelledException\") {\n console.log(\"Rendering cancelled\");\n return {\n success: false,\n error: \"Rendering was cancelled\",\n };\n }\n\n console.error(\"Page rendering error:\", err);\n return {\n success: false,\n error: `Failed to render page: ${err.message}`,\n };\n } finally {\n this.renderTask = null;\n }\n }\n\n /**\n * Get total number of pages in loaded PDF\n *\n * @returns {number} Page count, or 0 if no document loaded\n */\n getPageCount() {\n return this.pdfDoc ? this.pdfDoc.numPages : 0;\n }\n\n /**\n * Cancel current rendering task if active\n *\n * @returns {void}\n */\n cancelRender() {\n if (this.renderTask) {\n try {\n this.renderTask.cancel();\n } catch (err) {\n console.log(\"Render cancellation error (ignored):\", err);\n } finally {\n this.renderTask = null;\n }\n }\n }\n\n /**\n * Clean up resources and release references\n *\n * @returns {void}\n */\n destroy() {\n this.cancelRender();\n\n if (this.pdfDoc) {\n this.pdfDoc = null;\n }\n\n this.renderTask = null;\n }\n}\n"],"names":["PDFRenderer","url","pdf","pdfjsLib","err","pageNum","canvas","scale","page","viewport","calculateViewport","context","renderContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index3.cjs","sources":["../src/core/PDFRenderer.js"],"sourcesContent":["/**\n * PDFRenderer - Framework-agnostic PDF rendering subsystem\n *\n * This module encapsulates all pdf.js operations including document loading,\n * page rendering, viewport calculations, and rendering task management.\n *\n * @module core/PDFRenderer\n */\n\nimport * as pdfjsLib from \"pdfjs-dist\";\nimport { calculateViewport } from \"../utils/viewportUtils.js\";\n\n/**\n * PDFRenderer class\n *\n * Provides framework-agnostic PDF rendering capabilities.\n * Abstracts pdf.js complexity and provides clean interface for engine.\n *\n * @class\n * @example\n * const renderer = new PDFRenderer();\n * await renderer.loadDocument('/path/to/doc.pdf');\n * const result = await renderer.renderPage(1, canvasElement, 1.5);\n */\nexport class PDFRenderer {\n constructor() {\n /**\n * @private\n * @type {PDFDocumentProxy|null}\n */\n this.pdfDoc = null;\n\n /**\n * @private\n * @type {RenderTask|null}\n */\n this.renderTask = null;\n }\n\n /**\n * Load PDF document from URL\n *\n * @param {string} url - URL or path to PDF file\n * @returns {Promise<{success: boolean, pageCount?: number, error?: string}>}\n */\n async loadDocument(url) {\n try {\n if (!url || typeof url !== \"string\") {\n return {\n success: false,\n error: \"Invalid PDF URL provided\",\n };\n }\n\n const loadingTask = pdfjsLib.getDocument(url);\n const pdf = await loadingTask.promise;\n\n this.pdfDoc = pdf;\n\n return {\n success: true,\n pageCount: pdf.numPages,\n };\n } catch (err) {\n console.error(\"PDF loading error:\", err);\n return {\n success: false,\n error: `Failed to load PDF: ${err.message}`,\n };\n }\n }\n\n /**\n * Render PDF page to canvas element\n *\n * @param {number} pageNum - Page number (1-indexed)\n * @param {HTMLCanvasElement} canvas - Canvas element to render to\n * @param {number} scale - Scale factor for rendering\n * @returns {Promise<{success: boolean, viewport?: Object, error?: string}>}\n */\n async renderPage(pageNum, canvas, scale) {\n try {\n if (!this.pdfDoc) {\n return {\n success: false,\n error: \"No PDF document loaded\",\n };\n }\n\n if (!canvas || !(canvas instanceof HTMLCanvasElement)) {\n return {\n success: false,\n error: \"Invalid canvas element provided\",\n };\n }\n\n if (pageNum < 1 || pageNum > this.pdfDoc.numPages) {\n return {\n success: false,\n error: `Invalid page number: ${pageNum}. Document has ${this.pdfDoc.numPages} pages.`,\n };\n }\n\n // Cancel any in-progress rendering\n if (this.renderTask) {\n this.renderTask.cancel();\n this.renderTask = null;\n }\n\n const page = await this.pdfDoc.getPage(pageNum);\n const viewport = calculateViewport(page, scale);\n\n canvas.width = viewport.width;\n canvas.height = viewport.height;\n\n const context = canvas.getContext(\"2d\");\n if (!context) {\n return {\n success: false,\n error: \"Failed to get canvas 2d context\",\n };\n }\n\n const renderContext = {\n canvasContext: context,\n viewport: viewport,\n };\n\n this.renderTask = page.render(renderContext);\n await this.renderTask.promise;\n\n this.renderTask = null;\n\n return {\n success: true,\n viewport: viewport,\n };\n } catch (err) {\n if (err.name === \"RenderingCancelledException\") {\n console.log(\"Rendering cancelled\");\n return {\n success: false,\n error: \"Rendering was cancelled\",\n };\n }\n\n console.error(\"Page rendering error:\", err);\n return {\n success: false,\n error: `Failed to render page: ${err.message}`,\n };\n } finally {\n this.renderTask = null;\n }\n }\n\n /**\n * Get total number of pages in loaded PDF\n *\n * @returns {number} Page count, or 0 if no document loaded\n */\n getPageCount() {\n return this.pdfDoc ? this.pdfDoc.numPages : 0;\n }\n\n /**\n * Cancel current rendering task if active\n *\n * @returns {void}\n */\n cancelRender() {\n if (this.renderTask) {\n try {\n this.renderTask.cancel();\n } catch (err) {\n console.log(\"Render cancellation error (ignored):\", err);\n } finally {\n this.renderTask = null;\n }\n }\n }\n\n /**\n * Clean up resources and release references\n *\n * @returns {void}\n */\n destroy() {\n this.cancelRender();\n\n if (this.pdfDoc) {\n this.pdfDoc = null;\n }\n\n this.renderTask = null;\n }\n}\n"],"names":["PDFRenderer","url","pdf","pdfjsLib","err","pageNum","canvas","scale","page","viewport","calculateViewport","context","renderContext"],"mappings":"kaAwBO,MAAMA,CAAY,CACvB,aAAc,CAKZ,KAAK,OAAS,KAMd,KAAK,WAAa,IACpB,CAQA,MAAM,aAAaC,EAAK,CACtB,GAAI,CACF,GAAI,CAACA,GAAO,OAAOA,GAAQ,SACzB,MAAO,CACL,QAAS,GACT,MAAO,0BACjB,EAIM,MAAMC,EAAM,MADQC,EAAS,YAAYF,CAAG,EACd,QAE9B,YAAK,OAASC,EAEP,CACL,QAAS,GACT,UAAWA,EAAI,QACvB,CACI,OAASE,EAAK,CACZ,eAAQ,MAAM,qBAAsBA,CAAG,EAChC,CACL,QAAS,GACT,MAAO,uBAAuBA,EAAI,OAAO,EACjD,CACI,CACF,CAUA,MAAM,WAAWC,EAASC,EAAQC,EAAO,CACvC,GAAI,CACF,GAAI,CAAC,KAAK,OACR,MAAO,CACL,QAAS,GACT,MAAO,wBACjB,EAGM,GAAI,CAACD,GAAU,EAAEA,aAAkB,mBACjC,MAAO,CACL,QAAS,GACT,MAAO,iCACjB,EAGM,GAAID,EAAU,GAAKA,EAAU,KAAK,OAAO,SACvC,MAAO,CACL,QAAS,GACT,MAAO,wBAAwBA,CAAO,kBAAkB,KAAK,OAAO,QAAQ,SACtF,EAIU,KAAK,aACP,KAAK,WAAW,OAAM,EACtB,KAAK,WAAa,MAGpB,MAAMG,EAAO,MAAM,KAAK,OAAO,QAAQH,CAAO,EACxCI,EAAWC,EAAAA,kBAAkBF,EAAMD,CAAK,EAE9CD,EAAO,MAAQG,EAAS,MACxBH,EAAO,OAASG,EAAS,OAEzB,MAAME,EAAUL,EAAO,WAAW,IAAI,EACtC,GAAI,CAACK,EACH,MAAO,CACL,QAAS,GACT,MAAO,iCACjB,EAGM,MAAMC,EAAgB,CACpB,cAAeD,EACf,SAAUF,CAClB,EAEM,YAAK,WAAaD,EAAK,OAAOI,CAAa,EAC3C,MAAM,KAAK,WAAW,QAEtB,KAAK,WAAa,KAEX,CACL,QAAS,GACT,SAAUH,CAClB,CACI,OAASL,EAAK,CACZ,OAAIA,EAAI,OAAS,+BACf,QAAQ,IAAI,qBAAqB,EAC1B,CACL,QAAS,GACT,MAAO,yBACjB,IAGM,QAAQ,MAAM,wBAAyBA,CAAG,EACnC,CACL,QAAS,GACT,MAAO,0BAA0BA,EAAI,OAAO,EACpD,EACI,QAAC,CACC,KAAK,WAAa,IACpB,CACF,CAOA,cAAe,CACb,OAAO,KAAK,OAAS,KAAK,OAAO,SAAW,CAC9C,CAOA,cAAe,CACb,GAAI,KAAK,WACP,GAAI,CACF,KAAK,WAAW,OAAM,CACxB,OAASA,EAAK,CACZ,QAAQ,IAAI,uCAAwCA,CAAG,CACzD,QAAC,CACC,KAAK,WAAa,IACpB,CAEJ,CAOA,SAAU,CACR,KAAK,aAAY,EAEb,KAAK,SACP,KAAK,OAAS,MAGhB,KAAK,WAAa,IACpB,CACF"}
|
package/dist/index3.js
CHANGED
package/dist/index4.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class r{constructor(){this.currentTime=0,this.subscribers=new Set,this.animationFrameId=null,this.isRunning=!1}setTime(n){n!==this.currentTime&&(this.currentTime=n,this.notifySubscribers())}getCurrentTime(){return this.currentTime}subscribe(n){if(typeof n!="function")throw new Error("TimelineSync.subscribe: callback must be a function");return this.subscribers.add(n),()=>this.unsubscribe(n)}unsubscribe(n){this.subscribers.delete(n)}startContinuousSync(n){if(typeof n!="function")throw new Error("TimelineSync.startContinuousSync: getTimeFunction must be a function");if(this.isRunning){console.warn("TimelineSync: Continuous sync already running");return}this.isRunning=!0;const i=()=>{if(this.isRunning){try{const e=n();this.setTime(e)}catch(e){console.error("TimelineSync: Error in continuous sync:",e)}this.animationFrameId=requestAnimationFrame(i)}};i()}stopContinuousSync(){this.isRunning=!1,this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}destroy(){this.stopContinuousSync(),this.subscribers.clear(),this.currentTime=0}notifySubscribers(){for(const n of this.subscribers)try{n(this.currentTime)}catch(i){console.error("TimelineSync: Subscriber callback error:",i)}}}exports.TimelineSync=r;
|
|
2
2
|
//# sourceMappingURL=index4.cjs.map
|
package/dist/index4.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index4.cjs","sources":["../src/core/
|
|
1
|
+
{"version":3,"file":"index4.cjs","sources":["../src/core/TimelineSync.js"],"sourcesContent":["/**\n * TimelineSync - Framework-agnostic timeline synchronization subsystem\n *\n * This module manages timeline position and provides a subscriber notification\n * system for timeline updates. Supports both discrete updates (manual setTime)\n * and continuous synchronization via requestAnimationFrame for audio/video.\n *\n * @module core/TimelineSync\n */\n\n/**\n * TimelineSync class\n *\n * Provides timeline state management and pub-sub notification system.\n * Zero dependencies - pure JavaScript implementation.\n *\n * @class\n * @example\n * // Discrete mode\n * const sync = new TimelineSync();\n * sync.subscribe((time) => console.log('Time:', time));\n * sync.setTime(5.0);\n *\n * @example\n * // Continuous mode with audio\n * const audio = document.getElementById('audio');\n * sync.startContinuousSync(() => audio.currentTime);\n */\nexport class TimelineSync {\n constructor() {\n /**\n * @private\n * @type {number}\n */\n this.currentTime = 0;\n\n /**\n * @private\n * @type {Set<Function>}\n */\n this.subscribers = new Set();\n\n /**\n * @private\n * @type {number|null}\n */\n this.animationFrameId = null;\n\n /**\n * @private\n * @type {boolean}\n */\n this.isRunning = false;\n }\n\n /**\n * Set timeline position and notify subscribers if changed\n *\n * @param {number} timestamp - Timeline position in seconds\n * @returns {void}\n */\n setTime(timestamp) {\n if (timestamp === this.currentTime) {\n return;\n }\n\n this.currentTime = timestamp;\n this.notifySubscribers();\n }\n\n /**\n * Get current timeline position\n *\n * @returns {number} Current timeline position in seconds\n */\n getCurrentTime() {\n return this.currentTime;\n }\n\n /**\n * Subscribe to timeline updates\n *\n * @param {Function} callback - Function to call on timeline updates\n * @returns {Function} Unsubscribe function\n * @throws {Error} If callback is not a function\n */\n subscribe(callback) {\n if (typeof callback !== 'function') {\n throw new Error('TimelineSync.subscribe: callback must be a function');\n }\n\n this.subscribers.add(callback);\n\n return () => this.unsubscribe(callback);\n }\n\n /**\n * Unsubscribe from timeline updates\n *\n * @param {Function} callback - Callback function to remove\n * @returns {void}\n */\n unsubscribe(callback) {\n this.subscribers.delete(callback);\n }\n\n /**\n * Start continuous timeline synchronization\n *\n * @param {Function} getTimeFunction - Function that returns current time\n * @returns {void}\n * @throws {Error} If getTimeFunction is not a function\n */\n startContinuousSync(getTimeFunction) {\n if (typeof getTimeFunction !== 'function') {\n throw new Error('TimelineSync.startContinuousSync: getTimeFunction must be a function');\n }\n\n if (this.isRunning) {\n console.warn('TimelineSync: Continuous sync already running');\n return;\n }\n\n this.isRunning = true;\n\n const syncLoop = () => {\n if (!this.isRunning) {\n return;\n }\n\n try {\n const newTime = getTimeFunction();\n this.setTime(newTime);\n } catch (err) {\n console.error('TimelineSync: Error in continuous sync:', err);\n }\n\n this.animationFrameId = requestAnimationFrame(syncLoop);\n };\n\n syncLoop();\n }\n\n /**\n * Stop continuous timeline synchronization\n *\n * @returns {void}\n */\n stopContinuousSync() {\n this.isRunning = false;\n\n if (this.animationFrameId !== null) {\n cancelAnimationFrame(this.animationFrameId);\n this.animationFrameId = null;\n }\n }\n\n /**\n * Clean up resources and release references\n *\n * @returns {void}\n */\n destroy() {\n this.stopContinuousSync();\n this.subscribers.clear();\n this.currentTime = 0;\n }\n\n /**\n * Notify all subscribers of current time\n *\n * @private\n * @returns {void}\n */\n notifySubscribers() {\n for (const callback of this.subscribers) {\n try {\n callback(this.currentTime);\n } catch (err) {\n console.error('TimelineSync: Subscriber callback error:', err);\n }\n }\n }\n}\n"],"names":["TimelineSync","timestamp","callback","getTimeFunction","syncLoop","newTime","err"],"mappings":"gFA4BO,MAAMA,CAAa,CACxB,aAAc,CAKZ,KAAK,YAAc,EAMnB,KAAK,YAAc,IAAI,IAMvB,KAAK,iBAAmB,KAMxB,KAAK,UAAY,EACnB,CAQA,QAAQC,EAAW,CACbA,IAAc,KAAK,cAIvB,KAAK,YAAcA,EACnB,KAAK,kBAAiB,EACxB,CAOA,gBAAiB,CACf,OAAO,KAAK,WACd,CASA,UAAUC,EAAU,CAClB,GAAI,OAAOA,GAAa,WACtB,MAAM,IAAI,MAAM,qDAAqD,EAGvE,YAAK,YAAY,IAAIA,CAAQ,EAEtB,IAAM,KAAK,YAAYA,CAAQ,CACxC,CAQA,YAAYA,EAAU,CACpB,KAAK,YAAY,OAAOA,CAAQ,CAClC,CASA,oBAAoBC,EAAiB,CACnC,GAAI,OAAOA,GAAoB,WAC7B,MAAM,IAAI,MAAM,sEAAsE,EAGxF,GAAI,KAAK,UAAW,CAClB,QAAQ,KAAK,+CAA+C,EAC5D,MACF,CAEA,KAAK,UAAY,GAEjB,MAAMC,EAAW,IAAM,CACrB,GAAK,KAAK,UAIV,IAAI,CACF,MAAMC,EAAUF,EAAe,EAC/B,KAAK,QAAQE,CAAO,CACtB,OAASC,EAAK,CACZ,QAAQ,MAAM,0CAA2CA,CAAG,CAC9D,CAEA,KAAK,iBAAmB,sBAAsBF,CAAQ,EACxD,EAEAA,EAAQ,CACV,CAOA,oBAAqB,CACnB,KAAK,UAAY,GAEb,KAAK,mBAAqB,OAC5B,qBAAqB,KAAK,gBAAgB,EAC1C,KAAK,iBAAmB,KAE5B,CAOA,SAAU,CACR,KAAK,mBAAkB,EACvB,KAAK,YAAY,MAAK,EACtB,KAAK,YAAc,CACrB,CAQA,mBAAoB,CAClB,UAAWF,KAAY,KAAK,YAC1B,GAAI,CACFA,EAAS,KAAK,WAAW,CAC3B,OAASI,EAAK,CACZ,QAAQ,MAAM,2CAA4CA,CAAG,CAC/D,CAEJ,CACF"}
|