@ai-ecoverse/slicc-spectrum 1.20.0 → 1.22.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/{chunk-FVX3AKIL.js → chunk-7C2RFOQL.js} +2 -2
- package/dist/{chunk-HREBQ2GY.js → chunk-BALQPQXE.js} +22 -709
- package/dist/chunk-BALQPQXE.js.map +7 -0
- package/dist/chunk-LCUJINFQ.js +765 -0
- package/dist/chunk-LCUJINFQ.js.map +7 -0
- package/dist/{chunk-EBQYWRJ4.js → chunk-UGQPYZPJ.js} +3 -3
- package/dist/{chunk-3BBEUJX7.js → chunk-VGYK6PQ4.js} +3 -3
- package/dist/slicc-ui.js +53896 -51481
- package/dist/slicc-ui.js.map +4 -4
- package/dist/types/app/app.d.ts +9 -0
- package/dist/types/app/base.d.ts +3 -1
- package/dist/types/app/browser.d.ts +8 -5
- package/dist/types/app/panels.d.ts +7 -2
- package/dist/types/app/spectrum.d.ts +8 -0
- package/dist/types/app/terminals.d.ts +20 -9
- package/dist/types/app/tray.d.ts +1 -4
- package/package.json +2 -2
- package/dist/chunk-HREBQ2GY.js.map +0 -7
- package/dist/chunk-Y4Z7K443.js +0 -64
- package/dist/chunk-Y4Z7K443.js.map +0 -7
- /package/dist/{chunk-FVX3AKIL.js.map → chunk-7C2RFOQL.js.map} +0 -0
- /package/dist/{chunk-EBQYWRJ4.js.map → chunk-UGQPYZPJ.js.map} +0 -0
- /package/dist/{chunk-3BBEUJX7.js.map → chunk-VGYK6PQ4.js.map} +0 -0
|
@@ -0,0 +1,765 @@
|
|
|
1
|
+
// node_modules/@spectrum-web-components/overlay/src/slottable-request-event.js
|
|
2
|
+
var SlottableRequestEvent = class extends Event {
|
|
3
|
+
constructor(e2, n2, t) {
|
|
4
|
+
super("slottable-request", { bubbles: false, cancelable: true, composed: false }), this.name = e2, this.data = n2, this.slotName = t !== void 0 ? `${e2}.${t}` : e2;
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
var removeSlottableRequest = /* @__PURE__ */ Symbol("remove-slottable-request");
|
|
8
|
+
|
|
9
|
+
// node_modules/@spectrum-web-components/shared/src/random-id.js
|
|
10
|
+
function randomID() {
|
|
11
|
+
return Array.from(crypto.getRandomValues(new Uint8Array(4)), (r) => `0${(r & 255).toString(16)}`.slice(-2)).join("");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// node_modules/@spectrum-web-components/shared/src/platform.js
|
|
15
|
+
function n(o) {
|
|
16
|
+
return typeof window != "undefined" && window.navigator != null ? o.test(window.navigator.userAgent) : false;
|
|
17
|
+
}
|
|
18
|
+
function e(o) {
|
|
19
|
+
return typeof window != "undefined" && window.navigator != null ? o.test(window.navigator.platform) : false;
|
|
20
|
+
}
|
|
21
|
+
function isMac() {
|
|
22
|
+
return e(/^Mac/);
|
|
23
|
+
}
|
|
24
|
+
function isIPhone() {
|
|
25
|
+
return e(/^iPhone/);
|
|
26
|
+
}
|
|
27
|
+
function isIPad() {
|
|
28
|
+
return e(/^iPad/) || isMac() && navigator.maxTouchPoints > 1;
|
|
29
|
+
}
|
|
30
|
+
function isIOS() {
|
|
31
|
+
return isIPhone() || isIPad();
|
|
32
|
+
}
|
|
33
|
+
function isWebKit() {
|
|
34
|
+
return n(/AppleWebKit/) && !isChrome();
|
|
35
|
+
}
|
|
36
|
+
function isChrome() {
|
|
37
|
+
return n(/Chrome/);
|
|
38
|
+
}
|
|
39
|
+
function isAndroid() {
|
|
40
|
+
return n(/Android/);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// node_modules/@spectrum-web-components/base/src/condition-attribute-with-id.js
|
|
44
|
+
function conditionAttributeWithoutId(t, i, n2) {
|
|
45
|
+
const e2 = t.getAttribute(i);
|
|
46
|
+
let r = e2 ? e2.split(/\s+/) : [];
|
|
47
|
+
r = r.filter((s) => !n2.find((o) => s === o)), r.length ? t.setAttribute(i, r.join(" ")) : t.removeAttribute(i);
|
|
48
|
+
}
|
|
49
|
+
function conditionAttributeWithId(t, i, n2) {
|
|
50
|
+
const e2 = Array.isArray(n2) ? n2 : [n2], r = t.getAttribute(i), s = r ? r.split(/\s+/) : [];
|
|
51
|
+
return e2.every((d) => s.indexOf(d) > -1) ? () => {
|
|
52
|
+
} : (s.push(...e2), t.setAttribute(i, s.join(" ")), () => conditionAttributeWithoutId(t, i, e2));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// node_modules/@floating-ui/core/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
56
|
+
var min = Math.min;
|
|
57
|
+
var max = Math.max;
|
|
58
|
+
var oppositeSideMap = {
|
|
59
|
+
left: "right",
|
|
60
|
+
right: "left",
|
|
61
|
+
bottom: "top",
|
|
62
|
+
top: "bottom"
|
|
63
|
+
};
|
|
64
|
+
function clamp(start, value, end) {
|
|
65
|
+
return max(start, min(value, end));
|
|
66
|
+
}
|
|
67
|
+
function evaluate(value, param) {
|
|
68
|
+
return typeof value === "function" ? value(param) : value;
|
|
69
|
+
}
|
|
70
|
+
function getSide(placement) {
|
|
71
|
+
return placement.split("-")[0];
|
|
72
|
+
}
|
|
73
|
+
function getAlignment(placement) {
|
|
74
|
+
return placement.split("-")[1];
|
|
75
|
+
}
|
|
76
|
+
function getOppositeAxis(axis) {
|
|
77
|
+
return axis === "x" ? "y" : "x";
|
|
78
|
+
}
|
|
79
|
+
function getAxisLength(axis) {
|
|
80
|
+
return axis === "y" ? "height" : "width";
|
|
81
|
+
}
|
|
82
|
+
function getSideAxis(placement) {
|
|
83
|
+
const firstChar = placement[0];
|
|
84
|
+
return firstChar === "t" || firstChar === "b" ? "y" : "x";
|
|
85
|
+
}
|
|
86
|
+
function getAlignmentAxis(placement) {
|
|
87
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
88
|
+
}
|
|
89
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
90
|
+
if (rtl === void 0) {
|
|
91
|
+
rtl = false;
|
|
92
|
+
}
|
|
93
|
+
const alignment = getAlignment(placement);
|
|
94
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
95
|
+
const length = getAxisLength(alignmentAxis);
|
|
96
|
+
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
|
|
97
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
98
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
99
|
+
}
|
|
100
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
101
|
+
}
|
|
102
|
+
function getExpandedPlacements(placement) {
|
|
103
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
104
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
105
|
+
}
|
|
106
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
107
|
+
return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
|
|
108
|
+
}
|
|
109
|
+
var lrPlacement = ["left", "right"];
|
|
110
|
+
var rlPlacement = ["right", "left"];
|
|
111
|
+
var tbPlacement = ["top", "bottom"];
|
|
112
|
+
var btPlacement = ["bottom", "top"];
|
|
113
|
+
function getSideList(side, isStart, rtl) {
|
|
114
|
+
switch (side) {
|
|
115
|
+
case "top":
|
|
116
|
+
case "bottom":
|
|
117
|
+
if (rtl) return isStart ? rlPlacement : lrPlacement;
|
|
118
|
+
return isStart ? lrPlacement : rlPlacement;
|
|
119
|
+
case "left":
|
|
120
|
+
case "right":
|
|
121
|
+
return isStart ? tbPlacement : btPlacement;
|
|
122
|
+
default:
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
127
|
+
const alignment = getAlignment(placement);
|
|
128
|
+
let list = getSideList(getSide(placement), direction === "start", rtl);
|
|
129
|
+
if (alignment) {
|
|
130
|
+
list = list.map((side) => side + "-" + alignment);
|
|
131
|
+
if (flipAlignment) {
|
|
132
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return list;
|
|
136
|
+
}
|
|
137
|
+
function getOppositePlacement(placement) {
|
|
138
|
+
const side = getSide(placement);
|
|
139
|
+
return oppositeSideMap[side] + placement.slice(side.length);
|
|
140
|
+
}
|
|
141
|
+
function expandPaddingObject(padding) {
|
|
142
|
+
var _padding$top, _padding$right, _padding$bottom, _padding$left;
|
|
143
|
+
return {
|
|
144
|
+
top: (_padding$top = padding.top) != null ? _padding$top : 0,
|
|
145
|
+
right: (_padding$right = padding.right) != null ? _padding$right : 0,
|
|
146
|
+
bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
|
|
147
|
+
left: (_padding$left = padding.left) != null ? _padding$left : 0
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function getPaddingObject(padding) {
|
|
151
|
+
return typeof padding !== "number" ? expandPaddingObject(padding) : {
|
|
152
|
+
top: padding,
|
|
153
|
+
right: padding,
|
|
154
|
+
bottom: padding,
|
|
155
|
+
left: padding
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
function rectToClientRect(rect) {
|
|
159
|
+
const {
|
|
160
|
+
x,
|
|
161
|
+
y,
|
|
162
|
+
width,
|
|
163
|
+
height
|
|
164
|
+
} = rect;
|
|
165
|
+
return {
|
|
166
|
+
width,
|
|
167
|
+
height,
|
|
168
|
+
top: y,
|
|
169
|
+
left: x,
|
|
170
|
+
right: x + width,
|
|
171
|
+
bottom: y + height,
|
|
172
|
+
x,
|
|
173
|
+
y
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
178
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
179
|
+
let {
|
|
180
|
+
reference,
|
|
181
|
+
floating
|
|
182
|
+
} = _ref;
|
|
183
|
+
const sideAxis = getSideAxis(placement);
|
|
184
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
185
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
186
|
+
const side = getSide(placement);
|
|
187
|
+
const isVertical = sideAxis === "y";
|
|
188
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
189
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
190
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
191
|
+
let coords;
|
|
192
|
+
switch (side) {
|
|
193
|
+
case "top":
|
|
194
|
+
coords = {
|
|
195
|
+
x: commonX,
|
|
196
|
+
y: reference.y - floating.height
|
|
197
|
+
};
|
|
198
|
+
break;
|
|
199
|
+
case "bottom":
|
|
200
|
+
coords = {
|
|
201
|
+
x: commonX,
|
|
202
|
+
y: reference.y + reference.height
|
|
203
|
+
};
|
|
204
|
+
break;
|
|
205
|
+
case "right":
|
|
206
|
+
coords = {
|
|
207
|
+
x: reference.x + reference.width,
|
|
208
|
+
y: commonY
|
|
209
|
+
};
|
|
210
|
+
break;
|
|
211
|
+
case "left":
|
|
212
|
+
coords = {
|
|
213
|
+
x: reference.x - floating.width,
|
|
214
|
+
y: commonY
|
|
215
|
+
};
|
|
216
|
+
break;
|
|
217
|
+
default:
|
|
218
|
+
coords = {
|
|
219
|
+
x: reference.x,
|
|
220
|
+
y: reference.y
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
const alignment = getAlignment(placement);
|
|
224
|
+
if (alignment) {
|
|
225
|
+
coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1);
|
|
226
|
+
}
|
|
227
|
+
return coords;
|
|
228
|
+
}
|
|
229
|
+
async function detectOverflow(state, options) {
|
|
230
|
+
var _await$platform$isEle;
|
|
231
|
+
if (options === void 0) {
|
|
232
|
+
options = {};
|
|
233
|
+
}
|
|
234
|
+
const {
|
|
235
|
+
x,
|
|
236
|
+
y,
|
|
237
|
+
platform,
|
|
238
|
+
rects,
|
|
239
|
+
elements,
|
|
240
|
+
strategy
|
|
241
|
+
} = state;
|
|
242
|
+
const {
|
|
243
|
+
boundary = "clippingAncestors",
|
|
244
|
+
rootBoundary = "viewport",
|
|
245
|
+
elementContext = "floating",
|
|
246
|
+
altBoundary = false,
|
|
247
|
+
padding = 0
|
|
248
|
+
} = evaluate(options, state);
|
|
249
|
+
const paddingObject = getPaddingObject(padding);
|
|
250
|
+
const altContext = elementContext === "floating" ? "reference" : "floating";
|
|
251
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
252
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
253
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating)),
|
|
254
|
+
boundary,
|
|
255
|
+
rootBoundary,
|
|
256
|
+
strategy
|
|
257
|
+
}));
|
|
258
|
+
const rect = elementContext === "floating" ? {
|
|
259
|
+
x,
|
|
260
|
+
y,
|
|
261
|
+
width: rects.floating.width,
|
|
262
|
+
height: rects.floating.height
|
|
263
|
+
} : rects.reference;
|
|
264
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
265
|
+
const offsetScale = await (platform.isElement == null ? void 0 : platform.isElement(offsetParent)) && await (platform.getScale == null ? void 0 : platform.getScale(offsetParent)) || {
|
|
266
|
+
x: 1,
|
|
267
|
+
y: 1
|
|
268
|
+
};
|
|
269
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
270
|
+
elements,
|
|
271
|
+
rect,
|
|
272
|
+
offsetParent,
|
|
273
|
+
strategy
|
|
274
|
+
}) : rect);
|
|
275
|
+
return {
|
|
276
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
277
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
278
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
279
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
var MAX_RESET_COUNT = 50;
|
|
283
|
+
var computePosition = async (reference, floating, config) => {
|
|
284
|
+
const {
|
|
285
|
+
placement = "bottom",
|
|
286
|
+
strategy = "absolute",
|
|
287
|
+
middleware = [],
|
|
288
|
+
platform
|
|
289
|
+
} = config;
|
|
290
|
+
const platformWithDetectOverflow = platform.detectOverflow ? platform : {
|
|
291
|
+
...platform,
|
|
292
|
+
detectOverflow
|
|
293
|
+
};
|
|
294
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
295
|
+
let rects = await platform.getElementRects({
|
|
296
|
+
reference,
|
|
297
|
+
floating,
|
|
298
|
+
strategy
|
|
299
|
+
});
|
|
300
|
+
let {
|
|
301
|
+
x,
|
|
302
|
+
y
|
|
303
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
304
|
+
let statefulPlacement = placement;
|
|
305
|
+
let resetCount = 0;
|
|
306
|
+
const middlewareData = {};
|
|
307
|
+
for (let i = 0; i < middleware.length; i++) {
|
|
308
|
+
const currentMiddleware = middleware[i];
|
|
309
|
+
if (!currentMiddleware) {
|
|
310
|
+
continue;
|
|
311
|
+
}
|
|
312
|
+
const {
|
|
313
|
+
name,
|
|
314
|
+
fn
|
|
315
|
+
} = currentMiddleware;
|
|
316
|
+
const {
|
|
317
|
+
x: nextX,
|
|
318
|
+
y: nextY,
|
|
319
|
+
data,
|
|
320
|
+
reset
|
|
321
|
+
} = await fn({
|
|
322
|
+
x,
|
|
323
|
+
y,
|
|
324
|
+
initialPlacement: placement,
|
|
325
|
+
placement: statefulPlacement,
|
|
326
|
+
strategy,
|
|
327
|
+
middlewareData,
|
|
328
|
+
rects,
|
|
329
|
+
platform: platformWithDetectOverflow,
|
|
330
|
+
elements: {
|
|
331
|
+
reference,
|
|
332
|
+
floating
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
x = nextX != null ? nextX : x;
|
|
336
|
+
y = nextY != null ? nextY : y;
|
|
337
|
+
middlewareData[name] = {
|
|
338
|
+
...middlewareData[name],
|
|
339
|
+
...data
|
|
340
|
+
};
|
|
341
|
+
if (reset && resetCount < MAX_RESET_COUNT) {
|
|
342
|
+
resetCount++;
|
|
343
|
+
if (typeof reset === "object") {
|
|
344
|
+
if (reset.placement) {
|
|
345
|
+
statefulPlacement = reset.placement;
|
|
346
|
+
}
|
|
347
|
+
if (reset.rects) {
|
|
348
|
+
rects = reset.rects === true ? await platform.getElementRects({
|
|
349
|
+
reference,
|
|
350
|
+
floating,
|
|
351
|
+
strategy
|
|
352
|
+
}) : reset.rects;
|
|
353
|
+
}
|
|
354
|
+
({
|
|
355
|
+
x,
|
|
356
|
+
y
|
|
357
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
358
|
+
}
|
|
359
|
+
i = -1;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
return {
|
|
363
|
+
x,
|
|
364
|
+
y,
|
|
365
|
+
placement: statefulPlacement,
|
|
366
|
+
strategy,
|
|
367
|
+
middlewareData
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
var arrow = (options) => ({
|
|
371
|
+
name: "arrow",
|
|
372
|
+
options,
|
|
373
|
+
async fn(state) {
|
|
374
|
+
const {
|
|
375
|
+
x,
|
|
376
|
+
y,
|
|
377
|
+
placement,
|
|
378
|
+
rects,
|
|
379
|
+
platform,
|
|
380
|
+
elements,
|
|
381
|
+
middlewareData
|
|
382
|
+
} = state;
|
|
383
|
+
const {
|
|
384
|
+
element,
|
|
385
|
+
padding = 0
|
|
386
|
+
} = evaluate(options, state) || {};
|
|
387
|
+
if (element == null) {
|
|
388
|
+
return {};
|
|
389
|
+
}
|
|
390
|
+
const paddingObject = getPaddingObject(padding);
|
|
391
|
+
const coords = {
|
|
392
|
+
x,
|
|
393
|
+
y
|
|
394
|
+
};
|
|
395
|
+
const axis = getAlignmentAxis(placement);
|
|
396
|
+
const length = getAxisLength(axis);
|
|
397
|
+
const arrowDimensions = await platform.getDimensions(element);
|
|
398
|
+
const isYAxis = axis === "y";
|
|
399
|
+
const minProp = isYAxis ? "top" : "left";
|
|
400
|
+
const maxProp = isYAxis ? "bottom" : "right";
|
|
401
|
+
const clientProp = isYAxis ? "clientHeight" : "clientWidth";
|
|
402
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
403
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
|
404
|
+
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
405
|
+
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
406
|
+
if (!clientSize || !await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent))) {
|
|
407
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
408
|
+
}
|
|
409
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
410
|
+
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
411
|
+
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
412
|
+
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
413
|
+
const max2 = clientSize - arrowDimensions[length] - maxPadding;
|
|
414
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
415
|
+
const offset2 = clamp(minPadding, center, max2);
|
|
416
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset2 && rects.reference[length] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
417
|
+
const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max2 : 0;
|
|
418
|
+
return {
|
|
419
|
+
[axis]: coords[axis] + alignmentOffset,
|
|
420
|
+
data: {
|
|
421
|
+
[axis]: offset2,
|
|
422
|
+
centerOffset: center - offset2 - alignmentOffset,
|
|
423
|
+
...shouldAddOffset && {
|
|
424
|
+
alignmentOffset
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
reset: shouldAddOffset
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
var flip = function(options) {
|
|
432
|
+
if (options === void 0) {
|
|
433
|
+
options = {};
|
|
434
|
+
}
|
|
435
|
+
return {
|
|
436
|
+
name: "flip",
|
|
437
|
+
options,
|
|
438
|
+
async fn(state) {
|
|
439
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
440
|
+
const {
|
|
441
|
+
placement,
|
|
442
|
+
middlewareData,
|
|
443
|
+
rects,
|
|
444
|
+
initialPlacement,
|
|
445
|
+
platform,
|
|
446
|
+
elements
|
|
447
|
+
} = state;
|
|
448
|
+
const {
|
|
449
|
+
mainAxis: checkMainAxis = true,
|
|
450
|
+
crossAxis: checkCrossAxis = true,
|
|
451
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
452
|
+
fallbackStrategy = "bestFit",
|
|
453
|
+
fallbackAxisSideDirection = "none",
|
|
454
|
+
flipAlignment = true,
|
|
455
|
+
...detectOverflowOptions
|
|
456
|
+
} = evaluate(options, state);
|
|
457
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
458
|
+
return {};
|
|
459
|
+
}
|
|
460
|
+
const side = getSide(placement);
|
|
461
|
+
const initialSideAxis = getSideAxis(initialPlacement);
|
|
462
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
463
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
464
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
465
|
+
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
|
|
466
|
+
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
467
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
468
|
+
}
|
|
469
|
+
const placements2 = [initialPlacement, ...fallbackPlacements];
|
|
470
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
471
|
+
const overflows = [];
|
|
472
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
473
|
+
if (checkMainAxis) {
|
|
474
|
+
overflows.push(overflow[side]);
|
|
475
|
+
}
|
|
476
|
+
if (checkCrossAxis) {
|
|
477
|
+
const sides2 = getAlignmentSides(placement, rects, rtl);
|
|
478
|
+
overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
|
|
479
|
+
}
|
|
480
|
+
overflowsData = [...overflowsData, {
|
|
481
|
+
placement,
|
|
482
|
+
overflows
|
|
483
|
+
}];
|
|
484
|
+
if (!overflows.every((side2) => side2 <= 0)) {
|
|
485
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
486
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
487
|
+
const nextPlacement = placements2[nextIndex];
|
|
488
|
+
if (nextPlacement) {
|
|
489
|
+
const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
490
|
+
if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
|
|
491
|
+
// overflows the main axis.
|
|
492
|
+
overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
|
|
493
|
+
return {
|
|
494
|
+
data: {
|
|
495
|
+
index: nextIndex,
|
|
496
|
+
overflows: overflowsData
|
|
497
|
+
},
|
|
498
|
+
reset: {
|
|
499
|
+
placement: nextPlacement
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
505
|
+
if (!resetPlacement) {
|
|
506
|
+
switch (fallbackStrategy) {
|
|
507
|
+
case "bestFit": {
|
|
508
|
+
var _overflowsData$filter2;
|
|
509
|
+
const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
|
|
510
|
+
if (hasFallbackAxisSideDirection) {
|
|
511
|
+
const currentSideAxis = getSideAxis(d.placement);
|
|
512
|
+
return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
|
|
513
|
+
// reading directions favoring greater width.
|
|
514
|
+
currentSideAxis === "y";
|
|
515
|
+
}
|
|
516
|
+
return true;
|
|
517
|
+
}).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
518
|
+
if (placement2) {
|
|
519
|
+
resetPlacement = placement2;
|
|
520
|
+
}
|
|
521
|
+
break;
|
|
522
|
+
}
|
|
523
|
+
case "initialPlacement":
|
|
524
|
+
resetPlacement = initialPlacement;
|
|
525
|
+
break;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
if (placement !== resetPlacement) {
|
|
529
|
+
return {
|
|
530
|
+
reset: {
|
|
531
|
+
placement: resetPlacement
|
|
532
|
+
}
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
return {};
|
|
537
|
+
}
|
|
538
|
+
};
|
|
539
|
+
};
|
|
540
|
+
var originSides = /* @__PURE__ */ new Set(["left", "top"]);
|
|
541
|
+
async function convertValueToCoords(state, options) {
|
|
542
|
+
const {
|
|
543
|
+
placement,
|
|
544
|
+
platform,
|
|
545
|
+
elements
|
|
546
|
+
} = state;
|
|
547
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
548
|
+
const side = getSide(placement);
|
|
549
|
+
const alignment = getAlignment(placement);
|
|
550
|
+
const isVertical = getSideAxis(placement) === "y";
|
|
551
|
+
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
552
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
553
|
+
const rawValue = evaluate(options, state);
|
|
554
|
+
let {
|
|
555
|
+
mainAxis,
|
|
556
|
+
crossAxis,
|
|
557
|
+
alignmentAxis
|
|
558
|
+
} = typeof rawValue === "number" ? {
|
|
559
|
+
mainAxis: rawValue,
|
|
560
|
+
crossAxis: 0,
|
|
561
|
+
alignmentAxis: null
|
|
562
|
+
} : {
|
|
563
|
+
mainAxis: rawValue.mainAxis || 0,
|
|
564
|
+
crossAxis: rawValue.crossAxis || 0,
|
|
565
|
+
alignmentAxis: rawValue.alignmentAxis
|
|
566
|
+
};
|
|
567
|
+
if (alignment && typeof alignmentAxis === "number") {
|
|
568
|
+
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
|
|
569
|
+
}
|
|
570
|
+
return isVertical ? {
|
|
571
|
+
x: crossAxis * crossAxisMulti,
|
|
572
|
+
y: mainAxis * mainAxisMulti
|
|
573
|
+
} : {
|
|
574
|
+
x: mainAxis * mainAxisMulti,
|
|
575
|
+
y: crossAxis * crossAxisMulti
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
var offset = function(options) {
|
|
579
|
+
if (options === void 0) {
|
|
580
|
+
options = 0;
|
|
581
|
+
}
|
|
582
|
+
return {
|
|
583
|
+
name: "offset",
|
|
584
|
+
options,
|
|
585
|
+
async fn(state) {
|
|
586
|
+
var _middlewareData$offse, _middlewareData$arrow;
|
|
587
|
+
const {
|
|
588
|
+
x,
|
|
589
|
+
y,
|
|
590
|
+
placement,
|
|
591
|
+
middlewareData
|
|
592
|
+
} = state;
|
|
593
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
594
|
+
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
595
|
+
return {};
|
|
596
|
+
}
|
|
597
|
+
return {
|
|
598
|
+
x: x + diffCoords.x,
|
|
599
|
+
y: y + diffCoords.y,
|
|
600
|
+
data: {
|
|
601
|
+
...diffCoords,
|
|
602
|
+
placement
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
};
|
|
608
|
+
var shift = function(options) {
|
|
609
|
+
if (options === void 0) {
|
|
610
|
+
options = {};
|
|
611
|
+
}
|
|
612
|
+
return {
|
|
613
|
+
name: "shift",
|
|
614
|
+
options,
|
|
615
|
+
async fn(state) {
|
|
616
|
+
const {
|
|
617
|
+
x,
|
|
618
|
+
y,
|
|
619
|
+
placement,
|
|
620
|
+
platform
|
|
621
|
+
} = state;
|
|
622
|
+
const {
|
|
623
|
+
mainAxis: checkMainAxis = true,
|
|
624
|
+
crossAxis: checkCrossAxis = false,
|
|
625
|
+
limiter = {
|
|
626
|
+
fn: (_ref) => {
|
|
627
|
+
let {
|
|
628
|
+
x: x2,
|
|
629
|
+
y: y2
|
|
630
|
+
} = _ref;
|
|
631
|
+
return {
|
|
632
|
+
x: x2,
|
|
633
|
+
y: y2
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
},
|
|
637
|
+
...detectOverflowOptions
|
|
638
|
+
} = evaluate(options, state);
|
|
639
|
+
const coords = {
|
|
640
|
+
x,
|
|
641
|
+
y
|
|
642
|
+
};
|
|
643
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
644
|
+
const crossAxis = getSideAxis(placement);
|
|
645
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
646
|
+
let mainAxisCoord = coords[mainAxis];
|
|
647
|
+
let crossAxisCoord = coords[crossAxis];
|
|
648
|
+
const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]);
|
|
649
|
+
if (checkMainAxis) {
|
|
650
|
+
mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);
|
|
651
|
+
}
|
|
652
|
+
if (checkCrossAxis) {
|
|
653
|
+
crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
|
|
654
|
+
}
|
|
655
|
+
const limitedCoords = limiter.fn({
|
|
656
|
+
...state,
|
|
657
|
+
[mainAxis]: mainAxisCoord,
|
|
658
|
+
[crossAxis]: crossAxisCoord
|
|
659
|
+
});
|
|
660
|
+
return {
|
|
661
|
+
...limitedCoords,
|
|
662
|
+
data: {
|
|
663
|
+
x: limitedCoords.x - x,
|
|
664
|
+
y: limitedCoords.y - y,
|
|
665
|
+
enabled: {
|
|
666
|
+
[mainAxis]: checkMainAxis,
|
|
667
|
+
[crossAxis]: checkCrossAxis
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
};
|
|
673
|
+
};
|
|
674
|
+
var size = function(options) {
|
|
675
|
+
if (options === void 0) {
|
|
676
|
+
options = {};
|
|
677
|
+
}
|
|
678
|
+
return {
|
|
679
|
+
name: "size",
|
|
680
|
+
options,
|
|
681
|
+
async fn(state) {
|
|
682
|
+
const {
|
|
683
|
+
placement,
|
|
684
|
+
rects,
|
|
685
|
+
platform,
|
|
686
|
+
elements
|
|
687
|
+
} = state;
|
|
688
|
+
const {
|
|
689
|
+
apply = () => {
|
|
690
|
+
},
|
|
691
|
+
...detectOverflowOptions
|
|
692
|
+
} = evaluate(options, state);
|
|
693
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
694
|
+
const side = getSide(placement);
|
|
695
|
+
const alignment = getAlignment(placement);
|
|
696
|
+
const isYAxis = getSideAxis(placement) === "y";
|
|
697
|
+
const {
|
|
698
|
+
width,
|
|
699
|
+
height
|
|
700
|
+
} = rects.floating;
|
|
701
|
+
let heightSide;
|
|
702
|
+
let widthSide;
|
|
703
|
+
if (side === "top" || side === "bottom") {
|
|
704
|
+
heightSide = side;
|
|
705
|
+
widthSide = alignment === (await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
|
|
706
|
+
} else {
|
|
707
|
+
widthSide = side;
|
|
708
|
+
heightSide = alignment === "end" ? "top" : "bottom";
|
|
709
|
+
}
|
|
710
|
+
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
711
|
+
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
712
|
+
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
|
|
713
|
+
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
|
|
714
|
+
const shiftData = state.middlewareData.shift;
|
|
715
|
+
const noShift = !shiftData;
|
|
716
|
+
let availableHeight = overflowAvailableHeight;
|
|
717
|
+
let availableWidth = overflowAvailableWidth;
|
|
718
|
+
if (shiftData != null && shiftData.enabled.x) {
|
|
719
|
+
availableWidth = maximumClippingWidth;
|
|
720
|
+
}
|
|
721
|
+
if (shiftData != null && shiftData.enabled.y) {
|
|
722
|
+
availableHeight = maximumClippingHeight;
|
|
723
|
+
}
|
|
724
|
+
if (noShift && !alignment) {
|
|
725
|
+
if (isYAxis) {
|
|
726
|
+
availableWidth = width - 2 * max(overflow.left, overflow.right);
|
|
727
|
+
} else {
|
|
728
|
+
availableHeight = height - 2 * max(overflow.top, overflow.bottom);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
await apply({
|
|
732
|
+
...state,
|
|
733
|
+
availableWidth,
|
|
734
|
+
availableHeight
|
|
735
|
+
});
|
|
736
|
+
const nextDimensions = await platform.getDimensions(elements.floating);
|
|
737
|
+
if (width !== nextDimensions.width || height !== nextDimensions.height) {
|
|
738
|
+
return {
|
|
739
|
+
reset: {
|
|
740
|
+
rects: true
|
|
741
|
+
}
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
return {};
|
|
745
|
+
}
|
|
746
|
+
};
|
|
747
|
+
};
|
|
748
|
+
|
|
749
|
+
export {
|
|
750
|
+
SlottableRequestEvent,
|
|
751
|
+
removeSlottableRequest,
|
|
752
|
+
isIOS,
|
|
753
|
+
isWebKit,
|
|
754
|
+
isAndroid,
|
|
755
|
+
randomID,
|
|
756
|
+
rectToClientRect,
|
|
757
|
+
computePosition,
|
|
758
|
+
arrow,
|
|
759
|
+
flip,
|
|
760
|
+
offset,
|
|
761
|
+
shift,
|
|
762
|
+
size,
|
|
763
|
+
conditionAttributeWithId
|
|
764
|
+
};
|
|
765
|
+
//# sourceMappingURL=chunk-LCUJINFQ.js.map
|