@livepreso/react-plugin-textfield 0.5.1 → 0.6.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 (177) hide show
  1. package/.rush/temp/shrinkwrap-deps.json +2 -2
  2. package/CHANGELOG.json +37 -0
  3. package/CHANGELOG.md +15 -1
  4. package/components/BorderEdgeToggle.js +72 -0
  5. package/components/BubbleMenu.js +107 -19
  6. package/components/BubbleMenu.module.scss +0 -1
  7. package/components/InsertTokenDialog.js +1 -1
  8. package/components/InsertTokenDialog.module.scss +1 -1
  9. package/components/LinkEditDialog.js +2 -2
  10. package/components/LinkEditDialog.module.scss +1 -1
  11. package/components/TableDensityPicker.js +48 -0
  12. package/components/{color-picker/ColorPicker.module.scss → TableDensityPicker.module.scss} +4 -3
  13. package/components/TableToolbar.js +4 -0
  14. package/components/VerticalAlignToggle.js +8 -8
  15. package/components/color-picker/ColorPickerCombo.js +5 -5
  16. package/components/color-picker/ColorPickerCombo.module.scss +1 -1
  17. package/components/editor-toolbars/EditorMenu.js +2 -1
  18. package/components/editor-toolbars/EditorMenu.module.scss +1 -1
  19. package/components/editor-toolbars/EditorToolbar.js +10 -7
  20. package/components/editor-toolbars/EditorToolbar.module.scss +11 -68
  21. package/components/editor-toolbars/SimpleButton.module.scss +1 -1
  22. package/components/editor-toolbars/SubMenu.js +59 -3
  23. package/components/table-creator/TableCreatorCombo.js +4 -4
  24. package/components/table-creator/TableCreatorCombo.module.scss +1 -1
  25. package/components/tiptap/Table.js +172 -5
  26. package/components/tiptap/TableCells.js +33 -0
  27. package/components/tiptap/token/Token.module.scss +1 -1
  28. package/components/tiptap/token/TokenList.module.scss +1 -1
  29. package/components/utils.js +0 -49
  30. package/configs/table-toolbar-configuration.js +87 -8
  31. package/configs/toolbar-configuration.js +3 -3
  32. package/constants.js +16 -1
  33. package/index.js +11 -4
  34. package/index.module.scss +63 -22
  35. package/package.json +3 -4
  36. package/utils/generate-border-icon.js +22 -0
  37. package/utils/generate-vertical-alignment-icon.js +1 -1
  38. package/components/Popover.js +0 -43
  39. package/components/Popover.module.scss +0 -80
  40. package/components/Select/Select.js +0 -71
  41. package/components/Select/Select.module.scss +0 -100
  42. package/components/Select/SelectGroup.js +0 -37
  43. package/components/Select/index.js +0 -1
  44. package/components/Tooltip.js +0 -34
  45. package/components/Tooltip.module.scss +0 -87
  46. package/components/color-picker/ColorPicker.js +0 -28
  47. package/components/color-picker/ColorPickerChip.js +0 -22
  48. package/components/color-picker/ColorPickerChip.module.scss +0 -25
  49. package/components/editor-toolbars/ToolbarButton.js +0 -26
  50. package/components/editor-toolbars/ToolbarToggle.js +0 -35
  51. package/components/editor-toolbars/ToolbarToggleGroup.js +0 -43
  52. package/components/style.module.scss +0 -63
  53. package/icons/AddColumnLeft.js +0 -15
  54. package/icons/AddColumnRight.js +0 -15
  55. package/icons/AddRowAbove.js +0 -15
  56. package/icons/AddRowBelow.js +0 -15
  57. package/icons/AlignHorizontalCenter.js +0 -13
  58. package/icons/AlignHorizontalLeft.js +0 -13
  59. package/icons/AlignHorizontalRight.js +0 -13
  60. package/icons/AlignVerticalBottom.js +0 -13
  61. package/icons/AlignVerticalCenter.js +0 -13
  62. package/icons/AlignVerticalTop.js +0 -13
  63. package/icons/Backspace.js +0 -13
  64. package/icons/Bold.js +0 -14
  65. package/icons/BorderAll.js +0 -13
  66. package/icons/BorderBottom.js +0 -13
  67. package/icons/BorderClear.js +0 -13
  68. package/icons/BorderHorizontal.js +0 -13
  69. package/icons/BorderInner.js +0 -13
  70. package/icons/BorderLeft.js +0 -13
  71. package/icons/BorderOuter.js +0 -13
  72. package/icons/BorderRight.js +0 -13
  73. package/icons/BorderTop.js +0 -13
  74. package/icons/BorderVertical.js +0 -13
  75. package/icons/Close.js +0 -13
  76. package/icons/Delete.js +0 -13
  77. package/icons/EvenlyDistribute.js +0 -14
  78. package/icons/FitWidth.js +0 -13
  79. package/icons/FitWidthArrows.js +0 -21
  80. package/icons/FormatAlignCenter.js +0 -13
  81. package/icons/FormatAlignJustify.js +0 -13
  82. package/icons/FormatAlignLeft.js +0 -13
  83. package/icons/FormatAlignRight.js +0 -13
  84. package/icons/FormatBold.js +0 -13
  85. package/icons/FormatClear.js +0 -13
  86. package/icons/FormatColorFill.js +0 -13
  87. package/icons/FormatColorText.js +0 -13
  88. package/icons/FormatItalic.js +0 -13
  89. package/icons/FormatLineSpacing.js +0 -13
  90. package/icons/FormatListBulleted.js +0 -13
  91. package/icons/FormatListNumbered.js +0 -13
  92. package/icons/FormatStrikethrough.js +0 -13
  93. package/icons/FormatUnderlined.js +0 -13
  94. package/icons/HelpCenter.js +0 -13
  95. package/icons/HorizontalRule.js +0 -13
  96. package/icons/Italic.js +0 -14
  97. package/icons/ItalicIcon.js +0 -18
  98. package/icons/Link.js +0 -13
  99. package/icons/LinkOff.js +0 -13
  100. package/icons/MergeCells.js +0 -14
  101. package/icons/MoreVert.js +0 -13
  102. package/icons/Redo.js +0 -13
  103. package/icons/RemoveColumnOutline.js +0 -28
  104. package/icons/RemoveRowOutline.js +0 -25
  105. package/icons/SplitCells.js +0 -14
  106. package/icons/SplitScene.js +0 -13
  107. package/icons/Subscript.js +0 -13
  108. package/icons/Superscript.js +0 -13
  109. package/icons/Underline.js +0 -14
  110. package/icons/Undo.js +0 -13
  111. package/icons/VerticalAlignBottom.js +0 -13
  112. package/icons/VerticalAlignCenter.js +0 -13
  113. package/icons/VerticalAlignTop.js +0 -13
  114. package/icons/WandStars.js +0 -13
  115. package/icons/add_column_left.svg +0 -6
  116. package/icons/add_column_right.svg +0 -6
  117. package/icons/add_row_above.svg +0 -6
  118. package/icons/add_row_below.svg +0 -6
  119. package/icons/align_horizontal_center.svg +0 -1
  120. package/icons/align_horizontal_left.svg +0 -1
  121. package/icons/align_horizontal_right.svg +0 -1
  122. package/icons/align_vertical_bottom.svg +0 -1
  123. package/icons/align_vertical_center.svg +0 -1
  124. package/icons/align_vertical_top.svg +0 -1
  125. package/icons/backspace.svg +0 -1
  126. package/icons/bold.svg +0 -1
  127. package/icons/border_all.svg +0 -1
  128. package/icons/border_bottom.svg +0 -1
  129. package/icons/border_clear.svg +0 -1
  130. package/icons/border_horizontal.svg +0 -1
  131. package/icons/border_inner.svg +0 -1
  132. package/icons/border_left.svg +0 -1
  133. package/icons/border_outer.svg +0 -1
  134. package/icons/border_right.svg +0 -1
  135. package/icons/border_top.svg +0 -1
  136. package/icons/border_vertical.svg +0 -1
  137. package/icons/close.svg +0 -1
  138. package/icons/delete.svg +0 -1
  139. package/icons/evenly_distribute.svg +0 -5
  140. package/icons/fit_width.svg +0 -1
  141. package/icons/fit_width_arrows.svg +0 -12
  142. package/icons/format_align_center.svg +0 -1
  143. package/icons/format_align_justify.svg +0 -1
  144. package/icons/format_align_left.svg +0 -1
  145. package/icons/format_align_right.svg +0 -1
  146. package/icons/format_bold.svg +0 -1
  147. package/icons/format_clear.svg +0 -1
  148. package/icons/format_color_fill.svg +0 -1
  149. package/icons/format_italic.svg +0 -1
  150. package/icons/format_line_spacing.svg +0 -1
  151. package/icons/format_list_bulleted.svg +0 -1
  152. package/icons/format_list_numbered.svg +0 -1
  153. package/icons/format_strikethrough.svg +0 -1
  154. package/icons/format_underlined.svg +0 -1
  155. package/icons/help_center.svg +0 -1
  156. package/icons/horizontal_rule.svg +0 -1
  157. package/icons/index.js +0 -199
  158. package/icons/italic.svg +0 -1
  159. package/icons/link.svg +0 -1
  160. package/icons/link_off.svg +0 -1
  161. package/icons/merge_cells.svg +0 -5
  162. package/icons/more_vert.svg +0 -1
  163. package/icons/redo.svg +0 -1
  164. package/icons/remove_column_outline.svg +0 -20
  165. package/icons/remove_row_outline.svg +0 -17
  166. package/icons/split_cells.svg +0 -5
  167. package/icons/split_scene.svg +0 -1
  168. package/icons/subscript.svg +0 -1
  169. package/icons/superscript.svg +0 -1
  170. package/icons/underline.svg +0 -1
  171. package/icons/undo.svg +0 -1
  172. package/icons/vertical_align_bottom.svg +0 -1
  173. package/icons/vertical_align_center.svg +0 -1
  174. package/icons/vertical_align_top.svg +0 -1
  175. package/icons/wand_stars.svg +0 -1
  176. package/scripts/extract-svg.js +0 -290
  177. package/variables.scss +0 -6
