@salve-software/react-native-nitro-jsdom 1.0.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/LICENSE +21 -0
- package/NitroJsdom.podspec +63 -0
- package/README.md +95 -0
- package/android/CMakeLists.txt +86 -0
- package/android/build.gradle +148 -0
- package/android/fix-prefab.gradle +51 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +9 -0
- package/android/src/main/java/com/nitrojsdom/NitroJsdomPackage.kt +20 -0
- package/cpp/HybridHtmlSandbox.cpp +171 -0
- package/cpp/HybridHtmlSandbox.hpp +47 -0
- package/cpp/lexbor/LexborDocument.cpp +365 -0
- package/cpp/lexbor/LexborDocument.hpp +71 -0
- package/cpp/quickjs/DOMBindings.cpp +57 -0
- package/cpp/quickjs/DOMBindings.hpp +21 -0
- package/cpp/quickjs/DOMBindingsInternal.cpp +157 -0
- package/cpp/quickjs/DOMBindingsInternal.hpp +83 -0
- package/cpp/quickjs/MutationObservers.cpp +546 -0
- package/cpp/quickjs/MutationObservers.hpp +127 -0
- package/cpp/quickjs/QuickJSRuntime.cpp +475 -0
- package/cpp/quickjs/QuickJSRuntime.hpp +110 -0
- package/cpp/quickjs/Storage.cpp +130 -0
- package/cpp/quickjs/Storage.hpp +40 -0
- package/cpp/quickjs/bindings/ClassListBindings.cpp +241 -0
- package/cpp/quickjs/bindings/ClassListBindings.hpp +29 -0
- package/cpp/quickjs/bindings/DatasetBindings.cpp +120 -0
- package/cpp/quickjs/bindings/DatasetBindings.hpp +20 -0
- package/cpp/quickjs/bindings/DocumentBindings.cpp +155 -0
- package/cpp/quickjs/bindings/DocumentBindings.hpp +19 -0
- package/cpp/quickjs/bindings/ElementBindings.cpp +1106 -0
- package/cpp/quickjs/bindings/ElementBindings.hpp +19 -0
- package/cpp/quickjs/bindings/EventBindings.cpp +352 -0
- package/cpp/quickjs/bindings/EventBindings.hpp +21 -0
- package/cpp/quickjs/bindings/FetchBindings.cpp +347 -0
- package/cpp/quickjs/bindings/FetchBindings.hpp +16 -0
- package/cpp/quickjs/bindings/StyleBindings.cpp +245 -0
- package/cpp/quickjs/bindings/StyleBindings.hpp +22 -0
- package/cpp/quickjs/bindings/TimerBindings.cpp +94 -0
- package/cpp/quickjs/bindings/TimerBindings.hpp +16 -0
- package/cpp/quickjs/bindings/WindowBindings.cpp +211 -0
- package/cpp/quickjs/bindings/WindowBindings.hpp +16 -0
- package/ios/Bridge.h +8 -0
- package/lib/commonjs/classes/JSDOM/JSDOM.class.js +138 -0
- package/lib/commonjs/classes/JSDOM/JSDOM.class.js.map +1 -0
- package/lib/commonjs/classes/JSDOM/index.js +17 -0
- package/lib/commonjs/classes/JSDOM/index.js.map +1 -0
- package/lib/commonjs/classes/JSDOM/types/IFetchOptions.js +2 -0
- package/lib/commonjs/classes/JSDOM/types/IFetchOptions.js.map +1 -0
- package/lib/commonjs/classes/JSDOM/types/IJSDOMOptions.js +6 -0
- package/lib/commonjs/classes/JSDOM/types/IJSDOMOptions.js.map +1 -0
- package/lib/commonjs/classes/JSDOM/types/index.js +2 -0
- package/lib/commonjs/classes/JSDOM/types/index.js.map +1 -0
- package/lib/commonjs/classes/index.js +17 -0
- package/lib/commonjs/classes/index.js.map +1 -0
- package/lib/commonjs/index.js +17 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/specs/HtmlSandbox.nitro.js +6 -0
- package/lib/commonjs/specs/HtmlSandbox.nitro.js.map +1 -0
- package/lib/module/classes/JSDOM/JSDOM.class.js +133 -0
- package/lib/module/classes/JSDOM/JSDOM.class.js.map +1 -0
- package/lib/module/classes/JSDOM/index.js +4 -0
- package/lib/module/classes/JSDOM/index.js.map +1 -0
- package/lib/module/classes/JSDOM/types/IFetchOptions.js +2 -0
- package/lib/module/classes/JSDOM/types/IFetchOptions.js.map +1 -0
- package/lib/module/classes/JSDOM/types/IJSDOMOptions.js +4 -0
- package/lib/module/classes/JSDOM/types/IJSDOMOptions.js.map +1 -0
- package/lib/module/classes/JSDOM/types/index.js +2 -0
- package/lib/module/classes/JSDOM/types/index.js.map +1 -0
- package/lib/module/classes/index.js +4 -0
- package/lib/module/classes/index.js.map +1 -0
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/specs/HtmlSandbox.nitro.js +4 -0
- package/lib/module/specs/HtmlSandbox.nitro.js.map +1 -0
- package/lib/typescript/src/classes/JSDOM/JSDOM.class.d.ts +74 -0
- package/lib/typescript/src/classes/JSDOM/JSDOM.class.d.ts.map +1 -0
- package/lib/typescript/src/classes/JSDOM/index.d.ts +3 -0
- package/lib/typescript/src/classes/JSDOM/index.d.ts.map +1 -0
- package/lib/typescript/src/classes/JSDOM/types/IFetchOptions.d.ts +14 -0
- package/lib/typescript/src/classes/JSDOM/types/IFetchOptions.d.ts.map +1 -0
- package/lib/typescript/src/classes/JSDOM/types/IJSDOMOptions.d.ts +57 -0
- package/lib/typescript/src/classes/JSDOM/types/IJSDOMOptions.d.ts.map +1 -0
- package/lib/typescript/src/classes/JSDOM/types/index.d.ts +3 -0
- package/lib/typescript/src/classes/JSDOM/types/index.d.ts.map +1 -0
- package/lib/typescript/src/classes/index.d.ts +2 -0
- package/lib/typescript/src/classes/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/HtmlSandbox.nitro.d.ts +13 -0
- package/lib/typescript/src/specs/HtmlSandbox.nitro.d.ts.map +1 -0
- package/nitro.json +26 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/NitroJsdom+autolinking.cmake +81 -0
- package/nitrogen/generated/android/NitroJsdom+autolinking.gradle +27 -0
- package/nitrogen/generated/android/NitroJsdomOnLoad.cpp +49 -0
- package/nitrogen/generated/android/NitroJsdomOnLoad.hpp +34 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrojsdom/NitroJsdomOnLoad.kt +35 -0
- package/nitrogen/generated/ios/NitroJsdom+autolinking.rb +62 -0
- package/nitrogen/generated/ios/NitroJsdom-Swift-Cxx-Bridge.cpp +17 -0
- package/nitrogen/generated/ios/NitroJsdom-Swift-Cxx-Bridge.hpp +27 -0
- package/nitrogen/generated/ios/NitroJsdom-Swift-Cxx-Umbrella.hpp +38 -0
- package/nitrogen/generated/ios/NitroJsdomAutolinking.mm +35 -0
- package/nitrogen/generated/ios/NitroJsdomAutolinking.swift +16 -0
- package/nitrogen/generated/shared/c++/HybridHtmlSandboxSpec.cpp +26 -0
- package/nitrogen/generated/shared/c++/HybridHtmlSandboxSpec.hpp +73 -0
- package/package.json +131 -0
- package/src/classes/JSDOM/JSDOM.class.ts +145 -0
- package/src/classes/JSDOM/index.ts +2 -0
- package/src/classes/JSDOM/types/IFetchOptions.ts +14 -0
- package/src/classes/JSDOM/types/IJSDOMOptions.ts +57 -0
- package/src/classes/JSDOM/types/index.ts +2 -0
- package/src/classes/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/specs/HtmlSandbox.nitro.ts +33 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
#include "TimerBindings.hpp"
|
|
2
|
+
#include "../DOMBindingsInternal.hpp"
|
|
3
|
+
#include "../QuickJSRuntime.hpp"
|
|
4
|
+
#include <chrono>
|
|
5
|
+
|
|
6
|
+
namespace margelo::nitro::nitrojsdom {
|
|
7
|
+
|
|
8
|
+
namespace {
|
|
9
|
+
|
|
10
|
+
int64_t dom_now_ms() {
|
|
11
|
+
using namespace std::chrono;
|
|
12
|
+
return duration_cast<milliseconds>(steady_clock::now().time_since_epoch()).count();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
JSValue js_setTimeout(JSContext* ctx, JSValue, int argc, JSValue* argv) {
|
|
16
|
+
if (argc < 1 || !JS_IsFunction(ctx, argv[0])) return JS_NewInt32(ctx, 0);
|
|
17
|
+
auto* rctx = get_ctx(ctx);
|
|
18
|
+
if (!rctx) return JS_NewInt32(ctx, 0);
|
|
19
|
+
|
|
20
|
+
int32_t delay_ms = 0;
|
|
21
|
+
if (argc >= 2) JS_ToInt32(ctx, &delay_ms, argv[1]);
|
|
22
|
+
if (delay_ms < 0) delay_ms = 0;
|
|
23
|
+
|
|
24
|
+
uint32_t id = rctx->next_timer_id++;
|
|
25
|
+
Timer* t = new Timer();
|
|
26
|
+
t->id = id;
|
|
27
|
+
t->repeat = false;
|
|
28
|
+
t->interval_ms = delay_ms;
|
|
29
|
+
t->fire_at_ms = dom_now_ms() + delay_ms;
|
|
30
|
+
t->callback = new JSValue(JS_DupValue(ctx, argv[0]));
|
|
31
|
+
t->cancelled = false;
|
|
32
|
+
|
|
33
|
+
rctx->timer_map[id] = t;
|
|
34
|
+
rctx->timer_heap.push(t);
|
|
35
|
+
return JS_NewInt32(ctx, (int32_t)id);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
JSValue js_setInterval(JSContext* ctx, JSValue, int argc, JSValue* argv) {
|
|
39
|
+
if (argc < 1 || !JS_IsFunction(ctx, argv[0])) return JS_NewInt32(ctx, 0);
|
|
40
|
+
auto* rctx = get_ctx(ctx);
|
|
41
|
+
if (!rctx) return JS_NewInt32(ctx, 0);
|
|
42
|
+
|
|
43
|
+
int32_t interval_ms = 0;
|
|
44
|
+
if (argc >= 2) JS_ToInt32(ctx, &interval_ms, argv[1]);
|
|
45
|
+
if (interval_ms < 1) interval_ms = 1;
|
|
46
|
+
|
|
47
|
+
uint32_t id = rctx->next_timer_id++;
|
|
48
|
+
Timer* t = new Timer();
|
|
49
|
+
t->id = id;
|
|
50
|
+
t->repeat = true;
|
|
51
|
+
t->interval_ms = interval_ms;
|
|
52
|
+
t->fire_at_ms = dom_now_ms() + interval_ms;
|
|
53
|
+
t->callback = new JSValue(JS_DupValue(ctx, argv[0]));
|
|
54
|
+
t->cancelled = false;
|
|
55
|
+
|
|
56
|
+
rctx->timer_map[id] = t;
|
|
57
|
+
rctx->timer_heap.push(t);
|
|
58
|
+
return JS_NewInt32(ctx, (int32_t)id);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
JSValue js_clearTimer(JSContext* ctx, JSValue, int argc, JSValue* argv) {
|
|
62
|
+
if (argc < 1) return JS_UNDEFINED;
|
|
63
|
+
auto* rctx = get_ctx(ctx);
|
|
64
|
+
if (!rctx) return JS_UNDEFINED;
|
|
65
|
+
|
|
66
|
+
uint32_t id = 0;
|
|
67
|
+
JS_ToUint32(ctx, &id, argv[0]);
|
|
68
|
+
auto it = rctx->timer_map.find(id);
|
|
69
|
+
if (it != rctx->timer_map.end()) {
|
|
70
|
+
it->second->cancelled = true;
|
|
71
|
+
// Free the callback now to save memory; mark as null
|
|
72
|
+
if (it->second->callback) {
|
|
73
|
+
JSValue* cb = static_cast<JSValue*>(it->second->callback);
|
|
74
|
+
JS_FreeValue(ctx, *cb);
|
|
75
|
+
delete cb;
|
|
76
|
+
it->second->callback = nullptr;
|
|
77
|
+
}
|
|
78
|
+
rctx->timer_map.erase(it);
|
|
79
|
+
}
|
|
80
|
+
return JS_UNDEFINED;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
} // namespace
|
|
84
|
+
|
|
85
|
+
void TimerBindings::install(JSContext* ctx) {
|
|
86
|
+
JSValue global = JS_GetGlobalObject(ctx);
|
|
87
|
+
JS_SetPropertyStr(ctx, global, "setTimeout", JS_NewCFunction(ctx, js_setTimeout, "setTimeout", 2));
|
|
88
|
+
JS_SetPropertyStr(ctx, global, "setInterval", JS_NewCFunction(ctx, js_setInterval, "setInterval", 2));
|
|
89
|
+
JS_SetPropertyStr(ctx, global, "clearTimeout", JS_NewCFunction(ctx, js_clearTimer, "clearTimeout", 1));
|
|
90
|
+
JS_SetPropertyStr(ctx, global, "clearInterval", JS_NewCFunction(ctx, js_clearTimer, "clearInterval",1));
|
|
91
|
+
JS_FreeValue(ctx, global);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
} // namespace margelo::nitro::nitrojsdom
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
// setTimeout/setInterval/clearTimeout/clearInterval. The timers themselves are
|
|
4
|
+
// fired by QuickJSRuntime's event loop (RuntimeContext::timer_heap); this file
|
|
5
|
+
// only exposes the JS-facing scheduling API.
|
|
6
|
+
|
|
7
|
+
#include "quickjs.h"
|
|
8
|
+
|
|
9
|
+
namespace margelo::nitro::nitrojsdom {
|
|
10
|
+
|
|
11
|
+
class TimerBindings {
|
|
12
|
+
public:
|
|
13
|
+
static void install(JSContext* ctx);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
} // namespace margelo::nitro::nitrojsdom
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
#include "WindowBindings.hpp"
|
|
2
|
+
#include "../DOMBindingsInternal.hpp"
|
|
3
|
+
#include "../QuickJSRuntime.hpp"
|
|
4
|
+
#include <cstring>
|
|
5
|
+
#include <optional>
|
|
6
|
+
#include <string>
|
|
7
|
+
#include <vector>
|
|
8
|
+
|
|
9
|
+
namespace margelo::nitro::nitrojsdom {
|
|
10
|
+
|
|
11
|
+
namespace {
|
|
12
|
+
|
|
13
|
+
// ── console ────────────────────────────────────────────────────────────────
|
|
14
|
+
|
|
15
|
+
JSValue js_console_method(JSContext* ctx, JSValue, int argc, JSValue* argv, int magic) {
|
|
16
|
+
auto* rctx = get_ctx(ctx);
|
|
17
|
+
if (!rctx || !rctx->console_callback) return JS_UNDEFINED;
|
|
18
|
+
|
|
19
|
+
static const char* levels[] = { "log", "warn", "error", "info", "debug" };
|
|
20
|
+
std::string level = (magic >= 0 && magic < 5) ? levels[magic] : "log";
|
|
21
|
+
|
|
22
|
+
std::vector<std::string> args;
|
|
23
|
+
args.reserve(argc);
|
|
24
|
+
for (int i = 0; i < argc; i++) {
|
|
25
|
+
JSValue str_val = JS_ToString(ctx, argv[i]);
|
|
26
|
+
const char* s = JS_ToCString(ctx, str_val);
|
|
27
|
+
args.push_back(s ? s : "");
|
|
28
|
+
if (s) JS_FreeCString(ctx, s);
|
|
29
|
+
JS_FreeValue(ctx, str_val);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
rctx->console_callback(level, args);
|
|
33
|
+
return JS_UNDEFINED;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// ── window.alert / confirm / prompt ───────────────────────────────────────────
|
|
37
|
+
|
|
38
|
+
JSValue js_window_alert(JSContext* ctx, JSValue, int argc, JSValue* argv) {
|
|
39
|
+
auto* rctx = get_ctx(ctx);
|
|
40
|
+
if (!rctx || !rctx->alert_callback) return JS_UNDEFINED;
|
|
41
|
+
std::string message;
|
|
42
|
+
if (argc >= 1) {
|
|
43
|
+
JSValue str_val = JS_ToString(ctx, argv[0]);
|
|
44
|
+
if (JS_IsException(str_val)) return JS_EXCEPTION;
|
|
45
|
+
const char* s = JS_ToCString(ctx, str_val);
|
|
46
|
+
if (s) { message = s; JS_FreeCString(ctx, s); }
|
|
47
|
+
JS_FreeValue(ctx, str_val);
|
|
48
|
+
}
|
|
49
|
+
try { rctx->alert_callback(message); }
|
|
50
|
+
catch (const std::exception& e) { return JS_ThrowInternalError(ctx, "alert callback threw: %s", e.what()); }
|
|
51
|
+
catch (...) { return JS_ThrowInternalError(ctx, "alert callback threw an unknown exception"); }
|
|
52
|
+
return JS_UNDEFINED;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
JSValue js_window_confirm(JSContext* ctx, JSValue, int argc, JSValue* argv) {
|
|
56
|
+
auto* rctx = get_ctx(ctx);
|
|
57
|
+
if (!rctx || !rctx->confirm_callback) return JS_FALSE;
|
|
58
|
+
std::string message;
|
|
59
|
+
if (argc >= 1) {
|
|
60
|
+
JSValue str_val = JS_ToString(ctx, argv[0]);
|
|
61
|
+
if (JS_IsException(str_val)) return JS_EXCEPTION;
|
|
62
|
+
const char* s = JS_ToCString(ctx, str_val);
|
|
63
|
+
if (s) { message = s; JS_FreeCString(ctx, s); }
|
|
64
|
+
JS_FreeValue(ctx, str_val);
|
|
65
|
+
}
|
|
66
|
+
bool result;
|
|
67
|
+
try { result = rctx->confirm_callback(message); }
|
|
68
|
+
catch (const std::exception& e) { return JS_ThrowInternalError(ctx, "confirm callback threw: %s", e.what()); }
|
|
69
|
+
catch (...) { return JS_ThrowInternalError(ctx, "confirm callback threw an unknown exception"); }
|
|
70
|
+
return JS_NewBool(ctx, result);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
JSValue js_window_prompt(JSContext* ctx, JSValue, int argc, JSValue* argv) {
|
|
74
|
+
auto* rctx = get_ctx(ctx);
|
|
75
|
+
if (!rctx || !rctx->prompt_callback) return JS_NULL;
|
|
76
|
+
std::string message;
|
|
77
|
+
if (argc >= 1) {
|
|
78
|
+
JSValue str_val = JS_ToString(ctx, argv[0]);
|
|
79
|
+
if (JS_IsException(str_val)) return JS_EXCEPTION;
|
|
80
|
+
const char* s = JS_ToCString(ctx, str_val);
|
|
81
|
+
if (s) { message = s; JS_FreeCString(ctx, s); }
|
|
82
|
+
JS_FreeValue(ctx, str_val);
|
|
83
|
+
}
|
|
84
|
+
std::optional<std::string> defaultValue;
|
|
85
|
+
if (argc >= 2 && !JS_IsUndefined(argv[1])) {
|
|
86
|
+
JSValue str_val = JS_ToString(ctx, argv[1]);
|
|
87
|
+
if (JS_IsException(str_val)) return JS_EXCEPTION;
|
|
88
|
+
const char* s = JS_ToCString(ctx, str_val);
|
|
89
|
+
if (s) { defaultValue = std::string(s); JS_FreeCString(ctx, s); }
|
|
90
|
+
JS_FreeValue(ctx, str_val);
|
|
91
|
+
}
|
|
92
|
+
std::optional<std::string> result;
|
|
93
|
+
try { result = rctx->prompt_callback(message, defaultValue); }
|
|
94
|
+
catch (const std::exception& e) { return JS_ThrowInternalError(ctx, "prompt callback threw: %s", e.what()); }
|
|
95
|
+
catch (...) { return JS_ThrowInternalError(ctx, "prompt callback threw an unknown exception"); }
|
|
96
|
+
if (result.has_value()) {
|
|
97
|
+
return JS_NewStringLen(ctx, result->c_str(), result->size());
|
|
98
|
+
}
|
|
99
|
+
return JS_NULL;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// ── window.location ───────────────────────────────────────────────────────────
|
|
103
|
+
|
|
104
|
+
const char* kLocationBootstrapScript = R"JS(
|
|
105
|
+
(function() {
|
|
106
|
+
function parseUrl(str) {
|
|
107
|
+
str = String(str === undefined || str === null ? '' : str);
|
|
108
|
+
var m = /^([^:\/?#]+:)(?:\/\/(?:[^\/?#@]*@)?([^\/?#:]*)(?::(\d+))?)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(str);
|
|
109
|
+
if (!m) {
|
|
110
|
+
return { protocol: '', hostname: '', port: '', pathname: '', search: '', hash: '' };
|
|
111
|
+
}
|
|
112
|
+
var protocol = m[1] || '';
|
|
113
|
+
var hostname = m[2] || '';
|
|
114
|
+
var port = m[3] || '';
|
|
115
|
+
var pathname = m[4] || '';
|
|
116
|
+
var search = m[5] || '';
|
|
117
|
+
var hash = m[6] || '';
|
|
118
|
+
if (!pathname && hostname) pathname = '/';
|
|
119
|
+
return { protocol: protocol, hostname: hostname, port: port, pathname: pathname, search: search, hash: hash };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function Location(initialHref) {
|
|
123
|
+
this._href = String(initialHref || 'about:blank');
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function defineParsedProp(name) {
|
|
127
|
+
Object.defineProperty(Location.prototype, name, {
|
|
128
|
+
get: function() { return parseUrl(this._href)[name]; },
|
|
129
|
+
enumerable: true,
|
|
130
|
+
configurable: true,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
['protocol', 'hostname', 'port', 'pathname', 'search', 'hash'].forEach(defineParsedProp);
|
|
134
|
+
|
|
135
|
+
Object.defineProperty(Location.prototype, 'host', {
|
|
136
|
+
get: function() {
|
|
137
|
+
var p = parseUrl(this._href);
|
|
138
|
+
return p.hostname + (p.port ? ':' + p.port : '');
|
|
139
|
+
},
|
|
140
|
+
enumerable: true,
|
|
141
|
+
configurable: true,
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
Object.defineProperty(Location.prototype, 'origin', {
|
|
145
|
+
get: function() {
|
|
146
|
+
var p = parseUrl(this._href);
|
|
147
|
+
if (!p.hostname) return 'null';
|
|
148
|
+
return p.protocol + '//' + p.hostname + (p.port ? ':' + p.port : '');
|
|
149
|
+
},
|
|
150
|
+
enumerable: true,
|
|
151
|
+
configurable: true,
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
function resolveUrl(base, next) {
|
|
155
|
+
next = String(next);
|
|
156
|
+
if (/^[a-zA-Z][a-zA-Z0-9+\-.]*:/.test(next)) return next;
|
|
157
|
+
var p = parseUrl(base);
|
|
158
|
+
var origin = (p.protocol || '') + (p.hostname ? '//' + p.hostname + (p.port ? ':' + p.port : '') : '');
|
|
159
|
+
if (next.charAt(0) === '/') return origin + next;
|
|
160
|
+
if (next.charAt(0) === '#') return base.split('#')[0] + next;
|
|
161
|
+
if (next.charAt(0) === '?') return base.split('?')[0].split('#')[0] + next;
|
|
162
|
+
var dir = (p.pathname || '/').replace(/\/[^\/]*$/, '/');
|
|
163
|
+
return origin + dir + next;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
Object.defineProperty(Location.prototype, 'href', {
|
|
167
|
+
get: function() { return this._href; },
|
|
168
|
+
set: function(v) { this._href = resolveUrl(this._href, v); },
|
|
169
|
+
enumerable: true,
|
|
170
|
+
configurable: true,
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
Location.prototype.toString = function() { return this._href; };
|
|
174
|
+
Location.prototype.assign = function(url) { this._href = resolveUrl(this._href, url); };
|
|
175
|
+
Location.prototype.replace = function(url) { this._href = resolveUrl(this._href, url); };
|
|
176
|
+
Location.prototype.reload = function() {};
|
|
177
|
+
|
|
178
|
+
globalThis.Location = Location;
|
|
179
|
+
globalThis.location = new Location(globalThis.__initialHref);
|
|
180
|
+
delete globalThis.__initialHref;
|
|
181
|
+
})();
|
|
182
|
+
)JS";
|
|
183
|
+
|
|
184
|
+
} // namespace
|
|
185
|
+
|
|
186
|
+
void WindowBindings::install(JSContext* ctx) {
|
|
187
|
+
JSValue global = JS_GetGlobalObject(ctx);
|
|
188
|
+
|
|
189
|
+
JS_SetPropertyStr(ctx, global, "alert", JS_NewCFunction(ctx, js_window_alert, "alert", 1));
|
|
190
|
+
JS_SetPropertyStr(ctx, global, "confirm", JS_NewCFunction(ctx, js_window_confirm, "confirm", 1));
|
|
191
|
+
JS_SetPropertyStr(ctx, global, "prompt", JS_NewCFunction(ctx, js_window_prompt, "prompt", 2));
|
|
192
|
+
|
|
193
|
+
JSValue console_obj = JS_NewObject(ctx);
|
|
194
|
+
JS_SetPropertyStr(ctx, console_obj, "log", JS_NewCFunctionMagic(ctx, js_console_method, "log", 0, JS_CFUNC_generic_magic, 0));
|
|
195
|
+
JS_SetPropertyStr(ctx, console_obj, "warn", JS_NewCFunctionMagic(ctx, js_console_method, "warn", 0, JS_CFUNC_generic_magic, 1));
|
|
196
|
+
JS_SetPropertyStr(ctx, console_obj, "error", JS_NewCFunctionMagic(ctx, js_console_method, "error", 0, JS_CFUNC_generic_magic, 2));
|
|
197
|
+
JS_SetPropertyStr(ctx, console_obj, "info", JS_NewCFunctionMagic(ctx, js_console_method, "info", 0, JS_CFUNC_generic_magic, 3));
|
|
198
|
+
JS_SetPropertyStr(ctx, console_obj, "debug", JS_NewCFunctionMagic(ctx, js_console_method, "debug", 0, JS_CFUNC_generic_magic, 4));
|
|
199
|
+
JS_SetPropertyStr(ctx, global, "console", console_obj);
|
|
200
|
+
|
|
201
|
+
JS_FreeValue(ctx, global);
|
|
202
|
+
|
|
203
|
+
JSValue location_result = JS_Eval(ctx, kLocationBootstrapScript, strlen(kLocationBootstrapScript),
|
|
204
|
+
"<location-bootstrap>", JS_EVAL_TYPE_GLOBAL);
|
|
205
|
+
if (JS_IsException(location_result)) {
|
|
206
|
+
JS_FreeValue(ctx, JS_GetException(ctx));
|
|
207
|
+
}
|
|
208
|
+
JS_FreeValue(ctx, location_result);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
} // namespace margelo::nitro::nitrojsdom
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
// window.alert/confirm/prompt (bridged to onAlert/onConfirm/onPrompt native
|
|
4
|
+
// callbacks), console.log/warn/error/info/debug, and the window.location
|
|
5
|
+
// bootstrap script.
|
|
6
|
+
|
|
7
|
+
#include "quickjs.h"
|
|
8
|
+
|
|
9
|
+
namespace margelo::nitro::nitrojsdom {
|
|
10
|
+
|
|
11
|
+
class WindowBindings {
|
|
12
|
+
public:
|
|
13
|
+
static void install(JSContext* ctx);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
} // namespace margelo::nitro::nitrojsdom
|
package/ios/Bridge.h
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.JSDOM = void 0;
|
|
7
|
+
var _reactNativeNitroModules = require("react-native-nitro-modules");
|
|
8
|
+
function safeParseHeaders(headersJson) {
|
|
9
|
+
try {
|
|
10
|
+
const parsed = JSON.parse(headersJson);
|
|
11
|
+
return parsed && typeof parsed === 'object' ? parsed : {};
|
|
12
|
+
} catch {
|
|
13
|
+
return {};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
class JSDOM {
|
|
17
|
+
_disposed = false;
|
|
18
|
+
constructor(sandbox) {
|
|
19
|
+
this.sandbox = sandbox;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Creates a new sandboxed DOM environment.
|
|
24
|
+
*
|
|
25
|
+
* @param html - The initial HTML document string.
|
|
26
|
+
* @param options.runScripts - Execute `<script>` tags found in the HTML. Default: `true`.
|
|
27
|
+
* @param options.url - Value of `window.location.href` inside the sandbox. Default: `'about:blank'`.
|
|
28
|
+
* @param options.pretendToBeVisual - Sets `document.hidden = false`, allowing scripts that
|
|
29
|
+
* gate on page visibility (e.g. `requestAnimationFrame`) to run. Default: `false`.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const dom = JSDOM.create('<html><body><div id="result">0</div></body></html>')
|
|
34
|
+
* await dom.evaluate(`document.getElementById('result').textContent = String(2 + 2)`)
|
|
35
|
+
* const value = await dom.evaluate(`document.getElementById('result').textContent`)
|
|
36
|
+
* // value → "4"
|
|
37
|
+
* dom.dispose()
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
static create(html, options) {
|
|
41
|
+
const sandbox = _reactNativeNitroModules.NitroModules.createHybridObject('HtmlSandbox');
|
|
42
|
+
sandbox.initialize(html, options?.runScripts ?? true, options?.url ?? 'about:blank');
|
|
43
|
+
if (options?.onConsole) {
|
|
44
|
+
const cb = options.onConsole;
|
|
45
|
+
sandbox.setConsoleCallback((level, args) => cb(level, args));
|
|
46
|
+
} else {
|
|
47
|
+
sandbox.setConsoleCallback(null);
|
|
48
|
+
}
|
|
49
|
+
if (options?.onAlert || options?.onConfirm || options?.onPrompt) {
|
|
50
|
+
sandbox.setDialogCallbacks(options.onAlert ?? null, options.onConfirm ?? null, options.onPrompt ?? null);
|
|
51
|
+
}
|
|
52
|
+
if (options?.onFetch) {
|
|
53
|
+
const onFetch = options.onFetch;
|
|
54
|
+
sandbox.setFetchCallback(async (url, method, headersJson, body) => {
|
|
55
|
+
const headers = safeParseHeaders(headersJson);
|
|
56
|
+
return onFetch(url, {
|
|
57
|
+
method,
|
|
58
|
+
headers,
|
|
59
|
+
body
|
|
60
|
+
}).then(res => JSON.stringify({
|
|
61
|
+
ok: (res.status ?? 200) >= 200 && (res.status ?? 200) < 300,
|
|
62
|
+
status: res.status ?? 200,
|
|
63
|
+
statusText: res.statusText ?? '',
|
|
64
|
+
headersJson: JSON.stringify(res.headers ?? {}),
|
|
65
|
+
body: res.body ?? ''
|
|
66
|
+
})).catch(err => JSON.stringify({
|
|
67
|
+
error: err instanceof Error ? err.message : String(err)
|
|
68
|
+
}));
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return new JSDOM(sandbox);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Runs arbitrary JavaScript inside the isolated QuickJS sandbox.
|
|
76
|
+
* The return value is coerced to a string (same behaviour as `String(expr)` in JS).
|
|
77
|
+
*
|
|
78
|
+
* This is the **only** door into the sandbox — all DOM queries and mutations must
|
|
79
|
+
* be expressed as JS strings passed to `evaluate()`.
|
|
80
|
+
*
|
|
81
|
+
* @param script - Any valid JS expression or block of statements.
|
|
82
|
+
* @returns The stringified result of the last evaluated expression.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* // Mutate the DOM
|
|
87
|
+
* await dom.evaluate(`document.getElementById('price').textContent = (qty * unitPrice).toFixed(2)`)
|
|
88
|
+
*
|
|
89
|
+
* // Read from the DOM
|
|
90
|
+
* const text = await dom.evaluate(`document.getElementById('price').textContent`)
|
|
91
|
+
* // text → "42.00"
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
evaluate(script) {
|
|
95
|
+
if (this._disposed) {
|
|
96
|
+
return Promise.reject(new Error("JSDOM instance has been disposed"));
|
|
97
|
+
}
|
|
98
|
+
return this.sandbox.evaluate(script);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Serializes the current state of the document back to an HTML string.
|
|
103
|
+
* Reflects any DOM mutations made via `evaluate()`.
|
|
104
|
+
*
|
|
105
|
+
* Returns an empty string if called after `dispose()`.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* await dom.evaluate(`document.title = 'Hello'`)
|
|
110
|
+
* dom.serialize() // "<html><head><title>Hello</title></head>...</html>"
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
serialize() {
|
|
114
|
+
if (this._disposed) return "";
|
|
115
|
+
return this.sandbox.serialize();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Frees all native memory held by this sandbox (Lexbor document + QuickJS runtime).
|
|
120
|
+
* After calling `dispose()`, any further `evaluate()` calls will reject with an error.
|
|
121
|
+
* Calling `dispose()` multiple times is safe (idempotent).
|
|
122
|
+
* Always call this when you are done with the sandbox to avoid memory leaks.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* const dom = JSDOM.create(html)
|
|
127
|
+
* const value = await dom.evaluate(`window.__result`)
|
|
128
|
+
* dom.dispose() // ← always pair with create()
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
dispose() {
|
|
132
|
+
if (this._disposed) return;
|
|
133
|
+
this._disposed = true;
|
|
134
|
+
this.sandbox = null;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exports.JSDOM = JSDOM;
|
|
138
|
+
//# sourceMappingURL=JSDOM.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativeNitroModules","require","safeParseHeaders","headersJson","parsed","JSON","parse","JSDOM","_disposed","constructor","sandbox","create","html","options","NitroModules","createHybridObject","initialize","runScripts","url","onConsole","cb","setConsoleCallback","level","args","onAlert","onConfirm","onPrompt","setDialogCallbacks","onFetch","setFetchCallback","method","body","headers","then","res","stringify","ok","status","statusText","catch","err","error","Error","message","String","evaluate","script","Promise","reject","serialize","dispose","exports"],"sourceRoot":"../../../../src","sources":["classes/JSDOM/JSDOM.class.ts"],"mappings":";;;;;;AAEA,IAAAA,wBAAA,GAAAC,OAAA;AAEA,SAASC,gBAAgBA,CAACC,WAAmB,EAA0B;EACrE,IAAI;IACF,MAAMC,MAAM,GAAGC,IAAI,CAACC,KAAK,CAACH,WAAW,CAAC;IACtC,OAAOC,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,GAAGA,MAAM,GAAG,CAAC,CAAC;EAC3D,CAAC,CAAC,MAAM;IACN,OAAO,CAAC,CAAC;EACX;AACF;AAEO,MAAMG,KAAK,CAAC;EAETC,SAAS,GAAY,KAAK;EAE1BC,WAAWA,CAACC,OAAoB,EAAE;IACxC,IAAI,CAACA,OAAO,GAAGA,OAAO;EACxB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAOC,MAAMA,CAACC,IAAY,EAAEC,OAAuB,EAAS;IAC1D,MAAMH,OAAO,GAAGI,qCAAY,CAACC,kBAAkB,CAAc,aAAa,CAAC;IAE3EL,OAAO,CAACM,UAAU,CAChBJ,IAAI,EACJC,OAAO,EAAEI,UAAU,IAAI,IAAI,EAC3BJ,OAAO,EAAEK,GAAG,IAAI,aAClB,CAAC;IAED,IAAIL,OAAO,EAAEM,SAAS,EAAE;MACtB,MAAMC,EAAE,GAAGP,OAAO,CAACM,SAAS;MAC5BT,OAAO,CAACW,kBAAkB,CAAC,CAACC,KAAK,EAAEC,IAAI,KAAKH,EAAE,CAACE,KAAK,EAASC,IAAI,CAAC,CAAC;IACrE,CAAC,MAAM;MACLb,OAAO,CAACW,kBAAkB,CAAC,IAAI,CAAC;IAClC;IAEA,IAAIR,OAAO,EAAEW,OAAO,IAAIX,OAAO,EAAEY,SAAS,IAAIZ,OAAO,EAAEa,QAAQ,EAAE;MAC/DhB,OAAO,CAACiB,kBAAkB,CACxBd,OAAO,CAACW,OAAO,IAAI,IAAI,EACvBX,OAAO,CAACY,SAAS,IAAI,IAAI,EACzBZ,OAAO,CAACa,QAAQ,IAAI,IACtB,CAAC;IACH;IAEA,IAAIb,OAAO,EAAEe,OAAO,EAAE;MACpB,MAAMA,OAAO,GAAGf,OAAO,CAACe,OAAO;MAC/BlB,OAAO,CAACmB,gBAAgB,CAAC,OAAOX,GAAG,EAAEY,MAAM,EAAE3B,WAAW,EAAE4B,IAAI,KAAK;QACjE,MAAMC,OAAO,GAAG9B,gBAAgB,CAACC,WAAW,CAAC;QAC7C,OAAOyB,OAAO,CAACV,GAAG,EAAE;UAAEY,MAAM;UAAEE,OAAO;UAAED;QAAK,CAAC,CAAC,CAC3CE,IAAI,CAAEC,GAAG,IAAK7B,IAAI,CAAC8B,SAAS,CAAC;UAC5BC,EAAE,EAAE,CAACF,GAAG,CAACG,MAAM,IAAI,GAAG,KAAK,GAAG,IAAI,CAACH,GAAG,CAACG,MAAM,IAAI,GAAG,IAAI,GAAG;UAC3DA,MAAM,EAAEH,GAAG,CAACG,MAAM,IAAI,GAAG;UACzBC,UAAU,EAAEJ,GAAG,CAACI,UAAU,IAAI,EAAE;UAChCnC,WAAW,EAAEE,IAAI,CAAC8B,SAAS,CAACD,GAAG,CAACF,OAAO,IAAI,CAAC,CAAC,CAAC;UAC9CD,IAAI,EAAEG,GAAG,CAACH,IAAI,IAAI;QACpB,CAAC,CAAC,CAAC,CACFQ,KAAK,CAAEC,GAAG,IAAKnC,IAAI,CAAC8B,SAAS,CAAC;UAAEM,KAAK,EAAED,GAAG,YAAYE,KAAK,GAAGF,GAAG,CAACG,OAAO,GAAGC,MAAM,CAACJ,GAAG;QAAE,CAAC,CAAC,CAAC;MAChG,CAAC,CAAC;IACJ;IAEA,OAAO,IAAIjC,KAAK,CAACG,OAAO,CAAC;EAC3B;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEmC,QAAQA,CAACC,MAAc,EAAmB;IACxC,IAAI,IAAI,CAACtC,SAAS,EAAE;MAClB,OAAOuC,OAAO,CAACC,MAAM,CAAC,IAAIN,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtE;IACA,OAAO,IAAI,CAAChC,OAAO,CAAEmC,QAAQ,CAACC,MAAM,CAAC;EACvC;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEG,SAASA,CAAA,EAAW;IAClB,IAAI,IAAI,CAACzC,SAAS,EAAE,OAAO,EAAE;IAC7B,OAAO,IAAI,CAACE,OAAO,CAAEuC,SAAS,CAAC,CAAC;EAClC;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,OAAOA,CAAA,EAAS;IACd,IAAI,IAAI,CAAC1C,SAAS,EAAE;IACpB,IAAI,CAACA,SAAS,GAAG,IAAI;IACrB,IAAI,CAACE,OAAO,GAAG,IAAI;EACrB;AACF;AAACyC,OAAA,CAAA5C,KAAA,GAAAA,KAAA","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _JSDOM = require("./JSDOM.class");
|
|
7
|
+
Object.keys(_JSDOM).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _JSDOM[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _JSDOM[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_JSDOM","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../../../src","sources":["classes/JSDOM/index.ts"],"mappings":";;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["classes/JSDOM/types/IFetchOptions.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["classes/JSDOM/types/IJSDOMOptions.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["classes/JSDOM/types/index.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _JSDOM = require("./JSDOM");
|
|
7
|
+
Object.keys(_JSDOM).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _JSDOM[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _JSDOM[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_JSDOM","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../../src","sources":["classes/index.ts"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _classes = require("./classes");
|
|
7
|
+
Object.keys(_classes).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _classes[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _classes[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_classes","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,QAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,QAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,QAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/HtmlSandbox.nitro.ts"],"mappings":"","ignoreList":[]}
|