@sprawlify/primitives 0.1.6 → 0.1.8
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-Bw_czdwX.cjs +383 -0
- package/dist/core-CTtbW9qh.mjs +288 -0
- package/dist/core.cjs +9 -1
- package/dist/core.d.cts +25 -2
- package/dist/core.d.mts +25 -2
- package/dist/core.mjs +2 -2
- package/dist/machines/accordion/index.cjs +1 -1
- package/dist/machines/accordion/index.d.cts +2 -2
- package/dist/machines/accordion/index.d.mts +2 -2
- package/dist/machines/accordion/index.mjs +1 -1
- package/dist/machines/angle-slider/index.cjs +1 -1
- package/dist/machines/angle-slider/index.d.cts +2 -2
- package/dist/machines/angle-slider/index.d.mts +2 -2
- package/dist/machines/angle-slider/index.mjs +1 -1
- package/dist/machines/aspect-ratio/index.cjs +1 -1
- package/dist/machines/aspect-ratio/index.d.cts +1 -1
- package/dist/machines/aspect-ratio/index.d.mts +1 -1
- package/dist/machines/aspect-ratio/index.mjs +1 -1
- package/dist/machines/async-list/index.cjs +1 -1
- package/dist/machines/async-list/index.d.cts +1 -1
- package/dist/machines/async-list/index.d.mts +1 -1
- package/dist/machines/async-list/index.mjs +1 -1
- package/dist/machines/avatar/index.cjs +1 -1
- package/dist/machines/avatar/index.d.cts +1 -1
- package/dist/machines/avatar/index.d.mts +1 -1
- package/dist/machines/avatar/index.mjs +1 -1
- package/dist/machines/carousel/index.cjs +69 -18
- package/dist/machines/carousel/index.d.cts +3 -3
- package/dist/machines/carousel/index.d.mts +3 -3
- package/dist/machines/carousel/index.mjs +69 -18
- package/dist/machines/cascade-select/index.cjs +1 -1
- package/dist/machines/cascade-select/index.d.cts +3 -3
- package/dist/machines/cascade-select/index.d.mts +3 -3
- package/dist/machines/cascade-select/index.mjs +1 -1
- package/dist/machines/checkbox/index.cjs +1 -1
- package/dist/machines/checkbox/index.d.cts +2 -2
- package/dist/machines/checkbox/index.d.mts +2 -2
- package/dist/machines/checkbox/index.mjs +1 -1
- package/dist/machines/clipboard/index.cjs +1 -1
- package/dist/machines/clipboard/index.d.cts +2 -2
- package/dist/machines/clipboard/index.d.mts +2 -2
- package/dist/machines/clipboard/index.mjs +1 -1
- package/dist/machines/collapsible/index.cjs +1 -1
- package/dist/machines/collapsible/index.d.cts +1 -1
- package/dist/machines/collapsible/index.d.mts +1 -1
- package/dist/machines/collapsible/index.mjs +1 -1
- package/dist/machines/color-picker/index.cjs +76 -102
- package/dist/machines/color-picker/index.d.cts +3 -3
- package/dist/machines/color-picker/index.d.mts +3 -3
- package/dist/machines/color-picker/index.mjs +76 -102
- package/dist/machines/combobox/index.cjs +1 -1
- package/dist/machines/combobox/index.d.cts +2 -2
- package/dist/machines/combobox/index.d.mts +2 -2
- package/dist/machines/combobox/index.mjs +1 -1
- package/dist/machines/date-picker/index.cjs +1 -1
- package/dist/machines/date-picker/index.d.cts +2 -2
- package/dist/machines/date-picker/index.d.mts +2 -2
- package/dist/machines/date-picker/index.mjs +1 -1
- package/dist/machines/dialog/index.cjs +1 -1
- package/dist/machines/dialog/index.d.cts +2 -2
- package/dist/machines/dialog/index.d.mts +2 -2
- package/dist/machines/dialog/index.mjs +1 -1
- package/dist/machines/drawer/index.cjs +1 -1
- package/dist/machines/drawer/index.d.cts +2 -2
- package/dist/machines/drawer/index.d.mts +2 -2
- package/dist/machines/drawer/index.mjs +1 -1
- package/dist/machines/dropdown-menu/index.cjs +1 -1
- package/dist/machines/dropdown-menu/index.d.cts +2 -2
- package/dist/machines/dropdown-menu/index.d.mts +2 -2
- package/dist/machines/dropdown-menu/index.mjs +1 -1
- package/dist/machines/editable/index.cjs +1 -1
- package/dist/machines/editable/index.d.cts +2 -2
- package/dist/machines/editable/index.d.mts +2 -2
- package/dist/machines/editable/index.mjs +1 -1
- package/dist/machines/file-upload/index.cjs +1 -1
- package/dist/machines/file-upload/index.d.cts +2 -2
- package/dist/machines/file-upload/index.d.mts +2 -2
- package/dist/machines/file-upload/index.mjs +1 -1
- package/dist/machines/floating-panel/index.cjs +96 -93
- package/dist/machines/floating-panel/index.d.cts +3 -3
- package/dist/machines/floating-panel/index.d.mts +3 -3
- package/dist/machines/floating-panel/index.mjs +96 -93
- package/dist/machines/hover-card/index.cjs +1 -1
- package/dist/machines/hover-card/index.d.cts +2 -2
- package/dist/machines/hover-card/index.d.mts +2 -2
- package/dist/machines/hover-card/index.mjs +1 -1
- package/dist/machines/image-cropper/index.cjs +1 -1
- package/dist/machines/image-cropper/index.d.cts +1 -1
- package/dist/machines/image-cropper/index.d.mts +1 -1
- package/dist/machines/image-cropper/index.mjs +1 -1
- package/dist/machines/listbox/index.cjs +1 -1
- package/dist/machines/listbox/index.d.cts +2 -2
- package/dist/machines/listbox/index.d.mts +2 -2
- package/dist/machines/listbox/index.mjs +1 -1
- package/dist/machines/marquee/index.cjs +1 -1
- package/dist/machines/marquee/index.d.cts +3 -3
- package/dist/machines/marquee/index.d.mts +3 -3
- package/dist/machines/marquee/index.mjs +1 -1
- package/dist/machines/navigation-menu/index.cjs +1 -1
- package/dist/machines/navigation-menu/index.d.cts +2 -2
- package/dist/machines/navigation-menu/index.d.mts +2 -2
- package/dist/machines/navigation-menu/index.mjs +1 -1
- package/dist/machines/number-input/index.cjs +1 -1
- package/dist/machines/number-input/index.d.cts +2 -2
- package/dist/machines/number-input/index.d.mts +2 -2
- package/dist/machines/number-input/index.mjs +1 -1
- package/dist/machines/pagination/index.cjs +1 -1
- package/dist/machines/pagination/index.d.cts +1 -1
- package/dist/machines/pagination/index.d.mts +1 -1
- package/dist/machines/pagination/index.mjs +1 -1
- package/dist/machines/password-input/index.cjs +1 -1
- package/dist/machines/password-input/index.d.cts +2 -2
- package/dist/machines/password-input/index.d.mts +2 -2
- package/dist/machines/password-input/index.mjs +1 -1
- package/dist/machines/pin-input/index.cjs +1 -1
- package/dist/machines/pin-input/index.d.cts +2 -2
- package/dist/machines/pin-input/index.d.mts +2 -2
- package/dist/machines/pin-input/index.mjs +1 -1
- package/dist/machines/popover/index.cjs +1 -1
- package/dist/machines/popover/index.d.cts +2 -2
- package/dist/machines/popover/index.d.mts +2 -2
- package/dist/machines/popover/index.mjs +1 -1
- package/dist/machines/presence/index.cjs +1 -1
- package/dist/machines/presence/index.d.cts +1 -1
- package/dist/machines/presence/index.d.mts +1 -1
- package/dist/machines/presence/index.mjs +1 -1
- package/dist/machines/progress/index.cjs +1 -1
- package/dist/machines/progress/index.d.cts +2 -2
- package/dist/machines/progress/index.d.mts +2 -2
- package/dist/machines/progress/index.mjs +1 -1
- package/dist/machines/qr-code/index.cjs +1 -1
- package/dist/machines/qr-code/index.d.cts +1 -1
- package/dist/machines/qr-code/index.d.mts +1 -1
- package/dist/machines/qr-code/index.mjs +1 -1
- package/dist/machines/radio-group/index.cjs +1 -1
- package/dist/machines/radio-group/index.d.cts +1 -1
- package/dist/machines/radio-group/index.d.mts +1 -1
- package/dist/machines/radio-group/index.mjs +1 -1
- package/dist/machines/rating-group/index.cjs +1 -1
- package/dist/machines/rating-group/index.d.cts +2 -2
- package/dist/machines/rating-group/index.d.mts +2 -2
- package/dist/machines/rating-group/index.mjs +1 -1
- package/dist/machines/scroll-area/index.cjs +1 -1
- package/dist/machines/scroll-area/index.d.cts +1 -1
- package/dist/machines/scroll-area/index.d.mts +1 -1
- package/dist/machines/scroll-area/index.mjs +1 -1
- package/dist/machines/select/index.cjs +1 -1
- package/dist/machines/select/index.d.cts +2 -2
- package/dist/machines/select/index.d.mts +2 -2
- package/dist/machines/select/index.mjs +1 -1
- package/dist/machines/separator/index.cjs +1 -1
- package/dist/machines/separator/index.d.cts +1 -1
- package/dist/machines/separator/index.d.mts +1 -1
- package/dist/machines/separator/index.mjs +1 -1
- package/dist/machines/signature-pad/index.cjs +1 -1
- package/dist/machines/signature-pad/index.d.cts +2 -2
- package/dist/machines/signature-pad/index.d.mts +2 -2
- package/dist/machines/signature-pad/index.mjs +1 -1
- package/dist/machines/slider/index.cjs +1 -1
- package/dist/machines/slider/index.d.cts +2 -2
- package/dist/machines/slider/index.d.mts +2 -2
- package/dist/machines/slider/index.mjs +1 -1
- package/dist/machines/splitter/index.cjs +1 -1
- package/dist/machines/splitter/index.d.cts +1 -1
- package/dist/machines/splitter/index.d.mts +1 -1
- package/dist/machines/splitter/index.mjs +1 -1
- package/dist/machines/steps/index.cjs +1 -1
- package/dist/machines/steps/index.d.cts +2 -2
- package/dist/machines/steps/index.d.mts +2 -2
- package/dist/machines/steps/index.mjs +1 -1
- package/dist/machines/switch/index.cjs +1 -1
- package/dist/machines/switch/index.d.cts +2 -2
- package/dist/machines/switch/index.d.mts +2 -2
- package/dist/machines/switch/index.mjs +1 -1
- package/dist/machines/tabs/index.cjs +1 -1
- package/dist/machines/tabs/index.d.cts +2 -2
- package/dist/machines/tabs/index.d.mts +2 -2
- package/dist/machines/tabs/index.mjs +1 -1
- package/dist/machines/tags-input/index.cjs +1 -1
- package/dist/machines/tags-input/index.d.cts +2 -2
- package/dist/machines/tags-input/index.d.mts +2 -2
- package/dist/machines/tags-input/index.mjs +1 -1
- package/dist/machines/timer/index.cjs +1 -1
- package/dist/machines/timer/index.d.cts +2 -2
- package/dist/machines/timer/index.d.mts +2 -2
- package/dist/machines/timer/index.mjs +1 -1
- package/dist/machines/toast/index.cjs +1 -1
- package/dist/machines/toast/index.d.cts +2 -2
- package/dist/machines/toast/index.d.mts +2 -2
- package/dist/machines/toast/index.mjs +1 -1
- package/dist/machines/toggle/index.cjs +1 -1
- package/dist/machines/toggle/index.d.cts +1 -1
- package/dist/machines/toggle/index.d.mts +1 -1
- package/dist/machines/toggle/index.mjs +1 -1
- package/dist/machines/toggle-group/index.cjs +1 -1
- package/dist/machines/toggle-group/index.d.cts +1 -1
- package/dist/machines/toggle-group/index.d.mts +1 -1
- package/dist/machines/toggle-group/index.mjs +1 -1
- package/dist/machines/tooltip/index.cjs +1 -1
- package/dist/machines/tooltip/index.d.cts +2 -2
- package/dist/machines/tooltip/index.d.mts +2 -2
- package/dist/machines/tooltip/index.mjs +1 -1
- package/dist/machines/tour/index.cjs +48 -46
- package/dist/machines/tour/index.d.cts +3 -3
- package/dist/machines/tour/index.d.mts +3 -3
- package/dist/machines/tour/index.mjs +48 -46
- package/dist/machines/tree-view/index.cjs +1 -1
- package/dist/machines/tree-view/index.d.cts +2 -2
- package/dist/machines/tree-view/index.d.mts +2 -2
- package/dist/machines/tree-view/index.mjs +1 -1
- package/dist/{types-B24gMTKq.d.cts → types-DvUmCWsb.d.mts} +28 -12
- package/dist/{types-DUM9rzfD.d.mts → types-u-LWCSDE.d.cts} +28 -12
- package/package.json +1 -1
- package/dist/core-Ci9Yu6QI.mjs +0 -123
- package/dist/core-DwdPztGA.cjs +0 -170
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
const require_dom_query = require("./dom-query-BUO7rGsg.cjs");
|
|
2
|
+
const require_utils = require("./utils-ByNiZU8f.cjs");
|
|
3
|
+
//#region src/shared/core/merge-props.ts
|
|
4
|
+
const clsx = (...args) => args.map((str) => str?.trim?.()).filter(Boolean).join(" ");
|
|
5
|
+
const CSS_REGEX = /((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;
|
|
6
|
+
const serialize = (style) => {
|
|
7
|
+
const res = {};
|
|
8
|
+
let match;
|
|
9
|
+
while (match = CSS_REGEX.exec(style)) res[match[1]] = match[2];
|
|
10
|
+
return res;
|
|
11
|
+
};
|
|
12
|
+
const css = (a, b) => {
|
|
13
|
+
if (require_utils.isString(a)) {
|
|
14
|
+
if (require_utils.isString(b)) return `${a};${b}`;
|
|
15
|
+
a = serialize(a);
|
|
16
|
+
} else if (require_utils.isString(b)) b = serialize(b);
|
|
17
|
+
return Object.assign({}, a ?? {}, b ?? {});
|
|
18
|
+
};
|
|
19
|
+
function mergeProps(...args) {
|
|
20
|
+
let result = {};
|
|
21
|
+
for (let props of args) {
|
|
22
|
+
if (!props) continue;
|
|
23
|
+
for (let key in result) {
|
|
24
|
+
if (key.startsWith("on") && typeof result[key] === "function" && typeof props[key] === "function") {
|
|
25
|
+
result[key] = require_utils.callAll(props[key], result[key]);
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (key === "className" || key === "class") {
|
|
29
|
+
result[key] = clsx(result[key], props[key]);
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (key === "style") {
|
|
33
|
+
result[key] = css(result[key], props[key]);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
result[key] = props[key] !== void 0 ? props[key] : result[key];
|
|
37
|
+
}
|
|
38
|
+
for (let key in props) if (result[key] === void 0) result[key] = props[key];
|
|
39
|
+
const symbols = Object.getOwnPropertySymbols(props);
|
|
40
|
+
for (let symbol of symbols) result[symbol] = props[symbol];
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/shared/core/memo.ts
|
|
46
|
+
function memo(getDeps, fn, opts) {
|
|
47
|
+
let deps = [];
|
|
48
|
+
let result;
|
|
49
|
+
return (depArgs) => {
|
|
50
|
+
const newDeps = getDeps(depArgs);
|
|
51
|
+
if (!(newDeps.length !== deps.length || newDeps.some((dep, index) => !require_utils.isEqual(deps[index], dep)))) return result;
|
|
52
|
+
deps = newDeps;
|
|
53
|
+
result = fn(newDeps, depArgs);
|
|
54
|
+
opts?.onChange?.(result);
|
|
55
|
+
return result;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/shared/core/state.ts
|
|
60
|
+
const STATE_DELIMITER = ".";
|
|
61
|
+
const ABSOLUTE_PREFIX = "#";
|
|
62
|
+
const stateIndexCache = /* @__PURE__ */ new WeakMap();
|
|
63
|
+
const stateIdIndexCache = /* @__PURE__ */ new WeakMap();
|
|
64
|
+
function joinStatePath(parts) {
|
|
65
|
+
return parts.join(STATE_DELIMITER);
|
|
66
|
+
}
|
|
67
|
+
function isAbsoluteStatePath(value) {
|
|
68
|
+
return value.includes(STATE_DELIMITER);
|
|
69
|
+
}
|
|
70
|
+
function isExplicitAbsoluteStatePath(value) {
|
|
71
|
+
return value.startsWith(ABSOLUTE_PREFIX);
|
|
72
|
+
}
|
|
73
|
+
function stripAbsolutePrefix(value) {
|
|
74
|
+
return isExplicitAbsoluteStatePath(value) ? value.slice(1) : value;
|
|
75
|
+
}
|
|
76
|
+
function appendStatePath(base, segment) {
|
|
77
|
+
return base ? `${base}${STATE_DELIMITER}${segment}` : segment;
|
|
78
|
+
}
|
|
79
|
+
function buildStateIndex(machine) {
|
|
80
|
+
const index = /* @__PURE__ */ new Map();
|
|
81
|
+
const idIndex = /* @__PURE__ */ new Map();
|
|
82
|
+
const visit = (basePath, state) => {
|
|
83
|
+
index.set(basePath, state);
|
|
84
|
+
const stateId = state.id;
|
|
85
|
+
if (stateId) {
|
|
86
|
+
if (idIndex.has(stateId)) throw new Error(`Duplicate state id: ${stateId}`);
|
|
87
|
+
idIndex.set(stateId, basePath);
|
|
88
|
+
}
|
|
89
|
+
const childStates = state.states;
|
|
90
|
+
if (!childStates) return;
|
|
91
|
+
for (const [childKey, childState] of Object.entries(childStates)) {
|
|
92
|
+
if (!childState) continue;
|
|
93
|
+
visit(appendStatePath(basePath, childKey), childState);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
for (const [topKey, topState] of Object.entries(machine.states)) {
|
|
97
|
+
if (!topState) continue;
|
|
98
|
+
visit(topKey, topState);
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
index,
|
|
102
|
+
idIndex
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function ensureStateIndex(machine) {
|
|
106
|
+
const cached = stateIndexCache.get(machine);
|
|
107
|
+
if (cached) return cached;
|
|
108
|
+
const { index, idIndex } = buildStateIndex(machine);
|
|
109
|
+
stateIndexCache.set(machine, index);
|
|
110
|
+
stateIdIndexCache.set(machine, idIndex);
|
|
111
|
+
return index;
|
|
112
|
+
}
|
|
113
|
+
function getStatePathById(machine, stateId) {
|
|
114
|
+
ensureStateIndex(machine);
|
|
115
|
+
return stateIdIndexCache.get(machine)?.get(stateId);
|
|
116
|
+
}
|
|
117
|
+
function toSegments(value) {
|
|
118
|
+
if (!value) return [];
|
|
119
|
+
return String(value).split(STATE_DELIMITER).filter(Boolean);
|
|
120
|
+
}
|
|
121
|
+
function getStateChain(machine, state) {
|
|
122
|
+
if (!state) return [];
|
|
123
|
+
const stateIndex = ensureStateIndex(machine);
|
|
124
|
+
const segments = toSegments(state);
|
|
125
|
+
const chain = [];
|
|
126
|
+
const statePath = [];
|
|
127
|
+
for (const segment of segments) {
|
|
128
|
+
statePath.push(segment);
|
|
129
|
+
const path = joinStatePath(statePath);
|
|
130
|
+
const current = stateIndex.get(path);
|
|
131
|
+
if (!current) break;
|
|
132
|
+
chain.push({
|
|
133
|
+
path,
|
|
134
|
+
state: current
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
return chain;
|
|
138
|
+
}
|
|
139
|
+
function resolveAbsoluteStateValue(machine, value) {
|
|
140
|
+
const stateIndex = ensureStateIndex(machine);
|
|
141
|
+
const segments = toSegments(value);
|
|
142
|
+
if (!segments.length) return value;
|
|
143
|
+
const resolved = [];
|
|
144
|
+
for (const segment of segments) {
|
|
145
|
+
resolved.push(segment);
|
|
146
|
+
const path = joinStatePath(resolved);
|
|
147
|
+
if (!stateIndex.has(path)) return value;
|
|
148
|
+
}
|
|
149
|
+
let resolvedPath = joinStatePath(resolved);
|
|
150
|
+
let current = stateIndex.get(resolvedPath);
|
|
151
|
+
while (current?.initial) {
|
|
152
|
+
const nextPath = `${resolvedPath}${STATE_DELIMITER}${current.initial}`;
|
|
153
|
+
const nextState = stateIndex.get(nextPath);
|
|
154
|
+
if (!nextState) break;
|
|
155
|
+
resolvedPath = nextPath;
|
|
156
|
+
current = nextState;
|
|
157
|
+
}
|
|
158
|
+
return resolvedPath;
|
|
159
|
+
}
|
|
160
|
+
function hasStatePath(machine, value) {
|
|
161
|
+
return ensureStateIndex(machine).has(value);
|
|
162
|
+
}
|
|
163
|
+
function resolveStateValue(machine, value, source) {
|
|
164
|
+
const stateValue = String(value);
|
|
165
|
+
if (isExplicitAbsoluteStatePath(stateValue)) {
|
|
166
|
+
const stateId = stripAbsolutePrefix(stateValue);
|
|
167
|
+
const statePath = getStatePathById(machine, stateId);
|
|
168
|
+
if (!statePath) throw new Error(`Unknown state id: ${stateId}`);
|
|
169
|
+
return resolveAbsoluteStateValue(machine, statePath);
|
|
170
|
+
}
|
|
171
|
+
if (!isAbsoluteStatePath(stateValue) && source) {
|
|
172
|
+
const sourceSegments = toSegments(source);
|
|
173
|
+
for (let index = sourceSegments.length; index >= 1; index--) {
|
|
174
|
+
const candidate = appendStatePath(sourceSegments.slice(0, index).join(STATE_DELIMITER), stateValue);
|
|
175
|
+
if (hasStatePath(machine, candidate)) return resolveAbsoluteStateValue(machine, candidate);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return resolveAbsoluteStateValue(machine, stateValue);
|
|
179
|
+
}
|
|
180
|
+
function getStateDefinition(machine, state) {
|
|
181
|
+
const chain = getStateChain(machine, state);
|
|
182
|
+
return chain[chain.length - 1]?.state;
|
|
183
|
+
}
|
|
184
|
+
function findTransition(machine, state, eventType) {
|
|
185
|
+
const chain = getStateChain(machine, state);
|
|
186
|
+
for (let index = chain.length - 1; index >= 0; index--) {
|
|
187
|
+
const transition = (chain[index]?.state.on)?.[eventType];
|
|
188
|
+
if (transition) return {
|
|
189
|
+
transitions: transition,
|
|
190
|
+
source: chain[index]?.path
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
transitions: machine.on?.[eventType],
|
|
195
|
+
source: void 0
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
function getExitEnterStates(machine, prevState, nextState, reenter) {
|
|
199
|
+
const prevChain = prevState ? getStateChain(machine, prevState) : [];
|
|
200
|
+
const nextChain = getStateChain(machine, nextState);
|
|
201
|
+
let commonIndex = 0;
|
|
202
|
+
while (commonIndex < prevChain.length && commonIndex < nextChain.length && prevChain[commonIndex]?.path === nextChain[commonIndex]?.path) commonIndex += 1;
|
|
203
|
+
let exiting = prevChain.slice(commonIndex).reverse();
|
|
204
|
+
let entering = nextChain.slice(commonIndex);
|
|
205
|
+
const sameLeaf = prevChain.at(-1)?.path === nextChain.at(-1)?.path;
|
|
206
|
+
if (reenter && sameLeaf) {
|
|
207
|
+
exiting = prevChain.slice().reverse();
|
|
208
|
+
entering = nextChain;
|
|
209
|
+
}
|
|
210
|
+
return {
|
|
211
|
+
exiting,
|
|
212
|
+
entering
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
function matchesState(current, value) {
|
|
216
|
+
if (!current) return false;
|
|
217
|
+
return current === value || current.startsWith(`${value}${STATE_DELIMITER}`);
|
|
218
|
+
}
|
|
219
|
+
function hasTag(machine, state, tag) {
|
|
220
|
+
return getStateChain(machine, state).some((item) => item.state.tags?.includes(tag));
|
|
221
|
+
}
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region src/shared/core/create-machine.ts
|
|
224
|
+
function createGuards() {
|
|
225
|
+
return {
|
|
226
|
+
and: (...guards) => {
|
|
227
|
+
return function andGuard(params) {
|
|
228
|
+
return guards.every((str) => params.guard(str));
|
|
229
|
+
};
|
|
230
|
+
},
|
|
231
|
+
or: (...guards) => {
|
|
232
|
+
return function orGuard(params) {
|
|
233
|
+
return guards.some((str) => params.guard(str));
|
|
234
|
+
};
|
|
235
|
+
},
|
|
236
|
+
not: (guard) => {
|
|
237
|
+
return function notGuard(params) {
|
|
238
|
+
return !params.guard(guard);
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
function createMachine(config) {
|
|
244
|
+
ensureStateIndex(config);
|
|
245
|
+
return config;
|
|
246
|
+
}
|
|
247
|
+
function setup() {
|
|
248
|
+
return {
|
|
249
|
+
guards: createGuards(),
|
|
250
|
+
createMachine: (config) => {
|
|
251
|
+
return createMachine(config);
|
|
252
|
+
},
|
|
253
|
+
choose: (transitions) => {
|
|
254
|
+
return function chooseFn({ choose }) {
|
|
255
|
+
return choose(transitions)?.actions;
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region src/shared/core/types.ts
|
|
262
|
+
let MachineStatus = /* @__PURE__ */ function(MachineStatus) {
|
|
263
|
+
MachineStatus["NotStarted"] = "Not Started";
|
|
264
|
+
MachineStatus["Started"] = "Started";
|
|
265
|
+
MachineStatus["Stopped"] = "Stopped";
|
|
266
|
+
return MachineStatus;
|
|
267
|
+
}({});
|
|
268
|
+
const INIT_STATE = "__init__";
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region src/shared/core/scope.ts
|
|
271
|
+
function createScope(props) {
|
|
272
|
+
const getRootNode = () => props.getRootNode?.() ?? document;
|
|
273
|
+
const getDoc = () => require_dom_query.getDocument(getRootNode());
|
|
274
|
+
const getWin = () => getDoc().defaultView ?? window;
|
|
275
|
+
const getActiveElementFn = () => require_dom_query.getActiveElement(getRootNode());
|
|
276
|
+
const getById = (id) => getRootNode().getElementById(id);
|
|
277
|
+
return {
|
|
278
|
+
...props,
|
|
279
|
+
getRootNode,
|
|
280
|
+
getDoc,
|
|
281
|
+
getWin,
|
|
282
|
+
getActiveElement: getActiveElementFn,
|
|
283
|
+
isActiveElement: require_dom_query.isActiveElement,
|
|
284
|
+
getById
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
//#endregion
|
|
288
|
+
Object.defineProperty(exports, "INIT_STATE", {
|
|
289
|
+
enumerable: true,
|
|
290
|
+
get: function() {
|
|
291
|
+
return INIT_STATE;
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
Object.defineProperty(exports, "MachineStatus", {
|
|
295
|
+
enumerable: true,
|
|
296
|
+
get: function() {
|
|
297
|
+
return MachineStatus;
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
Object.defineProperty(exports, "createGuards", {
|
|
301
|
+
enumerable: true,
|
|
302
|
+
get: function() {
|
|
303
|
+
return createGuards;
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
Object.defineProperty(exports, "createMachine", {
|
|
307
|
+
enumerable: true,
|
|
308
|
+
get: function() {
|
|
309
|
+
return createMachine;
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
Object.defineProperty(exports, "createScope", {
|
|
313
|
+
enumerable: true,
|
|
314
|
+
get: function() {
|
|
315
|
+
return createScope;
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
Object.defineProperty(exports, "ensureStateIndex", {
|
|
319
|
+
enumerable: true,
|
|
320
|
+
get: function() {
|
|
321
|
+
return ensureStateIndex;
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
Object.defineProperty(exports, "findTransition", {
|
|
325
|
+
enumerable: true,
|
|
326
|
+
get: function() {
|
|
327
|
+
return findTransition;
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
Object.defineProperty(exports, "getExitEnterStates", {
|
|
331
|
+
enumerable: true,
|
|
332
|
+
get: function() {
|
|
333
|
+
return getExitEnterStates;
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
Object.defineProperty(exports, "getStateChain", {
|
|
337
|
+
enumerable: true,
|
|
338
|
+
get: function() {
|
|
339
|
+
return getStateChain;
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
Object.defineProperty(exports, "getStateDefinition", {
|
|
343
|
+
enumerable: true,
|
|
344
|
+
get: function() {
|
|
345
|
+
return getStateDefinition;
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
Object.defineProperty(exports, "hasTag", {
|
|
349
|
+
enumerable: true,
|
|
350
|
+
get: function() {
|
|
351
|
+
return hasTag;
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
Object.defineProperty(exports, "matchesState", {
|
|
355
|
+
enumerable: true,
|
|
356
|
+
get: function() {
|
|
357
|
+
return matchesState;
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
Object.defineProperty(exports, "memo", {
|
|
361
|
+
enumerable: true,
|
|
362
|
+
get: function() {
|
|
363
|
+
return memo;
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
Object.defineProperty(exports, "mergeProps", {
|
|
367
|
+
enumerable: true,
|
|
368
|
+
get: function() {
|
|
369
|
+
return mergeProps;
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
Object.defineProperty(exports, "resolveStateValue", {
|
|
373
|
+
enumerable: true,
|
|
374
|
+
get: function() {
|
|
375
|
+
return resolveStateValue;
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
Object.defineProperty(exports, "setup", {
|
|
379
|
+
enumerable: true,
|
|
380
|
+
get: function() {
|
|
381
|
+
return setup;
|
|
382
|
+
}
|
|
383
|
+
});
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { en as getActiveElement, sn as isActiveElement, tn as getDocument } from "./dom-query-BFuRs3l4.mjs";
|
|
2
|
+
import { W as callAll, dt as isString, ft as isEqual } from "./utils-VVoZ_v29.mjs";
|
|
3
|
+
//#region src/shared/core/merge-props.ts
|
|
4
|
+
const clsx = (...args) => args.map((str) => str?.trim?.()).filter(Boolean).join(" ");
|
|
5
|
+
const CSS_REGEX = /((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;
|
|
6
|
+
const serialize = (style) => {
|
|
7
|
+
const res = {};
|
|
8
|
+
let match;
|
|
9
|
+
while (match = CSS_REGEX.exec(style)) res[match[1]] = match[2];
|
|
10
|
+
return res;
|
|
11
|
+
};
|
|
12
|
+
const css = (a, b) => {
|
|
13
|
+
if (isString(a)) {
|
|
14
|
+
if (isString(b)) return `${a};${b}`;
|
|
15
|
+
a = serialize(a);
|
|
16
|
+
} else if (isString(b)) b = serialize(b);
|
|
17
|
+
return Object.assign({}, a ?? {}, b ?? {});
|
|
18
|
+
};
|
|
19
|
+
function mergeProps(...args) {
|
|
20
|
+
let result = {};
|
|
21
|
+
for (let props of args) {
|
|
22
|
+
if (!props) continue;
|
|
23
|
+
for (let key in result) {
|
|
24
|
+
if (key.startsWith("on") && typeof result[key] === "function" && typeof props[key] === "function") {
|
|
25
|
+
result[key] = callAll(props[key], result[key]);
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (key === "className" || key === "class") {
|
|
29
|
+
result[key] = clsx(result[key], props[key]);
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (key === "style") {
|
|
33
|
+
result[key] = css(result[key], props[key]);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
result[key] = props[key] !== void 0 ? props[key] : result[key];
|
|
37
|
+
}
|
|
38
|
+
for (let key in props) if (result[key] === void 0) result[key] = props[key];
|
|
39
|
+
const symbols = Object.getOwnPropertySymbols(props);
|
|
40
|
+
for (let symbol of symbols) result[symbol] = props[symbol];
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/shared/core/memo.ts
|
|
46
|
+
function memo(getDeps, fn, opts) {
|
|
47
|
+
let deps = [];
|
|
48
|
+
let result;
|
|
49
|
+
return (depArgs) => {
|
|
50
|
+
const newDeps = getDeps(depArgs);
|
|
51
|
+
if (!(newDeps.length !== deps.length || newDeps.some((dep, index) => !isEqual(deps[index], dep)))) return result;
|
|
52
|
+
deps = newDeps;
|
|
53
|
+
result = fn(newDeps, depArgs);
|
|
54
|
+
opts?.onChange?.(result);
|
|
55
|
+
return result;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/shared/core/state.ts
|
|
60
|
+
const STATE_DELIMITER = ".";
|
|
61
|
+
const ABSOLUTE_PREFIX = "#";
|
|
62
|
+
const stateIndexCache = /* @__PURE__ */ new WeakMap();
|
|
63
|
+
const stateIdIndexCache = /* @__PURE__ */ new WeakMap();
|
|
64
|
+
function joinStatePath(parts) {
|
|
65
|
+
return parts.join(STATE_DELIMITER);
|
|
66
|
+
}
|
|
67
|
+
function isAbsoluteStatePath(value) {
|
|
68
|
+
return value.includes(STATE_DELIMITER);
|
|
69
|
+
}
|
|
70
|
+
function isExplicitAbsoluteStatePath(value) {
|
|
71
|
+
return value.startsWith(ABSOLUTE_PREFIX);
|
|
72
|
+
}
|
|
73
|
+
function stripAbsolutePrefix(value) {
|
|
74
|
+
return isExplicitAbsoluteStatePath(value) ? value.slice(1) : value;
|
|
75
|
+
}
|
|
76
|
+
function appendStatePath(base, segment) {
|
|
77
|
+
return base ? `${base}${STATE_DELIMITER}${segment}` : segment;
|
|
78
|
+
}
|
|
79
|
+
function buildStateIndex(machine) {
|
|
80
|
+
const index = /* @__PURE__ */ new Map();
|
|
81
|
+
const idIndex = /* @__PURE__ */ new Map();
|
|
82
|
+
const visit = (basePath, state) => {
|
|
83
|
+
index.set(basePath, state);
|
|
84
|
+
const stateId = state.id;
|
|
85
|
+
if (stateId) {
|
|
86
|
+
if (idIndex.has(stateId)) throw new Error(`Duplicate state id: ${stateId}`);
|
|
87
|
+
idIndex.set(stateId, basePath);
|
|
88
|
+
}
|
|
89
|
+
const childStates = state.states;
|
|
90
|
+
if (!childStates) return;
|
|
91
|
+
for (const [childKey, childState] of Object.entries(childStates)) {
|
|
92
|
+
if (!childState) continue;
|
|
93
|
+
visit(appendStatePath(basePath, childKey), childState);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
for (const [topKey, topState] of Object.entries(machine.states)) {
|
|
97
|
+
if (!topState) continue;
|
|
98
|
+
visit(topKey, topState);
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
index,
|
|
102
|
+
idIndex
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function ensureStateIndex(machine) {
|
|
106
|
+
const cached = stateIndexCache.get(machine);
|
|
107
|
+
if (cached) return cached;
|
|
108
|
+
const { index, idIndex } = buildStateIndex(machine);
|
|
109
|
+
stateIndexCache.set(machine, index);
|
|
110
|
+
stateIdIndexCache.set(machine, idIndex);
|
|
111
|
+
return index;
|
|
112
|
+
}
|
|
113
|
+
function getStatePathById(machine, stateId) {
|
|
114
|
+
ensureStateIndex(machine);
|
|
115
|
+
return stateIdIndexCache.get(machine)?.get(stateId);
|
|
116
|
+
}
|
|
117
|
+
function toSegments(value) {
|
|
118
|
+
if (!value) return [];
|
|
119
|
+
return String(value).split(STATE_DELIMITER).filter(Boolean);
|
|
120
|
+
}
|
|
121
|
+
function getStateChain(machine, state) {
|
|
122
|
+
if (!state) return [];
|
|
123
|
+
const stateIndex = ensureStateIndex(machine);
|
|
124
|
+
const segments = toSegments(state);
|
|
125
|
+
const chain = [];
|
|
126
|
+
const statePath = [];
|
|
127
|
+
for (const segment of segments) {
|
|
128
|
+
statePath.push(segment);
|
|
129
|
+
const path = joinStatePath(statePath);
|
|
130
|
+
const current = stateIndex.get(path);
|
|
131
|
+
if (!current) break;
|
|
132
|
+
chain.push({
|
|
133
|
+
path,
|
|
134
|
+
state: current
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
return chain;
|
|
138
|
+
}
|
|
139
|
+
function resolveAbsoluteStateValue(machine, value) {
|
|
140
|
+
const stateIndex = ensureStateIndex(machine);
|
|
141
|
+
const segments = toSegments(value);
|
|
142
|
+
if (!segments.length) return value;
|
|
143
|
+
const resolved = [];
|
|
144
|
+
for (const segment of segments) {
|
|
145
|
+
resolved.push(segment);
|
|
146
|
+
const path = joinStatePath(resolved);
|
|
147
|
+
if (!stateIndex.has(path)) return value;
|
|
148
|
+
}
|
|
149
|
+
let resolvedPath = joinStatePath(resolved);
|
|
150
|
+
let current = stateIndex.get(resolvedPath);
|
|
151
|
+
while (current?.initial) {
|
|
152
|
+
const nextPath = `${resolvedPath}${STATE_DELIMITER}${current.initial}`;
|
|
153
|
+
const nextState = stateIndex.get(nextPath);
|
|
154
|
+
if (!nextState) break;
|
|
155
|
+
resolvedPath = nextPath;
|
|
156
|
+
current = nextState;
|
|
157
|
+
}
|
|
158
|
+
return resolvedPath;
|
|
159
|
+
}
|
|
160
|
+
function hasStatePath(machine, value) {
|
|
161
|
+
return ensureStateIndex(machine).has(value);
|
|
162
|
+
}
|
|
163
|
+
function resolveStateValue(machine, value, source) {
|
|
164
|
+
const stateValue = String(value);
|
|
165
|
+
if (isExplicitAbsoluteStatePath(stateValue)) {
|
|
166
|
+
const stateId = stripAbsolutePrefix(stateValue);
|
|
167
|
+
const statePath = getStatePathById(machine, stateId);
|
|
168
|
+
if (!statePath) throw new Error(`Unknown state id: ${stateId}`);
|
|
169
|
+
return resolveAbsoluteStateValue(machine, statePath);
|
|
170
|
+
}
|
|
171
|
+
if (!isAbsoluteStatePath(stateValue) && source) {
|
|
172
|
+
const sourceSegments = toSegments(source);
|
|
173
|
+
for (let index = sourceSegments.length; index >= 1; index--) {
|
|
174
|
+
const candidate = appendStatePath(sourceSegments.slice(0, index).join(STATE_DELIMITER), stateValue);
|
|
175
|
+
if (hasStatePath(machine, candidate)) return resolveAbsoluteStateValue(machine, candidate);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return resolveAbsoluteStateValue(machine, stateValue);
|
|
179
|
+
}
|
|
180
|
+
function getStateDefinition(machine, state) {
|
|
181
|
+
const chain = getStateChain(machine, state);
|
|
182
|
+
return chain[chain.length - 1]?.state;
|
|
183
|
+
}
|
|
184
|
+
function findTransition(machine, state, eventType) {
|
|
185
|
+
const chain = getStateChain(machine, state);
|
|
186
|
+
for (let index = chain.length - 1; index >= 0; index--) {
|
|
187
|
+
const transition = (chain[index]?.state.on)?.[eventType];
|
|
188
|
+
if (transition) return {
|
|
189
|
+
transitions: transition,
|
|
190
|
+
source: chain[index]?.path
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
transitions: machine.on?.[eventType],
|
|
195
|
+
source: void 0
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
function getExitEnterStates(machine, prevState, nextState, reenter) {
|
|
199
|
+
const prevChain = prevState ? getStateChain(machine, prevState) : [];
|
|
200
|
+
const nextChain = getStateChain(machine, nextState);
|
|
201
|
+
let commonIndex = 0;
|
|
202
|
+
while (commonIndex < prevChain.length && commonIndex < nextChain.length && prevChain[commonIndex]?.path === nextChain[commonIndex]?.path) commonIndex += 1;
|
|
203
|
+
let exiting = prevChain.slice(commonIndex).reverse();
|
|
204
|
+
let entering = nextChain.slice(commonIndex);
|
|
205
|
+
const sameLeaf = prevChain.at(-1)?.path === nextChain.at(-1)?.path;
|
|
206
|
+
if (reenter && sameLeaf) {
|
|
207
|
+
exiting = prevChain.slice().reverse();
|
|
208
|
+
entering = nextChain;
|
|
209
|
+
}
|
|
210
|
+
return {
|
|
211
|
+
exiting,
|
|
212
|
+
entering
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
function matchesState(current, value) {
|
|
216
|
+
if (!current) return false;
|
|
217
|
+
return current === value || current.startsWith(`${value}${STATE_DELIMITER}`);
|
|
218
|
+
}
|
|
219
|
+
function hasTag(machine, state, tag) {
|
|
220
|
+
return getStateChain(machine, state).some((item) => item.state.tags?.includes(tag));
|
|
221
|
+
}
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region src/shared/core/create-machine.ts
|
|
224
|
+
function createGuards() {
|
|
225
|
+
return {
|
|
226
|
+
and: (...guards) => {
|
|
227
|
+
return function andGuard(params) {
|
|
228
|
+
return guards.every((str) => params.guard(str));
|
|
229
|
+
};
|
|
230
|
+
},
|
|
231
|
+
or: (...guards) => {
|
|
232
|
+
return function orGuard(params) {
|
|
233
|
+
return guards.some((str) => params.guard(str));
|
|
234
|
+
};
|
|
235
|
+
},
|
|
236
|
+
not: (guard) => {
|
|
237
|
+
return function notGuard(params) {
|
|
238
|
+
return !params.guard(guard);
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
function createMachine(config) {
|
|
244
|
+
ensureStateIndex(config);
|
|
245
|
+
return config;
|
|
246
|
+
}
|
|
247
|
+
function setup() {
|
|
248
|
+
return {
|
|
249
|
+
guards: createGuards(),
|
|
250
|
+
createMachine: (config) => {
|
|
251
|
+
return createMachine(config);
|
|
252
|
+
},
|
|
253
|
+
choose: (transitions) => {
|
|
254
|
+
return function chooseFn({ choose }) {
|
|
255
|
+
return choose(transitions)?.actions;
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region src/shared/core/types.ts
|
|
262
|
+
let MachineStatus = /* @__PURE__ */ function(MachineStatus) {
|
|
263
|
+
MachineStatus["NotStarted"] = "Not Started";
|
|
264
|
+
MachineStatus["Started"] = "Started";
|
|
265
|
+
MachineStatus["Stopped"] = "Stopped";
|
|
266
|
+
return MachineStatus;
|
|
267
|
+
}({});
|
|
268
|
+
const INIT_STATE = "__init__";
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region src/shared/core/scope.ts
|
|
271
|
+
function createScope(props) {
|
|
272
|
+
const getRootNode = () => props.getRootNode?.() ?? document;
|
|
273
|
+
const getDoc = () => getDocument(getRootNode());
|
|
274
|
+
const getWin = () => getDoc().defaultView ?? window;
|
|
275
|
+
const getActiveElementFn = () => getActiveElement(getRootNode());
|
|
276
|
+
const getById = (id) => getRootNode().getElementById(id);
|
|
277
|
+
return {
|
|
278
|
+
...props,
|
|
279
|
+
getRootNode,
|
|
280
|
+
getDoc,
|
|
281
|
+
getWin,
|
|
282
|
+
getActiveElement: getActiveElementFn,
|
|
283
|
+
isActiveElement,
|
|
284
|
+
getById
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
//#endregion
|
|
288
|
+
export { createMachine as a, findTransition as c, getStateDefinition as d, hasTag as f, mergeProps as g, memo as h, createGuards as i, getExitEnterStates as l, resolveStateValue as m, INIT_STATE as n, setup as o, matchesState as p, MachineStatus as r, ensureStateIndex as s, createScope as t, getStateChain as u };
|
package/dist/core.cjs
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./dom-query-BUO7rGsg.cjs");
|
|
3
3
|
require("./utils-ByNiZU8f.cjs");
|
|
4
|
-
const require_core = require("./core-
|
|
4
|
+
const require_core = require("./core-Bw_czdwX.cjs");
|
|
5
5
|
exports.INIT_STATE = require_core.INIT_STATE;
|
|
6
6
|
exports.MachineStatus = require_core.MachineStatus;
|
|
7
7
|
exports.createGuards = require_core.createGuards;
|
|
8
8
|
exports.createMachine = require_core.createMachine;
|
|
9
9
|
exports.createScope = require_core.createScope;
|
|
10
|
+
exports.ensureStateIndex = require_core.ensureStateIndex;
|
|
11
|
+
exports.findTransition = require_core.findTransition;
|
|
12
|
+
exports.getExitEnterStates = require_core.getExitEnterStates;
|
|
13
|
+
exports.getStateChain = require_core.getStateChain;
|
|
14
|
+
exports.getStateDefinition = require_core.getStateDefinition;
|
|
15
|
+
exports.hasTag = require_core.hasTag;
|
|
16
|
+
exports.matchesState = require_core.matchesState;
|
|
10
17
|
exports.memo = require_core.memo;
|
|
11
18
|
exports.mergeProps = require_core.mergeProps;
|
|
19
|
+
exports.resolveStateValue = require_core.resolveStateValue;
|
|
12
20
|
exports.setup = require_core.setup;
|