@wordpress/format-library 5.32.0 → 5.32.1-next.ff1cebbba.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/build/bold/index.js +69 -58
  2. package/build/bold/index.js.map +7 -1
  3. package/build/code/index.js +62 -54
  4. package/build/code/index.js.map +7 -1
  5. package/build/default-formats.js +52 -24
  6. package/build/default-formats.js.map +7 -1
  7. package/build/image/index.js +185 -153
  8. package/build/image/index.js.map +7 -1
  9. package/build/index.js +28 -18
  10. package/build/index.js.map +7 -1
  11. package/build/italic/index.js +69 -58
  12. package/build/italic/index.js.map +7 -1
  13. package/build/keyboard/index.js +47 -36
  14. package/build/keyboard/index.js.map +7 -1
  15. package/build/language/index.js +145 -113
  16. package/build/language/index.js.map +7 -1
  17. package/build/link/css-classes-setting.js +81 -0
  18. package/build/link/css-classes-setting.js.map +7 -0
  19. package/build/link/index.js +162 -167
  20. package/build/link/index.js.map +7 -1
  21. package/build/link/inline.js +186 -174
  22. package/build/link/inline.js.map +7 -1
  23. package/build/link/use-link-instance-key.js +25 -19
  24. package/build/link/use-link-instance-key.js.map +7 -1
  25. package/build/link/utils.js +66 -115
  26. package/build/link/utils.js.map +7 -1
  27. package/build/lock-unlock.js +31 -15
  28. package/build/lock-unlock.js.map +7 -1
  29. package/build/non-breaking-space/index.js +44 -28
  30. package/build/non-breaking-space/index.js.map +7 -1
  31. package/build/strikethrough/index.js +57 -42
  32. package/build/strikethrough/index.js.map +7 -1
  33. package/build/subscript/index.js +47 -36
  34. package/build/subscript/index.js.map +7 -1
  35. package/build/superscript/index.js +47 -36
  36. package/build/superscript/index.js.map +7 -1
  37. package/build/text-color/index.js +102 -70
  38. package/build/text-color/index.js.map +7 -1
  39. package/build/text-color/inline.js +118 -116
  40. package/build/text-color/inline.js.map +7 -1
  41. package/build/underline/index.js +62 -40
  42. package/build/underline/index.js.map +7 -1
  43. package/build/unknown/index.js +51 -37
  44. package/build/unknown/index.js.map +7 -1
  45. package/build-module/bold/index.js +52 -52
  46. package/build-module/bold/index.js.map +7 -1
  47. package/build-module/code/index.js +41 -46
  48. package/build-module/code/index.js.map +7 -1
  49. package/build-module/default-formats.js +34 -19
  50. package/build-module/default-formats.js.map +7 -1
  51. package/build-module/image/index.js +174 -144
  52. package/build-module/image/index.js.map +7 -1
  53. package/build-module/index.js +6 -14
  54. package/build-module/index.js.map +7 -1
  55. package/build-module/italic/index.js +52 -52
  56. package/build-module/italic/index.js.map +7 -1
  57. package/build-module/keyboard/index.js +25 -30
  58. package/build-module/keyboard/index.js.map +7 -1
  59. package/build-module/language/index.js +128 -105
  60. package/build-module/language/index.js.map +7 -1
  61. package/build-module/link/css-classes-setting.js +67 -0
  62. package/build-module/link/css-classes-setting.js.map +7 -0
  63. package/build-module/link/index.js +128 -146
  64. package/build-module/link/index.js.map +7 -1
  65. package/build-module/link/inline.js +158 -154
  66. package/build-module/link/inline.js.map +7 -1
  67. package/build-module/link/use-link-instance-key.js +7 -14
  68. package/build-module/link/use-link-instance-key.js.map +7 -1
  69. package/build-module/link/utils.js +46 -101
  70. package/build-module/link/utils.js.map +7 -1
  71. package/build-module/lock-unlock.js +8 -7
  72. package/build-module/lock-unlock.js.map +7 -1
  73. package/build-module/non-breaking-space/index.js +22 -22
  74. package/build-module/non-breaking-space/index.js.map +7 -1
  75. package/build-module/strikethrough/index.js +38 -36
  76. package/build-module/strikethrough/index.js.map +7 -1
  77. package/build-module/subscript/index.js +25 -30
  78. package/build-module/subscript/index.js.map +7 -1
  79. package/build-module/superscript/index.js +25 -30
  80. package/build-module/superscript/index.js.map +7 -1
  81. package/build-module/text-color/index.js +72 -61
  82. package/build-module/text-color/index.js.map +7 -1
  83. package/build-module/text-color/inline.js +107 -106
  84. package/build-module/text-color/inline.js.map +7 -1
  85. package/build-module/underline/index.js +43 -34
  86. package/build-module/underline/index.js.map +7 -1
  87. package/build-module/unknown/index.js +26 -28
  88. package/build-module/unknown/index.js.map +7 -1
  89. package/build-style/style-rtl.css +0 -194
  90. package/build-style/style.css +0 -194
  91. package/package.json +21 -15
  92. package/src/image/style.scss +3 -0
  93. package/src/link/css-classes-setting.js +89 -0
  94. package/src/link/index.js +1 -0
  95. package/src/link/inline.js +19 -0
  96. package/src/link/style.scss +3 -0
  97. package/src/link/test/css-classes-setting.js +144 -0
  98. package/src/link/utils.js +8 -0
  99. package/src/style.scss +4 -4
  100. package/src/text-color/style.scss +2 -0
  101. package/build/default-formats.native.js +0 -16
  102. package/build/default-formats.native.js.map +0 -1
  103. package/build/link/index.native.js +0 -174
  104. package/build/link/index.native.js.map +0 -1
  105. package/build/link/modal-screens/link-picker-screen.native.js +0 -67
  106. package/build/link/modal-screens/link-picker-screen.native.js.map +0 -1
  107. package/build/link/modal-screens/link-settings-screen.native.js +0 -226
  108. package/build/link/modal-screens/link-settings-screen.native.js.map +0 -1
  109. package/build/link/modal-screens/screens.native.js +0 -11
  110. package/build/link/modal-screens/screens.native.js.map +0 -1
  111. package/build/link/modal.native.js +0 -53
  112. package/build/link/modal.native.js.map +0 -1
  113. package/build/text-color/index.native.js +0 -134
  114. package/build/text-color/index.native.js.map +0 -1
  115. package/build/text-color/inline.native.js +0 -150
  116. package/build/text-color/inline.native.js.map +0 -1
  117. package/build-module/default-formats.native.js +0 -10
  118. package/build-module/default-formats.native.js.map +0 -1
  119. package/build-module/link/index.native.js +0 -166
  120. package/build-module/link/index.native.js.map +0 -1
  121. package/build-module/link/modal-screens/link-picker-screen.native.js +0 -59
  122. package/build-module/link/modal-screens/link-picker-screen.native.js.map +0 -1
  123. package/build-module/link/modal-screens/link-settings-screen.native.js +0 -218
  124. package/build-module/link/modal-screens/link-settings-screen.native.js.map +0 -1
  125. package/build-module/link/modal-screens/screens.native.js +0 -5
  126. package/build-module/link/modal-screens/screens.native.js.map +0 -1
  127. package/build-module/link/modal.native.js +0 -45
  128. package/build-module/link/modal.native.js.map +0 -1
  129. package/build-module/text-color/index.native.js +0 -126
  130. package/build-module/text-color/index.native.js.map +0 -1
  131. package/build-module/text-color/inline.native.js +0 -142
  132. package/build-module/text-color/inline.native.js.map +0 -1
