spell-ui 0.8.13 → 0.8.15

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/core.js CHANGED
@@ -3846,7 +3846,7 @@ var xa = L, Sa = "ui-", Ca = 3, wa = class DefaultValues {
3846
3846
  "textAlign",
3847
3847
  "verticalAlign",
3848
3848
  "multiple"
3849
- ], ka = /\s+/g, Aa = "0.8.13";
3849
+ ], ka = /\s+/g, Aa = "0.8.15";
3850
3850
  // ../src/util/fetching.ts
3851
3851
  async function fetchOk(e, t, n) {
3852
3852
  let r;
@@ -3932,7 +3932,7 @@ var Ha = "ui-languages-changed", Ua = {
3932
3932
  }, Wa;
3933
3933
  function load() {
3934
3934
  let e = pageRuntime();
3935
- return e ? e.load() : (Wa ??= import("./UIRuntime-BXutHphM.js").then(({ UIRuntime: e }) => e.instance.load(), (e) => {
3935
+ return e ? e.load() : (Wa ??= import("./UIRuntime-DCv4sy30.js").then(({ UIRuntime: e }) => e.instance.load(), (e) => {
3936
3936
  throw Wa = void 0, e;
3937
3937
  }), Wa);
3938
3938
  }
@@ -5,7 +5,8 @@ import { Disposer, ModalOptions, ModalProvider } from './runtime.types';
5
5
  * `$.modal('confirm', ...)` shortcuts.
6
6
  * - A thin front door: the `ui-modal` family registers its provider (`register()`) when it's imported, so the
7
7
  * runtime chunk carries no modal markup.
8
- * - Until then every method throws, rather than falling back to `window.confirm()` with different behaviour.
8
+ * - Until then every method throws, rather than falling back to `window.confirm()` with different behaviour;
9
+ * `await UI.modals.ready()` first imports the family on a page with a `<ui-root>` that hasn't (`loadFamilyWith()`).
9
10
  * - Strings accept plain text or options: `UI.modals.confirm("Delete?")`.
10
11
  ****************/
11
12
  export declare class Modals {
@@ -20,6 +21,16 @@ export declare class Modals {
20
21
  * runtime chunk (the barrel exports it as a type only).
21
22
  */
22
23
  register(provider: ModalProvider): Disposer;
24
+ /** How this page imports the `ui-modal` family: `loadFamilyWith()`. */
25
+ private familyLoader;
26
+ /** Say how to import the `ui-modal` family, for a page that doesn't define it up front: `RootLoader` does. */
27
+ loadFamilyWith(loader: () => Promise<unknown>): void;
28
+ /**
29
+ * Resolves once a dialog can show, importing the `ui-modal` family the first time it's needed (as `UI.toasts.ready()`).
30
+ * - for a component pack's element, which can't import the family itself (`PACK_MODULES`)
31
+ * - rejects if the family can't be imported; a page with no way to import it resolves, and a dialog says what's wrong
32
+ */
33
+ ready(): Promise<void>;
23
34
  /** Resolves `true` on approve, `false` on deny / dismiss. */
24
35
  confirm(options: ModalOptions | string): Promise<boolean>;
25
36
  /** Resolves once acknowledged. */
package/dist/ui-root.js CHANGED
@@ -2165,7 +2165,9 @@ var N = {
2165
2165
  "../ui-visibility/index.ts": () => import("./ui-visibility.js"),
2166
2166
  "../ui-zoom/index.ts": () => import("./ui-zoom.js")
2167
2167
  });
2168
- se() && l.load().then((e) => e.toasts.loadFamilyWith(() => F.load("ui-toast").then(() => l.load())));
2168
+ se() && l.load().then((e) => {
2169
+ e.toasts.loadFamilyWith(() => F.load("ui-toast").then(() => l.load())), e.modals.loadFamilyWith(() => F.load("ui-modal").then(() => l.load()));
2170
+ });
2169
2171
  var P = { es: () => import("./components.es-DilRG1VO.js").then(({ es: e }) => e) }, F = class RootLoader {
2170
2172
  static loads = new s();
2171
2173
  static added = /* @__PURE__ */ new Map();