@makeswift/runtime 0.0.0-e0c0445 → 0.0.0-e76fc43
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/box-model.js +1 -0
- package/components.js +1 -0
- package/dist/actions.cjs.js +73 -16
- package/dist/actions.cjs.js.map +1 -1
- package/dist/actions.es.js +67 -16
- package/dist/actions.es.js.map +1 -1
- package/dist/box-models.cjs.js +25 -15
- package/dist/box-models.cjs.js.map +1 -1
- package/dist/box-models.es.js +25 -15
- package/dist/box-models.es.js.map +1 -1
- package/dist/components.cjs.js +2012 -333
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +1888 -219
- package/dist/components.es.js.map +1 -1
- package/dist/deepEqual.cjs.js +40 -0
- package/dist/deepEqual.cjs.js.map +1 -0
- package/dist/deepEqual.es.js +39 -0
- package/dist/deepEqual.es.js.map +1 -0
- package/dist/descriptors.cjs.js.map +1 -1
- package/dist/descriptors.es.js.map +1 -1
- package/dist/immutable.es.cjs.js +4459 -0
- package/dist/immutable.es.cjs.js.map +1 -0
- package/dist/immutable.es.es.js +4450 -0
- package/dist/immutable.es.es.js.map +1 -0
- package/dist/instances.cjs.js +89 -0
- package/dist/instances.cjs.js.map +1 -0
- package/dist/instances.es.js +87 -0
- package/dist/instances.es.js.map +1 -0
- package/dist/main.cjs.js +1 -0
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +1 -1
- package/dist/prop-controllers.cjs.js +2 -0
- package/dist/prop-controllers.cjs.js.map +1 -1
- package/dist/prop-controllers.es.js +1 -0
- package/dist/prop-controllers.es.js.map +1 -1
- package/dist/react-builder-preview.cjs.js +172 -33
- package/dist/react-builder-preview.cjs.js.map +1 -1
- package/dist/react-builder-preview.es.js +180 -41
- package/dist/react-builder-preview.es.js.map +1 -1
- package/dist/react.cjs2.js +50 -14
- package/dist/react.cjs2.js.map +1 -1
- package/dist/react.es2.js +52 -17
- package/dist/react.es2.js.map +1 -1
- package/dist/shallowEqual.cjs.js +24 -0
- package/dist/shallowEqual.cjs.js.map +1 -0
- package/dist/shallowEqual.es.js +23 -0
- package/dist/shallowEqual.es.js.map +1 -0
- package/dist/types/components/builtin/Text/Text.d.ts +16 -0
- package/dist/types/components/builtin/Text/Text.d.ts.map +1 -0
- package/dist/types/components/builtin/Text/components/RichTextEditor/components/Block/index.d.ts +24 -0
- package/dist/types/components/builtin/Text/components/RichTextEditor/components/Block/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Text/components/RichTextEditor/components/Link/index.d.ts +9 -0
- package/dist/types/components/builtin/Text/components/RichTextEditor/components/Link/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Text/components/RichTextEditor/components/Mark/hooks/useTypographyMark.d.ts +25 -0
- package/dist/types/components/builtin/Text/components/RichTextEditor/components/Mark/hooks/useTypographyMark.d.ts.map +1 -0
- package/dist/types/components/builtin/Text/components/RichTextEditor/components/Mark/index.d.ts +13 -0
- package/dist/types/components/builtin/Text/components/RichTextEditor/components/Mark/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Text/components/RichTextEditor/index.d.ts +5 -0
- package/dist/types/components/builtin/Text/components/RichTextEditor/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesBlocks.d.ts +3 -0
- package/dist/types/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesBlocks.d.ts.map +1 -0
- package/dist/types/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesMarks.d.ts +3 -0
- package/dist/types/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesMarks.d.ts.map +1 -0
- package/dist/types/components/builtin/Text/components/RichTextEditor/plugins/Inlines.d.ts +3 -0
- package/dist/types/components/builtin/Text/components/RichTextEditor/plugins/Inlines.d.ts.map +1 -0
- package/dist/types/components/builtin/Text/components/RichTextEditor/plugins/Link.d.ts +3 -0
- package/dist/types/components/builtin/Text/components/RichTextEditor/plugins/Link.d.ts.map +1 -0
- package/dist/types/components/builtin/Text/hooks/useRichText.d.ts +1 -0
- package/dist/types/components/builtin/Text/hooks/useRichText.d.ts.map +1 -0
- package/dist/types/components/builtin/Text/index.d.ts +2 -0
- package/dist/types/components/builtin/Text/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Text/prop-controllers.d.ts +286 -0
- package/dist/types/components/builtin/Text/prop-controllers.d.ts.map +1 -0
- package/dist/types/components/builtin/index.d.ts +1 -0
- package/dist/types/components/builtin/index.d.ts.map +1 -1
- package/dist/types/components/hooks/useRichText.d.ts +18 -0
- package/dist/types/components/hooks/useRichText.d.ts.map +1 -0
- package/dist/types/components/hooks/useTypography.d.ts +24 -0
- package/dist/types/components/hooks/useTypography.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/components/shared/RichTextEditor/components/Block/index.d.ts +24 -0
- package/dist/types/components/shared/RichTextEditor/components/Block/index.d.ts.map +1 -0
- package/dist/types/components/shared/RichTextEditor/components/Link/index.d.ts +9 -0
- package/dist/types/components/shared/RichTextEditor/components/Link/index.d.ts.map +1 -0
- package/dist/types/components/shared/RichTextEditor/components/Mark/hooks/useTypographyMark.d.ts +23 -0
- package/dist/types/components/shared/RichTextEditor/components/Mark/hooks/useTypographyMark.d.ts.map +1 -0
- package/dist/types/components/shared/RichTextEditor/components/Mark/index.d.ts +13 -0
- package/dist/types/components/shared/RichTextEditor/components/Mark/index.d.ts.map +1 -0
- package/dist/types/components/shared/RichTextEditor/index.d.ts +5 -0
- package/dist/types/components/shared/RichTextEditor/index.d.ts.map +1 -0
- package/dist/types/components/shared/RichTextEditor/plugins/DeviceOverridesBlocks.d.ts +3 -0
- package/dist/types/components/shared/RichTextEditor/plugins/DeviceOverridesBlocks.d.ts.map +1 -0
- package/dist/types/components/shared/RichTextEditor/plugins/DeviceOverridesMarks.d.ts +3 -0
- package/dist/types/components/shared/RichTextEditor/plugins/DeviceOverridesMarks.d.ts.map +1 -0
- package/dist/types/components/shared/RichTextEditor/plugins/Inlines.d.ts +3 -0
- package/dist/types/components/shared/RichTextEditor/plugins/Inlines.d.ts.map +1 -0
- package/dist/types/components/shared/RichTextEditor/plugins/Link.d.ts +3 -0
- package/dist/types/components/shared/RichTextEditor/plugins/Link.d.ts.map +1 -0
- package/dist/types/components/utils/contants.d.ts +5 -0
- package/dist/types/components/utils/contants.d.ts.map +1 -0
- package/dist/types/components/utils/devices.d.ts +1 -0
- package/dist/types/components/utils/devices.d.ts.map +1 -1
- package/dist/types/components/utils/intersection.d.ts +4 -0
- package/dist/types/components/utils/intersection.d.ts.map +1 -0
- package/dist/types/components/utils/keys.d.ts +5 -0
- package/dist/types/components/utils/keys.d.ts.map +1 -0
- package/dist/types/components/utils/queries.d.ts +6 -4
- package/dist/types/components/utils/queries.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/prop-controllers/descriptors.d.ts +1 -1
- package/dist/types/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/prop-controllers/index.d.ts +2 -0
- package/dist/types/prop-controllers/index.d.ts.map +1 -1
- package/dist/types/prop-controllers/instances.d.ts +63 -4
- package/dist/types/prop-controllers/instances.d.ts.map +1 -1
- package/dist/types/runtimes/react.d.ts.map +1 -1
- package/dist/types/state/actions.d.ts +88 -13
- package/dist/types/state/actions.d.ts.map +1 -1
- package/dist/types/state/modules/box-models.d.ts +5 -5
- package/dist/types/state/modules/box-models.d.ts.map +1 -1
- package/dist/types/state/modules/prop-controller-handles.d.ts +4 -8
- package/dist/types/state/modules/prop-controller-handles.d.ts.map +1 -1
- package/dist/types/state/react-builder-preview.d.ts +2 -0
- package/dist/types/state/react-builder-preview.d.ts.map +1 -1
- package/dist/types/state/react-page.d.ts +1 -0
- package/dist/types/state/react-page.d.ts.map +1 -1
- package/dist/types/utils/coalesce.d.ts +3 -0
- package/dist/types/utils/coalesce.d.ts.map +1 -0
- package/dist/types/utils/constants.d.ts +6 -0
- package/dist/types/utils/constants.d.ts.map +1 -0
- package/dist/types/utils/intersection.d.ts +4 -0
- package/dist/types/utils/intersection.d.ts.map +1 -0
- package/dist/types/utils/keys.d.ts +5 -0
- package/dist/types/utils/keys.d.ts.map +1 -0
- package/dist/types/utils/shallowMerge.d.ts +2 -0
- package/dist/types/utils/shallowMerge.d.ts.map +1 -0
- package/package.json +35 -4
- package/prop-controllers.js +1 -0
- package/react.js +1 -0
package/dist/components.cjs.js
CHANGED
|
@@ -40,6 +40,8 @@ var client = require("@apollo/client");
|
|
|
40
40
|
var boxModels = require("./box-models.cjs.js");
|
|
41
41
|
var NextImage = require("next/image");
|
|
42
42
|
var NextLink = require("next/link");
|
|
43
|
+
var slate = require("slate");
|
|
44
|
+
var slateReact = require("slate-react");
|
|
43
45
|
require("./actions.cjs.js");
|
|
44
46
|
require("./descriptors.cjs.js");
|
|
45
47
|
function _interopDefaultLegacy(e2) {
|
|
@@ -200,14 +202,14 @@ var featureDefinitions = {
|
|
|
200
202
|
"onViewportLeave"
|
|
201
203
|
])
|
|
202
204
|
};
|
|
203
|
-
function loadFeatures(
|
|
204
|
-
for (var key2 in
|
|
205
|
-
if (
|
|
205
|
+
function loadFeatures(features2) {
|
|
206
|
+
for (var key2 in features2) {
|
|
207
|
+
if (features2[key2] === null)
|
|
206
208
|
continue;
|
|
207
209
|
if (key2 === "projectionNodeConstructor") {
|
|
208
|
-
featureDefinitions.projectionNodeConstructor =
|
|
210
|
+
featureDefinitions.projectionNodeConstructor = features2[key2];
|
|
209
211
|
} else {
|
|
210
|
-
featureDefinitions[key2].Component =
|
|
212
|
+
featureDefinitions[key2].Component = features2[key2];
|
|
211
213
|
}
|
|
212
214
|
}
|
|
213
215
|
}
|
|
@@ -219,7 +221,7 @@ var LazyContext = React.createContext({ strict: false });
|
|
|
219
221
|
var featureNames = Object.keys(featureDefinitions);
|
|
220
222
|
var numFeatures = featureNames.length;
|
|
221
223
|
function useFeatures(props2, visualElement2, preloadedFeatures) {
|
|
222
|
-
var
|
|
224
|
+
var features2 = [];
|
|
223
225
|
React.useContext(LazyContext);
|
|
224
226
|
if (!visualElement2)
|
|
225
227
|
return null;
|
|
@@ -227,10 +229,10 @@ function useFeatures(props2, visualElement2, preloadedFeatures) {
|
|
|
227
229
|
var name_1 = featureNames[i];
|
|
228
230
|
var _a = featureDefinitions[name_1], isEnabled = _a.isEnabled, Component = _a.Component;
|
|
229
231
|
if (isEnabled(props2) && Component) {
|
|
230
|
-
|
|
232
|
+
features2.push(React__namespace.createElement(Component, __assign$1({ key: name_1 }, props2, { visualElement: visualElement2 })));
|
|
231
233
|
}
|
|
232
234
|
}
|
|
233
|
-
return
|
|
235
|
+
return features2;
|
|
234
236
|
}
|
|
235
237
|
var MotionConfigContext = React.createContext({
|
|
236
238
|
transformPagePoint: function(p) {
|
|
@@ -244,8 +246,8 @@ function useVisualElementContext() {
|
|
|
244
246
|
return React.useContext(MotionContext).visualElement;
|
|
245
247
|
}
|
|
246
248
|
var PresenceContext = React.createContext(null);
|
|
247
|
-
var isBrowser$
|
|
248
|
-
var useIsomorphicLayoutEffect = isBrowser$
|
|
249
|
+
var isBrowser$2 = typeof window !== "undefined";
|
|
250
|
+
var useIsomorphicLayoutEffect = isBrowser$2 ? React.useLayoutEffect : React.useEffect;
|
|
249
251
|
var prefersReducedMotion = { current: null };
|
|
250
252
|
var hasDetected = false;
|
|
251
253
|
function initPrefersReducedMotion() {
|
|
@@ -416,7 +418,7 @@ function createRenderStep(runNextFrame2) {
|
|
|
416
418
|
let numToRun = 0;
|
|
417
419
|
let isProcessing2 = false;
|
|
418
420
|
let flushNextFrame = false;
|
|
419
|
-
const toKeepAlive = new WeakSet();
|
|
421
|
+
const toKeepAlive = /* @__PURE__ */ new WeakSet();
|
|
420
422
|
const step = {
|
|
421
423
|
schedule: (callback, keepAlive = false, immediate = false) => {
|
|
422
424
|
const addToCurrentFrame = immediate && isProcessing2;
|
|
@@ -431,9 +433,9 @@ function createRenderStep(runNextFrame2) {
|
|
|
431
433
|
return callback;
|
|
432
434
|
},
|
|
433
435
|
cancel: (callback) => {
|
|
434
|
-
const
|
|
435
|
-
if (
|
|
436
|
-
toRunNextFrame.splice(
|
|
436
|
+
const index2 = toRunNextFrame.indexOf(callback);
|
|
437
|
+
if (index2 !== -1)
|
|
438
|
+
toRunNextFrame.splice(index2, 1);
|
|
437
439
|
toKeepAlive.delete(callback);
|
|
438
440
|
},
|
|
439
441
|
process: (frameData) => {
|
|
@@ -547,10 +549,10 @@ function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1 }) {
|
|
|
547
549
|
const delta = exponentialDecay * duration;
|
|
548
550
|
const d = delta * velocity + velocity;
|
|
549
551
|
const e2 = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq2, 2) * duration;
|
|
550
|
-
const
|
|
552
|
+
const f2 = Math.exp(-delta);
|
|
551
553
|
const g = calcAngularFreq(Math.pow(undampedFreq2, 2), dampingRatio);
|
|
552
554
|
const factor = -envelope(undampedFreq2) + safeMin > 0 ? -1 : 1;
|
|
553
|
-
return factor * ((d - e2) *
|
|
555
|
+
return factor * ((d - e2) * f2) / g;
|
|
554
556
|
};
|
|
555
557
|
} else {
|
|
556
558
|
envelope = (undampedFreq2) => {
|
|
@@ -595,8 +597,8 @@ function calcAngularFreq(undampedFreq, dampingRatio) {
|
|
|
595
597
|
}
|
|
596
598
|
const durationKeys = ["duration", "bounce"];
|
|
597
599
|
const physicsKeys = ["stiffness", "damping", "mass"];
|
|
598
|
-
function isSpringType(options,
|
|
599
|
-
return
|
|
600
|
+
function isSpringType(options, keys2) {
|
|
601
|
+
return keys2.some((key2) => options[key2] !== void 0);
|
|
600
602
|
}
|
|
601
603
|
function getSpringOptions(options) {
|
|
602
604
|
let springOptions = Object.assign({ velocity: 0, stiffness: 100, damping: 10, mass: 1, isResolvedFromDuration: false }, options);
|
|
@@ -774,7 +776,7 @@ const color$1 = {
|
|
|
774
776
|
};
|
|
775
777
|
const colorToken = "${c}";
|
|
776
778
|
const numberToken = "${n}";
|
|
777
|
-
function test(v) {
|
|
779
|
+
function test$1(v) {
|
|
778
780
|
var _a, _b, _c, _d;
|
|
779
781
|
return isNaN(v) && isString(v) && ((_b = (_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) + ((_d = (_c = v.match(colorRegex)) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0;
|
|
780
782
|
}
|
|
@@ -816,8 +818,8 @@ function getAnimatableNone$1(v) {
|
|
|
816
818
|
const transformer = createTransformer(v);
|
|
817
819
|
return transformer(parsed.map(convertNumbersToZero));
|
|
818
820
|
}
|
|
819
|
-
const complex = { test, parse, createTransformer, getAnimatableNone: getAnimatableNone$1 };
|
|
820
|
-
const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
821
|
+
const complex = { test: test$1, parse, createTransformer, getAnimatableNone: getAnimatableNone$1 };
|
|
822
|
+
const maxDefaults = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
821
823
|
function applyDefaultFilter(v) {
|
|
822
824
|
let [name2, value] = v.slice(0, -1).split("(");
|
|
823
825
|
if (name2 === "drop-shadow")
|
|
@@ -1134,10 +1136,10 @@ function detectAnimationFromOptions(config) {
|
|
|
1134
1136
|
} else if (types[config.type]) {
|
|
1135
1137
|
return types[config.type];
|
|
1136
1138
|
}
|
|
1137
|
-
const
|
|
1138
|
-
if (
|
|
1139
|
+
const keys2 = new Set(Object.keys(config));
|
|
1140
|
+
if (keys2.has("ease") || keys2.has("duration") && !keys2.has("dampingRatio")) {
|
|
1139
1141
|
return keyframes$1;
|
|
1140
|
-
} else if (
|
|
1142
|
+
} else if (keys2.has("dampingRatio") || keys2.has("stiffness") || keys2.has("mass") || keys2.has("damping") || keys2.has("restSpeed") || keys2.has("restDelta")) {
|
|
1141
1143
|
return spring;
|
|
1142
1144
|
}
|
|
1143
1145
|
return keyframes$1;
|
|
@@ -1376,8 +1378,8 @@ function addUniqueItem(arr, item) {
|
|
|
1376
1378
|
arr.indexOf(item) === -1 && arr.push(item);
|
|
1377
1379
|
}
|
|
1378
1380
|
function removeItem(arr, item) {
|
|
1379
|
-
var
|
|
1380
|
-
|
|
1381
|
+
var index2 = arr.indexOf(item);
|
|
1382
|
+
index2 > -1 && arr.splice(index2, 1);
|
|
1381
1383
|
}
|
|
1382
1384
|
var SubscriptionManager = function() {
|
|
1383
1385
|
function SubscriptionManager2() {
|
|
@@ -2275,7 +2277,7 @@ var transformPropSet = new Set(transformProps);
|
|
|
2275
2277
|
function isTransformProp(key2) {
|
|
2276
2278
|
return transformPropSet.has(key2);
|
|
2277
2279
|
}
|
|
2278
|
-
var transformOriginProps = new Set(["originX", "originY", "originZ"]);
|
|
2280
|
+
var transformOriginProps = /* @__PURE__ */ new Set(["originX", "originY", "originZ"]);
|
|
2279
2281
|
function isTransformOriginProp(key2) {
|
|
2280
2282
|
return transformOriginProps.has(key2);
|
|
2281
2283
|
}
|
|
@@ -2322,7 +2324,7 @@ function createProjectionNode(_a) {
|
|
|
2322
2324
|
if (parent === void 0) {
|
|
2323
2325
|
parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent();
|
|
2324
2326
|
}
|
|
2325
|
-
this.children = new Set();
|
|
2327
|
+
this.children = /* @__PURE__ */ new Set();
|
|
2326
2328
|
this.options = {};
|
|
2327
2329
|
this.isTreeAnimating = false;
|
|
2328
2330
|
this.isAnimationBlocked = false;
|
|
@@ -2334,8 +2336,8 @@ function createProjectionNode(_a) {
|
|
|
2334
2336
|
this.needsReset = false;
|
|
2335
2337
|
this.shouldResetTransform = false;
|
|
2336
2338
|
this.treeScale = { x: 1, y: 1 };
|
|
2337
|
-
this.eventHandlers = new Map();
|
|
2338
|
-
this.potentialNodes = new Map();
|
|
2339
|
+
this.eventHandlers = /* @__PURE__ */ new Map();
|
|
2340
|
+
this.potentialNodes = /* @__PURE__ */ new Map();
|
|
2339
2341
|
this.checkUpdateFailed = function() {
|
|
2340
2342
|
if (_this.isUpdating) {
|
|
2341
2343
|
_this.isUpdating = false;
|
|
@@ -2349,7 +2351,7 @@ function createProjectionNode(_a) {
|
|
|
2349
2351
|
this.hasProjected = false;
|
|
2350
2352
|
this.isVisible = true;
|
|
2351
2353
|
this.animationProgress = 0;
|
|
2352
|
-
this.sharedNodes = new Map();
|
|
2354
|
+
this.sharedNodes = /* @__PURE__ */ new Map();
|
|
2353
2355
|
this.id = id2;
|
|
2354
2356
|
this.latestValues = latestValues;
|
|
2355
2357
|
this.root = parent ? parent.root || parent : this;
|
|
@@ -3231,16 +3233,16 @@ function createMotionComponent(_a) {
|
|
|
3231
3233
|
var layoutId = useLayoutId(props2);
|
|
3232
3234
|
props2 = __assign$1(__assign$1({}, props2), { layoutId });
|
|
3233
3235
|
var config = React.useContext(MotionConfigContext);
|
|
3234
|
-
var
|
|
3236
|
+
var features2 = null;
|
|
3235
3237
|
var context = useCreateMotionContext(props2);
|
|
3236
3238
|
var projectionId = config.isStatic ? void 0 : useProjectionId();
|
|
3237
3239
|
var visualState = useVisualState(props2, config.isStatic);
|
|
3238
|
-
if (!config.isStatic && isBrowser$
|
|
3240
|
+
if (!config.isStatic && isBrowser$2) {
|
|
3239
3241
|
context.visualElement = useVisualElement(Component, visualState, __assign$1(__assign$1({}, config), props2), createVisualElement);
|
|
3240
3242
|
useProjection(projectionId, props2, context.visualElement, projectionNodeConstructor || featureDefinitions.projectionNodeConstructor);
|
|
3241
|
-
|
|
3243
|
+
features2 = useFeatures(props2, context.visualElement);
|
|
3242
3244
|
}
|
|
3243
|
-
return React__namespace.createElement(VisualElementHandler, { visualElement: context.visualElement, props: __assign$1(__assign$1({}, config), props2) },
|
|
3245
|
+
return React__namespace.createElement(VisualElementHandler, { visualElement: context.visualElement, props: __assign$1(__assign$1({}, config), props2) }, features2, React__namespace.createElement(MotionContext.Provider, { value: context }, useRender(Component, props2, projectionId, useMotionRef(visualState, context.visualElement, externalRef), visualState, config.isStatic, context.visualElement)));
|
|
3244
3246
|
}
|
|
3245
3247
|
return React.forwardRef(MotionComponent);
|
|
3246
3248
|
}
|
|
@@ -3260,7 +3262,7 @@ function createMotionProxy(createConfig) {
|
|
|
3260
3262
|
if (typeof Proxy === "undefined") {
|
|
3261
3263
|
return custom;
|
|
3262
3264
|
}
|
|
3263
|
-
var componentCache = new Map();
|
|
3265
|
+
var componentCache = /* @__PURE__ */ new Map();
|
|
3264
3266
|
return new Proxy(custom, {
|
|
3265
3267
|
get: function(_target, key2) {
|
|
3266
3268
|
if (!componentCache.has(key2)) {
|
|
@@ -3437,7 +3439,7 @@ function useHTMLProps(props2, visualState, isStatic) {
|
|
|
3437
3439
|
htmlProps.style = style;
|
|
3438
3440
|
return htmlProps;
|
|
3439
3441
|
}
|
|
3440
|
-
var validMotionProps = new Set([
|
|
3442
|
+
var validMotionProps = /* @__PURE__ */ new Set([
|
|
3441
3443
|
"initial",
|
|
3442
3444
|
"animate",
|
|
3443
3445
|
"exit",
|
|
@@ -3547,11 +3549,11 @@ function buildSVGPath(attrs, length, spacing, offset, useDashCase) {
|
|
|
3547
3549
|
useDashCase = true;
|
|
3548
3550
|
}
|
|
3549
3551
|
attrs.pathLength = 1;
|
|
3550
|
-
var
|
|
3551
|
-
attrs[
|
|
3552
|
+
var keys2 = useDashCase ? dashKeys : camelKeys;
|
|
3553
|
+
attrs[keys2.offset] = px.transform(-offset);
|
|
3552
3554
|
var pathLength = px.transform(length);
|
|
3553
3555
|
var pathSpacing = px.transform(spacing);
|
|
3554
|
-
attrs[
|
|
3556
|
+
attrs[keys2.array] = "".concat(pathLength, " ").concat(pathSpacing);
|
|
3555
3557
|
}
|
|
3556
3558
|
function buildSVGAttrs(state, _a, options, transformTemplate) {
|
|
3557
3559
|
var attrX = _a.attrX, attrY = _a.attrY, originX = _a.originX, originY = _a.originY, pathLength = _a.pathLength, _b = _a.pathSpacing, pathSpacing = _b === void 0 ? 1 : _b, _c = _a.pathOffset, pathOffset = _c === void 0 ? 0 : _c, latest = __rest(_a, ["attrX", "attrY", "originX", "originY", "pathLength", "pathSpacing", "pathOffset"]);
|
|
@@ -3620,7 +3622,7 @@ function renderHTML(element, _a, styleProp, projection) {
|
|
|
3620
3622
|
element.style.setProperty(key2, vars[key2]);
|
|
3621
3623
|
}
|
|
3622
3624
|
}
|
|
3623
|
-
var camelCaseAttributes = new Set([
|
|
3625
|
+
var camelCaseAttributes = /* @__PURE__ */ new Set([
|
|
3624
3626
|
"baseFrequency",
|
|
3625
3627
|
"diffuseConstant",
|
|
3626
3628
|
"kernelMatrix",
|
|
@@ -3721,8 +3723,8 @@ function makeLatestValues(props2, context, presenceContext, scrapeMotionValues)
|
|
|
3721
3723
|
for (var key3 in target) {
|
|
3722
3724
|
var valueTarget = target[key3];
|
|
3723
3725
|
if (Array.isArray(valueTarget)) {
|
|
3724
|
-
var
|
|
3725
|
-
valueTarget = valueTarget[
|
|
3726
|
+
var index2 = initialAnimationIsBlocked ? valueTarget.length - 1 : 0;
|
|
3727
|
+
valueTarget = valueTarget[index2];
|
|
3726
3728
|
}
|
|
3727
3729
|
if (valueTarget !== null) {
|
|
3728
3730
|
values[key3] = valueTarget;
|
|
@@ -3861,13 +3863,13 @@ var wrapHandler = function(handler, shouldFilterPrimaryPointer) {
|
|
|
3861
3863
|
return shouldFilterPrimaryPointer ? filterPrimaryPointer(listener) : listener;
|
|
3862
3864
|
};
|
|
3863
3865
|
var supportsPointerEvents$1 = function() {
|
|
3864
|
-
return isBrowser$
|
|
3866
|
+
return isBrowser$2 && window.onpointerdown === null;
|
|
3865
3867
|
};
|
|
3866
3868
|
var supportsTouchEvents$1 = function() {
|
|
3867
|
-
return isBrowser$
|
|
3869
|
+
return isBrowser$2 && window.ontouchstart === null;
|
|
3868
3870
|
};
|
|
3869
3871
|
var supportsMouseEvents = function() {
|
|
3870
|
-
return isBrowser$
|
|
3872
|
+
return isBrowser$2 && window.onmousedown === null;
|
|
3871
3873
|
};
|
|
3872
3874
|
var mouseEventNames = {
|
|
3873
3875
|
pointerdown: "mousedown",
|
|
@@ -4016,8 +4018,8 @@ function useTapGesture(_a) {
|
|
|
4016
4018
|
usePointerEvent(visualElement2, "pointerdown", hasPressListeners ? onPointerDown : void 0);
|
|
4017
4019
|
useUnmountEffect(removePointerEndListener);
|
|
4018
4020
|
}
|
|
4019
|
-
var observerCallbacks = new WeakMap();
|
|
4020
|
-
var observers = new WeakMap();
|
|
4021
|
+
var observerCallbacks = /* @__PURE__ */ new WeakMap();
|
|
4022
|
+
var observers = /* @__PURE__ */ new WeakMap();
|
|
4021
4023
|
var fireObserverCallback = function(entry) {
|
|
4022
4024
|
var _a;
|
|
4023
4025
|
(_a = observerCallbacks.get(entry.target)) === null || _a === void 0 ? void 0 : _a(entry);
|
|
@@ -4427,7 +4429,7 @@ function createAnimationState(visualElement2) {
|
|
|
4427
4429
|
var props2 = visualElement2.getProps();
|
|
4428
4430
|
var context = visualElement2.getVariantContext(true) || {};
|
|
4429
4431
|
var animations2 = [];
|
|
4430
|
-
var removedKeys = new Set();
|
|
4432
|
+
var removedKeys = /* @__PURE__ */ new Set();
|
|
4431
4433
|
var encounteredKeys = {};
|
|
4432
4434
|
var removedVariantIndex = Infinity;
|
|
4433
4435
|
var _loop_1 = function(i2) {
|
|
@@ -4828,7 +4830,7 @@ function measurePageBox(element, rootProjectionNode2, transformPagePoint) {
|
|
|
4828
4830
|
}
|
|
4829
4831
|
return viewportBox;
|
|
4830
4832
|
}
|
|
4831
|
-
var elementDragControls = new WeakMap();
|
|
4833
|
+
var elementDragControls = /* @__PURE__ */ new WeakMap();
|
|
4832
4834
|
var VisualElementDragControls = function() {
|
|
4833
4835
|
function VisualElementDragControls2(visualElement2) {
|
|
4834
4836
|
this.openGlobalLock = null;
|
|
@@ -5264,8 +5266,8 @@ var visualElement = function(_a) {
|
|
|
5264
5266
|
var latestValues = visualState.latestValues, renderState = visualState.renderState;
|
|
5265
5267
|
var instance;
|
|
5266
5268
|
var lifecycles = createLifecycles();
|
|
5267
|
-
var values = new Map();
|
|
5268
|
-
var valueSubscriptions = new Map();
|
|
5269
|
+
var values = /* @__PURE__ */ new Map();
|
|
5270
|
+
var valueSubscriptions = /* @__PURE__ */ new Map();
|
|
5269
5271
|
var prevMotionValues = {};
|
|
5270
5272
|
var baseTarget = __assign$1({}, latestValues);
|
|
5271
5273
|
var removeFromVariantTree;
|
|
@@ -5306,10 +5308,10 @@ var visualElement = function(_a) {
|
|
|
5306
5308
|
current: null,
|
|
5307
5309
|
depth: parent ? parent.depth + 1 : 0,
|
|
5308
5310
|
parent,
|
|
5309
|
-
children: new Set(),
|
|
5311
|
+
children: /* @__PURE__ */ new Set(),
|
|
5310
5312
|
presenceId,
|
|
5311
5313
|
shouldReduceMotion,
|
|
5312
|
-
variantChildren: isVariantNode ? new Set() : void 0,
|
|
5314
|
+
variantChildren: isVariantNode ? /* @__PURE__ */ new Set() : void 0,
|
|
5313
5315
|
isVisible: void 0,
|
|
5314
5316
|
manuallyAnimateOnMount: Boolean(parent === null || parent === void 0 ? void 0 : parent.isMounted()),
|
|
5315
5317
|
blockInitialAnimation,
|
|
@@ -5550,7 +5552,7 @@ function resolveCSSVariables(visualElement2, _a, transitionEnd) {
|
|
|
5550
5552
|
}
|
|
5551
5553
|
return { target, transitionEnd };
|
|
5552
5554
|
}
|
|
5553
|
-
var positionalKeys = new Set([
|
|
5555
|
+
var positionalKeys = /* @__PURE__ */ new Set([
|
|
5554
5556
|
"width",
|
|
5555
5557
|
"height",
|
|
5556
5558
|
"top",
|
|
@@ -5603,7 +5605,7 @@ var getTranslateFromMatrix = function(pos2, pos3) {
|
|
|
5603
5605
|
}
|
|
5604
5606
|
};
|
|
5605
5607
|
};
|
|
5606
|
-
var transformKeys = new Set(["x", "y", "z"]);
|
|
5608
|
+
var transformKeys = /* @__PURE__ */ new Set(["x", "y", "z"]);
|
|
5607
5609
|
var nonTranslationalTransformKeys = transformProps.filter(function(key2) {
|
|
5608
5610
|
return !transformKeys.has(key2);
|
|
5609
5611
|
});
|
|
@@ -6056,7 +6058,7 @@ var motion = /* @__PURE__ */ createMotionProxy(function(Component, config) {
|
|
|
6056
6058
|
function animationControls() {
|
|
6057
6059
|
var hasMounted = false;
|
|
6058
6060
|
var pendingAnimations = [];
|
|
6059
|
-
var subscribers = new Set();
|
|
6061
|
+
var subscribers = /* @__PURE__ */ new Set();
|
|
6060
6062
|
var controls = {
|
|
6061
6063
|
subscribe: function(visualElement2) {
|
|
6062
6064
|
subscribers.add(visualElement2);
|
|
@@ -6197,6 +6199,43 @@ const PAGE_PATHNAMES_BY_ID = client.gql`
|
|
|
6197
6199
|
}
|
|
6198
6200
|
}
|
|
6199
6201
|
`;
|
|
6202
|
+
const TYPOGRAPHY_FRAGMENT = client.gql`
|
|
6203
|
+
fragment Typography on Typography {
|
|
6204
|
+
id
|
|
6205
|
+
name
|
|
6206
|
+
style {
|
|
6207
|
+
deviceId
|
|
6208
|
+
value {
|
|
6209
|
+
fontFamily
|
|
6210
|
+
fontSize {
|
|
6211
|
+
value
|
|
6212
|
+
unit
|
|
6213
|
+
}
|
|
6214
|
+
color {
|
|
6215
|
+
swatchId
|
|
6216
|
+
alpha
|
|
6217
|
+
}
|
|
6218
|
+
lineHeight
|
|
6219
|
+
letterSpacing
|
|
6220
|
+
fontWeight
|
|
6221
|
+
textAlign
|
|
6222
|
+
uppercase
|
|
6223
|
+
underline
|
|
6224
|
+
strikethrough
|
|
6225
|
+
italic
|
|
6226
|
+
}
|
|
6227
|
+
}
|
|
6228
|
+
}
|
|
6229
|
+
`;
|
|
6230
|
+
const TYPOGRAPHIES_BY_ID = client.gql`
|
|
6231
|
+
query TypographiesById($ids: [ID!]!) {
|
|
6232
|
+
typographies(ids: $ids) {
|
|
6233
|
+
...Typography
|
|
6234
|
+
}
|
|
6235
|
+
}
|
|
6236
|
+
|
|
6237
|
+
${TYPOGRAPHY_FRAGMENT}
|
|
6238
|
+
`;
|
|
6200
6239
|
function isNonNullable(value) {
|
|
6201
6240
|
return value != null;
|
|
6202
6241
|
}
|
|
@@ -6237,7 +6276,7 @@ function useBackgrounds(value) {
|
|
|
6237
6276
|
value: backgrounds.map((bg) => {
|
|
6238
6277
|
if (bg.type === "image" && bg.payload != null && bg.payload.imageId != null) {
|
|
6239
6278
|
const _a2 = bg.payload, { imageId } = _a2, restOfPayload = __objRest(_a2, ["imageId"]);
|
|
6240
|
-
const file = files.find((
|
|
6279
|
+
const file = files.find((f2) => f2 && f2.id === imageId);
|
|
6241
6280
|
return file && {
|
|
6242
6281
|
id: bg.id,
|
|
6243
6282
|
type: "image",
|
|
@@ -6389,6 +6428,23 @@ function useFile(fileId) {
|
|
|
6389
6428
|
return null;
|
|
6390
6429
|
return data.file;
|
|
6391
6430
|
}
|
|
6431
|
+
const keys = (o) => Object.keys(o);
|
|
6432
|
+
const coalesce = (...args) => {
|
|
6433
|
+
let i;
|
|
6434
|
+
for (i = 0; i < args.length - 1; i += 1) {
|
|
6435
|
+
if (args[i] != null)
|
|
6436
|
+
return args[i];
|
|
6437
|
+
}
|
|
6438
|
+
return args[i];
|
|
6439
|
+
};
|
|
6440
|
+
function shallowMerge(a2, b2) {
|
|
6441
|
+
const bKeys = keys(b2);
|
|
6442
|
+
const merged = __spreadValues({}, a2);
|
|
6443
|
+
bKeys.forEach((key2) => {
|
|
6444
|
+
merged[key2] = coalesce(merged[key2], b2[key2]);
|
|
6445
|
+
});
|
|
6446
|
+
return merged;
|
|
6447
|
+
}
|
|
6392
6448
|
const DEVICES = [
|
|
6393
6449
|
{ id: "desktop", minWidth: 769 },
|
|
6394
6450
|
{ id: "tablet", minWidth: 476, maxWidth: 768 },
|
|
@@ -6403,6 +6459,12 @@ const getDevice = (deviceId) => {
|
|
|
6403
6459
|
function defaultStrategy(value, fallbacks) {
|
|
6404
6460
|
return value || fallbacks[0];
|
|
6405
6461
|
}
|
|
6462
|
+
function shallowMergeFallbacks(value, fallbacks) {
|
|
6463
|
+
return [value, ...fallbacks].filter((override) => Boolean(override)).reduce((a2, b2) => ({
|
|
6464
|
+
deviceId: a2.deviceId || b2.deviceId,
|
|
6465
|
+
value: shallowMerge(a2.value, b2.value)
|
|
6466
|
+
}));
|
|
6467
|
+
}
|
|
6406
6468
|
function findDeviceOverride(values = [], deviceId, strategy = defaultStrategy) {
|
|
6407
6469
|
const value = values.find(({ deviceId: d }) => d === deviceId);
|
|
6408
6470
|
const fallbacks = DEVICES.slice(0, DEVICES.findIndex((d) => d.id === deviceId) + 1).reverse().map((d) => values.find((v) => v.deviceId === d.id)).filter((override) => Boolean(override));
|
|
@@ -6699,11 +6761,11 @@ const useBoxAnimations = (_e) => {
|
|
|
6699
6761
|
}
|
|
6700
6762
|
};
|
|
6701
6763
|
};
|
|
6702
|
-
const getIndexes = (spans,
|
|
6764
|
+
const getIndexes = (spans, index2) => {
|
|
6703
6765
|
const flattened = spans.reduce((a2, s) => a2.concat(s), []);
|
|
6704
|
-
if (
|
|
6766
|
+
if (index2 < 0 || index2 > flattened.length)
|
|
6705
6767
|
throw new RangeError();
|
|
6706
|
-
let remainder =
|
|
6768
|
+
let remainder = index2;
|
|
6707
6769
|
let rowIndex = 0;
|
|
6708
6770
|
while (rowIndex < spans.length - 1 && remainder >= spans[rowIndex].length) {
|
|
6709
6771
|
remainder -= spans[rowIndex].length;
|
|
@@ -7439,20 +7501,20 @@ var _props = props;
|
|
|
7439
7501
|
function _interopRequireDefault(obj) {
|
|
7440
7502
|
return obj && obj.__esModule ? obj : { "default": obj };
|
|
7441
7503
|
}
|
|
7442
|
-
function _typeof(obj) {
|
|
7504
|
+
function _typeof$1(obj) {
|
|
7443
7505
|
"@babel/helpers - typeof";
|
|
7444
7506
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
7445
|
-
_typeof = function _typeof2(obj2) {
|
|
7507
|
+
_typeof$1 = function _typeof2(obj2) {
|
|
7446
7508
|
return typeof obj2;
|
|
7447
7509
|
};
|
|
7448
7510
|
} else {
|
|
7449
|
-
_typeof = function _typeof2(obj2) {
|
|
7511
|
+
_typeof$1 = function _typeof2(obj2) {
|
|
7450
7512
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
7451
7513
|
};
|
|
7452
7514
|
}
|
|
7453
|
-
return _typeof(obj);
|
|
7515
|
+
return _typeof$1(obj);
|
|
7454
7516
|
}
|
|
7455
|
-
function _defineProperty(obj, key2, value) {
|
|
7517
|
+
function _defineProperty$2(obj, key2, value) {
|
|
7456
7518
|
if (key2 in obj) {
|
|
7457
7519
|
Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true });
|
|
7458
7520
|
} else {
|
|
@@ -7462,7 +7524,7 @@ function _defineProperty(obj, key2, value) {
|
|
|
7462
7524
|
}
|
|
7463
7525
|
function _createForOfIteratorHelper(o) {
|
|
7464
7526
|
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
|
|
7465
|
-
if (Array.isArray(o) || (o = _unsupportedIterableToArray$
|
|
7527
|
+
if (Array.isArray(o) || (o = _unsupportedIterableToArray$2(o))) {
|
|
7466
7528
|
var i = 0;
|
|
7467
7529
|
var F = function F2() {
|
|
7468
7530
|
};
|
|
@@ -7486,7 +7548,7 @@ function _createForOfIteratorHelper(o) {
|
|
|
7486
7548
|
}, e: function e2(_e3) {
|
|
7487
7549
|
didErr = true;
|
|
7488
7550
|
err = _e3;
|
|
7489
|
-
}, f: function
|
|
7551
|
+
}, f: function f2() {
|
|
7490
7552
|
try {
|
|
7491
7553
|
if (!normalCompletion && it["return"] != null)
|
|
7492
7554
|
it["return"]();
|
|
@@ -7496,26 +7558,26 @@ function _createForOfIteratorHelper(o) {
|
|
|
7496
7558
|
}
|
|
7497
7559
|
} };
|
|
7498
7560
|
}
|
|
7499
|
-
function _slicedToArray(arr, i) {
|
|
7500
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$
|
|
7561
|
+
function _slicedToArray$1(arr, i) {
|
|
7562
|
+
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$2(arr, i) || _nonIterableRest$1();
|
|
7501
7563
|
}
|
|
7502
|
-
function _nonIterableRest() {
|
|
7564
|
+
function _nonIterableRest$1() {
|
|
7503
7565
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
7504
7566
|
}
|
|
7505
|
-
function _unsupportedIterableToArray$
|
|
7567
|
+
function _unsupportedIterableToArray$2(o, minLen) {
|
|
7506
7568
|
if (!o)
|
|
7507
7569
|
return;
|
|
7508
7570
|
if (typeof o === "string")
|
|
7509
|
-
return _arrayLikeToArray$
|
|
7571
|
+
return _arrayLikeToArray$2(o, minLen);
|
|
7510
7572
|
var n2 = Object.prototype.toString.call(o).slice(8, -1);
|
|
7511
7573
|
if (n2 === "Object" && o.constructor)
|
|
7512
7574
|
n2 = o.constructor.name;
|
|
7513
7575
|
if (n2 === "Map" || n2 === "Set")
|
|
7514
7576
|
return Array.from(n2);
|
|
7515
7577
|
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
|
|
7516
|
-
return _arrayLikeToArray$
|
|
7578
|
+
return _arrayLikeToArray$2(o, minLen);
|
|
7517
7579
|
}
|
|
7518
|
-
function _arrayLikeToArray$
|
|
7580
|
+
function _arrayLikeToArray$2(arr, len) {
|
|
7519
7581
|
if (len == null || len > arr.length)
|
|
7520
7582
|
len = arr.length;
|
|
7521
7583
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
@@ -7523,7 +7585,7 @@ function _arrayLikeToArray$1(arr, len) {
|
|
|
7523
7585
|
}
|
|
7524
7586
|
return arr2;
|
|
7525
7587
|
}
|
|
7526
|
-
function _iterableToArrayLimit(arr, i) {
|
|
7588
|
+
function _iterableToArrayLimit$1(arr, i) {
|
|
7527
7589
|
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr)))
|
|
7528
7590
|
return;
|
|
7529
7591
|
var _arr = [];
|
|
@@ -7550,7 +7612,7 @@ function _iterableToArrayLimit(arr, i) {
|
|
|
7550
7612
|
}
|
|
7551
7613
|
return _arr;
|
|
7552
7614
|
}
|
|
7553
|
-
function _arrayWithHoles(arr) {
|
|
7615
|
+
function _arrayWithHoles$1(arr) {
|
|
7554
7616
|
if (Array.isArray(arr))
|
|
7555
7617
|
return arr;
|
|
7556
7618
|
}
|
|
@@ -7575,7 +7637,7 @@ function parseTimeString(stamp) {
|
|
|
7575
7637
|
var seconds = 0;
|
|
7576
7638
|
var array2 = MATCH_START_STAMP.exec(stamp);
|
|
7577
7639
|
while (array2 !== null) {
|
|
7578
|
-
var _array = array2, _array2 = _slicedToArray(_array, 3), count = _array2[1], period = _array2[2];
|
|
7640
|
+
var _array = array2, _array2 = _slicedToArray$1(_array, 3), count = _array2[1], period = _array2[2];
|
|
7579
7641
|
if (period === "h")
|
|
7580
7642
|
seconds += parseInt(count, 10) * 60 * 60;
|
|
7581
7643
|
if (period === "m")
|
|
@@ -7649,13 +7711,13 @@ function getSDK(url, sdkGlobal) {
|
|
|
7649
7711
|
}
|
|
7650
7712
|
function getConfig(props2, defaultProps2, showWarning) {
|
|
7651
7713
|
var config = (0, _deepmerge["default"])(defaultProps2.config, props2.config);
|
|
7652
|
-
var
|
|
7714
|
+
var _iterator4 = _createForOfIteratorHelper(_props.DEPRECATED_CONFIG_PROPS), _step4;
|
|
7653
7715
|
try {
|
|
7654
|
-
for (
|
|
7655
|
-
var p =
|
|
7716
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
|
|
7717
|
+
var p = _step4.value;
|
|
7656
7718
|
if (props2[p]) {
|
|
7657
7719
|
var key2 = p.replace(/Config$/, "");
|
|
7658
|
-
config = (0, _deepmerge["default"])(config, _defineProperty({}, key2, props2[p]));
|
|
7720
|
+
config = (0, _deepmerge["default"])(config, _defineProperty$2({}, key2, props2[p]));
|
|
7659
7721
|
if (showWarning) {
|
|
7660
7722
|
var link2 = "https://github.com/CookPete/react-player#config-prop";
|
|
7661
7723
|
var message = "ReactPlayer: %c".concat(p, " %cis deprecated, please use the config prop instead \u2013 ").concat(link2);
|
|
@@ -7664,21 +7726,21 @@ function getConfig(props2, defaultProps2, showWarning) {
|
|
|
7664
7726
|
}
|
|
7665
7727
|
}
|
|
7666
7728
|
} catch (err) {
|
|
7667
|
-
|
|
7729
|
+
_iterator4.e(err);
|
|
7668
7730
|
} finally {
|
|
7669
|
-
|
|
7731
|
+
_iterator4.f();
|
|
7670
7732
|
}
|
|
7671
7733
|
return config;
|
|
7672
7734
|
}
|
|
7673
7735
|
function omit(object2) {
|
|
7674
|
-
var
|
|
7736
|
+
var _ref7;
|
|
7675
7737
|
for (var _len = arguments.length, arrays = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
7676
7738
|
arrays[_key - 1] = arguments[_key];
|
|
7677
7739
|
}
|
|
7678
|
-
var omitKeys = (
|
|
7740
|
+
var omitKeys = (_ref7 = []).concat.apply(_ref7, arrays);
|
|
7679
7741
|
var output = {};
|
|
7680
|
-
var
|
|
7681
|
-
for (var _i2 = 0, _keys =
|
|
7742
|
+
var keys2 = Object.keys(object2);
|
|
7743
|
+
for (var _i2 = 0, _keys = keys2; _i2 < _keys.length; _i2++) {
|
|
7682
7744
|
var key2 = _keys[_i2];
|
|
7683
7745
|
if (omitKeys.indexOf(key2) === -1) {
|
|
7684
7746
|
output[key2] = object2[key2];
|
|
@@ -7704,7 +7766,7 @@ function callPlayer(method) {
|
|
|
7704
7766
|
return (_this$player = this.player)[method].apply(_this$player, args);
|
|
7705
7767
|
}
|
|
7706
7768
|
function isObject(val) {
|
|
7707
|
-
return val !== null && _typeof(val) === "object";
|
|
7769
|
+
return val !== null && _typeof$1(val) === "object";
|
|
7708
7770
|
}
|
|
7709
7771
|
function isEqual(a2, b2) {
|
|
7710
7772
|
if (typeof a2 === "function" && typeof b2 === "function") {
|
|
@@ -7756,7 +7818,7 @@ var Player = {};
|
|
|
7756
7818
|
function _getRequireWildcardCache() {
|
|
7757
7819
|
if (typeof WeakMap !== "function")
|
|
7758
7820
|
return null;
|
|
7759
|
-
var cache = new WeakMap();
|
|
7821
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
7760
7822
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
7761
7823
|
return cache;
|
|
7762
7824
|
};
|
|
@@ -8188,7 +8250,7 @@ var Player = {};
|
|
|
8188
8250
|
function _getRequireWildcardCache() {
|
|
8189
8251
|
if (typeof WeakMap !== "function")
|
|
8190
8252
|
return null;
|
|
8191
|
-
var cache = new WeakMap();
|
|
8253
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
8192
8254
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
8193
8255
|
return cache;
|
|
8194
8256
|
};
|
|
@@ -8250,29 +8312,29 @@ var Player = {};
|
|
|
8250
8312
|
};
|
|
8251
8313
|
return _extends2.apply(this, arguments);
|
|
8252
8314
|
}
|
|
8253
|
-
function
|
|
8254
|
-
var
|
|
8315
|
+
function ownKeys2(object2, enumerableOnly) {
|
|
8316
|
+
var keys2 = Object.keys(object2);
|
|
8255
8317
|
if (Object.getOwnPropertySymbols) {
|
|
8256
8318
|
var symbols = Object.getOwnPropertySymbols(object2);
|
|
8257
8319
|
if (enumerableOnly)
|
|
8258
8320
|
symbols = symbols.filter(function(sym) {
|
|
8259
8321
|
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
|
|
8260
8322
|
});
|
|
8261
|
-
|
|
8323
|
+
keys2.push.apply(keys2, symbols);
|
|
8262
8324
|
}
|
|
8263
|
-
return
|
|
8325
|
+
return keys2;
|
|
8264
8326
|
}
|
|
8265
|
-
function
|
|
8327
|
+
function _objectSpread2(target) {
|
|
8266
8328
|
for (var i = 1; i < arguments.length; i++) {
|
|
8267
8329
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
8268
8330
|
if (i % 2) {
|
|
8269
|
-
|
|
8331
|
+
ownKeys2(Object(source), true).forEach(function(key2) {
|
|
8270
8332
|
_defineProperty2(target, key2, source[key2]);
|
|
8271
8333
|
});
|
|
8272
8334
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
8273
8335
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
8274
8336
|
} else {
|
|
8275
|
-
|
|
8337
|
+
ownKeys2(Object(source)).forEach(function(key2) {
|
|
8276
8338
|
Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
|
|
8277
8339
|
});
|
|
8278
8340
|
}
|
|
@@ -8435,7 +8497,7 @@ var Player = {};
|
|
|
8435
8497
|
var _this$props = this.props, style = _this$props.style, width = _this$props.width, height = _this$props.height, Wrapper2 = _this$props.wrapper;
|
|
8436
8498
|
var otherProps = (0, _utils.omit)(this.props, SUPPORTED_PROPS, _props2.DEPRECATED_CONFIG_PROPS);
|
|
8437
8499
|
return /* @__PURE__ */ _react2["default"].createElement(Wrapper2, _extends2({
|
|
8438
|
-
style:
|
|
8500
|
+
style: _objectSpread2({}, style, {
|
|
8439
8501
|
width,
|
|
8440
8502
|
height
|
|
8441
8503
|
})
|
|
@@ -8464,7 +8526,7 @@ var Player = {};
|
|
|
8464
8526
|
function _getRequireWildcardCache() {
|
|
8465
8527
|
if (typeof WeakMap !== "function")
|
|
8466
8528
|
return null;
|
|
8467
|
-
var cache = new WeakMap();
|
|
8529
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
8468
8530
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
8469
8531
|
return cache;
|
|
8470
8532
|
};
|
|
@@ -8512,29 +8574,29 @@ var Player = {};
|
|
|
8512
8574
|
}
|
|
8513
8575
|
return _typeof2(obj);
|
|
8514
8576
|
}
|
|
8515
|
-
function
|
|
8516
|
-
var
|
|
8577
|
+
function ownKeys2(object2, enumerableOnly) {
|
|
8578
|
+
var keys2 = Object.keys(object2);
|
|
8517
8579
|
if (Object.getOwnPropertySymbols) {
|
|
8518
8580
|
var symbols = Object.getOwnPropertySymbols(object2);
|
|
8519
8581
|
if (enumerableOnly)
|
|
8520
8582
|
symbols = symbols.filter(function(sym) {
|
|
8521
8583
|
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
|
|
8522
8584
|
});
|
|
8523
|
-
|
|
8585
|
+
keys2.push.apply(keys2, symbols);
|
|
8524
8586
|
}
|
|
8525
|
-
return
|
|
8587
|
+
return keys2;
|
|
8526
8588
|
}
|
|
8527
|
-
function
|
|
8589
|
+
function _objectSpread2(target) {
|
|
8528
8590
|
for (var i = 1; i < arguments.length; i++) {
|
|
8529
8591
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
8530
8592
|
if (i % 2) {
|
|
8531
|
-
|
|
8593
|
+
ownKeys2(Object(source), true).forEach(function(key2) {
|
|
8532
8594
|
_defineProperty2(target, key2, source[key2]);
|
|
8533
8595
|
});
|
|
8534
8596
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
8535
8597
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
8536
8598
|
} else {
|
|
8537
|
-
|
|
8599
|
+
ownKeys2(Object(source)).forEach(function(key2) {
|
|
8538
8600
|
Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
|
|
8539
8601
|
});
|
|
8540
8602
|
}
|
|
@@ -8715,8 +8777,8 @@ var Player = {};
|
|
|
8715
8777
|
}
|
|
8716
8778
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
8717
8779
|
_defineProperty2(_assertThisInitialized2(_this), "callPlayer", _utils.callPlayer);
|
|
8718
|
-
_defineProperty2(_assertThisInitialized2(_this), "onStateChange", function(
|
|
8719
|
-
var data =
|
|
8780
|
+
_defineProperty2(_assertThisInitialized2(_this), "onStateChange", function(_ref7) {
|
|
8781
|
+
var data = _ref7.data;
|
|
8720
8782
|
var _this$props = _this.props, onPlay2 = _this$props.onPlay, onPause2 = _this$props.onPause, onBuffer2 = _this$props.onBuffer, onBufferEnd2 = _this$props.onBufferEnd, onEnded2 = _this$props.onEnded, onReady2 = _this$props.onReady, loop = _this$props.loop;
|
|
8721
8783
|
var _window$SDK_GLOBAL$Pl = window[SDK_GLOBAL].PlayerState, PLAYING = _window$SDK_GLOBAL$Pl.PLAYING, PAUSED = _window$SDK_GLOBAL$Pl.PAUSED, BUFFERING = _window$SDK_GLOBAL$Pl.BUFFERING, ENDED = _window$SDK_GLOBAL$Pl.ENDED, CUED = _window$SDK_GLOBAL$Pl.CUED;
|
|
8722
8784
|
if (data === PLAYING) {
|
|
@@ -8772,11 +8834,11 @@ var Player = {};
|
|
|
8772
8834
|
}).then(function(YT) {
|
|
8773
8835
|
if (!_this2.container)
|
|
8774
8836
|
return;
|
|
8775
|
-
_this2.player = new YT.Player(_this2.container,
|
|
8837
|
+
_this2.player = new YT.Player(_this2.container, _objectSpread2({
|
|
8776
8838
|
width: "100%",
|
|
8777
8839
|
height: "100%",
|
|
8778
8840
|
videoId: id2,
|
|
8779
|
-
playerVars:
|
|
8841
|
+
playerVars: _objectSpread2({
|
|
8780
8842
|
autoplay: playing ? 1 : 0,
|
|
8781
8843
|
mute: muted ? 1 : 0,
|
|
8782
8844
|
controls: controls ? 1 : 0,
|
|
@@ -8896,7 +8958,7 @@ var SoundCloud = {};
|
|
|
8896
8958
|
function _getRequireWildcardCache() {
|
|
8897
8959
|
if (typeof WeakMap !== "function")
|
|
8898
8960
|
return null;
|
|
8899
|
-
var cache = new WeakMap();
|
|
8961
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
8900
8962
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
8901
8963
|
return cache;
|
|
8902
8964
|
};
|
|
@@ -8944,29 +9006,29 @@ var SoundCloud = {};
|
|
|
8944
9006
|
}
|
|
8945
9007
|
return _typeof2(obj);
|
|
8946
9008
|
}
|
|
8947
|
-
function
|
|
8948
|
-
var
|
|
9009
|
+
function ownKeys2(object2, enumerableOnly) {
|
|
9010
|
+
var keys2 = Object.keys(object2);
|
|
8949
9011
|
if (Object.getOwnPropertySymbols) {
|
|
8950
9012
|
var symbols = Object.getOwnPropertySymbols(object2);
|
|
8951
9013
|
if (enumerableOnly)
|
|
8952
9014
|
symbols = symbols.filter(function(sym) {
|
|
8953
9015
|
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
|
|
8954
9016
|
});
|
|
8955
|
-
|
|
9017
|
+
keys2.push.apply(keys2, symbols);
|
|
8956
9018
|
}
|
|
8957
|
-
return
|
|
9019
|
+
return keys2;
|
|
8958
9020
|
}
|
|
8959
|
-
function
|
|
9021
|
+
function _objectSpread2(target) {
|
|
8960
9022
|
for (var i = 1; i < arguments.length; i++) {
|
|
8961
9023
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
8962
9024
|
if (i % 2) {
|
|
8963
|
-
|
|
9025
|
+
ownKeys2(Object(source), true).forEach(function(key2) {
|
|
8964
9026
|
_defineProperty2(target, key2, source[key2]);
|
|
8965
9027
|
});
|
|
8966
9028
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
8967
9029
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
8968
9030
|
} else {
|
|
8969
|
-
|
|
9031
|
+
ownKeys2(Object(source)).forEach(function(key2) {
|
|
8970
9032
|
Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
|
|
8971
9033
|
});
|
|
8972
9034
|
}
|
|
@@ -9116,7 +9178,7 @@ var SoundCloud = {};
|
|
|
9116
9178
|
return _this2.props.onError(e2);
|
|
9117
9179
|
});
|
|
9118
9180
|
}
|
|
9119
|
-
_this2.player.load(url,
|
|
9181
|
+
_this2.player.load(url, _objectSpread2({}, _this2.props.config.soundcloud.options, {
|
|
9120
9182
|
callback: function callback() {
|
|
9121
9183
|
_this2.player.getDuration(function(duration) {
|
|
9122
9184
|
_this2.duration = duration / 1e3;
|
|
@@ -9209,7 +9271,7 @@ var Vimeo = {};
|
|
|
9209
9271
|
function _getRequireWildcardCache() {
|
|
9210
9272
|
if (typeof WeakMap !== "function")
|
|
9211
9273
|
return null;
|
|
9212
|
-
var cache = new WeakMap();
|
|
9274
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
9213
9275
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
9214
9276
|
return cache;
|
|
9215
9277
|
};
|
|
@@ -9257,29 +9319,29 @@ var Vimeo = {};
|
|
|
9257
9319
|
}
|
|
9258
9320
|
return _typeof2(obj);
|
|
9259
9321
|
}
|
|
9260
|
-
function
|
|
9261
|
-
var
|
|
9322
|
+
function ownKeys2(object2, enumerableOnly) {
|
|
9323
|
+
var keys2 = Object.keys(object2);
|
|
9262
9324
|
if (Object.getOwnPropertySymbols) {
|
|
9263
9325
|
var symbols = Object.getOwnPropertySymbols(object2);
|
|
9264
9326
|
if (enumerableOnly)
|
|
9265
9327
|
symbols = symbols.filter(function(sym) {
|
|
9266
9328
|
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
|
|
9267
9329
|
});
|
|
9268
|
-
|
|
9330
|
+
keys2.push.apply(keys2, symbols);
|
|
9269
9331
|
}
|
|
9270
|
-
return
|
|
9332
|
+
return keys2;
|
|
9271
9333
|
}
|
|
9272
|
-
function
|
|
9334
|
+
function _objectSpread2(target) {
|
|
9273
9335
|
for (var i = 1; i < arguments.length; i++) {
|
|
9274
9336
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
9275
9337
|
if (i % 2) {
|
|
9276
|
-
|
|
9338
|
+
ownKeys2(Object(source), true).forEach(function(key2) {
|
|
9277
9339
|
_defineProperty2(target, key2, source[key2]);
|
|
9278
9340
|
});
|
|
9279
9341
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
9280
9342
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
9281
9343
|
} else {
|
|
9282
|
-
|
|
9344
|
+
ownKeys2(Object(source)).forEach(function(key2) {
|
|
9283
9345
|
Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
|
|
9284
9346
|
});
|
|
9285
9347
|
}
|
|
@@ -9415,7 +9477,7 @@ var Vimeo = {};
|
|
|
9415
9477
|
(0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function(Vimeo4) {
|
|
9416
9478
|
if (!_this2.container)
|
|
9417
9479
|
return;
|
|
9418
|
-
_this2.player = new Vimeo4.Player(_this2.container,
|
|
9480
|
+
_this2.player = new Vimeo4.Player(_this2.container, _objectSpread2({
|
|
9419
9481
|
url,
|
|
9420
9482
|
autoplay: _this2.props.playing,
|
|
9421
9483
|
muted: _this2.props.muted,
|
|
@@ -9442,12 +9504,12 @@ var Vimeo = {};
|
|
|
9442
9504
|
});
|
|
9443
9505
|
_this2.player.on("ended", _this2.props.onEnded);
|
|
9444
9506
|
_this2.player.on("error", _this2.props.onError);
|
|
9445
|
-
_this2.player.on("timeupdate", function(
|
|
9446
|
-
var seconds =
|
|
9507
|
+
_this2.player.on("timeupdate", function(_ref7) {
|
|
9508
|
+
var seconds = _ref7.seconds;
|
|
9447
9509
|
_this2.currentTime = seconds;
|
|
9448
9510
|
});
|
|
9449
|
-
_this2.player.on("progress", function(
|
|
9450
|
-
var seconds =
|
|
9511
|
+
_this2.player.on("progress", function(_ref22) {
|
|
9512
|
+
var seconds = _ref22.seconds;
|
|
9451
9513
|
_this2.secondsLoaded = seconds;
|
|
9452
9514
|
});
|
|
9453
9515
|
}, this.props.onError);
|
|
@@ -9559,7 +9621,7 @@ var Facebook = {};
|
|
|
9559
9621
|
function _getRequireWildcardCache() {
|
|
9560
9622
|
if (typeof WeakMap !== "function")
|
|
9561
9623
|
return null;
|
|
9562
|
-
var cache = new WeakMap();
|
|
9624
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
9563
9625
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
9564
9626
|
return cache;
|
|
9565
9627
|
};
|
|
@@ -9842,7 +9904,7 @@ var Streamable = {};
|
|
|
9842
9904
|
function _getRequireWildcardCache() {
|
|
9843
9905
|
if (typeof WeakMap !== "function")
|
|
9844
9906
|
return null;
|
|
9845
|
-
var cache = new WeakMap();
|
|
9907
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
9846
9908
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
9847
9909
|
return cache;
|
|
9848
9910
|
};
|
|
@@ -10023,13 +10085,13 @@ var Streamable = {};
|
|
|
10023
10085
|
_this2.player.on("seeked", _this2.props.onSeek);
|
|
10024
10086
|
_this2.player.on("ended", _this2.props.onEnded);
|
|
10025
10087
|
_this2.player.on("error", _this2.props.onError);
|
|
10026
|
-
_this2.player.on("timeupdate", function(
|
|
10027
|
-
var duration =
|
|
10088
|
+
_this2.player.on("timeupdate", function(_ref7) {
|
|
10089
|
+
var duration = _ref7.duration, seconds = _ref7.seconds;
|
|
10028
10090
|
_this2.duration = duration;
|
|
10029
10091
|
_this2.currentTime = seconds;
|
|
10030
10092
|
});
|
|
10031
|
-
_this2.player.on("buffered", function(
|
|
10032
|
-
var percent2 =
|
|
10093
|
+
_this2.player.on("buffered", function(_ref22) {
|
|
10094
|
+
var percent2 = _ref22.percent;
|
|
10033
10095
|
if (_this2.duration) {
|
|
10034
10096
|
_this2.secondsLoaded = _this2.duration * percent2;
|
|
10035
10097
|
}
|
|
@@ -10126,7 +10188,7 @@ var Wistia = {};
|
|
|
10126
10188
|
function _getRequireWildcardCache() {
|
|
10127
10189
|
if (typeof WeakMap !== "function")
|
|
10128
10190
|
return null;
|
|
10129
|
-
var cache = new WeakMap();
|
|
10191
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
10130
10192
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
10131
10193
|
return cache;
|
|
10132
10194
|
};
|
|
@@ -10174,29 +10236,29 @@ var Wistia = {};
|
|
|
10174
10236
|
}
|
|
10175
10237
|
return _typeof2(obj);
|
|
10176
10238
|
}
|
|
10177
|
-
function
|
|
10178
|
-
var
|
|
10239
|
+
function ownKeys2(object2, enumerableOnly) {
|
|
10240
|
+
var keys2 = Object.keys(object2);
|
|
10179
10241
|
if (Object.getOwnPropertySymbols) {
|
|
10180
10242
|
var symbols = Object.getOwnPropertySymbols(object2);
|
|
10181
10243
|
if (enumerableOnly)
|
|
10182
10244
|
symbols = symbols.filter(function(sym) {
|
|
10183
10245
|
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
|
|
10184
10246
|
});
|
|
10185
|
-
|
|
10247
|
+
keys2.push.apply(keys2, symbols);
|
|
10186
10248
|
}
|
|
10187
|
-
return
|
|
10249
|
+
return keys2;
|
|
10188
10250
|
}
|
|
10189
|
-
function
|
|
10251
|
+
function _objectSpread2(target) {
|
|
10190
10252
|
for (var i = 1; i < arguments.length; i++) {
|
|
10191
10253
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
10192
10254
|
if (i % 2) {
|
|
10193
|
-
|
|
10255
|
+
ownKeys2(Object(source), true).forEach(function(key2) {
|
|
10194
10256
|
_defineProperty2(target, key2, source[key2]);
|
|
10195
10257
|
});
|
|
10196
10258
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
10197
10259
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
10198
10260
|
} else {
|
|
10199
|
-
|
|
10261
|
+
ownKeys2(Object(source)).forEach(function(key2) {
|
|
10200
10262
|
Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
|
|
10201
10263
|
});
|
|
10202
10264
|
}
|
|
@@ -10345,7 +10407,7 @@ var Wistia = {};
|
|
|
10345
10407
|
window._wq = window._wq || [];
|
|
10346
10408
|
window._wq.push({
|
|
10347
10409
|
id: _this2.getID(url),
|
|
10348
|
-
options:
|
|
10410
|
+
options: _objectSpread2({
|
|
10349
10411
|
autoPlay: playing,
|
|
10350
10412
|
silentAutoPlay: "allow",
|
|
10351
10413
|
muted,
|
|
@@ -10459,7 +10521,7 @@ var Twitch = {};
|
|
|
10459
10521
|
function _getRequireWildcardCache() {
|
|
10460
10522
|
if (typeof WeakMap !== "function")
|
|
10461
10523
|
return null;
|
|
10462
|
-
var cache = new WeakMap();
|
|
10524
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
10463
10525
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
10464
10526
|
return cache;
|
|
10465
10527
|
};
|
|
@@ -10507,29 +10569,29 @@ var Twitch = {};
|
|
|
10507
10569
|
}
|
|
10508
10570
|
return _typeof2(obj);
|
|
10509
10571
|
}
|
|
10510
|
-
function
|
|
10511
|
-
var
|
|
10572
|
+
function ownKeys2(object2, enumerableOnly) {
|
|
10573
|
+
var keys2 = Object.keys(object2);
|
|
10512
10574
|
if (Object.getOwnPropertySymbols) {
|
|
10513
10575
|
var symbols = Object.getOwnPropertySymbols(object2);
|
|
10514
10576
|
if (enumerableOnly)
|
|
10515
10577
|
symbols = symbols.filter(function(sym) {
|
|
10516
10578
|
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
|
|
10517
10579
|
});
|
|
10518
|
-
|
|
10580
|
+
keys2.push.apply(keys2, symbols);
|
|
10519
10581
|
}
|
|
10520
|
-
return
|
|
10582
|
+
return keys2;
|
|
10521
10583
|
}
|
|
10522
|
-
function
|
|
10584
|
+
function _objectSpread2(target) {
|
|
10523
10585
|
for (var i = 1; i < arguments.length; i++) {
|
|
10524
10586
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
10525
10587
|
if (i % 2) {
|
|
10526
|
-
|
|
10588
|
+
ownKeys2(Object(source), true).forEach(function(key2) {
|
|
10527
10589
|
_defineProperty2(target, key2, source[key2]);
|
|
10528
10590
|
});
|
|
10529
10591
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
10530
10592
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
10531
10593
|
} else {
|
|
10532
|
-
|
|
10594
|
+
ownKeys2(Object(source)).forEach(function(key2) {
|
|
10533
10595
|
Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
|
|
10534
10596
|
});
|
|
10535
10597
|
}
|
|
@@ -10667,7 +10729,7 @@ var Twitch = {};
|
|
|
10667
10729
|
return;
|
|
10668
10730
|
}
|
|
10669
10731
|
(0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function(Twitch4) {
|
|
10670
|
-
_this2.player = new Twitch4.Player(_this2.playerID,
|
|
10732
|
+
_this2.player = new Twitch4.Player(_this2.playerID, _objectSpread2({
|
|
10671
10733
|
video: isChannel ? "" : id2,
|
|
10672
10734
|
channel: isChannel ? id2 : "",
|
|
10673
10735
|
height: "100%",
|
|
@@ -10765,7 +10827,7 @@ var DailyMotion = {};
|
|
|
10765
10827
|
function _getRequireWildcardCache() {
|
|
10766
10828
|
if (typeof WeakMap !== "function")
|
|
10767
10829
|
return null;
|
|
10768
|
-
var cache = new WeakMap();
|
|
10830
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
10769
10831
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
10770
10832
|
return cache;
|
|
10771
10833
|
};
|
|
@@ -10813,29 +10875,29 @@ var DailyMotion = {};
|
|
|
10813
10875
|
}
|
|
10814
10876
|
return _typeof2(obj);
|
|
10815
10877
|
}
|
|
10816
|
-
function
|
|
10817
|
-
var
|
|
10878
|
+
function ownKeys2(object2, enumerableOnly) {
|
|
10879
|
+
var keys2 = Object.keys(object2);
|
|
10818
10880
|
if (Object.getOwnPropertySymbols) {
|
|
10819
10881
|
var symbols = Object.getOwnPropertySymbols(object2);
|
|
10820
10882
|
if (enumerableOnly)
|
|
10821
10883
|
symbols = symbols.filter(function(sym) {
|
|
10822
10884
|
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
|
|
10823
10885
|
});
|
|
10824
|
-
|
|
10886
|
+
keys2.push.apply(keys2, symbols);
|
|
10825
10887
|
}
|
|
10826
|
-
return
|
|
10888
|
+
return keys2;
|
|
10827
10889
|
}
|
|
10828
|
-
function
|
|
10890
|
+
function _objectSpread2(target) {
|
|
10829
10891
|
for (var i = 1; i < arguments.length; i++) {
|
|
10830
10892
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
10831
10893
|
if (i % 2) {
|
|
10832
|
-
|
|
10894
|
+
ownKeys2(Object(source), true).forEach(function(key2) {
|
|
10833
10895
|
_defineProperty2(target, key2, source[key2]);
|
|
10834
10896
|
});
|
|
10835
10897
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
10836
10898
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
10837
10899
|
} else {
|
|
10838
|
-
|
|
10900
|
+
ownKeys2(Object(source)).forEach(function(key2) {
|
|
10839
10901
|
Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
|
|
10840
10902
|
});
|
|
10841
10903
|
}
|
|
@@ -11043,7 +11105,7 @@ var DailyMotion = {};
|
|
|
11043
11105
|
width: "100%",
|
|
11044
11106
|
height: "100%",
|
|
11045
11107
|
video: id2,
|
|
11046
|
-
params:
|
|
11108
|
+
params: _objectSpread2({
|
|
11047
11109
|
controls,
|
|
11048
11110
|
autoplay: _this2.props.playing,
|
|
11049
11111
|
mute: _this2.props.muted,
|
|
@@ -11148,7 +11210,7 @@ var Mixcloud = {};
|
|
|
11148
11210
|
function _getRequireWildcardCache() {
|
|
11149
11211
|
if (typeof WeakMap !== "function")
|
|
11150
11212
|
return null;
|
|
11151
|
-
var cache = new WeakMap();
|
|
11213
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
11152
11214
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
11153
11215
|
return cache;
|
|
11154
11216
|
};
|
|
@@ -11196,29 +11258,29 @@ var Mixcloud = {};
|
|
|
11196
11258
|
}
|
|
11197
11259
|
return _typeof2(obj);
|
|
11198
11260
|
}
|
|
11199
|
-
function
|
|
11200
|
-
var
|
|
11261
|
+
function ownKeys2(object2, enumerableOnly) {
|
|
11262
|
+
var keys2 = Object.keys(object2);
|
|
11201
11263
|
if (Object.getOwnPropertySymbols) {
|
|
11202
11264
|
var symbols = Object.getOwnPropertySymbols(object2);
|
|
11203
11265
|
if (enumerableOnly)
|
|
11204
11266
|
symbols = symbols.filter(function(sym) {
|
|
11205
11267
|
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
|
|
11206
11268
|
});
|
|
11207
|
-
|
|
11269
|
+
keys2.push.apply(keys2, symbols);
|
|
11208
11270
|
}
|
|
11209
|
-
return
|
|
11271
|
+
return keys2;
|
|
11210
11272
|
}
|
|
11211
|
-
function
|
|
11273
|
+
function _objectSpread2(target) {
|
|
11212
11274
|
for (var i = 1; i < arguments.length; i++) {
|
|
11213
11275
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
11214
11276
|
if (i % 2) {
|
|
11215
|
-
|
|
11277
|
+
ownKeys2(Object(source), true).forEach(function(key2) {
|
|
11216
11278
|
_defineProperty2(target, key2, source[key2]);
|
|
11217
11279
|
});
|
|
11218
11280
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
11219
11281
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
11220
11282
|
} else {
|
|
11221
|
-
|
|
11283
|
+
ownKeys2(Object(source)).forEach(function(key2) {
|
|
11222
11284
|
Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
|
|
11223
11285
|
});
|
|
11224
11286
|
}
|
|
@@ -11407,7 +11469,7 @@ var Mixcloud = {};
|
|
|
11407
11469
|
width: "100%",
|
|
11408
11470
|
height: "100%"
|
|
11409
11471
|
};
|
|
11410
|
-
var query = (0, _utils.queryString)(
|
|
11472
|
+
var query = (0, _utils.queryString)(_objectSpread2({}, config.mixcloud.options, {
|
|
11411
11473
|
feed: "/".concat(id2, "/")
|
|
11412
11474
|
}));
|
|
11413
11475
|
return /* @__PURE__ */ _react2["default"].createElement("iframe", {
|
|
@@ -11445,7 +11507,7 @@ var FilePlayer = {};
|
|
|
11445
11507
|
function _getRequireWildcardCache() {
|
|
11446
11508
|
if (typeof WeakMap !== "function")
|
|
11447
11509
|
return null;
|
|
11448
|
-
var cache = new WeakMap();
|
|
11510
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
11449
11511
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
11450
11512
|
return cache;
|
|
11451
11513
|
};
|
|
@@ -11623,7 +11685,7 @@ var FilePlayer = {};
|
|
|
11623
11685
|
}, e: function e2(_e2) {
|
|
11624
11686
|
didErr = true;
|
|
11625
11687
|
err = _e2;
|
|
11626
|
-
}, f: function
|
|
11688
|
+
}, f: function f2() {
|
|
11627
11689
|
try {
|
|
11628
11690
|
if (!normalCompletion && it["return"] != null)
|
|
11629
11691
|
it["return"]();
|
|
@@ -11666,10 +11728,10 @@ var FilePlayer = {};
|
|
|
11666
11728
|
var MATCH_DROPBOX_URL = /www\.dropbox\.com\/.+/;
|
|
11667
11729
|
function canPlay(url) {
|
|
11668
11730
|
if (url instanceof Array) {
|
|
11669
|
-
var
|
|
11731
|
+
var _iterator4 = _createForOfIteratorHelper2(url), _step4;
|
|
11670
11732
|
try {
|
|
11671
|
-
for (
|
|
11672
|
-
var item =
|
|
11733
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
|
|
11734
|
+
var item = _step4.value;
|
|
11673
11735
|
if (typeof item === "string" && canPlay(item)) {
|
|
11674
11736
|
return true;
|
|
11675
11737
|
}
|
|
@@ -11678,9 +11740,9 @@ var FilePlayer = {};
|
|
|
11678
11740
|
}
|
|
11679
11741
|
}
|
|
11680
11742
|
} catch (err) {
|
|
11681
|
-
|
|
11743
|
+
_iterator4.e(err);
|
|
11682
11744
|
} finally {
|
|
11683
|
-
|
|
11745
|
+
_iterator4.f();
|
|
11684
11746
|
}
|
|
11685
11747
|
return false;
|
|
11686
11748
|
}
|
|
@@ -11765,20 +11827,20 @@ var FilePlayer = {};
|
|
|
11765
11827
|
_defineProperty2(_assertThisInitialized2(_this), "unmute", function() {
|
|
11766
11828
|
_this.player.muted = false;
|
|
11767
11829
|
});
|
|
11768
|
-
_defineProperty2(_assertThisInitialized2(_this), "renderSourceElement", function(source,
|
|
11830
|
+
_defineProperty2(_assertThisInitialized2(_this), "renderSourceElement", function(source, index2) {
|
|
11769
11831
|
if (typeof source === "string") {
|
|
11770
11832
|
return /* @__PURE__ */ _react2["default"].createElement("source", {
|
|
11771
|
-
key:
|
|
11833
|
+
key: index2,
|
|
11772
11834
|
src: source
|
|
11773
11835
|
});
|
|
11774
11836
|
}
|
|
11775
11837
|
return /* @__PURE__ */ _react2["default"].createElement("source", _extends2({
|
|
11776
|
-
key:
|
|
11838
|
+
key: index2
|
|
11777
11839
|
}, source));
|
|
11778
11840
|
});
|
|
11779
|
-
_defineProperty2(_assertThisInitialized2(_this), "renderTrack", function(track,
|
|
11841
|
+
_defineProperty2(_assertThisInitialized2(_this), "renderTrack", function(track, index2) {
|
|
11780
11842
|
return /* @__PURE__ */ _react2["default"].createElement("track", _extends2({
|
|
11781
|
-
key:
|
|
11843
|
+
key: index2
|
|
11782
11844
|
}, track));
|
|
11783
11845
|
});
|
|
11784
11846
|
_defineProperty2(_assertThisInitialized2(_this), "ref", function(player) {
|
|
@@ -12063,7 +12125,7 @@ var Preview = {};
|
|
|
12063
12125
|
function _getRequireWildcardCache() {
|
|
12064
12126
|
if (typeof WeakMap !== "function")
|
|
12065
12127
|
return null;
|
|
12066
|
-
var cache = new WeakMap();
|
|
12128
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
12067
12129
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
12068
12130
|
return cache;
|
|
12069
12131
|
};
|
|
@@ -12111,29 +12173,29 @@ var Preview = {};
|
|
|
12111
12173
|
}
|
|
12112
12174
|
return _typeof2(obj);
|
|
12113
12175
|
}
|
|
12114
|
-
function
|
|
12115
|
-
var
|
|
12176
|
+
function ownKeys2(object2, enumerableOnly) {
|
|
12177
|
+
var keys2 = Object.keys(object2);
|
|
12116
12178
|
if (Object.getOwnPropertySymbols) {
|
|
12117
12179
|
var symbols = Object.getOwnPropertySymbols(object2);
|
|
12118
12180
|
if (enumerableOnly)
|
|
12119
12181
|
symbols = symbols.filter(function(sym) {
|
|
12120
12182
|
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
|
|
12121
12183
|
});
|
|
12122
|
-
|
|
12184
|
+
keys2.push.apply(keys2, symbols);
|
|
12123
12185
|
}
|
|
12124
|
-
return
|
|
12186
|
+
return keys2;
|
|
12125
12187
|
}
|
|
12126
|
-
function
|
|
12188
|
+
function _objectSpread2(target) {
|
|
12127
12189
|
for (var i = 1; i < arguments.length; i++) {
|
|
12128
12190
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
12129
12191
|
if (i % 2) {
|
|
12130
|
-
|
|
12192
|
+
ownKeys2(Object(source), true).forEach(function(key2) {
|
|
12131
12193
|
_defineProperty2(target, key2, source[key2]);
|
|
12132
12194
|
});
|
|
12133
12195
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
12134
12196
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
12135
12197
|
} else {
|
|
12136
|
-
|
|
12198
|
+
ownKeys2(Object(source)).forEach(function(key2) {
|
|
12137
12199
|
Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
|
|
12138
12200
|
});
|
|
12139
12201
|
}
|
|
@@ -12268,9 +12330,9 @@ var Preview = {};
|
|
|
12268
12330
|
}
|
|
12269
12331
|
}, {
|
|
12270
12332
|
key: "fetchImage",
|
|
12271
|
-
value: function fetchImage(
|
|
12333
|
+
value: function fetchImage(_ref7) {
|
|
12272
12334
|
var _this2 = this;
|
|
12273
|
-
var url =
|
|
12335
|
+
var url = _ref7.url, light = _ref7.light;
|
|
12274
12336
|
if (typeof light === "string") {
|
|
12275
12337
|
this.setState({
|
|
12276
12338
|
image: light
|
|
@@ -12302,7 +12364,7 @@ var Preview = {};
|
|
|
12302
12364
|
justifyContent: "center"
|
|
12303
12365
|
};
|
|
12304
12366
|
var styles = {
|
|
12305
|
-
preview:
|
|
12367
|
+
preview: _objectSpread2({
|
|
12306
12368
|
width: "100%",
|
|
12307
12369
|
height: "100%",
|
|
12308
12370
|
backgroundImage: image ? "url(".concat(image, ")") : void 0,
|
|
@@ -12310,7 +12372,7 @@ var Preview = {};
|
|
|
12310
12372
|
backgroundPosition: "center",
|
|
12311
12373
|
cursor: "pointer"
|
|
12312
12374
|
}, flexCenter),
|
|
12313
|
-
shadow:
|
|
12375
|
+
shadow: _objectSpread2({
|
|
12314
12376
|
background: "radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",
|
|
12315
12377
|
borderRadius: ICON_SIZE,
|
|
12316
12378
|
width: ICON_SIZE,
|
|
@@ -12382,7 +12444,7 @@ var preload = {};
|
|
|
12382
12444
|
}, e: function e2(_e2) {
|
|
12383
12445
|
didErr = true;
|
|
12384
12446
|
err = _e2;
|
|
12385
|
-
}, f: function
|
|
12447
|
+
}, f: function f2() {
|
|
12386
12448
|
try {
|
|
12387
12449
|
if (!normalCompletion && it["return"] != null)
|
|
12388
12450
|
it["return"]();
|
|
@@ -12432,10 +12494,10 @@ var preload = {};
|
|
|
12432
12494
|
}];
|
|
12433
12495
|
function renderPreloadPlayers(url, controls, config) {
|
|
12434
12496
|
var players2 = [];
|
|
12435
|
-
var
|
|
12497
|
+
var _iterator4 = _createForOfIteratorHelper2(PRELOAD_PLAYERS), _step4;
|
|
12436
12498
|
try {
|
|
12437
|
-
for (
|
|
12438
|
-
var player =
|
|
12499
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
|
|
12500
|
+
var player = _step4.value;
|
|
12439
12501
|
if (!player.Player.canPlay(url) && config[player.configKey].preload) {
|
|
12440
12502
|
players2.push(/* @__PURE__ */ _react2["default"].createElement(_Player["default"], {
|
|
12441
12503
|
key: player.Player.displayName,
|
|
@@ -12449,9 +12511,9 @@ var preload = {};
|
|
|
12449
12511
|
}
|
|
12450
12512
|
}
|
|
12451
12513
|
} catch (err) {
|
|
12452
|
-
|
|
12514
|
+
_iterator4.e(err);
|
|
12453
12515
|
} finally {
|
|
12454
|
-
|
|
12516
|
+
_iterator4.f();
|
|
12455
12517
|
}
|
|
12456
12518
|
return players2;
|
|
12457
12519
|
}
|
|
@@ -12544,7 +12606,7 @@ var preload = {};
|
|
|
12544
12606
|
function _getRequireWildcardCache() {
|
|
12545
12607
|
if (typeof WeakMap !== "function")
|
|
12546
12608
|
return null;
|
|
12547
|
-
var cache = new WeakMap();
|
|
12609
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
12548
12610
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
12549
12611
|
return cache;
|
|
12550
12612
|
};
|
|
@@ -12592,29 +12654,29 @@ var preload = {};
|
|
|
12592
12654
|
}
|
|
12593
12655
|
return _typeof2(obj);
|
|
12594
12656
|
}
|
|
12595
|
-
function
|
|
12596
|
-
var
|
|
12657
|
+
function ownKeys2(object2, enumerableOnly) {
|
|
12658
|
+
var keys2 = Object.keys(object2);
|
|
12597
12659
|
if (Object.getOwnPropertySymbols) {
|
|
12598
12660
|
var symbols = Object.getOwnPropertySymbols(object2);
|
|
12599
12661
|
if (enumerableOnly)
|
|
12600
12662
|
symbols = symbols.filter(function(sym) {
|
|
12601
12663
|
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
|
|
12602
12664
|
});
|
|
12603
|
-
|
|
12665
|
+
keys2.push.apply(keys2, symbols);
|
|
12604
12666
|
}
|
|
12605
|
-
return
|
|
12667
|
+
return keys2;
|
|
12606
12668
|
}
|
|
12607
|
-
function
|
|
12669
|
+
function _objectSpread2(target) {
|
|
12608
12670
|
for (var i = 1; i < arguments.length; i++) {
|
|
12609
12671
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
12610
12672
|
if (i % 2) {
|
|
12611
|
-
|
|
12673
|
+
ownKeys2(Object(source), true).forEach(function(key2) {
|
|
12612
12674
|
_defineProperty2(target, key2, source[key2]);
|
|
12613
12675
|
});
|
|
12614
12676
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
12615
12677
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
12616
12678
|
} else {
|
|
12617
|
-
|
|
12679
|
+
ownKeys2(Object(source)).forEach(function(key2) {
|
|
12618
12680
|
Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
|
|
12619
12681
|
});
|
|
12620
12682
|
}
|
|
@@ -12902,7 +12964,7 @@ var preload = {};
|
|
|
12902
12964
|
});
|
|
12903
12965
|
return /* @__PURE__ */ _react2["default"].createElement(Wrapper2, _extends2({
|
|
12904
12966
|
ref: this.wrapperRef,
|
|
12905
|
-
style:
|
|
12967
|
+
style: _objectSpread2({}, style, {
|
|
12906
12968
|
width,
|
|
12907
12969
|
height
|
|
12908
12970
|
})
|
|
@@ -13351,9 +13413,9 @@ var Box = React.forwardRef(function Box2({
|
|
|
13351
13413
|
animate: animate2 == null ? void 0 : animate2.parent,
|
|
13352
13414
|
initial: initial2 == null ? void 0 : initial2.parent,
|
|
13353
13415
|
transition: transition == null ? void 0 : transition.parent,
|
|
13354
|
-
children: children && children.elements.length > 0 ? children.elements.map((child,
|
|
13416
|
+
children: children && children.elements.length > 0 ? children.elements.map((child, index2) => /* @__PURE__ */ jsxRuntime.jsx(GridItem$1, {
|
|
13355
13417
|
grid: children.columns,
|
|
13356
|
-
index,
|
|
13418
|
+
index: index2,
|
|
13357
13419
|
columnGap,
|
|
13358
13420
|
rowGap,
|
|
13359
13421
|
alignItems: verticalAlign,
|
|
@@ -13527,14 +13589,14 @@ var isArrayish$1 = function isArrayish2(obj) {
|
|
|
13527
13589
|
return obj instanceof Array || Array.isArray(obj) || obj.length >= 0 && (obj.splice instanceof Function || Object.getOwnPropertyDescriptor(obj, obj.length - 1) && obj.constructor.name !== "String");
|
|
13528
13590
|
};
|
|
13529
13591
|
var isArrayish = isArrayish$1;
|
|
13530
|
-
var concat = Array.prototype.concat;
|
|
13592
|
+
var concat$1 = Array.prototype.concat;
|
|
13531
13593
|
var slice = Array.prototype.slice;
|
|
13532
13594
|
var swizzle$1 = simpleSwizzle.exports = function swizzle2(args) {
|
|
13533
13595
|
var results = [];
|
|
13534
13596
|
for (var i = 0, len = args.length; i < len; i++) {
|
|
13535
13597
|
var arg = args[i];
|
|
13536
13598
|
if (isArrayish(arg)) {
|
|
13537
|
-
results = concat.call(results, slice.call(arg));
|
|
13599
|
+
results = concat$1.call(results, slice.call(arg));
|
|
13538
13600
|
} else {
|
|
13539
13601
|
results.push(arg);
|
|
13540
13602
|
}
|
|
@@ -13550,9 +13612,9 @@ var colorNames = colorName$1;
|
|
|
13550
13612
|
var swizzle = simpleSwizzle.exports;
|
|
13551
13613
|
var hasOwnProperty = Object.hasOwnProperty;
|
|
13552
13614
|
var reverseNames = {};
|
|
13553
|
-
for (var name in colorNames) {
|
|
13554
|
-
if (hasOwnProperty.call(colorNames, name)) {
|
|
13555
|
-
reverseNames[colorNames[name]] = name;
|
|
13615
|
+
for (var name$1 in colorNames) {
|
|
13616
|
+
if (hasOwnProperty.call(colorNames, name$1)) {
|
|
13617
|
+
reverseNames[colorNames[name$1]] = name$1;
|
|
13556
13618
|
}
|
|
13557
13619
|
}
|
|
13558
13620
|
var cs = colorString$1.exports = {
|
|
@@ -14131,10 +14193,10 @@ convert$2.hsv.rgb = function(hsv) {
|
|
|
14131
14193
|
var s = hsv[1] / 100;
|
|
14132
14194
|
var v = hsv[2] / 100;
|
|
14133
14195
|
var hi = Math.floor(h) % 6;
|
|
14134
|
-
var
|
|
14196
|
+
var f2 = h - Math.floor(h);
|
|
14135
14197
|
var p = 255 * v * (1 - s);
|
|
14136
|
-
var q = 255 * v * (1 - s *
|
|
14137
|
-
var t2 = 255 * v * (1 - s * (1 -
|
|
14198
|
+
var q = 255 * v * (1 - s * f2);
|
|
14199
|
+
var t2 = 255 * v * (1 - s * (1 - f2));
|
|
14138
14200
|
v *= 255;
|
|
14139
14201
|
switch (hi) {
|
|
14140
14202
|
case 0:
|
|
@@ -14174,7 +14236,7 @@ convert$2.hwb.rgb = function(hwb) {
|
|
|
14174
14236
|
var ratio = wh + bl;
|
|
14175
14237
|
var i;
|
|
14176
14238
|
var v;
|
|
14177
|
-
var
|
|
14239
|
+
var f2;
|
|
14178
14240
|
var n2;
|
|
14179
14241
|
if (ratio > 1) {
|
|
14180
14242
|
wh /= ratio;
|
|
@@ -14182,11 +14244,11 @@ convert$2.hwb.rgb = function(hwb) {
|
|
|
14182
14244
|
}
|
|
14183
14245
|
i = Math.floor(6 * h);
|
|
14184
14246
|
v = 1 - bl;
|
|
14185
|
-
|
|
14247
|
+
f2 = 6 * h - i;
|
|
14186
14248
|
if ((i & 1) !== 0) {
|
|
14187
|
-
|
|
14249
|
+
f2 = 1 - f2;
|
|
14188
14250
|
}
|
|
14189
|
-
n2 = wh +
|
|
14251
|
+
n2 = wh + f2 * (v - wh);
|
|
14190
14252
|
var r2;
|
|
14191
14253
|
var g;
|
|
14192
14254
|
var b2;
|
|
@@ -14437,26 +14499,26 @@ convert$2.hsl.hcg = function(hsl) {
|
|
|
14437
14499
|
var s = hsl[1] / 100;
|
|
14438
14500
|
var l = hsl[2] / 100;
|
|
14439
14501
|
var c2 = 1;
|
|
14440
|
-
var
|
|
14502
|
+
var f2 = 0;
|
|
14441
14503
|
if (l < 0.5) {
|
|
14442
14504
|
c2 = 2 * s * l;
|
|
14443
14505
|
} else {
|
|
14444
14506
|
c2 = 2 * s * (1 - l);
|
|
14445
14507
|
}
|
|
14446
14508
|
if (c2 < 1) {
|
|
14447
|
-
|
|
14509
|
+
f2 = (l - 0.5 * c2) / (1 - c2);
|
|
14448
14510
|
}
|
|
14449
|
-
return [hsl[0], c2 * 100,
|
|
14511
|
+
return [hsl[0], c2 * 100, f2 * 100];
|
|
14450
14512
|
};
|
|
14451
14513
|
convert$2.hsv.hcg = function(hsv) {
|
|
14452
14514
|
var s = hsv[1] / 100;
|
|
14453
14515
|
var v = hsv[2] / 100;
|
|
14454
14516
|
var c2 = s * v;
|
|
14455
|
-
var
|
|
14517
|
+
var f2 = 0;
|
|
14456
14518
|
if (c2 < 1) {
|
|
14457
|
-
|
|
14519
|
+
f2 = (v - c2) / (1 - c2);
|
|
14458
14520
|
}
|
|
14459
|
-
return [hsv[0], c2 * 100,
|
|
14521
|
+
return [hsv[0], c2 * 100, f2 * 100];
|
|
14460
14522
|
};
|
|
14461
14523
|
convert$2.hcg.rgb = function(hcg) {
|
|
14462
14524
|
var h = hcg[0] / 360;
|
|
@@ -14512,11 +14574,11 @@ convert$2.hcg.hsv = function(hcg) {
|
|
|
14512
14574
|
var c2 = hcg[1] / 100;
|
|
14513
14575
|
var g = hcg[2] / 100;
|
|
14514
14576
|
var v = c2 + g * (1 - c2);
|
|
14515
|
-
var
|
|
14577
|
+
var f2 = 0;
|
|
14516
14578
|
if (v > 0) {
|
|
14517
|
-
|
|
14579
|
+
f2 = c2 / v;
|
|
14518
14580
|
}
|
|
14519
|
-
return [hcg[0],
|
|
14581
|
+
return [hcg[0], f2 * 100, v * 100];
|
|
14520
14582
|
};
|
|
14521
14583
|
convert$2.hcg.hsl = function(hcg) {
|
|
14522
14584
|
var c2 = hcg[1] / 100;
|
|
@@ -14752,12 +14814,12 @@ function Color(obj, model2) {
|
|
|
14752
14814
|
this.valpha = 1;
|
|
14753
14815
|
} else {
|
|
14754
14816
|
this.valpha = 1;
|
|
14755
|
-
var
|
|
14817
|
+
var keys2 = Object.keys(obj);
|
|
14756
14818
|
if ("alpha" in obj) {
|
|
14757
|
-
|
|
14819
|
+
keys2.splice(keys2.indexOf("alpha"), 1);
|
|
14758
14820
|
this.valpha = typeof obj.alpha === "number" ? obj.alpha : 0;
|
|
14759
14821
|
}
|
|
14760
|
-
var hashedKeys =
|
|
14822
|
+
var hashedKeys = keys2.sort().join("");
|
|
14761
14823
|
if (!(hashedKeys in hashedModelKeys)) {
|
|
14762
14824
|
throw new Error("Unable to parse color from object: " + JSON.stringify(obj));
|
|
14763
14825
|
}
|
|
@@ -15091,8 +15153,8 @@ function compute(e2, i) {
|
|
|
15091
15153
|
};
|
|
15092
15154
|
if (!t(e2))
|
|
15093
15155
|
throw new TypeError("Invalid target");
|
|
15094
|
-
for (var
|
|
15095
|
-
if ((p = p.parentElement) ===
|
|
15156
|
+
for (var f2 = document.scrollingElement || document.documentElement, s = [], p = e2; t(p) && c2(p); ) {
|
|
15157
|
+
if ((p = p.parentElement) === f2) {
|
|
15096
15158
|
s.push(p);
|
|
15097
15159
|
break;
|
|
15098
15160
|
}
|
|
@@ -15103,7 +15165,7 @@ function compute(e2, i) {
|
|
|
15103
15165
|
if (l === "if-needed" && y >= 0 && V >= 0 && M <= g && E <= m && y >= R && M <= Y && V >= L && E <= X)
|
|
15104
15166
|
return C;
|
|
15105
15167
|
var S = getComputedStyle(k), j = parseInt(S.borderLeftWidth, 10), q = parseInt(S.borderTopWidth, 10), z = parseInt(S.borderRightWidth, 10), A = parseInt(S.borderBottomWidth, 10), F = 0, G = 0, J = "offsetWidth" in k ? k.offsetWidth - k.clientWidth - j - z : 0, K = "offsetHeight" in k ? k.offsetHeight - k.clientHeight - q - A : 0;
|
|
15106
|
-
if (
|
|
15168
|
+
if (f2 === k)
|
|
15107
15169
|
F = d === "start" ? x : d === "end" ? x - g : d === "nearest" ? r(v, v + g, g, q, A, v + x, v + x + b2, b2) : x - g / 2, G = u === "start" ? I : u === "center" ? I - m / 2 : u === "end" ? I - m : r(w, w + m, m, j, z, w + I, w + I + H, H), F = Math.max(0, F + v), G = Math.max(0, G + w);
|
|
15108
15170
|
else {
|
|
15109
15171
|
F = d === "start" ? x - R - q : d === "end" ? x - Y + A + K : d === "nearest" ? r(R, Y, D, q, A + K, x, x + b2, b2) : x - (R + D / 2) + K / 2, G = u === "start" ? I - L - j : u === "center" ? I - (L + O / 2) + J / 2 : u === "end" ? I - X + z + J : r(L, X, O, j, z + J, I, I + H, H);
|
|
@@ -15122,8 +15184,8 @@ function defaultBehavior(actions, behavior) {
|
|
|
15122
15184
|
behavior = "auto";
|
|
15123
15185
|
}
|
|
15124
15186
|
var canSmoothScroll = "scrollBehavior" in document.body.style;
|
|
15125
|
-
actions.forEach(function(
|
|
15126
|
-
var el =
|
|
15187
|
+
actions.forEach(function(_ref7) {
|
|
15188
|
+
var el = _ref7.el, top = _ref7.top, left = _ref7.left;
|
|
15127
15189
|
if (el.scroll && canSmoothScroll) {
|
|
15128
15190
|
el.scroll({
|
|
15129
15191
|
top,
|
|
@@ -15612,20 +15674,20 @@ function _assertThisInitialized(self) {
|
|
|
15612
15674
|
}
|
|
15613
15675
|
return self;
|
|
15614
15676
|
}
|
|
15615
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
15677
|
+
function _unsupportedIterableToArray$1(o, minLen) {
|
|
15616
15678
|
if (!o)
|
|
15617
15679
|
return;
|
|
15618
15680
|
if (typeof o === "string")
|
|
15619
|
-
return _arrayLikeToArray(o, minLen);
|
|
15681
|
+
return _arrayLikeToArray$1(o, minLen);
|
|
15620
15682
|
var n2 = Object.prototype.toString.call(o).slice(8, -1);
|
|
15621
15683
|
if (n2 === "Object" && o.constructor)
|
|
15622
15684
|
n2 = o.constructor.name;
|
|
15623
15685
|
if (n2 === "Map" || n2 === "Set")
|
|
15624
15686
|
return Array.from(o);
|
|
15625
15687
|
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
|
|
15626
|
-
return _arrayLikeToArray(o, minLen);
|
|
15688
|
+
return _arrayLikeToArray$1(o, minLen);
|
|
15627
15689
|
}
|
|
15628
|
-
function _arrayLikeToArray(arr, len) {
|
|
15690
|
+
function _arrayLikeToArray$1(arr, len) {
|
|
15629
15691
|
if (len == null || len > arr.length)
|
|
15630
15692
|
len = arr.length;
|
|
15631
15693
|
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
@@ -15635,7 +15697,7 @@ function _arrayLikeToArray(arr, len) {
|
|
|
15635
15697
|
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
15636
15698
|
var it;
|
|
15637
15699
|
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
|
|
15638
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
15700
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
15639
15701
|
if (it)
|
|
15640
15702
|
o = it;
|
|
15641
15703
|
var i = 0;
|
|
@@ -15667,8 +15729,8 @@ function chainFns() {
|
|
|
15667
15729
|
return fns[0];
|
|
15668
15730
|
return function() {
|
|
15669
15731
|
var result;
|
|
15670
|
-
for (var
|
|
15671
|
-
var fn =
|
|
15732
|
+
for (var _iterator4 = _createForOfIteratorHelperLoose(fns), _step4; !(_step4 = _iterator4()).done; ) {
|
|
15733
|
+
var fn = _step4.value;
|
|
15672
15734
|
result = fn.apply(this, arguments) || result;
|
|
15673
15735
|
}
|
|
15674
15736
|
return result;
|
|
@@ -15762,7 +15824,7 @@ function getPointerEventValues(event, transform) {
|
|
|
15762
15824
|
transform = identity;
|
|
15763
15825
|
}
|
|
15764
15826
|
var touchEvents = getEventTouches(event);
|
|
15765
|
-
var
|
|
15827
|
+
var _ref7 = touchEvents ? touchEvents[0] : event, clientX = _ref7.clientX, clientY = _ref7.clientY;
|
|
15766
15828
|
return transform([clientX, clientY]);
|
|
15767
15829
|
}
|
|
15768
15830
|
function getTwoTouchesEventValues(event, pointerIds, transform) {
|
|
@@ -15883,7 +15945,7 @@ var InternalCoordinatesOptionsNormalizers = /* @__PURE__ */ _extends$s({}, Inter
|
|
|
15883
15945
|
return [[left, right], [top, bottom]];
|
|
15884
15946
|
}
|
|
15885
15947
|
});
|
|
15886
|
-
var isBrowser = typeof window !== "undefined" && window.document && window.document.createElement;
|
|
15948
|
+
var isBrowser$1 = typeof window !== "undefined" && window.document && window.document.createElement;
|
|
15887
15949
|
var InternalGenericOptionsNormalizers = {
|
|
15888
15950
|
enabled: function enabled2(value) {
|
|
15889
15951
|
if (value === void 0) {
|
|
@@ -15902,12 +15964,12 @@ var InternalGenericOptionsNormalizers = {
|
|
|
15902
15964
|
return window2;
|
|
15903
15965
|
}(function(value) {
|
|
15904
15966
|
if (value === void 0) {
|
|
15905
|
-
value = isBrowser ? window : void 0;
|
|
15967
|
+
value = isBrowser$1 ? window : void 0;
|
|
15906
15968
|
}
|
|
15907
15969
|
return value;
|
|
15908
15970
|
}),
|
|
15909
15971
|
eventOptions: function eventOptions(_temp) {
|
|
15910
|
-
var
|
|
15972
|
+
var _ref7 = _temp === void 0 ? {} : _temp, _ref$passive = _ref7.passive, passive = _ref$passive === void 0 ? true : _ref$passive, _ref$capture = _ref7.capture, capture = _ref$capture === void 0 ? false : _ref$capture;
|
|
15911
15973
|
return {
|
|
15912
15974
|
passive,
|
|
15913
15975
|
capture
|
|
@@ -15916,8 +15978,8 @@ var InternalGenericOptionsNormalizers = {
|
|
|
15916
15978
|
transform: true
|
|
15917
15979
|
};
|
|
15918
15980
|
var InternalDistanceAngleOptionsNormalizers = /* @__PURE__ */ _extends$s({}, InternalGestureOptionsNormalizers, {
|
|
15919
|
-
bounds: function bounds2(_value, _key,
|
|
15920
|
-
var _ref2$distanceBounds =
|
|
15981
|
+
bounds: function bounds2(_value, _key, _ref22) {
|
|
15982
|
+
var _ref2$distanceBounds = _ref22.distanceBounds, distanceBounds = _ref2$distanceBounds === void 0 ? {} : _ref2$distanceBounds, _ref2$angleBounds = _ref22.angleBounds, angleBounds = _ref2$angleBounds === void 0 ? {} : _ref2$angleBounds;
|
|
15921
15983
|
var _distanceBounds = function _distanceBounds2(state) {
|
|
15922
15984
|
var D = assignDefault(valueFn(distanceBounds, state), {
|
|
15923
15985
|
min: -Infinity,
|
|
@@ -15958,8 +16020,8 @@ var InternalDragOptionsNormalizers = /* @__PURE__ */ _extends$s({}, InternalCoor
|
|
|
15958
16020
|
}
|
|
15959
16021
|
return value;
|
|
15960
16022
|
},
|
|
15961
|
-
threshold: function threshold2(v, _k,
|
|
15962
|
-
var _ref3$filterTaps =
|
|
16023
|
+
threshold: function threshold2(v, _k, _ref32) {
|
|
16024
|
+
var _ref3$filterTaps = _ref32.filterTaps, filterTaps = _ref3$filterTaps === void 0 ? false : _ref3$filterTaps, _ref3$lockDirection = _ref32.lockDirection, lockDirection2 = _ref3$lockDirection === void 0 ? false : _ref3$lockDirection, _ref3$axis = _ref32.axis, axis = _ref3$axis === void 0 ? void 0 : _ref3$axis;
|
|
15963
16025
|
var A = ensureVector(v, filterTaps ? 3 : lockDirection2 ? 1 : axis ? 1 : 0);
|
|
15964
16026
|
this.filterTaps = filterTaps;
|
|
15965
16027
|
return A;
|
|
@@ -16025,7 +16087,7 @@ function buildComplexConfig(config, actions) {
|
|
|
16025
16087
|
config = {};
|
|
16026
16088
|
}
|
|
16027
16089
|
if (actions === void 0) {
|
|
16028
|
-
actions = new Set();
|
|
16090
|
+
actions = /* @__PURE__ */ new Set();
|
|
16029
16091
|
}
|
|
16030
16092
|
var _config = config, drag2 = _config.drag, wheel = _config.wheel, move = _config.move, scroll = _config.scroll, pinch = _config.pinch, hover = _config.hover, eventOptions2 = _config.eventOptions, window2 = _config.window, transform = _config.transform, domTarget = _config.domTarget, enabled3 = _config.enabled;
|
|
16031
16093
|
var mergedConfig = getInternalGenericOptions({
|
|
@@ -16294,14 +16356,14 @@ function getIntentionalDisplacement(movement, threshold3) {
|
|
|
16294
16356
|
return false;
|
|
16295
16357
|
}
|
|
16296
16358
|
}
|
|
16297
|
-
function computeRubberband(bounds3,
|
|
16298
|
-
var Vx =
|
|
16299
|
-
var Rx =
|
|
16359
|
+
function computeRubberband(bounds3, _ref7, _ref22) {
|
|
16360
|
+
var Vx = _ref7[0], Vy = _ref7[1];
|
|
16361
|
+
var Rx = _ref22[0], Ry = _ref22[1];
|
|
16300
16362
|
var _bounds$ = bounds3[0], X1 = _bounds$[0], X2 = _bounds$[1], _bounds$2 = bounds3[1], Y1 = _bounds$2[0], Y2 = _bounds$2[1];
|
|
16301
16363
|
return [rubberbandIfOutOfBounds(Vx, X1, X2, Rx), rubberbandIfOutOfBounds(Vy, Y1, Y2, Ry)];
|
|
16302
16364
|
}
|
|
16303
|
-
function getGenericPayload(
|
|
16304
|
-
var state =
|
|
16365
|
+
function getGenericPayload(_ref32, event, isStartEvent) {
|
|
16366
|
+
var state = _ref32.state;
|
|
16305
16367
|
var timeStamp = event.timeStamp, _lastEventType = event.type;
|
|
16306
16368
|
var previous = state.values;
|
|
16307
16369
|
var elapsedTime = isStartEvent ? 0 : timeStamp - state.startTime;
|
|
@@ -16313,8 +16375,8 @@ function getGenericPayload(_ref3, event, isStartEvent) {
|
|
|
16313
16375
|
previous
|
|
16314
16376
|
};
|
|
16315
16377
|
}
|
|
16316
|
-
function getStartGestureState(
|
|
16317
|
-
var state =
|
|
16378
|
+
function getStartGestureState(_ref42, values, event, initial2) {
|
|
16379
|
+
var state = _ref42.state, config = _ref42.config, stateKey = _ref42.stateKey, args = _ref42.args, transform = _ref42.transform;
|
|
16318
16380
|
var offset = state.offset;
|
|
16319
16381
|
var startTime = event.timeStamp;
|
|
16320
16382
|
var initialFn = config.initial, bounds3 = config.bounds, threshold3 = config.threshold;
|
|
@@ -16337,8 +16399,8 @@ function getStartGestureState(_ref4, values, event, initial2) {
|
|
|
16337
16399
|
var Controller = function Controller2(classes) {
|
|
16338
16400
|
var _this = this;
|
|
16339
16401
|
this.classes = classes;
|
|
16340
|
-
this.pointerIds = new Set();
|
|
16341
|
-
this.touchIds = new Set();
|
|
16402
|
+
this.pointerIds = /* @__PURE__ */ new Set();
|
|
16403
|
+
this.touchIds = /* @__PURE__ */ new Set();
|
|
16342
16404
|
this.supportsTouchEvents = supportsTouchEvents();
|
|
16343
16405
|
this.supportsGestureEvents = supportsGestureEvents();
|
|
16344
16406
|
this.bind = function() {
|
|
@@ -16346,8 +16408,8 @@ var Controller = function Controller2(classes) {
|
|
|
16346
16408
|
args[_key] = arguments[_key];
|
|
16347
16409
|
}
|
|
16348
16410
|
var bindings = {};
|
|
16349
|
-
for (var
|
|
16350
|
-
var RecognizerClass =
|
|
16411
|
+
for (var _iterator4 = _createForOfIteratorHelperLoose(_this.classes), _step4; !(_step4 = _iterator4()).done; ) {
|
|
16412
|
+
var RecognizerClass = _step4.value;
|
|
16351
16413
|
new RecognizerClass(_this, args).addBindings(bindings);
|
|
16352
16414
|
}
|
|
16353
16415
|
var _loop = function _loop2(eventKey2) {
|
|
@@ -16412,8 +16474,8 @@ function clearAllWindowListeners(controller) {
|
|
|
16412
16474
|
}
|
|
16413
16475
|
controller.windowListeners = {};
|
|
16414
16476
|
}
|
|
16415
|
-
function clearWindowListeners(
|
|
16416
|
-
var config =
|
|
16477
|
+
function clearWindowListeners(_ref7, stateKey, options) {
|
|
16478
|
+
var config = _ref7.config, windowListeners = _ref7.windowListeners;
|
|
16417
16479
|
if (options === void 0) {
|
|
16418
16480
|
options = config.eventOptions;
|
|
16419
16481
|
}
|
|
@@ -16422,8 +16484,8 @@ function clearWindowListeners(_ref, stateKey, options) {
|
|
|
16422
16484
|
removeListeners(config.window, windowListeners[stateKey], options);
|
|
16423
16485
|
delete windowListeners[stateKey];
|
|
16424
16486
|
}
|
|
16425
|
-
function updateWindowListeners(
|
|
16426
|
-
var config =
|
|
16487
|
+
function updateWindowListeners(_ref22, stateKey, listeners, options) {
|
|
16488
|
+
var config = _ref22.config, windowListeners = _ref22.windowListeners;
|
|
16427
16489
|
if (listeners === void 0) {
|
|
16428
16490
|
listeners = [];
|
|
16429
16491
|
}
|
|
@@ -16435,8 +16497,8 @@ function updateWindowListeners(_ref2, stateKey, listeners, options) {
|
|
|
16435
16497
|
removeListeners(config.window, windowListeners[stateKey], options);
|
|
16436
16498
|
addListeners(config.window, windowListeners[stateKey] = listeners, options);
|
|
16437
16499
|
}
|
|
16438
|
-
function updateDomListeners(
|
|
16439
|
-
var config =
|
|
16500
|
+
function updateDomListeners(_ref32, bindings) {
|
|
16501
|
+
var config = _ref32.config, domListeners = _ref32.domListeners;
|
|
16440
16502
|
var domTarget = getDomTargetFromConfig(config);
|
|
16441
16503
|
if (!domTarget)
|
|
16442
16504
|
throw new Error("domTarget must be defined");
|
|
@@ -16449,8 +16511,8 @@ function updateDomListeners(_ref3, bindings) {
|
|
|
16449
16511
|
}
|
|
16450
16512
|
addListeners(domTarget, domListeners, eventOptions2);
|
|
16451
16513
|
}
|
|
16452
|
-
function getPropsListener(
|
|
16453
|
-
var config =
|
|
16514
|
+
function getPropsListener(_ref42, bindings) {
|
|
16515
|
+
var config = _ref42.config;
|
|
16454
16516
|
var props2 = {};
|
|
16455
16517
|
var captureString = config.eventOptions.capture ? "Capture" : "";
|
|
16456
16518
|
for (var _i2 = 0, _Object$entries2 = Object.entries(bindings); _i2 < _Object$entries2.length; _i2++) {
|
|
@@ -16467,8 +16529,8 @@ function takeAll(array2) {
|
|
|
16467
16529
|
}
|
|
16468
16530
|
return array2.splice(0, array2.length);
|
|
16469
16531
|
}
|
|
16470
|
-
function getDomTargetFromConfig(
|
|
16471
|
-
var domTarget =
|
|
16532
|
+
function getDomTargetFromConfig(_ref52) {
|
|
16533
|
+
var domTarget = _ref52.domTarget;
|
|
16472
16534
|
return domTarget && "current" in domTarget ? domTarget.current : domTarget;
|
|
16473
16535
|
}
|
|
16474
16536
|
function addBindings(bindings, name2, fn) {
|
|
@@ -16483,8 +16545,8 @@ function addListeners(el, listeners, options) {
|
|
|
16483
16545
|
if (options === void 0) {
|
|
16484
16546
|
options = {};
|
|
16485
16547
|
}
|
|
16486
|
-
for (var
|
|
16487
|
-
var _step2$value =
|
|
16548
|
+
for (var _iterator22 = _createForOfIteratorHelperLoose(listeners), _step22; !(_step22 = _iterator22()).done; ) {
|
|
16549
|
+
var _step2$value = _step22.value, eventName = _step2$value[0], eventHandler = _step2$value[1];
|
|
16488
16550
|
el.addEventListener(eventName, eventHandler, options);
|
|
16489
16551
|
}
|
|
16490
16552
|
}
|
|
@@ -16495,8 +16557,8 @@ function removeListeners(el, listeners, options) {
|
|
|
16495
16557
|
if (options === void 0) {
|
|
16496
16558
|
options = {};
|
|
16497
16559
|
}
|
|
16498
|
-
for (var
|
|
16499
|
-
var _step3$value =
|
|
16560
|
+
for (var _iterator32 = _createForOfIteratorHelperLoose(listeners), _step32; !(_step32 = _iterator32()).done; ) {
|
|
16561
|
+
var _step3$value = _step32.value, eventName = _step3$value[0], eventHandler = _step3$value[1];
|
|
16500
16562
|
el.removeEventListener(eventName, eventHandler, options);
|
|
16501
16563
|
}
|
|
16502
16564
|
}
|
|
@@ -16519,7 +16581,7 @@ function useRecognizers(handlers, config, nativeHandlers) {
|
|
|
16519
16581
|
function deprecationNoticeForDomTarget() {
|
|
16520
16582
|
}
|
|
16521
16583
|
function resolveClasses(internalHandlers) {
|
|
16522
|
-
var classes = new Set();
|
|
16584
|
+
var classes = /* @__PURE__ */ new Set();
|
|
16523
16585
|
if (internalHandlers.drag)
|
|
16524
16586
|
classes.add(RecognizersMap.get("drag"));
|
|
16525
16587
|
if (internalHandlers.wheel)
|
|
@@ -17217,7 +17279,7 @@ var RE_NOT_NATIVE = /^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;
|
|
|
17217
17279
|
function sortHandlers(handlers) {
|
|
17218
17280
|
var _native = {};
|
|
17219
17281
|
var handle = {};
|
|
17220
|
-
var actions = new Set();
|
|
17282
|
+
var actions = /* @__PURE__ */ new Set();
|
|
17221
17283
|
for (var key2 in handlers) {
|
|
17222
17284
|
if (RE_NOT_NATIVE.test(key2)) {
|
|
17223
17285
|
actions.add(RegExp.lastMatch);
|
|
@@ -17776,9 +17838,9 @@ var Carousel = React.forwardRef(function Carousel2({
|
|
|
17776
17838
|
slideBorder,
|
|
17777
17839
|
slideBorderRadius
|
|
17778
17840
|
}, ref) {
|
|
17779
|
-
const [
|
|
17841
|
+
const [index2, setIndex] = React.useState(0);
|
|
17780
17842
|
const swipe = React.useRef(0);
|
|
17781
|
-
const startIndex = wrap$1(0, images.length,
|
|
17843
|
+
const startIndex = wrap$1(0, images.length, index2);
|
|
17782
17844
|
const pageSize = useMediaQuery(responsivePageSize) || 1;
|
|
17783
17845
|
const step = useMediaQuery(responsiveStep) || 1;
|
|
17784
17846
|
const endIndex = startIndex + pageSize;
|
|
@@ -17792,8 +17854,8 @@ var Carousel = React.forwardRef(function Carousel2({
|
|
|
17792
17854
|
const direction = pageDistance / Math.abs(pageDistance);
|
|
17793
17855
|
const remaining = direction > 0 ? images.slice(endIndex) : images.slice(0, startIndex);
|
|
17794
17856
|
const distance2 = direction * Math.min(remaining.length, step * Math.abs(pageDistance));
|
|
17795
|
-
setIndex(
|
|
17796
|
-
}, [images,
|
|
17857
|
+
setIndex(index2 + distance2);
|
|
17858
|
+
}, [images, index2, startIndex, endIndex, step]);
|
|
17797
17859
|
const animation = useAnimation();
|
|
17798
17860
|
const bindPage = useGesture({
|
|
17799
17861
|
onDrag: ({
|
|
@@ -17927,7 +17989,7 @@ var Carousel = React.forwardRef(function Carousel2({
|
|
|
17927
17989
|
})]
|
|
17928
17990
|
});
|
|
17929
17991
|
});
|
|
17930
|
-
const Block = styled__default["default"].div`
|
|
17992
|
+
const Block$1 = styled__default["default"].div`
|
|
17931
17993
|
display: block;
|
|
17932
17994
|
padding: 0.5em;
|
|
17933
17995
|
font-size: 1em;
|
|
@@ -17986,7 +18048,7 @@ const Container$5 = styled__default["default"].div`
|
|
|
17986
18048
|
`)}
|
|
17987
18049
|
}
|
|
17988
18050
|
|
|
17989
|
-
${Block} {
|
|
18051
|
+
${Block$1} {
|
|
17990
18052
|
${(p) => cssMediaRules([p.shape], ([shape2 = "rounded"]) => {
|
|
17991
18053
|
switch (shape2) {
|
|
17992
18054
|
case "pill":
|
|
@@ -18194,7 +18256,7 @@ var Countdown = React.forwardRef(function Countdown2({
|
|
|
18194
18256
|
blockColor: useColor(blockColor),
|
|
18195
18257
|
gap,
|
|
18196
18258
|
children: [/* @__PURE__ */ jsxRuntime.jsxs(Segment, {
|
|
18197
|
-
children: [/* @__PURE__ */ jsxRuntime.jsx(Block, {
|
|
18259
|
+
children: [/* @__PURE__ */ jsxRuntime.jsx(Block$1, {
|
|
18198
18260
|
children: /* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
18199
18261
|
children: days
|
|
18200
18262
|
})
|
|
@@ -18202,7 +18264,7 @@ var Countdown = React.forwardRef(function Countdown2({
|
|
|
18202
18264
|
children: daysLabel == null ? "Days" : daysLabel
|
|
18203
18265
|
})]
|
|
18204
18266
|
}), /* @__PURE__ */ jsxRuntime.jsxs(Segment, {
|
|
18205
|
-
children: [/* @__PURE__ */ jsxRuntime.jsx(Block, {
|
|
18267
|
+
children: [/* @__PURE__ */ jsxRuntime.jsx(Block$1, {
|
|
18206
18268
|
children: /* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
18207
18269
|
children: hours
|
|
18208
18270
|
})
|
|
@@ -18210,7 +18272,7 @@ var Countdown = React.forwardRef(function Countdown2({
|
|
|
18210
18272
|
children: hoursLabel == null ? "Hours" : hoursLabel
|
|
18211
18273
|
})]
|
|
18212
18274
|
}), /* @__PURE__ */ jsxRuntime.jsxs(Segment, {
|
|
18213
|
-
children: [/* @__PURE__ */ jsxRuntime.jsx(Block, {
|
|
18275
|
+
children: [/* @__PURE__ */ jsxRuntime.jsx(Block$1, {
|
|
18214
18276
|
children: /* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
18215
18277
|
children: minutes
|
|
18216
18278
|
})
|
|
@@ -18218,7 +18280,7 @@ var Countdown = React.forwardRef(function Countdown2({
|
|
|
18218
18280
|
children: minutesLabel == null ? "Minutes" : minutesLabel
|
|
18219
18281
|
})]
|
|
18220
18282
|
}), /* @__PURE__ */ jsxRuntime.jsxs(Segment, {
|
|
18221
|
-
children: [/* @__PURE__ */ jsxRuntime.jsx(Block, {
|
|
18283
|
+
children: [/* @__PURE__ */ jsxRuntime.jsx(Block$1, {
|
|
18222
18284
|
children: /* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
18223
18285
|
children: seconds
|
|
18224
18286
|
})
|
|
@@ -18716,7 +18778,7 @@ const DropDownMenu = styled__default["default"].div`
|
|
|
18716
18778
|
const ButtonLink$1 = styled__default["default"](Button)`
|
|
18717
18779
|
margin: 8px 0;
|
|
18718
18780
|
`;
|
|
18719
|
-
const StyledLink$
|
|
18781
|
+
const StyledLink$2 = styled__default["default"](Link)`
|
|
18720
18782
|
text-decoration: none;
|
|
18721
18783
|
line-height: 1.4;
|
|
18722
18784
|
padding: 8px 16px;
|
|
@@ -18732,7 +18794,7 @@ function DropDownItem(_s) {
|
|
|
18732
18794
|
} = _t, restOfProps = __objRest(_t, [
|
|
18733
18795
|
"color"
|
|
18734
18796
|
]);
|
|
18735
|
-
return /* @__PURE__ */ jsxRuntime.jsx(StyledLink$
|
|
18797
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledLink$2, __spreadProps(__spreadValues({}, restOfProps), {
|
|
18736
18798
|
color: useColor(color2)
|
|
18737
18799
|
}));
|
|
18738
18800
|
}
|
|
@@ -18974,8 +19036,8 @@ var Navigation = React.forwardRef(function Navigation2({
|
|
|
18974
19036
|
});
|
|
18975
19037
|
});
|
|
18976
19038
|
function normalize() {
|
|
18977
|
-
var
|
|
18978
|
-
return [(
|
|
19039
|
+
var _ref7;
|
|
19040
|
+
return [(_ref7 = {
|
|
18979
19041
|
html: {
|
|
18980
19042
|
lineHeight: "1.15",
|
|
18981
19043
|
textSizeAdjust: "100%"
|
|
@@ -19003,75 +19065,75 @@ function normalize() {
|
|
|
19003
19065
|
borderBottom: "none",
|
|
19004
19066
|
textDecoration: "underline"
|
|
19005
19067
|
}
|
|
19006
|
-
},
|
|
19068
|
+
}, _ref7["b,\n strong"] = {
|
|
19007
19069
|
fontWeight: "bolder"
|
|
19008
|
-
},
|
|
19070
|
+
}, _ref7["code,\n kbd,\n samp"] = {
|
|
19009
19071
|
fontFamily: "monospace, monospace",
|
|
19010
19072
|
fontSize: "1em"
|
|
19011
|
-
},
|
|
19073
|
+
}, _ref7.small = {
|
|
19012
19074
|
fontSize: "80%"
|
|
19013
|
-
},
|
|
19075
|
+
}, _ref7["sub,\n sup"] = {
|
|
19014
19076
|
fontSize: "75%",
|
|
19015
19077
|
lineHeight: "0",
|
|
19016
19078
|
position: "relative",
|
|
19017
19079
|
verticalAlign: "baseline"
|
|
19018
|
-
},
|
|
19080
|
+
}, _ref7.sub = {
|
|
19019
19081
|
bottom: "-0.25em"
|
|
19020
|
-
},
|
|
19082
|
+
}, _ref7.sup = {
|
|
19021
19083
|
top: "-0.5em"
|
|
19022
|
-
},
|
|
19084
|
+
}, _ref7.img = {
|
|
19023
19085
|
borderStyle: "none"
|
|
19024
|
-
},
|
|
19086
|
+
}, _ref7["button,\n input,\n optgroup,\n select,\n textarea"] = {
|
|
19025
19087
|
fontFamily: "inherit",
|
|
19026
19088
|
fontSize: "100%",
|
|
19027
19089
|
lineHeight: "1.15",
|
|
19028
19090
|
margin: "0"
|
|
19029
|
-
},
|
|
19091
|
+
}, _ref7["button,\n input"] = {
|
|
19030
19092
|
overflow: "visible"
|
|
19031
|
-
},
|
|
19093
|
+
}, _ref7["button,\n select"] = {
|
|
19032
19094
|
textTransform: "none"
|
|
19033
|
-
},
|
|
19095
|
+
}, _ref7['button,\n html [type="button"],\n [type="reset"],\n [type="submit"]'] = {
|
|
19034
19096
|
WebkitAppearance: "button"
|
|
19035
|
-
},
|
|
19097
|
+
}, _ref7['button::-moz-focus-inner,\n [type="button"]::-moz-focus-inner,\n [type="reset"]::-moz-focus-inner,\n [type="submit"]::-moz-focus-inner'] = {
|
|
19036
19098
|
borderStyle: "none",
|
|
19037
19099
|
padding: "0"
|
|
19038
|
-
},
|
|
19100
|
+
}, _ref7['button:-moz-focusring,\n [type="button"]:-moz-focusring,\n [type="reset"]:-moz-focusring,\n [type="submit"]:-moz-focusring'] = {
|
|
19039
19101
|
outline: "1px dotted ButtonText"
|
|
19040
|
-
},
|
|
19102
|
+
}, _ref7.fieldset = {
|
|
19041
19103
|
padding: "0.35em 0.625em 0.75em"
|
|
19042
|
-
},
|
|
19104
|
+
}, _ref7.legend = {
|
|
19043
19105
|
boxSizing: "border-box",
|
|
19044
19106
|
color: "inherit",
|
|
19045
19107
|
display: "table",
|
|
19046
19108
|
maxWidth: "100%",
|
|
19047
19109
|
padding: "0",
|
|
19048
19110
|
whiteSpace: "normal"
|
|
19049
|
-
},
|
|
19111
|
+
}, _ref7.progress = {
|
|
19050
19112
|
verticalAlign: "baseline"
|
|
19051
|
-
},
|
|
19113
|
+
}, _ref7.textarea = {
|
|
19052
19114
|
overflow: "auto"
|
|
19053
|
-
},
|
|
19115
|
+
}, _ref7['[type="checkbox"],\n [type="radio"]'] = {
|
|
19054
19116
|
boxSizing: "border-box",
|
|
19055
19117
|
padding: "0"
|
|
19056
|
-
},
|
|
19118
|
+
}, _ref7['[type="number"]::-webkit-inner-spin-button,\n [type="number"]::-webkit-outer-spin-button'] = {
|
|
19057
19119
|
height: "auto"
|
|
19058
|
-
},
|
|
19120
|
+
}, _ref7['[type="search"]'] = {
|
|
19059
19121
|
WebkitAppearance: "textfield",
|
|
19060
19122
|
outlineOffset: "-2px"
|
|
19061
|
-
},
|
|
19123
|
+
}, _ref7['[type="search"]::-webkit-search-decoration'] = {
|
|
19062
19124
|
WebkitAppearance: "none"
|
|
19063
|
-
},
|
|
19125
|
+
}, _ref7["::-webkit-file-upload-button"] = {
|
|
19064
19126
|
WebkitAppearance: "button",
|
|
19065
19127
|
font: "inherit"
|
|
19066
|
-
},
|
|
19128
|
+
}, _ref7.details = {
|
|
19067
19129
|
display: "block"
|
|
19068
|
-
},
|
|
19130
|
+
}, _ref7.summary = {
|
|
19069
19131
|
display: "list-item"
|
|
19070
|
-
},
|
|
19132
|
+
}, _ref7.template = {
|
|
19071
19133
|
display: "none"
|
|
19072
|
-
},
|
|
19134
|
+
}, _ref7["[hidden]"] = {
|
|
19073
19135
|
display: "none"
|
|
19074
|
-
},
|
|
19136
|
+
}, _ref7), {
|
|
19075
19137
|
"abbr[title]": {
|
|
19076
19138
|
textDecoration: "underline dotted"
|
|
19077
19139
|
}
|
|
@@ -19143,9 +19205,9 @@ var Root = React.forwardRef(function Page2({
|
|
|
19143
19205
|
},
|
|
19144
19206
|
backgrounds,
|
|
19145
19207
|
children: /* @__PURE__ */ jsxRuntime.jsx(Grid, {
|
|
19146
|
-
children: children && children.elements.length > 0 ? children.elements.map((child,
|
|
19208
|
+
children: children && children.elements.length > 0 ? children.elements.map((child, index2) => /* @__PURE__ */ jsxRuntime.jsx(GridItem, {
|
|
19147
19209
|
grid: children.columns,
|
|
19148
|
-
index,
|
|
19210
|
+
index: index2,
|
|
19149
19211
|
columnGap,
|
|
19150
19212
|
rowGap,
|
|
19151
19213
|
children: /* @__PURE__ */ jsxRuntime.jsx(react.Element, {
|
|
@@ -19830,7 +19892,7 @@ const Container = styled__default["default"].div`
|
|
|
19830
19892
|
justify-content: ${alignment};
|
|
19831
19893
|
`)}
|
|
19832
19894
|
`;
|
|
19833
|
-
const StyledLink = styled__default["default"](Link)`
|
|
19895
|
+
const StyledLink$1 = styled__default["default"](Link)`
|
|
19834
19896
|
display: block;
|
|
19835
19897
|
color: ${(props2) => props2.brandColor};
|
|
19836
19898
|
transition: transform, opacity 0.18s;
|
|
@@ -19918,7 +19980,7 @@ var SocialLinks = React.forwardRef(function SocialLinks2({
|
|
|
19918
19980
|
gutter,
|
|
19919
19981
|
first: i === 0,
|
|
19920
19982
|
last: i === links2.length - 1,
|
|
19921
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(StyledLink, {
|
|
19983
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(StyledLink$1, {
|
|
19922
19984
|
backgroundColor: backgroundColorData,
|
|
19923
19985
|
brandColor: option.brandColor,
|
|
19924
19986
|
fill: fillData,
|
|
@@ -19940,6 +20002,1613 @@ var SocialLinks = React.forwardRef(function SocialLinks2({
|
|
|
19940
20002
|
})
|
|
19941
20003
|
});
|
|
19942
20004
|
});
|
|
20005
|
+
var lib$1 = {};
|
|
20006
|
+
Object.defineProperty(lib$1, "__esModule", {
|
|
20007
|
+
value: true
|
|
20008
|
+
});
|
|
20009
|
+
var IS_MAC$1 = typeof window != "undefined" && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
|
|
20010
|
+
var MODIFIERS = {
|
|
20011
|
+
alt: "altKey",
|
|
20012
|
+
control: "ctrlKey",
|
|
20013
|
+
meta: "metaKey",
|
|
20014
|
+
shift: "shiftKey"
|
|
20015
|
+
};
|
|
20016
|
+
var ALIASES = {
|
|
20017
|
+
add: "+",
|
|
20018
|
+
break: "pause",
|
|
20019
|
+
cmd: "meta",
|
|
20020
|
+
command: "meta",
|
|
20021
|
+
ctl: "control",
|
|
20022
|
+
ctrl: "control",
|
|
20023
|
+
del: "delete",
|
|
20024
|
+
down: "arrowdown",
|
|
20025
|
+
esc: "escape",
|
|
20026
|
+
ins: "insert",
|
|
20027
|
+
left: "arrowleft",
|
|
20028
|
+
mod: IS_MAC$1 ? "meta" : "control",
|
|
20029
|
+
opt: "alt",
|
|
20030
|
+
option: "alt",
|
|
20031
|
+
return: "enter",
|
|
20032
|
+
right: "arrowright",
|
|
20033
|
+
space: " ",
|
|
20034
|
+
spacebar: " ",
|
|
20035
|
+
up: "arrowup",
|
|
20036
|
+
win: "meta",
|
|
20037
|
+
windows: "meta"
|
|
20038
|
+
};
|
|
20039
|
+
var CODES = {
|
|
20040
|
+
backspace: 8,
|
|
20041
|
+
tab: 9,
|
|
20042
|
+
enter: 13,
|
|
20043
|
+
shift: 16,
|
|
20044
|
+
control: 17,
|
|
20045
|
+
alt: 18,
|
|
20046
|
+
pause: 19,
|
|
20047
|
+
capslock: 20,
|
|
20048
|
+
escape: 27,
|
|
20049
|
+
" ": 32,
|
|
20050
|
+
pageup: 33,
|
|
20051
|
+
pagedown: 34,
|
|
20052
|
+
end: 35,
|
|
20053
|
+
home: 36,
|
|
20054
|
+
arrowleft: 37,
|
|
20055
|
+
arrowup: 38,
|
|
20056
|
+
arrowright: 39,
|
|
20057
|
+
arrowdown: 40,
|
|
20058
|
+
insert: 45,
|
|
20059
|
+
delete: 46,
|
|
20060
|
+
meta: 91,
|
|
20061
|
+
numlock: 144,
|
|
20062
|
+
scrolllock: 145,
|
|
20063
|
+
";": 186,
|
|
20064
|
+
"=": 187,
|
|
20065
|
+
",": 188,
|
|
20066
|
+
"-": 189,
|
|
20067
|
+
".": 190,
|
|
20068
|
+
"/": 191,
|
|
20069
|
+
"`": 192,
|
|
20070
|
+
"[": 219,
|
|
20071
|
+
"\\": 220,
|
|
20072
|
+
"]": 221,
|
|
20073
|
+
"'": 222
|
|
20074
|
+
};
|
|
20075
|
+
for (var f = 1; f < 20; f++) {
|
|
20076
|
+
CODES["f" + f] = 111 + f;
|
|
20077
|
+
}
|
|
20078
|
+
function isHotkey$1(hotkey, options, event) {
|
|
20079
|
+
if (options && !("byKey" in options)) {
|
|
20080
|
+
event = options;
|
|
20081
|
+
options = null;
|
|
20082
|
+
}
|
|
20083
|
+
if (!Array.isArray(hotkey)) {
|
|
20084
|
+
hotkey = [hotkey];
|
|
20085
|
+
}
|
|
20086
|
+
var array2 = hotkey.map(function(string2) {
|
|
20087
|
+
return parseHotkey(string2, options);
|
|
20088
|
+
});
|
|
20089
|
+
var check = function check2(e2) {
|
|
20090
|
+
return array2.some(function(object2) {
|
|
20091
|
+
return compareHotkey(object2, e2);
|
|
20092
|
+
});
|
|
20093
|
+
};
|
|
20094
|
+
var ret = event == null ? check : check(event);
|
|
20095
|
+
return ret;
|
|
20096
|
+
}
|
|
20097
|
+
function isCodeHotkey(hotkey, event) {
|
|
20098
|
+
return isHotkey$1(hotkey, event);
|
|
20099
|
+
}
|
|
20100
|
+
function isKeyHotkey(hotkey, event) {
|
|
20101
|
+
return isHotkey$1(hotkey, { byKey: true }, event);
|
|
20102
|
+
}
|
|
20103
|
+
function parseHotkey(hotkey, options) {
|
|
20104
|
+
var byKey = options && options.byKey;
|
|
20105
|
+
var ret = {};
|
|
20106
|
+
hotkey = hotkey.replace("++", "+add");
|
|
20107
|
+
var values = hotkey.split("+");
|
|
20108
|
+
var length = values.length;
|
|
20109
|
+
for (var k in MODIFIERS) {
|
|
20110
|
+
ret[MODIFIERS[k]] = false;
|
|
20111
|
+
}
|
|
20112
|
+
var _iteratorNormalCompletion4 = true;
|
|
20113
|
+
var _didIteratorError4 = false;
|
|
20114
|
+
var _iteratorError4 = void 0;
|
|
20115
|
+
try {
|
|
20116
|
+
for (var _iterator4 = values[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
|
|
20117
|
+
var value = _step4.value;
|
|
20118
|
+
var optional = value.endsWith("?");
|
|
20119
|
+
if (optional) {
|
|
20120
|
+
value = value.slice(0, -1);
|
|
20121
|
+
}
|
|
20122
|
+
var name2 = toKeyName(value);
|
|
20123
|
+
var modifier = MODIFIERS[name2];
|
|
20124
|
+
if (length === 1 || !modifier) {
|
|
20125
|
+
if (byKey) {
|
|
20126
|
+
ret.key = name2;
|
|
20127
|
+
} else {
|
|
20128
|
+
ret.which = toKeyCode(value);
|
|
20129
|
+
}
|
|
20130
|
+
}
|
|
20131
|
+
if (modifier) {
|
|
20132
|
+
ret[modifier] = optional ? null : true;
|
|
20133
|
+
}
|
|
20134
|
+
}
|
|
20135
|
+
} catch (err) {
|
|
20136
|
+
_didIteratorError4 = true;
|
|
20137
|
+
_iteratorError4 = err;
|
|
20138
|
+
} finally {
|
|
20139
|
+
try {
|
|
20140
|
+
if (!_iteratorNormalCompletion4 && _iterator4.return) {
|
|
20141
|
+
_iterator4.return();
|
|
20142
|
+
}
|
|
20143
|
+
} finally {
|
|
20144
|
+
if (_didIteratorError4) {
|
|
20145
|
+
throw _iteratorError4;
|
|
20146
|
+
}
|
|
20147
|
+
}
|
|
20148
|
+
}
|
|
20149
|
+
return ret;
|
|
20150
|
+
}
|
|
20151
|
+
function compareHotkey(object2, event) {
|
|
20152
|
+
for (var key2 in object2) {
|
|
20153
|
+
var expected = object2[key2];
|
|
20154
|
+
var actual = void 0;
|
|
20155
|
+
if (expected == null) {
|
|
20156
|
+
continue;
|
|
20157
|
+
}
|
|
20158
|
+
if (key2 === "key") {
|
|
20159
|
+
actual = event.key.toLowerCase();
|
|
20160
|
+
} else if (key2 === "which") {
|
|
20161
|
+
actual = expected === 91 && event.which === 93 ? 91 : event.which;
|
|
20162
|
+
} else {
|
|
20163
|
+
actual = event[key2];
|
|
20164
|
+
}
|
|
20165
|
+
if (actual == null && expected === false) {
|
|
20166
|
+
continue;
|
|
20167
|
+
}
|
|
20168
|
+
if (actual !== expected) {
|
|
20169
|
+
return false;
|
|
20170
|
+
}
|
|
20171
|
+
}
|
|
20172
|
+
return true;
|
|
20173
|
+
}
|
|
20174
|
+
function toKeyCode(name2) {
|
|
20175
|
+
name2 = toKeyName(name2);
|
|
20176
|
+
var code = CODES[name2] || name2.toUpperCase().charCodeAt(0);
|
|
20177
|
+
return code;
|
|
20178
|
+
}
|
|
20179
|
+
function toKeyName(name2) {
|
|
20180
|
+
name2 = name2.toLowerCase();
|
|
20181
|
+
name2 = ALIASES[name2] || name2;
|
|
20182
|
+
return name2;
|
|
20183
|
+
}
|
|
20184
|
+
lib$1.default = isHotkey$1;
|
|
20185
|
+
lib$1.isHotkey = isHotkey$1;
|
|
20186
|
+
lib$1.isCodeHotkey = isCodeHotkey;
|
|
20187
|
+
var isKeyHotkey_1 = lib$1.isKeyHotkey = isKeyHotkey;
|
|
20188
|
+
lib$1.parseHotkey = parseHotkey;
|
|
20189
|
+
lib$1.compareHotkey = compareHotkey;
|
|
20190
|
+
lib$1.toKeyCode = toKeyCode;
|
|
20191
|
+
lib$1.toKeyName = toKeyName;
|
|
20192
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
|
|
20193
|
+
return typeof obj;
|
|
20194
|
+
} : function(obj) {
|
|
20195
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
20196
|
+
};
|
|
20197
|
+
var isBrowser = (typeof window === "undefined" ? "undefined" : _typeof(window)) === "object" && (typeof document === "undefined" ? "undefined" : _typeof(document)) === "object" && document.nodeType === 9;
|
|
20198
|
+
var slicedToArray$1 = function() {
|
|
20199
|
+
function sliceIterator(arr, i) {
|
|
20200
|
+
var _arr = [];
|
|
20201
|
+
var _n = true;
|
|
20202
|
+
var _d = false;
|
|
20203
|
+
var _e = void 0;
|
|
20204
|
+
try {
|
|
20205
|
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
|
20206
|
+
_arr.push(_s.value);
|
|
20207
|
+
if (i && _arr.length === i)
|
|
20208
|
+
break;
|
|
20209
|
+
}
|
|
20210
|
+
} catch (err) {
|
|
20211
|
+
_d = true;
|
|
20212
|
+
_e = err;
|
|
20213
|
+
} finally {
|
|
20214
|
+
try {
|
|
20215
|
+
if (!_n && _i["return"])
|
|
20216
|
+
_i["return"]();
|
|
20217
|
+
} finally {
|
|
20218
|
+
if (_d)
|
|
20219
|
+
throw _e;
|
|
20220
|
+
}
|
|
20221
|
+
}
|
|
20222
|
+
return _arr;
|
|
20223
|
+
}
|
|
20224
|
+
return function(arr, i) {
|
|
20225
|
+
if (Array.isArray(arr)) {
|
|
20226
|
+
return arr;
|
|
20227
|
+
} else if (Symbol.iterator in Object(arr)) {
|
|
20228
|
+
return sliceIterator(arr, i);
|
|
20229
|
+
} else {
|
|
20230
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
20231
|
+
}
|
|
20232
|
+
};
|
|
20233
|
+
}();
|
|
20234
|
+
var BROWSER_RULES = [["edge", /Edge\/([0-9\._]+)/], ["chrome", /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/], ["firefox", /Firefox\/([0-9\.]+)(?:\s|$)/], ["opera", /Opera\/([0-9\.]+)(?:\s|$)/], ["opera", /OPR\/([0-9\.]+)(:?\s|$)$/], ["ie", /Trident\/7\.0.*rv\:([0-9\.]+)\).*Gecko$/], ["ie", /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/], ["ie", /MSIE\s(7\.0)/], ["android", /Android\s([0-9\.]+)/], ["safari", /Version\/([0-9\._]+).*Safari/]];
|
|
20235
|
+
var browser = void 0;
|
|
20236
|
+
if (isBrowser) {
|
|
20237
|
+
var _iteratorNormalCompletion = true;
|
|
20238
|
+
var _didIteratorError = false;
|
|
20239
|
+
var _iteratorError = void 0;
|
|
20240
|
+
try {
|
|
20241
|
+
for (var _iterator = BROWSER_RULES[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
20242
|
+
var _ref = _step.value;
|
|
20243
|
+
var _ref2 = slicedToArray$1(_ref, 2);
|
|
20244
|
+
var name = _ref2[0];
|
|
20245
|
+
var regexp = _ref2[1];
|
|
20246
|
+
if (regexp.test(window.navigator.userAgent)) {
|
|
20247
|
+
browser = name;
|
|
20248
|
+
break;
|
|
20249
|
+
}
|
|
20250
|
+
}
|
|
20251
|
+
} catch (err) {
|
|
20252
|
+
_didIteratorError = true;
|
|
20253
|
+
_iteratorError = err;
|
|
20254
|
+
} finally {
|
|
20255
|
+
try {
|
|
20256
|
+
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
20257
|
+
_iterator.return();
|
|
20258
|
+
}
|
|
20259
|
+
} finally {
|
|
20260
|
+
if (_didIteratorError) {
|
|
20261
|
+
throw _iteratorError;
|
|
20262
|
+
}
|
|
20263
|
+
}
|
|
20264
|
+
}
|
|
20265
|
+
}
|
|
20266
|
+
var OS_RULES = [
|
|
20267
|
+
["ios", /os ([\.\_\d]+) like mac os/i],
|
|
20268
|
+
["macos", /mac os x/i],
|
|
20269
|
+
["android", /android/i],
|
|
20270
|
+
["firefoxos", /mozilla\/[a-z\.\_\d]+ \((?:mobile)|(?:tablet)/i],
|
|
20271
|
+
["windows", /windows\s*(?:nt)?\s*([\.\_\d]+)/i]
|
|
20272
|
+
];
|
|
20273
|
+
var os = void 0;
|
|
20274
|
+
if (isBrowser) {
|
|
20275
|
+
var _iteratorNormalCompletion2 = true;
|
|
20276
|
+
var _didIteratorError2 = false;
|
|
20277
|
+
var _iteratorError2 = void 0;
|
|
20278
|
+
try {
|
|
20279
|
+
for (var _iterator2 = OS_RULES[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
20280
|
+
var _ref3 = _step2.value;
|
|
20281
|
+
var _ref4 = slicedToArray$1(_ref3, 2);
|
|
20282
|
+
var _name = _ref4[0];
|
|
20283
|
+
var _regexp = _ref4[1];
|
|
20284
|
+
if (_regexp.test(window.navigator.userAgent)) {
|
|
20285
|
+
os = _name;
|
|
20286
|
+
break;
|
|
20287
|
+
}
|
|
20288
|
+
}
|
|
20289
|
+
} catch (err) {
|
|
20290
|
+
_didIteratorError2 = true;
|
|
20291
|
+
_iteratorError2 = err;
|
|
20292
|
+
} finally {
|
|
20293
|
+
try {
|
|
20294
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return) {
|
|
20295
|
+
_iterator2.return();
|
|
20296
|
+
}
|
|
20297
|
+
} finally {
|
|
20298
|
+
if (_didIteratorError2) {
|
|
20299
|
+
throw _iteratorError2;
|
|
20300
|
+
}
|
|
20301
|
+
}
|
|
20302
|
+
}
|
|
20303
|
+
}
|
|
20304
|
+
var FEATURE_RULES = [["inputeventslevel1", function(window2) {
|
|
20305
|
+
var event = window2.InputEvent ? new window2.InputEvent("input") : {};
|
|
20306
|
+
var support = "inputType" in event;
|
|
20307
|
+
return support;
|
|
20308
|
+
}], ["inputeventslevel2", function(window2) {
|
|
20309
|
+
var element = window2.document.createElement("div");
|
|
20310
|
+
element.contentEditable = true;
|
|
20311
|
+
var support = "onbeforeinput" in element;
|
|
20312
|
+
return support;
|
|
20313
|
+
}]];
|
|
20314
|
+
var features = [];
|
|
20315
|
+
if (isBrowser) {
|
|
20316
|
+
var _iteratorNormalCompletion3 = true;
|
|
20317
|
+
var _didIteratorError3 = false;
|
|
20318
|
+
var _iteratorError3 = void 0;
|
|
20319
|
+
try {
|
|
20320
|
+
for (var _iterator3 = FEATURE_RULES[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
|
20321
|
+
var _ref5 = _step3.value;
|
|
20322
|
+
var _ref6 = slicedToArray$1(_ref5, 2);
|
|
20323
|
+
var _name2 = _ref6[0];
|
|
20324
|
+
var test = _ref6[1];
|
|
20325
|
+
if (test(window)) {
|
|
20326
|
+
features.push(_name2);
|
|
20327
|
+
}
|
|
20328
|
+
}
|
|
20329
|
+
} catch (err) {
|
|
20330
|
+
_didIteratorError3 = true;
|
|
20331
|
+
_iteratorError3 = err;
|
|
20332
|
+
} finally {
|
|
20333
|
+
try {
|
|
20334
|
+
if (!_iteratorNormalCompletion3 && _iterator3.return) {
|
|
20335
|
+
_iterator3.return();
|
|
20336
|
+
}
|
|
20337
|
+
} finally {
|
|
20338
|
+
if (_didIteratorError3) {
|
|
20339
|
+
throw _iteratorError3;
|
|
20340
|
+
}
|
|
20341
|
+
}
|
|
20342
|
+
}
|
|
20343
|
+
}
|
|
20344
|
+
var ANDROID_API_VERSIONS = [[/^9([.]0|)/, 28], [/^8[.]1/, 27], [/^8([.]0|)/, 26], [/^7[.]1/, 25], [/^7([.]0|)/, 24], [/^6([.]0|)/, 23], [/^5[.]1/, 22], [/^5([.]0|)/, 21], [/^4[.]4/, 20]];
|
|
20345
|
+
function getAndroidApiVersion() {
|
|
20346
|
+
if (os !== "android")
|
|
20347
|
+
return null;
|
|
20348
|
+
var userAgent = window.navigator.userAgent;
|
|
20349
|
+
var matchData = userAgent.match(/Android\s([0-9\.]+)/);
|
|
20350
|
+
if (matchData == null)
|
|
20351
|
+
return null;
|
|
20352
|
+
var versionString = matchData[1];
|
|
20353
|
+
var _iteratorNormalCompletion4 = true;
|
|
20354
|
+
var _didIteratorError4 = false;
|
|
20355
|
+
var _iteratorError4 = void 0;
|
|
20356
|
+
try {
|
|
20357
|
+
for (var _iterator4 = ANDROID_API_VERSIONS[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
|
|
20358
|
+
var _ref7 = _step4.value;
|
|
20359
|
+
var _ref8 = slicedToArray$1(_ref7, 2);
|
|
20360
|
+
var regex = _ref8[0];
|
|
20361
|
+
var version = _ref8[1];
|
|
20362
|
+
if (versionString.match(regex))
|
|
20363
|
+
return version;
|
|
20364
|
+
}
|
|
20365
|
+
} catch (err) {
|
|
20366
|
+
_didIteratorError4 = true;
|
|
20367
|
+
_iteratorError4 = err;
|
|
20368
|
+
} finally {
|
|
20369
|
+
try {
|
|
20370
|
+
if (!_iteratorNormalCompletion4 && _iterator4.return) {
|
|
20371
|
+
_iterator4.return();
|
|
20372
|
+
}
|
|
20373
|
+
} finally {
|
|
20374
|
+
if (_didIteratorError4) {
|
|
20375
|
+
throw _iteratorError4;
|
|
20376
|
+
}
|
|
20377
|
+
}
|
|
20378
|
+
}
|
|
20379
|
+
return null;
|
|
20380
|
+
}
|
|
20381
|
+
var IS_IOS = os === "ios";
|
|
20382
|
+
var IS_MAC = os === "macos";
|
|
20383
|
+
getAndroidApiVersion();
|
|
20384
|
+
var HOTKEYS = {
|
|
20385
|
+
bold: "mod+b",
|
|
20386
|
+
compose: ["down", "left", "right", "up", "backspace", "enter"],
|
|
20387
|
+
moveBackward: "left",
|
|
20388
|
+
moveForward: "right",
|
|
20389
|
+
moveWordBackward: "ctrl+left",
|
|
20390
|
+
moveWordForward: "ctrl+right",
|
|
20391
|
+
deleteBackward: "shift?+backspace",
|
|
20392
|
+
deleteForward: "shift?+delete",
|
|
20393
|
+
extendBackward: "shift+left",
|
|
20394
|
+
extendForward: "shift+right",
|
|
20395
|
+
italic: "mod+i",
|
|
20396
|
+
splitBlock: "shift?+enter",
|
|
20397
|
+
undo: "mod+z"
|
|
20398
|
+
};
|
|
20399
|
+
var APPLE_HOTKEYS = {
|
|
20400
|
+
moveLineBackward: "opt+up",
|
|
20401
|
+
moveLineForward: "opt+down",
|
|
20402
|
+
moveWordBackward: "opt+left",
|
|
20403
|
+
moveWordForward: "opt+right",
|
|
20404
|
+
deleteBackward: ["ctrl+backspace", "ctrl+h"],
|
|
20405
|
+
deleteForward: ["ctrl+delete", "ctrl+d"],
|
|
20406
|
+
deleteLineBackward: "cmd+shift?+backspace",
|
|
20407
|
+
deleteLineForward: ["cmd+shift?+delete", "ctrl+k"],
|
|
20408
|
+
deleteWordBackward: "opt+shift?+backspace",
|
|
20409
|
+
deleteWordForward: "opt+shift?+delete",
|
|
20410
|
+
extendLineBackward: "opt+shift+up",
|
|
20411
|
+
extendLineForward: "opt+shift+down",
|
|
20412
|
+
redo: "cmd+shift+z",
|
|
20413
|
+
transposeCharacter: "ctrl+t"
|
|
20414
|
+
};
|
|
20415
|
+
var WINDOWS_HOTKEYS = {
|
|
20416
|
+
deleteWordBackward: "ctrl+shift?+backspace",
|
|
20417
|
+
deleteWordForward: "ctrl+shift?+delete",
|
|
20418
|
+
redo: "ctrl+y"
|
|
20419
|
+
};
|
|
20420
|
+
var Hotkeys = {};
|
|
20421
|
+
var IS_APPLE = IS_IOS || IS_MAC;
|
|
20422
|
+
var IS_WINDOWS = !IS_APPLE;
|
|
20423
|
+
var KEYS = [].concat(Object.keys(HOTKEYS)).concat(Object.keys(APPLE_HOTKEYS)).concat(Object.keys(WINDOWS_HOTKEYS));
|
|
20424
|
+
KEYS.forEach(function(key2) {
|
|
20425
|
+
var method = "is" + key2[0].toUpperCase() + key2.slice(1);
|
|
20426
|
+
if (Hotkeys[method])
|
|
20427
|
+
return;
|
|
20428
|
+
var generic = HOTKEYS[key2];
|
|
20429
|
+
var apple = APPLE_HOTKEYS[key2];
|
|
20430
|
+
var windows = WINDOWS_HOTKEYS[key2];
|
|
20431
|
+
var isGeneric = generic && isKeyHotkey_1(generic);
|
|
20432
|
+
var isApple = apple && isKeyHotkey_1(apple);
|
|
20433
|
+
var isWindows = windows && isKeyHotkey_1(windows);
|
|
20434
|
+
Hotkeys[method] = function(event) {
|
|
20435
|
+
if (isGeneric && isGeneric(event))
|
|
20436
|
+
return true;
|
|
20437
|
+
if (IS_APPLE && isApple && isApple(event))
|
|
20438
|
+
return true;
|
|
20439
|
+
if (IS_WINDOWS && isWindows && isWindows(event))
|
|
20440
|
+
return true;
|
|
20441
|
+
return false;
|
|
20442
|
+
};
|
|
20443
|
+
});
|
|
20444
|
+
function _defineProperty(obj, key2, value) {
|
|
20445
|
+
if (key2 in obj) {
|
|
20446
|
+
Object.defineProperty(obj, key2, {
|
|
20447
|
+
value,
|
|
20448
|
+
enumerable: true,
|
|
20449
|
+
configurable: true,
|
|
20450
|
+
writable: true
|
|
20451
|
+
});
|
|
20452
|
+
} else {
|
|
20453
|
+
obj[key2] = value;
|
|
20454
|
+
}
|
|
20455
|
+
return obj;
|
|
20456
|
+
}
|
|
20457
|
+
var defineProperty = _defineProperty;
|
|
20458
|
+
function _defineProperty$1(obj, key2, value) {
|
|
20459
|
+
if (key2 in obj) {
|
|
20460
|
+
Object.defineProperty(obj, key2, {
|
|
20461
|
+
value,
|
|
20462
|
+
enumerable: true,
|
|
20463
|
+
configurable: true,
|
|
20464
|
+
writable: true
|
|
20465
|
+
});
|
|
20466
|
+
} else {
|
|
20467
|
+
obj[key2] = value;
|
|
20468
|
+
}
|
|
20469
|
+
return obj;
|
|
20470
|
+
}
|
|
20471
|
+
function _objectSpread(target) {
|
|
20472
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
20473
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
20474
|
+
var ownKeys2 = Object.keys(source);
|
|
20475
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
20476
|
+
ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20477
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
20478
|
+
}));
|
|
20479
|
+
}
|
|
20480
|
+
ownKeys2.forEach(function(key2) {
|
|
20481
|
+
_defineProperty$1(target, key2, source[key2]);
|
|
20482
|
+
});
|
|
20483
|
+
}
|
|
20484
|
+
return target;
|
|
20485
|
+
}
|
|
20486
|
+
function unwrapExports(x) {
|
|
20487
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x;
|
|
20488
|
+
}
|
|
20489
|
+
function createCommonjsModule(fn, module) {
|
|
20490
|
+
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
20491
|
+
}
|
|
20492
|
+
var lib = createCommonjsModule(function(module, exports2) {
|
|
20493
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
20494
|
+
value: true
|
|
20495
|
+
});
|
|
20496
|
+
var IS_MAC2 = typeof window != "undefined" && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
|
|
20497
|
+
var MODIFIERS2 = {
|
|
20498
|
+
alt: "altKey",
|
|
20499
|
+
control: "ctrlKey",
|
|
20500
|
+
meta: "metaKey",
|
|
20501
|
+
shift: "shiftKey"
|
|
20502
|
+
};
|
|
20503
|
+
var ALIASES2 = {
|
|
20504
|
+
add: "+",
|
|
20505
|
+
break: "pause",
|
|
20506
|
+
cmd: "meta",
|
|
20507
|
+
command: "meta",
|
|
20508
|
+
ctl: "control",
|
|
20509
|
+
ctrl: "control",
|
|
20510
|
+
del: "delete",
|
|
20511
|
+
down: "arrowdown",
|
|
20512
|
+
esc: "escape",
|
|
20513
|
+
ins: "insert",
|
|
20514
|
+
left: "arrowleft",
|
|
20515
|
+
mod: IS_MAC2 ? "meta" : "control",
|
|
20516
|
+
opt: "alt",
|
|
20517
|
+
option: "alt",
|
|
20518
|
+
return: "enter",
|
|
20519
|
+
right: "arrowright",
|
|
20520
|
+
space: " ",
|
|
20521
|
+
spacebar: " ",
|
|
20522
|
+
up: "arrowup",
|
|
20523
|
+
win: "meta",
|
|
20524
|
+
windows: "meta"
|
|
20525
|
+
};
|
|
20526
|
+
var CODES2 = {
|
|
20527
|
+
backspace: 8,
|
|
20528
|
+
tab: 9,
|
|
20529
|
+
enter: 13,
|
|
20530
|
+
shift: 16,
|
|
20531
|
+
control: 17,
|
|
20532
|
+
alt: 18,
|
|
20533
|
+
pause: 19,
|
|
20534
|
+
capslock: 20,
|
|
20535
|
+
escape: 27,
|
|
20536
|
+
" ": 32,
|
|
20537
|
+
pageup: 33,
|
|
20538
|
+
pagedown: 34,
|
|
20539
|
+
end: 35,
|
|
20540
|
+
home: 36,
|
|
20541
|
+
arrowleft: 37,
|
|
20542
|
+
arrowup: 38,
|
|
20543
|
+
arrowright: 39,
|
|
20544
|
+
arrowdown: 40,
|
|
20545
|
+
insert: 45,
|
|
20546
|
+
delete: 46,
|
|
20547
|
+
meta: 91,
|
|
20548
|
+
numlock: 144,
|
|
20549
|
+
scrolllock: 145,
|
|
20550
|
+
";": 186,
|
|
20551
|
+
"=": 187,
|
|
20552
|
+
",": 188,
|
|
20553
|
+
"-": 189,
|
|
20554
|
+
".": 190,
|
|
20555
|
+
"/": 191,
|
|
20556
|
+
"`": 192,
|
|
20557
|
+
"[": 219,
|
|
20558
|
+
"\\": 220,
|
|
20559
|
+
"]": 221,
|
|
20560
|
+
"'": 222
|
|
20561
|
+
};
|
|
20562
|
+
for (var f2 = 1; f2 < 20; f2++) {
|
|
20563
|
+
CODES2["f" + f2] = 111 + f2;
|
|
20564
|
+
}
|
|
20565
|
+
function isHotkey2(hotkey, options, event) {
|
|
20566
|
+
if (options && !("byKey" in options)) {
|
|
20567
|
+
event = options;
|
|
20568
|
+
options = null;
|
|
20569
|
+
}
|
|
20570
|
+
if (!Array.isArray(hotkey)) {
|
|
20571
|
+
hotkey = [hotkey];
|
|
20572
|
+
}
|
|
20573
|
+
var array2 = hotkey.map(function(string2) {
|
|
20574
|
+
return parseHotkey2(string2, options);
|
|
20575
|
+
});
|
|
20576
|
+
var check = function check2(e2) {
|
|
20577
|
+
return array2.some(function(object2) {
|
|
20578
|
+
return compareHotkey2(object2, e2);
|
|
20579
|
+
});
|
|
20580
|
+
};
|
|
20581
|
+
var ret = event == null ? check : check(event);
|
|
20582
|
+
return ret;
|
|
20583
|
+
}
|
|
20584
|
+
function isCodeHotkey2(hotkey, event) {
|
|
20585
|
+
return isHotkey2(hotkey, event);
|
|
20586
|
+
}
|
|
20587
|
+
function isKeyHotkey2(hotkey, event) {
|
|
20588
|
+
return isHotkey2(hotkey, { byKey: true }, event);
|
|
20589
|
+
}
|
|
20590
|
+
function parseHotkey2(hotkey, options) {
|
|
20591
|
+
var byKey = options && options.byKey;
|
|
20592
|
+
var ret = {};
|
|
20593
|
+
hotkey = hotkey.replace("++", "+add");
|
|
20594
|
+
var values = hotkey.split("+");
|
|
20595
|
+
var length = values.length;
|
|
20596
|
+
for (var k in MODIFIERS2) {
|
|
20597
|
+
ret[MODIFIERS2[k]] = false;
|
|
20598
|
+
}
|
|
20599
|
+
var _iteratorNormalCompletion4 = true;
|
|
20600
|
+
var _didIteratorError4 = false;
|
|
20601
|
+
var _iteratorError4 = void 0;
|
|
20602
|
+
try {
|
|
20603
|
+
for (var _iterator4 = values[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
|
|
20604
|
+
var value = _step4.value;
|
|
20605
|
+
var optional = value.endsWith("?");
|
|
20606
|
+
if (optional) {
|
|
20607
|
+
value = value.slice(0, -1);
|
|
20608
|
+
}
|
|
20609
|
+
var name2 = toKeyName2(value);
|
|
20610
|
+
var modifier = MODIFIERS2[name2];
|
|
20611
|
+
if (length === 1 || !modifier) {
|
|
20612
|
+
if (byKey) {
|
|
20613
|
+
ret.key = name2;
|
|
20614
|
+
} else {
|
|
20615
|
+
ret.which = toKeyCode2(value);
|
|
20616
|
+
}
|
|
20617
|
+
}
|
|
20618
|
+
if (modifier) {
|
|
20619
|
+
ret[modifier] = optional ? null : true;
|
|
20620
|
+
}
|
|
20621
|
+
}
|
|
20622
|
+
} catch (err) {
|
|
20623
|
+
_didIteratorError4 = true;
|
|
20624
|
+
_iteratorError4 = err;
|
|
20625
|
+
} finally {
|
|
20626
|
+
try {
|
|
20627
|
+
if (!_iteratorNormalCompletion4 && _iterator4.return) {
|
|
20628
|
+
_iterator4.return();
|
|
20629
|
+
}
|
|
20630
|
+
} finally {
|
|
20631
|
+
if (_didIteratorError4) {
|
|
20632
|
+
throw _iteratorError4;
|
|
20633
|
+
}
|
|
20634
|
+
}
|
|
20635
|
+
}
|
|
20636
|
+
return ret;
|
|
20637
|
+
}
|
|
20638
|
+
function compareHotkey2(object2, event) {
|
|
20639
|
+
for (var key2 in object2) {
|
|
20640
|
+
var expected = object2[key2];
|
|
20641
|
+
var actual = void 0;
|
|
20642
|
+
if (expected == null) {
|
|
20643
|
+
continue;
|
|
20644
|
+
}
|
|
20645
|
+
if (key2 === "key") {
|
|
20646
|
+
actual = event.key.toLowerCase();
|
|
20647
|
+
} else if (key2 === "which") {
|
|
20648
|
+
actual = expected === 91 && event.which === 93 ? 91 : event.which;
|
|
20649
|
+
} else {
|
|
20650
|
+
actual = event[key2];
|
|
20651
|
+
}
|
|
20652
|
+
if (actual == null && expected === false) {
|
|
20653
|
+
continue;
|
|
20654
|
+
}
|
|
20655
|
+
if (actual !== expected) {
|
|
20656
|
+
return false;
|
|
20657
|
+
}
|
|
20658
|
+
}
|
|
20659
|
+
return true;
|
|
20660
|
+
}
|
|
20661
|
+
function toKeyCode2(name2) {
|
|
20662
|
+
name2 = toKeyName2(name2);
|
|
20663
|
+
var code = CODES2[name2] || name2.toUpperCase().charCodeAt(0);
|
|
20664
|
+
return code;
|
|
20665
|
+
}
|
|
20666
|
+
function toKeyName2(name2) {
|
|
20667
|
+
name2 = name2.toLowerCase();
|
|
20668
|
+
name2 = ALIASES2[name2] || name2;
|
|
20669
|
+
return name2;
|
|
20670
|
+
}
|
|
20671
|
+
exports2.default = isHotkey2;
|
|
20672
|
+
exports2.isHotkey = isHotkey2;
|
|
20673
|
+
exports2.isCodeHotkey = isCodeHotkey2;
|
|
20674
|
+
exports2.isKeyHotkey = isKeyHotkey2;
|
|
20675
|
+
exports2.parseHotkey = parseHotkey2;
|
|
20676
|
+
exports2.compareHotkey = compareHotkey2;
|
|
20677
|
+
exports2.toKeyCode = toKeyCode2;
|
|
20678
|
+
exports2.toKeyName = toKeyName2;
|
|
20679
|
+
});
|
|
20680
|
+
var isHotkey = unwrapExports(lib);
|
|
20681
|
+
lib.isHotkey;
|
|
20682
|
+
lib.isCodeHotkey;
|
|
20683
|
+
lib.isKeyHotkey;
|
|
20684
|
+
lib.parseHotkey;
|
|
20685
|
+
lib.compareHotkey;
|
|
20686
|
+
lib.toKeyCode;
|
|
20687
|
+
lib.toKeyName;
|
|
20688
|
+
var Keymap = function Keymap2(shortcuts, options) {
|
|
20689
|
+
var config = _objectSpread({
|
|
20690
|
+
if: function _if() {
|
|
20691
|
+
return true;
|
|
20692
|
+
}
|
|
20693
|
+
}, options);
|
|
20694
|
+
var functions = Object.keys(shortcuts).map(function(key2) {
|
|
20695
|
+
var isKeyPressed = isHotkey(key2);
|
|
20696
|
+
var command = shortcuts[key2];
|
|
20697
|
+
var check = function check2(event, editor) {
|
|
20698
|
+
return isKeyPressed(event) && config.if(editor);
|
|
20699
|
+
};
|
|
20700
|
+
var handler = typeof command == "string" ? function(event, editor) {
|
|
20701
|
+
event.preventDefault();
|
|
20702
|
+
editor.command(command);
|
|
20703
|
+
} : command;
|
|
20704
|
+
return {
|
|
20705
|
+
check,
|
|
20706
|
+
handler
|
|
20707
|
+
};
|
|
20708
|
+
});
|
|
20709
|
+
return {
|
|
20710
|
+
onKeyDown: function onKeyDown(event, editor, next) {
|
|
20711
|
+
var shortcut = functions.find(function(shortcut2) {
|
|
20712
|
+
return shortcut2.check(event, editor);
|
|
20713
|
+
});
|
|
20714
|
+
if (shortcut) {
|
|
20715
|
+
return shortcut.handler(event, editor, next);
|
|
20716
|
+
} else {
|
|
20717
|
+
return next();
|
|
20718
|
+
}
|
|
20719
|
+
}
|
|
20720
|
+
};
|
|
20721
|
+
};
|
|
20722
|
+
var isList = function isList2(blocks, block) {
|
|
20723
|
+
return block.type == blocks.unordered_list || block.type == blocks.ordered_list;
|
|
20724
|
+
};
|
|
20725
|
+
var wrapList = function(_ref7, editor) {
|
|
20726
|
+
var blocks = _ref7.blocks;
|
|
20727
|
+
var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
20728
|
+
var type = options.type || blocks.unordered_list;
|
|
20729
|
+
var rootBlocks = editor.value.document.getRootBlocksAtRange(editor.value.selection);
|
|
20730
|
+
editor.withoutNormalizing(function() {
|
|
20731
|
+
rootBlocks.forEach(function(block) {
|
|
20732
|
+
if (isList(blocks, block))
|
|
20733
|
+
return;
|
|
20734
|
+
editor.wrapBlockByKey(block.key, type);
|
|
20735
|
+
editor.wrapBlockByKey(block.key, blocks.list_item);
|
|
20736
|
+
editor.setNodeByKey(block.key, blocks.list_item_child);
|
|
20737
|
+
});
|
|
20738
|
+
});
|
|
20739
|
+
};
|
|
20740
|
+
var unwrapListByKey = function(_ref7, editor, key2) {
|
|
20741
|
+
var blocks = _ref7.blocks;
|
|
20742
|
+
var listItem = editor.value.document.getNode(key2);
|
|
20743
|
+
editor.withoutNormalizing(function() {
|
|
20744
|
+
editor.unwrapNodeByKey(listItem.key);
|
|
20745
|
+
var parent = editor.value.document.getParent(listItem.key);
|
|
20746
|
+
var itemIndex = parent.nodes.findIndex(function(node2) {
|
|
20747
|
+
return node2.key === listItem.key;
|
|
20748
|
+
});
|
|
20749
|
+
listItem.nodes.forEach(function(itemChild, index2) {
|
|
20750
|
+
editor.moveNodeByKey(itemChild.key, parent.key, index2 + itemIndex);
|
|
20751
|
+
if (itemChild.type == blocks.list_item_child) {
|
|
20752
|
+
editor.setNodeByKey(itemChild.key, {
|
|
20753
|
+
type: blocks["default"]
|
|
20754
|
+
});
|
|
20755
|
+
}
|
|
20756
|
+
});
|
|
20757
|
+
editor.removeNodeByKey(listItem.key);
|
|
20758
|
+
});
|
|
20759
|
+
};
|
|
20760
|
+
var unwrapList = function(_ref7, editor) {
|
|
20761
|
+
var blocks = _ref7.blocks;
|
|
20762
|
+
var listItemChildren = editor.value.document.getNodesAtRange(editor.value.selection).filter(function(node2) {
|
|
20763
|
+
return node2.type == blocks.list_item_child;
|
|
20764
|
+
});
|
|
20765
|
+
var furthestListItems = listItemChildren.map(function(listItemChild) {
|
|
20766
|
+
return editor.value.document.getFurthest(listItemChild.key, function(node2) {
|
|
20767
|
+
return node2.type == blocks.list_item;
|
|
20768
|
+
});
|
|
20769
|
+
}).filter(function(listItemChild, index2, array2) {
|
|
20770
|
+
return array2.indexOf(listItemChild) == index2;
|
|
20771
|
+
});
|
|
20772
|
+
furthestListItems.forEach(function(listItem) {
|
|
20773
|
+
unwrapListByKey({
|
|
20774
|
+
blocks
|
|
20775
|
+
}, editor, listItem.key);
|
|
20776
|
+
});
|
|
20777
|
+
};
|
|
20778
|
+
var toggleList = function(_ref7, editor) {
|
|
20779
|
+
var blocks = _ref7.blocks;
|
|
20780
|
+
var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
20781
|
+
var _editor$value = editor.value, document2 = _editor$value.document, startBlock = _editor$value.startBlock;
|
|
20782
|
+
var type = options.type || blocks.unordered_list;
|
|
20783
|
+
var parent = document2.getParent(startBlock.key);
|
|
20784
|
+
var isList3 = parent.type == blocks.list_item;
|
|
20785
|
+
if (!isList3)
|
|
20786
|
+
return editor.wrapList({
|
|
20787
|
+
type
|
|
20788
|
+
});
|
|
20789
|
+
var list = document2.getParent(parent.key);
|
|
20790
|
+
var sameType3 = list.type == type;
|
|
20791
|
+
if (sameType3) {
|
|
20792
|
+
editor.unwrapList();
|
|
20793
|
+
} else {
|
|
20794
|
+
editor.setNodeByKey(list.key, type);
|
|
20795
|
+
}
|
|
20796
|
+
};
|
|
20797
|
+
var decreaseListItemDepth = function(_ref7, editor) {
|
|
20798
|
+
var blocks = _ref7.blocks;
|
|
20799
|
+
var _editor$value = editor.value, document2 = _editor$value.document, startBlock = _editor$value.startBlock;
|
|
20800
|
+
var listItem = document2.getParent(startBlock.key);
|
|
20801
|
+
if (listItem.type != blocks.list_item)
|
|
20802
|
+
return;
|
|
20803
|
+
var list = document2.getParent(listItem.key);
|
|
20804
|
+
var parentListItem = document2.getParent(list.key);
|
|
20805
|
+
if (parentListItem.type != blocks.list_item)
|
|
20806
|
+
return;
|
|
20807
|
+
var parentList = document2.getParent(parentListItem.key);
|
|
20808
|
+
var index2 = parentList.nodes.indexOf(parentListItem);
|
|
20809
|
+
var otherItems = list.nodes.skipUntil(function(item) {
|
|
20810
|
+
return item === listItem;
|
|
20811
|
+
}).rest();
|
|
20812
|
+
if (!otherItems.isEmpty()) {
|
|
20813
|
+
var newList = slate.Block.create({
|
|
20814
|
+
object: "block",
|
|
20815
|
+
type: list.type
|
|
20816
|
+
});
|
|
20817
|
+
editor.withoutNormalizing(function() {
|
|
20818
|
+
editor.insertNodeByKey(listItem.key, listItem.nodes.size, newList);
|
|
20819
|
+
editor.moveNodeByKey(listItem.key, parentList.key, index2 + 1);
|
|
20820
|
+
otherItems.forEach(function(item, index3) {
|
|
20821
|
+
return editor.moveNodeByKey(item.key, newList.key, newList.nodes.size + index3);
|
|
20822
|
+
});
|
|
20823
|
+
});
|
|
20824
|
+
} else {
|
|
20825
|
+
editor.moveNodeByKey(listItem.key, parentList.key, index2 + 1);
|
|
20826
|
+
}
|
|
20827
|
+
};
|
|
20828
|
+
var increaseListItemDepth = function(_ref7, editor) {
|
|
20829
|
+
_ref7.blocks;
|
|
20830
|
+
var _editor$value = editor.value, document2 = _editor$value.document, startBlock = _editor$value.startBlock;
|
|
20831
|
+
var listItem = document2.getParent(startBlock.key);
|
|
20832
|
+
var previousListItem = document2.getPreviousSibling(listItem.key);
|
|
20833
|
+
var list = document2.getParent(listItem.key);
|
|
20834
|
+
if (!listItem)
|
|
20835
|
+
return;
|
|
20836
|
+
if (!previousListItem)
|
|
20837
|
+
return;
|
|
20838
|
+
var existingList = previousListItem.nodes.get(1);
|
|
20839
|
+
if (existingList) {
|
|
20840
|
+
editor.withoutNormalizing(function() {
|
|
20841
|
+
editor.moveNodeByKey(listItem.key, existingList.key, existingList.nodes.size);
|
|
20842
|
+
});
|
|
20843
|
+
} else {
|
|
20844
|
+
var newList = slate.Block.create({
|
|
20845
|
+
object: "block",
|
|
20846
|
+
type: list.type
|
|
20847
|
+
});
|
|
20848
|
+
editor.withoutNormalizing(function() {
|
|
20849
|
+
editor.insertNodeByKey(previousListItem.key, previousListItem.nodes.size, newList);
|
|
20850
|
+
editor.moveNodeByKey(listItem.key, newList.key, 0);
|
|
20851
|
+
});
|
|
20852
|
+
}
|
|
20853
|
+
};
|
|
20854
|
+
var wrapWithOptions = function wrapWithOptions2(fn, options) {
|
|
20855
|
+
return function() {
|
|
20856
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
20857
|
+
args[_key] = arguments[_key];
|
|
20858
|
+
}
|
|
20859
|
+
return fn.apply(void 0, [options].concat(args));
|
|
20860
|
+
};
|
|
20861
|
+
};
|
|
20862
|
+
var createCommands = function(options) {
|
|
20863
|
+
return {
|
|
20864
|
+
wrapList: wrapWithOptions(wrapList, options),
|
|
20865
|
+
unwrapList: wrapWithOptions(unwrapList, options),
|
|
20866
|
+
toggleList: wrapWithOptions(toggleList, options),
|
|
20867
|
+
unwrapListByKey: wrapWithOptions(unwrapListByKey, options),
|
|
20868
|
+
decreaseListItemDepth: wrapWithOptions(decreaseListItemDepth, options),
|
|
20869
|
+
increaseListItemDepth: wrapWithOptions(increaseListItemDepth, options)
|
|
20870
|
+
};
|
|
20871
|
+
};
|
|
20872
|
+
function _arrayWithHoles(arr) {
|
|
20873
|
+
if (Array.isArray(arr))
|
|
20874
|
+
return arr;
|
|
20875
|
+
}
|
|
20876
|
+
var arrayWithHoles = _arrayWithHoles;
|
|
20877
|
+
function _iterableToArrayLimit(arr, i) {
|
|
20878
|
+
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr)))
|
|
20879
|
+
return;
|
|
20880
|
+
var _arr = [];
|
|
20881
|
+
var _n = true;
|
|
20882
|
+
var _d = false;
|
|
20883
|
+
var _e = void 0;
|
|
20884
|
+
try {
|
|
20885
|
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
|
20886
|
+
_arr.push(_s.value);
|
|
20887
|
+
if (i && _arr.length === i)
|
|
20888
|
+
break;
|
|
20889
|
+
}
|
|
20890
|
+
} catch (err) {
|
|
20891
|
+
_d = true;
|
|
20892
|
+
_e = err;
|
|
20893
|
+
} finally {
|
|
20894
|
+
try {
|
|
20895
|
+
if (!_n && _i["return"] != null)
|
|
20896
|
+
_i["return"]();
|
|
20897
|
+
} finally {
|
|
20898
|
+
if (_d)
|
|
20899
|
+
throw _e;
|
|
20900
|
+
}
|
|
20901
|
+
}
|
|
20902
|
+
return _arr;
|
|
20903
|
+
}
|
|
20904
|
+
var iterableToArrayLimit = _iterableToArrayLimit;
|
|
20905
|
+
function _arrayLikeToArray(arr, len) {
|
|
20906
|
+
if (len == null || len > arr.length)
|
|
20907
|
+
len = arr.length;
|
|
20908
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
20909
|
+
arr2[i] = arr[i];
|
|
20910
|
+
}
|
|
20911
|
+
return arr2;
|
|
20912
|
+
}
|
|
20913
|
+
var arrayLikeToArray = _arrayLikeToArray;
|
|
20914
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
20915
|
+
if (!o)
|
|
20916
|
+
return;
|
|
20917
|
+
if (typeof o === "string")
|
|
20918
|
+
return arrayLikeToArray(o, minLen);
|
|
20919
|
+
var n2 = Object.prototype.toString.call(o).slice(8, -1);
|
|
20920
|
+
if (n2 === "Object" && o.constructor)
|
|
20921
|
+
n2 = o.constructor.name;
|
|
20922
|
+
if (n2 === "Map" || n2 === "Set")
|
|
20923
|
+
return Array.from(n2);
|
|
20924
|
+
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
|
|
20925
|
+
return arrayLikeToArray(o, minLen);
|
|
20926
|
+
}
|
|
20927
|
+
var unsupportedIterableToArray = _unsupportedIterableToArray;
|
|
20928
|
+
function _nonIterableRest() {
|
|
20929
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
20930
|
+
}
|
|
20931
|
+
var nonIterableRest = _nonIterableRest;
|
|
20932
|
+
function _slicedToArray(arr, i) {
|
|
20933
|
+
return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
|
|
20934
|
+
}
|
|
20935
|
+
var slicedToArray = _slicedToArray;
|
|
20936
|
+
var sameType = function sameType2(node2, other) {
|
|
20937
|
+
return node2.type == other.type;
|
|
20938
|
+
};
|
|
20939
|
+
var createNormalizeNode = function(_ref7) {
|
|
20940
|
+
var blocks = _ref7.blocks;
|
|
20941
|
+
var isList3 = function isList4(block) {
|
|
20942
|
+
return block && (block.type == blocks.unordered_list || block.type == blocks.ordered_list);
|
|
20943
|
+
};
|
|
20944
|
+
return function(node2, editor, next) {
|
|
20945
|
+
if (node2.object !== "document" && node2.object !== "block")
|
|
20946
|
+
return next();
|
|
20947
|
+
var mergable = node2.nodes.map(function(child, index2) {
|
|
20948
|
+
if (!isList3(child)) {
|
|
20949
|
+
return null;
|
|
20950
|
+
}
|
|
20951
|
+
var adjacent = node2.nodes.get(index2 + 1);
|
|
20952
|
+
if (!adjacent || !isList3(adjacent) || !sameType(child, adjacent)) {
|
|
20953
|
+
return null;
|
|
20954
|
+
}
|
|
20955
|
+
return [child, adjacent];
|
|
20956
|
+
}).filter(function(node3) {
|
|
20957
|
+
return node3;
|
|
20958
|
+
});
|
|
20959
|
+
if (mergable.isEmpty())
|
|
20960
|
+
return next();
|
|
20961
|
+
return function(editor2) {
|
|
20962
|
+
mergable.reverse().forEach(function(_ref22) {
|
|
20963
|
+
var _ref32 = slicedToArray(_ref22, 2), list = _ref32[0], adjacent = _ref32[1];
|
|
20964
|
+
var updatedAdjacent = editor2.value.document.getDescendant(adjacent.key);
|
|
20965
|
+
updatedAdjacent.nodes.forEach(function(child, index2) {
|
|
20966
|
+
editor2.withoutNormalizing(function() {
|
|
20967
|
+
editor2.moveNodeByKey(child.key, list.key, list.nodes.size + index2);
|
|
20968
|
+
});
|
|
20969
|
+
});
|
|
20970
|
+
editor2.withoutNormalizing(function() {
|
|
20971
|
+
editor2.removeNodeByKey(adjacent.key);
|
|
20972
|
+
});
|
|
20973
|
+
});
|
|
20974
|
+
};
|
|
20975
|
+
};
|
|
20976
|
+
};
|
|
20977
|
+
function createCommonjsModule$1(fn, module) {
|
|
20978
|
+
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
20979
|
+
}
|
|
20980
|
+
var _extends_1 = createCommonjsModule$1(function(module) {
|
|
20981
|
+
function _extends2() {
|
|
20982
|
+
module.exports = _extends2 = Object.assign || function(target) {
|
|
20983
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
20984
|
+
var source = arguments[i];
|
|
20985
|
+
for (var key2 in source) {
|
|
20986
|
+
if (Object.prototype.hasOwnProperty.call(source, key2)) {
|
|
20987
|
+
target[key2] = source[key2];
|
|
20988
|
+
}
|
|
20989
|
+
}
|
|
20990
|
+
}
|
|
20991
|
+
return target;
|
|
20992
|
+
};
|
|
20993
|
+
return _extends2.apply(this, arguments);
|
|
20994
|
+
}
|
|
20995
|
+
module.exports = _extends2;
|
|
20996
|
+
});
|
|
20997
|
+
var createRenderBlock = function(_ref7) {
|
|
20998
|
+
var blocks = _ref7.blocks, classNames = _ref7.classNames;
|
|
20999
|
+
return function(props2, editor, next) {
|
|
21000
|
+
var node2 = props2.node;
|
|
21001
|
+
switch (node2.type) {
|
|
21002
|
+
case blocks.unordered_list:
|
|
21003
|
+
return /* @__PURE__ */ React__default["default"].createElement("ul", _extends_1({
|
|
21004
|
+
className: classNames.unordered_list
|
|
21005
|
+
}, props2.attributes, {
|
|
21006
|
+
style: {
|
|
21007
|
+
listStylePosition: "inside"
|
|
21008
|
+
}
|
|
21009
|
+
}), props2.children);
|
|
21010
|
+
case blocks.ordered_list: {
|
|
21011
|
+
return /* @__PURE__ */ React__default["default"].createElement("ol", _extends_1({
|
|
21012
|
+
className: classNames.ordered_list
|
|
21013
|
+
}, props2.attributes, {
|
|
21014
|
+
style: {
|
|
21015
|
+
listStylePosition: "inside"
|
|
21016
|
+
}
|
|
21017
|
+
}), props2.children);
|
|
21018
|
+
}
|
|
21019
|
+
case blocks.list_item: {
|
|
21020
|
+
return /* @__PURE__ */ React__default["default"].createElement("li", _extends_1({
|
|
21021
|
+
className: classNames.list_item
|
|
21022
|
+
}, props2.attributes), props2.children);
|
|
21023
|
+
}
|
|
21024
|
+
case blocks.list_item_child: {
|
|
21025
|
+
return /* @__PURE__ */ React__default["default"].createElement("span", _extends_1({
|
|
21026
|
+
className: classNames.list_item_child
|
|
21027
|
+
}, props2.attributes), props2.children);
|
|
21028
|
+
}
|
|
21029
|
+
default:
|
|
21030
|
+
return next();
|
|
21031
|
+
}
|
|
21032
|
+
};
|
|
21033
|
+
};
|
|
21034
|
+
var createSchema = function(_ref7) {
|
|
21035
|
+
var _blocks;
|
|
21036
|
+
var blocks = _ref7.blocks;
|
|
21037
|
+
return {
|
|
21038
|
+
blocks: (_blocks = {}, defineProperty(_blocks, blocks.unordered_list, {
|
|
21039
|
+
nodes: [{
|
|
21040
|
+
match: {
|
|
21041
|
+
type: blocks.list_item
|
|
21042
|
+
}
|
|
21043
|
+
}]
|
|
21044
|
+
}), defineProperty(_blocks, blocks.ordered_list, {
|
|
21045
|
+
nodes: [{
|
|
21046
|
+
match: {
|
|
21047
|
+
type: blocks.list_item
|
|
21048
|
+
}
|
|
21049
|
+
}]
|
|
21050
|
+
}), defineProperty(_blocks, blocks.list_item, {
|
|
21051
|
+
parent: [{
|
|
21052
|
+
type: blocks.unordered_list
|
|
21053
|
+
}, {
|
|
21054
|
+
type: blocks.ordered_list
|
|
21055
|
+
}],
|
|
21056
|
+
nodes: [{
|
|
21057
|
+
match: {
|
|
21058
|
+
type: blocks.list_item_child
|
|
21059
|
+
},
|
|
21060
|
+
min: 1,
|
|
21061
|
+
max: 1
|
|
21062
|
+
}, {
|
|
21063
|
+
match: [{
|
|
21064
|
+
type: blocks.unordered_list
|
|
21065
|
+
}, {
|
|
21066
|
+
type: blocks.ordered_list
|
|
21067
|
+
}],
|
|
21068
|
+
min: 0,
|
|
21069
|
+
max: 1
|
|
21070
|
+
}],
|
|
21071
|
+
normalize: function normalize2(editor, error) {
|
|
21072
|
+
switch (error.code) {
|
|
21073
|
+
case "child_min_invalid":
|
|
21074
|
+
editor.insertNodeByKey(error.node.key, 0, slate.Block.create({
|
|
21075
|
+
type: blocks.list_item_child,
|
|
21076
|
+
nodes: [slate.Text.create()]
|
|
21077
|
+
}));
|
|
21078
|
+
return;
|
|
21079
|
+
case "child_type_invalid":
|
|
21080
|
+
editor.wrapBlockByKey(error.child.key, {
|
|
21081
|
+
type: blocks.list_item_child
|
|
21082
|
+
});
|
|
21083
|
+
return;
|
|
21084
|
+
case "parent_type_invalid":
|
|
21085
|
+
editor.wrapBlockByKey(error.node.key, blocks.unordered_list);
|
|
21086
|
+
return;
|
|
21087
|
+
default:
|
|
21088
|
+
return;
|
|
21089
|
+
}
|
|
21090
|
+
}
|
|
21091
|
+
}), _blocks)
|
|
21092
|
+
};
|
|
21093
|
+
};
|
|
21094
|
+
function ownKeys(object2, enumerableOnly) {
|
|
21095
|
+
var keys2 = Object.keys(object2);
|
|
21096
|
+
if (Object.getOwnPropertySymbols) {
|
|
21097
|
+
var symbols = Object.getOwnPropertySymbols(object2);
|
|
21098
|
+
if (enumerableOnly)
|
|
21099
|
+
symbols = symbols.filter(function(sym) {
|
|
21100
|
+
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
|
|
21101
|
+
});
|
|
21102
|
+
keys2.push.apply(keys2, symbols);
|
|
21103
|
+
}
|
|
21104
|
+
return keys2;
|
|
21105
|
+
}
|
|
21106
|
+
function _objectSpread$1(target) {
|
|
21107
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
21108
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
21109
|
+
if (i % 2) {
|
|
21110
|
+
ownKeys(Object(source), true).forEach(function(key2) {
|
|
21111
|
+
defineProperty(target, key2, source[key2]);
|
|
21112
|
+
});
|
|
21113
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
21114
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
21115
|
+
} else {
|
|
21116
|
+
ownKeys(Object(source)).forEach(function(key2) {
|
|
21117
|
+
Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
|
|
21118
|
+
});
|
|
21119
|
+
}
|
|
21120
|
+
}
|
|
21121
|
+
return target;
|
|
21122
|
+
}
|
|
21123
|
+
var index = function() {
|
|
21124
|
+
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
21125
|
+
var config = _objectSpread$1({}, options);
|
|
21126
|
+
var blocks = _objectSpread$1({
|
|
21127
|
+
unordered_list: "unordered-list",
|
|
21128
|
+
ordered_list: "ordered-list",
|
|
21129
|
+
list_item: "list-item",
|
|
21130
|
+
list_item_child: "list-item-child",
|
|
21131
|
+
"default": "paragraph"
|
|
21132
|
+
}, config.blocks);
|
|
21133
|
+
var classNames = _objectSpread$1({
|
|
21134
|
+
unordered_list: "unordered-list",
|
|
21135
|
+
ordered_list: "ordered-list",
|
|
21136
|
+
list_item: "list-item",
|
|
21137
|
+
list_item_child: "list-item-child"
|
|
21138
|
+
}, config.classNames);
|
|
21139
|
+
var commands = createCommands({
|
|
21140
|
+
blocks
|
|
21141
|
+
});
|
|
21142
|
+
var isListItem = function isListItem2(block) {
|
|
21143
|
+
return block && block.type == blocks.list_item;
|
|
21144
|
+
};
|
|
21145
|
+
var getListItem = function getListItem2(editor, block) {
|
|
21146
|
+
var possibleListItem = editor.value.document.getParent(block.key);
|
|
21147
|
+
return isListItem(possibleListItem) ? possibleListItem : null;
|
|
21148
|
+
};
|
|
21149
|
+
var isList3 = function isList4(block) {
|
|
21150
|
+
return block && (block.type == blocks.unordered_list || block.type == blocks.ordered_list);
|
|
21151
|
+
};
|
|
21152
|
+
var getList = function getList2(editor, block) {
|
|
21153
|
+
var possibleList = editor.value.document.getParent(block.key);
|
|
21154
|
+
return isList3(possibleList) ? possibleList : null;
|
|
21155
|
+
};
|
|
21156
|
+
var onBackspace = function onBackspace2(event, editor, next) {
|
|
21157
|
+
var selection = editor.value.selection;
|
|
21158
|
+
if (selection.isExpanded)
|
|
21159
|
+
return next();
|
|
21160
|
+
if (selection.start.offset !== 0)
|
|
21161
|
+
return next();
|
|
21162
|
+
var listItem = getListItem(editor, editor.value.startBlock);
|
|
21163
|
+
var list = getList(editor, listItem);
|
|
21164
|
+
var parentListItem = getListItem(editor, list);
|
|
21165
|
+
if (parentListItem) {
|
|
21166
|
+
editor.decreaseListItemDepth();
|
|
21167
|
+
return;
|
|
21168
|
+
}
|
|
21169
|
+
editor.unwrapList();
|
|
21170
|
+
};
|
|
21171
|
+
var onEnter = function onEnter2(event, editor, next) {
|
|
21172
|
+
var _editor$value = editor.value, selection = _editor$value.selection, startBlock = _editor$value.startBlock;
|
|
21173
|
+
event.preventDefault();
|
|
21174
|
+
if (selection.isExpanded)
|
|
21175
|
+
editor["delete"]();
|
|
21176
|
+
if (selection.start.offset === 0 && startBlock.getText() === "") {
|
|
21177
|
+
var _listItem = getListItem(editor, editor.value.startBlock);
|
|
21178
|
+
var list = getList(editor, _listItem);
|
|
21179
|
+
var parentListItem = getListItem(editor, list);
|
|
21180
|
+
if (parentListItem) {
|
|
21181
|
+
editor.decreaseListItemDepth();
|
|
21182
|
+
return;
|
|
21183
|
+
}
|
|
21184
|
+
editor.unwrapList();
|
|
21185
|
+
return;
|
|
21186
|
+
}
|
|
21187
|
+
var listItem = getListItem(editor, editor.value.startBlock);
|
|
21188
|
+
editor.splitDescendantsByKey(listItem.key, selection.start.key, selection.start.offset);
|
|
21189
|
+
};
|
|
21190
|
+
var onShiftEnter = function onShiftEnter2(event, editor, next) {
|
|
21191
|
+
event.preventDefault();
|
|
21192
|
+
editor.insertText("\n");
|
|
21193
|
+
};
|
|
21194
|
+
var schema = createSchema({
|
|
21195
|
+
blocks
|
|
21196
|
+
});
|
|
21197
|
+
var normalizeNode = createNormalizeNode({
|
|
21198
|
+
blocks
|
|
21199
|
+
});
|
|
21200
|
+
var renderBlock = createRenderBlock({
|
|
21201
|
+
blocks,
|
|
21202
|
+
classNames
|
|
21203
|
+
});
|
|
21204
|
+
return [{
|
|
21205
|
+
commands: {
|
|
21206
|
+
wrapList: commands.wrapList,
|
|
21207
|
+
unwrapList: commands.unwrapList,
|
|
21208
|
+
toggleList: commands.toggleList,
|
|
21209
|
+
decreaseListItemDepth: commands.decreaseListItemDepth,
|
|
21210
|
+
increaseListItemDepth: commands.increaseListItemDepth
|
|
21211
|
+
},
|
|
21212
|
+
normalizeNode,
|
|
21213
|
+
renderBlock,
|
|
21214
|
+
renderNode: renderBlock,
|
|
21215
|
+
schema
|
|
21216
|
+
}, Keymap({
|
|
21217
|
+
backspace: onBackspace,
|
|
21218
|
+
enter: onEnter,
|
|
21219
|
+
"shift+enter": onShiftEnter,
|
|
21220
|
+
tab: "increaseListItemDepth",
|
|
21221
|
+
"shift+tab": "decreaseListItemDepth"
|
|
21222
|
+
}, {
|
|
21223
|
+
"if": function _if(editor) {
|
|
21224
|
+
return !!getListItem(editor, editor.value.startBlock);
|
|
21225
|
+
}
|
|
21226
|
+
})];
|
|
21227
|
+
};
|
|
21228
|
+
function useTypography(typographyId) {
|
|
21229
|
+
const { error, data } = client.useQuery(TYPOGRAPHIES_BY_ID, {
|
|
21230
|
+
skip: typographyId == null,
|
|
21231
|
+
variables: { ids: typographyId != null ? [typographyId] : [] }
|
|
21232
|
+
});
|
|
21233
|
+
if (typographyId == null || error != null)
|
|
21234
|
+
return null;
|
|
21235
|
+
return data == null ? void 0 : data.typographies[0];
|
|
21236
|
+
}
|
|
21237
|
+
const concat = (a2, b2) => a2.concat(b2);
|
|
21238
|
+
const getSwatchId = ({ value: { color: color2 } }) => color2 && color2.swatchId;
|
|
21239
|
+
const getDeviceId = ({ deviceId }) => deviceId;
|
|
21240
|
+
const withColor = (swatches) => (_a) => {
|
|
21241
|
+
var _b = _a, { value: _c } = _b, _d = _c, { color: color2 } = _d, restOfValue = __objRest(_d, ["color"]), rest = __objRest(_b, ["value"]);
|
|
21242
|
+
return __spreadProps(__spreadValues({}, rest), {
|
|
21243
|
+
value: __spreadValues(__spreadValues({}, restOfValue), color2 ? {
|
|
21244
|
+
color: {
|
|
21245
|
+
swatch: swatches.find((s) => s && s.id === color2.swatchId),
|
|
21246
|
+
alpha: color2.alpha
|
|
21247
|
+
}
|
|
21248
|
+
} : {})
|
|
21249
|
+
});
|
|
21250
|
+
};
|
|
21251
|
+
const overrideTypographyStyle = (source, override) => {
|
|
21252
|
+
const devices = [...new Set(source.map(getDeviceId).concat(override.map(getDeviceId)))];
|
|
21253
|
+
return devices.map((deviceId) => ({
|
|
21254
|
+
deviceId,
|
|
21255
|
+
value: __spreadValues(__spreadValues({}, (findDeviceOverride(source, deviceId) || { value: {} }).value), (findDeviceOverride(override, deviceId, (v) => v) || { value: {} }).value)
|
|
21256
|
+
}));
|
|
21257
|
+
};
|
|
21258
|
+
function useTypographyMark(value) {
|
|
21259
|
+
const typography = useTypography(value && value.id);
|
|
21260
|
+
const swatchIds = [
|
|
21261
|
+
typography && typography.style.map(getSwatchId) || [],
|
|
21262
|
+
value && value.style.map(getSwatchId) || []
|
|
21263
|
+
].reduce(concat).filter(Boolean);
|
|
21264
|
+
const { error: colorError, data: colorData = {} } = client.useQuery(SWATCHES_BY_ID, {
|
|
21265
|
+
skip: swatchIds == null || swatchIds.length === 0,
|
|
21266
|
+
variables: { ids: swatchIds }
|
|
21267
|
+
});
|
|
21268
|
+
const { swatches = [] } = colorData;
|
|
21269
|
+
if (colorError != null)
|
|
21270
|
+
return null;
|
|
21271
|
+
return overrideTypographyStyle(typography && typography.style.map(withColor(swatches)) || [], value && value.style.map(withColor(swatches)) || []);
|
|
21272
|
+
}
|
|
21273
|
+
const Span = styled__default["default"].span`
|
|
21274
|
+
${(p) => cssMediaRules([p.typographyStyle], ([{
|
|
21275
|
+
color: color2,
|
|
21276
|
+
fontFamily,
|
|
21277
|
+
fontSize,
|
|
21278
|
+
fontWeight,
|
|
21279
|
+
lineHeight,
|
|
21280
|
+
letterSpacing,
|
|
21281
|
+
uppercase,
|
|
21282
|
+
underline,
|
|
21283
|
+
strikethrough,
|
|
21284
|
+
italic
|
|
21285
|
+
} = {}]) => styled.css`
|
|
21286
|
+
${color2 == null ? "" : styled.css`
|
|
21287
|
+
color: ${colorToString(color2)};
|
|
21288
|
+
`}
|
|
21289
|
+
|
|
21290
|
+
${fontFamily == null ? "" : styled.css`
|
|
21291
|
+
font-family: '${fontFamily}';
|
|
21292
|
+
`}
|
|
21293
|
+
|
|
21294
|
+
${fontSize == null || fontSize.value == null || fontSize.unit == null ? "" : styled.css`
|
|
21295
|
+
font-size: ${`${fontSize.value}${fontSize.unit}`};
|
|
21296
|
+
`}
|
|
21297
|
+
|
|
21298
|
+
${fontWeight == null ? "" : styled.css`
|
|
21299
|
+
font-weight: ${fontWeight};
|
|
21300
|
+
`}
|
|
21301
|
+
|
|
21302
|
+
${lineHeight == null ? "" : styled.css`
|
|
21303
|
+
line-height: ${lineHeight};
|
|
21304
|
+
`}
|
|
21305
|
+
|
|
21306
|
+
${letterSpacing == null ? "" : styled.css`
|
|
21307
|
+
letter-spacing: ${letterSpacing / 10}em;
|
|
21308
|
+
`}
|
|
21309
|
+
|
|
21310
|
+
${underline == null && strikethrough == null ? "" : styled.css`
|
|
21311
|
+
text-decoration: ${[Boolean(underline) && "underline", Boolean(strikethrough) && "line-through"].filter(Boolean).join(" ")};
|
|
21312
|
+
`}
|
|
21313
|
+
|
|
21314
|
+
${uppercase == null ? "" : styled.css`
|
|
21315
|
+
text-transform: ${uppercase === true ? "uppercase" : "initial"};
|
|
21316
|
+
`}
|
|
21317
|
+
|
|
21318
|
+
${italic == null ? "" : styled.css`
|
|
21319
|
+
font-style: ${italic === true ? "italic" : "initial"};
|
|
21320
|
+
`}
|
|
21321
|
+
`, shallowMergeFallbacks)}
|
|
21322
|
+
`;
|
|
21323
|
+
function Mark(_w) {
|
|
21324
|
+
var _x = _w, {
|
|
21325
|
+
value
|
|
21326
|
+
} = _x, restOfProps = __objRest(_x, [
|
|
21327
|
+
"value"
|
|
21328
|
+
]);
|
|
21329
|
+
const typographyStyle = useTypographyMark(value);
|
|
21330
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Span, __spreadProps(__spreadValues({}, restOfProps), {
|
|
21331
|
+
typographyStyle
|
|
21332
|
+
}));
|
|
21333
|
+
}
|
|
21334
|
+
const TYPOGRAPHY_TYPE = "typography";
|
|
21335
|
+
function DeviceOverridesMarksPlugin() {
|
|
21336
|
+
return {
|
|
21337
|
+
renderMark({
|
|
21338
|
+
mark,
|
|
21339
|
+
children
|
|
21340
|
+
}, _editor, next) {
|
|
21341
|
+
if (mark.type === TYPOGRAPHY_TYPE) {
|
|
21342
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Mark, {
|
|
21343
|
+
value: mark.data.get("value"),
|
|
21344
|
+
children
|
|
21345
|
+
});
|
|
21346
|
+
}
|
|
21347
|
+
return next();
|
|
21348
|
+
}
|
|
21349
|
+
};
|
|
21350
|
+
}
|
|
21351
|
+
const StyledBlock = styled__default["default"].div`
|
|
21352
|
+
margin: 0;
|
|
21353
|
+
${(p) => cssMediaRules([p.textAlign], ([textAlign]) => textAlign == null ? styled.css`` : styled.css`
|
|
21354
|
+
text-align: ${textAlign};
|
|
21355
|
+
`)}
|
|
21356
|
+
|
|
21357
|
+
${(p) => p.as === "blockquote" ? styled.css`
|
|
21358
|
+
padding: 0.5em 10px;
|
|
21359
|
+
font-size: 1.25em;
|
|
21360
|
+
font-weight: 300;
|
|
21361
|
+
border-left: 5px solid rgba(0, 0, 0, 0.1);
|
|
21362
|
+
` : ""}
|
|
21363
|
+
`;
|
|
21364
|
+
var Block = React.forwardRef(function Block2(_y, ref) {
|
|
21365
|
+
var _z = _y, {
|
|
21366
|
+
textAlign
|
|
21367
|
+
} = _z, restOfProps = __objRest(_z, [
|
|
21368
|
+
"textAlign"
|
|
21369
|
+
]);
|
|
21370
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledBlock, __spreadProps(__spreadValues({}, restOfProps), {
|
|
21371
|
+
ref,
|
|
21372
|
+
textAlign
|
|
21373
|
+
}));
|
|
21374
|
+
});
|
|
21375
|
+
function DeviceOverridesBlockPlugin() {
|
|
21376
|
+
return {
|
|
21377
|
+
renderBlock(props2, _editor, next) {
|
|
21378
|
+
const {
|
|
21379
|
+
node: node2,
|
|
21380
|
+
attributes,
|
|
21381
|
+
children
|
|
21382
|
+
} = props2;
|
|
21383
|
+
const blockProps = {
|
|
21384
|
+
textAlign: node2.data.get("textAlign")
|
|
21385
|
+
};
|
|
21386
|
+
switch (node2.type) {
|
|
21387
|
+
case "paragraph":
|
|
21388
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Block, __spreadProps(__spreadValues(__spreadValues({}, attributes), blockProps), {
|
|
21389
|
+
as: "p",
|
|
21390
|
+
children
|
|
21391
|
+
}));
|
|
21392
|
+
case "heading-one":
|
|
21393
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Block, __spreadProps(__spreadValues(__spreadValues({}, attributes), blockProps), {
|
|
21394
|
+
as: "h1",
|
|
21395
|
+
children
|
|
21396
|
+
}));
|
|
21397
|
+
case "heading-two":
|
|
21398
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Block, __spreadProps(__spreadValues(__spreadValues({}, attributes), blockProps), {
|
|
21399
|
+
as: "h2",
|
|
21400
|
+
children
|
|
21401
|
+
}));
|
|
21402
|
+
case "heading-three":
|
|
21403
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Block, __spreadProps(__spreadValues(__spreadValues({}, attributes), blockProps), {
|
|
21404
|
+
as: "h3",
|
|
21405
|
+
children
|
|
21406
|
+
}));
|
|
21407
|
+
case "heading-four":
|
|
21408
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Block, __spreadProps(__spreadValues(__spreadValues({}, attributes), blockProps), {
|
|
21409
|
+
as: "h4",
|
|
21410
|
+
children
|
|
21411
|
+
}));
|
|
21412
|
+
case "heading-five":
|
|
21413
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Block, __spreadProps(__spreadValues(__spreadValues({}, attributes), blockProps), {
|
|
21414
|
+
as: "h5",
|
|
21415
|
+
children
|
|
21416
|
+
}));
|
|
21417
|
+
case "heading-six":
|
|
21418
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Block, __spreadProps(__spreadValues(__spreadValues({}, attributes), blockProps), {
|
|
21419
|
+
as: "h6",
|
|
21420
|
+
children
|
|
21421
|
+
}));
|
|
21422
|
+
case "blockquote":
|
|
21423
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Block, __spreadProps(__spreadValues(__spreadValues({}, attributes), blockProps), {
|
|
21424
|
+
as: "blockquote",
|
|
21425
|
+
children
|
|
21426
|
+
}));
|
|
21427
|
+
default:
|
|
21428
|
+
return next();
|
|
21429
|
+
}
|
|
21430
|
+
}
|
|
21431
|
+
};
|
|
21432
|
+
}
|
|
21433
|
+
const StyledLink = styled__default["default"](Link)`
|
|
21434
|
+
text-decoration: none;
|
|
21435
|
+
`;
|
|
21436
|
+
function LinkPlugin() {
|
|
21437
|
+
return {
|
|
21438
|
+
renderInline(props2, _editor, next) {
|
|
21439
|
+
const {
|
|
21440
|
+
attributes,
|
|
21441
|
+
children,
|
|
21442
|
+
node: node2
|
|
21443
|
+
} = props2;
|
|
21444
|
+
switch (node2.type) {
|
|
21445
|
+
case "link": {
|
|
21446
|
+
const {
|
|
21447
|
+
data
|
|
21448
|
+
} = node2;
|
|
21449
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledLink, __spreadProps(__spreadValues({}, attributes), {
|
|
21450
|
+
link: data.toJS(),
|
|
21451
|
+
children
|
|
21452
|
+
}));
|
|
21453
|
+
}
|
|
21454
|
+
default: {
|
|
21455
|
+
return next();
|
|
21456
|
+
}
|
|
21457
|
+
}
|
|
21458
|
+
}
|
|
21459
|
+
};
|
|
21460
|
+
}
|
|
21461
|
+
function Inlines() {
|
|
21462
|
+
return {
|
|
21463
|
+
renderInline(props2, _editor, next) {
|
|
21464
|
+
const {
|
|
21465
|
+
attributes,
|
|
21466
|
+
children,
|
|
21467
|
+
node: node2
|
|
21468
|
+
} = props2;
|
|
21469
|
+
switch (node2.type) {
|
|
21470
|
+
case "code": {
|
|
21471
|
+
return /* @__PURE__ */ jsxRuntime.jsx("code", __spreadProps(__spreadValues({}, attributes), {
|
|
21472
|
+
children
|
|
21473
|
+
}));
|
|
21474
|
+
}
|
|
21475
|
+
case "superscript": {
|
|
21476
|
+
return /* @__PURE__ */ jsxRuntime.jsx("sup", __spreadProps(__spreadValues({}, attributes), {
|
|
21477
|
+
children
|
|
21478
|
+
}));
|
|
21479
|
+
}
|
|
21480
|
+
case "subscript": {
|
|
21481
|
+
return /* @__PURE__ */ jsxRuntime.jsx("sub", __spreadProps(__spreadValues({}, attributes), {
|
|
21482
|
+
children
|
|
21483
|
+
}));
|
|
21484
|
+
}
|
|
21485
|
+
default: {
|
|
21486
|
+
return next();
|
|
21487
|
+
}
|
|
21488
|
+
}
|
|
21489
|
+
}
|
|
21490
|
+
};
|
|
21491
|
+
}
|
|
21492
|
+
const RichTextEditor = styled__default["default"](React.forwardRef(function RichTextEditor2(_A, ref) {
|
|
21493
|
+
var _B = _A, {
|
|
21494
|
+
placeholder: placeholder2 = "Write some text..."
|
|
21495
|
+
} = _B, restOfProps = __objRest(_B, [
|
|
21496
|
+
"placeholder"
|
|
21497
|
+
]);
|
|
21498
|
+
const plugins = React.useMemo(() => [index(), LinkPlugin(), Inlines(), DeviceOverridesBlockPlugin(), DeviceOverridesMarksPlugin()], []);
|
|
21499
|
+
return /* @__PURE__ */ jsxRuntime.jsx(slateReact.Editor, __spreadProps(__spreadValues({}, restOfProps), {
|
|
21500
|
+
ref,
|
|
21501
|
+
autoFocus: false,
|
|
21502
|
+
plugins,
|
|
21503
|
+
placeholder: placeholder2
|
|
21504
|
+
}));
|
|
21505
|
+
}))`
|
|
21506
|
+
ul,
|
|
21507
|
+
ol {
|
|
21508
|
+
margin: 0;
|
|
21509
|
+
}
|
|
21510
|
+
`;
|
|
21511
|
+
const StyledRichTextEditor = styled__default["default"](RichTextEditor)`
|
|
21512
|
+
${cssWidth()}
|
|
21513
|
+
${cssMargin()}
|
|
21514
|
+
`;
|
|
21515
|
+
const defaultText = {
|
|
21516
|
+
document: {
|
|
21517
|
+
nodes: [{
|
|
21518
|
+
object: "block",
|
|
21519
|
+
type: "paragraph",
|
|
21520
|
+
nodes: []
|
|
21521
|
+
}]
|
|
21522
|
+
},
|
|
21523
|
+
data: {}
|
|
21524
|
+
};
|
|
21525
|
+
const COMMIT_DEBOUNCE_DELAY = 500;
|
|
21526
|
+
var Text = React.forwardRef(function Text2({
|
|
21527
|
+
id: id2,
|
|
21528
|
+
text,
|
|
21529
|
+
width,
|
|
21530
|
+
margin
|
|
21531
|
+
}, ref) {
|
|
21532
|
+
const [editor, setEditor] = React.useState(null);
|
|
21533
|
+
const [propControllers, setPropControllers] = React.useState(null);
|
|
21534
|
+
const controller = propControllers == null ? void 0 : propControllers.text;
|
|
21535
|
+
React.useImperativeHandle(ref, () => ({
|
|
21536
|
+
getBoxModel() {
|
|
21537
|
+
const el = editor == null ? void 0 : editor.findDOMNode([]);
|
|
21538
|
+
return el instanceof Element ? boxModels.getBox(el) : null;
|
|
21539
|
+
},
|
|
21540
|
+
setPropControllers
|
|
21541
|
+
}), [editor, setPropControllers]);
|
|
21542
|
+
React.useEffect(() => {
|
|
21543
|
+
if (editor)
|
|
21544
|
+
controller == null ? void 0 : controller.setSlateEditor(editor);
|
|
21545
|
+
}, [controller, editor]);
|
|
21546
|
+
const [value, setValue] = React.useState(() => {
|
|
21547
|
+
const _a = text != null ? text : defaultText, {
|
|
21548
|
+
selection
|
|
21549
|
+
} = _a, textWithoutSelection = __objRest(_a, [
|
|
21550
|
+
"selection"
|
|
21551
|
+
]);
|
|
21552
|
+
return slate.Value.fromJSON(textWithoutSelection);
|
|
21553
|
+
});
|
|
21554
|
+
const [shouldCommit, setShouldCommit] = React.useState(true);
|
|
21555
|
+
React.useEffect(() => {
|
|
21556
|
+
if (shouldCommit) {
|
|
21557
|
+
const nextValue = slate.Value.fromJSON(text != null ? text : defaultText);
|
|
21558
|
+
setValue((currentValue) => currentValue.selection.isBlurred ? slate.Value.fromJSON(nextValue.toJSON({
|
|
21559
|
+
preserveSelection: false
|
|
21560
|
+
})) : nextValue);
|
|
21561
|
+
}
|
|
21562
|
+
}, [shouldCommit, text]);
|
|
21563
|
+
React.useEffect(() => {
|
|
21564
|
+
if (shouldCommit)
|
|
21565
|
+
return;
|
|
21566
|
+
const timeoutId = window.setTimeout(() => {
|
|
21567
|
+
setShouldCommit(true);
|
|
21568
|
+
}, COMMIT_DEBOUNCE_DELAY);
|
|
21569
|
+
return () => {
|
|
21570
|
+
window.clearTimeout(timeoutId);
|
|
21571
|
+
};
|
|
21572
|
+
}, [shouldCommit]);
|
|
21573
|
+
function handleChange(change) {
|
|
21574
|
+
setValue(change.value);
|
|
21575
|
+
if (change.value.document !== value.document) {
|
|
21576
|
+
setShouldCommit(false);
|
|
21577
|
+
controller == null ? void 0 : controller.onChange(change);
|
|
21578
|
+
}
|
|
21579
|
+
}
|
|
21580
|
+
const lastController = React.useRef(controller);
|
|
21581
|
+
if (lastController.current !== controller)
|
|
21582
|
+
lastController.current = controller;
|
|
21583
|
+
const handleFocus = React.useCallback(() => {
|
|
21584
|
+
var _a;
|
|
21585
|
+
(_a = lastController.current) == null ? void 0 : _a.focus();
|
|
21586
|
+
}, []);
|
|
21587
|
+
const handleKeyDown = React.useCallback((event, _editor, next) => {
|
|
21588
|
+
var _a, _b;
|
|
21589
|
+
if (Hotkeys.isUndo(event)) {
|
|
21590
|
+
(_a = lastController.current) == null ? void 0 : _a.undo();
|
|
21591
|
+
return true;
|
|
21592
|
+
}
|
|
21593
|
+
if (Hotkeys.isRedo(event)) {
|
|
21594
|
+
(_b = lastController.current) == null ? void 0 : _b.redo();
|
|
21595
|
+
return true;
|
|
21596
|
+
}
|
|
21597
|
+
return next();
|
|
21598
|
+
}, []);
|
|
21599
|
+
const isInBuilder = react.useIsInBuilder();
|
|
21600
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledRichTextEditor, {
|
|
21601
|
+
id: id2,
|
|
21602
|
+
ref: setEditor,
|
|
21603
|
+
readOnly: !isInBuilder,
|
|
21604
|
+
width,
|
|
21605
|
+
margin,
|
|
21606
|
+
value,
|
|
21607
|
+
onChange: handleChange,
|
|
21608
|
+
onFocus: handleFocus,
|
|
21609
|
+
onKeyDown: handleKeyDown
|
|
21610
|
+
});
|
|
21611
|
+
});
|
|
19943
21612
|
exports.Box = Box;
|
|
19944
21613
|
exports.Button = Button;
|
|
19945
21614
|
exports.Carousel = Carousel;
|
|
@@ -19957,4 +21626,14 @@ exports.Image = Image$1;
|
|
|
19957
21626
|
exports.Navigation = Navigation;
|
|
19958
21627
|
exports.Root = Root;
|
|
19959
21628
|
exports.SocialLinks = SocialLinks;
|
|
21629
|
+
exports.Text = Text;
|
|
21630
|
+
exports.cssBorder = cssBorder;
|
|
21631
|
+
exports.cssBorderRadius = cssBorderRadius;
|
|
21632
|
+
exports.cssBoxShadow = cssBoxShadow;
|
|
21633
|
+
exports.cssGridItem = cssGridItem;
|
|
21634
|
+
exports.cssMargin = cssMargin;
|
|
21635
|
+
exports.cssMediaRules = cssMediaRules;
|
|
21636
|
+
exports.cssPadding = cssPadding;
|
|
21637
|
+
exports.cssTextStyle = cssTextStyle;
|
|
21638
|
+
exports.cssWidth = cssWidth;
|
|
19960
21639
|
//# sourceMappingURL=components.cjs.js.map
|