quill-toolbar-tip 0.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/LICENSE +21 -0
- package/README.md +149 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +218 -0
- package/dist/index.js.map +1 -0
- package/package.json +45 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 zzxming
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# QuillToolbarTip
|
|
2
|
+
|
|
3
|
+
## Install
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install quill-toolbar-tip
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
Add the text you want to display in the tooltip. The keys matchs the toolbar format name.
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import QuillToolbarTip from 'quill-toolbar-tip';
|
|
15
|
+
import 'quill-toolbar-tip/dist/index.css';
|
|
16
|
+
|
|
17
|
+
Quill.register({
|
|
18
|
+
[`modules/${QuillToolbarTip.moduleName}`]: QuillToolbarTip,
|
|
19
|
+
}, true);
|
|
20
|
+
|
|
21
|
+
const QuillToolbarTipOption = {
|
|
22
|
+
tipTextMap: {
|
|
23
|
+
bold: 'Bold',
|
|
24
|
+
italic: 'Italic',
|
|
25
|
+
color: {
|
|
26
|
+
onShow(target, value) {
|
|
27
|
+
return `Font Color${value ? `: ${value}` : ''}`;
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
background: {
|
|
31
|
+
onShow(target, value) {
|
|
32
|
+
return `Background Color${value ? `: ${value}` : ''}`;
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const quill = new Quill('#editor', {
|
|
39
|
+
theme: 'snow',
|
|
40
|
+
modules: {
|
|
41
|
+
toolbar: [
|
|
42
|
+
['bold', 'italic',],
|
|
43
|
+
[{ list: 'ordered' }, { list: 'bullet' }],
|
|
44
|
+
[{ script: 'sub' }, { script: 'super' }],
|
|
45
|
+
[{ color: [] }, { background: [] }],
|
|
46
|
+
],
|
|
47
|
+
[QuillToolbarTip.moduleName]: QuillToolbarTipOption
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
You can set specify tip with `key:value`. For setting the tip text 'Unordered List' for a bullet list, you can use 'list: bullet': 'Unordered List'`
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
const QuillToolbarTipOption = {
|
|
56
|
+
tipTextMap: {
|
|
57
|
+
'list:ordered': 'Ordered List',
|
|
58
|
+
'list:bullet': 'Unordered List',
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
You also can set an options for the key, and use the `onShow` to calculate the text of the tooltip. but you should use the `onShow` option, the `msg` / `content` or string value will be ignored. The final display text will be the item value.
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
const QuillToolbarTipOption = {
|
|
67
|
+
tipTextMap: {
|
|
68
|
+
script: {
|
|
69
|
+
onShow(target, value) {
|
|
70
|
+
const text = {
|
|
71
|
+
sub: 'Subscript',
|
|
72
|
+
super: 'Superscript',
|
|
73
|
+
};
|
|
74
|
+
return text[value] || null;
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Options
|
|
82
|
+
|
|
83
|
+
| Option | Type | Description |
|
|
84
|
+
| --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
85
|
+
| defaultTooltipOptions | `Partial<TooltipOptions>` | Default tooltip options. |
|
|
86
|
+
| tipTextMap | `Record<string, Partial<TooltipItem> \| string>` | Tooltip text map. You can also set a object that will be use in the tooltip. The configuration of tooltip options is shown below |
|
|
87
|
+
|
|
88
|
+
### Types and default value
|
|
89
|
+
|
|
90
|
+
| Option | Description |
|
|
91
|
+
| --------- | ------------------------------------------------------------------------------------------ |
|
|
92
|
+
| direction | The direction of the tooltip display |
|
|
93
|
+
| delay | The delay before the tooltip is displayed and hidden in milliseconds. |
|
|
94
|
+
| msg | The message of the tooltip |
|
|
95
|
+
| content | The content of the tooltip |
|
|
96
|
+
| className | The class name of the tooltip |
|
|
97
|
+
| distance | Distance between toolbar item and tooltip |
|
|
98
|
+
| onShow | Callback when tooltip show. If `onShow` return `undefined`, the tooltip will not be shown. |
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
interface TooltipOptions {
|
|
102
|
+
direction: 'top' | 'right' | 'bottom' | 'left';
|
|
103
|
+
msg: string;
|
|
104
|
+
delay: number;
|
|
105
|
+
content: HTMLElement;
|
|
106
|
+
className: string | string[];
|
|
107
|
+
distance: number;
|
|
108
|
+
onShow: (target: HTMLElement) => string | HTMLElement | undefined;
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Only one of `msg` / `content` and `onShow` will be effective at the same time, with a priority of `onShow` > `content` > `msg`.
|
|
113
|
+
|
|
114
|
+
That means if you set a options like below. the final display text will be 'C'
|
|
115
|
+
|
|
116
|
+
```js
|
|
117
|
+
const B = document.createElement('span');
|
|
118
|
+
B.textContent = 'B';
|
|
119
|
+
|
|
120
|
+
tipTextMap = {
|
|
121
|
+
color: {
|
|
122
|
+
msg: 'A',
|
|
123
|
+
content: B,
|
|
124
|
+
onShow() {
|
|
125
|
+
return 'C';
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The parameter `value` of `onShow` is the current value of the toolbar button or select
|
|
132
|
+
|
|
133
|
+
```ts
|
|
134
|
+
interface TooltipItem extends Omit<TooltipOptions, 'onShow'> {
|
|
135
|
+
onShow: (target: HTMLElement, value: string) => string | HTMLElement;
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
The `defaultTooltipOptions` like below
|
|
140
|
+
|
|
141
|
+
```ts
|
|
142
|
+
const tooltipDefaultOptions = {
|
|
143
|
+
msg: '',
|
|
144
|
+
delay: 150,
|
|
145
|
+
direction: 'top',
|
|
146
|
+
className: [] as string[],
|
|
147
|
+
distance: 8,
|
|
148
|
+
};
|
|
149
|
+
```
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.toolbar-tip__tooltip{position:absolute;z-index:20;padding:4px 12px;border-radius:4px;font-size:12px;color:#fff;white-space:nowrap;background-color:#303133;transition:opacity .15s linear}.toolbar-tip__tooltip.transparent{opacity:0}.toolbar-tip__tooltip.hidden{display:none}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import Quill from 'quill';
|
|
2
|
+
import Toolbar from 'quill/modules/toolbar';
|
|
3
|
+
|
|
4
|
+
interface TooltipOptions {
|
|
5
|
+
direction: 'top' | 'right' | 'bottom' | 'left';
|
|
6
|
+
msg: string;
|
|
7
|
+
delay: number;
|
|
8
|
+
content: HTMLElement;
|
|
9
|
+
className: string | string[];
|
|
10
|
+
distance: number;
|
|
11
|
+
onShow: (target: HTMLElement) => string | HTMLElement | undefined;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface TooltipItem extends Omit<TooltipOptions, 'onShow'> {
|
|
15
|
+
onShow: (target: HTMLElement, value: string) => string | HTMLElement;
|
|
16
|
+
}
|
|
17
|
+
interface QuillToolbarTipOptions {
|
|
18
|
+
tipTextMap: Record<string, Partial<TooltipItem> | string>;
|
|
19
|
+
defaultTooltipOptions: Partial<TooltipOptions>;
|
|
20
|
+
}
|
|
21
|
+
declare class QuillToolbarTip {
|
|
22
|
+
quill: Quill;
|
|
23
|
+
static moduleName: string;
|
|
24
|
+
options: Omit<QuillToolbarTipOptions, 'defaultTooltipOptions'>;
|
|
25
|
+
toolbar: Toolbar;
|
|
26
|
+
constructor(quill: Quill, options: Partial<QuillToolbarTipOptions>);
|
|
27
|
+
resolveOptions(options: Partial<QuillToolbarTipOptions>): {
|
|
28
|
+
tipTextMap: Record<string, string | Partial<TooltipItem>>;
|
|
29
|
+
};
|
|
30
|
+
createToolbarTip(): void;
|
|
31
|
+
getControlLabel([toolName, target]: [string, HTMLButtonElement | HTMLSelectElement]): HTMLElement | null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { QuillToolbarTip, type QuillToolbarTipOptions, type TooltipItem, QuillToolbarTip as default };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
const tooltipDefaultOptions = {
|
|
2
|
+
msg: '',
|
|
3
|
+
delay: 150,
|
|
4
|
+
direction: 'top',
|
|
5
|
+
className: [],
|
|
6
|
+
distance: 8,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const viewportPadding = 8;
|
|
10
|
+
const limitDomInViewPort = (rect) => {
|
|
11
|
+
let { left, top, width, height } = rect;
|
|
12
|
+
const { clientWidth, clientHeight } = document.documentElement;
|
|
13
|
+
let leftLimited = false;
|
|
14
|
+
let topLimited = false;
|
|
15
|
+
if (left + width > clientWidth) {
|
|
16
|
+
left = clientWidth - width - viewportPadding;
|
|
17
|
+
leftLimited = true;
|
|
18
|
+
}
|
|
19
|
+
else if (left < 0) {
|
|
20
|
+
left = viewportPadding;
|
|
21
|
+
leftLimited = true;
|
|
22
|
+
}
|
|
23
|
+
if (top + height > clientHeight) {
|
|
24
|
+
top = clientHeight - height - viewportPadding;
|
|
25
|
+
topLimited = true;
|
|
26
|
+
}
|
|
27
|
+
else if (top < 0) {
|
|
28
|
+
top = viewportPadding;
|
|
29
|
+
topLimited = true;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
left,
|
|
33
|
+
top,
|
|
34
|
+
leftLimited,
|
|
35
|
+
topLimited,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const isUndefined = (val) => val === undefined;
|
|
40
|
+
const isString = (val) => typeof val === 'string';
|
|
41
|
+
const ensureArray = (value) => (Array.isArray(value) ? (value || []) : [value]);
|
|
42
|
+
|
|
43
|
+
let tooltipContainer;
|
|
44
|
+
const createTooltip = (target, options = {}) => {
|
|
45
|
+
let { msg = '', delay = 150, content, direction = 'top', className = [], distance = 8, onShow, } = Object.assign(tooltipDefaultOptions, options);
|
|
46
|
+
if (isString(className)) {
|
|
47
|
+
className = ensureArray(className.split(' '));
|
|
48
|
+
}
|
|
49
|
+
if (msg || content || onShow) {
|
|
50
|
+
if (!tooltipContainer) {
|
|
51
|
+
tooltipContainer = document.createElement('div');
|
|
52
|
+
document.body.appendChild(tooltipContainer);
|
|
53
|
+
}
|
|
54
|
+
const tooltip = document.createElement('div');
|
|
55
|
+
tooltip.classList.add('toolbar-tip__tooltip', 'hidden', 'transparent', ...className);
|
|
56
|
+
const setTooltipContent = () => {
|
|
57
|
+
if (content) {
|
|
58
|
+
tooltip.appendChild(content);
|
|
59
|
+
}
|
|
60
|
+
if (msg) {
|
|
61
|
+
tooltip.textContent = msg;
|
|
62
|
+
}
|
|
63
|
+
if (onShow) {
|
|
64
|
+
const result = onShow(target);
|
|
65
|
+
if (isString(result)) {
|
|
66
|
+
tooltip.textContent = result;
|
|
67
|
+
}
|
|
68
|
+
else if (result) {
|
|
69
|
+
tooltip.appendChild(result);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return Boolean(content || msg || onShow);
|
|
76
|
+
};
|
|
77
|
+
let timer;
|
|
78
|
+
const transitionendHandler = () => {
|
|
79
|
+
tooltip.classList.add('hidden');
|
|
80
|
+
if (tooltipContainer.contains(tooltip)) {
|
|
81
|
+
tooltipContainer.removeChild(tooltip);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const open = () => {
|
|
85
|
+
if (timer)
|
|
86
|
+
clearTimeout(timer);
|
|
87
|
+
timer = setTimeout(() => {
|
|
88
|
+
// empty content will not display
|
|
89
|
+
const setContentResult = setTooltipContent();
|
|
90
|
+
if (!setContentResult)
|
|
91
|
+
return;
|
|
92
|
+
tooltipContainer.appendChild(tooltip);
|
|
93
|
+
tooltip.removeEventListener('transitionend', transitionendHandler);
|
|
94
|
+
tooltip.classList.remove('hidden');
|
|
95
|
+
const elRect = target.getBoundingClientRect();
|
|
96
|
+
const contentRect = tooltip.getBoundingClientRect();
|
|
97
|
+
const extraPositionMap = {
|
|
98
|
+
top: {
|
|
99
|
+
top: -contentRect.height - distance,
|
|
100
|
+
left: elRect.width / 2 - contentRect.width / 2,
|
|
101
|
+
},
|
|
102
|
+
right: {
|
|
103
|
+
top: elRect.height / 2 - contentRect.height / 2,
|
|
104
|
+
left: elRect.width + distance,
|
|
105
|
+
},
|
|
106
|
+
bottom: {
|
|
107
|
+
top: contentRect.height + distance,
|
|
108
|
+
left: elRect.width / 2 - contentRect.width / 2,
|
|
109
|
+
},
|
|
110
|
+
left: {
|
|
111
|
+
top: elRect.height / 2 - contentRect.height / 2,
|
|
112
|
+
left: -contentRect.width - distance,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
const extra = extraPositionMap[direction];
|
|
116
|
+
let top = elRect.top + extra.top;
|
|
117
|
+
let left = elRect.left + extra.left;
|
|
118
|
+
Object.assign(tooltip.style, {
|
|
119
|
+
top: `${top + window.scrollY}px`,
|
|
120
|
+
left: `${left + window.scrollX}px`,
|
|
121
|
+
});
|
|
122
|
+
({ top, left } = limitDomInViewPort(tooltip.getBoundingClientRect()));
|
|
123
|
+
Object.assign(tooltip.style, {
|
|
124
|
+
top: `${top + window.scrollY}px`,
|
|
125
|
+
left: `${left + window.scrollX}px`,
|
|
126
|
+
});
|
|
127
|
+
tooltip.classList.remove('transparent');
|
|
128
|
+
}, delay);
|
|
129
|
+
};
|
|
130
|
+
const close = () => {
|
|
131
|
+
if (timer)
|
|
132
|
+
clearTimeout(timer);
|
|
133
|
+
timer = setTimeout(() => {
|
|
134
|
+
tooltip.classList.add('transparent');
|
|
135
|
+
tooltip.addEventListener('transitionend', transitionendHandler, { once: true });
|
|
136
|
+
// handle remove when transition set none
|
|
137
|
+
setTimeout(() => {
|
|
138
|
+
transitionendHandler();
|
|
139
|
+
}, 150);
|
|
140
|
+
}, delay);
|
|
141
|
+
};
|
|
142
|
+
target.addEventListener('mouseenter', open);
|
|
143
|
+
target.addEventListener('mouseleave', close);
|
|
144
|
+
tooltip.addEventListener('mouseenter', open);
|
|
145
|
+
tooltip.addEventListener('mouseleave', close);
|
|
146
|
+
return tooltip;
|
|
147
|
+
}
|
|
148
|
+
return null;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
class QuillToolbarTip {
|
|
152
|
+
quill;
|
|
153
|
+
static moduleName = 'toolbarTip';
|
|
154
|
+
options;
|
|
155
|
+
toolbar;
|
|
156
|
+
constructor(quill, options) {
|
|
157
|
+
this.quill = quill;
|
|
158
|
+
if (!options.tipTextMap) {
|
|
159
|
+
throw new Error('Please provide the tip text');
|
|
160
|
+
}
|
|
161
|
+
this.options = this.resolveOptions(options);
|
|
162
|
+
this.toolbar = this.quill.getModule('toolbar');
|
|
163
|
+
if (!this.toolbar) {
|
|
164
|
+
throw new Error('Please provide the toolbar');
|
|
165
|
+
}
|
|
166
|
+
if (!this.toolbar || this.toolbar.controls.length <= 0) {
|
|
167
|
+
console.warn('Toolbar is not available or has no controls');
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
this.createToolbarTip();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
resolveOptions(options) {
|
|
174
|
+
Object.assign(tooltipDefaultOptions, options.defaultTooltipOptions);
|
|
175
|
+
return {
|
|
176
|
+
tipTextMap: options.tipTextMap || {},
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
createToolbarTip() {
|
|
180
|
+
for (const control of this.toolbar.controls) {
|
|
181
|
+
const toolControlItem = control;
|
|
182
|
+
let [toolName, toolControl] = toolControlItem;
|
|
183
|
+
const parentOptions = this.options.tipTextMap[toolName];
|
|
184
|
+
if (toolControl.value) {
|
|
185
|
+
toolName = `${toolName}:${toolControl.value}`;
|
|
186
|
+
}
|
|
187
|
+
let currentControlOption = this.options.tipTextMap[toolName];
|
|
188
|
+
if (isString(currentControlOption)) {
|
|
189
|
+
currentControlOption = {
|
|
190
|
+
msg: currentControlOption,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
const targetLabel = this.getControlLabel(toolControlItem);
|
|
194
|
+
if (!targetLabel || (isUndefined(currentControlOption) && isUndefined(parentOptions)))
|
|
195
|
+
continue;
|
|
196
|
+
createTooltip(targetLabel, {
|
|
197
|
+
...currentControlOption,
|
|
198
|
+
onShow(target) {
|
|
199
|
+
let result = toolControl.value;
|
|
200
|
+
if (parentOptions && !isString(parentOptions) && parentOptions.onShow) {
|
|
201
|
+
result = parentOptions.onShow(target, toolControl.value);
|
|
202
|
+
}
|
|
203
|
+
let currentControlResult;
|
|
204
|
+
if (currentControlOption) {
|
|
205
|
+
currentControlResult = currentControlOption.onShow ? currentControlOption.onShow(target, toolControl.value) : currentControlOption.content || currentControlOption.msg;
|
|
206
|
+
}
|
|
207
|
+
return currentControlResult || result;
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
getControlLabel([toolName, target]) {
|
|
213
|
+
return target.tagName.toLowerCase() === 'button' ? target : this.toolbar.container?.querySelector(`.ql-${toolName} .ql-picker-label`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export { QuillToolbarTip, QuillToolbarTip as default };
|
|
218
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/constants/tooltip-config.ts","../src/utils/position.ts","../src/utils/types.ts","../src/utils/components.ts","../src/index.ts"],"sourcesContent":[null,null,null,null,null],"names":[],"mappings":"AAAO,MAAM,qBAAqB,GAAG;AACnC,IAAA,GAAG,EAAE,EAAE;AACP,IAAA,KAAK,EAAE,GAAG;AACV,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,SAAS,EAAE,EAAc;AACzB,IAAA,QAAQ,EAAE,CAAC;CACZ;;ACND,MAAM,eAAe,GAAG,CAAC;AAClB,MAAM,kBAAkB,GAAG,CAAC,IAAkE,KAAI;IACvG,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IACvC,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC,eAAe;IAC9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BAAoB,EAAE;wBACxB,oBAAoB,GAAG,oBAAoB,CAAC,MAAM,GAAG,oBAAoB,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,KAAK,CAAC,GAAG,oBAAoB,CAAC,OAAO,IAAI,oBAAoB,CAAC,GAAG;;oBAExK,OAAO,oBAAoB,IAAI,MAAM;iBACtC;AACF,aAAA,CAAC;;;AAIN,IAAA,eAAe,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAmD,EAAA;QAClF,OAAO,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,aAAa,CAAC,CAAO,IAAA,EAAA,QAAQ,CAAmB,iBAAA,CAAA,CAAuB;;;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "quill-toolbar-tip",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"packageManager": "pnpm@9.9.0",
|
|
6
|
+
"description": "a module for quill toolbar set tip text",
|
|
7
|
+
"author": "zzxmming",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"quill",
|
|
11
|
+
"module",
|
|
12
|
+
"toolbar"
|
|
13
|
+
],
|
|
14
|
+
"main": "dist/index.js",
|
|
15
|
+
"types": "dist/index.d.ts",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"lint": "eslint . --cache",
|
|
21
|
+
"build": "gulp --require @esbuild-kit/cjs-loader",
|
|
22
|
+
"dev": "gulp --require @esbuild-kit/cjs-loader dev"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"quill": "^2.0.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@esbuild-kit/cjs-loader": "^2.4.4",
|
|
29
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
30
|
+
"@types/node": "^22.9.0",
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "^8.13.0",
|
|
32
|
+
"@typescript-eslint/parser": "^8.13.0",
|
|
33
|
+
"@zzxming/eslint-config": "^0.3.2",
|
|
34
|
+
"autoprefixer": "^10.4.20",
|
|
35
|
+
"esbuild-sass-plugin": "^3.3.1",
|
|
36
|
+
"gulp": "^4.0.0",
|
|
37
|
+
"gulp-clean-css": "^4.3.0",
|
|
38
|
+
"gulp-postcss": "^10.0.0",
|
|
39
|
+
"gulp-sass": "^5.1.0",
|
|
40
|
+
"rollup": "^4.18.1",
|
|
41
|
+
"rollup-plugin-dts": "^6.1.1",
|
|
42
|
+
"sass": "^1.80.6",
|
|
43
|
+
"typescript": "^5.6.3"
|
|
44
|
+
}
|
|
45
|
+
}
|