@simai-studio/ui 5.20261019.1710 → 5.20261019.1921
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 +4 -4
- package/distr/component/button-group/css/button-group.min.css +1 -1
- package/distr/component/country-code/js/country-code.min.js +1 -1
- package/distr/component/dropdown/js/dropdown.min.js +1 -1
- package/distr/component/file-upload/js/file-upload.min.js +1 -1
- package/distr/component/inputs/js/inputs.min.js +1 -1
- package/distr/component/pagination/css/pagination.min.css +1 -1
- package/distr/component/quantity/js/quantity.min.js +1 -1
- package/distr/component/textarea/js/textarea.min.js +1 -1
- package/distr/core/contracts/adaptive-sizing.schema.json +1 -1
- package/distr/core/contracts/composite-host-port.v1.schema.json +1 -1
- package/distr/core/contracts/composition-document.v1.schema.json +1 -1
- package/distr/core/contracts/composition-editor-field-kind.v1.schema.json +1 -1
- package/distr/core/contracts/composition-editor-manifest.v1.schema.json +1 -1
- package/distr/core/contracts/composition-port-manifest.v1.schema.json +1 -1
- package/distr/core/contracts/composition-type-manifest.v1.schema.json +1 -1
- package/distr/core/contracts/public-js-api.json +1 -0
- package/distr/core/contracts/public-variables.v1.json +11 -0
- package/distr/core/css/core.css +11 -0
- package/distr/core/css/core.min.css +1 -1
- package/distr/core/js/core-loader.js +13 -11
- package/distr/core/js/core-loader.min.js +1 -1
- package/distr/core/js/core.js +75 -24
- package/distr/core/js/core.min.js +2 -2
- package/distr/core/js/smart-base.js +2 -2
- package/distr/core/js/smart-base.min.js +1 -1
- package/distr/core/js/template-utilities.generated.json +1 -0
- package/distr/smart/avatar/js/avatar.min.js +1 -1
- package/distr/smart/badges/js/badges.min.js +1 -1
- package/distr/smart/button-group/js/button-group.min.js +22 -21
- package/distr/smart/button-group/smart.manifest.json +22 -1
- package/distr/smart/button-group/template/default.js +4 -0
- package/distr/smart/buttons/js/buttons.min.js +1 -1
- package/distr/smart/country-code/js/country-code.min.js +1 -1
- package/distr/smart/datepicker/js/datepicker.min.js +1 -1
- package/distr/smart/dropdown/js/dropdown.min.js +1 -1
- package/distr/smart/file-upload/js/file-upload.min.js +1 -1
- package/distr/smart/inputs/js/inputs.min.js +1 -1
- package/distr/smart/list-item/js/list-item.min.js +16 -16
- package/distr/smart/modal/contract.json +1 -1
- package/distr/smart/progress-scale/js/progress-scale.min.js +1 -1
- package/distr/smart/reference-link/js/reference-link.min.js +1 -1
- package/distr/smart/tags/js/tags.min.js +1 -1
- package/distr/smart/textarea/js/textarea.min.js +5 -5
- package/package-manifest.json +46 -46
- package/package.json +4 -4
package/distr/core/js/core.js
CHANGED
|
@@ -71,7 +71,7 @@ function noteDeprecated({
|
|
|
71
71
|
if (warnEnabled()) {
|
|
72
72
|
const where = component ? `${component}: ` : '';
|
|
73
73
|
const what = kind === 'value' ? `${attribute}="${from}"` : `${kind} ${from}`;
|
|
74
|
-
globalThis.console?.warn?.(`[
|
|
74
|
+
globalThis.console?.warn?.(`[SIMAI Framework] ${where}${what} is a legacy name${to ? `; write ${to}` : ''}. See contracts/changes/journal.json.`);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
function listDeprecations() {
|
|
@@ -99,6 +99,7 @@ if (typeof globalThis !== 'undefined') {
|
|
|
99
99
|
"use strict";
|
|
100
100
|
__webpack_require__.r(__webpack_exports__);
|
|
101
101
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
102
|
+
/* harmony export */ EFFECT_FORMAT: () => (/* binding */ EFFECT_FORMAT),
|
|
102
103
|
/* harmony export */ EFFECT_SCHEMA: () => (/* binding */ EFFECT_SCHEMA),
|
|
103
104
|
/* harmony export */ FRAME_RUNNER: () => (/* binding */ FRAME_RUNNER),
|
|
104
105
|
/* harmony export */ FRAME_RUNNER_SHA256: () => (/* binding */ FRAME_RUNNER_SHA256),
|
|
@@ -117,6 +118,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
117
118
|
/* harmony export */ resolveTheme: () => (/* binding */ resolveTheme)
|
|
118
119
|
/* harmony export */ });
|
|
119
120
|
/* harmony import */ var _composition_schema_name_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ac24888e7d3e");
|
|
121
|
+
/* harmony import */ var _deprecations_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("06e8cd089f28");
|
|
120
122
|
// Background effects (simai.effect 1.1.0; Larena's design of 2026-10-14,
|
|
121
123
|
// larena-specs docs/architecture/2026-10-14-background-effects.md). An effect
|
|
122
124
|
// is an animated background drawn into one area of a page; its manifest
|
|
@@ -145,8 +147,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
145
147
|
// it runs in a sandboxed frame of its own (an opaque origin under a strict
|
|
146
148
|
// content security policy, its checked settings sent by message), or, with
|
|
147
149
|
// SF_BOOT_CONFIG.effects.foreign = 'refuse', not at all.
|
|
148
|
-
|
|
149
|
-
//
|
|
150
|
+
|
|
151
|
+
// The fields a writer of an effect.json emits: the format named without a
|
|
152
|
+
// version, with schema_version beside it (format-names-without-version). A
|
|
153
|
+
// reader takes either form: schema-name.mjs.
|
|
154
|
+
|
|
155
|
+
const EFFECT_FORMAT = Object.freeze((0,_composition_schema_name_mjs__WEBPACK_IMPORTED_MODULE_0__.schemaFields)('simai.effect', 1)); // The older label of the same format, which readers still take until the
|
|
156
|
+
// journal retires it (global-effect-schema-constant). Its value stays: a
|
|
157
|
+
// writer that put it alone in "schema" would otherwise emit a name with no
|
|
158
|
+
// schema_version.
|
|
150
159
|
|
|
151
160
|
const EFFECT_SCHEMA = 'simai.effect.v1';
|
|
152
161
|
const SETTING_TYPES = new Set(['choice', 'integer', 'number', 'boolean', 'string', 'text', 'color', 'file']);
|
|
@@ -832,13 +841,19 @@ function resolveTheme(manifest, {
|
|
|
832
841
|
reason: themeMode === 'auto' ? 'light-only-on-dark' : 'mode-not-drawable'
|
|
833
842
|
});
|
|
834
843
|
} // The areas a placement draws under take the theme it is drawn in
|
|
835
|
-
// (area-takes-the-drawn-theme); what they had before comes back after.
|
|
844
|
+
// (area-takes-the-drawn-theme); what they had before comes back after. A
|
|
845
|
+
// theme class changes the tokens but not the ink the area inherited from the
|
|
846
|
+
// page, so an area also takes AREA_CLASS, which core's sheet gives the drawn
|
|
847
|
+
// theme's text colour (color: var(--sf-on-surface), in sf.base, so an
|
|
848
|
+
// author's colour utility on the area still wins).
|
|
849
|
+
|
|
850
|
+
const AREA_CLASS = 'sf-effect-area';
|
|
836
851
|
|
|
837
852
|
function themeAreas() {
|
|
838
853
|
const before = new Map();
|
|
839
854
|
|
|
840
855
|
const restore = (element, had) => {
|
|
841
|
-
element.classList.remove(...THEME_CLASSES);
|
|
856
|
+
element.classList.remove(...THEME_CLASSES, AREA_CLASS);
|
|
842
857
|
if (had.length) element.classList.add(...had);
|
|
843
858
|
};
|
|
844
859
|
|
|
@@ -847,7 +862,8 @@ function themeAreas() {
|
|
|
847
862
|
const wanted = `theme-${scheme}`;
|
|
848
863
|
|
|
849
864
|
for (const element of elements) {
|
|
850
|
-
if (!before.has(element)) before.set(element, THEME_CLASSES.filter(name => element.classList.contains(name)));
|
|
865
|
+
if (!before.has(element)) before.set(element, [...THEME_CLASSES, AREA_CLASS].filter(name => element.classList.contains(name)));
|
|
866
|
+
if (!element.classList.contains(AREA_CLASS)) element.classList.add(AREA_CLASS); // Touched only when it changes, so an observer of the class sees no churn.
|
|
851
867
|
|
|
852
868
|
const other = THEME_CLASSES.find(name => name !== wanted);
|
|
853
869
|
if (element.classList.contains(other)) element.classList.remove(other);
|
|
@@ -1930,8 +1946,18 @@ if (typeof window !== 'undefined') {
|
|
|
1930
1946
|
mountWindows,
|
|
1931
1947
|
loadEffect,
|
|
1932
1948
|
placeEffect,
|
|
1933
|
-
|
|
1934
|
-
SANDBOX_RUNNER_SHA256: FRAME_RUNNER_SHA256
|
|
1949
|
+
EFFECT_FORMAT,
|
|
1950
|
+
SANDBOX_RUNNER_SHA256: FRAME_RUNNER_SHA256,
|
|
1951
|
+
|
|
1952
|
+
get EFFECT_SCHEMA() {
|
|
1953
|
+
(0,_deprecations_js__WEBPACK_IMPORTED_MODULE_1__.noteDeprecated)({
|
|
1954
|
+
kind: 'global',
|
|
1955
|
+
from: 'SF.Effects.EFFECT_SCHEMA',
|
|
1956
|
+
to: 'SF.Effects.EFFECT_FORMAT'
|
|
1957
|
+
});
|
|
1958
|
+
return EFFECT_SCHEMA;
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1935
1961
|
});
|
|
1936
1962
|
|
|
1937
1963
|
if (typeof document !== 'undefined' && document.documentElement) {
|
|
@@ -4105,18 +4131,51 @@ function startPreloaderMotion(container, isActive = () => true, options = {}) {
|
|
|
4105
4131
|
/* global __webpack_public_path__: writable */
|
|
4106
4132
|
(() => {
|
|
4107
4133
|
const cdnDefault = 'https://cdn.jsdelivr.net/gh/simai/ui@main/distr/';
|
|
4108
|
-
if (typeof window === 'undefined') return; //
|
|
4109
|
-
//
|
|
4110
|
-
//
|
|
4111
|
-
//
|
|
4112
|
-
|
|
4134
|
+
if (typeof window === 'undefined') return; // The script that is running is Core itself: its URL names the distr/ it
|
|
4135
|
+
// came from. document.currentScript holds it while Core evaluates; failing
|
|
4136
|
+
// that (a module, a deferred evaluation), the last <script> whose path ends
|
|
4137
|
+
// in core/js/core.js or core/js/core.min.js stands in.
|
|
4138
|
+
|
|
4139
|
+
const corePath = /\/core\/js\/core(?:\.min)?\.js$/u;
|
|
4140
|
+
|
|
4141
|
+
const isCoreScript = script => {
|
|
4142
|
+
if (!script?.src) return false;
|
|
4143
|
+
|
|
4144
|
+
try {
|
|
4145
|
+
return corePath.test(new URL(script.src, document.baseURI).pathname);
|
|
4146
|
+
} catch {
|
|
4147
|
+
return false;
|
|
4148
|
+
}
|
|
4149
|
+
};
|
|
4150
|
+
|
|
4151
|
+
const findCoreScript = () => {
|
|
4152
|
+
if (typeof document === 'undefined') return null;
|
|
4153
|
+
if (isCoreScript(document.currentScript)) return document.currentScript;
|
|
4154
|
+
return Array.from(document.scripts || []).reverse().find(isCoreScript) || null;
|
|
4155
|
+
};
|
|
4156
|
+
|
|
4157
|
+
const ownScript = findCoreScript(); // A page that never set sfPath loads the rest of the runtime from where Core
|
|
4158
|
+
// itself came from: an npm-loaded core.js finds its siblings in the same
|
|
4159
|
+
// package version, a self-hosted one in the same copy.
|
|
4160
|
+
|
|
4161
|
+
if (!window.sfPath && ownScript) {
|
|
4162
|
+
try {
|
|
4163
|
+
window.sfPath = new URL('../../', new URL(ownScript.src, document.baseURI)).href;
|
|
4164
|
+
} catch {
|
|
4165
|
+
/* An unreadable script URL leaves the fallback below to speak. */
|
|
4166
|
+
}
|
|
4167
|
+
} // Without a Core script to read, the fallback is an unpinned branch: the
|
|
4168
|
+
// project then serves whatever sits on main today instead of the build it
|
|
4169
|
+
// shipped, and nothing on screen says so. The fallback stays — a page with no
|
|
4170
|
+
// configuration still has to run — but it says out loud what it just did and
|
|
4171
|
+
// what to write instead.
|
|
4172
|
+
|
|
4113
4173
|
|
|
4114
4174
|
if (!window.sfPath) {
|
|
4115
4175
|
window.sfPath = cdnDefault;
|
|
4116
4176
|
|
|
4117
4177
|
try {
|
|
4118
|
-
console.warn('SIMAI Framework: window.sfPath is not set, so the runtime is loading
|
|
4119
|
-
+ 'or to a released commit: https://cdn.jsdelivr.net/gh/simai/ui@<commit>/distr/ .');
|
|
4178
|
+
console.warn('SIMAI Framework: window.sfPath is not set and Core could not tell where ' + `it was loaded from, so the runtime is loading from ${cdnDefault} — an ` + 'unpinned branch that changes without notice. Set window.sfPath, before ' + 'core.js, to your own copy of distr/ or to a released package: ' + 'https://cdn.jsdelivr.net/npm/@simai-studio/ui@<version>/distr/ .');
|
|
4120
4179
|
} catch {
|
|
4121
4180
|
/* A console is not something a runtime may insist on. */
|
|
4122
4181
|
}
|
|
@@ -4146,15 +4205,7 @@ function startPreloaderMotion(container, isActive = () => true, options = {}) {
|
|
|
4146
4205
|
}
|
|
4147
4206
|
|
|
4148
4207
|
const configuredCoreRoot = frameworkRoot.pathname.endsWith('/core/') ? frameworkRoot : new URL('core/', frameworkRoot);
|
|
4149
|
-
const coreScript =
|
|
4150
|
-
if (!script.src) return false;
|
|
4151
|
-
|
|
4152
|
-
try {
|
|
4153
|
-
return /\/core\/js\/core(?:\.min)?\.js$/.test(new URL(script.src, document.baseURI).pathname);
|
|
4154
|
-
} catch {
|
|
4155
|
-
return false;
|
|
4156
|
-
}
|
|
4157
|
-
});
|
|
4208
|
+
const coreScript = ownScript;
|
|
4158
4209
|
const coreRoot = coreScript ? new URL('../', new URL(coreScript.src, document.baseURI)) : configuredCoreRoot;
|
|
4159
4210
|
|
|
4160
4211
|
if (__webpack_require__.p !== coreRoot.href) {
|