okno 1.0.0-beta.34 → 1.0.0-beta.36
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.d.ts.map +1 -1
- package/dist/boot.js +54 -30
- package/dist/codegen/modules.d.ts.map +1 -1
- package/dist/dispatch-dIjAypRM.js +934 -0
- package/dist/editor/index.js +14417 -14003
- package/dist/index.js +1 -1
- package/dist/local/disk.d.ts +0 -1
- package/dist/local/disk.d.ts.map +1 -1
- package/dist/local/dispatch.d.ts.map +1 -1
- package/dist/next/index.js +1 -1
- package/dist/{plugin-BLXI8bRY.js → plugin-CPb37kty.js} +1 -1
- package/dist/runtime/wrap.d.ts +10 -0
- package/dist/runtime/wrap.d.ts.map +1 -1
- package/dist/runtime/wrap.js +123 -115
- package/dist/types/schema.d.ts +9 -0
- package/dist/types/schema.d.ts.map +1 -1
- package/dist/vite/index.js +1 -1
- package/package.json +1 -1
- package/src/runtime/wrap.ts +19 -0
- package/dist/dispatch-J7j2qG_a.js +0 -941
package/dist/boot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAuTA,OAAO,EAAE,CAAA"}
|
package/dist/boot.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const e = globalThis;
|
|
2
|
-
let
|
|
3
|
-
const m = "okno-win-opened",
|
|
2
|
+
let a = !1;
|
|
3
|
+
const m = "okno-win-opened", c = "okno-shadow-root", l = "okno-vt-style", r = "okno-nav-vt";
|
|
4
4
|
function u() {
|
|
5
5
|
try {
|
|
6
6
|
return e.localStorage?.getItem(m) === "true";
|
|
@@ -14,7 +14,7 @@ function h() {
|
|
|
14
14
|
function _() {
|
|
15
15
|
if (!e.document) return !1;
|
|
16
16
|
for (const t of Array.from(e.document.styleSheets)) {
|
|
17
|
-
if (t.ownerNode?.id ===
|
|
17
|
+
if (t.ownerNode?.id === l) continue;
|
|
18
18
|
let n;
|
|
19
19
|
try {
|
|
20
20
|
n = t.cssRules;
|
|
@@ -27,58 +27,58 @@ function _() {
|
|
|
27
27
|
return !1;
|
|
28
28
|
}
|
|
29
29
|
function d() {
|
|
30
|
-
if (!e.document || e.document.getElementById(
|
|
30
|
+
if (!e.document || e.document.getElementById(l) || !h()) return;
|
|
31
31
|
const t = _(), n = e.document.createElement("style");
|
|
32
|
-
n.id =
|
|
32
|
+
n.id = l;
|
|
33
33
|
let o = `
|
|
34
|
-
html.${
|
|
35
|
-
html.${
|
|
36
|
-
html.${
|
|
34
|
+
html.${r}::view-transition-group(okno-shell) { animation-duration: 420ms; }
|
|
35
|
+
html.${r}::view-transition-old(okno-shell) { animation: okno-shell-hold 420ms both; }
|
|
36
|
+
html.${r}::view-transition-new(okno-shell) { animation: none; }
|
|
37
37
|
@keyframes okno-shell-hold { from { opacity: 1 } to { opacity: 1 } }
|
|
38
38
|
`;
|
|
39
39
|
t || (o += `
|
|
40
40
|
@view-transition { navigation: auto; }
|
|
41
|
-
html.${
|
|
42
|
-
html.${
|
|
43
|
-
html.${
|
|
41
|
+
html.${r}::view-transition-group(root),
|
|
42
|
+
html.${r}::view-transition-old(root),
|
|
43
|
+
html.${r}::view-transition-new(root) { animation: none; }
|
|
44
44
|
`), n.textContent = o, e.document.head.appendChild(n);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function v(t) {
|
|
47
47
|
t.style.cssText += ";position:fixed;inset:0;pointer-events:none;view-transition-name:okno-shell";
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function p(t) {
|
|
50
50
|
if (!u() || !t.viewTransition) return;
|
|
51
|
-
e.document?.documentElement.classList.add(
|
|
52
|
-
const n = e.document?.getElementById(
|
|
53
|
-
n instanceof HTMLElement &&
|
|
51
|
+
e.document?.documentElement.classList.add(r);
|
|
52
|
+
const n = e.document?.getElementById(c);
|
|
53
|
+
n instanceof HTMLElement && v(n);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function w(t) {
|
|
56
56
|
const n = t.viewTransition;
|
|
57
57
|
if (!u() || !n || !e.document) return;
|
|
58
58
|
const o = e.document.documentElement;
|
|
59
|
-
o.classList.add(
|
|
60
|
-
() => o.classList.remove(
|
|
61
|
-
() => o.classList.remove(
|
|
59
|
+
o.classList.add(r), n.finished?.then?.(
|
|
60
|
+
() => o.classList.remove(r),
|
|
61
|
+
() => o.classList.remove(r)
|
|
62
62
|
);
|
|
63
|
-
let
|
|
64
|
-
|
|
63
|
+
let i = e.document.getElementById(c);
|
|
64
|
+
i || (i = e.document.createElement("div"), i.id = c, e.document.body.appendChild(i)), i instanceof HTMLElement && (i.style.cssText = "position:fixed;inset:0;pointer-events:none;view-transition-name:okno-shell");
|
|
65
65
|
}
|
|
66
66
|
function f() {
|
|
67
67
|
return !!e.__okno_loaded;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function y() {
|
|
70
70
|
let t = e.document?.activeElement;
|
|
71
71
|
for (; t && t.shadowRoot?.activeElement; )
|
|
72
72
|
t = t.shadowRoot.activeElement;
|
|
73
73
|
const n = t?.tagName;
|
|
74
74
|
return n === "INPUT" || n === "TEXTAREA" || t?.isContentEditable === !0;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
function s(t) {
|
|
77
|
+
a || f() || (a = !0, e.__okno_autostart = t, import("okno/editor").catch((n) => {
|
|
78
|
+
a = !1, console.error("[okno] failed to load editor bundle", n);
|
|
79
79
|
}));
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function E() {
|
|
82
82
|
const t = e.location;
|
|
83
83
|
if (!t) return !1;
|
|
84
84
|
try {
|
|
@@ -87,12 +87,36 @@ function p() {
|
|
|
87
87
|
}
|
|
88
88
|
return typeof t.hash == "string" && /(?:^#|[#&])okno(?:$|[=&])/.test(t.hash);
|
|
89
89
|
}
|
|
90
|
+
function k() {
|
|
91
|
+
const t = e.location;
|
|
92
|
+
if (!t || typeof t.hash != "string") return null;
|
|
93
|
+
const n = /(?:^#|[#&])okno-invite=([^&]+)/.exec(t.hash);
|
|
94
|
+
if (!n?.[1]) return null;
|
|
95
|
+
let o;
|
|
96
|
+
try {
|
|
97
|
+
o = decodeURIComponent(n[1]);
|
|
98
|
+
} catch {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
try {
|
|
102
|
+
const i = t.hash.replace(/(^#|[#&])okno-invite=[^&]*/, "$1").replace(/^[#&]+$/, "");
|
|
103
|
+
e.history?.replaceState(null, "", t.pathname + t.search + (i && i !== "#" ? i : ""));
|
|
104
|
+
} catch {
|
|
105
|
+
}
|
|
106
|
+
return o;
|
|
107
|
+
}
|
|
90
108
|
function g() {
|
|
91
109
|
if (!e.document || (typeof __OKNO_IS_DEV__ < "u" ? __OKNO_IS_DEV__ : !1) || e.__okno_gate_installed) return;
|
|
92
|
-
e.__okno_gate_installed = !0, e.document.addEventListener("keydown", (
|
|
93
|
-
f() ||
|
|
110
|
+
e.__okno_gate_installed = !0, e.document.addEventListener("keydown", (i) => {
|
|
111
|
+
f() || i.key !== "e" || i.ctrlKey || i.metaKey || i.altKey || y() || s("key");
|
|
94
112
|
}), e.__okno_ensure_vt = d;
|
|
95
113
|
const n = window;
|
|
96
|
-
n.addEventListener("pageswap",
|
|
114
|
+
n.addEventListener("pageswap", p), n.addEventListener("pagereveal", w), u() && (d(), s("session"));
|
|
115
|
+
const o = k();
|
|
116
|
+
if (o) {
|
|
117
|
+
e.__okno_invite = o, s("url");
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
E() && s("url");
|
|
97
121
|
}
|
|
98
122
|
g();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/codegen/modules.ts"],"names":[],"mappings":"AAgCA,eAAO,MAAM,eAAe,oHACoF,CAAA;AAoBhH;kEACkE;AAClE,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAKhD;AAED;;;mCAGmC;AACnC,wBAAgB,kBAAkB,IAAI,MAAM,CAO3C;
|
|
1
|
+
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/codegen/modules.ts"],"names":[],"mappings":"AAgCA,eAAO,MAAM,eAAe,oHACoF,CAAA;AAoBhH;kEACkE;AAClE,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAKhD;AAED;;;mCAGmC;AACnC,wBAAgB,kBAAkB,IAAI,MAAM,CAO3C;AAqHD;;;;;+EAK+E;AAC/E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAoD1D;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAsDzE;AAED,0CAA0C;AAC1C,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,GAAG,CAAC,MAAM,CAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAmFtG;AAED,2FAA2F;AAC3F,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,GAAG,CAAC,MAAM,CAAa,EAAE,OAAO,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CA4I7H;AAED,4CAA4C;AAC5C,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,GAAG,CAAC,MAAM,CAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAuExG"}
|