@simai-studio/ui 5.20261019.1827 → 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.
Files changed (37) hide show
  1. package/README.md +4 -4
  2. package/distr/component/country-code/js/country-code.min.js +1 -1
  3. package/distr/component/dropdown/js/dropdown.min.js +1 -1
  4. package/distr/component/file-upload/js/file-upload.min.js +1 -1
  5. package/distr/component/inputs/js/inputs.min.js +1 -1
  6. package/distr/component/pagination/css/pagination.min.css +1 -1
  7. package/distr/component/quantity/js/quantity.min.js +1 -1
  8. package/distr/component/textarea/js/textarea.min.js +1 -1
  9. package/distr/core/contracts/adaptive-sizing.schema.json +1 -1
  10. package/distr/core/contracts/composite-host-port.v1.schema.json +1 -1
  11. package/distr/core/contracts/composition-document.v1.schema.json +1 -1
  12. package/distr/core/contracts/composition-editor-field-kind.v1.schema.json +1 -1
  13. package/distr/core/contracts/composition-editor-manifest.v1.schema.json +1 -1
  14. package/distr/core/contracts/composition-port-manifest.v1.schema.json +1 -1
  15. package/distr/core/contracts/composition-type-manifest.v1.schema.json +1 -1
  16. package/distr/core/js/core-loader.js +12 -10
  17. package/distr/core/js/core-loader.min.js +1 -1
  18. package/distr/core/js/core.js +42 -17
  19. package/distr/core/js/core.min.js +1 -1
  20. package/distr/core/js/smart-base.js +2 -2
  21. package/distr/core/js/smart-base.min.js +1 -1
  22. package/distr/smart/avatar/js/avatar.min.js +1 -1
  23. package/distr/smart/badges/js/badges.min.js +1 -1
  24. package/distr/smart/buttons/js/buttons.min.js +1 -1
  25. package/distr/smart/country-code/js/country-code.min.js +1 -1
  26. package/distr/smart/datepicker/js/datepicker.min.js +1 -1
  27. package/distr/smart/dropdown/js/dropdown.min.js +1 -1
  28. package/distr/smart/file-upload/js/file-upload.min.js +1 -1
  29. package/distr/smart/inputs/js/inputs.min.js +1 -1
  30. package/distr/smart/list-item/js/list-item.min.js +16 -16
  31. package/distr/smart/modal/contract.json +1 -1
  32. package/distr/smart/progress-scale/js/progress-scale.min.js +1 -1
  33. package/distr/smart/reference-link/js/reference-link.min.js +1 -1
  34. package/distr/smart/tags/js/tags.min.js +1 -1
  35. package/distr/smart/textarea/js/textarea.min.js +5 -5
  36. package/package-manifest.json +37 -37
  37. package/package.json +4 -4
@@ -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?.(`[Simai Framework] ${where}${what} is a legacy name${to ? `; write ${to}` : ''}. See contracts/changes/journal.json.`);
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() {
@@ -4131,18 +4131,51 @@ function startPreloaderMotion(container, isActive = () => true, options = {}) {
4131
4131
  /* global __webpack_public_path__: writable */
4132
4132
  (() => {
4133
4133
  const cdnDefault = 'https://cdn.jsdelivr.net/gh/simai/ui@main/distr/';
4134
- if (typeof window === 'undefined') return; // A page that never set sfPath used to fall back here in silence, and the
4135
- // fallback is an unpinned branch: the project then serves whatever sits on
4136
- // main today instead of the build it shipped, and nothing on screen says so.
4137
- // The fallback stays — a page with no configuration still has to run — but it
4138
- // says out loud what it just did and what to write instead.
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
+
4139
4173
 
4140
4174
  if (!window.sfPath) {
4141
4175
  window.sfPath = cdnDefault;
4142
4176
 
4143
4177
  try {
4144
- console.warn('SIMAI Framework: window.sfPath is not set, so the runtime is loading ' + `from ${cdnDefault} — an unpinned branch that changes without notice. ` + 'Set window.sfPath to your own copy of distr/, before core.js, ' // A release is a commit of simai/ui (ui-<12 hex>); there are no tags.
4145
- + '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/ .');
4146
4179
  } catch {
4147
4180
  /* A console is not something a runtime may insist on. */
4148
4181
  }
@@ -4172,15 +4205,7 @@ function startPreloaderMotion(container, isActive = () => true, options = {}) {
4172
4205
  }
4173
4206
 
4174
4207
  const configuredCoreRoot = frameworkRoot.pathname.endsWith('/core/') ? frameworkRoot : new URL('core/', frameworkRoot);
4175
- const coreScript = typeof document === 'undefined' ? null : Array.from(document.scripts).reverse().find(script => {
4176
- if (!script.src) return false;
4177
-
4178
- try {
4179
- return /\/core\/js\/core(?:\.min)?\.js$/.test(new URL(script.src, document.baseURI).pathname);
4180
- } catch {
4181
- return false;
4182
- }
4183
- });
4208
+ const coreScript = ownScript;
4184
4209
  const coreRoot = coreScript ? new URL('../', new URL(coreScript.src, document.baseURI)) : configuredCoreRoot;
4185
4210
 
4186
4211
  if (__webpack_require__.p !== coreRoot.href) {