@measured/puck-plugin-heading-analyzer 0.14.2-canary.e6e01c6 → 0.14.3-canary.73b83ef
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +1755 -380
- package/package.json +2 -2
package/dist/index.js
CHANGED
@@ -34978,36 +34978,33 @@ function querySelectorAll(parentNode, selector) {
|
|
34978
34978
|
function getOptions(shared2, fromBinding) {
|
34979
34979
|
return __spreadValues(__spreadValues({}, shared2), fromBinding);
|
34980
34980
|
}
|
34981
|
-
function bindEvent(
|
34981
|
+
function bindEvent(win, binding, options) {
|
34982
34982
|
let timer;
|
34983
|
-
if (
|
34983
|
+
if (!loaded) {
|
34984
34984
|
timer = setInterval(() => {
|
34985
|
-
|
34986
|
-
|
34987
|
-
|
34988
|
-
clearInterval(timer);
|
34985
|
+
if (win.document.readyState === "complete") {
|
34986
|
+
win.addEventListener(binding.eventName, binding.fn, options);
|
34987
|
+
loaded = true;
|
34989
34988
|
}
|
34990
34989
|
}, 100);
|
34991
|
-
|
34990
|
+
} else {
|
34991
|
+
win.addEventListener(binding.eventName, binding.fn, options);
|
34992
34992
|
}
|
34993
|
-
const win = getWin(el);
|
34994
|
-
win == null ? void 0 : win.addEventListener(binding.eventName, binding.fn, options);
|
34995
34993
|
return timer;
|
34996
34994
|
}
|
34997
34995
|
function bindEvents(el, bindings, sharedOptions) {
|
34998
34996
|
const unbindings = bindings.flatMap((binding) => {
|
34999
34997
|
const iframes = querySelectorAll(window.document, "[data-rfd-iframe]");
|
35000
|
-
const
|
35001
|
-
return
|
35002
|
-
if (!
|
34998
|
+
const windows = [el, ...iframes.map((iframe) => iframe.contentWindow)];
|
34999
|
+
return windows.map((win) => {
|
35000
|
+
if (!win)
|
35003
35001
|
return function unbind() {
|
35004
35002
|
};
|
35005
35003
|
const options = getOptions(sharedOptions, binding.options);
|
35006
|
-
const timer = bindEvent(
|
35004
|
+
const timer = bindEvent(win, binding, options);
|
35007
35005
|
return function unbind() {
|
35008
35006
|
clearInterval(timer);
|
35009
|
-
|
35010
|
-
win == null ? void 0 : win.removeEventListener(binding.eventName, binding.fn, options);
|
35007
|
+
win.removeEventListener(binding.eventName, binding.fn, options);
|
35011
35008
|
};
|
35012
35009
|
});
|
35013
35010
|
});
|
@@ -35207,6 +35204,26 @@ function getFurthestAway({
|
|
35207
35204
|
}).sort((a2, b) => b.distance - a2.distance);
|
35208
35205
|
return sorted[0] ? sorted[0].id : null;
|
35209
35206
|
}
|
35207
|
+
function normalizeFamilies(pageBorderBox, candidates) {
|
35208
|
+
const families = candidates.reduce((acc, candidate) => {
|
35209
|
+
var _a3;
|
35210
|
+
const familyName = ((_a3 = candidate.parents[0]) == null ? void 0 : _a3.id) || candidate.descriptor.id;
|
35211
|
+
const family = acc[familyName] || [];
|
35212
|
+
const generation = candidate.parents.length;
|
35213
|
+
family[generation] = [...family[generation] || [], candidate];
|
35214
|
+
return __spreadProps(__spreadValues({}, acc), {
|
35215
|
+
[familyName]: family
|
35216
|
+
});
|
35217
|
+
}, {});
|
35218
|
+
return Object.keys(families).map((familyName) => {
|
35219
|
+
const family = families[familyName].flat();
|
35220
|
+
const reversedFamily = [...family].reverse();
|
35221
|
+
const chosenMember = reversedFamily.find((member) => {
|
35222
|
+
return pageBorderBox.center.x < member.page.borderBox.right && pageBorderBox.center.x > member.page.borderBox.left && pageBorderBox.center.y > member.page.borderBox.top && pageBorderBox.center.y < member.page.borderBox.bottom;
|
35223
|
+
});
|
35224
|
+
return chosenMember || family[0];
|
35225
|
+
});
|
35226
|
+
}
|
35210
35227
|
function getDroppableOver({
|
35211
35228
|
pageBorderBox,
|
35212
35229
|
draggable: draggable2,
|
@@ -35247,10 +35264,14 @@ function getDroppableOver({
|
|
35247
35264
|
if (candidates.length === 1) {
|
35248
35265
|
return candidates[0].descriptor.id;
|
35249
35266
|
}
|
35267
|
+
const normalizedCandidates = normalizeFamilies(pageBorderBox, candidates);
|
35268
|
+
if (normalizedCandidates.length === 1) {
|
35269
|
+
return normalizedCandidates[0].descriptor.id;
|
35270
|
+
}
|
35250
35271
|
return getFurthestAway({
|
35251
35272
|
pageBorderBox,
|
35252
35273
|
draggable: draggable2,
|
35253
|
-
candidates
|
35274
|
+
candidates: normalizedCandidates
|
35254
35275
|
});
|
35255
35276
|
}
|
35256
35277
|
function getIsDisplaced({
|
@@ -35935,20 +35956,22 @@ function offsetPoint(x, y, win) {
|
|
35935
35956
|
let offsetY = 0;
|
35936
35957
|
if (win.parent !== win.self) {
|
35937
35958
|
const iframe = win.frameElement;
|
35938
|
-
|
35939
|
-
|
35940
|
-
|
35941
|
-
|
35942
|
-
|
35943
|
-
|
35944
|
-
|
35945
|
-
|
35946
|
-
|
35947
|
-
|
35948
|
-
|
35949
|
-
|
35950
|
-
|
35951
|
-
|
35959
|
+
if (iframe) {
|
35960
|
+
const rect = iframe.getBoundingClientRect();
|
35961
|
+
const transform = getTransform(iframe);
|
35962
|
+
offsetX = rect.left;
|
35963
|
+
offsetY = rect.top;
|
35964
|
+
if (transform) {
|
35965
|
+
const {
|
35966
|
+
x: transformedX,
|
35967
|
+
y: transformedY
|
35968
|
+
} = applyTransformPoint(x, y, transform.matrix, transform.origin);
|
35969
|
+
const point2 = {
|
35970
|
+
x: transformedX + offsetX,
|
35971
|
+
y: transformedY + offsetY
|
35972
|
+
};
|
35973
|
+
return point2;
|
35974
|
+
}
|
35952
35975
|
}
|
35953
35976
|
}
|
35954
35977
|
const point = {
|
@@ -37621,7 +37644,7 @@ function getBody() {
|
|
37621
37644
|
!document.body ? process.env.NODE_ENV !== "production" ? invariant2(false, "document.body is not ready") : invariant2(false) : void 0;
|
37622
37645
|
return document.body;
|
37623
37646
|
}
|
37624
|
-
var import_react5, import_react_dom2, isProduction$1, spacesAndTabs, lineStartWithSpaces, clean$2, getDevMessage, getFormattedMessage, isDisabledFlag, warning2, error,
|
37647
|
+
var import_react5, import_react_dom2, isProduction$1, spacesAndTabs, lineStartWithSpaces, clean$2, getDevMessage, getFormattedMessage, isDisabledFlag, warning2, error, loaded, isProduction2, prefix$1, RbdInvariant, ErrorBoundary, dragHandleUsageInstructions, position, onDragStart, withLocation, withCombine, onDragUpdate, returnedToStart, onDragEnd, preset, preset$1, origin, add, subtract, isEqual$1, negate, patch, distance2, closest$1, apply, executeClip, offsetByPosition, getCorners, noSpacing2, scroll$1, increase, clip2, getSubject, scrollDroppable, toDroppableMap, toDraggableMap, toDroppableList, toDraggableList, getDraggablesInsideDroppable, removeDraggableFromList, moveToNextCombine, isHomeOf, noDisplacedBy, emptyGroups, noImpact, noImpact$1, isWithin, isPartiallyVisibleThroughFrame, isTotallyVisibleThroughFrame, vertical, horizontal, isTotallyVisibleThroughFrameOnAxis, getDroppableDisplaced, isVisibleInDroppable, isVisibleInViewport, isVisible$1, isPartiallyVisible, isTotallyVisible, isTotallyVisibleOnAxis, getShouldAnimate, fromCombine, fromReorder, moveToNextIndex, getCombinedItemDisplacement, whenCombining, distanceFromStartToBorderBoxCenter, distanceFromEndToBorderBoxCenter, getCrossAxisBorderBoxCenter, goAfter, goBefore, goIntoStart, whenReordering, withDroppableDisplacement, getResultWithoutDroppableDisplacement, getPageBorderBoxCenterFromImpact, scrollViewport, speculativelyIncrease, withViewportDisplacement, getClientFromPageBorderBoxCenter, isTotallyVisibleInNewLocation, moveToNextPlace, getKnownActive, getBestCrossAxisDroppable, getCurrentPageBorderBoxCenter, getCurrentPageBorderBox, getClosestDraggable, getDisplacedBy, getRequiredGrowthForPlaceholder, withMaxScroll, addPlaceholder, removePlaceholder, moveToNewDroppable, moveCrossAxis, whatIsDraggedOver, getDroppableOver$1, moveInDirection, offsetRectByPosition, withDroppableScroll, getReorderImpact, combineThresholdDivisor, getCombineImpact, getDragImpact, patchDroppableMap, clearUnusedPlaceholder, recomputePlaceholders, update, recompute, getClientBorderBoxCenter, refreshSnap, getHomeLocation, getLiftEffect, patchDimensionMap, start, finish, offsetDraggable, getFrame, adjustAdditionsForScrollChanges, timingsKey, publishWhileDraggingInVirtual, isSnapping, postDroppableChange, idle$2, reducer, beforeInitialCapture, lift$1, initialPublish, publishWhileDragging, collectionStarting, updateDroppableScroll, updateDroppableIsEnabled, updateDroppableIsCombineEnabled, move, moveByWindowScroll, updateViewportMaxScroll, moveUp, moveDown, moveRight, moveLeft, flush, animateDrop, completeDrop, drop$1, dropPending, dropAnimationFinished, lift, style, curves, combine, timings, outOfTheWayTiming, transitions, moveTo, transforms, minDropTime, maxDropTime, dropTimeRange, maxDropTimeAtDistance, cancelDropModifier, getDropDuration, getNewHomeClientOffset, getDropImpact, dropMiddleware, drop, getWindowScroll3, shouldEnd, scrollListener, scrollListener$1, getExpiringAnnounce, getAsyncMarshal, areLocationsEqual, isCombineEqual, isCriticalEqual, withTimings, getDragStart, getPublisher, responders, dropAnimationFinishMiddleware, dropAnimationFinish, dropAnimationFlushOnScrollMiddleware, dropAnimationFlushOnScroll, dimensionMarshalStopper, focus, shouldStop, autoScroll, pendingDrop, pendingDrop$1, composeEnhancers, createStore2, clean$1, getMaxScroll, getDocumentElement, getMaxWindowScroll, getViewport, getInitialPublish, createDimensionMarshal, canStartDrag, scrollWindow, getScrollableDroppables, getScrollableDroppableOver, getBestScrollableDroppable, defaultAutoScrollerOptions, getDistanceThresholds, getPercentage, minScroll, getValueFromDistance, dampenValueByTime, getValue, getScrollOnAxis, adjustForSizeLimits, clean, getScroll$1, smallestSigned, getOverlap, canPartiallyScroll, canScrollWindow, getWindowOverlap, canScrollDroppable, getDroppableOverlap, getWindowScrollChange, getDroppableScrollChange, iframeCache, createCol, matrixPattern, getMatrix, getOrigin, findNearestTransform, defaultTransform, getTransform, applyTransformPoint, applyTransformRect, applyTransformSpacing, applyTransformBox, resetToOrigin, getIframeScroll, scroll, createFluidScroller, createJumpScroller, createAutoScroller, prefix2, dragHandle, draggable, droppable, scrollContainer, makeGetSelector, getStyles, noPointerEvents, getStyles$1, useIsomorphicLayoutEffect2, useLayoutEffect2, getHead, createStyleEl, alwaysDataAttr, dynamicDataAttr, getWindowFromEl, dragHandleCache, StoreContext, getBodyElement, visuallyHidden, visuallyHidden$1, getId, count$1, defaults, useUniqueId$1, AppContext, peerDependencies, semver, getVersion, isSatisfied, checkReactVersion, suffix, checkDoctype, tab, enter, escape, space, pageUp, pageDown, end, home, arrowLeft, arrowUp, arrowRight, arrowDown, preventedKeys, preventStandardKeyEvents, supportedEventName, supportedPageVisibilityEventName, primaryButton, sloppyClickThreshold, idle$1, scrollJumpKeys, idle, timeForLongPress, forcePressThreshold, interactiveTagNames, getBorderBoxCenterPosition, supportedMatchesName, defaultSensors, createResponders, createAutoScrollerOptions, count, useUniqueContextId$1, zIndexOptions, getDraggingTransition, getDraggingOpacity, getShouldDraggingAnimate, applyOffsetBox, DroppableContext, Draggable, Draggable$1, isStrictEqual, whatIsDraggedOverFromResult, getCombineWithFromResult, getCombineWithFromImpact, atRest, makeMapStateToProps$1, mapDispatchToProps$1, ConnectedDraggable, ConnectedDraggable$1, getScroll, isEqual2, isScroll, isAuto, isVisible, isEither, isBoth, isElementScrollable, isBodyScrollable, getClosestScrollable, getClosestScrollable$1, getIsFixed, getEnv, getDroppableDimension, getClient, getParents, getDimension, immediate, delayed, getListenerOptions, getScrollable, getClosestScrollableFromDrag, empty, getSize, getStyle, Placeholder, Placeholder$1, shared, standard, virtual, AnimateInOut, Droppable, Droppable$1, defaultProps, attachDefaultPropsToOwnProps, isMatchingType, getDraggable, makeMapStateToProps, mapDispatchToProps, ConnectedDroppable, ConnectedDroppable$1;
|
37625
37648
|
var init_dnd_esm = __esm({
|
37626
37649
|
"../../node_modules/@measured/dnd/dist/dnd.esm.js"() {
|
37627
37650
|
init_react_import();
|
@@ -37650,13 +37673,7 @@ var init_dnd_esm = __esm({
|
|
37650
37673
|
isDisabledFlag = "__@hello-pangea/dnd-disable-dev-warnings";
|
37651
37674
|
warning2 = log.bind(null, "warn");
|
37652
37675
|
error = log.bind(null, "error");
|
37653
|
-
|
37654
|
-
let win = el;
|
37655
|
-
if (el.nodeName === "IFRAME") {
|
37656
|
-
win = el.contentWindow;
|
37657
|
-
}
|
37658
|
-
return win;
|
37659
|
-
};
|
37676
|
+
loaded = false;
|
37660
37677
|
isProduction2 = process.env.NODE_ENV === "production";
|
37661
37678
|
prefix$1 = "Invariant failed";
|
37662
37679
|
RbdInvariant = class extends Error {
|
@@ -41035,7 +41052,7 @@ var init_dnd_esm = __esm({
|
|
41035
41052
|
}
|
41036
41053
|
if (!el.parentElement) {
|
41037
41054
|
const refWindow = el.ownerDocument.defaultView;
|
41038
|
-
if (refWindow && refWindow.self !== refWindow.parent) {
|
41055
|
+
if (refWindow && refWindow.self !== refWindow.parent && refWindow.frameElement) {
|
41039
41056
|
const iframe = refWindow.frameElement;
|
41040
41057
|
return findNearestTransform(iframe);
|
41041
41058
|
}
|
@@ -41157,7 +41174,7 @@ var init_dnd_esm = __esm({
|
|
41157
41174
|
}) => {
|
41158
41175
|
const el = querySelectorAllIframe(`[data-rfd-draggable-id="${state.critical.draggable.id}"]`)[0];
|
41159
41176
|
const win = (el == null ? void 0 : el.ownerDocument.defaultView) || window;
|
41160
|
-
const isInIframe = win !== window;
|
41177
|
+
const isInIframe = win !== window && win.frameElement;
|
41161
41178
|
if (isInIframe) {
|
41162
41179
|
const iframe = win.frameElement;
|
41163
41180
|
const viewportBox = getBox(iframe);
|
@@ -41996,7 +42013,8 @@ var init_dnd_esm = __esm({
|
|
41996
42013
|
client,
|
41997
42014
|
page,
|
41998
42015
|
closest: closest2,
|
41999
|
-
transform
|
42016
|
+
transform,
|
42017
|
+
parents
|
42000
42018
|
}) => {
|
42001
42019
|
const frame = (() => {
|
42002
42020
|
if (!closest2) {
|
@@ -42045,7 +42063,8 @@ var init_dnd_esm = __esm({
|
|
42045
42063
|
page,
|
42046
42064
|
frame,
|
42047
42065
|
subject,
|
42048
|
-
transform
|
42066
|
+
transform,
|
42067
|
+
parents
|
42049
42068
|
};
|
42050
42069
|
return dimension;
|
42051
42070
|
};
|
@@ -42082,6 +42101,27 @@ var init_dnd_esm = __esm({
|
|
42082
42101
|
});
|
42083
42102
|
return client;
|
42084
42103
|
};
|
42104
|
+
getParents = (ref2) => {
|
42105
|
+
var _a3;
|
42106
|
+
const contextId = ref2.getAttribute(`${prefix2}-droppable-context-id`);
|
42107
|
+
const parentDescriptors = [];
|
42108
|
+
if (!contextId)
|
42109
|
+
return [];
|
42110
|
+
let currentEl = ref2;
|
42111
|
+
while (currentEl) {
|
42112
|
+
currentEl = (_a3 = currentEl.parentElement) == null ? void 0 : _a3.closest(`[${prefix2}-droppable-context-id="${contextId}"]`);
|
42113
|
+
const id = currentEl == null ? void 0 : currentEl.getAttribute(`${prefix2}-droppable-id`);
|
42114
|
+
if (id) {
|
42115
|
+
parentDescriptors.push({
|
42116
|
+
id,
|
42117
|
+
mode: "standard",
|
42118
|
+
type: "DEFAULT"
|
42119
|
+
});
|
42120
|
+
}
|
42121
|
+
}
|
42122
|
+
parentDescriptors.reverse();
|
42123
|
+
return parentDescriptors;
|
42124
|
+
};
|
42085
42125
|
getDimension = ({
|
42086
42126
|
ref: ref2,
|
42087
42127
|
descriptor,
|
@@ -42117,6 +42157,7 @@ var init_dnd_esm = __esm({
|
|
42117
42157
|
shouldClipSubject
|
42118
42158
|
};
|
42119
42159
|
})();
|
42160
|
+
const parents = getParents(ref2);
|
42120
42161
|
const dimension = getDroppableDimension({
|
42121
42162
|
descriptor,
|
42122
42163
|
isEnabled: !isDropDisabled,
|
@@ -42126,7 +42167,8 @@ var init_dnd_esm = __esm({
|
|
42126
42167
|
client,
|
42127
42168
|
page,
|
42128
42169
|
closest: closest2,
|
42129
|
-
transform
|
42170
|
+
transform,
|
42171
|
+
parents
|
42130
42172
|
});
|
42131
42173
|
return dimension;
|
42132
42174
|
};
|
@@ -42597,6 +42639,1291 @@ var init_dnd_esm = __esm({
|
|
42597
42639
|
}
|
42598
42640
|
});
|
42599
42641
|
|
42642
|
+
// ../../node_modules/ua-parser-js/src/ua-parser.js
|
42643
|
+
var require_ua_parser = __commonJS({
|
42644
|
+
"../../node_modules/ua-parser-js/src/ua-parser.js"(exports, module2) {
|
42645
|
+
init_react_import();
|
42646
|
+
(function(window2, undefined2) {
|
42647
|
+
"use strict";
|
42648
|
+
var LIBVERSION = "1.0.37", EMPTY = "", UNKNOWN = "?", FUNC_TYPE = "function", UNDEF_TYPE = "undefined", OBJ_TYPE = "object", STR_TYPE = "string", MAJOR = "major", MODEL = "model", NAME = "name", TYPE2 = "type", VENDOR = "vendor", VERSION = "version", ARCHITECTURE = "architecture", CONSOLE = "console", MOBILE = "mobile", TABLET = "tablet", SMARTTV = "smarttv", WEARABLE = "wearable", EMBEDDED = "embedded", UA_MAX_LENGTH = 500;
|
42649
|
+
var AMAZON = "Amazon", APPLE = "Apple", ASUS = "ASUS", BLACKBERRY = "BlackBerry", BROWSER = "Browser", CHROME = "Chrome", EDGE = "Edge", FIREFOX = "Firefox", GOOGLE = "Google", HUAWEI = "Huawei", LG = "LG", MICROSOFT = "Microsoft", MOTOROLA = "Motorola", OPERA = "Opera", SAMSUNG = "Samsung", SHARP = "Sharp", SONY = "Sony", XIAOMI = "Xiaomi", ZEBRA = "Zebra", FACEBOOK = "Facebook", CHROMIUM_OS = "Chromium OS", MAC_OS = "Mac OS";
|
42650
|
+
var extend = function(regexes2, extensions) {
|
42651
|
+
var mergedRegexes = {};
|
42652
|
+
for (var i2 in regexes2) {
|
42653
|
+
if (extensions[i2] && extensions[i2].length % 2 === 0) {
|
42654
|
+
mergedRegexes[i2] = extensions[i2].concat(regexes2[i2]);
|
42655
|
+
} else {
|
42656
|
+
mergedRegexes[i2] = regexes2[i2];
|
42657
|
+
}
|
42658
|
+
}
|
42659
|
+
return mergedRegexes;
|
42660
|
+
}, enumerize = function(arr) {
|
42661
|
+
var enums = {};
|
42662
|
+
for (var i2 = 0; i2 < arr.length; i2++) {
|
42663
|
+
enums[arr[i2].toUpperCase()] = arr[i2];
|
42664
|
+
}
|
42665
|
+
return enums;
|
42666
|
+
}, has = function(str1, str2) {
|
42667
|
+
return typeof str1 === STR_TYPE ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false;
|
42668
|
+
}, lowerize = function(str) {
|
42669
|
+
return str.toLowerCase();
|
42670
|
+
}, majorize = function(version2) {
|
42671
|
+
return typeof version2 === STR_TYPE ? version2.replace(/[^\d\.]/g, EMPTY).split(".")[0] : undefined2;
|
42672
|
+
}, trim = function(str, len) {
|
42673
|
+
if (typeof str === STR_TYPE) {
|
42674
|
+
str = str.replace(/^\s\s*/, EMPTY);
|
42675
|
+
return typeof len === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);
|
42676
|
+
}
|
42677
|
+
};
|
42678
|
+
var rgxMapper = function(ua, arrays) {
|
42679
|
+
var i2 = 0, j, k, p, q, matches, match;
|
42680
|
+
while (i2 < arrays.length && !matches) {
|
42681
|
+
var regex = arrays[i2], props = arrays[i2 + 1];
|
42682
|
+
j = k = 0;
|
42683
|
+
while (j < regex.length && !matches) {
|
42684
|
+
if (!regex[j]) {
|
42685
|
+
break;
|
42686
|
+
}
|
42687
|
+
matches = regex[j++].exec(ua);
|
42688
|
+
if (!!matches) {
|
42689
|
+
for (p = 0; p < props.length; p++) {
|
42690
|
+
match = matches[++k];
|
42691
|
+
q = props[p];
|
42692
|
+
if (typeof q === OBJ_TYPE && q.length > 0) {
|
42693
|
+
if (q.length === 2) {
|
42694
|
+
if (typeof q[1] == FUNC_TYPE) {
|
42695
|
+
this[q[0]] = q[1].call(this, match);
|
42696
|
+
} else {
|
42697
|
+
this[q[0]] = q[1];
|
42698
|
+
}
|
42699
|
+
} else if (q.length === 3) {
|
42700
|
+
if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {
|
42701
|
+
this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined2;
|
42702
|
+
} else {
|
42703
|
+
this[q[0]] = match ? match.replace(q[1], q[2]) : undefined2;
|
42704
|
+
}
|
42705
|
+
} else if (q.length === 4) {
|
42706
|
+
this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined2;
|
42707
|
+
}
|
42708
|
+
} else {
|
42709
|
+
this[q] = match ? match : undefined2;
|
42710
|
+
}
|
42711
|
+
}
|
42712
|
+
}
|
42713
|
+
}
|
42714
|
+
i2 += 2;
|
42715
|
+
}
|
42716
|
+
}, strMapper = function(str, map) {
|
42717
|
+
for (var i2 in map) {
|
42718
|
+
if (typeof map[i2] === OBJ_TYPE && map[i2].length > 0) {
|
42719
|
+
for (var j = 0; j < map[i2].length; j++) {
|
42720
|
+
if (has(map[i2][j], str)) {
|
42721
|
+
return i2 === UNKNOWN ? undefined2 : i2;
|
42722
|
+
}
|
42723
|
+
}
|
42724
|
+
} else if (has(map[i2], str)) {
|
42725
|
+
return i2 === UNKNOWN ? undefined2 : i2;
|
42726
|
+
}
|
42727
|
+
}
|
42728
|
+
return str;
|
42729
|
+
};
|
42730
|
+
var oldSafariMap = {
|
42731
|
+
"1.0": "/8",
|
42732
|
+
"1.2": "/1",
|
42733
|
+
"1.3": "/3",
|
42734
|
+
"2.0": "/412",
|
42735
|
+
"2.0.2": "/416",
|
42736
|
+
"2.0.3": "/417",
|
42737
|
+
"2.0.4": "/419",
|
42738
|
+
"?": "/"
|
42739
|
+
}, windowsVersionMap = {
|
42740
|
+
"ME": "4.90",
|
42741
|
+
"NT 3.11": "NT3.51",
|
42742
|
+
"NT 4.0": "NT4.0",
|
42743
|
+
"2000": "NT 5.0",
|
42744
|
+
"XP": ["NT 5.1", "NT 5.2"],
|
42745
|
+
"Vista": "NT 6.0",
|
42746
|
+
"7": "NT 6.1",
|
42747
|
+
"8": "NT 6.2",
|
42748
|
+
"8.1": "NT 6.3",
|
42749
|
+
"10": ["NT 6.4", "NT 10.0"],
|
42750
|
+
"RT": "ARM"
|
42751
|
+
};
|
42752
|
+
var regexes = {
|
42753
|
+
browser: [
|
42754
|
+
[
|
42755
|
+
/\b(?:crmo|crios)\/([\w\.]+)/i
|
42756
|
+
// Chrome for Android/iOS
|
42757
|
+
],
|
42758
|
+
[VERSION, [NAME, "Chrome"]],
|
42759
|
+
[
|
42760
|
+
/edg(?:e|ios|a)?\/([\w\.]+)/i
|
42761
|
+
// Microsoft Edge
|
42762
|
+
],
|
42763
|
+
[VERSION, [NAME, "Edge"]],
|
42764
|
+
[
|
42765
|
+
// Presto based
|
42766
|
+
/(opera mini)\/([-\w\.]+)/i,
|
42767
|
+
// Opera Mini
|
42768
|
+
/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,
|
42769
|
+
// Opera Mobi/Tablet
|
42770
|
+
/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i
|
42771
|
+
// Opera
|
42772
|
+
],
|
42773
|
+
[NAME, VERSION],
|
42774
|
+
[
|
42775
|
+
/opios[\/ ]+([\w\.]+)/i
|
42776
|
+
// Opera mini on iphone >= 8.0
|
42777
|
+
],
|
42778
|
+
[VERSION, [NAME, OPERA + " Mini"]],
|
42779
|
+
[
|
42780
|
+
/\bopr\/([\w\.]+)/i
|
42781
|
+
// Opera Webkit
|
42782
|
+
],
|
42783
|
+
[VERSION, [NAME, OPERA]],
|
42784
|
+
[
|
42785
|
+
// Mixed
|
42786
|
+
/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i
|
42787
|
+
// Baidu
|
42788
|
+
],
|
42789
|
+
[VERSION, [NAME, "Baidu"]],
|
42790
|
+
[
|
42791
|
+
/(kindle)\/([\w\.]+)/i,
|
42792
|
+
// Kindle
|
42793
|
+
/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,
|
42794
|
+
// Lunascape/Maxthon/Netfront/Jasmine/Blazer
|
42795
|
+
// Trident based
|
42796
|
+
/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,
|
42797
|
+
// Avant/IEMobile/SlimBrowser
|
42798
|
+
/(?:ms|\()(ie) ([\w\.]+)/i,
|
42799
|
+
// Internet Explorer
|
42800
|
+
// Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon
|
42801
|
+
/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,
|
42802
|
+
// Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ
|
42803
|
+
/(heytap|ovi)browser\/([\d\.]+)/i,
|
42804
|
+
// Heytap/Ovi
|
42805
|
+
/(weibo)__([\d\.]+)/i
|
42806
|
+
// Weibo
|
42807
|
+
],
|
42808
|
+
[NAME, VERSION],
|
42809
|
+
[
|
42810
|
+
/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i
|
42811
|
+
// UCBrowser
|
42812
|
+
],
|
42813
|
+
[VERSION, [NAME, "UC" + BROWSER]],
|
42814
|
+
[
|
42815
|
+
/microm.+\bqbcore\/([\w\.]+)/i,
|
42816
|
+
// WeChat Desktop for Windows Built-in Browser
|
42817
|
+
/\bqbcore\/([\w\.]+).+microm/i,
|
42818
|
+
/micromessenger\/([\w\.]+)/i
|
42819
|
+
// WeChat
|
42820
|
+
],
|
42821
|
+
[VERSION, [NAME, "WeChat"]],
|
42822
|
+
[
|
42823
|
+
/konqueror\/([\w\.]+)/i
|
42824
|
+
// Konqueror
|
42825
|
+
],
|
42826
|
+
[VERSION, [NAME, "Konqueror"]],
|
42827
|
+
[
|
42828
|
+
/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i
|
42829
|
+
// IE11
|
42830
|
+
],
|
42831
|
+
[VERSION, [NAME, "IE"]],
|
42832
|
+
[
|
42833
|
+
/ya(?:search)?browser\/([\w\.]+)/i
|
42834
|
+
// Yandex
|
42835
|
+
],
|
42836
|
+
[VERSION, [NAME, "Yandex"]],
|
42837
|
+
[
|
42838
|
+
/slbrowser\/([\w\.]+)/i
|
42839
|
+
// Smart Lenovo Browser
|
42840
|
+
],
|
42841
|
+
[VERSION, [NAME, "Smart Lenovo " + BROWSER]],
|
42842
|
+
[
|
42843
|
+
/(avast|avg)\/([\w\.]+)/i
|
42844
|
+
// Avast/AVG Secure Browser
|
42845
|
+
],
|
42846
|
+
[[NAME, /(.+)/, "$1 Secure " + BROWSER], VERSION],
|
42847
|
+
[
|
42848
|
+
/\bfocus\/([\w\.]+)/i
|
42849
|
+
// Firefox Focus
|
42850
|
+
],
|
42851
|
+
[VERSION, [NAME, FIREFOX + " Focus"]],
|
42852
|
+
[
|
42853
|
+
/\bopt\/([\w\.]+)/i
|
42854
|
+
// Opera Touch
|
42855
|
+
],
|
42856
|
+
[VERSION, [NAME, OPERA + " Touch"]],
|
42857
|
+
[
|
42858
|
+
/coc_coc\w+\/([\w\.]+)/i
|
42859
|
+
// Coc Coc Browser
|
42860
|
+
],
|
42861
|
+
[VERSION, [NAME, "Coc Coc"]],
|
42862
|
+
[
|
42863
|
+
/dolfin\/([\w\.]+)/i
|
42864
|
+
// Dolphin
|
42865
|
+
],
|
42866
|
+
[VERSION, [NAME, "Dolphin"]],
|
42867
|
+
[
|
42868
|
+
/coast\/([\w\.]+)/i
|
42869
|
+
// Opera Coast
|
42870
|
+
],
|
42871
|
+
[VERSION, [NAME, OPERA + " Coast"]],
|
42872
|
+
[
|
42873
|
+
/miuibrowser\/([\w\.]+)/i
|
42874
|
+
// MIUI Browser
|
42875
|
+
],
|
42876
|
+
[VERSION, [NAME, "MIUI " + BROWSER]],
|
42877
|
+
[
|
42878
|
+
/fxios\/([-\w\.]+)/i
|
42879
|
+
// Firefox for iOS
|
42880
|
+
],
|
42881
|
+
[VERSION, [NAME, FIREFOX]],
|
42882
|
+
[
|
42883
|
+
/\bqihu|(qi?ho?o?|360)browser/i
|
42884
|
+
// 360
|
42885
|
+
],
|
42886
|
+
[[NAME, "360 " + BROWSER]],
|
42887
|
+
[
|
42888
|
+
/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i
|
42889
|
+
],
|
42890
|
+
[[NAME, /(.+)/, "$1 " + BROWSER], VERSION],
|
42891
|
+
[
|
42892
|
+
// Oculus/Sailfish/HuaweiBrowser/VivoBrowser
|
42893
|
+
/samsungbrowser\/([\w\.]+)/i
|
42894
|
+
// Samsung Internet
|
42895
|
+
],
|
42896
|
+
[VERSION, [NAME, SAMSUNG + " Internet"]],
|
42897
|
+
[
|
42898
|
+
/(comodo_dragon)\/([\w\.]+)/i
|
42899
|
+
// Comodo Dragon
|
42900
|
+
],
|
42901
|
+
[[NAME, /_/g, " "], VERSION],
|
42902
|
+
[
|
42903
|
+
/metasr[\/ ]?([\d\.]+)/i
|
42904
|
+
// Sogou Explorer
|
42905
|
+
],
|
42906
|
+
[VERSION, [NAME, "Sogou Explorer"]],
|
42907
|
+
[
|
42908
|
+
/(sogou)mo\w+\/([\d\.]+)/i
|
42909
|
+
// Sogou Mobile
|
42910
|
+
],
|
42911
|
+
[[NAME, "Sogou Mobile"], VERSION],
|
42912
|
+
[
|
42913
|
+
/(electron)\/([\w\.]+) safari/i,
|
42914
|
+
// Electron-based App
|
42915
|
+
/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,
|
42916
|
+
// Tesla
|
42917
|
+
/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i
|
42918
|
+
// QQBrowser/2345 Browser
|
42919
|
+
],
|
42920
|
+
[NAME, VERSION],
|
42921
|
+
[
|
42922
|
+
/(lbbrowser)/i,
|
42923
|
+
// LieBao Browser
|
42924
|
+
/\[(linkedin)app\]/i
|
42925
|
+
// LinkedIn App for iOS & Android
|
42926
|
+
],
|
42927
|
+
[NAME],
|
42928
|
+
[
|
42929
|
+
// WebView
|
42930
|
+
/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i
|
42931
|
+
// Facebook App for iOS & Android
|
42932
|
+
],
|
42933
|
+
[[NAME, FACEBOOK], VERSION],
|
42934
|
+
[
|
42935
|
+
/(Klarna)\/([\w\.]+)/i,
|
42936
|
+
// Klarna Shopping Browser for iOS & Android
|
42937
|
+
/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,
|
42938
|
+
// Kakao App
|
42939
|
+
/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,
|
42940
|
+
// Naver InApp
|
42941
|
+
/safari (line)\/([\w\.]+)/i,
|
42942
|
+
// Line App for iOS
|
42943
|
+
/\b(line)\/([\w\.]+)\/iab/i,
|
42944
|
+
// Line App for Android
|
42945
|
+
/(alipay)client\/([\w\.]+)/i,
|
42946
|
+
// Alipay
|
42947
|
+
/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i
|
42948
|
+
// Chromium/Instagram/Snapchat
|
42949
|
+
],
|
42950
|
+
[NAME, VERSION],
|
42951
|
+
[
|
42952
|
+
/\bgsa\/([\w\.]+) .*safari\//i
|
42953
|
+
// Google Search Appliance on iOS
|
42954
|
+
],
|
42955
|
+
[VERSION, [NAME, "GSA"]],
|
42956
|
+
[
|
42957
|
+
/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i
|
42958
|
+
// TikTok
|
42959
|
+
],
|
42960
|
+
[VERSION, [NAME, "TikTok"]],
|
42961
|
+
[
|
42962
|
+
/headlesschrome(?:\/([\w\.]+)| )/i
|
42963
|
+
// Chrome Headless
|
42964
|
+
],
|
42965
|
+
[VERSION, [NAME, CHROME + " Headless"]],
|
42966
|
+
[
|
42967
|
+
/ wv\).+(chrome)\/([\w\.]+)/i
|
42968
|
+
// Chrome WebView
|
42969
|
+
],
|
42970
|
+
[[NAME, CHROME + " WebView"], VERSION],
|
42971
|
+
[
|
42972
|
+
/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i
|
42973
|
+
// Android Browser
|
42974
|
+
],
|
42975
|
+
[VERSION, [NAME, "Android " + BROWSER]],
|
42976
|
+
[
|
42977
|
+
/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i
|
42978
|
+
// Chrome/OmniWeb/Arora/Tizen/Nokia
|
42979
|
+
],
|
42980
|
+
[NAME, VERSION],
|
42981
|
+
[
|
42982
|
+
/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i
|
42983
|
+
// Mobile Safari
|
42984
|
+
],
|
42985
|
+
[VERSION, [NAME, "Mobile Safari"]],
|
42986
|
+
[
|
42987
|
+
/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i
|
42988
|
+
// Safari & Safari Mobile
|
42989
|
+
],
|
42990
|
+
[VERSION, NAME],
|
42991
|
+
[
|
42992
|
+
/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i
|
42993
|
+
// Safari < 3.0
|
42994
|
+
],
|
42995
|
+
[NAME, [VERSION, strMapper, oldSafariMap]],
|
42996
|
+
[
|
42997
|
+
/(webkit|khtml)\/([\w\.]+)/i
|
42998
|
+
],
|
42999
|
+
[NAME, VERSION],
|
43000
|
+
[
|
43001
|
+
// Gecko based
|
43002
|
+
/(navigator|netscape\d?)\/([-\w\.]+)/i
|
43003
|
+
// Netscape
|
43004
|
+
],
|
43005
|
+
[[NAME, "Netscape"], VERSION],
|
43006
|
+
[
|
43007
|
+
/mobile vr; rv:([\w\.]+)\).+firefox/i
|
43008
|
+
// Firefox Reality
|
43009
|
+
],
|
43010
|
+
[VERSION, [NAME, FIREFOX + " Reality"]],
|
43011
|
+
[
|
43012
|
+
/ekiohf.+(flow)\/([\w\.]+)/i,
|
43013
|
+
// Flow
|
43014
|
+
/(swiftfox)/i,
|
43015
|
+
// Swiftfox
|
43016
|
+
/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,
|
43017
|
+
// IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar
|
43018
|
+
/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,
|
43019
|
+
// Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
|
43020
|
+
/(firefox)\/([\w\.]+)/i,
|
43021
|
+
// Other Firefox-based
|
43022
|
+
/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,
|
43023
|
+
// Mozilla
|
43024
|
+
// Other
|
43025
|
+
/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,
|
43026
|
+
// Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser
|
43027
|
+
/(links) \(([\w\.]+)/i,
|
43028
|
+
// Links
|
43029
|
+
/panasonic;(viera)/i
|
43030
|
+
// Panasonic Viera
|
43031
|
+
],
|
43032
|
+
[NAME, VERSION],
|
43033
|
+
[
|
43034
|
+
/(cobalt)\/([\w\.]+)/i
|
43035
|
+
// Cobalt
|
43036
|
+
],
|
43037
|
+
[NAME, [VERSION, /master.|lts./, ""]]
|
43038
|
+
],
|
43039
|
+
cpu: [
|
43040
|
+
[
|
43041
|
+
/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i
|
43042
|
+
// AMD64 (x64)
|
43043
|
+
],
|
43044
|
+
[[ARCHITECTURE, "amd64"]],
|
43045
|
+
[
|
43046
|
+
/(ia32(?=;))/i
|
43047
|
+
// IA32 (quicktime)
|
43048
|
+
],
|
43049
|
+
[[ARCHITECTURE, lowerize]],
|
43050
|
+
[
|
43051
|
+
/((?:i[346]|x)86)[;\)]/i
|
43052
|
+
// IA32 (x86)
|
43053
|
+
],
|
43054
|
+
[[ARCHITECTURE, "ia32"]],
|
43055
|
+
[
|
43056
|
+
/\b(aarch64|arm(v?8e?l?|_?64))\b/i
|
43057
|
+
// ARM64
|
43058
|
+
],
|
43059
|
+
[[ARCHITECTURE, "arm64"]],
|
43060
|
+
[
|
43061
|
+
/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i
|
43062
|
+
// ARMHF
|
43063
|
+
],
|
43064
|
+
[[ARCHITECTURE, "armhf"]],
|
43065
|
+
[
|
43066
|
+
// PocketPC mistakenly identified as PowerPC
|
43067
|
+
/windows (ce|mobile); ppc;/i
|
43068
|
+
],
|
43069
|
+
[[ARCHITECTURE, "arm"]],
|
43070
|
+
[
|
43071
|
+
/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i
|
43072
|
+
// PowerPC
|
43073
|
+
],
|
43074
|
+
[[ARCHITECTURE, /ower/, EMPTY, lowerize]],
|
43075
|
+
[
|
43076
|
+
/(sun4\w)[;\)]/i
|
43077
|
+
// SPARC
|
43078
|
+
],
|
43079
|
+
[[ARCHITECTURE, "sparc"]],
|
43080
|
+
[
|
43081
|
+
/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i
|
43082
|
+
// IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
|
43083
|
+
],
|
43084
|
+
[[ARCHITECTURE, lowerize]]
|
43085
|
+
],
|
43086
|
+
device: [
|
43087
|
+
[
|
43088
|
+
//////////////////////////
|
43089
|
+
// MOBILES & TABLETS
|
43090
|
+
/////////////////////////
|
43091
|
+
// Samsung
|
43092
|
+
/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i
|
43093
|
+
],
|
43094
|
+
[MODEL, [VENDOR, SAMSUNG], [TYPE2, TABLET]],
|
43095
|
+
[
|
43096
|
+
/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,
|
43097
|
+
/samsung[- ]([-\w]+)/i,
|
43098
|
+
/sec-(sgh\w+)/i
|
43099
|
+
],
|
43100
|
+
[MODEL, [VENDOR, SAMSUNG], [TYPE2, MOBILE]],
|
43101
|
+
[
|
43102
|
+
// Apple
|
43103
|
+
/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i
|
43104
|
+
// iPod/iPhone
|
43105
|
+
],
|
43106
|
+
[MODEL, [VENDOR, APPLE], [TYPE2, MOBILE]],
|
43107
|
+
[
|
43108
|
+
/\((ipad);[-\w\),; ]+apple/i,
|
43109
|
+
// iPad
|
43110
|
+
/applecoremedia\/[\w\.]+ \((ipad)/i,
|
43111
|
+
/\b(ipad)\d\d?,\d\d?[;\]].+ios/i
|
43112
|
+
],
|
43113
|
+
[MODEL, [VENDOR, APPLE], [TYPE2, TABLET]],
|
43114
|
+
[
|
43115
|
+
/(macintosh);/i
|
43116
|
+
],
|
43117
|
+
[MODEL, [VENDOR, APPLE]],
|
43118
|
+
[
|
43119
|
+
// Sharp
|
43120
|
+
/\b(sh-?[altvz]?\d\d[a-ekm]?)/i
|
43121
|
+
],
|
43122
|
+
[MODEL, [VENDOR, SHARP], [TYPE2, MOBILE]],
|
43123
|
+
[
|
43124
|
+
// Huawei
|
43125
|
+
/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
|
43126
|
+
],
|
43127
|
+
[MODEL, [VENDOR, HUAWEI], [TYPE2, TABLET]],
|
43128
|
+
[
|
43129
|
+
/(?:huawei|honor)([-\w ]+)[;\)]/i,
|
43130
|
+
/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i
|
43131
|
+
],
|
43132
|
+
[MODEL, [VENDOR, HUAWEI], [TYPE2, MOBILE]],
|
43133
|
+
[
|
43134
|
+
// Xiaomi
|
43135
|
+
/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,
|
43136
|
+
// Xiaomi POCO
|
43137
|
+
/\b; (\w+) build\/hm\1/i,
|
43138
|
+
// Xiaomi Hongmi 'numeric' models
|
43139
|
+
/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,
|
43140
|
+
// Xiaomi Hongmi
|
43141
|
+
/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,
|
43142
|
+
// Xiaomi Redmi
|
43143
|
+
/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,
|
43144
|
+
// Xiaomi Redmi 'numeric' models
|
43145
|
+
/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i
|
43146
|
+
// Xiaomi Mi
|
43147
|
+
],
|
43148
|
+
[[MODEL, /_/g, " "], [VENDOR, XIAOMI], [TYPE2, MOBILE]],
|
43149
|
+
[
|
43150
|
+
/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,
|
43151
|
+
// Redmi Pad
|
43152
|
+
/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i
|
43153
|
+
// Mi Pad tablets
|
43154
|
+
],
|
43155
|
+
[[MODEL, /_/g, " "], [VENDOR, XIAOMI], [TYPE2, TABLET]],
|
43156
|
+
[
|
43157
|
+
// OPPO
|
43158
|
+
/; (\w+) bui.+ oppo/i,
|
43159
|
+
/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i
|
43160
|
+
],
|
43161
|
+
[MODEL, [VENDOR, "OPPO"], [TYPE2, MOBILE]],
|
43162
|
+
[
|
43163
|
+
// Vivo
|
43164
|
+
/vivo (\w+)(?: bui|\))/i,
|
43165
|
+
/\b(v[12]\d{3}\w?[at])(?: bui|;)/i
|
43166
|
+
],
|
43167
|
+
[MODEL, [VENDOR, "Vivo"], [TYPE2, MOBILE]],
|
43168
|
+
[
|
43169
|
+
// Realme
|
43170
|
+
/\b(rmx[1-3]\d{3})(?: bui|;|\))/i
|
43171
|
+
],
|
43172
|
+
[MODEL, [VENDOR, "Realme"], [TYPE2, MOBILE]],
|
43173
|
+
[
|
43174
|
+
// Motorola
|
43175
|
+
/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,
|
43176
|
+
/\bmot(?:orola)?[- ](\w*)/i,
|
43177
|
+
/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i
|
43178
|
+
],
|
43179
|
+
[MODEL, [VENDOR, MOTOROLA], [TYPE2, MOBILE]],
|
43180
|
+
[
|
43181
|
+
/\b(mz60\d|xoom[2 ]{0,2}) build\//i
|
43182
|
+
],
|
43183
|
+
[MODEL, [VENDOR, MOTOROLA], [TYPE2, TABLET]],
|
43184
|
+
[
|
43185
|
+
// LG
|
43186
|
+
/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i
|
43187
|
+
],
|
43188
|
+
[MODEL, [VENDOR, LG], [TYPE2, TABLET]],
|
43189
|
+
[
|
43190
|
+
/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,
|
43191
|
+
/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,
|
43192
|
+
/\blg-?([\d\w]+) bui/i
|
43193
|
+
],
|
43194
|
+
[MODEL, [VENDOR, LG], [TYPE2, MOBILE]],
|
43195
|
+
[
|
43196
|
+
// Lenovo
|
43197
|
+
/(ideatab[-\w ]+)/i,
|
43198
|
+
/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i
|
43199
|
+
],
|
43200
|
+
[MODEL, [VENDOR, "Lenovo"], [TYPE2, TABLET]],
|
43201
|
+
[
|
43202
|
+
// Nokia
|
43203
|
+
/(?:maemo|nokia).*(n900|lumia \d+)/i,
|
43204
|
+
/nokia[-_ ]?([-\w\.]*)/i
|
43205
|
+
],
|
43206
|
+
[[MODEL, /_/g, " "], [VENDOR, "Nokia"], [TYPE2, MOBILE]],
|
43207
|
+
[
|
43208
|
+
// Google
|
43209
|
+
/(pixel c)\b/i
|
43210
|
+
// Google Pixel C
|
43211
|
+
],
|
43212
|
+
[MODEL, [VENDOR, GOOGLE], [TYPE2, TABLET]],
|
43213
|
+
[
|
43214
|
+
/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i
|
43215
|
+
// Google Pixel
|
43216
|
+
],
|
43217
|
+
[MODEL, [VENDOR, GOOGLE], [TYPE2, MOBILE]],
|
43218
|
+
[
|
43219
|
+
// Sony
|
43220
|
+
/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i
|
43221
|
+
],
|
43222
|
+
[MODEL, [VENDOR, SONY], [TYPE2, MOBILE]],
|
43223
|
+
[
|
43224
|
+
/sony tablet [ps]/i,
|
43225
|
+
/\b(?:sony)?sgp\w+(?: bui|\))/i
|
43226
|
+
],
|
43227
|
+
[[MODEL, "Xperia Tablet"], [VENDOR, SONY], [TYPE2, TABLET]],
|
43228
|
+
[
|
43229
|
+
// OnePlus
|
43230
|
+
/ (kb2005|in20[12]5|be20[12][59])\b/i,
|
43231
|
+
/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i
|
43232
|
+
],
|
43233
|
+
[MODEL, [VENDOR, "OnePlus"], [TYPE2, MOBILE]],
|
43234
|
+
[
|
43235
|
+
// Amazon
|
43236
|
+
/(alexa)webm/i,
|
43237
|
+
/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,
|
43238
|
+
// Kindle Fire without Silk / Echo Show
|
43239
|
+
/(kf[a-z]+)( bui|\)).+silk\//i
|
43240
|
+
// Kindle Fire HD
|
43241
|
+
],
|
43242
|
+
[MODEL, [VENDOR, AMAZON], [TYPE2, TABLET]],
|
43243
|
+
[
|
43244
|
+
/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i
|
43245
|
+
// Fire Phone
|
43246
|
+
],
|
43247
|
+
[[MODEL, /(.+)/g, "Fire Phone $1"], [VENDOR, AMAZON], [TYPE2, MOBILE]],
|
43248
|
+
[
|
43249
|
+
// BlackBerry
|
43250
|
+
/(playbook);[-\w\),; ]+(rim)/i
|
43251
|
+
// BlackBerry PlayBook
|
43252
|
+
],
|
43253
|
+
[MODEL, VENDOR, [TYPE2, TABLET]],
|
43254
|
+
[
|
43255
|
+
/\b((?:bb[a-f]|st[hv])100-\d)/i,
|
43256
|
+
/\(bb10; (\w+)/i
|
43257
|
+
// BlackBerry 10
|
43258
|
+
],
|
43259
|
+
[MODEL, [VENDOR, BLACKBERRY], [TYPE2, MOBILE]],
|
43260
|
+
[
|
43261
|
+
// Asus
|
43262
|
+
/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i
|
43263
|
+
],
|
43264
|
+
[MODEL, [VENDOR, ASUS], [TYPE2, TABLET]],
|
43265
|
+
[
|
43266
|
+
/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i
|
43267
|
+
],
|
43268
|
+
[MODEL, [VENDOR, ASUS], [TYPE2, MOBILE]],
|
43269
|
+
[
|
43270
|
+
// HTC
|
43271
|
+
/(nexus 9)/i
|
43272
|
+
// HTC Nexus 9
|
43273
|
+
],
|
43274
|
+
[MODEL, [VENDOR, "HTC"], [TYPE2, TABLET]],
|
43275
|
+
[
|
43276
|
+
/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,
|
43277
|
+
// HTC
|
43278
|
+
// ZTE
|
43279
|
+
/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,
|
43280
|
+
/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i
|
43281
|
+
// Alcatel/GeeksPhone/Nexian/Panasonic/Sony
|
43282
|
+
],
|
43283
|
+
[VENDOR, [MODEL, /_/g, " "], [TYPE2, MOBILE]],
|
43284
|
+
[
|
43285
|
+
// Acer
|
43286
|
+
/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i
|
43287
|
+
],
|
43288
|
+
[MODEL, [VENDOR, "Acer"], [TYPE2, TABLET]],
|
43289
|
+
[
|
43290
|
+
// Meizu
|
43291
|
+
/droid.+; (m[1-5] note) bui/i,
|
43292
|
+
/\bmz-([-\w]{2,})/i
|
43293
|
+
],
|
43294
|
+
[MODEL, [VENDOR, "Meizu"], [TYPE2, MOBILE]],
|
43295
|
+
[
|
43296
|
+
// Ulefone
|
43297
|
+
/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i
|
43298
|
+
],
|
43299
|
+
[MODEL, [VENDOR, "Ulefone"], [TYPE2, MOBILE]],
|
43300
|
+
[
|
43301
|
+
// MIXED
|
43302
|
+
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,
|
43303
|
+
// BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron
|
43304
|
+
/(hp) ([\w ]+\w)/i,
|
43305
|
+
// HP iPAQ
|
43306
|
+
/(asus)-?(\w+)/i,
|
43307
|
+
// Asus
|
43308
|
+
/(microsoft); (lumia[\w ]+)/i,
|
43309
|
+
// Microsoft Lumia
|
43310
|
+
/(lenovo)[-_ ]?([-\w]+)/i,
|
43311
|
+
// Lenovo
|
43312
|
+
/(jolla)/i,
|
43313
|
+
// Jolla
|
43314
|
+
/(oppo) ?([\w ]+) bui/i
|
43315
|
+
// OPPO
|
43316
|
+
],
|
43317
|
+
[VENDOR, MODEL, [TYPE2, MOBILE]],
|
43318
|
+
[
|
43319
|
+
/(kobo)\s(ereader|touch)/i,
|
43320
|
+
// Kobo
|
43321
|
+
/(archos) (gamepad2?)/i,
|
43322
|
+
// Archos
|
43323
|
+
/(hp).+(touchpad(?!.+tablet)|tablet)/i,
|
43324
|
+
// HP TouchPad
|
43325
|
+
/(kindle)\/([\w\.]+)/i,
|
43326
|
+
// Kindle
|
43327
|
+
/(nook)[\w ]+build\/(\w+)/i,
|
43328
|
+
// Nook
|
43329
|
+
/(dell) (strea[kpr\d ]*[\dko])/i,
|
43330
|
+
// Dell Streak
|
43331
|
+
/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,
|
43332
|
+
// Le Pan Tablets
|
43333
|
+
/(trinity)[- ]*(t\d{3}) bui/i,
|
43334
|
+
// Trinity Tablets
|
43335
|
+
/(gigaset)[- ]+(q\w{1,9}) bui/i,
|
43336
|
+
// Gigaset Tablets
|
43337
|
+
/(vodafone) ([\w ]+)(?:\)| bui)/i
|
43338
|
+
// Vodafone
|
43339
|
+
],
|
43340
|
+
[VENDOR, MODEL, [TYPE2, TABLET]],
|
43341
|
+
[
|
43342
|
+
/(surface duo)/i
|
43343
|
+
// Surface Duo
|
43344
|
+
],
|
43345
|
+
[MODEL, [VENDOR, MICROSOFT], [TYPE2, TABLET]],
|
43346
|
+
[
|
43347
|
+
/droid [\d\.]+; (fp\du?)(?: b|\))/i
|
43348
|
+
// Fairphone
|
43349
|
+
],
|
43350
|
+
[MODEL, [VENDOR, "Fairphone"], [TYPE2, MOBILE]],
|
43351
|
+
[
|
43352
|
+
/(u304aa)/i
|
43353
|
+
// AT&T
|
43354
|
+
],
|
43355
|
+
[MODEL, [VENDOR, "AT&T"], [TYPE2, MOBILE]],
|
43356
|
+
[
|
43357
|
+
/\bsie-(\w*)/i
|
43358
|
+
// Siemens
|
43359
|
+
],
|
43360
|
+
[MODEL, [VENDOR, "Siemens"], [TYPE2, MOBILE]],
|
43361
|
+
[
|
43362
|
+
/\b(rct\w+) b/i
|
43363
|
+
// RCA Tablets
|
43364
|
+
],
|
43365
|
+
[MODEL, [VENDOR, "RCA"], [TYPE2, TABLET]],
|
43366
|
+
[
|
43367
|
+
/\b(venue[\d ]{2,7}) b/i
|
43368
|
+
// Dell Venue Tablets
|
43369
|
+
],
|
43370
|
+
[MODEL, [VENDOR, "Dell"], [TYPE2, TABLET]],
|
43371
|
+
[
|
43372
|
+
/\b(q(?:mv|ta)\w+) b/i
|
43373
|
+
// Verizon Tablet
|
43374
|
+
],
|
43375
|
+
[MODEL, [VENDOR, "Verizon"], [TYPE2, TABLET]],
|
43376
|
+
[
|
43377
|
+
/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i
|
43378
|
+
// Barnes & Noble Tablet
|
43379
|
+
],
|
43380
|
+
[MODEL, [VENDOR, "Barnes & Noble"], [TYPE2, TABLET]],
|
43381
|
+
[
|
43382
|
+
/\b(tm\d{3}\w+) b/i
|
43383
|
+
],
|
43384
|
+
[MODEL, [VENDOR, "NuVision"], [TYPE2, TABLET]],
|
43385
|
+
[
|
43386
|
+
/\b(k88) b/i
|
43387
|
+
// ZTE K Series Tablet
|
43388
|
+
],
|
43389
|
+
[MODEL, [VENDOR, "ZTE"], [TYPE2, TABLET]],
|
43390
|
+
[
|
43391
|
+
/\b(nx\d{3}j) b/i
|
43392
|
+
// ZTE Nubia
|
43393
|
+
],
|
43394
|
+
[MODEL, [VENDOR, "ZTE"], [TYPE2, MOBILE]],
|
43395
|
+
[
|
43396
|
+
/\b(gen\d{3}) b.+49h/i
|
43397
|
+
// Swiss GEN Mobile
|
43398
|
+
],
|
43399
|
+
[MODEL, [VENDOR, "Swiss"], [TYPE2, MOBILE]],
|
43400
|
+
[
|
43401
|
+
/\b(zur\d{3}) b/i
|
43402
|
+
// Swiss ZUR Tablet
|
43403
|
+
],
|
43404
|
+
[MODEL, [VENDOR, "Swiss"], [TYPE2, TABLET]],
|
43405
|
+
[
|
43406
|
+
/\b((zeki)?tb.*\b) b/i
|
43407
|
+
// Zeki Tablets
|
43408
|
+
],
|
43409
|
+
[MODEL, [VENDOR, "Zeki"], [TYPE2, TABLET]],
|
43410
|
+
[
|
43411
|
+
/\b([yr]\d{2}) b/i,
|
43412
|
+
/\b(dragon[- ]+touch |dt)(\w{5}) b/i
|
43413
|
+
// Dragon Touch Tablet
|
43414
|
+
],
|
43415
|
+
[[VENDOR, "Dragon Touch"], MODEL, [TYPE2, TABLET]],
|
43416
|
+
[
|
43417
|
+
/\b(ns-?\w{0,9}) b/i
|
43418
|
+
// Insignia Tablets
|
43419
|
+
],
|
43420
|
+
[MODEL, [VENDOR, "Insignia"], [TYPE2, TABLET]],
|
43421
|
+
[
|
43422
|
+
/\b((nxa|next)-?\w{0,9}) b/i
|
43423
|
+
// NextBook Tablets
|
43424
|
+
],
|
43425
|
+
[MODEL, [VENDOR, "NextBook"], [TYPE2, TABLET]],
|
43426
|
+
[
|
43427
|
+
/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i
|
43428
|
+
// Voice Xtreme Phones
|
43429
|
+
],
|
43430
|
+
[[VENDOR, "Voice"], MODEL, [TYPE2, MOBILE]],
|
43431
|
+
[
|
43432
|
+
/\b(lvtel\-)?(v1[12]) b/i
|
43433
|
+
// LvTel Phones
|
43434
|
+
],
|
43435
|
+
[[VENDOR, "LvTel"], MODEL, [TYPE2, MOBILE]],
|
43436
|
+
[
|
43437
|
+
/\b(ph-1) /i
|
43438
|
+
// Essential PH-1
|
43439
|
+
],
|
43440
|
+
[MODEL, [VENDOR, "Essential"], [TYPE2, MOBILE]],
|
43441
|
+
[
|
43442
|
+
/\b(v(100md|700na|7011|917g).*\b) b/i
|
43443
|
+
// Envizen Tablets
|
43444
|
+
],
|
43445
|
+
[MODEL, [VENDOR, "Envizen"], [TYPE2, TABLET]],
|
43446
|
+
[
|
43447
|
+
/\b(trio[-\w\. ]+) b/i
|
43448
|
+
// MachSpeed Tablets
|
43449
|
+
],
|
43450
|
+
[MODEL, [VENDOR, "MachSpeed"], [TYPE2, TABLET]],
|
43451
|
+
[
|
43452
|
+
/\btu_(1491) b/i
|
43453
|
+
// Rotor Tablets
|
43454
|
+
],
|
43455
|
+
[MODEL, [VENDOR, "Rotor"], [TYPE2, TABLET]],
|
43456
|
+
[
|
43457
|
+
/(shield[\w ]+) b/i
|
43458
|
+
// Nvidia Shield Tablets
|
43459
|
+
],
|
43460
|
+
[MODEL, [VENDOR, "Nvidia"], [TYPE2, TABLET]],
|
43461
|
+
[
|
43462
|
+
/(sprint) (\w+)/i
|
43463
|
+
// Sprint Phones
|
43464
|
+
],
|
43465
|
+
[VENDOR, MODEL, [TYPE2, MOBILE]],
|
43466
|
+
[
|
43467
|
+
/(kin\.[onetw]{3})/i
|
43468
|
+
// Microsoft Kin
|
43469
|
+
],
|
43470
|
+
[[MODEL, /\./g, " "], [VENDOR, MICROSOFT], [TYPE2, MOBILE]],
|
43471
|
+
[
|
43472
|
+
/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i
|
43473
|
+
// Zebra
|
43474
|
+
],
|
43475
|
+
[MODEL, [VENDOR, ZEBRA], [TYPE2, TABLET]],
|
43476
|
+
[
|
43477
|
+
/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i
|
43478
|
+
],
|
43479
|
+
[MODEL, [VENDOR, ZEBRA], [TYPE2, MOBILE]],
|
43480
|
+
[
|
43481
|
+
///////////////////
|
43482
|
+
// SMARTTVS
|
43483
|
+
///////////////////
|
43484
|
+
/smart-tv.+(samsung)/i
|
43485
|
+
// Samsung
|
43486
|
+
],
|
43487
|
+
[VENDOR, [TYPE2, SMARTTV]],
|
43488
|
+
[
|
43489
|
+
/hbbtv.+maple;(\d+)/i
|
43490
|
+
],
|
43491
|
+
[[MODEL, /^/, "SmartTV"], [VENDOR, SAMSUNG], [TYPE2, SMARTTV]],
|
43492
|
+
[
|
43493
|
+
/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i
|
43494
|
+
// LG SmartTV
|
43495
|
+
],
|
43496
|
+
[[VENDOR, LG], [TYPE2, SMARTTV]],
|
43497
|
+
[
|
43498
|
+
/(apple) ?tv/i
|
43499
|
+
// Apple TV
|
43500
|
+
],
|
43501
|
+
[VENDOR, [MODEL, APPLE + " TV"], [TYPE2, SMARTTV]],
|
43502
|
+
[
|
43503
|
+
/crkey/i
|
43504
|
+
// Google Chromecast
|
43505
|
+
],
|
43506
|
+
[[MODEL, CHROME + "cast"], [VENDOR, GOOGLE], [TYPE2, SMARTTV]],
|
43507
|
+
[
|
43508
|
+
/droid.+aft(\w+)( bui|\))/i
|
43509
|
+
// Fire TV
|
43510
|
+
],
|
43511
|
+
[MODEL, [VENDOR, AMAZON], [TYPE2, SMARTTV]],
|
43512
|
+
[
|
43513
|
+
/\(dtv[\);].+(aquos)/i,
|
43514
|
+
/(aquos-tv[\w ]+)\)/i
|
43515
|
+
// Sharp
|
43516
|
+
],
|
43517
|
+
[MODEL, [VENDOR, SHARP], [TYPE2, SMARTTV]],
|
43518
|
+
[
|
43519
|
+
/(bravia[\w ]+)( bui|\))/i
|
43520
|
+
// Sony
|
43521
|
+
],
|
43522
|
+
[MODEL, [VENDOR, SONY], [TYPE2, SMARTTV]],
|
43523
|
+
[
|
43524
|
+
/(mitv-\w{5}) bui/i
|
43525
|
+
// Xiaomi
|
43526
|
+
],
|
43527
|
+
[MODEL, [VENDOR, XIAOMI], [TYPE2, SMARTTV]],
|
43528
|
+
[
|
43529
|
+
/Hbbtv.*(technisat) (.*);/i
|
43530
|
+
// TechniSAT
|
43531
|
+
],
|
43532
|
+
[VENDOR, MODEL, [TYPE2, SMARTTV]],
|
43533
|
+
[
|
43534
|
+
/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,
|
43535
|
+
// Roku
|
43536
|
+
/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i
|
43537
|
+
// HbbTV devices
|
43538
|
+
],
|
43539
|
+
[[VENDOR, trim], [MODEL, trim], [TYPE2, SMARTTV]],
|
43540
|
+
[
|
43541
|
+
/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i
|
43542
|
+
// SmartTV from Unidentified Vendors
|
43543
|
+
],
|
43544
|
+
[[TYPE2, SMARTTV]],
|
43545
|
+
[
|
43546
|
+
///////////////////
|
43547
|
+
// CONSOLES
|
43548
|
+
///////////////////
|
43549
|
+
/(ouya)/i,
|
43550
|
+
// Ouya
|
43551
|
+
/(nintendo) ([wids3utch]+)/i
|
43552
|
+
// Nintendo
|
43553
|
+
],
|
43554
|
+
[VENDOR, MODEL, [TYPE2, CONSOLE]],
|
43555
|
+
[
|
43556
|
+
/droid.+; (shield) bui/i
|
43557
|
+
// Nvidia
|
43558
|
+
],
|
43559
|
+
[MODEL, [VENDOR, "Nvidia"], [TYPE2, CONSOLE]],
|
43560
|
+
[
|
43561
|
+
/(playstation [345portablevi]+)/i
|
43562
|
+
// Playstation
|
43563
|
+
],
|
43564
|
+
[MODEL, [VENDOR, SONY], [TYPE2, CONSOLE]],
|
43565
|
+
[
|
43566
|
+
/\b(xbox(?: one)?(?!; xbox))[\); ]/i
|
43567
|
+
// Microsoft Xbox
|
43568
|
+
],
|
43569
|
+
[MODEL, [VENDOR, MICROSOFT], [TYPE2, CONSOLE]],
|
43570
|
+
[
|
43571
|
+
///////////////////
|
43572
|
+
// WEARABLES
|
43573
|
+
///////////////////
|
43574
|
+
/((pebble))app/i
|
43575
|
+
// Pebble
|
43576
|
+
],
|
43577
|
+
[VENDOR, MODEL, [TYPE2, WEARABLE]],
|
43578
|
+
[
|
43579
|
+
/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i
|
43580
|
+
// Apple Watch
|
43581
|
+
],
|
43582
|
+
[MODEL, [VENDOR, APPLE], [TYPE2, WEARABLE]],
|
43583
|
+
[
|
43584
|
+
/droid.+; (glass) \d/i
|
43585
|
+
// Google Glass
|
43586
|
+
],
|
43587
|
+
[MODEL, [VENDOR, GOOGLE], [TYPE2, WEARABLE]],
|
43588
|
+
[
|
43589
|
+
/droid.+; (wt63?0{2,3})\)/i
|
43590
|
+
],
|
43591
|
+
[MODEL, [VENDOR, ZEBRA], [TYPE2, WEARABLE]],
|
43592
|
+
[
|
43593
|
+
/(quest( 2| pro)?)/i
|
43594
|
+
// Oculus Quest
|
43595
|
+
],
|
43596
|
+
[MODEL, [VENDOR, FACEBOOK], [TYPE2, WEARABLE]],
|
43597
|
+
[
|
43598
|
+
///////////////////
|
43599
|
+
// EMBEDDED
|
43600
|
+
///////////////////
|
43601
|
+
/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i
|
43602
|
+
// Tesla
|
43603
|
+
],
|
43604
|
+
[VENDOR, [TYPE2, EMBEDDED]],
|
43605
|
+
[
|
43606
|
+
/(aeobc)\b/i
|
43607
|
+
// Echo Dot
|
43608
|
+
],
|
43609
|
+
[MODEL, [VENDOR, AMAZON], [TYPE2, EMBEDDED]],
|
43610
|
+
[
|
43611
|
+
////////////////////
|
43612
|
+
// MIXED (GENERIC)
|
43613
|
+
///////////////////
|
43614
|
+
/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i
|
43615
|
+
// Android Phones from Unidentified Vendors
|
43616
|
+
],
|
43617
|
+
[MODEL, [TYPE2, MOBILE]],
|
43618
|
+
[
|
43619
|
+
/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i
|
43620
|
+
// Android Tablets from Unidentified Vendors
|
43621
|
+
],
|
43622
|
+
[MODEL, [TYPE2, TABLET]],
|
43623
|
+
[
|
43624
|
+
/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i
|
43625
|
+
// Unidentifiable Tablet
|
43626
|
+
],
|
43627
|
+
[[TYPE2, TABLET]],
|
43628
|
+
[
|
43629
|
+
/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i
|
43630
|
+
// Unidentifiable Mobile
|
43631
|
+
],
|
43632
|
+
[[TYPE2, MOBILE]],
|
43633
|
+
[
|
43634
|
+
/(android[-\w\. ]{0,9});.+buil/i
|
43635
|
+
// Generic Android Device
|
43636
|
+
],
|
43637
|
+
[MODEL, [VENDOR, "Generic"]]
|
43638
|
+
],
|
43639
|
+
engine: [
|
43640
|
+
[
|
43641
|
+
/windows.+ edge\/([\w\.]+)/i
|
43642
|
+
// EdgeHTML
|
43643
|
+
],
|
43644
|
+
[VERSION, [NAME, EDGE + "HTML"]],
|
43645
|
+
[
|
43646
|
+
/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i
|
43647
|
+
// Blink
|
43648
|
+
],
|
43649
|
+
[VERSION, [NAME, "Blink"]],
|
43650
|
+
[
|
43651
|
+
/(presto)\/([\w\.]+)/i,
|
43652
|
+
// Presto
|
43653
|
+
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,
|
43654
|
+
// WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna
|
43655
|
+
/ekioh(flow)\/([\w\.]+)/i,
|
43656
|
+
// Flow
|
43657
|
+
/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,
|
43658
|
+
// KHTML/Tasman/Links
|
43659
|
+
/(icab)[\/ ]([23]\.[\d\.]+)/i,
|
43660
|
+
// iCab
|
43661
|
+
/\b(libweb)/i
|
43662
|
+
],
|
43663
|
+
[NAME, VERSION],
|
43664
|
+
[
|
43665
|
+
/rv\:([\w\.]{1,9})\b.+(gecko)/i
|
43666
|
+
// Gecko
|
43667
|
+
],
|
43668
|
+
[VERSION, NAME]
|
43669
|
+
],
|
43670
|
+
os: [
|
43671
|
+
[
|
43672
|
+
// Windows
|
43673
|
+
/microsoft (windows) (vista|xp)/i
|
43674
|
+
// Windows (iTunes)
|
43675
|
+
],
|
43676
|
+
[NAME, VERSION],
|
43677
|
+
[
|
43678
|
+
/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i
|
43679
|
+
// Windows Phone
|
43680
|
+
],
|
43681
|
+
[NAME, [VERSION, strMapper, windowsVersionMap]],
|
43682
|
+
[
|
43683
|
+
/windows nt 6\.2; (arm)/i,
|
43684
|
+
// Windows RT
|
43685
|
+
/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,
|
43686
|
+
/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i
|
43687
|
+
],
|
43688
|
+
[[VERSION, strMapper, windowsVersionMap], [NAME, "Windows"]],
|
43689
|
+
[
|
43690
|
+
// iOS/macOS
|
43691
|
+
/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,
|
43692
|
+
// iOS
|
43693
|
+
/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,
|
43694
|
+
/cfnetwork\/.+darwin/i
|
43695
|
+
],
|
43696
|
+
[[VERSION, /_/g, "."], [NAME, "iOS"]],
|
43697
|
+
[
|
43698
|
+
/(mac os x) ?([\w\. ]*)/i,
|
43699
|
+
/(macintosh|mac_powerpc\b)(?!.+haiku)/i
|
43700
|
+
// Mac OS
|
43701
|
+
],
|
43702
|
+
[[NAME, MAC_OS], [VERSION, /_/g, "."]],
|
43703
|
+
[
|
43704
|
+
// Mobile OSes
|
43705
|
+
/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i
|
43706
|
+
// Android-x86/HarmonyOS
|
43707
|
+
],
|
43708
|
+
[VERSION, NAME],
|
43709
|
+
[
|
43710
|
+
// Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS
|
43711
|
+
/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,
|
43712
|
+
/(blackberry)\w*\/([\w\.]*)/i,
|
43713
|
+
// Blackberry
|
43714
|
+
/(tizen|kaios)[\/ ]([\w\.]+)/i,
|
43715
|
+
// Tizen/KaiOS
|
43716
|
+
/\((series40);/i
|
43717
|
+
// Series 40
|
43718
|
+
],
|
43719
|
+
[NAME, VERSION],
|
43720
|
+
[
|
43721
|
+
/\(bb(10);/i
|
43722
|
+
// BlackBerry 10
|
43723
|
+
],
|
43724
|
+
[VERSION, [NAME, BLACKBERRY]],
|
43725
|
+
[
|
43726
|
+
/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i
|
43727
|
+
// Symbian
|
43728
|
+
],
|
43729
|
+
[VERSION, [NAME, "Symbian"]],
|
43730
|
+
[
|
43731
|
+
/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i
|
43732
|
+
// Firefox OS
|
43733
|
+
],
|
43734
|
+
[VERSION, [NAME, FIREFOX + " OS"]],
|
43735
|
+
[
|
43736
|
+
/web0s;.+rt(tv)/i,
|
43737
|
+
/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i
|
43738
|
+
// WebOS
|
43739
|
+
],
|
43740
|
+
[VERSION, [NAME, "webOS"]],
|
43741
|
+
[
|
43742
|
+
/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i
|
43743
|
+
// watchOS
|
43744
|
+
],
|
43745
|
+
[VERSION, [NAME, "watchOS"]],
|
43746
|
+
[
|
43747
|
+
// Google Chromecast
|
43748
|
+
/crkey\/([\d\.]+)/i
|
43749
|
+
// Google Chromecast
|
43750
|
+
],
|
43751
|
+
[VERSION, [NAME, CHROME + "cast"]],
|
43752
|
+
[
|
43753
|
+
/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i
|
43754
|
+
// Chromium OS
|
43755
|
+
],
|
43756
|
+
[[NAME, CHROMIUM_OS], VERSION],
|
43757
|
+
[
|
43758
|
+
// Smart TVs
|
43759
|
+
/panasonic;(viera)/i,
|
43760
|
+
// Panasonic Viera
|
43761
|
+
/(netrange)mmh/i,
|
43762
|
+
// Netrange
|
43763
|
+
/(nettv)\/(\d+\.[\w\.]+)/i,
|
43764
|
+
// NetTV
|
43765
|
+
// Console
|
43766
|
+
/(nintendo|playstation) ([wids345portablevuch]+)/i,
|
43767
|
+
// Nintendo/Playstation
|
43768
|
+
/(xbox); +xbox ([^\);]+)/i,
|
43769
|
+
// Microsoft Xbox (360, One, X, S, Series X, Series S)
|
43770
|
+
// Other
|
43771
|
+
/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,
|
43772
|
+
// Joli/Palm
|
43773
|
+
/(mint)[\/\(\) ]?(\w*)/i,
|
43774
|
+
// Mint
|
43775
|
+
/(mageia|vectorlinux)[; ]/i,
|
43776
|
+
// Mageia/VectorLinux
|
43777
|
+
/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,
|
43778
|
+
// Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire
|
43779
|
+
/(hurd|linux) ?([\w\.]*)/i,
|
43780
|
+
// Hurd/Linux
|
43781
|
+
/(gnu) ?([\w\.]*)/i,
|
43782
|
+
// GNU
|
43783
|
+
/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,
|
43784
|
+
// FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly
|
43785
|
+
/(haiku) (\w+)/i
|
43786
|
+
// Haiku
|
43787
|
+
],
|
43788
|
+
[NAME, VERSION],
|
43789
|
+
[
|
43790
|
+
/(sunos) ?([\w\.\d]*)/i
|
43791
|
+
// Solaris
|
43792
|
+
],
|
43793
|
+
[[NAME, "Solaris"], VERSION],
|
43794
|
+
[
|
43795
|
+
/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,
|
43796
|
+
// Solaris
|
43797
|
+
/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,
|
43798
|
+
// AIX
|
43799
|
+
/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,
|
43800
|
+
// BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX/SerenityOS
|
43801
|
+
/(unix) ?([\w\.]*)/i
|
43802
|
+
// UNIX
|
43803
|
+
],
|
43804
|
+
[NAME, VERSION]
|
43805
|
+
]
|
43806
|
+
};
|
43807
|
+
var UAParser2 = function(ua, extensions) {
|
43808
|
+
if (typeof ua === OBJ_TYPE) {
|
43809
|
+
extensions = ua;
|
43810
|
+
ua = undefined2;
|
43811
|
+
}
|
43812
|
+
if (!(this instanceof UAParser2)) {
|
43813
|
+
return new UAParser2(ua, extensions).getResult();
|
43814
|
+
}
|
43815
|
+
var _navigator = typeof window2 !== UNDEF_TYPE && window2.navigator ? window2.navigator : undefined2;
|
43816
|
+
var _ua = ua || (_navigator && _navigator.userAgent ? _navigator.userAgent : EMPTY);
|
43817
|
+
var _uach = _navigator && _navigator.userAgentData ? _navigator.userAgentData : undefined2;
|
43818
|
+
var _rgxmap = extensions ? extend(regexes, extensions) : regexes;
|
43819
|
+
var _isSelfNav = _navigator && _navigator.userAgent == _ua;
|
43820
|
+
this.getBrowser = function() {
|
43821
|
+
var _browser = {};
|
43822
|
+
_browser[NAME] = undefined2;
|
43823
|
+
_browser[VERSION] = undefined2;
|
43824
|
+
rgxMapper.call(_browser, _ua, _rgxmap.browser);
|
43825
|
+
_browser[MAJOR] = majorize(_browser[VERSION]);
|
43826
|
+
if (_isSelfNav && _navigator && _navigator.brave && typeof _navigator.brave.isBrave == FUNC_TYPE) {
|
43827
|
+
_browser[NAME] = "Brave";
|
43828
|
+
}
|
43829
|
+
return _browser;
|
43830
|
+
};
|
43831
|
+
this.getCPU = function() {
|
43832
|
+
var _cpu = {};
|
43833
|
+
_cpu[ARCHITECTURE] = undefined2;
|
43834
|
+
rgxMapper.call(_cpu, _ua, _rgxmap.cpu);
|
43835
|
+
return _cpu;
|
43836
|
+
};
|
43837
|
+
this.getDevice = function() {
|
43838
|
+
var _device = {};
|
43839
|
+
_device[VENDOR] = undefined2;
|
43840
|
+
_device[MODEL] = undefined2;
|
43841
|
+
_device[TYPE2] = undefined2;
|
43842
|
+
rgxMapper.call(_device, _ua, _rgxmap.device);
|
43843
|
+
if (_isSelfNav && !_device[TYPE2] && _uach && _uach.mobile) {
|
43844
|
+
_device[TYPE2] = MOBILE;
|
43845
|
+
}
|
43846
|
+
if (_isSelfNav && _device[MODEL] == "Macintosh" && _navigator && typeof _navigator.standalone !== UNDEF_TYPE && _navigator.maxTouchPoints && _navigator.maxTouchPoints > 2) {
|
43847
|
+
_device[MODEL] = "iPad";
|
43848
|
+
_device[TYPE2] = TABLET;
|
43849
|
+
}
|
43850
|
+
return _device;
|
43851
|
+
};
|
43852
|
+
this.getEngine = function() {
|
43853
|
+
var _engine = {};
|
43854
|
+
_engine[NAME] = undefined2;
|
43855
|
+
_engine[VERSION] = undefined2;
|
43856
|
+
rgxMapper.call(_engine, _ua, _rgxmap.engine);
|
43857
|
+
return _engine;
|
43858
|
+
};
|
43859
|
+
this.getOS = function() {
|
43860
|
+
var _os = {};
|
43861
|
+
_os[NAME] = undefined2;
|
43862
|
+
_os[VERSION] = undefined2;
|
43863
|
+
rgxMapper.call(_os, _ua, _rgxmap.os);
|
43864
|
+
if (_isSelfNav && !_os[NAME] && _uach && _uach.platform != "Unknown") {
|
43865
|
+
_os[NAME] = _uach.platform.replace(/chrome os/i, CHROMIUM_OS).replace(/macos/i, MAC_OS);
|
43866
|
+
}
|
43867
|
+
return _os;
|
43868
|
+
};
|
43869
|
+
this.getResult = function() {
|
43870
|
+
return {
|
43871
|
+
ua: this.getUA(),
|
43872
|
+
browser: this.getBrowser(),
|
43873
|
+
engine: this.getEngine(),
|
43874
|
+
os: this.getOS(),
|
43875
|
+
device: this.getDevice(),
|
43876
|
+
cpu: this.getCPU()
|
43877
|
+
};
|
43878
|
+
};
|
43879
|
+
this.getUA = function() {
|
43880
|
+
return _ua;
|
43881
|
+
};
|
43882
|
+
this.setUA = function(ua2) {
|
43883
|
+
_ua = typeof ua2 === STR_TYPE && ua2.length > UA_MAX_LENGTH ? trim(ua2, UA_MAX_LENGTH) : ua2;
|
43884
|
+
return this;
|
43885
|
+
};
|
43886
|
+
this.setUA(_ua);
|
43887
|
+
return this;
|
43888
|
+
};
|
43889
|
+
UAParser2.VERSION = LIBVERSION;
|
43890
|
+
UAParser2.BROWSER = enumerize([NAME, VERSION, MAJOR]);
|
43891
|
+
UAParser2.CPU = enumerize([ARCHITECTURE]);
|
43892
|
+
UAParser2.DEVICE = enumerize([MODEL, VENDOR, TYPE2, CONSOLE, MOBILE, SMARTTV, TABLET, WEARABLE, EMBEDDED]);
|
43893
|
+
UAParser2.ENGINE = UAParser2.OS = enumerize([NAME, VERSION]);
|
43894
|
+
if (typeof exports !== UNDEF_TYPE) {
|
43895
|
+
if (typeof module2 !== UNDEF_TYPE && module2.exports) {
|
43896
|
+
exports = module2.exports = UAParser2;
|
43897
|
+
}
|
43898
|
+
exports.UAParser = UAParser2;
|
43899
|
+
} else {
|
43900
|
+
if (typeof define === FUNC_TYPE && define.amd) {
|
43901
|
+
define(function() {
|
43902
|
+
return UAParser2;
|
43903
|
+
});
|
43904
|
+
} else if (typeof window2 !== UNDEF_TYPE) {
|
43905
|
+
window2.UAParser = UAParser2;
|
43906
|
+
}
|
43907
|
+
}
|
43908
|
+
var $ = typeof window2 !== UNDEF_TYPE && (window2.jQuery || window2.Zepto);
|
43909
|
+
if ($ && !$.ua) {
|
43910
|
+
var parser = new UAParser2();
|
43911
|
+
$.ua = parser.getResult();
|
43912
|
+
$.ua.get = function() {
|
43913
|
+
return parser.getUA();
|
43914
|
+
};
|
43915
|
+
$.ua.set = function(ua) {
|
43916
|
+
parser.setUA(ua);
|
43917
|
+
var result = parser.getResult();
|
43918
|
+
for (var prop in result) {
|
43919
|
+
$.ua[prop] = result[prop];
|
43920
|
+
}
|
43921
|
+
};
|
43922
|
+
}
|
43923
|
+
})(typeof window === "object" ? window : exports);
|
43924
|
+
}
|
43925
|
+
});
|
43926
|
+
|
42600
43927
|
// ../../node_modules/use-debounce/dist/index.module.js
|
42601
43928
|
var index_module_exports = {};
|
42602
43929
|
__export(index_module_exports, {
|
@@ -44480,189 +45807,6 @@ var require_object_hash = __commonJS({
|
|
44480
45807
|
}
|
44481
45808
|
});
|
44482
45809
|
|
44483
|
-
// ../../node_modules/@measured/auto-frame-component/dist/index.js
|
44484
|
-
var require_dist = __commonJS({
|
44485
|
-
"../../node_modules/@measured/auto-frame-component/dist/index.js"(exports, module2) {
|
44486
|
-
"use strict";
|
44487
|
-
init_react_import();
|
44488
|
-
var __create2 = Object.create;
|
44489
|
-
var __defProp2 = Object.defineProperty;
|
44490
|
-
var __defProps2 = Object.defineProperties;
|
44491
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
44492
|
-
var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
|
44493
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
44494
|
-
var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
|
44495
|
-
var __getProtoOf2 = Object.getPrototypeOf;
|
44496
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
44497
|
-
var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
|
44498
|
-
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
44499
|
-
var __spreadValues2 = (a2, b) => {
|
44500
|
-
for (var prop in b || (b = {}))
|
44501
|
-
if (__hasOwnProp2.call(b, prop))
|
44502
|
-
__defNormalProp2(a2, prop, b[prop]);
|
44503
|
-
if (__getOwnPropSymbols2)
|
44504
|
-
for (var prop of __getOwnPropSymbols2(b)) {
|
44505
|
-
if (__propIsEnum2.call(b, prop))
|
44506
|
-
__defNormalProp2(a2, prop, b[prop]);
|
44507
|
-
}
|
44508
|
-
return a2;
|
44509
|
-
};
|
44510
|
-
var __spreadProps2 = (a2, b) => __defProps2(a2, __getOwnPropDescs2(b));
|
44511
|
-
var __objRest2 = (source, exclude) => {
|
44512
|
-
var target = {};
|
44513
|
-
for (var prop in source)
|
44514
|
-
if (__hasOwnProp2.call(source, prop) && exclude.indexOf(prop) < 0)
|
44515
|
-
target[prop] = source[prop];
|
44516
|
-
if (source != null && __getOwnPropSymbols2)
|
44517
|
-
for (var prop of __getOwnPropSymbols2(source)) {
|
44518
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum2.call(source, prop))
|
44519
|
-
target[prop] = source[prop];
|
44520
|
-
}
|
44521
|
-
return target;
|
44522
|
-
};
|
44523
|
-
var __export2 = (target, all) => {
|
44524
|
-
for (var name in all)
|
44525
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
44526
|
-
};
|
44527
|
-
var __copyProps2 = (to, from, except, desc) => {
|
44528
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
44529
|
-
for (let key of __getOwnPropNames2(from))
|
44530
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
44531
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
44532
|
-
}
|
44533
|
-
return to;
|
44534
|
-
};
|
44535
|
-
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
44536
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
44537
|
-
// file that has been converted to a CommonJS file using a Babel-
|
44538
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
44539
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
44540
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
44541
|
-
mod
|
44542
|
-
));
|
44543
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
44544
|
-
var auto_frame_component_exports = {};
|
44545
|
-
__export2(auto_frame_component_exports, {
|
44546
|
-
default: () => AutoFrameComponent_default
|
44547
|
-
});
|
44548
|
-
module2.exports = __toCommonJS2(auto_frame_component_exports);
|
44549
|
-
var import_react13 = __toESM2(require("react"));
|
44550
|
-
var import_react22 = __toESM2(require("react"));
|
44551
|
-
var import_react_frame_component = __toESM2(require_lib());
|
44552
|
-
var import_object_hash = __toESM2(require_object_hash());
|
44553
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
44554
|
-
var styleSelector = 'style, link[as="style"], link[rel="stylesheet"]';
|
44555
|
-
var collectStyles = (doc) => {
|
44556
|
-
const collected = [];
|
44557
|
-
doc.head.querySelectorAll(styleSelector).forEach((style2) => {
|
44558
|
-
collected.push(style2);
|
44559
|
-
});
|
44560
|
-
return collected;
|
44561
|
-
};
|
44562
|
-
var CopyHostStyles = ({
|
44563
|
-
children,
|
44564
|
-
debug = false,
|
44565
|
-
onStylesLoaded = () => null
|
44566
|
-
}) => {
|
44567
|
-
const { document: doc, window: win } = (0, import_react_frame_component.useFrame)();
|
44568
|
-
(0, import_react22.useLayoutEffect)(() => {
|
44569
|
-
if (!win || !doc) {
|
44570
|
-
return () => {
|
44571
|
-
};
|
44572
|
-
}
|
44573
|
-
const elements = [];
|
44574
|
-
const lookupEl = (el) => elements.findIndex((elementMap) => elementMap.original === el);
|
44575
|
-
const addEl = (el, onLoad = () => {
|
44576
|
-
}) => {
|
44577
|
-
const index = lookupEl(el);
|
44578
|
-
if (index > -1) {
|
44579
|
-
if (debug)
|
44580
|
-
console.log(
|
44581
|
-
`Tried to add an element that was already mirrored. Updating instead...`
|
44582
|
-
);
|
44583
|
-
elements[index].mirror.innerText = el.innerText;
|
44584
|
-
onLoad();
|
44585
|
-
return;
|
44586
|
-
}
|
44587
|
-
const elHash = (0, import_object_hash.default)(el.outerHTML);
|
44588
|
-
const existingHashes = collectStyles(doc).map(
|
44589
|
-
(existingStyle) => (0, import_object_hash.default)(existingStyle.outerHTML)
|
44590
|
-
);
|
44591
|
-
if (existingHashes.indexOf(elHash) > -1) {
|
44592
|
-
if (debug)
|
44593
|
-
console.log(
|
44594
|
-
`iframe already contains element that is being mirrored. Skipping...`
|
44595
|
-
);
|
44596
|
-
onLoad();
|
44597
|
-
return;
|
44598
|
-
}
|
44599
|
-
const mirror = el.cloneNode(true);
|
44600
|
-
mirror.onload = onLoad;
|
44601
|
-
doc.head.append(mirror);
|
44602
|
-
elements.push({ original: el, mirror });
|
44603
|
-
if (debug)
|
44604
|
-
console.log(`Added style node ${el.outerHTML}`);
|
44605
|
-
};
|
44606
|
-
const removeEl = (el) => {
|
44607
|
-
const index = lookupEl(el);
|
44608
|
-
if (index === -1) {
|
44609
|
-
if (debug)
|
44610
|
-
console.log(
|
44611
|
-
`Tried to remove an element that did not exist. Skipping...`
|
44612
|
-
);
|
44613
|
-
return;
|
44614
|
-
}
|
44615
|
-
elements[index].mirror.remove();
|
44616
|
-
if (debug)
|
44617
|
-
console.log(`Removed style node ${el.outerHTML}`);
|
44618
|
-
};
|
44619
|
-
const observer = new MutationObserver((mutations) => {
|
44620
|
-
mutations.forEach((mutation) => {
|
44621
|
-
if (mutation.type === "childList") {
|
44622
|
-
mutation.addedNodes.forEach((node) => {
|
44623
|
-
if (node.nodeType === Node.TEXT_NODE || node.nodeType === Node.ELEMENT_NODE) {
|
44624
|
-
const el = node.nodeType === Node.TEXT_NODE ? node.parentElement : node;
|
44625
|
-
if (el && el.matches(styleSelector)) {
|
44626
|
-
addEl(el);
|
44627
|
-
}
|
44628
|
-
}
|
44629
|
-
});
|
44630
|
-
mutation.removedNodes.forEach((node) => {
|
44631
|
-
if (node.nodeType === Node.TEXT_NODE || node.nodeType === Node.ELEMENT_NODE) {
|
44632
|
-
const el = node.nodeType === Node.TEXT_NODE ? node.parentElement : node;
|
44633
|
-
if (el && el.matches(styleSelector)) {
|
44634
|
-
removeEl(el);
|
44635
|
-
}
|
44636
|
-
}
|
44637
|
-
});
|
44638
|
-
}
|
44639
|
-
});
|
44640
|
-
});
|
44641
|
-
const parentDocument = win.parent.document;
|
44642
|
-
const collectedStyles = collectStyles(parentDocument);
|
44643
|
-
let mountedCounter = 0;
|
44644
|
-
collectedStyles.forEach((styleNode) => {
|
44645
|
-
addEl(styleNode, () => {
|
44646
|
-
mountedCounter += 1;
|
44647
|
-
if (mountedCounter === collectedStyles.length) {
|
44648
|
-
onStylesLoaded();
|
44649
|
-
}
|
44650
|
-
});
|
44651
|
-
});
|
44652
|
-
observer.observe(parentDocument.head, { childList: true, subtree: true });
|
44653
|
-
return () => {
|
44654
|
-
observer.disconnect();
|
44655
|
-
};
|
44656
|
-
}, []);
|
44657
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children });
|
44658
|
-
};
|
44659
|
-
var AutoFrameComponent_default = import_react22.default.forwardRef(function(_a3, ref2) {
|
44660
|
-
var _b = _a3, { children, debug, onStylesLoaded } = _b, props = __objRest2(_b, ["children", "debug", "onStylesLoaded"]);
|
44661
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_frame_component.default, __spreadProps2(__spreadValues2({}, props), { ref: ref2, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CopyHostStyles, { debug, onStylesLoaded, children }) }));
|
44662
|
-
});
|
44663
|
-
}
|
44664
|
-
});
|
44665
|
-
|
44666
45810
|
// ../../node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.js
|
44667
45811
|
var react_hotkeys_hook_esm_exports = {};
|
44668
45812
|
__export(react_hotkeys_hook_esm_exports, {
|
@@ -45132,7 +46276,7 @@ var init_react_hotkeys_hook_esm = __esm({
|
|
45132
46276
|
});
|
45133
46277
|
|
45134
46278
|
// ../core/dist/index.js
|
45135
|
-
var
|
46279
|
+
var require_dist = __commonJS({
|
45136
46280
|
"../core/dist/index.js"(exports, module2) {
|
45137
46281
|
"use strict";
|
45138
46282
|
init_react_import();
|
@@ -53156,9 +54300,9 @@ var require_dist2 = __commonJS({
|
|
53156
54300
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
53157
54301
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
53158
54302
|
}
|
53159
|
-
var
|
54303
|
+
var React32 = require("react");
|
53160
54304
|
var Scheduler = require_scheduler2();
|
53161
|
-
var ReactSharedInternals =
|
54305
|
+
var ReactSharedInternals = React32.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
53162
54306
|
var suppressWarning = false;
|
53163
54307
|
function setSuppressWarning(newSuppressWarning) {
|
53164
54308
|
{
|
@@ -53207,7 +54351,7 @@ var require_dist2 = __commonJS({
|
|
53207
54351
|
var HostPortal = 4;
|
53208
54352
|
var HostComponent = 5;
|
53209
54353
|
var HostText = 6;
|
53210
|
-
var
|
54354
|
+
var Fragment18 = 7;
|
53211
54355
|
var Mode = 8;
|
53212
54356
|
var ContextConsumer = 9;
|
53213
54357
|
var ContextProvider = 10;
|
@@ -54363,7 +55507,7 @@ var require_dist2 = __commonJS({
|
|
54363
55507
|
return "DehydratedFragment";
|
54364
55508
|
case ForwardRef:
|
54365
55509
|
return getWrappedName$1(type, type.render, "ForwardRef");
|
54366
|
-
case
|
55510
|
+
case Fragment18:
|
54367
55511
|
return "Fragment";
|
54368
55512
|
case HostComponent:
|
54369
55513
|
return type;
|
@@ -54763,7 +55907,7 @@ var require_dist2 = __commonJS({
|
|
54763
55907
|
{
|
54764
55908
|
if (props.value == null) {
|
54765
55909
|
if (typeof props.children === "object" && props.children !== null) {
|
54766
|
-
|
55910
|
+
React32.Children.forEach(props.children, function(child) {
|
54767
55911
|
if (child == null) {
|
54768
55912
|
return;
|
54769
55913
|
}
|
@@ -63210,7 +64354,7 @@ var require_dist2 = __commonJS({
|
|
63210
64354
|
}
|
63211
64355
|
}
|
63212
64356
|
var fakeInternalInstance = {};
|
63213
|
-
var emptyRefsObject = new
|
64357
|
+
var emptyRefsObject = new React32.Component().refs;
|
63214
64358
|
var didWarnAboutStateAssignmentForComponent;
|
63215
64359
|
var didWarnAboutUninitializedState;
|
63216
64360
|
var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
|
@@ -64034,7 +65178,7 @@ var require_dist2 = __commonJS({
|
|
64034
65178
|
}
|
64035
65179
|
}
|
64036
65180
|
function updateFragment2(returnFiber, current2, fragment, lanes, key) {
|
64037
|
-
if (current2 === null || current2.tag !==
|
65181
|
+
if (current2 === null || current2.tag !== Fragment18) {
|
64038
65182
|
var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
|
64039
65183
|
created.return = returnFiber;
|
64040
65184
|
return created;
|
@@ -64437,7 +65581,7 @@ var require_dist2 = __commonJS({
|
|
64437
65581
|
if (child.key === key) {
|
64438
65582
|
var elementType = element.type;
|
64439
65583
|
if (elementType === REACT_FRAGMENT_TYPE) {
|
64440
|
-
if (child.tag ===
|
65584
|
+
if (child.tag === Fragment18) {
|
64441
65585
|
deleteRemainingChildren(returnFiber, child.sibling);
|
64442
65586
|
var existing = useFiber(child, element.props.children);
|
64443
65587
|
existing.return = returnFiber;
|
@@ -68612,7 +69756,7 @@ var require_dist2 = __commonJS({
|
|
68612
69756
|
var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
|
68613
69757
|
return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
|
68614
69758
|
}
|
68615
|
-
case
|
69759
|
+
case Fragment18:
|
68616
69760
|
return updateFragment(current2, workInProgress2, renderLanes2);
|
68617
69761
|
case Mode:
|
68618
69762
|
return updateMode(current2, workInProgress2, renderLanes2);
|
@@ -68885,7 +70029,7 @@ var require_dist2 = __commonJS({
|
|
68885
70029
|
case SimpleMemoComponent:
|
68886
70030
|
case FunctionComponent:
|
68887
70031
|
case ForwardRef:
|
68888
|
-
case
|
70032
|
+
case Fragment18:
|
68889
70033
|
case Mode:
|
68890
70034
|
case Profiler:
|
68891
70035
|
case ContextConsumer:
|
@@ -73144,7 +74288,7 @@ var require_dist2 = __commonJS({
|
|
73144
74288
|
return fiber;
|
73145
74289
|
}
|
73146
74290
|
function createFiberFromFragment(elements, mode, lanes, key) {
|
73147
|
-
var fiber = createFiber(
|
74291
|
+
var fiber = createFiber(Fragment18, elements, key, mode);
|
73148
74292
|
fiber.lanes = lanes;
|
73149
74293
|
return fiber;
|
73150
74294
|
}
|
@@ -74400,6 +75544,7 @@ var require_dist2 = __commonJS({
|
|
74400
75544
|
{ width: 768, height: "auto", icon: "Tablet", label: "Medium" },
|
74401
75545
|
{ width: 1280, height: "auto", icon: "Monitor", label: "Large" }
|
74402
75546
|
];
|
75547
|
+
var import_ua_parser_js2 = require_ua_parser();
|
74403
75548
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
74404
75549
|
var defaultAppState2 = {
|
74405
75550
|
data: { content: [], root: { props: { title: "" } } },
|
@@ -74439,7 +75584,8 @@ var require_dist2 = __commonJS({
|
|
74439
75584
|
setZoomConfig: () => null,
|
74440
75585
|
status: "LOADING",
|
74441
75586
|
setStatus: () => null,
|
74442
|
-
iframe: {}
|
75587
|
+
iframe: {},
|
75588
|
+
safariFallbackMode: false
|
74443
75589
|
};
|
74444
75590
|
var appContext2 = (0, import_react32.createContext)(defaultContext2);
|
74445
75591
|
var AppProvider = ({
|
@@ -74451,10 +75597,34 @@ var require_dist2 = __commonJS({
|
|
74451
75597
|
(0, import_react32.useEffect)(() => {
|
74452
75598
|
setStatus("MOUNTED");
|
74453
75599
|
}, []);
|
75600
|
+
const [safariFallbackMode, setSafariFallbackMode] = (0, import_react32.useState)(false);
|
75601
|
+
(0, import_react32.useEffect)(() => {
|
75602
|
+
var _a3, _b, _c;
|
75603
|
+
const ua = new import_ua_parser_js2.UAParser(navigator.userAgent);
|
75604
|
+
const { browser } = ua.getResult();
|
75605
|
+
if (browser.name === "Safari" && (((_a3 = browser.version) == null ? void 0 : _a3.indexOf("17.2.")) || ((_b = browser.version) == null ? void 0 : _b.indexOf("17.3.")) || ((_c = browser.version) == null ? void 0 : _c.indexOf("17.4.")))) {
|
75606
|
+
if (process.env.NODE_ENV !== "production" && value.iframe.enabled) {
|
75607
|
+
console.warn(
|
75608
|
+
`Detected Safari ${browser.version}, which contains a bug that prevents Puck DropZones from detecting a mouseover event within an iframe. This affects Safari versions 17.2, 17.3 and 17.4.
|
75609
|
+
|
75610
|
+
Running in compatibility mode, which may have some DropZone side-effects. Alternatively, consider disabling iframes: https://puckeditor.com/docs/integrating-puck/viewports#opting-out-of-iframes.
|
75611
|
+
|
75612
|
+
See https://github.com/measuredco/puck/issues/411 for more information. This message will not show in production.`
|
75613
|
+
);
|
75614
|
+
}
|
75615
|
+
setSafariFallbackMode(true);
|
75616
|
+
}
|
75617
|
+
}, []);
|
74454
75618
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
74455
75619
|
appContext2.Provider,
|
74456
75620
|
{
|
74457
|
-
value: __spreadProps2(__spreadValues2({}, value), {
|
75621
|
+
value: __spreadProps2(__spreadValues2({}, value), {
|
75622
|
+
zoomConfig,
|
75623
|
+
setZoomConfig,
|
75624
|
+
status,
|
75625
|
+
setStatus,
|
75626
|
+
safariFallbackMode
|
75627
|
+
}),
|
74458
75628
|
children
|
74459
75629
|
}
|
74460
75630
|
);
|
@@ -75176,7 +76346,11 @@ var require_dist2 = __commonJS({
|
|
75176
76346
|
let isEnabled = userWillDrag;
|
75177
76347
|
if (userIsDragging) {
|
75178
76348
|
if (draggingNewComponent) {
|
75179
|
-
|
76349
|
+
if (appContext22.safariFallbackMode) {
|
76350
|
+
isEnabled = true;
|
76351
|
+
} else {
|
76352
|
+
isEnabled = hoveringOverArea;
|
76353
|
+
}
|
75180
76354
|
} else {
|
75181
76355
|
isEnabled = draggingOverArea && hoveringOverZone;
|
75182
76356
|
}
|
@@ -75471,7 +76645,7 @@ var require_dist2 = __commonJS({
|
|
75471
76645
|
return el;
|
75472
76646
|
};
|
75473
76647
|
init_react_import2();
|
75474
|
-
var
|
76648
|
+
var import_react29 = require("react");
|
75475
76649
|
init_react_import2();
|
75476
76650
|
var import_react112 = require("react");
|
75477
76651
|
init_react_import2();
|
@@ -76102,7 +77276,7 @@ var require_dist2 = __commonJS({
|
|
76102
77276
|
const [componentState, setComponentState] = (0, import_react132.useState)({});
|
76103
77277
|
const deferredSetStates = {};
|
76104
77278
|
const setComponentLoading = (0, import_react132.useCallback)(
|
76105
|
-
(id, loading,
|
77279
|
+
(id, loading, defer2 = 0) => {
|
76106
77280
|
if (deferredSetStates[id]) {
|
76107
77281
|
clearTimeout(deferredSetStates[id]);
|
76108
77282
|
delete deferredSetStates[id];
|
@@ -76112,7 +77286,7 @@ var require_dist2 = __commonJS({
|
|
76112
77286
|
[id]: __spreadProps2(__spreadValues2({}, prev[id]), { loading })
|
76113
77287
|
}));
|
76114
77288
|
delete deferredSetStates[id];
|
76115
|
-
},
|
77289
|
+
}, defer2);
|
76116
77290
|
},
|
76117
77291
|
[]
|
76118
77292
|
);
|
@@ -76902,7 +78076,7 @@ var require_dist2 = __commonJS({
|
|
76902
78076
|
onChange(e2.currentTarget.value);
|
76903
78077
|
},
|
76904
78078
|
disabled: readOnly,
|
76905
|
-
|
78079
|
+
checked: value === option.value
|
76906
78080
|
}
|
76907
78081
|
),
|
76908
78082
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName14("radioInner"), children: option.label || option.value })
|
@@ -76942,7 +78116,7 @@ var require_dist2 = __commonJS({
|
|
76942
78116
|
disabled: readOnly,
|
76943
78117
|
onChange: (e2) => {
|
76944
78118
|
if (e2.currentTarget.value === "true" || e2.currentTarget.value === "false") {
|
76945
|
-
onChange(
|
78119
|
+
onChange(JSON.parse(e2.currentTarget.value));
|
76946
78120
|
return;
|
76947
78121
|
}
|
76948
78122
|
onChange(e2.currentTarget.value);
|
@@ -77434,15 +78608,212 @@ var require_dist2 = __commonJS({
|
|
77434
78608
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Wrapper, { children: componentList ? componentList : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ComponentList, { id: "all" }) });
|
77435
78609
|
};
|
77436
78610
|
init_react_import2();
|
77437
|
-
var
|
77438
|
-
var import_auto_frame_component = __toESM2(require_dist());
|
78611
|
+
var import_react23 = require("react");
|
77439
78612
|
init_react_import2();
|
77440
|
-
var
|
78613
|
+
var import_react222 = __toESM2(require("react"));
|
78614
|
+
var import_react_frame_component = __toESM2(require_lib());
|
78615
|
+
var import_object_hash = __toESM2(require_object_hash());
|
77441
78616
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
78617
|
+
var styleSelector = 'style, link[rel="stylesheet"]';
|
78618
|
+
var collectStyles = (doc) => {
|
78619
|
+
const collected = [];
|
78620
|
+
doc.head.querySelectorAll(styleSelector).forEach((style2) => {
|
78621
|
+
collected.push(style2);
|
78622
|
+
});
|
78623
|
+
return collected;
|
78624
|
+
};
|
78625
|
+
var getStyleSheet = (el) => {
|
78626
|
+
return Array.from(document.styleSheets).find((ss) => {
|
78627
|
+
const ownerNode = ss.ownerNode;
|
78628
|
+
return ownerNode.href === el.href;
|
78629
|
+
});
|
78630
|
+
};
|
78631
|
+
var getStyles2 = (styleSheet) => {
|
78632
|
+
if (styleSheet) {
|
78633
|
+
try {
|
78634
|
+
return [...styleSheet.cssRules].map((rule) => rule.cssText).join("");
|
78635
|
+
} catch (e2) {
|
78636
|
+
console.warn(
|
78637
|
+
"Access to stylesheet %s is denied. Ignoring\u2026",
|
78638
|
+
styleSheet.href
|
78639
|
+
);
|
78640
|
+
}
|
78641
|
+
}
|
78642
|
+
return "";
|
78643
|
+
};
|
78644
|
+
var defer = (fn) => setTimeout(fn, 0);
|
78645
|
+
var CopyHostStyles = ({
|
78646
|
+
children,
|
78647
|
+
debug = false,
|
78648
|
+
onStylesLoaded = () => null
|
78649
|
+
}) => {
|
78650
|
+
const { document: doc, window: win } = (0, import_react_frame_component.useFrame)();
|
78651
|
+
(0, import_react222.useEffect)(() => {
|
78652
|
+
if (!win || !doc) {
|
78653
|
+
return () => {
|
78654
|
+
};
|
78655
|
+
}
|
78656
|
+
let elements = [];
|
78657
|
+
const hashes = {};
|
78658
|
+
const lookupEl = (el) => elements.findIndex((elementMap) => elementMap.original === el);
|
78659
|
+
const mirrorEl = (el, inlineStyles = false) => __async2(void 0, null, function* () {
|
78660
|
+
let mirror;
|
78661
|
+
if (el.nodeName === "LINK" && inlineStyles) {
|
78662
|
+
mirror = document.createElement("style");
|
78663
|
+
mirror.type = "text/css";
|
78664
|
+
let styleSheet = getStyleSheet(el);
|
78665
|
+
if (!styleSheet) {
|
78666
|
+
yield new Promise((resolve) => {
|
78667
|
+
const fn = () => {
|
78668
|
+
resolve();
|
78669
|
+
el.removeEventListener("load", fn);
|
78670
|
+
};
|
78671
|
+
el.addEventListener("load", fn);
|
78672
|
+
});
|
78673
|
+
styleSheet = getStyleSheet(el);
|
78674
|
+
}
|
78675
|
+
const styles = getStyles2(styleSheet);
|
78676
|
+
if (!styles) {
|
78677
|
+
if (debug) {
|
78678
|
+
console.warn(
|
78679
|
+
`Tried to load styles for link element, but couldn't find them. Skipping...`
|
78680
|
+
);
|
78681
|
+
}
|
78682
|
+
return;
|
78683
|
+
}
|
78684
|
+
mirror.innerHTML = styles;
|
78685
|
+
mirror.setAttribute("data-href", el.getAttribute("href"));
|
78686
|
+
} else {
|
78687
|
+
mirror = el.cloneNode(true);
|
78688
|
+
}
|
78689
|
+
return mirror;
|
78690
|
+
});
|
78691
|
+
const addEl = (el) => __async2(void 0, null, function* () {
|
78692
|
+
const index = lookupEl(el);
|
78693
|
+
if (index > -1) {
|
78694
|
+
if (debug)
|
78695
|
+
console.log(
|
78696
|
+
`Tried to add an element that was already mirrored. Updating instead...`
|
78697
|
+
);
|
78698
|
+
elements[index].mirror.innerText = el.innerText;
|
78699
|
+
return;
|
78700
|
+
}
|
78701
|
+
const mirror = yield mirrorEl(el);
|
78702
|
+
if (!mirror) {
|
78703
|
+
return;
|
78704
|
+
}
|
78705
|
+
const elHash = (0, import_object_hash.default)(mirror.outerHTML);
|
78706
|
+
if (hashes[elHash]) {
|
78707
|
+
if (debug)
|
78708
|
+
console.log(
|
78709
|
+
`iframe already contains element that is being mirrored. Skipping...`
|
78710
|
+
);
|
78711
|
+
return;
|
78712
|
+
}
|
78713
|
+
hashes[elHash] = true;
|
78714
|
+
doc.head.append(mirror);
|
78715
|
+
elements.push({ original: el, mirror });
|
78716
|
+
if (debug)
|
78717
|
+
console.log(`Added style node ${el.outerHTML}`);
|
78718
|
+
});
|
78719
|
+
const removeEl = (el) => {
|
78720
|
+
var _a3, _b;
|
78721
|
+
const index = lookupEl(el);
|
78722
|
+
if (index === -1) {
|
78723
|
+
if (debug)
|
78724
|
+
console.log(
|
78725
|
+
`Tried to remove an element that did not exist. Skipping...`
|
78726
|
+
);
|
78727
|
+
return;
|
78728
|
+
}
|
78729
|
+
const elHash = (0, import_object_hash.default)(el.outerHTML);
|
78730
|
+
(_b = (_a3 = elements[index]) == null ? void 0 : _a3.mirror) == null ? void 0 : _b.remove();
|
78731
|
+
delete hashes[elHash];
|
78732
|
+
if (debug)
|
78733
|
+
console.log(`Removed style node ${el.outerHTML}`);
|
78734
|
+
};
|
78735
|
+
const observer = new MutationObserver((mutations) => {
|
78736
|
+
mutations.forEach((mutation) => {
|
78737
|
+
if (mutation.type === "childList") {
|
78738
|
+
mutation.addedNodes.forEach((node) => {
|
78739
|
+
if (node.nodeType === Node.TEXT_NODE || node.nodeType === Node.ELEMENT_NODE) {
|
78740
|
+
const el = node.nodeType === Node.TEXT_NODE ? node.parentElement : node;
|
78741
|
+
if (el && el.matches(styleSelector)) {
|
78742
|
+
defer(() => addEl(el));
|
78743
|
+
}
|
78744
|
+
}
|
78745
|
+
});
|
78746
|
+
mutation.removedNodes.forEach((node) => {
|
78747
|
+
if (node.nodeType === Node.TEXT_NODE || node.nodeType === Node.ELEMENT_NODE) {
|
78748
|
+
const el = node.nodeType === Node.TEXT_NODE ? node.parentElement : node;
|
78749
|
+
if (el && el.matches(styleSelector)) {
|
78750
|
+
defer(() => removeEl(el));
|
78751
|
+
}
|
78752
|
+
}
|
78753
|
+
});
|
78754
|
+
}
|
78755
|
+
});
|
78756
|
+
});
|
78757
|
+
const parentDocument = win.parent.document;
|
78758
|
+
const collectedStyles = collectStyles(parentDocument);
|
78759
|
+
const hrefs = [];
|
78760
|
+
let stylesLoaded = 0;
|
78761
|
+
Promise.all(
|
78762
|
+
collectedStyles.map((styleNode, i2) => __async2(void 0, null, function* () {
|
78763
|
+
if (styleNode.nodeName === "LINK") {
|
78764
|
+
const linkHref = styleNode.href;
|
78765
|
+
if (hrefs.indexOf(linkHref) > -1) {
|
78766
|
+
return;
|
78767
|
+
}
|
78768
|
+
hrefs.push(linkHref);
|
78769
|
+
}
|
78770
|
+
const mirror = yield mirrorEl(styleNode);
|
78771
|
+
if (!mirror)
|
78772
|
+
return;
|
78773
|
+
elements.push({ original: styleNode, mirror });
|
78774
|
+
return mirror;
|
78775
|
+
}))
|
78776
|
+
).then((mirrorStyles) => {
|
78777
|
+
const filtered = mirrorStyles.filter(
|
78778
|
+
(el) => typeof el !== "undefined"
|
78779
|
+
);
|
78780
|
+
filtered.forEach((mirror) => {
|
78781
|
+
mirror.onload = () => {
|
78782
|
+
stylesLoaded = stylesLoaded + 1;
|
78783
|
+
if (stylesLoaded >= elements.length) {
|
78784
|
+
onStylesLoaded();
|
78785
|
+
}
|
78786
|
+
};
|
78787
|
+
});
|
78788
|
+
doc.head.innerHTML = "";
|
78789
|
+
doc.head.append(...filtered);
|
78790
|
+
observer.observe(parentDocument.head, { childList: true, subtree: true });
|
78791
|
+
filtered.forEach((el) => {
|
78792
|
+
const elHash = (0, import_object_hash.default)(el.outerHTML);
|
78793
|
+
hashes[elHash] = true;
|
78794
|
+
});
|
78795
|
+
});
|
78796
|
+
return () => {
|
78797
|
+
observer.disconnect();
|
78798
|
+
};
|
78799
|
+
}, []);
|
78800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_jsx_runtime29.Fragment, { children });
|
78801
|
+
};
|
78802
|
+
var AutoFrameComponent = import_react222.default.forwardRef(
|
78803
|
+
function(_a3, ref2) {
|
78804
|
+
var _b = _a3, { children, debug, onStylesLoaded } = _b, props = __objRest2(_b, ["children", "debug", "onStylesLoaded"]);
|
78805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_frame_component.default, __spreadProps2(__spreadValues2({}, props), { ref: ref2, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CopyHostStyles, { debug, onStylesLoaded, children }) }));
|
78806
|
+
}
|
78807
|
+
);
|
78808
|
+
AutoFrameComponent.displayName = "AutoFrameComponent";
|
78809
|
+
var AutoFrame_default = AutoFrameComponent;
|
78810
|
+
init_react_import2();
|
78811
|
+
var styles_module_default16 = { "PuckPreview": "_PuckPreview_rxwlr_1", "PuckPreview-frame": "_PuckPreview-frame_rxwlr_5" };
|
78812
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
77442
78813
|
var getClassName21 = get_class_name_factory_default2("PuckPreview", styles_module_default16);
|
77443
78814
|
var Preview = ({ id = "puck-preview" }) => {
|
77444
78815
|
const { config, dispatch, state, setStatus, iframe } = useAppContext2();
|
77445
|
-
const Page = (0,
|
78816
|
+
const Page = (0, import_react23.useCallback)(
|
77446
78817
|
(pageProps) => {
|
77447
78818
|
var _a3, _b;
|
77448
78819
|
return ((_a3 = config.root) == null ? void 0 : _a3.render) ? (_b = config.root) == null ? void 0 : _b.render(__spreadProps2(__spreadValues2({
|
@@ -77450,13 +78821,13 @@ var require_dist2 = __commonJS({
|
|
77450
78821
|
}, pageProps), {
|
77451
78822
|
editMode: true,
|
77452
78823
|
puck: { renderDropZone: DropZone }
|
77453
|
-
})) : /* @__PURE__ */ (0,
|
78824
|
+
})) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_jsx_runtime30.Fragment, { children: pageProps.children });
|
77454
78825
|
},
|
77455
78826
|
[config.root]
|
77456
78827
|
);
|
77457
78828
|
const rootProps = state.data.root.props || state.data.root;
|
77458
|
-
const ref2 = (0,
|
77459
|
-
return /* @__PURE__ */ (0,
|
78829
|
+
const ref2 = (0, import_react23.useRef)(null);
|
78830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
77460
78831
|
"div",
|
77461
78832
|
{
|
77462
78833
|
className: getClassName21(),
|
@@ -77464,8 +78835,8 @@ var require_dist2 = __commonJS({
|
|
77464
78835
|
onClick: () => {
|
77465
78836
|
dispatch({ type: "setUi", ui: __spreadProps2(__spreadValues2({}, state.ui), { itemSelector: null }) });
|
77466
78837
|
},
|
77467
|
-
children: iframe.enabled ? /* @__PURE__ */ (0,
|
77468
|
-
|
78838
|
+
children: iframe.enabled ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
78839
|
+
AutoFrame_default,
|
77469
78840
|
{
|
77470
78841
|
id: "preview-frame",
|
77471
78842
|
className: getClassName21("frame"),
|
@@ -77474,9 +78845,9 @@ var require_dist2 = __commonJS({
|
|
77474
78845
|
onStylesLoaded: () => {
|
77475
78846
|
setStatus("READY");
|
77476
78847
|
},
|
77477
|
-
children: /* @__PURE__ */ (0,
|
78848
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Page, __spreadProps2(__spreadValues2({ dispatch, state }, rootProps), { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DropZone, { zone: rootDroppableId2 }) }))
|
77478
78849
|
}
|
77479
|
-
) : /* @__PURE__ */ (0,
|
78850
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { id: "preview-frame", className: getClassName21("frame"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Page, __spreadProps2(__spreadValues2({ dispatch, state }, rootProps), { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DropZone, { zone: rootDroppableId2 }) })) })
|
77480
78851
|
}
|
77481
78852
|
);
|
77482
78853
|
};
|
@@ -77508,7 +78879,7 @@ var require_dist2 = __commonJS({
|
|
77508
78879
|
el.style.scrollMargin = oldStyle.scrollMargin || "";
|
77509
78880
|
}
|
77510
78881
|
};
|
77511
|
-
var
|
78882
|
+
var import_react24 = require("react");
|
77512
78883
|
init_react_import2();
|
77513
78884
|
var isChildOfZone = (item, maybeChild, ctx) => {
|
77514
78885
|
var _a3;
|
@@ -77518,7 +78889,7 @@ var require_dist2 = __commonJS({
|
|
77518
78889
|
return area === item.props.id;
|
77519
78890
|
})) : false;
|
77520
78891
|
};
|
77521
|
-
var
|
78892
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
77522
78893
|
var getClassName222 = get_class_name_factory_default2("LayerTree", styles_module_default17);
|
77523
78894
|
var getClassNameLayer = get_class_name_factory_default2("Layer", styles_module_default17);
|
77524
78895
|
var LayerTree = ({
|
@@ -77531,15 +78902,15 @@ var require_dist2 = __commonJS({
|
|
77531
78902
|
label
|
77532
78903
|
}) => {
|
77533
78904
|
const zones = data.zones || {};
|
77534
|
-
const ctx = (0,
|
77535
|
-
return /* @__PURE__ */ (0,
|
77536
|
-
label && /* @__PURE__ */ (0,
|
77537
|
-
/* @__PURE__ */ (0,
|
78905
|
+
const ctx = (0, import_react24.useContext)(dropZoneContext2);
|
78906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
78907
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: getClassName222("zoneTitle"), children: [
|
78908
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: getClassName222("zoneIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Layers, { size: "16" }) }),
|
77538
78909
|
" ",
|
77539
78910
|
label
|
77540
78911
|
] }),
|
77541
|
-
/* @__PURE__ */ (0,
|
77542
|
-
zoneContent.length === 0 && /* @__PURE__ */ (0,
|
78912
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("ul", { className: getClassName222(), children: [
|
78913
|
+
zoneContent.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: getClassName222("helper"), children: "No items" }),
|
77543
78914
|
zoneContent.map((item, i2) => {
|
77544
78915
|
var _a3;
|
77545
78916
|
const isSelected = (itemSelector == null ? void 0 : itemSelector.index) === i2 && (itemSelector.zone === zone || itemSelector.zone === rootDroppableId2 && !zone);
|
@@ -77555,7 +78926,7 @@ var require_dist2 = __commonJS({
|
|
77555
78926
|
const selectedItem = itemSelector && data ? getItem2(itemSelector, data) : null;
|
77556
78927
|
const isHovering = hoveringComponent === item.props.id;
|
77557
78928
|
const childIsSelected = isChildOfZone(item, selectedItem, ctx);
|
77558
|
-
return /* @__PURE__ */ (0,
|
78929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
77559
78930
|
"li",
|
77560
78931
|
{
|
77561
78932
|
className: getClassNameLayer({
|
@@ -77565,7 +78936,7 @@ var require_dist2 = __commonJS({
|
|
77565
78936
|
childIsSelected
|
77566
78937
|
}),
|
77567
78938
|
children: [
|
77568
|
-
/* @__PURE__ */ (0,
|
78939
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: getClassNameLayer("inner"), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
77569
78940
|
"button",
|
77570
78941
|
{
|
77571
78942
|
className: getClassNameLayer("clickable"),
|
@@ -77597,22 +78968,22 @@ var require_dist2 = __commonJS({
|
|
77597
78968
|
setHoveringComponent(null);
|
77598
78969
|
},
|
77599
78970
|
children: [
|
77600
|
-
containsZone && /* @__PURE__ */ (0,
|
78971
|
+
containsZone && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
77601
78972
|
"div",
|
77602
78973
|
{
|
77603
78974
|
className: getClassNameLayer("chevron"),
|
77604
78975
|
title: isSelected ? "Collapse" : "Expand",
|
77605
|
-
children: /* @__PURE__ */ (0,
|
78976
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ChevronDown, { size: "12" })
|
77606
78977
|
}
|
77607
78978
|
),
|
77608
|
-
/* @__PURE__ */ (0,
|
77609
|
-
/* @__PURE__ */ (0,
|
77610
|
-
/* @__PURE__ */ (0,
|
78979
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: getClassNameLayer("title"), children: [
|
78980
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: getClassNameLayer("icon"), children: item.type === "Text" || item.type === "Heading" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Type, { size: "16" }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(LayoutGrid, { size: "16" }) }),
|
78981
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: getClassNameLayer("name"), children: (_a3 = config.components[item.type]["label"]) != null ? _a3 : item.type })
|
77611
78982
|
] })
|
77612
78983
|
]
|
77613
78984
|
}
|
77614
78985
|
) }),
|
77615
|
-
containsZone && Object.keys(zonesForItem).map((zoneKey, idx) => /* @__PURE__ */ (0,
|
78986
|
+
containsZone && Object.keys(zonesForItem).map((zoneKey, idx) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: getClassNameLayer("zones"), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
77616
78987
|
LayerTree,
|
77617
78988
|
{
|
77618
78989
|
config,
|
@@ -77632,13 +79003,13 @@ var require_dist2 = __commonJS({
|
|
77632
79003
|
] })
|
77633
79004
|
] });
|
77634
79005
|
};
|
77635
|
-
var
|
77636
|
-
var
|
79006
|
+
var import_react25 = require("react");
|
79007
|
+
var import_jsx_runtime322 = require("react/jsx-runtime");
|
77637
79008
|
var Outline = () => {
|
77638
79009
|
const { dispatch, state, overrides, config } = useAppContext2();
|
77639
79010
|
const { data, ui } = state;
|
77640
79011
|
const { itemSelector } = ui;
|
77641
|
-
const setItemSelector = (0,
|
79012
|
+
const setItemSelector = (0, import_react25.useCallback)(
|
77642
79013
|
(newItemSelector) => {
|
77643
79014
|
dispatch({
|
77644
79015
|
type: "setUi",
|
@@ -77647,9 +79018,9 @@ var require_dist2 = __commonJS({
|
|
77647
79018
|
},
|
77648
79019
|
[]
|
77649
79020
|
);
|
77650
|
-
const Wrapper = (0,
|
77651
|
-
return /* @__PURE__ */ (0,
|
77652
|
-
(ctx == null ? void 0 : ctx.activeZones) && (ctx == null ? void 0 : ctx.activeZones[rootDroppableId2]) && /* @__PURE__ */ (0,
|
79021
|
+
const Wrapper = (0, import_react25.useMemo)(() => overrides.outline || "div", [overrides]);
|
79022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(dropZoneContext2.Consumer, { children: (ctx) => /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)(import_jsx_runtime322.Fragment, { children: [
|
79023
|
+
(ctx == null ? void 0 : ctx.activeZones) && (ctx == null ? void 0 : ctx.activeZones[rootDroppableId2]) && /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
77653
79024
|
LayerTree,
|
77654
79025
|
{
|
77655
79026
|
config,
|
@@ -77662,7 +79033,7 @@ var require_dist2 = __commonJS({
|
|
77662
79033
|
),
|
77663
79034
|
Object.entries(findZonesForArea(data, "root")).map(
|
77664
79035
|
([zoneKey, zone]) => {
|
77665
|
-
return /* @__PURE__ */ (0,
|
79036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
77666
79037
|
LayerTree,
|
77667
79038
|
{
|
77668
79039
|
config,
|
@@ -77741,12 +79112,12 @@ var require_dist2 = __commonJS({
|
|
77741
79112
|
};
|
77742
79113
|
}
|
77743
79114
|
init_react_import2();
|
77744
|
-
var
|
79115
|
+
var import_react26 = require("react");
|
77745
79116
|
var import_use_debounce3 = (init_index_module(), __toCommonJS(index_module_exports));
|
77746
79117
|
var EMPTY_HISTORY_INDEX = -1;
|
77747
79118
|
function useHistoryStore() {
|
77748
|
-
const [histories, setHistories] = (0,
|
77749
|
-
const [index, setIndex] = (0,
|
79119
|
+
const [histories, setHistories] = (0, import_react26.useState)([]);
|
79120
|
+
const [index, setIndex] = (0, import_react26.useState)(EMPTY_HISTORY_INDEX);
|
77750
79121
|
const hasPast = index > EMPTY_HISTORY_INDEX;
|
77751
79122
|
const hasFuture = index < histories.length - 1;
|
77752
79123
|
const currentHistory = histories[index];
|
@@ -77896,16 +79267,16 @@ var require_dist2 = __commonJS({
|
|
77896
79267
|
var styles = window.getComputedStyle(el);
|
77897
79268
|
return calculateBox3(borderBox, styles);
|
77898
79269
|
};
|
77899
|
-
var
|
79270
|
+
var import_react28 = require("react");
|
77900
79271
|
init_react_import2();
|
77901
|
-
var
|
79272
|
+
var import_react27 = require("react");
|
77902
79273
|
init_react_import2();
|
77903
79274
|
var styles_module_default18 = { "ViewportControls": "_ViewportControls_3zdvn_1", "ViewportControls-divider": "_ViewportControls-divider_3zdvn_15", "ViewportControls-zoomSelect": "_ViewportControls-zoomSelect_3zdvn_21", "ViewportButton--isActive": "_ViewportButton--isActive_3zdvn_33", "ViewportButton-inner": "_ViewportButton-inner_3zdvn_33" };
|
77904
|
-
var
|
79275
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
77905
79276
|
var icons = {
|
77906
|
-
Smartphone: /* @__PURE__ */ (0,
|
77907
|
-
Tablet: /* @__PURE__ */ (0,
|
77908
|
-
Monitor: /* @__PURE__ */ (0,
|
79277
|
+
Smartphone: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Smartphone, { size: 16 }),
|
79278
|
+
Tablet: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Tablet, { size: 16 }),
|
79279
|
+
Monitor: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Monitor, { size: 16 })
|
77909
79280
|
};
|
77910
79281
|
var getClassName23 = get_class_name_factory_default2("ViewportControls", styles_module_default18);
|
77911
79282
|
var getClassNameButton = get_class_name_factory_default2("ViewportButton", styles_module_default18);
|
@@ -77917,11 +79288,11 @@ var require_dist2 = __commonJS({
|
|
77917
79288
|
onClick
|
77918
79289
|
}) => {
|
77919
79290
|
const { state } = useAppContext2();
|
77920
|
-
const [isActive2, setIsActive] = (0,
|
77921
|
-
(0,
|
79291
|
+
const [isActive2, setIsActive] = (0, import_react27.useState)(false);
|
79292
|
+
(0, import_react27.useEffect)(() => {
|
77922
79293
|
setIsActive(width === state.ui.viewports.current.width);
|
77923
79294
|
}, [width, state.ui.viewports.current.width]);
|
77924
|
-
return /* @__PURE__ */ (0,
|
79295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: getClassNameButton({ isActive: isActive2 }), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
77925
79296
|
IconButton,
|
77926
79297
|
{
|
77927
79298
|
title,
|
@@ -77930,7 +79301,7 @@ var require_dist2 = __commonJS({
|
|
77930
79301
|
e2.stopPropagation();
|
77931
79302
|
onClick({ width, height });
|
77932
79303
|
},
|
77933
|
-
children: /* @__PURE__ */ (0,
|
79304
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: getClassNameButton("inner"), children })
|
77934
79305
|
}
|
77935
79306
|
) });
|
77936
79307
|
};
|
@@ -77954,7 +79325,7 @@ var require_dist2 = __commonJS({
|
|
77954
79325
|
const defaultsContainAutoZoom = defaultZoomOptions.find(
|
77955
79326
|
(option) => option.value === autoZoom
|
77956
79327
|
);
|
77957
|
-
const zoomOptions = (0,
|
79328
|
+
const zoomOptions = (0, import_react27.useMemo)(
|
77958
79329
|
() => [
|
77959
79330
|
...defaultZoomOptions,
|
77960
79331
|
...defaultsContainAutoZoom ? [] : [
|
@@ -77966,8 +79337,8 @@ var require_dist2 = __commonJS({
|
|
77966
79337
|
].filter((a2) => a2.value <= autoZoom).sort((a2, b) => a2.value > b.value ? 1 : -1),
|
77967
79338
|
[autoZoom]
|
77968
79339
|
);
|
77969
|
-
return /* @__PURE__ */ (0,
|
77970
|
-
viewports.map((viewport, i2) => /* @__PURE__ */ (0,
|
79340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: getClassName23(), children: [
|
79341
|
+
viewports.map((viewport, i2) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
77971
79342
|
ViewportButton,
|
77972
79343
|
{
|
77973
79344
|
height: viewport.height,
|
@@ -77978,8 +79349,8 @@ var require_dist2 = __commonJS({
|
|
77978
79349
|
},
|
77979
79350
|
i2
|
77980
79351
|
)),
|
77981
|
-
/* @__PURE__ */ (0,
|
77982
|
-
/* @__PURE__ */ (0,
|
79352
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: getClassName23("divider") }),
|
79353
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
77983
79354
|
IconButton,
|
77984
79355
|
{
|
77985
79356
|
title: "Zoom viewport out",
|
@@ -77993,10 +79364,10 @@ var require_dist2 = __commonJS({
|
|
77993
79364
|
)].value
|
77994
79365
|
);
|
77995
79366
|
},
|
77996
|
-
children: /* @__PURE__ */ (0,
|
79367
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ZoomOut, { size: 16 })
|
77997
79368
|
}
|
77998
79369
|
),
|
77999
|
-
/* @__PURE__ */ (0,
|
79370
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
78000
79371
|
IconButton,
|
78001
79372
|
{
|
78002
79373
|
title: "Zoom viewport in",
|
@@ -78010,11 +79381,11 @@ var require_dist2 = __commonJS({
|
|
78010
79381
|
)].value
|
78011
79382
|
);
|
78012
79383
|
},
|
78013
|
-
children: /* @__PURE__ */ (0,
|
79384
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ZoomIn, { size: 16 })
|
78014
79385
|
}
|
78015
79386
|
),
|
78016
|
-
/* @__PURE__ */ (0,
|
78017
|
-
/* @__PURE__ */ (0,
|
79387
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: getClassName23("divider") }),
|
79388
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
78018
79389
|
"select",
|
78019
79390
|
{
|
78020
79391
|
className: getClassName23("zoomSelect"),
|
@@ -78022,7 +79393,7 @@ var require_dist2 = __commonJS({
|
|
78022
79393
|
onChange: (e2) => {
|
78023
79394
|
onZoom(parseFloat(e2.currentTarget.value));
|
78024
79395
|
},
|
78025
|
-
children: zoomOptions.map((option) => /* @__PURE__ */ (0,
|
79396
|
+
children: zoomOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
78026
79397
|
"option",
|
78027
79398
|
{
|
78028
79399
|
value: option.value,
|
@@ -78064,24 +79435,24 @@ var require_dist2 = __commonJS({
|
|
78064
79435
|
}
|
78065
79436
|
return { autoZoom, rootHeight, zoom };
|
78066
79437
|
};
|
78067
|
-
var
|
79438
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
78068
79439
|
var getClassName24 = get_class_name_factory_default2("PuckCanvas", styles_module_default19);
|
78069
79440
|
var ZOOM_ON_CHANGE = true;
|
78070
79441
|
var Canvas = () => {
|
78071
79442
|
const { status, iframe } = useAppContext2();
|
78072
79443
|
const { dispatch, state, overrides, setUi, zoomConfig, setZoomConfig } = useAppContext2();
|
78073
79444
|
const { ui } = state;
|
78074
|
-
const frameRef = (0,
|
78075
|
-
const [showTransition, setShowTransition] = (0,
|
78076
|
-
const defaultRender = (0,
|
78077
|
-
const PuckDefault = ({ children }) => /* @__PURE__ */ (0,
|
79445
|
+
const frameRef = (0, import_react28.useRef)(null);
|
79446
|
+
const [showTransition, setShowTransition] = (0, import_react28.useState)(false);
|
79447
|
+
const defaultRender = (0, import_react28.useMemo)(() => {
|
79448
|
+
const PuckDefault = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_jsx_runtime34.Fragment, { children });
|
78078
79449
|
return PuckDefault;
|
78079
79450
|
}, []);
|
78080
|
-
const CustomPreview = (0,
|
79451
|
+
const CustomPreview = (0, import_react28.useMemo)(
|
78081
79452
|
() => overrides.preview || defaultRender,
|
78082
79453
|
[overrides]
|
78083
79454
|
);
|
78084
|
-
const getFrameDimensions = (0,
|
79455
|
+
const getFrameDimensions = (0, import_react28.useCallback)(() => {
|
78085
79456
|
if (frameRef.current) {
|
78086
79457
|
const frame = frameRef.current;
|
78087
79458
|
const box = getBox3(frame);
|
@@ -78089,7 +79460,7 @@ var require_dist2 = __commonJS({
|
|
78089
79460
|
}
|
78090
79461
|
return { width: 0, height: 0 };
|
78091
79462
|
}, [frameRef]);
|
78092
|
-
const resetAutoZoom = (0,
|
79463
|
+
const resetAutoZoom = (0, import_react28.useCallback)(
|
78093
79464
|
(ui2 = state.ui) => {
|
78094
79465
|
if (frameRef.current) {
|
78095
79466
|
setZoomConfig(
|
@@ -78099,11 +79470,11 @@ var require_dist2 = __commonJS({
|
|
78099
79470
|
},
|
78100
79471
|
[frameRef, zoomConfig, state.ui]
|
78101
79472
|
);
|
78102
|
-
(0,
|
79473
|
+
(0, import_react28.useEffect)(() => {
|
78103
79474
|
setShowTransition(false);
|
78104
79475
|
resetAutoZoom();
|
78105
79476
|
}, [frameRef, ui.leftSideBarVisible, ui.rightSideBarVisible]);
|
78106
|
-
(0,
|
79477
|
+
(0, import_react28.useEffect)(() => {
|
78107
79478
|
const { height: frameHeight } = getFrameDimensions();
|
78108
79479
|
if (ui.viewports.current.height === "auto") {
|
78109
79480
|
setZoomConfig(__spreadProps2(__spreadValues2({}, zoomConfig), {
|
@@ -78111,7 +79482,7 @@ var require_dist2 = __commonJS({
|
|
78111
79482
|
}));
|
78112
79483
|
}
|
78113
79484
|
}, [zoomConfig.zoom]);
|
78114
|
-
(0,
|
79485
|
+
(0, import_react28.useEffect)(() => {
|
78115
79486
|
const observer = new ResizeObserver(() => {
|
78116
79487
|
setShowTransition(false);
|
78117
79488
|
resetAutoZoom();
|
@@ -78123,7 +79494,7 @@ var require_dist2 = __commonJS({
|
|
78123
79494
|
observer.disconnect();
|
78124
79495
|
};
|
78125
79496
|
}, []);
|
78126
|
-
return /* @__PURE__ */ (0,
|
79497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
78127
79498
|
"div",
|
78128
79499
|
{
|
78129
79500
|
className: getClassName24({
|
@@ -78135,7 +79506,7 @@ var require_dist2 = __commonJS({
|
|
78135
79506
|
recordHistory: true
|
78136
79507
|
}),
|
78137
79508
|
children: [
|
78138
|
-
ui.viewports.controlsVisible && iframe.enabled && /* @__PURE__ */ (0,
|
79509
|
+
ui.viewports.controlsVisible && iframe.enabled && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassName24("controls"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
78139
79510
|
ViewportControls,
|
78140
79511
|
{
|
78141
79512
|
autoZoom: zoomConfig.autoZoom,
|
@@ -78160,7 +79531,7 @@ var require_dist2 = __commonJS({
|
|
78160
79531
|
}
|
78161
79532
|
}
|
78162
79533
|
) }),
|
78163
|
-
/* @__PURE__ */ (0,
|
79534
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassName24("inner"), ref: frameRef, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
78164
79535
|
"div",
|
78165
79536
|
{
|
78166
79537
|
className: getClassName24("root"),
|
@@ -78172,14 +79543,14 @@ var require_dist2 = __commonJS({
|
|
78172
79543
|
overflow: iframe.enabled ? void 0 : "auto"
|
78173
79544
|
},
|
78174
79545
|
suppressHydrationWarning: true,
|
78175
|
-
children: /* @__PURE__ */ (0,
|
79546
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CustomPreview, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Preview, {}) })
|
78176
79547
|
}
|
78177
79548
|
) })
|
78178
79549
|
]
|
78179
79550
|
}
|
78180
79551
|
);
|
78181
79552
|
};
|
78182
|
-
var
|
79553
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
78183
79554
|
var getClassName25 = get_class_name_factory_default2("Puck", styles_module_default8);
|
78184
79555
|
function Puck({
|
78185
79556
|
children,
|
@@ -78197,14 +79568,15 @@ var require_dist2 = __commonJS({
|
|
78197
79568
|
viewports = defaultViewports2,
|
78198
79569
|
iframe = {
|
78199
79570
|
enabled: true
|
78200
|
-
}
|
79571
|
+
},
|
79572
|
+
dnd
|
78201
79573
|
}) {
|
78202
79574
|
var _a3;
|
78203
79575
|
const historyStore = useHistoryStore();
|
78204
|
-
const [reducer2] = (0,
|
79576
|
+
const [reducer2] = (0, import_react29.useState)(
|
78205
79577
|
() => createReducer({ config, record: historyStore.record })
|
78206
79578
|
);
|
78207
|
-
const [initialAppState] = (0,
|
79579
|
+
const [initialAppState] = (0, import_react29.useState)(() => {
|
78208
79580
|
var _a22, _b, _c, _d;
|
78209
79581
|
const initial = __spreadValues2(__spreadValues2({}, defaultAppState2.ui), initialUi);
|
78210
79582
|
let clientUiState = {};
|
@@ -78252,7 +79624,7 @@ var require_dist2 = __commonJS({
|
|
78252
79624
|
})
|
78253
79625
|
});
|
78254
79626
|
});
|
78255
|
-
const [appState, dispatch] = (0,
|
79627
|
+
const [appState, dispatch] = (0, import_react29.useReducer)(
|
78256
79628
|
reducer2,
|
78257
79629
|
flushZones(initialAppState)
|
78258
79630
|
);
|
@@ -78263,9 +79635,9 @@ var require_dist2 = __commonJS({
|
|
78263
79635
|
config,
|
78264
79636
|
dispatch
|
78265
79637
|
);
|
78266
|
-
const [menuOpen, setMenuOpen] = (0,
|
79638
|
+
const [menuOpen, setMenuOpen] = (0, import_react29.useState)(false);
|
78267
79639
|
const { itemSelector, leftSideBarVisible, rightSideBarVisible } = ui;
|
78268
|
-
const setItemSelector = (0,
|
79640
|
+
const setItemSelector = (0, import_react29.useCallback)(
|
78269
79641
|
(newItemSelector) => {
|
78270
79642
|
if (newItemSelector === itemSelector)
|
78271
79643
|
return;
|
@@ -78278,21 +79650,21 @@ var require_dist2 = __commonJS({
|
|
78278
79650
|
[itemSelector]
|
78279
79651
|
);
|
78280
79652
|
const selectedItem = itemSelector ? getItem2(itemSelector, data) : null;
|
78281
|
-
(0,
|
79653
|
+
(0, import_react29.useEffect)(() => {
|
78282
79654
|
if (onChange)
|
78283
79655
|
onChange(data);
|
78284
79656
|
}, [data]);
|
78285
79657
|
const { onDragStartOrUpdate, placeholderStyle } = usePlaceholderStyle();
|
78286
|
-
const [draggedItem, setDraggedItem] = (0,
|
79658
|
+
const [draggedItem, setDraggedItem] = (0, import_react29.useState)();
|
78287
79659
|
const rootProps = data.root.props || data.root;
|
78288
|
-
(0,
|
79660
|
+
(0, import_react29.useEffect)(() => {
|
78289
79661
|
if (Object.keys(data.root).length > 0 && !data.root.props) {
|
78290
79662
|
console.error(
|
78291
79663
|
"Warning: Defining props on `root` is deprecated. Please use `root.props`. This will be a breaking change in a future release."
|
78292
79664
|
);
|
78293
79665
|
}
|
78294
79666
|
}, []);
|
78295
|
-
const toggleSidebars = (0,
|
79667
|
+
const toggleSidebars = (0, import_react29.useCallback)(
|
78296
79668
|
(sidebar) => {
|
78297
79669
|
const widerViewport = window.matchMedia("(min-width: 638px)").matches;
|
78298
79670
|
const sideBarVisible = sidebar === "left" ? leftSideBarVisible : rightSideBarVisible;
|
@@ -78306,7 +79678,7 @@ var require_dist2 = __commonJS({
|
|
78306
79678
|
},
|
78307
79679
|
[dispatch, leftSideBarVisible, rightSideBarVisible]
|
78308
79680
|
);
|
78309
|
-
(0,
|
79681
|
+
(0, import_react29.useEffect)(() => {
|
78310
79682
|
if (!window.matchMedia("(min-width: 638px)").matches) {
|
78311
79683
|
dispatch({
|
78312
79684
|
type: "setUi",
|
@@ -78329,11 +79701,11 @@ var require_dist2 = __commonJS({
|
|
78329
79701
|
window.removeEventListener("resize", handleResize);
|
78330
79702
|
};
|
78331
79703
|
}, []);
|
78332
|
-
const defaultRender = (0,
|
78333
|
-
const PuckDefault = ({ children: children2 }) => /* @__PURE__ */ (0,
|
79704
|
+
const defaultRender = (0, import_react29.useMemo)(() => {
|
79705
|
+
const PuckDefault = ({ children: children2 }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, { children: children2 });
|
78334
79706
|
return PuckDefault;
|
78335
79707
|
}, []);
|
78336
|
-
const defaultHeaderRender = (0,
|
79708
|
+
const defaultHeaderRender = (0, import_react29.useMemo)(() => {
|
78337
79709
|
if (renderHeader) {
|
78338
79710
|
console.warn(
|
78339
79711
|
"`renderHeader` is deprecated. Please use `overrides.header` and the `usePuck` hook instead"
|
@@ -78341,45 +79713,45 @@ var require_dist2 = __commonJS({
|
|
78341
79713
|
const RenderHeader = (_a22) => {
|
78342
79714
|
var _b = _a22, { actions } = _b, props = __objRest2(_b, ["actions"]);
|
78343
79715
|
const Comp = renderHeader;
|
78344
|
-
return /* @__PURE__ */ (0,
|
79716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Comp, __spreadProps2(__spreadValues2({}, props), { dispatch, state: appState, children: actions }));
|
78345
79717
|
};
|
78346
79718
|
return RenderHeader;
|
78347
79719
|
}
|
78348
79720
|
return defaultRender;
|
78349
79721
|
}, [renderHeader]);
|
78350
|
-
const defaultHeaderActionsRender = (0,
|
79722
|
+
const defaultHeaderActionsRender = (0, import_react29.useMemo)(() => {
|
78351
79723
|
if (renderHeaderActions) {
|
78352
79724
|
console.warn(
|
78353
79725
|
"`renderHeaderActions` is deprecated. Please use `overrides.headerActions` and the `usePuck` hook instead."
|
78354
79726
|
);
|
78355
79727
|
const RenderHeader = (props) => {
|
78356
79728
|
const Comp = renderHeaderActions;
|
78357
|
-
return /* @__PURE__ */ (0,
|
79729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Comp, __spreadProps2(__spreadValues2({}, props), { dispatch, state: appState }));
|
78358
79730
|
};
|
78359
79731
|
return RenderHeader;
|
78360
79732
|
}
|
78361
79733
|
return defaultRender;
|
78362
79734
|
}, [renderHeader]);
|
78363
|
-
const loadedOverrides = (0,
|
79735
|
+
const loadedOverrides = (0, import_react29.useMemo)(() => {
|
78364
79736
|
return loadOverrides({ overrides, plugins });
|
78365
79737
|
}, [plugins]);
|
78366
|
-
const CustomPuck = (0,
|
79738
|
+
const CustomPuck = (0, import_react29.useMemo)(
|
78367
79739
|
() => loadedOverrides.puck || defaultRender,
|
78368
79740
|
[loadedOverrides]
|
78369
79741
|
);
|
78370
|
-
const CustomHeader = (0,
|
79742
|
+
const CustomHeader = (0, import_react29.useMemo)(
|
78371
79743
|
() => loadedOverrides.header || defaultHeaderRender,
|
78372
79744
|
[loadedOverrides]
|
78373
79745
|
);
|
78374
|
-
const CustomHeaderActions = (0,
|
79746
|
+
const CustomHeaderActions = (0, import_react29.useMemo)(
|
78375
79747
|
() => loadedOverrides.headerActions || defaultHeaderActionsRender,
|
78376
79748
|
[loadedOverrides]
|
78377
79749
|
);
|
78378
|
-
const [mounted, setMounted] = (0,
|
78379
|
-
(0,
|
79750
|
+
const [mounted, setMounted] = (0, import_react29.useState)(false);
|
79751
|
+
(0, import_react29.useEffect)(() => {
|
78380
79752
|
setMounted(true);
|
78381
79753
|
}, []);
|
78382
|
-
return /* @__PURE__ */ (0,
|
79754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "Puck", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
78383
79755
|
AppProvider,
|
78384
79756
|
{
|
78385
79757
|
value: {
|
@@ -78394,9 +79766,10 @@ var require_dist2 = __commonJS({
|
|
78394
79766
|
viewports,
|
78395
79767
|
iframe
|
78396
79768
|
},
|
78397
|
-
children: /* @__PURE__ */ (0,
|
79769
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
78398
79770
|
DragDropContext2,
|
78399
79771
|
{
|
79772
|
+
autoScrollerOptions: { disabled: dnd == null ? void 0 : dnd.disableAutoScroll },
|
78400
79773
|
onDragUpdate: (update2) => {
|
78401
79774
|
setDraggedItem(__spreadValues2(__spreadValues2({}, draggedItem), update2));
|
78402
79775
|
onDragStartOrUpdate(update2);
|
@@ -78449,7 +79822,7 @@ var require_dist2 = __commonJS({
|
|
78449
79822
|
});
|
78450
79823
|
}
|
78451
79824
|
},
|
78452
|
-
children: /* @__PURE__ */ (0,
|
79825
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
78453
79826
|
DropZoneProvider,
|
78454
79827
|
{
|
78455
79828
|
value: {
|
@@ -78463,7 +79836,7 @@ var require_dist2 = __commonJS({
|
|
78463
79836
|
mode: "edit",
|
78464
79837
|
areaId: "root"
|
78465
79838
|
},
|
78466
|
-
children: /* @__PURE__ */ (0,
|
79839
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CustomPuck, { children: children || /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
78467
79840
|
"div",
|
78468
79841
|
{
|
78469
79842
|
className: getClassName25({
|
@@ -78473,65 +79846,65 @@ var require_dist2 = __commonJS({
|
|
78473
79846
|
rightSideBarVisible
|
78474
79847
|
}),
|
78475
79848
|
children: [
|
78476
|
-
/* @__PURE__ */ (0,
|
78477
|
-
/* @__PURE__ */ (0,
|
79849
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: getClassName25("layout"), children: [
|
79850
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
78478
79851
|
CustomHeader,
|
78479
79852
|
{
|
78480
|
-
actions: /* @__PURE__ */ (0,
|
78481
|
-
/* @__PURE__ */ (0,
|
78482
|
-
/* @__PURE__ */ (0,
|
79853
|
+
actions: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
79854
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CustomHeaderActions, {}),
|
79855
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
78483
79856
|
Button,
|
78484
79857
|
{
|
78485
79858
|
onClick: () => {
|
78486
79859
|
onPublish && onPublish(data);
|
78487
79860
|
},
|
78488
|
-
icon: /* @__PURE__ */ (0,
|
79861
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Globe, { size: "14px" }),
|
78489
79862
|
children: "Publish"
|
78490
79863
|
}
|
78491
79864
|
)
|
78492
79865
|
] }),
|
78493
|
-
children: /* @__PURE__ */ (0,
|
78494
|
-
/* @__PURE__ */ (0,
|
78495
|
-
/* @__PURE__ */ (0,
|
79866
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("header", { className: getClassName25("header"), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: getClassName25("headerInner"), children: [
|
79867
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: getClassName25("headerToggle"), children: [
|
79868
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: getClassName25("leftSideBarToggle"), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
78496
79869
|
IconButton,
|
78497
79870
|
{
|
78498
79871
|
onClick: () => {
|
78499
79872
|
toggleSidebars("left");
|
78500
79873
|
},
|
78501
79874
|
title: "Toggle left sidebar",
|
78502
|
-
children: /* @__PURE__ */ (0,
|
79875
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PanelLeft, { focusable: "false" })
|
78503
79876
|
}
|
78504
79877
|
) }),
|
78505
|
-
/* @__PURE__ */ (0,
|
79878
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: getClassName25("rightSideBarToggle"), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
78506
79879
|
IconButton,
|
78507
79880
|
{
|
78508
79881
|
onClick: () => {
|
78509
79882
|
toggleSidebars("right");
|
78510
79883
|
},
|
78511
79884
|
title: "Toggle right sidebar",
|
78512
|
-
children: /* @__PURE__ */ (0,
|
79885
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PanelRight, { focusable: "false" })
|
78513
79886
|
}
|
78514
79887
|
) })
|
78515
79888
|
] }),
|
78516
|
-
/* @__PURE__ */ (0,
|
79889
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: getClassName25("headerTitle"), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Heading2, { rank: 2, size: "xs", children: [
|
78517
79890
|
headerTitle || rootProps.title || "Page",
|
78518
|
-
headerPath && /* @__PURE__ */ (0,
|
79891
|
+
headerPath && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
78519
79892
|
" ",
|
78520
|
-
/* @__PURE__ */ (0,
|
79893
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("code", { className: getClassName25("headerPath"), children: headerPath })
|
78521
79894
|
] })
|
78522
79895
|
] }) }),
|
78523
|
-
/* @__PURE__ */ (0,
|
78524
|
-
/* @__PURE__ */ (0,
|
79896
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: getClassName25("headerTools"), children: [
|
79897
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: getClassName25("menuButton"), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
78525
79898
|
IconButton,
|
78526
79899
|
{
|
78527
79900
|
onClick: () => {
|
78528
79901
|
return setMenuOpen(!menuOpen);
|
78529
79902
|
},
|
78530
79903
|
title: "Toggle menu bar",
|
78531
|
-
children: menuOpen ? /* @__PURE__ */ (0,
|
79904
|
+
children: menuOpen ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ChevronUp, { focusable: "false" }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ChevronDown, { focusable: "false" })
|
78532
79905
|
}
|
78533
79906
|
) }),
|
78534
|
-
/* @__PURE__ */ (0,
|
79907
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
78535
79908
|
MenuBar,
|
78536
79909
|
{
|
78537
79910
|
appState,
|
@@ -78539,7 +79912,7 @@ var require_dist2 = __commonJS({
|
|
78539
79912
|
dispatch,
|
78540
79913
|
onPublish,
|
78541
79914
|
menuOpen,
|
78542
|
-
renderHeaderActions: () => /* @__PURE__ */ (0,
|
79915
|
+
renderHeaderActions: () => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CustomHeaderActions, {}),
|
78543
79916
|
setMenuOpen
|
78544
79917
|
}
|
78545
79918
|
)
|
@@ -78547,23 +79920,23 @@ var require_dist2 = __commonJS({
|
|
78547
79920
|
] }) })
|
78548
79921
|
}
|
78549
79922
|
),
|
78550
|
-
/* @__PURE__ */ (0,
|
78551
|
-
/* @__PURE__ */ (0,
|
78552
|
-
/* @__PURE__ */ (0,
|
79923
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: getClassName25("leftSideBar"), children: [
|
79924
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SidebarSection2, { title: "Components", noBorderTop: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Components, {}) }),
|
79925
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SidebarSection2, { title: "Outline", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Outline, {}) })
|
78553
79926
|
] }),
|
78554
|
-
/* @__PURE__ */ (0,
|
78555
|
-
/* @__PURE__ */ (0,
|
79927
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Canvas, {}),
|
79928
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: getClassName25("rightSideBar"), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
78556
79929
|
SidebarSection2,
|
78557
79930
|
{
|
78558
79931
|
noPadding: true,
|
78559
79932
|
noBorderTop: true,
|
78560
79933
|
showBreadcrumbs: true,
|
78561
79934
|
title: selectedItem ? (_a3 = config.components[selectedItem.type]["label"]) != null ? _a3 : selectedItem.type : "Page",
|
78562
|
-
children: /* @__PURE__ */ (0,
|
79935
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Fields, {})
|
78563
79936
|
}
|
78564
79937
|
) })
|
78565
79938
|
] }),
|
78566
|
-
/* @__PURE__ */ (0,
|
79939
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
78567
79940
|
"div",
|
78568
79941
|
{
|
78569
79942
|
id: "puck-portal-root",
|
@@ -78585,7 +79958,7 @@ var require_dist2 = __commonJS({
|
|
78585
79958
|
Puck.Outline = Outline;
|
78586
79959
|
Puck.Preview = Preview;
|
78587
79960
|
init_react_import2();
|
78588
|
-
var
|
79961
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
78589
79962
|
function Render({
|
78590
79963
|
config,
|
78591
79964
|
data
|
@@ -78594,7 +79967,7 @@ var require_dist2 = __commonJS({
|
|
78594
79967
|
const rootProps = data.root.props || data.root;
|
78595
79968
|
const title = (rootProps == null ? void 0 : rootProps.title) || "";
|
78596
79969
|
if ((_a3 = config.root) == null ? void 0 : _a3.render) {
|
78597
|
-
return /* @__PURE__ */ (0,
|
79970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropZoneProvider, { value: { data, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
78598
79971
|
config.root.render,
|
78599
79972
|
__spreadProps2(__spreadValues2({}, rootProps), {
|
78600
79973
|
puck: {
|
@@ -78603,11 +79976,11 @@ var require_dist2 = __commonJS({
|
|
78603
79976
|
title,
|
78604
79977
|
editMode: false,
|
78605
79978
|
id: "puck-root",
|
78606
|
-
children: /* @__PURE__ */ (0,
|
79979
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropZone, { zone: rootDroppableId2 })
|
78607
79980
|
})
|
78608
79981
|
) });
|
78609
79982
|
}
|
78610
|
-
return /* @__PURE__ */ (0,
|
79983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropZoneProvider, { value: { data, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropZone, { zone: rootDroppableId2 }) });
|
78611
79984
|
}
|
78612
79985
|
init_react_import2();
|
78613
79986
|
var migrations = [
|
@@ -78772,7 +80145,7 @@ init_react_import();
|
|
78772
80145
|
// src/HeadingAnalyzer.tsx
|
78773
80146
|
init_react_import();
|
78774
80147
|
var import_react12 = require("react");
|
78775
|
-
var import_puck = __toESM(
|
80148
|
+
var import_puck = __toESM(require_dist());
|
78776
80149
|
|
78777
80150
|
// ../core/components/SidebarSection/index.tsx
|
78778
80151
|
init_react_import();
|
@@ -78957,6 +80330,7 @@ var defaultViewports = [
|
|
78957
80330
|
];
|
78958
80331
|
|
78959
80332
|
// ../core/components/Puck/context.tsx
|
80333
|
+
var import_ua_parser_js = __toESM(require_ua_parser());
|
78960
80334
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
78961
80335
|
var defaultAppState = {
|
78962
80336
|
data: { content: [], root: { props: { title: "" } } },
|
@@ -78996,7 +80370,8 @@ var defaultContext = {
|
|
78996
80370
|
setZoomConfig: () => null,
|
78997
80371
|
status: "LOADING",
|
78998
80372
|
setStatus: () => null,
|
78999
|
-
iframe: {}
|
80373
|
+
iframe: {},
|
80374
|
+
safariFallbackMode: false
|
79000
80375
|
};
|
79001
80376
|
var appContext = (0, import_react10.createContext)(defaultContext);
|
79002
80377
|
function useAppContext() {
|