Changeset 3405619
- Timestamp:
- 11/29/2025 06:03:47 AM (2 weeks ago)
- Location:
- consistency
- Files:
-
- 42 edited
- 1 copied
-
tags/1.8.4 (copied) (copied from consistency/trunk)
-
tags/1.8.4/build/index.asset.php (modified) (1 diff)
-
tags/1.8.4/build/index.js (modified) (1 diff)
-
tags/1.8.4/changelog.txt (modified) (1 diff)
-
tags/1.8.4/composer.json (modified) (1 diff)
-
tags/1.8.4/composer.lock (modified) (2 diffs)
-
tags/1.8.4/consistency.php (modified) (1 diff)
-
tags/1.8.4/includes/MetaData/MetaData.php (modified) (1 diff)
-
tags/1.8.4/includes/Option/Option.php (modified) (2 diffs)
-
tags/1.8.4/includes/Utils/Concerns/ObjectArrayTrait.php (modified) (1 diff)
-
tags/1.8.4/package.json (modified) (1 diff)
-
tags/1.8.4/readme.txt (modified) (2 diffs)
-
tags/1.8.4/src/app/fixes.js (modified) (2 diffs)
-
tags/1.8.4/src/components/GlobalSettingToggle.js (modified) (2 diffs)
-
tags/1.8.4/src/components/UserSettingToggle.js (modified) (2 diffs)
-
tags/1.8.4/src/config/rules.js (modified) (2 diffs)
-
tags/1.8.4/vendor/autoload.php (modified) (1 diff)
-
tags/1.8.4/vendor/composer/InstalledVersions.php (modified) (5 diffs)
-
tags/1.8.4/vendor/composer/autoload_classmap.php (modified) (1 diff)
-
tags/1.8.4/vendor/composer/autoload_static.php (modified) (1 diff)
-
tags/1.8.4/vendor/composer/installed.php (modified) (3 diffs)
-
tags/1.8.4/vendor/composer/platform_check.php (modified) (1 diff)
-
trunk/build/index.asset.php (modified) (1 diff)
-
trunk/build/index.js (modified) (1 diff)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/composer.json (modified) (1 diff)
-
trunk/composer.lock (modified) (2 diffs)
-
trunk/consistency.php (modified) (1 diff)
-
trunk/includes/MetaData/MetaData.php (modified) (1 diff)
-
trunk/includes/Option/Option.php (modified) (2 diffs)
-
trunk/includes/Utils/Concerns/ObjectArrayTrait.php (modified) (1 diff)
-
trunk/package.json (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/app/fixes.js (modified) (2 diffs)
-
trunk/src/components/GlobalSettingToggle.js (modified) (2 diffs)
-
trunk/src/components/UserSettingToggle.js (modified) (2 diffs)
-
trunk/src/config/rules.js (modified) (2 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/InstalledVersions.php (modified) (5 diffs)
-
trunk/vendor/composer/autoload_classmap.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_static.php (modified) (1 diff)
-
trunk/vendor/composer/installed.php (modified) (3 diffs)
-
trunk/vendor/composer/platform_check.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
consistency/tags/1.8.4/build/index.asset.php
r3184822 r3405619 1 <?php return array('dependencies' => array('react', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-rich-text'), 'version' => ' 71c2764f0435ef4fe22c');1 <?php return array('dependencies' => array('react', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-rich-text'), 'version' => '39053d2cc07db4dc4039'); -
consistency/tags/1.8.4/build/index.js
r3184822 r3405619 1 (()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,s=window.wp.plugins,n=window.wp.domReady;var o=e.n(n);const c=window.wp.element,r=(0,c.createContext)(),a=({children:e})=>{const[s]=(0,c.useState)(null!==document.querySelector('iframe[name="editor-canvas"]')),[n,o]=(0,c.useState)(!1),[a,i]=(0,c.useState)(""),[l,u]=(0,c.useState)([]), d=(0,c.useRef)(0),p=(0,c.useRef)(!1);return(0,t.createElement)(r.Provider,{value:{isEditorInIframe:s,isPreviousFixCanceled:n,setPreviousFixCanceled:o,previousFixCanceledContent:a,setPreviousFixCanceledContent:i,blocksToBeProcessed:l,setBlocksToBeProcessed:u,cursorOffsetRef:d,isContentPastedRef:p}},e)},i=r,l=window.wp.i18n,u=window.wp.editor,d=window.wp.data,p=window.wp.components,y=()=>(0,t.createElement)(p.Icon,{icon:(0,t.createElement)("svg",{version:"1.1",id:"consistency-plugin",x:"0px",y:"0px",width:"24px",height:"24px",viewBox:"0 0 24 24",enableBackground:"new 0 0 24 24"},(0,t.createElement)("line",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",x1:"4",y1:"20",x2:"7",y2:"20"}),(0,t.createElement)("line",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",x1:"14",y1:"20",x2:"21",y2:"20"}),(0,t.createElement)("line",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),(0,t.createElement)("line",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),(0,t.createElement)("polyline",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",points:"5,20 11,4 13,4 20,20 "}))}),g=window.wp.coreData,m=window.wp.notices,h=e=>{const{settingSlug:s,settingName:n,settingDescription:o}=e,{currentUser:c}=(0,d.useSelect)((e=>({currentUser:e(g.store).getCurrentUser()})),[]),r=c&&c.id,[a,i]=(0,g.useEntityProp)("root","user","meta",r),{saveEditedEntityRecord:u}=(0,d.useDispatch)(g.store),{createNotice:y}=(0,d.useDispatch)(m.store);return(0,t.createElement)(p.ToggleControl,{label:n,help:(0,t.createElement)("span",{dangerouslySetInnerHTML:o}),checked:a?.consistency_plugin_user_settings?.find((e=>e.slug===s))?.value||!1,onChange:e=>{let t=a?.consistency_plugin_user_settings.map((t=>s===t.slug?{...t,value:e}:t));t?.find((e=>e.slug===s))||t.push({slug:s,value:e}),i({...a,consistency_plugin_user_settings:t}),u("root","user",r,{...a,meta:t}),y((0,l.__)("info","consistency"),e?sprintf((0,l.__)('"%1$s" Correction is enabled',"consistency"),n):sprintf((0,l.__)('"%1$s" Correction is disabled',"consistency"),n),{isDismissible:!0,type:"snackbar",speak:!0})}})},f=()=>(0,t.createElement)(p.Panel,{className:"UserSettingPanel"},(0,t.createElement)(p.PanelHeader,null,(0,t.createElement)("strong",null,(0,l.__)("Settings for my account","consistency")),(0,t.createElement)("br",null)),(0,t.createElement)("div",{style:{padding:16}},(0,t.createElement)(p.PanelRow,null,(0,t.createElement)(h,{settingSlug:"on_the_fly",settingName:(0,l.__)("On-the-fly autocorrect","consistency"),settingDescription:{__html:(0,l.__)("Enable/disable on-the-fly autocorrect","consistency")}})),(0,t.createElement)(p.PanelRow,null,(0,t.createElement)(h,{settingSlug:"on_paste",settingName:(0,l.__)("On paste autocorrect","consistency"),settingDescription:{__html:(0,l.__)("Enable/disable autocorrect on paste","consistency")}})))),b=window.wp.richText,_=e=>"string"==typeof e||e instanceof String,k=e=>"object"==typeof e&&e instanceof b.RichTextData,{getEntityRecord:w}=(0,d.select)("core"),{updateBlock:v}=(0,d.dispatch)("core/block-editor"),S=()=>{const e=w("root","site");return e?.consistency_plugin_localization_management||!0},x=()=>{const e=w("root","site");return e?.language||"en_US"},C=()=>{const e=x(),s=S()?(0,l.__)(` (${e} locale)`,"consistency"):(0,l.__)(" (all locales)","consistency");return(0,t.createElement)("span",{style:{fontWeight:"normal",fontStyle:"italic",fontSize:"smaller"}},s)},T=["regularToCurlyQuotes","regularToFrenchQuotes","regularToFrenchQuotesWithoutSpaces","regularToGermanQuotes","regularToGermanBookStyleQuotes"],E=[{slug:"quote",incompatibleWith:[]},{slug:"2hyphens",incompatibleWith:[]},{slug:"3hyphens",incompatibleWith:[]},{slug:"4hyphens",incompatibleWith:[]},{slug:"ordinalNumberSuffix",incompatibleWith:[]},{slug:"regularToCurlyQuotes",incompatibleWith:["regularToGermanQuotes","regularToGermanBookStyleQuotes","regularToFrenchQuotes","regularToFrenchQuotesWithoutSpaces"]},{slug:"regularToGermanQuotes",incompatibleWith:["regularToCurlyQuotes","regularToGermanBookStyleQuotes","regularToFrenchQuotes","regularToFrenchQuotesWithoutSpaces"]},{slug:"regularToGermanBookStyleQuotes",incompatibleWith:["regularToCurlyQuotes","regularToGermanQuotes","regularToFrenchQuotes","regularToFrenchQuotesWithoutSpaces"]},{slug:"regularToFrenchQuotes",incompatibleWith:["regularToCurlyQuotes","regularToGermanQuotes","regularToGermanBookStyleQuotes","regularToFrenchQuotesWithoutSpaces"]},{slug:"regularToFrenchQuotesWithoutSpaces",incompatibleWith:["regularToCurlyQuotes","regularToGermanQuotes","regularToGermanBookStyleQuotes","regularToFrenchQuotes"]},{slug:"curlyToFrenchQuotes",incompatibleWith:["regularToCurlyQuotes"]},{slug:"breakingSpace",incompatibleWith:["spaceBefore"]},{slug:"noSpaceBefore",incompatibleWith:["spaceBefore"]},{slug:"spaceBefore",incompatibleWith:["breakingSpace","noSpaceBefore"]},{slug:"noBreakingSpaceAfter",incompatibleWith:[]},{slug:"noNonBreakingSpaceAfter",incompatibleWith:[]},{slug:"capitalizeFirstSentenceLetter",incompatibleWith:[]},{slug:"etcThreeDots",incompatibleWith:[]},{slug:"etcTwoDots",incompatibleWith:[]},{slug:"etcEllipsis",incompatibleWith:[]},{slug:"ellipsis",incompatibleWith:[]},{slug:"symbolInACircle",incompatibleWith:[]},{slug:"symbolInSmallCapsAndSuperscriptStyle",incompatibleWith:[]},{slug:"fractions",incompatibleWith:[]},{slug:"percentages",incompatibleWith:[]}],B=[{slug:"quote",name:(0,l.__)("Straight Apostrophe","consistency"),description:(0,l.__)("Replace straight apostrophes with curly apostrophes:","consistency")+"<span aria-hidden='true' style='display:block;'><code>'</code> <span style='font-size:20px'>→</span> <code>’</code></span>",mask:/\'/,replace:"’",format:"",nbMoved:0,category:"apostrophe"},{slug:"2hyphens",name:(0,l.__)("En Dash","consistency"),description:(0,l.__)("Replace two hyphens with an en dash:","consistency")+"<span aria-hidden='true' style='display:block;'><code>--</code> <span style='font-size:20px'>→</span> <code style=\"font-family:sans-serif;\">–</code></span>",mask:/(?:\-)\-/,replace:"–",format:"",nbMoved:-1,category:"dash"},{slug:"3hyphens",name:(0,l.__)("Em Dash","consistency"),description:(0,l.__)("Replace three hyphens with an em dash:","consistency")+"<span aria-hidden='true' style='display:block;'><code>---</code> <span style='font-size:20px'>→</span> <code style=\"font-family:sans-serif;\">—</code></span>",mask:/(?:–|\-\-)\-/,replace:"—",format:"",nbMoved:e=>-(e.length-1),category:"dash"},{slug:"4hyphens",name:(0,l.__)("Two-Em Dash","consistency"),description:(0,l.__)("Replace four hyphens with two-em dash:","consistency")+"<span aria-hidden='true' style='display:block;'><code>----</code> <span style='font-size:20px'>→</span> <code style=\"font-family:sans-serif;\">⸺</code></span>",mask:/(?:—|–\-|\-\-\-)\-/,replace:"⸺",format:"",nbMoved:e=>-(e.length-1),category:"dash"},{slug:"ordinalNumberSuffix",name:(0,l.__)("Ordinal Number Suffix","consistency"),description:(0,l.__)("Add the sup HTML tag to ordinal number suffixes","consistency")+"<span aria-hidden='true' style='display:block;'><code>1st</code> <span style='font-size:20px'>→</span> <code>1<sup>st</sup></code></span>",mask:/([10-9]{1,20})(th|nd|rd|e|er|res|d|ds|de|des)( | |\.|\,|\;)/,replace:"$1$2$3",format:"superscript",nbMoved:0,category:"suffixe"},{slug:"regularToCurlyQuotes",name:(0,l.__)("Curly Quotes","consistency"),description:(0,l.__)("Replace straight quotes with curly quotes:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>“ ”</code></span>",mask:/"/,replace:"“$1”",format:"",nbMoved:0,category:"quotation"},{slug:"regularToGermanQuotes",name:(0,l.__)("German Quotes","consistency"),description:(0,l.__)("Replace straight quotes with german quotes:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>„ “</code></span>",mask:/"/,replace:"„$1“",format:"",nbMoved:0,category:"quotation"},{slug:"regularToGermanBookStyleQuotes",name:(0,l.__)("German Book-Style Quotes","consistency"),description:(0,l.__)("Replace straight quotes with german book-style quotes:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>» «</code></span>",mask:/"/,replace:"»$1«",format:"",nbMoved:0,category:"quotation"},{slug:"regularToFrenchQuotes",name:(0,l.__)("French Quotes with Spaces","consistency"),description:(0,l.__)("Replace straight quotes with french quotes with non-breaking spaces:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>« »</code></span>",mask:/"/,replace:"« $1 »",format:"",nbMoved:1,category:"quotation"},{slug:"regularToFrenchQuotesWithoutSpaces",name:(0,l.__)("French Quotes","consistency"),description:(0,l.__)("Replace straight quotes with french quotes without spaces:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>« »</code></span>",mask:/"/,replace:"«$1»",format:"",nbMoved:0,category:"quotation"},{slug:"curlyToFrenchQuotes",name:(0,l.__)("Curly Quotes to French Quotes","consistency"),description:(0,l.__)("Replace curly quotes with french quotes with non-breaking spaces:","consistency")+"<span aria-hidden='true' style='display:block;'><code>“ ”</code> <span style='font-size:20px'>→</span> <code>« »</code></span>",mask:/“.*?”/,replace:e=>`« ${e.substring(1,e.length-1)} »`,format:"",nbMoved:0,category:"quotation"},{slug:"breakingSpace",name:(0,l.__)("Breaking Spaces","consistency"),description:sprintf((0,l.__)("Replace a breaking space followed by a character from this list:%1$s with a non-breaking space","consistency"),"<br /><code>? ! : ; » € $ £ ¥ ₽ 元 %</code><br />"),mask:/ ([\?|\!|\:|\;|»|€|\$|£|¥|₽|元|\%])/,replace:" $1",format:"",nbMoved:0,category:"space"},{slug:"noSpaceBefore",name:(0,l.__)("No Space Before","consistency"),description:sprintf((0,l.__)("Add a non-breaking space before a character from this list:%1$s having no space before","consistency"),"<br /><code>? ! : ; » € $ £ ¥ ₽ 元 %</code><br />"),mask:/(?<! | | )([\?|\!|\:|»|€|\$|£|¥|₽|元|\%])/,replace:" $1",format:"",nbMoved:1,category:"space"},{slug:"spaceBefore",name:(0,l.__)("Space Before","consistency"),description:(0,l.__)("Remove any space preceding a character from this list:","consistency")+"<span style='display:block;'><code>? ! : ; %</code></span>",mask:/([ | ])(?=[\?|\!|\:|\;|\%])(.)/,replace:"$2",format:"",nbMoved:-1,category:"space"},{slug:"noBreakingSpaceAfter",name:(0,l.__)("No Breaking Space After","consistency"),description:sprintf((0,l.__)("Add a breaking space after a character from this list:%1$s when followed with another character","consistency"),"<br /><code>, … ) ]</code><br />"),mask:/([\,|…|\)|\]])(?! | |\.|\,|\d|$)(.)/,replace:"$1 $2",format:"",nbMoved:1,category:"space"},{slug:"noNonBreakingSpaceAfter",name:(0,l.__)("No Non-Breaking Space After","consistency"),description:(0,l.__)("Add a non-breaking space after open french quote having no space after","consistency"),mask:/(«)(?! | | )/,replace:"$1 ",format:"",nbMoved:0,category:"space"},{slug:"capitalizeFirstSentenceLetter",name:(0,l.__)("First Sentence Letter","consistency"),description:(0,l.__)("Capitalize the first letter of a sentence","consistency"),mask:/(^[a-záàâäãåăçéèêëíìîïñóòôöõúùûüýÿæœșț])|(?<=[\.|\?|\!|…] )[a-záàâäãåăçéèêëíìîïñóòôöõúùûüýÿæœșț]/,replace:e=>e.toUpperCase(),format:"",nbMoved:0,category:"case"},{slug:"etcThreeDots",name:(0,l.__)('Three Dots Following "etc"',"consistency"),description:(0,l.__)('Replace 3 dots placed after the abbreviation "etc" with a period:',"consistency")+"<span aria-hidden='true' style='display:block;'><code>etc...</code> <span style='font-size:20px'>→</span> <code>etc.</code></span>",mask:/etc(\.{3})/i,replace:e=>e.substring(0,3)+".",format:"",nbMoved:-2,category:"ellipsis"},{slug:"etcTwoDots",name:(0,l.__)('Two Dots Following "etc"',"consistency"),description:(0,l.__)('Replace 2 dots placed after the abbreviation "etc" with a period:',"consistency")+"<span aria-hidden='true' style='display:block;'><code>etc..</code> <span style='font-size:20px'>→</span> <code>etc.</code></span>",mask:/etc(\.{2})/i,replace:e=>e.substring(0,2)+".",format:"",nbMoved:-1,category:"ellipsis"},{slug:"etcEllipsis",name:(0,l.__)('Ellipsis Following "etc"',"consistency"),description:(0,l.__)('Replace the ellipsis placed after the abbreviation "etc" with a period:',"consistency")+"<span aria-hidden='true' style='display:block;'><code>etc…</code> <span style='font-size:20px'>→</span> <code>etc.</code></span>",mask:/etc(\.{3}|…)/i,replace:e=>e.substring(0,3)+".",format:"",nbMoved:0,category:"ellipsis"},{slug:"ellipsis",name:(0,l.__)("Ellipsis","consistency"),description:(0,l.__)("Replaces 3 dots with ellipsis:","consistency")+"<span aria-hidden='true' style='display:block;'><code>...</code> <span style='font-size:20px'>→</span> <code>…</code></span>",mask:/\.{3}/,replace:"…",format:"",nbMoved:-2,category:"ellipsis"},{slug:"symbolInACircle",name:(0,l.__)("Symbol in a Circle","consistency"),description:(0,l.__)("Replaces 1 character placed in parentheses with a symbol","consistency")+"<span aria-hidden='true' style='display:block;'><code>(c) (p) (r)</code> <span style='font-size:20px'>→</span> <code>© ℗ ®</code></span>",mask:/(\([c|p|r])(\))/,replace:e=>{switch(e[1]){case"c":return"©";case"p":return"℗";case"r":return"®"}return" "},format:"",nbMoved:-2,category:"symbol"},{slug:"symbolInSmallCapsAndSuperscriptStyle",name:(0,l.__)("Symbol in Small Caps and Superscript Style","consistency"),description:(0,l.__)("Replaces 2-character abbreviations with a symbol in small caps and superscript style","consistency")+"<span aria-hidden='true' style='display:block;'><code>tm sm md mc</code> <span style='font-size:20px'>→</span> <code>™ ℠ 🅫 🅪</code></span>",mask:/(?<= | |\(|\[|\{|:|^)(tm|sm|md|mc)(?= | |\.|\,|\;|\:|\)|\]|\}|$)/,replace:e=>{switch(e){case"tm":return"™";case"sm":return"℠";case"md":return"🅫";case"mc":return"🅪";default:return" "}},format:"",nbMoved:-1,category:"symbol"},{slug:"fractions",name:(0,l.__)("Fractions","consistency"),description:(0,l.__)("Replaces fractions with fraction symbols:","consistency")+"<span aria-hidden='true' style='display:block;'><code>1/2 3/5 1/9</code> <span style='font-size:20px'>→</span> <code>½ ⅗ ⅑</code></span>",mask:/[1-9]\/[1-9]/,replace:e=>{switch(e){case"1/4":return"¼";case"1/2":return"½";case"3/4":return"¾";case"1/3":return"⅓";case"2/3":return"⅔";case"1/5":return"⅕";case"2/5":return"⅖";case"3/5":return"⅗";case"4/5":return"⅘";case"1/6":return"⅙";case"5/6":return"⅚";case"1/8":return"⅛";case"3/8":return"⅜";case"5/8":return"⅝";case"7/8":return"⅞";case"1/7":return"⅐";case"1/9":return"⅑";default:return" "}},format:"",nbMoved:-2,category:"symbol"},{slug:"percentages",name:(0,l.__)("Percentages","consistency"),description:(0,l.__)("Replaces percentages with percentages symbols:","consistency")+"<span aria-hidden='true' style='display:block;'><code>0/0 0/00 0/000</code> <span style='font-size:20px'>→</span> <code>% ‰ ‱</code></span>",mask:/(0\/0|0\/00|0\/000)(?= | |\.|\,|\;|\:|\)|\]|\})(.)/,replace:e=>{const t=e.substring(0,e.length-1),s=e.substring(e.length-1,e.length);switch(t){case"0/0":return"%"+s;case"0/00":return"‰"+s;case"0/000":return"‱"+s;default:return" "+s}},format:"",nbMoved:e=>-(e.substring(0,e.length-1).length-1),category:"symbol"}],{getSelectionStart:F}=(0,d.select)("core/block-editor"),{selectionChange:P}=(0,d.dispatch)("core/block-editor"),R=()=>{const e=(()=>{const e=w("root","site");return e?.consistency_plugin_settings||[]})();return S()?e.filter((e=>$(e.slug))):e},Q=()=>B.filter((e=>!0===R()?.find((t=>t.slug===e.slug))?.value)),{getBlockName:W,getBlockAttributes:M}=(0,d.select)("core/block-editor"),$=e=>{const t=x();return!(void 0===localesByRules||!localesByRules.hasOwnProperty(e))&&localesByRules[e].includes(t)},N=e=>{const t=E.find((t=>t.slug===e));return!!t&&t.incompatibleWith.some((e=>R()?.find((t=>t.slug===e))?.value))},q=e=>{const{settingSlug:s,settingName:n,settingDescription:o}=e,{createNotice:c}=(0,d.useDispatch)(m.store);if(S()&&!$(s))return"";const[r,a]=(0,g.useEntityProp)("root","site","consistency_plugin_settings",void 0),{saveEditedEntityRecord:i}=(0,d.useDispatch)(g.store);return(0,t.createElement)(p.PanelRow,null,(0,t.createElement)(p.ToggleControl,{label:n,help:(0,t.createElement)("span",{dangerouslySetInnerHTML:o}),checked:r?.find((e=>e.slug===s))?.value||!1,disabled:N(s),onChange:e=>{let t=r.map((t=>s===t.slug?{...t,value:e}:t));a(t),i("root","site",void 0,t),c((0,l.__)("info","consistency"),e?sprintf((0,l.__)('"%1$s" Correction is enabled',"consistency"),n):sprintf((0,l.__)('"%1$s" Correction is disabled',"consistency"),n),{isDismissible:!0,type:"snackbar",speak:!0})}}))},A=[{slug:"apostrophe",label:(0,l.__)("Apostrophes","consistency"),description:(0,l.__)("Fixes related to apostrophes.","consistency")},{slug:"quotation",label:(0,l.__)("Quotation marks","consistency"),description:(0,l.__)("Fixes related to quotation marks.","consistency")},{slug:"dash",label:(0,l.__)("Dashes","consistency"),description:(0,l.__)("Fixes related to dashes.","consistency")},{slug:"suffixe",label:(0,l.__)("Suffixes","consistency"),description:(0,l.__)("Fixes related to suffixes.","consistency")},{slug:"space",label:(0,l.__)("Spaces","consistency"),description:(0,l.__)("Fixes related to spaces.","consistency")},{slug:"case",label:(0,l.__)("Case","consistency"),description:(0,l.__)("Fixes related to case.","consistency")},{slug:"ellipsis",label:(0,l.__)("Ellipsis","consistency"),description:(0,l.__)("Fixes related to ellipsis.","consistency")},{slug:"symbol",label:(0,l.__)("Symbols","consistency"),description:(0,l.__)("Fixes related to symbols.","consistency")}],z=()=>(0,t.createElement)(p.Panel,{className:"GlobalSettingPanel"},(0,t.createElement)(p.PanelHeader,null,(0,t.createElement)("strong",null,(0,l.__)("Global correction rules","consistency"),(0,t.createElement)(C,null))),[...A].map(((e,s)=>(0,t.createElement)(p.PanelBody,{key:s,title:(0,l.__)(e.label,"consistency"),initialOpen:!1},[...B].filter((t=>t.category===e.slug)).map(((e,s)=>(0,t.createElement)(q,{key:s,settingSlug:e.slug,settingName:e.name,settingDescription:{__html:e.description}}))))))),{canUser:I}=(0,d.select)("core"),O=()=>{const e=I("create","users");return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.PluginSidebar,{name:"consistency-custom-sidebar",title:(0,l.__)("Consistency","consistency"),icon:y},(0,t.createElement)(f,null),e&&(0,t.createElement)(z,null)),(0,t.createElement)(u.PluginSidebarMoreMenuItem,{target:"consistency-custom-sidebar"},(0,l.__)("Consistency Settings","consistency")))},{getBlock:D,getBlocks:L,getBlockAttributes:G,getSelectionStart:j,isTyping:U}=(0,d.select)("core/block-editor"),{updateBlockAttributes:H,updateBlock:K}=(0,d.dispatch)("core/block-editor"),J=e=>{const{currentBlockId:t,isPreviousFixCanceled:s,setPreviousFixCanceled:n,blocksToBeProcessed:o,cursorOffsetRef:c}=e;if(!(e=>{const{currentBlockId:t,blocksToBeProcessed:s}=e,n=W(t);return!!s.includes(n)})({currentBlockId:t,blocksToBeProcessed:o})||!(e=>{const t=M(e);return!(!t||!t.hasOwnProperty("content")||!_(t.content)&&!k(t.content))})(t))return;let r=Q();const a=D(t);let i=G(t),l=!1;Object.entries(r).forEach((([e,o])=>{if(l)return;if(""!==o.format)return;i.content;let r,u=o.replace,d="",p="",y=0,g=0,m=("object"==typeof i.content&&i.content,"object"==typeof i.content?i.content.text:i.content),h=(e=>e.replace(/<\b(code|pre|kbd)\b>.*?<\/\b(code|pre|kbd)\b>/gi,"").replace(/(<([^>]+)>)/gi,""))(m),f=!1;if(U()||(f=o.mask.test(h)),U()){r=j(),y=r?.offset||document.getSelection()?.anchorOffset||0,g=(e=>{const t=document.querySelector(`#block-${e}`);if(null===t)return;const s=t.querySelector('[contenteditable="true"]')||t,n=document.getSelection(),o=n?.getRangeAt(0);if(!o||!o.collapsed)return;const c=o.cloneRange(),r=document.createTextNode("\0");c.insertNode(r);const a=s.textContent||"";let i=a.indexOf("\0");r.parentNode.removeChild(r),s.normalize();const l=(s?.innerHTML.match(/ /g)||[]).length;return l>0&&(i=a.replace(/ /g," ").indexOf("\0"),i=i-6*l+l),i})(t)||y;const e=h.match(o.mask);if(null===e||0===e.length)return;const s=e[0].length||1;d=h.substring(0,g-s),p=h.substring(g-s,h.length),f=o.mask.test(h)&&o.mask.test(p)}if(!f)return;if((e=>!!T.includes(e.slug))(o)&&(u=((e,t,s)=>{const n=e.replace.charAt(0),o=e.replace.charAt(e.replace.length-1),c=e.replace.substring(1,e.replace.indexOf("$"))||"";let r="";0!==[...e.replace.matchAll(/[0-9]/g)].length&&(r=e.replace.substring([...e.replace.matchAll(/[0-9]/g)].pop().index+1,e.replace.length-1));const a=new RegExp(`${n}`,"g"),i=new RegExp(`${o}`,"g");return(t.match(a)||[]).length===(t.match(i)||[]).length?n+c:r+o})(o,m)),0!==g&&(m=d+p.replace(o.mask,u)),0===g&&(m=m.replace(o.mask,o.replace)),s)return void n(!1);s||""!==o.format||(l=(e=>{const{block:t,currentBlockId:s,blockAttributes:n,blockContent:o}=e;let c;if(k(n.content)){const e=(0,b.create)({...n.content,text:o});c=new b.RichTextData(e)}return _(n.content)&&(c=o),void 0!==c&&(v(s,{...t,attributes:{...n,content:c}}),!0)})({block:a,currentBlockId:t,blockAttributes:i,blockContent:m}));const w="function"==typeof o.nbMoved?o.nbMoved(p):o.nbMoved||0;l&&(c.current=w)}))},{getSelectedBlockClientId:V,isTyping:X,getBlockAttributes:Y}=(0,d.select)("core/block-editor"),Z=window.wp.blocks,ee=()=>((()=>{const{isEditorInIframe:e,isContentPastedRef:t}=(0,c.useContext)(i),s=(0,c.useRef)(!1);(0,c.useEffect)((()=>{if(s.current)return;const n=e=>{t.current=!0},o=e=>(e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}),c=e?document.querySelector('iframe[name="editor-canvas"]'):document.querySelector("#editor");if(!c)return;const r=o(c);return e&&"complete"===c.contentWindow.document.readyState&&o(c),s.current=!0,r}),[e])})(),(()=>{const{isEditorInIframe:e,setPreviousFixCanceled:t}=(0,c.useContext)(i),s=(0,c.useRef)(!1);(0,c.useEffect)((()=>{if(s.current)return;const n=e=>{90===e.keyCode&&(e.ctrlKey||e.metaKey)&&t(!0)},o=e=>(e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n)}),c=e?document.querySelector('iframe[name="editor-canvas"]'):document.querySelector("#editor");if(!c)return;const r=o(c);return e&&"complete"===c.contentWindow.document.readyState&&o(c),s.current=!0,r}),[t])})(),(()=>{const{setBlocksToBeProcessed:e}=(0,c.useContext)(i);(0,c.useEffect)((()=>{let t=(0,Z.getBlockTypes)().filter((e=>e.attributes&&e.attributes.content&&("string"===e.attributes.content.type||"rich-text"===e.attributes.content.type)));const s=["core/html"];t=t.filter((e=>!s.includes(e.name))),console.log("Consistency - Blocks that can be processed:",t),e(t.map((e=>e.name)))}),[])})(),(()=>{const{isPreviousFixCanceled:e,setPreviousFixCanceled:t,previousFixCanceledContent:s,setPreviousFixCanceledContent:n,blocksToBeProcessed:o,cursorOffsetRef:r,isContentPastedRef:a}=(0,c.useContext)(i);r.current=r.current||0,a.current=a.current||!1,(0,c.useEffect)((()=>{const c=(0,d.subscribe)((()=>{const{onTheFly:c,onPaste:i}=(()=>{const e={onTheFly:!1,onPaste:!1},t=(0,d.select)(g.store).getCurrentUser(),s=w("root","user",t?.id||0,"consistency_plugin_user_settings"),n=s?.meta?.consistency_plugin_user_settings;return e.onTheFly=n?.find((e=>"on_the_fly"===e.slug))?.value||!1,e.onPaste=n?.find((e=>"on_paste"===e.slug))?.value||!1,e})();if(!c&&!i)return;if(void 0===R())return;if(i&&!0===a.current)return a.current=!1,void(e=>{const{isPreviousFixCanceled:t,setPreviousFixCanceled:s,blocksToBeProcessed:n,cursorOffsetRef:o}=e;let c=Q();const r=L(),a=r.flatMap((({innerBlocks:e,...t})=>e.map((e=>({...t,...e}))))),i=r.reduce(((e,t)=>{let s=t.attributes?.content;return n.includes(t.name)&&void 0!==s?(Object.entries(c).forEach((([e,t])=>{if(T.includes(t.slug)){const e=t.mask.toString().match(/(?<=\/).+?(?=\/)/g)[0],n=new RegExp(`(?<!=)${e}(?!>)([^${e}]*)(?<!=)${e}(?!>)`,"g");s=s.replaceAll(n,t.replace)}if(!T.includes(t.slug)){const e=t.mask.toString(),n=new RegExp(e.substring(1,e.length-1),"g");s=s.replaceAll(n,t.replace)}})),void 0!==s&&(e[t.clientId]={content:s}),e):e}),{});Object.keys(i).length>0&&H(Object.keys(i),i,!0),a.forEach((e=>{if(!n.includes(e.name))return;const c=e.clientId;e?.clientId&&J({currentBlockId:c,isPreviousFixCanceled:t,setPreviousFixCanceled:s,blocksToBeProcessed:n,cursorOffsetRef:o})}))})({isPreviousFixCanceled:e,setPreviousFixCanceled:t,blocksToBeProcessed:o,cursorOffsetRef:r});const l=V();if(null===l||!c)return;const u=Y(l);u&&(u.hasOwnProperty("content")&&s===u.content||(n(u.content),X()&&J({currentBlockId:l,isPreviousFixCanceled:e,setPreviousFixCanceled:t,blocksToBeProcessed:o,cursorOffsetRef:r})))}));return()=>{c(),(e=>{const t=window.getSelection(),s=F();if(!t)return;let n;if(null===t.anchorNode){if(null===s||null===s?.clientId)return;return n=s?.offset||0,void P(s.clientId,s.attributeKey,n+e,n+e)}1===t?.anchorNode?.nodeType&&(n=t.anchorNode?.firstChild?.length||0),3===t?.anchorNode?.nodeType&&(n=t.anchorOffset||0);const o=e>=0?n+e:n;if(1!==t?.anchorNode?.nodeType)if(3!==t?.anchorNode?.nodeType);else{const e=t.anchorNode;t.collapse(e,o)}else{const e=t.anchorNode?.firstChild||t.anchorNode?.childNodes[0];t.collapse(e,o)}})(r.current),r.current=0}}),[e,t,s,n,o,r,a])})(),(0,t.createElement)(O,null)),te=()=>(0,t.createElement)(a,null,(0,t.createElement)(ee,null));o()((()=>{(0,s.registerPlugin)("consistency-custom-sidebar",{render:te})}))})();1 (()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,s=window.wp.plugins,n=window.wp.domReady;var o=e.n(n);const c=window.wp.element,r=(0,c.createContext)(),a=({children:e})=>{const[s]=(0,c.useState)(null!==document.querySelector('iframe[name="editor-canvas"]')),[n,o]=(0,c.useState)(!1),[a,i]=(0,c.useState)(""),[l,u]=(0,c.useState)([]),p=(0,c.useRef)(0),d=(0,c.useRef)(!1);return(0,t.createElement)(r.Provider,{value:{isEditorInIframe:s,isPreviousFixCanceled:n,setPreviousFixCanceled:o,previousFixCanceledContent:a,setPreviousFixCanceledContent:i,blocksToBeProcessed:l,setBlocksToBeProcessed:u,cursorOffsetRef:p,isContentPastedRef:d}},e)},i=r,l=window.wp.i18n,u=window.wp.editor,p=window.wp.data,d=window.wp.components,y=()=>(0,t.createElement)(d.Icon,{icon:(0,t.createElement)("svg",{version:"1.1",id:"consistency-plugin",x:"0px",y:"0px",width:"24px",height:"24px",viewBox:"0 0 24 24",enableBackground:"new 0 0 24 24"},(0,t.createElement)("line",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",x1:"4",y1:"20",x2:"7",y2:"20"}),(0,t.createElement)("line",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",x1:"14",y1:"20",x2:"21",y2:"20"}),(0,t.createElement)("line",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),(0,t.createElement)("line",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),(0,t.createElement)("polyline",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",points:"5,20 11,4 13,4 20,20 "}))}),g=window.wp.coreData,m=window.wp.notices,h=e=>{const{settingSlug:s,settingName:n,settingDescription:o}=e,{currentUser:c}=(0,p.useSelect)((e=>({currentUser:e(g.store).getCurrentUser()})),[]),r=c&&c.id,[a,i]=(0,g.useEntityProp)("root","user","meta",r),{saveEditedEntityRecord:u}=(0,p.useDispatch)(g.store),{createNotice:y}=(0,p.useDispatch)(m.store);return(0,t.createElement)(d.ToggleControl,{label:n,help:(0,t.createElement)("span",{dangerouslySetInnerHTML:o}),checked:a?.consistency_plugin_user_settings?.find((e=>e.slug===s))?.value||!1,onChange:e=>{let t=a?.consistency_plugin_user_settings.map((t=>s===t.slug?{...t,value:e}:t));t?.find((e=>e.slug===s))||t.push({slug:s,value:e}),i({...a,consistency_plugin_user_settings:t}),u("root","user",r,{...a,meta:t}),y((0,l.__)("info","consistency"),e?(0,l.sprintf)((0,l.__)('"%1$s" Correction is enabled',"consistency"),n):(0,l.sprintf)((0,l.__)('"%1$s" Correction is disabled',"consistency"),n),{isDismissible:!0,type:"snackbar",speak:!0})}})},f=()=>(0,t.createElement)(d.Panel,{className:"UserSettingPanel"},(0,t.createElement)(d.PanelHeader,null,(0,t.createElement)("strong",null,(0,l.__)("Settings for my account","consistency")),(0,t.createElement)("br",null)),(0,t.createElement)("div",{style:{padding:16}},(0,t.createElement)(d.PanelRow,null,(0,t.createElement)(h,{settingSlug:"on_the_fly",settingName:(0,l.__)("On-the-fly autocorrect","consistency"),settingDescription:{__html:(0,l.__)("Enable/disable on-the-fly autocorrect","consistency")}})),(0,t.createElement)(d.PanelRow,null,(0,t.createElement)(h,{settingSlug:"on_paste",settingName:(0,l.__)("On paste autocorrect","consistency"),settingDescription:{__html:(0,l.__)("Enable/disable autocorrect on paste","consistency")}})))),b=window.wp.richText,_=e=>"string"==typeof e||e instanceof String,k=e=>"object"==typeof e&&e instanceof b.RichTextData,{getEntityRecord:w}=(0,p.select)("core"),{updateBlock:v}=(0,p.dispatch)("core/block-editor"),S=()=>{const e=w("root","site");return e?.consistency_plugin_localization_management||!0},x=()=>{const e=w("root","site");return e?.language||"en_US"},C=()=>{const e=x(),s=S()?(0,l.__)(` (${e} locale)`,"consistency"):(0,l.__)(" (all locales)","consistency");return(0,t.createElement)("span",{style:{fontWeight:"normal",fontStyle:"italic",fontSize:"smaller"}},s)},T=["regularToCurlyQuotes","regularToFrenchQuotes","regularToFrenchQuotesWithoutSpaces","regularToGermanQuotes","regularToGermanBookStyleQuotes"],E=[{slug:"quote",incompatibleWith:[]},{slug:"2hyphens",incompatibleWith:[]},{slug:"3hyphens",incompatibleWith:[]},{slug:"4hyphens",incompatibleWith:[]},{slug:"ordinalNumberSuffix",incompatibleWith:[]},{slug:"regularToCurlyQuotes",incompatibleWith:["regularToGermanQuotes","regularToGermanBookStyleQuotes","regularToFrenchQuotes","regularToFrenchQuotesWithoutSpaces"]},{slug:"regularToGermanQuotes",incompatibleWith:["regularToCurlyQuotes","regularToGermanBookStyleQuotes","regularToFrenchQuotes","regularToFrenchQuotesWithoutSpaces"]},{slug:"regularToGermanBookStyleQuotes",incompatibleWith:["regularToCurlyQuotes","regularToGermanQuotes","regularToFrenchQuotes","regularToFrenchQuotesWithoutSpaces"]},{slug:"regularToFrenchQuotes",incompatibleWith:["regularToCurlyQuotes","regularToGermanQuotes","regularToGermanBookStyleQuotes","regularToFrenchQuotesWithoutSpaces"]},{slug:"regularToFrenchQuotesWithoutSpaces",incompatibleWith:["regularToCurlyQuotes","regularToGermanQuotes","regularToGermanBookStyleQuotes","regularToFrenchQuotes"]},{slug:"curlyToFrenchQuotes",incompatibleWith:["regularToCurlyQuotes"]},{slug:"breakingSpace",incompatibleWith:["spaceBefore"]},{slug:"noSpaceBefore",incompatibleWith:["spaceBefore"]},{slug:"spaceBefore",incompatibleWith:["breakingSpace","noSpaceBefore"]},{slug:"noBreakingSpaceAfter",incompatibleWith:[]},{slug:"noNonBreakingSpaceAfter",incompatibleWith:[]},{slug:"capitalizeFirstSentenceLetter",incompatibleWith:[]},{slug:"etcThreeDots",incompatibleWith:[]},{slug:"etcTwoDots",incompatibleWith:[]},{slug:"etcEllipsis",incompatibleWith:[]},{slug:"ellipsis",incompatibleWith:[]},{slug:"symbolInACircle",incompatibleWith:[]},{slug:"symbolInSmallCapsAndSuperscriptStyle",incompatibleWith:[]},{slug:"fractions",incompatibleWith:[]},{slug:"percentages",incompatibleWith:[]}],B=[{slug:"quote",name:(0,l.__)("Straight Apostrophe","consistency"),description:(0,l.__)("Replace straight apostrophes with curly apostrophes:","consistency")+"<span aria-hidden='true' style='display:block;'><code>'</code> <span style='font-size:20px'>→</span> <code>’</code></span>",mask:/\'/,replace:"’",format:"",nbMoved:0,category:"apostrophe"},{slug:"2hyphens",name:(0,l.__)("En Dash","consistency"),description:(0,l.__)("Replace two hyphens with an en dash:","consistency")+"<span aria-hidden='true' style='display:block;'><code>--</code> <span style='font-size:20px'>→</span> <code style=\"font-family:sans-serif;\">–</code></span>",mask:/(?:\-)\-/,replace:"–",format:"",nbMoved:-1,category:"dash"},{slug:"3hyphens",name:(0,l.__)("Em Dash","consistency"),description:(0,l.__)("Replace three hyphens with an em dash:","consistency")+"<span aria-hidden='true' style='display:block;'><code>---</code> <span style='font-size:20px'>→</span> <code style=\"font-family:sans-serif;\">—</code></span>",mask:/(?:–|\-\-)\-/,replace:"—",format:"",nbMoved:e=>-(e.length-1),category:"dash"},{slug:"4hyphens",name:(0,l.__)("Two-Em Dash","consistency"),description:(0,l.__)("Replace four hyphens with two-em dash:","consistency")+"<span aria-hidden='true' style='display:block;'><code>----</code> <span style='font-size:20px'>→</span> <code style=\"font-family:sans-serif;\">⸺</code></span>",mask:/(?:—|–\-|\-\-\-)\-/,replace:"⸺",format:"",nbMoved:e=>-(e.length-1),category:"dash"},{slug:"ordinalNumberSuffix",name:(0,l.__)("Ordinal Number Suffix","consistency"),description:(0,l.__)("Add the sup HTML tag to ordinal number suffixes","consistency")+"<span aria-hidden='true' style='display:block;'><code>1st</code> <span style='font-size:20px'>→</span> <code>1<sup>st</sup></code></span>",mask:/([10-9]{1,20})(th|nd|rd|e|er|res|d|ds|de|des)( | |\.|\,|\;)/,replace:"$1$2$3",format:"superscript",nbMoved:0,category:"suffixe"},{slug:"regularToCurlyQuotes",name:(0,l.__)("Curly Quotes","consistency"),description:(0,l.__)("Replace straight quotes with curly quotes:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>“ ”</code></span>",mask:/"/,replace:"“$1”",format:"",nbMoved:0,category:"quotation"},{slug:"regularToGermanQuotes",name:(0,l.__)("German Quotes","consistency"),description:(0,l.__)("Replace straight quotes with german quotes:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>„ “</code></span>",mask:/"/,replace:"„$1“",format:"",nbMoved:0,category:"quotation"},{slug:"regularToGermanBookStyleQuotes",name:(0,l.__)("German Book-Style Quotes","consistency"),description:(0,l.__)("Replace straight quotes with german book-style quotes:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>» «</code></span>",mask:/"/,replace:"»$1«",format:"",nbMoved:0,category:"quotation"},{slug:"regularToFrenchQuotes",name:(0,l.__)("French Quotes with Spaces","consistency"),description:(0,l.__)("Replace straight quotes with french quotes with non-breaking spaces:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>« »</code></span>",mask:/"/,replace:"« $1 »",format:"",nbMoved:1,category:"quotation"},{slug:"regularToFrenchQuotesWithoutSpaces",name:(0,l.__)("French Quotes","consistency"),description:(0,l.__)("Replace straight quotes with french quotes without spaces:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>« »</code></span>",mask:/"/,replace:"«$1»",format:"",nbMoved:0,category:"quotation"},{slug:"curlyToFrenchQuotes",name:(0,l.__)("Curly Quotes to French Quotes","consistency"),description:(0,l.__)("Replace curly quotes with french quotes with non-breaking spaces:","consistency")+"<span aria-hidden='true' style='display:block;'><code>“ ”</code> <span style='font-size:20px'>→</span> <code>« »</code></span>",mask:/“.*?”/,replace:e=>`« ${e.substring(1,e.length-1)} »`,format:"",nbMoved:0,category:"quotation"},{slug:"breakingSpace",name:(0,l.__)("Breaking Spaces","consistency"),description:(0,l.sprintf)((0,l.__)("Replace a breaking space followed by a character from this list:%1$s with a non-breaking space","consistency"),"<br /><code>? ! : ; » € $ £ ¥ ₽ 元 %</code><br />"),mask:/ ([\?|\!|\:|\;|»|€|\$|£|¥|₽|元|\%])/,replace:" $1",format:"",nbMoved:0,category:"space"},{slug:"noSpaceBefore",name:(0,l.__)("No Space Before","consistency"),description:(0,l.sprintf)((0,l.__)("Add a non-breaking space before a character from this list:%1$s having no space before","consistency"),"<br /><code>? ! : ; » € $ £ ¥ ₽ 元 %</code><br />"),mask:/(?<! | | )([\?|\!|\:|»|€|\$|£|¥|₽|元|\%])/,replace:" $1",format:"",nbMoved:1,category:"space"},{slug:"spaceBefore",name:(0,l.__)("Space Before","consistency"),description:(0,l.__)("Remove any space preceding a character from this list:","consistency")+"<span style='display:block;'><code>? ! : ; %</code></span>",mask:/([ | ])(?=[\?|\!|\:|\;|\%])(.)/,replace:"$2",format:"",nbMoved:-1,category:"space"},{slug:"noBreakingSpaceAfter",name:(0,l.__)("No Breaking Space After","consistency"),description:(0,l.sprintf)((0,l.__)("Add a breaking space after a character from this list:%1$s when followed with another character","consistency"),"<br /><code>, … ) ]</code><br />"),mask:/([\,|…|\)|\]])(?! | |\.|\,|\d|$)(.)/,replace:"$1 $2",format:"",nbMoved:1,category:"space"},{slug:"noNonBreakingSpaceAfter",name:(0,l.__)("No Non-Breaking Space After","consistency"),description:(0,l.__)("Add a non-breaking space after open french quote having no space after","consistency"),mask:/(«)(?! | | )/,replace:"$1 ",format:"",nbMoved:0,category:"space"},{slug:"capitalizeFirstSentenceLetter",name:(0,l.__)("First Sentence Letter","consistency"),description:(0,l.__)("Capitalize the first letter of a sentence","consistency"),mask:/(^[a-záàâäãåăçéèêëíìîïñóòôöõúùûüýÿæœșț])|(?<=[\.|\?|\!|…] )[a-záàâäãåăçéèêëíìîïñóòôöõúùûüýÿæœșț]/,replace:e=>e.toUpperCase(),format:"",nbMoved:0,category:"case"},{slug:"etcThreeDots",name:(0,l.__)('Three Dots Following "etc"',"consistency"),description:(0,l.__)('Replace 3 dots placed after the abbreviation "etc" with a period:',"consistency")+"<span aria-hidden='true' style='display:block;'><code>etc...</code> <span style='font-size:20px'>→</span> <code>etc.</code></span>",mask:/etc(\.{3})/i,replace:e=>e.substring(0,3)+".",format:"",nbMoved:-2,category:"ellipsis"},{slug:"etcTwoDots",name:(0,l.__)('Two Dots Following "etc"',"consistency"),description:(0,l.__)('Replace 2 dots placed after the abbreviation "etc" with a period:',"consistency")+"<span aria-hidden='true' style='display:block;'><code>etc..</code> <span style='font-size:20px'>→</span> <code>etc.</code></span>",mask:/etc(\.{2})/i,replace:e=>e.substring(0,2)+".",format:"",nbMoved:-1,category:"ellipsis"},{slug:"etcEllipsis",name:(0,l.__)('Ellipsis Following "etc"',"consistency"),description:(0,l.__)('Replace the ellipsis placed after the abbreviation "etc" with a period:',"consistency")+"<span aria-hidden='true' style='display:block;'><code>etc…</code> <span style='font-size:20px'>→</span> <code>etc.</code></span>",mask:/etc(\.{3}|…)/i,replace:e=>e.substring(0,3)+".",format:"",nbMoved:0,category:"ellipsis"},{slug:"ellipsis",name:(0,l.__)("Ellipsis","consistency"),description:(0,l.__)("Replaces 3 dots with ellipsis:","consistency")+"<span aria-hidden='true' style='display:block;'><code>...</code> <span style='font-size:20px'>→</span> <code>…</code></span>",mask:/\.{3}/,replace:"…",format:"",nbMoved:-2,category:"ellipsis"},{slug:"symbolInACircle",name:(0,l.__)("Symbol in a Circle","consistency"),description:(0,l.__)("Replaces 1 character placed in parentheses with a symbol","consistency")+"<span aria-hidden='true' style='display:block;'><code>(c) (p) (r)</code> <span style='font-size:20px'>→</span> <code>© ℗ ®</code></span>",mask:/(\([c|p|r])(\))/,replace:e=>{switch(e[1]){case"c":return"©";case"p":return"℗";case"r":return"®"}return" "},format:"",nbMoved:-2,category:"symbol"},{slug:"symbolInSmallCapsAndSuperscriptStyle",name:(0,l.__)("Symbol in Small Caps and Superscript Style","consistency"),description:(0,l.__)("Replaces 2-character abbreviations with a symbol in small caps and superscript style","consistency")+"<span aria-hidden='true' style='display:block;'><code>tm sm md mc</code> <span style='font-size:20px'>→</span> <code>™ ℠ 🅫 🅪</code></span>",mask:/(?<= | |\(|\[|\{|:|^)(tm|sm|md|mc)(?= | |\.|\,|\;|\:|\)|\]|\}|$)/,replace:e=>{switch(e){case"tm":return"™";case"sm":return"℠";case"md":return"🅫";case"mc":return"🅪";default:return" "}},format:"",nbMoved:-1,category:"symbol"},{slug:"fractions",name:(0,l.__)("Fractions","consistency"),description:(0,l.__)("Replaces fractions with fraction symbols:","consistency")+"<span aria-hidden='true' style='display:block;'><code>1/2 3/5 1/9</code> <span style='font-size:20px'>→</span> <code>½ ⅗ ⅑</code></span>",mask:/[1-9]\/[1-9]/,replace:e=>{switch(e){case"1/4":return"¼";case"1/2":return"½";case"3/4":return"¾";case"1/3":return"⅓";case"2/3":return"⅔";case"1/5":return"⅕";case"2/5":return"⅖";case"3/5":return"⅗";case"4/5":return"⅘";case"1/6":return"⅙";case"5/6":return"⅚";case"1/8":return"⅛";case"3/8":return"⅜";case"5/8":return"⅝";case"7/8":return"⅞";case"1/7":return"⅐";case"1/9":return"⅑";default:return" "}},format:"",nbMoved:-2,category:"symbol"},{slug:"percentages",name:(0,l.__)("Percentages","consistency"),description:(0,l.__)("Replaces percentages with percentages symbols:","consistency")+"<span aria-hidden='true' style='display:block;'><code>0/0 0/00 0/000</code> <span style='font-size:20px'>→</span> <code>% ‰ ‱</code></span>",mask:/(0\/0|0\/00|0\/000)(?= | |\.|\,|\;|\:|\)|\]|\})(.)/,replace:e=>{const t=e.substring(0,e.length-1),s=e.substring(e.length-1,e.length);switch(t){case"0/0":return"%"+s;case"0/00":return"‰"+s;case"0/000":return"‱"+s;default:return" "+s}},format:"",nbMoved:e=>-(e.substring(0,e.length-1).length-1),category:"symbol"}],{getSelectionStart:P}=(0,p.select)("core/block-editor"),{selectionChange:F}=(0,p.dispatch)("core/block-editor"),R=()=>{const e=(()=>{const e=w("root","site");return e?.consistency_plugin_settings||[]})();return S()?e.filter((e=>$(e.slug))):e},Q=()=>B.filter((e=>!0===R()?.find((t=>t.slug===e.slug))?.value)),{getBlockName:W,getBlockAttributes:M}=(0,p.select)("core/block-editor"),$=e=>{const t=x();return!(void 0===localesByRules||!localesByRules.hasOwnProperty(e))&&localesByRules[e].includes(t)},N=e=>{const t=E.find((t=>t.slug===e));return!!t&&t.incompatibleWith.some((e=>R()?.find((t=>t.slug===e))?.value))},q=e=>{const{settingSlug:s,settingName:n,settingDescription:o}=e,{createNotice:c}=(0,p.useDispatch)(m.store);if(S()&&!$(s))return"";const[r,a]=(0,g.useEntityProp)("root","site","consistency_plugin_settings",void 0),{saveEditedEntityRecord:i}=(0,p.useDispatch)(g.store);return(0,t.createElement)(d.PanelRow,null,(0,t.createElement)(d.ToggleControl,{label:n,help:(0,t.createElement)("span",{dangerouslySetInnerHTML:o}),checked:r?.find((e=>e.slug===s))?.value||!1,disabled:N(s),onChange:e=>{let t=r.map((t=>s===t.slug?{...t,value:e}:t));a(t),i("root","site",void 0,t),c((0,l.__)("info","consistency"),e?(0,l.sprintf)((0,l.__)('"%1$s" Correction is enabled',"consistency"),n):(0,l.sprintf)((0,l.__)('"%1$s" Correction is disabled',"consistency"),n),{isDismissible:!0,type:"snackbar",speak:!0})}}))},A=[{slug:"apostrophe",label:(0,l.__)("Apostrophes","consistency"),description:(0,l.__)("Fixes related to apostrophes.","consistency")},{slug:"quotation",label:(0,l.__)("Quotation marks","consistency"),description:(0,l.__)("Fixes related to quotation marks.","consistency")},{slug:"dash",label:(0,l.__)("Dashes","consistency"),description:(0,l.__)("Fixes related to dashes.","consistency")},{slug:"suffixe",label:(0,l.__)("Suffixes","consistency"),description:(0,l.__)("Fixes related to suffixes.","consistency")},{slug:"space",label:(0,l.__)("Spaces","consistency"),description:(0,l.__)("Fixes related to spaces.","consistency")},{slug:"case",label:(0,l.__)("Case","consistency"),description:(0,l.__)("Fixes related to case.","consistency")},{slug:"ellipsis",label:(0,l.__)("Ellipsis","consistency"),description:(0,l.__)("Fixes related to ellipsis.","consistency")},{slug:"symbol",label:(0,l.__)("Symbols","consistency"),description:(0,l.__)("Fixes related to symbols.","consistency")}],z=()=>(0,t.createElement)(d.Panel,{className:"GlobalSettingPanel"},(0,t.createElement)(d.PanelHeader,null,(0,t.createElement)("strong",null,(0,l.__)("Global correction rules","consistency"),(0,t.createElement)(C,null))),[...A].map(((e,s)=>(0,t.createElement)(d.PanelBody,{key:s,title:(0,l.__)(e.label,"consistency"),initialOpen:!1},[...B].filter((t=>t.category===e.slug)).map(((e,s)=>(0,t.createElement)(q,{key:s,settingSlug:e.slug,settingName:e.name,settingDescription:{__html:e.description}}))))))),{canUser:I}=(0,p.select)("core"),O=()=>{const e=I("create","users");return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.PluginSidebar,{name:"consistency-custom-sidebar",title:(0,l.__)("Consistency","consistency"),icon:y},(0,t.createElement)(f,null),e&&(0,t.createElement)(z,null)),(0,t.createElement)(u.PluginSidebarMoreMenuItem,{target:"consistency-custom-sidebar"},(0,l.__)("Consistency Settings","consistency")))},{getBlock:D,getBlocks:L,getBlockAttributes:G,getSelectionStart:j,isTyping:U}=(0,p.select)("core/block-editor"),{updateBlockAttributes:H,updateBlock:K}=(0,p.dispatch)("core/block-editor"),V=e=>{const{currentBlockId:t,isPreviousFixCanceled:s,setPreviousFixCanceled:n,blocksToBeProcessed:o,cursorOffsetRef:c}=e;if(!(e=>{const{currentBlockId:t,blocksToBeProcessed:s}=e,n=W(t);return!!s.includes(n)})({currentBlockId:t,blocksToBeProcessed:o})||!(e=>{const t=M(e);return!(!t||!t.hasOwnProperty("content")||!_(t.content)&&!k(t.content))})(t))return;let r=Q();const a=D(t);let i=G(t),l=!1;Object.entries(r).forEach((([e,o])=>{if(l)return;if(""!==o.format)return;i.content;let r,u=o.replace,p="",d="",y=0,g=0,m=("object"==typeof i.content&&i.content,"object"==typeof i.content?i.content.text:i.content),h=(e=>e.replace(/<\b(code|pre|kbd)\b>.*?<\/\b(code|pre|kbd)\b>/gi,"").replace(/(<([^>]+)>)/gi,""))(m),f=!1;if(U()||(f=o.mask.test(h)),U()){r=j(),y=r?.offset||document.getSelection()?.anchorOffset||0,g=(e=>{const t=document.querySelector(`#block-${e}`);if(null===t)return;const s=t.querySelector('[contenteditable="true"]')||t,n=document.getSelection(),o=n?.getRangeAt(0);if(!o||!o.collapsed)return;const c=o.cloneRange(),r=document.createTextNode("\0");c.insertNode(r);const a=s.textContent||"";let i=a.indexOf("\0");r.parentNode.removeChild(r),s.normalize();const l=(s?.innerHTML.match(/ /g)||[]).length;return l>0&&(i=a.replace(/ /g," ").indexOf("\0"),i=i-6*l+l),i})(t)||y;const e=h.match(o.mask);if(null===e||0===e.length)return;const s=e[0].length||1;p=h.substring(0,g-s),d=h.substring(g-s,h.length),f=o.mask.test(h)&&o.mask.test(d)}if(!f)return;if((e=>!!T.includes(e.slug))(o)&&(u=((e,t,s)=>{const n=e.replace.charAt(0),o=e.replace.charAt(e.replace.length-1),c=e.replace.substring(1,e.replace.indexOf("$"))||"";let r="";0!==[...e.replace.matchAll(/[0-9]/g)].length&&(r=e.replace.substring([...e.replace.matchAll(/[0-9]/g)].pop().index+1,e.replace.length-1));const a=new RegExp(`${n}`,"g"),i=new RegExp(`${o}`,"g");return(t.match(a)||[]).length===(t.match(i)||[]).length?n+c:r+o})(o,m)),0!==g){const e=J({firstPart:p,lastPart:d,mask:o.mask,replaceValue:u});if(null===e)return;m=e}if(0===g&&(m=m.replace(o.mask,o.replace)),s)return void n(!1);s||""!==o.format||(l=(e=>{const{block:t,currentBlockId:s,blockAttributes:n,blockContent:o}=e;let c;if(k(n.content)){const e=(0,b.create)({...n.content,text:o});c=new b.RichTextData(e)}return _(n.content)&&(c=o),void 0!==c&&(v(s,{...t,attributes:{...n,content:c}}),!0)})({block:a,currentBlockId:t,blockAttributes:i,blockContent:m}));const w="function"==typeof o.nbMoved?o.nbMoved(d):o.nbMoved||0;l&&(c.current=w)}))},J=({firstPart:e,lastPart:t,mask:s,replaceValue:n})=>{if("string"!=typeof t)return null;let o=!1;const c=t.replace(s,((...e)=>{o=!0;const t=e[0];if("function"==typeof n)return n(...e);const c=new RegExp(s.source,s.flags);return t.replace(c,n)}));return o?e+c:null},{getSelectedBlockClientId:X,isTyping:Y,getBlockAttributes:Z}=(0,p.select)("core/block-editor"),ee=window.wp.blocks,te=()=>((()=>{const{isEditorInIframe:e,isContentPastedRef:t}=(0,c.useContext)(i),s=(0,c.useRef)(!1);(0,c.useEffect)((()=>{if(s.current)return;const n=e=>{t.current=!0},o=e=>(e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}),c=e?document.querySelector('iframe[name="editor-canvas"]'):document.querySelector("#editor");if(!c)return;const r=o(c);return e&&"complete"===c.contentWindow.document.readyState&&o(c),s.current=!0,r}),[e])})(),(()=>{const{isEditorInIframe:e,setPreviousFixCanceled:t}=(0,c.useContext)(i),s=(0,c.useRef)(!1);(0,c.useEffect)((()=>{if(s.current)return;const n=e=>{90===e.keyCode&&(e.ctrlKey||e.metaKey)&&t(!0)},o=e=>(e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n)}),c=e?document.querySelector('iframe[name="editor-canvas"]'):document.querySelector("#editor");if(!c)return;const r=o(c);return e&&"complete"===c.contentWindow.document.readyState&&o(c),s.current=!0,r}),[t])})(),(()=>{const{setBlocksToBeProcessed:e}=(0,c.useContext)(i);(0,c.useEffect)((()=>{let t=(0,ee.getBlockTypes)().filter((e=>e.attributes&&e.attributes.content&&("string"===e.attributes.content.type||"rich-text"===e.attributes.content.type)));const s=["core/html"];t=t.filter((e=>!s.includes(e.name))),console.log("Consistency - Blocks that can be processed:",t),e(t.map((e=>e.name)))}),[])})(),(()=>{const{isPreviousFixCanceled:e,setPreviousFixCanceled:t,previousFixCanceledContent:s,setPreviousFixCanceledContent:n,blocksToBeProcessed:o,cursorOffsetRef:r,isContentPastedRef:a}=(0,c.useContext)(i);r.current=r.current||0,a.current=a.current||!1,(0,c.useEffect)((()=>{const c=(0,p.subscribe)((()=>{const{onTheFly:c,onPaste:i}=(()=>{const e={onTheFly:!1,onPaste:!1},t=(0,p.select)(g.store).getCurrentUser(),s=w("root","user",t?.id||0,"consistency_plugin_user_settings"),n=s?.meta?.consistency_plugin_user_settings;return e.onTheFly=n?.find((e=>"on_the_fly"===e.slug))?.value||!1,e.onPaste=n?.find((e=>"on_paste"===e.slug))?.value||!1,e})();if(!c&&!i)return;if(void 0===R())return;if(i&&!0===a.current)return a.current=!1,void(e=>{const{isPreviousFixCanceled:t,setPreviousFixCanceled:s,blocksToBeProcessed:n,cursorOffsetRef:o}=e;let c=Q();const r=L(),a=r.flatMap((({innerBlocks:e,...t})=>e.map((e=>({...t,...e}))))),i=r.reduce(((e,t)=>{let s=t.attributes?.content;return n.includes(t.name)&&void 0!==s?(Object.entries(c).forEach((([e,t])=>{if(T.includes(t.slug)){const e=t.mask.toString().match(/(?<=\/).+?(?=\/)/g)[0],n=new RegExp(`(?<!=)${e}(?!>)([^${e}]*)(?<!=)${e}(?!>)`,"g");s=s.replaceAll(n,t.replace)}if(!T.includes(t.slug)){const e=t.mask.toString(),n=new RegExp(e.substring(1,e.length-1),"g");s=s.replaceAll(n,t.replace)}})),void 0!==s&&(e[t.clientId]={content:s}),e):e}),{});Object.keys(i).length>0&&H(Object.keys(i),i,!0),a.forEach((e=>{if(!n.includes(e.name))return;const c=e.clientId;e?.clientId&&V({currentBlockId:c,isPreviousFixCanceled:t,setPreviousFixCanceled:s,blocksToBeProcessed:n,cursorOffsetRef:o})}))})({isPreviousFixCanceled:e,setPreviousFixCanceled:t,blocksToBeProcessed:o,cursorOffsetRef:r});const l=X();if(null===l||!c)return;const u=Z(l);u&&(u.hasOwnProperty("content")&&s===u.content||(n(u.content),Y()&&V({currentBlockId:l,isPreviousFixCanceled:e,setPreviousFixCanceled:t,blocksToBeProcessed:o,cursorOffsetRef:r})))}));return()=>{c(),(e=>{const t=window.getSelection(),s=P();if(!t)return;let n;if(null===t.anchorNode){if(null===s||null===s?.clientId)return;return n=s?.offset||0,void F(s.clientId,s.attributeKey,n+e,n+e)}1===t?.anchorNode?.nodeType&&(n=t.anchorNode?.firstChild?.length||0),3===t?.anchorNode?.nodeType&&(n=t.anchorOffset||0);const o=e>=0?n+e:n;if(1!==t?.anchorNode?.nodeType)if(3!==t?.anchorNode?.nodeType);else{const e=t.anchorNode;t.collapse(e,o)}else{const e=t.anchorNode?.firstChild||t.anchorNode?.childNodes[0];t.collapse(e,o)}})(r.current),r.current=0}}),[e,t,s,n,o,r,a])})(),(0,t.createElement)(O,null)),se=()=>(0,t.createElement)(a,null,(0,t.createElement)(te,null));o()((()=>{(0,s.registerPlugin)("consistency-custom-sidebar",{render:se})}))})(); -
consistency/tags/1.8.4/changelog.txt
r3277079 r3405619 148 148 149 149 * Plugin initial commit. Let's write =^.^= 150 -
consistency/tags/1.8.4/composer.json
r3122806 r3405619 16 16 ], 17 17 "require": { 18 "php": ">= 7.4"18 "php": ">=8.1" 19 19 }, 20 20 "require-dev": { -
consistency/tags/1.8.4/composer.lock
r3122806 r3405619 5 5 "This file is @generated automatically" 6 6 ], 7 "content-hash": " f8f5c68ad13fdf708cf8fd467ec9001b",7 "content-hash": "74009a08b7da1b6f32e03d75c9109217", 8 8 "packages": [], 9 9 "packages-dev": [ … … 1035 1035 "prefer-lowest": false, 1036 1036 "platform": { 1037 "php": ">= 7.4"1037 "php": ">=8.1" 1038 1038 }, 1039 "platform-dev": [],1040 "plugin-api-version": "2. 3.0"1039 "platform-dev": {}, 1040 "plugin-api-version": "2.6.0" 1041 1041 } -
consistency/tags/1.8.4/consistency.php
r3277079 r3405619 4 4 * Plugin URI: https://www.webaxones.com 5 5 * Description: Fixes typographic and punctuation consistency 6 * Version: 1.8. 36 * Version: 1.8.4 7 7 * Requires at least: 6.1 8 8 * Requires PHP: 7.4 -
consistency/tags/1.8.4/includes/MetaData/MetaData.php
r3145550 r3405619 136 136 public function update(): void 137 137 { 138 $difference = $this->getDifferenceBetweenTwoObjectArray( (array) $this->currentValue, (array) $this->value ); 139 140 if ( empty( $difference ) ) { 138 if ( ! is_array( $this->value ) ) { 139 update_metadata( $this->object->getType(), $this->object->getId(), $this->metaKey, $this->value, '' ); 141 140 return; 142 141 } 143 142 144 update_metadata( $this->object->getType(), $this->object->getId(), $this->metaKey, $difference, '' ); 143 if ( null === $this->currentValue ) { 144 $this->fetchAndSetCurrentValue(); 145 } 146 147 if ( ! is_array( $this->currentValue ) ) { 148 update_metadata( $this->object->getType(), $this->object->getId(), $this->metaKey, $this->value, '' ); 149 return; 150 } 151 152 // Keep user overrides while aligning with the latest schema. 153 $normalizedValues = $this->synchronizeObjectArraysBySlug( 154 (array) $this->currentValue, 155 (array) $this->value 156 ); 157 158 if ( $normalizedValues === $this->currentValue ) { 159 return; 160 } 161 162 update_metadata( $this->object->getType(), $this->object->getId(), $this->metaKey, $normalizedValues, '' ); 145 163 } 146 164 } -
consistency/tags/1.8.4/includes/Option/Option.php
r3130518 r3405619 62 62 public function add(): void 63 63 { 64 if ( null !== $this->get() ) { 65 $this->update( $this->optionName, $this->get(), $this->value ); 64 $currentValue = $this->get(); 65 66 if ( null === $currentValue ) { 67 add_option( $this->optionName, $this->value ); 68 return; 66 69 } 67 70 68 if ( null === $this->get() ) { 69 add_option( $this->optionName, $this->value ); 70 } 71 $this->update(); 71 72 } 72 73 … … 89 90 } 90 91 91 $ difference = $this->getDifferenceBetweenTwoObjectArray( (array) $this->get(), (array) $this->value);92 $currentValue = $this->get(); 92 93 93 if ( empty( $difference ) ) { 94 if ( ! is_array( $currentValue ) ) { 95 update_option( $this->optionName, $this->value ); 94 96 return; 95 97 } 96 98 97 update_option( $this->optionName, $difference ); 99 // Keep user overrides while aligning with the latest schema. 100 $normalizedValues = $this->synchronizeObjectArraysBySlug( 101 (array) $currentValue, 102 (array) $this->value 103 ); 104 105 if ( $normalizedValues === $currentValue ) { 106 return; 107 } 108 109 update_option( $this->optionName, $normalizedValues ); 98 110 } 99 111 } -
consistency/tags/1.8.4/includes/Utils/Concerns/ObjectArrayTrait.php
r3145550 r3405619 8 8 { 9 9 /** 10 * Get difference between 2 object arrays with same schema: slug - value10 * Synchronize two slug-indexed object arrays to keep user values across schema changes. 11 11 * 12 * @return string 12 * @param array $storedValue Current value stored in database. 13 * @param array $referenceValue Reference shape that contains the latest schema. 14 * 15 * @return array Normalized array ready to be persisted. 13 16 */ 14 p ublic function getDifferenceBetweenTwoObjectArray( array $array1, array $array2): array17 protected function synchronizeObjectArraysBySlug( array $storedValue, array $referenceValue ): array 15 18 { 16 if ( empty( $ array1) ) {17 return $ array2;19 if ( empty( $referenceValue ) ) { 20 return $storedValue; 18 21 } 19 if ( empty( $array2 ) ) { 22 23 if ( empty( $storedValue ) ) { 24 return $referenceValue; 25 } 26 27 $storedBySlug = $this->indexObjectArrayBySlug( $storedValue ); 28 $normalized = []; 29 30 foreach ( $referenceValue as $referenceEntry ) { 31 $slug = $referenceEntry['slug'] ?? ''; 32 33 if ( '' === $slug ) { 34 continue; 35 } 36 37 $existingEntry = $storedBySlug[ $slug ] ?? []; 38 $normalized[] = $this->mergeObjectArrayEntry( $referenceEntry, $existingEntry ); 39 unset( $storedBySlug[ $slug ] ); 40 } 41 42 if ( empty( $storedBySlug ) ) { 43 return $normalized; 44 } 45 46 // Keep custom slugs added via filters even if the core schema dropped them. 47 foreach ( $storedBySlug as $remainingEntry ) { 48 if ( empty( $remainingEntry['slug'] ) ) { 49 continue; 50 } 51 52 $normalized[] = $remainingEntry; 53 } 54 55 return $normalized; 56 } 57 58 /** 59 * Build an associative array keyed by slug for faster lookups. 60 * 61 * @param array $objects Objects that contain a slug key. 62 * 63 * @return array 64 */ 65 protected function indexObjectArrayBySlug( array $objects ): array 66 { 67 if ( empty( $objects ) ) { 20 68 return []; 21 69 } 22 return array_udiff( 23 $array1, 24 $array2, 25 function ( $a, $b ) { 26 return strcmp( $a['slug'], $b['slug'] ); 70 71 $indexed = []; 72 73 foreach ( $objects as $object ) { 74 $slug = $object['slug'] ?? ''; 75 76 if ( '' === $slug ) { 77 continue; 27 78 } 28 ); 79 80 $indexed[ $slug ] = $object; 81 } 82 83 return $indexed; 84 } 85 86 /** 87 * Merge one reference entry with the stored entry while preserving user choices. 88 * 89 * @param array $referenceEntry Entry that represents the latest schema. 90 * @param array $storedEntry Entry saved in the database, can be empty. 91 * 92 * @return array 93 */ 94 protected function mergeObjectArrayEntry( array $referenceEntry, array $storedEntry ): array 95 { 96 if ( empty( $storedEntry ) ) { 97 return $referenceEntry; 98 } 99 100 $merged = $referenceEntry; 101 102 if ( array_key_exists( 'value', $storedEntry ) ) { 103 $merged['value'] = $storedEntry['value']; 104 } 105 106 foreach ( $storedEntry as $key => $value ) { 107 if ( array_key_exists( $key, $referenceEntry ) ) { 108 continue; 109 } 110 111 $merged[ $key ] = $value; 112 } 113 114 return $merged; 29 115 } 30 116 } -
consistency/tags/1.8.4/package.json
r3277079 r3405619 1 1 { 2 2 "name": "consistency", 3 "version": "1.8. 3",3 "version": "1.8.4", 4 4 "description": "", 5 5 "main": "index.js", -
consistency/tags/1.8.4/readme.txt
r3277079 r3405619 3 3 Tags: punctuation, typography, block editor, gutenberg 4 4 Requires at least: 6.1 5 Tested up to: 6. 86 Stable tag: 1.8. 35 Tested up to: 6.9 6 Stable tag: 1.8.4 7 7 Requires PHP: 7.4 8 8 License: GPL-3.0-or-later … … 70 70 == Changelog == 71 71 72 = 1.8.4 = 73 * Correctif : enregistrement des réglages fiabilisé. 74 * Correctif : ajustement de sprintf pour garantir la compatibilité avec WordPress 6.9. 75 72 76 = 1.8.3 = 73 77 * Add: Indicate compatibility with WordPress 6.8 -
consistency/tags/1.8.4/src/app/fixes.js
r3184822 r3405619 121 121 // Concat strings 122 122 if ( 0 !== cursorPositionInsideHTML ) { 123 blockContent = firstPart + lastPart.replace( rule.mask, replaceWithThis ) 123 const typedReplacement = getTypedReplacementResult( { 124 firstPart, 125 lastPart, 126 mask: rule.mask, 127 replaceValue: replaceWithThis 128 } ) 129 130 if ( typedReplacement === null ) { 131 return 132 } 133 134 blockContent = typedReplacement 124 135 } 125 136 … … 249 260 250 261 } 262 263 /** 264 * Compute updated text content when applying a replacement at the cursor position. 265 * 266 * @param {Object} props Replacement context. 267 * @param {string} props.firstPart Text preceding the replaced fragment. 268 * @param {string} props.lastPart Text starting at the fragment to replace. 269 * @param {RegExp} props.mask Regular expression used for the replacement. 270 * @param {string|Function} props.replaceValue Replacement value or callback. 271 * @return {string|null} 272 */ 273 const getTypedReplacementResult = ( { firstPart, lastPart, mask, replaceValue } ) => { 274 if ( typeof lastPart !== 'string' ) { 275 return null 276 } 277 278 let hasReplacement = false 279 280 const replacementResult = lastPart.replace( mask, ( ...args ) => { 281 hasReplacement = true 282 const match = args[0] 283 284 if ( typeof replaceValue === 'function' ) { 285 return replaceValue( ...args ) 286 } 287 288 const localMask = new RegExp( mask.source, mask.flags ) 289 return match.replace( localMask, replaceValue ) 290 } ) 291 292 if ( ! hasReplacement ) { 293 return null 294 } 295 296 return firstPart + replacementResult 297 } -
consistency/tags/1.8.4/src/components/GlobalSettingToggle.js
r3145550 r3405619 1 1 /** 2 2 * @summary: GlobalSettingToggle component. 3 * 3 * 4 4 * This file contains the GlobalSettingToggle component used to display the plugin's global settings in sidebar. 5 5 * @author Loïc Antignac. … … 9 9 * WordPress dependencies 10 10 */ 11 import { __ } from '@wordpress/i18n'11 import { __, sprintf } from '@wordpress/i18n' 12 12 import { useDispatch } from '@wordpress/data' 13 13 import { PanelRow, ToggleControl } from '@wordpress/components' -
consistency/tags/1.8.4/src/components/UserSettingToggle.js
r3145550 r3405619 1 1 /** 2 2 * @summary: UserSettingToggle component. 3 * 3 * 4 4 * This file contains the UserSettingToggle component used to display the plugin's user settings in sidebar. 5 5 * @author Loïc Antignac. … … 9 9 * WordPress dependencies 10 10 */ 11 import { __ } from '@wordpress/i18n'11 import { __, sprintf } from '@wordpress/i18n' 12 12 import { useDispatch, useSelect } from '@wordpress/data' 13 13 import { ToggleControl } from '@wordpress/components' -
consistency/tags/1.8.4/src/config/rules.js
r3184822 r3405619 10 10 * WordPress dependencies 11 11 */ 12 import { __ } from '@wordpress/i18n'12 import { __, sprintf } from '@wordpress/i18n' 13 13 14 14 export const rules = [ … … 398 398 }, 399 399 ] 400 -
consistency/tags/1.8.4/vendor/autoload.php
r3092549 r3405619 15 15 } 16 16 } 17 trigger_error( 18 $err, 19 E_USER_ERROR 20 ); 17 throw new RuntimeException($err); 21 18 } 22 19 -
consistency/tags/1.8.4/vendor/composer/InstalledVersions.php
r3122806 r3405619 28 28 { 29 29 /** 30 * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to 31 * @internal 32 */ 33 private static $selfDir = null; 34 35 /** 30 36 * @var mixed[]|null 31 37 * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null 32 38 */ 33 39 private static $installed; 40 41 /** 42 * @var bool 43 */ 44 private static $installedIsLocalDir; 34 45 35 46 /** … … 310 321 self::$installed = $data; 311 322 self::$installedByVendor = array(); 323 324 // when using reload, we disable the duplicate protection to ensure that self::$installed data is 325 // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not, 326 // so we have to assume it does not, and that may result in duplicate data being returned when listing 327 // all installed packages for example 328 self::$installedIsLocalDir = false; 329 } 330 331 /** 332 * @return string 333 */ 334 private static function getSelfDir() 335 { 336 if (self::$selfDir === null) { 337 self::$selfDir = strtr(__DIR__, '\\', '/'); 338 } 339 340 return self::$selfDir; 312 341 } 313 342 … … 323 352 324 353 $installed = array(); 354 $copiedLocalDir = false; 325 355 326 356 if (self::$canGetVendors) { 357 $selfDir = self::getSelfDir(); 327 358 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 359 $vendorDir = strtr($vendorDir, '\\', '/'); 328 360 if (isset(self::$installedByVendor[$vendorDir])) { 329 361 $installed[] = self::$installedByVendor[$vendorDir]; … … 331 363 /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ 332 364 $required = require $vendorDir.'/composer/installed.php'; 333 $installed[] = self::$installedByVendor[$vendorDir] = $required; 334 if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { 335 self::$installed = $installed[count($installed) - 1]; 365 self::$installedByVendor[$vendorDir] = $required; 366 $installed[] = $required; 367 if (self::$installed === null && $vendorDir.'/composer' === $selfDir) { 368 self::$installed = $required; 369 self::$installedIsLocalDir = true; 336 370 } 371 } 372 if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) { 373 $copiedLocalDir = true; 337 374 } 338 375 } … … 351 388 } 352 389 353 if (self::$installed !== array() ) {390 if (self::$installed !== array() && !$copiedLocalDir) { 354 391 $installed[] = self::$installed; 355 392 } -
consistency/tags/1.8.4/vendor/composer/autoload_classmap.php
r3122806 r3405619 11 11 'Webaxones\\Consistency\\Asset\\Asset' => $baseDir . '/includes/Asset/Asset.php', 12 12 'Webaxones\\Consistency\\Config\\Languages' => $baseDir . '/includes/Config/Languages.php', 13 'Webaxones\\Consistency\\Config\\LocalizationManagement' => $baseDir . '/includes/Config/LocalizationManagement.php', 13 14 'Webaxones\\Consistency\\Config\\LocalizedRules' => $baseDir . '/includes/Config/LocalizedRules.php', 14 15 'Webaxones\\Consistency\\Config\\RestSchema' => $baseDir . '/includes/Config/RestSchema.php', -
consistency/tags/1.8.4/vendor/composer/autoload_static.php
r3122806 r3405619 34 34 'Webaxones\\Consistency\\Asset\\Asset' => __DIR__ . '/../..' . '/includes/Asset/Asset.php', 35 35 'Webaxones\\Consistency\\Config\\Languages' => __DIR__ . '/../..' . '/includes/Config/Languages.php', 36 'Webaxones\\Consistency\\Config\\LocalizationManagement' => __DIR__ . '/../..' . '/includes/Config/LocalizationManagement.php', 36 37 'Webaxones\\Consistency\\Config\\LocalizedRules' => __DIR__ . '/../..' . '/includes/Config/LocalizedRules.php', 37 38 'Webaxones\\Consistency\\Config\\RestSchema' => __DIR__ . '/../..' . '/includes/Config/RestSchema.php', -
consistency/tags/1.8.4/vendor/composer/installed.php
r3122806 r3405619 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' e595262819000eef15c4a7d1d98f998f376acf4f',6 'reference' => '67486ad7060c7aa3f7a3d3f928413842f601bbb5', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 34 34 'reference' => '0ec6bad5f4523eda2514e89d5ea48cde6ebe7f99', 35 35 'type' => 'metapackage', 36 'install_path' => NULL,36 'install_path' => null, 37 37 'aliases' => array( 38 38 0 => '9999999-dev', … … 52 52 'pretty_version' => 'dev-master', 53 53 'version' => 'dev-master', 54 'reference' => ' e595262819000eef15c4a7d1d98f998f376acf4f',54 'reference' => '67486ad7060c7aa3f7a3d3f928413842f601bbb5', 55 55 'type' => 'wordpress-plugin', 56 56 'install_path' => __DIR__ . '/../../', -
consistency/tags/1.8.4/vendor/composer/platform_check.php
r3084555 r3405619 5 5 $issues = array(); 6 6 7 if (!(PHP_VERSION_ID >= 70400)) {8 $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';7 if (!(PHP_VERSION_ID >= 80100)) { 8 $issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.'; 9 9 } 10 10 -
consistency/trunk/build/index.asset.php
r3184822 r3405619 1 <?php return array('dependencies' => array('react', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-rich-text'), 'version' => ' 71c2764f0435ef4fe22c');1 <?php return array('dependencies' => array('react', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-rich-text'), 'version' => '39053d2cc07db4dc4039'); -
consistency/trunk/build/index.js
r3184822 r3405619 1 (()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,s=window.wp.plugins,n=window.wp.domReady;var o=e.n(n);const c=window.wp.element,r=(0,c.createContext)(),a=({children:e})=>{const[s]=(0,c.useState)(null!==document.querySelector('iframe[name="editor-canvas"]')),[n,o]=(0,c.useState)(!1),[a,i]=(0,c.useState)(""),[l,u]=(0,c.useState)([]), d=(0,c.useRef)(0),p=(0,c.useRef)(!1);return(0,t.createElement)(r.Provider,{value:{isEditorInIframe:s,isPreviousFixCanceled:n,setPreviousFixCanceled:o,previousFixCanceledContent:a,setPreviousFixCanceledContent:i,blocksToBeProcessed:l,setBlocksToBeProcessed:u,cursorOffsetRef:d,isContentPastedRef:p}},e)},i=r,l=window.wp.i18n,u=window.wp.editor,d=window.wp.data,p=window.wp.components,y=()=>(0,t.createElement)(p.Icon,{icon:(0,t.createElement)("svg",{version:"1.1",id:"consistency-plugin",x:"0px",y:"0px",width:"24px",height:"24px",viewBox:"0 0 24 24",enableBackground:"new 0 0 24 24"},(0,t.createElement)("line",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",x1:"4",y1:"20",x2:"7",y2:"20"}),(0,t.createElement)("line",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",x1:"14",y1:"20",x2:"21",y2:"20"}),(0,t.createElement)("line",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),(0,t.createElement)("line",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),(0,t.createElement)("polyline",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",points:"5,20 11,4 13,4 20,20 "}))}),g=window.wp.coreData,m=window.wp.notices,h=e=>{const{settingSlug:s,settingName:n,settingDescription:o}=e,{currentUser:c}=(0,d.useSelect)((e=>({currentUser:e(g.store).getCurrentUser()})),[]),r=c&&c.id,[a,i]=(0,g.useEntityProp)("root","user","meta",r),{saveEditedEntityRecord:u}=(0,d.useDispatch)(g.store),{createNotice:y}=(0,d.useDispatch)(m.store);return(0,t.createElement)(p.ToggleControl,{label:n,help:(0,t.createElement)("span",{dangerouslySetInnerHTML:o}),checked:a?.consistency_plugin_user_settings?.find((e=>e.slug===s))?.value||!1,onChange:e=>{let t=a?.consistency_plugin_user_settings.map((t=>s===t.slug?{...t,value:e}:t));t?.find((e=>e.slug===s))||t.push({slug:s,value:e}),i({...a,consistency_plugin_user_settings:t}),u("root","user",r,{...a,meta:t}),y((0,l.__)("info","consistency"),e?sprintf((0,l.__)('"%1$s" Correction is enabled',"consistency"),n):sprintf((0,l.__)('"%1$s" Correction is disabled',"consistency"),n),{isDismissible:!0,type:"snackbar",speak:!0})}})},f=()=>(0,t.createElement)(p.Panel,{className:"UserSettingPanel"},(0,t.createElement)(p.PanelHeader,null,(0,t.createElement)("strong",null,(0,l.__)("Settings for my account","consistency")),(0,t.createElement)("br",null)),(0,t.createElement)("div",{style:{padding:16}},(0,t.createElement)(p.PanelRow,null,(0,t.createElement)(h,{settingSlug:"on_the_fly",settingName:(0,l.__)("On-the-fly autocorrect","consistency"),settingDescription:{__html:(0,l.__)("Enable/disable on-the-fly autocorrect","consistency")}})),(0,t.createElement)(p.PanelRow,null,(0,t.createElement)(h,{settingSlug:"on_paste",settingName:(0,l.__)("On paste autocorrect","consistency"),settingDescription:{__html:(0,l.__)("Enable/disable autocorrect on paste","consistency")}})))),b=window.wp.richText,_=e=>"string"==typeof e||e instanceof String,k=e=>"object"==typeof e&&e instanceof b.RichTextData,{getEntityRecord:w}=(0,d.select)("core"),{updateBlock:v}=(0,d.dispatch)("core/block-editor"),S=()=>{const e=w("root","site");return e?.consistency_plugin_localization_management||!0},x=()=>{const e=w("root","site");return e?.language||"en_US"},C=()=>{const e=x(),s=S()?(0,l.__)(` (${e} locale)`,"consistency"):(0,l.__)(" (all locales)","consistency");return(0,t.createElement)("span",{style:{fontWeight:"normal",fontStyle:"italic",fontSize:"smaller"}},s)},T=["regularToCurlyQuotes","regularToFrenchQuotes","regularToFrenchQuotesWithoutSpaces","regularToGermanQuotes","regularToGermanBookStyleQuotes"],E=[{slug:"quote",incompatibleWith:[]},{slug:"2hyphens",incompatibleWith:[]},{slug:"3hyphens",incompatibleWith:[]},{slug:"4hyphens",incompatibleWith:[]},{slug:"ordinalNumberSuffix",incompatibleWith:[]},{slug:"regularToCurlyQuotes",incompatibleWith:["regularToGermanQuotes","regularToGermanBookStyleQuotes","regularToFrenchQuotes","regularToFrenchQuotesWithoutSpaces"]},{slug:"regularToGermanQuotes",incompatibleWith:["regularToCurlyQuotes","regularToGermanBookStyleQuotes","regularToFrenchQuotes","regularToFrenchQuotesWithoutSpaces"]},{slug:"regularToGermanBookStyleQuotes",incompatibleWith:["regularToCurlyQuotes","regularToGermanQuotes","regularToFrenchQuotes","regularToFrenchQuotesWithoutSpaces"]},{slug:"regularToFrenchQuotes",incompatibleWith:["regularToCurlyQuotes","regularToGermanQuotes","regularToGermanBookStyleQuotes","regularToFrenchQuotesWithoutSpaces"]},{slug:"regularToFrenchQuotesWithoutSpaces",incompatibleWith:["regularToCurlyQuotes","regularToGermanQuotes","regularToGermanBookStyleQuotes","regularToFrenchQuotes"]},{slug:"curlyToFrenchQuotes",incompatibleWith:["regularToCurlyQuotes"]},{slug:"breakingSpace",incompatibleWith:["spaceBefore"]},{slug:"noSpaceBefore",incompatibleWith:["spaceBefore"]},{slug:"spaceBefore",incompatibleWith:["breakingSpace","noSpaceBefore"]},{slug:"noBreakingSpaceAfter",incompatibleWith:[]},{slug:"noNonBreakingSpaceAfter",incompatibleWith:[]},{slug:"capitalizeFirstSentenceLetter",incompatibleWith:[]},{slug:"etcThreeDots",incompatibleWith:[]},{slug:"etcTwoDots",incompatibleWith:[]},{slug:"etcEllipsis",incompatibleWith:[]},{slug:"ellipsis",incompatibleWith:[]},{slug:"symbolInACircle",incompatibleWith:[]},{slug:"symbolInSmallCapsAndSuperscriptStyle",incompatibleWith:[]},{slug:"fractions",incompatibleWith:[]},{slug:"percentages",incompatibleWith:[]}],B=[{slug:"quote",name:(0,l.__)("Straight Apostrophe","consistency"),description:(0,l.__)("Replace straight apostrophes with curly apostrophes:","consistency")+"<span aria-hidden='true' style='display:block;'><code>'</code> <span style='font-size:20px'>→</span> <code>’</code></span>",mask:/\'/,replace:"’",format:"",nbMoved:0,category:"apostrophe"},{slug:"2hyphens",name:(0,l.__)("En Dash","consistency"),description:(0,l.__)("Replace two hyphens with an en dash:","consistency")+"<span aria-hidden='true' style='display:block;'><code>--</code> <span style='font-size:20px'>→</span> <code style=\"font-family:sans-serif;\">–</code></span>",mask:/(?:\-)\-/,replace:"–",format:"",nbMoved:-1,category:"dash"},{slug:"3hyphens",name:(0,l.__)("Em Dash","consistency"),description:(0,l.__)("Replace three hyphens with an em dash:","consistency")+"<span aria-hidden='true' style='display:block;'><code>---</code> <span style='font-size:20px'>→</span> <code style=\"font-family:sans-serif;\">—</code></span>",mask:/(?:–|\-\-)\-/,replace:"—",format:"",nbMoved:e=>-(e.length-1),category:"dash"},{slug:"4hyphens",name:(0,l.__)("Two-Em Dash","consistency"),description:(0,l.__)("Replace four hyphens with two-em dash:","consistency")+"<span aria-hidden='true' style='display:block;'><code>----</code> <span style='font-size:20px'>→</span> <code style=\"font-family:sans-serif;\">⸺</code></span>",mask:/(?:—|–\-|\-\-\-)\-/,replace:"⸺",format:"",nbMoved:e=>-(e.length-1),category:"dash"},{slug:"ordinalNumberSuffix",name:(0,l.__)("Ordinal Number Suffix","consistency"),description:(0,l.__)("Add the sup HTML tag to ordinal number suffixes","consistency")+"<span aria-hidden='true' style='display:block;'><code>1st</code> <span style='font-size:20px'>→</span> <code>1<sup>st</sup></code></span>",mask:/([10-9]{1,20})(th|nd|rd|e|er|res|d|ds|de|des)( | |\.|\,|\;)/,replace:"$1$2$3",format:"superscript",nbMoved:0,category:"suffixe"},{slug:"regularToCurlyQuotes",name:(0,l.__)("Curly Quotes","consistency"),description:(0,l.__)("Replace straight quotes with curly quotes:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>“ ”</code></span>",mask:/"/,replace:"“$1”",format:"",nbMoved:0,category:"quotation"},{slug:"regularToGermanQuotes",name:(0,l.__)("German Quotes","consistency"),description:(0,l.__)("Replace straight quotes with german quotes:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>„ “</code></span>",mask:/"/,replace:"„$1“",format:"",nbMoved:0,category:"quotation"},{slug:"regularToGermanBookStyleQuotes",name:(0,l.__)("German Book-Style Quotes","consistency"),description:(0,l.__)("Replace straight quotes with german book-style quotes:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>» «</code></span>",mask:/"/,replace:"»$1«",format:"",nbMoved:0,category:"quotation"},{slug:"regularToFrenchQuotes",name:(0,l.__)("French Quotes with Spaces","consistency"),description:(0,l.__)("Replace straight quotes with french quotes with non-breaking spaces:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>« »</code></span>",mask:/"/,replace:"« $1 »",format:"",nbMoved:1,category:"quotation"},{slug:"regularToFrenchQuotesWithoutSpaces",name:(0,l.__)("French Quotes","consistency"),description:(0,l.__)("Replace straight quotes with french quotes without spaces:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>« »</code></span>",mask:/"/,replace:"«$1»",format:"",nbMoved:0,category:"quotation"},{slug:"curlyToFrenchQuotes",name:(0,l.__)("Curly Quotes to French Quotes","consistency"),description:(0,l.__)("Replace curly quotes with french quotes with non-breaking spaces:","consistency")+"<span aria-hidden='true' style='display:block;'><code>“ ”</code> <span style='font-size:20px'>→</span> <code>« »</code></span>",mask:/“.*?”/,replace:e=>`« ${e.substring(1,e.length-1)} »`,format:"",nbMoved:0,category:"quotation"},{slug:"breakingSpace",name:(0,l.__)("Breaking Spaces","consistency"),description:sprintf((0,l.__)("Replace a breaking space followed by a character from this list:%1$s with a non-breaking space","consistency"),"<br /><code>? ! : ; » € $ £ ¥ ₽ 元 %</code><br />"),mask:/ ([\?|\!|\:|\;|»|€|\$|£|¥|₽|元|\%])/,replace:" $1",format:"",nbMoved:0,category:"space"},{slug:"noSpaceBefore",name:(0,l.__)("No Space Before","consistency"),description:sprintf((0,l.__)("Add a non-breaking space before a character from this list:%1$s having no space before","consistency"),"<br /><code>? ! : ; » € $ £ ¥ ₽ 元 %</code><br />"),mask:/(?<! | | )([\?|\!|\:|»|€|\$|£|¥|₽|元|\%])/,replace:" $1",format:"",nbMoved:1,category:"space"},{slug:"spaceBefore",name:(0,l.__)("Space Before","consistency"),description:(0,l.__)("Remove any space preceding a character from this list:","consistency")+"<span style='display:block;'><code>? ! : ; %</code></span>",mask:/([ | ])(?=[\?|\!|\:|\;|\%])(.)/,replace:"$2",format:"",nbMoved:-1,category:"space"},{slug:"noBreakingSpaceAfter",name:(0,l.__)("No Breaking Space After","consistency"),description:sprintf((0,l.__)("Add a breaking space after a character from this list:%1$s when followed with another character","consistency"),"<br /><code>, … ) ]</code><br />"),mask:/([\,|…|\)|\]])(?! | |\.|\,|\d|$)(.)/,replace:"$1 $2",format:"",nbMoved:1,category:"space"},{slug:"noNonBreakingSpaceAfter",name:(0,l.__)("No Non-Breaking Space After","consistency"),description:(0,l.__)("Add a non-breaking space after open french quote having no space after","consistency"),mask:/(«)(?! | | )/,replace:"$1 ",format:"",nbMoved:0,category:"space"},{slug:"capitalizeFirstSentenceLetter",name:(0,l.__)("First Sentence Letter","consistency"),description:(0,l.__)("Capitalize the first letter of a sentence","consistency"),mask:/(^[a-záàâäãåăçéèêëíìîïñóòôöõúùûüýÿæœșț])|(?<=[\.|\?|\!|…] )[a-záàâäãåăçéèêëíìîïñóòôöõúùûüýÿæœșț]/,replace:e=>e.toUpperCase(),format:"",nbMoved:0,category:"case"},{slug:"etcThreeDots",name:(0,l.__)('Three Dots Following "etc"',"consistency"),description:(0,l.__)('Replace 3 dots placed after the abbreviation "etc" with a period:',"consistency")+"<span aria-hidden='true' style='display:block;'><code>etc...</code> <span style='font-size:20px'>→</span> <code>etc.</code></span>",mask:/etc(\.{3})/i,replace:e=>e.substring(0,3)+".",format:"",nbMoved:-2,category:"ellipsis"},{slug:"etcTwoDots",name:(0,l.__)('Two Dots Following "etc"',"consistency"),description:(0,l.__)('Replace 2 dots placed after the abbreviation "etc" with a period:',"consistency")+"<span aria-hidden='true' style='display:block;'><code>etc..</code> <span style='font-size:20px'>→</span> <code>etc.</code></span>",mask:/etc(\.{2})/i,replace:e=>e.substring(0,2)+".",format:"",nbMoved:-1,category:"ellipsis"},{slug:"etcEllipsis",name:(0,l.__)('Ellipsis Following "etc"',"consistency"),description:(0,l.__)('Replace the ellipsis placed after the abbreviation "etc" with a period:',"consistency")+"<span aria-hidden='true' style='display:block;'><code>etc…</code> <span style='font-size:20px'>→</span> <code>etc.</code></span>",mask:/etc(\.{3}|…)/i,replace:e=>e.substring(0,3)+".",format:"",nbMoved:0,category:"ellipsis"},{slug:"ellipsis",name:(0,l.__)("Ellipsis","consistency"),description:(0,l.__)("Replaces 3 dots with ellipsis:","consistency")+"<span aria-hidden='true' style='display:block;'><code>...</code> <span style='font-size:20px'>→</span> <code>…</code></span>",mask:/\.{3}/,replace:"…",format:"",nbMoved:-2,category:"ellipsis"},{slug:"symbolInACircle",name:(0,l.__)("Symbol in a Circle","consistency"),description:(0,l.__)("Replaces 1 character placed in parentheses with a symbol","consistency")+"<span aria-hidden='true' style='display:block;'><code>(c) (p) (r)</code> <span style='font-size:20px'>→</span> <code>© ℗ ®</code></span>",mask:/(\([c|p|r])(\))/,replace:e=>{switch(e[1]){case"c":return"©";case"p":return"℗";case"r":return"®"}return" "},format:"",nbMoved:-2,category:"symbol"},{slug:"symbolInSmallCapsAndSuperscriptStyle",name:(0,l.__)("Symbol in Small Caps and Superscript Style","consistency"),description:(0,l.__)("Replaces 2-character abbreviations with a symbol in small caps and superscript style","consistency")+"<span aria-hidden='true' style='display:block;'><code>tm sm md mc</code> <span style='font-size:20px'>→</span> <code>™ ℠ 🅫 🅪</code></span>",mask:/(?<= | |\(|\[|\{|:|^)(tm|sm|md|mc)(?= | |\.|\,|\;|\:|\)|\]|\}|$)/,replace:e=>{switch(e){case"tm":return"™";case"sm":return"℠";case"md":return"🅫";case"mc":return"🅪";default:return" "}},format:"",nbMoved:-1,category:"symbol"},{slug:"fractions",name:(0,l.__)("Fractions","consistency"),description:(0,l.__)("Replaces fractions with fraction symbols:","consistency")+"<span aria-hidden='true' style='display:block;'><code>1/2 3/5 1/9</code> <span style='font-size:20px'>→</span> <code>½ ⅗ ⅑</code></span>",mask:/[1-9]\/[1-9]/,replace:e=>{switch(e){case"1/4":return"¼";case"1/2":return"½";case"3/4":return"¾";case"1/3":return"⅓";case"2/3":return"⅔";case"1/5":return"⅕";case"2/5":return"⅖";case"3/5":return"⅗";case"4/5":return"⅘";case"1/6":return"⅙";case"5/6":return"⅚";case"1/8":return"⅛";case"3/8":return"⅜";case"5/8":return"⅝";case"7/8":return"⅞";case"1/7":return"⅐";case"1/9":return"⅑";default:return" "}},format:"",nbMoved:-2,category:"symbol"},{slug:"percentages",name:(0,l.__)("Percentages","consistency"),description:(0,l.__)("Replaces percentages with percentages symbols:","consistency")+"<span aria-hidden='true' style='display:block;'><code>0/0 0/00 0/000</code> <span style='font-size:20px'>→</span> <code>% ‰ ‱</code></span>",mask:/(0\/0|0\/00|0\/000)(?= | |\.|\,|\;|\:|\)|\]|\})(.)/,replace:e=>{const t=e.substring(0,e.length-1),s=e.substring(e.length-1,e.length);switch(t){case"0/0":return"%"+s;case"0/00":return"‰"+s;case"0/000":return"‱"+s;default:return" "+s}},format:"",nbMoved:e=>-(e.substring(0,e.length-1).length-1),category:"symbol"}],{getSelectionStart:F}=(0,d.select)("core/block-editor"),{selectionChange:P}=(0,d.dispatch)("core/block-editor"),R=()=>{const e=(()=>{const e=w("root","site");return e?.consistency_plugin_settings||[]})();return S()?e.filter((e=>$(e.slug))):e},Q=()=>B.filter((e=>!0===R()?.find((t=>t.slug===e.slug))?.value)),{getBlockName:W,getBlockAttributes:M}=(0,d.select)("core/block-editor"),$=e=>{const t=x();return!(void 0===localesByRules||!localesByRules.hasOwnProperty(e))&&localesByRules[e].includes(t)},N=e=>{const t=E.find((t=>t.slug===e));return!!t&&t.incompatibleWith.some((e=>R()?.find((t=>t.slug===e))?.value))},q=e=>{const{settingSlug:s,settingName:n,settingDescription:o}=e,{createNotice:c}=(0,d.useDispatch)(m.store);if(S()&&!$(s))return"";const[r,a]=(0,g.useEntityProp)("root","site","consistency_plugin_settings",void 0),{saveEditedEntityRecord:i}=(0,d.useDispatch)(g.store);return(0,t.createElement)(p.PanelRow,null,(0,t.createElement)(p.ToggleControl,{label:n,help:(0,t.createElement)("span",{dangerouslySetInnerHTML:o}),checked:r?.find((e=>e.slug===s))?.value||!1,disabled:N(s),onChange:e=>{let t=r.map((t=>s===t.slug?{...t,value:e}:t));a(t),i("root","site",void 0,t),c((0,l.__)("info","consistency"),e?sprintf((0,l.__)('"%1$s" Correction is enabled',"consistency"),n):sprintf((0,l.__)('"%1$s" Correction is disabled',"consistency"),n),{isDismissible:!0,type:"snackbar",speak:!0})}}))},A=[{slug:"apostrophe",label:(0,l.__)("Apostrophes","consistency"),description:(0,l.__)("Fixes related to apostrophes.","consistency")},{slug:"quotation",label:(0,l.__)("Quotation marks","consistency"),description:(0,l.__)("Fixes related to quotation marks.","consistency")},{slug:"dash",label:(0,l.__)("Dashes","consistency"),description:(0,l.__)("Fixes related to dashes.","consistency")},{slug:"suffixe",label:(0,l.__)("Suffixes","consistency"),description:(0,l.__)("Fixes related to suffixes.","consistency")},{slug:"space",label:(0,l.__)("Spaces","consistency"),description:(0,l.__)("Fixes related to spaces.","consistency")},{slug:"case",label:(0,l.__)("Case","consistency"),description:(0,l.__)("Fixes related to case.","consistency")},{slug:"ellipsis",label:(0,l.__)("Ellipsis","consistency"),description:(0,l.__)("Fixes related to ellipsis.","consistency")},{slug:"symbol",label:(0,l.__)("Symbols","consistency"),description:(0,l.__)("Fixes related to symbols.","consistency")}],z=()=>(0,t.createElement)(p.Panel,{className:"GlobalSettingPanel"},(0,t.createElement)(p.PanelHeader,null,(0,t.createElement)("strong",null,(0,l.__)("Global correction rules","consistency"),(0,t.createElement)(C,null))),[...A].map(((e,s)=>(0,t.createElement)(p.PanelBody,{key:s,title:(0,l.__)(e.label,"consistency"),initialOpen:!1},[...B].filter((t=>t.category===e.slug)).map(((e,s)=>(0,t.createElement)(q,{key:s,settingSlug:e.slug,settingName:e.name,settingDescription:{__html:e.description}}))))))),{canUser:I}=(0,d.select)("core"),O=()=>{const e=I("create","users");return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.PluginSidebar,{name:"consistency-custom-sidebar",title:(0,l.__)("Consistency","consistency"),icon:y},(0,t.createElement)(f,null),e&&(0,t.createElement)(z,null)),(0,t.createElement)(u.PluginSidebarMoreMenuItem,{target:"consistency-custom-sidebar"},(0,l.__)("Consistency Settings","consistency")))},{getBlock:D,getBlocks:L,getBlockAttributes:G,getSelectionStart:j,isTyping:U}=(0,d.select)("core/block-editor"),{updateBlockAttributes:H,updateBlock:K}=(0,d.dispatch)("core/block-editor"),J=e=>{const{currentBlockId:t,isPreviousFixCanceled:s,setPreviousFixCanceled:n,blocksToBeProcessed:o,cursorOffsetRef:c}=e;if(!(e=>{const{currentBlockId:t,blocksToBeProcessed:s}=e,n=W(t);return!!s.includes(n)})({currentBlockId:t,blocksToBeProcessed:o})||!(e=>{const t=M(e);return!(!t||!t.hasOwnProperty("content")||!_(t.content)&&!k(t.content))})(t))return;let r=Q();const a=D(t);let i=G(t),l=!1;Object.entries(r).forEach((([e,o])=>{if(l)return;if(""!==o.format)return;i.content;let r,u=o.replace,d="",p="",y=0,g=0,m=("object"==typeof i.content&&i.content,"object"==typeof i.content?i.content.text:i.content),h=(e=>e.replace(/<\b(code|pre|kbd)\b>.*?<\/\b(code|pre|kbd)\b>/gi,"").replace(/(<([^>]+)>)/gi,""))(m),f=!1;if(U()||(f=o.mask.test(h)),U()){r=j(),y=r?.offset||document.getSelection()?.anchorOffset||0,g=(e=>{const t=document.querySelector(`#block-${e}`);if(null===t)return;const s=t.querySelector('[contenteditable="true"]')||t,n=document.getSelection(),o=n?.getRangeAt(0);if(!o||!o.collapsed)return;const c=o.cloneRange(),r=document.createTextNode("\0");c.insertNode(r);const a=s.textContent||"";let i=a.indexOf("\0");r.parentNode.removeChild(r),s.normalize();const l=(s?.innerHTML.match(/ /g)||[]).length;return l>0&&(i=a.replace(/ /g," ").indexOf("\0"),i=i-6*l+l),i})(t)||y;const e=h.match(o.mask);if(null===e||0===e.length)return;const s=e[0].length||1;d=h.substring(0,g-s),p=h.substring(g-s,h.length),f=o.mask.test(h)&&o.mask.test(p)}if(!f)return;if((e=>!!T.includes(e.slug))(o)&&(u=((e,t,s)=>{const n=e.replace.charAt(0),o=e.replace.charAt(e.replace.length-1),c=e.replace.substring(1,e.replace.indexOf("$"))||"";let r="";0!==[...e.replace.matchAll(/[0-9]/g)].length&&(r=e.replace.substring([...e.replace.matchAll(/[0-9]/g)].pop().index+1,e.replace.length-1));const a=new RegExp(`${n}`,"g"),i=new RegExp(`${o}`,"g");return(t.match(a)||[]).length===(t.match(i)||[]).length?n+c:r+o})(o,m)),0!==g&&(m=d+p.replace(o.mask,u)),0===g&&(m=m.replace(o.mask,o.replace)),s)return void n(!1);s||""!==o.format||(l=(e=>{const{block:t,currentBlockId:s,blockAttributes:n,blockContent:o}=e;let c;if(k(n.content)){const e=(0,b.create)({...n.content,text:o});c=new b.RichTextData(e)}return _(n.content)&&(c=o),void 0!==c&&(v(s,{...t,attributes:{...n,content:c}}),!0)})({block:a,currentBlockId:t,blockAttributes:i,blockContent:m}));const w="function"==typeof o.nbMoved?o.nbMoved(p):o.nbMoved||0;l&&(c.current=w)}))},{getSelectedBlockClientId:V,isTyping:X,getBlockAttributes:Y}=(0,d.select)("core/block-editor"),Z=window.wp.blocks,ee=()=>((()=>{const{isEditorInIframe:e,isContentPastedRef:t}=(0,c.useContext)(i),s=(0,c.useRef)(!1);(0,c.useEffect)((()=>{if(s.current)return;const n=e=>{t.current=!0},o=e=>(e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}),c=e?document.querySelector('iframe[name="editor-canvas"]'):document.querySelector("#editor");if(!c)return;const r=o(c);return e&&"complete"===c.contentWindow.document.readyState&&o(c),s.current=!0,r}),[e])})(),(()=>{const{isEditorInIframe:e,setPreviousFixCanceled:t}=(0,c.useContext)(i),s=(0,c.useRef)(!1);(0,c.useEffect)((()=>{if(s.current)return;const n=e=>{90===e.keyCode&&(e.ctrlKey||e.metaKey)&&t(!0)},o=e=>(e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n)}),c=e?document.querySelector('iframe[name="editor-canvas"]'):document.querySelector("#editor");if(!c)return;const r=o(c);return e&&"complete"===c.contentWindow.document.readyState&&o(c),s.current=!0,r}),[t])})(),(()=>{const{setBlocksToBeProcessed:e}=(0,c.useContext)(i);(0,c.useEffect)((()=>{let t=(0,Z.getBlockTypes)().filter((e=>e.attributes&&e.attributes.content&&("string"===e.attributes.content.type||"rich-text"===e.attributes.content.type)));const s=["core/html"];t=t.filter((e=>!s.includes(e.name))),console.log("Consistency - Blocks that can be processed:",t),e(t.map((e=>e.name)))}),[])})(),(()=>{const{isPreviousFixCanceled:e,setPreviousFixCanceled:t,previousFixCanceledContent:s,setPreviousFixCanceledContent:n,blocksToBeProcessed:o,cursorOffsetRef:r,isContentPastedRef:a}=(0,c.useContext)(i);r.current=r.current||0,a.current=a.current||!1,(0,c.useEffect)((()=>{const c=(0,d.subscribe)((()=>{const{onTheFly:c,onPaste:i}=(()=>{const e={onTheFly:!1,onPaste:!1},t=(0,d.select)(g.store).getCurrentUser(),s=w("root","user",t?.id||0,"consistency_plugin_user_settings"),n=s?.meta?.consistency_plugin_user_settings;return e.onTheFly=n?.find((e=>"on_the_fly"===e.slug))?.value||!1,e.onPaste=n?.find((e=>"on_paste"===e.slug))?.value||!1,e})();if(!c&&!i)return;if(void 0===R())return;if(i&&!0===a.current)return a.current=!1,void(e=>{const{isPreviousFixCanceled:t,setPreviousFixCanceled:s,blocksToBeProcessed:n,cursorOffsetRef:o}=e;let c=Q();const r=L(),a=r.flatMap((({innerBlocks:e,...t})=>e.map((e=>({...t,...e}))))),i=r.reduce(((e,t)=>{let s=t.attributes?.content;return n.includes(t.name)&&void 0!==s?(Object.entries(c).forEach((([e,t])=>{if(T.includes(t.slug)){const e=t.mask.toString().match(/(?<=\/).+?(?=\/)/g)[0],n=new RegExp(`(?<!=)${e}(?!>)([^${e}]*)(?<!=)${e}(?!>)`,"g");s=s.replaceAll(n,t.replace)}if(!T.includes(t.slug)){const e=t.mask.toString(),n=new RegExp(e.substring(1,e.length-1),"g");s=s.replaceAll(n,t.replace)}})),void 0!==s&&(e[t.clientId]={content:s}),e):e}),{});Object.keys(i).length>0&&H(Object.keys(i),i,!0),a.forEach((e=>{if(!n.includes(e.name))return;const c=e.clientId;e?.clientId&&J({currentBlockId:c,isPreviousFixCanceled:t,setPreviousFixCanceled:s,blocksToBeProcessed:n,cursorOffsetRef:o})}))})({isPreviousFixCanceled:e,setPreviousFixCanceled:t,blocksToBeProcessed:o,cursorOffsetRef:r});const l=V();if(null===l||!c)return;const u=Y(l);u&&(u.hasOwnProperty("content")&&s===u.content||(n(u.content),X()&&J({currentBlockId:l,isPreviousFixCanceled:e,setPreviousFixCanceled:t,blocksToBeProcessed:o,cursorOffsetRef:r})))}));return()=>{c(),(e=>{const t=window.getSelection(),s=F();if(!t)return;let n;if(null===t.anchorNode){if(null===s||null===s?.clientId)return;return n=s?.offset||0,void P(s.clientId,s.attributeKey,n+e,n+e)}1===t?.anchorNode?.nodeType&&(n=t.anchorNode?.firstChild?.length||0),3===t?.anchorNode?.nodeType&&(n=t.anchorOffset||0);const o=e>=0?n+e:n;if(1!==t?.anchorNode?.nodeType)if(3!==t?.anchorNode?.nodeType);else{const e=t.anchorNode;t.collapse(e,o)}else{const e=t.anchorNode?.firstChild||t.anchorNode?.childNodes[0];t.collapse(e,o)}})(r.current),r.current=0}}),[e,t,s,n,o,r,a])})(),(0,t.createElement)(O,null)),te=()=>(0,t.createElement)(a,null,(0,t.createElement)(ee,null));o()((()=>{(0,s.registerPlugin)("consistency-custom-sidebar",{render:te})}))})();1 (()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,s=window.wp.plugins,n=window.wp.domReady;var o=e.n(n);const c=window.wp.element,r=(0,c.createContext)(),a=({children:e})=>{const[s]=(0,c.useState)(null!==document.querySelector('iframe[name="editor-canvas"]')),[n,o]=(0,c.useState)(!1),[a,i]=(0,c.useState)(""),[l,u]=(0,c.useState)([]),p=(0,c.useRef)(0),d=(0,c.useRef)(!1);return(0,t.createElement)(r.Provider,{value:{isEditorInIframe:s,isPreviousFixCanceled:n,setPreviousFixCanceled:o,previousFixCanceledContent:a,setPreviousFixCanceledContent:i,blocksToBeProcessed:l,setBlocksToBeProcessed:u,cursorOffsetRef:p,isContentPastedRef:d}},e)},i=r,l=window.wp.i18n,u=window.wp.editor,p=window.wp.data,d=window.wp.components,y=()=>(0,t.createElement)(d.Icon,{icon:(0,t.createElement)("svg",{version:"1.1",id:"consistency-plugin",x:"0px",y:"0px",width:"24px",height:"24px",viewBox:"0 0 24 24",enableBackground:"new 0 0 24 24"},(0,t.createElement)("line",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",x1:"4",y1:"20",x2:"7",y2:"20"}),(0,t.createElement)("line",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",x1:"14",y1:"20",x2:"21",y2:"20"}),(0,t.createElement)("line",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),(0,t.createElement)("line",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),(0,t.createElement)("polyline",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",points:"5,20 11,4 13,4 20,20 "}))}),g=window.wp.coreData,m=window.wp.notices,h=e=>{const{settingSlug:s,settingName:n,settingDescription:o}=e,{currentUser:c}=(0,p.useSelect)((e=>({currentUser:e(g.store).getCurrentUser()})),[]),r=c&&c.id,[a,i]=(0,g.useEntityProp)("root","user","meta",r),{saveEditedEntityRecord:u}=(0,p.useDispatch)(g.store),{createNotice:y}=(0,p.useDispatch)(m.store);return(0,t.createElement)(d.ToggleControl,{label:n,help:(0,t.createElement)("span",{dangerouslySetInnerHTML:o}),checked:a?.consistency_plugin_user_settings?.find((e=>e.slug===s))?.value||!1,onChange:e=>{let t=a?.consistency_plugin_user_settings.map((t=>s===t.slug?{...t,value:e}:t));t?.find((e=>e.slug===s))||t.push({slug:s,value:e}),i({...a,consistency_plugin_user_settings:t}),u("root","user",r,{...a,meta:t}),y((0,l.__)("info","consistency"),e?(0,l.sprintf)((0,l.__)('"%1$s" Correction is enabled',"consistency"),n):(0,l.sprintf)((0,l.__)('"%1$s" Correction is disabled',"consistency"),n),{isDismissible:!0,type:"snackbar",speak:!0})}})},f=()=>(0,t.createElement)(d.Panel,{className:"UserSettingPanel"},(0,t.createElement)(d.PanelHeader,null,(0,t.createElement)("strong",null,(0,l.__)("Settings for my account","consistency")),(0,t.createElement)("br",null)),(0,t.createElement)("div",{style:{padding:16}},(0,t.createElement)(d.PanelRow,null,(0,t.createElement)(h,{settingSlug:"on_the_fly",settingName:(0,l.__)("On-the-fly autocorrect","consistency"),settingDescription:{__html:(0,l.__)("Enable/disable on-the-fly autocorrect","consistency")}})),(0,t.createElement)(d.PanelRow,null,(0,t.createElement)(h,{settingSlug:"on_paste",settingName:(0,l.__)("On paste autocorrect","consistency"),settingDescription:{__html:(0,l.__)("Enable/disable autocorrect on paste","consistency")}})))),b=window.wp.richText,_=e=>"string"==typeof e||e instanceof String,k=e=>"object"==typeof e&&e instanceof b.RichTextData,{getEntityRecord:w}=(0,p.select)("core"),{updateBlock:v}=(0,p.dispatch)("core/block-editor"),S=()=>{const e=w("root","site");return e?.consistency_plugin_localization_management||!0},x=()=>{const e=w("root","site");return e?.language||"en_US"},C=()=>{const e=x(),s=S()?(0,l.__)(` (${e} locale)`,"consistency"):(0,l.__)(" (all locales)","consistency");return(0,t.createElement)("span",{style:{fontWeight:"normal",fontStyle:"italic",fontSize:"smaller"}},s)},T=["regularToCurlyQuotes","regularToFrenchQuotes","regularToFrenchQuotesWithoutSpaces","regularToGermanQuotes","regularToGermanBookStyleQuotes"],E=[{slug:"quote",incompatibleWith:[]},{slug:"2hyphens",incompatibleWith:[]},{slug:"3hyphens",incompatibleWith:[]},{slug:"4hyphens",incompatibleWith:[]},{slug:"ordinalNumberSuffix",incompatibleWith:[]},{slug:"regularToCurlyQuotes",incompatibleWith:["regularToGermanQuotes","regularToGermanBookStyleQuotes","regularToFrenchQuotes","regularToFrenchQuotesWithoutSpaces"]},{slug:"regularToGermanQuotes",incompatibleWith:["regularToCurlyQuotes","regularToGermanBookStyleQuotes","regularToFrenchQuotes","regularToFrenchQuotesWithoutSpaces"]},{slug:"regularToGermanBookStyleQuotes",incompatibleWith:["regularToCurlyQuotes","regularToGermanQuotes","regularToFrenchQuotes","regularToFrenchQuotesWithoutSpaces"]},{slug:"regularToFrenchQuotes",incompatibleWith:["regularToCurlyQuotes","regularToGermanQuotes","regularToGermanBookStyleQuotes","regularToFrenchQuotesWithoutSpaces"]},{slug:"regularToFrenchQuotesWithoutSpaces",incompatibleWith:["regularToCurlyQuotes","regularToGermanQuotes","regularToGermanBookStyleQuotes","regularToFrenchQuotes"]},{slug:"curlyToFrenchQuotes",incompatibleWith:["regularToCurlyQuotes"]},{slug:"breakingSpace",incompatibleWith:["spaceBefore"]},{slug:"noSpaceBefore",incompatibleWith:["spaceBefore"]},{slug:"spaceBefore",incompatibleWith:["breakingSpace","noSpaceBefore"]},{slug:"noBreakingSpaceAfter",incompatibleWith:[]},{slug:"noNonBreakingSpaceAfter",incompatibleWith:[]},{slug:"capitalizeFirstSentenceLetter",incompatibleWith:[]},{slug:"etcThreeDots",incompatibleWith:[]},{slug:"etcTwoDots",incompatibleWith:[]},{slug:"etcEllipsis",incompatibleWith:[]},{slug:"ellipsis",incompatibleWith:[]},{slug:"symbolInACircle",incompatibleWith:[]},{slug:"symbolInSmallCapsAndSuperscriptStyle",incompatibleWith:[]},{slug:"fractions",incompatibleWith:[]},{slug:"percentages",incompatibleWith:[]}],B=[{slug:"quote",name:(0,l.__)("Straight Apostrophe","consistency"),description:(0,l.__)("Replace straight apostrophes with curly apostrophes:","consistency")+"<span aria-hidden='true' style='display:block;'><code>'</code> <span style='font-size:20px'>→</span> <code>’</code></span>",mask:/\'/,replace:"’",format:"",nbMoved:0,category:"apostrophe"},{slug:"2hyphens",name:(0,l.__)("En Dash","consistency"),description:(0,l.__)("Replace two hyphens with an en dash:","consistency")+"<span aria-hidden='true' style='display:block;'><code>--</code> <span style='font-size:20px'>→</span> <code style=\"font-family:sans-serif;\">–</code></span>",mask:/(?:\-)\-/,replace:"–",format:"",nbMoved:-1,category:"dash"},{slug:"3hyphens",name:(0,l.__)("Em Dash","consistency"),description:(0,l.__)("Replace three hyphens with an em dash:","consistency")+"<span aria-hidden='true' style='display:block;'><code>---</code> <span style='font-size:20px'>→</span> <code style=\"font-family:sans-serif;\">—</code></span>",mask:/(?:–|\-\-)\-/,replace:"—",format:"",nbMoved:e=>-(e.length-1),category:"dash"},{slug:"4hyphens",name:(0,l.__)("Two-Em Dash","consistency"),description:(0,l.__)("Replace four hyphens with two-em dash:","consistency")+"<span aria-hidden='true' style='display:block;'><code>----</code> <span style='font-size:20px'>→</span> <code style=\"font-family:sans-serif;\">⸺</code></span>",mask:/(?:—|–\-|\-\-\-)\-/,replace:"⸺",format:"",nbMoved:e=>-(e.length-1),category:"dash"},{slug:"ordinalNumberSuffix",name:(0,l.__)("Ordinal Number Suffix","consistency"),description:(0,l.__)("Add the sup HTML tag to ordinal number suffixes","consistency")+"<span aria-hidden='true' style='display:block;'><code>1st</code> <span style='font-size:20px'>→</span> <code>1<sup>st</sup></code></span>",mask:/([10-9]{1,20})(th|nd|rd|e|er|res|d|ds|de|des)( | |\.|\,|\;)/,replace:"$1$2$3",format:"superscript",nbMoved:0,category:"suffixe"},{slug:"regularToCurlyQuotes",name:(0,l.__)("Curly Quotes","consistency"),description:(0,l.__)("Replace straight quotes with curly quotes:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>“ ”</code></span>",mask:/"/,replace:"“$1”",format:"",nbMoved:0,category:"quotation"},{slug:"regularToGermanQuotes",name:(0,l.__)("German Quotes","consistency"),description:(0,l.__)("Replace straight quotes with german quotes:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>„ “</code></span>",mask:/"/,replace:"„$1“",format:"",nbMoved:0,category:"quotation"},{slug:"regularToGermanBookStyleQuotes",name:(0,l.__)("German Book-Style Quotes","consistency"),description:(0,l.__)("Replace straight quotes with german book-style quotes:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>» «</code></span>",mask:/"/,replace:"»$1«",format:"",nbMoved:0,category:"quotation"},{slug:"regularToFrenchQuotes",name:(0,l.__)("French Quotes with Spaces","consistency"),description:(0,l.__)("Replace straight quotes with french quotes with non-breaking spaces:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>« »</code></span>",mask:/"/,replace:"« $1 »",format:"",nbMoved:1,category:"quotation"},{slug:"regularToFrenchQuotesWithoutSpaces",name:(0,l.__)("French Quotes","consistency"),description:(0,l.__)("Replace straight quotes with french quotes without spaces:","consistency")+"<span aria-hidden='true' style='display:block;'><code>\" \"</code> <span style='font-size:20px'>→</span> <code>« »</code></span>",mask:/"/,replace:"«$1»",format:"",nbMoved:0,category:"quotation"},{slug:"curlyToFrenchQuotes",name:(0,l.__)("Curly Quotes to French Quotes","consistency"),description:(0,l.__)("Replace curly quotes with french quotes with non-breaking spaces:","consistency")+"<span aria-hidden='true' style='display:block;'><code>“ ”</code> <span style='font-size:20px'>→</span> <code>« »</code></span>",mask:/“.*?”/,replace:e=>`« ${e.substring(1,e.length-1)} »`,format:"",nbMoved:0,category:"quotation"},{slug:"breakingSpace",name:(0,l.__)("Breaking Spaces","consistency"),description:(0,l.sprintf)((0,l.__)("Replace a breaking space followed by a character from this list:%1$s with a non-breaking space","consistency"),"<br /><code>? ! : ; » € $ £ ¥ ₽ 元 %</code><br />"),mask:/ ([\?|\!|\:|\;|»|€|\$|£|¥|₽|元|\%])/,replace:" $1",format:"",nbMoved:0,category:"space"},{slug:"noSpaceBefore",name:(0,l.__)("No Space Before","consistency"),description:(0,l.sprintf)((0,l.__)("Add a non-breaking space before a character from this list:%1$s having no space before","consistency"),"<br /><code>? ! : ; » € $ £ ¥ ₽ 元 %</code><br />"),mask:/(?<! | | )([\?|\!|\:|»|€|\$|£|¥|₽|元|\%])/,replace:" $1",format:"",nbMoved:1,category:"space"},{slug:"spaceBefore",name:(0,l.__)("Space Before","consistency"),description:(0,l.__)("Remove any space preceding a character from this list:","consistency")+"<span style='display:block;'><code>? ! : ; %</code></span>",mask:/([ | ])(?=[\?|\!|\:|\;|\%])(.)/,replace:"$2",format:"",nbMoved:-1,category:"space"},{slug:"noBreakingSpaceAfter",name:(0,l.__)("No Breaking Space After","consistency"),description:(0,l.sprintf)((0,l.__)("Add a breaking space after a character from this list:%1$s when followed with another character","consistency"),"<br /><code>, … ) ]</code><br />"),mask:/([\,|…|\)|\]])(?! | |\.|\,|\d|$)(.)/,replace:"$1 $2",format:"",nbMoved:1,category:"space"},{slug:"noNonBreakingSpaceAfter",name:(0,l.__)("No Non-Breaking Space After","consistency"),description:(0,l.__)("Add a non-breaking space after open french quote having no space after","consistency"),mask:/(«)(?! | | )/,replace:"$1 ",format:"",nbMoved:0,category:"space"},{slug:"capitalizeFirstSentenceLetter",name:(0,l.__)("First Sentence Letter","consistency"),description:(0,l.__)("Capitalize the first letter of a sentence","consistency"),mask:/(^[a-záàâäãåăçéèêëíìîïñóòôöõúùûüýÿæœșț])|(?<=[\.|\?|\!|…] )[a-záàâäãåăçéèêëíìîïñóòôöõúùûüýÿæœșț]/,replace:e=>e.toUpperCase(),format:"",nbMoved:0,category:"case"},{slug:"etcThreeDots",name:(0,l.__)('Three Dots Following "etc"',"consistency"),description:(0,l.__)('Replace 3 dots placed after the abbreviation "etc" with a period:',"consistency")+"<span aria-hidden='true' style='display:block;'><code>etc...</code> <span style='font-size:20px'>→</span> <code>etc.</code></span>",mask:/etc(\.{3})/i,replace:e=>e.substring(0,3)+".",format:"",nbMoved:-2,category:"ellipsis"},{slug:"etcTwoDots",name:(0,l.__)('Two Dots Following "etc"',"consistency"),description:(0,l.__)('Replace 2 dots placed after the abbreviation "etc" with a period:',"consistency")+"<span aria-hidden='true' style='display:block;'><code>etc..</code> <span style='font-size:20px'>→</span> <code>etc.</code></span>",mask:/etc(\.{2})/i,replace:e=>e.substring(0,2)+".",format:"",nbMoved:-1,category:"ellipsis"},{slug:"etcEllipsis",name:(0,l.__)('Ellipsis Following "etc"',"consistency"),description:(0,l.__)('Replace the ellipsis placed after the abbreviation "etc" with a period:',"consistency")+"<span aria-hidden='true' style='display:block;'><code>etc…</code> <span style='font-size:20px'>→</span> <code>etc.</code></span>",mask:/etc(\.{3}|…)/i,replace:e=>e.substring(0,3)+".",format:"",nbMoved:0,category:"ellipsis"},{slug:"ellipsis",name:(0,l.__)("Ellipsis","consistency"),description:(0,l.__)("Replaces 3 dots with ellipsis:","consistency")+"<span aria-hidden='true' style='display:block;'><code>...</code> <span style='font-size:20px'>→</span> <code>…</code></span>",mask:/\.{3}/,replace:"…",format:"",nbMoved:-2,category:"ellipsis"},{slug:"symbolInACircle",name:(0,l.__)("Symbol in a Circle","consistency"),description:(0,l.__)("Replaces 1 character placed in parentheses with a symbol","consistency")+"<span aria-hidden='true' style='display:block;'><code>(c) (p) (r)</code> <span style='font-size:20px'>→</span> <code>© ℗ ®</code></span>",mask:/(\([c|p|r])(\))/,replace:e=>{switch(e[1]){case"c":return"©";case"p":return"℗";case"r":return"®"}return" "},format:"",nbMoved:-2,category:"symbol"},{slug:"symbolInSmallCapsAndSuperscriptStyle",name:(0,l.__)("Symbol in Small Caps and Superscript Style","consistency"),description:(0,l.__)("Replaces 2-character abbreviations with a symbol in small caps and superscript style","consistency")+"<span aria-hidden='true' style='display:block;'><code>tm sm md mc</code> <span style='font-size:20px'>→</span> <code>™ ℠ 🅫 🅪</code></span>",mask:/(?<= | |\(|\[|\{|:|^)(tm|sm|md|mc)(?= | |\.|\,|\;|\:|\)|\]|\}|$)/,replace:e=>{switch(e){case"tm":return"™";case"sm":return"℠";case"md":return"🅫";case"mc":return"🅪";default:return" "}},format:"",nbMoved:-1,category:"symbol"},{slug:"fractions",name:(0,l.__)("Fractions","consistency"),description:(0,l.__)("Replaces fractions with fraction symbols:","consistency")+"<span aria-hidden='true' style='display:block;'><code>1/2 3/5 1/9</code> <span style='font-size:20px'>→</span> <code>½ ⅗ ⅑</code></span>",mask:/[1-9]\/[1-9]/,replace:e=>{switch(e){case"1/4":return"¼";case"1/2":return"½";case"3/4":return"¾";case"1/3":return"⅓";case"2/3":return"⅔";case"1/5":return"⅕";case"2/5":return"⅖";case"3/5":return"⅗";case"4/5":return"⅘";case"1/6":return"⅙";case"5/6":return"⅚";case"1/8":return"⅛";case"3/8":return"⅜";case"5/8":return"⅝";case"7/8":return"⅞";case"1/7":return"⅐";case"1/9":return"⅑";default:return" "}},format:"",nbMoved:-2,category:"symbol"},{slug:"percentages",name:(0,l.__)("Percentages","consistency"),description:(0,l.__)("Replaces percentages with percentages symbols:","consistency")+"<span aria-hidden='true' style='display:block;'><code>0/0 0/00 0/000</code> <span style='font-size:20px'>→</span> <code>% ‰ ‱</code></span>",mask:/(0\/0|0\/00|0\/000)(?= | |\.|\,|\;|\:|\)|\]|\})(.)/,replace:e=>{const t=e.substring(0,e.length-1),s=e.substring(e.length-1,e.length);switch(t){case"0/0":return"%"+s;case"0/00":return"‰"+s;case"0/000":return"‱"+s;default:return" "+s}},format:"",nbMoved:e=>-(e.substring(0,e.length-1).length-1),category:"symbol"}],{getSelectionStart:P}=(0,p.select)("core/block-editor"),{selectionChange:F}=(0,p.dispatch)("core/block-editor"),R=()=>{const e=(()=>{const e=w("root","site");return e?.consistency_plugin_settings||[]})();return S()?e.filter((e=>$(e.slug))):e},Q=()=>B.filter((e=>!0===R()?.find((t=>t.slug===e.slug))?.value)),{getBlockName:W,getBlockAttributes:M}=(0,p.select)("core/block-editor"),$=e=>{const t=x();return!(void 0===localesByRules||!localesByRules.hasOwnProperty(e))&&localesByRules[e].includes(t)},N=e=>{const t=E.find((t=>t.slug===e));return!!t&&t.incompatibleWith.some((e=>R()?.find((t=>t.slug===e))?.value))},q=e=>{const{settingSlug:s,settingName:n,settingDescription:o}=e,{createNotice:c}=(0,p.useDispatch)(m.store);if(S()&&!$(s))return"";const[r,a]=(0,g.useEntityProp)("root","site","consistency_plugin_settings",void 0),{saveEditedEntityRecord:i}=(0,p.useDispatch)(g.store);return(0,t.createElement)(d.PanelRow,null,(0,t.createElement)(d.ToggleControl,{label:n,help:(0,t.createElement)("span",{dangerouslySetInnerHTML:o}),checked:r?.find((e=>e.slug===s))?.value||!1,disabled:N(s),onChange:e=>{let t=r.map((t=>s===t.slug?{...t,value:e}:t));a(t),i("root","site",void 0,t),c((0,l.__)("info","consistency"),e?(0,l.sprintf)((0,l.__)('"%1$s" Correction is enabled',"consistency"),n):(0,l.sprintf)((0,l.__)('"%1$s" Correction is disabled',"consistency"),n),{isDismissible:!0,type:"snackbar",speak:!0})}}))},A=[{slug:"apostrophe",label:(0,l.__)("Apostrophes","consistency"),description:(0,l.__)("Fixes related to apostrophes.","consistency")},{slug:"quotation",label:(0,l.__)("Quotation marks","consistency"),description:(0,l.__)("Fixes related to quotation marks.","consistency")},{slug:"dash",label:(0,l.__)("Dashes","consistency"),description:(0,l.__)("Fixes related to dashes.","consistency")},{slug:"suffixe",label:(0,l.__)("Suffixes","consistency"),description:(0,l.__)("Fixes related to suffixes.","consistency")},{slug:"space",label:(0,l.__)("Spaces","consistency"),description:(0,l.__)("Fixes related to spaces.","consistency")},{slug:"case",label:(0,l.__)("Case","consistency"),description:(0,l.__)("Fixes related to case.","consistency")},{slug:"ellipsis",label:(0,l.__)("Ellipsis","consistency"),description:(0,l.__)("Fixes related to ellipsis.","consistency")},{slug:"symbol",label:(0,l.__)("Symbols","consistency"),description:(0,l.__)("Fixes related to symbols.","consistency")}],z=()=>(0,t.createElement)(d.Panel,{className:"GlobalSettingPanel"},(0,t.createElement)(d.PanelHeader,null,(0,t.createElement)("strong",null,(0,l.__)("Global correction rules","consistency"),(0,t.createElement)(C,null))),[...A].map(((e,s)=>(0,t.createElement)(d.PanelBody,{key:s,title:(0,l.__)(e.label,"consistency"),initialOpen:!1},[...B].filter((t=>t.category===e.slug)).map(((e,s)=>(0,t.createElement)(q,{key:s,settingSlug:e.slug,settingName:e.name,settingDescription:{__html:e.description}}))))))),{canUser:I}=(0,p.select)("core"),O=()=>{const e=I("create","users");return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.PluginSidebar,{name:"consistency-custom-sidebar",title:(0,l.__)("Consistency","consistency"),icon:y},(0,t.createElement)(f,null),e&&(0,t.createElement)(z,null)),(0,t.createElement)(u.PluginSidebarMoreMenuItem,{target:"consistency-custom-sidebar"},(0,l.__)("Consistency Settings","consistency")))},{getBlock:D,getBlocks:L,getBlockAttributes:G,getSelectionStart:j,isTyping:U}=(0,p.select)("core/block-editor"),{updateBlockAttributes:H,updateBlock:K}=(0,p.dispatch)("core/block-editor"),V=e=>{const{currentBlockId:t,isPreviousFixCanceled:s,setPreviousFixCanceled:n,blocksToBeProcessed:o,cursorOffsetRef:c}=e;if(!(e=>{const{currentBlockId:t,blocksToBeProcessed:s}=e,n=W(t);return!!s.includes(n)})({currentBlockId:t,blocksToBeProcessed:o})||!(e=>{const t=M(e);return!(!t||!t.hasOwnProperty("content")||!_(t.content)&&!k(t.content))})(t))return;let r=Q();const a=D(t);let i=G(t),l=!1;Object.entries(r).forEach((([e,o])=>{if(l)return;if(""!==o.format)return;i.content;let r,u=o.replace,p="",d="",y=0,g=0,m=("object"==typeof i.content&&i.content,"object"==typeof i.content?i.content.text:i.content),h=(e=>e.replace(/<\b(code|pre|kbd)\b>.*?<\/\b(code|pre|kbd)\b>/gi,"").replace(/(<([^>]+)>)/gi,""))(m),f=!1;if(U()||(f=o.mask.test(h)),U()){r=j(),y=r?.offset||document.getSelection()?.anchorOffset||0,g=(e=>{const t=document.querySelector(`#block-${e}`);if(null===t)return;const s=t.querySelector('[contenteditable="true"]')||t,n=document.getSelection(),o=n?.getRangeAt(0);if(!o||!o.collapsed)return;const c=o.cloneRange(),r=document.createTextNode("\0");c.insertNode(r);const a=s.textContent||"";let i=a.indexOf("\0");r.parentNode.removeChild(r),s.normalize();const l=(s?.innerHTML.match(/ /g)||[]).length;return l>0&&(i=a.replace(/ /g," ").indexOf("\0"),i=i-6*l+l),i})(t)||y;const e=h.match(o.mask);if(null===e||0===e.length)return;const s=e[0].length||1;p=h.substring(0,g-s),d=h.substring(g-s,h.length),f=o.mask.test(h)&&o.mask.test(d)}if(!f)return;if((e=>!!T.includes(e.slug))(o)&&(u=((e,t,s)=>{const n=e.replace.charAt(0),o=e.replace.charAt(e.replace.length-1),c=e.replace.substring(1,e.replace.indexOf("$"))||"";let r="";0!==[...e.replace.matchAll(/[0-9]/g)].length&&(r=e.replace.substring([...e.replace.matchAll(/[0-9]/g)].pop().index+1,e.replace.length-1));const a=new RegExp(`${n}`,"g"),i=new RegExp(`${o}`,"g");return(t.match(a)||[]).length===(t.match(i)||[]).length?n+c:r+o})(o,m)),0!==g){const e=J({firstPart:p,lastPart:d,mask:o.mask,replaceValue:u});if(null===e)return;m=e}if(0===g&&(m=m.replace(o.mask,o.replace)),s)return void n(!1);s||""!==o.format||(l=(e=>{const{block:t,currentBlockId:s,blockAttributes:n,blockContent:o}=e;let c;if(k(n.content)){const e=(0,b.create)({...n.content,text:o});c=new b.RichTextData(e)}return _(n.content)&&(c=o),void 0!==c&&(v(s,{...t,attributes:{...n,content:c}}),!0)})({block:a,currentBlockId:t,blockAttributes:i,blockContent:m}));const w="function"==typeof o.nbMoved?o.nbMoved(d):o.nbMoved||0;l&&(c.current=w)}))},J=({firstPart:e,lastPart:t,mask:s,replaceValue:n})=>{if("string"!=typeof t)return null;let o=!1;const c=t.replace(s,((...e)=>{o=!0;const t=e[0];if("function"==typeof n)return n(...e);const c=new RegExp(s.source,s.flags);return t.replace(c,n)}));return o?e+c:null},{getSelectedBlockClientId:X,isTyping:Y,getBlockAttributes:Z}=(0,p.select)("core/block-editor"),ee=window.wp.blocks,te=()=>((()=>{const{isEditorInIframe:e,isContentPastedRef:t}=(0,c.useContext)(i),s=(0,c.useRef)(!1);(0,c.useEffect)((()=>{if(s.current)return;const n=e=>{t.current=!0},o=e=>(e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}),c=e?document.querySelector('iframe[name="editor-canvas"]'):document.querySelector("#editor");if(!c)return;const r=o(c);return e&&"complete"===c.contentWindow.document.readyState&&o(c),s.current=!0,r}),[e])})(),(()=>{const{isEditorInIframe:e,setPreviousFixCanceled:t}=(0,c.useContext)(i),s=(0,c.useRef)(!1);(0,c.useEffect)((()=>{if(s.current)return;const n=e=>{90===e.keyCode&&(e.ctrlKey||e.metaKey)&&t(!0)},o=e=>(e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n)}),c=e?document.querySelector('iframe[name="editor-canvas"]'):document.querySelector("#editor");if(!c)return;const r=o(c);return e&&"complete"===c.contentWindow.document.readyState&&o(c),s.current=!0,r}),[t])})(),(()=>{const{setBlocksToBeProcessed:e}=(0,c.useContext)(i);(0,c.useEffect)((()=>{let t=(0,ee.getBlockTypes)().filter((e=>e.attributes&&e.attributes.content&&("string"===e.attributes.content.type||"rich-text"===e.attributes.content.type)));const s=["core/html"];t=t.filter((e=>!s.includes(e.name))),console.log("Consistency - Blocks that can be processed:",t),e(t.map((e=>e.name)))}),[])})(),(()=>{const{isPreviousFixCanceled:e,setPreviousFixCanceled:t,previousFixCanceledContent:s,setPreviousFixCanceledContent:n,blocksToBeProcessed:o,cursorOffsetRef:r,isContentPastedRef:a}=(0,c.useContext)(i);r.current=r.current||0,a.current=a.current||!1,(0,c.useEffect)((()=>{const c=(0,p.subscribe)((()=>{const{onTheFly:c,onPaste:i}=(()=>{const e={onTheFly:!1,onPaste:!1},t=(0,p.select)(g.store).getCurrentUser(),s=w("root","user",t?.id||0,"consistency_plugin_user_settings"),n=s?.meta?.consistency_plugin_user_settings;return e.onTheFly=n?.find((e=>"on_the_fly"===e.slug))?.value||!1,e.onPaste=n?.find((e=>"on_paste"===e.slug))?.value||!1,e})();if(!c&&!i)return;if(void 0===R())return;if(i&&!0===a.current)return a.current=!1,void(e=>{const{isPreviousFixCanceled:t,setPreviousFixCanceled:s,blocksToBeProcessed:n,cursorOffsetRef:o}=e;let c=Q();const r=L(),a=r.flatMap((({innerBlocks:e,...t})=>e.map((e=>({...t,...e}))))),i=r.reduce(((e,t)=>{let s=t.attributes?.content;return n.includes(t.name)&&void 0!==s?(Object.entries(c).forEach((([e,t])=>{if(T.includes(t.slug)){const e=t.mask.toString().match(/(?<=\/).+?(?=\/)/g)[0],n=new RegExp(`(?<!=)${e}(?!>)([^${e}]*)(?<!=)${e}(?!>)`,"g");s=s.replaceAll(n,t.replace)}if(!T.includes(t.slug)){const e=t.mask.toString(),n=new RegExp(e.substring(1,e.length-1),"g");s=s.replaceAll(n,t.replace)}})),void 0!==s&&(e[t.clientId]={content:s}),e):e}),{});Object.keys(i).length>0&&H(Object.keys(i),i,!0),a.forEach((e=>{if(!n.includes(e.name))return;const c=e.clientId;e?.clientId&&V({currentBlockId:c,isPreviousFixCanceled:t,setPreviousFixCanceled:s,blocksToBeProcessed:n,cursorOffsetRef:o})}))})({isPreviousFixCanceled:e,setPreviousFixCanceled:t,blocksToBeProcessed:o,cursorOffsetRef:r});const l=X();if(null===l||!c)return;const u=Z(l);u&&(u.hasOwnProperty("content")&&s===u.content||(n(u.content),Y()&&V({currentBlockId:l,isPreviousFixCanceled:e,setPreviousFixCanceled:t,blocksToBeProcessed:o,cursorOffsetRef:r})))}));return()=>{c(),(e=>{const t=window.getSelection(),s=P();if(!t)return;let n;if(null===t.anchorNode){if(null===s||null===s?.clientId)return;return n=s?.offset||0,void F(s.clientId,s.attributeKey,n+e,n+e)}1===t?.anchorNode?.nodeType&&(n=t.anchorNode?.firstChild?.length||0),3===t?.anchorNode?.nodeType&&(n=t.anchorOffset||0);const o=e>=0?n+e:n;if(1!==t?.anchorNode?.nodeType)if(3!==t?.anchorNode?.nodeType);else{const e=t.anchorNode;t.collapse(e,o)}else{const e=t.anchorNode?.firstChild||t.anchorNode?.childNodes[0];t.collapse(e,o)}})(r.current),r.current=0}}),[e,t,s,n,o,r,a])})(),(0,t.createElement)(O,null)),se=()=>(0,t.createElement)(a,null,(0,t.createElement)(te,null));o()((()=>{(0,s.registerPlugin)("consistency-custom-sidebar",{render:se})}))})(); -
consistency/trunk/changelog.txt
r3277079 r3405619 148 148 149 149 * Plugin initial commit. Let's write =^.^= 150 -
consistency/trunk/composer.json
r3122806 r3405619 16 16 ], 17 17 "require": { 18 "php": ">= 7.4"18 "php": ">=8.1" 19 19 }, 20 20 "require-dev": { -
consistency/trunk/composer.lock
r3122806 r3405619 5 5 "This file is @generated automatically" 6 6 ], 7 "content-hash": " f8f5c68ad13fdf708cf8fd467ec9001b",7 "content-hash": "74009a08b7da1b6f32e03d75c9109217", 8 8 "packages": [], 9 9 "packages-dev": [ … … 1035 1035 "prefer-lowest": false, 1036 1036 "platform": { 1037 "php": ">= 7.4"1037 "php": ">=8.1" 1038 1038 }, 1039 "platform-dev": [],1040 "plugin-api-version": "2. 3.0"1039 "platform-dev": {}, 1040 "plugin-api-version": "2.6.0" 1041 1041 } -
consistency/trunk/consistency.php
r3277079 r3405619 4 4 * Plugin URI: https://www.webaxones.com 5 5 * Description: Fixes typographic and punctuation consistency 6 * Version: 1.8. 36 * Version: 1.8.4 7 7 * Requires at least: 6.1 8 8 * Requires PHP: 7.4 -
consistency/trunk/includes/MetaData/MetaData.php
r3145550 r3405619 136 136 public function update(): void 137 137 { 138 $difference = $this->getDifferenceBetweenTwoObjectArray( (array) $this->currentValue, (array) $this->value ); 139 140 if ( empty( $difference ) ) { 138 if ( ! is_array( $this->value ) ) { 139 update_metadata( $this->object->getType(), $this->object->getId(), $this->metaKey, $this->value, '' ); 141 140 return; 142 141 } 143 142 144 update_metadata( $this->object->getType(), $this->object->getId(), $this->metaKey, $difference, '' ); 143 if ( null === $this->currentValue ) { 144 $this->fetchAndSetCurrentValue(); 145 } 146 147 if ( ! is_array( $this->currentValue ) ) { 148 update_metadata( $this->object->getType(), $this->object->getId(), $this->metaKey, $this->value, '' ); 149 return; 150 } 151 152 // Keep user overrides while aligning with the latest schema. 153 $normalizedValues = $this->synchronizeObjectArraysBySlug( 154 (array) $this->currentValue, 155 (array) $this->value 156 ); 157 158 if ( $normalizedValues === $this->currentValue ) { 159 return; 160 } 161 162 update_metadata( $this->object->getType(), $this->object->getId(), $this->metaKey, $normalizedValues, '' ); 145 163 } 146 164 } -
consistency/trunk/includes/Option/Option.php
r3130518 r3405619 62 62 public function add(): void 63 63 { 64 if ( null !== $this->get() ) { 65 $this->update( $this->optionName, $this->get(), $this->value ); 64 $currentValue = $this->get(); 65 66 if ( null === $currentValue ) { 67 add_option( $this->optionName, $this->value ); 68 return; 66 69 } 67 70 68 if ( null === $this->get() ) { 69 add_option( $this->optionName, $this->value ); 70 } 71 $this->update(); 71 72 } 72 73 … … 89 90 } 90 91 91 $ difference = $this->getDifferenceBetweenTwoObjectArray( (array) $this->get(), (array) $this->value);92 $currentValue = $this->get(); 92 93 93 if ( empty( $difference ) ) { 94 if ( ! is_array( $currentValue ) ) { 95 update_option( $this->optionName, $this->value ); 94 96 return; 95 97 } 96 98 97 update_option( $this->optionName, $difference ); 99 // Keep user overrides while aligning with the latest schema. 100 $normalizedValues = $this->synchronizeObjectArraysBySlug( 101 (array) $currentValue, 102 (array) $this->value 103 ); 104 105 if ( $normalizedValues === $currentValue ) { 106 return; 107 } 108 109 update_option( $this->optionName, $normalizedValues ); 98 110 } 99 111 } -
consistency/trunk/includes/Utils/Concerns/ObjectArrayTrait.php
r3145550 r3405619 8 8 { 9 9 /** 10 * Get difference between 2 object arrays with same schema: slug - value10 * Synchronize two slug-indexed object arrays to keep user values across schema changes. 11 11 * 12 * @return string 12 * @param array $storedValue Current value stored in database. 13 * @param array $referenceValue Reference shape that contains the latest schema. 14 * 15 * @return array Normalized array ready to be persisted. 13 16 */ 14 p ublic function getDifferenceBetweenTwoObjectArray( array $array1, array $array2): array17 protected function synchronizeObjectArraysBySlug( array $storedValue, array $referenceValue ): array 15 18 { 16 if ( empty( $ array1) ) {17 return $ array2;19 if ( empty( $referenceValue ) ) { 20 return $storedValue; 18 21 } 19 if ( empty( $array2 ) ) { 22 23 if ( empty( $storedValue ) ) { 24 return $referenceValue; 25 } 26 27 $storedBySlug = $this->indexObjectArrayBySlug( $storedValue ); 28 $normalized = []; 29 30 foreach ( $referenceValue as $referenceEntry ) { 31 $slug = $referenceEntry['slug'] ?? ''; 32 33 if ( '' === $slug ) { 34 continue; 35 } 36 37 $existingEntry = $storedBySlug[ $slug ] ?? []; 38 $normalized[] = $this->mergeObjectArrayEntry( $referenceEntry, $existingEntry ); 39 unset( $storedBySlug[ $slug ] ); 40 } 41 42 if ( empty( $storedBySlug ) ) { 43 return $normalized; 44 } 45 46 // Keep custom slugs added via filters even if the core schema dropped them. 47 foreach ( $storedBySlug as $remainingEntry ) { 48 if ( empty( $remainingEntry['slug'] ) ) { 49 continue; 50 } 51 52 $normalized[] = $remainingEntry; 53 } 54 55 return $normalized; 56 } 57 58 /** 59 * Build an associative array keyed by slug for faster lookups. 60 * 61 * @param array $objects Objects that contain a slug key. 62 * 63 * @return array 64 */ 65 protected function indexObjectArrayBySlug( array $objects ): array 66 { 67 if ( empty( $objects ) ) { 20 68 return []; 21 69 } 22 return array_udiff( 23 $array1, 24 $array2, 25 function ( $a, $b ) { 26 return strcmp( $a['slug'], $b['slug'] ); 70 71 $indexed = []; 72 73 foreach ( $objects as $object ) { 74 $slug = $object['slug'] ?? ''; 75 76 if ( '' === $slug ) { 77 continue; 27 78 } 28 ); 79 80 $indexed[ $slug ] = $object; 81 } 82 83 return $indexed; 84 } 85 86 /** 87 * Merge one reference entry with the stored entry while preserving user choices. 88 * 89 * @param array $referenceEntry Entry that represents the latest schema. 90 * @param array $storedEntry Entry saved in the database, can be empty. 91 * 92 * @return array 93 */ 94 protected function mergeObjectArrayEntry( array $referenceEntry, array $storedEntry ): array 95 { 96 if ( empty( $storedEntry ) ) { 97 return $referenceEntry; 98 } 99 100 $merged = $referenceEntry; 101 102 if ( array_key_exists( 'value', $storedEntry ) ) { 103 $merged['value'] = $storedEntry['value']; 104 } 105 106 foreach ( $storedEntry as $key => $value ) { 107 if ( array_key_exists( $key, $referenceEntry ) ) { 108 continue; 109 } 110 111 $merged[ $key ] = $value; 112 } 113 114 return $merged; 29 115 } 30 116 } -
consistency/trunk/package.json
r3277079 r3405619 1 1 { 2 2 "name": "consistency", 3 "version": "1.8. 3",3 "version": "1.8.4", 4 4 "description": "", 5 5 "main": "index.js", -
consistency/trunk/readme.txt
r3277079 r3405619 3 3 Tags: punctuation, typography, block editor, gutenberg 4 4 Requires at least: 6.1 5 Tested up to: 6. 86 Stable tag: 1.8. 35 Tested up to: 6.9 6 Stable tag: 1.8.4 7 7 Requires PHP: 7.4 8 8 License: GPL-3.0-or-later … … 70 70 == Changelog == 71 71 72 = 1.8.4 = 73 * Correctif : enregistrement des réglages fiabilisé. 74 * Correctif : ajustement de sprintf pour garantir la compatibilité avec WordPress 6.9. 75 72 76 = 1.8.3 = 73 77 * Add: Indicate compatibility with WordPress 6.8 -
consistency/trunk/src/app/fixes.js
r3184822 r3405619 121 121 // Concat strings 122 122 if ( 0 !== cursorPositionInsideHTML ) { 123 blockContent = firstPart + lastPart.replace( rule.mask, replaceWithThis ) 123 const typedReplacement = getTypedReplacementResult( { 124 firstPart, 125 lastPart, 126 mask: rule.mask, 127 replaceValue: replaceWithThis 128 } ) 129 130 if ( typedReplacement === null ) { 131 return 132 } 133 134 blockContent = typedReplacement 124 135 } 125 136 … … 249 260 250 261 } 262 263 /** 264 * Compute updated text content when applying a replacement at the cursor position. 265 * 266 * @param {Object} props Replacement context. 267 * @param {string} props.firstPart Text preceding the replaced fragment. 268 * @param {string} props.lastPart Text starting at the fragment to replace. 269 * @param {RegExp} props.mask Regular expression used for the replacement. 270 * @param {string|Function} props.replaceValue Replacement value or callback. 271 * @return {string|null} 272 */ 273 const getTypedReplacementResult = ( { firstPart, lastPart, mask, replaceValue } ) => { 274 if ( typeof lastPart !== 'string' ) { 275 return null 276 } 277 278 let hasReplacement = false 279 280 const replacementResult = lastPart.replace( mask, ( ...args ) => { 281 hasReplacement = true 282 const match = args[0] 283 284 if ( typeof replaceValue === 'function' ) { 285 return replaceValue( ...args ) 286 } 287 288 const localMask = new RegExp( mask.source, mask.flags ) 289 return match.replace( localMask, replaceValue ) 290 } ) 291 292 if ( ! hasReplacement ) { 293 return null 294 } 295 296 return firstPart + replacementResult 297 } -
consistency/trunk/src/components/GlobalSettingToggle.js
r3145550 r3405619 1 1 /** 2 2 * @summary: GlobalSettingToggle component. 3 * 3 * 4 4 * This file contains the GlobalSettingToggle component used to display the plugin's global settings in sidebar. 5 5 * @author Loïc Antignac. … … 9 9 * WordPress dependencies 10 10 */ 11 import { __ } from '@wordpress/i18n'11 import { __, sprintf } from '@wordpress/i18n' 12 12 import { useDispatch } from '@wordpress/data' 13 13 import { PanelRow, ToggleControl } from '@wordpress/components' -
consistency/trunk/src/components/UserSettingToggle.js
r3145550 r3405619 1 1 /** 2 2 * @summary: UserSettingToggle component. 3 * 3 * 4 4 * This file contains the UserSettingToggle component used to display the plugin's user settings in sidebar. 5 5 * @author Loïc Antignac. … … 9 9 * WordPress dependencies 10 10 */ 11 import { __ } from '@wordpress/i18n'11 import { __, sprintf } from '@wordpress/i18n' 12 12 import { useDispatch, useSelect } from '@wordpress/data' 13 13 import { ToggleControl } from '@wordpress/components' -
consistency/trunk/src/config/rules.js
r3184822 r3405619 10 10 * WordPress dependencies 11 11 */ 12 import { __ } from '@wordpress/i18n'12 import { __, sprintf } from '@wordpress/i18n' 13 13 14 14 export const rules = [ … … 398 398 }, 399 399 ] 400 -
consistency/trunk/vendor/autoload.php
r3092549 r3405619 15 15 } 16 16 } 17 trigger_error( 18 $err, 19 E_USER_ERROR 20 ); 17 throw new RuntimeException($err); 21 18 } 22 19 -
consistency/trunk/vendor/composer/InstalledVersions.php
r3122806 r3405619 28 28 { 29 29 /** 30 * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to 31 * @internal 32 */ 33 private static $selfDir = null; 34 35 /** 30 36 * @var mixed[]|null 31 37 * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null 32 38 */ 33 39 private static $installed; 40 41 /** 42 * @var bool 43 */ 44 private static $installedIsLocalDir; 34 45 35 46 /** … … 310 321 self::$installed = $data; 311 322 self::$installedByVendor = array(); 323 324 // when using reload, we disable the duplicate protection to ensure that self::$installed data is 325 // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not, 326 // so we have to assume it does not, and that may result in duplicate data being returned when listing 327 // all installed packages for example 328 self::$installedIsLocalDir = false; 329 } 330 331 /** 332 * @return string 333 */ 334 private static function getSelfDir() 335 { 336 if (self::$selfDir === null) { 337 self::$selfDir = strtr(__DIR__, '\\', '/'); 338 } 339 340 return self::$selfDir; 312 341 } 313 342 … … 323 352 324 353 $installed = array(); 354 $copiedLocalDir = false; 325 355 326 356 if (self::$canGetVendors) { 357 $selfDir = self::getSelfDir(); 327 358 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 359 $vendorDir = strtr($vendorDir, '\\', '/'); 328 360 if (isset(self::$installedByVendor[$vendorDir])) { 329 361 $installed[] = self::$installedByVendor[$vendorDir]; … … 331 363 /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ 332 364 $required = require $vendorDir.'/composer/installed.php'; 333 $installed[] = self::$installedByVendor[$vendorDir] = $required; 334 if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { 335 self::$installed = $installed[count($installed) - 1]; 365 self::$installedByVendor[$vendorDir] = $required; 366 $installed[] = $required; 367 if (self::$installed === null && $vendorDir.'/composer' === $selfDir) { 368 self::$installed = $required; 369 self::$installedIsLocalDir = true; 336 370 } 371 } 372 if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) { 373 $copiedLocalDir = true; 337 374 } 338 375 } … … 351 388 } 352 389 353 if (self::$installed !== array() ) {390 if (self::$installed !== array() && !$copiedLocalDir) { 354 391 $installed[] = self::$installed; 355 392 } -
consistency/trunk/vendor/composer/autoload_classmap.php
r3122806 r3405619 11 11 'Webaxones\\Consistency\\Asset\\Asset' => $baseDir . '/includes/Asset/Asset.php', 12 12 'Webaxones\\Consistency\\Config\\Languages' => $baseDir . '/includes/Config/Languages.php', 13 'Webaxones\\Consistency\\Config\\LocalizationManagement' => $baseDir . '/includes/Config/LocalizationManagement.php', 13 14 'Webaxones\\Consistency\\Config\\LocalizedRules' => $baseDir . '/includes/Config/LocalizedRules.php', 14 15 'Webaxones\\Consistency\\Config\\RestSchema' => $baseDir . '/includes/Config/RestSchema.php', -
consistency/trunk/vendor/composer/autoload_static.php
r3122806 r3405619 34 34 'Webaxones\\Consistency\\Asset\\Asset' => __DIR__ . '/../..' . '/includes/Asset/Asset.php', 35 35 'Webaxones\\Consistency\\Config\\Languages' => __DIR__ . '/../..' . '/includes/Config/Languages.php', 36 'Webaxones\\Consistency\\Config\\LocalizationManagement' => __DIR__ . '/../..' . '/includes/Config/LocalizationManagement.php', 36 37 'Webaxones\\Consistency\\Config\\LocalizedRules' => __DIR__ . '/../..' . '/includes/Config/LocalizedRules.php', 37 38 'Webaxones\\Consistency\\Config\\RestSchema' => __DIR__ . '/../..' . '/includes/Config/RestSchema.php', -
consistency/trunk/vendor/composer/installed.php
r3122806 r3405619 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' e595262819000eef15c4a7d1d98f998f376acf4f',6 'reference' => '67486ad7060c7aa3f7a3d3f928413842f601bbb5', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 34 34 'reference' => '0ec6bad5f4523eda2514e89d5ea48cde6ebe7f99', 35 35 'type' => 'metapackage', 36 'install_path' => NULL,36 'install_path' => null, 37 37 'aliases' => array( 38 38 0 => '9999999-dev', … … 52 52 'pretty_version' => 'dev-master', 53 53 'version' => 'dev-master', 54 'reference' => ' e595262819000eef15c4a7d1d98f998f376acf4f',54 'reference' => '67486ad7060c7aa3f7a3d3f928413842f601bbb5', 55 55 'type' => 'wordpress-plugin', 56 56 'install_path' => __DIR__ . '/../../', -
consistency/trunk/vendor/composer/platform_check.php
r3084555 r3405619 5 5 $issues = array(); 6 6 7 if (!(PHP_VERSION_ID >= 70400)) {8 $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';7 if (!(PHP_VERSION_ID >= 80100)) { 8 $issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.'; 9 9 } 10 10
Note: See TracChangeset
for help on using the changeset viewer.