@@ -1,43 +1,52 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { __ } from '@wordpress/i18n';
5
- import { toggleFormat } from '@wordpress/rich-text';
6
- import { RichTextShortcut, __unstableRichTextInputEvent } from '@wordpress/block-editor';
7
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
8
- const name = 'core/underline';
9
- const title = __('Underline');
10
- export const underline = {
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { __ } from "@wordpress/i18n";
3
+ import { toggleFormat } from "@wordpress/rich-text";
4
+ import {
5
+ RichTextShortcut,
6
+ __unstableRichTextInputEvent
7
+ } from "@wordpress/block-editor";
8
+ const name = "core/underline";
9
+ const title = __("Underline");
10
+ const underline = {
11
11
  name,
12
12
  title,
13
- tagName: 'span',
13
+ tagName: "span",
14
14
  className: null,
15
15
  attributes: {
16
- style: 'style'
16
+ style: "style"
17
17
  },
18
- edit({
19
- value,
20
- onChange
21
- }) {
18
+ edit({ value, onChange }) {
22
19
  const onToggle = () => {
23
- onChange(toggleFormat(value, {
24
- type: name,
25
- attributes: {
26
- style: 'text-decoration: underline;'
27
- },
28
- title
29
- }));
20
+ onChange(
21
+ toggleFormat(value, {
22
+ type: name,
23
+ attributes: {
24
+ style: "text-decoration: underline;"
25
+ },
26
+ title
27
+ })
28
+ );
30
29
  };
31
- return /*#__PURE__*/_jsxs(_Fragment, {
32
- children: [/*#__PURE__*/_jsx(RichTextShortcut, {
33
- type: "primary",
34
- character: "u",
35
- onUse: onToggle
36
- }), /*#__PURE__*/_jsx(__unstableRichTextInputEvent, {
37
- inputType: "formatUnderline",
38
- onInput: onToggle
39
- })]
40
- });
30
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
31
+ /* @__PURE__ */ jsx(
32
+ RichTextShortcut,
33
+ {
34
+ type: "primary",
35
+ character: "u",
36
+ onUse: onToggle
37
+ }
38
+ ),
39
+ /* @__PURE__ */ jsx(
40
+ __unstableRichTextInputEvent,
41
+ {
42
+ inputType: "formatUnderline",
43
+ onInput: onToggle
44
+ }
45
+ )
46
+ ] });
41
47
  }
