@kokimoki/kit 1.6.7 → 1.8.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/README.md +76 -0
- package/dist/api.d.ts +63 -0
- package/dist/api.js +95 -0
- package/dist/credentials.d.ts +25 -0
- package/dist/credentials.js +45 -0
- package/dist/dev-app.d.ts +57 -0
- package/dist/dev-app.js +272 -0
- package/dist/dev-frame/index.d.ts +5 -0
- package/dist/dev-frame/index.js +9 -0
- package/dist/dev-frame/render-dev-frame.d.ts +42 -0
- package/dist/dev-frame/render-dev-frame.js +189 -0
- package/dist/dev-frame/styles.d.ts +4 -0
- package/dist/dev-frame/styles.js +191 -0
- package/dist/dev-i18n.d.ts +56 -0
- package/dist/dev-i18n.js +165 -0
- package/dist/dev-overlays.d.ts +19 -0
- package/dist/dev-overlays.js +301 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +7 -0
- package/dist/kokimoki-kit-plugin.d.ts +54 -4
- package/dist/kokimoki-kit-plugin.js +523 -107
- package/dist/preprocess-style.js +12 -11
- package/dist/production-loading-screen.d.ts +20 -0
- package/dist/production-loading-screen.js +123 -0
- package/dist/schemas/app-meta-schema.d.ts +22 -0
- package/dist/schemas/app-meta-schema.js +31 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/kokimoki-kit.instructions.md +389 -0
- package/llms.txt +46 -0
- package/package.json +11 -3
package/dist/preprocess-style.js
CHANGED
|
@@ -3,17 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.hexToRgb =
|
|
7
|
-
exports.rgbToHex = rgbToHex;
|
|
8
|
-
exports.revertReplaceForColorPickers = revertReplaceForColorPickers;
|
|
9
|
-
exports.hexToTailwindRgbString = hexToTailwindRgbString;
|
|
10
|
-
exports.getLuminance = getLuminance;
|
|
11
|
-
exports.calculateRatio = calculateRatio;
|
|
12
|
-
exports.handleStringColor = handleStringColor;
|
|
13
|
-
exports.destringRgb = destringRgb;
|
|
14
|
-
exports.generateA11yOnColor = generateA11yOnColor;
|
|
15
|
-
exports.generatePalette = generatePalette;
|
|
16
|
-
exports.preprocessStyle = preprocessStyle;
|
|
6
|
+
exports.preprocessStyle = exports.generatePalette = exports.generateA11yOnColor = exports.destringRgb = exports.handleStringColor = exports.calculateRatio = exports.getLuminance = exports.hexToTailwindRgbString = exports.revertReplaceForColorPickers = exports.rgbToHex = exports.hexToRgb = void 0;
|
|
17
7
|
const colorjs_io_1 = __importDefault(require("colorjs.io"));
|
|
18
8
|
const colornames_1 = __importDefault(require("colornames"));
|
|
19
9
|
// List of rgb tuple variable names (possibly temporary system to support color picker for these variables)
|
|
@@ -113,10 +103,12 @@ function hexToRgb(hex) {
|
|
|
113
103
|
b: parseInt(b, 16),
|
|
114
104
|
};
|
|
115
105
|
}
|
|
106
|
+
exports.hexToRgb = hexToRgb;
|
|
116
107
|
function rgbToHex(r, g, b) {
|
|
117
108
|
const toHex = (c) => `0${c.toString(16)}`.slice(-2);
|
|
118
109
|
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
119
110
|
}
|
|
111
|
+
exports.rgbToHex = rgbToHex;
|
|
120
112
|
// export function replaceForColorPickers(code: string) {
|
|
121
113
|
// return code.replace(
|
|
122
114
|
// /--([a-z0-9-]+):\s*(\d+)\s+(\d+)\s+(\d+);/gi,
|
|
@@ -153,6 +145,7 @@ function revertReplaceForColorPickers(code) {
|
|
|
153
145
|
return match;
|
|
154
146
|
});
|
|
155
147
|
}
|
|
148
|
+
exports.revertReplaceForColorPickers = revertReplaceForColorPickers;
|
|
156
149
|
function lighten(hex, intensity) {
|
|
157
150
|
const color = hexToRgb(`#${hex}`);
|
|
158
151
|
if (!color)
|
|
@@ -179,6 +172,7 @@ function hexToTailwindRgbString(hex) {
|
|
|
179
172
|
const [, r, g, b] = colorParts;
|
|
180
173
|
return `${parseInt(r, 16)} ${parseInt(g, 16)} ${parseInt(b, 16)}`;
|
|
181
174
|
}
|
|
175
|
+
exports.hexToTailwindRgbString = hexToTailwindRgbString;
|
|
182
176
|
function getLuminance(r, g, b) {
|
|
183
177
|
const { _r, _g, _b } = typeof r === "object"
|
|
184
178
|
? { _r: r.r, _g: r.g, _b: r.b }
|
|
@@ -192,6 +186,7 @@ function getLuminance(r, g, b) {
|
|
|
192
186
|
});
|
|
193
187
|
return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722;
|
|
194
188
|
}
|
|
189
|
+
exports.getLuminance = getLuminance;
|
|
195
190
|
function calculateRatio(luminance1, luminance2) {
|
|
196
191
|
const lum1 = typeof luminance1 === "string"
|
|
197
192
|
? getLuminance(handleStringColor(luminance1))
|
|
@@ -205,6 +200,7 @@ function calculateRatio(luminance1, luminance2) {
|
|
|
205
200
|
? (lum2 + 0.05) / (lum1 + 0.05)
|
|
206
201
|
: (lum1 + 0.05) / (lum2 + 0.05);
|
|
207
202
|
}
|
|
203
|
+
exports.calculateRatio = calculateRatio;
|
|
208
204
|
function handleStringColor(colorString, returnType = "rgb") {
|
|
209
205
|
// if it's a css variable
|
|
210
206
|
if (colorString.includes("--")) {
|
|
@@ -228,6 +224,7 @@ function handleStringColor(colorString, returnType = "rgb") {
|
|
|
228
224
|
}
|
|
229
225
|
return colorString;
|
|
230
226
|
}
|
|
227
|
+
exports.handleStringColor = handleStringColor;
|
|
231
228
|
function cssColorToHex(colorString) {
|
|
232
229
|
if (colorString.includes("#"))
|
|
233
230
|
return colorString;
|
|
@@ -254,11 +251,13 @@ function destringRgb(rgbString) {
|
|
|
254
251
|
b: parseInt(rgb[3], 10),
|
|
255
252
|
};
|
|
256
253
|
}
|
|
254
|
+
exports.destringRgb = destringRgb;
|
|
257
255
|
function generateA11yOnColor(hex) {
|
|
258
256
|
const black = calculateRatio(hex, "#000000");
|
|
259
257
|
const white = calculateRatio(hex, "#FFFFFF");
|
|
260
258
|
return black < white ? "0 0 0" : "255 255 255";
|
|
261
259
|
}
|
|
260
|
+
exports.generateA11yOnColor = generateA11yOnColor;
|
|
262
261
|
function generatePalette(baseColor) {
|
|
263
262
|
const hexValidation = new RegExp(/^#[0-9a-f]{6}$/i);
|
|
264
263
|
if (!hexValidation.test(baseColor))
|
|
@@ -300,6 +299,7 @@ function generatePalette(baseColor) {
|
|
|
300
299
|
});
|
|
301
300
|
return response;
|
|
302
301
|
}
|
|
302
|
+
exports.generatePalette = generatePalette;
|
|
303
303
|
function preprocessGfcThemeBlock(code) {
|
|
304
304
|
// Generate map of defined css variables
|
|
305
305
|
const cssVariableMap = {};
|
|
@@ -376,3 +376,4 @@ function preprocessStyle(code) {
|
|
|
376
376
|
}
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
|
+
exports.preprocessStyle = preprocessStyle;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Production loading screen HTML/CSS/JS for kokimoki-kit plugin.
|
|
3
|
+
* This screen is injected into production builds and removed when km:ready is received.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Loading screen styles
|
|
7
|
+
*/
|
|
8
|
+
export declare const loadingScreenStyles = "\n<style id=\"km-loading-style\">\n #km-loading {\n position: fixed;\n inset: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 1.5rem;\n background: #fff;\n z-index: 9999;\n transition: opacity 0.3s ease-out;\n color: #1a1a2e;\n text-decoration: none;\n }\n #km-loading.km-ready {\n opacity: 0;\n pointer-events: none;\n }\n #km-loading .km-spinner {\n height: 2rem;\n animation: km-spin 1s linear infinite;\n }\n #km-loading .km-logo {\n height: 3rem;\n }\n #km-loading .km-powered {\n font-size: 0.75rem;\n font-weight: 600;\n opacity: 0.65;\n font-family: system-ui, -apple-system, sans-serif;\n }\n @keyframes km-spin {\n to { transform: rotate(360deg); }\n }\n</style>";
|
|
9
|
+
/**
|
|
10
|
+
* km:ready listener script with 3s minimum display time
|
|
11
|
+
*/
|
|
12
|
+
export declare const loadingScreenScript = "\n<script>\n (function() {\n var startTime = Date.now();\n var minDisplayTime = 3000;\n var appReady = false;\n \n function hideLoading() {\n var el = document.getElementById('km-loading');\n var style = document.getElementById('km-loading-style');\n if (el) {\n el.classList.add('km-ready');\n setTimeout(function() {\n el.remove();\n if (style) style.remove();\n }, 300);\n }\n }\n \n function tryHide() {\n if (!appReady) return;\n var elapsed = Date.now() - startTime;\n var remaining = Math.max(0, minDisplayTime - elapsed);\n setTimeout(hideLoading, remaining);\n }\n \n window.addEventListener('message', function(e) {\n if (e.data === 'km:ready' && !appReady) {\n appReady = true;\n tryHide();\n }\n });\n })();\n</script>";
|
|
13
|
+
/**
|
|
14
|
+
* Loading screen HTML element with Games for Crowds branding
|
|
15
|
+
*/
|
|
16
|
+
export declare const loadingScreenElement = "<a href=\"https://gamesforcrowds.com\" target=\"_blank\" id=\"km-loading\">\n <svg class=\"km-spinner\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path fill=\"currentColor\" d=\"M12 22q-2.05 0-3.875-.788t-3.187-2.15t-2.15-3.187T2 12q0-2.075.788-3.887t2.15-3.175t3.187-2.15T12 2q.425 0 .713.288T13 3t-.288.713T12 4Q8.675 4 6.337 6.338T4 12t2.338 5.663T12 20t5.663-2.337T20 12q0-.425.288-.712T21 11t.713.288T22 12q0 2.05-.788 3.875t-2.15 3.188t-3.175 2.15T12 22\"/>\n </svg>\n <svg class=\"km-logo\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 797.59 219.07\" fill=\"currentColor\">\n <g>\n <path d=\"M162.8,96.03c30.87-26.51,10.41-92.22-28.46-95.03-29.39-2.13-60.31-.26-90.99.07-.73,0-1.45-.02-2.17.09C20.3,4.26,3.91,21.33.05,41.8l-.05,123.54c2.6,4.28,5.58,6,10.54,3.94,6.74-3.82,26.58-29.17,31.77-30.22,1.69-.34,3.72.1,5.48-.03-1.15,26.53,19.87,47.52,45.62,49.88,10.24.94,31.34-1.93,39.43.57,8.71,2.7,26.57,28.84,33.53,29.55,3.29.34,7.74-2.14,8.38-5.52,1.72-9.15-2.16-26.7.23-34.77.33-1.1,7.39-8.47,9.02-10.98,16.21-24.98,7.36-61.07-21.22-71.74ZM50.83,121.59l-15.96,2.04-19.08,18.42V46.55c1.67-14.1,15.14-27.27,28.74-30.26,27.33,1.33,57.83-2.6,84.8-.28,20.06,1.73,36.5,34.92,31,55.08-7.53,27.65-45.72,17.08-67.02,18.97-18.52,1.65-36.21,13.88-42.47,31.53ZM170.32,159.08c-1.85,3-10.53,10.69-10.53,11.47v20.5c-1.75.44-2-.72-3.01-1.49-5.71-4.38-11.7-14.4-18.92-16.08-20.43-4.73-47.91,7.68-65.09-10.9-16.98-18.36-8.23-50.63,16.23-55.82,10.35-2.2,44.8-1.74,56.33-.74,24.82,2.14,38.05,31.97,25,53.07Z\"/>\n <polygon points=\"573.74 181.88 556.14 122.98 538.69 122.81 519.73 181.89 501.74 122.88 481.24 122.88 508.73 212.9 525.78 213.95 527.35 213.29 545.25 152.88 564.73 212.9 583.28 213.42 611.24 122.88 590.24 122.88 573.74 181.88\"/>\n <path d=\"M666.74,122.88c-13.74-1.63-30.44,1.21-44.5,0v91h40.5c2.92,0,11.75-2.85,14.86-4.14,38.57-16.14,31.3-81.86-10.86-86.86ZM678.08,187.22c-2.88,4.2-11.41,9.66-16.34,9.66h-20.5v-58c6.18.55,13.48-.75,19.5,0,22.38,2.79,28.85,31.55,17.34,48.34Z\"/>\n <path d=\"M425,121.14c-41.35,5.24-51.11,67.28-16.45,87.94,28.45,16.96,67.81.39,70.73-33.66,2.97-34.62-18.81-58.77-54.28-54.28ZM427.98,198.64c-27.94-4.46-28.04-57.3,1.02-61.5,40.78-5.9,43.14,68.55-1.02,61.5Z\"/>\n <path d=\"M363.48,127.14c-1.58-.84-10.61-4.26-11.74-4.26h-41.5v91h19v-33l11.58.92,18.92,32.08h21.5l-20.99-35.44c19.78-8.94,22.88-40.88,3.23-51.3ZM355.77,157.91c-1.32,4.05-6.98,7.97-11.02,7.97h-15.5v-27c5.36.62,12.39-.85,17.5,0,9.11,1.51,11.57,11.21,9.02,19.03Z\"/>\n <path d=\"M777.02,179.61c-3.95-19.44-32.26-17.78-42.74-26.26-5.4-4.37-4.24-12.34,1.69-15.23,9.47-4.61,20.58,1.49,27.6,7.63l12.65-9.36c-10.04-12.51-23.17-17.41-39.22-15.24-28.56,3.86-35.71,38.53-7.02,50.5,9.33,3.89,33.09,5.53,28.6,20.07-3.99,12.93-29.66,6.57-35.83-2.65l-12.44,11.18c19.81,25.44,74.88,19.65,66.7-20.64Z\"/>\n <path d=\"M267.5,198.64c-41.37,7.02-43.83-58.8-9.75-61.75,10.54-.91,17.28,3.56,24.13,10.88l14.35-7.92c-9.32-19.99-38.11-23.5-56.51-14.99-32.89,15.21-33.7,69.52-.86,85.89,19.28,9.61,48.03,5.78,58.38-14.86l-12.64-7.94c-5.5,3.74-10.09,9.5-17.1,10.69Z\"/>\n <path d=\"M433.4,44.09l21.29,35.46c2.72,2.8,9.85,1.78,13.55,1.07l22.47-37.65v59.55h21.35V4.76l-20.8,1.11-27.53,50.58-29.76-51.69h-20.79v97.76h20.23v-58.43Z\"/>\n <path d=\"M306.43,48.58h-42.7v16.85h21.35c-.27,13.22-7.04,21.88-20.74,22.52-41.54,1.94-38.23-76.19,5.07-66.97,7.84,1.67,10.69,7.85,16.21,11.88l15.05-8.01c-.07-9-13.02-17.18-20.95-19.79-43.1-14.17-73.97,23.73-63.98,65.1,11.75,48.67,85.6,47.68,90.69-4.17.54-5.55-.39-11.78,0-17.42Z\"/>\n <path d=\"M340.09,81.68l33.82-.02,6.67,20.85h23.6L368.81,5.87c-1.88-2.26-20.12-1.02-24.2-.56l-34.81,97.22h23.6l6.7-20.83ZM356.43,29.47l10.67,34.84h-21.35l10.67-34.84Z\"/>\n <polygon points=\"590.71 84.54 551.39 84.54 551.39 60.94 585.1 60.94 585.1 42.96 551.39 42.96 551.39 22.74 588.47 22.74 588.47 4.76 530.04 4.76 530.04 102.52 590.71 102.52 590.71 84.54\"/>\n <path d=\"M608.77,97.39c25.08,16.57,67.45,5.44,61.46-30-1.89-11.15-12.36-17.09-21.93-20.77-7.64-2.94-35.54-8.52-22.36-22.37,8.09-8.51,23.15-1.69,30.32,5.07,2.52-1.37,13.45-9.1,13.04-11.48-14.3-20.97-60.08-20.5-65.72,7.08-2.89,14.13,1.82,25,14.48,31.72,10.24,5.44,38.71,7.15,31.37,24.24-3.47,8.09-18.1,7.13-25,4.22-4.16-1.76-9.85-8.71-12.66-8.29-2.01.3-13.33,8.46-13.03,10.32.38,2.39,7.73,8.73,10.04,10.25Z\"/>\n </g>\n <g>\n <path fill=\"#3c63e7\" d=\"M735,55.98c-24.25,4.14-27.28,47.44,1.59,47.65,31.23.23,35.57-53.99-1.59-47.65ZM734.29,92.39c-9.51-2.94-5.29-24.14,2.49-26.5,16.88-5.12,14.38,31.73-2.49,26.5Z\"/>\n <path fill=\"#3c63e7\" d=\"M716.28,56.67c-3.34-.27-7.15.39-10.41,0-1.21-.14-1.64.47-1.24-1.25,1.77-7.6,5.49-10.69,13.44-7.79l.86-10.79c-14.12-3.91-26.67,3.85-26.53,18.98l-8.25,1.69-1.3,9.08,8.13.02-3.61,36.13,12.26-.85,4.05-35.24h11.1c1.99-.47,1.49-8.28,1.51-9.99Z\"/>\n <path fill=\"#3c63e7\" d=\"M796.72,56.17c-6.86-1.78-12.48,2-15.87,7.73l.45-7.22h-11.74s-4.51,46.06-4.51,46.06h12.65c2.16-13.01-1.47-38.8,18.96-34.32-.94-2.92,2.45-10.57.06-12.25Z\"/>\n </g>\n </svg>\n <p class=\"km-powered\">Powered by Kokimoki</p>\n</a>";
|
|
17
|
+
/**
|
|
18
|
+
* Removes any existing km-loading elements from HTML
|
|
19
|
+
*/
|
|
20
|
+
export declare function removeExistingLoadingScreen(html: string): string;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Production loading screen HTML/CSS/JS for kokimoki-kit plugin.
|
|
4
|
+
* This screen is injected into production builds and removed when km:ready is received.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.removeExistingLoadingScreen = exports.loadingScreenElement = exports.loadingScreenScript = exports.loadingScreenStyles = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Loading screen styles
|
|
10
|
+
*/
|
|
11
|
+
exports.loadingScreenStyles = `
|
|
12
|
+
<style id="km-loading-style">
|
|
13
|
+
#km-loading {
|
|
14
|
+
position: fixed;
|
|
15
|
+
inset: 0;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
gap: 1.5rem;
|
|
21
|
+
background: #fff;
|
|
22
|
+
z-index: 9999;
|
|
23
|
+
transition: opacity 0.3s ease-out;
|
|
24
|
+
color: #1a1a2e;
|
|
25
|
+
text-decoration: none;
|
|
26
|
+
}
|
|
27
|
+
#km-loading.km-ready {
|
|
28
|
+
opacity: 0;
|
|
29
|
+
pointer-events: none;
|
|
30
|
+
}
|
|
31
|
+
#km-loading .km-spinner {
|
|
32
|
+
height: 2rem;
|
|
33
|
+
animation: km-spin 1s linear infinite;
|
|
34
|
+
}
|
|
35
|
+
#km-loading .km-logo {
|
|
36
|
+
height: 3rem;
|
|
37
|
+
}
|
|
38
|
+
#km-loading .km-powered {
|
|
39
|
+
font-size: 0.75rem;
|
|
40
|
+
font-weight: 600;
|
|
41
|
+
opacity: 0.65;
|
|
42
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
43
|
+
}
|
|
44
|
+
@keyframes km-spin {
|
|
45
|
+
to { transform: rotate(360deg); }
|
|
46
|
+
}
|
|
47
|
+
</style>`;
|
|
48
|
+
/**
|
|
49
|
+
* km:ready listener script with 3s minimum display time
|
|
50
|
+
*/
|
|
51
|
+
exports.loadingScreenScript = `
|
|
52
|
+
<script>
|
|
53
|
+
(function() {
|
|
54
|
+
var startTime = Date.now();
|
|
55
|
+
var minDisplayTime = 3000;
|
|
56
|
+
var appReady = false;
|
|
57
|
+
|
|
58
|
+
function hideLoading() {
|
|
59
|
+
var el = document.getElementById('km-loading');
|
|
60
|
+
var style = document.getElementById('km-loading-style');
|
|
61
|
+
if (el) {
|
|
62
|
+
el.classList.add('km-ready');
|
|
63
|
+
setTimeout(function() {
|
|
64
|
+
el.remove();
|
|
65
|
+
if (style) style.remove();
|
|
66
|
+
}, 300);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function tryHide() {
|
|
71
|
+
if (!appReady) return;
|
|
72
|
+
var elapsed = Date.now() - startTime;
|
|
73
|
+
var remaining = Math.max(0, minDisplayTime - elapsed);
|
|
74
|
+
setTimeout(hideLoading, remaining);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
window.addEventListener('message', function(e) {
|
|
78
|
+
if (e.data === 'km:ready' && !appReady) {
|
|
79
|
+
appReady = true;
|
|
80
|
+
tryHide();
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
})();
|
|
84
|
+
</script>`;
|
|
85
|
+
/**
|
|
86
|
+
* Loading screen HTML element with Games for Crowds branding
|
|
87
|
+
*/
|
|
88
|
+
exports.loadingScreenElement = `<a href="https://gamesforcrowds.com" target="_blank" id="km-loading">
|
|
89
|
+
<svg class="km-spinner" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
90
|
+
<path fill="currentColor" d="M12 22q-2.05 0-3.875-.788t-3.187-2.15t-2.15-3.187T2 12q0-2.075.788-3.887t2.15-3.175t3.187-2.15T12 2q.425 0 .713.288T13 3t-.288.713T12 4Q8.675 4 6.337 6.338T4 12t2.338 5.663T12 20t5.663-2.337T20 12q0-.425.288-.712T21 11t.713.288T22 12q0 2.05-.788 3.875t-2.15 3.188t-3.175 2.15T12 22"/>
|
|
91
|
+
</svg>
|
|
92
|
+
<svg class="km-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 797.59 219.07" fill="currentColor">
|
|
93
|
+
<g>
|
|
94
|
+
<path d="M162.8,96.03c30.87-26.51,10.41-92.22-28.46-95.03-29.39-2.13-60.31-.26-90.99.07-.73,0-1.45-.02-2.17.09C20.3,4.26,3.91,21.33.05,41.8l-.05,123.54c2.6,4.28,5.58,6,10.54,3.94,6.74-3.82,26.58-29.17,31.77-30.22,1.69-.34,3.72.1,5.48-.03-1.15,26.53,19.87,47.52,45.62,49.88,10.24.94,31.34-1.93,39.43.57,8.71,2.7,26.57,28.84,33.53,29.55,3.29.34,7.74-2.14,8.38-5.52,1.72-9.15-2.16-26.7.23-34.77.33-1.1,7.39-8.47,9.02-10.98,16.21-24.98,7.36-61.07-21.22-71.74ZM50.83,121.59l-15.96,2.04-19.08,18.42V46.55c1.67-14.1,15.14-27.27,28.74-30.26,27.33,1.33,57.83-2.6,84.8-.28,20.06,1.73,36.5,34.92,31,55.08-7.53,27.65-45.72,17.08-67.02,18.97-18.52,1.65-36.21,13.88-42.47,31.53ZM170.32,159.08c-1.85,3-10.53,10.69-10.53,11.47v20.5c-1.75.44-2-.72-3.01-1.49-5.71-4.38-11.7-14.4-18.92-16.08-20.43-4.73-47.91,7.68-65.09-10.9-16.98-18.36-8.23-50.63,16.23-55.82,10.35-2.2,44.8-1.74,56.33-.74,24.82,2.14,38.05,31.97,25,53.07Z"/>
|
|
95
|
+
<polygon points="573.74 181.88 556.14 122.98 538.69 122.81 519.73 181.89 501.74 122.88 481.24 122.88 508.73 212.9 525.78 213.95 527.35 213.29 545.25 152.88 564.73 212.9 583.28 213.42 611.24 122.88 590.24 122.88 573.74 181.88"/>
|
|
96
|
+
<path d="M666.74,122.88c-13.74-1.63-30.44,1.21-44.5,0v91h40.5c2.92,0,11.75-2.85,14.86-4.14,38.57-16.14,31.3-81.86-10.86-86.86ZM678.08,187.22c-2.88,4.2-11.41,9.66-16.34,9.66h-20.5v-58c6.18.55,13.48-.75,19.5,0,22.38,2.79,28.85,31.55,17.34,48.34Z"/>
|
|
97
|
+
<path d="M425,121.14c-41.35,5.24-51.11,67.28-16.45,87.94,28.45,16.96,67.81.39,70.73-33.66,2.97-34.62-18.81-58.77-54.28-54.28ZM427.98,198.64c-27.94-4.46-28.04-57.3,1.02-61.5,40.78-5.9,43.14,68.55-1.02,61.5Z"/>
|
|
98
|
+
<path d="M363.48,127.14c-1.58-.84-10.61-4.26-11.74-4.26h-41.5v91h19v-33l11.58.92,18.92,32.08h21.5l-20.99-35.44c19.78-8.94,22.88-40.88,3.23-51.3ZM355.77,157.91c-1.32,4.05-6.98,7.97-11.02,7.97h-15.5v-27c5.36.62,12.39-.85,17.5,0,9.11,1.51,11.57,11.21,9.02,19.03Z"/>
|
|
99
|
+
<path d="M777.02,179.61c-3.95-19.44-32.26-17.78-42.74-26.26-5.4-4.37-4.24-12.34,1.69-15.23,9.47-4.61,20.58,1.49,27.6,7.63l12.65-9.36c-10.04-12.51-23.17-17.41-39.22-15.24-28.56,3.86-35.71,38.53-7.02,50.5,9.33,3.89,33.09,5.53,28.6,20.07-3.99,12.93-29.66,6.57-35.83-2.65l-12.44,11.18c19.81,25.44,74.88,19.65,66.7-20.64Z"/>
|
|
100
|
+
<path d="M267.5,198.64c-41.37,7.02-43.83-58.8-9.75-61.75,10.54-.91,17.28,3.56,24.13,10.88l14.35-7.92c-9.32-19.99-38.11-23.5-56.51-14.99-32.89,15.21-33.7,69.52-.86,85.89,19.28,9.61,48.03,5.78,58.38-14.86l-12.64-7.94c-5.5,3.74-10.09,9.5-17.1,10.69Z"/>
|
|
101
|
+
<path d="M433.4,44.09l21.29,35.46c2.72,2.8,9.85,1.78,13.55,1.07l22.47-37.65v59.55h21.35V4.76l-20.8,1.11-27.53,50.58-29.76-51.69h-20.79v97.76h20.23v-58.43Z"/>
|
|
102
|
+
<path d="M306.43,48.58h-42.7v16.85h21.35c-.27,13.22-7.04,21.88-20.74,22.52-41.54,1.94-38.23-76.19,5.07-66.97,7.84,1.67,10.69,7.85,16.21,11.88l15.05-8.01c-.07-9-13.02-17.18-20.95-19.79-43.1-14.17-73.97,23.73-63.98,65.1,11.75,48.67,85.6,47.68,90.69-4.17.54-5.55-.39-11.78,0-17.42Z"/>
|
|
103
|
+
<path d="M340.09,81.68l33.82-.02,6.67,20.85h23.6L368.81,5.87c-1.88-2.26-20.12-1.02-24.2-.56l-34.81,97.22h23.6l6.7-20.83ZM356.43,29.47l10.67,34.84h-21.35l10.67-34.84Z"/>
|
|
104
|
+
<polygon points="590.71 84.54 551.39 84.54 551.39 60.94 585.1 60.94 585.1 42.96 551.39 42.96 551.39 22.74 588.47 22.74 588.47 4.76 530.04 4.76 530.04 102.52 590.71 102.52 590.71 84.54"/>
|
|
105
|
+
<path d="M608.77,97.39c25.08,16.57,67.45,5.44,61.46-30-1.89-11.15-12.36-17.09-21.93-20.77-7.64-2.94-35.54-8.52-22.36-22.37,8.09-8.51,23.15-1.69,30.32,5.07,2.52-1.37,13.45-9.1,13.04-11.48-14.3-20.97-60.08-20.5-65.72,7.08-2.89,14.13,1.82,25,14.48,31.72,10.24,5.44,38.71,7.15,31.37,24.24-3.47,8.09-18.1,7.13-25,4.22-4.16-1.76-9.85-8.71-12.66-8.29-2.01.3-13.33,8.46-13.03,10.32.38,2.39,7.73,8.73,10.04,10.25Z"/>
|
|
106
|
+
</g>
|
|
107
|
+
<g>
|
|
108
|
+
<path fill="#3c63e7" d="M735,55.98c-24.25,4.14-27.28,47.44,1.59,47.65,31.23.23,35.57-53.99-1.59-47.65ZM734.29,92.39c-9.51-2.94-5.29-24.14,2.49-26.5,16.88-5.12,14.38,31.73-2.49,26.5Z"/>
|
|
109
|
+
<path fill="#3c63e7" d="M716.28,56.67c-3.34-.27-7.15.39-10.41,0-1.21-.14-1.64.47-1.24-1.25,1.77-7.6,5.49-10.69,13.44-7.79l.86-10.79c-14.12-3.91-26.67,3.85-26.53,18.98l-8.25,1.69-1.3,9.08,8.13.02-3.61,36.13,12.26-.85,4.05-35.24h11.1c1.99-.47,1.49-8.28,1.51-9.99Z"/>
|
|
110
|
+
<path fill="#3c63e7" d="M796.72,56.17c-6.86-1.78-12.48,2-15.87,7.73l.45-7.22h-11.74s-4.51,46.06-4.51,46.06h12.65c2.16-13.01-1.47-38.8,18.96-34.32-.94-2.92,2.45-10.57.06-12.25Z"/>
|
|
111
|
+
</g>
|
|
112
|
+
</svg>
|
|
113
|
+
<p class="km-powered">Powered by Kokimoki</p>
|
|
114
|
+
</a>`;
|
|
115
|
+
/**
|
|
116
|
+
* Removes any existing km-loading elements from HTML
|
|
117
|
+
*/
|
|
118
|
+
function removeExistingLoadingScreen(html) {
|
|
119
|
+
return html
|
|
120
|
+
.replace(/<div[^>]*id=["']km-loading["'][^>]*>[\s\S]*?<\/div>/gi, "")
|
|
121
|
+
.replace(/<style[^>]*id=["']km-loading-style["'][^>]*>[\s\S]*?<\/style>/gi, "");
|
|
122
|
+
}
|
|
123
|
+
exports.removeExistingLoadingScreen = removeExistingLoadingScreen;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
/**
|
|
3
|
+
* Reserved store name for the App Meta store.
|
|
4
|
+
* Stores with the `__km/` prefix are reserved for SDK internal use.
|
|
5
|
+
*/
|
|
6
|
+
export declare const APP_META_STORE_NAME = "__km/app-meta";
|
|
7
|
+
/**
|
|
8
|
+
* Schema for the App Meta store.
|
|
9
|
+
* Used by the server to inject meta tags into the HTML response.
|
|
10
|
+
*
|
|
11
|
+
* All fields are optional - missing fields will fall back to defaults in index.html.
|
|
12
|
+
*/
|
|
13
|
+
export declare const appMetaStoreSchema: z.ZodObject<{
|
|
14
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
15
|
+
title: z.ZodOptional<z.ZodString>;
|
|
16
|
+
description: z.ZodOptional<z.ZodString>;
|
|
17
|
+
ogTitle: z.ZodOptional<z.ZodString>;
|
|
18
|
+
ogDescription: z.ZodOptional<z.ZodString>;
|
|
19
|
+
ogImage: z.ZodOptional<z.ZodString>;
|
|
20
|
+
favicon: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type AppMetaState = z.infer<typeof appMetaStoreSchema>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.appMetaStoreSchema = exports.APP_META_STORE_NAME = void 0;
|
|
4
|
+
const v4_1 = require("zod/v4");
|
|
5
|
+
/**
|
|
6
|
+
* Reserved store name for the App Meta store.
|
|
7
|
+
* Stores with the `__km/` prefix are reserved for SDK internal use.
|
|
8
|
+
*/
|
|
9
|
+
exports.APP_META_STORE_NAME = "__km/app-meta";
|
|
10
|
+
/**
|
|
11
|
+
* Schema for the App Meta store.
|
|
12
|
+
* Used by the server to inject meta tags into the HTML response.
|
|
13
|
+
*
|
|
14
|
+
* All fields are optional - missing fields will fall back to defaults in index.html.
|
|
15
|
+
*/
|
|
16
|
+
exports.appMetaStoreSchema = v4_1.z.object({
|
|
17
|
+
/** HTML lang attribute (e.g., 'en', 'et', 'de') */
|
|
18
|
+
lang: v4_1.z.string().optional(),
|
|
19
|
+
/** Document title (browser tab) */
|
|
20
|
+
title: v4_1.z.string().optional(),
|
|
21
|
+
/** Meta description */
|
|
22
|
+
description: v4_1.z.string().optional(),
|
|
23
|
+
/** Open Graph title (defaults to title if not set) */
|
|
24
|
+
ogTitle: v4_1.z.string().optional(),
|
|
25
|
+
/** Open Graph description (defaults to description if not set) */
|
|
26
|
+
ogDescription: v4_1.z.string().optional(),
|
|
27
|
+
/** Open Graph image URL */
|
|
28
|
+
ogImage: v4_1.z.string().optional(),
|
|
29
|
+
/** Favicon URL */
|
|
30
|
+
favicon: v4_1.z.string().optional(),
|
|
31
|
+
});
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const KOKIMOKI_KIT_VERSION = "1.
|
|
1
|
+
export declare const KOKIMOKI_KIT_VERSION = "1.8.0";
|
package/dist/version.js
CHANGED