@wordpress/block-editor 9.1.0 → 9.2.0
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/CHANGELOG.md +2 -0
- package/build/components/block-draggable/draggable-chip.native.js +2 -1
- package/build/components/block-draggable/draggable-chip.native.js.map +1 -1
- package/build/components/block-draggable/index.native.js +7 -3
- package/build/components/block-draggable/index.native.js.map +1 -1
- package/build/components/block-list/block.native.js +2 -1
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.js +34 -32
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-mobile-toolbar/index.native.js +2 -1
- package/build/components/block-mobile-toolbar/index.native.js.map +1 -1
- package/build/components/block-popover/inbetween.js +9 -6
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-popover/index.js +2 -1
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +1 -0
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +16 -2
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js +70 -94
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +35 -60
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/convert-to-group-buttons/toolbar.js +22 -5
- package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build/components/index.js +9 -0
- package/build/components/index.js.map +1 -1
- package/build/components/media-placeholder/index.js +0 -2
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-replace-flow/index.js +0 -2
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/media-upload/index.native.js +10 -4
- package/build/components/media-upload/index.native.js.map +1 -1
- package/build/components/plain-text/index.native.js +62 -7
- package/build/components/plain-text/index.native.js.map +1 -1
- package/build/components/publish-date-time-picker/index.js +55 -0
- package/build/components/publish-date-time-picker/index.js.map +1 -0
- package/build/components/rich-text/index.js +1 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +5 -1
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/writing-flow/use-input.js +15 -0
- package/build/components/writing-flow/use-input.js.map +1 -1
- package/build/elements/index.js +9 -0
- package/build/elements/index.js.map +1 -0
- package/build/hooks/color.js +8 -88
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/dimensions.js +14 -4
- package/build/hooks/dimensions.js.map +1 -1
- package/build/index.js +14 -0
- package/build/index.js.map +1 -1
- package/build/layouts/flex.js +5 -2
- package/build/layouts/flex.js.map +1 -1
- package/build/store/actions.js +14 -0
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +17 -2
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +29 -1
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.native.js +2 -1
- package/build-module/components/block-draggable/draggable-chip.native.js.map +1 -1
- package/build-module/components/block-draggable/index.native.js +7 -3
- package/build-module/components/block-draggable/index.native.js.map +1 -1
- package/build-module/components/block-list/block.native.js +2 -1
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +35 -33
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/index.native.js +2 -1
- package/build-module/components/block-mobile-toolbar/index.native.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +9 -6
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-popover/index.js +2 -1
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +1 -0
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +13 -2
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js +72 -96
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +36 -64
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/toolbar.js +23 -6
- package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build-module/components/index.js +1 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +0 -2
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +0 -2
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/media-upload/index.native.js +8 -3
- package/build-module/components/media-upload/index.native.js.map +1 -1
- package/build-module/components/plain-text/index.native.js +63 -8
- package/build-module/components/plain-text/index.native.js.map +1 -1
- package/build-module/components/publish-date-time-picker/index.js +42 -0
- package/build-module/components/publish-date-time-picker/index.js.map +1 -0
- package/build-module/components/rich-text/index.js +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +5 -1
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/writing-flow/use-input.js +15 -0
- package/build-module/components/writing-flow/use-input.js.map +1 -1
- package/build-module/elements/index.js +2 -0
- package/build-module/elements/index.js.map +1 -0
- package/build-module/hooks/color.js +8 -88
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/dimensions.js +14 -4
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/layouts/flex.js +4 -2
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/store/actions.js +12 -0
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +17 -2
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +23 -0
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +37 -34
- package/build-style/style.css +37 -34
- package/package.json +30 -30
- package/src/components/block-draggable/draggable-chip.native.js +1 -1
- package/src/components/block-draggable/index.native.js +4 -0
- package/src/components/block-draggable/test/__snapshots__/index.native.js.snap +73 -0
- package/src/components/block-draggable/test/helpers.native.js +183 -0
- package/src/components/block-draggable/test/index.native.js +496 -0
- package/src/components/block-list/block.native.js +1 -0
- package/src/components/block-list/index.js +44 -44
- package/src/components/block-mobile-toolbar/index.native.js +1 -0
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +4 -0
- package/src/components/block-popover/inbetween.js +12 -7
- package/src/components/block-popover/index.js +1 -0
- package/src/components/block-tools/block-selection-button.js +1 -0
- package/src/components/block-variation-transforms/index.js +6 -2
- package/src/components/colors-gradients/dropdown.js +35 -61
- package/src/components/colors-gradients/panel-color-gradient-settings.js +30 -76
- package/src/components/colors-gradients/style.scss +11 -37
- package/src/components/convert-to-group-buttons/toolbar.js +30 -13
- package/src/components/index.js +1 -0
- package/src/components/media-placeholder/index.js +0 -2
- package/src/components/media-replace-flow/index.js +0 -2
- package/src/components/media-upload/index.native.js +6 -2
- package/src/components/media-upload/test/index.native.js +31 -6
- package/src/components/plain-text/index.native.js +64 -8
- package/src/components/publish-date-time-picker/README.md +52 -0
- package/src/components/publish-date-time-picker/index.js +50 -0
- package/src/components/publish-date-time-picker/style.scss +20 -0
- package/src/components/rich-text/index.js +2 -0
- package/src/components/rich-text/index.native.js +4 -0
- package/src/components/writing-flow/use-input.js +12 -0
- package/src/elements/index.js +1 -0
- package/src/hooks/color.js +5 -74
- package/src/hooks/color.scss +9 -0
- package/src/hooks/dimensions.js +11 -3
- package/src/index.js +1 -0
- package/src/layouts/flex.js +11 -3
- package/src/store/actions.js +12 -0
- package/src/store/reducer.js +14 -1
- package/src/store/selectors.js +28 -0
- package/src/store/test/reducer.js +5 -0
- package/src/style.scss +1 -0
- package/build/components/colors/color-panel.js +0 -82
- package/build/components/colors/color-panel.js.map +0 -1
- package/build/components/colors/color-panel.native.js +0 -11
- package/build/components/colors/color-panel.native.js.map +0 -1
- package/build-module/components/colors/color-panel.js +0 -70
- package/build-module/components/colors/color-panel.js.map +0 -1
- package/build-module/components/colors/color-panel.native.js +0 -4
- package/build-module/components/colors/color-panel.native.js.map +0 -1
- package/src/components/colors/color-panel.js +0 -91
- package/src/components/colors/color-panel.native.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/components/rich-text/index.native.js"],"names":["wrapperClasses","classes","RichTextWrapper","forwardedRef","children","tagName","start","reversed","value","originalValue","onChange","originalOnChange","isSelected","originalIsSelected","multiline","inlineToolbar","wrapperClassName","autocompleters","onReplace","placeholder","allowedFormats","formattingControls","withoutInteractiveFormatting","onRemove","onMerge","onSplit","__unstableOnSplitAtEnd","onSplitAtEnd","__unstableOnSplitMiddle","onSplitMiddle","identifier","preserveWhiteSpace","__unstablePastePlainText","pastePlainText","__unstableEmbedURLOnPaste","__unstableDisableFormats","disableFormats","disableLineBreaks","unstableOnFocus","__unstableAllowPrefixTransformations","__unstableMultilineRootTag","__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","onBlur","setRef","props","instanceId","fallbackRef","clientId","blockIsSelected","nativeProps","embedHandlerPickerRef","selector","select","getSelectionStart","getSelectionEnd","getSettings","didAutomaticChange","getBlock","isMultiSelecting","hasMultiSelection","blockEditorStore","selectionStart","selectionEnd","__experimentalUndo","undo","undefined","attributeKey","extraProps","Platform","OS","block","shouldBlurOnUnmount","offset","disabled","__unstableMarkLastChangeAsPersistent","enterFormattedText","exitFormattedText","selectionChange","__unstableMarkAutomaticChange","multilineTag","adjustedAllowedFormats","hasFormats","length","adjustedValue","adjustedOnChange","Array","isArray","childrenSource","toHTML","newValue","fromDOM","document","childNodes","onSelectionChange","selectionChangeStart","selectionChangeEnd","onDelete","isReverse","splitValue","record","pastedBlocks","blocks","before","after","hasPastedBlocks","lastPastedBlockIndex","isAfterOriginal","push","indexToSelect","initialPosition","onEnter","shiftKey","canSplit","transforms","filter","type","transformation","item","regExp","test","text","transform","content","splitStart","end","splitEnd","canSplitAtEnd","onPaste","html","plainText","isInternal","files","activeFormats","pastedValue","multilineWrapperTags","HTML","mode","window","console","log","isPastedURL","trim","presentEmbedHandlerPicker","current","presentPicker","createEmbed","createLink","valueToInsert","LINE_SEPARATOR","canPasteEmbed","name","inputRule","valueToFormat","startPosition","characterBefore","slice","trimmedTextBefore","prefixTransforms","prefix","mergedRef","id","style","nestedIsSelected","onFocus","editableProps","editableTagName","TagName","listBoxId","activeId","onKeyDown","className","event","since","alternative","version","ForwardedRichTextContainer","Content","Tag","MultilineTag","isEmpty","defaultProps","format"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AASA;;;;AANA;;AACA;;AAYA;;AACA;;AAOA;;AACA;;AAcA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAOA;;AA8rBA;;AACA;;AACA;;AA3vBA;AACA;AACA;;AAIA;AACA;AACA;;AAkCA;AACA;AACA;AAiBA,MAAMA,cAAc,GAAG,wBAAvB;AACA,MAAMC,OAAO,GAAG,kCAAhB;;AAEA,SAASC,eAAT,OAmDCC,YAnDD,EAoDE;AAAA,MAnDD;AACCC,IAAAA,QADD;AAECC,IAAAA,OAFD;AAGCC,IAAAA,KAHD;AAICC,IAAAA,QAJD;AAKCC,IAAAA,KAAK,EAAEC,aALR;AAMCC,IAAAA,QAAQ,EAAEC,gBANX;AAOCC,IAAAA,UAAU,EAAEC,kBAPb;AAQCC,IAAAA,SARD;AASCC,IAAAA,aATD;AAUCC,IAAAA,gBAVD;AAWCC,IAAAA,cAXD;AAYCC,IAAAA,SAZD;AAaCC,IAAAA,WAbD;AAcCC,IAAAA,cAdD;AAeCC,IAAAA,kBAfD;AAgBCC,IAAAA,4BAhBD;AAiBCC,IAAAA,QAjBD;AAkBCC,IAAAA,OAlBD;AAmBCC,IAAAA,OAnBD;AAoBCC,IAAAA,sBAAsB,EAAEC,YApBzB;AAqBCC,I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,EAA8B;AAC7BA,IAAAA,KAAK,GAAG4F,iBAAeC,MAAf,CAAuB7F,KAAvB,CAAR;AACA;;AAED,QAAMuL,YAAY,GAAG,4BAAiBjL,SAAjB,CAArB;;AAEA,MAAK,CAAEN,KAAF,IAAWuL,YAAhB,EAA+B;AAC9BvL,IAAAA,KAAK,GAAI,IAAIuL,YAAc,MAAMA,YAAc,GAA/C;AACA;;AAED,QAAMxD,OAAO,GAAG,4BAAC,gBAAD,QAAW/H,KAAX,CAAhB;;AAEA,MAAKsL,GAAL,EAAW;AACV,WAAO,4BAAC,GAAD,EAAU,kBAAMrI,KAAN,EAAa,CAAE,QAAF,CAAb,CAAV,EAA0C8E,OAA1C,CAAP;AACA;;AAED,SAAOA,OAAP;AACA,CAxBD;;AA0BAqD,0BAA0B,CAACI,OAA3B,GAAuCxL,KAAF,IAAa;AACjD,SAAO,CAAEA,KAAF,IAAWA,KAAK,CAACuF,MAAN,KAAiB,CAAnC;AACA,CAFD;;AAIA6F,0BAA0B,CAACC,OAA3B,CAAmCI,YAAnC,GAAkD;AACjDC,EAAAA,MAAM,EAAE,QADyC;AAEjD1L,EAAAA,KAAK,EAAE;AAF0C,CAAlD;AAKA;AACA;AACA;;eACeoL,0B","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tRawHTML,\n\tPlatform,\n\tuseRef,\n\tuseCallback,\n\tforwardRef,\n} from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tpasteHandler,\n\tchildren as childrenSource,\n\tgetBlockTransforms,\n\tfindTransform,\n\tisUnmodifiedDefaultBlock,\n} from '@wordpress/blocks';\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\nimport {\n\t__experimentalRichText as RichText,\n\t__unstableCreateElement,\n\tisEmpty,\n\t__unstableIsEmptyLine as isEmptyLine,\n\tinsert,\n\t__unstableInsertLineSeparator as insertLineSeparator,\n\tcreate,\n\treplace,\n\tsplit,\n\t__UNSTABLE_LINE_SEPARATOR as LINE_SEPARATOR,\n\ttoHTMLString,\n\tslice,\n} from '@wordpress/rich-text';\nimport deprecated from '@wordpress/deprecated';\nimport { isURL } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport Autocomplete from '../autocomplete';\nimport { useBlockEditContext } from '../block-edit';\nimport { RemoveBrowserShortcuts } from './remove-browser-shortcuts';\nimport { filePasteHandler } from './file-paste-handler';\nimport FormatToolbarContainer from './format-toolbar-container';\nimport { useNativeProps } from './use-native-props';\nimport { store as blockEditorStore } from '../../store';\nimport {\n\taddActiveFormats,\n\tgetMultilineTag,\n\tgetAllowedFormats,\n\tisShortcode,\n\tcreateLinkInParagraph,\n} from './utils';\nimport EmbedHandlerPicker from './embed-handler-picker';\n\nconst wrapperClasses = 'block-editor-rich-text';\nconst classes = 'block-editor-rich-text__editable';\n\nfunction RichTextWrapper(\n\t{\n\t\tchildren,\n\t\ttagName,\n\t\tstart,\n\t\treversed,\n\t\tvalue: originalValue,\n\t\tonChange: originalOnChange,\n\t\tisSelected: originalIsSelected,\n\t\tmultiline,\n\t\tinlineToolbar,\n\t\twrapperClassName,\n\t\tautocompleters,\n\t\tonReplace,\n\t\tplaceholder,\n\t\tallowedFormats,\n\t\tformattingControls,\n\t\twithoutInteractiveFormatting,\n\t\tonRemove,\n\t\tonMerge,\n\t\tonSplit,\n\t\t__unstableOnSplitAtEnd: onSplitAtEnd,\n\t\t__unstableOnSplitMiddle: onSplitMiddle,\n\t\tidentifier,\n\t\tpreserveWhiteSpace,\n\t\t__unstablePastePlainText: pastePlainText,\n\t\t__unstableEmbedURLOnPaste,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tdisableLineBreaks,\n\t\tunstableOnFocus,\n\t\t__unstableAllowPrefixTransformations,\n\t\t__unstableMultilineRootTag,\n\t\t// Native props.\n\t\t__unstableMobileNoFocusOnMount,\n\t\tdeleteEnter,\n\t\tplaceholderTextColor,\n\t\ttextAlign,\n\t\tselectionColor,\n\t\ttagsToEliminate,\n\t\trootTagsToEliminate,\n\t\tdisableEditingMenu,\n\t\tfontSize,\n\t\tfontFamily,\n\t\tfontWeight,\n\t\tfontStyle,\n\t\tminWidth,\n\t\tmaxWidth,\n\t\tonBlur,\n\t\tsetRef,\n\t\t...props\n\t},\n\tforwardedRef\n) {\n\tconst instanceId = useInstanceId( RichTextWrapper );\n\n\tidentifier = identifier || instanceId;\n\n\tconst fallbackRef = useRef();\n\tconst { clientId, isSelected: blockIsSelected } = useBlockEditContext();\n\tconst nativeProps = useNativeProps();\n\tconst embedHandlerPickerRef = useRef();\n\tconst selector = ( select ) => {\n\t\tconst {\n\t\t\tgetSelectionStart,\n\t\t\tgetSelectionEnd,\n\t\t\tgetSettings,\n\t\t\tdidAutomaticChange,\n\t\t\tgetBlock,\n\t\t\tisMultiSelecting,\n\t\t\thasMultiSelection,\n\t\t} = select( blockEditorStore );\n\n\t\tconst selectionStart = getSelectionStart();\n\t\tconst selectionEnd = getSelectionEnd();\n\t\tconst { __experimentalUndo: undo } = getSettings();\n\n\t\tlet isSelected;\n\n\t\tif ( originalIsSelected === undefined ) {\n\t\t\tisSelected =\n\t\t\t\tselectionStart.clientId === clientId &&\n\t\t\t\tselectionStart.attributeKey === identifier;\n\t\t} else if ( originalIsSelected ) {\n\t\t\tisSelected = selectionStart.clientId === clientId;\n\t\t}\n\n\t\tlet extraProps = {};\n\t\tif ( Platform.OS === 'native' ) {\n\t\t\t// If the block of this RichText is unmodified then it's a candidate for replacing when adding a new block.\n\t\t\t// In order to fix https://github.com/wordpress-mobile/gutenberg-mobile/issues/1126, let's blur on unmount in that case.\n\t\t\t// This apparently assumes functionality the BlockHlder actually.\n\t\t\tconst block = clientId && getBlock( clientId );\n\t\t\tconst shouldBlurOnUnmount =\n\t\t\t\tblock && isSelected && isUnmodifiedDefaultBlock( block );\n\t\t\textraProps = {\n\t\t\t\tshouldBlurOnUnmount,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tselectionStart: isSelected ? selectionStart.offset : undefined,\n\t\t\tselectionEnd: isSelected ? selectionEnd.offset : undefined,\n\t\t\tisSelected,\n\t\t\tdidAutomaticChange: didAutomaticChange(),\n\t\t\tdisabled: isMultiSelecting() || hasMultiSelection(),\n\t\t\tundo,\n\t\t\t...extraProps,\n\t\t};\n\t};\n\t// This selector must run on every render so the right selection state is\n\t// retrieved from the store on merge.\n\t// To do: fix this somehow.\n\tconst {\n\t\tselectionStart,\n\t\tselectionEnd,\n\t\tisSelected,\n\t\tdidAutomaticChange,\n\t\tdisabled,\n\t\tundo,\n\t\tshouldBlurOnUnmount,\n\t} = useSelect( selector );\n\tconst {\n\t\t__unstableMarkLastChangeAsPersistent,\n\t\tenterFormattedText,\n\t\texitFormattedText,\n\t\tselectionChange,\n\t\t__unstableMarkAutomaticChange,\n\t} = useDispatch( blockEditorStore );\n\tconst multilineTag = getMultilineTag( multiline );\n\tconst adjustedAllowedFormats = getAllowedFormats( {\n\t\tallowedFormats,\n\t\tformattingControls,\n\t\tdisableFormats,\n\t} );\n\tconst hasFormats =\n\t\t! adjustedAllowedFormats || adjustedAllowedFormats.length > 0;\n\tlet adjustedValue = originalValue;\n\tlet adjustedOnChange = originalOnChange;\n\n\t// Handle deprecated format.\n\tif ( Array.isArray( originalValue ) ) {\n\t\tadjustedValue = childrenSource.toHTML( originalValue );\n\t\tadjustedOnChange = ( newValue ) =>\n\t\t\toriginalOnChange(\n\t\t\t\tchildrenSource.fromDOM(\n\t\t\t\t\t__unstableCreateElement( document, newValue ).childNodes\n\t\t\t\t)\n\t\t\t);\n\t}\n\n\tconst onSelectionChange = useCallback(\n\t\t( selectionChangeStart, selectionChangeEnd ) => {\n\t\t\tselectionChange(\n\t\t\t\tclientId,\n\t\t\t\tidentifier,\n\t\t\t\tselectionChangeStart,\n\t\t\t\tselectionChangeEnd\n\t\t\t);\n\t\t},\n\t\t[ clientId, identifier ]\n\t);\n\n\tconst onDelete = useCallback(\n\t\t( { value, isReverse } ) => {\n\t\t\tif ( onMerge ) {\n\t\t\t\tonMerge( ! isReverse );\n\t\t\t}\n\n\t\t\t// Only handle remove on Backspace. This serves dual-purpose of being\n\t\t\t// an intentional user interaction distinguishing between Backspace and\n\t\t\t// Delete to remove the empty field, but also to avoid merge & remove\n\t\t\t// causing destruction of two fields (merge, then removed merged).\n\t\t\tif ( onRemove && isEmpty( value ) && isReverse ) {\n\t\t\t\tonRemove( ! isReverse );\n\t\t\t}\n\t\t},\n\t\t[ onMerge, onRemove ]\n\t);\n\n\t/**\n\t * Signals to the RichText owner that the block can be replaced with two\n\t * blocks as a result of splitting the block by pressing enter, or with\n\t * blocks as a result of splitting the block by pasting block content in the\n\t * instance.\n\t *\n\t * @param {Object} record The rich text value to split.\n\t * @param {Array} pastedBlocks The pasted blocks to insert, if any.\n\t */\n\tconst splitValue = useCallback(\n\t\t( record, pastedBlocks = [] ) => {\n\t\t\tif ( ! onReplace || ! onSplit ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst blocks = [];\n\t\t\tconst [ before, after ] = split( record );\n\t\t\tconst hasPastedBlocks = pastedBlocks.length > 0;\n\t\t\tlet lastPastedBlockIndex = -1;\n\n\t\t\t// Consider the after value to be the original it is not empty and\n\t\t\t// the before value *is* empty.\n\t\t\tconst isAfterOriginal = isEmpty( before ) && ! isEmpty( after );\n\n\t\t\t// Create a block with the content before the caret if there's no pasted\n\t\t\t// blocks, or if there are pasted blocks and the value is not empty.\n\t\t\t// We do not want a leading empty block on paste, but we do if split\n\t\t\t// with e.g. the enter key.\n\t\t\tif ( ! hasPastedBlocks || ! isEmpty( before ) ) {\n\t\t\t\tblocks.push(\n\t\t\t\t\tonSplit(\n\t\t\t\t\t\ttoHTMLString( {\n\t\t\t\t\t\t\tvalue: before,\n\t\t\t\t\t\t\tmultilineTag,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t\t! isAfterOriginal\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tlastPastedBlockIndex += 1;\n\t\t\t}\n\n\t\t\tif ( hasPastedBlocks ) {\n\t\t\t\tblocks.push( ...pastedBlocks );\n\t\t\t\tlastPastedBlockIndex += pastedBlocks.length;\n\t\t\t} else if ( onSplitMiddle ) {\n\t\t\t\tblocks.push( onSplitMiddle() );\n\t\t\t}\n\n\t\t\t// If there's pasted blocks, append a block with non empty content\n\t\t\t// after the caret. Otherwise, do append an empty block if there\n\t\t\t// is no `onSplitMiddle` prop, but if there is and the content is\n\t\t\t// empty, the middle block is enough to set focus in.\n\t\t\tif (\n\t\t\t\thasPastedBlocks\n\t\t\t\t\t? ! isEmpty( after )\n\t\t\t\t\t: ! onSplitMiddle || ! isEmpty( after )\n\t\t\t) {\n\t\t\t\tblocks.push(\n\t\t\t\t\tonSplit(\n\t\t\t\t\t\ttoHTMLString( {\n\t\t\t\t\t\t\tvalue: after,\n\t\t\t\t\t\t\tmultilineTag,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t\tisAfterOriginal\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// If there are pasted blocks, set the selection to the last one.\n\t\t\t// Otherwise, set the selection to the second block.\n\t\t\tconst indexToSelect = hasPastedBlocks ? lastPastedBlockIndex : 1;\n\n\t\t\t// If there are pasted blocks, move the caret to the end of the selected block\n\t\t\t// Otherwise, retain the default value.\n\t\t\tconst initialPosition = hasPastedBlocks ? -1 : 0;\n\n\t\t\tonReplace( blocks, indexToSelect, initialPosition );\n\t\t},\n\t\t[ onReplace, onSplit, multilineTag, onSplitMiddle ]\n\t);\n\n\tconst onEnter = useCallback(\n\t\t( { value, onChange, shiftKey } ) => {\n\t\t\tconst canSplit = onReplace && onSplit;\n\n\t\t\tif ( onReplace ) {\n\t\t\t\tconst transforms = getBlockTransforms( 'from' ).filter(\n\t\t\t\t\t( { type } ) => type === 'enter'\n\t\t\t\t);\n\t\t\t\tconst transformation = findTransform( transforms, ( item ) => {\n\t\t\t\t\treturn item.regExp.test( value.text );\n\t\t\t\t} );\n\n\t\t\t\tif ( transformation ) {\n\t\t\t\t\tonReplace( [\n\t\t\t\t\t\ttransformation.transform( { content: value.text } ),\n\t\t\t\t\t] );\n\t\t\t\t\t__unstableMarkAutomaticChange();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( multiline ) {\n\t\t\t\tif ( shiftKey ) {\n\t\t\t\t\tif ( ! disableLineBreaks ) {\n\t\t\t\t\t\tonChange( insert( value, '\\n' ) );\n\t\t\t\t\t}\n\t\t\t\t} else if ( canSplit && isEmptyLine( value ) ) {\n\t\t\t\t\tsplitValue( value );\n\t\t\t\t} else {\n\t\t\t\t\tonChange( insertLineSeparator( value ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst { text, start: splitStart, end: splitEnd } = value;\n\t\t\t\tconst canSplitAtEnd =\n\t\t\t\t\tonSplitAtEnd &&\n\t\t\t\t\tsplitStart === splitEnd &&\n\t\t\t\t\tsplitEnd === text.length;\n\n\t\t\t\tif ( shiftKey || ( ! canSplit && ! canSplitAtEnd ) ) {\n\t\t\t\t\tif ( ! disableLineBreaks ) {\n\t\t\t\t\t\tonChange( insert( value, '\\n' ) );\n\t\t\t\t\t}\n\t\t\t\t} else if ( ! canSplit && canSplitAtEnd ) {\n\t\t\t\t\tonSplitAtEnd();\n\t\t\t\t} else if ( canSplit ) {\n\t\t\t\t\tsplitValue( value );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tonReplace,\n\t\t\tonSplit,\n\t\t\t__unstableMarkAutomaticChange,\n\t\t\tmultiline,\n\t\t\tsplitValue,\n\t\t\tonSplitAtEnd,\n\t\t]\n\t);\n\n\tconst onPaste = useCallback(\n\t\t( {\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\thtml,\n\t\t\tplainText,\n\t\t\tisInternal,\n\t\t\tfiles,\n\t\t\tactiveFormats,\n\t\t} ) => {\n\t\t\t// If the data comes from a rich text instance, we can directly use it\n\t\t\t// without filtering the data. The filters are only meant for externally\n\t\t\t// pasted content and remove inline styles.\n\t\t\tif ( isInternal ) {\n\t\t\t\tconst pastedValue = create( {\n\t\t\t\t\thtml,\n\t\t\t\t\tmultilineTag,\n\t\t\t\t\tmultilineWrapperTags:\n\t\t\t\t\t\tmultilineTag === 'li' ? [ 'ul', 'ol' ] : undefined,\n\t\t\t\t\tpreserveWhiteSpace,\n\t\t\t\t} );\n\t\t\t\taddActiveFormats( pastedValue, activeFormats );\n\t\t\t\tonChange( insert( value, pastedValue ) );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( pastePlainText ) {\n\t\t\t\tonChange( insert( value, create( { text: plainText } ) ) );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Only process file if no HTML is present.\n\t\t\t// Note: a pasted file may have the URL as plain text.\n\t\t\tif ( files && files.length && ! html ) {\n\t\t\t\tconst content = pasteHandler( {\n\t\t\t\t\tHTML: filePasteHandler( files ),\n\t\t\t\t\tmode: 'BLOCKS',\n\t\t\t\t\ttagName,\n\t\t\t\t\tpreserveWhiteSpace,\n\t\t\t\t} );\n\n\t\t\t\t// Allows us to ask for this information when we get a report.\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\twindow.console.log( 'Received items:\\n\\n', files );\n\n\t\t\t\tif ( onReplace && isEmpty( value ) ) {\n\t\t\t\t\tonReplace( content );\n\t\t\t\t} else {\n\t\t\t\t\tsplitValue( value, content );\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet mode = onReplace && onSplit ? 'AUTO' : 'INLINE';\n\n\t\t\t// Force the blocks mode when the user is pasting\n\t\t\t// on a new line & the content resembles a shortcode.\n\t\t\t// Otherwise it's going to be detected as inline\n\t\t\t// and the shortcode won't be replaced.\n\t\t\tif (\n\t\t\t\tmode === 'AUTO' &&\n\t\t\t\tisEmpty( value ) &&\n\t\t\t\tisShortcode( plainText )\n\t\t\t) {\n\t\t\t\tmode = 'BLOCKS';\n\t\t\t}\n\n\t\t\tconst isPastedURL = isURL( plainText.trim() );\n\t\t\tconst presentEmbedHandlerPicker = () =>\n\t\t\t\tembedHandlerPickerRef.current?.presentPicker( {\n\t\t\t\t\tcreateEmbed: () =>\n\t\t\t\t\t\tonReplace( content, content.length - 1, -1 ),\n\t\t\t\t\tcreateLink: () =>\n\t\t\t\t\t\tcreateLinkInParagraph( plainText.trim(), onReplace ),\n\t\t\t\t} );\n\n\t\t\tif (\n\t\t\t\t__unstableEmbedURLOnPaste &&\n\t\t\t\tisEmpty( value ) &&\n\t\t\t\tisPastedURL\n\t\t\t) {\n\t\t\t\tmode = 'BLOCKS';\n\t\t\t}\n\n\t\t\tconst content = pasteHandler( {\n\t\t\t\tHTML: html,\n\t\t\t\tplainText,\n\t\t\t\tmode,\n\t\t\t\ttagName,\n\t\t\t\tpreserveWhiteSpace,\n\t\t\t} );\n\n\t\t\tif ( typeof content === 'string' ) {\n\t\t\t\tlet valueToInsert = create( { html: content } );\n\n\t\t\t\taddActiveFormats( valueToInsert, activeFormats );\n\n\t\t\t\t// If the content should be multiline, we should process text\n\t\t\t\t// separated by a line break as separate lines.\n\t\t\t\tif ( multilineTag ) {\n\t\t\t\t\tvalueToInsert = replace(\n\t\t\t\t\t\tvalueToInsert,\n\t\t\t\t\t\t/\\n+/g,\n\t\t\t\t\t\tLINE_SEPARATOR\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tonChange( insert( value, valueToInsert ) );\n\t\t\t} else if ( content.length > 0 ) {\n\t\t\t\t// When an URL is pasted in an empty paragraph then the EmbedHandlerPicker should showcase options allowing the transformation of that URL\n\t\t\t\t// into either an Embed block or a link within the target paragraph. If the paragraph is non-empty, the URL is pasted as text.\n\t\t\t\tconst canPasteEmbed =\n\t\t\t\t\tisPastedURL &&\n\t\t\t\t\tcontent.length === 1 &&\n\t\t\t\t\tcontent[ 0 ].name === 'core/embed';\n\t\t\t\tif ( onReplace && isEmpty( value ) ) {\n\t\t\t\t\tif ( canPasteEmbed ) {\n\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\tinsert( value, create( { text: plainText } ) )\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( __unstableEmbedURLOnPaste ) {\n\t\t\t\t\t\t\tpresentEmbedHandlerPicker();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tonReplace( content, content.length - 1, -1 );\n\t\t\t\t} else {\n\t\t\t\t\tif ( canPasteEmbed ) {\n\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\tinsert( value, create( { text: plainText } ) )\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsplitValue( value, content );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\ttagName,\n\t\t\tonReplace,\n\t\t\tonSplit,\n\t\t\tsplitValue,\n\t\t\t__unstableEmbedURLOnPaste,\n\t\t\tmultilineTag,\n\t\t\tpreserveWhiteSpace,\n\t\t\tpastePlainText,\n\t\t]\n\t);\n\n\tconst inputRule = useCallback(\n\t\t( value, valueToFormat ) => {\n\t\t\tif ( ! onReplace ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { start: startPosition, text } = value;\n\t\t\tconst characterBefore = text.slice(\n\t\t\t\tstartPosition - 1,\n\t\t\t\tstartPosition\n\t\t\t);\n\n\t\t\t// The character right before the caret must be a plain space.\n\t\t\tif ( characterBefore !== ' ' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst trimmedTextBefore = text.slice( 0, startPosition ).trim();\n\t\t\tconst prefixTransforms = getBlockTransforms( 'from' ).filter(\n\t\t\t\t( { type } ) => type === 'prefix'\n\t\t\t);\n\t\t\tconst transformation = findTransform(\n\t\t\t\tprefixTransforms,\n\t\t\t\t( { prefix } ) => {\n\t\t\t\t\treturn trimmedTextBefore === prefix;\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( ! transformation ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst content = valueToFormat(\n\t\t\t\tslice( value, startPosition, text.length )\n\t\t\t);\n\t\t\tconst block = transformation.transform( content );\n\n\t\t\tonReplace( [ block ] );\n\t\t\t__unstableMarkAutomaticChange();\n\t\t},\n\t\t[ onReplace, __unstableMarkAutomaticChange ]\n\t);\n\n\tconst mergedRef = useMergeRefs( [ forwardedRef, fallbackRef ] );\n\n\tconst content = (\n\t\t<RichText\n\t\t\tclientId={ clientId }\n\t\t\tidentifier={ identifier }\n\t\t\tref={ mergedRef }\n\t\t\tvalue={ adjustedValue }\n\t\t\tonChange={ adjustedOnChange }\n\t\t\tselectionStart={ selectionStart }\n\t\t\tselectionEnd={ selectionEnd }\n\t\t\tonSelectionChange={ onSelectionChange }\n\t\t\ttagName={ tagName }\n\t\t\tstart={ start }\n\t\t\treversed={ reversed }\n\t\t\tplaceholder={ placeholder }\n\t\t\tallowedFormats={ adjustedAllowedFormats }\n\t\t\twithoutInteractiveFormatting={ withoutInteractiveFormatting }\n\t\t\tonEnter={ onEnter }\n\t\t\tonDelete={ onDelete }\n\t\t\tonPaste={ onPaste }\n\t\t\t__unstableIsSelected={ isSelected }\n\t\t\t__unstableInputRule={ inputRule }\n\t\t\t__unstableMultilineTag={ multilineTag }\n\t\t\t__unstableOnEnterFormattedText={ enterFormattedText }\n\t\t\t__unstableOnExitFormattedText={ exitFormattedText }\n\t\t\t__unstableOnCreateUndoLevel={ __unstableMarkLastChangeAsPersistent }\n\t\t\t__unstableMarkAutomaticChange={ __unstableMarkAutomaticChange }\n\t\t\t__unstableDidAutomaticChange={ didAutomaticChange }\n\t\t\t__unstableUndo={ undo }\n\t\t\t__unstableDisableFormats={ disableFormats }\n\t\t\tpreserveWhiteSpace={ preserveWhiteSpace }\n\t\t\tdisabled={ disabled }\n\t\t\tunstableOnFocus={ unstableOnFocus }\n\t\t\t__unstableAllowPrefixTransformations={\n\t\t\t\t__unstableAllowPrefixTransformations\n\t\t\t}\n\t\t\t__unstableMultilineRootTag={ __unstableMultilineRootTag }\n\t\t\t// Native props.\n\t\t\t{ ...nativeProps }\n\t\t\tblockIsSelected={\n\t\t\t\toriginalIsSelected !== undefined\n\t\t\t\t\t? originalIsSelected\n\t\t\t\t\t: blockIsSelected\n\t\t\t}\n\t\t\tshouldBlurOnUnmount={ shouldBlurOnUnmount }\n\t\t\t__unstableMobileNoFocusOnMount={ __unstableMobileNoFocusOnMount }\n\t\t\tdeleteEnter={ deleteEnter }\n\t\t\tplaceholderTextColor={ placeholderTextColor }\n\t\t\ttextAlign={ textAlign }\n\t\t\tselectionColor={ selectionColor }\n\t\t\ttagsToEliminate={ tagsToEliminate }\n\t\t\trootTagsToEliminate={ rootTagsToEliminate }\n\t\t\tdisableEditingMenu={ disableEditingMenu }\n\t\t\tfontSize={ fontSize }\n\t\t\tfontFamily={ fontFamily }\n\t\t\tfontWeight={ fontWeight }\n\t\t\tfontStyle={ fontStyle }\n\t\t\tminWidth={ minWidth }\n\t\t\tmaxWidth={ maxWidth }\n\t\t\tonBlur={ onBlur }\n\t\t\tsetRef={ setRef }\n\t\t\t// Props to be set on the editable container are destructured on the\n\t\t\t// element itself for web (see below), but passed through rich text\n\t\t\t// for native.\n\t\t\tid={ props.id }\n\t\t\tstyle={ props.style }\n\t\t>\n\t\t\t{ ( {\n\t\t\t\tisSelected: nestedIsSelected,\n\t\t\t\tvalue,\n\t\t\t\tonChange,\n\t\t\t\tonFocus,\n\t\t\t\teditableProps,\n\t\t\t\teditableTagName: TagName,\n\t\t\t} ) => (\n\t\t\t\t<>\n\t\t\t\t\t{ children && children( { value, onChange, onFocus } ) }\n\t\t\t\t\t{ nestedIsSelected && hasFormats && (\n\t\t\t\t\t\t<FormatToolbarContainer\n\t\t\t\t\t\t\tinline={ inlineToolbar }\n\t\t\t\t\t\t\tanchorRef={ fallbackRef.current }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ nestedIsSelected && <RemoveBrowserShortcuts /> }\n\t\t\t\t\t<Autocomplete\n\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\tcompleters={ autocompleters }\n\t\t\t\t\t\trecord={ value }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tisSelected={ nestedIsSelected }\n\t\t\t\t\t\tcontentRef={ fallbackRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { listBoxId, activeId, onKeyDown } ) => (\n\t\t\t\t\t\t\t<TagName\n\t\t\t\t\t\t\t\t{ ...editableProps }\n\t\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\tprops.style\n\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\t...props.style,\n\t\t\t\t\t\t\t\t\t\t\t\t...editableProps.style,\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t: editableProps.style\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\tclasses,\n\t\t\t\t\t\t\t\t\tprops.className,\n\t\t\t\t\t\t\t\t\teditableProps.className\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\taria-autocomplete={\n\t\t\t\t\t\t\t\t\tlistBoxId ? 'list' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-owns={ listBoxId }\n\t\t\t\t\t\t\t\taria-activedescendant={ activeId }\n\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\tonKeyDown( event );\n\t\t\t\t\t\t\t\t\teditableProps.onKeyDown( event );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Autocomplete>\n\t\t\t\t\t<EmbedHandlerPicker ref={ embedHandlerPickerRef } />\n\t\t\t\t</>\n\t\t\t) }\n\t\t</RichText>\n\t);\n\n\tif ( ! wrapperClassName ) {\n\t\treturn content;\n\t}\n\n\tdeprecated( 'wp.blockEditor.RichText wrapperClassName prop', {\n\t\tsince: '5.4',\n\t\talternative: 'className prop or create your own wrapper div',\n\t\tversion: '6.2',\n\t} );\n\n\treturn (\n\t\t<div className={ classnames( wrapperClasses, wrapperClassName ) }>\n\t\t\t{ content }\n\t\t</div>\n\t);\n}\n\nconst ForwardedRichTextContainer = forwardRef( RichTextWrapper );\n\nForwardedRichTextContainer.Content = ( {\n\tvalue,\n\ttagName: Tag,\n\tmultiline,\n\t...props\n} ) => {\n\t// Handle deprecated `children` and `node` sources.\n\tif ( Array.isArray( value ) ) {\n\t\tvalue = childrenSource.toHTML( value );\n\t}\n\n\tconst MultilineTag = getMultilineTag( multiline );\n\n\tif ( ! value && MultilineTag ) {\n\t\tvalue = `<${ MultilineTag }></${ MultilineTag }>`;\n\t}\n\n\tconst content = <RawHTML>{ value }</RawHTML>;\n\n\tif ( Tag ) {\n\t\treturn <Tag { ...omit( props, [ 'format' ] ) }>{ content }</Tag>;\n\t}\n\n\treturn content;\n};\n\nForwardedRichTextContainer.isEmpty = ( value ) => {\n\treturn ! value || value.length === 0;\n};\n\nForwardedRichTextContainer.Content.defaultProps = {\n\tformat: 'string',\n\tvalue: '',\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md\n */\nexport default ForwardedRichTextContainer;\nexport { RichTextShortcut } from './shortcut';\nexport { RichTextToolbarButton } from './toolbar-button';\nexport { __unstableRichTextInputEvent } from './input-event';\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/components/rich-text/index.native.js"],"names":["wrapperClasses","classes","RichTextWrapper","forwardedRef","children","tagName","start","reversed","value","originalValue","onChange","originalOnChange","isSelected","originalIsSelected","multiline","inlineToolbar","wrapperClassName","autocompleters","onReplace","placeholder","allowedFormats","formattingControls","withoutInteractiveFormatting","onRemove","onMerge","onSplit","__unstableOnSplitAtEnd","onSplitAtEnd","__unstableOnSplitMiddle","onSplitMiddle","identifier","preserveWhiteSpace","__unstablePastePlainText","pastePlainText","__unstableEmbedURLOnPaste","__unstableDisableFormats","disableFormats","disableLineBreaks","unstableOnFocus","__unstableAllowPrefixTransformations","__unstableMultilineRootTag","__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","onBlur","setRef","disableSuggestions","disableAutocorrection","props","instanceId","fallbackRef","clientId","blockIsSelected","nativeProps","embedHandlerPickerRef","selector","select","getSelectionStart","getSelectionEnd","getSettings","didAutomaticChange","getBlock","isMultiSelecting","hasMultiSelection","blockEditorStore","selectionStart","selectionEnd","__experimentalUndo","undo","undefined","attributeKey","extraProps","Platform","OS","block","shouldBlurOnUnmount","offset","disabled","__unstableMarkLastChangeAsPersistent","enterFormattedText","exitFormattedText","selectionChange","__unstableMarkAutomaticChange","multilineTag","adjustedAllowedFormats","hasFormats","length","adjustedValue","adjustedOnChange","Array","isArray","childrenSource","toHTML","newValue","fromDOM","document","childNodes","onSelectionChange","selectionChangeStart","selectionChangeEnd","onDelete","isReverse","splitValue","record","pastedBlocks","blocks","before","after","hasPastedBlocks","lastPastedBlockIndex","isAfterOriginal","push","indexToSelect","initialPosition","onEnter","shiftKey","canSplit","transforms","filter","type","transformation","item","regExp","test","text","transform","content","splitStart","end","splitEnd","canSplitAtEnd","onPaste","html","plainText","isInternal","files","activeFormats","pastedValue","multilineWrapperTags","HTML","mode","window","console","log","isPastedURL","trim","presentEmbedHandlerPicker","current","presentPicker","createEmbed","createLink","valueToInsert","LINE_SEPARATOR","canPasteEmbed","name","inputRule","valueToFormat","startPosition","characterBefore","slice","trimmedTextBefore","prefixTransforms","prefix","mergedRef","id","style","nestedIsSelected","onFocus","editableProps","editableTagName","TagName","listBoxId","activeId","onKeyDown","className","event","since","alternative","version","ForwardedRichTextContainer","Content","Tag","Mult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,QAAMxD,OAAO,GAAG,4BAAC,gBAAD,QAAWjI,KAAX,CAAhB;;AAEA,MAAKwL,GAAL,EAAW;AACV,WAAO,4BAAC,GAAD,EAAU,kBAAMrI,KAAN,EAAa,CAAE,QAAF,CAAb,CAAV,EAA0C8E,OAA1C,CAAP;AACA;;AAED,SAAOA,OAAP;AACA,CAxBD;;AA0BAqD,0BAA0B,CAACI,OAA3B,GAAuC1L,KAAF,IAAa;AACjD,SAAO,CAAEA,KAAF,IAAWA,KAAK,CAACyF,MAAN,KAAiB,CAAnC;AACA,CAFD;;AAIA6F,0BAA0B,CAACC,OAA3B,CAAmCI,YAAnC,GAAkD;AACjDC,EAAAA,MAAM,EAAE,QADyC;AAEjD5L,EAAAA,KAAK,EAAE;AAF0C,CAAlD;AAKA;AACA;AACA;;eACesL,0B","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tRawHTML,\n\tPlatform,\n\tuseRef,\n\tuseCallback,\n\tforwardRef,\n} from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tpasteHandler,\n\tchildren as childrenSource,\n\tgetBlockTransforms,\n\tfindTransform,\n\tisUnmodifiedDefaultBlock,\n} from '@wordpress/blocks';\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\nimport {\n\t__experimentalRichText as RichText,\n\t__unstableCreateElement,\n\tisEmpty,\n\t__unstableIsEmptyLine as isEmptyLine,\n\tinsert,\n\t__unstableInsertLineSeparator as insertLineSeparator,\n\tcreate,\n\treplace,\n\tsplit,\n\t__UNSTABLE_LINE_SEPARATOR as LINE_SEPARATOR,\n\ttoHTMLString,\n\tslice,\n} from '@wordpress/rich-text';\nimport deprecated from '@wordpress/deprecated';\nimport { isURL } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport Autocomplete from '../autocomplete';\nimport { useBlockEditContext } from '../block-edit';\nimport { RemoveBrowserShortcuts } from './remove-browser-shortcuts';\nimport { filePasteHandler } from './file-paste-handler';\nimport FormatToolbarContainer from './format-toolbar-container';\nimport { useNativeProps } from './use-native-props';\nimport { store as blockEditorStore } from '../../store';\nimport {\n\taddActiveFormats,\n\tgetMultilineTag,\n\tgetAllowedFormats,\n\tisShortcode,\n\tcreateLinkInParagraph,\n} from './utils';\nimport EmbedHandlerPicker from './embed-handler-picker';\n\nconst wrapperClasses = 'block-editor-rich-text';\nconst classes = 'block-editor-rich-text__editable';\n\nfunction RichTextWrapper(\n\t{\n\t\tchildren,\n\t\ttagName,\n\t\tstart,\n\t\treversed,\n\t\tvalue: originalValue,\n\t\tonChange: originalOnChange,\n\t\tisSelected: originalIsSelected,\n\t\tmultiline,\n\t\tinlineToolbar,\n\t\twrapperClassName,\n\t\tautocompleters,\n\t\tonReplace,\n\t\tplaceholder,\n\t\tallowedFormats,\n\t\tformattingControls,\n\t\twithoutInteractiveFormatting,\n\t\tonRemove,\n\t\tonMerge,\n\t\tonSplit,\n\t\t__unstableOnSplitAtEnd: onSplitAtEnd,\n\t\t__unstableOnSplitMiddle: onSplitMiddle,\n\t\tidentifier,\n\t\tpreserveWhiteSpace,\n\t\t__unstablePastePlainText: pastePlainText,\n\t\t__unstableEmbedURLOnPaste,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tdisableLineBreaks,\n\t\tunstableOnFocus,\n\t\t__unstableAllowPrefixTransformations,\n\t\t__unstableMultilineRootTag,\n\t\t// Native props.\n\t\t__unstableMobileNoFocusOnMount,\n\t\tdeleteEnter,\n\t\tplaceholderTextColor,\n\t\ttextAlign,\n\t\tselectionColor,\n\t\ttagsToEliminate,\n\t\trootTagsToEliminate,\n\t\tdisableEditingMenu,\n\t\tfontSize,\n\t\tfontFamily,\n\t\tfontWeight,\n\t\tfontStyle,\n\t\tminWidth,\n\t\tmaxWidth,\n\t\tonBlur,\n\t\tsetRef,\n\t\tdisableSuggestions,\n\t\tdisableAutocorrection,\n\t\t...props\n\t},\n\tforwardedRef\n) {\n\tconst instanceId = useInstanceId( RichTextWrapper );\n\n\tidentifier = identifier || instanceId;\n\n\tconst fallbackRef = useRef();\n\tconst { clientId, isSelected: blockIsSelected } = useBlockEditContext();\n\tconst nativeProps = useNativeProps();\n\tconst embedHandlerPickerRef = useRef();\n\tconst selector = ( select ) => {\n\t\tconst {\n\t\t\tgetSelectionStart,\n\t\t\tgetSelectionEnd,\n\t\t\tgetSettings,\n\t\t\tdidAutomaticChange,\n\t\t\tgetBlock,\n\t\t\tisMultiSelecting,\n\t\t\thasMultiSelection,\n\t\t} = select( blockEditorStore );\n\n\t\tconst selectionStart = getSelectionStart();\n\t\tconst selectionEnd = getSelectionEnd();\n\t\tconst { __experimentalUndo: undo } = getSettings();\n\n\t\tlet isSelected;\n\n\t\tif ( originalIsSelected === undefined ) {\n\t\t\tisSelected =\n\t\t\t\tselectionStart.clientId === clientId &&\n\t\t\t\tselectionStart.attributeKey === identifier;\n\t\t} else if ( originalIsSelected ) {\n\t\t\tisSelected = selectionStart.clientId === clientId;\n\t\t}\n\n\t\tlet extraProps = {};\n\t\tif ( Platform.OS === 'native' ) {\n\t\t\t// If the block of this RichText is unmodified then it's a candidate for replacing when adding a new block.\n\t\t\t// In order to fix https://github.com/wordpress-mobile/gutenberg-mobile/issues/1126, let's blur on unmount in that case.\n\t\t\t// This apparently assumes functionality the BlockHlder actually.\n\t\t\tconst block = clientId && getBlock( clientId );\n\t\t\tconst shouldBlurOnUnmount =\n\t\t\t\tblock && isSelected && isUnmodifiedDefaultBlock( block );\n\t\t\textraProps = {\n\t\t\t\tshouldBlurOnUnmount,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tselectionStart: isSelected ? selectionStart.offset : undefined,\n\t\t\tselectionEnd: isSelected ? selectionEnd.offset : undefined,\n\t\t\tisSelected,\n\t\t\tdidAutomaticChange: didAutomaticChange(),\n\t\t\tdisabled: isMultiSelecting() || hasMultiSelection(),\n\t\t\tundo,\n\t\t\t...extraProps,\n\t\t};\n\t};\n\t// This selector must run on every render so the right selection state is\n\t// retrieved from the store on merge.\n\t// To do: fix this somehow.\n\tconst {\n\t\tselectionStart,\n\t\tselectionEnd,\n\t\tisSelected,\n\t\tdidAutomaticChange,\n\t\tdisabled,\n\t\tundo,\n\t\tshouldBlurOnUnmount,\n\t} = useSelect( selector );\n\tconst {\n\t\t__unstableMarkLastChangeAsPersistent,\n\t\tenterFormattedText,\n\t\texitFormattedText,\n\t\tselectionChange,\n\t\t__unstableMarkAutomaticChange,\n\t} = useDispatch( blockEditorStore );\n\tconst multilineTag = getMultilineTag( multiline );\n\tconst adjustedAllowedFormats = getAllowedFormats( {\n\t\tallowedFormats,\n\t\tformattingControls,\n\t\tdisableFormats,\n\t} );\n\tconst hasFormats =\n\t\t! adjustedAllowedFormats || adjustedAllowedFormats.length > 0;\n\tlet adjustedValue = originalValue;\n\tlet adjustedOnChange = originalOnChange;\n\n\t// Handle deprecated format.\n\tif ( Array.isArray( originalValue ) ) {\n\t\tadjustedValue = childrenSource.toHTML( originalValue );\n\t\tadjustedOnChange = ( newValue ) =>\n\t\t\toriginalOnChange(\n\t\t\t\tchildrenSource.fromDOM(\n\t\t\t\t\t__unstableCreateElement( document, newValue ).childNodes\n\t\t\t\t)\n\t\t\t);\n\t}\n\n\tconst onSelectionChange = useCallback(\n\t\t( selectionChangeStart, selectionChangeEnd ) => {\n\t\t\tselectionChange(\n\t\t\t\tclientId,\n\t\t\t\tidentifier,\n\t\t\t\tselectionChangeStart,\n\t\t\t\tselectionChangeEnd\n\t\t\t);\n\t\t},\n\t\t[ clientId, identifier ]\n\t);\n\n\tconst onDelete = useCallback(\n\t\t( { value, isReverse } ) => {\n\t\t\tif ( onMerge ) {\n\t\t\t\tonMerge( ! isReverse );\n\t\t\t}\n\n\t\t\t// Only handle remove on Backspace. This serves dual-purpose of being\n\t\t\t// an intentional user interaction distinguishing between Backspace and\n\t\t\t// Delete to remove the empty field, but also to avoid merge & remove\n\t\t\t// causing destruction of two fields (merge, then removed merged).\n\t\t\tif ( onRemove && isEmpty( value ) && isReverse ) {\n\t\t\t\tonRemove( ! isReverse );\n\t\t\t}\n\t\t},\n\t\t[ onMerge, onRemove ]\n\t);\n\n\t/**\n\t * Signals to the RichText owner that the block can be replaced with two\n\t * blocks as a result of splitting the block by pressing enter, or with\n\t * blocks as a result of splitting the block by pasting block content in the\n\t * instance.\n\t *\n\t * @param {Object} record The rich text value to split.\n\t * @param {Array} pastedBlocks The pasted blocks to insert, if any.\n\t */\n\tconst splitValue = useCallback(\n\t\t( record, pastedBlocks = [] ) => {\n\t\t\tif ( ! onReplace || ! onSplit ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst blocks = [];\n\t\t\tconst [ before, after ] = split( record );\n\t\t\tconst hasPastedBlocks = pastedBlocks.length > 0;\n\t\t\tlet lastPastedBlockIndex = -1;\n\n\t\t\t// Consider the after value to be the original it is not empty and\n\t\t\t// the before value *is* empty.\n\t\t\tconst isAfterOriginal = isEmpty( before ) && ! isEmpty( after );\n\n\t\t\t// Create a block with the content before the caret if there's no pasted\n\t\t\t// blocks, or if there are pasted blocks and the value is not empty.\n\t\t\t// We do not want a leading empty block on paste, but we do if split\n\t\t\t// with e.g. the enter key.\n\t\t\tif ( ! hasPastedBlocks || ! isEmpty( before ) ) {\n\t\t\t\tblocks.push(\n\t\t\t\t\tonSplit(\n\t\t\t\t\t\ttoHTMLString( {\n\t\t\t\t\t\t\tvalue: before,\n\t\t\t\t\t\t\tmultilineTag,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t\t! isAfterOriginal\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tlastPastedBlockIndex += 1;\n\t\t\t}\n\n\t\t\tif ( hasPastedBlocks ) {\n\t\t\t\tblocks.push( ...pastedBlocks );\n\t\t\t\tlastPastedBlockIndex += pastedBlocks.length;\n\t\t\t} else if ( onSplitMiddle ) {\n\t\t\t\tblocks.push( onSplitMiddle() );\n\t\t\t}\n\n\t\t\t// If there's pasted blocks, append a block with non empty content\n\t\t\t// after the caret. Otherwise, do append an empty block if there\n\t\t\t// is no `onSplitMiddle` prop, but if there is and the content is\n\t\t\t// empty, the middle block is enough to set focus in.\n\t\t\tif (\n\t\t\t\thasPastedBlocks\n\t\t\t\t\t? ! isEmpty( after )\n\t\t\t\t\t: ! onSplitMiddle || ! isEmpty( after )\n\t\t\t) {\n\t\t\t\tblocks.push(\n\t\t\t\t\tonSplit(\n\t\t\t\t\t\ttoHTMLString( {\n\t\t\t\t\t\t\tvalue: after,\n\t\t\t\t\t\t\tmultilineTag,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t\tisAfterOriginal\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// If there are pasted blocks, set the selection to the last one.\n\t\t\t// Otherwise, set the selection to the second block.\n\t\t\tconst indexToSelect = hasPastedBlocks ? lastPastedBlockIndex : 1;\n\n\t\t\t// If there are pasted blocks, move the caret to the end of the selected block\n\t\t\t// Otherwise, retain the default value.\n\t\t\tconst initialPosition = hasPastedBlocks ? -1 : 0;\n\n\t\t\tonReplace( blocks, indexToSelect, initialPosition );\n\t\t},\n\t\t[ onReplace, onSplit, multilineTag, onSplitMiddle ]\n\t);\n\n\tconst onEnter = useCallback(\n\t\t( { value, onChange, shiftKey } ) => {\n\t\t\tconst canSplit = onReplace && onSplit;\n\n\t\t\tif ( onReplace ) {\n\t\t\t\tconst transforms = getBlockTransforms( 'from' ).filter(\n\t\t\t\t\t( { type } ) => type === 'enter'\n\t\t\t\t);\n\t\t\t\tconst transformation = findTransform( transforms, ( item ) => {\n\t\t\t\t\treturn item.regExp.test( value.text );\n\t\t\t\t} );\n\n\t\t\t\tif ( transformation ) {\n\t\t\t\t\tonReplace( [\n\t\t\t\t\t\ttransformation.transform( { content: value.text } ),\n\t\t\t\t\t] );\n\t\t\t\t\t__unstableMarkAutomaticChange();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( multiline ) {\n\t\t\t\tif ( shiftKey ) {\n\t\t\t\t\tif ( ! disableLineBreaks ) {\n\t\t\t\t\t\tonChange( insert( value, '\\n' ) );\n\t\t\t\t\t}\n\t\t\t\t} else if ( canSplit && isEmptyLine( value ) ) {\n\t\t\t\t\tsplitValue( value );\n\t\t\t\t} else {\n\t\t\t\t\tonChange( insertLineSeparator( value ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst { text, start: splitStart, end: splitEnd } = value;\n\t\t\t\tconst canSplitAtEnd =\n\t\t\t\t\tonSplitAtEnd &&\n\t\t\t\t\tsplitStart === splitEnd &&\n\t\t\t\t\tsplitEnd === text.length;\n\n\t\t\t\tif ( shiftKey || ( ! canSplit && ! canSplitAtEnd ) ) {\n\t\t\t\t\tif ( ! disableLineBreaks ) {\n\t\t\t\t\t\tonChange( insert( value, '\\n' ) );\n\t\t\t\t\t}\n\t\t\t\t} else if ( ! canSplit && canSplitAtEnd ) {\n\t\t\t\t\tonSplitAtEnd();\n\t\t\t\t} else if ( canSplit ) {\n\t\t\t\t\tsplitValue( value );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tonReplace,\n\t\t\tonSplit,\n\t\t\t__unstableMarkAutomaticChange,\n\t\t\tmultiline,\n\t\t\tsplitValue,\n\t\t\tonSplitAtEnd,\n\t\t]\n\t);\n\n\tconst onPaste = useCallback(\n\t\t( {\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\thtml,\n\t\t\tplainText,\n\t\t\tisInternal,\n\t\t\tfiles,\n\t\t\tactiveFormats,\n\t\t} ) => {\n\t\t\t// If the data comes from a rich text instance, we can directly use it\n\t\t\t// without filtering the data. The filters are only meant for externally\n\t\t\t// pasted content and remove inline styles.\n\t\t\tif ( isInternal ) {\n\t\t\t\tconst pastedValue = create( {\n\t\t\t\t\thtml,\n\t\t\t\t\tmultilineTag,\n\t\t\t\t\tmultilineWrapperTags:\n\t\t\t\t\t\tmultilineTag === 'li' ? [ 'ul', 'ol' ] : undefined,\n\t\t\t\t\tpreserveWhiteSpace,\n\t\t\t\t} );\n\t\t\t\taddActiveFormats( pastedValue, activeFormats );\n\t\t\t\tonChange( insert( value, pastedValue ) );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( pastePlainText ) {\n\t\t\t\tonChange( insert( value, create( { text: plainText } ) ) );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Only process file if no HTML is present.\n\t\t\t// Note: a pasted file may have the URL as plain text.\n\t\t\tif ( files && files.length && ! html ) {\n\t\t\t\tconst content = pasteHandler( {\n\t\t\t\t\tHTML: filePasteHandler( files ),\n\t\t\t\t\tmode: 'BLOCKS',\n\t\t\t\t\ttagName,\n\t\t\t\t\tpreserveWhiteSpace,\n\t\t\t\t} );\n\n\t\t\t\t// Allows us to ask for this information when we get a report.\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\twindow.console.log( 'Received items:\\n\\n', files );\n\n\t\t\t\tif ( onReplace && isEmpty( value ) ) {\n\t\t\t\t\tonReplace( content );\n\t\t\t\t} else {\n\t\t\t\t\tsplitValue( value, content );\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet mode = onReplace && onSplit ? 'AUTO' : 'INLINE';\n\n\t\t\t// Force the blocks mode when the user is pasting\n\t\t\t// on a new line & the content resembles a shortcode.\n\t\t\t// Otherwise it's going to be detected as inline\n\t\t\t// and the shortcode won't be replaced.\n\t\t\tif (\n\t\t\t\tmode === 'AUTO' &&\n\t\t\t\tisEmpty( value ) &&\n\t\t\t\tisShortcode( plainText )\n\t\t\t) {\n\t\t\t\tmode = 'BLOCKS';\n\t\t\t}\n\n\t\t\tconst isPastedURL = isURL( plainText.trim() );\n\t\t\tconst presentEmbedHandlerPicker = () =>\n\t\t\t\tembedHandlerPickerRef.current?.presentPicker( {\n\t\t\t\t\tcreateEmbed: () =>\n\t\t\t\t\t\tonReplace( content, content.length - 1, -1 ),\n\t\t\t\t\tcreateLink: () =>\n\t\t\t\t\t\tcreateLinkInParagraph( plainText.trim(), onReplace ),\n\t\t\t\t} );\n\n\t\t\tif (\n\t\t\t\t__unstableEmbedURLOnPaste &&\n\t\t\t\tisEmpty( value ) &&\n\t\t\t\tisPastedURL\n\t\t\t) {\n\t\t\t\tmode = 'BLOCKS';\n\t\t\t}\n\n\t\t\tconst content = pasteHandler( {\n\t\t\t\tHTML: html,\n\t\t\t\tplainText,\n\t\t\t\tmode,\n\t\t\t\ttagName,\n\t\t\t\tpreserveWhiteSpace,\n\t\t\t} );\n\n\t\t\tif ( typeof content === 'string' ) {\n\t\t\t\tlet valueToInsert = create( { html: content } );\n\n\t\t\t\taddActiveFormats( valueToInsert, activeFormats );\n\n\t\t\t\t// If the content should be multiline, we should process text\n\t\t\t\t// separated by a line break as separate lines.\n\t\t\t\tif ( multilineTag ) {\n\t\t\t\t\tvalueToInsert = replace(\n\t\t\t\t\t\tvalueToInsert,\n\t\t\t\t\t\t/\\n+/g,\n\t\t\t\t\t\tLINE_SEPARATOR\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tonChange( insert( value, valueToInsert ) );\n\t\t\t} else if ( content.length > 0 ) {\n\t\t\t\t// When an URL is pasted in an empty paragraph then the EmbedHandlerPicker should showcase options allowing the transformation of that URL\n\t\t\t\t// into either an Embed block or a link within the target paragraph. If the paragraph is non-empty, the URL is pasted as text.\n\t\t\t\tconst canPasteEmbed =\n\t\t\t\t\tisPastedURL &&\n\t\t\t\t\tcontent.length === 1 &&\n\t\t\t\t\tcontent[ 0 ].name === 'core/embed';\n\t\t\t\tif ( onReplace && isEmpty( value ) ) {\n\t\t\t\t\tif ( canPasteEmbed ) {\n\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\tinsert( value, create( { text: plainText } ) )\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( __unstableEmbedURLOnPaste ) {\n\t\t\t\t\t\t\tpresentEmbedHandlerPicker();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tonReplace( content, content.length - 1, -1 );\n\t\t\t\t} else {\n\t\t\t\t\tif ( canPasteEmbed ) {\n\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\tinsert( value, create( { text: plainText } ) )\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsplitValue( value, content );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\ttagName,\n\t\t\tonReplace,\n\t\t\tonSplit,\n\t\t\tsplitValue,\n\t\t\t__unstableEmbedURLOnPaste,\n\t\t\tmultilineTag,\n\t\t\tpreserveWhiteSpace,\n\t\t\tpastePlainText,\n\t\t]\n\t);\n\n\tconst inputRule = useCallback(\n\t\t( value, valueToFormat ) => {\n\t\t\tif ( ! onReplace ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { start: startPosition, text } = value;\n\t\t\tconst characterBefore = text.slice(\n\t\t\t\tstartPosition - 1,\n\t\t\t\tstartPosition\n\t\t\t);\n\n\t\t\t// The character right before the caret must be a plain space.\n\t\t\tif ( characterBefore !== ' ' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst trimmedTextBefore = text.slice( 0, startPosition ).trim();\n\t\t\tconst prefixTransforms = getBlockTransforms( 'from' ).filter(\n\t\t\t\t( { type } ) => type === 'prefix'\n\t\t\t);\n\t\t\tconst transformation = findTransform(\n\t\t\t\tprefixTransforms,\n\t\t\t\t( { prefix } ) => {\n\t\t\t\t\treturn trimmedTextBefore === prefix;\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( ! transformation ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst content = valueToFormat(\n\t\t\t\tslice( value, startPosition, text.length )\n\t\t\t);\n\t\t\tconst block = transformation.transform( content );\n\n\t\t\tonReplace( [ block ] );\n\t\t\t__unstableMarkAutomaticChange();\n\t\t},\n\t\t[ onReplace, __unstableMarkAutomaticChange ]\n\t);\n\n\tconst mergedRef = useMergeRefs( [ forwardedRef, fallbackRef ] );\n\n\tconst content = (\n\t\t<RichText\n\t\t\tclientId={ clientId }\n\t\t\tidentifier={ identifier }\n\t\t\tref={ mergedRef }\n\t\t\tvalue={ adjustedValue }\n\t\t\tonChange={ adjustedOnChange }\n\t\t\tselectionStart={ selectionStart }\n\t\t\tselectionEnd={ selectionEnd }\n\t\t\tonSelectionChange={ onSelectionChange }\n\t\t\ttagName={ tagName }\n\t\t\tstart={ start }\n\t\t\treversed={ reversed }\n\t\t\tplaceholder={ placeholder }\n\t\t\tallowedFormats={ adjustedAllowedFormats }\n\t\t\twithoutInteractiveFormatting={ withoutInteractiveFormatting }\n\t\t\tonEnter={ onEnter }\n\t\t\tonDelete={ onDelete }\n\t\t\tonPaste={ onPaste }\n\t\t\t__unstableIsSelected={ isSelected }\n\t\t\t__unstableInputRule={ inputRule }\n\t\t\t__unstableMultilineTag={ multilineTag }\n\t\t\t__unstableOnEnterFormattedText={ enterFormattedText }\n\t\t\t__unstableOnExitFormattedText={ exitFormattedText }\n\t\t\t__unstableOnCreateUndoLevel={ __unstableMarkLastChangeAsPersistent }\n\t\t\t__unstableMarkAutomaticChange={ __unstableMarkAutomaticChange }\n\t\t\t__unstableDidAutomaticChange={ didAutomaticChange }\n\t\t\t__unstableUndo={ undo }\n\t\t\t__unstableDisableFormats={ disableFormats }\n\t\t\tpreserveWhiteSpace={ preserveWhiteSpace }\n\t\t\tdisabled={ disabled }\n\t\t\tunstableOnFocus={ unstableOnFocus }\n\t\t\t__unstableAllowPrefixTransformations={\n\t\t\t\t__unstableAllowPrefixTransformations\n\t\t\t}\n\t\t\t__unstableMultilineRootTag={ __unstableMultilineRootTag }\n\t\t\t// Native props.\n\t\t\t{ ...nativeProps }\n\t\t\tblockIsSelected={\n\t\t\t\toriginalIsSelected !== undefined\n\t\t\t\t\t? originalIsSelected\n\t\t\t\t\t: blockIsSelected\n\t\t\t}\n\t\t\tshouldBlurOnUnmount={ shouldBlurOnUnmount }\n\t\t\t__unstableMobileNoFocusOnMount={ __unstableMobileNoFocusOnMount }\n\t\t\tdeleteEnter={ deleteEnter }\n\t\t\tplaceholderTextColor={ placeholderTextColor }\n\t\t\ttextAlign={ textAlign }\n\t\t\tselectionColor={ selectionColor }\n\t\t\ttagsToEliminate={ tagsToEliminate }\n\t\t\trootTagsToEliminate={ rootTagsToEliminate }\n\t\t\tdisableEditingMenu={ disableEditingMenu }\n\t\t\tfontSize={ fontSize }\n\t\t\tfontFamily={ fontFamily }\n\t\t\tfontWeight={ fontWeight }\n\t\t\tfontStyle={ fontStyle }\n\t\t\tminWidth={ minWidth }\n\t\t\tmaxWidth={ maxWidth }\n\t\t\tonBlur={ onBlur }\n\t\t\tsetRef={ setRef }\n\t\t\tdisableSuggestions={ disableSuggestions }\n\t\t\tdisableAutocorrection={ disableAutocorrection }\n\t\t\t// Props to be set on the editable container are destructured on the\n\t\t\t// element itself for web (see below), but passed through rich text\n\t\t\t// for native.\n\t\t\tid={ props.id }\n\t\t\tstyle={ props.style }\n\t\t>\n\t\t\t{ ( {\n\t\t\t\tisSelected: nestedIsSelected,\n\t\t\t\tvalue,\n\t\t\t\tonChange,\n\t\t\t\tonFocus,\n\t\t\t\teditableProps,\n\t\t\t\teditableTagName: TagName,\n\t\t\t} ) => (\n\t\t\t\t<>\n\t\t\t\t\t{ children && children( { value, onChange, onFocus } ) }\n\t\t\t\t\t{ nestedIsSelected && hasFormats && (\n\t\t\t\t\t\t<FormatToolbarContainer\n\t\t\t\t\t\t\tinline={ inlineToolbar }\n\t\t\t\t\t\t\tanchorRef={ fallbackRef.current }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ nestedIsSelected && <RemoveBrowserShortcuts /> }\n\t\t\t\t\t<Autocomplete\n\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\tcompleters={ autocompleters }\n\t\t\t\t\t\trecord={ value }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tisSelected={ nestedIsSelected }\n\t\t\t\t\t\tcontentRef={ fallbackRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { listBoxId, activeId, onKeyDown } ) => (\n\t\t\t\t\t\t\t<TagName\n\t\t\t\t\t\t\t\t{ ...editableProps }\n\t\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\tprops.style\n\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\t...props.style,\n\t\t\t\t\t\t\t\t\t\t\t\t...editableProps.style,\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t: editableProps.style\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\tclasses,\n\t\t\t\t\t\t\t\t\tprops.className,\n\t\t\t\t\t\t\t\t\teditableProps.className\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\taria-autocomplete={\n\t\t\t\t\t\t\t\t\tlistBoxId ? 'list' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-owns={ listBoxId }\n\t\t\t\t\t\t\t\taria-activedescendant={ activeId }\n\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\tonKeyDown( event );\n\t\t\t\t\t\t\t\t\teditableProps.onKeyDown( event );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Autocomplete>\n\t\t\t\t\t<EmbedHandlerPicker ref={ embedHandlerPickerRef } />\n\t\t\t\t</>\n\t\t\t) }\n\t\t</RichText>\n\t);\n\n\tif ( ! wrapperClassName ) {\n\t\treturn content;\n\t}\n\n\tdeprecated( 'wp.blockEditor.RichText wrapperClassName prop', {\n\t\tsince: '5.4',\n\t\talternative: 'className prop or create your own wrapper div',\n\t\tversion: '6.2',\n\t} );\n\n\treturn (\n\t\t<div className={ classnames( wrapperClasses, wrapperClassName ) }>\n\t\t\t{ content }\n\t\t</div>\n\t);\n}\n\nconst ForwardedRichTextContainer = forwardRef( RichTextWrapper );\n\nForwardedRichTextContainer.Content = ( {\n\tvalue,\n\ttagName: Tag,\n\tmultiline,\n\t...props\n} ) => {\n\t// Handle deprecated `children` and `node` sources.\n\tif ( Array.isArray( value ) ) {\n\t\tvalue = childrenSource.toHTML( value );\n\t}\n\n\tconst MultilineTag = getMultilineTag( multiline );\n\n\tif ( ! value && MultilineTag ) {\n\t\tvalue = `<${ MultilineTag }></${ MultilineTag }>`;\n\t}\n\n\tconst content = <RawHTML>{ value }</RawHTML>;\n\n\tif ( Tag ) {\n\t\treturn <Tag { ...omit( props, [ 'format' ] ) }>{ content }</Tag>;\n\t}\n\n\treturn content;\n};\n\nForwardedRichTextContainer.isEmpty = ( value ) => {\n\treturn ! value || value.length === 0;\n};\n\nForwardedRichTextContainer.Content.defaultProps = {\n\tformat: 'string',\n\tvalue: '',\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md\n */\nexport default ForwardedRichTextContainer;\nexport { RichTextShortcut } from './shortcut';\nexport { RichTextToolbarButton } from './toolbar-button';\nexport { __unstableRichTextInputEvent } from './input-event';\n"]}
|
|
@@ -41,6 +41,19 @@ function useInput() {
|
|
|
41
41
|
__unstableExpandSelection
|
|
42
42
|
} = (0, _data.useDispatch)(_store.store);
|
|
43
43
|
return (0, _compose.useRefEffect)(node => {
|
|
44
|
+
function onBeforeInput(event) {
|
|
45
|
+
var _event$inputType;
|
|
46
|
+
|
|
47
|
+
if (!hasMultiSelection()) {
|
|
48
|
+
return;
|
|
49
|
+
} // Prevent the browser to format something when we have multiselection.
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
if ((_event$inputType = event.inputType) !== null && _event$inputType !== void 0 && _event$inputType.startsWith('format')) {
|
|
53
|
+
event.preventDefault();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
44
57
|
function onKeyDown(event) {
|
|
45
58
|
if (event.defaultPrevented) {
|
|
46
59
|
return;
|
|
@@ -105,9 +118,11 @@ function useInput() {
|
|
|
105
118
|
}
|
|
106
119
|
}
|
|
107
120
|
|
|
121
|
+
node.addEventListener('beforeinput', onBeforeInput);
|
|
108
122
|
node.addEventListener('keydown', onKeyDown);
|
|
109
123
|
node.addEventListener('compositionstart', onCompositionStart);
|
|
110
124
|
return () => {
|
|
125
|
+
node.removeEventListener('beforeinput', onBeforeInput);
|
|
111
126
|
node.removeEventListener('keydown', onKeyDown);
|
|
112
127
|
node.removeEventListener('compositionstart', onCompositionStart);
|
|
113
128
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/components/writing-flow/use-input.js"],"names":["useInput","__unstableIsFullySelected","getSelectedBlockClientIds","__unstableIsSelectionMergeable","hasMultiSelection","blockEditorStore","replaceBlocks","__unstableSplitSelection","removeBlocks","__unstableDeleteSelection","__unstableExpandSelection","node","
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/components/writing-flow/use-input.js"],"names":["useInput","__unstableIsFullySelected","getSelectedBlockClientIds","__unstableIsSelectionMergeable","hasMultiSelection","blockEditorStore","replaceBlocks","__unstableSplitSelection","removeBlocks","__unstableDeleteSelection","__unstableExpandSelection","node","onBeforeInput","event","inputType","startsWith","preventDefault","onKeyDown","defaultPrevented","keyCode","ENTER","contentEditable","BACKSPACE","DELETE","key","length","metaKey","ctrlKey","ownerDocument","defaultView","getSelection","removeAllRanges","onCompositionStart","addEventListener","removeEventListener"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;AACe,SAASA,QAAT,GAAoB;AAClC,QAAM;AACLC,IAAAA,yBADK;AAELC,IAAAA,yBAFK;AAGLC,IAAAA,8BAHK;AAILC,IAAAA;AAJK,MA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B,SAA1B,EAAqCjB,SAArC;AACAN,MAAAA,IAAI,CAACuB,mBAAL,CAA0B,kBAA1B,EAA8CF,kBAA9C;AACA,KAJD;AAKA,GA3FM,EA2FJ,EA3FI,CAAP;AA4FA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Handles input for selections across blocks.\n */\nexport default function useInput() {\n\tconst {\n\t\t__unstableIsFullySelected,\n\t\tgetSelectedBlockClientIds,\n\t\t__unstableIsSelectionMergeable,\n\t\thasMultiSelection,\n\t} = useSelect( blockEditorStore );\n\tconst {\n\t\treplaceBlocks,\n\t\t__unstableSplitSelection,\n\t\tremoveBlocks,\n\t\t__unstableDeleteSelection,\n\t\t__unstableExpandSelection,\n\t} = useDispatch( blockEditorStore );\n\n\treturn useRefEffect( ( node ) => {\n\t\tfunction onBeforeInput( event ) {\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Prevent the browser to format something when we have multiselection.\n\t\t\tif ( event.inputType?.startsWith( 'format' ) ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( event.keyCode === ENTER ) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( __unstableIsFullySelected() ) {\n\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\tgetSelectedBlockClientIds(),\n\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t__unstableSplitSelection();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tevent.keyCode === BACKSPACE ||\n\t\t\t\tevent.keyCode === DELETE\n\t\t\t) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( __unstableIsFullySelected() ) {\n\t\t\t\t\tremoveBlocks( getSelectedBlockClientIds() );\n\t\t\t\t} else if ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t\t__unstableDeleteSelection( event.keyCode === DELETE );\n\t\t\t\t} else {\n\t\t\t\t\t__unstableExpandSelection();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t// If key.length is longer than 1, it's a control key that doesn't\n\t\t\t\t// input anything.\n\t\t\t\tevent.key.length === 1 &&\n\t\t\t\t! ( event.metaKey || event.ctrlKey )\n\t\t\t) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tif ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t\t__unstableDeleteSelection( event.keyCode === DELETE );\n\t\t\t\t} else {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t// Safari does not stop default behaviour with either\n\t\t\t\t\t// event.preventDefault() or node.contentEditable = false, so\n\t\t\t\t\t// remove the selection to stop browser manipulation.\n\t\t\t\t\tnode.ownerDocument.defaultView\n\t\t\t\t\t\t.getSelection()\n\t\t\t\t\t\t.removeAllRanges();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction onCompositionStart( event ) {\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnode.contentEditable = false;\n\n\t\t\tif ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t__unstableDeleteSelection();\n\t\t\t} else {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// Safari does not stop default behaviour with either\n\t\t\t\t// event.preventDefault() or node.contentEditable = false, so\n\t\t\t\t// remove the selection to stop browser manipulation.\n\t\t\t\tnode.ownerDocument.defaultView.getSelection().removeAllRanges();\n\t\t\t}\n\t\t}\n\n\t\tnode.addEventListener( 'beforeinput', onBeforeInput );\n\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\tnode.addEventListener( 'compositionstart', onCompositionStart );\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'beforeinput', onBeforeInput );\n\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t\tnode.removeEventListener( 'compositionstart', onCompositionStart );\n\t\t};\n\t}, [] );\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.__experimentalElementButtonClassName = void 0;
|
|
7
|
+
const __experimentalElementButtonClassName = 'wp-element-button';
|
|
8
|
+
exports.__experimentalElementButtonClassName = __experimentalElementButtonClassName;
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/elements/index.js"],"names":["__experimentalElementButtonClassName"],"mappings":";;;;;;AAAO,MAAMA,oCAAoC,GAAG,mBAA7C","sourcesContent":["export const __experimentalElementButtonClassName = 'wp-element-button';\n"]}
|
package/build/hooks/color.js
CHANGED
|
@@ -80,33 +80,6 @@ const hasTextColorSupport = blockType => {
|
|
|
80
80
|
const colorSupport = (0, _blocks.getBlockSupport)(blockType, COLOR_SUPPORT_KEY);
|
|
81
81
|
return colorSupport && colorSupport.text !== false;
|
|
82
82
|
};
|
|
83
|
-
/**
|
|
84
|
-
* Checks whether a color has been set either with a named preset color in
|
|
85
|
-
* a top level block attribute or as a custom value within the style attribute
|
|
86
|
-
* object.
|
|
87
|
-
*
|
|
88
|
-
* @param {string} name Name of the color to check.
|
|
89
|
-
* @return {boolean} Whether or not a color has a value.
|
|
90
|
-
*/
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const hasColor = name => props => {
|
|
94
|
-
var _props$attributes$sty9, _props$attributes$sty10;
|
|
95
|
-
|
|
96
|
-
if (name === 'background') {
|
|
97
|
-
var _props$attributes$sty, _props$attributes$sty2, _props$attributes$sty3, _props$attributes$sty4;
|
|
98
|
-
|
|
99
|
-
return !!props.attributes.backgroundColor || !!((_props$attributes$sty = props.attributes.style) !== null && _props$attributes$sty !== void 0 && (_props$attributes$sty2 = _props$attributes$sty.color) !== null && _props$attributes$sty2 !== void 0 && _props$attributes$sty2.background) || !!props.attributes.gradient || !!((_props$attributes$sty3 = props.attributes.style) !== null && _props$attributes$sty3 !== void 0 && (_props$attributes$sty4 = _props$attributes$sty3.color) !== null && _props$attributes$sty4 !== void 0 && _props$attributes$sty4.gradient);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (name === 'link') {
|
|
103
|
-
var _props$attributes$sty5, _props$attributes$sty6, _props$attributes$sty7, _props$attributes$sty8;
|
|
104
|
-
|
|
105
|
-
return !!((_props$attributes$sty5 = props.attributes.style) !== null && _props$attributes$sty5 !== void 0 && (_props$attributes$sty6 = _props$attributes$sty5.elements) !== null && _props$attributes$sty6 !== void 0 && (_props$attributes$sty7 = _props$attributes$sty6.link) !== null && _props$attributes$sty7 !== void 0 && (_props$attributes$sty8 = _props$attributes$sty7.color) !== null && _props$attributes$sty8 !== void 0 && _props$attributes$sty8.text);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return !!props.attributes[`${name}Color`] || !!((_props$attributes$sty9 = props.attributes.style) !== null && _props$attributes$sty9 !== void 0 && (_props$attributes$sty10 = _props$attributes$sty9.color) !== null && _props$attributes$sty10 !== void 0 && _props$attributes$sty10[name]);
|
|
109
|
-
};
|
|
110
83
|
/**
|
|
111
84
|
* Clears a single color property from a style object.
|
|
112
85
|
*
|
|
@@ -117,25 +90,6 @@ const hasColor = name => props => {
|
|
|
117
90
|
|
|
118
91
|
|
|
119
92
|
const clearColorFromStyles = (path, style) => (0, _utils.cleanEmptyObject)((0, _utils.immutableSet)(style, path, undefined));
|
|
120
|
-
/**
|
|
121
|
-
* Resets the block attributes for text color.
|
|
122
|
-
*
|
|
123
|
-
* @param {Object} props Current block props.
|
|
124
|
-
* @param {Object} props.attributes Block attributes.
|
|
125
|
-
* @param {Function} props.setAttributes Block's setAttributes prop used to apply reset.
|
|
126
|
-
*/
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const resetTextColor = _ref => {
|
|
130
|
-
let {
|
|
131
|
-
attributes,
|
|
132
|
-
setAttributes
|
|
133
|
-
} = _ref;
|
|
134
|
-
setAttributes({
|
|
135
|
-
textColor: undefined,
|
|
136
|
-
style: clearColorFromStyles(['color', 'text'], attributes.style)
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
93
|
/**
|
|
140
94
|
* Clears text color related properties from supplied attributes.
|
|
141
95
|
*
|
|
@@ -148,25 +102,6 @@ const resetAllTextFilter = attributes => ({
|
|
|
148
102
|
textColor: undefined,
|
|
149
103
|
style: clearColorFromStyles(['color', 'text'], attributes.style)
|
|
150
104
|
});
|
|
151
|
-
/**
|
|
152
|
-
* Resets the block attributes for link color.
|
|
153
|
-
*
|
|
154
|
-
* @param {Object} props Current block props.
|
|
155
|
-
* @param {Object} props.attributes Block attributes.
|
|
156
|
-
* @param {Function} props.setAttributes Block's setAttributes prop used to apply reset.
|
|
157
|
-
*/
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
const resetLinkColor = _ref2 => {
|
|
161
|
-
let {
|
|
162
|
-
attributes,
|
|
163
|
-
setAttributes
|
|
164
|
-
} = _ref2;
|
|
165
|
-
const path = ['elements', 'link', 'color', 'text'];
|
|
166
|
-
setAttributes({
|
|
167
|
-
style: clearColorFromStyles(path, attributes.style)
|
|
168
|
-
});
|
|
169
|
-
};
|
|
170
105
|
/**
|
|
171
106
|
* Clears link color related properties from supplied attributes.
|
|
172
107
|
*
|
|
@@ -201,22 +136,6 @@ const clearBackgroundAndGradient = attributes => {
|
|
|
201
136
|
}
|
|
202
137
|
};
|
|
203
138
|
};
|
|
204
|
-
/**
|
|
205
|
-
* Resets the block attributes for both background color and gradient.
|
|
206
|
-
*
|
|
207
|
-
* @param {Object} props Current block props.
|
|
208
|
-
* @param {Object} props.attributes Block attributes.
|
|
209
|
-
* @param {Function} props.setAttributes Block's setAttributes prop used to apply reset.
|
|
210
|
-
*/
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
const resetBackgroundAndGradient = _ref3 => {
|
|
214
|
-
let {
|
|
215
|
-
attributes,
|
|
216
|
-
setAttributes
|
|
217
|
-
} = _ref3;
|
|
218
|
-
setAttributes(clearBackgroundAndGradient(attributes));
|
|
219
|
-
};
|
|
220
139
|
/**
|
|
221
140
|
* Filters registered block settings, extending attributes to include
|
|
222
141
|
* `backgroundColor` and `textColor` attribute.
|
|
@@ -475,12 +394,19 @@ function ColorEdit(props) {
|
|
|
475
394
|
};
|
|
476
395
|
|
|
477
396
|
const onChangeLinkColor = value => {
|
|
397
|
+
var _localAttributes$curr9;
|
|
398
|
+
|
|
478
399
|
const colorObject = (0, _colors.getColorObjectByColorValue)(allSolids, value);
|
|
479
400
|
const newLinkColorValue = colorObject !== null && colorObject !== void 0 && colorObject.slug ? `var:preset|color|${colorObject.slug}` : value;
|
|
480
|
-
const newStyle = (0, _utils.cleanEmptyObject)((0, _utils.immutableSet)(style, ['elements', 'link', 'color', 'text'], newLinkColorValue));
|
|
401
|
+
const newStyle = (0, _utils.cleanEmptyObject)((0, _utils.immutableSet)((_localAttributes$curr9 = localAttributes.current) === null || _localAttributes$curr9 === void 0 ? void 0 : _localAttributes$curr9.style, ['elements', 'link', 'color', 'text'], newLinkColorValue));
|
|
481
402
|
props.setAttributes({
|
|
482
403
|
style: newStyle
|
|
483
404
|
});
|
|
405
|
+
localAttributes.current = { ...localAttributes.current,
|
|
406
|
+
...{
|
|
407
|
+
style: newStyle
|
|
408
|
+
}
|
|
409
|
+
};
|
|
484
410
|
};
|
|
485
411
|
|
|
486
412
|
const enableContrastChecking = _element.Platform.OS === 'web' && !gradient && !(style !== null && style !== void 0 && (_style$color6 = style.color) !== null && _style$color6 !== void 0 && _style$color6.gradient);
|
|
@@ -494,8 +420,6 @@ function ColorEdit(props) {
|
|
|
494
420
|
onColorChange: onChangeColor('text'),
|
|
495
421
|
colorValue: (0, _colors.getColorObjectByAttributeValues)(allSolids, textColor, style === null || style === void 0 ? void 0 : (_style$color7 = style.color) === null || _style$color7 === void 0 ? void 0 : _style$color7.text).color,
|
|
496
422
|
isShownByDefault: defaultColorControls === null || defaultColorControls === void 0 ? void 0 : defaultColorControls.text,
|
|
497
|
-
hasValue: () => hasColor('text')(props),
|
|
498
|
-
onDeselect: () => resetTextColor(props),
|
|
499
423
|
resetAllFilter: resetAllTextFilter
|
|
500
424
|
}] : []), ...(hasBackgroundColor || hasGradientColor ? [{
|
|
501
425
|
label: (0, _i18n.__)('Background'),
|
|
@@ -504,8 +428,6 @@ function ColorEdit(props) {
|
|
|
504
428
|
gradientValue,
|
|
505
429
|
onGradientChange: hasGradientColor ? onChangeGradient : undefined,
|
|
506
430
|
isShownByDefault: defaultColorControls === null || defaultColorControls === void 0 ? void 0 : defaultColorControls.background,
|
|
507
|
-
hasValue: () => hasColor('background')(props),
|
|
508
|
-
onDeselect: () => resetBackgroundAndGradient(props),
|
|
509
431
|
resetAllFilter: clearBackgroundAndGradient
|
|
510
432
|
}] : []), ...(hasLinkColor ? [{
|
|
511
433
|
label: (0, _i18n.__)('Link'),
|
|
@@ -513,8 +435,6 @@ function ColorEdit(props) {
|
|
|
513
435
|
colorValue: getLinkColorFromAttributeValue(allSolids, style === null || style === void 0 ? void 0 : (_style$elements2 = style.elements) === null || _style$elements2 === void 0 ? void 0 : (_style$elements2$link = _style$elements2.link) === null || _style$elements2$link === void 0 ? void 0 : (_style$elements2$link2 = _style$elements2$link.color) === null || _style$elements2$link2 === void 0 ? void 0 : _style$elements2$link2.text),
|
|
514
436
|
clearable: !!(style !== null && style !== void 0 && (_style$elements3 = style.elements) !== null && _style$elements3 !== void 0 && (_style$elements3$link = _style$elements3.link) !== null && _style$elements3$link !== void 0 && (_style$elements3$link2 = _style$elements3$link.color) !== null && _style$elements3$link2 !== void 0 && _style$elements3$link2.text),
|
|
515
437
|
isShownByDefault: defaultColorControls === null || defaultColorControls === void 0 ? void 0 : defaultColorControls.link,
|
|
516
|
-
hasValue: () => hasColor('link')(props),
|
|
517
|
-
onDeselect: () => resetLinkColor(props),
|
|
518
438
|
resetAllFilter: resetAllLinkFilter
|
|
519
439
|
}] : [])]
|
|
520
440
|
});
|