@inploi/plugin-feedback 6.0.0 → 6.1.1
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/cdn/index.js +13 -13
- package/dist/components/feedback-widget.test.d.ts +1 -0
- package/dist/feedback.d.ts +14 -0
- package/dist/i18n.d.ts +18 -0
- package/dist/plugin-feedback.cjs +373 -241
- package/dist/plugin-feedback.js +373 -241
- package/dist/style/tokens.d.ts +8 -1
- package/dist/style/tokens.test.d.ts +1 -0
- package/package.json +3 -3
package/dist/plugin-feedback.cjs
CHANGED
|
@@ -1925,10 +1925,6 @@ const oppositeSideMap = {
|
|
|
1925
1925
|
bottom: "top",
|
|
1926
1926
|
top: "bottom"
|
|
1927
1927
|
};
|
|
1928
|
-
const oppositeAlignmentMap = {
|
|
1929
|
-
start: "end",
|
|
1930
|
-
end: "start"
|
|
1931
|
-
};
|
|
1932
1928
|
function clamp(start, value, end) {
|
|
1933
1929
|
return max(start, min(value, end));
|
|
1934
1930
|
}
|
|
@@ -1947,9 +1943,9 @@ function getOppositeAxis(axis) {
|
|
|
1947
1943
|
function getAxisLength(axis) {
|
|
1948
1944
|
return axis === "y" ? "height" : "width";
|
|
1949
1945
|
}
|
|
1950
|
-
const yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
1951
1946
|
function getSideAxis(placement) {
|
|
1952
|
-
|
|
1947
|
+
const firstChar = placement[0];
|
|
1948
|
+
return firstChar === "t" || firstChar === "b" ? "y" : "x";
|
|
1953
1949
|
}
|
|
1954
1950
|
function getAlignmentAxis(placement) {
|
|
1955
1951
|
return getOppositeAxis(getSideAxis(placement));
|
|
@@ -1972,7 +1968,7 @@ function getExpandedPlacements(placement) {
|
|
|
1972
1968
|
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
1973
1969
|
}
|
|
1974
1970
|
function getOppositeAlignmentPlacement(placement) {
|
|
1975
|
-
return placement.replace(
|
|
1971
|
+
return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
|
|
1976
1972
|
}
|
|
1977
1973
|
const lrPlacement = ["left", "right"];
|
|
1978
1974
|
const rlPlacement = ["right", "left"];
|
|
@@ -2004,7 +2000,8 @@ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
|
2004
2000
|
return list;
|
|
2005
2001
|
}
|
|
2006
2002
|
function getOppositePlacement(placement) {
|
|
2007
|
-
|
|
2003
|
+
const side = getSide(placement);
|
|
2004
|
+
return oppositeSideMap[side] + placement.slice(side.length);
|
|
2008
2005
|
}
|
|
2009
2006
|
function expandPaddingObject(padding) {
|
|
2010
2007
|
return {
|
|
@@ -2096,6 +2093,63 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
2096
2093
|
}
|
|
2097
2094
|
return coords;
|
|
2098
2095
|
}
|
|
2096
|
+
async function detectOverflow(state, options2) {
|
|
2097
|
+
var _await$platform$isEle;
|
|
2098
|
+
if (options2 === void 0) {
|
|
2099
|
+
options2 = {};
|
|
2100
|
+
}
|
|
2101
|
+
const {
|
|
2102
|
+
x: x2,
|
|
2103
|
+
y: y2,
|
|
2104
|
+
platform: platform2,
|
|
2105
|
+
rects,
|
|
2106
|
+
elements,
|
|
2107
|
+
strategy
|
|
2108
|
+
} = state;
|
|
2109
|
+
const {
|
|
2110
|
+
boundary = "clippingAncestors",
|
|
2111
|
+
rootBoundary = "viewport",
|
|
2112
|
+
elementContext = "floating",
|
|
2113
|
+
altBoundary = false,
|
|
2114
|
+
padding = 0
|
|
2115
|
+
} = evaluate(options2, state);
|
|
2116
|
+
const paddingObject = getPaddingObject(padding);
|
|
2117
|
+
const altContext = elementContext === "floating" ? "reference" : "floating";
|
|
2118
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
2119
|
+
const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
|
|
2120
|
+
element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
|
|
2121
|
+
boundary,
|
|
2122
|
+
rootBoundary,
|
|
2123
|
+
strategy
|
|
2124
|
+
}));
|
|
2125
|
+
const rect = elementContext === "floating" ? {
|
|
2126
|
+
x: x2,
|
|
2127
|
+
y: y2,
|
|
2128
|
+
width: rects.floating.width,
|
|
2129
|
+
height: rects.floating.height
|
|
2130
|
+
} : rects.reference;
|
|
2131
|
+
const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
|
|
2132
|
+
const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
|
|
2133
|
+
x: 1,
|
|
2134
|
+
y: 1
|
|
2135
|
+
} : {
|
|
2136
|
+
x: 1,
|
|
2137
|
+
y: 1
|
|
2138
|
+
};
|
|
2139
|
+
const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
2140
|
+
elements,
|
|
2141
|
+
rect,
|
|
2142
|
+
offsetParent,
|
|
2143
|
+
strategy
|
|
2144
|
+
}) : rect);
|
|
2145
|
+
return {
|
|
2146
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
2147
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
2148
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
2149
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
2150
|
+
};
|
|
2151
|
+
}
|
|
2152
|
+
const MAX_RESET_COUNT = 50;
|
|
2099
2153
|
const computePosition$1 = async (reference, floating, config) => {
|
|
2100
2154
|
const {
|
|
2101
2155
|
placement = "bottom",
|
|
@@ -2103,7 +2157,10 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
2103
2157
|
middleware = [],
|
|
2104
2158
|
platform: platform2
|
|
2105
2159
|
} = config;
|
|
2106
|
-
const
|
|
2160
|
+
const platformWithDetectOverflow = platform2.detectOverflow ? platform2 : {
|
|
2161
|
+
...platform2,
|
|
2162
|
+
detectOverflow
|
|
2163
|
+
};
|
|
2107
2164
|
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
|
|
2108
2165
|
let rects = await platform2.getElementRects({
|
|
2109
2166
|
reference,
|
|
@@ -2115,13 +2172,17 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
2115
2172
|
y: y2
|
|
2116
2173
|
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
2117
2174
|
let statefulPlacement = placement;
|
|
2118
|
-
let middlewareData = {};
|
|
2119
2175
|
let resetCount = 0;
|
|
2120
|
-
|
|
2176
|
+
const middlewareData = {};
|
|
2177
|
+
for (let i2 = 0; i2 < middleware.length; i2++) {
|
|
2178
|
+
const currentMiddleware = middleware[i2];
|
|
2179
|
+
if (!currentMiddleware) {
|
|
2180
|
+
continue;
|
|
2181
|
+
}
|
|
2121
2182
|
const {
|
|
2122
2183
|
name,
|
|
2123
2184
|
fn: fn2
|
|
2124
|
-
} =
|
|
2185
|
+
} = currentMiddleware;
|
|
2125
2186
|
const {
|
|
2126
2187
|
x: nextX,
|
|
2127
2188
|
y: nextY,
|
|
@@ -2135,7 +2196,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
2135
2196
|
strategy,
|
|
2136
2197
|
middlewareData,
|
|
2137
2198
|
rects,
|
|
2138
|
-
platform:
|
|
2199
|
+
platform: platformWithDetectOverflow,
|
|
2139
2200
|
elements: {
|
|
2140
2201
|
reference,
|
|
2141
2202
|
floating
|
|
@@ -2143,14 +2204,11 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
2143
2204
|
});
|
|
2144
2205
|
x2 = nextX != null ? nextX : x2;
|
|
2145
2206
|
y2 = nextY != null ? nextY : y2;
|
|
2146
|
-
middlewareData = {
|
|
2147
|
-
...middlewareData,
|
|
2148
|
-
|
|
2149
|
-
...middlewareData[name],
|
|
2150
|
-
...data
|
|
2151
|
-
}
|
|
2207
|
+
middlewareData[name] = {
|
|
2208
|
+
...middlewareData[name],
|
|
2209
|
+
...data
|
|
2152
2210
|
};
|
|
2153
|
-
if (reset && resetCount
|
|
2211
|
+
if (reset && resetCount < MAX_RESET_COUNT) {
|
|
2154
2212
|
resetCount++;
|
|
2155
2213
|
if (typeof reset === "object") {
|
|
2156
2214
|
if (reset.placement) {
|
|
@@ -2179,62 +2237,6 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
2179
2237
|
middlewareData
|
|
2180
2238
|
};
|
|
2181
2239
|
};
|
|
2182
|
-
async function detectOverflow(state, options2) {
|
|
2183
|
-
var _await$platform$isEle;
|
|
2184
|
-
if (options2 === void 0) {
|
|
2185
|
-
options2 = {};
|
|
2186
|
-
}
|
|
2187
|
-
const {
|
|
2188
|
-
x: x2,
|
|
2189
|
-
y: y2,
|
|
2190
|
-
platform: platform2,
|
|
2191
|
-
rects,
|
|
2192
|
-
elements,
|
|
2193
|
-
strategy
|
|
2194
|
-
} = state;
|
|
2195
|
-
const {
|
|
2196
|
-
boundary = "clippingAncestors",
|
|
2197
|
-
rootBoundary = "viewport",
|
|
2198
|
-
elementContext = "floating",
|
|
2199
|
-
altBoundary = false,
|
|
2200
|
-
padding = 0
|
|
2201
|
-
} = evaluate(options2, state);
|
|
2202
|
-
const paddingObject = getPaddingObject(padding);
|
|
2203
|
-
const altContext = elementContext === "floating" ? "reference" : "floating";
|
|
2204
|
-
const element = elements[altBoundary ? altContext : elementContext];
|
|
2205
|
-
const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
|
|
2206
|
-
element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
|
|
2207
|
-
boundary,
|
|
2208
|
-
rootBoundary,
|
|
2209
|
-
strategy
|
|
2210
|
-
}));
|
|
2211
|
-
const rect = elementContext === "floating" ? {
|
|
2212
|
-
x: x2,
|
|
2213
|
-
y: y2,
|
|
2214
|
-
width: rects.floating.width,
|
|
2215
|
-
height: rects.floating.height
|
|
2216
|
-
} : rects.reference;
|
|
2217
|
-
const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
|
|
2218
|
-
const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
|
|
2219
|
-
x: 1,
|
|
2220
|
-
y: 1
|
|
2221
|
-
} : {
|
|
2222
|
-
x: 1,
|
|
2223
|
-
y: 1
|
|
2224
|
-
};
|
|
2225
|
-
const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
2226
|
-
elements,
|
|
2227
|
-
rect,
|
|
2228
|
-
offsetParent,
|
|
2229
|
-
strategy
|
|
2230
|
-
}) : rect);
|
|
2231
|
-
return {
|
|
2232
|
-
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
2233
|
-
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
2234
|
-
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
2235
|
-
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
2236
|
-
};
|
|
2237
|
-
}
|
|
2238
2240
|
const arrow$3 = (options2) => ({
|
|
2239
2241
|
name: "arrow",
|
|
2240
2242
|
options: options2,
|
|
@@ -2336,7 +2338,7 @@ const flip$2 = function(options2) {
|
|
|
2336
2338
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
2337
2339
|
}
|
|
2338
2340
|
const placements = [initialPlacement, ...fallbackPlacements];
|
|
2339
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
2341
|
+
const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
|
|
2340
2342
|
const overflows = [];
|
|
2341
2343
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
2342
2344
|
if (checkMainAxis) {
|
|
@@ -2355,15 +2357,20 @@ const flip$2 = function(options2) {
|
|
|
2355
2357
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
2356
2358
|
const nextPlacement = placements[nextIndex];
|
|
2357
2359
|
if (nextPlacement) {
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2360
|
+
const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
2361
|
+
if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
|
|
2362
|
+
// overflows the main axis.
|
|
2363
|
+
overflowsData.every((d2) => getSideAxis(d2.placement) === initialSideAxis ? d2.overflows[0] > 0 : true)) {
|
|
2364
|
+
return {
|
|
2365
|
+
data: {
|
|
2366
|
+
index: nextIndex,
|
|
2367
|
+
overflows: overflowsData
|
|
2368
|
+
},
|
|
2369
|
+
reset: {
|
|
2370
|
+
placement: nextPlacement
|
|
2371
|
+
}
|
|
2372
|
+
};
|
|
2373
|
+
}
|
|
2367
2374
|
}
|
|
2368
2375
|
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d2) => d2.overflows[0] <= 0).sort((a2, b2) => a2.overflows[1] - b2.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
2369
2376
|
if (!resetPlacement) {
|
|
@@ -2421,7 +2428,8 @@ const hide$2 = function(options2) {
|
|
|
2421
2428
|
options: options2,
|
|
2422
2429
|
async fn(state) {
|
|
2423
2430
|
const {
|
|
2424
|
-
rects
|
|
2431
|
+
rects,
|
|
2432
|
+
platform: platform2
|
|
2425
2433
|
} = state;
|
|
2426
2434
|
const {
|
|
2427
2435
|
strategy = "referenceHidden",
|
|
@@ -2429,7 +2437,7 @@ const hide$2 = function(options2) {
|
|
|
2429
2437
|
} = evaluate(options2, state);
|
|
2430
2438
|
switch (strategy) {
|
|
2431
2439
|
case "referenceHidden": {
|
|
2432
|
-
const overflow = await detectOverflow(state, {
|
|
2440
|
+
const overflow = await platform2.detectOverflow(state, {
|
|
2433
2441
|
...detectOverflowOptions,
|
|
2434
2442
|
elementContext: "reference"
|
|
2435
2443
|
});
|
|
@@ -2442,7 +2450,7 @@ const hide$2 = function(options2) {
|
|
|
2442
2450
|
};
|
|
2443
2451
|
}
|
|
2444
2452
|
case "escaped": {
|
|
2445
|
-
const overflow = await detectOverflow(state, {
|
|
2453
|
+
const overflow = await platform2.detectOverflow(state, {
|
|
2446
2454
|
...detectOverflowOptions,
|
|
2447
2455
|
altBoundary: true
|
|
2448
2456
|
});
|
|
@@ -2461,6 +2469,7 @@ const hide$2 = function(options2) {
|
|
|
2461
2469
|
}
|
|
2462
2470
|
};
|
|
2463
2471
|
};
|
|
2472
|
+
const originSides = /* @__PURE__ */ new Set(["left", "top"]);
|
|
2464
2473
|
async function convertValueToCoords(state, options2) {
|
|
2465
2474
|
const {
|
|
2466
2475
|
placement,
|
|
@@ -2471,7 +2480,7 @@ async function convertValueToCoords(state, options2) {
|
|
|
2471
2480
|
const side = getSide(placement);
|
|
2472
2481
|
const alignment = getAlignment(placement);
|
|
2473
2482
|
const isVertical = getSideAxis(placement) === "y";
|
|
2474
|
-
const mainAxisMulti =
|
|
2483
|
+
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
2475
2484
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
2476
2485
|
const rawValue = evaluate(options2, state);
|
|
2477
2486
|
let {
|
|
@@ -2483,10 +2492,9 @@ async function convertValueToCoords(state, options2) {
|
|
|
2483
2492
|
crossAxis: 0,
|
|
2484
2493
|
alignmentAxis: null
|
|
2485
2494
|
} : {
|
|
2486
|
-
mainAxis: 0,
|
|
2487
|
-
crossAxis: 0,
|
|
2488
|
-
alignmentAxis:
|
|
2489
|
-
...rawValue
|
|
2495
|
+
mainAxis: rawValue.mainAxis || 0,
|
|
2496
|
+
crossAxis: rawValue.crossAxis || 0,
|
|
2497
|
+
alignmentAxis: rawValue.alignmentAxis
|
|
2490
2498
|
};
|
|
2491
2499
|
if (alignment && typeof alignmentAxis === "number") {
|
|
2492
2500
|
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
|
|
@@ -2540,7 +2548,8 @@ const shift$2 = function(options2) {
|
|
|
2540
2548
|
const {
|
|
2541
2549
|
x: x2,
|
|
2542
2550
|
y: y2,
|
|
2543
|
-
placement
|
|
2551
|
+
placement,
|
|
2552
|
+
platform: platform2
|
|
2544
2553
|
} = state;
|
|
2545
2554
|
const {
|
|
2546
2555
|
mainAxis: checkMainAxis = true,
|
|
@@ -2563,7 +2572,7 @@ const shift$2 = function(options2) {
|
|
|
2563
2572
|
x: x2,
|
|
2564
2573
|
y: y2
|
|
2565
2574
|
};
|
|
2566
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
2575
|
+
const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
|
|
2567
2576
|
const crossAxis = getSideAxis(getSide(placement));
|
|
2568
2577
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
2569
2578
|
let mainAxisCoord = coords[mainAxis];
|
|
@@ -2591,7 +2600,11 @@ const shift$2 = function(options2) {
|
|
|
2591
2600
|
...limitedCoords,
|
|
2592
2601
|
data: {
|
|
2593
2602
|
x: limitedCoords.x - x2,
|
|
2594
|
-
y: limitedCoords.y - y2
|
|
2603
|
+
y: limitedCoords.y - y2,
|
|
2604
|
+
enabled: {
|
|
2605
|
+
[mainAxis]: checkMainAxis,
|
|
2606
|
+
[crossAxis]: checkCrossAxis
|
|
2607
|
+
}
|
|
2595
2608
|
}
|
|
2596
2609
|
};
|
|
2597
2610
|
}
|
|
@@ -2646,7 +2659,7 @@ const limitShift$2 = function(options2) {
|
|
|
2646
2659
|
if (checkCrossAxis) {
|
|
2647
2660
|
var _middlewareData$offse, _middlewareData$offse2;
|
|
2648
2661
|
const len = mainAxis === "y" ? "width" : "height";
|
|
2649
|
-
const isOriginSide =
|
|
2662
|
+
const isOriginSide = originSides.has(getSide(placement));
|
|
2650
2663
|
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
|
|
2651
2664
|
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
|
|
2652
2665
|
if (crossAxisCoord < limitMin) {
|
|
@@ -2670,6 +2683,7 @@ const size$2 = function(options2) {
|
|
|
2670
2683
|
name: "size",
|
|
2671
2684
|
options: options2,
|
|
2672
2685
|
async fn(state) {
|
|
2686
|
+
var _state$middlewareData, _state$middlewareData2;
|
|
2673
2687
|
const {
|
|
2674
2688
|
placement,
|
|
2675
2689
|
rects,
|
|
@@ -2681,7 +2695,7 @@ const size$2 = function(options2) {
|
|
|
2681
2695
|
},
|
|
2682
2696
|
...detectOverflowOptions
|
|
2683
2697
|
} = evaluate(options2, state);
|
|
2684
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
2698
|
+
const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
|
|
2685
2699
|
const side = getSide(placement);
|
|
2686
2700
|
const alignment = getAlignment(placement);
|
|
2687
2701
|
const isYAxis = getSideAxis(placement) === "y";
|
|
@@ -2705,10 +2719,11 @@ const size$2 = function(options2) {
|
|
|
2705
2719
|
const noShift = !state.middlewareData.shift;
|
|
2706
2720
|
let availableHeight = overflowAvailableHeight;
|
|
2707
2721
|
let availableWidth = overflowAvailableWidth;
|
|
2708
|
-
if (
|
|
2709
|
-
availableWidth =
|
|
2710
|
-
}
|
|
2711
|
-
|
|
2722
|
+
if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
|
|
2723
|
+
availableWidth = maximumClippingWidth;
|
|
2724
|
+
}
|
|
2725
|
+
if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
|
|
2726
|
+
availableHeight = maximumClippingHeight;
|
|
2712
2727
|
}
|
|
2713
2728
|
if (noShift && !alignment) {
|
|
2714
2729
|
const xMin = max(overflow.left, 0);
|
|
@@ -2779,7 +2794,6 @@ function isShadowRoot(value) {
|
|
|
2779
2794
|
}
|
|
2780
2795
|
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
2781
2796
|
}
|
|
2782
|
-
const invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
2783
2797
|
function isOverflowElement(element) {
|
|
2784
2798
|
const {
|
|
2785
2799
|
overflow,
|
|
@@ -2787,29 +2801,31 @@ function isOverflowElement(element) {
|
|
|
2787
2801
|
overflowY,
|
|
2788
2802
|
display
|
|
2789
2803
|
} = getComputedStyle$1(element);
|
|
2790
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) &&
|
|
2804
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents";
|
|
2791
2805
|
}
|
|
2792
|
-
const tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
2793
2806
|
function isTableElement(element) {
|
|
2794
|
-
return
|
|
2807
|
+
return /^(table|td|th)$/.test(getNodeName(element));
|
|
2795
2808
|
}
|
|
2796
|
-
const topLayerSelectors = [":popover-open", ":modal"];
|
|
2797
2809
|
function isTopLayer(element) {
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
return
|
|
2801
|
-
} catch (_e) {
|
|
2802
|
-
return false;
|
|
2810
|
+
try {
|
|
2811
|
+
if (element.matches(":popover-open")) {
|
|
2812
|
+
return true;
|
|
2803
2813
|
}
|
|
2804
|
-
})
|
|
2814
|
+
} catch (_e) {
|
|
2815
|
+
}
|
|
2816
|
+
try {
|
|
2817
|
+
return element.matches(":modal");
|
|
2818
|
+
} catch (_e) {
|
|
2819
|
+
return false;
|
|
2820
|
+
}
|
|
2805
2821
|
}
|
|
2806
|
-
const
|
|
2807
|
-
const
|
|
2808
|
-
const
|
|
2822
|
+
const willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
|
|
2823
|
+
const containRe = /paint|layout|strict|content/;
|
|
2824
|
+
const isNotNone = (value) => !!value && value !== "none";
|
|
2825
|
+
let isWebKitValue;
|
|
2809
2826
|
function isContainingBlock(elementOrCss) {
|
|
2810
|
-
const webkit = isWebKit();
|
|
2811
2827
|
const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
|
|
2812
|
-
return
|
|
2828
|
+
return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || "");
|
|
2813
2829
|
}
|
|
2814
2830
|
function getContainingBlock(element) {
|
|
2815
2831
|
let currentNode = getParentNode(element);
|
|
@@ -2824,13 +2840,13 @@ function getContainingBlock(element) {
|
|
|
2824
2840
|
return null;
|
|
2825
2841
|
}
|
|
2826
2842
|
function isWebKit() {
|
|
2827
|
-
if (
|
|
2828
|
-
|
|
2829
|
-
|
|
2843
|
+
if (isWebKitValue == null) {
|
|
2844
|
+
isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none");
|
|
2845
|
+
}
|
|
2846
|
+
return isWebKitValue;
|
|
2830
2847
|
}
|
|
2831
|
-
const lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
2832
2848
|
function isLastTraversableNode(node) {
|
|
2833
|
-
return
|
|
2849
|
+
return /^(html|body|#document)$/.test(getNodeName(node));
|
|
2834
2850
|
}
|
|
2835
2851
|
function getComputedStyle$1(element) {
|
|
2836
2852
|
return getWindow(element).getComputedStyle(element);
|
|
@@ -2884,8 +2900,9 @@ function getOverflowAncestors(node, list, traverseIframes) {
|
|
|
2884
2900
|
if (isBody) {
|
|
2885
2901
|
const frameElement = getFrameElement(win);
|
|
2886
2902
|
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
2903
|
+
} else {
|
|
2904
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
2887
2905
|
}
|
|
2888
|
-
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
2889
2906
|
}
|
|
2890
2907
|
function getFrameElement(win) {
|
|
2891
2908
|
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
@@ -3007,6 +3024,22 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
3007
3024
|
y: y2
|
|
3008
3025
|
});
|
|
3009
3026
|
}
|
|
3027
|
+
function getWindowScrollBarX(element, rect) {
|
|
3028
|
+
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
3029
|
+
if (!rect) {
|
|
3030
|
+
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
3031
|
+
}
|
|
3032
|
+
return rect.left + leftScroll;
|
|
3033
|
+
}
|
|
3034
|
+
function getHTMLOffset(documentElement, scroll) {
|
|
3035
|
+
const htmlRect = documentElement.getBoundingClientRect();
|
|
3036
|
+
const x2 = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
|
|
3037
|
+
const y2 = htmlRect.top + scroll.scrollTop;
|
|
3038
|
+
return {
|
|
3039
|
+
x: x2,
|
|
3040
|
+
y: y2
|
|
3041
|
+
};
|
|
3042
|
+
}
|
|
3010
3043
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
3011
3044
|
let {
|
|
3012
3045
|
elements,
|
|
@@ -3031,26 +3064,24 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
3031
3064
|
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
3032
3065
|
scroll = getNodeScroll(offsetParent);
|
|
3033
3066
|
}
|
|
3034
|
-
if (
|
|
3067
|
+
if (isOffsetParentAnElement) {
|
|
3035
3068
|
const offsetRect = getBoundingClientRect(offsetParent);
|
|
3036
3069
|
scale = getScale(offsetParent);
|
|
3037
3070
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
3038
3071
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
3039
3072
|
}
|
|
3040
3073
|
}
|
|
3074
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
3041
3075
|
return {
|
|
3042
3076
|
width: rect.width * scale.x,
|
|
3043
3077
|
height: rect.height * scale.y,
|
|
3044
|
-
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
3045
|
-
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
3078
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
3079
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
3046
3080
|
};
|
|
3047
3081
|
}
|
|
3048
3082
|
function getClientRects(element) {
|
|
3049
3083
|
return Array.from(element.getClientRects());
|
|
3050
3084
|
}
|
|
3051
|
-
function getWindowScrollBarX(element) {
|
|
3052
|
-
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
3053
|
-
}
|
|
3054
3085
|
function getDocumentRect(element) {
|
|
3055
3086
|
const html = getDocumentElement(element);
|
|
3056
3087
|
const scroll = getNodeScroll(element);
|
|
@@ -3069,6 +3100,7 @@ function getDocumentRect(element) {
|
|
|
3069
3100
|
y: y2
|
|
3070
3101
|
};
|
|
3071
3102
|
}
|
|
3103
|
+
const SCROLLBAR_MAX = 25;
|
|
3072
3104
|
function getViewportRect(element, strategy) {
|
|
3073
3105
|
const win = getWindow(element);
|
|
3074
3106
|
const html = getDocumentElement(element);
|
|
@@ -3086,6 +3118,19 @@ function getViewportRect(element, strategy) {
|
|
|
3086
3118
|
y2 = visualViewport.offsetTop;
|
|
3087
3119
|
}
|
|
3088
3120
|
}
|
|
3121
|
+
const windowScrollbarX = getWindowScrollBarX(html);
|
|
3122
|
+
if (windowScrollbarX <= 0) {
|
|
3123
|
+
const doc = html.ownerDocument;
|
|
3124
|
+
const body = doc.body;
|
|
3125
|
+
const bodyStyles = getComputedStyle(body);
|
|
3126
|
+
const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
3127
|
+
const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
3128
|
+
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
|
|
3129
|
+
width -= clippingStableScrollbarWidth;
|
|
3130
|
+
}
|
|
3131
|
+
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
3132
|
+
width += windowScrollbarX;
|
|
3133
|
+
}
|
|
3089
3134
|
return {
|
|
3090
3135
|
width,
|
|
3091
3136
|
height,
|
|
@@ -3120,9 +3165,10 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
|
3120
3165
|
} else {
|
|
3121
3166
|
const visualOffsets = getVisualOffsets(element);
|
|
3122
3167
|
rect = {
|
|
3123
|
-
...clippingAncestor,
|
|
3124
3168
|
x: clippingAncestor.x - visualOffsets.x,
|
|
3125
|
-
y: clippingAncestor.y - visualOffsets.y
|
|
3169
|
+
y: clippingAncestor.y - visualOffsets.y,
|
|
3170
|
+
width: clippingAncestor.width,
|
|
3171
|
+
height: clippingAncestor.height
|
|
3126
3172
|
};
|
|
3127
3173
|
}
|
|
3128
3174
|
return rectToClientRect(rect);
|
|
@@ -3149,7 +3195,7 @@ function getClippingElementAncestors(element, cache) {
|
|
|
3149
3195
|
if (!currentNodeIsContaining && computedStyle.position === "fixed") {
|
|
3150
3196
|
currentContainingBlockComputedStyle = null;
|
|
3151
3197
|
}
|
|
3152
|
-
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle &&
|
|
3198
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === "absolute" || currentContainingBlockComputedStyle.position === "fixed") || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
3153
3199
|
if (shouldDropCurrentNode) {
|
|
3154
3200
|
result = result.filter((ancestor) => ancestor !== currentNode);
|
|
3155
3201
|
} else {
|
|
@@ -3169,20 +3215,23 @@ function getClippingRect(_ref) {
|
|
|
3169
3215
|
} = _ref;
|
|
3170
3216
|
const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
3171
3217
|
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
3172
|
-
const
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3218
|
+
const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
|
|
3219
|
+
let top = firstRect.top;
|
|
3220
|
+
let right = firstRect.right;
|
|
3221
|
+
let bottom = firstRect.bottom;
|
|
3222
|
+
let left = firstRect.left;
|
|
3223
|
+
for (let i2 = 1; i2 < clippingAncestors.length; i2++) {
|
|
3224
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i2], strategy);
|
|
3225
|
+
top = max(rect.top, top);
|
|
3226
|
+
right = min(rect.right, right);
|
|
3227
|
+
bottom = min(rect.bottom, bottom);
|
|
3228
|
+
left = max(rect.left, left);
|
|
3229
|
+
}
|
|
3181
3230
|
return {
|
|
3182
|
-
width:
|
|
3183
|
-
height:
|
|
3184
|
-
x:
|
|
3185
|
-
y:
|
|
3231
|
+
width: right - left,
|
|
3232
|
+
height: bottom - top,
|
|
3233
|
+
x: left,
|
|
3234
|
+
y: top
|
|
3186
3235
|
};
|
|
3187
3236
|
}
|
|
3188
3237
|
function getDimensions(element) {
|
|
@@ -3205,6 +3254,9 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
3205
3254
|
scrollTop: 0
|
|
3206
3255
|
};
|
|
3207
3256
|
const offsets = createCoords(0);
|
|
3257
|
+
function setLeftRTLScrollbarOffset() {
|
|
3258
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
3259
|
+
}
|
|
3208
3260
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
3209
3261
|
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
3210
3262
|
scroll = getNodeScroll(offsetParent);
|
|
@@ -3214,11 +3266,15 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
3214
3266
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
3215
3267
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
3216
3268
|
} else if (documentElement) {
|
|
3217
|
-
|
|
3269
|
+
setLeftRTLScrollbarOffset();
|
|
3218
3270
|
}
|
|
3219
3271
|
}
|
|
3220
|
-
|
|
3221
|
-
|
|
3272
|
+
if (isFixed && !isOffsetParentAnElement && documentElement) {
|
|
3273
|
+
setLeftRTLScrollbarOffset();
|
|
3274
|
+
}
|
|
3275
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
3276
|
+
const x2 = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
3277
|
+
const y2 = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
3222
3278
|
return {
|
|
3223
3279
|
x: x2,
|
|
3224
3280
|
y: y2,
|
|
@@ -3236,7 +3292,11 @@ function getTrueOffsetParent(element, polyfill) {
|
|
|
3236
3292
|
if (polyfill) {
|
|
3237
3293
|
return polyfill(element);
|
|
3238
3294
|
}
|
|
3239
|
-
|
|
3295
|
+
let rawOffsetParent = element.offsetParent;
|
|
3296
|
+
if (getDocumentElement(element) === rawOffsetParent) {
|
|
3297
|
+
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
3298
|
+
}
|
|
3299
|
+
return rawOffsetParent;
|
|
3240
3300
|
}
|
|
3241
3301
|
function getOffsetParent(element, polyfill) {
|
|
3242
3302
|
const win = getWindow(element);
|
|
@@ -3291,6 +3351,9 @@ const platform = {
|
|
|
3291
3351
|
isElement,
|
|
3292
3352
|
isRTL
|
|
3293
3353
|
};
|
|
3354
|
+
function rectsAreEqual(a2, b2) {
|
|
3355
|
+
return a2.x === b2.x && a2.y === b2.y && a2.width === b2.width && a2.height === b2.height;
|
|
3356
|
+
}
|
|
3294
3357
|
function observeMove(element, onMove) {
|
|
3295
3358
|
let io = null;
|
|
3296
3359
|
let timeoutId;
|
|
@@ -3309,12 +3372,13 @@ function observeMove(element, onMove) {
|
|
|
3309
3372
|
threshold = 1;
|
|
3310
3373
|
}
|
|
3311
3374
|
cleanup();
|
|
3375
|
+
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
3312
3376
|
const {
|
|
3313
3377
|
left,
|
|
3314
3378
|
top,
|
|
3315
3379
|
width,
|
|
3316
3380
|
height
|
|
3317
|
-
} =
|
|
3381
|
+
} = elementRectForRootMargin;
|
|
3318
3382
|
if (!skip) {
|
|
3319
3383
|
onMove();
|
|
3320
3384
|
}
|
|
@@ -3345,6 +3409,9 @@ function observeMove(element, onMove) {
|
|
|
3345
3409
|
refresh(false, ratio);
|
|
3346
3410
|
}
|
|
3347
3411
|
}
|
|
3412
|
+
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
3413
|
+
refresh();
|
|
3414
|
+
}
|
|
3348
3415
|
isFirstUpdate = false;
|
|
3349
3416
|
}
|
|
3350
3417
|
try {
|
|
@@ -3353,7 +3420,7 @@ function observeMove(element, onMove) {
|
|
|
3353
3420
|
// Handle <iframe>s
|
|
3354
3421
|
root: root.ownerDocument
|
|
3355
3422
|
});
|
|
3356
|
-
} catch (
|
|
3423
|
+
} catch (_e) {
|
|
3357
3424
|
io = new IntersectionObserver(handleObserve, options2);
|
|
3358
3425
|
}
|
|
3359
3426
|
io.observe(element);
|
|
@@ -3373,7 +3440,7 @@ function autoUpdate(reference, floating, update, options2) {
|
|
|
3373
3440
|
animationFrame = false
|
|
3374
3441
|
} = options2;
|
|
3375
3442
|
const referenceEl = unwrapElement(reference);
|
|
3376
|
-
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
|
|
3443
|
+
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
|
|
3377
3444
|
ancestors.forEach((ancestor) => {
|
|
3378
3445
|
ancestorScroll && ancestor.addEventListener("scroll", update, {
|
|
3379
3446
|
passive: true
|
|
@@ -3386,7 +3453,7 @@ function autoUpdate(reference, floating, update, options2) {
|
|
|
3386
3453
|
if (elementResize) {
|
|
3387
3454
|
resizeObserver = new ResizeObserver((_ref) => {
|
|
3388
3455
|
let [firstEntry] = _ref;
|
|
3389
|
-
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
3456
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {
|
|
3390
3457
|
resizeObserver.unobserve(floating);
|
|
3391
3458
|
cancelAnimationFrame(reobserveFrame);
|
|
3392
3459
|
reobserveFrame = requestAnimationFrame(() => {
|
|
@@ -3399,7 +3466,9 @@ function autoUpdate(reference, floating, update, options2) {
|
|
|
3399
3466
|
if (referenceEl && !animationFrame) {
|
|
3400
3467
|
resizeObserver.observe(referenceEl);
|
|
3401
3468
|
}
|
|
3402
|
-
|
|
3469
|
+
if (floating) {
|
|
3470
|
+
resizeObserver.observe(floating);
|
|
3471
|
+
}
|
|
3403
3472
|
}
|
|
3404
3473
|
let frameId;
|
|
3405
3474
|
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
@@ -3408,7 +3477,7 @@ function autoUpdate(reference, floating, update, options2) {
|
|
|
3408
3477
|
}
|
|
3409
3478
|
function frameLoop() {
|
|
3410
3479
|
const nextRefRect = getBoundingClientRect(reference);
|
|
3411
|
-
if (prevRefRect && (
|
|
3480
|
+
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
3412
3481
|
update();
|
|
3413
3482
|
}
|
|
3414
3483
|
prevRefRect = nextRefRect;
|
|
@@ -5279,6 +5348,8 @@ var createTranslation = (defaultTerms) => {
|
|
|
5279
5348
|
};
|
|
5280
5349
|
const { TranslationProvider, createTFunction, useTranslation } = createTranslation({
|
|
5281
5350
|
a11y_label: "How was your experience?",
|
|
5351
|
+
positive_label: "Good",
|
|
5352
|
+
negative_label: "Bad",
|
|
5282
5353
|
positive_heading: "Thanks!",
|
|
5283
5354
|
negative_heading: "We’re sorry to hear that",
|
|
5284
5355
|
positive_text: "Would you like to tell us more about your experience?",
|
|
@@ -5287,7 +5358,8 @@ const { TranslationProvider, createTFunction, useTranslation } = createTranslati
|
|
|
5287
5358
|
submitting: "Sending feedback...",
|
|
5288
5359
|
skip: "No, thanks",
|
|
5289
5360
|
submitted_heading: "Thank you!",
|
|
5290
|
-
submitted_text: "Your feedback has been sent and will be used to improve our products."
|
|
5361
|
+
submitted_text: "Your feedback has been sent and will be used to improve our products.",
|
|
5362
|
+
comment_minimum: "Please type more characters in the comment box"
|
|
5291
5363
|
});
|
|
5292
5364
|
var COLOR_SHADES = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
|
|
5293
5365
|
var OKLCH_PRESETS = {
|
|
@@ -5411,52 +5483,62 @@ var designTokens = () => {
|
|
|
5411
5483
|
};
|
|
5412
5484
|
};
|
|
5413
5485
|
const [black, white, transparent] = ["oklch(0 0 0)", "oklch(100 0 0)", "transparent"];
|
|
5414
|
-
const tokens = designTokens().core(({ theme }) =>
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5486
|
+
const tokens = designTokens().core(({ theme }) => {
|
|
5487
|
+
const accent = generatePalette({
|
|
5488
|
+
prefix: "a-",
|
|
5489
|
+
hue: theme.accent.hue,
|
|
5490
|
+
chroma: theme.accent.chroma,
|
|
5491
|
+
mode: theme.mode,
|
|
5492
|
+
transform: sameAsInput
|
|
5493
|
+
});
|
|
5494
|
+
const exact = theme.exactAccent;
|
|
5495
|
+
return {
|
|
5496
|
+
color: {
|
|
5497
|
+
transparent,
|
|
5498
|
+
black,
|
|
5499
|
+
white,
|
|
5500
|
+
lowest: theme.mode === "light" ? white : black,
|
|
5501
|
+
highest: theme.mode === "light" ? black : white,
|
|
5502
|
+
...accent,
|
|
5503
|
+
/** The solid accent fill (the submit button), pressed, and its text. An exact accent lands unchanged here only:
|
|
5504
|
+
* text and focus rings keep the palette's contrast-controlled shades. */
|
|
5505
|
+
"a-solid": (exact == null ? void 0 : exact.color) ?? accent["a-9"],
|
|
5506
|
+
"a-solid-pressed": exact ? `color-mix(in oklab, ${exact.color} 88%, black)` : theme.mode === "light" ? accent["a-10"] : accent["a-8"],
|
|
5507
|
+
"on-a": (exact == null ? void 0 : exact.text) ?? (theme.mode === "light" ? accent["a-1"] : white),
|
|
5508
|
+
...generatePalette({
|
|
5509
|
+
prefix: "n-",
|
|
5510
|
+
hue: theme.accent.hue,
|
|
5511
|
+
// An achromatic accent gets achromatic neutrals; otherwise neutrals carry a faint tint of the accent hue.
|
|
5512
|
+
chroma: theme.accent.chroma === 0 ? 0 : 0.05,
|
|
5513
|
+
mode: theme.mode,
|
|
5514
|
+
transform: sameAsInput
|
|
5515
|
+
}),
|
|
5516
|
+
...generatePalette({
|
|
5517
|
+
prefix: "p-",
|
|
5518
|
+
hue: theme.positive.hue,
|
|
5519
|
+
chroma: theme.positive.chroma,
|
|
5520
|
+
mode: theme.mode,
|
|
5521
|
+
transform: sameAsInput
|
|
5522
|
+
}),
|
|
5523
|
+
...generatePalette({
|
|
5524
|
+
prefix: "e-",
|
|
5525
|
+
hue: theme.negative.hue,
|
|
5526
|
+
chroma: theme.negative.chroma,
|
|
5527
|
+
mode: theme.mode,
|
|
5528
|
+
transform: sameAsInput
|
|
5529
|
+
})
|
|
5530
|
+
},
|
|
5531
|
+
radius: {
|
|
5532
|
+
base: theme.corners === "rounded" ? ".25rem" : theme.corners === "soft" ? ".125rem" : "0",
|
|
5533
|
+
multiplier: theme.corners === "rounded" ? "0.5rem" : theme.corners === "soft" ? "0.175rem" : "0"
|
|
5534
|
+
},
|
|
5535
|
+
duration: {
|
|
5536
|
+
snappy: ".4s",
|
|
5537
|
+
medium: ".6s",
|
|
5538
|
+
slow: ".9s"
|
|
5539
|
+
}
|
|
5540
|
+
};
|
|
5541
|
+
}).semantic(({ core }) => ({
|
|
5460
5542
|
radius: {
|
|
5461
5543
|
sm: `calc(${core("radius.base")} + (0 * ${core("radius.multiplier")}))`,
|
|
5462
5544
|
md: `calc(${core("radius.base")} + (1 * ${core("radius.multiplier")}))`,
|
|
@@ -5538,12 +5620,12 @@ function noop() {
|
|
|
5538
5620
|
}
|
|
5539
5621
|
const options = [
|
|
5540
5622
|
{
|
|
5541
|
-
label: "
|
|
5623
|
+
label: "positive_label",
|
|
5542
5624
|
icon: /* @__PURE__ */ u$1(Icon, { name: "happy" }),
|
|
5543
5625
|
value: 1,
|
|
5544
5626
|
variant: "positive"
|
|
5545
5627
|
},
|
|
5546
|
-
{ label: "
|
|
5628
|
+
{ label: "negative_label", icon: /* @__PURE__ */ u$1(Icon, { name: "sad" }), value: -1, variant: "negative" }
|
|
5547
5629
|
];
|
|
5548
5630
|
const submitWithMetaEnter = (e2) => {
|
|
5549
5631
|
const isSubmitCombo = e2.key === "Enter" && e2.metaKey;
|
|
@@ -5561,24 +5643,30 @@ const Label = () => {
|
|
|
5561
5643
|
const FeedbackWidget = ({ analytics, params, logger }) => {
|
|
5562
5644
|
const variants = getThemeVariants(params.theme).join(" ");
|
|
5563
5645
|
const id = g$1();
|
|
5646
|
+
const ratings = A$1(null);
|
|
5647
|
+
const t2 = T$1(
|
|
5648
|
+
() => createTFunction({ overrides: params.terms ?? {}, locale: params.locale }),
|
|
5649
|
+
[params.terms, params.locale]
|
|
5650
|
+
);
|
|
5564
5651
|
const [score, setScore] = d(0);
|
|
5565
5652
|
const [open, setOpen] = d();
|
|
5566
|
-
return /* @__PURE__ */ u$1(TranslationProvider, { locale:
|
|
5653
|
+
return /* @__PURE__ */ u$1(TranslationProvider, { locale: params.locale, terms: params.terms, children: /* @__PURE__ */ u$1("div", { role: "group", "aria-labelledby": `${id}-label`, class: variants, children: [
|
|
5567
5654
|
/* @__PURE__ */ u$1("span", { id: `${id}-label`, className: "sr-only", children: /* @__PURE__ */ u$1(Label, {}) }),
|
|
5568
|
-
/* @__PURE__ */ u$1("div", { class: "isolate flex", children: options.map((option) => /* @__PURE__ */ u$1(
|
|
5655
|
+
/* @__PURE__ */ u$1("div", { ref: ratings, class: "isolate flex", children: options.map((option) => /* @__PURE__ */ u$1(
|
|
5569
5656
|
$cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,
|
|
5570
5657
|
{
|
|
5571
5658
|
open: open === option.value,
|
|
5572
|
-
onOpenChange: () => {
|
|
5573
|
-
if (
|
|
5574
|
-
|
|
5575
|
-
|
|
5659
|
+
onOpenChange: (next) => {
|
|
5660
|
+
if (next)
|
|
5661
|
+
setOpen(option.value);
|
|
5662
|
+
else
|
|
5663
|
+
setOpen((current) => current === option.value ? void 0 : current);
|
|
5576
5664
|
},
|
|
5577
5665
|
children: [
|
|
5578
5666
|
/* @__PURE__ */ u$1(
|
|
5579
5667
|
$cb5cc270b50c6fcd$export$41fb9f06171c75f4,
|
|
5580
5668
|
{
|
|
5581
|
-
"aria-label": option.label,
|
|
5669
|
+
"aria-label": t2(option.label),
|
|
5582
5670
|
"aria-pressed": score === option.value,
|
|
5583
5671
|
class: buttonClass({ colorScheme: option.variant, size: params.size }),
|
|
5584
5672
|
onClick: (e2) => {
|
|
@@ -5603,10 +5691,26 @@ const FeedbackWidget = ({ analytics, params, logger }) => {
|
|
|
5603
5691
|
/* @__PURE__ */ u$1($cb5cc270b50c6fcd$export$602eac185826482c, { container: params.host, children: /* @__PURE__ */ u$1("div", { "data-widget": FEEDBACK_WIDGET_ID, "data-key": params.key, children: /* @__PURE__ */ u$1("div", { class: clsx$1("absolute isolate z-50", variants), children: /* @__PURE__ */ u$1(
|
|
5604
5692
|
$cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,
|
|
5605
5693
|
{
|
|
5694
|
+
"aria-labelledby": `${id}-${option.value}-heading`,
|
|
5695
|
+
onInteractOutside: (event) => {
|
|
5696
|
+
var _a;
|
|
5697
|
+
const target = event.detail.originalEvent.target;
|
|
5698
|
+
if (target instanceof Element && ((_a = ratings.current) == null ? void 0 : _a.contains(target.closest("button[aria-pressed]"))))
|
|
5699
|
+
event.preventDefault();
|
|
5700
|
+
},
|
|
5606
5701
|
collisionPadding: 16,
|
|
5607
5702
|
class: "data-[state=open]:animate-slideDownAndFade bg-lowest ring-neutral-5 shadow-surface-lg isolate w-64 max-w-[var(--radix-popover-content-available-width)] rounded-lg p-2 ring-1 will-change-[transform,opacity]",
|
|
5608
5703
|
sideOffset: 5,
|
|
5609
|
-
children: /* @__PURE__ */ u$1(
|
|
5704
|
+
children: /* @__PURE__ */ u$1(
|
|
5705
|
+
CommentForm,
|
|
5706
|
+
{
|
|
5707
|
+
analytics,
|
|
5708
|
+
params,
|
|
5709
|
+
onClose: () => setOpen(0),
|
|
5710
|
+
score,
|
|
5711
|
+
headingId: `${id}-${option.value}-heading`
|
|
5712
|
+
}
|
|
5713
|
+
)
|
|
5610
5714
|
}
|
|
5611
5715
|
) }) }) })
|
|
5612
5716
|
]
|
|
@@ -5619,20 +5723,40 @@ const CommentForm = ({
|
|
|
5619
5723
|
params,
|
|
5620
5724
|
onClose,
|
|
5621
5725
|
score,
|
|
5622
|
-
analytics
|
|
5726
|
+
analytics,
|
|
5727
|
+
headingId
|
|
5623
5728
|
}) => {
|
|
5624
5729
|
const { t: t2 } = useTranslation();
|
|
5625
5730
|
const id = g$1();
|
|
5731
|
+
const form = A$1(null);
|
|
5732
|
+
const success = A$1(null);
|
|
5733
|
+
const transferFocus = A$1(false);
|
|
5626
5734
|
const [submission, setSubmission] = d({ state: "idle" });
|
|
5735
|
+
_(() => {
|
|
5736
|
+
var _a;
|
|
5737
|
+
if (submission.state === "success" && transferFocus.current)
|
|
5738
|
+
(_a = success.current) == null ? void 0 : _a.focus({ preventScroll: true });
|
|
5739
|
+
}, [submission.state]);
|
|
5627
5740
|
if (submission.state === "success") {
|
|
5628
|
-
return /* @__PURE__ */ u$1(
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5741
|
+
return /* @__PURE__ */ u$1(
|
|
5742
|
+
"div",
|
|
5743
|
+
{
|
|
5744
|
+
ref: success,
|
|
5745
|
+
tabIndex: -1,
|
|
5746
|
+
role: "status",
|
|
5747
|
+
"aria-labelledby": headingId,
|
|
5748
|
+
class: "flex flex-col gap-1 text-balance p-4 text-center",
|
|
5749
|
+
children: [
|
|
5750
|
+
/* @__PURE__ */ u$1("p", { id: headingId, class: "text-neutral-12 text-pretty text-base font-semibold leading-tight tracking-tight", children: t2("submitted_heading") }),
|
|
5751
|
+
/* @__PURE__ */ u$1("p", { class: "text-neutral-11 text-pretty text-sm leading-tight", children: t2("submitted_text") })
|
|
5752
|
+
]
|
|
5753
|
+
}
|
|
5754
|
+
);
|
|
5632
5755
|
}
|
|
5633
5756
|
return /* @__PURE__ */ u$1(
|
|
5634
5757
|
"form",
|
|
5635
5758
|
{
|
|
5759
|
+
ref: form,
|
|
5636
5760
|
class: "flex flex-col gap-2.5 p-2",
|
|
5637
5761
|
onSubmit: (e2) => {
|
|
5638
5762
|
e2.preventDefault();
|
|
@@ -5640,7 +5764,7 @@ const CommentForm = ({
|
|
|
5640
5764
|
const formData = new FormData(e2.currentTarget);
|
|
5641
5765
|
const comment = formData.get("comment");
|
|
5642
5766
|
if (typeof comment !== "string" || comment.length <= 5) {
|
|
5643
|
-
setSubmission({ state: "error", error: "
|
|
5767
|
+
setSubmission({ state: "error", error: t2("comment_minimum") });
|
|
5644
5768
|
return;
|
|
5645
5769
|
}
|
|
5646
5770
|
Promise.all([
|
|
@@ -5648,8 +5772,9 @@ const CommentForm = ({
|
|
|
5648
5772
|
/** Min delay of 500ms so it feels like it’s doing stuff */
|
|
5649
5773
|
new Promise((resolve) => setTimeout(resolve, 1e3))
|
|
5650
5774
|
]).then(() => {
|
|
5651
|
-
var _a;
|
|
5775
|
+
var _a, _b, _c;
|
|
5652
5776
|
(_a = params.onLeaveComment) == null ? void 0 : _a.call(params);
|
|
5777
|
+
transferFocus.current = Boolean((_c = (_b = form.current) == null ? void 0 : _b.closest('[role="dialog"]')) == null ? void 0 : _c.contains(document.activeElement));
|
|
5653
5778
|
setSubmission({ state: "success" });
|
|
5654
5779
|
}).catch((e22) => {
|
|
5655
5780
|
if (e22 instanceof Error) {
|
|
@@ -5663,7 +5788,7 @@ const CommentForm = ({
|
|
|
5663
5788
|
/* @__PURE__ */ u$1("input", { type: "hidden", name: "key", value: params.key }),
|
|
5664
5789
|
/* @__PURE__ */ u$1("fieldset", { class: "flex flex-col gap-4", children: [
|
|
5665
5790
|
/* @__PURE__ */ u$1("label", { htmlFor: id, class: "flex flex-col gap-1", children: [
|
|
5666
|
-
/* @__PURE__ */ u$1("p", { class: "text-neutral-12 text-pretty text-base font-semibold leading-tight tracking-tight", children: t2(score === -1 ? "negative_heading" : "positive_heading") }),
|
|
5791
|
+
/* @__PURE__ */ u$1("p", { id: headingId, class: "text-neutral-12 text-pretty text-base font-semibold leading-tight tracking-tight", children: t2(score === -1 ? "negative_heading" : "positive_heading") }),
|
|
5667
5792
|
/* @__PURE__ */ u$1("p", { class: "text-neutral-11 text-pretty text-sm leading-tight", children: t2(score === -1 ? "negative_text" : "positive_text") })
|
|
5668
5793
|
] }),
|
|
5669
5794
|
/* @__PURE__ */ u$1("div", { class: "flex flex-col gap-2", children: [
|
|
@@ -5677,7 +5802,7 @@ const CommentForm = ({
|
|
|
5677
5802
|
id
|
|
5678
5803
|
}
|
|
5679
5804
|
),
|
|
5680
|
-
submission.state === "error" ? /* @__PURE__ */ u$1("div", { role: "alert", class: "
|
|
5805
|
+
submission.state === "error" ? /* @__PURE__ */ u$1("div", { role: "alert", class: "flex gap-1 text-balance text-xs", children: [
|
|
5681
5806
|
/* @__PURE__ */ u$1(Icon, { name: "warning", class: "size-[1lh] flex-none" }),
|
|
5682
5807
|
submission.error
|
|
5683
5808
|
] }) : null
|
|
@@ -5688,7 +5813,7 @@ const CommentForm = ({
|
|
|
5688
5813
|
"button",
|
|
5689
5814
|
{
|
|
5690
5815
|
onTouchStart: noop,
|
|
5691
|
-
class: "bg-accent-
|
|
5816
|
+
class: "bg-accent-solid active:bg-accent-solid-pressed fr ease-expo-out duration-snappy text-on-accent grid items-center overflow-hidden rounded-lg px-5 py-2 pl-2.5 text-center transition-all hover:scale-[1.02] active:scale-[.97]",
|
|
5692
5817
|
children: submission.state === "submitting" ? t2("submitting") : t2("submit")
|
|
5693
5818
|
}
|
|
5694
5819
|
),
|
|
@@ -6170,8 +6295,8 @@ const tailwind = `[data-widget='inploi-feedback'] {
|
|
|
6170
6295
|
border-width: 1px;
|
|
6171
6296
|
}
|
|
6172
6297
|
|
|
6173
|
-
[data-widget='inploi-feedback'] .bg-accent-
|
|
6174
|
-
background-color: var(--i-color-a-
|
|
6298
|
+
[data-widget='inploi-feedback'] .bg-accent-solid {
|
|
6299
|
+
background-color: var(--i-color-a-solid);
|
|
6175
6300
|
}
|
|
6176
6301
|
|
|
6177
6302
|
[data-widget='inploi-feedback'] .bg-lowest {
|
|
@@ -6289,10 +6414,6 @@ const tailwind = `[data-widget='inploi-feedback'] {
|
|
|
6289
6414
|
letter-spacing: -0.025em;
|
|
6290
6415
|
}
|
|
6291
6416
|
|
|
6292
|
-
[data-widget='inploi-feedback'] .text-accent-1 {
|
|
6293
|
-
color: var(--i-color-a-1);
|
|
6294
|
-
}
|
|
6295
|
-
|
|
6296
6417
|
[data-widget='inploi-feedback'] .text-accent-10 {
|
|
6297
6418
|
color: var(--i-color-a-10);
|
|
6298
6419
|
}
|
|
@@ -6309,6 +6430,10 @@ const tailwind = `[data-widget='inploi-feedback'] {
|
|
|
6309
6430
|
color: var(--i-color-n-12);
|
|
6310
6431
|
}
|
|
6311
6432
|
|
|
6433
|
+
[data-widget='inploi-feedback'] .text-on-accent {
|
|
6434
|
+
color: var(--i-color-on-a);
|
|
6435
|
+
}
|
|
6436
|
+
|
|
6312
6437
|
[data-widget='inploi-feedback'] .underline {
|
|
6313
6438
|
text-decoration-line: underline;
|
|
6314
6439
|
}
|
|
@@ -6344,6 +6469,12 @@ const tailwind = `[data-widget='inploi-feedback'] {
|
|
|
6344
6469
|
outline-style: solid;
|
|
6345
6470
|
}
|
|
6346
6471
|
|
|
6472
|
+
[data-widget='inploi-feedback'] .ring {
|
|
6473
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
6474
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
6475
|
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
6476
|
+
}
|
|
6477
|
+
|
|
6347
6478
|
[data-widget='inploi-feedback'] .ring-1 {
|
|
6348
6479
|
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
6349
6480
|
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
@@ -6516,8 +6647,8 @@ const tailwind = `[data-widget='inploi-feedback'] {
|
|
|
6516
6647
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
6517
6648
|
}
|
|
6518
6649
|
|
|
6519
|
-
[data-widget='inploi-feedback'] .active\\:bg-accent-
|
|
6520
|
-
background-color: var(--i-color-a-
|
|
6650
|
+
[data-widget='inploi-feedback'] .active\\:bg-accent-solid-pressed:active {
|
|
6651
|
+
background-color: var(--i-color-a-solid-pressed);
|
|
6521
6652
|
}
|
|
6522
6653
|
|
|
6523
6654
|
[data-widget='inploi-feedback'] .aria-\\[pressed\\=true\\]\\:text-negative-11[aria-pressed="true"] {
|
|
@@ -6555,14 +6686,6 @@ const tailwind = `[data-widget='inploi-feedback'] {
|
|
|
6555
6686
|
color: var(--i-color-a-10);
|
|
6556
6687
|
}
|
|
6557
6688
|
|
|
6558
|
-
[data-widget='inploi-feedback'] .dark .theme-dark\\:text-highest {
|
|
6559
|
-
color: var(--i-color-highest);
|
|
6560
|
-
}
|
|
6561
|
-
|
|
6562
|
-
[data-widget='inploi-feedback'] .dark .theme-dark\\:active\\:bg-accent-8:active {
|
|
6563
|
-
background-color: var(--i-color-a-8);
|
|
6564
|
-
}
|
|
6565
|
-
|
|
6566
6689
|
[data-widget='inploi-feedback'] .rounded .theme-rounded\\:rounded-sm {
|
|
6567
6690
|
border-radius: var(--i-radius-sm);
|
|
6568
6691
|
}
|
|
@@ -6651,6 +6774,7 @@ const createFeedbackDomManager = (logger) => {
|
|
|
6651
6774
|
const feedbackPlugin = () => sdk.createPlugin(({ apiClient, logger, analytics }) => {
|
|
6652
6775
|
const dom = createFeedbackDomManager(logger);
|
|
6653
6776
|
let prerendered = false;
|
|
6777
|
+
const targets = /* @__PURE__ */ new Set();
|
|
6654
6778
|
const App = ({ params }) => {
|
|
6655
6779
|
return _$2(k$3, {}, [
|
|
6656
6780
|
[
|
|
@@ -6678,7 +6802,15 @@ const feedbackPlugin = () => sdk.createPlugin(({ apiClient, logger, analytics })
|
|
|
6678
6802
|
typeof window !== "undefined",
|
|
6679
6803
|
"the `render` method of JobSearch cannot be called in non-browser environments. Use `prerender` instead."
|
|
6680
6804
|
);
|
|
6681
|
-
|
|
6805
|
+
const target = params.target ?? dom.getRenderTargetElement(params.key);
|
|
6806
|
+
targets.add(target);
|
|
6807
|
+
fn2(_$2(App, { params }), target);
|
|
6808
|
+
},
|
|
6809
|
+
/** Release components, portals and document listeners when an owning widget unmounts. */
|
|
6810
|
+
destroy: () => {
|
|
6811
|
+
for (const target of targets)
|
|
6812
|
+
J$1(null, target);
|
|
6813
|
+
targets.clear();
|
|
6682
6814
|
},
|
|
6683
6815
|
"~brand": "@inploi/plugin-feedback"
|
|
6684
6816
|
};
|