locize 2.4.6 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +3 -0
- package/.ts.eslintrc +37 -0
- package/CHANGELOG.md +9 -0
- package/README.md +10 -19
- package/dist/cjs/api/handleCommitKey.js +17 -0
- package/dist/cjs/api/handleCommitKeys.js +39 -0
- package/dist/cjs/api/handleConfirmInitialized.js +11 -0
- package/dist/cjs/api/handleEditKey.js +60 -0
- package/dist/cjs/api/handleIsLocizeEnabled.js +11 -0
- package/dist/cjs/api/handleRequestPopupChanges.js +21 -0
- package/dist/cjs/api/handleRequestResourceBundle.js +27 -0
- package/dist/cjs/api/handleSelectedKeys.js +27 -0
- package/dist/cjs/api/handleTurnOff.js +8 -0
- package/dist/cjs/api/handleTurnOn.js +8 -0
- package/dist/cjs/api/postMessage.js +161 -0
- package/dist/cjs/clickHandler.js +48 -0
- package/dist/cjs/index.d.ts +15 -0
- package/dist/cjs/index.js +55 -0
- package/dist/cjs/locizePlugin.js +110 -0
- package/dist/cjs/observer.js +74 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/parser.js +122 -0
- package/dist/cjs/process.js +69 -0
- package/dist/cjs/processLegacy.js +80 -0
- package/dist/cjs/shims/uniqueID.js +31 -0
- package/dist/cjs/startStandalone.js +24 -0
- package/dist/cjs/store.js +49 -0
- package/dist/cjs/ui/elements/icons.js +48 -0
- package/dist/cjs/ui/elements/popup.js +80 -0
- package/dist/cjs/ui/elements/ribbonBox.js +67 -0
- package/dist/cjs/ui/highlightNode.js +167 -0
- package/dist/cjs/ui/mouseDistance.js +44 -0
- package/dist/cjs/ui/popup.js +113 -0
- package/dist/cjs/ui/stylesheet.js +12 -0
- package/dist/cjs/ui/utils.js +39 -0
- package/dist/cjs/uninstrumentedStore.js +43 -0
- package/dist/cjs/utils.js +138 -0
- package/dist/cjs/vars.js +22 -0
- package/dist/esm/api/handleCommitKey.js +15 -0
- package/dist/esm/api/handleCommitKeys.js +33 -0
- package/dist/esm/api/handleConfirmInitialized.js +9 -0
- package/dist/esm/api/handleEditKey.js +56 -0
- package/dist/esm/api/handleIsLocizeEnabled.js +9 -0
- package/dist/esm/api/handleRequestPopupChanges.js +19 -0
- package/dist/esm/api/handleRequestResourceBundle.js +20 -0
- package/dist/esm/api/handleSelectedKeys.js +25 -0
- package/dist/esm/api/handleTurnOff.js +6 -0
- package/dist/esm/api/handleTurnOn.js +6 -0
- package/dist/esm/api/postMessage.js +148 -0
- package/dist/esm/clickHandler.js +44 -0
- package/dist/esm/index.d.mts +1 -0
- package/dist/esm/index.d.ts +15 -0
- package/dist/esm/index.js +33 -0
- package/dist/esm/locizePlugin.js +99 -0
- package/dist/esm/observer.js +70 -0
- package/dist/esm/parser.js +113 -0
- package/dist/esm/process.js +61 -0
- package/dist/esm/processLegacy.js +72 -0
- package/dist/esm/shims/uniqueID.js +29 -0
- package/dist/esm/startStandalone.js +20 -0
- package/dist/esm/store.js +41 -0
- package/dist/esm/ui/elements/icons.js +39 -0
- package/dist/esm/ui/elements/popup.js +76 -0
- package/dist/esm/ui/elements/ribbonBox.js +62 -0
- package/dist/esm/ui/highlightNode.js +156 -0
- package/dist/esm/ui/mouseDistance.js +39 -0
- package/dist/esm/ui/popup.js +108 -0
- package/dist/esm/ui/stylesheet.js +8 -0
- package/dist/esm/ui/utils.js +34 -0
- package/dist/esm/uninstrumentedStore.js +35 -0
- package/dist/esm/utils.js +123 -0
- package/dist/esm/vars.js +16 -0
- package/dist/umd/locize.js +2796 -286
- package/dist/umd/locize.min.js +1 -1
- package/index.d.mts +1 -0
- package/index.d.ts +5 -6
- package/index.js +4 -4
- package/locize.js +2796 -286
- package/locize.min.js +1 -1
- package/package.json +64 -31
- package/rollup.config.js +62 -29
- package/src/api/handleCommitKey.js +17 -0
- package/src/api/handleCommitKeys.js +39 -0
- package/src/api/handleConfirmInitialized.js +10 -0
- package/src/api/handleEditKey.js +81 -0
- package/src/api/handleIsLocizeEnabled.js +13 -0
- package/src/api/handleRequestPopupChanges.js +25 -0
- package/src/api/handleRequestResourceBundle.js +11 -0
- package/src/api/handleSelectedKeys.js +32 -0
- package/src/api/handleTurnOff.js +8 -0
- package/src/api/handleTurnOn.js +8 -0
- package/src/api/index.js +19 -0
- package/src/api/postMessage.js +169 -0
- package/src/clickHandler.js +48 -0
- package/src/index.js +30 -0
- package/src/locizePlugin.js +117 -0
- package/src/observer.js +93 -0
- package/src/parser.js +162 -0
- package/src/process.js +62 -0
- package/src/processLegacy.js +69 -0
- package/src/shims/uniqueID.js +49 -0
- package/src/startStandalone.js +19 -0
- package/src/store.js +47 -0
- package/src/ui/elements/icons.js +92 -0
- package/src/ui/elements/popup.js +226 -0
- package/src/ui/elements/ribbonBox.js +76 -0
- package/src/ui/highlightNode.js +203 -0
- package/src/ui/mouseDistance.js +46 -0
- package/src/ui/popup.js +135 -0
- package/src/ui/stylesheet.js +8 -0
- package/src/ui/utils.js +37 -0
- package/src/uninstrumentedStore.js +39 -0
- package/src/utils.js +158 -0
- package/src/vars.js +18 -0
- package/tsconfig.json +4 -4
- package/.eslintrc.js +0 -20
- package/debuggingApp/README.md +0 -11
- package/debuggingApp/debugEditor.html +0 -28
- package/debuggingApp/index.html +0 -151
- package/debuggingApp/node_modules/.package-lock.json +0 -668
- package/debuggingApp/node_modules/@babel/runtime/LICENSE +0 -22
- package/debuggingApp/node_modules/@babel/runtime/README.md +0 -19
- package/debuggingApp/node_modules/@babel/runtime/helpers/AsyncGenerator.js +0 -98
- package/debuggingApp/node_modules/@babel/runtime/helpers/AwaitValue.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js +0 -30
- package/debuggingApp/node_modules/@babel/runtime/helpers/applyDecs.js +0 -284
- package/debuggingApp/node_modules/@babel/runtime/helpers/arrayLikeToArray.js +0 -11
- package/debuggingApp/node_modules/@babel/runtime/helpers/arrayWithHoles.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/assertThisInitialized.js +0 -9
- package/debuggingApp/node_modules/@babel/runtime/helpers/asyncGeneratorDelegate.js +0 -56
- package/debuggingApp/node_modules/@babel/runtime/helpers/asyncIterator.js +0 -50
- package/debuggingApp/node_modules/@babel/runtime/helpers/asyncToGenerator.js +0 -37
- package/debuggingApp/node_modules/@babel/runtime/helpers/awaitAsyncGenerator.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/checkPrivateRedeclaration.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/classApplyDescriptorDestructureSet.js +0 -22
- package/debuggingApp/node_modules/@babel/runtime/helpers/classApplyDescriptorGet.js +0 -9
- package/debuggingApp/node_modules/@babel/runtime/helpers/classApplyDescriptorSet.js +0 -13
- package/debuggingApp/node_modules/@babel/runtime/helpers/classCallCheck.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/classCheckPrivateStaticAccess.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/classExtractFieldDescriptor.js +0 -9
- package/debuggingApp/node_modules/@babel/runtime/helpers/classNameTDZError.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/classPrivateFieldDestructureSet.js +0 -10
- package/debuggingApp/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js +0 -10
- package/debuggingApp/node_modules/@babel/runtime/helpers/classPrivateFieldInitSpec.js +0 -8
- package/debuggingApp/node_modules/@babel/runtime/helpers/classPrivateFieldLooseBase.js +0 -9
- package/debuggingApp/node_modules/@babel/runtime/helpers/classPrivateFieldLooseKey.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js +0 -11
- package/debuggingApp/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js +0 -9
- package/debuggingApp/node_modules/@babel/runtime/helpers/classPrivateMethodInitSpec.js +0 -8
- package/debuggingApp/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/classStaticPrivateFieldDestructureSet.js +0 -13
- package/debuggingApp/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js +0 -13
- package/debuggingApp/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js +0 -14
- package/debuggingApp/node_modules/@babel/runtime/helpers/classStaticPrivateMethodGet.js +0 -8
- package/debuggingApp/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/construct.js +0 -22
- package/debuggingApp/node_modules/@babel/runtime/helpers/createClass.js +0 -20
- package/debuggingApp/node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js +0 -60
- package/debuggingApp/node_modules/@babel/runtime/helpers/createForOfIteratorHelperLoose.js +0 -24
- package/debuggingApp/node_modules/@babel/runtime/helpers/createSuper.js +0 -24
- package/debuggingApp/node_modules/@babel/runtime/helpers/decorate.js +0 -400
- package/debuggingApp/node_modules/@babel/runtime/helpers/defaults.js +0 -16
- package/debuggingApp/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js +0 -24
- package/debuggingApp/node_modules/@babel/runtime/helpers/defineProperty.js +0 -16
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/AsyncGenerator.js +0 -95
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/AwaitValue.js +0 -3
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js +0 -28
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/applyDecs.js +0 -282
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +0 -9
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +0 -3
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +0 -4
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/asyncGeneratorDelegate.js +0 -54
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/asyncIterator.js +0 -48
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js +0 -35
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js +0 -4
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/checkPrivateRedeclaration.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorDestructureSet.js +0 -20
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorGet.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorSet.js +0 -11
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticAccess.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticFieldDescriptor.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classExtractFieldDescriptor.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js +0 -3
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classPrivateFieldDestructureSet.js +0 -6
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js +0 -6
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classPrivateFieldInitSpec.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js +0 -4
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classPrivateMethodInitSpec.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js +0 -3
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldDestructureSet.js +0 -8
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js +0 -8
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js +0 -9
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js +0 -3
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/construct.js +0 -18
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/createClass.js +0 -18
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js +0 -57
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelperLoose.js +0 -21
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/createSuper.js +0 -19
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/decorate.js +0 -396
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/defaults.js +0 -14
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js +0 -22
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/defineProperty.js +0 -14
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/extends.js +0 -16
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/get.js +0 -20
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +0 -6
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/identity.js +0 -3
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/inherits.js +0 -18
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +0 -6
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js +0 -9
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/initializerWarningHelper.js +0 -3
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/instanceof.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js +0 -51
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js +0 -3
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +0 -12
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +0 -3
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +0 -29
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js +0 -14
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/jsx.js +0 -26
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/maybeArrayLike.js +0 -9
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/newArrowCheck.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +0 -3
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +0 -3
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js +0 -3
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/objectSpread.js +0 -19
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +0 -27
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +0 -19
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +0 -14
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/package.json +0 -3
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +0 -11
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/readOnlyError.js +0 -3
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js +0 -352
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/set.js +0 -51
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/skipFirstGeneratorNext.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/slicedToArrayLoose.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/superPropBase.js +0 -9
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js +0 -11
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js +0 -8
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/tdz.js +0 -3
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/temporalRef.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/temporalUndefined.js +0 -1
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/toArray.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +0 -13
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +0 -6
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/typeof.js +0 -9
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +0 -9
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js +0 -6
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js +0 -37
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js +0 -50
- package/debuggingApp/node_modules/@babel/runtime/helpers/esm/writeOnlyError.js +0 -3
- package/debuggingApp/node_modules/@babel/runtime/helpers/extends.js +0 -18
- package/debuggingApp/node_modules/@babel/runtime/helpers/get.js +0 -23
- package/debuggingApp/node_modules/@babel/runtime/helpers/getPrototypeOf.js +0 -8
- package/debuggingApp/node_modules/@babel/runtime/helpers/identity.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/inherits.js +0 -21
- package/debuggingApp/node_modules/@babel/runtime/helpers/inheritsLoose.js +0 -9
- package/debuggingApp/node_modules/@babel/runtime/helpers/initializerDefineProperty.js +0 -11
- package/debuggingApp/node_modules/@babel/runtime/helpers/initializerWarningHelper.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/instanceof.js +0 -9
- package/debuggingApp/node_modules/@babel/runtime/helpers/interopRequireDefault.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/interopRequireWildcard.js +0 -53
- package/debuggingApp/node_modules/@babel/runtime/helpers/isNativeFunction.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js +0 -14
- package/debuggingApp/node_modules/@babel/runtime/helpers/iterableToArray.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js +0 -31
- package/debuggingApp/node_modules/@babel/runtime/helpers/iterableToArrayLimitLoose.js +0 -16
- package/debuggingApp/node_modules/@babel/runtime/helpers/jsx.js +0 -29
- package/debuggingApp/node_modules/@babel/runtime/helpers/maybeArrayLike.js +0 -12
- package/debuggingApp/node_modules/@babel/runtime/helpers/newArrowCheck.js +0 -7
- package/debuggingApp/node_modules/@babel/runtime/helpers/nonIterableRest.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/nonIterableSpread.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/objectDestructuringEmpty.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/objectSpread.js +0 -22
- package/debuggingApp/node_modules/@babel/runtime/helpers/objectSpread2.js +0 -29
- package/debuggingApp/node_modules/@babel/runtime/helpers/objectWithoutProperties.js +0 -22
- package/debuggingApp/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js +0 -16
- package/debuggingApp/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js +0 -15
- package/debuggingApp/node_modules/@babel/runtime/helpers/readOnlyError.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/regeneratorRuntime.js +0 -354
- package/debuggingApp/node_modules/@babel/runtime/helpers/set.js +0 -54
- package/debuggingApp/node_modules/@babel/runtime/helpers/setPrototypeOf.js +0 -9
- package/debuggingApp/node_modules/@babel/runtime/helpers/skipFirstGeneratorNext.js +0 -9
- package/debuggingApp/node_modules/@babel/runtime/helpers/slicedToArray.js +0 -13
- package/debuggingApp/node_modules/@babel/runtime/helpers/slicedToArrayLoose.js +0 -13
- package/debuggingApp/node_modules/@babel/runtime/helpers/superPropBase.js +0 -12
- package/debuggingApp/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js +0 -13
- package/debuggingApp/node_modules/@babel/runtime/helpers/taggedTemplateLiteralLoose.js +0 -10
- package/debuggingApp/node_modules/@babel/runtime/helpers/tdz.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/helpers/temporalRef.js +0 -9
- package/debuggingApp/node_modules/@babel/runtime/helpers/temporalUndefined.js +0 -3
- package/debuggingApp/node_modules/@babel/runtime/helpers/toArray.js +0 -13
- package/debuggingApp/node_modules/@babel/runtime/helpers/toConsumableArray.js +0 -13
- package/debuggingApp/node_modules/@babel/runtime/helpers/toPrimitive.js +0 -16
- package/debuggingApp/node_modules/@babel/runtime/helpers/toPropertyKey.js +0 -10
- package/debuggingApp/node_modules/@babel/runtime/helpers/typeof.js +0 -11
- package/debuggingApp/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js +0 -12
- package/debuggingApp/node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js +0 -9
- package/debuggingApp/node_modules/@babel/runtime/helpers/wrapNativeSuper.js +0 -42
- package/debuggingApp/node_modules/@babel/runtime/helpers/wrapRegExp.js +0 -55
- package/debuggingApp/node_modules/@babel/runtime/helpers/writeOnlyError.js +0 -5
- package/debuggingApp/node_modules/@babel/runtime/package.json +0 -876
- package/debuggingApp/node_modules/@babel/runtime/regenerator/index.js +0 -15
- package/debuggingApp/node_modules/accepts/HISTORY.md +0 -243
- package/debuggingApp/node_modules/accepts/LICENSE +0 -23
- package/debuggingApp/node_modules/accepts/README.md +0 -140
- package/debuggingApp/node_modules/accepts/index.js +0 -238
- package/debuggingApp/node_modules/accepts/package.json +0 -47
- package/debuggingApp/node_modules/array-flatten/LICENSE +0 -21
- package/debuggingApp/node_modules/array-flatten/README.md +0 -43
- package/debuggingApp/node_modules/array-flatten/array-flatten.js +0 -64
- package/debuggingApp/node_modules/array-flatten/package.json +0 -39
- package/debuggingApp/node_modules/body-parser/HISTORY.md +0 -651
- package/debuggingApp/node_modules/body-parser/LICENSE +0 -23
- package/debuggingApp/node_modules/body-parser/README.md +0 -464
- package/debuggingApp/node_modules/body-parser/SECURITY.md +0 -25
- package/debuggingApp/node_modules/body-parser/index.js +0 -157
- package/debuggingApp/node_modules/body-parser/lib/read.js +0 -205
- package/debuggingApp/node_modules/body-parser/lib/types/json.js +0 -236
- package/debuggingApp/node_modules/body-parser/lib/types/raw.js +0 -101
- package/debuggingApp/node_modules/body-parser/lib/types/text.js +0 -121
- package/debuggingApp/node_modules/body-parser/lib/types/urlencoded.js +0 -284
- package/debuggingApp/node_modules/body-parser/package.json +0 -56
- package/debuggingApp/node_modules/bytes/History.md +0 -97
- package/debuggingApp/node_modules/bytes/LICENSE +0 -23
- package/debuggingApp/node_modules/bytes/Readme.md +0 -152
- package/debuggingApp/node_modules/bytes/index.js +0 -170
- package/debuggingApp/node_modules/bytes/package.json +0 -42
- package/debuggingApp/node_modules/call-bind/.github/FUNDING.yml +0 -12
- package/debuggingApp/node_modules/call-bind/.nycrc +0 -13
- package/debuggingApp/node_modules/call-bind/CHANGELOG.md +0 -42
- package/debuggingApp/node_modules/call-bind/LICENSE +0 -21
- package/debuggingApp/node_modules/call-bind/README.md +0 -2
- package/debuggingApp/node_modules/call-bind/callBound.js +0 -15
- package/debuggingApp/node_modules/call-bind/index.js +0 -47
- package/debuggingApp/node_modules/call-bind/package.json +0 -80
- package/debuggingApp/node_modules/call-bind/test/callBound.js +0 -55
- package/debuggingApp/node_modules/call-bind/test/index.js +0 -66
- package/debuggingApp/node_modules/content-disposition/HISTORY.md +0 -60
- package/debuggingApp/node_modules/content-disposition/LICENSE +0 -22
- package/debuggingApp/node_modules/content-disposition/README.md +0 -142
- package/debuggingApp/node_modules/content-disposition/index.js +0 -458
- package/debuggingApp/node_modules/content-disposition/package.json +0 -44
- package/debuggingApp/node_modules/content-type/HISTORY.md +0 -24
- package/debuggingApp/node_modules/content-type/LICENSE +0 -22
- package/debuggingApp/node_modules/content-type/README.md +0 -92
- package/debuggingApp/node_modules/content-type/index.js +0 -222
- package/debuggingApp/node_modules/content-type/package.json +0 -40
- package/debuggingApp/node_modules/cookie/HISTORY.md +0 -142
- package/debuggingApp/node_modules/cookie/LICENSE +0 -24
- package/debuggingApp/node_modules/cookie/README.md +0 -302
- package/debuggingApp/node_modules/cookie/SECURITY.md +0 -25
- package/debuggingApp/node_modules/cookie/index.js +0 -270
- package/debuggingApp/node_modules/cookie/package.json +0 -44
- package/debuggingApp/node_modules/cookie-signature/History.md +0 -38
- package/debuggingApp/node_modules/cookie-signature/Readme.md +0 -42
- package/debuggingApp/node_modules/cookie-signature/index.js +0 -51
- package/debuggingApp/node_modules/cookie-signature/package.json +0 -18
- package/debuggingApp/node_modules/cookies/History.md +0 -62
- package/debuggingApp/node_modules/cookies/LICENSE.txt +0 -22
- package/debuggingApp/node_modules/cookies/README.md +0 -121
- package/debuggingApp/node_modules/cookies/lib/cookies.js +0 -181
- package/debuggingApp/node_modules/cookies/package.json +0 -24
- package/debuggingApp/node_modules/debug/.coveralls.yml +0 -1
- package/debuggingApp/node_modules/debug/.travis.yml +0 -14
- package/debuggingApp/node_modules/debug/CHANGELOG.md +0 -362
- package/debuggingApp/node_modules/debug/LICENSE +0 -19
- package/debuggingApp/node_modules/debug/Makefile +0 -50
- package/debuggingApp/node_modules/debug/README.md +0 -312
- package/debuggingApp/node_modules/debug/component.json +0 -19
- package/debuggingApp/node_modules/debug/node.js +0 -1
- package/debuggingApp/node_modules/debug/package.json +0 -49
- package/debuggingApp/node_modules/debug/src/browser.js +0 -185
- package/debuggingApp/node_modules/debug/src/debug.js +0 -202
- package/debuggingApp/node_modules/debug/src/index.js +0 -10
- package/debuggingApp/node_modules/debug/src/inspector-log.js +0 -15
- package/debuggingApp/node_modules/debug/src/node.js +0 -248
- package/debuggingApp/node_modules/depd/History.md +0 -103
- package/debuggingApp/node_modules/depd/LICENSE +0 -22
- package/debuggingApp/node_modules/depd/Readme.md +0 -280
- package/debuggingApp/node_modules/depd/index.js +0 -538
- package/debuggingApp/node_modules/depd/lib/browser/index.js +0 -77
- package/debuggingApp/node_modules/depd/package.json +0 -45
- package/debuggingApp/node_modules/destroy/LICENSE +0 -23
- package/debuggingApp/node_modules/destroy/README.md +0 -63
- package/debuggingApp/node_modules/destroy/index.js +0 -209
- package/debuggingApp/node_modules/destroy/package.json +0 -48
- package/debuggingApp/node_modules/ee-first/LICENSE +0 -22
- package/debuggingApp/node_modules/ee-first/README.md +0 -80
- package/debuggingApp/node_modules/ee-first/index.js +0 -95
- package/debuggingApp/node_modules/ee-first/package.json +0 -29
- package/debuggingApp/node_modules/encodeurl/HISTORY.md +0 -14
- package/debuggingApp/node_modules/encodeurl/LICENSE +0 -22
- package/debuggingApp/node_modules/encodeurl/README.md +0 -128
- package/debuggingApp/node_modules/encodeurl/index.js +0 -60
- package/debuggingApp/node_modules/encodeurl/package.json +0 -40
- package/debuggingApp/node_modules/escape-html/LICENSE +0 -24
- package/debuggingApp/node_modules/escape-html/Readme.md +0 -43
- package/debuggingApp/node_modules/escape-html/index.js +0 -78
- package/debuggingApp/node_modules/escape-html/package.json +0 -24
- package/debuggingApp/node_modules/etag/HISTORY.md +0 -83
- package/debuggingApp/node_modules/etag/LICENSE +0 -22
- package/debuggingApp/node_modules/etag/README.md +0 -159
- package/debuggingApp/node_modules/etag/index.js +0 -131
- package/debuggingApp/node_modules/etag/package.json +0 -47
- package/debuggingApp/node_modules/express/History.md +0 -3579
- package/debuggingApp/node_modules/express/LICENSE +0 -24
- package/debuggingApp/node_modules/express/Readme.md +0 -166
- package/debuggingApp/node_modules/express/index.js +0 -11
- package/debuggingApp/node_modules/express/lib/application.js +0 -661
- package/debuggingApp/node_modules/express/lib/express.js +0 -116
- package/debuggingApp/node_modules/express/lib/middleware/init.js +0 -43
- package/debuggingApp/node_modules/express/lib/middleware/query.js +0 -47
- package/debuggingApp/node_modules/express/lib/request.js +0 -525
- package/debuggingApp/node_modules/express/lib/response.js +0 -1169
- package/debuggingApp/node_modules/express/lib/router/index.js +0 -673
- package/debuggingApp/node_modules/express/lib/router/layer.js +0 -181
- package/debuggingApp/node_modules/express/lib/router/route.js +0 -225
- package/debuggingApp/node_modules/express/lib/utils.js +0 -304
- package/debuggingApp/node_modules/express/lib/view.js +0 -182
- package/debuggingApp/node_modules/express/package.json +0 -99
- package/debuggingApp/node_modules/finalhandler/HISTORY.md +0 -195
- package/debuggingApp/node_modules/finalhandler/LICENSE +0 -22
- package/debuggingApp/node_modules/finalhandler/README.md +0 -147
- package/debuggingApp/node_modules/finalhandler/SECURITY.md +0 -25
- package/debuggingApp/node_modules/finalhandler/index.js +0 -336
- package/debuggingApp/node_modules/finalhandler/package.json +0 -46
- package/debuggingApp/node_modules/forwarded/HISTORY.md +0 -21
- package/debuggingApp/node_modules/forwarded/LICENSE +0 -22
- package/debuggingApp/node_modules/forwarded/README.md +0 -57
- package/debuggingApp/node_modules/forwarded/index.js +0 -90
- package/debuggingApp/node_modules/forwarded/package.json +0 -45
- package/debuggingApp/node_modules/fresh/HISTORY.md +0 -70
- package/debuggingApp/node_modules/fresh/LICENSE +0 -23
- package/debuggingApp/node_modules/fresh/README.md +0 -119
- package/debuggingApp/node_modules/fresh/index.js +0 -137
- package/debuggingApp/node_modules/fresh/package.json +0 -46
- package/debuggingApp/node_modules/function-bind/.jscs.json +0 -176
- package/debuggingApp/node_modules/function-bind/.travis.yml +0 -168
- package/debuggingApp/node_modules/function-bind/LICENSE +0 -20
- package/debuggingApp/node_modules/function-bind/README.md +0 -48
- package/debuggingApp/node_modules/function-bind/implementation.js +0 -52
- package/debuggingApp/node_modules/function-bind/index.js +0 -5
- package/debuggingApp/node_modules/function-bind/package.json +0 -63
- package/debuggingApp/node_modules/function-bind/test/index.js +0 -252
- package/debuggingApp/node_modules/get-intrinsic/.github/FUNDING.yml +0 -12
- package/debuggingApp/node_modules/get-intrinsic/.nycrc +0 -9
- package/debuggingApp/node_modules/get-intrinsic/CHANGELOG.md +0 -91
- package/debuggingApp/node_modules/get-intrinsic/LICENSE +0 -21
- package/debuggingApp/node_modules/get-intrinsic/README.md +0 -71
- package/debuggingApp/node_modules/get-intrinsic/index.js +0 -334
- package/debuggingApp/node_modules/get-intrinsic/package.json +0 -88
- package/debuggingApp/node_modules/get-intrinsic/test/GetIntrinsic.js +0 -274
- package/debuggingApp/node_modules/has/LICENSE-MIT +0 -22
- package/debuggingApp/node_modules/has/README.md +0 -18
- package/debuggingApp/node_modules/has/package.json +0 -48
- package/debuggingApp/node_modules/has/src/index.js +0 -5
- package/debuggingApp/node_modules/has/test/index.js +0 -10
- package/debuggingApp/node_modules/has-symbols/.github/FUNDING.yml +0 -12
- package/debuggingApp/node_modules/has-symbols/.nycrc +0 -9
- package/debuggingApp/node_modules/has-symbols/CHANGELOG.md +0 -75
- package/debuggingApp/node_modules/has-symbols/LICENSE +0 -21
- package/debuggingApp/node_modules/has-symbols/README.md +0 -46
- package/debuggingApp/node_modules/has-symbols/index.js +0 -13
- package/debuggingApp/node_modules/has-symbols/package.json +0 -101
- package/debuggingApp/node_modules/has-symbols/shams.js +0 -42
- package/debuggingApp/node_modules/has-symbols/test/index.js +0 -22
- package/debuggingApp/node_modules/has-symbols/test/shams/core-js.js +0 -28
- package/debuggingApp/node_modules/has-symbols/test/shams/get-own-property-symbols.js +0 -28
- package/debuggingApp/node_modules/has-symbols/test/tests.js +0 -56
- package/debuggingApp/node_modules/http-errors/HISTORY.md +0 -180
- package/debuggingApp/node_modules/http-errors/LICENSE +0 -23
- package/debuggingApp/node_modules/http-errors/README.md +0 -169
- package/debuggingApp/node_modules/http-errors/index.js +0 -289
- package/debuggingApp/node_modules/http-errors/package.json +0 -50
- package/debuggingApp/node_modules/i18next/CONTRIBUTING.md +0 -22
- package/debuggingApp/node_modules/i18next/LICENSE +0 -21
- package/debuggingApp/node_modules/i18next/README.md +0 -60
- package/debuggingApp/node_modules/i18next/dist/cjs/i18next.js +0 -2801
- package/debuggingApp/node_modules/i18next/dist/esm/i18next.bundled.js +0 -2954
- package/debuggingApp/node_modules/i18next/dist/esm/i18next.js +0 -2802
- package/debuggingApp/node_modules/i18next/dist/esm/package.json +0 -1
- package/debuggingApp/node_modules/i18next/dist/umd/i18next.js +0 -2922
- package/debuggingApp/node_modules/i18next/dist/umd/i18next.min.js +0 -1
- package/debuggingApp/node_modules/i18next/i18next.js +0 -2922
- package/debuggingApp/node_modules/i18next/i18next.min.js +0 -1
- package/debuggingApp/node_modules/i18next/index.d.ts +0 -1257
- package/debuggingApp/node_modules/i18next/index.js +0 -5
- package/debuggingApp/node_modules/i18next/package.json +0 -126
- package/debuggingApp/node_modules/i18next-express-middleware/LICENSE +0 -22
- package/debuggingApp/node_modules/i18next-express-middleware/README.md +0 -167
- package/debuggingApp/node_modules/i18next-express-middleware/lib/LanguageDetector.js +0 -138
- package/debuggingApp/node_modules/i18next-express-middleware/lib/index.js +0 -152
- package/debuggingApp/node_modules/i18next-express-middleware/lib/languageLookups/cookie.js +0 -47
- package/debuggingApp/node_modules/i18next-express-middleware/lib/languageLookups/header.js +0 -59
- package/debuggingApp/node_modules/i18next-express-middleware/lib/languageLookups/path.js +0 -27
- package/debuggingApp/node_modules/i18next-express-middleware/lib/languageLookups/querystring.js +0 -31
- package/debuggingApp/node_modules/i18next-express-middleware/lib/languageLookups/session.js +0 -27
- package/debuggingApp/node_modules/i18next-express-middleware/lib/utils.js +0 -70
- package/debuggingApp/node_modules/i18next-express-middleware/package.json +0 -43
- package/debuggingApp/node_modules/i18next-node-fs-backend/LICENSE +0 -22
- package/debuggingApp/node_modules/i18next-node-fs-backend/README.md +0 -72
- package/debuggingApp/node_modules/i18next-node-fs-backend/lib/index.js +0 -162
- package/debuggingApp/node_modules/i18next-node-fs-backend/lib/utils.js +0 -78
- package/debuggingApp/node_modules/i18next-node-fs-backend/package.json +0 -43
- package/debuggingApp/node_modules/iconv-lite/Changelog.md +0 -162
- package/debuggingApp/node_modules/iconv-lite/LICENSE +0 -21
- package/debuggingApp/node_modules/iconv-lite/README.md +0 -156
- package/debuggingApp/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -555
- package/debuggingApp/node_modules/iconv-lite/encodings/dbcs-data.js +0 -176
- package/debuggingApp/node_modules/iconv-lite/encodings/index.js +0 -22
- package/debuggingApp/node_modules/iconv-lite/encodings/internal.js +0 -188
- package/debuggingApp/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -72
- package/debuggingApp/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
- package/debuggingApp/node_modules/iconv-lite/encodings/sbcs-data.js +0 -174
- package/debuggingApp/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
- package/debuggingApp/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
- package/debuggingApp/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
- package/debuggingApp/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
- package/debuggingApp/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
- package/debuggingApp/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
- package/debuggingApp/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -55
- package/debuggingApp/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
- package/debuggingApp/node_modules/iconv-lite/encodings/utf16.js +0 -177
- package/debuggingApp/node_modules/iconv-lite/encodings/utf7.js +0 -290
- package/debuggingApp/node_modules/iconv-lite/lib/bom-handling.js +0 -52
- package/debuggingApp/node_modules/iconv-lite/lib/extend-node.js +0 -217
- package/debuggingApp/node_modules/iconv-lite/lib/index.d.ts +0 -24
- package/debuggingApp/node_modules/iconv-lite/lib/index.js +0 -153
- package/debuggingApp/node_modules/iconv-lite/lib/streams.js +0 -121
- package/debuggingApp/node_modules/iconv-lite/package.json +0 -46
- package/debuggingApp/node_modules/inherits/LICENSE +0 -16
- package/debuggingApp/node_modules/inherits/README.md +0 -42
- package/debuggingApp/node_modules/inherits/inherits.js +0 -9
- package/debuggingApp/node_modules/inherits/inherits_browser.js +0 -27
- package/debuggingApp/node_modules/inherits/package.json +0 -29
- package/debuggingApp/node_modules/ipaddr.js/LICENSE +0 -19
- package/debuggingApp/node_modules/ipaddr.js/README.md +0 -233
- package/debuggingApp/node_modules/ipaddr.js/ipaddr.min.js +0 -1
- package/debuggingApp/node_modules/ipaddr.js/lib/ipaddr.js +0 -673
- package/debuggingApp/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +0 -68
- package/debuggingApp/node_modules/ipaddr.js/package.json +0 -35
- package/debuggingApp/node_modules/json5/.travis.yml +0 -5
- package/debuggingApp/node_modules/json5/CHANGELOG.md +0 -144
- package/debuggingApp/node_modules/json5/README.md +0 -271
- package/debuggingApp/node_modules/json5/lib/cli.js +0 -41
- package/debuggingApp/node_modules/json5/lib/json5.js +0 -754
- package/debuggingApp/node_modules/json5/lib/require.js +0 -18
- package/debuggingApp/node_modules/json5/package.json +0 -30
- package/debuggingApp/node_modules/json5/package.json5 +0 -30
- package/debuggingApp/node_modules/json5/test/parse-cases/arrays/empty-array.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/arrays/leading-comma-array.js +0 -3
- package/debuggingApp/node_modules/json5/test/parse-cases/arrays/lone-trailing-comma-array.js +0 -3
- package/debuggingApp/node_modules/json5/test/parse-cases/arrays/no-comma-array.txt +0 -4
- package/debuggingApp/node_modules/json5/test/parse-cases/arrays/regular-array.json +0 -5
- package/debuggingApp/node_modules/json5/test/parse-cases/arrays/trailing-comma-array.json5 +0 -3
- package/debuggingApp/node_modules/json5/test/parse-cases/comments/block-comment-following-array-element.json5 +0 -6
- package/debuggingApp/node_modules/json5/test/parse-cases/comments/block-comment-following-top-level-value.json5 +0 -5
- package/debuggingApp/node_modules/json5/test/parse-cases/comments/block-comment-in-string.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/comments/block-comment-preceding-top-level-value.json5 +0 -5
- package/debuggingApp/node_modules/json5/test/parse-cases/comments/block-comment-with-asterisks.json5 +0 -7
- package/debuggingApp/node_modules/json5/test/parse-cases/comments/inline-comment-following-array-element.json5 +0 -3
- package/debuggingApp/node_modules/json5/test/parse-cases/comments/inline-comment-following-top-level-value.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/comments/inline-comment-in-string.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/comments/inline-comment-preceding-top-level-value.json5 +0 -2
- package/debuggingApp/node_modules/json5/test/parse-cases/comments/top-level-block-comment.txt +0 -4
- package/debuggingApp/node_modules/json5/test/parse-cases/comments/top-level-inline-comment.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/comments/unterminated-block-comment.txt +0 -5
- package/debuggingApp/node_modules/json5/test/parse-cases/misc/empty.txt +0 -0
- package/debuggingApp/node_modules/json5/test/parse-cases/misc/npm-package.json +0 -106
- package/debuggingApp/node_modules/json5/test/parse-cases/misc/npm-package.json5 +0 -106
- package/debuggingApp/node_modules/json5/test/parse-cases/misc/readme-example.json5 +0 -25
- package/debuggingApp/node_modules/json5/test/parse-cases/misc/valid-whitespace.json5 +0 -5
- package/debuggingApp/node_modules/json5/test/parse-cases/new-lines/.gitattributes +0 -4
- package/debuggingApp/node_modules/json5/test/parse-cases/new-lines/comment-cr.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/new-lines/comment-crlf.json5 +0 -3
- package/debuggingApp/node_modules/json5/test/parse-cases/new-lines/comment-lf.json5 +0 -3
- package/debuggingApp/node_modules/json5/test/parse-cases/new-lines/escaped-cr.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/new-lines/escaped-crlf.json5 +0 -5
- package/debuggingApp/node_modules/json5/test/parse-cases/new-lines/escaped-lf.json5 +0 -5
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/binary-coffeescript.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/float-leading-decimal-point.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/float-leading-zero.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/float-trailing-decimal-point-with-integer-exponent.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/float-trailing-decimal-point.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/float-with-integer-exponent.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/float.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/hexadecimal-empty.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/hexadecimal-lowercase-letter.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/hexadecimal-uppercase-x.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/hexadecimal-with-integer-exponent.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/hexadecimal.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/infinity.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-float-exponent.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-hexadecimal-exponent.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-integer-exponent.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-negative-float-exponent.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-negative-hexadecimal-exponent.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-negative-integer-exponent.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-negative-zero-integer-exponent.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-positive-float-exponent.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-positive-hexadecimal-exponent.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-positive-integer-exponent.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-positive-zero-integer-exponent.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer-with-zero-integer-exponent.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/integer.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/lone-decimal-point.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/nan.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-binary-coffeescript.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-float-leading-decimal-point.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-float-leading-zero.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-float-trailing-decimal-point.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-float.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-hexadecimal.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-infinity.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-integer.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-noctal.js +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-octal-coffeescript.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-octal.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-zero-binary-coffeescript.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-zero-float-leading-decimal-point.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-zero-float-trailing-decimal-point.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-zero-float.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-zero-hexadecimal.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-zero-integer.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-zero-octal-coffeescript.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/negative-zero-octal.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/noctal-with-leading-octal-digit.js +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/noctal.js +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/octal-coffeescript.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/octal.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-binary-coffeescript.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-float-leading-decimal-point.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-float-leading-zero.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-float-trailing-decimal-point.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-float.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-hexadecimal.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-infinity.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-integer.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-noctal.js +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-octal-coffeescript.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-octal.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-zero-binary-coffeescript.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-zero-float-leading-decimal-point.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-zero-float-trailing-decimal-point.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-zero-float.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-zero-hexadecimal.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-zero-integer.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-zero-octal-coffeescript.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/positive-zero-octal.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/zero-binary-coffeescript.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/zero-float-leading-decimal-point.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/zero-float-trailing-decimal-point.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/zero-float.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/zero-hexadecimal.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/zero-integer-with-integer-exponent.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/zero-integer.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/zero-octal-coffeescript.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/numbers/zero-octal.txt +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/objects/duplicate-keys.json +0 -4
- package/debuggingApp/node_modules/json5/test/parse-cases/objects/empty-object.json +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/objects/illegal-unquoted-key-number.txt +0 -3
- package/debuggingApp/node_modules/json5/test/parse-cases/objects/illegal-unquoted-key-symbol.txt +0 -3
- package/debuggingApp/node_modules/json5/test/parse-cases/objects/leading-comma-object.txt +0 -3
- package/debuggingApp/node_modules/json5/test/parse-cases/objects/lone-trailing-comma-object.txt +0 -3
- package/debuggingApp/node_modules/json5/test/parse-cases/objects/no-comma-object.txt +0 -4
- package/debuggingApp/node_modules/json5/test/parse-cases/objects/reserved-unquoted-key.json5 +0 -3
- package/debuggingApp/node_modules/json5/test/parse-cases/objects/single-quoted-key.json5 +0 -3
- package/debuggingApp/node_modules/json5/test/parse-cases/objects/trailing-comma-object.json5 +0 -3
- package/debuggingApp/node_modules/json5/test/parse-cases/objects/unquoted-keys.json5 +0 -8
- package/debuggingApp/node_modules/json5/test/parse-cases/strings/escaped-single-quoted-string.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/strings/multi-line-string.json5 +0 -2
- package/debuggingApp/node_modules/json5/test/parse-cases/strings/single-quoted-string.json5 +0 -1
- package/debuggingApp/node_modules/json5/test/parse-cases/strings/unescaped-multi-line-string.txt +0 -2
- package/debuggingApp/node_modules/json5/test/parse-cases/todo/unicode-escaped-unquoted-key.json5 +0 -3
- package/debuggingApp/node_modules/json5/test/parse-cases/todo/unicode-unquoted-key.json5 +0 -3
- package/debuggingApp/node_modules/json5/test/parse.js +0 -89
- package/debuggingApp/node_modules/json5/test/readme.md +0 -23
- package/debuggingApp/node_modules/json5/test/require.js +0 -18
- package/debuggingApp/node_modules/json5/test/stringify.js +0 -498
- package/debuggingApp/node_modules/keygrip/HISTORY.md +0 -20
- package/debuggingApp/node_modules/keygrip/LICENSE +0 -21
- package/debuggingApp/node_modules/keygrip/README.md +0 -103
- package/debuggingApp/node_modules/keygrip/index.js +0 -71
- package/debuggingApp/node_modules/keygrip/package.json +0 -25
- package/debuggingApp/node_modules/media-typer/HISTORY.md +0 -22
- package/debuggingApp/node_modules/media-typer/LICENSE +0 -22
- package/debuggingApp/node_modules/media-typer/README.md +0 -81
- package/debuggingApp/node_modules/media-typer/index.js +0 -270
- package/debuggingApp/node_modules/media-typer/package.json +0 -26
- package/debuggingApp/node_modules/merge-descriptors/HISTORY.md +0 -21
- package/debuggingApp/node_modules/merge-descriptors/LICENSE +0 -23
- package/debuggingApp/node_modules/merge-descriptors/README.md +0 -48
- package/debuggingApp/node_modules/merge-descriptors/index.js +0 -60
- package/debuggingApp/node_modules/merge-descriptors/package.json +0 -32
- package/debuggingApp/node_modules/methods/HISTORY.md +0 -29
- package/debuggingApp/node_modules/methods/LICENSE +0 -24
- package/debuggingApp/node_modules/methods/README.md +0 -51
- package/debuggingApp/node_modules/methods/index.js +0 -69
- package/debuggingApp/node_modules/methods/package.json +0 -36
- package/debuggingApp/node_modules/mime/CHANGELOG.md +0 -164
- package/debuggingApp/node_modules/mime/LICENSE +0 -21
- package/debuggingApp/node_modules/mime/README.md +0 -90
- package/debuggingApp/node_modules/mime/cli.js +0 -8
- package/debuggingApp/node_modules/mime/mime.js +0 -108
- package/debuggingApp/node_modules/mime/package.json +0 -44
- package/debuggingApp/node_modules/mime/src/build.js +0 -53
- package/debuggingApp/node_modules/mime/src/test.js +0 -60
- package/debuggingApp/node_modules/mime/types.json +0 -1
- package/debuggingApp/node_modules/mime-db/HISTORY.md +0 -507
- package/debuggingApp/node_modules/mime-db/LICENSE +0 -23
- package/debuggingApp/node_modules/mime-db/README.md +0 -100
- package/debuggingApp/node_modules/mime-db/db.json +0 -8519
- package/debuggingApp/node_modules/mime-db/index.js +0 -12
- package/debuggingApp/node_modules/mime-db/package.json +0 -60
- package/debuggingApp/node_modules/mime-types/HISTORY.md +0 -397
- package/debuggingApp/node_modules/mime-types/LICENSE +0 -23
- package/debuggingApp/node_modules/mime-types/README.md +0 -113
- package/debuggingApp/node_modules/mime-types/index.js +0 -188
- package/debuggingApp/node_modules/mime-types/package.json +0 -44
- package/debuggingApp/node_modules/ms/index.js +0 -152
- package/debuggingApp/node_modules/ms/license.md +0 -21
- package/debuggingApp/node_modules/ms/package.json +0 -37
- package/debuggingApp/node_modules/ms/readme.md +0 -51
- package/debuggingApp/node_modules/negotiator/HISTORY.md +0 -108
- package/debuggingApp/node_modules/negotiator/LICENSE +0 -24
- package/debuggingApp/node_modules/negotiator/README.md +0 -203
- package/debuggingApp/node_modules/negotiator/index.js +0 -82
- package/debuggingApp/node_modules/negotiator/lib/charset.js +0 -169
- package/debuggingApp/node_modules/negotiator/lib/encoding.js +0 -184
- package/debuggingApp/node_modules/negotiator/lib/language.js +0 -179
- package/debuggingApp/node_modules/negotiator/lib/mediaType.js +0 -294
- package/debuggingApp/node_modules/negotiator/package.json +0 -42
- package/debuggingApp/node_modules/object-inspect/.github/FUNDING.yml +0 -12
- package/debuggingApp/node_modules/object-inspect/.nycrc +0 -13
- package/debuggingApp/node_modules/object-inspect/CHANGELOG.md +0 -360
- package/debuggingApp/node_modules/object-inspect/LICENSE +0 -21
- package/debuggingApp/node_modules/object-inspect/example/all.js +0 -23
- package/debuggingApp/node_modules/object-inspect/example/circular.js +0 -6
- package/debuggingApp/node_modules/object-inspect/example/fn.js +0 -5
- package/debuggingApp/node_modules/object-inspect/example/inspect.js +0 -10
- package/debuggingApp/node_modules/object-inspect/index.js +0 -512
- package/debuggingApp/node_modules/object-inspect/package-support.json +0 -20
- package/debuggingApp/node_modules/object-inspect/package.json +0 -94
- package/debuggingApp/node_modules/object-inspect/readme.markdown +0 -86
- package/debuggingApp/node_modules/object-inspect/test/bigint.js +0 -58
- package/debuggingApp/node_modules/object-inspect/test/browser/dom.js +0 -15
- package/debuggingApp/node_modules/object-inspect/test/circular.js +0 -16
- package/debuggingApp/node_modules/object-inspect/test/deep.js +0 -12
- package/debuggingApp/node_modules/object-inspect/test/element.js +0 -53
- package/debuggingApp/node_modules/object-inspect/test/err.js +0 -48
- package/debuggingApp/node_modules/object-inspect/test/fakes.js +0 -29
- package/debuggingApp/node_modules/object-inspect/test/fn.js +0 -76
- package/debuggingApp/node_modules/object-inspect/test/has.js +0 -15
- package/debuggingApp/node_modules/object-inspect/test/holes.js +0 -15
- package/debuggingApp/node_modules/object-inspect/test/indent-option.js +0 -271
- package/debuggingApp/node_modules/object-inspect/test/inspect.js +0 -139
- package/debuggingApp/node_modules/object-inspect/test/lowbyte.js +0 -12
- package/debuggingApp/node_modules/object-inspect/test/number.js +0 -58
- package/debuggingApp/node_modules/object-inspect/test/quoteStyle.js +0 -17
- package/debuggingApp/node_modules/object-inspect/test/toStringTag.js +0 -40
- package/debuggingApp/node_modules/object-inspect/test/undef.js +0 -12
- package/debuggingApp/node_modules/object-inspect/test/values.js +0 -211
- package/debuggingApp/node_modules/object-inspect/test-core-js.js +0 -26
- package/debuggingApp/node_modules/object-inspect/util.inspect.js +0 -1
- package/debuggingApp/node_modules/on-finished/HISTORY.md +0 -98
- package/debuggingApp/node_modules/on-finished/LICENSE +0 -23
- package/debuggingApp/node_modules/on-finished/README.md +0 -162
- package/debuggingApp/node_modules/on-finished/index.js +0 -234
- package/debuggingApp/node_modules/on-finished/package.json +0 -39
- package/debuggingApp/node_modules/parseurl/HISTORY.md +0 -58
- package/debuggingApp/node_modules/parseurl/LICENSE +0 -24
- package/debuggingApp/node_modules/parseurl/README.md +0 -133
- package/debuggingApp/node_modules/parseurl/index.js +0 -158
- package/debuggingApp/node_modules/parseurl/package.json +0 -40
- package/debuggingApp/node_modules/path-to-regexp/History.md +0 -36
- package/debuggingApp/node_modules/path-to-regexp/LICENSE +0 -21
- package/debuggingApp/node_modules/path-to-regexp/Readme.md +0 -35
- package/debuggingApp/node_modules/path-to-regexp/index.js +0 -129
- package/debuggingApp/node_modules/path-to-regexp/package.json +0 -30
- package/debuggingApp/node_modules/proxy-addr/HISTORY.md +0 -161
- package/debuggingApp/node_modules/proxy-addr/LICENSE +0 -22
- package/debuggingApp/node_modules/proxy-addr/README.md +0 -139
- package/debuggingApp/node_modules/proxy-addr/index.js +0 -327
- package/debuggingApp/node_modules/proxy-addr/package.json +0 -47
- package/debuggingApp/node_modules/qs/.github/FUNDING.yml +0 -12
- package/debuggingApp/node_modules/qs/.nycrc +0 -13
- package/debuggingApp/node_modules/qs/CHANGELOG.md +0 -388
- package/debuggingApp/node_modules/qs/LICENSE.md +0 -29
- package/debuggingApp/node_modules/qs/README.md +0 -623
- package/debuggingApp/node_modules/qs/dist/qs.js +0 -2044
- package/debuggingApp/node_modules/qs/lib/formats.js +0 -23
- package/debuggingApp/node_modules/qs/lib/index.js +0 -11
- package/debuggingApp/node_modules/qs/lib/parse.js +0 -263
- package/debuggingApp/node_modules/qs/lib/stringify.js +0 -317
- package/debuggingApp/node_modules/qs/lib/utils.js +0 -252
- package/debuggingApp/node_modules/qs/package.json +0 -73
- package/debuggingApp/node_modules/qs/test/parse.js +0 -841
- package/debuggingApp/node_modules/qs/test/stringify.js +0 -865
- package/debuggingApp/node_modules/qs/test/utils.js +0 -136
- package/debuggingApp/node_modules/range-parser/HISTORY.md +0 -56
- package/debuggingApp/node_modules/range-parser/LICENSE +0 -23
- package/debuggingApp/node_modules/range-parser/README.md +0 -84
- package/debuggingApp/node_modules/range-parser/index.js +0 -162
- package/debuggingApp/node_modules/range-parser/package.json +0 -44
- package/debuggingApp/node_modules/raw-body/HISTORY.md +0 -303
- package/debuggingApp/node_modules/raw-body/LICENSE +0 -22
- package/debuggingApp/node_modules/raw-body/README.md +0 -223
- package/debuggingApp/node_modules/raw-body/SECURITY.md +0 -24
- package/debuggingApp/node_modules/raw-body/index.d.ts +0 -87
- package/debuggingApp/node_modules/raw-body/index.js +0 -329
- package/debuggingApp/node_modules/raw-body/package.json +0 -49
- package/debuggingApp/node_modules/regenerator-runtime/LICENSE +0 -21
- package/debuggingApp/node_modules/regenerator-runtime/README.md +0 -31
- package/debuggingApp/node_modules/regenerator-runtime/package.json +0 -19
- package/debuggingApp/node_modules/regenerator-runtime/path.js +0 -11
- package/debuggingApp/node_modules/regenerator-runtime/runtime.js +0 -754
- package/debuggingApp/node_modules/safe-buffer/LICENSE +0 -21
- package/debuggingApp/node_modules/safe-buffer/README.md +0 -584
- package/debuggingApp/node_modules/safe-buffer/index.d.ts +0 -187
- package/debuggingApp/node_modules/safe-buffer/index.js +0 -65
- package/debuggingApp/node_modules/safe-buffer/package.json +0 -51
- package/debuggingApp/node_modules/safer-buffer/LICENSE +0 -21
- package/debuggingApp/node_modules/safer-buffer/Porting-Buffer.md +0 -268
- package/debuggingApp/node_modules/safer-buffer/Readme.md +0 -156
- package/debuggingApp/node_modules/safer-buffer/dangerous.js +0 -58
- package/debuggingApp/node_modules/safer-buffer/package.json +0 -34
- package/debuggingApp/node_modules/safer-buffer/safer.js +0 -77
- package/debuggingApp/node_modules/safer-buffer/tests.js +0 -406
- package/debuggingApp/node_modules/send/HISTORY.md +0 -521
- package/debuggingApp/node_modules/send/LICENSE +0 -23
- package/debuggingApp/node_modules/send/README.md +0 -327
- package/debuggingApp/node_modules/send/SECURITY.md +0 -24
- package/debuggingApp/node_modules/send/index.js +0 -1143
- package/debuggingApp/node_modules/send/node_modules/ms/index.js +0 -162
- package/debuggingApp/node_modules/send/node_modules/ms/license.md +0 -21
- package/debuggingApp/node_modules/send/node_modules/ms/package.json +0 -38
- package/debuggingApp/node_modules/send/node_modules/ms/readme.md +0 -59
- package/debuggingApp/node_modules/send/package.json +0 -62
- package/debuggingApp/node_modules/serve-static/HISTORY.md +0 -471
- package/debuggingApp/node_modules/serve-static/LICENSE +0 -25
- package/debuggingApp/node_modules/serve-static/README.md +0 -257
- package/debuggingApp/node_modules/serve-static/index.js +0 -210
- package/debuggingApp/node_modules/serve-static/package.json +0 -42
- package/debuggingApp/node_modules/setprototypeof/LICENSE +0 -13
- package/debuggingApp/node_modules/setprototypeof/README.md +0 -31
- package/debuggingApp/node_modules/setprototypeof/index.d.ts +0 -2
- package/debuggingApp/node_modules/setprototypeof/index.js +0 -17
- package/debuggingApp/node_modules/setprototypeof/package.json +0 -38
- package/debuggingApp/node_modules/setprototypeof/test/index.js +0 -24
- package/debuggingApp/node_modules/side-channel/.github/FUNDING.yml +0 -12
- package/debuggingApp/node_modules/side-channel/.nycrc +0 -13
- package/debuggingApp/node_modules/side-channel/CHANGELOG.md +0 -65
- package/debuggingApp/node_modules/side-channel/LICENSE +0 -21
- package/debuggingApp/node_modules/side-channel/README.md +0 -2
- package/debuggingApp/node_modules/side-channel/index.js +0 -124
- package/debuggingApp/node_modules/side-channel/package.json +0 -67
- package/debuggingApp/node_modules/side-channel/test/index.js +0 -78
- package/debuggingApp/node_modules/statuses/HISTORY.md +0 -82
- package/debuggingApp/node_modules/statuses/LICENSE +0 -23
- package/debuggingApp/node_modules/statuses/README.md +0 -136
- package/debuggingApp/node_modules/statuses/codes.json +0 -65
- package/debuggingApp/node_modules/statuses/index.js +0 -146
- package/debuggingApp/node_modules/statuses/package.json +0 -49
- package/debuggingApp/node_modules/toidentifier/HISTORY.md +0 -9
- package/debuggingApp/node_modules/toidentifier/LICENSE +0 -21
- package/debuggingApp/node_modules/toidentifier/README.md +0 -61
- package/debuggingApp/node_modules/toidentifier/index.js +0 -32
- package/debuggingApp/node_modules/toidentifier/package.json +0 -38
- package/debuggingApp/node_modules/type-is/HISTORY.md +0 -259
- package/debuggingApp/node_modules/type-is/LICENSE +0 -23
- package/debuggingApp/node_modules/type-is/README.md +0 -170
- package/debuggingApp/node_modules/type-is/index.js +0 -266
- package/debuggingApp/node_modules/type-is/package.json +0 -45
- package/debuggingApp/node_modules/unpipe/HISTORY.md +0 -4
- package/debuggingApp/node_modules/unpipe/LICENSE +0 -22
- package/debuggingApp/node_modules/unpipe/README.md +0 -43
- package/debuggingApp/node_modules/unpipe/index.js +0 -69
- package/debuggingApp/node_modules/unpipe/package.json +0 -27
- package/debuggingApp/node_modules/utils-merge/LICENSE +0 -20
- package/debuggingApp/node_modules/utils-merge/README.md +0 -34
- package/debuggingApp/node_modules/utils-merge/index.js +0 -23
- package/debuggingApp/node_modules/utils-merge/package.json +0 -40
- package/debuggingApp/node_modules/vary/HISTORY.md +0 -39
- package/debuggingApp/node_modules/vary/LICENSE +0 -22
- package/debuggingApp/node_modules/vary/README.md +0 -101
- package/debuggingApp/node_modules/vary/index.js +0 -149
- package/debuggingApp/node_modules/vary/package.json +0 -43
- package/debuggingApp/package-lock.json +0 -1162
- package/debuggingApp/package.json +0 -18
- package/debuggingApp/server.js +0 -42
- package/dist/cjs/locize.js +0 -464
- package/dist/esm/locize.js +0 -454
package/dist/umd/locize.js
CHANGED
|
@@ -4,65 +4,2292 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.locize = {}));
|
|
5
5
|
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
|
-
function
|
|
8
|
-
|
|
7
|
+
function _typeof(o) {
|
|
8
|
+
"@babel/helpers - typeof";
|
|
9
|
+
|
|
10
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
11
|
+
return typeof o;
|
|
12
|
+
} : function (o) {
|
|
13
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
14
|
+
}, _typeof(o);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function _toPrimitive(input, hint) {
|
|
18
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
|
19
|
+
var prim = input[Symbol.toPrimitive];
|
|
20
|
+
if (prim !== undefined) {
|
|
21
|
+
var res = prim.call(input, hint || "default");
|
|
22
|
+
if (_typeof(res) !== "object") return res;
|
|
23
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
24
|
+
}
|
|
25
|
+
return (hint === "string" ? String : Number)(input);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function _toPropertyKey(arg) {
|
|
29
|
+
var key = _toPrimitive(arg, "string");
|
|
30
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function _defineProperty(obj, key, value) {
|
|
34
|
+
key = _toPropertyKey(key);
|
|
35
|
+
if (key in obj) {
|
|
36
|
+
Object.defineProperty(obj, key, {
|
|
37
|
+
value: value,
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true
|
|
41
|
+
});
|
|
42
|
+
} else {
|
|
43
|
+
obj[key] = value;
|
|
44
|
+
}
|
|
45
|
+
return obj;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
var INVISIBLE_CHARACTERS = ["\u200B", "\u200C"];
|
|
49
|
+
var INVISIBLE_REGEX = RegExp("([".concat(INVISIBLE_CHARACTERS.join(''), "]{9})+"), 'gu');
|
|
50
|
+
var TEMPLATE_MINIMUM_LENGTH = '{"k":"a"}'.length;
|
|
51
|
+
var invisibleStartMarker = 'subliminal:start';
|
|
52
|
+
var toBytes = function toBytes(text) {
|
|
53
|
+
return Array.from(new TextEncoder().encode(text));
|
|
54
|
+
};
|
|
55
|
+
var fromBytes = function fromBytes(bytes) {
|
|
56
|
+
return new TextDecoder().decode(new Uint8Array(bytes));
|
|
57
|
+
};
|
|
58
|
+
var padToWholeBytes = function padToWholeBytes(binary) {
|
|
59
|
+
var needsToAdd = 8 - binary.length;
|
|
60
|
+
return '0'.repeat(needsToAdd) + binary;
|
|
61
|
+
};
|
|
62
|
+
var encodeMessage = function encodeMessage(text) {
|
|
63
|
+
var bytes = toBytes(text).map(Number);
|
|
64
|
+
var binary = bytes.map(function (byte) {
|
|
65
|
+
return padToWholeBytes(byte.toString(2)) + '0';
|
|
66
|
+
}).join('');
|
|
67
|
+
var result = Array.from(binary).map(function (b) {
|
|
68
|
+
return INVISIBLE_CHARACTERS[Number(b)];
|
|
69
|
+
}).join('');
|
|
70
|
+
return result;
|
|
71
|
+
};
|
|
72
|
+
var encodedInvisibleStartMarker = encodeMessage(invisibleStartMarker) ;
|
|
73
|
+
var decodeMessage = function decodeMessage(message) {
|
|
74
|
+
var binary = Array.from(message).map(function (character) {
|
|
75
|
+
return INVISIBLE_CHARACTERS.indexOf(character);
|
|
76
|
+
}).map(String).join('');
|
|
77
|
+
var textBytes = binary.match(/(.{9})/g);
|
|
78
|
+
var codes = Uint8Array.from((textBytes === null || textBytes === void 0 ? void 0 : textBytes.map(function (byte) {
|
|
79
|
+
return parseInt(byte.slice(0, 8), 2);
|
|
80
|
+
})) || []);
|
|
81
|
+
return fromBytes(codes);
|
|
82
|
+
};
|
|
83
|
+
var decodeFromText = function decodeFromText(text) {
|
|
84
|
+
var _text$match;
|
|
85
|
+
var invisibleMessages = (_text$match = text.match(INVISIBLE_REGEX)) === null || _text$match === void 0 ? void 0 : _text$match.filter(function (m) {
|
|
86
|
+
return m.length > TEMPLATE_MINIMUM_LENGTH - 1;
|
|
87
|
+
});
|
|
88
|
+
if (!invisibleMessages || invisibleMessages.length === 0) return;
|
|
89
|
+
return decodeMessage(invisibleMessages[invisibleMessages.length - 1]);
|
|
90
|
+
};
|
|
91
|
+
var removeInvisibles = function removeInvisibles(text) {
|
|
92
|
+
return text.replace(INVISIBLE_REGEX, '');
|
|
93
|
+
};
|
|
94
|
+
var encodeValue = function encodeValue(data) {
|
|
95
|
+
if (Object.keys(data).length === 0) return data;
|
|
96
|
+
var value = {
|
|
97
|
+
k: data.key,
|
|
98
|
+
n: data.ns,
|
|
99
|
+
l: data.lng,
|
|
100
|
+
s: data.source
|
|
101
|
+
};
|
|
102
|
+
return JSON.stringify(value);
|
|
103
|
+
};
|
|
104
|
+
var decodeValue = function decodeValue(value) {
|
|
105
|
+
if (!value || typeof value !== 'string' || value.indexOf('{') !== 0) return;
|
|
106
|
+
try {
|
|
107
|
+
var parsed = JSON.parse(value || '{}');
|
|
108
|
+
return {
|
|
109
|
+
key: parsed.k,
|
|
110
|
+
ns: parsed.n,
|
|
111
|
+
lng: parsed.l,
|
|
112
|
+
source: parsed.s
|
|
113
|
+
};
|
|
114
|
+
} catch (e) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
function wrap(text) {
|
|
119
|
+
var invisibleMeta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
120
|
+
var encodedValue = encodeValue(invisibleMeta);
|
|
121
|
+
var invisibleMark = encodeMessage(encodedValue);
|
|
122
|
+
return typeof text === 'string' && text ? encodedInvisibleStartMarker + text + invisibleMark : text;
|
|
123
|
+
}
|
|
124
|
+
function unwrap(text) {
|
|
125
|
+
var encodedValue = decodeFromText(text);
|
|
126
|
+
var decodedVal = decodeValue(encodedValue);
|
|
127
|
+
var result = removeInvisibles(text);
|
|
128
|
+
return {
|
|
129
|
+
text: result,
|
|
130
|
+
invisibleMeta: decodedVal
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
function containsHiddenMeta(text) {
|
|
134
|
+
if (!text || text.length < 27) return false;
|
|
135
|
+
if (!INVISIBLE_REGEX.test(text)) return false;
|
|
136
|
+
var lastByte = text.substring(text.length - 9);
|
|
137
|
+
var lastChar = decodeMessage(lastByte);
|
|
138
|
+
return lastChar === '}';
|
|
139
|
+
}
|
|
140
|
+
function containsHiddenStartMarker(text) {
|
|
141
|
+
return text.startsWith(encodedInvisibleStartMarker);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function ownKeys$8(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
145
|
+
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
146
|
+
var postProcessorName = 'subliminal';
|
|
147
|
+
var SubliminalPostProcessor = {
|
|
148
|
+
name: postProcessorName,
|
|
149
|
+
type: 'postProcessor',
|
|
150
|
+
options: {},
|
|
151
|
+
setOptions: function setOptions(options) {
|
|
152
|
+
this.options = _objectSpread$8(_objectSpread$8({}, options), this.options);
|
|
153
|
+
},
|
|
154
|
+
process: function process(value, keyIn, options, translator) {
|
|
155
|
+
var opt = this.options = _objectSpread$8(_objectSpread$8({}, options), this.options);
|
|
156
|
+
var key, ns, lng, source;
|
|
157
|
+
if (options.i18nResolved) {
|
|
158
|
+
key = options.i18nResolved.exactUsedKey;
|
|
159
|
+
ns = options.i18nResolved.usedNS;
|
|
160
|
+
lng = options.i18nResolved.usedLng;
|
|
161
|
+
if (options.i18nResolved.res === undefined) {
|
|
162
|
+
if (key !== value) {
|
|
163
|
+
source = 'default';
|
|
164
|
+
} else {
|
|
165
|
+
source = 'key';
|
|
166
|
+
}
|
|
167
|
+
} else {
|
|
168
|
+
source = 'translation';
|
|
169
|
+
}
|
|
170
|
+
} else {
|
|
171
|
+
var _ref, _opt$keySeparator, _translator$options, _ref2, _namespaces$, _translator$options2;
|
|
172
|
+
var keySeparator = (_ref = (_opt$keySeparator = opt.keySeparator) !== null && _opt$keySeparator !== void 0 ? _opt$keySeparator : translator === null || translator === void 0 || (_translator$options = translator.options) === null || _translator$options === void 0 ? void 0 : _translator$options.keySeparator) !== null && _ref !== void 0 ? _ref : '.';
|
|
173
|
+
var _translator$extractFr = translator.extractFromKey(keyIn.join(keySeparator), options),
|
|
174
|
+
extractedKey = _translator$extractFr.key,
|
|
175
|
+
namespaces = _translator$extractFr.namespaces;
|
|
176
|
+
key = extractedKey;
|
|
177
|
+
ns = (_ref2 = (_namespaces$ = namespaces === null || namespaces === void 0 ? void 0 : namespaces[0]) !== null && _namespaces$ !== void 0 ? _namespaces$ : opt.ns) !== null && _ref2 !== void 0 ? _ref2 : translator === null || translator === void 0 || (_translator$options2 = translator.options) === null || _translator$options2 === void 0 ? void 0 : _translator$options2.defaultNS;
|
|
178
|
+
lng = options.lng || this.language;
|
|
179
|
+
if (key === value) {
|
|
180
|
+
source = 'key';
|
|
181
|
+
} else {
|
|
182
|
+
source = 'translation';
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return wrap(value, {
|
|
186
|
+
key: key,
|
|
187
|
+
ns: ns,
|
|
188
|
+
lng: lng,
|
|
189
|
+
source: source
|
|
190
|
+
});
|
|
191
|
+
},
|
|
192
|
+
overloadTranslationOptionHandler: function overloadTranslationOptionHandler() {
|
|
193
|
+
return {
|
|
194
|
+
postProcess: postProcessorName,
|
|
195
|
+
postProcessPassResolved: true
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
var validAttributes = ['placeholder', 'title', 'alt'];
|
|
201
|
+
var colors = {
|
|
202
|
+
highlight: '#26a69a',
|
|
203
|
+
warning: '#e67a00'
|
|
204
|
+
};
|
|
205
|
+
var getIframeUrl = function getIframeUrl() {
|
|
206
|
+
var _prc$env;
|
|
207
|
+
var p;
|
|
208
|
+
if (typeof process !== 'undefined') p = process;
|
|
209
|
+
if (!p && typeof window !== 'undefined') p = window.process;
|
|
210
|
+
var prc = p || {};
|
|
211
|
+
var env = ((_prc$env = prc.env) === null || _prc$env === void 0 ? void 0 : _prc$env.locizeIncontext) || 'production';
|
|
212
|
+
return env === 'development' ? 'http://localhost:3003/' : env === 'staging' ? 'https://incontext-dev.locize.app' : 'https://incontext.locize.app';
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
var sheet = function () {
|
|
216
|
+
if (typeof document === 'undefined') return;
|
|
217
|
+
var style = document.createElement('style');
|
|
218
|
+
document.head.appendChild(style);
|
|
219
|
+
return style.sheet;
|
|
220
|
+
}();
|
|
221
|
+
|
|
222
|
+
function ownKeys$7(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
223
|
+
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
224
|
+
function addLocizeSavedHandler(handler) {
|
|
225
|
+
api.locizeSavedHandler = handler;
|
|
226
|
+
}
|
|
227
|
+
function turnOn() {
|
|
228
|
+
api.scriptTurnedOff = false;
|
|
229
|
+
api.turnOn();
|
|
230
|
+
return api.scriptTurnedOff;
|
|
231
|
+
}
|
|
232
|
+
function turnOff() {
|
|
233
|
+
api.turnOff();
|
|
234
|
+
api.scriptTurnedOff = true;
|
|
235
|
+
return api.scriptTurnedOff;
|
|
236
|
+
}
|
|
237
|
+
function setEditorLng(lng) {
|
|
238
|
+
api.sendCurrentTargetLanguage(lng);
|
|
239
|
+
}
|
|
240
|
+
var pendingMsgs = [];
|
|
241
|
+
function sendMessage(action, payload) {
|
|
242
|
+
if (!api.source) {
|
|
243
|
+
var _document$getElementB;
|
|
244
|
+
api.source = (_document$getElementB = document.getElementById('i18next-editor-iframe')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.contentWindow;
|
|
245
|
+
}
|
|
246
|
+
if (!api.origin) api.origin = getIframeUrl();
|
|
247
|
+
if (!api.source || !api.source.postMessage) {
|
|
248
|
+
pendingMsgs.push({
|
|
249
|
+
action: action,
|
|
250
|
+
payload: payload
|
|
251
|
+
});
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
if (api.legacy) {
|
|
255
|
+
api.source.postMessage(_objectSpread$7({
|
|
256
|
+
message: action
|
|
257
|
+
}, payload), api.origin);
|
|
258
|
+
} else {
|
|
259
|
+
api.source.postMessage({
|
|
260
|
+
sender: 'i18next-editor',
|
|
261
|
+
senderAPIVersion: 'v1',
|
|
262
|
+
action: action,
|
|
263
|
+
message: action,
|
|
264
|
+
payload: payload
|
|
265
|
+
}, api.origin);
|
|
266
|
+
}
|
|
267
|
+
var todo = pendingMsgs;
|
|
268
|
+
pendingMsgs = [];
|
|
269
|
+
todo.forEach(function (_ref) {
|
|
270
|
+
var action = _ref.action,
|
|
271
|
+
payload = _ref.payload;
|
|
272
|
+
sendMessage(action, payload);
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
var handlers = {};
|
|
276
|
+
var repeat = 5;
|
|
277
|
+
var api = {
|
|
278
|
+
init: function init(implementation, clickHandler) {
|
|
279
|
+
api.i18n = implementation;
|
|
280
|
+
api.clickHandler = clickHandler;
|
|
281
|
+
},
|
|
282
|
+
requestInitialize: function requestInitialize(payload) {
|
|
283
|
+
sendMessage('requestInitialize', payload);
|
|
284
|
+
api.initInterval = setInterval(function () {
|
|
285
|
+
repeat = repeat - 1;
|
|
286
|
+
api.requestInitialize(payload);
|
|
287
|
+
if (repeat < 0 && api.initInterval) clearInterval(api.initInterval);
|
|
288
|
+
}, 1000);
|
|
289
|
+
},
|
|
290
|
+
selectKey: function selectKey(meta) {
|
|
291
|
+
sendMessage('selectKey', meta);
|
|
292
|
+
},
|
|
293
|
+
confirmResourceBundle: function confirmResourceBundle(payload) {
|
|
294
|
+
sendMessage('confirmResourceBundle', payload);
|
|
295
|
+
},
|
|
296
|
+
sendCurrentParsedContent: function sendCurrentParsedContent() {
|
|
297
|
+
sendMessage('sendCurrentParsedContent', {
|
|
298
|
+
content: Object.values(store.data).map(function (item) {
|
|
299
|
+
return {
|
|
300
|
+
id: item.id,
|
|
301
|
+
keys: item.keys
|
|
302
|
+
};
|
|
303
|
+
})
|
|
304
|
+
});
|
|
305
|
+
},
|
|
306
|
+
sendCurrentTargetLanguage: function sendCurrentTargetLanguage(lng) {
|
|
307
|
+
sendMessage('sendCurrentTargetLanguage', {
|
|
308
|
+
targetLng: lng || api.i18n.getLng()
|
|
309
|
+
});
|
|
310
|
+
},
|
|
311
|
+
addHandler: function addHandler(action, fc) {
|
|
312
|
+
if (!handlers[action]) handlers[action] = [];
|
|
313
|
+
handlers[action].push(fc);
|
|
314
|
+
},
|
|
315
|
+
sendLocizeIsEnabled: function sendLocizeIsEnabled() {
|
|
316
|
+
sendMessage('locizeIsEnabled', {
|
|
317
|
+
enabled: true
|
|
318
|
+
});
|
|
319
|
+
},
|
|
320
|
+
turnOn: function turnOn() {
|
|
321
|
+
if (api.scriptTurnedOff) return sendMessage('forcedOff');
|
|
322
|
+
if (!api.clickInterceptionEnabled) {
|
|
323
|
+
window.document.body.addEventListener('click', api.clickHandler, true);
|
|
324
|
+
}
|
|
325
|
+
api.clickInterceptionEnabled = true;
|
|
326
|
+
sendMessage('turnedOn');
|
|
327
|
+
},
|
|
328
|
+
turnOff: function turnOff() {
|
|
329
|
+
if (api.scriptTurnedOff) return sendMessage('forcedOff');
|
|
330
|
+
if (api.clickInterceptionEnabled) {
|
|
331
|
+
window.document.body.removeEventListener('click', api.clickHandler, true);
|
|
332
|
+
}
|
|
333
|
+
api.clickInterceptionEnabled = false;
|
|
334
|
+
sendMessage('turnedOff');
|
|
335
|
+
},
|
|
336
|
+
onAddedKey: function onAddedKey(lng, ns, key, value) {
|
|
337
|
+
var msg = {
|
|
338
|
+
lng: lng,
|
|
339
|
+
ns: ns,
|
|
340
|
+
key: key,
|
|
341
|
+
value: value
|
|
342
|
+
};
|
|
343
|
+
sendMessage('added', msg);
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
if (typeof window !== 'undefined') {
|
|
347
|
+
window.addEventListener('message', function (e) {
|
|
348
|
+
var _e$data = e.data,
|
|
349
|
+
sender = _e$data.sender,
|
|
350
|
+
action = _e$data.action,
|
|
351
|
+
message = _e$data.message,
|
|
352
|
+
payload = _e$data.payload;
|
|
353
|
+
if (message && handlers[message]) {
|
|
354
|
+
handlers[message].forEach(function (fc) {
|
|
355
|
+
fc(payload, e);
|
|
356
|
+
});
|
|
357
|
+
} else if (sender === 'i18next-editor-frame' && handlers[action]) {
|
|
358
|
+
handlers[action].forEach(function (fc) {
|
|
359
|
+
fc(payload);
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function setValueOnNode(meta, value) {
|
|
366
|
+
var item = store.get(meta.eleUniqueID);
|
|
367
|
+
if (!item || !item.keys[meta.textType]) return;
|
|
368
|
+
var txtWithHiddenMeta = wrap(value, item.subliminal);
|
|
369
|
+
if (meta.textType === 'text') {
|
|
370
|
+
item.node.textContent = txtWithHiddenMeta;
|
|
371
|
+
} else if (meta.textType.indexOf('attr:') === 0) {
|
|
372
|
+
var attr = meta.textType.replace('attr:', '');
|
|
373
|
+
item.node.setAttribute(attr, txtWithHiddenMeta);
|
|
374
|
+
} else if (meta.textType === 'html') {
|
|
375
|
+
var id = "".concat(meta.textType, "-").concat(meta.children);
|
|
376
|
+
if (!item.originalChildNodes) {
|
|
377
|
+
var clones = [];
|
|
378
|
+
item.node.childNodes.forEach(function (c) {
|
|
379
|
+
clones.push(c);
|
|
380
|
+
});
|
|
381
|
+
item.originalChildNodes = clones;
|
|
382
|
+
}
|
|
383
|
+
if (item.children[id].length === item.node.childNodes.length) {
|
|
384
|
+
item.node.innerHTML = txtWithHiddenMeta;
|
|
385
|
+
} else {
|
|
386
|
+
var children = item.children[id];
|
|
387
|
+
var first = children[0].child;
|
|
388
|
+
var dummy = document.createElement('div');
|
|
389
|
+
dummy.innerHTML = txtWithHiddenMeta;
|
|
390
|
+
var nodes = [];
|
|
391
|
+
dummy.childNodes.forEach(function (c) {
|
|
392
|
+
nodes.push(c);
|
|
393
|
+
});
|
|
394
|
+
nodes.forEach(function (c) {
|
|
395
|
+
try {
|
|
396
|
+
item.node.insertBefore(c, first);
|
|
397
|
+
} catch (error) {
|
|
398
|
+
item.node.appendChild(c);
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
children.forEach(function (replaceable) {
|
|
402
|
+
if (item.node.contains(replaceable.child)) item.node.removeChild(replaceable.child);
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
function handler$9(payload) {
|
|
408
|
+
var meta = payload.meta,
|
|
409
|
+
value = payload.value;
|
|
410
|
+
if (meta && value !== undefined) {
|
|
411
|
+
setValueOnNode(meta, value);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
api.addHandler('editKey', handler$9);
|
|
415
|
+
|
|
416
|
+
function handler$8(payload) {
|
|
417
|
+
var meta = payload.meta,
|
|
418
|
+
value = payload.value,
|
|
419
|
+
lng = payload.lng;
|
|
420
|
+
if (meta && value !== undefined) {
|
|
421
|
+
setValueOnNode(meta, value);
|
|
422
|
+
var usedLng = lng || api.i18n.getLng();
|
|
423
|
+
api.i18n.setResource(usedLng, meta.ns, meta.key, value);
|
|
424
|
+
api.i18n.triggerRerender();
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
api.addHandler('commitKey', handler$8);
|
|
428
|
+
|
|
429
|
+
function _arrayLikeToArray(arr, len) {
|
|
430
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
431
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
432
|
+
return arr2;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
function _arrayWithoutHoles(arr) {
|
|
436
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
function _iterableToArray(iter) {
|
|
440
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
444
|
+
if (!o) return;
|
|
445
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
446
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
447
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
448
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
449
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
function _nonIterableSpread() {
|
|
453
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
function _toConsumableArray(arr) {
|
|
457
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
function handler$7(payload) {
|
|
461
|
+
var updated = payload.updated;
|
|
462
|
+
updated.forEach(function (item) {
|
|
463
|
+
var lng = item.lng,
|
|
464
|
+
ns = item.ns,
|
|
465
|
+
key = item.key,
|
|
466
|
+
data = item.data,
|
|
467
|
+
metas = item.metas,
|
|
468
|
+
meta = item.meta;
|
|
469
|
+
if (meta && data.value) setValueOnNode(meta, data.value);
|
|
470
|
+
if (metas) {
|
|
471
|
+
Object.values(metas).forEach(function (metaItem) {
|
|
472
|
+
setValueOnNode(metaItem, data.value);
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
api.i18n.setResource(lng, ns, key, data.value);
|
|
476
|
+
});
|
|
477
|
+
Object.values(store.data).forEach(function (item) {
|
|
478
|
+
if (item.originalChildNodes) {
|
|
479
|
+
var _item$node;
|
|
480
|
+
(_item$node = item.node).replaceChildren.apply(_item$node, _toConsumableArray(item.originalChildNodes));
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
api.i18n.triggerRerender();
|
|
484
|
+
if (api.locizeSavedHandler) api.locizeSavedHandler(payload);
|
|
485
|
+
if (window.locizeSavedHandler) window.locizeSavedHandler(payload);
|
|
486
|
+
}
|
|
487
|
+
api.addHandler('commitKeys', handler$7);
|
|
488
|
+
|
|
489
|
+
function handler$6(payload) {
|
|
490
|
+
api.initialized = true;
|
|
491
|
+
clearInterval(api.initInterval);
|
|
492
|
+
api.sendCurrentParsedContent();
|
|
493
|
+
api.sendCurrentTargetLanguage();
|
|
494
|
+
}
|
|
495
|
+
api.addHandler('confirmInitialized', handler$6);
|
|
496
|
+
|
|
497
|
+
function handler$5(payload) {
|
|
498
|
+
var containerStyle = payload.containerStyle;
|
|
499
|
+
if (containerStyle) {
|
|
500
|
+
var popup = document.getElementById('i18next-editor-popup');
|
|
501
|
+
if (containerStyle.height) {
|
|
502
|
+
var diff = "calc(".concat(containerStyle.height, " - ").concat(popup.style.height, ")");
|
|
503
|
+
popup.style.setProperty('top', "calc(".concat(popup.style.top, " - ").concat(diff, ")"));
|
|
504
|
+
popup.style.setProperty('height', containerStyle.height);
|
|
505
|
+
}
|
|
506
|
+
if (containerStyle.width) {
|
|
507
|
+
var _diff = "calc(".concat(containerStyle.width, " - ").concat(popup.style.width, ")");
|
|
508
|
+
popup.style.setProperty('left', "calc(".concat(popup.style.left, " - ").concat(_diff, ")"));
|
|
509
|
+
popup.style.setProperty('width', containerStyle.width);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
api.addHandler('requestPopupChanges', handler$5);
|
|
514
|
+
|
|
515
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
516
|
+
if (source == null) return {};
|
|
517
|
+
var target = {};
|
|
518
|
+
var sourceKeys = Object.keys(source);
|
|
519
|
+
var key, i;
|
|
520
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
521
|
+
key = sourceKeys[i];
|
|
522
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
523
|
+
target[key] = source[key];
|
|
524
|
+
}
|
|
525
|
+
return target;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
function _objectWithoutProperties(source, excluded) {
|
|
529
|
+
if (source == null) return {};
|
|
530
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
531
|
+
var key, i;
|
|
9
532
|
if (Object.getOwnPropertySymbols) {
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
533
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
534
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
535
|
+
key = sourceSymbolKeys[i];
|
|
536
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
537
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
538
|
+
target[key] = source[key];
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
return target;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
var _excluded = ["lng", "ns"];
|
|
545
|
+
function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
546
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
547
|
+
function handler$4(payload) {
|
|
548
|
+
var lng = payload.lng,
|
|
549
|
+
ns = payload.ns,
|
|
550
|
+
rest = _objectWithoutProperties(payload, _excluded);
|
|
551
|
+
api.i18n.getResourceBundle(lng, ns, function (resources) {
|
|
552
|
+
api.confirmResourceBundle(_objectSpread$6({
|
|
553
|
+
resources: resources,
|
|
554
|
+
lng: lng,
|
|
555
|
+
ns: ns
|
|
556
|
+
}, rest));
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
api.addHandler('requestResourceBundle', handler$4);
|
|
560
|
+
|
|
561
|
+
var previousMatches = [];
|
|
562
|
+
function handler$3(payload) {
|
|
563
|
+
var keys = payload.keys;
|
|
564
|
+
var matchingItems = [];
|
|
565
|
+
Object.values(store.data).forEach(function (item) {
|
|
566
|
+
var matches = Object.values(item.keys).filter(function (k) {
|
|
567
|
+
return keys.includes(k.qualifiedKey);
|
|
24
568
|
});
|
|
569
|
+
if (matches.length) {
|
|
570
|
+
matchingItems.push(item);
|
|
571
|
+
}
|
|
572
|
+
});
|
|
573
|
+
previousMatches.forEach(function (item) {
|
|
574
|
+
resetHighlight(item, item.node, item.keys, false);
|
|
575
|
+
});
|
|
576
|
+
matchingItems.forEach(function (item) {
|
|
577
|
+
selectedHighlight(item, item.node, item.keys);
|
|
578
|
+
});
|
|
579
|
+
previousMatches = matchingItems;
|
|
580
|
+
}
|
|
581
|
+
api.addHandler('selectedKeys', handler$3);
|
|
582
|
+
|
|
583
|
+
function handler$2(payload, e) {
|
|
584
|
+
api.source = e.source;
|
|
585
|
+
api.origin = e.origin;
|
|
586
|
+
api.legacy = true;
|
|
587
|
+
api.sendLocizeIsEnabled();
|
|
588
|
+
}
|
|
589
|
+
api.addHandler('isLocizeEnabled', handler$2);
|
|
590
|
+
|
|
591
|
+
function handler$1(payload, e) {
|
|
592
|
+
api.turnOn();
|
|
593
|
+
}
|
|
594
|
+
api.addHandler('turnOn', handler$1);
|
|
595
|
+
|
|
596
|
+
function handler(payload, e) {
|
|
597
|
+
api.turnOff();
|
|
598
|
+
}
|
|
599
|
+
api.addHandler('turnOff', handler);
|
|
600
|
+
|
|
601
|
+
var iconEdit = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#FFFFFF"><g></g><g><g><g><path d="M3,21l3.75,0L17.81,9.94l-3.75-3.75L3,17.25L3,21z M5,18.08l9.06-9.06l0.92,0.92L5.92,19L5,19L5,18.08z"/></g><g><path d="M18.37,3.29c-0.39-0.39-1.02-0.39-1.41,0l-1.83,1.83l3.75,3.75l1.83-1.83c0.39-0.39,0.39-1.02,0-1.41L18.37,3.29z"/></g></g></g></svg>';
|
|
602
|
+
var i18nextIcon = "\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 210 304\" stroke=\"#000\" stroke-linecap=\"round\" stroke-linejoin=\"round\" fill=\"#fff\" fill-rule=\"evenodd\">\n <g stroke=\"none\" class=\"B\">\n <path d=\"M 142 31.5 v 57.2 l 64.3 165.1 s 19.6 40.3 -36.5 50.1 h -128 s -52.3 -5.5 -39.8 -46.9 L 69.5 88.7 V 31.5 z\" fill=\"#009688\"/>\n <path d=\"M 143.3 24.8 H 66.2 c -6.2 0 -11.3 -5.6 -11.3 -12.4 S 60 0 66.2 0 h 77.1 c 6.3 0 11.3 5.6 11.3 12.4 s -5.1 12.4 -11.3 12.4 z\" class=\"C\" fill=\"#004d40\"/>\n <path d=\"M 123 124.9 c 8.3 0 15 8.1 15 18.1 c 0 10 -6.8 18.1 -15 18.1 c -8.3 0 -15 -8.1 -15 -18.1 c 0 -10 6.7 -18.1 15 -18.1 z m -58.8 31.7 c 0 -8.5 5.6 -15.3 12.7 -15.3 s 12.7 6.8 12.7 15.3 s -5.6 15.3 -12.7 15.3 s -12.7 -6.8 -12.7 -15.3 z\" fill=\"white\"/>\n <path d=\"M 147.7 84.9 V 57.7 s 34.5 -7.6 51.7 32.5 c 0 0 -26.9 19.6 -51.7 -5.3 z m -84.5 0 V 57.7 s -34.5 -7.6 -51.7 32.5 c 0 0 26.8 19.6 51.7 -5.3 z\" class=\"C\" fill=\"#004d40\"/>\n <path d=\"M 168.4 197.5 c -56.1 -17.4 -103.3 -8.1 -126.3 -1 l -23.2 56 c -10.5 33.4 33.2 37.8 33.2 37.8 h 106.9 c 46.9 -7.9 30.5 -40.4 30.5 -40.4 z\" fill=\"white\"/>\n <path d=\"M 87.6 218.3 c 0 6 -8.1 10.9 -18.1 10.9 s -18.1 -4.9 -18.1 -10.9 c 0 -6.1 8.1 -10.9 18.1 -10.9 s 18.1 4.9 18.1 10.9 z m 64.4 0 c 0 6 -8.1 10.9 -18.1 10.9 c -10 0 -18.1 -4.9 -18.1 -10.9 c 0 -6.1 8.1 -10.9 18.1 -10.9 c 10 0 18.1 4.9 18.1 10.9 z\" class=\"C\" fill=\"#004d40\"/>\n </g>\n</svg>\n";
|
|
603
|
+
var locizeIcon = "\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 194.667 196\" height=\"196\" width=\"194.667\" xml:space=\"preserve\">\n <defs>\n <clipPath id=\"a\" clipPathUnits=\"userSpaceOnUse\">\n <path d=\"M5.5 74.048C5.5 36.98 35.551 6.93 72.619 6.93c37.069 0 67.119 30.05 67.119 67.118 0 37.07-30.05 67.12-67.119 67.12-37.068 0-67.119-30.05-67.119-67.12\"/>\n </clipPath>\n <clipPath id=\"b\" clipPathUnits=\"userSpaceOnUse\">\n <path d=\"M0 147h146V0H0Z\"/>\n </clipPath>\n <clipPath id=\"c\" clipPathUnits=\"userSpaceOnUse\">\n <path d=\"M88.756 55.055h50.982l4.512 88.195-64 1.25z\"/>\n </clipPath>\n </defs>\n <g clip-path=\"url(#a)\" transform=\"matrix(1.33333 0 0 -1.33333 0 196)\">\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-.766-5.554 1.148-8.427 0-11.107-1.149-2.681-2.49-7.469-1.341-10.724 1.149-3.255 2.872-10.34 4.404-10.533 1.532-.19-1.148 7.66.383 5.171 1.533-2.49 1.533-6.193 4.214-8.746 2.68-2.553 6.319-2.17 9.192-4.658 2.872-2.49 5.744-6.129 8.425-5.746 0 0-.192-1.914-1.532-5.17-1.34-3.255-1.532-7.084.192-9.383 1.723-2.298 3.446-5.746 4.979-7.469 1.532-1.723 2.681-10.915 2.297-15.51-.382-4.596 1.724-14.937 6.511-17.236 4.787-2.298 0 1.15-.957 4.022-.958 2.872.739 9.575 3.052 10.533 2.309.958 4.416 4.787 6.139 7.469 1.724 2.68 6.128 3.83 7.469 7.084 1.341 3.255.766 7.085 1.532 8.809.766 1.724 2.873 5.554-1.724 7.852-4.595 2.298-6.51 1.148-6.702 3.255-.192 2.107-1.341 4.404-4.595 5.361-3.256.959-6.129 2.816-9.768 3.227-3.638.412-4.404-2.461-6.319-.928-1.914 1.531-3.446 3.064-4.213 4.978-.765 1.915-3.064.766-2.871 1.915.19 1.15 3.254 4.404-.193 3.255-3.446-1.148-6.51-.765-6.319 2.298.193 3.064 4.405 4.214 6.129 4.597 1.722.383 3.063-1.723 5.17-3.065 2.106-1.34.191 1.915 1.34 4.214 1.149 2.298 5.554 2.106 6.128 5.361.575 3.255-.191 5.937 3.256 6.32 3.446.383 7.084-.191 7.468 1.533.382 1.722-4.022-.576-4.213 1.531-.192 2.106 3.829 4.978 4.978 2.872 1.149-2.106 4.022-2.298 4.405-1.531.383.765 0 2.105-1.341 5.361-1.34 3.256-2.681 2.298-3.829 5.936-1.149 3.639-3.064-.191-4.979 1.724s-4.213 5.937-4.597 2.489c-.382-3.446-.382-5.361-2.105-8.042-1.724-2.682-2.489-.575-4.022 1.149-1.532 1.723-4.979 3.447-3.83 4.978C23.362 4.979 24.511 9 26.234 7.85c1.724-1.149 4.405-1.149 4.022.767-.383 1.914 0 2.681.766 3.638.766.958 3.447 2.682 3.447-.766 0-3.447-.384-4.405 2.298-4.788 2.681-.383 5.744-.574 5.554 1.149-.193 1.724.766 1.341 0 4.214-.767 2.873-3.065 3.063-5.554 4.405-2.489 1.34-3.83 3.446-5.936 2.68s-2.299-1.531-2.49-3.638c-.192-2.107-1.341-2.873-2.107-1.915-.765.957.192 4.022-2.68 2.106-2.873-1.914-4.021-5.171-5.553-2.872-1.533 2.297 2.297 6.319-1.724 4.595-4.022-1.723-6.895-3.637-4.788-4.404 2.107-.766 4.214-2.107 2.107-2.873-2.107-.765-6.32.575-7.852-.957C4.212 7.66 0 0 0 0\" transform=\"translate(13.926 109.38)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-.766-5.554 1.148-8.427 0-11.107-1.149-2.681-2.49-7.469-1.341-10.724 1.149-3.255 2.872-10.34 4.404-10.533 1.532-.19-1.148 7.66.383 5.171 1.533-2.49 1.533-6.193 4.214-8.746 2.68-2.553 6.319-2.17 9.192-4.658 2.872-2.49 5.744-6.129 8.425-5.746 0 0-.192-1.914-1.532-5.17-1.34-3.255-1.532-7.084.192-9.383 1.723-2.298 3.446-5.746 4.979-7.469 1.532-1.723 2.681-10.915 2.297-15.51-.382-4.596 1.724-14.937 6.511-17.236 4.787-2.298 0 1.15-.957 4.022-.958 2.872.739 9.575 3.052 10.533 2.309.958 4.416 4.787 6.139 7.469 1.724 2.68 6.128 3.83 7.469 7.084 1.341 3.255.766 7.085 1.532 8.809.766 1.724 2.873 5.554-1.724 7.852-4.595 2.298-6.51 1.148-6.702 3.255-.192 2.107-1.341 4.404-4.595 5.361-3.256.959-6.129 2.816-9.768 3.227-3.638.412-4.404-2.461-6.319-.928-1.914 1.531-3.446 3.064-4.213 4.978-.765 1.915-3.064.766-2.871 1.915.19 1.15 3.254 4.404-.193 3.255-3.446-1.148-6.51-.765-6.319 2.298.193 3.064 4.405 4.214 6.129 4.597 1.722.383 3.063-1.723 5.17-3.065 2.106-1.34.191 1.915 1.34 4.214 1.149 2.298 5.554 2.106 6.128 5.361.575 3.255-.191 5.937 3.256 6.32 3.446.383 7.084-.191 7.468 1.533.382 1.722-4.022-.576-4.213 1.531-.192 2.106 3.829 4.978 4.978 2.872 1.149-2.106 4.022-2.298 4.405-1.531.383.765 0 2.105-1.341 5.361-1.34 3.256-2.681 2.298-3.829 5.936-1.149 3.639-3.064-.191-4.979 1.724s-4.213 5.937-4.597 2.489c-.382-3.446-.382-5.361-2.105-8.042-1.724-2.682-2.489-.575-4.022 1.149-1.532 1.723-4.979 3.447-3.83 4.978C23.362 4.979 24.511 9 26.234 7.85c1.724-1.149 4.405-1.149 4.022.767-.383 1.914 0 2.681.766 3.638.766.958 3.447 2.682 3.447-.766 0-3.447-.384-4.405 2.298-4.788 2.681-.383 5.744-.574 5.554 1.149-.193 1.724.766 1.341 0 4.214-.767 2.873-3.065 3.063-5.554 4.405-2.489 1.34-3.83 3.446-5.936 2.68s-2.299-1.531-2.49-3.638c-.192-2.107-1.341-2.873-2.107-1.915-.765.957.192 4.022-2.68 2.106-2.873-1.914-4.021-5.171-5.553-2.872-1.533 2.297 2.297 6.319-1.724 4.595-4.022-1.723-6.895-3.637-4.788-4.404 2.107-.766 4.214-2.107 2.107-2.873-2.107-.765-6.32.575-7.852-.957C4.212 7.66 0 0 0 0Z\" transform=\"translate(13.926 109.38)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-.01-2.141.575-3.829 2.49-1.915C4.405 0 5.553 2.298 6.895 1.341c1.34-.958 3.638-.703 4.594-.639.959.064 1.15 2.937 3.831 2.554s1.724.574 4.596 2.107c2.873 1.532 9.001 4.212 2.681 3.446-6.32-.766-6.703.958-11.108-1.914-4.403-2.873-5.36-2.873-6.509-3.639-1.149-.766-2.49 2.298-4.022 0C-.575.958.011 2.182 0 0\" transform=\"translate(36.522 130.061)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-.01-2.141.575-3.829 2.49-1.915C4.405 0 5.553 2.298 6.895 1.341c1.34-.958 3.638-.703 4.594-.639.959.064 1.15 2.937 3.831 2.554s1.724.574 4.596 2.107c2.873 1.532 9.001 4.212 2.681 3.446-6.32-.766-6.703.958-11.108-1.914-4.403-2.873-5.36-2.873-6.509-3.639-1.149-.766-2.49 2.298-4.022 0C-.575.958.011 2.182 0 0Z\" transform=\"translate(36.522 130.061)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-2.263-1.956-5.744-4.788-3.064-4.788 2.681 0 3.983 1.404 5.439-.447 1.456-1.85.88-4.723.88-6.063 0-1.341-.766-4.406 1.15-8.235 1.915-3.829 2.106-6.319 4.022-3.829 1.914 2.488 6.51 7.276 8.808 7.658 2.298.384 4.597 1.342 5.746 3.257 1.148 1.915 0 3.773 1.914 5.141 1.914 1.369 1.531 3.093 2.107 5.199C27.575 0 32.747 0 30.448 1.148c-2.297 1.15-6.51 1.916-11.49 1.341C13.979 1.915 4.213 3.638 0 0\" transform=\"translate(59.502 135.998)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-2.263-1.956-5.744-4.788-3.064-4.788 2.681 0 3.983 1.404 5.439-.447 1.456-1.85.88-4.723.88-6.063 0-1.341-.766-4.406 1.15-8.235 1.915-3.829 2.106-6.319 4.022-3.829 1.914 2.488 6.51 7.276 8.808 7.658 2.298.384 4.597 1.342 5.746 3.257 1.148 1.915 0 3.773 1.914 5.141 1.914 1.369 1.531 3.093 2.107 5.199C27.575 0 32.747 0 30.448 1.148c-2.297 1.15-6.51 1.916-11.49 1.341C13.979 1.915 4.213 3.638 0 0Z\" transform=\"translate(59.502 135.998)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-1.218-1.986-.575-2.107.766-2.49 1.34-.383-.575-2.68.957-2.872 1.532-.193 4.979-1.15 5.936 0 .959 1.148-1.531.7-3.255 1.977C2.682-2.107.865 1.41 0 0\" transform=\"translate(38.438 76.826)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-1.218-1.986-.575-2.107.766-2.49 1.34-.383-.575-2.68.957-2.872 1.532-.193 4.979-1.15 5.936 0 .959 1.148-1.531.7-3.255 1.977C2.682-2.107.865 1.41 0 0Z\" transform=\"translate(38.438 76.826)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-2.063-1.033-1.148-2.682-3.064-3.831-1.915-1.148-1.149-1.531-1.723-4.213-.575-2.68.191-4.212 1.532-2.106S2.298 1.148 0 0\" transform=\"translate(131.121 45.612)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-2.063-1.033-1.148-2.682-3.064-3.831-1.915-1.148-1.149-1.531-1.723-4.213-.575-2.68.191-4.212 1.532-2.106S2.298 1.148 0 0Z\" transform=\"translate(131.121 45.612)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-.575-.575-1.532 2.681-2.106 4.213-.575 1.532-.561 4.195 1.056 5.675C.964 11.734 0 7.469 0 5.17 0 2.873.574.575 0 0m-6.704 5.936c-1.341.766-3.828 0-6.892-.957-3.065-.958-.613 2.131.766 4.213 1.233 1.861.574-.574 3.256-.766 2.68-.192 4.213-3.256 2.87-2.49m-4.402-6.511c-.192-1.531.574-4.021-3.639-3.064-4.213.958-4.213 3.256-5.936 1.533-1.723-1.724-3.83-3.255-6.32-.575C-29.49 0-29.107.766-30.447.958c-.955.135-4.138.846-6.792.074.206.123.426.285.663.5 1.915 1.723 1.532 2.298 3.638 4.213 2.108 1.916 3.639 3.638 5.171 1.916 1.532-1.725 4.788-2.108 3.639-4.023-1.149-1.914-.383-3.063.958-1.914 1.339 1.149 3.255 1.914 1.915 3.446-1.342 1.532-2.682 5.554-.766 2.873 1.915-2.681 2.489-4.022 3.637-5.553C-17.234.958-16.085 0-15.702.958c.383.957-.192 3.063.383 3.446.574.383 0-3.255 1.723-3.446 1.723-.192 2.681 0 2.49-1.533M9.192-8.81c-.574 3.257-4.787 32.747-4.787 32.747s-11.299 7.277-13.213 5.746c-1.916-1.533-5.171-1.302-4.788.21s2.872 1.128-1.341 4.002c-4.212 2.873-4.978 5.362-8.233 1.724-3.257-3.639-4.022-6.703-5.937-7.661-1.915-.957-3.447-4.021-1.34-4.787 2.106-.765 2.298 0 4.02-1.531 1.725-1.533 4.023-1.149 4.406-.193.383.959.766 4.022.957 5.171.192 1.149 2.138 4.979 1.93 1.915-.207-3.064 2.665-3.064.75-5.17-1.914-2.106-.765-3.831-4.595-4.214-3.831-.382-4.022 1.915-6.128.766-2.107-1.148-1.915-1.915-2.681-3.063-.766-1.149-4.788-3.447-4.788-3.447s-3.255 1.149-1.724-.958c1.533-2.106 2.873-4.595 1.533-4.786-1.341-.192-4.98 1.914-4.98-.384s-.573-4.787.959-5.362c1.081-.405 1.783-1.284 2.775-1.161-.769-.332-1.468-.813-2.009-1.52-1.491-1.947-.575-5.362-3.639-6.511-3.063-1.15-3.063-2.489-3.639-4.979-.573-2.489 0-8.808.766-9.383.765-.574 2.107-5.362 5.363-4.978 3.256.383 6.702.53 7.851-.023 1.149-.551 3.063 1.171 3.638-3.233.575-4.404 1.915-4.979 2.681-7.277.766-2.297-.383-7.086 0-9.958s3.064-7.852 3.064-10.341c0-2.489 2.873-3.638 4.405-2.681 1.532.958 4.787 2.873 6.127 5.937 1.342 3.063 1.342 4.595 3.447 8.617 2.106 4.021 1.533 6.894 2.489 9.958.958 3.064 3.262 5.171 6.419 8.617 3.156 3.446 2.588 5.362 0 5.171-2.588-.191-4.314 2.297-5.654 5.361-1.338 3.065-2.87 10.724-1.721 8.235 1.149-2.491 3.446-9.384 5.744-10.533 2.298-1.149 6.512 1.953 7.469 3.083.957 1.131.574 4.385-1.916 5.726C.383-8.617 1.915-7.469 4.405-9c2.489-1.532 5.362-3.064 4.787.19\" transform=\"translate(132.845 86.592)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-.575-.575-1.532 2.681-2.106 4.213-.575 1.532-.561 4.195 1.056 5.675C.964 11.734 0 7.469 0 5.17 0 2.873.574.575 0 0Zm-6.704 5.936c-1.341.766-3.828 0-6.892-.957-3.065-.958-.613 2.131.766 4.213 1.233 1.861.574-.574 3.256-.766 2.68-.192 4.213-3.256 2.87-2.49zm-4.402-6.511c-.192-1.531.574-4.021-3.639-3.064-4.213.958-4.213 3.256-5.936 1.533-1.723-1.724-3.83-3.255-6.32-.575C-29.49 0-29.107.766-30.447.958c-.955.135-4.138.846-6.792.074.206.123.426.285.663.5 1.915 1.723 1.532 2.298 3.638 4.213 2.108 1.916 3.639 3.638 5.171 1.916 1.532-1.725 4.788-2.108 3.639-4.023-1.149-1.914-.383-3.063.958-1.914 1.339 1.149 3.255 1.914 1.915 3.446-1.342 1.532-2.682 5.554-.766 2.873 1.915-2.681 2.489-4.022 3.637-5.553C-17.234.958-16.085 0-15.702.958c.383.957-.192 3.063.383 3.446.574.383 0-3.255 1.723-3.446 1.723-.192 2.681 0 2.49-1.533zM9.192-8.81c-.574 3.257-4.787 32.747-4.787 32.747s-11.299 7.277-13.213 5.746c-1.916-1.533-5.171-1.302-4.788.21s2.872 1.128-1.341 4.002c-4.212 2.873-4.978 5.362-8.233 1.724-3.257-3.639-4.022-6.703-5.937-7.661-1.915-.957-3.447-4.021-1.34-4.787 2.106-.765 2.298 0 4.02-1.531 1.725-1.533 4.023-1.149 4.406-.193.383.959.766 4.022.957 5.171.192 1.149 2.138 4.979 1.93 1.915-.207-3.064 2.665-3.064.75-5.17-1.914-2.106-.765-3.831-4.595-4.214-3.831-.382-4.022 1.915-6.128.766-2.107-1.148-1.915-1.915-2.681-3.063-.766-1.149-4.788-3.447-4.788-3.447s-3.255 1.149-1.724-.958c1.533-2.106 2.873-4.595 1.533-4.786-1.341-.192-4.98 1.914-4.98-.384s-.573-4.787.959-5.362c1.081-.405 1.783-1.284 2.775-1.161-.769-.332-1.468-.813-2.009-1.52-1.491-1.947-.575-5.362-3.639-6.511-3.063-1.15-3.063-2.489-3.639-4.979-.573-2.489 0-8.808.766-9.383.765-.574 2.107-5.362 5.363-4.978 3.256.383 6.702.53 7.851-.023 1.149-.551 3.063 1.171 3.638-3.233.575-4.404 1.915-4.979 2.681-7.277.766-2.297-.383-7.086 0-9.958s3.064-7.852 3.064-10.341c0-2.489 2.873-3.638 4.405-2.681 1.532.958 4.787 2.873 6.127 5.937 1.342 3.063 1.342 4.595 3.447 8.617 2.106 4.021 1.533 6.894 2.489 9.958.958 3.064 3.262 5.171 6.419 8.617 3.156 3.446 2.588 5.362 0 5.171-2.588-.191-4.314 2.297-5.654 5.361-1.338 3.065-2.87 10.724-1.721 8.235 1.149-2.491 3.446-9.384 5.744-10.533 2.298-1.149 6.512 1.953 7.469 3.083.957 1.131.574 4.385-1.916 5.726C.383-8.617 1.915-7.469 4.405-9c2.489-1.532 5.362-3.064 4.787.19z\" transform=\"translate(132.845 86.592)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-1.173-.353-2.106-2.681-1.532-3.831.576-1.148-.574.576-2.106-.382-1.533-.957-3.808-3.639-1.713-3.829 2.096-.193 1.713 1.531 3.628.765 1.915-.765 4.021-.575 4.021 1.34C2.298-4.021 1.915.574 0 0\" transform=\"translate(95.886 109.955)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-1.173-.353-2.106-2.681-1.532-3.831.576-1.148-.574.576-2.106-.382-1.533-.957-3.808-3.639-1.713-3.829 2.096-.193 1.713 1.531 3.628.765 1.915-.765 4.021-.575 4.021 1.34C2.298-4.021 1.915.574 0 0Z\" transform=\"translate(95.886 109.955)\"/>\n <path style=\"fill:#2196f3;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-1.154-.165-1.533-3.064.957-3.447 2.49-.383 6.947.575 5.293 2.107C4.596.191 2.682.383 0 0\" transform=\"translate(83.44 118.763)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-1.154-.165-1.533-3.064.957-3.447 2.49-.383 6.947.575 5.293 2.107C4.596.191 2.682.383 0 0Z\" transform=\"translate(83.44 118.763)\"/>\n </g>\n <g clip-path=\"url(#b)\" transform=\"matrix(1.33333 0 0 -1.33333 0 196)\">\n <path style=\"fill:none;stroke:#2196f3;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c0-37.068-30.05-67.119-67.119-67.119S-134.238-37.068-134.238 0c0 37.069 30.05 67.119 67.119 67.119S0 37.069 0 0Z\" transform=\"translate(139.738 74.049)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c0-36.731-29.777-66.509-66.509-66.509S-133.019-36.731-133.019 0c0 36.733 29.778 66.51 66.51 66.51C-29.777 66.51 0 36.733 0 0Z\" transform=\"translate(139.438 73.186)\"/>\n </g>\n <g clip-path=\"url(#c)\" transform=\"matrix(1.33333 0 0 -1.33333 0 196)\">\n <path style=\"fill:#fff;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-1.542-1.541-3.386-2.311-5.533-2.311-2.148 0-3.991.77-5.532 2.311s-2.313 3.387-2.313 5.533c0 2.147.772 3.963 2.313 5.45 1.541 1.486 3.384 2.23 5.532 2.23 2.147 0 3.991-.744 5.533-2.23 1.54-1.487 2.312-3.303 2.312-5.45C2.312 3.387 1.54 1.541 0 0m12.551 23.039c-4.954 4.9-10.954 7.35-18.001 7.35-7.047 0-13.047-2.45-18.002-7.35-4.955-4.898-7.432-10.817-7.432-17.754 0-4.183 2.119-11.176 6.359-20.974 4.238-9.799 8.477-18.717 12.715-26.754 4.241-8.037 6.36-11.946 6.36-11.727.66 1.211 1.568 2.863 2.724 4.955 1.157 2.092 3.194 6.029 6.112 11.809 2.917 5.781 5.477 11.094 7.678 15.935a203.312 203.312 0 0 1 6.111 15.032c1.873 5.173 2.807 9.082 2.807 11.724 0 6.937-2.477 12.856-7.431 17.754\" transform=\"translate(119.64 109.307)\"/>\n <path style=\"fill:#fff;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M0 0c-1.542-1.541-3.386-2.311-5.533-2.311-2.148 0-3.991.77-5.532 2.311s-2.313 3.387-2.313 5.533c0 2.147.772 3.963 2.313 5.45 1.541 1.486 3.384 2.23 5.532 2.23 2.147 0 3.991-.744 5.533-2.23 1.54-1.487 2.312-3.303 2.312-5.45C2.312 3.387 1.54 1.541 0 0m12.551 23.039c-4.954 4.9-10.954 7.35-18.001 7.35-7.047 0-13.047-2.45-18.002-7.35-4.955-4.898-7.432-10.817-7.432-17.754 0-4.183 2.119-11.176 6.359-20.974 4.238-9.799 8.477-18.717 12.715-26.754 4.241-8.037 6.36-11.946 6.36-11.727.66 1.211 1.568 2.863 2.724 4.955 1.157 2.092 3.194 6.029 6.112 11.809 2.917 5.781 5.477 11.094 7.678 15.935a203.312 203.312 0 0 1 6.111 15.032c1.873 5.173 2.807 9.082 2.807 11.724 0 6.937-2.477 12.856-7.431 17.754\" transform=\"translate(119.64 109.307)\"/>\n <path style=\"fill:none;stroke:#2196f3;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" d=\"M0 0c-1.542-1.541-3.386-2.311-5.533-2.311-2.148 0-3.991.77-5.532 2.311s-2.313 3.387-2.313 5.533c0 2.147.772 3.963 2.313 5.45 1.541 1.486 3.384 2.23 5.532 2.23 2.147 0 3.991-.744 5.533-2.23 1.54-1.487 2.312-3.303 2.312-5.45C2.312 3.387 1.54 1.541 0 0Zm12.551 23.039c-4.954 4.9-10.954 7.35-18.001 7.35-7.047 0-13.047-2.45-18.002-7.35-4.955-4.898-7.432-10.817-7.432-17.754 0-4.183 2.119-11.176 6.359-20.974 4.238-9.799 8.477-18.717 12.715-26.754 4.241-8.037 6.36-11.946 6.36-11.727.66 1.211 1.568 2.863 2.724 4.955 1.157 2.092 3.194 6.029 6.112 11.809 2.917 5.781 5.477 11.094 7.678 15.935a203.312 203.312 0 0 1 6.111 15.032c1.873 5.173 2.807 9.082 2.807 11.724 0 6.937-2.477 12.856-7.431 17.754z\" transform=\"translate(119.64 109.307)\"/>\n </g>\n</svg>\n";
|
|
604
|
+
var minimizeIcon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M6 19h12v2H6v-2z"/></svg>';
|
|
605
|
+
var editIconUrl = URL.createObjectURL(new Blob([iconEdit], {
|
|
606
|
+
type: 'image/svg+xml'
|
|
607
|
+
}));
|
|
608
|
+
var i18nextIconUrl = URL.createObjectURL(new Blob([i18nextIcon], {
|
|
609
|
+
type: 'image/svg+xml'
|
|
610
|
+
}));
|
|
611
|
+
var minimizeIconUrl = URL.createObjectURL(new Blob([minimizeIcon], {
|
|
612
|
+
type: 'image/svg+xml'
|
|
613
|
+
}));
|
|
614
|
+
var locizeIconUrl = URL.createObjectURL(new Blob([locizeIcon], {
|
|
615
|
+
type: 'image/svg+xml'
|
|
616
|
+
}));
|
|
617
|
+
function EditIcon() {
|
|
618
|
+
var image = document.createElement('img');
|
|
619
|
+
image.setAttribute('data-i18next-editor-element', 'true');
|
|
620
|
+
image.src = editIconUrl;
|
|
621
|
+
image.style.width = '15px';
|
|
622
|
+
return image;
|
|
623
|
+
}
|
|
624
|
+
function RibbonLogo() {
|
|
625
|
+
var circleSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '18px';
|
|
626
|
+
var logoSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '15px';
|
|
627
|
+
var ribbon = document.createElement('div');
|
|
628
|
+
ribbon.setAttribute('data-i18next-editor-element', 'true');
|
|
629
|
+
ribbon.style = "display: inline-flex; align-items: center; justify-content: center; width: ".concat(circleSize, "; height: ").concat(circleSize, "; box-shadow: inset 0 0 5px ").concat(colors.highlight, "; border: 2px solid ").concat(colors.highlight, "; border-radius: 50%");
|
|
630
|
+
var image = document.createElement('img');
|
|
631
|
+
image.src = i18nextIconUrl;
|
|
632
|
+
image.style.width = logoSize;
|
|
633
|
+
ribbon.appendChild(image);
|
|
634
|
+
return ribbon;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
if (sheet) {
|
|
638
|
+
sheet.insertRule('.i18next-editor-button:hover { background-color: rgba(38, 166, 154, 1) !important; }');
|
|
639
|
+
}
|
|
640
|
+
function RibbonButton(text, attrTitle, onClick) {
|
|
641
|
+
var btn = document.createElement('button');
|
|
642
|
+
btn.style = 'font-family: Arial; position: relative; backdrop-filter: blur(3px); cursor: pointer; padding: 2px 10px 2px 20px; font-size: 15px; font-weight: 300; text-transform: uppercase; color: #fff; background-color: rgba(38, 166, 154, 0.8); border: none; border-radius: 12px';
|
|
643
|
+
btn.classList.add('i18next-editor-button');
|
|
644
|
+
btn.setAttribute('data-i18next-editor-element', 'true');
|
|
645
|
+
btn.setAttribute('title', attrTitle);
|
|
646
|
+
var icon = EditIcon();
|
|
647
|
+
icon.style = 'position: absolute; left: 4px; top: 3px;';
|
|
648
|
+
icon.style.width = '15px';
|
|
649
|
+
btn.appendChild(icon);
|
|
650
|
+
var span = document.createElement('span');
|
|
651
|
+
span.textContent = text;
|
|
652
|
+
btn.appendChild(span);
|
|
653
|
+
btn.onclick = onClick;
|
|
654
|
+
return btn;
|
|
655
|
+
}
|
|
656
|
+
function RibbonBox() {
|
|
657
|
+
var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
658
|
+
var box = document.createElement('div');
|
|
659
|
+
box.style = 'position: absolute; top: 0; left: 0; display: flex; align-items: flex-start; justify-content: center; filter: drop-shadow(0px 0px 20px #aaa );';
|
|
660
|
+
box.setAttribute('data-i18next-editor-element', 'true');
|
|
661
|
+
var arrow = document.createElement('div');
|
|
662
|
+
arrow.style = "\n position: absolute;\n width: 0;\n height: 0;\n border-top-width: 7px;\n border-bottom-width: 7px;\n border-left-width: 10px;\n border-right-width: 10px;\n border-style: solid;\n border-color: transparent ".concat(colors.highlight, " transparent\n transparent;\n ");
|
|
663
|
+
box.appendChild(arrow);
|
|
664
|
+
var logo = RibbonLogo();
|
|
665
|
+
box.appendChild(logo);
|
|
666
|
+
var btnbox = document.createElement('div');
|
|
667
|
+
btnbox.style = 'display: flex; flex-direction: column; align-items: flex-start; margin-left: 2px; margin-top: 1px';
|
|
668
|
+
Object.keys(keys).forEach(function (k) {
|
|
669
|
+
var data = keys[k];
|
|
670
|
+
var btn = RibbonButton(k.replace('attr:', ''), "".concat(data.ns, ":").concat(data.key), function () {
|
|
671
|
+
api.selectKey(data);
|
|
672
|
+
});
|
|
673
|
+
btn.style.marginBottom = '2px';
|
|
674
|
+
btnbox.appendChild(btn);
|
|
675
|
+
});
|
|
676
|
+
box.appendChild(btnbox);
|
|
677
|
+
return {
|
|
678
|
+
box: box,
|
|
679
|
+
arrow: arrow
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
const min = Math.min;
|
|
684
|
+
const max = Math.max;
|
|
685
|
+
const round = Math.round;
|
|
686
|
+
const createCoords = v => ({
|
|
687
|
+
x: v,
|
|
688
|
+
y: v
|
|
689
|
+
});
|
|
690
|
+
const oppositeSideMap = {
|
|
691
|
+
left: 'right',
|
|
692
|
+
right: 'left',
|
|
693
|
+
bottom: 'top',
|
|
694
|
+
top: 'bottom'
|
|
695
|
+
};
|
|
696
|
+
const oppositeAlignmentMap = {
|
|
697
|
+
start: 'end',
|
|
698
|
+
end: 'start'
|
|
699
|
+
};
|
|
700
|
+
function clamp(start, value, end) {
|
|
701
|
+
return max(start, min(value, end));
|
|
702
|
+
}
|
|
703
|
+
function evaluate(value, param) {
|
|
704
|
+
return typeof value === 'function' ? value(param) : value;
|
|
705
|
+
}
|
|
706
|
+
function getSide(placement) {
|
|
707
|
+
return placement.split('-')[0];
|
|
708
|
+
}
|
|
709
|
+
function getAlignment(placement) {
|
|
710
|
+
return placement.split('-')[1];
|
|
711
|
+
}
|
|
712
|
+
function getOppositeAxis(axis) {
|
|
713
|
+
return axis === 'x' ? 'y' : 'x';
|
|
714
|
+
}
|
|
715
|
+
function getAxisLength(axis) {
|
|
716
|
+
return axis === 'y' ? 'height' : 'width';
|
|
717
|
+
}
|
|
718
|
+
function getSideAxis(placement) {
|
|
719
|
+
return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
|
|
720
|
+
}
|
|
721
|
+
function getAlignmentAxis(placement) {
|
|
722
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
723
|
+
}
|
|
724
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
725
|
+
if (rtl === void 0) {
|
|
726
|
+
rtl = false;
|
|
727
|
+
}
|
|
728
|
+
const alignment = getAlignment(placement);
|
|
729
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
730
|
+
const length = getAxisLength(alignmentAxis);
|
|
731
|
+
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
732
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
733
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
734
|
+
}
|
|
735
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
736
|
+
}
|
|
737
|
+
function getExpandedPlacements(placement) {
|
|
738
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
739
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
740
|
+
}
|
|
741
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
742
|
+
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
743
|
+
}
|
|
744
|
+
function getSideList(side, isStart, rtl) {
|
|
745
|
+
const lr = ['left', 'right'];
|
|
746
|
+
const rl = ['right', 'left'];
|
|
747
|
+
const tb = ['top', 'bottom'];
|
|
748
|
+
const bt = ['bottom', 'top'];
|
|
749
|
+
switch (side) {
|
|
750
|
+
case 'top':
|
|
751
|
+
case 'bottom':
|
|
752
|
+
if (rtl) return isStart ? rl : lr;
|
|
753
|
+
return isStart ? lr : rl;
|
|
754
|
+
case 'left':
|
|
755
|
+
case 'right':
|
|
756
|
+
return isStart ? tb : bt;
|
|
757
|
+
default:
|
|
758
|
+
return [];
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
762
|
+
const alignment = getAlignment(placement);
|
|
763
|
+
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
764
|
+
if (alignment) {
|
|
765
|
+
list = list.map(side => side + "-" + alignment);
|
|
766
|
+
if (flipAlignment) {
|
|
767
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
return list;
|
|
771
|
+
}
|
|
772
|
+
function getOppositePlacement(placement) {
|
|
773
|
+
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
|
774
|
+
}
|
|
775
|
+
function expandPaddingObject(padding) {
|
|
776
|
+
return {
|
|
777
|
+
top: 0,
|
|
778
|
+
right: 0,
|
|
779
|
+
bottom: 0,
|
|
780
|
+
left: 0,
|
|
781
|
+
...padding
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
function getPaddingObject(padding) {
|
|
785
|
+
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
786
|
+
top: padding,
|
|
787
|
+
right: padding,
|
|
788
|
+
bottom: padding,
|
|
789
|
+
left: padding
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
function rectToClientRect(rect) {
|
|
793
|
+
return {
|
|
794
|
+
...rect,
|
|
795
|
+
top: rect.y,
|
|
796
|
+
left: rect.x,
|
|
797
|
+
right: rect.x + rect.width,
|
|
798
|
+
bottom: rect.y + rect.height
|
|
799
|
+
};
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
803
|
+
let {
|
|
804
|
+
reference,
|
|
805
|
+
floating
|
|
806
|
+
} = _ref;
|
|
807
|
+
const sideAxis = getSideAxis(placement);
|
|
808
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
809
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
810
|
+
const side = getSide(placement);
|
|
811
|
+
const isVertical = sideAxis === 'y';
|
|
812
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
813
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
814
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
815
|
+
let coords;
|
|
816
|
+
switch (side) {
|
|
817
|
+
case 'top':
|
|
818
|
+
coords = {
|
|
819
|
+
x: commonX,
|
|
820
|
+
y: reference.y - floating.height
|
|
821
|
+
};
|
|
822
|
+
break;
|
|
823
|
+
case 'bottom':
|
|
824
|
+
coords = {
|
|
825
|
+
x: commonX,
|
|
826
|
+
y: reference.y + reference.height
|
|
827
|
+
};
|
|
828
|
+
break;
|
|
829
|
+
case 'right':
|
|
830
|
+
coords = {
|
|
831
|
+
x: reference.x + reference.width,
|
|
832
|
+
y: commonY
|
|
833
|
+
};
|
|
834
|
+
break;
|
|
835
|
+
case 'left':
|
|
836
|
+
coords = {
|
|
837
|
+
x: reference.x - floating.width,
|
|
838
|
+
y: commonY
|
|
839
|
+
};
|
|
840
|
+
break;
|
|
841
|
+
default:
|
|
842
|
+
coords = {
|
|
843
|
+
x: reference.x,
|
|
844
|
+
y: reference.y
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
switch (getAlignment(placement)) {
|
|
848
|
+
case 'start':
|
|
849
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
850
|
+
break;
|
|
851
|
+
case 'end':
|
|
852
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
853
|
+
break;
|
|
854
|
+
}
|
|
855
|
+
return coords;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
/**
|
|
859
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
860
|
+
* next to a reference element when it is given a certain positioning strategy.
|
|
861
|
+
*
|
|
862
|
+
* This export does not have any `platform` interface logic. You will need to
|
|
863
|
+
* write one for the platform you are using Floating UI with.
|
|
864
|
+
*/
|
|
865
|
+
const computePosition$1 = async (reference, floating, config) => {
|
|
866
|
+
const {
|
|
867
|
+
placement = 'bottom',
|
|
868
|
+
strategy = 'absolute',
|
|
869
|
+
middleware = [],
|
|
870
|
+
platform
|
|
871
|
+
} = config;
|
|
872
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
873
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
874
|
+
let rects = await platform.getElementRects({
|
|
875
|
+
reference,
|
|
876
|
+
floating,
|
|
877
|
+
strategy
|
|
878
|
+
});
|
|
879
|
+
let {
|
|
880
|
+
x,
|
|
881
|
+
y
|
|
882
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
883
|
+
let statefulPlacement = placement;
|
|
884
|
+
let middlewareData = {};
|
|
885
|
+
let resetCount = 0;
|
|
886
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
|
887
|
+
const {
|
|
888
|
+
name,
|
|
889
|
+
fn
|
|
890
|
+
} = validMiddleware[i];
|
|
891
|
+
const {
|
|
892
|
+
x: nextX,
|
|
893
|
+
y: nextY,
|
|
894
|
+
data,
|
|
895
|
+
reset
|
|
896
|
+
} = await fn({
|
|
897
|
+
x,
|
|
898
|
+
y,
|
|
899
|
+
initialPlacement: placement,
|
|
900
|
+
placement: statefulPlacement,
|
|
901
|
+
strategy,
|
|
902
|
+
middlewareData,
|
|
903
|
+
rects,
|
|
904
|
+
platform,
|
|
905
|
+
elements: {
|
|
906
|
+
reference,
|
|
907
|
+
floating
|
|
908
|
+
}
|
|
909
|
+
});
|
|
910
|
+
x = nextX != null ? nextX : x;
|
|
911
|
+
y = nextY != null ? nextY : y;
|
|
912
|
+
middlewareData = {
|
|
913
|
+
...middlewareData,
|
|
914
|
+
[name]: {
|
|
915
|
+
...middlewareData[name],
|
|
916
|
+
...data
|
|
917
|
+
}
|
|
918
|
+
};
|
|
919
|
+
if (reset && resetCount <= 50) {
|
|
920
|
+
resetCount++;
|
|
921
|
+
if (typeof reset === 'object') {
|
|
922
|
+
if (reset.placement) {
|
|
923
|
+
statefulPlacement = reset.placement;
|
|
924
|
+
}
|
|
925
|
+
if (reset.rects) {
|
|
926
|
+
rects = reset.rects === true ? await platform.getElementRects({
|
|
927
|
+
reference,
|
|
928
|
+
floating,
|
|
929
|
+
strategy
|
|
930
|
+
}) : reset.rects;
|
|
931
|
+
}
|
|
932
|
+
({
|
|
933
|
+
x,
|
|
934
|
+
y
|
|
935
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
936
|
+
}
|
|
937
|
+
i = -1;
|
|
938
|
+
continue;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
return {
|
|
942
|
+
x,
|
|
943
|
+
y,
|
|
944
|
+
placement: statefulPlacement,
|
|
945
|
+
strategy,
|
|
946
|
+
middlewareData
|
|
947
|
+
};
|
|
948
|
+
};
|
|
949
|
+
|
|
950
|
+
/**
|
|
951
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
952
|
+
* element is overflowing a given clipping boundary on each side.
|
|
953
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
954
|
+
* - negative = how many pixels left before it will overflow
|
|
955
|
+
* - 0 = lies flush with the boundary
|
|
956
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
957
|
+
*/
|
|
958
|
+
async function detectOverflow(state, options) {
|
|
959
|
+
var _await$platform$isEle;
|
|
960
|
+
if (options === void 0) {
|
|
961
|
+
options = {};
|
|
962
|
+
}
|
|
963
|
+
const {
|
|
964
|
+
x,
|
|
965
|
+
y,
|
|
966
|
+
platform,
|
|
967
|
+
rects,
|
|
968
|
+
elements,
|
|
969
|
+
strategy
|
|
970
|
+
} = state;
|
|
971
|
+
const {
|
|
972
|
+
boundary = 'clippingAncestors',
|
|
973
|
+
rootBoundary = 'viewport',
|
|
974
|
+
elementContext = 'floating',
|
|
975
|
+
altBoundary = false,
|
|
976
|
+
padding = 0
|
|
977
|
+
} = evaluate(options, state);
|
|
978
|
+
const paddingObject = getPaddingObject(padding);
|
|
979
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
980
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
981
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
982
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
983
|
+
boundary,
|
|
984
|
+
rootBoundary,
|
|
985
|
+
strategy
|
|
986
|
+
}));
|
|
987
|
+
const rect = elementContext === 'floating' ? {
|
|
988
|
+
...rects.floating,
|
|
989
|
+
x,
|
|
990
|
+
y
|
|
991
|
+
} : rects.reference;
|
|
992
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
993
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
994
|
+
x: 1,
|
|
995
|
+
y: 1
|
|
996
|
+
} : {
|
|
997
|
+
x: 1,
|
|
998
|
+
y: 1
|
|
999
|
+
};
|
|
1000
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
1001
|
+
rect,
|
|
1002
|
+
offsetParent,
|
|
1003
|
+
strategy
|
|
1004
|
+
}) : rect);
|
|
1005
|
+
return {
|
|
1006
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
1007
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
1008
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
1009
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
1010
|
+
};
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* Provides data to position an inner element of the floating element so that it
|
|
1015
|
+
* appears centered to the reference element.
|
|
1016
|
+
* @see https://floating-ui.com/docs/arrow
|
|
1017
|
+
*/
|
|
1018
|
+
const arrow = options => ({
|
|
1019
|
+
name: 'arrow',
|
|
1020
|
+
options,
|
|
1021
|
+
async fn(state) {
|
|
1022
|
+
const {
|
|
1023
|
+
x,
|
|
1024
|
+
y,
|
|
1025
|
+
placement,
|
|
1026
|
+
rects,
|
|
1027
|
+
platform,
|
|
1028
|
+
elements,
|
|
1029
|
+
middlewareData
|
|
1030
|
+
} = state;
|
|
1031
|
+
// Since `element` is required, we don't Partial<> the type.
|
|
1032
|
+
const {
|
|
1033
|
+
element,
|
|
1034
|
+
padding = 0
|
|
1035
|
+
} = evaluate(options, state) || {};
|
|
1036
|
+
if (element == null) {
|
|
1037
|
+
return {};
|
|
1038
|
+
}
|
|
1039
|
+
const paddingObject = getPaddingObject(padding);
|
|
1040
|
+
const coords = {
|
|
1041
|
+
x,
|
|
1042
|
+
y
|
|
1043
|
+
};
|
|
1044
|
+
const axis = getAlignmentAxis(placement);
|
|
1045
|
+
const length = getAxisLength(axis);
|
|
1046
|
+
const arrowDimensions = await platform.getDimensions(element);
|
|
1047
|
+
const isYAxis = axis === 'y';
|
|
1048
|
+
const minProp = isYAxis ? 'top' : 'left';
|
|
1049
|
+
const maxProp = isYAxis ? 'bottom' : 'right';
|
|
1050
|
+
const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
|
|
1051
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
1052
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
|
1053
|
+
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
1054
|
+
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
1055
|
+
|
|
1056
|
+
// DOM platform can return `window` as the `offsetParent`.
|
|
1057
|
+
if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
|
|
1058
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
1059
|
+
}
|
|
1060
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
1061
|
+
|
|
1062
|
+
// If the padding is large enough that it causes the arrow to no longer be
|
|
1063
|
+
// centered, modify the padding so that it is centered.
|
|
1064
|
+
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
1065
|
+
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
1066
|
+
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
1067
|
+
|
|
1068
|
+
// Make sure the arrow doesn't overflow the floating element if the center
|
|
1069
|
+
// point is outside the floating element's bounds.
|
|
1070
|
+
const min$1 = minPadding;
|
|
1071
|
+
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
1072
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
1073
|
+
const offset = clamp(min$1, center, max);
|
|
1074
|
+
|
|
1075
|
+
// If the reference is small enough that the arrow's padding causes it to
|
|
1076
|
+
// to point to nothing for an aligned placement, adjust the offset of the
|
|
1077
|
+
// floating element itself. To ensure `shift()` continues to take action,
|
|
1078
|
+
// a single reset is performed when this is true.
|
|
1079
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
1080
|
+
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
|
|
1081
|
+
return {
|
|
1082
|
+
[axis]: coords[axis] + alignmentOffset,
|
|
1083
|
+
data: {
|
|
1084
|
+
[axis]: offset,
|
|
1085
|
+
centerOffset: center - offset - alignmentOffset,
|
|
1086
|
+
...(shouldAddOffset && {
|
|
1087
|
+
alignmentOffset
|
|
1088
|
+
})
|
|
1089
|
+
},
|
|
1090
|
+
reset: shouldAddOffset
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
});
|
|
1094
|
+
|
|
1095
|
+
/**
|
|
1096
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
1097
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
1098
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
1099
|
+
* @see https://floating-ui.com/docs/flip
|
|
1100
|
+
*/
|
|
1101
|
+
const flip = function (options) {
|
|
1102
|
+
if (options === void 0) {
|
|
1103
|
+
options = {};
|
|
1104
|
+
}
|
|
1105
|
+
return {
|
|
1106
|
+
name: 'flip',
|
|
1107
|
+
options,
|
|
1108
|
+
async fn(state) {
|
|
1109
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
1110
|
+
const {
|
|
1111
|
+
placement,
|
|
1112
|
+
middlewareData,
|
|
1113
|
+
rects,
|
|
1114
|
+
initialPlacement,
|
|
1115
|
+
platform,
|
|
1116
|
+
elements
|
|
1117
|
+
} = state;
|
|
1118
|
+
const {
|
|
1119
|
+
mainAxis: checkMainAxis = true,
|
|
1120
|
+
crossAxis: checkCrossAxis = true,
|
|
1121
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
1122
|
+
fallbackStrategy = 'bestFit',
|
|
1123
|
+
fallbackAxisSideDirection = 'none',
|
|
1124
|
+
flipAlignment = true,
|
|
1125
|
+
...detectOverflowOptions
|
|
1126
|
+
} = evaluate(options, state);
|
|
1127
|
+
|
|
1128
|
+
// If a reset by the arrow was caused due to an alignment offset being
|
|
1129
|
+
// added, we should skip any logic now since `flip()` has already done its
|
|
1130
|
+
// work.
|
|
1131
|
+
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
1132
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
1133
|
+
return {};
|
|
1134
|
+
}
|
|
1135
|
+
const side = getSide(placement);
|
|
1136
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
1137
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
1138
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
1139
|
+
if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
|
|
1140
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
1141
|
+
}
|
|
1142
|
+
const placements = [initialPlacement, ...fallbackPlacements];
|
|
1143
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
1144
|
+
const overflows = [];
|
|
1145
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
1146
|
+
if (checkMainAxis) {
|
|
1147
|
+
overflows.push(overflow[side]);
|
|
1148
|
+
}
|
|
1149
|
+
if (checkCrossAxis) {
|
|
1150
|
+
const sides = getAlignmentSides(placement, rects, rtl);
|
|
1151
|
+
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
1152
|
+
}
|
|
1153
|
+
overflowsData = [...overflowsData, {
|
|
1154
|
+
placement,
|
|
1155
|
+
overflows
|
|
1156
|
+
}];
|
|
1157
|
+
|
|
1158
|
+
// One or more sides is overflowing.
|
|
1159
|
+
if (!overflows.every(side => side <= 0)) {
|
|
1160
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
1161
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
1162
|
+
const nextPlacement = placements[nextIndex];
|
|
1163
|
+
if (nextPlacement) {
|
|
1164
|
+
// Try next placement and re-run the lifecycle.
|
|
1165
|
+
return {
|
|
1166
|
+
data: {
|
|
1167
|
+
index: nextIndex,
|
|
1168
|
+
overflows: overflowsData
|
|
1169
|
+
},
|
|
1170
|
+
reset: {
|
|
1171
|
+
placement: nextPlacement
|
|
1172
|
+
}
|
|
1173
|
+
};
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
1177
|
+
// then find the placement that fits the best on the main crossAxis side.
|
|
1178
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
1179
|
+
|
|
1180
|
+
// Otherwise fallback.
|
|
1181
|
+
if (!resetPlacement) {
|
|
1182
|
+
switch (fallbackStrategy) {
|
|
1183
|
+
case 'bestFit':
|
|
1184
|
+
{
|
|
1185
|
+
var _overflowsData$map$so;
|
|
1186
|
+
const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
|
|
1187
|
+
if (placement) {
|
|
1188
|
+
resetPlacement = placement;
|
|
1189
|
+
}
|
|
1190
|
+
break;
|
|
1191
|
+
}
|
|
1192
|
+
case 'initialPlacement':
|
|
1193
|
+
resetPlacement = initialPlacement;
|
|
1194
|
+
break;
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
if (placement !== resetPlacement) {
|
|
1198
|
+
return {
|
|
1199
|
+
reset: {
|
|
1200
|
+
placement: resetPlacement
|
|
1201
|
+
}
|
|
1202
|
+
};
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
return {};
|
|
1206
|
+
}
|
|
1207
|
+
};
|
|
1208
|
+
};
|
|
1209
|
+
|
|
1210
|
+
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
1211
|
+
// Derivable.
|
|
1212
|
+
async function convertValueToCoords(state, options) {
|
|
1213
|
+
const {
|
|
1214
|
+
placement,
|
|
1215
|
+
platform,
|
|
1216
|
+
elements
|
|
1217
|
+
} = state;
|
|
1218
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
1219
|
+
const side = getSide(placement);
|
|
1220
|
+
const alignment = getAlignment(placement);
|
|
1221
|
+
const isVertical = getSideAxis(placement) === 'y';
|
|
1222
|
+
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
1223
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
1224
|
+
const rawValue = evaluate(options, state);
|
|
1225
|
+
|
|
1226
|
+
// eslint-disable-next-line prefer-const
|
|
1227
|
+
let {
|
|
1228
|
+
mainAxis,
|
|
1229
|
+
crossAxis,
|
|
1230
|
+
alignmentAxis
|
|
1231
|
+
} = typeof rawValue === 'number' ? {
|
|
1232
|
+
mainAxis: rawValue,
|
|
1233
|
+
crossAxis: 0,
|
|
1234
|
+
alignmentAxis: null
|
|
1235
|
+
} : {
|
|
1236
|
+
mainAxis: 0,
|
|
1237
|
+
crossAxis: 0,
|
|
1238
|
+
alignmentAxis: null,
|
|
1239
|
+
...rawValue
|
|
1240
|
+
};
|
|
1241
|
+
if (alignment && typeof alignmentAxis === 'number') {
|
|
1242
|
+
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
1243
|
+
}
|
|
1244
|
+
return isVertical ? {
|
|
1245
|
+
x: crossAxis * crossAxisMulti,
|
|
1246
|
+
y: mainAxis * mainAxisMulti
|
|
1247
|
+
} : {
|
|
1248
|
+
x: mainAxis * mainAxisMulti,
|
|
1249
|
+
y: crossAxis * crossAxisMulti
|
|
1250
|
+
};
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
/**
|
|
1254
|
+
* Modifies the placement by translating the floating element along the
|
|
1255
|
+
* specified axes.
|
|
1256
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
1257
|
+
* object may be passed.
|
|
1258
|
+
* @see https://floating-ui.com/docs/offset
|
|
1259
|
+
*/
|
|
1260
|
+
const offset$1 = function (options) {
|
|
1261
|
+
if (options === void 0) {
|
|
1262
|
+
options = 0;
|
|
1263
|
+
}
|
|
1264
|
+
return {
|
|
1265
|
+
name: 'offset',
|
|
1266
|
+
options,
|
|
1267
|
+
async fn(state) {
|
|
1268
|
+
const {
|
|
1269
|
+
x,
|
|
1270
|
+
y
|
|
1271
|
+
} = state;
|
|
1272
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
1273
|
+
return {
|
|
1274
|
+
x: x + diffCoords.x,
|
|
1275
|
+
y: y + diffCoords.y,
|
|
1276
|
+
data: diffCoords
|
|
1277
|
+
};
|
|
1278
|
+
}
|
|
1279
|
+
};
|
|
1280
|
+
};
|
|
1281
|
+
|
|
1282
|
+
/**
|
|
1283
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
1284
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
1285
|
+
* @see https://floating-ui.com/docs/shift
|
|
1286
|
+
*/
|
|
1287
|
+
const shift = function (options) {
|
|
1288
|
+
if (options === void 0) {
|
|
1289
|
+
options = {};
|
|
1290
|
+
}
|
|
1291
|
+
return {
|
|
1292
|
+
name: 'shift',
|
|
1293
|
+
options,
|
|
1294
|
+
async fn(state) {
|
|
1295
|
+
const {
|
|
1296
|
+
x,
|
|
1297
|
+
y,
|
|
1298
|
+
placement
|
|
1299
|
+
} = state;
|
|
1300
|
+
const {
|
|
1301
|
+
mainAxis: checkMainAxis = true,
|
|
1302
|
+
crossAxis: checkCrossAxis = false,
|
|
1303
|
+
limiter = {
|
|
1304
|
+
fn: _ref => {
|
|
1305
|
+
let {
|
|
1306
|
+
x,
|
|
1307
|
+
y
|
|
1308
|
+
} = _ref;
|
|
1309
|
+
return {
|
|
1310
|
+
x,
|
|
1311
|
+
y
|
|
1312
|
+
};
|
|
1313
|
+
}
|
|
1314
|
+
},
|
|
1315
|
+
...detectOverflowOptions
|
|
1316
|
+
} = evaluate(options, state);
|
|
1317
|
+
const coords = {
|
|
1318
|
+
x,
|
|
1319
|
+
y
|
|
1320
|
+
};
|
|
1321
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
1322
|
+
const crossAxis = getSideAxis(getSide(placement));
|
|
1323
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
1324
|
+
let mainAxisCoord = coords[mainAxis];
|
|
1325
|
+
let crossAxisCoord = coords[crossAxis];
|
|
1326
|
+
if (checkMainAxis) {
|
|
1327
|
+
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
|
1328
|
+
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
1329
|
+
const min = mainAxisCoord + overflow[minSide];
|
|
1330
|
+
const max = mainAxisCoord - overflow[maxSide];
|
|
1331
|
+
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
|
1332
|
+
}
|
|
1333
|
+
if (checkCrossAxis) {
|
|
1334
|
+
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
1335
|
+
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
1336
|
+
const min = crossAxisCoord + overflow[minSide];
|
|
1337
|
+
const max = crossAxisCoord - overflow[maxSide];
|
|
1338
|
+
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
|
1339
|
+
}
|
|
1340
|
+
const limitedCoords = limiter.fn({
|
|
1341
|
+
...state,
|
|
1342
|
+
[mainAxis]: mainAxisCoord,
|
|
1343
|
+
[crossAxis]: crossAxisCoord
|
|
1344
|
+
});
|
|
1345
|
+
return {
|
|
1346
|
+
...limitedCoords,
|
|
1347
|
+
data: {
|
|
1348
|
+
x: limitedCoords.x - x,
|
|
1349
|
+
y: limitedCoords.y - y
|
|
1350
|
+
}
|
|
1351
|
+
};
|
|
1352
|
+
}
|
|
1353
|
+
};
|
|
1354
|
+
};
|
|
1355
|
+
|
|
1356
|
+
function getNodeName(node) {
|
|
1357
|
+
if (isNode(node)) {
|
|
1358
|
+
return (node.nodeName || '').toLowerCase();
|
|
1359
|
+
}
|
|
1360
|
+
// Mocked nodes in testing environments may not be instances of Node. By
|
|
1361
|
+
// returning `#document` an infinite loop won't occur.
|
|
1362
|
+
// https://github.com/floating-ui/floating-ui/issues/2317
|
|
1363
|
+
return '#document';
|
|
1364
|
+
}
|
|
1365
|
+
function getWindow$1(node) {
|
|
1366
|
+
var _node$ownerDocument;
|
|
1367
|
+
return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
1368
|
+
}
|
|
1369
|
+
function getDocumentElement(node) {
|
|
1370
|
+
var _ref;
|
|
1371
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
1372
|
+
}
|
|
1373
|
+
function isNode(value) {
|
|
1374
|
+
return value instanceof Node || value instanceof getWindow$1(value).Node;
|
|
1375
|
+
}
|
|
1376
|
+
function isElement(value) {
|
|
1377
|
+
return value instanceof Element || value instanceof getWindow$1(value).Element;
|
|
1378
|
+
}
|
|
1379
|
+
function isHTMLElement(value) {
|
|
1380
|
+
return value instanceof HTMLElement || value instanceof getWindow$1(value).HTMLElement;
|
|
1381
|
+
}
|
|
1382
|
+
function isShadowRoot(value) {
|
|
1383
|
+
// Browsers without `ShadowRoot` support.
|
|
1384
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
1385
|
+
return false;
|
|
1386
|
+
}
|
|
1387
|
+
return value instanceof ShadowRoot || value instanceof getWindow$1(value).ShadowRoot;
|
|
1388
|
+
}
|
|
1389
|
+
function isOverflowElement(element) {
|
|
1390
|
+
const {
|
|
1391
|
+
overflow,
|
|
1392
|
+
overflowX,
|
|
1393
|
+
overflowY,
|
|
1394
|
+
display
|
|
1395
|
+
} = getComputedStyle(element);
|
|
1396
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
1397
|
+
}
|
|
1398
|
+
function isTableElement(element) {
|
|
1399
|
+
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
1400
|
+
}
|
|
1401
|
+
function isContainingBlock(element) {
|
|
1402
|
+
const webkit = isWebKit();
|
|
1403
|
+
const css = getComputedStyle(element);
|
|
1404
|
+
|
|
1405
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1406
|
+
return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
|
|
1407
|
+
}
|
|
1408
|
+
function getContainingBlock(element) {
|
|
1409
|
+
let currentNode = getParentNode(element);
|
|
1410
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1411
|
+
if (isContainingBlock(currentNode)) {
|
|
1412
|
+
return currentNode;
|
|
1413
|
+
} else {
|
|
1414
|
+
currentNode = getParentNode(currentNode);
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
return null;
|
|
1418
|
+
}
|
|
1419
|
+
function isWebKit() {
|
|
1420
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
1421
|
+
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
1422
|
+
}
|
|
1423
|
+
function isLastTraversableNode(node) {
|
|
1424
|
+
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
1425
|
+
}
|
|
1426
|
+
function getComputedStyle(element) {
|
|
1427
|
+
return getWindow$1(element).getComputedStyle(element);
|
|
1428
|
+
}
|
|
1429
|
+
function getNodeScroll(element) {
|
|
1430
|
+
if (isElement(element)) {
|
|
1431
|
+
return {
|
|
1432
|
+
scrollLeft: element.scrollLeft,
|
|
1433
|
+
scrollTop: element.scrollTop
|
|
1434
|
+
};
|
|
1435
|
+
}
|
|
1436
|
+
return {
|
|
1437
|
+
scrollLeft: element.pageXOffset,
|
|
1438
|
+
scrollTop: element.pageYOffset
|
|
1439
|
+
};
|
|
1440
|
+
}
|
|
1441
|
+
function getParentNode(node) {
|
|
1442
|
+
if (getNodeName(node) === 'html') {
|
|
1443
|
+
return node;
|
|
1444
|
+
}
|
|
1445
|
+
const result =
|
|
1446
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
1447
|
+
node.assignedSlot ||
|
|
1448
|
+
// DOM Element detected.
|
|
1449
|
+
node.parentNode ||
|
|
1450
|
+
// ShadowRoot detected.
|
|
1451
|
+
isShadowRoot(node) && node.host ||
|
|
1452
|
+
// Fallback.
|
|
1453
|
+
getDocumentElement(node);
|
|
1454
|
+
return isShadowRoot(result) ? result.host : result;
|
|
1455
|
+
}
|
|
1456
|
+
function getNearestOverflowAncestor(node) {
|
|
1457
|
+
const parentNode = getParentNode(node);
|
|
1458
|
+
if (isLastTraversableNode(parentNode)) {
|
|
1459
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
1460
|
+
}
|
|
1461
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
1462
|
+
return parentNode;
|
|
1463
|
+
}
|
|
1464
|
+
return getNearestOverflowAncestor(parentNode);
|
|
1465
|
+
}
|
|
1466
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
1467
|
+
var _node$ownerDocument2;
|
|
1468
|
+
if (list === void 0) {
|
|
1469
|
+
list = [];
|
|
1470
|
+
}
|
|
1471
|
+
if (traverseIframes === void 0) {
|
|
1472
|
+
traverseIframes = true;
|
|
1473
|
+
}
|
|
1474
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
1475
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
1476
|
+
const win = getWindow$1(scrollableAncestor);
|
|
1477
|
+
if (isBody) {
|
|
1478
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
|
1479
|
+
}
|
|
1480
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
function getCssDimensions(element) {
|
|
1484
|
+
const css = getComputedStyle(element);
|
|
1485
|
+
// In testing environments, the `width` and `height` properties are empty
|
|
1486
|
+
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
1487
|
+
let width = parseFloat(css.width) || 0;
|
|
1488
|
+
let height = parseFloat(css.height) || 0;
|
|
1489
|
+
const hasOffset = isHTMLElement(element);
|
|
1490
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
1491
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
1492
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
1493
|
+
if (shouldFallback) {
|
|
1494
|
+
width = offsetWidth;
|
|
1495
|
+
height = offsetHeight;
|
|
1496
|
+
}
|
|
1497
|
+
return {
|
|
1498
|
+
width,
|
|
1499
|
+
height,
|
|
1500
|
+
$: shouldFallback
|
|
1501
|
+
};
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
function unwrapElement(element) {
|
|
1505
|
+
return !isElement(element) ? element.contextElement : element;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
function getScale(element) {
|
|
1509
|
+
const domElement = unwrapElement(element);
|
|
1510
|
+
if (!isHTMLElement(domElement)) {
|
|
1511
|
+
return createCoords(1);
|
|
1512
|
+
}
|
|
1513
|
+
const rect = domElement.getBoundingClientRect();
|
|
1514
|
+
const {
|
|
1515
|
+
width,
|
|
1516
|
+
height,
|
|
1517
|
+
$
|
|
1518
|
+
} = getCssDimensions(domElement);
|
|
1519
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
1520
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
1521
|
+
|
|
1522
|
+
// 0, NaN, or Infinity should always fallback to 1.
|
|
1523
|
+
|
|
1524
|
+
if (!x || !Number.isFinite(x)) {
|
|
1525
|
+
x = 1;
|
|
1526
|
+
}
|
|
1527
|
+
if (!y || !Number.isFinite(y)) {
|
|
1528
|
+
y = 1;
|
|
1529
|
+
}
|
|
1530
|
+
return {
|
|
1531
|
+
x,
|
|
1532
|
+
y
|
|
1533
|
+
};
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
const noOffsets = /*#__PURE__*/createCoords(0);
|
|
1537
|
+
function getVisualOffsets(element) {
|
|
1538
|
+
const win = getWindow$1(element);
|
|
1539
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
1540
|
+
return noOffsets;
|
|
1541
|
+
}
|
|
1542
|
+
return {
|
|
1543
|
+
x: win.visualViewport.offsetLeft,
|
|
1544
|
+
y: win.visualViewport.offsetTop
|
|
1545
|
+
};
|
|
1546
|
+
}
|
|
1547
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
1548
|
+
if (isFixed === void 0) {
|
|
1549
|
+
isFixed = false;
|
|
1550
|
+
}
|
|
1551
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow$1(element)) {
|
|
1552
|
+
return false;
|
|
1553
|
+
}
|
|
1554
|
+
return isFixed;
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
1558
|
+
if (includeScale === void 0) {
|
|
1559
|
+
includeScale = false;
|
|
1560
|
+
}
|
|
1561
|
+
if (isFixedStrategy === void 0) {
|
|
1562
|
+
isFixedStrategy = false;
|
|
1563
|
+
}
|
|
1564
|
+
const clientRect = element.getBoundingClientRect();
|
|
1565
|
+
const domElement = unwrapElement(element);
|
|
1566
|
+
let scale = createCoords(1);
|
|
1567
|
+
if (includeScale) {
|
|
1568
|
+
if (offsetParent) {
|
|
1569
|
+
if (isElement(offsetParent)) {
|
|
1570
|
+
scale = getScale(offsetParent);
|
|
1571
|
+
}
|
|
1572
|
+
} else {
|
|
1573
|
+
scale = getScale(element);
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
1577
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
1578
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
1579
|
+
let width = clientRect.width / scale.x;
|
|
1580
|
+
let height = clientRect.height / scale.y;
|
|
1581
|
+
if (domElement) {
|
|
1582
|
+
const win = getWindow$1(domElement);
|
|
1583
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow$1(offsetParent) : offsetParent;
|
|
1584
|
+
let currentIFrame = win.frameElement;
|
|
1585
|
+
while (currentIFrame && offsetParent && offsetWin !== win) {
|
|
1586
|
+
const iframeScale = getScale(currentIFrame);
|
|
1587
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
1588
|
+
const css = getComputedStyle(currentIFrame);
|
|
1589
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
1590
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
1591
|
+
x *= iframeScale.x;
|
|
1592
|
+
y *= iframeScale.y;
|
|
1593
|
+
width *= iframeScale.x;
|
|
1594
|
+
height *= iframeScale.y;
|
|
1595
|
+
x += left;
|
|
1596
|
+
y += top;
|
|
1597
|
+
currentIFrame = getWindow$1(currentIFrame).frameElement;
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
return rectToClientRect({
|
|
1601
|
+
width,
|
|
1602
|
+
height,
|
|
1603
|
+
x,
|
|
1604
|
+
y
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
1609
|
+
let {
|
|
1610
|
+
rect,
|
|
1611
|
+
offsetParent,
|
|
1612
|
+
strategy
|
|
1613
|
+
} = _ref;
|
|
1614
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1615
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
1616
|
+
if (offsetParent === documentElement) {
|
|
1617
|
+
return rect;
|
|
1618
|
+
}
|
|
1619
|
+
let scroll = {
|
|
1620
|
+
scrollLeft: 0,
|
|
1621
|
+
scrollTop: 0
|
|
1622
|
+
};
|
|
1623
|
+
let scale = createCoords(1);
|
|
1624
|
+
const offsets = createCoords(0);
|
|
1625
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
|
|
1626
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1627
|
+
scroll = getNodeScroll(offsetParent);
|
|
1628
|
+
}
|
|
1629
|
+
if (isHTMLElement(offsetParent)) {
|
|
1630
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
1631
|
+
scale = getScale(offsetParent);
|
|
1632
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1633
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
return {
|
|
1637
|
+
width: rect.width * scale.x,
|
|
1638
|
+
height: rect.height * scale.y,
|
|
1639
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
1640
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
1641
|
+
};
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
function getClientRects(element) {
|
|
1645
|
+
return Array.from(element.getClientRects());
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
function getWindowScrollBarX(element) {
|
|
1649
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
1650
|
+
// incorrect for RTL.
|
|
1651
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
// Gets the entire size of the scrollable document area, even extending outside
|
|
1655
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
1656
|
+
function getDocumentRect(element) {
|
|
1657
|
+
const html = getDocumentElement(element);
|
|
1658
|
+
const scroll = getNodeScroll(element);
|
|
1659
|
+
const body = element.ownerDocument.body;
|
|
1660
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
1661
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
1662
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1663
|
+
const y = -scroll.scrollTop;
|
|
1664
|
+
if (getComputedStyle(body).direction === 'rtl') {
|
|
1665
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
1666
|
+
}
|
|
1667
|
+
return {
|
|
1668
|
+
width,
|
|
1669
|
+
height,
|
|
1670
|
+
x,
|
|
1671
|
+
y
|
|
1672
|
+
};
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
function getViewportRect(element, strategy) {
|
|
1676
|
+
const win = getWindow$1(element);
|
|
1677
|
+
const html = getDocumentElement(element);
|
|
1678
|
+
const visualViewport = win.visualViewport;
|
|
1679
|
+
let width = html.clientWidth;
|
|
1680
|
+
let height = html.clientHeight;
|
|
1681
|
+
let x = 0;
|
|
1682
|
+
let y = 0;
|
|
1683
|
+
if (visualViewport) {
|
|
1684
|
+
width = visualViewport.width;
|
|
1685
|
+
height = visualViewport.height;
|
|
1686
|
+
const visualViewportBased = isWebKit();
|
|
1687
|
+
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
1688
|
+
x = visualViewport.offsetLeft;
|
|
1689
|
+
y = visualViewport.offsetTop;
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
return {
|
|
1693
|
+
width,
|
|
1694
|
+
height,
|
|
1695
|
+
x,
|
|
1696
|
+
y
|
|
1697
|
+
};
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
// Returns the inner client rect, subtracting scrollbars if present.
|
|
1701
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
1702
|
+
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
1703
|
+
const top = clientRect.top + element.clientTop;
|
|
1704
|
+
const left = clientRect.left + element.clientLeft;
|
|
1705
|
+
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
1706
|
+
const width = element.clientWidth * scale.x;
|
|
1707
|
+
const height = element.clientHeight * scale.y;
|
|
1708
|
+
const x = left * scale.x;
|
|
1709
|
+
const y = top * scale.y;
|
|
1710
|
+
return {
|
|
1711
|
+
width,
|
|
1712
|
+
height,
|
|
1713
|
+
x,
|
|
1714
|
+
y
|
|
1715
|
+
};
|
|
1716
|
+
}
|
|
1717
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
1718
|
+
let rect;
|
|
1719
|
+
if (clippingAncestor === 'viewport') {
|
|
1720
|
+
rect = getViewportRect(element, strategy);
|
|
1721
|
+
} else if (clippingAncestor === 'document') {
|
|
1722
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
1723
|
+
} else if (isElement(clippingAncestor)) {
|
|
1724
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
1725
|
+
} else {
|
|
1726
|
+
const visualOffsets = getVisualOffsets(element);
|
|
1727
|
+
rect = {
|
|
1728
|
+
...clippingAncestor,
|
|
1729
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
1730
|
+
y: clippingAncestor.y - visualOffsets.y
|
|
1731
|
+
};
|
|
1732
|
+
}
|
|
1733
|
+
return rectToClientRect(rect);
|
|
1734
|
+
}
|
|
1735
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
1736
|
+
const parentNode = getParentNode(element);
|
|
1737
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
1738
|
+
return false;
|
|
1739
|
+
}
|
|
1740
|
+
return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
1744
|
+
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
1745
|
+
// of the given element up the tree.
|
|
1746
|
+
function getClippingElementAncestors(element, cache) {
|
|
1747
|
+
const cachedResult = cache.get(element);
|
|
1748
|
+
if (cachedResult) {
|
|
1749
|
+
return cachedResult;
|
|
1750
|
+
}
|
|
1751
|
+
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
1752
|
+
let currentContainingBlockComputedStyle = null;
|
|
1753
|
+
const elementIsFixed = getComputedStyle(element).position === 'fixed';
|
|
1754
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
1755
|
+
|
|
1756
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1757
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1758
|
+
const computedStyle = getComputedStyle(currentNode);
|
|
1759
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
1760
|
+
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
1761
|
+
currentContainingBlockComputedStyle = null;
|
|
1762
|
+
}
|
|
1763
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
1764
|
+
if (shouldDropCurrentNode) {
|
|
1765
|
+
// Drop non-containing blocks.
|
|
1766
|
+
result = result.filter(ancestor => ancestor !== currentNode);
|
|
1767
|
+
} else {
|
|
1768
|
+
// Record last containing block for next iteration.
|
|
1769
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
1770
|
+
}
|
|
1771
|
+
currentNode = getParentNode(currentNode);
|
|
1772
|
+
}
|
|
1773
|
+
cache.set(element, result);
|
|
1774
|
+
return result;
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
// Gets the maximum area that the element is visible in due to any number of
|
|
1778
|
+
// clipping ancestors.
|
|
1779
|
+
function getClippingRect(_ref) {
|
|
1780
|
+
let {
|
|
1781
|
+
element,
|
|
1782
|
+
boundary,
|
|
1783
|
+
rootBoundary,
|
|
1784
|
+
strategy
|
|
1785
|
+
} = _ref;
|
|
1786
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
1787
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
1788
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
1789
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
1790
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
1791
|
+
accRect.top = max(rect.top, accRect.top);
|
|
1792
|
+
accRect.right = min(rect.right, accRect.right);
|
|
1793
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
1794
|
+
accRect.left = max(rect.left, accRect.left);
|
|
1795
|
+
return accRect;
|
|
1796
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
1797
|
+
return {
|
|
1798
|
+
width: clippingRect.right - clippingRect.left,
|
|
1799
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
1800
|
+
x: clippingRect.left,
|
|
1801
|
+
y: clippingRect.top
|
|
1802
|
+
};
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
function getDimensions(element) {
|
|
1806
|
+
return getCssDimensions(element);
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
1810
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1811
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
1812
|
+
const isFixed = strategy === 'fixed';
|
|
1813
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
1814
|
+
let scroll = {
|
|
1815
|
+
scrollLeft: 0,
|
|
1816
|
+
scrollTop: 0
|
|
1817
|
+
};
|
|
1818
|
+
const offsets = createCoords(0);
|
|
1819
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1820
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1821
|
+
scroll = getNodeScroll(offsetParent);
|
|
1822
|
+
}
|
|
1823
|
+
if (isOffsetParentAnElement) {
|
|
1824
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
1825
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1826
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1827
|
+
} else if (documentElement) {
|
|
1828
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
1829
|
+
}
|
|
25
1830
|
}
|
|
26
|
-
return
|
|
1831
|
+
return {
|
|
1832
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
1833
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
|
1834
|
+
width: rect.width,
|
|
1835
|
+
height: rect.height
|
|
1836
|
+
};
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
1840
|
+
if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
|
|
1841
|
+
return null;
|
|
1842
|
+
}
|
|
1843
|
+
if (polyfill) {
|
|
1844
|
+
return polyfill(element);
|
|
1845
|
+
}
|
|
1846
|
+
return element.offsetParent;
|
|
27
1847
|
}
|
|
28
|
-
function _typeof(obj) {
|
|
29
|
-
"@babel/helpers - typeof";
|
|
30
1848
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1849
|
+
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
1850
|
+
// such as table ancestors and cross browser bugs.
|
|
1851
|
+
function getOffsetParent(element, polyfill) {
|
|
1852
|
+
const window = getWindow$1(element);
|
|
1853
|
+
if (!isHTMLElement(element)) {
|
|
1854
|
+
return window;
|
|
1855
|
+
}
|
|
1856
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
1857
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
|
|
1858
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
1859
|
+
}
|
|
1860
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
|
|
1861
|
+
return window;
|
|
1862
|
+
}
|
|
1863
|
+
return offsetParent || getContainingBlock(element) || window;
|
|
36
1864
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
1865
|
+
|
|
1866
|
+
const getElementRects = async function (_ref) {
|
|
1867
|
+
let {
|
|
1868
|
+
reference,
|
|
1869
|
+
floating,
|
|
1870
|
+
strategy
|
|
1871
|
+
} = _ref;
|
|
1872
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
1873
|
+
const getDimensionsFn = this.getDimensions;
|
|
1874
|
+
return {
|
|
1875
|
+
reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
|
|
1876
|
+
floating: {
|
|
1877
|
+
x: 0,
|
|
1878
|
+
y: 0,
|
|
1879
|
+
...(await getDimensionsFn(floating))
|
|
1880
|
+
}
|
|
1881
|
+
};
|
|
1882
|
+
};
|
|
1883
|
+
|
|
1884
|
+
function isRTL(element) {
|
|
1885
|
+
return getComputedStyle(element).direction === 'rtl';
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
const platform = {
|
|
1889
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
1890
|
+
getDocumentElement,
|
|
1891
|
+
getClippingRect,
|
|
1892
|
+
getOffsetParent,
|
|
1893
|
+
getElementRects,
|
|
1894
|
+
getClientRects,
|
|
1895
|
+
getDimensions,
|
|
1896
|
+
getScale,
|
|
1897
|
+
isElement,
|
|
1898
|
+
isRTL
|
|
1899
|
+
};
|
|
1900
|
+
|
|
1901
|
+
/**
|
|
1902
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
1903
|
+
* next to a reference element when it is given a certain CSS positioning
|
|
1904
|
+
* strategy.
|
|
1905
|
+
*/
|
|
1906
|
+
const computePosition = (reference, floating, options) => {
|
|
1907
|
+
// This caches the expensive `getClippingElementAncestors` function so that
|
|
1908
|
+
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
1909
|
+
// single call. If other functions become expensive, we can add them as well.
|
|
1910
|
+
const cache = new Map();
|
|
1911
|
+
const mergedOptions = {
|
|
1912
|
+
platform,
|
|
1913
|
+
...options
|
|
1914
|
+
};
|
|
1915
|
+
const platformWithCache = {
|
|
1916
|
+
...mergedOptions.platform,
|
|
1917
|
+
_c: cache
|
|
1918
|
+
};
|
|
1919
|
+
return computePosition$1(reference, floating, {
|
|
1920
|
+
...mergedOptions,
|
|
1921
|
+
platform: platformWithCache
|
|
1922
|
+
});
|
|
1923
|
+
};
|
|
1924
|
+
|
|
1925
|
+
var eleToOutline = ['DIV', 'P', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'OL', 'UL', 'ADDRESS', 'BLOCKQUOTE', 'DL', 'PRE'];
|
|
1926
|
+
var overriddenStyles = ['outline', 'border-radius', 'outline-offset', 'filter'];
|
|
1927
|
+
var originalStyles = {};
|
|
1928
|
+
var selected = {};
|
|
1929
|
+
function highlight(item, node, keys) {
|
|
1930
|
+
var id = item.id;
|
|
1931
|
+
if (selected[id]) return;
|
|
1932
|
+
if (!originalStyles[id]) {
|
|
1933
|
+
originalStyles[id] = overriddenStyles.reduce(function (mem, s) {
|
|
1934
|
+
mem[s] = node.style[s];
|
|
1935
|
+
return mem;
|
|
1936
|
+
}, {});
|
|
1937
|
+
}
|
|
1938
|
+
if (eleToOutline.includes(node.nodeName)) {
|
|
1939
|
+
node.style.outline = "".concat(colors.highlight, " solid 1px");
|
|
1940
|
+
node.style.setProperty('border-radius', '1px');
|
|
1941
|
+
node.style.setProperty('outline-offset', '2px');
|
|
1942
|
+
node.style.filter = 'brightness(110%)';
|
|
1943
|
+
} else {
|
|
1944
|
+
node.style.outline = "".concat(colors.highlight, " solid 1px");
|
|
1945
|
+
node.style.setProperty('border-radius', '1px');
|
|
1946
|
+
node.style.setProperty('outline-offset', '1px');
|
|
1947
|
+
node.style.filter = 'brightness(110%)';
|
|
1948
|
+
}
|
|
1949
|
+
if (!item.ribbonBox) {
|
|
1950
|
+
var _RibbonBox = RibbonBox(keys),
|
|
1951
|
+
actions = _RibbonBox.box,
|
|
1952
|
+
arrowEle = _RibbonBox.arrow;
|
|
1953
|
+
document.body.appendChild(actions);
|
|
1954
|
+
var refEle = node;
|
|
1955
|
+
if (node.childNodes.length === 1) {
|
|
1956
|
+
var childNode = node.childNodes[0];
|
|
1957
|
+
if (childNode && childNode.nodeName === '#text') {
|
|
1958
|
+
var range = document.createRange();
|
|
1959
|
+
range.selectNode(childNode);
|
|
1960
|
+
var rect = range.getBoundingClientRect();
|
|
1961
|
+
refEle = {
|
|
1962
|
+
getBoundingClientRect: function getBoundingClientRect() {
|
|
1963
|
+
return rect;
|
|
1964
|
+
}
|
|
1965
|
+
};
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
computePosition(refEle, actions, {
|
|
1969
|
+
placement: 'right',
|
|
1970
|
+
middleware: [flip({
|
|
1971
|
+
fallbackPlacements: ['left', 'bottom']
|
|
1972
|
+
}), shift(), offset$1(function (_ref) {
|
|
1973
|
+
var placement = _ref.placement,
|
|
1974
|
+
rects = _ref.rects;
|
|
1975
|
+
if (placement === 'bottom') return rects.r;
|
|
1976
|
+
return 35;
|
|
1977
|
+
}), arrow({
|
|
1978
|
+
element: arrowEle
|
|
1979
|
+
})]
|
|
1980
|
+
}).then(function (_ref2) {
|
|
1981
|
+
var x = _ref2.x,
|
|
1982
|
+
y = _ref2.y,
|
|
1983
|
+
middlewareData = _ref2.middlewareData,
|
|
1984
|
+
placement = _ref2.placement;
|
|
1985
|
+
Object.assign(actions.style, {
|
|
1986
|
+
left: "".concat(x, "px"),
|
|
1987
|
+
top: "".concat(y, "px"),
|
|
1988
|
+
display: 'inline-flex'
|
|
1989
|
+
});
|
|
1990
|
+
var side = placement.split('-')[0];
|
|
1991
|
+
var staticSide = {
|
|
1992
|
+
top: 'bottom',
|
|
1993
|
+
right: 'left',
|
|
1994
|
+
bottom: 'top',
|
|
1995
|
+
left: 'right'
|
|
1996
|
+
}[side];
|
|
1997
|
+
if (middlewareData.arrow) {
|
|
1998
|
+
var _middlewareData$arrow = middlewareData.arrow,
|
|
1999
|
+
_x = _middlewareData$arrow.x,
|
|
2000
|
+
_y = _middlewareData$arrow.y;
|
|
2001
|
+
Object.assign(arrowEle.style, _defineProperty(_defineProperty({
|
|
2002
|
+
left: _x != null ? "".concat(_x, "px") : '',
|
|
2003
|
+
top: _y != null ? "".concat(_y, "px") : '',
|
|
2004
|
+
right: '',
|
|
2005
|
+
bottom: ''
|
|
2006
|
+
}, staticSide, "".concat(side === 'bottom' ? -18 : -25, "px")), "transform", side === 'bottom' ? 'rotate(90deg)' : side === 'left' ? 'rotate(180deg)' : ''));
|
|
2007
|
+
}
|
|
45
2008
|
});
|
|
2009
|
+
item.ribbonBox = actions;
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
function highlightUninstrumented(item, node, keys) {
|
|
2013
|
+
var id = item.id;
|
|
2014
|
+
if (selected[id]) return;
|
|
2015
|
+
if (!originalStyles[id]) {
|
|
2016
|
+
originalStyles[id] = overriddenStyles.reduce(function (mem, s) {
|
|
2017
|
+
mem[s] = node.style[s];
|
|
2018
|
+
return mem;
|
|
2019
|
+
}, {});
|
|
2020
|
+
}
|
|
2021
|
+
if (eleToOutline.includes(node.nodeName)) {
|
|
2022
|
+
node.style.outline = "".concat(colors.warning, " solid 1px");
|
|
2023
|
+
node.style.setProperty('border-radius', '1px');
|
|
2024
|
+
node.style.setProperty('outline-offset', '2px');
|
|
2025
|
+
node.style.filter = 'brightness(110%)';
|
|
46
2026
|
} else {
|
|
47
|
-
|
|
2027
|
+
node.style.outline = "".concat(colors.warning, " solid 1px");
|
|
2028
|
+
node.style.setProperty('border-radius', '1px');
|
|
2029
|
+
node.style.setProperty('outline-offset', '1px');
|
|
2030
|
+
node.style.filter = 'brightness(110%)';
|
|
48
2031
|
}
|
|
49
|
-
return obj;
|
|
50
2032
|
}
|
|
51
|
-
function
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
2033
|
+
function selectedHighlight(item, node, keys) {
|
|
2034
|
+
var id = item.id;
|
|
2035
|
+
if (!originalStyles[id]) {
|
|
2036
|
+
originalStyles[id] = overriddenStyles.reduce(function (mem, s) {
|
|
2037
|
+
mem[s] = node.style[s];
|
|
2038
|
+
return mem;
|
|
2039
|
+
}, {});
|
|
58
2040
|
}
|
|
59
|
-
|
|
2041
|
+
if (eleToOutline.includes(node.nodeName)) {
|
|
2042
|
+
node.style.outline = "".concat(colors.highlight, " solid 1px");
|
|
2043
|
+
node.style.setProperty('border-radius', '1px');
|
|
2044
|
+
node.style.setProperty('outline-offset', '2px');
|
|
2045
|
+
node.style.filter = "brightness(110%) drop-shadow(0px 0px 2px ".concat(colors.highlight, " )");
|
|
2046
|
+
} else {
|
|
2047
|
+
node.style.outline = "".concat(colors.highlight, " solid 1px");
|
|
2048
|
+
node.style.setProperty('border-radius', '1px');
|
|
2049
|
+
node.style.setProperty('outline-offset', '1px');
|
|
2050
|
+
node.style.filter = "brightness(110%) drop-shadow(0px 0px 2px ".concat(colors.highlight, " )");
|
|
2051
|
+
}
|
|
2052
|
+
if (item.ribbonBox) {
|
|
2053
|
+
document.body.removeChild(item.ribbonBox);
|
|
2054
|
+
delete item.ribbonBox;
|
|
2055
|
+
}
|
|
2056
|
+
selected[id] = true;
|
|
60
2057
|
}
|
|
61
|
-
function
|
|
62
|
-
var
|
|
63
|
-
|
|
2058
|
+
function resetHighlight(item, node, keys) {
|
|
2059
|
+
var ignoreSelected = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
2060
|
+
var id = item.id;
|
|
2061
|
+
if (ignoreSelected && selected[id]) return;
|
|
2062
|
+
if (originalStyles[id]) {
|
|
2063
|
+
overriddenStyles.forEach(function (s) {
|
|
2064
|
+
node.style.setProperty(s, originalStyles[id][s]);
|
|
2065
|
+
});
|
|
2066
|
+
delete originalStyles[id];
|
|
2067
|
+
}
|
|
2068
|
+
if (item.ribbonBox) {
|
|
2069
|
+
document.body.removeChild(item.ribbonBox);
|
|
2070
|
+
delete item.ribbonBox;
|
|
2071
|
+
}
|
|
2072
|
+
delete selected[id];
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2076
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2077
|
+
var data$1 = {};
|
|
2078
|
+
function clean$1() {
|
|
2079
|
+
Object.values(data$1).forEach(function (item) {
|
|
2080
|
+
if (!document.body.contains(item.node)) {
|
|
2081
|
+
resetHighlight(item.id, item.node);
|
|
2082
|
+
delete data$1[item.id];
|
|
2083
|
+
}
|
|
2084
|
+
});
|
|
2085
|
+
}
|
|
2086
|
+
function save$1(id, subliminal, type, meta, node, children) {
|
|
2087
|
+
if (!id || !type || !meta || !node) return;
|
|
2088
|
+
if (!data$1[id]) {
|
|
2089
|
+
data$1[id] = {
|
|
2090
|
+
id: id,
|
|
2091
|
+
node: node,
|
|
2092
|
+
subliminal: subliminal
|
|
2093
|
+
};
|
|
2094
|
+
}
|
|
2095
|
+
data$1[id].keys = _objectSpread$5(_objectSpread$5({}, data$1[id].keys), {}, _defineProperty({}, "".concat(type), meta));
|
|
2096
|
+
if (children) {
|
|
2097
|
+
data$1[id].children = _objectSpread$5(_objectSpread$5({}, data$1[id].children), {}, _defineProperty({}, "".concat(type, "-").concat(children.map(function (c) {
|
|
2098
|
+
return c.childIndex;
|
|
2099
|
+
}).join(',')), children));
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
function get$1(id) {
|
|
2103
|
+
return data$1[id];
|
|
2104
|
+
}
|
|
2105
|
+
var store = {
|
|
2106
|
+
save: save$1,
|
|
2107
|
+
clean: clean$1,
|
|
2108
|
+
get: get$1,
|
|
2109
|
+
data: data$1
|
|
2110
|
+
};
|
|
2111
|
+
|
|
2112
|
+
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2113
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2114
|
+
var data = {};
|
|
2115
|
+
function clean() {
|
|
2116
|
+
Object.values(data).forEach(function (item) {
|
|
2117
|
+
if (!document.body.contains(item.node)) {
|
|
2118
|
+
resetHighlight(item.id, item.node);
|
|
2119
|
+
delete data[item.id];
|
|
2120
|
+
}
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
2123
|
+
function save(id, type, node) {
|
|
2124
|
+
if (!id || !type || !node) return;
|
|
2125
|
+
if (!data[id]) {
|
|
2126
|
+
data[id] = {
|
|
2127
|
+
id: id,
|
|
2128
|
+
node: node
|
|
2129
|
+
};
|
|
2130
|
+
}
|
|
2131
|
+
data[id].keys = _objectSpread$4(_objectSpread$4({}, data[id].keys), {}, _defineProperty({}, "".concat(type), 'uninstrumented'));
|
|
2132
|
+
}
|
|
2133
|
+
function get(id) {
|
|
2134
|
+
return data[id];
|
|
2135
|
+
}
|
|
2136
|
+
var uninstrumentedStore = {
|
|
2137
|
+
save: save,
|
|
2138
|
+
clean: clean,
|
|
2139
|
+
get: get,
|
|
2140
|
+
data: data
|
|
2141
|
+
};
|
|
2142
|
+
|
|
2143
|
+
(function () {
|
|
2144
|
+
|
|
2145
|
+
if (typeof Document === 'undefined') return;
|
|
2146
|
+
var nextID = 1;
|
|
2147
|
+
if (Document.prototype.hasOwnProperty('uniqueID')) {
|
|
2148
|
+
return;
|
|
2149
|
+
}
|
|
2150
|
+
console.info('"document.uniqueID" not implemented; creating shim');
|
|
2151
|
+
Object.defineProperty(Document.prototype, 'uniqueID', {
|
|
2152
|
+
get: function get() {
|
|
2153
|
+
return nextID++;
|
|
2154
|
+
},
|
|
2155
|
+
enumerable: false,
|
|
2156
|
+
configurable: false
|
|
2157
|
+
});
|
|
2158
|
+
Object.defineProperty(Element.prototype, 'uniqueID', {
|
|
2159
|
+
get: function get() {
|
|
2160
|
+
Object.defineProperty(this, 'uniqueID', {
|
|
2161
|
+
value: document.uniqueID,
|
|
2162
|
+
writable: false,
|
|
2163
|
+
enumerable: false,
|
|
2164
|
+
configurable: false
|
|
2165
|
+
});
|
|
2166
|
+
return this.uniqueID;
|
|
2167
|
+
},
|
|
2168
|
+
enumerable: false,
|
|
2169
|
+
configurable: true
|
|
2170
|
+
});
|
|
2171
|
+
})();
|
|
2172
|
+
|
|
2173
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2174
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2175
|
+
var currentSourceLng;
|
|
2176
|
+
var i18n;
|
|
2177
|
+
var ignoreMergedEleUniqueIds = [];
|
|
2178
|
+
function setImplementation(impl) {
|
|
2179
|
+
i18n = impl;
|
|
2180
|
+
}
|
|
2181
|
+
function walk(node, func) {
|
|
2182
|
+
if (node.dataset && node.dataset.i18nextEditorElement === 'true') return;
|
|
2183
|
+
func(node);
|
|
2184
|
+
var children = node.childNodes;
|
|
2185
|
+
for (var i = 0; i < children.length; i++) {
|
|
2186
|
+
walk(children[i], func);
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2189
|
+
function extractMeta(id, type, meta, children) {
|
|
2190
|
+
var _i18n, _i18n2;
|
|
2191
|
+
var invisibleMeta = meta.invisibleMeta,
|
|
2192
|
+
text = meta.text;
|
|
2193
|
+
if (!invisibleMeta || !invisibleMeta.key || !invisibleMeta.ns) return;
|
|
2194
|
+
if (!currentSourceLng) currentSourceLng = (_i18n = i18n) === null || _i18n === void 0 ? void 0 : _i18n.getSourceLng();
|
|
2195
|
+
return _objectSpread$3(_objectSpread$3({
|
|
2196
|
+
eleUniqueID: id,
|
|
2197
|
+
textType: type,
|
|
2198
|
+
children: children ? children.map(function (c) {
|
|
2199
|
+
return c.childIndex;
|
|
2200
|
+
}).join(',') : null,
|
|
2201
|
+
qualifiedKey: "".concat(invisibleMeta.ns, ":").concat(invisibleMeta.key)
|
|
2202
|
+
}, invisibleMeta), {}, {
|
|
2203
|
+
extractedText: text,
|
|
2204
|
+
i18nTargetLng: (_i18n2 = i18n) === null || _i18n2 === void 0 ? void 0 : _i18n2.getLng(),
|
|
2205
|
+
i18nSourceLng: currentSourceLng,
|
|
2206
|
+
i18nRawText: _defineProperty(_defineProperty({}, "".concat(invisibleMeta.lng), invisibleMeta.source === 'translation' && i18n ? i18n.getResource(invisibleMeta.lng, invisibleMeta.ns, invisibleMeta.key) : null), "".concat(currentSourceLng), invisibleMeta.source === 'translation' && i18n ? i18n.getResource(currentSourceLng, invisibleMeta.ns, invisibleMeta.key) : null)
|
|
2207
|
+
});
|
|
2208
|
+
}
|
|
2209
|
+
function containsOnlySpaces(str) {
|
|
2210
|
+
return /^\s*$/.test(str);
|
|
2211
|
+
}
|
|
2212
|
+
function handleNode(node) {
|
|
2213
|
+
if (node.childNodes && !ignoreMergedEleUniqueIds.includes(node.uniqueID)) {
|
|
2214
|
+
var merge = [];
|
|
2215
|
+
node.childNodes.forEach(function (child, i) {
|
|
2216
|
+
if (merge.length && child.nodeName !== '#text') {
|
|
2217
|
+
ignoreMergedEleUniqueIds.push(child.uniqueID);
|
|
2218
|
+
merge.push({
|
|
2219
|
+
childIndex: i,
|
|
2220
|
+
child: child
|
|
2221
|
+
});
|
|
2222
|
+
}
|
|
2223
|
+
if (child.nodeName !== '#text') return;
|
|
2224
|
+
var txt = child.textContent;
|
|
2225
|
+
if (containsOnlySpaces(txt)) return;
|
|
2226
|
+
var hasHiddenMeta = containsHiddenMeta(txt);
|
|
2227
|
+
var hasHiddenStartMarker = containsHiddenStartMarker(txt);
|
|
2228
|
+
if (hasHiddenStartMarker && hasHiddenMeta) {
|
|
2229
|
+
var meta = unwrap(txt);
|
|
2230
|
+
store.save(node.uniqueID, meta.invisibleMeta, 'text', extractMeta(node.uniqueID, 'text', meta), node);
|
|
2231
|
+
} else if (hasHiddenStartMarker) {
|
|
2232
|
+
merge.push({
|
|
2233
|
+
childIndex: i,
|
|
2234
|
+
child: child,
|
|
2235
|
+
text: txt
|
|
2236
|
+
});
|
|
2237
|
+
} else if (merge.length && !hasHiddenMeta) {
|
|
2238
|
+
merge.push({
|
|
2239
|
+
childIndex: i,
|
|
2240
|
+
child: child,
|
|
2241
|
+
text: txt
|
|
2242
|
+
});
|
|
2243
|
+
} else if (merge.length && hasHiddenMeta) {
|
|
2244
|
+
merge.push({
|
|
2245
|
+
childIndex: i,
|
|
2246
|
+
child: child,
|
|
2247
|
+
text: txt
|
|
2248
|
+
});
|
|
2249
|
+
var _meta = unwrap(merge.reduce(function (mem, item) {
|
|
2250
|
+
return mem + item.text;
|
|
2251
|
+
}, ''));
|
|
2252
|
+
store.save(node.uniqueID, _meta.invisibleMeta, 'html', extractMeta(node.uniqueID, 'html', _meta, merge), node, merge);
|
|
2253
|
+
merge = [];
|
|
2254
|
+
} else if (txt) {
|
|
2255
|
+
uninstrumentedStore.save(node.uniqueID, 'text', node);
|
|
2256
|
+
}
|
|
2257
|
+
});
|
|
2258
|
+
}
|
|
2259
|
+
if (!node.getAttribute) return;
|
|
2260
|
+
validAttributes.forEach(function (attr) {
|
|
2261
|
+
var txt = node.getAttribute(attr);
|
|
2262
|
+
if (containsHiddenMeta(txt)) {
|
|
2263
|
+
var meta = unwrap(txt);
|
|
2264
|
+
store.save(node.uniqueID, meta.invisibleMeta, "attr:".concat(attr), extractMeta(node.uniqueID, "attr:".concat(attr), meta), node);
|
|
2265
|
+
} else if (txt) {
|
|
2266
|
+
uninstrumentedStore.save(node.uniqueID, "attr:".concat(attr), node);
|
|
2267
|
+
}
|
|
2268
|
+
});
|
|
2269
|
+
}
|
|
2270
|
+
function parseTree(node) {
|
|
2271
|
+
currentSourceLng = undefined;
|
|
2272
|
+
walk(node, handleNode);
|
|
2273
|
+
store.clean();
|
|
2274
|
+
ignoreMergedEleUniqueIds = [];
|
|
2275
|
+
return store.data;
|
|
64
2276
|
}
|
|
65
2277
|
|
|
2278
|
+
function debounce(func, wait, immediate) {
|
|
2279
|
+
var timeout;
|
|
2280
|
+
return function () {
|
|
2281
|
+
var context = this;
|
|
2282
|
+
var args = arguments;
|
|
2283
|
+
var later = function later() {
|
|
2284
|
+
timeout = null;
|
|
2285
|
+
if (!immediate) func.apply(context, args);
|
|
2286
|
+
};
|
|
2287
|
+
var callNow = immediate && !timeout;
|
|
2288
|
+
clearTimeout(timeout);
|
|
2289
|
+
timeout = setTimeout(later, wait);
|
|
2290
|
+
if (callNow) func.apply(context, args);
|
|
2291
|
+
};
|
|
2292
|
+
}
|
|
66
2293
|
function isWindow(obj) {
|
|
67
2294
|
return obj != null && obj === obj.window;
|
|
68
2295
|
}
|
|
@@ -93,9 +2320,10 @@
|
|
|
93
2320
|
};
|
|
94
2321
|
}
|
|
95
2322
|
function getClickedElement(e) {
|
|
96
|
-
// clicked input
|
|
97
2323
|
if (e.srcElement && e.srcElement.nodeType === 1 && (e.srcElement.nodeName === 'BUTTON' || e.srcElement.nodeName === 'INPUT')) {
|
|
98
|
-
if (e.srcElement.getAttribute && e.srcElement.getAttribute('ignorelocizeeditor') === '')
|
|
2324
|
+
if (e.srcElement.getAttribute && e.srcElement.getAttribute('ignorelocizeeditor') === '') {
|
|
2325
|
+
return null;
|
|
2326
|
+
}
|
|
99
2327
|
return e.srcElement;
|
|
100
2328
|
}
|
|
101
2329
|
var el;
|
|
@@ -106,32 +2334,16 @@
|
|
|
106
2334
|
if (parent.getAttribute && parent.getAttribute('ignorelocizeeditor') === '') return null;
|
|
107
2335
|
var left = e.pageX;
|
|
108
2336
|
var top = e.pageY;
|
|
109
|
-
// let pOffset = offset(parent);
|
|
110
|
-
// console.warn('click', top, left);
|
|
111
|
-
// console.warn('parent', parent, pOffset, parent.clientHeight, parent.offsetHeight);
|
|
112
|
-
|
|
113
2337
|
var topStartsAt = 0;
|
|
114
2338
|
var topBreaksAt;
|
|
115
|
-
// eslint-disable-next-line no-plusplus
|
|
116
2339
|
for (var i = 0; i < parent.childNodes.length; i++) {
|
|
117
2340
|
var n = parent.childNodes[i];
|
|
118
2341
|
var nOffset = offset(n);
|
|
119
|
-
// console.warn('child', n, nOffset, n.clientHeight, n.offsetHeight)
|
|
120
|
-
|
|
121
|
-
// if a node is with the bottom over the top click set the next child as start index
|
|
122
2342
|
if (n.nodeType === 1 && nOffset.bottom < top) topStartsAt = i + 1;
|
|
123
|
-
|
|
124
|
-
// if node is below top click set end index to this node
|
|
125
2343
|
if (!topBreaksAt && nOffset.top + (n.clientHeight || 0) > top) topBreaksAt = i;
|
|
126
2344
|
}
|
|
127
|
-
|
|
128
|
-
// check we are inside children lenght
|
|
129
2345
|
if (topStartsAt + 1 > parent.childNodes.length) topStartsAt = parent.childNodes.length - 1;
|
|
130
2346
|
if (!topBreaksAt) topBreaksAt = parent.childNodes.length;
|
|
131
|
-
// console.warn('bound', topStartsAt, topBreaksAt)
|
|
132
|
-
|
|
133
|
-
// inside our boundaries check when left is to big and out of clicks left
|
|
134
|
-
// eslint-disable-next-line no-plusplus
|
|
135
2347
|
for (var y = topStartsAt; y < topBreaksAt; y++) {
|
|
136
2348
|
var _n = parent.childNodes[y];
|
|
137
2349
|
var _nOffset = offset(_n);
|
|
@@ -146,7 +2358,6 @@
|
|
|
146
2358
|
function getElementText(el) {
|
|
147
2359
|
var str = el.textContent || el.text && el.text.innerText || el.placeholder;
|
|
148
2360
|
if (typeof str !== 'string') return;
|
|
149
|
-
// eslint-disable-next-line consistent-return
|
|
150
2361
|
return str.replace(/\n +/g, '').trim();
|
|
151
2362
|
}
|
|
152
2363
|
function getAttribute(el, name) {
|
|
@@ -155,7 +2366,9 @@
|
|
|
155
2366
|
function getElementI18nKey(el) {
|
|
156
2367
|
var key = getAttribute(el, 'data-i18n');
|
|
157
2368
|
if (key) return key;
|
|
158
|
-
if (el.nodeType === window.Node.TEXT_NODE && el.parentElement)
|
|
2369
|
+
if (el.nodeType === window.Node.TEXT_NODE && el.parentElement) {
|
|
2370
|
+
return getElementI18nKey(el.parentElement);
|
|
2371
|
+
}
|
|
159
2372
|
return undefined;
|
|
160
2373
|
}
|
|
161
2374
|
function getElementNamespace(el) {
|
|
@@ -169,9 +2382,7 @@
|
|
|
169
2382
|
var jsonData = {};
|
|
170
2383
|
try {
|
|
171
2384
|
jsonData = JSON.parse(opts);
|
|
172
|
-
} catch (e) {
|
|
173
|
-
// not our problem here in editor
|
|
174
|
-
}
|
|
2385
|
+
} catch (e) {}
|
|
175
2386
|
if (jsonData.ns) found = jsonData.ns;
|
|
176
2387
|
}
|
|
177
2388
|
if (!found) found = getAttribute(ele, 'i18next-ns');
|
|
@@ -184,9 +2395,356 @@
|
|
|
184
2395
|
return found;
|
|
185
2396
|
}
|
|
186
2397
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
2398
|
+
function createObserver(ele, handle) {
|
|
2399
|
+
var internalChange;
|
|
2400
|
+
var lastToggleTimeout;
|
|
2401
|
+
var toggleInternal = function toggleInternal() {
|
|
2402
|
+
if (lastToggleTimeout) clearTimeout(lastToggleTimeout);
|
|
2403
|
+
lastToggleTimeout = setTimeout(function () {
|
|
2404
|
+
if (internalChange) internalChange = false;
|
|
2405
|
+
}, 200);
|
|
2406
|
+
};
|
|
2407
|
+
var targetEles = [];
|
|
2408
|
+
var debouncedHandler = debounce(function h() {
|
|
2409
|
+
handle(targetEles);
|
|
2410
|
+
targetEles = [];
|
|
2411
|
+
}, 100);
|
|
2412
|
+
var observer = new MutationObserver(function (mutations) {
|
|
2413
|
+
if (internalChange) {
|
|
2414
|
+
toggleInternal();
|
|
2415
|
+
return;
|
|
2416
|
+
}
|
|
2417
|
+
var triggerMutation = false;
|
|
2418
|
+
mutations.forEach(function (mutation) {
|
|
2419
|
+
if (mutation.type === 'attributes' && !validAttributes.includes(mutation.attributeName)) {
|
|
2420
|
+
return;
|
|
2421
|
+
}
|
|
2422
|
+
if (mutation.type === 'childList') {
|
|
2423
|
+
var notOurs = 0;
|
|
2424
|
+
mutation.addedNodes.forEach(function (n) {
|
|
2425
|
+
if (n.dataset && n.dataset.i18nextEditorElement === 'true') return;
|
|
2426
|
+
notOurs = notOurs + 1;
|
|
2427
|
+
}, 0);
|
|
2428
|
+
mutation.removedNodes.forEach(function (n) {
|
|
2429
|
+
if (n.dataset && n.dataset.i18nextEditorElement === 'true') return;
|
|
2430
|
+
notOurs = notOurs + 1;
|
|
2431
|
+
}, 0);
|
|
2432
|
+
if (notOurs === 0) return;
|
|
2433
|
+
}
|
|
2434
|
+
triggerMutation = true;
|
|
2435
|
+
var includedAlready = targetEles.reduce(function (mem, element) {
|
|
2436
|
+
if (mem || element.contains(mutation.target) || !mutation.target.parentElement) return true;
|
|
2437
|
+
return false;
|
|
2438
|
+
}, false);
|
|
2439
|
+
if (!includedAlready) {
|
|
2440
|
+
targetEles = targetEles.filter(function (element) {
|
|
2441
|
+
return !mutation.target.contains(element);
|
|
2442
|
+
});
|
|
2443
|
+
targetEles.push(mutation.target);
|
|
2444
|
+
}
|
|
2445
|
+
});
|
|
2446
|
+
if (triggerMutation) debouncedHandler();
|
|
2447
|
+
});
|
|
2448
|
+
return {
|
|
2449
|
+
start: function start() {
|
|
2450
|
+
var observerConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
2451
|
+
attributes: true,
|
|
2452
|
+
childList: true,
|
|
2453
|
+
characterData: true,
|
|
2454
|
+
subtree: true
|
|
2455
|
+
};
|
|
2456
|
+
observer.observe(ele, observerConfig);
|
|
2457
|
+
},
|
|
2458
|
+
skipNext: function skipNext() {
|
|
2459
|
+
internalChange = true;
|
|
2460
|
+
}
|
|
2461
|
+
};
|
|
2462
|
+
}
|
|
2463
|
+
|
|
2464
|
+
function isInViewport(element) {
|
|
2465
|
+
var rect = element.getBoundingClientRect();
|
|
2466
|
+
return rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
2467
|
+
}
|
|
2468
|
+
function mouseDistanceFromElement(mouseEvent, element) {
|
|
2469
|
+
var $n = element,
|
|
2470
|
+
mX = mouseEvent.pageX,
|
|
2471
|
+
mY = mouseEvent.pageY,
|
|
2472
|
+
from = {
|
|
2473
|
+
x: mX,
|
|
2474
|
+
y: mY
|
|
2475
|
+
},
|
|
2476
|
+
off = $n.getBoundingClientRect(),
|
|
2477
|
+
ny1 = off.top + document.body.scrollTop,
|
|
2478
|
+
ny2 = ny1 + $n.offsetHeight,
|
|
2479
|
+
nx1 = off.left + document.body.scrollLeft,
|
|
2480
|
+
nx2 = nx1 + $n.offsetWidth,
|
|
2481
|
+
maxX1 = Math.max(mX, nx1),
|
|
2482
|
+
minX2 = Math.min(mX, nx2),
|
|
2483
|
+
maxY1 = Math.max(mY, ny1),
|
|
2484
|
+
minY2 = Math.min(mY, ny2),
|
|
2485
|
+
intersectX = minX2 >= maxX1,
|
|
2486
|
+
intersectY = minY2 >= maxY1,
|
|
2487
|
+
to = {
|
|
2488
|
+
x: intersectX ? mX : nx2 < mX ? nx2 : nx1,
|
|
2489
|
+
y: intersectY ? mY : ny2 < mY ? ny2 : ny1
|
|
2490
|
+
},
|
|
2491
|
+
distX = to.x - from.x,
|
|
2492
|
+
distY = to.y - from.y,
|
|
2493
|
+
hypot = Math.pow(Math.pow(distX, 2) + Math.pow(distY, 2), 1 / 2);
|
|
2494
|
+
return Math.floor(hypot);
|
|
2495
|
+
}
|
|
2496
|
+
|
|
2497
|
+
var debouncedUpdateDistance = debounce(function (e, observer) {
|
|
2498
|
+
Object.values(store.data).forEach(function (item) {
|
|
2499
|
+
if (!isInViewport(item.node)) return;
|
|
2500
|
+
var distance = mouseDistanceFromElement(e, item.node);
|
|
2501
|
+
if (distance < 5) {
|
|
2502
|
+
highlight(item, item.node, item.keys);
|
|
2503
|
+
} else if (distance > 5) {
|
|
2504
|
+
var boxDistance = item.ribbonBox ? mouseDistanceFromElement(e, item.ribbonBox) : 1000;
|
|
2505
|
+
if (boxDistance > 10) resetHighlight(item, item.node, item.keys);
|
|
2506
|
+
}
|
|
2507
|
+
});
|
|
2508
|
+
Object.values(uninstrumentedStore.data).forEach(function (item) {
|
|
2509
|
+
if (!isInViewport(item.node)) return;
|
|
2510
|
+
var distance = mouseDistanceFromElement(e, item.node);
|
|
2511
|
+
if (distance < 10) {
|
|
2512
|
+
highlightUninstrumented(item, item.node, item.keys);
|
|
2513
|
+
} else if (distance > 10) {
|
|
2514
|
+
resetHighlight(item, item.node, item.keys);
|
|
2515
|
+
}
|
|
2516
|
+
});
|
|
2517
|
+
}, 50);
|
|
2518
|
+
var currentFC;
|
|
2519
|
+
function startMouseTracking(observer) {
|
|
2520
|
+
currentFC = function handle(e) {
|
|
2521
|
+
debouncedUpdateDistance(e, observer);
|
|
2522
|
+
};
|
|
2523
|
+
document.addEventListener('mousemove', currentFC);
|
|
2524
|
+
}
|
|
2525
|
+
function stopMouseTracking() {
|
|
2526
|
+
document.removeEventListener('mousemove', currentFC);
|
|
2527
|
+
}
|
|
2528
|
+
|
|
2529
|
+
function initDragElement() {
|
|
2530
|
+
var pos1 = 0;
|
|
2531
|
+
var pos2 = 0;
|
|
2532
|
+
var pos3 = 0;
|
|
2533
|
+
var pos4 = 0;
|
|
2534
|
+
var popups = document.getElementsByClassName('i18next-editor-popup');
|
|
2535
|
+
var elmnt = null;
|
|
2536
|
+
var overlay = null;
|
|
2537
|
+
var currentZIndex = 100;
|
|
2538
|
+
for (var i = 0; i < popups.length; i++) {
|
|
2539
|
+
var popup = popups[i];
|
|
2540
|
+
var header = getHeader(popup);
|
|
2541
|
+
popup.onmousedown = function () {
|
|
2542
|
+
this.style.zIndex = '' + ++currentZIndex;
|
|
2543
|
+
};
|
|
2544
|
+
if (header) {
|
|
2545
|
+
header.parentPopup = popup;
|
|
2546
|
+
header.onmousedown = dragMouseDown;
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2549
|
+
function dragMouseDown(e) {
|
|
2550
|
+
if (!overlay) overlay = document.getElementById('i18next-editor-popup-overlay');
|
|
2551
|
+
if (overlay) overlay.style.display = 'block';
|
|
2552
|
+
stopMouseTracking();
|
|
2553
|
+
elmnt = this.parentPopup;
|
|
2554
|
+
elmnt.style.zIndex = '' + ++currentZIndex;
|
|
2555
|
+
e = e || window.event;
|
|
2556
|
+
pos3 = e.clientX;
|
|
2557
|
+
pos4 = e.clientY;
|
|
2558
|
+
document.onmouseup = closeDragElement;
|
|
2559
|
+
document.onmousemove = elementDrag;
|
|
2560
|
+
}
|
|
2561
|
+
function elementDrag(e) {
|
|
2562
|
+
if (!elmnt) {
|
|
2563
|
+
return;
|
|
2564
|
+
}
|
|
2565
|
+
e = e || window.event;
|
|
2566
|
+
pos1 = pos3 - e.clientX;
|
|
2567
|
+
pos2 = pos4 - e.clientY;
|
|
2568
|
+
pos3 = e.clientX;
|
|
2569
|
+
pos4 = e.clientY;
|
|
2570
|
+
elmnt.style.top = elmnt.offsetTop - pos2 + 'px';
|
|
2571
|
+
elmnt.style.left = elmnt.offsetLeft - pos1 + 'px';
|
|
2572
|
+
}
|
|
2573
|
+
function closeDragElement() {
|
|
2574
|
+
startMouseTracking();
|
|
2575
|
+
if (overlay) overlay.style.display = 'none';
|
|
2576
|
+
document.onmouseup = null;
|
|
2577
|
+
document.onmousemove = null;
|
|
2578
|
+
}
|
|
2579
|
+
function getHeader(element) {
|
|
2580
|
+
var headerItems = element.getElementsByClassName('i18next-editor-popup-header');
|
|
2581
|
+
if (headerItems.length === 1) {
|
|
2582
|
+
return headerItems[0];
|
|
2583
|
+
}
|
|
2584
|
+
return null;
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
function initResizeElement() {
|
|
2588
|
+
var popups = document.getElementsByClassName('i18next-editor-popup');
|
|
2589
|
+
var element = null;
|
|
2590
|
+
var overlay = null;
|
|
2591
|
+
var startX, startY, startWidth, startHeight;
|
|
2592
|
+
for (var i = 0; i < popups.length; i++) {
|
|
2593
|
+
var p = popups[i];
|
|
2594
|
+
var right = document.createElement('div');
|
|
2595
|
+
right.className = 'resizer-right';
|
|
2596
|
+
p.appendChild(right);
|
|
2597
|
+
right.addEventListener('mousedown', initDrag, false);
|
|
2598
|
+
right.parentPopup = p;
|
|
2599
|
+
var bottom = document.createElement('div');
|
|
2600
|
+
bottom.className = 'resizer-bottom';
|
|
2601
|
+
p.appendChild(bottom);
|
|
2602
|
+
bottom.addEventListener('mousedown', initDrag, false);
|
|
2603
|
+
bottom.parentPopup = p;
|
|
2604
|
+
var both = document.createElement('div');
|
|
2605
|
+
both.className = 'resizer-both';
|
|
2606
|
+
p.appendChild(both);
|
|
2607
|
+
both.addEventListener('mousedown', initDrag, false);
|
|
2608
|
+
both.parentPopup = p;
|
|
2609
|
+
}
|
|
2610
|
+
function initDrag(e) {
|
|
2611
|
+
stopMouseTracking();
|
|
2612
|
+
if (!overlay) overlay = document.getElementById('i18next-editor-popup-overlay');
|
|
2613
|
+
if (overlay) overlay.style.display = 'block';
|
|
2614
|
+
element = this.parentPopup;
|
|
2615
|
+
startX = e.clientX;
|
|
2616
|
+
startY = e.clientY;
|
|
2617
|
+
startWidth = parseInt(document.defaultView.getComputedStyle(element).width, 10);
|
|
2618
|
+
startHeight = parseInt(document.defaultView.getComputedStyle(element).height, 10);
|
|
2619
|
+
document.documentElement.addEventListener('mousemove', doDrag, false);
|
|
2620
|
+
document.documentElement.addEventListener('mouseup', stopDrag, false);
|
|
2621
|
+
}
|
|
2622
|
+
function doDrag(e) {
|
|
2623
|
+
element.style.width = startWidth + e.clientX - startX + 'px';
|
|
2624
|
+
element.style.height = startHeight + e.clientY - startY + 'px';
|
|
2625
|
+
}
|
|
2626
|
+
function stopDrag() {
|
|
2627
|
+
startMouseTracking();
|
|
2628
|
+
if (overlay) overlay.style.display = 'none';
|
|
2629
|
+
document.documentElement.removeEventListener('mousemove', doDrag, false);
|
|
2630
|
+
document.documentElement.removeEventListener('mouseup', stopDrag, false);
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
if (sheet) {
|
|
2635
|
+
sheet.insertRule("@keyframes i18next-editor-animate-top { \n from {\n top: calc(100vh + 600px); \n left: calc(100vw + 300px);\n opacity: 0;\n }\n to {\n top: var(--i18next-editor-popup-position-top);\n left: var(--i18next-editor-popup-position-left);\n opacity: 1;\n }\n }");
|
|
2636
|
+
sheet.insertRule("@keyframes i18next-editor-animate-bottom { \n from {\n top: var(--i18next-editor-popup-position-top);\n left: var(--i18next-editor-popup-position-left);\n opacity: 1;\n }\n to {\n top: calc(100vh + 600px); \n left: calc(100vw + 300px);\n opacity: 0;\n }\n }");
|
|
2637
|
+
sheet.insertRule(".i18next-editor-popup * { \n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */\n }");
|
|
2638
|
+
sheet.insertRule(".i18next-editor-popup .resizer-right {\n width: 15px;\n height: 100%;\n background: transparent;\n position: absolute;\n right: -15px;\n bottom: 0;\n cursor: e-resize;\n }");
|
|
2639
|
+
sheet.insertRule(".i18next-editor-popup .resizer-both {\n width: 15px;\n height: 15px;\n background: transparent;\n z-index: 10;\n position: absolute;\n right: -15px;\n bottom: -15px;\n cursor: se-resize;\n }");
|
|
2640
|
+
sheet.insertRule(".i18next-editor-popup .resizer-bottom {\n width: 100%;\n height: 15px;\n background: transparent;\n position: absolute;\n right: 0;\n bottom: -15px;\n cursor: s-resize;\n }");
|
|
2641
|
+
}
|
|
2642
|
+
function Ribbon(popupEle, onMaximize) {
|
|
2643
|
+
var ribbon = document.createElement('div');
|
|
2644
|
+
ribbon.setAttribute('data-i18next-editor-element', 'true');
|
|
2645
|
+
ribbon.style = "\n cursor: pointer;\n position: fixed;\n bottom: 25px;\n right: 25px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 50px;\n height: 50px;\n background-color: rgba(249, 249, 249, 0.2);\n backdrop-filter: blur(3px);\n box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);\n border-radius: 50%\n ";
|
|
2646
|
+
ribbon.onclick = function () {
|
|
2647
|
+
onMaximize();
|
|
2648
|
+
};
|
|
2649
|
+
var image = document.createElement('img');
|
|
2650
|
+
image.src = locizeIconUrl;
|
|
2651
|
+
image.style.width = '45px';
|
|
2652
|
+
ribbon.appendChild(image);
|
|
2653
|
+
return ribbon;
|
|
2654
|
+
}
|
|
2655
|
+
function Minimize(popupEle, onMinimize) {
|
|
2656
|
+
var image = document.createElement('img');
|
|
2657
|
+
image.setAttribute('data-i18next-editor-element', 'true');
|
|
2658
|
+
image.src = minimizeIconUrl;
|
|
2659
|
+
image.style.width = '24px';
|
|
2660
|
+
image.style.cursor = 'pointer';
|
|
2661
|
+
image.onclick = function () {
|
|
2662
|
+
popupEle.style.setProperty('--i18next-editor-popup-position-top', popupEle.style.top);
|
|
2663
|
+
popupEle.style.setProperty('--i18next-editor-popup-position-left', popupEle.style.left);
|
|
2664
|
+
popupEle.style.animation = 'i18next-editor-animate-bottom 2s forwards';
|
|
2665
|
+
onMinimize();
|
|
2666
|
+
};
|
|
2667
|
+
return image;
|
|
2668
|
+
}
|
|
2669
|
+
function Popup(url, cb) {
|
|
2670
|
+
var popup = document.createElement('div');
|
|
2671
|
+
popup.setAttribute('id', 'i18next-editor-popup');
|
|
2672
|
+
popup.classList.add('i18next-editor-popup');
|
|
2673
|
+
popup.style = "\n z-index: 9;\n background-color: transparent;\n border: 1px solid rgba(200, 200, 200, 0.9);\n box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);\n border-radius: 3px;\n --i18next-editor-popup-height: 200px;\n height: var(--i18next-editor-popup-height);\n min-height: 150px;\n min-width: 300px;\n --i18next-editor-popup-width: 400px;\n width: var(--i18next-editor-popup-width);\n max-height: 600px;\n max-width: 800px;\n\n position: fixed;\n --i18next-editor-popup-position-top: calc(100vh - var(--i18next-editor-popup-height) - 10px);\n top: calc(100vh - var(--i18next-editor-popup-height) - 10px);\n --i18next-editor-popup-position-left: calc(100vw - var(--i18next-editor-popup-width) - 10px);\n left: calc(100vw - var(--i18next-editor-popup-width) - 10px);\n\n overflow: visible;\n ";
|
|
2674
|
+
popup.setAttribute('data-i18next-editor-element', 'true');
|
|
2675
|
+
var header = document.createElement('div');
|
|
2676
|
+
header.classList.add('i18next-editor-popup-header');
|
|
2677
|
+
header.style = "\n padding: 2px 10px;\n cursor: move;\n z-index: 10;\n backdrop-filter: blur(3px);\n background-color: rgba(200, 200, 200, 0.5);\n background: linear-gradient(0deg, rgba(200, 200, 200, 0.6), rgba(200, 200, 200, 0.5));\n color: #fff;\n text-align: right;\n ";
|
|
2678
|
+
popup.appendChild(header);
|
|
2679
|
+
header.appendChild(Minimize(popup, function () {
|
|
2680
|
+
var ribbon = Ribbon(popup, function () {
|
|
2681
|
+
popup.style.animation = 'i18next-editor-animate-top 1s';
|
|
2682
|
+
startMouseTracking();
|
|
2683
|
+
setTimeout(function () {
|
|
2684
|
+
document.body.removeChild(ribbon);
|
|
2685
|
+
}, 1000);
|
|
2686
|
+
});
|
|
2687
|
+
document.body.appendChild(ribbon);
|
|
2688
|
+
stopMouseTracking();
|
|
2689
|
+
}));
|
|
2690
|
+
var iframe = document.createElement('iframe');
|
|
2691
|
+
iframe.setAttribute('id', 'i18next-editor-iframe');
|
|
2692
|
+
iframe.setAttribute('data-i18next-editor-element', 'true');
|
|
2693
|
+
iframe.style = "\n z-index: 100;\n width: 100%;\n height: calc(100% - 32px);\n border: none;\n background: #fff;\n ";
|
|
2694
|
+
iframe.setAttribute('src', url);
|
|
2695
|
+
iframe.addEventListener('load', cb);
|
|
2696
|
+
popup.appendChild(iframe);
|
|
2697
|
+
var overlay = document.createElement('div');
|
|
2698
|
+
overlay.setAttribute('id', 'i18next-editor-popup-overlay');
|
|
2699
|
+
overlay.setAttribute('data-i18next-editor-element', 'true');
|
|
2700
|
+
overlay.style = "\n display: none;\n position: absolute;\n top: 32px;\n z-index: 101;\n width: 100%;\n height: calc(100% - 32px);\n background-color: rgba(200, 200, 200, 0.5);\n background: linear-gradient(0deg, rgba(240, 240, 240, 0.6), rgba(255, 255, 255, 0.5));\n backdrop-filter: blur(2px);\n";
|
|
2701
|
+
popup.appendChild(overlay);
|
|
2702
|
+
return popup;
|
|
2703
|
+
}
|
|
2704
|
+
|
|
2705
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2706
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2707
|
+
function start() {
|
|
2708
|
+
var implementation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2709
|
+
if (typeof document === 'undefined') return;
|
|
2710
|
+
var scriptEle = document.getElementById('locize');
|
|
2711
|
+
var config = {};
|
|
2712
|
+
['projectId', 'version'].forEach(function (attr) {
|
|
2713
|
+
if (!scriptEle) return;
|
|
2714
|
+
var value = scriptEle.getAttribute(attr.toLowerCase()) || scriptEle.getAttribute('data-' + attr.toLowerCase());
|
|
2715
|
+
if (value === 'true') value = true;
|
|
2716
|
+
if (value === 'false') value = false;
|
|
2717
|
+
if (value !== undefined && value !== null) config[attr] = value;
|
|
2718
|
+
});
|
|
2719
|
+
config = _objectSpread$2(_objectSpread$2({}, implementation.getLocizeDetails()), config);
|
|
2720
|
+
api.init(implementation);
|
|
2721
|
+
setImplementation(implementation);
|
|
2722
|
+
implementation === null || implementation === void 0 || implementation.bindLanguageChange(function (lng) {
|
|
2723
|
+
api.sendCurrentTargetLanguage(implementation.getLng());
|
|
2724
|
+
});
|
|
2725
|
+
function continueToStart() {
|
|
2726
|
+
var observer = createObserver(document.body, function (eles) {
|
|
2727
|
+
eles.forEach(function (ele) {
|
|
2728
|
+
parseTree(ele);
|
|
2729
|
+
});
|
|
2730
|
+
api.sendCurrentParsedContent();
|
|
2731
|
+
});
|
|
2732
|
+
observer.start();
|
|
2733
|
+
startMouseTracking(observer);
|
|
2734
|
+
document.body.append(Popup(getIframeUrl(), function () {
|
|
2735
|
+
api.requestInitialize(config);
|
|
2736
|
+
}));
|
|
2737
|
+
initDragElement();
|
|
2738
|
+
initResizeElement();
|
|
2739
|
+
}
|
|
2740
|
+
if (document.body) return continueToStart();
|
|
2741
|
+
window.addEventListener('load', function () {
|
|
2742
|
+
return continueToStart();
|
|
2743
|
+
});
|
|
2744
|
+
}
|
|
2745
|
+
|
|
2746
|
+
function createClickHandler(cb) {
|
|
2747
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
190
2748
|
var handler = function handler(e) {
|
|
191
2749
|
var el = getClickedElement(e);
|
|
192
2750
|
if (!el) return {};
|
|
@@ -206,11 +2764,8 @@
|
|
|
206
2764
|
var pR = parseFloat(style.getPropertyValue('padding-right'));
|
|
207
2765
|
var pL = parseFloat(style.getPropertyValue('padding-left'));
|
|
208
2766
|
var sizing = style.getPropertyValue('box-sizing');
|
|
209
|
-
|
|
210
|
-
// eslint-disable-next-line consistent-return
|
|
211
2767
|
function getFallbackNS() {
|
|
212
|
-
|
|
213
|
-
if (i18next && i18next.options && i18next.options.isLocizify) return i18next.options.defaultNS;
|
|
2768
|
+
if (options.isLocizify) return options.defaultNS;
|
|
214
2769
|
}
|
|
215
2770
|
cb({
|
|
216
2771
|
tagName: rectEl.tagName,
|
|
@@ -229,241 +2784,196 @@
|
|
|
229
2784
|
return handler;
|
|
230
2785
|
}
|
|
231
2786
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
var
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
turnOn.innerHTML = 'Open in locize';
|
|
257
|
-
turnOn.setAttribute('style', "".concat(baseBtn, " background-color: #1976d2;"));
|
|
258
|
-
turnOn.onclick = function () {
|
|
259
|
-
var i18next = options.getI18next();
|
|
260
|
-
var backendOptions = i18next && i18next.options && i18next.options.backend;
|
|
261
|
-
var _backendOptions$optio = _objectSpread2(_objectSpread2({}, backendOptions), options),
|
|
262
|
-
projectId = _backendOptions$optio.projectId,
|
|
263
|
-
version = _backendOptions$optio.version;
|
|
264
|
-
var editorUrl = options.editorUrl || backendOptions && backendOptions.loadPath && backendOptions.loadPath.indexOf('https://api-dev.locize.app') === 0 && 'https://dev.locize.app' || 'https://www.locize.app';
|
|
265
|
-
window.location = "".concat(editorUrl, "/cat/").concat(projectId, "/v/").concat(version, "/incontext?sourceurl=").concat(encodeURI(window.location.href));
|
|
266
|
-
};
|
|
267
|
-
turnOn.setAttribute('ignorelocizeeditor', '');
|
|
268
|
-
cont.appendChild(turnOn);
|
|
269
|
-
window.document.body.appendChild(cont);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
var isInIframe = true;
|
|
273
|
-
try {
|
|
274
|
-
// eslint-disable-next-line no-undef, no-restricted-globals
|
|
275
|
-
isInIframe = self !== top;
|
|
276
|
-
// eslint-disable-next-line no-empty
|
|
277
|
-
} catch (e) {}
|
|
278
|
-
var source;
|
|
279
|
-
var origin;
|
|
280
|
-
var handler;
|
|
281
|
-
var clickInterceptionEnabled;
|
|
282
|
-
var handleLocizeSaved;
|
|
283
|
-
var scriptTurnedOff; // used to flag turnOff by developers using the exported functions -> disable the editor function by code
|
|
284
|
-
var pendingMsgs = [];
|
|
285
|
-
function addLocizeSavedHandler(hnd) {
|
|
286
|
-
handleLocizeSaved = hnd;
|
|
287
|
-
}
|
|
288
|
-
function setEditorLng(lng) {
|
|
289
|
-
var msg = {
|
|
290
|
-
message: 'setLng',
|
|
291
|
-
lng: lng
|
|
292
|
-
};
|
|
293
|
-
if (source) {
|
|
294
|
-
source.postMessage(msg, origin);
|
|
295
|
-
} else {
|
|
296
|
-
pendingMsgs.push(msg);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
function sendHrefChanged(href) {
|
|
300
|
-
var msg = {
|
|
301
|
-
message: 'hrefChanged',
|
|
302
|
-
href: href
|
|
303
|
-
};
|
|
304
|
-
if (source) {
|
|
305
|
-
source.postMessage(msg, origin);
|
|
306
|
-
} else {
|
|
307
|
-
pendingMsgs.push(msg);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
function onAddedKey(lng, ns, key, value) {
|
|
311
|
-
var msg = {
|
|
312
|
-
message: 'added',
|
|
313
|
-
lng: lng,
|
|
314
|
-
ns: ns,
|
|
315
|
-
key: key,
|
|
316
|
-
value: value
|
|
2787
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2788
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2789
|
+
function startLegacy() {
|
|
2790
|
+
var implementation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2791
|
+
if (typeof document === 'undefined') return;
|
|
2792
|
+
var scriptEle = document.getElementById('locize');
|
|
2793
|
+
var config = {};
|
|
2794
|
+
['projectId', 'version'].forEach(function (attr) {
|
|
2795
|
+
if (!scriptEle) return;
|
|
2796
|
+
var value = scriptEle.getAttribute(attr.toLowerCase()) || scriptEle.getAttribute('data-' + attr.toLowerCase());
|
|
2797
|
+
if (value === 'true') value = true;
|
|
2798
|
+
if (value === 'false') value = false;
|
|
2799
|
+
if (value !== undefined && value !== null) config[attr] = value;
|
|
2800
|
+
});
|
|
2801
|
+
config = _objectSpread$1(_objectSpread$1({}, implementation.getLocizeDetails()), config);
|
|
2802
|
+
api.init(implementation, createClickHandler(function (payload) {
|
|
2803
|
+
sendMessage('clickedElement', {
|
|
2804
|
+
payload: payload
|
|
2805
|
+
});
|
|
2806
|
+
}, implementation.getLocizeDetails()));
|
|
2807
|
+
api.sendCurrentTargetLanguage = function (lng) {
|
|
2808
|
+
sendMessage('setLng', {
|
|
2809
|
+
lng: lng || implementation.getLng()
|
|
2810
|
+
});
|
|
317
2811
|
};
|
|
318
|
-
if (
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
2812
|
+
if (typeof window !== 'undefined') {
|
|
2813
|
+
var oldHref = window.document.location.href;
|
|
2814
|
+
window.addEventListener('load', function () {
|
|
2815
|
+
sendMessage('hrefChanged', {
|
|
2816
|
+
href: window.document.location.href
|
|
2817
|
+
});
|
|
2818
|
+
var bodyList = window.document.querySelector('body');
|
|
2819
|
+
var observer = new window.MutationObserver(function (mutations) {
|
|
2820
|
+
mutations.forEach(function (mutation) {
|
|
2821
|
+
if (oldHref !== window.document.location.href) {
|
|
2822
|
+
oldHref = window.document.location.href;
|
|
2823
|
+
sendMessage('hrefChanged', {
|
|
2824
|
+
href: oldHref
|
|
2825
|
+
});
|
|
2826
|
+
}
|
|
2827
|
+
});
|
|
2828
|
+
});
|
|
2829
|
+
var config = {
|
|
2830
|
+
childList: true,
|
|
2831
|
+
subtree: true
|
|
2832
|
+
};
|
|
2833
|
+
observer.observe(bodyList, config);
|
|
2834
|
+
});
|
|
322
2835
|
}
|
|
2836
|
+
implementation === null || implementation === void 0 || implementation.bindLanguageChange(function (lng) {
|
|
2837
|
+
api.sendCurrentTargetLanguage(implementation.getLng());
|
|
2838
|
+
});
|
|
2839
|
+
implementation === null || implementation === void 0 || implementation.bindMissingKeyHandler(function (lng, ns, k, val) {
|
|
2840
|
+
api.onAddedKey(lng, ns, k, val);
|
|
2841
|
+
});
|
|
323
2842
|
}
|
|
2843
|
+
|
|
2844
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2845
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2846
|
+
var isInIframe = typeof window !== 'undefined';
|
|
2847
|
+
try {
|
|
2848
|
+
isInIframe = self !== top;
|
|
2849
|
+
} catch (e) {}
|
|
324
2850
|
var i18next;
|
|
325
2851
|
var locizePlugin = {
|
|
326
2852
|
type: '3rdParty',
|
|
327
2853
|
init: function init(i18n) {
|
|
2854
|
+
var options = i18n.options;
|
|
328
2855
|
i18next = i18n;
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
2856
|
+
if (!isInIframe) {
|
|
2857
|
+
i18next.use(SubliminalPostProcessor);
|
|
2858
|
+
if (typeof options.postProcess === 'string') {
|
|
2859
|
+
options.postProcess = [options.postProcess, 'subliminal'];
|
|
2860
|
+
} else if (Array.isArray(options.postProcess)) {
|
|
2861
|
+
options.postProcess.push('subliminal');
|
|
2862
|
+
} else {
|
|
2863
|
+
options.postProcess = 'subliminal';
|
|
2864
|
+
}
|
|
2865
|
+
options.postProcessPassResolved = true;
|
|
2866
|
+
}
|
|
2867
|
+
var impl = {
|
|
2868
|
+
getResource: function getResource(lng, ns, key) {
|
|
2869
|
+
return i18n.getResource(lng, ns, key);
|
|
2870
|
+
},
|
|
2871
|
+
setResource: function setResource(lng, ns, key, value) {
|
|
2872
|
+
return i18n.addResource(lng, ns, key, value, {
|
|
336
2873
|
silent: true
|
|
337
2874
|
});
|
|
2875
|
+
},
|
|
2876
|
+
getResourceBundle: function getResourceBundle(lng, ns, cb) {
|
|
2877
|
+
i18n.loadNamespaces(ns, function () {
|
|
2878
|
+
cb(i18n.getResourceBundle(lng, ns));
|
|
2879
|
+
});
|
|
2880
|
+
},
|
|
2881
|
+
getLng: function getLng() {
|
|
2882
|
+
return i18n.languages[0];
|
|
2883
|
+
},
|
|
2884
|
+
getSourceLng: function getSourceLng() {
|
|
2885
|
+
var fallback = i18n.options.fallbackLng;
|
|
2886
|
+
if (typeof fallback === 'string') return fallback;
|
|
2887
|
+
if (Array.isArray(fallback)) return fallback[fallback.length - 1];
|
|
2888
|
+
if (fallback && fallback["default"]) {
|
|
2889
|
+
if (typeof fallback["default"] === 'string') return fallback;
|
|
2890
|
+
if (Array.isArray(fallback["default"])) return fallback["default"][fallback["default"].length - 1];
|
|
2891
|
+
}
|
|
2892
|
+
if (typeof fallback === 'function') {
|
|
2893
|
+
var res = fallback(i18n.resolvedLanguage);
|
|
2894
|
+
if (typeof res === 'string') return res;
|
|
2895
|
+
if (Array.isArray(res)) return res[res.length - 1];
|
|
2896
|
+
}
|
|
2897
|
+
return 'dev';
|
|
2898
|
+
},
|
|
2899
|
+
getLocizeDetails: function getLocizeDetails() {
|
|
2900
|
+
var backendName = i18n.services.backendConnector.backend ? i18n.services.backendConnector.backend.constructor.name : 'options.resources';
|
|
2901
|
+
var opts = {
|
|
2902
|
+
backendName: backendName,
|
|
2903
|
+
sourceLng: impl.getSourceLng(),
|
|
2904
|
+
i18nFormat: i18n.options.compatibilityJSON === 'v3' ? 'i18next_v3' : 'i18next_v4',
|
|
2905
|
+
i18nFramework: 'i18next',
|
|
2906
|
+
isLocizify: i18n.options.isLocizify,
|
|
2907
|
+
defaultNS: i18n.options.defaultNS
|
|
2908
|
+
};
|
|
2909
|
+
if (!i18n.options.backend && !i18n.options.editor) return opts;
|
|
2910
|
+
var pickFrom = i18n.options.backend || i18n.options.editor;
|
|
2911
|
+
return _objectSpread(_objectSpread({}, opts), {}, {
|
|
2912
|
+
projectId: pickFrom.projectId,
|
|
2913
|
+
version: pickFrom.version
|
|
2914
|
+
});
|
|
2915
|
+
},
|
|
2916
|
+
bindLanguageChange: function bindLanguageChange(cb) {
|
|
2917
|
+
i18n.on('languageChanged', cb);
|
|
2918
|
+
},
|
|
2919
|
+
bindMissingKeyHandler: function bindMissingKeyHandler(cb) {
|
|
2920
|
+
i18n.options.missingKeyHandler = function (lng, ns, k, val, isUpdate, opts) {
|
|
2921
|
+
if (!isUpdate) cb(lng, ns, k, val);
|
|
2922
|
+
};
|
|
2923
|
+
},
|
|
2924
|
+
triggerRerender: function triggerRerender() {
|
|
338
2925
|
i18n.emit('editorSaved');
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
if (isInIframe) {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
2926
|
+
}
|
|
2927
|
+
};
|
|
2928
|
+
if (!isInIframe) {
|
|
2929
|
+
start(impl);
|
|
2930
|
+
} else {
|
|
2931
|
+
startLegacy(impl);
|
|
345
2932
|
}
|
|
346
|
-
i18next.on('languageChanged', function (lng) {
|
|
347
|
-
setEditorLng(lng);
|
|
348
|
-
});
|
|
349
2933
|
}
|
|
350
2934
|
};
|
|
351
|
-
function getI18next() {
|
|
352
|
-
return i18next;
|
|
353
|
-
}
|
|
354
|
-
function showLocizeLink() {
|
|
355
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
356
|
-
if (!isInIframe) initUI(_objectSpread2(_objectSpread2({}, options), {}, {
|
|
357
|
-
getI18next: getI18next
|
|
358
|
-
}));
|
|
359
|
-
}
|
|
360
|
-
if (typeof window !== 'undefined') {
|
|
361
|
-
// eslint-disable-next-line consistent-return
|
|
362
|
-
window.addEventListener('message', function (e) {
|
|
363
|
-
if (!e.data || !e.data.message) return;
|
|
364
|
-
if (e.data.message === 'isLocizeEnabled') {
|
|
365
|
-
// console.warn("result: ", ev.data);
|
|
366
|
-
// parent => ev.source;
|
|
367
|
-
if (!source) {
|
|
368
|
-
source = e.source;
|
|
369
|
-
origin = e.origin;
|
|
370
|
-
handler = createClickHandler(function (payload) {
|
|
371
|
-
source.postMessage({
|
|
372
|
-
message: 'clickedElement',
|
|
373
|
-
payload: payload
|
|
374
|
-
}, origin);
|
|
375
|
-
}, {
|
|
376
|
-
getI18next: getI18next
|
|
377
|
-
});
|
|
378
|
-
// document.body.addEventListener('click', handler, true);
|
|
379
|
-
// clickInterceptionEnabled = true;
|
|
380
|
-
}
|
|
381
2935
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
}, origin);
|
|
395
|
-
if (!clickInterceptionEnabled) window.document.body.addEventListener('click', handler, true);
|
|
396
|
-
clickInterceptionEnabled = true;
|
|
397
|
-
source.postMessage({
|
|
398
|
-
message: 'turnedOn'
|
|
399
|
-
}, origin);
|
|
400
|
-
} else if (e.data.message === 'turnOff') {
|
|
401
|
-
// eslint-disable-next-line consistent-return
|
|
402
|
-
if (scriptTurnedOff) return source.postMessage({
|
|
403
|
-
message: 'forcedOff'
|
|
404
|
-
}, origin);
|
|
405
|
-
if (clickInterceptionEnabled) window.document.body.removeEventListener('click', handler, true);
|
|
406
|
-
clickInterceptionEnabled = false;
|
|
407
|
-
source.postMessage({
|
|
408
|
-
message: 'turnedOff'
|
|
409
|
-
}, origin);
|
|
410
|
-
} else if (e.data.message === 'committed') {
|
|
411
|
-
var data = e.data.payload;
|
|
412
|
-
if (window.locizeSavedHandler) window.locizeSavedHandler(data);
|
|
413
|
-
if (handleLocizeSaved) handleLocizeSaved(data);
|
|
2936
|
+
function startStandalone() {
|
|
2937
|
+
startLegacy({
|
|
2938
|
+
getLocizeDetails: function getLocizeDetails() {
|
|
2939
|
+
return {};
|
|
2940
|
+
},
|
|
2941
|
+
getLng: function getLng() {
|
|
2942
|
+
return undefined;
|
|
2943
|
+
},
|
|
2944
|
+
setResource: function setResource() {},
|
|
2945
|
+
triggerRerender: function triggerRerender() {},
|
|
2946
|
+
getResourceBundle: function getResourceBundle() {
|
|
2947
|
+
return {};
|
|
414
2948
|
}
|
|
415
2949
|
});
|
|
416
2950
|
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
message: 'turnedOff'
|
|
432
|
-
}, origin);
|
|
433
|
-
if (source) source.postMessage({
|
|
434
|
-
message: 'forcedOff'
|
|
435
|
-
}, origin);
|
|
436
|
-
return scriptTurnedOff;
|
|
437
|
-
}
|
|
438
|
-
if (typeof window !== 'undefined') {
|
|
439
|
-
var oldHref = window.document.location.href;
|
|
440
|
-
window.addEventListener('load', function () {
|
|
441
|
-
sendHrefChanged(window.document.location.href);
|
|
442
|
-
var bodyList = window.document.querySelector('body');
|
|
443
|
-
var observer = new window.MutationObserver(function (mutations) {
|
|
444
|
-
mutations.forEach(function (mutation) {
|
|
445
|
-
if (oldHref !== window.document.location.href) {
|
|
446
|
-
// console.warn('url changed', oldHref, document.location.href);
|
|
447
|
-
oldHref = window.document.location.href;
|
|
448
|
-
sendHrefChanged(oldHref);
|
|
449
|
-
}
|
|
450
|
-
});
|
|
451
|
-
});
|
|
452
|
-
var config = {
|
|
453
|
-
childList: true,
|
|
454
|
-
subtree: true
|
|
455
|
-
};
|
|
456
|
-
observer.observe(bodyList, config);
|
|
457
|
-
});
|
|
458
|
-
}
|
|
2951
|
+
if (typeof window !== 'undefined') window.locizeStartStandalone = startStandalone;
|
|
2952
|
+
|
|
2953
|
+
var index = {
|
|
2954
|
+
wrap: wrap,
|
|
2955
|
+
unwrap: unwrap,
|
|
2956
|
+
containsHiddenMeta: containsHiddenMeta,
|
|
2957
|
+
PostProcessor: SubliminalPostProcessor,
|
|
2958
|
+
addLocizeSavedHandler: addLocizeSavedHandler,
|
|
2959
|
+
locizePlugin: locizePlugin,
|
|
2960
|
+
turnOn: turnOn,
|
|
2961
|
+
turnOff: turnOff,
|
|
2962
|
+
setEditorLng: setEditorLng,
|
|
2963
|
+
startStandalone: startStandalone
|
|
2964
|
+
};
|
|
459
2965
|
|
|
2966
|
+
exports.PostProcessor = SubliminalPostProcessor;
|
|
460
2967
|
exports.addLocizeSavedHandler = addLocizeSavedHandler;
|
|
2968
|
+
exports.containsHiddenMeta = containsHiddenMeta;
|
|
2969
|
+
exports["default"] = index;
|
|
461
2970
|
exports.locizePlugin = locizePlugin;
|
|
462
|
-
exports.onAddedKey = onAddedKey;
|
|
463
2971
|
exports.setEditorLng = setEditorLng;
|
|
464
|
-
exports.
|
|
2972
|
+
exports.startStandalone = startStandalone;
|
|
465
2973
|
exports.turnOff = turnOff;
|
|
466
2974
|
exports.turnOn = turnOn;
|
|
2975
|
+
exports.unwrap = unwrap;
|
|
2976
|
+
exports.wrap = wrap;
|
|
467
2977
|
|
|
468
2978
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
469
2979
|
|