@base44-preview/vite-plugin 1.0.24-pr.93.c15f29a → 1.0.24-pr.94.453a5a6
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/html-injections-plugin.d.ts.map +1 -1
- package/dist/html-injections-plugin.js +0 -6
- package/dist/html-injections-plugin.js.map +1 -1
- package/package.json +1 -1
- package/src/html-injections-plugin.ts +0 -6
- package/dist/injections/keyboard-viewport-bridge.d.ts +0 -2
- package/dist/injections/keyboard-viewport-bridge.d.ts.map +0 -1
- package/dist/injections/keyboard-viewport-bridge.js +0 -53
- package/dist/injections/keyboard-viewport-bridge.js.map +0 -1
- package/src/injections/keyboard-viewport-bridge.ts +0 -51
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-injections-plugin.d.ts","sourceRoot":"","sources":["../src/html-injections-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAqB,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"html-injections-plugin.d.ts","sourceRoot":"","sources":["../src/html-injections-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAqB,MAAM,MAAM,CAAC;AAyEtD,wBAAgB,oBAAoB,CAAC,EACnC,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,gBAAgB,GACjB,EAAE;IACD,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,GAmFM,MAAM,CACZ"}
|
|
@@ -52,11 +52,6 @@ const INJECTIONS = {
|
|
|
52
52
|
injectTo: "head",
|
|
53
53
|
mode: "dev",
|
|
54
54
|
},
|
|
55
|
-
keyboardViewport: {
|
|
56
|
-
src: "/node_modules/@base44/vite-plugin/dist/injections/keyboard-viewport-bridge.js",
|
|
57
|
-
injectTo: "head",
|
|
58
|
-
mode: "dev",
|
|
59
|
-
},
|
|
60
55
|
analyticsTracker: {
|
|
61
56
|
injectTo: "head",
|
|
62
57
|
mode: "production",
|
|
@@ -69,7 +64,6 @@ export function htmlInjectionsPlugin({ hmrNotifier, navigationNotifier, visualEd
|
|
|
69
64
|
sandboxMount: true,
|
|
70
65
|
hmrNotifier,
|
|
71
66
|
navigationNotifier,
|
|
72
|
-
keyboardViewport: true,
|
|
73
67
|
analyticsTracker,
|
|
74
68
|
};
|
|
75
69
|
let resolvedEnv = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-injections-plugin.js","sourceRoot":"","sources":["../src/html-injections-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAW/B,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BhC,CAAC;AAEF,MAAM,UAAU,GAA8B;IAC5C,eAAe,EAAE;QACf,GAAG,EAAE,gFAAgF;QACrF,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,KAAK;KACZ;IACD,YAAY,EAAE;QACZ,GAAG,EAAE,6EAA6E;QAClF,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,KAAK;KACZ;IACD,WAAW,EAAE;QACX,GAAG,EAAE,2EAA2E;QAChF,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,KAAK;KACZ;IACD,kBAAkB,EAAE;QAClB,GAAG,EAAE,0EAA0E;QAC/E,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,KAAK;KACZ;IACD,gBAAgB,EAAE;QAChB,
|
|
1
|
+
{"version":3,"file":"html-injections-plugin.js","sourceRoot":"","sources":["../src/html-injections-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAW/B,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BhC,CAAC;AAEF,MAAM,UAA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C,eAAe;4BACf,oBAAoB;4BACpB,uFAAuF;4BACvF,QAAQ;4BACR,2EAA2E;4BAC3E,GAAG;yBACJ,CAAC,IAAI,CAAC,IAAI,CAAC;wBACZ,QAAQ,EAAE,MAAM;qBACjB,CAAC,CAAC;gBACL,CAAC;gBAED,OAAO,IAAI,CAAC;YACd,CAAC;SACF;KACQ,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -64,11 +64,6 @@ const INJECTIONS: Record<string, Injection> = {
|
|
|
64
64
|
injectTo: "head",
|
|
65
65
|
mode: "dev",
|
|
66
66
|
},
|
|
67
|
-
keyboardViewport: {
|
|
68
|
-
src: "/node_modules/@base44/vite-plugin/dist/injections/keyboard-viewport-bridge.js",
|
|
69
|
-
injectTo: "head",
|
|
70
|
-
mode: "dev",
|
|
71
|
-
},
|
|
72
67
|
analyticsTracker: {
|
|
73
68
|
injectTo: "head",
|
|
74
69
|
mode: "production",
|
|
@@ -92,7 +87,6 @@ export function htmlInjectionsPlugin({
|
|
|
92
87
|
sandboxMount: true,
|
|
93
88
|
hmrNotifier,
|
|
94
89
|
navigationNotifier,
|
|
95
|
-
keyboardViewport: true,
|
|
96
90
|
analyticsTracker,
|
|
97
91
|
};
|
|
98
92
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard-viewport-bridge.d.ts","sourceRoot":"","sources":["../../src/injections/keyboard-viewport-bridge.ts"],"names":[],"mappings":""}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// The keyboard shrinks the builder's top-level visual viewport, not the preview
|
|
2
|
-
// iframe's, so the app inside can't reflow above it and leaves a blank gap. The
|
|
3
|
-
// builder posts the visible height here; while the keyboard is open (height > 0)
|
|
4
|
-
// we cap the app's full-height roots to it so the layout fits above it, 0 releases.
|
|
5
|
-
if (window.self !== window.top) {
|
|
6
|
-
const HEIGHT_VAR = "--base44-keyboard-viewport-height";
|
|
7
|
-
const STYLE_ID = "base44-keyboard-viewport-style";
|
|
8
|
-
function ensureStyle() {
|
|
9
|
-
if (document.getElementById(STYLE_ID))
|
|
10
|
-
return;
|
|
11
|
-
const style = document.createElement("style");
|
|
12
|
-
style.id = STYLE_ID;
|
|
13
|
-
// Applies only while HEIGHT_VAR is set on <html>. code_generator gives app roots
|
|
14
|
-
// min-h-screen/h-screen, so capping those (+ 100vh/100dvh, #root, the document).
|
|
15
|
-
// !important is required to override inline 100vh/100dvh styles and to win in
|
|
16
|
-
// apps that run Tailwind in important mode — we're overriding arbitrary user CSS.
|
|
17
|
-
style.textContent = [
|
|
18
|
-
`html[style*="${HEIGHT_VAR}"], html[style*="${HEIGHT_VAR}"] body {`,
|
|
19
|
-
` height: var(${HEIGHT_VAR}) !important;`,
|
|
20
|
-
` min-height: var(${HEIGHT_VAR}) !important;`,
|
|
21
|
-
`}`,
|
|
22
|
-
`html[style*="${HEIGHT_VAR}"] #root {`,
|
|
23
|
-
` height: var(${HEIGHT_VAR}) !important;`,
|
|
24
|
-
` min-height: var(${HEIGHT_VAR}) !important;`,
|
|
25
|
-
` overflow: hidden;`,
|
|
26
|
-
`}`,
|
|
27
|
-
`html[style*="${HEIGHT_VAR}"] :is(.h-screen, .min-h-screen),`,
|
|
28
|
-
`html[style*="${HEIGHT_VAR}"] [style*="100vh"],`,
|
|
29
|
-
`html[style*="${HEIGHT_VAR}"] [style*="100dvh"] {`,
|
|
30
|
-
` height: var(${HEIGHT_VAR}) !important;`,
|
|
31
|
-
` min-height: var(${HEIGHT_VAR}) !important;`,
|
|
32
|
-
`}`,
|
|
33
|
-
].join("\n");
|
|
34
|
-
document.head.appendChild(style);
|
|
35
|
-
}
|
|
36
|
-
function apply(height) {
|
|
37
|
-
if (height > 0) {
|
|
38
|
-
ensureStyle();
|
|
39
|
-
document.documentElement.style.setProperty(HEIGHT_VAR, `${Math.round(height)}px`);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
document.documentElement.style.removeProperty(HEIGHT_VAR);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
window.addEventListener("message", (event) => {
|
|
46
|
-
const data = event.data;
|
|
47
|
-
if (!data || data.type !== "keyboard-viewport" || typeof data.height !== "number")
|
|
48
|
-
return;
|
|
49
|
-
apply(data.height);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
export {};
|
|
53
|
-
//# sourceMappingURL=keyboard-viewport-bridge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard-viewport-bridge.js","sourceRoot":"","sources":["../../src/injections/keyboard-viewport-bridge.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,gFAAgF;AAChF,iFAAiF;AACjF,oFAAoF;AACpF,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC;IAC/B,MAAM,UAAU,GAAG,mCAAmC,CAAC;IACvD,MAAM,QAAQ,GAAG,gCAAgC,CAAC;IAElD,SAAS,WAAW;QAClB,IAAI,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC;YAAE,OAAO;QAC9C,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC9C,KAAK,CAAC,EAAE,GAAG,QAAQ,CAAC;QACpB,iFAAiF;QACjF,iFAAiF;QACjF,8EAA8E;QAC9E,kFAAkF;QAClF,KAAK,CAAC,WAAW,GAAG;YAClB,gBAAgB,UAAU,oBAAoB,UAAU,WAAW;YACnE,iBAAiB,UAAU,eAAe;YAC1C,qBAAqB,UAAU,eAAe;YAC9C,GAAG;YACH,gBAAgB,UAAU,YAAY;YACtC,iBAAiB,UAAU,eAAe;YAC1C,qBAAqB,UAAU,eAAe;YAC9C,qBAAqB;YACrB,GAAG;YACH,gBAAgB,UAAU,mCAAmC;YAC7D,gBAAgB,UAAU,sBAAsB;YAChD,gBAAgB,UAAU,wBAAwB;YAClD,iBAAiB,UAAU,eAAe;YAC1C,qBAAqB,UAAU,eAAe;YAC9C,GAAG;SACJ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACb,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAED,SAAS,KAAK,CAAC,MAAc;QAC3B,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;YACf,WAAW,EAAE,CAAC;YACd,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACpF,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,KAAmB,EAAE,EAAE;QACzD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,mBAAmB,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ;YAAE,OAAO;QAC1F,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
// The keyboard shrinks the builder's top-level visual viewport, not the preview
|
|
2
|
-
// iframe's, so the app inside can't reflow above it and leaves a blank gap. The
|
|
3
|
-
// builder posts the visible height here; while the keyboard is open (height > 0)
|
|
4
|
-
// we cap the app's full-height roots to it so the layout fits above it, 0 releases.
|
|
5
|
-
if (window.self !== window.top) {
|
|
6
|
-
const HEIGHT_VAR = "--base44-keyboard-viewport-height";
|
|
7
|
-
const STYLE_ID = "base44-keyboard-viewport-style";
|
|
8
|
-
|
|
9
|
-
function ensureStyle() {
|
|
10
|
-
if (document.getElementById(STYLE_ID)) return;
|
|
11
|
-
const style = document.createElement("style");
|
|
12
|
-
style.id = STYLE_ID;
|
|
13
|
-
// Applies only while HEIGHT_VAR is set on <html>. code_generator gives app roots
|
|
14
|
-
// min-h-screen/h-screen, so capping those (+ 100vh/100dvh, #root, the document).
|
|
15
|
-
// !important is required to override inline 100vh/100dvh styles and to win in
|
|
16
|
-
// apps that run Tailwind in important mode — we're overriding arbitrary user CSS.
|
|
17
|
-
style.textContent = [
|
|
18
|
-
`html[style*="${HEIGHT_VAR}"], html[style*="${HEIGHT_VAR}"] body {`,
|
|
19
|
-
` height: var(${HEIGHT_VAR}) !important;`,
|
|
20
|
-
` min-height: var(${HEIGHT_VAR}) !important;`,
|
|
21
|
-
`}`,
|
|
22
|
-
`html[style*="${HEIGHT_VAR}"] #root {`,
|
|
23
|
-
` height: var(${HEIGHT_VAR}) !important;`,
|
|
24
|
-
` min-height: var(${HEIGHT_VAR}) !important;`,
|
|
25
|
-
` overflow: hidden;`,
|
|
26
|
-
`}`,
|
|
27
|
-
`html[style*="${HEIGHT_VAR}"] :is(.h-screen, .min-h-screen),`,
|
|
28
|
-
`html[style*="${HEIGHT_VAR}"] [style*="100vh"],`,
|
|
29
|
-
`html[style*="${HEIGHT_VAR}"] [style*="100dvh"] {`,
|
|
30
|
-
` height: var(${HEIGHT_VAR}) !important;`,
|
|
31
|
-
` min-height: var(${HEIGHT_VAR}) !important;`,
|
|
32
|
-
`}`,
|
|
33
|
-
].join("\n");
|
|
34
|
-
document.head.appendChild(style);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function apply(height: number) {
|
|
38
|
-
if (height > 0) {
|
|
39
|
-
ensureStyle();
|
|
40
|
-
document.documentElement.style.setProperty(HEIGHT_VAR, `${Math.round(height)}px`);
|
|
41
|
-
} else {
|
|
42
|
-
document.documentElement.style.removeProperty(HEIGHT_VAR);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
window.addEventListener("message", (event: MessageEvent) => {
|
|
47
|
-
const data = event.data;
|
|
48
|
-
if (!data || data.type !== "keyboard-viewport" || typeof data.height !== "number") return;
|
|
49
|
-
apply(data.height);
|
|
50
|
-
});
|
|
51
|
-
}
|