@livepreso/react-plugin-textfield 0.0.2 → 0.1.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/.rush/temp/shrinkwrap-deps.json +1 -1
- package/CHANGELOG.json +24 -0
- package/CHANGELOG.md +13 -1
- package/components/table-creator/TableCellThumb.js +25 -0
- package/components/table-creator/TableCellThumb.module.scss +19 -0
- package/components/table-creator/TableCreator.js +44 -0
- package/components/table-creator/TableCreatorCombo.js +18 -0
- package/components/table-creator/TableCreatorCombo.module.scss +19 -0
- package/configs/toolbar-configuration.js +22 -14
- package/package.json +2 -2
- package/.vscode/settings.json +0 -22
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"/@tiptap/extension-bold@3.0.9(@tiptap/core@3.0.9)": "sha512-rVULIFt9ZO+fO5ty9zuC3HwY3knxUw7q9JBztpKPfQQCuIJ+iQnOfB8NtI3L8hxVSxhIR1pqr8B3S/8vlpXbVg==",
|
|
134
134
|
"/@tiptap/extension-bubble-menu@3.0.9(@tiptap/core@3.0.9)(@tiptap/pm@3.0.9)": "sha512-fZQfdSbKJl3J+Yi+s8NrcLBgXHOaGVD4g+vn+orTPUlZdG9FWvEoon8DexOdK9OvYnW6QMM7kS8whOgpogVyUQ==",
|
|
135
135
|
"/@tiptap/extension-document@3.0.9(@tiptap/core@3.0.9)": "sha512-DB/R5e6QvuGhY8EhCkfNjR2xQfz/TOWoxfQGhDuy5U+oK3WBwCcHq9t5+nbSCMHtKfi/i49aHKDvv7TQCpuP0w==",
|
|
136
|
-
"/@tiptap/extension-floating-menu@3.4.
|
|
136
|
+
"/@tiptap/extension-floating-menu@3.4.6(@tiptap/core@3.0.9)(@tiptap/pm@3.0.9)": "sha512-4Y0GbnPd2ET4Z/Co7mcX8Dx2t+ox+6bolIAil378r20mTPTVL09vHWK9OhbGxlxkhbJ158CeKBqsZh4cO824qg==",
|
|
137
137
|
"/@tiptap/extension-hard-break@3.0.9(@tiptap/core@3.0.9)": "sha512-PWNYsUwVsMWt/R5/OWjfGb+7DQT0DvH+1owBimRq0pWZepg8qkz1jdPGgsRmUFyERRsXeEpgj3VaQfrgbyUfrA==",
|
|
138
138
|
"/@tiptap/extension-heading@3.0.9(@tiptap/core@3.0.9)": "sha512-LRLCIt87fvDZ5CdkinzhkCwRz5ax6FlsjJzG32MJ3wXyvVslqeLXBvH28JFUZEyzgcd/SnYmYxnef5+yvAX61g==",
|
|
139
139
|
"/@tiptap/extension-image@3.0.9(@tiptap/core@3.0.9)": "sha512-/2igN/oIF58zqX5fcg00bf6qGLcQyXHysl5I8GiurkvO95d+SQTlYbJneSRUpt6CgrUKbhRnMBPVubmapgg+Zw==",
|
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livepreso/react-plugin-textfield",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"tag": "@livepreso/react-plugin-textfield_v0.1.0",
|
|
7
|
+
"date": "Tue, 30 Sep 2025 00:36:15 GMT",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "size selector dropdown for insert table"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"version": "0.0.3",
|
|
18
|
+
"tag": "@livepreso/react-plugin-textfield_v0.0.3",
|
|
19
|
+
"date": "Thu, 18 Sep 2025 00:33:25 GMT",
|
|
20
|
+
"comments": {
|
|
21
|
+
"dependency": [
|
|
22
|
+
{
|
|
23
|
+
"comment": "Updating dependency \"@livepreso/content-react\" to `2.0.1`"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
4
28
|
{
|
|
5
29
|
"version": "0.0.2",
|
|
6
30
|
"tag": "@livepreso/react-plugin-textfield_v0.0.2",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
# Change Log - @livepreso/react-plugin-textfield
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 30 Sep 2025 00:36:15 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.1.0
|
|
6
|
+
Tue, 30 Sep 2025 00:36:15 GMT
|
|
7
|
+
|
|
8
|
+
### Minor changes
|
|
9
|
+
|
|
10
|
+
- size selector dropdown for insert table
|
|
11
|
+
|
|
12
|
+
## 0.0.3
|
|
13
|
+
Thu, 18 Sep 2025 00:33:25 GMT
|
|
14
|
+
|
|
15
|
+
_Version update only_
|
|
4
16
|
|
|
5
17
|
## 0.0.2
|
|
6
18
|
Fri, 12 Sep 2025 02:07:08 GMT
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
|
|
5
|
+
import style from "./TableCellThumb.module.scss";
|
|
6
|
+
|
|
7
|
+
export function TableCellThumb({
|
|
8
|
+
className,
|
|
9
|
+
selected,
|
|
10
|
+
onClick,
|
|
11
|
+
onMouseOver,
|
|
12
|
+
row,
|
|
13
|
+
col,
|
|
14
|
+
}) {
|
|
15
|
+
return (
|
|
16
|
+
<button
|
|
17
|
+
aria-label={`Insert ${col} by ${row} cell table`}
|
|
18
|
+
className={classNames(style.cell, className, {
|
|
19
|
+
[style.selected]: selected,
|
|
20
|
+
})}
|
|
21
|
+
onClick={onClick}
|
|
22
|
+
onMouseOver={onMouseOver}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
:global(.sp-presenter-overlay) {
|
|
2
|
+
.cell {
|
|
3
|
+
//top level styles
|
|
4
|
+
width: 20px;
|
|
5
|
+
height: 16px;
|
|
6
|
+
margin-bottom: 4px;
|
|
7
|
+
border: 1px solid var(--sp-toolbar-highlight-color);
|
|
8
|
+
|
|
9
|
+
&:not(:last-child) {
|
|
10
|
+
margin-right: 4px;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.selected {
|
|
15
|
+
border: 1px solid var(--sp-toolbar-focus-color);
|
|
16
|
+
background-color: var(--sp-toolbar-hover-color);
|
|
17
|
+
box-shadow: 0 0 1px 1px var(--sp-toolbar-hover-color);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import style from "./TableCreatorCombo.module.scss";
|
|
4
|
+
import { TableCellThumb } from "./TableCellThumb";
|
|
5
|
+
|
|
6
|
+
export function TableCreator({ className, onChange = () => {} }) {
|
|
7
|
+
function handleChange(row, cols) {
|
|
8
|
+
onChange(row, cols);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const [selectedRow, setSelectedRow] = React.useState(0);
|
|
12
|
+
const [selectedCol, setSelectedCol] = React.useState(0);
|
|
13
|
+
|
|
14
|
+
const maxRows = 8;
|
|
15
|
+
const maxCols = 8;
|
|
16
|
+
const rows = Array.from({ length: maxRows }, (_, idx) => idx + 1);
|
|
17
|
+
const cols = Array.from({ length: maxCols }, (_, idx) => idx + 1);
|
|
18
|
+
function handleRollover(rowIndex, colIndex) {
|
|
19
|
+
setSelectedRow(rowIndex);
|
|
20
|
+
setSelectedCol(colIndex);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div className={style.options}>
|
|
25
|
+
{rows.map((rowIndex) => (
|
|
26
|
+
<div key={`row_${rowIndex}`} className={style.row}>
|
|
27
|
+
{cols.map((colIndex) => (
|
|
28
|
+
<TableCellThumb
|
|
29
|
+
key={`${rowIndex}_${colIndex}`}
|
|
30
|
+
row={rowIndex}
|
|
31
|
+
col={colIndex}
|
|
32
|
+
selected={rowIndex <= selectedRow && colIndex <= selectedCol}
|
|
33
|
+
onClick={() => handleChange(rowIndex, colIndex)}
|
|
34
|
+
onMouseOver={() => handleRollover(rowIndex, colIndex)}
|
|
35
|
+
/>
|
|
36
|
+
))}
|
|
37
|
+
</div>
|
|
38
|
+
))}
|
|
39
|
+
<div className={style.indicator}>
|
|
40
|
+
{!!selectedRow && !!selectedCol && `${selectedCol} x ${selectedRow}`}
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import { TableCreator } from "./TableCreator";
|
|
4
|
+
import { Popover } from "../Popover";
|
|
5
|
+
import toolbarStyle from "../editor-toolbars/EditorToolbar.module.scss";
|
|
6
|
+
import { BorderAll } from "../../icons";
|
|
7
|
+
import { ToolbarButton } from "../editor-toolbars/ToolbarButton";
|
|
8
|
+
|
|
9
|
+
export function TableCreatorCombo({ disabled, onChange }) {
|
|
10
|
+
return (
|
|
11
|
+
<Popover
|
|
12
|
+
triggerClassName={toolbarStyle.item}
|
|
13
|
+
trigger={<ToolbarButton disabled={disabled} icon={<BorderAll />} />}
|
|
14
|
+
>
|
|
15
|
+
<TableCreator onChange={onChange} />
|
|
16
|
+
</Popover>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@import "../style.module.scss";
|
|
2
|
+
|
|
3
|
+
:global(.sp-presenter-overlay) {
|
|
4
|
+
.indicator {
|
|
5
|
+
font-size: 14px;
|
|
6
|
+
line-height: 16px;
|
|
7
|
+
text-align: center;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.options {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
padding: 5px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.row {
|
|
17
|
+
display: flex;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -22,6 +22,7 @@ import { PRIMARY_TOOLBAR_IDS, TOOLBAR_COMPONENT_TYPES } from "../constants";
|
|
|
22
22
|
import LinkEditDialog from "../components/LinkEditDialog";
|
|
23
23
|
import { Gapcursor } from "@tiptap/extensions";
|
|
24
24
|
import { ColorPickerCombo } from "../components/color-picker/ColorPickerCombo";
|
|
25
|
+
import { TableCreatorCombo } from "../components/table-creator/TableCreatorCombo";
|
|
25
26
|
|
|
26
27
|
function generateTextStyleTest(textStyles) {
|
|
27
28
|
return (editor) => {
|
|
@@ -293,21 +294,28 @@ const clearFormattingButton = () => ({
|
|
|
293
294
|
|
|
294
295
|
const insertTableButton = () => ({
|
|
295
296
|
id: PRIMARY_TOOLBAR_IDS.INSERT_TABLE,
|
|
296
|
-
label: "Insert
|
|
297
|
-
type: TOOLBAR_COMPONENT_TYPES.
|
|
297
|
+
label: "Insert table",
|
|
298
|
+
type: TOOLBAR_COMPONENT_TYPES.CUSTOM,
|
|
298
299
|
extensions: [TableExtended, TableCell, TableHeader, TableRow, Gapcursor],
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
300
|
+
renderContent: ({ editor, isEnabled } = {}) => {
|
|
301
|
+
return (
|
|
302
|
+
<TableCreatorCombo
|
|
303
|
+
disabled={!isEnabled}
|
|
304
|
+
onChange={(rows, cols) => {
|
|
305
|
+
editor
|
|
306
|
+
.chain()
|
|
307
|
+
.focus()
|
|
308
|
+
.insertTable({
|
|
309
|
+
rows,
|
|
310
|
+
cols,
|
|
311
|
+
withHeaderRow: true,
|
|
312
|
+
})
|
|
313
|
+
.setFullWidth()
|
|
314
|
+
.run();
|
|
315
|
+
}}
|
|
316
|
+
/>
|
|
317
|
+
);
|
|
318
|
+
},
|
|
311
319
|
});
|
|
312
320
|
|
|
313
321
|
export const primaryItemGenerators = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livepreso/react-plugin-textfield",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@tiptap/extension-subscript": "~3.0.6",
|
|
56
56
|
"@tiptap/extension-superscript": "~3.0.6",
|
|
57
57
|
"lodash.debounce": "~4.0.8",
|
|
58
|
-
"@livepreso/content-react": "2.0.
|
|
58
|
+
"@livepreso/content-react": "2.0.1"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": ""
|
package/.vscode/settings.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"workbench.colorCustomizations": {
|
|
3
|
-
"activityBar.activeBackground": "#1f6fd0",
|
|
4
|
-
"activityBar.background": "#1f6fd0",
|
|
5
|
-
"activityBar.foreground": "#e7e7e7",
|
|
6
|
-
"activityBar.inactiveForeground": "#e7e7e799",
|
|
7
|
-
"activityBarBadge.background": "#ee90bb",
|
|
8
|
-
"activityBarBadge.foreground": "#15202b",
|
|
9
|
-
"commandCenter.border": "#e7e7e799",
|
|
10
|
-
"sash.hoverBorder": "#1f6fd0",
|
|
11
|
-
"statusBar.background": "#1857a4",
|
|
12
|
-
"statusBar.foreground": "#e7e7e7",
|
|
13
|
-
"statusBarItem.hoverBackground": "#1f6fd0",
|
|
14
|
-
"statusBarItem.remoteBackground": "#1857a4",
|
|
15
|
-
"statusBarItem.remoteForeground": "#e7e7e7",
|
|
16
|
-
"titleBar.activeBackground": "#1857a4",
|
|
17
|
-
"titleBar.activeForeground": "#e7e7e7",
|
|
18
|
-
"titleBar.inactiveBackground": "#1857a499",
|
|
19
|
-
"titleBar.inactiveForeground": "#e7e7e799"
|
|
20
|
-
},
|
|
21
|
-
"peacock.remoteColor": "#1857a4"
|
|
22
|
-
}
|