@zipify/wysiwyg 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/build/cli.config.js +9 -1
- package/dist/cli.js +1 -1
- package/dist/wysiwyg.mjs +50 -34
- package/package.json +3 -2
package/dist/wysiwyg.mjs
CHANGED
|
@@ -12551,32 +12551,47 @@ function getBasePlacement(placement) {
|
|
|
12551
12551
|
var max$3 = Math.max;
|
|
12552
12552
|
var min$3 = Math.min;
|
|
12553
12553
|
var round = Math.round;
|
|
12554
|
-
function
|
|
12554
|
+
function getUAString() {
|
|
12555
|
+
var uaData = navigator.userAgentData;
|
|
12556
|
+
if (uaData != null && uaData.brands) {
|
|
12557
|
+
return uaData.brands.map(function(item) {
|
|
12558
|
+
return item.brand + "/" + item.version;
|
|
12559
|
+
}).join(" ");
|
|
12560
|
+
}
|
|
12561
|
+
return navigator.userAgent;
|
|
12562
|
+
}
|
|
12563
|
+
function isLayoutViewport() {
|
|
12564
|
+
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
12565
|
+
}
|
|
12566
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
12555
12567
|
if (includeScale === void 0) {
|
|
12556
12568
|
includeScale = false;
|
|
12557
12569
|
}
|
|
12558
|
-
|
|
12570
|
+
if (isFixedStrategy === void 0) {
|
|
12571
|
+
isFixedStrategy = false;
|
|
12572
|
+
}
|
|
12573
|
+
var clientRect2 = element.getBoundingClientRect();
|
|
12559
12574
|
var scaleX = 1;
|
|
12560
12575
|
var scaleY = 1;
|
|
12561
|
-
if (isHTMLElement(element)
|
|
12562
|
-
|
|
12563
|
-
|
|
12564
|
-
|
|
12565
|
-
|
|
12566
|
-
|
|
12567
|
-
|
|
12568
|
-
|
|
12569
|
-
|
|
12570
|
-
|
|
12576
|
+
if (includeScale && isHTMLElement(element)) {
|
|
12577
|
+
scaleX = element.offsetWidth > 0 ? round(clientRect2.width) / element.offsetWidth || 1 : 1;
|
|
12578
|
+
scaleY = element.offsetHeight > 0 ? round(clientRect2.height) / element.offsetHeight || 1 : 1;
|
|
12579
|
+
}
|
|
12580
|
+
var _ref = isElement$1(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;
|
|
12581
|
+
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
12582
|
+
var x = (clientRect2.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
|
|
12583
|
+
var y = (clientRect2.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
|
|
12584
|
+
var width = clientRect2.width / scaleX;
|
|
12585
|
+
var height = clientRect2.height / scaleY;
|
|
12571
12586
|
return {
|
|
12572
|
-
width
|
|
12573
|
-
height
|
|
12574
|
-
top:
|
|
12575
|
-
right:
|
|
12576
|
-
bottom:
|
|
12577
|
-
left:
|
|
12578
|
-
x
|
|
12579
|
-
y
|
|
12587
|
+
width,
|
|
12588
|
+
height,
|
|
12589
|
+
top: y,
|
|
12590
|
+
right: x + width,
|
|
12591
|
+
bottom: y + height,
|
|
12592
|
+
left: x,
|
|
12593
|
+
x,
|
|
12594
|
+
y
|
|
12580
12595
|
};
|
|
12581
12596
|
}
|
|
12582
12597
|
function getLayoutRect(element) {
|
|
@@ -12633,8 +12648,8 @@ function getTrueOffsetParent(element) {
|
|
|
12633
12648
|
return element.offsetParent;
|
|
12634
12649
|
}
|
|
12635
12650
|
function getContainingBlock(element) {
|
|
12636
|
-
var isFirefox =
|
|
12637
|
-
var isIE =
|
|
12651
|
+
var isFirefox = /firefox/i.test(getUAString());
|
|
12652
|
+
var isIE = /Trident/i.test(getUAString());
|
|
12638
12653
|
if (isIE && isHTMLElement(element)) {
|
|
12639
12654
|
var elementCss = getComputedStyle$1(element);
|
|
12640
12655
|
if (elementCss.position === "fixed") {
|
|
@@ -12954,7 +12969,7 @@ function getWindowScroll(node) {
|
|
|
12954
12969
|
function getWindowScrollBarX(element) {
|
|
12955
12970
|
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
|
12956
12971
|
}
|
|
12957
|
-
function getViewportRect(element) {
|
|
12972
|
+
function getViewportRect(element, strategy) {
|
|
12958
12973
|
var win = getWindow(element);
|
|
12959
12974
|
var html2 = getDocumentElement(element);
|
|
12960
12975
|
var visualViewport = win.visualViewport;
|
|
@@ -12965,7 +12980,8 @@ function getViewportRect(element) {
|
|
|
12965
12980
|
if (visualViewport) {
|
|
12966
12981
|
width = visualViewport.width;
|
|
12967
12982
|
height = visualViewport.height;
|
|
12968
|
-
|
|
12983
|
+
var layoutViewport = isLayoutViewport();
|
|
12984
|
+
if (layoutViewport || !layoutViewport && strategy === "fixed") {
|
|
12969
12985
|
x = visualViewport.offsetLeft;
|
|
12970
12986
|
y = visualViewport.offsetTop;
|
|
12971
12987
|
}
|
|
@@ -13029,8 +13045,8 @@ function rectToClientRect(rect) {
|
|
|
13029
13045
|
bottom: rect.y + rect.height
|
|
13030
13046
|
});
|
|
13031
13047
|
}
|
|
13032
|
-
function getInnerBoundingClientRect(element) {
|
|
13033
|
-
var rect = getBoundingClientRect(element);
|
|
13048
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
13049
|
+
var rect = getBoundingClientRect(element, false, strategy === "fixed");
|
|
13034
13050
|
rect.top = rect.top + element.clientTop;
|
|
13035
13051
|
rect.left = rect.left + element.clientLeft;
|
|
13036
13052
|
rect.bottom = rect.top + element.clientHeight;
|
|
@@ -13041,8 +13057,8 @@ function getInnerBoundingClientRect(element) {
|
|
|
13041
13057
|
rect.y = rect.top;
|
|
13042
13058
|
return rect;
|
|
13043
13059
|
}
|
|
13044
|
-
function getClientRectFromMixedType(element, clippingParent) {
|
|
13045
|
-
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement$1(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
13060
|
+
function getClientRectFromMixedType(element, clippingParent, strategy) {
|
|
13061
|
+
return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement$1(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
13046
13062
|
}
|
|
13047
13063
|
function getClippingParents(element) {
|
|
13048
13064
|
var clippingParents2 = listScrollParents(getParentNode(element));
|
|
@@ -13055,18 +13071,18 @@ function getClippingParents(element) {
|
|
|
13055
13071
|
return isElement$1(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body";
|
|
13056
13072
|
});
|
|
13057
13073
|
}
|
|
13058
|
-
function getClippingRect(element, boundary, rootBoundary) {
|
|
13074
|
+
function getClippingRect(element, boundary, rootBoundary, strategy) {
|
|
13059
13075
|
var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
|
|
13060
13076
|
var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]);
|
|
13061
13077
|
var firstClippingParent = clippingParents2[0];
|
|
13062
13078
|
var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) {
|
|
13063
|
-
var rect = getClientRectFromMixedType(element, clippingParent);
|
|
13079
|
+
var rect = getClientRectFromMixedType(element, clippingParent, strategy);
|
|
13064
13080
|
accRect.top = max$3(rect.top, accRect.top);
|
|
13065
13081
|
accRect.right = min$3(rect.right, accRect.right);
|
|
13066
13082
|
accRect.bottom = min$3(rect.bottom, accRect.bottom);
|
|
13067
13083
|
accRect.left = max$3(rect.left, accRect.left);
|
|
13068
13084
|
return accRect;
|
|
13069
|
-
}, getClientRectFromMixedType(element, firstClippingParent));
|
|
13085
|
+
}, getClientRectFromMixedType(element, firstClippingParent, strategy));
|
|
13070
13086
|
clippingRect.width = clippingRect.right - clippingRect.left;
|
|
13071
13087
|
clippingRect.height = clippingRect.bottom - clippingRect.top;
|
|
13072
13088
|
clippingRect.x = clippingRect.left;
|
|
@@ -13129,12 +13145,12 @@ function detectOverflow(state, options) {
|
|
|
13129
13145
|
if (options === void 0) {
|
|
13130
13146
|
options = {};
|
|
13131
13147
|
}
|
|
13132
|
-
var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding;
|
|
13148
|
+
var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding;
|
|
13133
13149
|
var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
|
|
13134
13150
|
var altContext = elementContext === popper ? reference : popper;
|
|
13135
13151
|
var popperRect = state.rects.popper;
|
|
13136
13152
|
var element = state.elements[altBoundary ? altContext : elementContext];
|
|
13137
|
-
var clippingClientRect = getClippingRect(isElement$1(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
|
|
13153
|
+
var clippingClientRect = getClippingRect(isElement$1(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
|
|
13138
13154
|
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
|
13139
13155
|
var popperOffsets2 = computeOffsets({
|
|
13140
13156
|
reference: referenceClientRect,
|
|
@@ -13521,7 +13537,7 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
|
13521
13537
|
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
13522
13538
|
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
13523
13539
|
var documentElement = getDocumentElement(offsetParent);
|
|
13524
|
-
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
|
|
13540
|
+
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
|
13525
13541
|
var scroll = {
|
|
13526
13542
|
scrollLeft: 0,
|
|
13527
13543
|
scrollTop: 0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zipify/wysiwyg",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "Zipify modification of TipTap text editor",
|
|
5
5
|
"main": "dist/wysiwyg.mjs",
|
|
6
6
|
"bin": {
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"@babel/plugin-transform-runtime": "^7.18.10",
|
|
58
58
|
"@babel/preset-env": "^7.19.0",
|
|
59
59
|
"@babel/runtime": "^7.19.0",
|
|
60
|
+
"@rollup/plugin-babel": "^5.3.1",
|
|
60
61
|
"@rollup/plugin-commonjs": "^22.0.2",
|
|
61
62
|
"@rollup/plugin-node-resolve": "^14.0.0",
|
|
62
63
|
"@rollup/plugin-replace": "^4.0.0",
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
"@vue/vue2-jest": "^29.0.0",
|
|
65
66
|
"@zipify/colorpicker": "^2.2.1",
|
|
66
67
|
"babel-jest": "^29.0.2",
|
|
67
|
-
"eslint": "8.
|
|
68
|
+
"eslint": "8.22.0",
|
|
68
69
|
"eslint-plugin-import": "^2.26.0",
|
|
69
70
|
"eslint-plugin-vue": "^9.4.0",
|
|
70
71
|
"gzipper": "^7.1.0",
|