@@ -1,290 +0,0 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
- const https = require("https");
4
- const { transform } = require("@svgr/core");
5
- // const svgrJSX = require("@svgr/plugin-jsx");
6
-
7
- // Array of symbol names to download
8
- const SYMBOL_NAMES = [
9
- "backspace",
10
- "align_horizontal_center",
11
- "align_horizontal_left",
12
- "align_horizontal_right",
13
- "align_vertical_bottom",
14
- "align_vertical_center",
15
- "align_vertical_top",
16
- "border_all",
17
- "border_bottom",
18
- "border_clear",
19
- "border_horizontal",
20
- "border_inner",
21
- "border_left",
22
- "border_outer",
23
- "border_right",
24
- "border_top",
25
- "border_vertical",
26
- "close",
27
- "delete",
28
- "delete_column",
29
- "delete_row",
30
- "format_align_center",
31
- "format_align_justify",
32
- "format_align_left",
33
- "format_align_right",
34
- "format_bold",
35
- "format_clear",
36
- "format_color_fill",
37
- "format_italic",
38
- "format_list_bulleted",
39
- "format_list_numbered",
40
- "format_strikethrough",
41
- "format_underlined",
42
- "help_center",
43
- "horizontal_rule",
44
- "link",
45
- "link_off",
46
- "more_vert",
47
- "redo",
48
- "undo",
49
- "format_line_spacing",
50
- "vertical_align_top",
51
- "vertical_align_center",
52
- "vertical_align_bottom",
53
- "wand_stars",
54
- ];
55
-
56
- /**
57
- * Extracts SVG files from GitHub and saves them with new names
58
- * @param {string} style - The style directory (rounded/sharp/outlined)
59
- * @param {string} weight - The weight parameter for the file name (e.g., 'wght600')
60
- * @param {string} size - The size parameter for the file name (e.g., '24px')
61
- * @param {string} outputDir - Optional output directory (defaults to current directory)
62
- * @param {boolean} createIndex - Whether to create an index.js file (defaults to true)
63
- */
64
-
65
- // eslint-disable-next-line max-params
66
- function extractSvgFiles(
67
- style,
68
- weight,
69
- size,
70
- outputDir = "./",
71
- createIndex = true,
72
- ) {
73
- // Ensure output directory exists
74
- if (!fs.existsSync(outputDir)) {
75
- fs.mkdirSync(outputDir, { recursive: true });
76
- }
77
-
78
- // Track promises for all downloads
79
- const downloadPromises = [];
80
-
81
- // Process each symbol from the predefined array
82
- SYMBOL_NAMES.forEach((symbolName) => {
83
- const githubUrl = `https://raw.githubusercontent.com/google/material-design-icons/refs/heads/master/symbols/web/${symbolName}/materialsymbols${style}/${symbolName}_${weight}_${size}.svg`;
84
-
85
- const outputFileName = `${symbolName}.svg`;
86
- const outputFilePath = path.join(outputDir, outputFileName);
87
-
88
- // Add download promise to array
89
- const downloadPromise = downloadFile(githubUrl, outputFilePath)
90
- .then(() => {
91
- console.log(`Downloaded: ${outputFilePath}`);
92
- })
93
- .catch((error) =>
94
- console.error(`Failed to download ${symbolName}: ${error.message}`),
95
- );
96
-
97
- downloadPromises.push(downloadPromise);
98
- });
99
-
100
- // Wait for all downloads to complete, then create index if requested
101
- Promise.all(downloadPromises)
102
- .then(() => {
103
- console.log("All downloads complete!");
104
-
105
- // Get all SVG files in the directory
106
- const svgFiles = fs
107
- .readdirSync(outputDir)
108
- .filter((file) => file.toLowerCase().endsWith(".svg"));
109
-
110
- // Create React components from all found SVGs
111
- svgFiles.forEach((file) => {
112
- const baseName = path.basename(file, ".svg");
113
-
114
- const componentName = toCamelCase(baseName, true);
115
- const svgCode = fs.readFileSync(`${outputDir}/${file}`, "utf-8");
116
- const reactFilePath = `${outputDir}/${componentName}.js`;
117
-
118
- const reactSvg = transform.sync(
119
- svgCode,
120
- {
121
- icon: size,
122
- jsxRuntime: "classic",
123
- plugins: ["@svgr/plugin-jsx"],
124
- },
125
- { componentName, filePath: reactFilePath },
126
- );
127
-
128
- fs.writeFileSync(reactFilePath, reactSvg);
129
- });
130
-
131
- if (createIndex) {
132
- createSvgIndex({
133
- style,
134
- weight,
135
- size,
136
- svgDir: outputDir,
137
- });
138
- }
139
- })
140
- .catch((error) => {
141
- console.error("Error during download & React component creation:", error);
142
- });
143
- }
144
-
145
- /**
146
- * Downloads a file from a URL and saves it to the specified path
147
- * @param {string} url - The URL to download from
148
- * @param {string} outputPath - The path to save the file to
149
- * @returns {Promise} A promise that resolves when the file is downloaded
150
- */
151
- function downloadFile(url, outputPath) {
152
- return new Promise((resolve, reject) => {
153
- https
154
- .get(url, (response) => {
155
- if (response.statusCode === 200) {
156
- const file = fs.createWriteStream(outputPath);
157
- response.pipe(file);
158
-
159
- file.on("finish", () => {
160
- file.close();
161
- resolve();
162
- });
163
-
164
- file.on("error", (err) => {
165
- fs.unlink(outputPath, () => {}); // Delete the file if there was an error
166
- reject(err);
167
- });
168
- } else if (response.statusCode === 404) {
169
- reject(new Error(`File not found (404): ${url}`));
170
- } else {
171
- reject(new Error(`Failed to download file: ${response.statusCode}`));
172
- }
173
- })
174
- .on("error", (err) => {
175
- reject(err);
176
- });
177
- });
178
- }
179
-
180
- /**
181
- * Converts a string to camelCase format
182
- * @param {string} str - The string to convert
183
- * @returns {string} The camelCase formatted string
184
- */
185
- function toCamelCase(str, captitaliseFirstLetter = false) {
186
- // Replace non-alphanumeric characters with spaces, then split into words
187
- return str
188
- .replace(/[^a-zA-Z0-9]/g, " ")
189
- .split(" ")
190
- .filter((word) => word.length > 0) // Remove empty strings
191
- .map((word, index) => {
192
- // First word starts with lowercase, rest with uppercase
193
- if (index === 0 && !captitaliseFirstLetter) {
194
- return word.toLowerCase();
195
- }
196
- return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
197
- })
198
- .join("");
199
- }
200
-
201
- /**
202
- * Creates an index.js file that exports all SVG files from a directory
203
- * @param {string} svgDir - Directory containing SVG files
204
- * @param {string} outputFile - Path to the output index.js file
205
- */
206
- function createSvgIndex({
207
- style,
208
- weight,
209
- size,
210
- svgDir,
211
- outputFile = "index.js",
212
- }) {
213
- // Get all SVG files in the directory
214
- const svgFiles = fs
215
- .readdirSync(svgDir)
216
- .filter(
217
- (file) =>
218
- file.toLowerCase().endsWith(".js") && file.toLowerCase() !== "index.js",
219
- );
220
-
221
- if (svgFiles.length === 0) {
222
- console.warn(`No SVG files found in ${svgDir}`);
223
- return;
224
- }
225
-
226
- // Create the content for the index.js file
227
- let indexContent = "// Auto-generated index file for SVG exports\n\n";
228
-
229
- // Add imports and exports
230
- svgFiles.forEach((file) => {
231
- const baseName = path.basename(file, ".js");
232
- indexContent += `import ${baseName} from './${file}';\n`;
233
- });
234
-
235
- indexContent += "\nexport const MATERIAL_SVG_PARAMS = {\n";
236
- indexContent += `\tstyle: "${style}", \n`;
237
- indexContent += `\tweight: "${weight}", \n`;
238
- indexContent += `\tsize: "${size}", \n`;
239
- indexContent += `};\n`;
240
-
241
- indexContent += "\nexport {\n";
242
- svgFiles.forEach((file) => {
243
- const baseName = path.basename(file, ".js");
244
- indexContent += ` ${baseName},\n`;
245
- });
246
- indexContent += "};\n\n";
247
-
248
- // Add a default export with all icons in an object
249
- indexContent += "export default {\n";
250
- svgFiles.forEach((file) => {
251
- const baseName = path.basename(file, ".js");
252
- indexContent += ` ${baseName},\n`;
253
- });
254
- indexContent += "};\n";
255
-
256
- // Write the index.js file
257
- const outputPath = path.join(svgDir, outputFile);
258
- fs.writeFileSync(outputPath, indexContent);
259
- console.log(`Created SVG index file: ${outputPath}`);
260
- }
261
-
262
- // Example usage:
263
- // extractSvgFiles('rounded', 'wght600', '24px', './extracted-icons', true);
264
-
265
- module.exports = extractSvgFiles;
266
-
267
- // If script is run directly
268
- if (require.main === module) {
269
- const args = process.argv.slice(2);
270
- if (args.length < 3) {
271
- console.log(
272
- "Usage: node extract-svg.js <style> <weight> <size> [outputDir] [createIndex]",
273
- );
274
- console.log(
275
- "Example: node extract-svg.js rounded wght600 24px ./icons true",
276
- );
277
- process.exit(1);
278
- }
279
-
280
- const [
281
- style,
282
- weight,
283
- size,
284
- outputDir = "./extracted-icons",
285
- createIndexArg = "true",
286
- ] = args;
287
- const createIndex = createIndexArg.toLowerCase() !== "false";
288
- console.log({ args, style, weight, size, outputDir, createIndex });
289
- extractSvgFiles(style, weight, size, outputDir, createIndex);
290
- }
package/variables.scss DELETED
@@ -1,6 +0,0 @@
1
- $interactive-color: #3c80f6;
2
- $button-color: #f0f0f0;
3
- $button-hover-color: #e0e0e0;
4
-
5
- $active-color: #a6ccf7;
6
- $toolbar-color: #222f3e;