@soul-refiner/design-system 2.0.0-alpha.18 → 2.0.0-alpha.19
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/dist/_virtual/_cloneBuffer.js +5 -0
- package/dist/_virtual/_commonjsHelpers.js +10 -0
- package/dist/_virtual/_nodeUtil.js +5 -0
- package/dist/_virtual/index.js +5 -0
- package/dist/_virtual/index2.js +5 -0
- package/dist/_virtual/index3.js +5 -0
- package/dist/_virtual/isBuffer.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.development.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.production.min.js +5 -0
- package/dist/_virtual/util.js +5 -0
- package/dist/_virtual/with-selector.development.js +5 -0
- package/dist/_virtual/with-selector.js +5 -0
- package/dist/_virtual/with-selector.production.min.js +5 -0
- package/dist/node_modules/@udecode/plate-alignment/dist/index.js +98 -0
- package/dist/node_modules/@udecode/plate-core/dist/index.js +2656 -0
- package/dist/node_modules/@udecode/plate-link/dist/index.js +585 -0
- package/dist/node_modules/@udecode/plate-media/dist/index.js +211 -0
- package/dist/node_modules/@udecode/plate-normalizers/dist/index.js +20 -0
- package/dist/node_modules/@udecode/plate-resizable/dist/index.js +334 -0
- package/dist/node_modules/@udecode/plate-table/dist/index.js +1371 -0
- package/dist/node_modules/@udecode/plate-utils/dist/index.js +127 -0
- package/dist/node_modules/@udecode/slate/dist/index.js +316 -0
- package/dist/node_modules/@udecode/slate-react/dist/index.js +35 -0
- package/dist/node_modules/@udecode/slate-utils/dist/index.js +230 -0
- package/dist/node_modules/@udecode/utils/dist/index.js +61 -0
- package/dist/node_modules/clsx/dist/clsx.m.js +8 -0
- package/dist/node_modules/dequal/dist/index.js +88 -0
- package/dist/node_modules/immer/dist/immer.js +968 -0
- package/dist/node_modules/is-hotkey/lib/index.js +253 -0
- package/dist/node_modules/jotai/esm/react/utils.js +29 -0
- package/dist/node_modules/jotai/esm/react.js +116 -0
- package/dist/node_modules/jotai/esm/vanilla/utils.js +44 -0
- package/dist/node_modules/jotai/esm/vanilla.js +602 -0
- package/dist/node_modules/jotai-optics/dist/index.modern.js +8 -0
- package/dist/node_modules/jotai-x/dist/index.js +259 -0
- package/dist/node_modules/js-video-url-parser/lib/base.js +9 -0
- package/dist/node_modules/js-video-url-parser/lib/provider/allocine.js +38 -0
- package/dist/node_modules/js-video-url-parser/lib/provider/canalplus.js +50 -0
- package/dist/node_modules/js-video-url-parser/lib/provider/coub.js +58 -0
- package/dist/node_modules/js-video-url-parser/lib/provider/dailymotion.js +74 -0
- package/dist/node_modules/js-video-url-parser/lib/provider/facebook.js +82 -0
- package/dist/node_modules/js-video-url-parser/lib/provider/loom.js +55 -0
- package/dist/node_modules/js-video-url-parser/lib/provider/soundcloud.js +129 -0
- package/dist/node_modules/js-video-url-parser/lib/provider/teachertube.js +114 -0
- package/dist/node_modules/js-video-url-parser/lib/provider/ted.js +100 -0
- package/dist/node_modules/js-video-url-parser/lib/provider/tiktok.js +54 -0
- package/dist/node_modules/js-video-url-parser/lib/provider/twitch.js +154 -0
- package/dist/node_modules/js-video-url-parser/lib/provider/vimeo.js +93 -0
- package/dist/node_modules/js-video-url-parser/lib/provider/wistia.js +116 -0
- package/dist/node_modules/js-video-url-parser/lib/provider/youku.js +87 -0
- package/dist/node_modules/js-video-url-parser/lib/provider/youtube.js +209 -0
- package/dist/node_modules/js-video-url-parser/lib/urlParser.js +88 -0
- package/dist/node_modules/js-video-url-parser/lib/util.js +112 -0
- package/dist/node_modules/lodash/_DataView.js +14 -0
- package/dist/node_modules/lodash/_Hash.js +42 -0
- package/dist/node_modules/lodash/_ListCache.js +42 -0
- package/dist/node_modules/lodash/_Map.js +14 -0
- package/dist/node_modules/lodash/_MapCache.js +42 -0
- package/dist/node_modules/lodash/_Promise.js +14 -0
- package/dist/node_modules/lodash/_Set.js +14 -0
- package/dist/node_modules/lodash/_SetCache.js +35 -0
- package/dist/node_modules/lodash/_Stack.js +38 -0
- package/dist/node_modules/lodash/_Symbol.js +12 -0
- package/dist/node_modules/lodash/_Uint8Array.js +12 -0
- package/dist/node_modules/lodash/_WeakMap.js +14 -0
- package/dist/node_modules/lodash/_apply.js +26 -0
- package/dist/node_modules/lodash/_arrayAggregator.js +27 -0
- package/dist/node_modules/lodash/_arrayEach.js +27 -0
- package/dist/node_modules/lodash/_arrayFilter.js +30 -0
- package/dist/node_modules/lodash/_arrayLikeKeys.js +60 -0
- package/dist/node_modules/lodash/_arrayMap.js +26 -0
- package/dist/node_modules/lodash/_arrayPush.js +25 -0
- package/dist/node_modules/lodash/_arraySome.js +28 -0
- package/dist/node_modules/lodash/_assignMergeValue.js +27 -0
- package/dist/node_modules/lodash/_assignValue.js +35 -0
- package/dist/node_modules/lodash/_assocIndexOf.js +27 -0
- package/dist/node_modules/lodash/_baseAggregator.js +27 -0
- package/dist/node_modules/lodash/_baseAssign.js +24 -0
- package/dist/node_modules/lodash/_baseAssignIn.js +24 -0
- package/dist/node_modules/lodash/_baseAssignValue.js +31 -0
- package/dist/node_modules/lodash/_baseClone.js +193 -0
- package/dist/node_modules/lodash/_baseCreate.js +36 -0
- package/dist/node_modules/lodash/_baseEach.js +21 -0
- package/dist/node_modules/lodash/_baseFlatten.js +45 -0
- package/dist/node_modules/lodash/_baseFor.js +22 -0
- package/dist/node_modules/lodash/_baseForOwn.js +23 -0
- package/dist/node_modules/lodash/_baseGet.js +31 -0
- package/dist/node_modules/lodash/_baseGetAllKeys.js +27 -0
- package/dist/node_modules/lodash/_baseGetTag.js +36 -0
- package/dist/node_modules/lodash/_baseHasIn.js +18 -0
- package/dist/node_modules/lodash/_baseIsArguments.js +25 -0
- package/dist/node_modules/lodash/_baseIsEqual.js +35 -0
- package/dist/node_modules/lodash/_baseIsEqualDeep.js +96 -0
- package/dist/node_modules/lodash/_baseIsMap.js +25 -0
- package/dist/node_modules/lodash/_baseIsMatch.js +69 -0
- package/dist/node_modules/lodash/_baseIsNative.js +56 -0
- package/dist/node_modules/lodash/_baseIsSet.js +25 -0
- package/dist/node_modules/lodash/_baseIsTypedArray.js +68 -0
- package/dist/node_modules/lodash/_baseIteratee.js +41 -0
- package/dist/node_modules/lodash/_baseKeys.js +37 -0
- package/dist/node_modules/lodash/_baseKeysIn.js +41 -0
- package/dist/node_modules/lodash/_baseMap.js +29 -0
- package/dist/node_modules/lodash/_baseMatches.js +30 -0
- package/dist/node_modules/lodash/_baseMatchesProperty.js +45 -0
- package/dist/node_modules/lodash/_baseMerge.js +54 -0
- package/dist/node_modules/lodash/_baseMergeDeep.js +114 -0
- package/dist/node_modules/lodash/_baseProperty.js +19 -0
- package/dist/node_modules/lodash/_basePropertyDeep.js +22 -0
- package/dist/node_modules/lodash/_baseRest.js +25 -0
- package/dist/node_modules/lodash/_baseSetToString.js +30 -0
- package/dist/node_modules/lodash/_baseSlice.js +36 -0
- package/dist/node_modules/lodash/_baseTimes.js +25 -0
- package/dist/node_modules/lodash/_baseToString.js +46 -0
- package/dist/node_modules/lodash/_baseUnary.js +19 -0
- package/dist/node_modules/lodash/_baseUnset.js +29 -0
- package/dist/node_modules/lodash/_baseValues.js +25 -0
- package/dist/node_modules/lodash/_cacheHas.js +18 -0
- package/dist/node_modules/lodash/_castPath.js +30 -0
- package/dist/node_modules/lodash/_cloneArrayBuffer.js +22 -0
- package/dist/node_modules/lodash/_cloneBuffer.js +48 -0
- package/dist/node_modules/lodash/_cloneDataView.js +22 -0
- package/dist/node_modules/lodash/_cloneRegExp.js +22 -0
- package/dist/node_modules/lodash/_cloneSymbol.js +24 -0
- package/dist/node_modules/lodash/_cloneTypedArray.js +22 -0
- package/dist/node_modules/lodash/_copyArray.js +25 -0
- package/dist/node_modules/lodash/_copyObject.js +47 -0
- package/dist/node_modules/lodash/_copySymbols.js +23 -0
- package/dist/node_modules/lodash/_copySymbolsIn.js +23 -0
- package/dist/node_modules/lodash/_coreJsData.js +12 -0
- package/dist/node_modules/lodash/_createAggregator.js +32 -0
- package/dist/node_modules/lodash/_createAssigner.js +44 -0
- package/dist/node_modules/lodash/_createBaseEach.js +38 -0
- package/dist/node_modules/lodash/_createBaseFor.js +30 -0
- package/dist/node_modules/lodash/_customDefaultsMerge.js +35 -0
- package/dist/node_modules/lodash/_customOmitClone.js +22 -0
- package/dist/node_modules/lodash/_defineProperty.js +17 -0
- package/dist/node_modules/lodash/_equalArrays.js +92 -0
- package/dist/node_modules/lodash/_equalByTag.js +123 -0
- package/dist/node_modules/lodash/_equalObjects.js +96 -0
- package/dist/node_modules/lodash/_flatRest.js +24 -0
- package/dist/node_modules/lodash/_freeGlobal.js +11 -0
- package/dist/node_modules/lodash/_getAllKeys.js +24 -0
- package/dist/node_modules/lodash/_getAllKeysIn.js +25 -0
- package/dist/node_modules/lodash/_getMapData.js +24 -0
- package/dist/node_modules/lodash/_getMatchData.js +31 -0
- package/dist/node_modules/lodash/_getNative.js +24 -0
- package/dist/node_modules/lodash/_getPrototype.js +12 -0
- package/dist/node_modules/lodash/_getRawTag.js +52 -0
- package/dist/node_modules/lodash/_getSymbols.js +37 -0
- package/dist/node_modules/lodash/_getSymbolsIn.js +34 -0
- package/dist/node_modules/lodash/_getTag.js +70 -0
- package/dist/node_modules/lodash/_getValue.js +18 -0
- package/dist/node_modules/lodash/_hasPath.js +50 -0
- package/dist/node_modules/lodash/_hashClear.js +21 -0
- package/dist/node_modules/lodash/_hashDelete.js +22 -0
- package/dist/node_modules/lodash/_hashGet.js +36 -0
- package/dist/node_modules/lodash/_hashHas.js +29 -0
- package/dist/node_modules/lodash/_hashSet.js +29 -0
- package/dist/node_modules/lodash/_initCloneArray.js +31 -0
- package/dist/node_modules/lodash/_initCloneByTag.js +87 -0
- package/dist/node_modules/lodash/_initCloneObject.js +26 -0
- package/dist/node_modules/lodash/_isFlattenable.js +28 -0
- package/dist/node_modules/lodash/_isIndex.js +30 -0
- package/dist/node_modules/lodash/_isIterateeCall.js +39 -0
- package/dist/node_modules/lodash/_isKey.js +36 -0
- package/dist/node_modules/lodash/_isKeyable.js +20 -0
- package/dist/node_modules/lodash/_isMasked.js +26 -0
- package/dist/node_modules/lodash/_isPrototype.js +23 -0
- package/dist/node_modules/lodash/_isStrictComparable.js +21 -0
- package/dist/node_modules/lodash/_listCacheClear.js +18 -0
- package/dist/node_modules/lodash/_listCacheDelete.js +41 -0
- package/dist/node_modules/lodash/_listCacheGet.js +25 -0
- package/dist/node_modules/lodash/_listCacheHas.js +22 -0
- package/dist/node_modules/lodash/_listCacheSet.js +32 -0
- package/dist/node_modules/lodash/_mapCacheClear.js +29 -0
- package/dist/node_modules/lodash/_mapCacheDelete.js +24 -0
- package/dist/node_modules/lodash/_mapCacheGet.js +22 -0
- package/dist/node_modules/lodash/_mapCacheHas.js +22 -0
- package/dist/node_modules/lodash/_mapCacheSet.js +28 -0
- package/dist/node_modules/lodash/_mapToArray.js +23 -0
- package/dist/node_modules/lodash/_matchesStrictComparable.js +25 -0
- package/dist/node_modules/lodash/_memoizeCapped.js +32 -0
- package/dist/node_modules/lodash/_nativeCreate.js +12 -0
- package/dist/node_modules/lodash/_nativeKeys.js +12 -0
- package/dist/node_modules/lodash/_nativeKeysIn.js +25 -0
- package/dist/node_modules/lodash/_nodeUtil.js +43 -0
- package/dist/node_modules/lodash/_objectToString.js +27 -0
- package/dist/node_modules/lodash/_overArg.js +20 -0
- package/dist/node_modules/lodash/_overRest.js +42 -0
- package/dist/node_modules/lodash/_parent.js +23 -0
- package/dist/node_modules/lodash/_root.js +15 -0
- package/dist/node_modules/lodash/_safeGet.js +26 -0
- package/dist/node_modules/lodash/_setCacheAdd.js +24 -0
- package/dist/node_modules/lodash/_setCacheHas.js +19 -0
- package/dist/node_modules/lodash/_setToArray.js +23 -0
- package/dist/node_modules/lodash/_setToString.js +21 -0
- package/dist/node_modules/lodash/_shortOut.js +42 -0
- package/dist/node_modules/lodash/_stackClear.js +21 -0
- package/dist/node_modules/lodash/_stackDelete.js +23 -0
- package/dist/node_modules/lodash/_stackGet.js +19 -0
- package/dist/node_modules/lodash/_stackHas.js +19 -0
- package/dist/node_modules/lodash/_stackSet.js +42 -0
- package/dist/node_modules/lodash/_stringToPath.js +33 -0
- package/dist/node_modules/lodash/_toKey.js +27 -0
- package/dist/node_modules/lodash/_toSource.js +31 -0
- package/dist/node_modules/lodash/castArray.js +55 -0
- package/dist/node_modules/lodash/cloneDeep.js +40 -0
- package/dist/node_modules/lodash/constant.js +31 -0
- package/dist/node_modules/lodash/defaults.js +69 -0
- package/dist/node_modules/lodash/defaultsDeep.js +44 -0
- package/dist/node_modules/lodash/eq.js +42 -0
- package/dist/node_modules/lodash/flatten.js +28 -0
- package/dist/node_modules/lodash/get.js +39 -0
- package/dist/node_modules/lodash/hasIn.js +41 -0
- package/dist/node_modules/lodash/identity.js +26 -0
- package/dist/node_modules/lodash/isArguments.js +43 -0
- package/dist/node_modules/lodash/isArray.js +31 -0
- package/dist/node_modules/lodash/isArrayLike.js +40 -0
- package/dist/node_modules/lodash/isArrayLikeObject.js +40 -0
- package/dist/node_modules/lodash/isBuffer.js +52 -0
- package/dist/node_modules/lodash/isFunction.js +44 -0
- package/dist/node_modules/lodash/isLength.js +40 -0
- package/dist/node_modules/lodash/isMap.js +35 -0
- package/dist/node_modules/lodash/isObject.js +36 -0
- package/dist/node_modules/lodash/isObjectLike.js +34 -0
- package/dist/node_modules/lodash/isPlainObject.js +70 -0
- package/dist/node_modules/lodash/isSet.js +35 -0
- package/dist/node_modules/lodash/isSymbol.js +36 -0
- package/dist/node_modules/lodash/isTypedArray.js +35 -0
- package/dist/node_modules/lodash/keyBy.js +48 -0
- package/dist/node_modules/lodash/keys.js +45 -0
- package/dist/node_modules/lodash/keysIn.js +40 -0
- package/dist/node_modules/lodash/last.js +25 -0
- package/dist/node_modules/lodash/map.js +67 -0
- package/dist/node_modules/lodash/memoize.js +79 -0
- package/dist/node_modules/lodash/merge.js +51 -0
- package/dist/node_modules/lodash/mergeWith.js +46 -0
- package/dist/node_modules/lodash/omit.js +75 -0
- package/dist/node_modules/lodash/property.js +41 -0
- package/dist/node_modules/lodash/stubArray.js +28 -0
- package/dist/node_modules/lodash/stubFalse.js +23 -0
- package/dist/node_modules/lodash/toPlainObject.js +39 -0
- package/dist/node_modules/lodash/toString.js +34 -0
- package/dist/node_modules/lodash/values.js +46 -0
- package/dist/node_modules/lodash.mapvalues/index.js +2290 -0
- package/dist/node_modules/optics-ts/dist/mjs/index.js +31 -0
- package/dist/node_modules/optics-ts/dist/mjs/internals.js +460 -0
- package/dist/node_modules/proxy-compare/dist/index.modern.js +7 -0
- package/dist/node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.js +395 -0
- package/dist/node_modules/react-tracked/dist/index.modern.js +48 -0
- package/dist/node_modules/use-deep-compare/dist-web/index.js +35 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +181 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +32 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +254 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js +30 -0
- package/dist/node_modules/use-sync-external-store/shim/index.js +21 -0
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js +19 -0
- package/dist/node_modules/zustand/esm/middleware.js +551 -0
- package/dist/node_modules/zustand/esm/traditional.js +25 -0
- package/dist/node_modules/zustand/esm/vanilla.js +34 -0
- package/dist/node_modules/zustand-x/dist/index.js +217 -0
- package/dist/src/common/styles.js +12 -12
- package/dist/src/components/actions/button/button.js +11 -10
- package/dist/src/components/actions/dropdown/dropdown.js +5 -5
- package/dist/src/components/actions/rate/rate.js +2 -2
- package/dist/src/components/actions/switch/switch.js +3 -3
- package/dist/src/components/actions/toggle/toggle.js +4 -4
- package/dist/src/components/actions/upload/upload.js +3 -3
- package/dist/src/components/atoms/box/box.js +2 -2
- package/dist/src/components/atoms/typography/display.js +2 -2
- package/dist/src/components/atoms/typography/heading.js +2 -2
- package/dist/src/components/atoms/typography/paragraph.js +2 -2
- package/dist/src/components/atoms/typography/typography.js +2 -2
- package/dist/src/components/card/action/action.js +6 -6
- package/dist/src/components/card/audio/audio.js +5 -5
- package/dist/src/components/card/feature/feature.js +7 -7
- package/dist/src/components/card/meeting/meeting.js +6 -6
- package/dist/src/components/card/person/person.js +5 -5
- package/dist/src/components/card/price/price.js +4 -4
- package/dist/src/components/card/regular/regular.js +2 -2
- package/dist/src/components/card/styles.js +2 -2
- package/dist/src/components/card/video/video.js +5 -5
- package/dist/src/components/card/written/written.js +5 -5
- package/dist/src/components/custom/courses_selection/courses_selection.js +5 -5
- package/dist/src/components/custom/users_selection/users_selection.js +6 -6
- package/dist/src/components/editor/editor.js +2 -2
- package/dist/src/components/editor/navbar/alignment_dropdown.js +3 -3
- package/dist/src/components/editor/navbar/button_modal.js +2 -2
- package/dist/src/components/editor/navbar/navbar.js +6 -6
- package/dist/src/components/editor/plugins/blocks/buttons.js +3 -3
- package/dist/src/components/editor/plugins/blocks/image.js +12 -11
- package/dist/src/components/editor/plugins/blocks/list.js +2 -2
- package/dist/src/components/editor/plugins/blocks/media-popover.js +9 -7
- package/dist/src/components/editor/plugins/blocks/qa.js +2 -2
- package/dist/src/components/editor/plugins/blocks/resizable.js +3 -3
- package/dist/src/components/editor/plugins/blocks/table-cell.js +7 -7
- package/dist/src/components/editor/plugins/blocks/table-row.js +2 -2
- package/dist/src/components/editor/plugins/blocks/table.js +16 -14
- package/dist/src/components/editor/plugins/leafs/leafs.js +2 -2
- package/dist/src/components/editor/plugins/leafs/link.js +2 -2
- package/dist/src/components/editor/plugins/plate.js +3 -3
- package/dist/src/components/editor/simple_editor/navbar.js +4 -4
- package/dist/src/components/editor/simple_editor/simple_editor.js +3 -3
- package/dist/src/components/editor/styles/menu_button.js +2 -2
- package/dist/src/components/feedback/animated_toast/animated_toast.js +3 -3
- package/dist/src/components/feedback/badge/badge.js +3 -3
- package/dist/src/components/feedback/banner/banner.js +2 -2
- package/dist/src/components/feedback/chip/chip.js +3 -3
- package/dist/src/components/feedback/loader/loader.js +4 -3
- package/dist/src/components/feedback/notification/notification.js +2 -2
- package/dist/src/components/feedback/progress/progress.js +5 -5
- package/dist/src/components/feedback/toast/toast.js +3 -3
- package/dist/src/components/iconography/avatar/avatar.js +6 -6
- package/dist/src/components/iconography/icon/icon.js +2 -2
- package/dist/src/components/input/calendar/calendar.js +13 -13
- package/dist/src/components/input/checkbox/checkbox.js +2 -2
- package/dist/src/components/input/date/date.js +13 -13
- package/dist/src/components/input/filter/filter.js +11 -10
- package/dist/src/components/input/filter/filter_option.js +3 -3
- package/dist/src/components/input/radio/radio.js +3 -3
- package/dist/src/components/input/search/search.js +4 -4
- package/dist/src/components/input/select/select.js +3 -3
- package/dist/src/components/input/text_area/text_area.js +6 -6
- package/dist/src/components/input/text_input/text_input.js +7 -7
- package/dist/src/components/input/time/time.js +3 -3
- package/dist/src/components/media/video-player/playlist-item.js +3 -3
- package/dist/src/components/media/video-player/video.js +6 -6
- package/dist/src/components/navigation/breadcrumb/breadcrumb.js +3 -3
- package/dist/src/components/navigation/inner/inner.js +8 -8
- package/dist/src/components/navigation/tabs/tabs.js +4 -4
- package/dist/src/components/surfaces/accordion/accordion.js +3 -3
- package/dist/src/components/surfaces/calendar_date/calendar_date.js +6 -6
- package/dist/src/components/surfaces/carousel/card/card.js +4 -4
- package/dist/src/components/surfaces/comment/comment.js +10 -10
- package/dist/src/components/surfaces/drawer/drawer.js +6 -6
- package/dist/src/components/surfaces/message/message.js +2 -2
- package/dist/src/components/surfaces/modal/modal.js +3 -3
- package/dist/src/components/surfaces/post/post.js +9 -9
- package/dist/src/components/table/table/table.js +7 -7
- package/dist/src/index.js +0 -1
- package/package.json +2 -1
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var reactUtils = require('@udecode/react-utils');
|
|
5
|
+
var clsx_m = require('../../../clsx/dist/clsx.m.js');
|
|
6
|
+
require('../../../lodash/merge.js');
|
|
7
|
+
var index = require('../../plate-core/dist/index.js');
|
|
8
|
+
require('../../../lodash/defaults.js');
|
|
9
|
+
var index$2 = require('../../slate/dist/index.js');
|
|
10
|
+
var index$1 = require('../../slate-react/dist/index.js');
|
|
11
|
+
require('slate-react');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
14
|
+
|
|
15
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
16
|
+
|
|
17
|
+
var __defProp = Object.defineProperty;
|
|
18
|
+
var __defProps = Object.defineProperties;
|
|
19
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
20
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
21
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
22
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
23
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
24
|
+
var __spreadValues = (a, b) => {
|
|
25
|
+
for (var prop in b || (b = {}))
|
|
26
|
+
if (__hasOwnProp.call(b, prop))
|
|
27
|
+
__defNormalProp(a, prop, b[prop]);
|
|
28
|
+
if (__getOwnPropSymbols)
|
|
29
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
30
|
+
if (__propIsEnum.call(b, prop))
|
|
31
|
+
__defNormalProp(a, prop, b[prop]);
|
|
32
|
+
}
|
|
33
|
+
return a;
|
|
34
|
+
};
|
|
35
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
36
|
+
var __objRest = (source, exclude) => {
|
|
37
|
+
var target = {};
|
|
38
|
+
for (var prop in source)
|
|
39
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
40
|
+
target[prop] = source[prop];
|
|
41
|
+
if (source != null && __getOwnPropSymbols)
|
|
42
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
43
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
44
|
+
target[prop] = source[prop];
|
|
45
|
+
}
|
|
46
|
+
return target;
|
|
47
|
+
};
|
|
48
|
+
var usePlateElement = (props) => {
|
|
49
|
+
const _a = props, {
|
|
50
|
+
editor,
|
|
51
|
+
attributes,
|
|
52
|
+
nodeProps,
|
|
53
|
+
element,
|
|
54
|
+
elementToAttributes
|
|
55
|
+
} = _a, rootProps = __objRest(_a, [
|
|
56
|
+
"editor",
|
|
57
|
+
"attributes",
|
|
58
|
+
"nodeProps",
|
|
59
|
+
"element",
|
|
60
|
+
"elementToAttributes"
|
|
61
|
+
]);
|
|
62
|
+
return {
|
|
63
|
+
ref: reactUtils.useComposedRef(props.ref, attributes.ref),
|
|
64
|
+
props: __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, attributes), rootProps), nodeProps), elementToAttributes == null ? void 0 : elementToAttributes(element)), {
|
|
65
|
+
className: clsx_m.clsx(props.className, nodeProps == null ? void 0 : nodeProps.className)
|
|
66
|
+
})
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
var PlateElement = React__default.default.forwardRef(
|
|
70
|
+
(props, ref) => {
|
|
71
|
+
const { ref: rootRef, props: rootProps } = usePlateElement(__spreadProps(__spreadValues({}, props), {
|
|
72
|
+
ref
|
|
73
|
+
}));
|
|
74
|
+
return /* @__PURE__ */ React__default.default.createElement(reactUtils.Box, __spreadProps(__spreadValues({}, rootProps), { ref: rootRef }));
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
PlateElement.displayName = "PlateElement";
|
|
78
|
+
var usePlateLeaf = (props) => {
|
|
79
|
+
const _a = props, {
|
|
80
|
+
editor,
|
|
81
|
+
attributes,
|
|
82
|
+
nodeProps,
|
|
83
|
+
text,
|
|
84
|
+
leaf,
|
|
85
|
+
leafToAttributes
|
|
86
|
+
} = _a, rootProps = __objRest(_a, [
|
|
87
|
+
"editor",
|
|
88
|
+
"attributes",
|
|
89
|
+
"nodeProps",
|
|
90
|
+
"text",
|
|
91
|
+
"leaf",
|
|
92
|
+
"leafToAttributes"
|
|
93
|
+
]);
|
|
94
|
+
return {
|
|
95
|
+
ref: reactUtils.useComposedRef(props.ref, attributes.ref),
|
|
96
|
+
props: __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, attributes), rootProps), nodeProps), leafToAttributes == null ? void 0 : leafToAttributes(leaf)), {
|
|
97
|
+
className: clsx_m.clsx(props.className, nodeProps == null ? void 0 : nodeProps.className)
|
|
98
|
+
})
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
var PlateLeaf = React__default.default.forwardRef(
|
|
102
|
+
(props, ref) => {
|
|
103
|
+
const { ref: rootRef, props: rootProps } = usePlateLeaf(__spreadProps(__spreadValues({}, props), { ref }));
|
|
104
|
+
return /* @__PURE__ */ React__default.default.createElement(reactUtils.Text, __spreadProps(__spreadValues({}, rootProps), { ref: rootRef }));
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
PlateLeaf.displayName = "PlateLeaf";
|
|
108
|
+
var useRemoveNodeButton = ({ element }) => {
|
|
109
|
+
const editor = index.useEditorRef();
|
|
110
|
+
return {
|
|
111
|
+
props: {
|
|
112
|
+
onMouseDown: (e) => {
|
|
113
|
+
e.preventDefault();
|
|
114
|
+
},
|
|
115
|
+
onClick: () => {
|
|
116
|
+
const path = index$1.findNodePath(editor, element);
|
|
117
|
+
index$2.removeNodes(editor, { at: path });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
exports.PlateElement = PlateElement;
|
|
124
|
+
exports.PlateLeaf = PlateLeaf;
|
|
125
|
+
exports.usePlateElement = usePlateElement;
|
|
126
|
+
exports.usePlateLeaf = usePlateLeaf;
|
|
127
|
+
exports.useRemoveNodeButton = useRemoveNodeButton;
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var slate = require('slate');
|
|
4
|
+
require('slate-history');
|
|
5
|
+
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __defProps = Object.defineProperties;
|
|
8
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
9
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
var createTEditor = () => slate.createEditor();
|
|
38
|
+
var isElement = (value) => slate.Element.isElement(value);
|
|
39
|
+
|
|
40
|
+
// src/interfaces/editor/isBlock.ts
|
|
41
|
+
var isBlock = (editor, value) => isElement(value) && slate.Editor.isBlock(editor, value);
|
|
42
|
+
|
|
43
|
+
// src/utils/match.ts
|
|
44
|
+
function castArray(value) {
|
|
45
|
+
return Array.isArray(value) ? value : [value];
|
|
46
|
+
}
|
|
47
|
+
var match = (obj, path, predicate) => {
|
|
48
|
+
if (!predicate)
|
|
49
|
+
return true;
|
|
50
|
+
if (typeof predicate === "object") {
|
|
51
|
+
return Object.entries(predicate).every(([key, value]) => {
|
|
52
|
+
const values = castArray(value);
|
|
53
|
+
return values.includes(obj[key]);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return predicate(obj, path);
|
|
57
|
+
};
|
|
58
|
+
var getQueryOptions = (editor, options = {}) => {
|
|
59
|
+
const { match: _match, block } = options;
|
|
60
|
+
return __spreadProps(__spreadValues({}, options), {
|
|
61
|
+
match: _match || block ? (n, path) => match(n, path, _match) && (!block || isBlock(editor, n)) : void 0
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// src/interfaces/editor/getAboveNode.ts
|
|
66
|
+
var getAboveNode = (editor, options) => slate.Editor.above(editor, getQueryOptions(editor, options));
|
|
67
|
+
var unhangRange = (editor, range, options = {}) => {
|
|
68
|
+
const { voids, unhang = true } = options;
|
|
69
|
+
if (slate.Range.isRange(range) && unhang) {
|
|
70
|
+
return slate.Editor.unhangRange(editor, range, { voids });
|
|
71
|
+
}
|
|
72
|
+
return range;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// src/interfaces/editor/getNodeEntries.ts
|
|
76
|
+
var getNodeEntries = (editor, options) => {
|
|
77
|
+
unhangRange(editor, options == null ? void 0 : options.at, options);
|
|
78
|
+
return slate.Editor.nodes(editor, getQueryOptions(editor, options));
|
|
79
|
+
};
|
|
80
|
+
var getParentNode = (editor, at, options) => {
|
|
81
|
+
try {
|
|
82
|
+
return slate.Editor.parent(editor, at, options);
|
|
83
|
+
} catch (error) {
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
var getPreviousNode = (editor, options) => slate.Editor.previous(editor, options);
|
|
87
|
+
var isElementEmpty = (editor, element) => slate.Editor.isEmpty(editor, element);
|
|
88
|
+
var withoutNormalizing = (editor, fn) => {
|
|
89
|
+
let normalized = false;
|
|
90
|
+
slate.Editor.withoutNormalizing(editor, () => {
|
|
91
|
+
normalized = !!fn();
|
|
92
|
+
});
|
|
93
|
+
return normalized;
|
|
94
|
+
};
|
|
95
|
+
var isText = (value) => slate.Text.isText(value);
|
|
96
|
+
var removeNodes = (editor, options) => slate.Transforms.removeNodes(editor, options);
|
|
97
|
+
var select = (editor, target) => {
|
|
98
|
+
slate.Transforms.select(editor, target);
|
|
99
|
+
};
|
|
100
|
+
var getEndPoint = (editor, at) => slate.Editor.end(editor, at);
|
|
101
|
+
var getPointBefore = (editor, at, options) => slate.Editor.before(editor, at, options);
|
|
102
|
+
var getStartPoint = (editor, at) => slate.Editor.start(editor, at);
|
|
103
|
+
var getEdgePoints = (editor, at) => slate.Editor.edges(editor, at);
|
|
104
|
+
var getEditorString = (editor, at, options) => {
|
|
105
|
+
if (!at)
|
|
106
|
+
return "";
|
|
107
|
+
try {
|
|
108
|
+
return slate.Editor.string(editor, at, options);
|
|
109
|
+
} catch (error) {
|
|
110
|
+
return "";
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
var getMarks = (editor) => slate.Editor.marks(editor);
|
|
114
|
+
var getNextNode = (editor, options) => slate.Editor.next(editor, options);
|
|
115
|
+
var getNodeEntry = (editor, at, options) => {
|
|
116
|
+
try {
|
|
117
|
+
return slate.Editor.node(editor, at, options);
|
|
118
|
+
} catch (error) {
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
var getPoint = (editor, at, options) => slate.Editor.point(editor, at, options);
|
|
122
|
+
var isEndPoint = (editor, point, at) => !!point && slate.Editor.isEnd(editor, point, at);
|
|
123
|
+
var isInline = (editor, value) => isElement(value) && slate.Editor.isInline(editor, value);
|
|
124
|
+
var isStartPoint = (editor, point, at) => !!point && slate.Editor.isStart(editor, point, at);
|
|
125
|
+
var normalizeEditor = (editor, options) => slate.Editor.normalize(editor, options);
|
|
126
|
+
var removeEditorMark = (editor, key) => slate.Editor.removeMark(editor, key);
|
|
127
|
+
|
|
128
|
+
// src/interfaces/node/getNode.ts
|
|
129
|
+
var getNode = (root, path) => {
|
|
130
|
+
try {
|
|
131
|
+
for (let i = 0; i < path.length; i++) {
|
|
132
|
+
const p = path[i];
|
|
133
|
+
if (isText(root) || !root.children[p]) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
root = root.children[p];
|
|
137
|
+
}
|
|
138
|
+
return root;
|
|
139
|
+
} catch (error) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
var getNodeChildren = (root, path, options) => slate.Node.children(root, path, options);
|
|
144
|
+
var getNodeLeaf = (root, path) => slate.Node.leaf(root, path);
|
|
145
|
+
var getNodeProps = (node) => slate.Node.extractProps(node);
|
|
146
|
+
var getNodeString = (node) => slate.Node.string(node);
|
|
147
|
+
var isAncestor = (value) => slate.Element.isAncestor(value);
|
|
148
|
+
var isCollapsed = (range) => !!range && slate.Range.isCollapsed(range);
|
|
149
|
+
var isExpanded = (range) => !!range && slate.Range.isExpanded(range);
|
|
150
|
+
var collapseSelection = (editor, options) => {
|
|
151
|
+
slate.Transforms.collapse(editor, options);
|
|
152
|
+
};
|
|
153
|
+
var deselect = (editor) => {
|
|
154
|
+
slate.Transforms.deselect(editor);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// src/utils/queryNode.ts
|
|
158
|
+
function castArray2(value) {
|
|
159
|
+
return Array.isArray(value) ? value : [value];
|
|
160
|
+
}
|
|
161
|
+
var queryNode = (entry, { filter, allow, exclude, level, maxLevel } = {}) => {
|
|
162
|
+
if (!entry)
|
|
163
|
+
return false;
|
|
164
|
+
const [node, path] = entry;
|
|
165
|
+
if (level) {
|
|
166
|
+
const levels = castArray2(level);
|
|
167
|
+
if (!levels.includes(path.length)) {
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (maxLevel && path.length > maxLevel) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
if (filter && !filter(entry)) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
if (allow) {
|
|
178
|
+
const allows = castArray2(allow);
|
|
179
|
+
if (allows.length > 0 && !allows.includes(node.type)) {
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (exclude) {
|
|
184
|
+
const excludes = castArray2(exclude);
|
|
185
|
+
if (excludes.length > 0 && excludes.includes(node.type)) {
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return true;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
// src/interfaces/transforms/insertNodes.ts
|
|
193
|
+
var insertNodes = (editor, nodes, _a = {}) => {
|
|
194
|
+
var _b = _a, { nextBlock, removeEmpty } = _b, options = __objRest(_b, ["nextBlock", "removeEmpty"]);
|
|
195
|
+
slate.withoutNormalizing(editor, () => {
|
|
196
|
+
if (removeEmpty) {
|
|
197
|
+
const blockEntry = getAboveNode(editor, { at: options.at });
|
|
198
|
+
if (blockEntry) {
|
|
199
|
+
const queryNodeOptions = removeEmpty === true ? {
|
|
200
|
+
allow: ["p"]
|
|
201
|
+
} : removeEmpty;
|
|
202
|
+
const { filter } = queryNodeOptions;
|
|
203
|
+
queryNodeOptions.filter = ([node, path]) => {
|
|
204
|
+
if (getNodeString(node))
|
|
205
|
+
return false;
|
|
206
|
+
const children = node.children;
|
|
207
|
+
if (children.some((n) => isInline(editor, n)))
|
|
208
|
+
return false;
|
|
209
|
+
return !filter || filter([node, path]);
|
|
210
|
+
};
|
|
211
|
+
if (queryNode(blockEntry, queryNodeOptions)) {
|
|
212
|
+
slate.removeNodes(editor, { at: blockEntry[1] });
|
|
213
|
+
nextBlock = false;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (nextBlock) {
|
|
218
|
+
const { at = editor.selection } = options;
|
|
219
|
+
if (at) {
|
|
220
|
+
const endPoint = getEndPoint(editor, at);
|
|
221
|
+
const blockEntry = getAboveNode(editor, {
|
|
222
|
+
at: endPoint,
|
|
223
|
+
block: true
|
|
224
|
+
});
|
|
225
|
+
if (blockEntry) {
|
|
226
|
+
options.at = slate.Path.next(blockEntry[1]);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
slate.Transforms.insertNodes(editor, nodes, options);
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
var setNodes = (editor, props, options) => slate.Transforms.setNodes(editor, props, options);
|
|
234
|
+
var splitNodes = (editor, options) => slate.Transforms.splitNodes(editor, options);
|
|
235
|
+
var unsetNodes = (editor, props, options) => {
|
|
236
|
+
return slate.Transforms.unsetNodes(editor, props, options);
|
|
237
|
+
};
|
|
238
|
+
var unwrapNodes = (editor, options) => {
|
|
239
|
+
slate.Transforms.unwrapNodes(editor, getQueryOptions(editor, options));
|
|
240
|
+
};
|
|
241
|
+
var wrapNodes = (editor, element, options) => {
|
|
242
|
+
unhangRange(editor, options == null ? void 0 : options.at, options);
|
|
243
|
+
slate.Transforms.wrapNodes(editor, element, options);
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
// src/queries/findNode.ts
|
|
247
|
+
var findNode = (editor, options = {}) => {
|
|
248
|
+
try {
|
|
249
|
+
const nodeEntries = getNodeEntries(editor, __spreadValues({
|
|
250
|
+
at: editor.selection || []
|
|
251
|
+
}, getQueryOptions(editor, options)));
|
|
252
|
+
for (const [node, path] of nodeEntries) {
|
|
253
|
+
return [node, path];
|
|
254
|
+
}
|
|
255
|
+
} catch (error) {
|
|
256
|
+
return void 0;
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
// src/queries/someNode.ts
|
|
261
|
+
var someNode = (editor, options) => {
|
|
262
|
+
return !!findNode(editor, options);
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
// src/transforms/setElements.ts
|
|
266
|
+
var setElements = (editor, props, options) => setNodes(editor, props, options);
|
|
267
|
+
|
|
268
|
+
exports.collapseSelection = collapseSelection;
|
|
269
|
+
exports.createTEditor = createTEditor;
|
|
270
|
+
exports.deselect = deselect;
|
|
271
|
+
exports.findNode = findNode;
|
|
272
|
+
exports.getAboveNode = getAboveNode;
|
|
273
|
+
exports.getEdgePoints = getEdgePoints;
|
|
274
|
+
exports.getEditorString = getEditorString;
|
|
275
|
+
exports.getEndPoint = getEndPoint;
|
|
276
|
+
exports.getMarks = getMarks;
|
|
277
|
+
exports.getNextNode = getNextNode;
|
|
278
|
+
exports.getNode = getNode;
|
|
279
|
+
exports.getNodeChildren = getNodeChildren;
|
|
280
|
+
exports.getNodeEntries = getNodeEntries;
|
|
281
|
+
exports.getNodeEntry = getNodeEntry;
|
|
282
|
+
exports.getNodeLeaf = getNodeLeaf;
|
|
283
|
+
exports.getNodeProps = getNodeProps;
|
|
284
|
+
exports.getNodeString = getNodeString;
|
|
285
|
+
exports.getParentNode = getParentNode;
|
|
286
|
+
exports.getPoint = getPoint;
|
|
287
|
+
exports.getPointBefore = getPointBefore;
|
|
288
|
+
exports.getPreviousNode = getPreviousNode;
|
|
289
|
+
exports.getQueryOptions = getQueryOptions;
|
|
290
|
+
exports.getStartPoint = getStartPoint;
|
|
291
|
+
exports.insertNodes = insertNodes;
|
|
292
|
+
exports.isAncestor = isAncestor;
|
|
293
|
+
exports.isBlock = isBlock;
|
|
294
|
+
exports.isCollapsed = isCollapsed;
|
|
295
|
+
exports.isElement = isElement;
|
|
296
|
+
exports.isElementEmpty = isElementEmpty;
|
|
297
|
+
exports.isEndPoint = isEndPoint;
|
|
298
|
+
exports.isExpanded = isExpanded;
|
|
299
|
+
exports.isInline = isInline;
|
|
300
|
+
exports.isStartPoint = isStartPoint;
|
|
301
|
+
exports.isText = isText;
|
|
302
|
+
exports.match = match;
|
|
303
|
+
exports.normalizeEditor = normalizeEditor;
|
|
304
|
+
exports.queryNode = queryNode;
|
|
305
|
+
exports.removeEditorMark = removeEditorMark;
|
|
306
|
+
exports.removeNodes = removeNodes;
|
|
307
|
+
exports.select = select;
|
|
308
|
+
exports.setElements = setElements;
|
|
309
|
+
exports.setNodes = setNodes;
|
|
310
|
+
exports.someNode = someNode;
|
|
311
|
+
exports.splitNodes = splitNodes;
|
|
312
|
+
exports.unhangRange = unhangRange;
|
|
313
|
+
exports.unsetNodes = unsetNodes;
|
|
314
|
+
exports.unwrapNodes = unwrapNodes;
|
|
315
|
+
exports.withoutNormalizing = withoutNormalizing;
|
|
316
|
+
exports.wrapNodes = wrapNodes;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var slateReact = require('slate-react');
|
|
4
|
+
var index = require('../../slate/dist/index.js');
|
|
5
|
+
|
|
6
|
+
// src/react-editor/blurEditor.ts
|
|
7
|
+
var findNodePath = (editor, node) => {
|
|
8
|
+
try {
|
|
9
|
+
return slateReact.ReactEditor.findPath(editor, node);
|
|
10
|
+
} catch (error) {
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
var focusEditor = (editor, target) => {
|
|
14
|
+
if (target) {
|
|
15
|
+
index.withoutNormalizing(editor, () => {
|
|
16
|
+
index.deselect(editor);
|
|
17
|
+
index.select(editor, target);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
slateReact.ReactEditor.focus(editor);
|
|
21
|
+
};
|
|
22
|
+
var isComposing = (editor) => slateReact.ReactEditor.isComposing(editor);
|
|
23
|
+
var isEditorFocused = (editor) => slateReact.ReactEditor.isFocused(editor);
|
|
24
|
+
var focusEditorEdge = (editor, {
|
|
25
|
+
edge = "start"
|
|
26
|
+
} = {}) => {
|
|
27
|
+
const target = edge === "start" ? index.getStartPoint(editor, []) : index.getEndPoint(editor, []);
|
|
28
|
+
focusEditor(editor, target);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
exports.findNodePath = findNodePath;
|
|
32
|
+
exports.focusEditor = focusEditor;
|
|
33
|
+
exports.focusEditorEdge = focusEditorEdge;
|
|
34
|
+
exports.isComposing = isComposing;
|
|
35
|
+
exports.isEditorFocused = isEditorFocused;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('../../slate/dist/index.js');
|
|
4
|
+
var slate = require('slate');
|
|
5
|
+
var castArray = require('../../../lodash/castArray.js');
|
|
6
|
+
var map = require('../../../lodash/map.js');
|
|
7
|
+
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __defProps = Object.defineProperties;
|
|
10
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
11
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
12
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15
|
+
var __spreadValues = (a, b) => {
|
|
16
|
+
for (var prop in b || (b = {}))
|
|
17
|
+
if (__hasOwnProp.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
if (__getOwnPropSymbols)
|
|
20
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
21
|
+
if (__propIsEnum.call(b, prop))
|
|
22
|
+
__defNormalProp(a, prop, b[prop]);
|
|
23
|
+
}
|
|
24
|
+
return a;
|
|
25
|
+
};
|
|
26
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
27
|
+
var __objRest = (source, exclude) => {
|
|
28
|
+
var target = {};
|
|
29
|
+
for (var prop in source)
|
|
30
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
31
|
+
target[prop] = source[prop];
|
|
32
|
+
if (source != null && __getOwnPropSymbols)
|
|
33
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
34
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
35
|
+
target[prop] = source[prop];
|
|
36
|
+
}
|
|
37
|
+
return target;
|
|
38
|
+
};
|
|
39
|
+
var getBlockAbove = (editor, options = {}) => index.getAboveNode(editor, __spreadProps(__spreadValues({}, options), {
|
|
40
|
+
block: true
|
|
41
|
+
}));
|
|
42
|
+
var getEdgeBlocksAbove = (editor, _a = {}) => {
|
|
43
|
+
var _b = _a, { at: _at } = _b, options = __objRest(_b, ["at"]);
|
|
44
|
+
const at = _at != null ? _at : editor.selection;
|
|
45
|
+
if (!at)
|
|
46
|
+
return null;
|
|
47
|
+
const [start, end] = index.getEdgePoints(editor, at != null ? at : editor.selection);
|
|
48
|
+
const startBlock = getBlockAbove(editor, __spreadValues({
|
|
49
|
+
at: start
|
|
50
|
+
}, options));
|
|
51
|
+
if (!startBlock)
|
|
52
|
+
return null;
|
|
53
|
+
const endBlock = getBlockAbove(editor, __spreadValues({
|
|
54
|
+
at: end
|
|
55
|
+
}, options));
|
|
56
|
+
if (!endBlock)
|
|
57
|
+
return null;
|
|
58
|
+
return [startBlock, endBlock];
|
|
59
|
+
};
|
|
60
|
+
var getNextNodeStartPoint = (editor, at) => {
|
|
61
|
+
const nextEntry = index.getNextNode(editor, {
|
|
62
|
+
at
|
|
63
|
+
});
|
|
64
|
+
if (!nextEntry)
|
|
65
|
+
return;
|
|
66
|
+
return index.getStartPoint(editor, nextEntry[1]);
|
|
67
|
+
};
|
|
68
|
+
var isRangeAcrossBlocks = (editor, _a = {}) => {
|
|
69
|
+
var _b = _a, {
|
|
70
|
+
at
|
|
71
|
+
} = _b, options = __objRest(_b, [
|
|
72
|
+
"at"
|
|
73
|
+
]);
|
|
74
|
+
if (!at)
|
|
75
|
+
at = editor.selection;
|
|
76
|
+
if (!at)
|
|
77
|
+
return;
|
|
78
|
+
const [start, end] = slate.Range.edges(at);
|
|
79
|
+
const startBlock = getBlockAbove(editor, __spreadValues({
|
|
80
|
+
at: start
|
|
81
|
+
}, options));
|
|
82
|
+
const endBlock = getBlockAbove(editor, __spreadValues({
|
|
83
|
+
at: end
|
|
84
|
+
}, options));
|
|
85
|
+
if (!startBlock && !endBlock)
|
|
86
|
+
return;
|
|
87
|
+
if (!startBlock || !endBlock)
|
|
88
|
+
return true;
|
|
89
|
+
return !slate.Path.equals(startBlock[1], endBlock[1]);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// src/queries/getPointBeforeLocation.ts
|
|
93
|
+
var getPointBeforeLocation = (editor, at, options) => {
|
|
94
|
+
if (!options || !options.match && !options.matchString) {
|
|
95
|
+
return index.getPointBefore(editor, at, options);
|
|
96
|
+
}
|
|
97
|
+
const unitOffset = !options.unit || options.unit === "offset";
|
|
98
|
+
const matchStrings = options.matchString ? castArray.default(options.matchString) : [""];
|
|
99
|
+
let point;
|
|
100
|
+
matchStrings.some((matchString) => {
|
|
101
|
+
var _a, _b;
|
|
102
|
+
let beforeAt = at;
|
|
103
|
+
let previousBeforePoint = index.getPoint(editor, at, { edge: "end" });
|
|
104
|
+
const stackLength = matchString.length + 1;
|
|
105
|
+
const stack = Array.from({ length: stackLength });
|
|
106
|
+
let count = 0;
|
|
107
|
+
while (true) {
|
|
108
|
+
const beforePoint = index.getPointBefore(editor, beforeAt, options);
|
|
109
|
+
if (!beforePoint)
|
|
110
|
+
return;
|
|
111
|
+
if (isRangeAcrossBlocks(editor, {
|
|
112
|
+
at: {
|
|
113
|
+
anchor: beforePoint,
|
|
114
|
+
focus: previousBeforePoint
|
|
115
|
+
}
|
|
116
|
+
})) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const beforeString = index.getEditorString(editor, {
|
|
120
|
+
anchor: beforePoint,
|
|
121
|
+
focus: previousBeforePoint
|
|
122
|
+
});
|
|
123
|
+
let beforeStringToMatch = beforeString;
|
|
124
|
+
if (unitOffset && stackLength) {
|
|
125
|
+
stack.unshift({
|
|
126
|
+
point: beforePoint,
|
|
127
|
+
text: beforeString
|
|
128
|
+
});
|
|
129
|
+
stack.pop();
|
|
130
|
+
beforeStringToMatch = map.default(stack.slice(0, -1), "text").join("");
|
|
131
|
+
}
|
|
132
|
+
if (matchString === beforeStringToMatch || ((_a = options.match) == null ? void 0 : _a.call(options, { beforeString: beforeStringToMatch, beforePoint, at }))) {
|
|
133
|
+
if (options.afterMatch) {
|
|
134
|
+
if (stackLength && unitOffset) {
|
|
135
|
+
point = (_b = stack.at(-1)) == null ? void 0 : _b.point;
|
|
136
|
+
return !!point;
|
|
137
|
+
}
|
|
138
|
+
point = previousBeforePoint;
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
point = beforePoint;
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
previousBeforePoint = beforePoint;
|
|
145
|
+
beforeAt = beforePoint;
|
|
146
|
+
count += 1;
|
|
147
|
+
if (!options.skipInvalid && (!matchString || count >= matchString.length))
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
return point;
|
|
152
|
+
};
|
|
153
|
+
var getPointFromLocation = (editor, {
|
|
154
|
+
at = editor.selection,
|
|
155
|
+
focus
|
|
156
|
+
} = {}) => {
|
|
157
|
+
let point;
|
|
158
|
+
if (slate.Range.isRange(at))
|
|
159
|
+
point = focus ? at.focus : at.anchor;
|
|
160
|
+
if (slate.Point.isPoint(at))
|
|
161
|
+
point = at;
|
|
162
|
+
if (slate.Path.isPath(at))
|
|
163
|
+
point = { path: at, offset: 0 };
|
|
164
|
+
return point;
|
|
165
|
+
};
|
|
166
|
+
var getPreviousNodeEndPoint = (editor, at) => {
|
|
167
|
+
const prevEntry = index.getPreviousNode(editor, {
|
|
168
|
+
at
|
|
169
|
+
});
|
|
170
|
+
if (!prevEntry)
|
|
171
|
+
return;
|
|
172
|
+
return index.getEndPoint(editor, prevEntry[1]);
|
|
173
|
+
};
|
|
174
|
+
var getRangeBefore = (editor, at, options) => {
|
|
175
|
+
const anchor = getPointBeforeLocation(editor, at, options);
|
|
176
|
+
if (!anchor)
|
|
177
|
+
return;
|
|
178
|
+
const focus = index.getPoint(editor, at, { edge: "end" });
|
|
179
|
+
return {
|
|
180
|
+
anchor,
|
|
181
|
+
focus
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
var getRangeFromBlockStart = (editor, options = {}) => {
|
|
185
|
+
var _a;
|
|
186
|
+
const path = (_a = getBlockAbove(editor, options)) == null ? void 0 : _a[1];
|
|
187
|
+
if (!path)
|
|
188
|
+
return;
|
|
189
|
+
const start = index.getStartPoint(editor, path);
|
|
190
|
+
const focus = getPointFromLocation(editor, options);
|
|
191
|
+
if (!focus)
|
|
192
|
+
return;
|
|
193
|
+
return { anchor: start, focus };
|
|
194
|
+
};
|
|
195
|
+
var isSelectionExpanded = (editor) => index.isExpanded(editor.selection);
|
|
196
|
+
var insertElements = (editor, nodes, options) => {
|
|
197
|
+
index.insertNodes(editor, nodes, options);
|
|
198
|
+
};
|
|
199
|
+
var removeNodeChildren = (editor, path, options) => {
|
|
200
|
+
index.withoutNormalizing(editor, () => {
|
|
201
|
+
for (const [, childPath] of index.getNodeChildren(editor, path, {
|
|
202
|
+
reverse: true
|
|
203
|
+
})) {
|
|
204
|
+
index.removeNodes(editor, __spreadProps(__spreadValues({}, options), { at: childPath }));
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
// src/transforms/replaceNodeChildren.ts
|
|
210
|
+
var replaceNodeChildren = (editor, { at, nodes, insertOptions, removeOptions }) => {
|
|
211
|
+
index.withoutNormalizing(editor, () => {
|
|
212
|
+
removeNodeChildren(editor, at, removeOptions);
|
|
213
|
+
index.insertNodes(editor, nodes, __spreadProps(__spreadValues({}, insertOptions), {
|
|
214
|
+
at: at.concat([0])
|
|
215
|
+
}));
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
exports.getBlockAbove = getBlockAbove;
|
|
220
|
+
exports.getEdgeBlocksAbove = getEdgeBlocksAbove;
|
|
221
|
+
exports.getNextNodeStartPoint = getNextNodeStartPoint;
|
|
222
|
+
exports.getPointBeforeLocation = getPointBeforeLocation;
|
|
223
|
+
exports.getPointFromLocation = getPointFromLocation;
|
|
224
|
+
exports.getPreviousNodeEndPoint = getPreviousNodeEndPoint;
|
|
225
|
+
exports.getRangeBefore = getRangeBefore;
|
|
226
|
+
exports.getRangeFromBlockStart = getRangeFromBlockStart;
|
|
227
|
+
exports.insertElements = insertElements;
|
|
228
|
+
exports.isRangeAcrossBlocks = isRangeAcrossBlocks;
|
|
229
|
+
exports.isSelectionExpanded = isSelectionExpanded;
|
|
230
|
+
exports.replaceNodeChildren = replaceNodeChildren;
|