@sveltia/ui 0.30.3 → 0.31.1

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.
@@ -17,6 +17,11 @@ export const AVAILABLE_BUTTONS = {
17
17
  icon: 'format_italic',
18
18
  inline: true,
19
19
  },
20
+ strikethrough: {
21
+ labelKey: 'strikethrough',
22
+ icon: 'strikethrough_s',
23
+ inline: true,
24
+ },
20
25
  code: {
21
26
  labelKey: 'code',
22
27
  icon: 'code',
@@ -87,7 +92,7 @@ export const AVAILABLE_BUTTONS = {
87
92
  /**
88
93
  * @type {TextEditorFormatType[]}
89
94
  */
90
- export const TEXT_FORMAT_BUTTON_TYPES = ['bold', 'italic', 'code'];
95
+ export const TEXT_FORMAT_BUTTON_TYPES = ['bold', 'italic', 'strikethrough', 'code'];
91
96
 
92
97
  /**
93
98
  * @type {TextEditorInlineType[]}
@@ -89,10 +89,11 @@ const editorConfig = {
89
89
  theme: {
90
90
  text: {
91
91
  /**
92
- * Enable bold+italic styling.
92
+ * Enable bold+italic and strikethrough styling.
93
93
  * @see https://github.com/facebook/lexical/discussions/4381
94
94
  */
95
95
  italic: 'italic',
96
+ strikethrough: 'strikethrough',
96
97
  },
97
98
  list: {
98
99
  nested: {
@@ -162,6 +162,9 @@
162
162
  .lexical-root :global(strong.italic) {
163
163
  font-style: italic;
164
164
  }
165
+ .lexical-root :global(.strikethrough) {
166
+ text-decoration: line-through;
167
+ }
165
168
  .lexical-root :global(li.nested) {
166
169
  list-style-type: none;
167
170
  }
@@ -42,7 +42,7 @@
42
42
  top: 0;
43
43
  z-index: 1;
44
44
  display: flex;
45
- gap: 8px;
45
+ gap: 4px;
46
46
  border-width: 1px 1px 0;
47
47
  border-style: solid;
48
48
  border-color: var(--sui-textbox-border-color);
@@ -50,7 +50,8 @@
50
50
  border-start-end-radius: var(--sui-textbox-border-radius);
51
51
  border-end-start-radius: 0;
52
52
  border-end-end-radius: 0;
53
- padding: 8px;
53
+ padding: 0 4px;
54
+ height: 40px;
54
55
  background-color: var(--sui-tertiary-background-color);
55
56
  }
56
57
  @media (width < 768px) {
@@ -54,6 +54,7 @@ export namespace strings {
54
54
  export let code_block: string;
55
55
  export let bold: string;
56
56
  export let italic: string;
57
+ export let strikethrough: string;
57
58
  export let code: string;
58
59
  export let link: string;
59
60
  export let insert_link: string;
@@ -53,6 +53,7 @@ export const strings = {
53
53
  code_block: 'Code Block',
54
54
  bold: 'Bold',
55
55
  italic: 'Italic',
56
+ strikethrough: 'Strikethrough',
56
57
  code: 'Code',
57
58
  link: 'Link',
58
59
  insert_link: 'Insert Link',
@@ -54,6 +54,7 @@ export namespace strings {
54
54
  export let code_block: string;
55
55
  export let bold: string;
56
56
  export let italic: string;
57
+ export let strikethrough: string;
57
58
  export let code: string;
58
59
  export let link: string;
59
60
  export let insert_link: string;
@@ -53,6 +53,7 @@ export const strings = {
53
53
  code_block: 'コードブロック',
54
54
  bold: '太字',
55
55
  italic: '斜体',
56
+ strikethrough: '取り消し線',
56
57
  code: 'コード',
57
58
  link: 'リンク',
58
59
  insert_link: 'リンクを挿入',
@@ -587,7 +587,7 @@ export type InputEventHandlers = {
587
587
  export type PopupPosition = ("top-left" | "top-right" | "right-top" | "right-bottom" | "bottom-left" | "bottom-right" | "left-top" | "left-bottom");
588
588
  export type ToastPosition = "auto" | "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
589
589
  export type TextEditorBlockType = "paragraph" | "heading-1" | "heading-2" | "heading-3" | "heading-4" | "heading-5" | "heading-6" | "bulleted-list" | "numbered-list" | "blockquote" | "code-block";
590
- export type TextEditorFormatType = "bold" | "italic" | "code";
590
+ export type TextEditorFormatType = "bold" | "italic" | "strikethrough" | "code";
591
591
  export type TextEditorInlineType = TextEditorFormatType | "link";
592
592
  export type TextEditorMode = "rich-text" | "plain-text";
593
593
  export type TextEditorComponent = {
package/dist/typedefs.js CHANGED
@@ -237,7 +237,7 @@
237
237
  */
238
238
 
239
239
  /**
240
- * @typedef {'bold' | 'italic' | 'code'} TextEditorFormatType
240
+ * @typedef {'bold' | 'italic' | 'strikethrough' | 'code'} TextEditorFormatType
241
241
  */
242
242
 
243
243
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltia/ui",
3
- "version": "0.30.3",
3
+ "version": "0.31.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {