@css-inline/css-inline-wasm 0.13.2 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +1 -0
- package/index.js +77 -44
- package/index.min.js +2 -2
- package/index.mjs +77 -44
- package/index_bg.wasm +0 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
19
19
|
*/
|
|
20
20
|
export declare const initWasm: (module_or_path: Promise<InitInput> | InitInput) => Promise<void>;
|
|
21
21
|
export declare function inline(html: string, options?: InlineOptions): string;
|
|
22
|
+
export declare function inlineFragment(html: string, css: string, options?: InlineOptions): string;
|
|
22
23
|
export declare function version(): string;
|
|
23
24
|
|
|
24
25
|
export {};
|
package/index.js
CHANGED
|
@@ -22,6 +22,7 @@ var wasm_binding_exports = {};
|
|
|
22
22
|
__export(wasm_binding_exports, {
|
|
23
23
|
initWasm: () => initWasm,
|
|
24
24
|
inline: () => inline2,
|
|
25
|
+
inlineFragment: () => inlineFragment2,
|
|
25
26
|
version: () => version2
|
|
26
27
|
});
|
|
27
28
|
module.exports = __toCommonJS(wasm_binding_exports);
|
|
@@ -33,7 +34,32 @@ heap.push(void 0, null, true, false);
|
|
|
33
34
|
function getObject(idx) {
|
|
34
35
|
return heap[idx];
|
|
35
36
|
}
|
|
37
|
+
var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
38
|
+
throw Error("TextDecoder not available");
|
|
39
|
+
} };
|
|
40
|
+
if (typeof TextDecoder !== "undefined") {
|
|
41
|
+
cachedTextDecoder.decode();
|
|
42
|
+
}
|
|
43
|
+
var cachedUint8Memory0 = null;
|
|
44
|
+
function getUint8Memory0() {
|
|
45
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
46
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
47
|
+
}
|
|
48
|
+
return cachedUint8Memory0;
|
|
49
|
+
}
|
|
50
|
+
function getStringFromWasm0(ptr, len) {
|
|
51
|
+
ptr = ptr >>> 0;
|
|
52
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
53
|
+
}
|
|
36
54
|
var heap_next = heap.length;
|
|
55
|
+
function addHeapObject(obj) {
|
|
56
|
+
if (heap_next === heap.length)
|
|
57
|
+
heap.push(heap.length + 1);
|
|
58
|
+
const idx = heap_next;
|
|
59
|
+
heap_next = heap[idx];
|
|
60
|
+
heap[idx] = obj;
|
|
61
|
+
return idx;
|
|
62
|
+
}
|
|
37
63
|
function dropObject(idx) {
|
|
38
64
|
if (idx < 132)
|
|
39
65
|
return;
|
|
@@ -46,13 +72,6 @@ function takeObject(idx) {
|
|
|
46
72
|
return ret;
|
|
47
73
|
}
|
|
48
74
|
var WASM_VECTOR_LEN = 0;
|
|
49
|
-
var cachedUint8Memory0 = null;
|
|
50
|
-
function getUint8Memory0() {
|
|
51
|
-
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
52
|
-
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
53
|
-
}
|
|
54
|
-
return cachedUint8Memory0;
|
|
55
|
-
}
|
|
56
75
|
var cachedTextEncoder = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
|
|
57
76
|
throw Error("TextEncoder not available");
|
|
58
77
|
} };
|
|
@@ -107,24 +126,6 @@ function getInt32Memory0() {
|
|
|
107
126
|
}
|
|
108
127
|
return cachedInt32Memory0;
|
|
109
128
|
}
|
|
110
|
-
var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
111
|
-
throw Error("TextDecoder not available");
|
|
112
|
-
} };
|
|
113
|
-
if (typeof TextDecoder !== "undefined") {
|
|
114
|
-
cachedTextDecoder.decode();
|
|
115
|
-
}
|
|
116
|
-
function getStringFromWasm0(ptr, len) {
|
|
117
|
-
ptr = ptr >>> 0;
|
|
118
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
119
|
-
}
|
|
120
|
-
function addHeapObject(obj) {
|
|
121
|
-
if (heap_next === heap.length)
|
|
122
|
-
heap.push(heap.length + 1);
|
|
123
|
-
const idx = heap_next;
|
|
124
|
-
heap_next = heap[idx];
|
|
125
|
-
heap[idx] = obj;
|
|
126
|
-
return idx;
|
|
127
|
-
}
|
|
128
129
|
var cachedFloat64Memory0 = null;
|
|
129
130
|
function getFloat64Memory0() {
|
|
130
131
|
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
@@ -215,6 +216,35 @@ function inline(html, options) {
|
|
|
215
216
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
216
217
|
}
|
|
217
218
|
}
|
|
219
|
+
function inlineFragment(html, css, options) {
|
|
220
|
+
let deferred4_0;
|
|
221
|
+
let deferred4_1;
|
|
222
|
+
try {
|
|
223
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
224
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
225
|
+
const len0 = WASM_VECTOR_LEN;
|
|
226
|
+
const ptr1 = passStringToWasm0(css, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
227
|
+
const len1 = WASM_VECTOR_LEN;
|
|
228
|
+
wasm.inlineFragment(retptr, ptr0, len0, ptr1, len1, addHeapObject(options));
|
|
229
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
230
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
231
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
232
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
233
|
+
var ptr3 = r0;
|
|
234
|
+
var len3 = r1;
|
|
235
|
+
if (r3) {
|
|
236
|
+
ptr3 = 0;
|
|
237
|
+
len3 = 0;
|
|
238
|
+
throw takeObject(r2);
|
|
239
|
+
}
|
|
240
|
+
deferred4_0 = ptr3;
|
|
241
|
+
deferred4_1 = len3;
|
|
242
|
+
return getStringFromWasm0(ptr3, len3);
|
|
243
|
+
} finally {
|
|
244
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
245
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
218
248
|
function version() {
|
|
219
249
|
let deferred1_0;
|
|
220
250
|
let deferred1_1;
|
|
@@ -262,31 +292,15 @@ function __wbg_get_imports() {
|
|
|
262
292
|
const ret = getObject(arg0) === void 0;
|
|
263
293
|
return ret;
|
|
264
294
|
};
|
|
265
|
-
imports.wbg.
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
269
|
-
const obj = getObject(arg1);
|
|
270
|
-
const ret = typeof obj === "string" ? obj : void 0;
|
|
271
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
272
|
-
var len1 = WASM_VECTOR_LEN;
|
|
273
|
-
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
274
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
275
|
-
};
|
|
276
|
-
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
277
|
-
const v = getObject(arg0);
|
|
278
|
-
const ret = typeof v === "boolean" ? v ? 1 : 0 : 2;
|
|
279
|
-
return ret;
|
|
295
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
296
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
297
|
+
return addHeapObject(ret);
|
|
280
298
|
};
|
|
281
299
|
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
282
300
|
const val = getObject(arg0);
|
|
283
301
|
const ret = typeof val === "object" && val !== null;
|
|
284
302
|
return ret;
|
|
285
303
|
};
|
|
286
|
-
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
287
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
288
|
-
return addHeapObject(ret);
|
|
289
|
-
};
|
|
290
304
|
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
291
305
|
const ret = getObject(arg0);
|
|
292
306
|
return addHeapObject(ret);
|
|
@@ -307,6 +321,22 @@ function __wbg_get_imports() {
|
|
|
307
321
|
const ret = +getObject(arg0);
|
|
308
322
|
return ret;
|
|
309
323
|
};
|
|
324
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
325
|
+
takeObject(arg0);
|
|
326
|
+
};
|
|
327
|
+
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
328
|
+
const v = getObject(arg0);
|
|
329
|
+
const ret = typeof v === "boolean" ? v ? 1 : 0 : 2;
|
|
330
|
+
return ret;
|
|
331
|
+
};
|
|
332
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
333
|
+
const obj = getObject(arg1);
|
|
334
|
+
const ret = typeof obj === "string" ? obj : void 0;
|
|
335
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
336
|
+
var len1 = WASM_VECTOR_LEN;
|
|
337
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
338
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
339
|
+
};
|
|
310
340
|
imports.wbg.__wbg_length_c20a40f15020d68a = function(arg0) {
|
|
311
341
|
const ret = getObject(arg0).length;
|
|
312
342
|
return ret;
|
|
@@ -412,6 +442,9 @@ var initWasm = async (module_or_path) => {
|
|
|
412
442
|
function inline2(html, options) {
|
|
413
443
|
return inline(html, options);
|
|
414
444
|
}
|
|
445
|
+
function inlineFragment2(html, css, options) {
|
|
446
|
+
return inlineFragment(html, css, options);
|
|
447
|
+
}
|
|
415
448
|
function version2() {
|
|
416
449
|
return version();
|
|
417
450
|
}
|
package/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var cssInline=(()=>{var
|
|
2
|
-
${n.stack}`:r}function T(n,e){let t,r;try{let
|
|
1
|
+
"use strict";var cssInline=(()=>{var v=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var P=(n,e)=>{for(var t in e)v(n,t,{get:e[t],enumerable:!0})},H=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of z(e))!C.call(n,i)&&i!==t&&v(n,i,{get:()=>e[i],enumerable:!(r=q(e,i))||r.enumerable});return n};var J=n=>H(v({},"__esModule",{value:!0}),n);var rn={};P(rn,{initWasm:()=>Z,inline:()=>nn,inlineFragment:()=>en,version:()=>tn});var o,d=new Array(128).fill(void 0);d.push(void 0,null,!0,!1);function c(n){return d[n]}var M=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&M.decode();var p=null;function S(){return(p===null||p.byteLength===0)&&(p=new Uint8Array(o.memory.buffer)),p}function m(n,e){return n=n>>>0,M.decode(S().subarray(n,n+e))}var x=d.length;function l(n){x===d.length&&d.push(d.length+1);let e=x;return x=d[e],d[e]=n,e}function V(n){n<132||(d[n]=x,x=n)}function F(n){let e=c(n);return V(n),e}var y=0,j=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},G=typeof j.encodeInto=="function"?function(n,e){return j.encodeInto(n,e)}:function(n,e){let t=j.encode(n);return e.set(t),{read:n.length,written:t.length}};function I(n,e,t){if(t===void 0){let a=j.encode(n),u=e(a.length,1)>>>0;return S().subarray(u,u+a.length).set(a),y=a.length,u}let r=n.length,i=e(r,1)>>>0,f=S(),s=0;for(;s<r;s++){let a=n.charCodeAt(s);if(a>127)break;f[i+s]=a}if(s!==r){s!==0&&(n=n.slice(s)),i=t(i,r,r=s+n.length*3,1)>>>0;let a=S().subarray(i+s,i+r),u=G(n,a);s+=u.written,i=t(i,r,s,1)>>>0}return y=s,i}function O(n){return n==null}var h=null;function _(){return(h===null||h.byteLength===0)&&(h=new Int32Array(o.memory.buffer)),h}var A=null;function K(){return(A===null||A.byteLength===0)&&(A=new Float64Array(o.memory.buffer)),A}function E(n){let e=typeof n;if(e=="number"||e=="boolean"||n==null)return`${n}`;if(e=="string")return`"${n}"`;if(e=="symbol"){let i=n.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){let i=n.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(n)){let i=n.length,f="[";i>0&&(f+=E(n[0]));for(let s=1;s<i;s++)f+=", "+E(n[s]);return f+="]",f}let t=/\[object ([^\]]+)\]/.exec(toString.call(n)),r;if(t.length>1)r=t[1];else return toString.call(n);if(r=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message}
|
|
2
|
+
${n.stack}`:r}function T(n,e){let t,r;try{let b=o.__wbindgen_add_to_stack_pointer(-16),w=I(n,o.__wbindgen_malloc,o.__wbindgen_realloc),W=y;o.inline(b,w,W,l(e));var i=_()[b/4+0],f=_()[b/4+1],s=_()[b/4+2],a=_()[b/4+3],u=i,g=f;if(a)throw u=0,g=0,F(s);return t=u,r=g,m(u,g)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_free(t,r,1)}}function k(n,e,t){let r,i;try{let w=o.__wbindgen_add_to_stack_pointer(-16),W=I(n,o.__wbindgen_malloc,o.__wbindgen_realloc),D=y,N=I(e,o.__wbindgen_malloc,o.__wbindgen_realloc),B=y;o.inlineFragment(w,W,D,N,B,l(t));var f=_()[w/4+0],s=_()[w/4+1],a=_()[w/4+2],u=_()[w/4+3],g=f,b=s;if(u)throw g=0,b=0,F(a);return r=g,i=b,m(g,b)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_free(r,i,1)}}function U(){let n,e;try{let i=o.__wbindgen_add_to_stack_pointer(-16);o.version(i);var t=_()[i/4+0],r=_()[i/4+1];return n=t,e=r,m(t,r)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_free(n,e,1)}}async function Q(n,e){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,e)}catch(r){if(n.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let t=await n.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{let t=await WebAssembly.instantiate(n,e);return t instanceof WebAssembly.Instance?{instance:t,module:n}:t}}function X(){let n={};return n.wbg={},n.wbg.__wbindgen_is_undefined=function(e){return c(e)===void 0},n.wbg.__wbindgen_string_new=function(e,t){let r=m(e,t);return l(r)},n.wbg.__wbindgen_is_object=function(e){let t=c(e);return typeof t=="object"&&t!==null},n.wbg.__wbindgen_object_clone_ref=function(e){let t=c(e);return l(t)},n.wbg.__wbg_getwithrefkey_edc2c8960f0f1191=function(e,t){let r=c(e)[c(t)];return l(r)},n.wbg.__wbindgen_in=function(e,t){return c(e)in c(t)},n.wbg.__wbg_isSafeInteger_f7b04ef02296c4d2=function(e){return Number.isSafeInteger(c(e))},n.wbg.__wbindgen_as_number=function(e){return+c(e)},n.wbg.__wbindgen_object_drop_ref=function(e){F(e)},n.wbg.__wbindgen_boolean_get=function(e){let t=c(e);return typeof t=="boolean"?t?1:0:2},n.wbg.__wbindgen_string_get=function(e,t){let r=c(t),i=typeof r=="string"?r:void 0;var f=O(i)?0:I(i,o.__wbindgen_malloc,o.__wbindgen_realloc),s=y;_()[e/4+1]=s,_()[e/4+0]=f},n.wbg.__wbg_length_c20a40f15020d68a=function(e){return c(e).length},n.wbg.__wbindgen_memory=function(){let e=o.memory;return l(e)},n.wbg.__wbg_buffer_12d079cc21e14bdb=function(e){let t=c(e).buffer;return l(t)},n.wbg.__wbg_new_63b92bc8671ed464=function(e){let t=new Uint8Array(c(e));return l(t)},n.wbg.__wbg_set_a47bac70306a19a7=function(e,t,r){c(e).set(c(t),r>>>0)},n.wbg.__wbindgen_error_new=function(e,t){let r=new Error(m(e,t));return l(r)},n.wbg.__wbindgen_jsval_loose_eq=function(e,t){return c(e)==c(t)},n.wbg.__wbindgen_number_get=function(e,t){let r=c(t),i=typeof r=="number"?r:void 0;K()[e/8+1]=O(i)?0:i,_()[e/4+0]=!O(i)},n.wbg.__wbg_instanceof_Uint8Array_2b3bbecd033d19f6=function(e){let t;try{t=c(e)instanceof Uint8Array}catch{t=!1}return t},n.wbg.__wbg_instanceof_ArrayBuffer_836825be07d4c9d2=function(e){let t;try{t=c(e)instanceof ArrayBuffer}catch{t=!1}return t},n.wbg.__wbindgen_debug_string=function(e,t){let r=E(c(t)),i=I(r,o.__wbindgen_malloc,o.__wbindgen_realloc),f=y;_()[e/4+1]=f,_()[e/4+0]=i},n.wbg.__wbindgen_throw=function(e,t){throw new Error(m(e,t))},n}function Y(n,e){return o=n.exports,L.__wbindgen_wasm_module=e,A=null,h=null,p=null,o}async function L(n){if(o!==void 0)return o;typeof n>"u"&&(n=new URL("index_bg.wasm",void 0));let e=X();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));let{instance:t,module:r}=await Q(await n,e);return Y(t,r)}var R=L;var $=!1,Z=async n=>{if($)throw new Error("Already initialized. The `initWasm()` function can be used only once.");await R(await n),$=!0};function nn(n,e){return T(n,e)}function en(n,e,t){return k(n,e,t)}function tn(){return U()}return J(rn);})();
|
package/index.mjs
CHANGED
|
@@ -5,7 +5,32 @@ heap.push(void 0, null, true, false);
|
|
|
5
5
|
function getObject(idx) {
|
|
6
6
|
return heap[idx];
|
|
7
7
|
}
|
|
8
|
+
var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
9
|
+
throw Error("TextDecoder not available");
|
|
10
|
+
} };
|
|
11
|
+
if (typeof TextDecoder !== "undefined") {
|
|
12
|
+
cachedTextDecoder.decode();
|
|
13
|
+
}
|
|
14
|
+
var cachedUint8Memory0 = null;
|
|
15
|
+
function getUint8Memory0() {
|
|
16
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
17
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
18
|
+
}
|
|
19
|
+
return cachedUint8Memory0;
|
|
20
|
+
}
|
|
21
|
+
function getStringFromWasm0(ptr, len) {
|
|
22
|
+
ptr = ptr >>> 0;
|
|
23
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
24
|
+
}
|
|
8
25
|
var heap_next = heap.length;
|
|
26
|
+
function addHeapObject(obj) {
|
|
27
|
+
if (heap_next === heap.length)
|
|
28
|
+
heap.push(heap.length + 1);
|
|
29
|
+
const idx = heap_next;
|
|
30
|
+
heap_next = heap[idx];
|
|
31
|
+
heap[idx] = obj;
|
|
32
|
+
return idx;
|
|
33
|
+
}
|
|
9
34
|
function dropObject(idx) {
|
|
10
35
|
if (idx < 132)
|
|
11
36
|
return;
|
|
@@ -18,13 +43,6 @@ function takeObject(idx) {
|
|
|
18
43
|
return ret;
|
|
19
44
|
}
|
|
20
45
|
var WASM_VECTOR_LEN = 0;
|
|
21
|
-
var cachedUint8Memory0 = null;
|
|
22
|
-
function getUint8Memory0() {
|
|
23
|
-
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
24
|
-
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
25
|
-
}
|
|
26
|
-
return cachedUint8Memory0;
|
|
27
|
-
}
|
|
28
46
|
var cachedTextEncoder = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
|
|
29
47
|
throw Error("TextEncoder not available");
|
|
30
48
|
} };
|
|
@@ -79,24 +97,6 @@ function getInt32Memory0() {
|
|
|
79
97
|
}
|
|
80
98
|
return cachedInt32Memory0;
|
|
81
99
|
}
|
|
82
|
-
var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
83
|
-
throw Error("TextDecoder not available");
|
|
84
|
-
} };
|
|
85
|
-
if (typeof TextDecoder !== "undefined") {
|
|
86
|
-
cachedTextDecoder.decode();
|
|
87
|
-
}
|
|
88
|
-
function getStringFromWasm0(ptr, len) {
|
|
89
|
-
ptr = ptr >>> 0;
|
|
90
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
91
|
-
}
|
|
92
|
-
function addHeapObject(obj) {
|
|
93
|
-
if (heap_next === heap.length)
|
|
94
|
-
heap.push(heap.length + 1);
|
|
95
|
-
const idx = heap_next;
|
|
96
|
-
heap_next = heap[idx];
|
|
97
|
-
heap[idx] = obj;
|
|
98
|
-
return idx;
|
|
99
|
-
}
|
|
100
100
|
var cachedFloat64Memory0 = null;
|
|
101
101
|
function getFloat64Memory0() {
|
|
102
102
|
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
@@ -187,6 +187,35 @@ function inline(html, options) {
|
|
|
187
187
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
+
function inlineFragment(html, css, options) {
|
|
191
|
+
let deferred4_0;
|
|
192
|
+
let deferred4_1;
|
|
193
|
+
try {
|
|
194
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
195
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
196
|
+
const len0 = WASM_VECTOR_LEN;
|
|
197
|
+
const ptr1 = passStringToWasm0(css, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
198
|
+
const len1 = WASM_VECTOR_LEN;
|
|
199
|
+
wasm.inlineFragment(retptr, ptr0, len0, ptr1, len1, addHeapObject(options));
|
|
200
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
201
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
202
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
203
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
204
|
+
var ptr3 = r0;
|
|
205
|
+
var len3 = r1;
|
|
206
|
+
if (r3) {
|
|
207
|
+
ptr3 = 0;
|
|
208
|
+
len3 = 0;
|
|
209
|
+
throw takeObject(r2);
|
|
210
|
+
}
|
|
211
|
+
deferred4_0 = ptr3;
|
|
212
|
+
deferred4_1 = len3;
|
|
213
|
+
return getStringFromWasm0(ptr3, len3);
|
|
214
|
+
} finally {
|
|
215
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
216
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
190
219
|
function version() {
|
|
191
220
|
let deferred1_0;
|
|
192
221
|
let deferred1_1;
|
|
@@ -234,31 +263,15 @@ function __wbg_get_imports() {
|
|
|
234
263
|
const ret = getObject(arg0) === void 0;
|
|
235
264
|
return ret;
|
|
236
265
|
};
|
|
237
|
-
imports.wbg.
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
241
|
-
const obj = getObject(arg1);
|
|
242
|
-
const ret = typeof obj === "string" ? obj : void 0;
|
|
243
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
244
|
-
var len1 = WASM_VECTOR_LEN;
|
|
245
|
-
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
246
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
247
|
-
};
|
|
248
|
-
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
249
|
-
const v = getObject(arg0);
|
|
250
|
-
const ret = typeof v === "boolean" ? v ? 1 : 0 : 2;
|
|
251
|
-
return ret;
|
|
266
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
267
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
268
|
+
return addHeapObject(ret);
|
|
252
269
|
};
|
|
253
270
|
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
254
271
|
const val = getObject(arg0);
|
|
255
272
|
const ret = typeof val === "object" && val !== null;
|
|
256
273
|
return ret;
|
|
257
274
|
};
|
|
258
|
-
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
259
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
260
|
-
return addHeapObject(ret);
|
|
261
|
-
};
|
|
262
275
|
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
263
276
|
const ret = getObject(arg0);
|
|
264
277
|
return addHeapObject(ret);
|
|
@@ -279,6 +292,22 @@ function __wbg_get_imports() {
|
|
|
279
292
|
const ret = +getObject(arg0);
|
|
280
293
|
return ret;
|
|
281
294
|
};
|
|
295
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
296
|
+
takeObject(arg0);
|
|
297
|
+
};
|
|
298
|
+
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
299
|
+
const v = getObject(arg0);
|
|
300
|
+
const ret = typeof v === "boolean" ? v ? 1 : 0 : 2;
|
|
301
|
+
return ret;
|
|
302
|
+
};
|
|
303
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
304
|
+
const obj = getObject(arg1);
|
|
305
|
+
const ret = typeof obj === "string" ? obj : void 0;
|
|
306
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
307
|
+
var len1 = WASM_VECTOR_LEN;
|
|
308
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
309
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
310
|
+
};
|
|
282
311
|
imports.wbg.__wbg_length_c20a40f15020d68a = function(arg0) {
|
|
283
312
|
const ret = getObject(arg0).length;
|
|
284
313
|
return ret;
|
|
@@ -384,11 +413,15 @@ var initWasm = async (module_or_path) => {
|
|
|
384
413
|
function inline2(html, options) {
|
|
385
414
|
return inline(html, options);
|
|
386
415
|
}
|
|
416
|
+
function inlineFragment2(html, css, options) {
|
|
417
|
+
return inlineFragment(html, css, options);
|
|
418
|
+
}
|
|
387
419
|
function version2() {
|
|
388
420
|
return version();
|
|
389
421
|
}
|
|
390
422
|
export {
|
|
391
423
|
initWasm,
|
|
392
424
|
inline2 as inline,
|
|
425
|
+
inlineFragment2 as inlineFragment,
|
|
393
426
|
version2 as version
|
|
394
427
|
};
|
package/index_bg.wasm
CHANGED
|
Binary file
|