@zipify/wysiwyg 1.2.5 → 1.4.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +2 -2
- package/dist/wysiwyg.css +42 -31
- package/dist/wysiwyg.mjs +158 -53
- package/lib/Wysiwyg.vue +4 -1
- package/lib/assets/icons/indicator.svg +5 -0
- package/lib/components/base/Button.vue +7 -0
- package/lib/components/base/dropdown/Dropdown.vue +7 -1
- package/lib/components/base/dropdown/DropdownActivator.vue +19 -4
- package/lib/components/base/dropdown/__tests__/DropdownActivator.test.js +23 -1
- package/lib/components/toolbar/controls/AlignmentControl.vue +11 -1
- package/lib/components/toolbar/controls/FontColorControl.vue +13 -0
- package/lib/components/toolbar/controls/FontFamilyControl.vue +4 -0
- package/lib/components/toolbar/controls/FontSizeControl.vue +6 -1
- package/lib/components/toolbar/controls/FontWeightControl.vue +12 -0
- package/lib/components/toolbar/controls/ItalicControl.vue +13 -0
- package/lib/components/toolbar/controls/LineHeightControl.vue +14 -0
- package/lib/components/toolbar/controls/UnderlineControl.vue +12 -0
- package/lib/components/toolbar/controls/__tests__/AlignmentControl.test.js +72 -5
- package/lib/components/toolbar/controls/__tests__/FontColorControl.test.js +22 -1
- package/lib/components/toolbar/controls/__tests__/FontFamilyControl.test.js +1 -0
- package/lib/components/toolbar/controls/__tests__/FontSizeControl.test.js +1 -0
- package/lib/components/toolbar/controls/__tests__/FontWeightControl.test.js +1 -0
- package/lib/components/toolbar/controls/__tests__/ItalicControl.test.js +23 -1
- package/lib/components/toolbar/controls/__tests__/LineHeightControl.test.js +23 -1
- package/lib/components/toolbar/controls/__tests__/UnderlineControl.test.js +25 -1
- package/lib/extensions/StylePreset.js +41 -19
- package/lib/extensions/TextDecoration.js +7 -0
- package/lib/extensions/__tests__/StylePreset.test.js +99 -0
- package/lib/extensions/__tests__/TextDecoration.test.js +20 -0
- package/lib/extensions/__tests__/__snapshots__/StylePreset.test.js.snap +26 -0
- package/package.json +1 -1
package/dist/wysiwyg.mjs
CHANGED
|
@@ -14286,7 +14286,7 @@ var __component__$F = /* @__PURE__ */ normalizeComponent(
|
|
|
14286
14286
|
staticRenderFns$F,
|
|
14287
14287
|
false,
|
|
14288
14288
|
__vue2_injectStyles$F,
|
|
14289
|
-
"
|
|
14289
|
+
"2fa65564",
|
|
14290
14290
|
null,
|
|
14291
14291
|
null
|
|
14292
14292
|
);
|
|
@@ -14415,22 +14415,23 @@ const __vite_glob_0_4 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" sty
|
|
|
14415
14415
|
const __vite_glob_0_5 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="#fff" stroke="#B3B3B3" d="M4.5 4.5h19v19h-19z"/>\n <path fill="#3B3B3B" d="M26 20.7a2.51 2.51 0 0 1-5 0c0-1.31 2.5-4.7 2.5-4.7s2.5 3.39 2.5 4.7Z"/>\n <path fill="#3B3B3B" fill-rule="evenodd" d="M19.64 19.93h-1.715a.75.75 0 0 1-.475-.145.82.82 0 0 1-.268-.359l-.89-2.433h-4.943l-.89 2.433a.78.78 0 0 1-.26.347.73.73 0 0 1-.475.157H8L12.686 8h2.269l4.686 11.93Zm-7.721-4.505h3.803l-1.452-3.968a18.048 18.048 0 0 1-.219-.623c-.08-.24-.158-.5-.235-.78-.077.28-.152.542-.227.784a8.742 8.742 0 0 1-.218.635l-1.452 3.952Z" clip-rule="evenodd"/>\n</svg>\n';
|
|
14416
14416
|
const __vite_glob_0_6 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M16.64 19.93h-1.715a.75.75 0 0 1-.475-.145.82.82 0 0 1-.268-.359l-.89-2.433H8.35l-.891 2.433a.78.78 0 0 1-.26.347.73.73 0 0 1-.475.157H5L9.686 8h2.269l4.686 11.93Zm-7.72-4.505h3.803l-1.452-3.968a18.048 18.048 0 0 1-.219-.623c-.08-.24-.158-.5-.235-.78-.077.28-.152.542-.227.784a8.742 8.742 0 0 1-.218.635L8.92 15.425Zm14.968 4.505h-.915a.987.987 0 0 1-.454-.087c-.11-.058-.192-.175-.248-.35l-.181-.603a7.005 7.005 0 0 1-.631.507c-.206.146-.42.269-.64.368a3.26 3.26 0 0 1-.7.222c-.248.05-.523.075-.826.075-.357 0-.687-.049-.99-.145a2.134 2.134 0 0 1-.78-.433 1.967 1.967 0 0 1-.507-.718 2.545 2.545 0 0 1-.181-.998c0-.319.084-.634.251-.945.168-.31.447-.59.838-.841.39-.25.91-.458 1.559-.623.649-.165 1.455-.258 2.417-.28v-.495c0-.567-.12-.986-.359-1.259-.239-.272-.587-.408-1.043-.408-.33 0-.605.039-.825.116a3.17 3.17 0 0 0-.574.26 25.11 25.11 0 0 1-.45.26.912.912 0 0 1-.453.115.59.59 0 0 1-.355-.107.843.843 0 0 1-.239-.264l-.371-.652c.973-.891 2.148-1.337 3.523-1.337.494 0 .936.081 1.324.244.387.162.716.387.985.676.27.289.475.634.615 1.036.14.401.21.841.21 1.32v5.346Zm-3.96-1.271c.21 0 .402-.02.578-.058.176-.038.342-.096.5-.173.156-.077.307-.172.453-.285a4.13 4.13 0 0 0 .441-.4v-1.427c-.594.027-1.09.078-1.489.153a3.967 3.967 0 0 0-.961.284c-.242.116-.414.25-.516.404a.894.894 0 0 0-.152.504c0 .357.106.613.317.767.212.154.489.231.83.231Z" clip-rule="evenodd"/>\n</svg>\n';
|
|
14417
14417
|
const __vite_glob_0_7 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M22 20.62a2.42 2.42 0 0 1-4.84 0c0-1.25 2.42-4.54 2.42-4.54S22 19.37 22 20.62ZM9.92 15.425l1.452-3.951c.071-.182.145-.394.219-.636.074-.242.149-.503.226-.783a17.223 17.223 0 0 0 .454 1.402l1.452 3.968H9.919Zm5.411 4.199c.226-.795.658-1.684 1.184-2.562L12.955 8h-2.269L6 19.93h1.725a.736.736 0 0 0 .474-.157.792.792 0 0 0 .26-.347l.891-2.434h4.941l.891 2.434c.031.079.097.134.148.198Z" clip-rule="evenodd"/>\n</svg>\n';
|
|
14418
|
-
const __vite_glob_0_8 = '<svg xmlns="http://www.w3.org/2000/svg" fill="
|
|
14419
|
-
const __vite_glob_0_9 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)"
|
|
14420
|
-
const __vite_glob_0_10 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="
|
|
14421
|
-
const __vite_glob_0_11 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <
|
|
14422
|
-
const __vite_glob_0_12 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <
|
|
14423
|
-
const __vite_glob_0_13 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <
|
|
14424
|
-
const __vite_glob_0_14 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <
|
|
14425
|
-
const __vite_glob_0_15 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" d="
|
|
14426
|
-
const __vite_glob_0_16 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" d="
|
|
14427
|
-
const __vite_glob_0_17 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)"
|
|
14428
|
-
const __vite_glob_0_18 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" d="M14
|
|
14429
|
-
const __vite_glob_0_19 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)"
|
|
14430
|
-
const __vite_glob_0_20 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" d="
|
|
14431
|
-
const __vite_glob_0_21 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)"
|
|
14432
|
-
const __vite_glob_0_22 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0
|
|
14433
|
-
const
|
|
14418
|
+
const __vite_glob_0_8 = '<svg width="9" height="9" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M0 4.5C0 2.01472 2.01472 0 4.5 0C6.98528 0 9 2.01472 9 4.5C9 6.98528 6.98528 9 4.5 9C2.01472 9 0 6.98528 0 4.5Z" fill="#FFAB00"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M5.0625 2.25H3.9375V5.625H5.0625V2.25Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3.9375 6.75C3.9375 6.43894 4.18894 6.1875 4.5 6.1875C4.8105 6.1875 5.0625 6.43894 5.0625 6.75C5.0625 7.06106 4.8105 7.3125 4.5 7.3125C4.18894 7.3125 3.9375 7.06106 3.9375 6.75Z" fill="white"/>\n</svg>\n';
|
|
14419
|
+
const __vite_glob_0_9 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" d="M18 9V7h-7v2h2.64l-1.22 10H10v2h7v-2h-2.83L15.4 9H18Z"/>\n</svg>\n';
|
|
14420
|
+
const __vite_glob_0_10 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="m5 10 3-3 3 3H9v8h2l-3 3-3-3h2v-8H5Zm8-3h10v2H13V7Zm10 6H13v2h10v-2Zm0 6H13v2h10v-2Z" clip-rule="evenodd"/>\n</svg>\n';
|
|
14421
|
+
const __vite_glob_0_11 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M12 17.5h-2a3.5 3.5 0 1 1 0-7h2V9h-2a5 5 0 0 0 0 10h2v-1.5Zm6-4.5h-8v2h8v-2Zm-2-4h2a5 5 0 0 1 0 10h-2v-1.5h2a3.5 3.5 0 1 0 0-7h-2V9Z" clip-rule="evenodd"/>\n</svg>\n';
|
|
14422
|
+
const __vite_glob_0_12 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <rect width="9" height="9" x="9.5" y="9.5" stroke="var(--zw-icon-foreground)" rx="4.5"/>\n</svg>\n';
|
|
14423
|
+
const __vite_glob_0_13 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" d="M15.108 18.184V19H10.5v-.816h1.842v-5.862c0-.176.006-.354.018-.534l-1.53 1.314a.375.375 0 0 1-.156.084.373.373 0 0 1-.27-.048.318.318 0 0 1-.084-.078l-.336-.462 2.562-2.214h.87v7.8h1.692Zm1.519.156a.8.8 0 0 1 .054-.294.829.829 0 0 1 .156-.24.77.77 0 0 1 .534-.222.77.77 0 0 1 .696.462c.04.092.06.19.06.294a.744.744 0 0 1-.222.534.692.692 0 0 1-.24.156.73.73 0 0 1-.294.06.73.73 0 0 1-.294-.06.692.692 0 0 1-.396-.39.816.816 0 0 1-.054-.3Z"/>\n</svg>\n';
|
|
14424
|
+
const __vite_glob_0_14 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <rect width="10" height="10" x="9" y="9" fill="var(--zw-icon-foreground)" rx="5"/>\n</svg>\n';
|
|
14425
|
+
const __vite_glob_0_15 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" d="M12.086 9.802h.834v11.292h-.834V9.802Zm2.592 8.538a.8.8 0 0 1 .054-.294.829.829 0 0 1 .156-.24.77.77 0 0 1 .534-.222.77.77 0 0 1 .696.462c.04.092.06.19.06.294a.744.744 0 0 1-.222.534.692.692 0 0 1-.24.156.73.73 0 0 1-.294.06.73.73 0 0 1-.294-.06.692.692 0 0 1-.396-.39.816.816 0 0 1-.054-.3Z"/>\n</svg>\n';
|
|
14426
|
+
const __vite_glob_0_16 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" d="m13.664 15.808-1.35-3.498a7.11 7.11 0 0 1-.252-.804c-.084.324-.17.594-.258.81l-1.35 3.492h3.21ZM16.088 19h-.9a.387.387 0 0 1-.252-.078.48.48 0 0 1-.144-.198l-.804-2.076H10.13l-.804 2.076a.421.421 0 0 1-.138.192.383.383 0 0 1-.252.084h-.9l3.438-8.598h1.176L16.088 19Zm.7-.66a.8.8 0 0 1 .053-.294.829.829 0 0 1 .156-.24.77.77 0 0 1 .534-.222.77.77 0 0 1 .696.462c.04.092.06.19.06.294a.744.744 0 0 1-.222.534.692.692 0 0 1-.24.156.73.73 0 0 1-.294.06.73.73 0 0 1-.294-.06.692.692 0 0 1-.396-.39.816.816 0 0 1-.054-.3Z"/>\n</svg>\n';
|
|
14427
|
+
const __vite_glob_0_17 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" d="M9 9h10v10H9z"/>\n</svg>\n';
|
|
14428
|
+
const __vite_glob_0_18 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M14.089 6.726a1 1 0 0 1 1.425-.003l6.8 6.882a1 1 0 0 1 .007 1.398L17.2 20.3l-.2.2c-2.2 2.1-5.7 2-7.8-.2l-3.516-3.6a1 1 0 0 1 0-1.399l8.405-8.575Zm1.81 12.674c.1 0 .2 0 .2-.1l4.8-5-6.1-6.2-5 5.1 6.1 6.2Z" clip-rule="evenodd"/>\n</svg>\n';
|
|
14429
|
+
const __vite_glob_0_19 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" d="M14 9.333V6.666l-3.334 3.333L14 13.333v-2.667c2.206 0 4 1.793 4 4s-1.794 4-4 4c-2.207 0-4-1.793-4-4H8.666A5.332 5.332 0 0 0 14 19.999a5.332 5.332 0 0 0 5.333-5.333A5.332 5.332 0 0 0 14 9.333Z"/>\n</svg>\n';
|
|
14430
|
+
const __vite_glob_0_20 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="m14 12.731.77.27H20v2H8v-2h2.84a2.892 2.892 0 0 1-.46-.71 3.61 3.61 0 0 1-.29-1.52c0-.484.1-.964.29-1.41a3.5 3.5 0 0 1 .83-1.2 4 4 0 0 1 1.35-.84 4.74 4.74 0 0 1 1.83-.32 6 6 0 0 1 2.11.41 5 5 0 0 1 1.68 1l-.46.88a.69.69 0 0 1-.18.22.41.41 0 0 1-.25.07.69.69 0 0 1-.39-.16 5.551 5.551 0 0 0-.56-.36 4.641 4.641 0 0 0-.8-.36 3.44 3.44 0 0 0-1.14-.16 3.16 3.16 0 0 0-1.11.17 2.29 2.29 0 0 0-.8.45 1.87 1.87 0 0 0-.49.67 2.138 2.138 0 0 0-.11.79c-.023.357.08.711.29 1 .206.267.465.489.76.65.338.187.693.34 1.06.46Zm1.99 6.06c.24-.22.427-.49.55-.79.135-.315.2-.657.19-1h1.74a4.58 4.58 0 0 1-.25 1.38 4 4 0 0 1-.91 1.37 4.231 4.231 0 0 1-1.46.92 5.503 5.503 0 0 1-2 .33 6.13 6.13 0 0 1-2.5-.46 5.66 5.66 0 0 1-1.89-1.31l.54-.88a.61.61 0 0 1 .19-.17.45.45 0 0 1 .25-.07.5.5 0 0 1 .28.1c.128.077.251.16.37.25l.46.33c.19.13.391.243.6.34.245.107.5.191.76.25.328.076.664.11 1 .1a3.67 3.67 0 0 0 1.19-.18c.328-.109.63-.282.89-.51Z" clip-rule="evenodd"/>\n</svg>\n';
|
|
14431
|
+
const __vite_glob_0_21 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" d="M21.985 8.625h-1.75V9.5h2.625v.875h-3.5v-1.75c0-.481.394-.875.875-.875h1.75v-.875H19.36V6h2.625c.481 0 .875.394.875.875v.875a.878.878 0 0 1-.875.875ZM7.88 20h2.327l2.975-4.742h.105L16.262 20h2.328l-4.069-6.361L18.32 7.75h-2.345l-2.687 4.366h-.105L10.48 7.75H8.15l3.78 5.889L7.88 20Z"/>\n</svg>\n';
|
|
14432
|
+
const __vite_glob_0_22 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M15.4 16.06a3.3 3.3 0 0 1-1.4.29 3.12 3.12 0 0 1-1.39-.29 2.88 2.88 0 0 1-1.05-.81 3.711 3.711 0 0 1-.65-1.25 5.659 5.659 0 0 1-.22-1.6V7H9v5.41a6.89 6.89 0 0 0 .34 2.22 5.29 5.29 0 0 0 1 1.77c.437.501.975.904 1.58 1.18A5 5 0 0 0 14 18a5 5 0 0 0 2.08-.42 4.61 4.61 0 0 0 1.57-1.18 5.27 5.27 0 0 0 1-1.77 6.89 6.89 0 0 0 .35-2.22V7h-1.69v5.41a5.659 5.659 0 0 1-.22 1.59 3.71 3.71 0 0 1-.69 1.25c-.27.34-.61.617-1 .81ZM20 19H8v2h12v-2Z" clip-rule="evenodd"/>\n</svg>\n';
|
|
14433
|
+
const __vite_glob_0_23 = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 20 20">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M18.96 10a5 5 0 0 0-5-5h-2v1.5h2a3.49 3.49 0 0 1 1.58 6.61L13.43 11h.53V9h-2.53l-7-7-1.47 1.47L17.49 18l1.47-1.47-2.34-2.34A4.93 4.93 0 0 0 18.96 10Zm-13 1h1.59L5.96 9.41V11ZM3.81 7.26A3.47 3.47 0 0 0 2.46 10a3.5 3.5 0 0 0 3.5 3.5h2V15h-2a5 5 0 0 1-3.21-8.8l1.06 1.06Z" clip-rule="evenodd"/>\n</svg>\n';
|
|
14434
|
+
const modules = /* @__PURE__ */ Object.assign({ "../assets/icons/alignment-center.svg": __vite_glob_0_0, "../assets/icons/alignment-justify.svg": __vite_glob_0_1, "../assets/icons/alignment-left.svg": __vite_glob_0_2, "../assets/icons/alignment-right.svg": __vite_glob_0_3, "../assets/icons/arrow.svg": __vite_glob_0_4, "../assets/icons/background-color.svg": __vite_glob_0_5, "../assets/icons/case-style.svg": __vite_glob_0_6, "../assets/icons/font-color.svg": __vite_glob_0_7, "../assets/icons/indicator.svg": __vite_glob_0_8, "../assets/icons/italic.svg": __vite_glob_0_9, "../assets/icons/line-height.svg": __vite_glob_0_10, "../assets/icons/link.svg": __vite_glob_0_11, "../assets/icons/list-circle.svg": __vite_glob_0_12, "../assets/icons/list-decimal.svg": __vite_glob_0_13, "../assets/icons/list-disc.svg": __vite_glob_0_14, "../assets/icons/list-latin.svg": __vite_glob_0_15, "../assets/icons/list-roman.svg": __vite_glob_0_16, "../assets/icons/list-square.svg": __vite_glob_0_17, "../assets/icons/remove-format.svg": __vite_glob_0_18, "../assets/icons/reset-styles.svg": __vite_glob_0_19, "../assets/icons/strike-through.svg": __vite_glob_0_20, "../assets/icons/superscript.svg": __vite_glob_0_21, "../assets/icons/underline.svg": __vite_glob_0_22, "../assets/icons/unlink.svg": __vite_glob_0_23 });
|
|
14434
14435
|
function importIcon(name) {
|
|
14435
14436
|
return modules[`../assets/icons/${name}.svg`] || "";
|
|
14436
14437
|
}
|
|
@@ -20143,7 +20144,14 @@ var render$v = function __render__14() {
|
|
|
20143
20144
|
}
|
|
20144
20145
|
}, [_c("span", {
|
|
20145
20146
|
staticClass: "zw-dropdown__activator-title zw-text--truncate"
|
|
20146
|
-
}, [_vm._v(" " + _vm._s(_vm.activeOptionTitle) + " ")]), _c("Icon", {
|
|
20147
|
+
}, [_vm._v(" " + _vm._s(_vm.activeOptionTitle) + " ")]), _vm.isCustomized ? _c("Icon", {
|
|
20148
|
+
staticClass: "zw-dropdown__customized-indicator",
|
|
20149
|
+
attrs: {
|
|
20150
|
+
"name": "indicator",
|
|
20151
|
+
"size": "9px",
|
|
20152
|
+
"data-test-selector": "customizedIndicator"
|
|
20153
|
+
}
|
|
20154
|
+
}) : _vm._e(), _c("Icon", {
|
|
20147
20155
|
staticClass: "zw-dropdown__activator-arrow",
|
|
20148
20156
|
attrs: {
|
|
20149
20157
|
"name": "arrow",
|
|
@@ -20172,6 +20180,11 @@ const __vue2_script$v = {
|
|
|
20172
20180
|
type: String,
|
|
20173
20181
|
required: false,
|
|
20174
20182
|
default: "none"
|
|
20183
|
+
},
|
|
20184
|
+
isCustomized: {
|
|
20185
|
+
type: Boolean,
|
|
20186
|
+
required: false,
|
|
20187
|
+
default: false
|
|
20175
20188
|
}
|
|
20176
20189
|
},
|
|
20177
20190
|
setup(props) {
|
|
@@ -20198,7 +20211,7 @@ var __component__$v = /* @__PURE__ */ normalizeComponent(
|
|
|
20198
20211
|
staticRenderFns$v,
|
|
20199
20212
|
false,
|
|
20200
20213
|
__vue2_injectStyles$v,
|
|
20201
|
-
"
|
|
20214
|
+
"58b29148",
|
|
20202
20215
|
null,
|
|
20203
20216
|
null
|
|
20204
20217
|
);
|
|
@@ -20462,7 +20475,8 @@ var render$q = function __render__19() {
|
|
|
20462
20475
|
staticClass: "zw-dropdown"
|
|
20463
20476
|
}, [_c("DropdownActivator", {
|
|
20464
20477
|
attrs: {
|
|
20465
|
-
"color": _vm.color
|
|
20478
|
+
"color": _vm.color,
|
|
20479
|
+
"is-customized": _vm.isCustomized
|
|
20466
20480
|
},
|
|
20467
20481
|
scopedSlots: _vm._u([{
|
|
20468
20482
|
key: "default",
|
|
@@ -20520,6 +20534,11 @@ const __vue2_script$q = {
|
|
|
20520
20534
|
type: String,
|
|
20521
20535
|
required: false,
|
|
20522
20536
|
default: "none"
|
|
20537
|
+
},
|
|
20538
|
+
isCustomized: {
|
|
20539
|
+
type: Boolean,
|
|
20540
|
+
required: false,
|
|
20541
|
+
default: false
|
|
20523
20542
|
}
|
|
20524
20543
|
},
|
|
20525
20544
|
setup(props, { emit }) {
|
|
@@ -20551,7 +20570,7 @@ var __component__$q = /* @__PURE__ */ normalizeComponent(
|
|
|
20551
20570
|
staticRenderFns$q,
|
|
20552
20571
|
false,
|
|
20553
20572
|
__vue2_injectStyles$q,
|
|
20554
|
-
"
|
|
20573
|
+
"29e6a104",
|
|
20555
20574
|
null,
|
|
20556
20575
|
null
|
|
20557
20576
|
);
|
|
@@ -20870,7 +20889,8 @@ var render$n = function __render__22() {
|
|
|
20870
20889
|
staticClass: "zw-font-family-control",
|
|
20871
20890
|
attrs: {
|
|
20872
20891
|
"options": _vm.options,
|
|
20873
|
-
"value": _vm.currentValue
|
|
20892
|
+
"value": _vm.currentValue,
|
|
20893
|
+
"is-customized": _vm.isCustomized
|
|
20874
20894
|
},
|
|
20875
20895
|
on: {
|
|
20876
20896
|
"change": _vm.apply
|
|
@@ -20931,6 +20951,7 @@ const __vue2_script$n = {
|
|
|
20931
20951
|
return { "--zw-font-family-option": `"${option.id}"` };
|
|
20932
20952
|
}
|
|
20933
20953
|
const currentValue = editor.commands.getFontFamily();
|
|
20954
|
+
const isCustomized = editor.commands.isSettingCustomized("marks", TextSettings.FONT_FAMILY);
|
|
20934
20955
|
const apply2 = (fontFamily) => {
|
|
20935
20956
|
recentFontNames.add(fontFamily);
|
|
20936
20957
|
editor.chain().focus().applyFontFamily(fontFamily).run();
|
|
@@ -20938,6 +20959,7 @@ const __vue2_script$n = {
|
|
|
20938
20959
|
return {
|
|
20939
20960
|
options,
|
|
20940
20961
|
currentValue,
|
|
20962
|
+
isCustomized,
|
|
20941
20963
|
renderOptionStyles,
|
|
20942
20964
|
apply: apply2
|
|
20943
20965
|
};
|
|
@@ -20950,7 +20972,7 @@ var __component__$n = /* @__PURE__ */ normalizeComponent(
|
|
|
20950
20972
|
staticRenderFns$n,
|
|
20951
20973
|
false,
|
|
20952
20974
|
__vue2_injectStyles$n,
|
|
20953
|
-
"
|
|
20975
|
+
"2f66bfa6",
|
|
20954
20976
|
null,
|
|
20955
20977
|
null
|
|
20956
20978
|
);
|
|
@@ -20976,9 +20998,11 @@ var render$m = function __render__23() {
|
|
|
20976
20998
|
},
|
|
20977
20999
|
expression: "{ text: 'Font Weight', hotkey: 'Mod B' }"
|
|
20978
21000
|
}],
|
|
21001
|
+
staticClass: "zw-font-weight-control",
|
|
20979
21002
|
attrs: {
|
|
20980
21003
|
"options": _vm.options,
|
|
20981
|
-
"value": _vm.currentValue
|
|
21004
|
+
"value": _vm.currentValue,
|
|
21005
|
+
"is-customized": _vm.isCustomized
|
|
20982
21006
|
},
|
|
20983
21007
|
on: {
|
|
20984
21008
|
"change": _vm.apply
|
|
@@ -20986,6 +21010,7 @@ var render$m = function __render__23() {
|
|
|
20986
21010
|
});
|
|
20987
21011
|
};
|
|
20988
21012
|
var staticRenderFns$m = [];
|
|
21013
|
+
const FontWeightControl_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
20989
21014
|
const __vue2_script$m = {
|
|
20990
21015
|
name: "FontWeightControl",
|
|
20991
21016
|
components: {
|
|
@@ -20999,10 +21024,12 @@ const __vue2_script$m = {
|
|
|
20999
21024
|
const font = editor.commands.getFont();
|
|
21000
21025
|
const options = computed(() => unref(font).weights.map((style2) => ({ id: style2 })));
|
|
21001
21026
|
const currentValue = editor.commands.getFontWeight();
|
|
21027
|
+
const isCustomized = editor.commands.isSettingCustomized("marks", TextSettings.FONT_WEIGHT);
|
|
21002
21028
|
const apply2 = (value) => editor.chain().focus().applyFontWeight(value).run();
|
|
21003
21029
|
return {
|
|
21004
21030
|
options,
|
|
21005
21031
|
currentValue,
|
|
21032
|
+
isCustomized,
|
|
21006
21033
|
apply: apply2
|
|
21007
21034
|
};
|
|
21008
21035
|
}
|
|
@@ -21014,7 +21041,7 @@ var __component__$m = /* @__PURE__ */ normalizeComponent(
|
|
|
21014
21041
|
staticRenderFns$m,
|
|
21015
21042
|
false,
|
|
21016
21043
|
__vue2_injectStyles$m,
|
|
21017
|
-
|
|
21044
|
+
"5a87e48e",
|
|
21018
21045
|
null,
|
|
21019
21046
|
null
|
|
21020
21047
|
);
|
|
@@ -21043,7 +21070,8 @@ var render$l = function __render__24() {
|
|
|
21043
21070
|
staticClass: "zw-font-size-control",
|
|
21044
21071
|
attrs: {
|
|
21045
21072
|
"options": _vm.options,
|
|
21046
|
-
"value": _vm.currentValue
|
|
21073
|
+
"value": _vm.currentValue,
|
|
21074
|
+
"is-customized": _vm.isCustomized
|
|
21047
21075
|
},
|
|
21048
21076
|
on: {
|
|
21049
21077
|
"change": _vm.apply
|
|
@@ -21067,10 +21095,12 @@ const __vue2_script$l = {
|
|
|
21067
21095
|
return fontSizes.map((size2) => ({ id: size2, title: `${size2}px` }));
|
|
21068
21096
|
});
|
|
21069
21097
|
const currentValue = editor.commands.getFontSize();
|
|
21098
|
+
const isCustomized = editor.commands.isSettingCustomized("marks", TextSettings.FONT_SIZE);
|
|
21070
21099
|
const apply2 = (value) => editor.chain().focus().applyFontSize(value).run();
|
|
21071
21100
|
return {
|
|
21072
21101
|
options,
|
|
21073
21102
|
currentValue,
|
|
21103
|
+
isCustomized,
|
|
21074
21104
|
apply: apply2
|
|
21075
21105
|
};
|
|
21076
21106
|
}
|
|
@@ -21082,7 +21112,7 @@ var __component__$l = /* @__PURE__ */ normalizeComponent(
|
|
|
21082
21112
|
staticRenderFns$l,
|
|
21083
21113
|
false,
|
|
21084
21114
|
__vue2_injectStyles$l,
|
|
21085
|
-
"
|
|
21115
|
+
"3f8185ea",
|
|
21086
21116
|
null,
|
|
21087
21117
|
null
|
|
21088
21118
|
);
|
|
@@ -21116,6 +21146,7 @@ var render$k = function __render__25() {
|
|
|
21116
21146
|
value: "Font Color",
|
|
21117
21147
|
expression: "'Font Color'"
|
|
21118
21148
|
}],
|
|
21149
|
+
staticClass: "zw-position--relative",
|
|
21119
21150
|
attrs: {
|
|
21120
21151
|
"icon": "",
|
|
21121
21152
|
"skin": "toolbar",
|
|
@@ -21130,7 +21161,14 @@ var render$k = function __render__25() {
|
|
|
21130
21161
|
"size": "28px",
|
|
21131
21162
|
"auto-color": ""
|
|
21132
21163
|
}
|
|
21133
|
-
})
|
|
21164
|
+
}), _vm.isCustomized ? _c("Icon", {
|
|
21165
|
+
staticClass: "zw-button__customized-indicator",
|
|
21166
|
+
attrs: {
|
|
21167
|
+
"name": "indicator",
|
|
21168
|
+
"size": "9px",
|
|
21169
|
+
"data-test-selector": "customizedIndicator"
|
|
21170
|
+
}
|
|
21171
|
+
}) : _vm._e()], 1)];
|
|
21134
21172
|
}
|
|
21135
21173
|
}])
|
|
21136
21174
|
});
|
|
@@ -21149,9 +21187,11 @@ const __vue2_script$k = {
|
|
|
21149
21187
|
setup() {
|
|
21150
21188
|
const editor = inject(InjectionTokens$1.EDITOR);
|
|
21151
21189
|
const currentValue = editor.commands.getFontColor();
|
|
21190
|
+
const isCustomized = editor.commands.isSettingCustomized("marks", TextSettings.FONT_COLOR);
|
|
21152
21191
|
const apply2 = (color) => editor.chain().applyFontColor(color).run();
|
|
21153
21192
|
return {
|
|
21154
21193
|
currentValue,
|
|
21194
|
+
isCustomized,
|
|
21155
21195
|
apply: apply2
|
|
21156
21196
|
};
|
|
21157
21197
|
}
|
|
@@ -21270,6 +21310,7 @@ var render$i = function __render__27() {
|
|
|
21270
21310
|
},
|
|
21271
21311
|
expression: "{ text: 'Italic', hotkey: 'Mod I' }"
|
|
21272
21312
|
}],
|
|
21313
|
+
staticClass: "zw-position--relative",
|
|
21273
21314
|
attrs: {
|
|
21274
21315
|
"skin": "toolbar",
|
|
21275
21316
|
"icon": "",
|
|
@@ -21285,7 +21326,14 @@ var render$i = function __render__27() {
|
|
|
21285
21326
|
"size": "28px",
|
|
21286
21327
|
"auto-color": ""
|
|
21287
21328
|
}
|
|
21288
|
-
})
|
|
21329
|
+
}), _vm.isCustomized ? _c("Icon", {
|
|
21330
|
+
staticClass: "zw-button__customized-indicator",
|
|
21331
|
+
attrs: {
|
|
21332
|
+
"name": "indicator",
|
|
21333
|
+
"size": "9px",
|
|
21334
|
+
"data-test-selector": "customizedIndicator"
|
|
21335
|
+
}
|
|
21336
|
+
}) : _vm._e()], 1);
|
|
21289
21337
|
};
|
|
21290
21338
|
var staticRenderFns$i = [];
|
|
21291
21339
|
const __vue2_script$i = {
|
|
@@ -21300,11 +21348,13 @@ const __vue2_script$i = {
|
|
|
21300
21348
|
setup() {
|
|
21301
21349
|
const editor = inject(InjectionTokens$1.EDITOR);
|
|
21302
21350
|
const currentValue = editor.commands.isItalic();
|
|
21351
|
+
const isCustomized = editor.commands.isSettingCustomized("marks", TextSettings.FONT_STYLE);
|
|
21303
21352
|
const isAvailable = editor.commands.isItalicAvailable();
|
|
21304
21353
|
const apply2 = () => editor.chain().focus().toggleItalic().run();
|
|
21305
21354
|
return {
|
|
21306
21355
|
isAvailable,
|
|
21307
21356
|
currentValue,
|
|
21357
|
+
isCustomized,
|
|
21308
21358
|
apply: apply2
|
|
21309
21359
|
};
|
|
21310
21360
|
}
|
|
@@ -21342,6 +21392,7 @@ var render$h = function __render__28() {
|
|
|
21342
21392
|
},
|
|
21343
21393
|
expression: "{ text: 'Underline', hotkey: 'Mod U' }"
|
|
21344
21394
|
}],
|
|
21395
|
+
staticClass: "zw-position--relative",
|
|
21345
21396
|
attrs: {
|
|
21346
21397
|
"skin": "toolbar",
|
|
21347
21398
|
"icon": "",
|
|
@@ -21356,7 +21407,14 @@ var render$h = function __render__28() {
|
|
|
21356
21407
|
"size": "28px",
|
|
21357
21408
|
"auto-color": ""
|
|
21358
21409
|
}
|
|
21359
|
-
})
|
|
21410
|
+
}), _vm.isCustomized ? _c("Icon", {
|
|
21411
|
+
staticClass: "zw-button__customized-indicator",
|
|
21412
|
+
attrs: {
|
|
21413
|
+
"name": "indicator",
|
|
21414
|
+
"size": "9px",
|
|
21415
|
+
"data-test-selector": "customizedIndicator"
|
|
21416
|
+
}
|
|
21417
|
+
}) : _vm._e()], 1);
|
|
21360
21418
|
};
|
|
21361
21419
|
var staticRenderFns$h = [];
|
|
21362
21420
|
const __vue2_script$h = {
|
|
@@ -21371,9 +21429,11 @@ const __vue2_script$h = {
|
|
|
21371
21429
|
setup() {
|
|
21372
21430
|
const editor = inject(InjectionTokens$1.EDITOR);
|
|
21373
21431
|
const currentValue = editor.commands.isUnderline();
|
|
21432
|
+
const isCustomized = editor.commands.isUnderlineCustomized();
|
|
21374
21433
|
const apply2 = () => editor.chain().focus().toggleUnderline().run();
|
|
21375
21434
|
return {
|
|
21376
21435
|
currentValue,
|
|
21436
|
+
isCustomized,
|
|
21377
21437
|
apply: apply2
|
|
21378
21438
|
};
|
|
21379
21439
|
}
|
|
@@ -21634,6 +21694,7 @@ var render$d = function __render__32() {
|
|
|
21634
21694
|
value: option.tooltip,
|
|
21635
21695
|
expression: "option.tooltip"
|
|
21636
21696
|
}],
|
|
21697
|
+
staticClass: "zw-position--relative",
|
|
21637
21698
|
attrs: {
|
|
21638
21699
|
"icon": "",
|
|
21639
21700
|
"skin": "toolbar",
|
|
@@ -21642,7 +21703,14 @@ var render$d = function __render__32() {
|
|
|
21642
21703
|
on: {
|
|
21643
21704
|
"click": activate
|
|
21644
21705
|
}
|
|
21645
|
-
}, [_c("Icon", {
|
|
21706
|
+
}, [_vm.isCustomized && isActive2 ? _c("Icon", {
|
|
21707
|
+
staticClass: "zw-button__customized-indicator",
|
|
21708
|
+
attrs: {
|
|
21709
|
+
"name": "indicator",
|
|
21710
|
+
"size": "9px",
|
|
21711
|
+
"data-test-selector": "customizedIndicator"
|
|
21712
|
+
}
|
|
21713
|
+
}) : _vm._e(), _c("Icon", {
|
|
21646
21714
|
attrs: {
|
|
21647
21715
|
"name": "alignment-".concat(option.id),
|
|
21648
21716
|
"size": "28px",
|
|
@@ -21685,12 +21753,14 @@ const __vue2_script$d = {
|
|
|
21685
21753
|
setup(_, { emit }) {
|
|
21686
21754
|
const editor = inject(InjectionTokens$1.EDITOR);
|
|
21687
21755
|
const currentValue = editor.commands.getAlignment();
|
|
21756
|
+
const isCustomized = editor.commands.isSettingCustomized("attributes", TextSettings.ALIGNMENT);
|
|
21688
21757
|
function apply2(value) {
|
|
21689
21758
|
editor.chain().focus().applyAlignment(value).run();
|
|
21690
21759
|
emit("applied");
|
|
21691
21760
|
}
|
|
21692
21761
|
return {
|
|
21693
21762
|
currentValue,
|
|
21763
|
+
isCustomized,
|
|
21694
21764
|
apply: apply2
|
|
21695
21765
|
};
|
|
21696
21766
|
}
|
|
@@ -21816,6 +21886,7 @@ var render$b = function __render__34() {
|
|
|
21816
21886
|
value: "Line Height",
|
|
21817
21887
|
expression: "'Line Height'"
|
|
21818
21888
|
}],
|
|
21889
|
+
staticClass: "zw-position--relative",
|
|
21819
21890
|
attrs: {
|
|
21820
21891
|
"icon": "",
|
|
21821
21892
|
"skin": "toolbar",
|
|
@@ -21830,7 +21901,14 @@ var render$b = function __render__34() {
|
|
|
21830
21901
|
"size": "28px",
|
|
21831
21902
|
"auto-color": ""
|
|
21832
21903
|
}
|
|
21833
|
-
})
|
|
21904
|
+
}), _vm.isCustomized ? _c("Icon", {
|
|
21905
|
+
staticClass: "zw-button__customized-indicator",
|
|
21906
|
+
attrs: {
|
|
21907
|
+
"name": "indicator",
|
|
21908
|
+
"size": "9px",
|
|
21909
|
+
"data-test-selector": "customizedIndicator"
|
|
21910
|
+
}
|
|
21911
|
+
}) : _vm._e()], 1), _c("Modal", {
|
|
21834
21912
|
ref: "modalRef",
|
|
21835
21913
|
staticClass: "zw-line-height-control__modal",
|
|
21836
21914
|
attrs: {
|
|
@@ -21889,11 +21967,13 @@ const __vue2_script$b = {
|
|
|
21889
21967
|
const editor = inject(InjectionTokens$1.EDITOR);
|
|
21890
21968
|
const toggler = useModalToggler({ wrapperRef, modalRef });
|
|
21891
21969
|
const currentValue = editor.commands.getLineHeight();
|
|
21970
|
+
const isCustomized = editor.commands.isSettingCustomized("attributes", TextSettings.LINE_HEIGHT);
|
|
21892
21971
|
const apply2 = (value) => editor.commands.applyLineHeight(String(value));
|
|
21893
21972
|
return {
|
|
21894
21973
|
wrapperRef,
|
|
21895
21974
|
modalRef,
|
|
21896
21975
|
isOpened: toggler.isOpened,
|
|
21976
|
+
isCustomized,
|
|
21897
21977
|
toggler,
|
|
21898
21978
|
currentValue,
|
|
21899
21979
|
apply: apply2
|
|
@@ -21907,7 +21987,7 @@ var __component__$b = /* @__PURE__ */ normalizeComponent(
|
|
|
21907
21987
|
staticRenderFns$b,
|
|
21908
21988
|
false,
|
|
21909
21989
|
__vue2_injectStyles$b,
|
|
21910
|
-
"
|
|
21990
|
+
"8aeefd68",
|
|
21911
21991
|
null,
|
|
21912
21992
|
null
|
|
21913
21993
|
);
|
|
@@ -23197,29 +23277,47 @@ const StylePreset = Extension.create({
|
|
|
23197
23277
|
removePreset: createCommand(({ commands: commands2 }) => {
|
|
23198
23278
|
commands2.setNode(NodeTypes.PARAGRAPH, { preset: null });
|
|
23199
23279
|
}),
|
|
23200
|
-
getPresetCustomization: createCommand(({ editor }) => {
|
|
23280
|
+
getPresetCustomization: createCommand(({ editor, commands: commands2 }) => {
|
|
23201
23281
|
const state = toRef(editor, "state");
|
|
23202
23282
|
return computed(() => {
|
|
23203
|
-
const
|
|
23204
|
-
const
|
|
23205
|
-
|
|
23206
|
-
|
|
23207
|
-
|
|
23208
|
-
|
|
23209
|
-
|
|
23210
|
-
|
|
23211
|
-
|
|
23212
|
-
|
|
23213
|
-
|
|
23214
|
-
|
|
23215
|
-
|
|
23283
|
+
const { selection, doc: doc2 } = unref(state);
|
|
23284
|
+
const { from: from2, to } = selection;
|
|
23285
|
+
return commands2._getSettingCustomization(doc2, from2, to);
|
|
23286
|
+
});
|
|
23287
|
+
}),
|
|
23288
|
+
isSettingCustomized: createCommand(({ commands: commands2 }, group, name) => {
|
|
23289
|
+
const customization = commands2.getPresetCustomization();
|
|
23290
|
+
return computed(() => {
|
|
23291
|
+
var _a, _b;
|
|
23292
|
+
return (_b = (_a = unref(customization)[group]) == null ? void 0 : _a.includes(name)) != null ? _b : false;
|
|
23293
|
+
});
|
|
23294
|
+
}),
|
|
23295
|
+
getContentCustomization: createCommand(({ editor, commands: commands2 }) => {
|
|
23296
|
+
const state = toRef(editor, "state");
|
|
23297
|
+
return computed(() => {
|
|
23298
|
+
const { doc: doc2 } = unref(state);
|
|
23299
|
+
return commands2._getSettingCustomization(doc2, 0, doc2.content.size);
|
|
23300
|
+
});
|
|
23301
|
+
}),
|
|
23302
|
+
_getSettingCustomization: createCommand((_, doc2, from2, to) => {
|
|
23303
|
+
const marks = /* @__PURE__ */ new Set();
|
|
23304
|
+
const attributes = /* @__PURE__ */ new Set();
|
|
23305
|
+
doc2.nodesBetween(from2, to, (node) => {
|
|
23306
|
+
for (const [name, value] of Object.entries(node.attrs)) {
|
|
23307
|
+
const isSetting = TextSettings.attributes.includes(name);
|
|
23308
|
+
if (isSetting && value)
|
|
23309
|
+
attributes.add(name);
|
|
23310
|
+
}
|
|
23311
|
+
for (const { type } of node.marks) {
|
|
23312
|
+
if (TextSettings.marks.includes(type.name)) {
|
|
23313
|
+
marks.add(type.name);
|
|
23216
23314
|
}
|
|
23217
|
-
}
|
|
23218
|
-
return {
|
|
23219
|
-
attributes: Array.from(attributes),
|
|
23220
|
-
marks: Array.from(marks)
|
|
23221
|
-
};
|
|
23315
|
+
}
|
|
23222
23316
|
});
|
|
23317
|
+
return {
|
|
23318
|
+
attributes: Array.from(attributes),
|
|
23319
|
+
marks: Array.from(marks)
|
|
23320
|
+
};
|
|
23223
23321
|
}),
|
|
23224
23322
|
removePresetCustomization: createCommand(({ chain }) => {
|
|
23225
23323
|
chain().storeSelection().expandSelectionToBlock().unsetMarks(TextSettings.marks).resetAttributes(NodeTypes.PARAGRAPH, TextSettings.attributes).resetAttributes(NodeTypes.HEADING, TextSettings.attributes).restoreSelection().run();
|
|
@@ -23586,6 +23684,11 @@ const TextDecoration = Mark.create({
|
|
|
23586
23684
|
};
|
|
23587
23685
|
});
|
|
23588
23686
|
}),
|
|
23687
|
+
isUnderlineCustomized: createCommand(({ commands: commands2 }) => {
|
|
23688
|
+
const currentValue = commands2.isUnderline();
|
|
23689
|
+
const defaultValue = commands2.getDefaultTextDecoration();
|
|
23690
|
+
return computed(() => unref(currentValue) !== unref(defaultValue).underline);
|
|
23691
|
+
}),
|
|
23589
23692
|
getDefaultTextDecoration: createCommand(({ commands: commands2 }) => {
|
|
23590
23693
|
const preset = commands2.getPreset();
|
|
23591
23694
|
return computed(() => {
|
|
@@ -26123,6 +26226,7 @@ const __vue2_script = {
|
|
|
26123
26226
|
listRef: toRef(props, "favoriteColors"),
|
|
26124
26227
|
triggerUpdate: (colors) => emit("update-favorite-colors", colors)
|
|
26125
26228
|
});
|
|
26229
|
+
const getContentCustomization = () => editor.commands.getContentCustomization();
|
|
26126
26230
|
provide(InjectionTokens$1.EDITOR, editor);
|
|
26127
26231
|
provide(InjectionTokens$1.FONTS, fonts);
|
|
26128
26232
|
provide(InjectionTokens$1.FONT_SIZES, fontSizes);
|
|
@@ -26135,7 +26239,8 @@ const __vue2_script = {
|
|
|
26135
26239
|
toolbarRef,
|
|
26136
26240
|
wysiwygRef,
|
|
26137
26241
|
toolbar,
|
|
26138
|
-
updateToolbar
|
|
26242
|
+
updateToolbar,
|
|
26243
|
+
getContentCustomization
|
|
26139
26244
|
};
|
|
26140
26245
|
}
|
|
26141
26246
|
};
|
package/lib/Wysiwyg.vue
CHANGED
|
@@ -193,6 +193,8 @@ export default {
|
|
|
193
193
|
triggerUpdate: (colors) => emit('update-favorite-colors', colors)
|
|
194
194
|
});
|
|
195
195
|
|
|
196
|
+
const getContentCustomization = () => editor.commands.getContentCustomization();
|
|
197
|
+
|
|
196
198
|
provide(InjectionTokens.EDITOR, editor);
|
|
197
199
|
provide(InjectionTokens.FONTS, fonts);
|
|
198
200
|
provide(InjectionTokens.FONT_SIZES, fontSizes);
|
|
@@ -206,7 +208,8 @@ export default {
|
|
|
206
208
|
toolbarRef,
|
|
207
209
|
wysiwygRef,
|
|
208
210
|
toolbar,
|
|
209
|
-
updateToolbar
|
|
211
|
+
updateToolbar,
|
|
212
|
+
getContentCustomization
|
|
210
213
|
};
|
|
211
214
|
}
|
|
212
215
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="9" height="9" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M0 4.5C0 2.01472 2.01472 0 4.5 0C6.98528 0 9 2.01472 9 4.5C9 6.98528 6.98528 9 4.5 9C2.01472 9 0 6.98528 0 4.5Z" fill="#FFAB00"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.0625 2.25H3.9375V5.625H5.0625V2.25Z" fill="white"/>
|
|
4
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.9375 6.75C3.9375 6.43894 4.18894 6.1875 4.5 6.1875C4.8105 6.1875 5.0625 6.43894 5.0625 6.75C5.0625 7.06106 4.8105 7.3125 4.5 7.3125C4.18894 7.3125 3.9375 7.06106 3.9375 6.75Z" fill="white"/>
|
|
5
|
+
</svg>
|
|
@@ -135,4 +135,11 @@ export default {
|
|
|
135
135
|
color: rgb(var(--zw-color-white));
|
|
136
136
|
background-color: rgb(var(--zw-color-n5));
|
|
137
137
|
}
|
|
138
|
+
|
|
139
|
+
.zw-button__customized-indicator {
|
|
140
|
+
display: inline-block !important;
|
|
141
|
+
position: absolute;
|
|
142
|
+
top: calc(0px - var(--zw-offset-xxs));
|
|
143
|
+
right: 2px;
|
|
144
|
+
}
|
|
138
145
|
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="zw-dropdown" ref="dropdownRef">
|
|
3
|
-
<DropdownActivator :color="color">
|
|
3
|
+
<DropdownActivator :color="color" :is-customized="isCustomized">
|
|
4
4
|
<template #default="attrs">
|
|
5
5
|
<slot name="activator" v-bind="attrs" />
|
|
6
6
|
</template>
|
|
@@ -60,6 +60,12 @@ export default {
|
|
|
60
60
|
type: String,
|
|
61
61
|
required: false,
|
|
62
62
|
default: 'none'
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
isCustomized: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
required: false,
|
|
68
|
+
default: false
|
|
63
69
|
}
|
|
64
70
|
},
|
|
65
71
|
|