sibujs 4.5.0 → 4.6.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/dist/browser.cjs +309 -129
- package/dist/browser.d.cts +46 -14
- package/dist/browser.d.ts +46 -14
- package/dist/browser.js +8 -6
- package/dist/build.cjs +184 -72
- package/dist/build.js +15 -16
- package/dist/cdn.dev.global.js +12 -12
- package/dist/cdn.full.dev.global.js +11 -11
- package/dist/cdn.full.global.js +10 -10
- package/dist/cdn.global.js +12 -12
- package/dist/{chunk-IXKSNWV5.js → chunk-2INLLLMZ.js} +1 -1
- package/dist/chunk-3ISI6ACU.js +44 -0
- package/dist/{chunk-ONOHFDLG.js → chunk-47M47FOM.js} +3 -3
- package/dist/chunk-5HZXGZ6T.js +24 -0
- package/dist/{chunk-KKLW7YWL.js → chunk-5MT6SJ3P.js} +275 -144
- package/dist/{chunk-UGRX3S57.js → chunk-5Q4R7HCL.js} +12 -3
- package/dist/{chunk-S373NSMK.js → chunk-7GQCWFOE.js} +150 -59
- package/dist/{chunk-FTIR4QW2.js → chunk-7NCARGJW.js} +6 -8
- package/dist/{chunk-5DXA2J44.js → chunk-7XHATCIH.js} +5 -2
- package/dist/{chunk-VZKNK2V7.js → chunk-AIF3Z2T7.js} +296 -38
- package/dist/{chunk-4PMLNECI.js → chunk-BAAG6ZTI.js} +98 -29
- package/dist/{chunk-XZZOBQAY.js → chunk-D33YTSX5.js} +2 -2
- package/dist/{chunk-TBYTO6BS.js → chunk-DKGBBKOF.js} +136 -80
- package/dist/{chunk-NIOYEGBQ.js → chunk-HURREPU2.js} +27 -13
- package/dist/{chunk-GW3SCCZG.js → chunk-HYXDKS4N.js} +153 -110
- package/dist/chunk-J6FW5TV6.js +233 -0
- package/dist/{chunk-PCT43HW3.js → chunk-JSXPZCET.js} +1 -1
- package/dist/chunk-NYNYSPK7.js +318 -0
- package/dist/{chunk-RJE2BNI4.js → chunk-ORMZXBKQ.js} +108 -45
- package/dist/{chunk-OMJJM3KM.js → chunk-OXUY2A6L.js} +287 -130
- package/dist/{chunk-3JZ4L5TJ.js → chunk-PK6FK2G2.js} +181 -66
- package/dist/{chunk-RBTPLM32.js → chunk-QE4TTDU3.js} +2 -2
- package/dist/{chunk-2DCGACUU.js → chunk-SXXVZMKZ.js} +251 -66
- package/dist/{chunk-R25EFXXC.js → chunk-TUCPL2HB.js} +3 -3
- package/dist/{chunk-7LN645I6.js → chunk-UZQ6ALFS.js} +3 -3
- package/dist/{chunk-KEISJXBU.js → chunk-VVWPJ543.js} +6 -8
- package/dist/{chunk-RIXRAYIU.js → chunk-XC4MEKGA.js} +3 -3
- package/dist/{chunk-B3WHI2QA.js → chunk-XRRZKZYX.js} +55 -31
- package/dist/{contracts-DBdg9J_a.d.cts → contracts-DRIuclVT.d.cts} +10 -2
- package/dist/{contracts-DBdg9J_a.d.ts → contracts-DRIuclVT.d.ts} +10 -2
- package/dist/{customElement-OB9CIsc5.d.cts → customElement-MmInOW1U.d.cts} +21 -0
- package/dist/{customElement-OB9CIsc5.d.ts → customElement-MmInOW1U.d.ts} +21 -0
- package/dist/data.cjs +213 -117
- package/dist/data.d.cts +47 -9
- package/dist/data.d.ts +47 -9
- package/dist/data.js +12 -9
- package/dist/devtools.cjs +81 -57
- package/dist/devtools.js +7 -8
- package/dist/dispose-GEIG2KOF.js +28 -0
- package/dist/ecosystem.cjs +309 -104
- package/dist/ecosystem.d.cts +19 -3
- package/dist/ecosystem.d.ts +19 -3
- package/dist/ecosystem.js +12 -12
- package/dist/extras.cjs +2133 -863
- package/dist/extras.d.cts +10 -9
- package/dist/extras.d.ts +10 -9
- package/dist/extras.js +39 -28
- package/dist/index.cjs +184 -72
- package/dist/index.d.cts +22 -5
- package/dist/index.d.ts +22 -5
- package/dist/index.js +24 -27
- package/dist/motion.cjs +107 -41
- package/dist/motion.js +5 -5
- package/dist/patterns.cjs +317 -39
- package/dist/patterns.d.cts +27 -9
- package/dist/patterns.d.ts +27 -9
- package/dist/patterns.js +8 -8
- package/dist/performance.cjs +308 -216
- package/dist/performance.d.cts +2 -2
- package/dist/performance.d.ts +2 -2
- package/dist/performance.js +8 -9
- package/dist/plugin-DVgSnTfK.d.cts +112 -0
- package/dist/plugin-DVgSnTfK.d.ts +112 -0
- package/dist/plugins.cjs +549 -202
- package/dist/plugins.d.cts +3 -3
- package/dist/plugins.d.ts +3 -3
- package/dist/plugins.js +35 -23
- package/dist/signal-EotCj4hS.d.cts +110 -0
- package/dist/signal-EotCj4hS.d.ts +110 -0
- package/dist/{ssr-BiPRdZ6n.d.cts → ssr-Bli9XRW5.d.cts} +5 -0
- package/dist/{ssr-BiPRdZ6n.d.ts → ssr-Bli9XRW5.d.ts} +5 -0
- package/dist/{ssr-Y7XOEPEN.js → ssr-XOTUASDO.js} +4 -5
- package/dist/ssr.cjs +176 -72
- package/dist/ssr.d.cts +9 -3
- package/dist/ssr.d.ts +9 -3
- package/dist/ssr.js +11 -12
- package/dist/{startup-BMpaiMhP.d.ts → startup-BLfSeL15.d.cts} +73 -22
- package/dist/{startup-BMpaiMhP.d.cts → startup-BLfSeL15.d.ts} +73 -22
- package/dist/{tagFactory-DVoDpHye.d.ts → tagFactory-DFstCLQV.d.cts} +2 -100
- package/dist/{tagFactory-DVoDpHye.d.cts → tagFactory-DkaNVUNV.d.ts} +2 -100
- package/dist/testing.cjs +2484 -2185
- package/dist/testing.d.cts +56 -5
- package/dist/testing.d.ts +56 -5
- package/dist/testing.js +580 -307
- package/dist/ui.cjs +707 -317
- package/dist/ui.d.cts +40 -7
- package/dist/ui.d.ts +40 -7
- package/dist/ui.js +151 -56
- package/dist/widgets.cjs +246 -278
- package/dist/widgets.js +9 -10
- package/package.json +1 -1
- package/dist/chunk-2WLZ6757.js +0 -149
- package/dist/chunk-CCSJMTRN.js +0 -15
- package/dist/chunk-QKRPLZ2V.js +0 -108
- package/dist/chunk-VUF4ALSW.js +0 -60
- package/dist/chunk-WWV3SJ3L.js +0 -131
- package/dist/dispose-46BOMMQJ.js +0 -19
- package/dist/plugin-D30wlGW5.d.cts +0 -71
- package/dist/plugin-D30wlGW5.d.ts +0 -71
package/dist/performance.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TrustedHTML } from './ssr-
|
|
2
|
-
export { t as trustHTML } from './ssr-
|
|
1
|
+
import { T as TrustedHTML } from './ssr-Bli9XRW5.cjs';
|
|
2
|
+
export { t as trustHTML } from './ssr-Bli9XRW5.cjs';
|
|
3
3
|
|
|
4
4
|
declare const Priority: {
|
|
5
5
|
readonly IMMEDIATE: 0;
|
package/dist/performance.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TrustedHTML } from './ssr-
|
|
2
|
-
export { t as trustHTML } from './ssr-
|
|
1
|
+
import { T as TrustedHTML } from './ssr-Bli9XRW5.js';
|
|
2
|
+
export { t as trustHTML } from './ssr-Bli9XRW5.js';
|
|
3
3
|
|
|
4
4
|
declare const Priority: {
|
|
5
5
|
readonly IMMEDIATE: 0;
|
package/dist/performance.js
CHANGED
|
@@ -33,18 +33,17 @@ import {
|
|
|
33
33
|
transitionState,
|
|
34
34
|
uniqueId,
|
|
35
35
|
yieldToMain
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-DKGBBKOF.js";
|
|
37
37
|
import {
|
|
38
38
|
trustHTML
|
|
39
|
-
} from "./chunk-
|
|
40
|
-
import "./chunk-
|
|
39
|
+
} from "./chunk-HURREPU2.js";
|
|
40
|
+
import "./chunk-2INLLLMZ.js";
|
|
41
41
|
import "./chunk-7ZHH77QA.js";
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-2WLZ6757.js";
|
|
42
|
+
import "./chunk-XC4MEKGA.js";
|
|
43
|
+
import "./chunk-7XHATCIH.js";
|
|
44
|
+
import "./chunk-D33YTSX5.js";
|
|
45
|
+
import "./chunk-5Q4R7HCL.js";
|
|
46
|
+
import "./chunk-NYNYSPK7.js";
|
|
48
47
|
export {
|
|
49
48
|
DOMPool,
|
|
50
49
|
Features,
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
interface PluginContext {
|
|
2
|
+
/** Register a global hook */
|
|
3
|
+
onInit: (callback: () => void) => void;
|
|
4
|
+
onMount: (callback: (element: HTMLElement) => void) => void;
|
|
5
|
+
onUnmount: (callback: (element: HTMLElement) => void) => void;
|
|
6
|
+
onError: (callback: (error: Error) => void) => void;
|
|
7
|
+
/** Provide a value globally */
|
|
8
|
+
provide: (key: string, value: unknown) => void;
|
|
9
|
+
}
|
|
10
|
+
interface SibuPlugin {
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* Register hooks and providers. May be async: the plugin is committed only
|
|
14
|
+
* when the returned promise fulfils, and a rejection commits nothing and
|
|
15
|
+
* leaves the plugin installable again.
|
|
16
|
+
*/
|
|
17
|
+
install: (ctx: PluginContext, options?: unknown) => void | PromiseLike<void>;
|
|
18
|
+
}
|
|
19
|
+
interface PluginHooks {
|
|
20
|
+
init: Array<() => void>;
|
|
21
|
+
mount: Array<(element: HTMLElement) => void>;
|
|
22
|
+
unmount: Array<(element: HTMLElement) => void>;
|
|
23
|
+
error: Array<(error: Error) => void>;
|
|
24
|
+
}
|
|
25
|
+
/** Shared across duplicate copies of this module: see the class below. */
|
|
26
|
+
declare const CANCELLED_BRAND: unique symbol;
|
|
27
|
+
/**
|
|
28
|
+
* An installation that never took effect because `reset()` (or a newer install
|
|
29
|
+
* of the same name) invalidated it. Thrown by a synchronous install that reset
|
|
30
|
+
* its own registry, and the rejection of a cancelled async install — a
|
|
31
|
+
* deliberate cancellation, not a failure, so it is not reported as a runtime
|
|
32
|
+
* error.
|
|
33
|
+
*/
|
|
34
|
+
declare class PluginInstallCancelledError extends Error {
|
|
35
|
+
/** The plugin whose installation was cancelled. */
|
|
36
|
+
readonly pluginName: string;
|
|
37
|
+
/**
|
|
38
|
+
* Brand, not identity: the default registry is shared across duplicate copies
|
|
39
|
+
* of this module, so the error a caller receives may come from another copy's
|
|
40
|
+
* constructor. `instanceof` is taught to recognise the brand instead.
|
|
41
|
+
*/
|
|
42
|
+
readonly [CANCELLED_BRAND] = true;
|
|
43
|
+
constructor(pluginName: string);
|
|
44
|
+
static [Symbol.hasInstance](value: unknown): boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Whether `value` is a cancelled-installation error, from this copy of the
|
|
48
|
+
* module or any duplicate of it.
|
|
49
|
+
*/
|
|
50
|
+
declare function isPluginInstallCancelledError(value: unknown): value is PluginInstallCancelledError;
|
|
51
|
+
interface PluginRegistry {
|
|
52
|
+
readonly installedPlugins: Set<string>;
|
|
53
|
+
readonly hooks: PluginHooks;
|
|
54
|
+
readonly provided: Map<string, unknown>;
|
|
55
|
+
/**
|
|
56
|
+
* Install a plugin. Returns a promise for an async `install()` — awaited, it
|
|
57
|
+
* fulfils when the plugin is committed, rejects with the install failure, or
|
|
58
|
+
* rejects with {@link PluginInstallCancelledError} when `reset()` invalidated
|
|
59
|
+
* it; a synchronous install returns `undefined` and throws on failure.
|
|
60
|
+
*/
|
|
61
|
+
plugin: (p: SibuPlugin, options?: unknown) => void | Promise<void>;
|
|
62
|
+
inject: <T = unknown>(key: string, defaultValue?: T) => T;
|
|
63
|
+
triggerMount: (element: HTMLElement) => void;
|
|
64
|
+
triggerUnmount: (element: HTMLElement) => void;
|
|
65
|
+
triggerError: (error: Error) => void;
|
|
66
|
+
reset: () => void;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Create an isolated plugin registry. Useful for tests, SSR per-request
|
|
70
|
+
* isolation, or embedding multiple independent SibuJS apps on one page.
|
|
71
|
+
*/
|
|
72
|
+
declare function createPluginRegistry(): PluginRegistry;
|
|
73
|
+
/**
|
|
74
|
+
* Creates a plugin definition.
|
|
75
|
+
*/
|
|
76
|
+
declare function createPlugin(name: string, install: (ctx: PluginContext, options?: unknown) => void | PromiseLike<void>): SibuPlugin;
|
|
77
|
+
/**
|
|
78
|
+
* Installs a plugin into the default (singleton) registry.
|
|
79
|
+
*
|
|
80
|
+
* Returns the installation's completion promise when `install()` is async —
|
|
81
|
+
* await it to know the plugin is ready, or to catch a failed installation — and
|
|
82
|
+
* `undefined` for a synchronous install (which throws on failure).
|
|
83
|
+
*/
|
|
84
|
+
declare function plugin(plugin: SibuPlugin, options?: unknown): void | Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Retrieve a value provided by a plugin (from the default registry).
|
|
87
|
+
*/
|
|
88
|
+
declare function inject<T = unknown>(key: string, defaultValue?: T): T;
|
|
89
|
+
/**
|
|
90
|
+
* Trigger mount hooks for an element (default registry).
|
|
91
|
+
*/
|
|
92
|
+
declare function triggerPluginMount(element: HTMLElement): void;
|
|
93
|
+
/**
|
|
94
|
+
* Trigger unmount hooks for an element (default registry).
|
|
95
|
+
*/
|
|
96
|
+
declare function triggerPluginUnmount(element: HTMLElement): void;
|
|
97
|
+
/**
|
|
98
|
+
* Trigger error hooks (default registry).
|
|
99
|
+
*/
|
|
100
|
+
declare function triggerPluginError(error: Error): void;
|
|
101
|
+
/**
|
|
102
|
+
* Reset the default plugin registry (useful for testing).
|
|
103
|
+
*/
|
|
104
|
+
declare function resetPlugins(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Replace the default registry with an isolated one. Emits a dev warning
|
|
107
|
+
* if the default singleton already had plugins installed (to surface
|
|
108
|
+
* accidental interleaving of singleton + registry use).
|
|
109
|
+
*/
|
|
110
|
+
declare function setDefaultPluginRegistry(registry: PluginRegistry): void;
|
|
111
|
+
|
|
112
|
+
export { type PluginContext as P, type SibuPlugin as S, PluginInstallCancelledError as a, type PluginRegistry as b, createPlugin as c, createPluginRegistry as d, isPluginInstallCancelledError as e, triggerPluginMount as f, triggerPluginUnmount as g, inject as i, plugin as p, resetPlugins as r, setDefaultPluginRegistry as s, triggerPluginError as t };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
interface PluginContext {
|
|
2
|
+
/** Register a global hook */
|
|
3
|
+
onInit: (callback: () => void) => void;
|
|
4
|
+
onMount: (callback: (element: HTMLElement) => void) => void;
|
|
5
|
+
onUnmount: (callback: (element: HTMLElement) => void) => void;
|
|
6
|
+
onError: (callback: (error: Error) => void) => void;
|
|
7
|
+
/** Provide a value globally */
|
|
8
|
+
provide: (key: string, value: unknown) => void;
|
|
9
|
+
}
|
|
10
|
+
interface SibuPlugin {
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* Register hooks and providers. May be async: the plugin is committed only
|
|
14
|
+
* when the returned promise fulfils, and a rejection commits nothing and
|
|
15
|
+
* leaves the plugin installable again.
|
|
16
|
+
*/
|
|
17
|
+
install: (ctx: PluginContext, options?: unknown) => void | PromiseLike<void>;
|
|
18
|
+
}
|
|
19
|
+
interface PluginHooks {
|
|
20
|
+
init: Array<() => void>;
|
|
21
|
+
mount: Array<(element: HTMLElement) => void>;
|
|
22
|
+
unmount: Array<(element: HTMLElement) => void>;
|
|
23
|
+
error: Array<(error: Error) => void>;
|
|
24
|
+
}
|
|
25
|
+
/** Shared across duplicate copies of this module: see the class below. */
|
|
26
|
+
declare const CANCELLED_BRAND: unique symbol;
|
|
27
|
+
/**
|
|
28
|
+
* An installation that never took effect because `reset()` (or a newer install
|
|
29
|
+
* of the same name) invalidated it. Thrown by a synchronous install that reset
|
|
30
|
+
* its own registry, and the rejection of a cancelled async install — a
|
|
31
|
+
* deliberate cancellation, not a failure, so it is not reported as a runtime
|
|
32
|
+
* error.
|
|
33
|
+
*/
|
|
34
|
+
declare class PluginInstallCancelledError extends Error {
|
|
35
|
+
/** The plugin whose installation was cancelled. */
|
|
36
|
+
readonly pluginName: string;
|
|
37
|
+
/**
|
|
38
|
+
* Brand, not identity: the default registry is shared across duplicate copies
|
|
39
|
+
* of this module, so the error a caller receives may come from another copy's
|
|
40
|
+
* constructor. `instanceof` is taught to recognise the brand instead.
|
|
41
|
+
*/
|
|
42
|
+
readonly [CANCELLED_BRAND] = true;
|
|
43
|
+
constructor(pluginName: string);
|
|
44
|
+
static [Symbol.hasInstance](value: unknown): boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Whether `value` is a cancelled-installation error, from this copy of the
|
|
48
|
+
* module or any duplicate of it.
|
|
49
|
+
*/
|
|
50
|
+
declare function isPluginInstallCancelledError(value: unknown): value is PluginInstallCancelledError;
|
|
51
|
+
interface PluginRegistry {
|
|
52
|
+
readonly installedPlugins: Set<string>;
|
|
53
|
+
readonly hooks: PluginHooks;
|
|
54
|
+
readonly provided: Map<string, unknown>;
|
|
55
|
+
/**
|
|
56
|
+
* Install a plugin. Returns a promise for an async `install()` — awaited, it
|
|
57
|
+
* fulfils when the plugin is committed, rejects with the install failure, or
|
|
58
|
+
* rejects with {@link PluginInstallCancelledError} when `reset()` invalidated
|
|
59
|
+
* it; a synchronous install returns `undefined` and throws on failure.
|
|
60
|
+
*/
|
|
61
|
+
plugin: (p: SibuPlugin, options?: unknown) => void | Promise<void>;
|
|
62
|
+
inject: <T = unknown>(key: string, defaultValue?: T) => T;
|
|
63
|
+
triggerMount: (element: HTMLElement) => void;
|
|
64
|
+
triggerUnmount: (element: HTMLElement) => void;
|
|
65
|
+
triggerError: (error: Error) => void;
|
|
66
|
+
reset: () => void;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Create an isolated plugin registry. Useful for tests, SSR per-request
|
|
70
|
+
* isolation, or embedding multiple independent SibuJS apps on one page.
|
|
71
|
+
*/
|
|
72
|
+
declare function createPluginRegistry(): PluginRegistry;
|
|
73
|
+
/**
|
|
74
|
+
* Creates a plugin definition.
|
|
75
|
+
*/
|
|
76
|
+
declare function createPlugin(name: string, install: (ctx: PluginContext, options?: unknown) => void | PromiseLike<void>): SibuPlugin;
|
|
77
|
+
/**
|
|
78
|
+
* Installs a plugin into the default (singleton) registry.
|
|
79
|
+
*
|
|
80
|
+
* Returns the installation's completion promise when `install()` is async —
|
|
81
|
+
* await it to know the plugin is ready, or to catch a failed installation — and
|
|
82
|
+
* `undefined` for a synchronous install (which throws on failure).
|
|
83
|
+
*/
|
|
84
|
+
declare function plugin(plugin: SibuPlugin, options?: unknown): void | Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Retrieve a value provided by a plugin (from the default registry).
|
|
87
|
+
*/
|
|
88
|
+
declare function inject<T = unknown>(key: string, defaultValue?: T): T;
|
|
89
|
+
/**
|
|
90
|
+
* Trigger mount hooks for an element (default registry).
|
|
91
|
+
*/
|
|
92
|
+
declare function triggerPluginMount(element: HTMLElement): void;
|
|
93
|
+
/**
|
|
94
|
+
* Trigger unmount hooks for an element (default registry).
|
|
95
|
+
*/
|
|
96
|
+
declare function triggerPluginUnmount(element: HTMLElement): void;
|
|
97
|
+
/**
|
|
98
|
+
* Trigger error hooks (default registry).
|
|
99
|
+
*/
|
|
100
|
+
declare function triggerPluginError(error: Error): void;
|
|
101
|
+
/**
|
|
102
|
+
* Reset the default plugin registry (useful for testing).
|
|
103
|
+
*/
|
|
104
|
+
declare function resetPlugins(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Replace the default registry with an isolated one. Emits a dev warning
|
|
107
|
+
* if the default singleton already had plugins installed (to surface
|
|
108
|
+
* accidental interleaving of singleton + registry use).
|
|
109
|
+
*/
|
|
110
|
+
declare function setDefaultPluginRegistry(registry: PluginRegistry): void;
|
|
111
|
+
|
|
112
|
+
export { type PluginContext as P, type SibuPlugin as S, PluginInstallCancelledError as a, type PluginRegistry as b, createPlugin as c, createPluginRegistry as d, isPluginInstallCancelledError as e, triggerPluginMount as f, triggerPluginUnmount as g, inject as i, plugin as p, resetPlugins as r, setDefaultPluginRegistry as s, triggerPluginError as t };
|