okno 1.0.0-alpha.5 → 1.0.0-alpha.7
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/boot.js +33 -0
- package/dist/editor/index.js +26921 -15021
- package/dist/index-Dqe9DAF7.js +14259 -0
- package/dist/index-xyzNSgl4.js +5497 -0
- package/dist/index.js +1 -1
- package/dist/okno.css +1 -0
- package/dist/plugin-CP-6ZrvQ.js +542 -0
- package/dist/runtime/wrap.js +126 -0
- package/dist/vite/index.js +1 -1
- package/package.json +22 -7
- package/src/runtime/wrap.ts +281 -0
- package/dist/codegen/generate.d.ts +0 -6
- package/dist/codegen/generate.d.ts.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/plugin-DvUn7pFQ.js +0 -438
- package/dist/runtime/wrap.d.ts +0 -11
- package/dist/runtime/wrap.d.ts.map +0 -1
- package/dist/types/fields.d.ts +0 -73
- package/dist/types/fields.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/schema.d.ts +0 -47
- package/dist/types/schema.d.ts.map +0 -1
- package/dist/vite/dev-server.d.ts +0 -8
- package/dist/vite/dev-server.d.ts.map +0 -1
- package/dist/vite/index.d.ts +0 -2
- package/dist/vite/index.d.ts.map +0 -1
- package/dist/vite/plugin.d.ts +0 -4
- package/dist/vite/plugin.d.ts.map +0 -1
package/dist/boot.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const n = globalThis;
|
|
2
|
+
let o = !1;
|
|
3
|
+
function s() {
|
|
4
|
+
return !!n.__okno_loaded;
|
|
5
|
+
}
|
|
6
|
+
function u() {
|
|
7
|
+
var r, i;
|
|
8
|
+
let t = (r = n.document) == null ? void 0 : r.activeElement;
|
|
9
|
+
for (; t && ((i = t.shadowRoot) != null && i.activeElement); )
|
|
10
|
+
t = t.shadowRoot.activeElement;
|
|
11
|
+
const e = t == null ? void 0 : t.tagName;
|
|
12
|
+
return e === "INPUT" || e === "TEXTAREA" || (t == null ? void 0 : t.isContentEditable) === !0;
|
|
13
|
+
}
|
|
14
|
+
function a(t) {
|
|
15
|
+
o || s() || (o = !0, n.__okno_autostart = t, import("okno/editor").catch((e) => {
|
|
16
|
+
o = !1, console.error("[okno] failed to load editor bundle", e);
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
function l() {
|
|
20
|
+
const t = n.location;
|
|
21
|
+
if (!t) return !1;
|
|
22
|
+
try {
|
|
23
|
+
if (new URLSearchParams(t.search).has("okno")) return !0;
|
|
24
|
+
} catch {
|
|
25
|
+
}
|
|
26
|
+
return typeof t.hash == "string" && /(?:^#|[#&])okno(?:$|[=&])/.test(t.hash);
|
|
27
|
+
}
|
|
28
|
+
function _() {
|
|
29
|
+
!n.document || typeof __OKNO_IS_DEV__ < "u" && __OKNO_IS_DEV__ || n.__okno_gate_installed || (n.__okno_gate_installed = !0, n.document.addEventListener("keydown", (e) => {
|
|
30
|
+
s() || e.key !== "e" || e.ctrlKey || e.metaKey || e.altKey || u() || a("key");
|
|
31
|
+
}), l() && a("url"));
|
|
32
|
+
}
|
|
33
|
+
_();
|