42
48
  };
43
- //# sourceMappingURL=index.js.map
49
+ export {
50
+ underline
51
+ };
52
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["__","toggleFormat","RichTextShortcut","__unstableRichTextInputEvent","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","name","title","underline","tagName","className","attributes","style","edit","value","onChange","onToggle","type","children","character","onUse","inputType","onInput"],"sources":["@wordpress/format-library/src/underline/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { toggleFormat } from '@wordpress/rich-text';\nimport {\n\tRichTextShortcut,\n\t__unstableRichTextInputEvent,\n} from '@wordpress/block-editor';\n\nconst name = 'core/underline';\nconst title = __( 'Underline' );\n\nexport const underline = {\n\tname,\n\ttitle,\n\ttagName: 'span',\n\tclassName: null,\n\tattributes: {\n\t\tstyle: 'style',\n\t},\n\tedit( { value, onChange } ) {\n\t\tconst onToggle = () => {\n\t\t\tonChange(\n\t\t\t\ttoggleFormat( value, {\n\t\t\t\t\ttype: name,\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\tstyle: 'text-decoration: underline;',\n\t\t\t\t\t},\n\t\t\t\t\ttitle,\n\t\t\t\t} )\n\t\t\t);\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<RichTextShortcut\n\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\tcharacter=\"u\"\n\t\t\t\t\tonUse={ onToggle }\n\t\t\t\t/>\n\t\t\t\t<__unstableRichTextInputEvent\n\t\t\t\t\tinputType=\"formatUnderline\"\n\t\t\t\t\tonInput={ onToggle }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,YAAY,QAAQ,sBAAsB;AACnD,SACCC,gBAAgB,EAChBC,4BAA4B,QACtB,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEjC,MAAMC,IAAI,GAAG,gBAAgB;AAC7B,MAAMC,KAAK,GAAGX,EAAE,CAAE,WAAY,CAAC;AAE/B,OAAO,MAAMY,SAAS,GAAG;EACxBF,IAAI;EACJC,KAAK;EACLE,OAAO,EAAE,MAAM;EACfC,SAAS,EAAE,IAAI;EACfC,UAAU,EAAE;IACXC,KAAK,EAAE;EACR,CAAC;EACDC,IAAIA,CAAE;IAAEC,KAAK;IAAEC;EAAS,CAAC,EAAG;IAC3B,MAAMC,QAAQ,GAAGA,CAAA,KAAM;MACtBD,QAAQ,CACPlB,YAAY,CAAEiB,KAAK,EAAE;QACpBG,IAAI,EAAEX,IAAI;QACVK,UAAU,EAAE;UACXC,KAAK,EAAE;QACR,CAAC;QACDL;MACD,CAAE,CACH,CAAC;IACF,CAAC;IAED,oBACCF,KAAA,CAAAF,SAAA;MAAAe,QAAA,gBACCjB,IAAA,CAACH,gBAAgB;QAChBmB,IAAI,EAAC,SAAS;QACdE,SAAS,EAAC,GAAG;QACbC,KAAK,EAAGJ;MAAU,CAClB,CAAC,eACFf,IAAA,CAACF,4BAA4B;QAC5BsB,SAAS,EAAC,iBAAiB;QAC3BC,OAAO,EAAGN;MAAU,CACpB,CAAC;IAAA,CACD,CAAC;EAEL;AACD,CAAC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/underline/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { toggleFormat } from '@wordpress/rich-text';\nimport {\n\tRichTextShortcut,\n\t__unstableRichTextInputEvent,\n} from '@wordpress/block-editor';\n\nconst name = 'core/underline';\nconst title = __( 'Underline' );\n\nexport const underline = {\n\tname,\n\ttitle,\n\ttagName: 'span',\n\tclassName: null,\n\tattributes: {\n\t\tstyle: 'style',\n\t},\n\tedit( { value, onChange } ) {\n\t\tconst onToggle = () => {\n\t\t\tonChange(\n\t\t\t\ttoggleFormat( value, {\n\t\t\t\t\ttype: name,\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\tstyle: 'text-decoration: underline;',\n\t\t\t\t\t},\n\t\t\t\t\ttitle,\n\t\t\t\t} )\n\t\t\t);\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<RichTextShortcut\n\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\tcharacter=\"u\"\n\t\t\t\t\tonUse={ onToggle }\n\t\t\t\t/>\n\t\t\t\t<__unstableRichTextInputEvent\n\t\t\t\t\tinputType=\"formatUnderline\"\n\t\t\t\t\tonInput={ onToggle }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t},\n};\n"],
5
+ "mappings": "AAmCG,mBACC,KADD;AAhCH,SAAS,UAAU;AACnB,SAAS,oBAAoB;AAC7B;AAAA,EACC;AAAA,EACA;AAAA,OACM;AAEP,MAAM,OAAO;AACb,MAAM,QAAQ,GAAI,WAAY;AAEvB,MAAM,YAAY;AAAA,EACxB;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,WAAW;AAAA,EACX,YAAY;AAAA,IACX,OAAO;AAAA,EACR;AAAA,EACA,KAAM,EAAE,OAAO,SAAS,GAAI;AAC3B,UAAM,WAAW,MAAM;AACtB;AAAA,QACC,aAAc,OAAO;AAAA,UACpB,MAAM;AAAA,UACN,YAAY;AAAA,YACX,OAAO;AAAA,UACR;AAAA,UACA;AAAA,QACD,CAAE;AAAA,MACH;AAAA,IACD;AAEA,WACC,iCACC;AAAA;AAAA,QAAC;AAAA;AAAA,UACA,MAAK;AAAA,UACL,WAAU;AAAA,UACV,OAAQ;AAAA;AAAA,MACT;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACA,WAAU;AAAA,UACV,SAAU;AAAA;AAAA,MACX;AAAA,OACD;AAAA,EAEF;AACD;",
6
+ "names": []
7
+ }
@@ -1,33 +1,25 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { __ } from '@wordpress/i18n';
5
- import { removeFormat, slice, isCollapsed } from '@wordpress/rich-text';
6
- import { RichTextToolbarButton } from '@wordpress/block-editor';
7
- import { help } from '@wordpress/icons';
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- const name = 'core/unknown';
10
- const title = __('Clear Unknown Formatting');
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { __ } from "@wordpress/i18n";
3
+ import { removeFormat, slice, isCollapsed } from "@wordpress/rich-text";
4
+ import { RichTextToolbarButton } from "@wordpress/block-editor";
5
+ import { help } from "@wordpress/icons";
6
+ const name = "core/unknown";
7
+ const title = __("Clear Unknown Formatting");
11
8
  function selectionContainsUnknownFormats(value) {
12
9
  if (isCollapsed(value)) {
13
10
  return false;
14
11
  }
15
12
  const selectedValue = slice(value);
16
- return selectedValue.formats.some(formats => {
17
- return formats.some(format => format.type === name);
13
+ return selectedValue.formats.some((formats) => {
14
+ return formats.some((format) => format.type === name);
18
15
  });
19
16
  }
20
- export const unknown = {
17
+ const unknown = {
21
18
  name,
22
19
  title,
23
- tagName: '*',
20
+ tagName: "*",
24
21
  className: null,
25
- edit({
26
- isActive,
27
- value,
28
- onChange,
29
- onFocus
30
- }) {
22
+ edit({ isActive, value, onChange, onFocus }) {
31
23
  if (!isActive && !selectionContainsUnknownFormats(value)) {
32
24
  return null;
33
25
  }
@@ -35,13 +27,19 @@ export const unknown = {
35
27
  onChange(removeFormat(value, name));
36
28
  onFocus();
37
29
  }
38
- return /*#__PURE__*/_jsx(RichTextToolbarButton, {
39
- name: "unknown",
40
- icon: help,
41
- title: title,
42
- onClick: onClick,
43
- isActive: true
44
- });
30
+ return /* @__PURE__ */ jsx(
31
+ RichTextToolbarButton,
32
+ {
33
+ name: "unknown",
34
+ icon: help,
35
+ title,
36
+ onClick,
37
+ isActive: true
38
+ }
39
+ );
45
40
  }
46
41
  };
47
- //# sourceMappingURL=index.js.map
42
+ export {
43
+ unknown
44
+ };
45
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["__","removeFormat","slice","isCollapsed","RichTextToolbarButton","help","jsx","_jsx","name","title","selectionContainsUnknownFormats","value","selectedValue","formats","some","format","type","unknown","tagName","className","edit","isActive","onChange","onFocus","onClick","icon"],"sources":["@wordpress/format-library/src/unknown/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { removeFormat, slice, isCollapsed } from '@wordpress/rich-text';\nimport { RichTextToolbarButton } from '@wordpress/block-editor';\nimport { help } from '@wordpress/icons';\n\nconst name = 'core/unknown';\nconst title = __( 'Clear Unknown Formatting' );\n\nfunction selectionContainsUnknownFormats( value ) {\n\tif ( isCollapsed( value ) ) {\n\t\treturn false;\n\t}\n\n\tconst selectedValue = slice( value );\n\treturn selectedValue.formats.some( ( formats ) => {\n\t\treturn formats.some( ( format ) => format.type === name );\n\t} );\n}\n\nexport const unknown = {\n\tname,\n\ttitle,\n\ttagName: '*',\n\tclassName: null,\n\tedit( { isActive, value, onChange, onFocus } ) {\n\t\tif ( ! isActive && ! selectionContainsUnknownFormats( value ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tfunction onClick() {\n\t\t\tonChange( removeFormat( value, name ) );\n\t\t\tonFocus();\n\t\t}\n\n\t\treturn (\n\t\t\t<RichTextToolbarButton\n\t\t\t\tname=\"unknown\"\n\t\t\t\ticon={ help }\n\t\t\t\ttitle={ title }\n\t\t\t\tonClick={ onClick }\n\t\t\t\tisActive\n\t\t\t/>\n\t\t);\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,YAAY,EAAEC,KAAK,EAAEC,WAAW,QAAQ,sBAAsB;AACvE,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,IAAI,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAExC,MAAMC,IAAI,GAAG,cAAc;AAC3B,MAAMC,KAAK,GAAGT,EAAE,CAAE,0BAA2B,CAAC;AAE9C,SAASU,+BAA+BA,CAAEC,KAAK,EAAG;EACjD,IAAKR,WAAW,CAAEQ,KAAM,CAAC,EAAG;IAC3B,OAAO,KAAK;EACb;EAEA,MAAMC,aAAa,GAAGV,KAAK,CAAES,KAAM,CAAC;EACpC,OAAOC,aAAa,CAACC,OAAO,CAACC,IAAI,CAAID,OAAO,IAAM;IACjD,OAAOA,OAAO,CAACC,IAAI,CAAIC,MAAM,IAAMA,MAAM,CAACC,IAAI,KAAKR,IAAK,CAAC;EAC1D,CAAE,CAAC;AACJ;AAEA,OAAO,MAAMS,OAAO,GAAG;EACtBT,IAAI;EACJC,KAAK;EACLS,OAAO,EAAE,GAAG;EACZC,SAAS,EAAE,IAAI;EACfC,IAAIA,CAAE;IAAEC,QAAQ;IAAEV,KAAK;IAAEW,QAAQ;IAAEC;EAAQ,CAAC,EAAG;IAC9C,IAAK,CAAEF,QAAQ,IAAI,CAAEX,+BAA+B,CAAEC,KAAM,CAAC,EAAG;MAC/D,OAAO,IAAI;IACZ;IAEA,SAASa,OAAOA,CAAA,EAAG;MAClBF,QAAQ,CAAErB,YAAY,CAAEU,KAAK,EAAEH,IAAK,CAAE,CAAC;MACvCe,OAAO,CAAC,CAAC;IACV;IAEA,oBACChB,IAAA,CAACH,qBAAqB;MACrBI,IAAI,EAAC,SAAS;MACdiB,IAAI,EAAGpB,IAAM;MACbI,KAAK,EAAGA,KAAO;MACfe,OAAO,EAAGA,OAAS;MACnBH,QAAQ;IAAA,CACR,CAAC;EAEJ;AACD,CAAC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/unknown/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { removeFormat, slice, isCollapsed } from '@wordpress/rich-text';\nimport { RichTextToolbarButton } from '@wordpress/block-editor';\nimport { help } from '@wordpress/icons';\n\nconst name = 'core/unknown';\nconst title = __( 'Clear Unknown Formatting' );\n\nfunction selectionContainsUnknownFormats( value ) {\n\tif ( isCollapsed( value ) ) {\n\t\treturn false;\n\t}\n\n\tconst selectedValue = slice( value );\n\treturn selectedValue.formats.some( ( formats ) => {\n\t\treturn formats.some( ( format ) => format.type === name );\n\t} );\n}\n\nexport const unknown = {\n\tname,\n\ttitle,\n\ttagName: '*',\n\tclassName: null,\n\tedit( { isActive, value, onChange, onFocus } ) {\n\t\tif ( ! isActive && ! selectionContainsUnknownFormats( value ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tfunction onClick() {\n\t\t\tonChange( removeFormat( value, name ) );\n\t\t\tonFocus();\n\t\t}\n\n\t\treturn (\n\t\t\t<RichTextToolbarButton\n\t\t\t\tname=\"unknown\"\n\t\t\t\ticon={ help }\n\t\t\t\ttitle={ title }\n\t\t\t\tonClick={ onClick }\n\t\t\t\tisActive\n\t\t\t/>\n\t\t);\n\t},\n};\n"],
5
+ "mappings": "AAsCG;AAnCH,SAAS,UAAU;AACnB,SAAS,cAAc,OAAO,mBAAmB;AACjD,SAAS,6BAA6B;AACtC,SAAS,YAAY;AAErB,MAAM,OAAO;AACb,MAAM,QAAQ,GAAI,0BAA2B;AAE7C,SAAS,gCAAiC,OAAQ;AACjD,MAAK,YAAa,KAAM,GAAI;AAC3B,WAAO;AAAA,EACR;AAEA,QAAM,gBAAgB,MAAO,KAAM;AACnC,SAAO,cAAc,QAAQ,KAAM,CAAE,YAAa;AACjD,WAAO,QAAQ,KAAM,CAAE,WAAY,OAAO,SAAS,IAAK;AAAA,EACzD,CAAE;AACH;AAEO,MAAM,UAAU;AAAA,EACtB;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,WAAW;AAAA,EACX,KAAM,EAAE,UAAU,OAAO,UAAU,QAAQ,GAAI;AAC9C,QAAK,CAAE,YAAY,CAAE,gCAAiC,KAAM,GAAI;AAC/D,aAAO;AAAA,IACR;AAEA,aAAS,UAAU;AAClB,eAAU,aAAc,OAAO,IAAK,CAAE;AACtC,cAAQ;AAAA,IACT;AAEA,WACC;AAAA,MAAC;AAAA;AAAA,QACA,MAAK;AAAA,QACL,MAAO;AAAA,QACP;AAAA,QACA;AAAA,QACA,UAAQ;AAAA;AAAA,IACT;AAAA,EAEF;AACD;",
6
+ "names": []
7
+ }
@@ -1,57 +1,3 @@
1
- /**
2
- * Colors
3
- */
4
- /**
5
- * Breakpoints & Media Queries
6
- */
7
- /**
8
- * Colors
9
- */
10
- /**
11
- * SCSS Variables.
12
- *
13
- * Please use variables from this sheet to ensure consistency across the UI.
14
- * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
15
- * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
16
- */
17
- /**
18
- * Fonts & basic variables.
19
- */
20
- /**
21
- * Typography
22
- */
23
- /**
24
- * Grid System.
25
- * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
26
- */
27
- /**
28
- * Radius scale.
29
- */
30
- /**
31
- * Elevation scale.
32
- */
33
- /**
34
- * Dimensions.
35
- */
36
- /**
37
- * Mobile specific styles
38
- */
39
- /**
40
- * Editor styles.
41
- */
42
- /**
43
- * Block & Editor UI.
44
- */
45
- /**
46
- * Block paddings.
47
- */
48
- /**
49
- * React Native specific.
50
- * These variables do not appear to be used anywhere else.
51
- */
52
- /**
53
- * Colors
54
- */
55
1
  /**
56
2
  * SCSS Variables.
57
3
  *
@@ -59,91 +5,9 @@
59
5
  * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
60
6
  * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
61
7
  */
62
- /**
63
- * Fonts & basic variables.
64
- */
65
- /**
66
- * Typography
67
- */
68
- /**
69
- * Grid System.
70
- * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
71
- */
72
- /**
73
- * Radius scale.
74
- */
75
- /**
76
- * Elevation scale.
77
- */
78
- /**
79
- * Dimensions.
80
- */
81
- /**
82
- * Mobile specific styles
83
- */
84
- /**
85
- * Editor styles.
86
- */
87
- /**
88
- * Block & Editor UI.
89
- */
90
- /**
91
- * Block paddings.
92
- */
93
- /**
94
- * React Native specific.
95
- * These variables do not appear to be used anywhere else.
96
- */
97
- /**
98
- * Breakpoints & Media Queries
99
- */
100
- /**
101
- * Converts a hex value into the rgb equivalent.
102
- *
103
- * @param {string} hex - the hexadecimal value to convert
104
- * @return {string} comma separated rgb values
105
- */
106
- /**
107
- * Long content fade mixin
108
- *
109
- * Creates a fading overlay to signify that the content is longer
110
- * than the space allows.
111
- */
112
- /**
113
- * Typography
114
- */
115
- /**
116
- * Breakpoint mixins
117
- */
118
- /**
119
- * Focus styles.
120
- */
121
- /**
122
- * Applies editor left position to the selector passed as argument
123
- */
124
- /**
125
- * Styles that are reused verbatim in a few places
126
- */
127
- /**
128
- * Allows users to opt-out of animations via OS-level preferences.
129
- */
130
- /**
131
- * Reset default styles for JavaScript UI based pages.
132
- * This is a WP-admin agnostic reset
133
- */
134
- /**
135
- * Reset the WP Admin page styles for Gutenberg-like pages.
136
- */
137
8
  /**
138
9
  * Colors
139
10
  */
140
- /**
141
- * SCSS Variables.
142
- *
143
- * Please use variables from this sheet to ensure consistency across the UI.
144
- * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
145
- * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
146
- */
147
11
  /**
148
12
  * Fonts & basic variables.
149
13
  */
@@ -179,64 +43,6 @@
179
43
  * React Native specific.
180
44
  * These variables do not appear to be used anywhere else.
181
45
  */
182
- /**
183
- * Breakpoints & Media Queries
184
- */
185
- /**
186
- * Converts a hex value into the rgb equivalent.
187
- *
188
- * @param {string} hex - the hexadecimal value to convert
189
- * @return {string} comma separated rgb values
190
- */
191
- /**
192
- * Long content fade mixin
193
- *
194
- * Creates a fading overlay to signify that the content is longer
195
- * than the space allows.
196
- */
197
- /**
198
- * Typography
199
- */
200
- /**
201
- * Breakpoint mixins
202
- */
203
- /**
204
- * Focus styles.
205
- */
206
- /**
207
- * Applies editor left position to the selector passed as argument
208
- */
209
- /**
210
- * Styles that are reused verbatim in a few places
211
- */
212
- /**
213
- * Allows users to opt-out of animations via OS-level preferences.
214
- */
215
- /**
216
- * Reset default styles for JavaScript UI based pages.
217
- * This is a WP-admin agnostic reset
218
- */
219
- /**
220
- * Reset the WP Admin page styles for Gutenberg-like pages.
221
- */
222
- :root {
223
- --wp-block-synced-color: #7a00df;
224
- --wp-block-synced-color--rgb: 122, 0, 223;
225
- --wp-bound-block-color: var(--wp-block-synced-color);
226
- --wp-admin-theme-color: #007cba;
227
- --wp-admin-theme-color--rgb: 0, 124, 186;
228
- --wp-admin-theme-color-darker-10: #006ba1;
229
- --wp-admin-theme-color-darker-10--rgb: 0, 107, 161;
230
- --wp-admin-theme-color-darker-20: #005a87;
231
- --wp-admin-theme-color-darker-20--rgb: 0, 90, 135;
232
- --wp-admin-border-width-focus: 2px;
233
- }
234
- @media (min-resolution: 192dpi) {
235
- :root {
236
- --wp-admin-border-width-focus: 1.5px;
237
- }
238
- }
239
-
240
46
  .block-editor-format-toolbar__image-popover {
241
47
  z-index: 159990;
242
48
  }
@@ -1,57 +1,3 @@
1
- /**
2
- * Colors
3
- */
4
- /**
5
- * Breakpoints & Media Queries
6
- */
7
- /**
8
- * Colors
9
- */
10
- /**
11
- * SCSS Variables.
12
- *
13
- * Please use variables from this sheet to ensure consistency across the UI.
14
- * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
15
- * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
16
- */
17
- /**
18
- * Fonts & basic variables.
19
- */
20
- /**
21
- * Typography
22
- */
23
- /**
24
- * Grid System.
25
- * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
26
- */
27
- /**
28
- * Radius scale.
29
- */
30
- /**
31
- * Elevation scale.
32
- */
33
- /**
34
- * Dimensions.
35
- */
36
- /**
37
- * Mobile specific styles
38
- */
39
- /**
40
- * Editor styles.
41
- */
42
- /**
43
- * Block & Editor UI.
44
- */
45
- /**
46
- * Block paddings.
47
- */
48
- /**
49
- * React Native specific.
50
- * These variables do not appear to be used anywhere else.
51
- */
52
- /**
53
- * Colors
54
- */
55
1
  /**
56
2
  * SCSS Variables.
57
3
  *
@@ -59,91 +5,9 @@
59
5
  * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
60
6
  * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
61
7
  */
62
- /**
63
- * Fonts & basic variables.
64
- */
65
- /**
66
- * Typography
67
- */
68
- /**
69
- * Grid System.
70
- * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
71
- */
72
- /**
73
- * Radius scale.
74
- */
75
- /**
76
- * Elevation scale.
77
- */
78
- /**
79
- * Dimensions.
80
- */
81
- /**
82
- * Mobile specific styles
83
- */
84
- /**
85
- * Editor styles.
86
- */
87
- /**
88
- * Block & Editor UI.
89
- */
90
- /**
91
- * Block paddings.
92
- */
93
- /**
94
- * React Native specific.
95
- * These variables do not appear to be used anywhere else.
96
- */
97
- /**
98
- * Breakpoints & Media Queries
99
- */
100
- /**
101
- * Converts a hex value into the rgb equivalent.
102
- *
103
- * @param {string} hex - the hexadecimal value to convert
104
- * @return {string} comma separated rgb values
105
- */
106
- /**
107
- * Long content fade mixin
108
- *
109
- * Creates a fading overlay to signify that the content is longer
110
- * than the space allows.
111
- */
112
- /**
113
- * Typography
114
- */
115
- /**
116
- * Breakpoint mixins
117
- */
118
- /**
119
- * Focus styles.
120
- */
121
- /**
122
- * Applies editor left position to the selector passed as argument
123
- */
124
- /**
125
- * Styles that are reused verbatim in a few places
126
- */
127
- /**
128
- * Allows users to opt-out of animations via OS-level preferences.
129
- */
130
- /**
131
- * Reset default styles for JavaScript UI based pages.
132
- * This is a WP-admin agnostic reset
133
- */
134
- /**
135
- * Reset the WP Admin page styles for Gutenberg-like pages.
136
- */
137
8
  /**
138
9
  * Colors
139
10
  */
140
- /**
141
- * SCSS Variables.
142
- *
143
- * Please use variables from this sheet to ensure consistency across the UI.
144
- * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
145
- * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
146
- */
147
11
  /**
148
12
  * Fonts & basic variables.
149
13
  */
@@ -179,64 +43,6 @@
179
43
  * React Native specific.
180
44
  * These variables do not appear to be used anywhere else.
181
45
  */
182
- /**
183
- * Breakpoints & Media Queries
184
- */
185
- /**
186
- * Converts a hex value into the rgb equivalent.
187
- *
188
- * @param {string} hex - the hexadecimal value to convert
189
- * @return {string} comma separated rgb values
190
- */
191
- /**
192
- * Long content fade mixin
193
- *
194
- * Creates a fading overlay to signify that the content is longer
195
- * than the space allows.
196
- */
197
- /**
198
- * Typography
199
- */
200
- /**
201
- * Breakpoint mixins
202
- */
203
- /**
204
- * Focus styles.
205
- */
206
- /**
207
- * Applies editor left position to the selector passed as argument
208
- */
209
- /**
210
- * Styles that are reused verbatim in a few places
211
- */
212
- /**
213
- * Allows users to opt-out of animations via OS-level preferences.
214
- */
215
- /**
216
- * Reset default styles for JavaScript UI based pages.
217
- * This is a WP-admin agnostic reset
218
- */
219
- /**
220
- * Reset the WP Admin page styles for Gutenberg-like pages.
221
- */
222
- :root {
223
- --wp-block-synced-color: #7a00df;
224
- --wp-block-synced-color--rgb: 122, 0, 223;
225
- --wp-bound-block-color: var(--wp-block-synced-color);
226
- --wp-admin-theme-color: #007cba;
227
- --wp-admin-theme-color--rgb: 0, 124, 186;
228
- --wp-admin-theme-color-darker-10: #006ba1;
229
- --wp-admin-theme-color-darker-10--rgb: 0, 107, 161;
230
- --wp-admin-theme-color-darker-20: #005a87;
231
- --wp-admin-theme-color-darker-20--rgb: 0, 90, 135;
232
- --wp-admin-border-width-focus: 2px;
233
- }
234
- @media (min-resolution: 192dpi) {
235
- :root {
236
- --wp-admin-border-width-focus: 1.5px;
237
- }
238
- }
239
-
240
46
  .block-editor-format-toolbar__image-popover {
241
47
  z-index: 159990;
242
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/format-library",
3
- "version": "5.32.0",
3
+ "version": "5.32.1-next.ff1cebbba.0",
4
4
  "description": "Format library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -24,22 +24,28 @@
24
24
  },
25
25
  "main": "build/index.js",
26
26
  "module": "build-module/index.js",
27
+ "exports": {
28
+ ".": {
29
+ "import": "./build-module/index.js",
30
+ "require": "./build/index.js"
31
+ },
32
+ "./package.json": "./package.json"
33
+ },
27
34
  "react-native": "src/index",
28
35
  "wpScript": true,
29
36
  "dependencies": {
30
- "@babel/runtime": "7.25.7",
31
- "@wordpress/a11y": "^4.32.0",
32
- "@wordpress/block-editor": "^15.5.0",
33
- "@wordpress/components": "^30.5.0",
34
- "@wordpress/compose": "^7.32.0",
35
- "@wordpress/data": "^10.32.0",
36
- "@wordpress/element": "^6.32.0",
37
- "@wordpress/html-entities": "^4.32.0",
38
- "@wordpress/i18n": "^6.5.0",
39
- "@wordpress/icons": "^10.32.0",
40
- "@wordpress/private-apis": "^1.32.0",
41
- "@wordpress/rich-text": "^7.32.0",
42
- "@wordpress/url": "^4.32.0"
37
+ "@wordpress/a11y": "^4.32.1-next.ff1cebbba.0",
38
+ "@wordpress/block-editor": "^15.5.1-next.ff1cebbba.0",
39
+ "@wordpress/components": "^30.6.1-next.ff1cebbba.0",
40
+ "@wordpress/compose": "^7.32.1-next.ff1cebbba.0",
41
+ "@wordpress/data": "^10.32.1-next.ff1cebbba.0",
42
+ "@wordpress/element": "^6.32.1-next.ff1cebbba.0",
43
+ "@wordpress/html-entities": "^4.32.1-next.ff1cebbba.0",
44
+ "@wordpress/i18n": "^6.5.1-next.ff1cebbba.0",
45
+ "@wordpress/icons": "^11.0.1-next.ff1cebbba.0",
46
+ "@wordpress/private-apis": "^1.32.1-next.ff1cebbba.0",
47
+ "@wordpress/rich-text": "^7.32.1-next.ff1cebbba.0",
48
+ "@wordpress/url": "^4.32.1-next.ff1cebbba.0"
43
49
  },
44
50
  "peerDependencies": {
45
51
  "react": "^18.0.0",
@@ -48,5 +54,5 @@
48
54
  "publishConfig": {
49
55
  "access": "public"
50
56
  },
51
- "gitHead": "a030b4c0e0695239b942c7dc18511782b64f10ed"
57
+ "gitHead": "c5b659710aff01d40d2eb97b211eb2cec9c07d3b"
52
58
  }
@@ -1,3 +1,6 @@
1
+ @use "@wordpress/base-styles/variables" as *;
2
+ @use "@wordpress/base-styles/z-index" as *;
3
+
1
4
  .block-editor-format-toolbar__image-popover {
2
5
  z-index: z-index(".block-editor-format-toolbar__image-popover");
3
6