ninegrid2 6.1329.0 → 6.1331.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.
@@ -55297,6 +55297,8 @@ class nxEditor extends nxDiv {
55297
55297
 
55298
55298
  this.shadowRoot.querySelector('#font-size').onchange = (e) => {
55299
55299
  const size = e.target.value;
55300
+
55301
+ console.log(e.target, size);
55300
55302
  // Tiptap의 chain을 사용하여 스타일 적용
55301
55303
  this.#editor.chain().focus().setMark('textStyle', { fontSize: size }).run();
55302
55304
  };
@@ -55308,7 +55310,21 @@ class nxEditor extends nxDiv {
55308
55310
  extensions: [
55309
55311
  index_default,
55310
55312
  Underline,
55311
- TextStyle,
55313
+ TextStyle.extend({
55314
+ addAttributes() {
55315
+ return {
55316
+ fontSize: {
55317
+ default: null,
55318
+ // HTML 태그에 style="font-size: ..."를 입히는 로직
55319
+ parseHTML: element => element.style.fontSize,
55320
+ renderHTML: attributes => {
55321
+ if (!attributes.fontSize) return {};
55322
+ return { style: `font-size: ${attributes.fontSize}` };
55323
+ },
55324
+ },
55325
+ };
55326
+ },
55327
+ }),
55312
55328
  Color,
55313
55329
  TextStyle.configure({ types: [Highlight.name, Color.name] }),
55314
55330
  Highlight.configure({ multicolor: true }),
@@ -55293,6 +55293,8 @@ class nxEditor extends nxDiv {
55293
55293
 
55294
55294
  this.shadowRoot.querySelector('#font-size').onchange = (e) => {
55295
55295
  const size = e.target.value;
55296
+
55297
+ console.log(e.target, size);
55296
55298
  // Tiptap의 chain을 사용하여 스타일 적용
55297
55299
  this.#editor.chain().focus().setMark('textStyle', { fontSize: size }).run();
55298
55300
  };
@@ -55304,7 +55306,21 @@ class nxEditor extends nxDiv {
55304
55306
  extensions: [
55305
55307
  index_default,
55306
55308
  Underline,
55307
- TextStyle,
55309
+ TextStyle.extend({
55310
+ addAttributes() {
55311
+ return {
55312
+ fontSize: {
55313
+ default: null,
55314
+ // HTML 태그에 style="font-size: ..."를 입히는 로직
55315
+ parseHTML: element => element.style.fontSize,
55316
+ renderHTML: attributes => {
55317
+ if (!attributes.fontSize) return {};
55318
+ return { style: `font-size: ${attributes.fontSize}` };
55319
+ },
55320
+ },
55321
+ };
55322
+ },
55323
+ }),
55308
55324
  Color,
55309
55325
  TextStyle.configure({ types: [Highlight.name, Color.name] }),
55310
55326
  Highlight.configure({ multicolor: true }),
@@ -109,6 +109,8 @@ class nxEditor extends nxDiv {
109
109
 
110
110
  this.shadowRoot.querySelector('#font-size').onchange = (e) => {
111
111
  const size = e.target.value;
112
+
113
+ console.log(e.target, size);
112
114
  // Tiptap의 chain을 사용하여 스타일 적용
113
115
  this.#editor.chain().focus().setMark('textStyle', { fontSize: size }).run();
114
116
  };
@@ -120,7 +122,21 @@ class nxEditor extends nxDiv {
120
122
  extensions: [
121
123
  StarterKit,
122
124
  Underline,
123
- TextStyle,
125
+ TextStyle.extend({
126
+ addAttributes() {
127
+ return {
128
+ fontSize: {
129
+ default: null,
130
+ // HTML 태그에 style="font-size: ..."를 입히는 로직
131
+ parseHTML: element => element.style.fontSize,
132
+ renderHTML: attributes => {
133
+ if (!attributes.fontSize) return {};
134
+ return { style: `font-size: ${attributes.fontSize}` };
135
+ },
136
+ },
137
+ };
138
+ },
139
+ }),
124
140
  Color,
125
141
  TextStyle.configure({ types: [Highlight.name, Color.name] }),
126
142
  Highlight.configure({ multicolor: true }),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.1329.0",
4
+ "version": "6.1331.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -109,6 +109,8 @@ class nxEditor extends nxDiv {
109
109
 
110
110
  this.shadowRoot.querySelector('#font-size').onchange = (e) => {
111
111
  const size = e.target.value;
112
+
113
+ console.log(e.target, size);
112
114
  // Tiptap의 chain을 사용하여 스타일 적용
113
115
  this.#editor.chain().focus().setMark('textStyle', { fontSize: size }).run();
114
116
  };
@@ -120,7 +122,21 @@ class nxEditor extends nxDiv {
120
122
  extensions: [
121
123
  StarterKit,
122
124
  Underline,
123
- TextStyle,
125
+ TextStyle.extend({
126
+ addAttributes() {
127
+ return {
128
+ fontSize: {
129
+ default: null,
130
+ // HTML 태그에 style="font-size: ..."를 입히는 로직
131
+ parseHTML: element => element.style.fontSize,
132
+ renderHTML: attributes => {
133
+ if (!attributes.fontSize) return {};
134
+ return { style: `font-size: ${attributes.fontSize}` };
135
+ },
136
+ },
137
+ };
138
+ },
139
+ }),
124
140
  Color,
125
141
  TextStyle.configure({ types: [Highlight.name, Color.name] }),
126
142
  Highlight.configure({ multicolor: true }),