inline-attacher 0.0.7 → 0.0.8
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/README.md +4 -2
- package/dist/inline-attacher.js +71 -80
- package/dist/inline-attacher.umd.cjs +1 -1
- package/package.json +15 -15
package/README.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
# 📎 Inline
|
|
1
|
+
# 📎 Inline Attacher
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/inline-attacher)
|
|
4
4
|
[](https://www.npmjs.com/package/inline-attacher)
|
|
5
|
-
[](https://github.com/EastSun5566/inline-attacher/blob/main/LICENSE)
|
|
6
6
|
|
|
7
7
|
> A modern port of [Inline Attachment](https://github.com/Rovak/InlineAttachment)
|
|
8
8
|
|
|
9
|
+
🔗 <https://eastsun5566.github.io/inline-attacher/>
|
|
10
|
+
|
|
9
11
|
## Installation
|
|
10
12
|
|
|
11
13
|
```sh
|
package/dist/inline-attacher.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var w = Object.defineProperty;
|
|
2
2
|
var x = (n, t, e) => t in n ? w(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
3
|
var o = (n, t, e) => (x(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
-
import { EditorView as
|
|
5
|
-
const
|
|
4
|
+
import { EditorView as V } from "@codemirror/view";
|
|
5
|
+
const E = {
|
|
6
6
|
/**
|
|
7
7
|
* URL where the file will be send
|
|
8
8
|
*/
|
|
@@ -90,7 +90,7 @@ const v = {
|
|
|
90
90
|
onFileUploaded() {
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
|
-
async function
|
|
93
|
+
async function D({
|
|
94
94
|
url: n,
|
|
95
95
|
...t
|
|
96
96
|
}) {
|
|
@@ -109,53 +109,53 @@ async function P({
|
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function T(n) {
|
|
113
113
|
return typeof n == "function";
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
const
|
|
117
|
-
let
|
|
118
|
-
for (const
|
|
119
|
-
if (
|
|
120
|
-
|
|
115
|
+
function A(n, t = "", e = "") {
|
|
116
|
+
const s = t.split(".");
|
|
117
|
+
let i = n;
|
|
118
|
+
for (const r of s)
|
|
119
|
+
if (i && typeof i == "object" && r in i)
|
|
120
|
+
i = i[r];
|
|
121
121
|
else
|
|
122
122
|
return e;
|
|
123
|
-
return
|
|
123
|
+
return i !== void 0 ? i : e;
|
|
124
124
|
}
|
|
125
|
-
class
|
|
125
|
+
class v {
|
|
126
126
|
constructor(t, e) {
|
|
127
|
-
o(this, "options",
|
|
127
|
+
o(this, "options", E);
|
|
128
128
|
o(this, "editor");
|
|
129
129
|
o(this, "filename", "");
|
|
130
130
|
o(this, "lastValue", "");
|
|
131
|
-
this.editor = t, this.options = { ...
|
|
131
|
+
this.editor = t, this.options = { ...E, ...e };
|
|
132
132
|
}
|
|
133
133
|
/** Uploads file */
|
|
134
134
|
async uploadFile(t) {
|
|
135
135
|
const {
|
|
136
136
|
defaultExtension: e,
|
|
137
|
-
remoteFilename:
|
|
138
|
-
uploadFieldName:
|
|
139
|
-
extraParams:
|
|
137
|
+
remoteFilename: s,
|
|
138
|
+
uploadFieldName: i,
|
|
139
|
+
extraParams: r,
|
|
140
140
|
extraHeaders: l,
|
|
141
|
-
uploadUrl:
|
|
141
|
+
uploadUrl: c,
|
|
142
142
|
uploadMethod: p,
|
|
143
|
-
beforeFileUpload:
|
|
144
|
-
} = this.options,
|
|
143
|
+
beforeFileUpload: d
|
|
144
|
+
} = this.options, a = new FormData();
|
|
145
145
|
let f = e;
|
|
146
146
|
if (t.name) {
|
|
147
147
|
const [u] = t.name.match(/\.(.+)$/) || [];
|
|
148
148
|
u && (f = u);
|
|
149
149
|
}
|
|
150
|
-
const g = (
|
|
151
|
-
if (this.filename = g,
|
|
152
|
-
|
|
153
|
-
}), !(
|
|
150
|
+
const g = (s == null ? void 0 : s(t)) || `image-${Date.now()}.${f}`;
|
|
151
|
+
if (this.filename = g, a.append(i, t, g), Object.keys(r).forEach((u) => {
|
|
152
|
+
a.append(u, r[u]);
|
|
153
|
+
}), !(d != null && d(a)))
|
|
154
154
|
return;
|
|
155
|
-
const { ok: F, value: m } = await
|
|
156
|
-
url:
|
|
155
|
+
const { ok: F, value: m } = await D({
|
|
156
|
+
url: c,
|
|
157
157
|
method: p,
|
|
158
|
-
body:
|
|
158
|
+
body: a,
|
|
159
159
|
headers: l
|
|
160
160
|
});
|
|
161
161
|
if (!F) {
|
|
@@ -175,22 +175,22 @@ class E {
|
|
|
175
175
|
* Handles upload response
|
|
176
176
|
*/
|
|
177
177
|
onFileUploadSucceed(t) {
|
|
178
|
-
var
|
|
179
|
-
const { onFileUploadSucceed: e, urlText:
|
|
178
|
+
var d, a;
|
|
179
|
+
const { onFileUploadSucceed: e, urlText: s, responseUrlKey: i } = this.options;
|
|
180
180
|
if (!(e != null && e(t)) || !this.lastValue)
|
|
181
181
|
return;
|
|
182
|
-
const
|
|
183
|
-
if (!
|
|
182
|
+
const r = A(t, i) || "unknown URL";
|
|
183
|
+
if (!r)
|
|
184
184
|
return;
|
|
185
|
-
const l = /!\[({[^}]+})]\(([^)]+)\)/,
|
|
186
|
-
this.editor.setValue(p), (
|
|
185
|
+
const l = /!\[({[^}]+})]\(([^)]+)\)/, c = T(s) ? s(r, t) : s.replace(s.match(l)[1], this.filename).replace(s.match(l)[2], r), p = this.editor.getValue().replace(this.lastValue, c);
|
|
186
|
+
this.editor.setValue(p), (a = (d = this.options).onFileUploaded) == null || a.call(d, r);
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
189
|
* Called when a file has failed to upload
|
|
190
190
|
*/
|
|
191
191
|
onFileUploadError(t) {
|
|
192
|
-
var
|
|
193
|
-
if (!((
|
|
192
|
+
var s, i;
|
|
193
|
+
if (!((i = (s = this.options).onFileUploadError) != null && i.call(s, t)) || !this.lastValue)
|
|
194
194
|
return;
|
|
195
195
|
const e = this.editor.getValue().replace(this.lastValue, this.options.errorText);
|
|
196
196
|
this.editor.setValue(e);
|
|
@@ -199,8 +199,8 @@ class E {
|
|
|
199
199
|
* Called when a file has been inserted, either by drop or paste
|
|
200
200
|
*/
|
|
201
201
|
onFileInserted(t) {
|
|
202
|
-
var e,
|
|
203
|
-
(
|
|
202
|
+
var e, s;
|
|
203
|
+
(s = (e = this.options).onFileReceived) != null && s.call(e, t) && (this.lastValue = this.options.progressText, this.editor.insertValue(this.lastValue));
|
|
204
204
|
}
|
|
205
205
|
handleFiles(t) {
|
|
206
206
|
Array.from(t).forEach((e) => {
|
|
@@ -212,24 +212,23 @@ class E {
|
|
|
212
212
|
*/
|
|
213
213
|
onPaste(t) {
|
|
214
214
|
var e;
|
|
215
|
-
|
|
215
|
+
(e = t.clipboardData) != null && e.files.length && this.handleFiles(t.clipboardData.files);
|
|
216
216
|
}
|
|
217
217
|
/**
|
|
218
218
|
* Called when a drop event occurred
|
|
219
219
|
*/
|
|
220
220
|
onDrop(t) {
|
|
221
221
|
var e;
|
|
222
|
-
|
|
222
|
+
(e = t.dataTransfer) != null && e.files.length && this.handleFiles(t.dataTransfer.files);
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
const e = n.scrollTop;
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
n.value = l + t + d, r += t.length, a === "ie" ? (n.focus(), s = document.selection.createRange(), s.moveStart("character", -n.value.length), s.moveStart("character", r), s.moveEnd("character", 0), s.select()) : a === "ff" && (n.selectionStart = r, n.selectionEnd = r, n.focus()), n.scrollTop = e;
|
|
225
|
+
function U(n, t) {
|
|
226
|
+
const e = n.scrollTop, s = n.selectionStart || 0, { value: i } = n, r = i.slice(0, s), l = i.slice(s, i.length);
|
|
227
|
+
n.value = r + t + l;
|
|
228
|
+
const c = s + t.length;
|
|
229
|
+
n.selectionStart = c, n.selectionEnd = c, n.scrollTop = e, n.focus();
|
|
231
230
|
}
|
|
232
|
-
class
|
|
231
|
+
class b {
|
|
233
232
|
constructor(t) {
|
|
234
233
|
o(this, "instance");
|
|
235
234
|
this.instance = t;
|
|
@@ -238,46 +237,45 @@ class U {
|
|
|
238
237
|
return this.instance.value;
|
|
239
238
|
}
|
|
240
239
|
insertValue(t) {
|
|
241
|
-
|
|
240
|
+
U(this.instance, t), this.dispatchInputEvent();
|
|
242
241
|
}
|
|
243
242
|
setValue(t) {
|
|
244
|
-
this.instance.value = t;
|
|
243
|
+
this.instance.value = t, this.dispatchInputEvent();
|
|
244
|
+
}
|
|
245
|
+
dispatchInputEvent() {
|
|
246
|
+
this.instance.dispatchEvent(new InputEvent("input", {
|
|
247
|
+
bubbles: !0,
|
|
248
|
+
cancelable: !0
|
|
249
|
+
}));
|
|
245
250
|
}
|
|
246
251
|
}
|
|
247
|
-
class y extends
|
|
252
|
+
class y extends v {
|
|
248
253
|
constructor(t, e = {}) {
|
|
249
|
-
super(new
|
|
254
|
+
super(new b(t), e);
|
|
250
255
|
}
|
|
251
256
|
bind() {
|
|
252
257
|
this.editor.instance.addEventListener(
|
|
253
258
|
"paste",
|
|
254
259
|
(t) => {
|
|
255
260
|
this.onPaste(t);
|
|
256
|
-
}
|
|
257
|
-
!1
|
|
261
|
+
}
|
|
258
262
|
), this.editor.instance.addEventListener(
|
|
259
263
|
"drop",
|
|
260
264
|
(t) => {
|
|
261
|
-
t.
|
|
262
|
-
},
|
|
263
|
-
!1
|
|
264
|
-
), this.editor.instance.addEventListener(
|
|
265
|
-
"dragenter",
|
|
266
|
-
(t) => {
|
|
267
|
-
t.stopPropagation(), t.preventDefault();
|
|
265
|
+
t.preventDefault(), this.onDrop(t);
|
|
268
266
|
}
|
|
269
267
|
), this.editor.instance.addEventListener(
|
|
270
268
|
"dragover",
|
|
271
269
|
(t) => {
|
|
272
|
-
t.
|
|
270
|
+
t.preventDefault();
|
|
273
271
|
}
|
|
274
272
|
);
|
|
275
273
|
}
|
|
276
274
|
}
|
|
277
|
-
function
|
|
275
|
+
function L(...n) {
|
|
278
276
|
return new y(...n).bind();
|
|
279
277
|
}
|
|
280
|
-
class
|
|
278
|
+
class P {
|
|
281
279
|
constructor(t) {
|
|
282
280
|
o(this, "instance");
|
|
283
281
|
this.instance = t;
|
|
@@ -299,41 +297,34 @@ class b {
|
|
|
299
297
|
}), this.instance.dispatch({ selection: { anchor: e } });
|
|
300
298
|
}
|
|
301
299
|
}
|
|
302
|
-
class h extends
|
|
300
|
+
class h extends v {
|
|
303
301
|
constructor(t, e = {}) {
|
|
304
|
-
super(new
|
|
302
|
+
super(new P(t), e);
|
|
305
303
|
}
|
|
306
304
|
bind() {
|
|
307
305
|
this.editor.instance.dom.addEventListener(
|
|
308
306
|
"paste",
|
|
309
307
|
(t) => {
|
|
310
308
|
this.onPaste(t);
|
|
311
|
-
}
|
|
312
|
-
!1
|
|
309
|
+
}
|
|
313
310
|
), this.editor.instance.dom.addEventListener(
|
|
314
311
|
"drop",
|
|
315
312
|
(t) => {
|
|
316
|
-
t.
|
|
317
|
-
},
|
|
318
|
-
!1
|
|
319
|
-
), this.editor.instance.dom.addEventListener(
|
|
320
|
-
"dragenter",
|
|
321
|
-
(t) => {
|
|
322
|
-
t.stopPropagation(), t.preventDefault();
|
|
313
|
+
t.preventDefault(), this.onDrop(t);
|
|
323
314
|
}
|
|
324
315
|
), this.editor.instance.dom.addEventListener(
|
|
325
316
|
"dragover",
|
|
326
317
|
(t) => {
|
|
327
|
-
t.
|
|
318
|
+
t.preventDefault();
|
|
328
319
|
}
|
|
329
320
|
);
|
|
330
321
|
}
|
|
331
322
|
}
|
|
332
|
-
function
|
|
323
|
+
function S(...n) {
|
|
333
324
|
return new h(...n).bind();
|
|
334
325
|
}
|
|
335
326
|
function M(n = {}) {
|
|
336
|
-
return
|
|
327
|
+
return V.domEventHandlers({
|
|
337
328
|
paste: (t, e) => {
|
|
338
329
|
new h(e, n).onPaste(t);
|
|
339
330
|
},
|
|
@@ -350,10 +341,10 @@ function M(n = {}) {
|
|
|
350
341
|
}
|
|
351
342
|
export {
|
|
352
343
|
h as CodeMirrorInlineAttachmentAdapter,
|
|
353
|
-
|
|
354
|
-
|
|
344
|
+
E as DEFAULT_OPTIONS,
|
|
345
|
+
v as InlineAttachment,
|
|
355
346
|
y as InputInlineAttachmentAdapter,
|
|
356
|
-
|
|
357
|
-
|
|
347
|
+
L as attach,
|
|
348
|
+
S as attachCodeMirror,
|
|
358
349
|
M as inlineAttachmentExtension
|
|
359
350
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(r,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@codemirror/view")):typeof define=="function"&&define.amd?define(["exports","@codemirror/view"],o):(r=typeof globalThis<"u"?globalThis:r||self,o(r.inlineAttacher={},r.CodemirrorView))})(this,function(r,o){"use strict";var L=Object.defineProperty;var M=(r,o,l)=>o in r?L(r,o,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[o]=l;var d=(r,o,l)=>(M(r,typeof o!="symbol"?o+"":o,l),l);const l={uploadUrl:"/upload",uploadMethod:"POST",uploadFieldName:"file",defaultExtension:"png",responseUrlKey:"url",allowedTypes:["image/jpeg","image/png","image/jpg","image/gif"],progressText:"![Uploading file...]()",urlText:"",errorText:"Error uploading file",extraParams:{},extraHeaders:{},beforeFileUpload(){return!0},onFileReceived(){return!0},onFileUploadSucceed(){return!0},onFileUploadError(){return!0},onFileUploaded(){}};async function T({url:n,...t}){try{const e=await fetch(n,t);if(!e.ok)throw new Error(e.statusText);return{ok:!0,value:await e.json()}}catch(e){return{ok:!1,value:e}}}function V(n){return typeof n=="function"}function y(n,t="",e=""){const i=t.split(".");let s=n;for(const a of i)if(s&&typeof s=="object"&&a in s)s=s[a];else return e;return s!==void 0?s:e}class g{constructor(t,e){d(this,"options",l);d(this,"editor");d(this,"filename","");d(this,"lastValue","");this.editor=t,this.options={...l,...e}}async uploadFile(t){const{defaultExtension:e,remoteFilename:i,uploadFieldName:s,extraParams:a,extraHeaders:u,uploadUrl:h,uploadMethod:E,beforeFileUpload:p}=this.options,c=new FormData;let w=e;if(t.name){const[f]=t.name.match(/\.(.+)$/)||[];f&&(w=f)}const F=(i==null?void 0:i(t))||`image-${Date.now()}.${w}`;if(this.filename=F,c.append(s,t,F),Object.keys(a).forEach(f=>{c.append(f,a[f])}),!(p!=null&&p(c)))return;const{ok:S,value:A}=await T({url:h,method:E,body:c,headers:u});if(!S){this.onFileUploadError(A);return}this.onFileUploadSucceed(A)}isFileAllowed(t){const{allowedTypes:e}=this.options;return e.includes("*")||e.includes(t.type)}onFileUploadSucceed(t){var p,c;const{onFileUploadSucceed:e,urlText:i,responseUrlKey:s}=this.options;if(!(e!=null&&e(t))||!this.lastValue)return;const a=y(t,s)||"unknown URL";if(!a)return;const u=/!\[({[^}]+})]\(([^)]+)\)/,h=V(i)?i(a,t):i.replace(i.match(u)[1],this.filename).replace(i.match(u)[2],a),E=this.editor.getValue().replace(this.lastValue,h);this.editor.setValue(E),(c=(p=this.options).onFileUploaded)==null||c.call(p,a)}onFileUploadError(t){var i,s;if(!((s=(i=this.options).onFileUploadError)!=null&&s.call(i,t))||!this.lastValue)return;const e=this.editor.getValue().replace(this.lastValue,this.options.errorText);this.editor.setValue(e)}onFileInserted(t){var e,i;(i=(e=this.options).onFileReceived)!=null&&i.call(e,t)&&(this.lastValue=this.options.progressText,this.editor.insertValue(this.lastValue))}handleFiles(t){Array.from(t).forEach(e=>{this.isFileAllowed(e)&&(this.onFileInserted(e),this.uploadFile(e))})}onPaste(t){var e;(e=t.clipboardData)!=null&&e.files.length&&this.handleFiles(t.clipboardData.files)}onDrop(t){var e;(e=t.dataTransfer)!=null&&e.files.length&&this.handleFiles(t.dataTransfer.files)}}function D(n,t){const e=n.scrollTop,i=n.selectionStart||0,{value:s}=n,a=s.slice(0,i),u=s.slice(i,s.length);n.value=a+t+u;const h=i+t.length;n.selectionStart=h,n.selectionEnd=h,n.scrollTop=e,n.focus()}class I{constructor(t){d(this,"instance");this.instance=t}getValue(){return this.instance.value}insertValue(t){D(this.instance,t),this.dispatchInputEvent()}setValue(t){this.instance.value=t,this.dispatchInputEvent()}dispatchInputEvent(){this.instance.dispatchEvent(new InputEvent("input",{bubbles:!0,cancelable:!0}))}}class v extends g{constructor(t,e={}){super(new I(t),e)}bind(){this.editor.instance.addEventListener("paste",t=>{this.onPaste(t)}),this.editor.instance.addEventListener("drop",t=>{t.preventDefault(),this.onDrop(t)}),this.editor.instance.addEventListener("dragover",t=>{t.preventDefault()})}}function b(...n){return new v(...n).bind()}class x{constructor(t){d(this,"instance");this.instance=t}getValue(){return this.instance.state.doc.toString()}insertValue(t){this.instance.dispatch(this.instance.state.replaceSelection(t))}setValue(t){const e=this.instance.state.selection.main.head;this.instance.dispatch({changes:{from:0,to:this.instance.state.doc.length,insert:t}}),this.instance.dispatch({selection:{anchor:e}})}}class m extends g{constructor(t,e={}){super(new x(t),e)}bind(){this.editor.instance.dom.addEventListener("paste",t=>{this.onPaste(t)}),this.editor.instance.dom.addEventListener("drop",t=>{t.preventDefault(),this.onDrop(t)}),this.editor.instance.dom.addEventListener("dragover",t=>{t.preventDefault()})}}function P(...n){return new m(...n).bind()}function U(n={}){return o.EditorView.domEventHandlers({paste:(t,e)=>{new m(e,n).onPaste(t)},drop:(t,e)=>{t.stopPropagation(),t.preventDefault(),new m(e,n).onDrop(t)},dragenter:t=>{t.stopPropagation(),t.preventDefault()},dragover:t=>{t.stopPropagation(),t.preventDefault()}})}r.CodeMirrorInlineAttachmentAdapter=m,r.DEFAULT_OPTIONS=l,r.InlineAttachment=g,r.InputInlineAttachmentAdapter=v,r.attach=b,r.attachCodeMirror=P,r.inlineAttachmentExtension=U,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "inline-attacher",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "📎 A modern port from Inline Attachment",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -34,36 +34,36 @@
|
|
|
34
34
|
"url": "https://github.com/EastSun5566/inline-attachment/issues/new"
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/EastSun5566/inline-attachment",
|
|
37
|
-
"packageManager": "pnpm@8.6.0",
|
|
38
37
|
"engines": {
|
|
39
|
-
"node": ">=16.0.0"
|
|
40
|
-
"pnpm": ">=7.0.0"
|
|
38
|
+
"node": ">=16.0.0"
|
|
41
39
|
},
|
|
42
40
|
"peerDependencies": {
|
|
43
41
|
"@codemirror/view": ">=6.0.0"
|
|
44
42
|
},
|
|
45
43
|
"devDependencies": {
|
|
46
|
-
"@codemirror/state": "^6.
|
|
47
|
-
"@types/node": "^20.
|
|
48
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
49
|
-
"@typescript-eslint/parser": "^6.
|
|
50
|
-
"eslint": "^8.
|
|
44
|
+
"@codemirror/state": "^6.4.1",
|
|
45
|
+
"@types/node": "^20.16.11",
|
|
46
|
+
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
47
|
+
"@typescript-eslint/parser": "^6.21.0",
|
|
48
|
+
"eslint": "^8.57.1",
|
|
51
49
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
52
50
|
"eslint-config-airbnb-typescript": "^17.1.0",
|
|
53
|
-
"eslint-plugin-import": "^2.
|
|
54
|
-
"rimraf": "^5.0.
|
|
55
|
-
"typescript": "^5.
|
|
56
|
-
"vite": "^4.
|
|
51
|
+
"eslint-plugin-import": "^2.31.0",
|
|
52
|
+
"rimraf": "^5.0.10",
|
|
53
|
+
"typescript": "^5.6.3",
|
|
54
|
+
"vite": "^4.5.5"
|
|
57
55
|
},
|
|
58
56
|
"dependencies": {
|
|
59
|
-
"@codemirror/view": "^6.
|
|
57
|
+
"@codemirror/view": "^6.34.1"
|
|
60
58
|
},
|
|
61
59
|
"scripts": {
|
|
62
60
|
"dev": "vite",
|
|
63
61
|
"build": "rimraf dist && tsc && vite build",
|
|
64
62
|
"preview": "vite preview",
|
|
65
63
|
"playground:dev": "pnpm -C playground dev",
|
|
64
|
+
"playground:deploy": "pnpm -C playground deploy",
|
|
66
65
|
"lint": "eslint --fix --ext .ts src",
|
|
67
|
-
"release": "pnpx standard-version && git push --follow-tags && pnpm publish"
|
|
66
|
+
"release": "pnpx standard-version && git push --follow-tags && pnpm publish && pnpm dlx jsr publish",
|
|
67
|
+
"size-check": "pnpx vite-bundle-visualizer"
|
|
68
68
|
}
|
|
69
69
|
}
|