inline-attacher 0.1.0 → 0.1.1
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 +1 -1
- package/dist/core.d.ts +7 -4
- package/dist/inline-attacher.js +113 -84
- package/dist/inline-attacher.umd.cjs +1 -1
- package/package.json +4 -6
- package/dist/__tests__/adapters-input.test.d.ts +0 -1
- package/dist/__tests__/core.test.d.ts +0 -1
- package/dist/__tests__/utils.test.d.ts +0 -1
package/README.md
CHANGED
package/dist/core.d.ts
CHANGED
|
@@ -4,9 +4,10 @@ export declare class InlineAttachment<TInstance> {
|
|
|
4
4
|
editor: Editor<TInstance>;
|
|
5
5
|
filename: string;
|
|
6
6
|
lastValue: string;
|
|
7
|
+
private pendingPlaceholders;
|
|
7
8
|
constructor(editor: Editor<TInstance>, options: Partial<InlineAttachmentOptions>);
|
|
8
9
|
/** Uploads file */
|
|
9
|
-
uploadFile(file: File): Promise<void>;
|
|
10
|
+
uploadFile(file: File, placeholder?: string): Promise<void>;
|
|
10
11
|
/**
|
|
11
12
|
* Returns if the given file is allowed to handle
|
|
12
13
|
*/
|
|
@@ -14,16 +15,18 @@ export declare class InlineAttachment<TInstance> {
|
|
|
14
15
|
/**
|
|
15
16
|
* Handles upload response
|
|
16
17
|
*/
|
|
17
|
-
onFileUploadSucceed(response: Record<string, unknown
|
|
18
|
+
onFileUploadSucceed(response: Record<string, unknown>, placeholder?: string, filename?: string): void;
|
|
18
19
|
/**
|
|
19
20
|
* Called when a file has failed to upload
|
|
20
21
|
*/
|
|
21
|
-
onFileUploadError(error: Error): void;
|
|
22
|
+
onFileUploadError(error: Error, placeholder?: string): void;
|
|
22
23
|
/**
|
|
23
24
|
* Called when a file has been inserted, either by drop or paste
|
|
24
25
|
*/
|
|
25
|
-
onFileInserted(file: File):
|
|
26
|
+
onFileInserted(file: File): string | false;
|
|
26
27
|
handleFiles(files: FileList): void;
|
|
28
|
+
private insertFile;
|
|
29
|
+
private replacePlaceholder;
|
|
27
30
|
/**
|
|
28
31
|
* Called when a paste event occurred
|
|
29
32
|
*/
|
package/dist/inline-attacher.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EditorView as w } from "@codemirror/view";
|
|
2
|
-
const
|
|
2
|
+
const E = {
|
|
3
3
|
/**
|
|
4
4
|
* URL where the file will be send
|
|
5
5
|
*/
|
|
@@ -87,7 +87,7 @@ const m = {
|
|
|
87
87
|
onFileUploaded() {
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
|
-
async function
|
|
90
|
+
async function P({
|
|
91
91
|
url: n,
|
|
92
92
|
...t
|
|
93
93
|
}) {
|
|
@@ -106,74 +106,82 @@ async function U({
|
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function U(n) {
|
|
110
110
|
return typeof n == "function";
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
const
|
|
114
|
-
let
|
|
115
|
-
for (const
|
|
116
|
-
if (
|
|
117
|
-
|
|
112
|
+
function y(n, t = "", e = "") {
|
|
113
|
+
const s = t.split(".");
|
|
114
|
+
let i = n;
|
|
115
|
+
for (const r of s)
|
|
116
|
+
if (i && typeof i == "object" && r in i)
|
|
117
|
+
i = i[r];
|
|
118
118
|
else
|
|
119
119
|
return e;
|
|
120
|
-
return
|
|
120
|
+
return i !== void 0 ? i : e;
|
|
121
121
|
}
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
function T(n, t, e, s = 0) {
|
|
123
|
+
let i = 0;
|
|
124
|
+
for (let r = 0; r <= s; r += 1) {
|
|
125
|
+
const o = n.indexOf(t, i);
|
|
126
|
+
if (o === -1) return n;
|
|
127
|
+
if (r === s)
|
|
128
|
+
return n.slice(0, o) + e + n.slice(o + t.length);
|
|
129
|
+
i = o + t.length;
|
|
130
|
+
}
|
|
131
|
+
return n;
|
|
132
|
+
}
|
|
133
|
+
class F {
|
|
134
|
+
options = E;
|
|
124
135
|
editor;
|
|
125
136
|
filename = "";
|
|
126
137
|
lastValue = "";
|
|
138
|
+
pendingPlaceholders = [];
|
|
127
139
|
constructor(t, e) {
|
|
128
|
-
this.editor = t, this.options = { ...
|
|
140
|
+
this.editor = t, this.options = { ...E, ...e };
|
|
129
141
|
}
|
|
130
|
-
|
|
131
|
-
async uploadFile(t) {
|
|
142
|
+
async uploadFile(t, e) {
|
|
132
143
|
const {
|
|
133
|
-
defaultExtension:
|
|
144
|
+
defaultExtension: s,
|
|
134
145
|
remoteFilename: i,
|
|
135
146
|
uploadFieldName: r,
|
|
136
147
|
extraParams: o,
|
|
137
148
|
extraHeaders: a,
|
|
138
|
-
uploadUrl:
|
|
149
|
+
uploadUrl: c,
|
|
139
150
|
uploadMethod: d,
|
|
140
|
-
beforeFileUpload:
|
|
141
|
-
uploadHandler:
|
|
142
|
-
} = this.options,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
const u = i?.(t) || `image-${Date.now()}.${f}`;
|
|
149
|
-
if (this.filename = u, c.append(r, t, u), Object.keys(o).forEach((s) => {
|
|
150
|
-
c.append(s, o[s]);
|
|
151
|
-
}), !F?.(c)) return;
|
|
152
|
-
if (h) {
|
|
151
|
+
beforeFileUpload: u,
|
|
152
|
+
uploadHandler: f
|
|
153
|
+
} = this.options, p = new FormData(), x = s.replace(/^\./, ""), h = i?.(t) || t.name || `image-${Date.now()}.${x}`;
|
|
154
|
+
if (this.filename = h, p.append(r, t, h), Object.keys(o).forEach((l) => {
|
|
155
|
+
p.append(l, o[l]);
|
|
156
|
+
}), !u?.(p)) return;
|
|
157
|
+
if (f) {
|
|
153
158
|
try {
|
|
154
|
-
const
|
|
159
|
+
const l = await f({
|
|
155
160
|
file: t,
|
|
156
|
-
filename:
|
|
157
|
-
formData:
|
|
161
|
+
filename: h,
|
|
162
|
+
formData: p,
|
|
158
163
|
options: this.options
|
|
159
164
|
});
|
|
160
|
-
this.onFileUploadSucceed(
|
|
161
|
-
} catch (
|
|
162
|
-
this.onFileUploadError(
|
|
165
|
+
this.onFileUploadSucceed(l, e, h);
|
|
166
|
+
} catch (l) {
|
|
167
|
+
this.onFileUploadError(
|
|
168
|
+
l instanceof Error ? l : new Error(String(l)),
|
|
169
|
+
e
|
|
170
|
+
);
|
|
163
171
|
}
|
|
164
172
|
return;
|
|
165
173
|
}
|
|
166
|
-
const { ok: v, value:
|
|
167
|
-
url:
|
|
174
|
+
const { ok: v, value: m } = await P({
|
|
175
|
+
url: c,
|
|
168
176
|
method: d,
|
|
169
|
-
body:
|
|
177
|
+
body: p,
|
|
170
178
|
headers: a
|
|
171
179
|
});
|
|
172
180
|
if (!v) {
|
|
173
|
-
this.onFileUploadError(
|
|
181
|
+
this.onFileUploadError(m, e);
|
|
174
182
|
return;
|
|
175
183
|
}
|
|
176
|
-
this.onFileUploadSucceed(
|
|
184
|
+
this.onFileUploadSucceed(m, e, h);
|
|
177
185
|
}
|
|
178
186
|
/**
|
|
179
187
|
* Returns if the given file is allowed to handle
|
|
@@ -182,34 +190,55 @@ class E {
|
|
|
182
190
|
const { allowedTypes: e } = this.options;
|
|
183
191
|
return e.includes("*") || e.includes(t.type);
|
|
184
192
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
this.editor.setValue(d), this.options.onFileUploaded?.(o);
|
|
193
|
+
onFileUploadSucceed(t, e, s = this.filename) {
|
|
194
|
+
const { onFileUploadSucceed: i, urlText: r, responseUrlKey: o } = this.options;
|
|
195
|
+
if (!i?.(t)) return;
|
|
196
|
+
const a = typeof e == "string" ? e : e?.text || this.lastValue;
|
|
197
|
+
if (!a) return;
|
|
198
|
+
const c = y(t, o) || "unknown URL", d = /!\[({[^}]+})]\(([^)]+)\)/, u = U(r) ? r(c, t) : r.replace(r.match(d)[1], s).replace(r.match(d)[2], c), f = this.replacePlaceholder(e, a, u);
|
|
199
|
+
this.editor.setValue(f), this.options.onFileUploaded?.(c);
|
|
193
200
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
this.editor.setValue(e);
|
|
201
|
+
onFileUploadError(t, e) {
|
|
202
|
+
if (!this.options.onFileUploadError?.(t)) return;
|
|
203
|
+
const s = typeof e == "string" ? e : e?.text || this.lastValue;
|
|
204
|
+
if (!s) return;
|
|
205
|
+
const i = this.replacePlaceholder(e, s, this.options.errorText);
|
|
206
|
+
this.editor.setValue(i);
|
|
201
207
|
}
|
|
202
208
|
/**
|
|
203
209
|
* Called when a file has been inserted, either by drop or paste
|
|
204
210
|
*/
|
|
205
211
|
onFileInserted(t) {
|
|
206
|
-
|
|
212
|
+
const e = this.insertFile(t);
|
|
213
|
+
return e ? e.text : !1;
|
|
207
214
|
}
|
|
208
215
|
handleFiles(t) {
|
|
209
216
|
Array.from(t).forEach((e) => {
|
|
210
|
-
|
|
217
|
+
if (!this.isFileAllowed(e)) return;
|
|
218
|
+
const s = this.pendingPlaceholders.length, i = this.onFileInserted(e);
|
|
219
|
+
if (!i) return;
|
|
220
|
+
const r = this.pendingPlaceholders[s];
|
|
221
|
+
this.uploadFile(
|
|
222
|
+
e,
|
|
223
|
+
r?.text === i ? r : i
|
|
224
|
+
);
|
|
211
225
|
});
|
|
212
226
|
}
|
|
227
|
+
insertFile(t) {
|
|
228
|
+
if (!this.options.onFileReceived?.(t)) return !1;
|
|
229
|
+
const e = {
|
|
230
|
+
id: /* @__PURE__ */ Symbol("inline-attacher-placeholder"),
|
|
231
|
+
text: this.options.progressText
|
|
232
|
+
};
|
|
233
|
+
return this.pendingPlaceholders.push(e), this.lastValue = e.text, this.editor.insertValue(e.text), e;
|
|
234
|
+
}
|
|
235
|
+
replacePlaceholder(t, e, s) {
|
|
236
|
+
const i = this.editor.getValue();
|
|
237
|
+
if (!t || typeof t == "string")
|
|
238
|
+
return i.replace(e, s);
|
|
239
|
+
const r = this.pendingPlaceholders.findIndex(({ id: o }) => o === t.id);
|
|
240
|
+
return r === -1 ? i.replace(e, s) : (this.pendingPlaceholders.splice(r, 1), T(i, e, s, r));
|
|
241
|
+
}
|
|
213
242
|
/**
|
|
214
243
|
* Called when a paste event occurred
|
|
215
244
|
*/
|
|
@@ -223,13 +252,13 @@ class E {
|
|
|
223
252
|
t.dataTransfer?.files.length && this.handleFiles(t.dataTransfer.files);
|
|
224
253
|
}
|
|
225
254
|
}
|
|
226
|
-
function
|
|
227
|
-
const e = n.scrollTop,
|
|
228
|
-
n.value =
|
|
229
|
-
const
|
|
230
|
-
n.selectionStart =
|
|
255
|
+
function b(n, t) {
|
|
256
|
+
const e = n.scrollTop, s = n.selectionStart ?? 0, i = n.selectionEnd ?? s, r = Math.min(s, i), o = Math.max(s, i), { value: a } = n, c = a.slice(0, r), d = a.slice(o, a.length);
|
|
257
|
+
n.value = c + t + d;
|
|
258
|
+
const u = r + t.length;
|
|
259
|
+
n.selectionStart = u, n.selectionEnd = u, n.scrollTop = e, n.focus();
|
|
231
260
|
}
|
|
232
|
-
class
|
|
261
|
+
class D {
|
|
233
262
|
instance;
|
|
234
263
|
constructor(t) {
|
|
235
264
|
this.instance = t;
|
|
@@ -238,7 +267,7 @@ class T {
|
|
|
238
267
|
return this.instance.value;
|
|
239
268
|
}
|
|
240
269
|
insertValue(t) {
|
|
241
|
-
|
|
270
|
+
b(this.instance, t), this.dispatchInputEvent();
|
|
242
271
|
}
|
|
243
272
|
setValue(t) {
|
|
244
273
|
this.instance.value = t, this.dispatchInputEvent();
|
|
@@ -250,9 +279,9 @@ class T {
|
|
|
250
279
|
}));
|
|
251
280
|
}
|
|
252
281
|
}
|
|
253
|
-
class
|
|
282
|
+
class I extends F {
|
|
254
283
|
constructor(t, e = {}) {
|
|
255
|
-
super(new
|
|
284
|
+
super(new D(t), e);
|
|
256
285
|
}
|
|
257
286
|
bind() {
|
|
258
287
|
this.editor.instance.addEventListener(
|
|
@@ -273,10 +302,10 @@ class b extends E {
|
|
|
273
302
|
);
|
|
274
303
|
}
|
|
275
304
|
}
|
|
276
|
-
function
|
|
277
|
-
return new
|
|
305
|
+
function V(...n) {
|
|
306
|
+
return new I(...n).bind();
|
|
278
307
|
}
|
|
279
|
-
class
|
|
308
|
+
class A {
|
|
280
309
|
instance;
|
|
281
310
|
constructor(t) {
|
|
282
311
|
this.instance = t;
|
|
@@ -298,9 +327,9 @@ class y {
|
|
|
298
327
|
}), this.instance.dispatch({ selection: { anchor: e } });
|
|
299
328
|
}
|
|
300
329
|
}
|
|
301
|
-
class
|
|
330
|
+
class g extends F {
|
|
302
331
|
constructor(t, e = {}) {
|
|
303
|
-
super(new
|
|
332
|
+
super(new A(t), e);
|
|
304
333
|
}
|
|
305
334
|
bind() {
|
|
306
335
|
this.editor.instance.dom.addEventListener(
|
|
@@ -321,16 +350,16 @@ class p extends E {
|
|
|
321
350
|
);
|
|
322
351
|
}
|
|
323
352
|
}
|
|
324
|
-
function
|
|
325
|
-
return new
|
|
353
|
+
function k(...n) {
|
|
354
|
+
return new g(...n).bind();
|
|
326
355
|
}
|
|
327
|
-
function
|
|
356
|
+
function L(n = {}) {
|
|
328
357
|
return w.domEventHandlers({
|
|
329
358
|
paste: (t, e) => {
|
|
330
|
-
new
|
|
359
|
+
new g(e, n).onPaste(t);
|
|
331
360
|
},
|
|
332
361
|
drop: (t, e) => {
|
|
333
|
-
t.stopPropagation(), t.preventDefault(), new
|
|
362
|
+
t.stopPropagation(), t.preventDefault(), new g(e, n).onDrop(t);
|
|
334
363
|
},
|
|
335
364
|
dragenter: (t) => {
|
|
336
365
|
t.stopPropagation(), t.preventDefault();
|
|
@@ -341,11 +370,11 @@ function S(n = {}) {
|
|
|
341
370
|
});
|
|
342
371
|
}
|
|
343
372
|
export {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
373
|
+
g as CodeMirrorInlineAttachmentAdapter,
|
|
374
|
+
E as DEFAULT_OPTIONS,
|
|
375
|
+
F as InlineAttachment,
|
|
376
|
+
I as InputInlineAttachmentAdapter,
|
|
377
|
+
V as attach,
|
|
378
|
+
k as attachCodeMirror,
|
|
379
|
+
L as inlineAttachmentExtension
|
|
351
380
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(s,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("@codemirror/view")):typeof define=="function"&&define.amd?define(["exports","@codemirror/view"],h):(s=typeof globalThis<"u"?globalThis:s||self,h(s.inlineAttacher={},s.CodemirrorView))})(this,(function(s,h){"use strict";const F={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 P({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 T(n){return typeof n=="function"}function y(n,t="",e=""){const o=t.split(".");let i=n;for(const r of o)if(i&&typeof i=="object"&&r in i)i=i[r];else return e;return i!==void 0?i:e}function A(n,t,e,o=0){let i=0;for(let r=0;r<=o;r+=1){const a=n.indexOf(t,i);if(a===-1)return n;if(r===o)return n.slice(0,a)+e+n.slice(a+t.length);i=a+t.length}return n}class v{options=F;editor;filename="";lastValue="";pendingPlaceholders=[];constructor(t,e){this.editor=t,this.options={...F,...e}}async uploadFile(t,e){const{defaultExtension:o,remoteFilename:i,uploadFieldName:r,extraParams:a,extraHeaders:l,uploadUrl:d,uploadMethod:u,beforeFileUpload:p,uploadHandler:E}=this.options,f=new FormData,M=o.replace(/^\./,""),g=i?.(t)||t.name||`image-${Date.now()}.${M}`;if(this.filename=g,f.append(r,t,g),Object.keys(a).forEach(c=>{f.append(c,a[c])}),!p?.(f))return;if(E){try{const c=await E({file:t,filename:g,formData:f,options:this.options});this.onFileUploadSucceed(c,e,g)}catch(c){this.onFileUploadError(c instanceof Error?c:new Error(String(c)),e)}return}const{ok:L,value:w}=await P({url:d,method:u,body:f,headers:l});if(!L){this.onFileUploadError(w,e);return}this.onFileUploadSucceed(w,e,g)}isFileAllowed(t){const{allowedTypes:e}=this.options;return e.includes("*")||e.includes(t.type)}onFileUploadSucceed(t,e,o=this.filename){const{onFileUploadSucceed:i,urlText:r,responseUrlKey:a}=this.options;if(!i?.(t))return;const l=typeof e=="string"?e:e?.text||this.lastValue;if(!l)return;const d=y(t,a)||"unknown URL",u=/!\[({[^}]+})]\(([^)]+)\)/,p=T(r)?r(d,t):r.replace(r.match(u)[1],o).replace(r.match(u)[2],d),E=this.replacePlaceholder(e,l,p);this.editor.setValue(E),this.options.onFileUploaded?.(d)}onFileUploadError(t,e){if(!this.options.onFileUploadError?.(t))return;const o=typeof e=="string"?e:e?.text||this.lastValue;if(!o)return;const i=this.replacePlaceholder(e,o,this.options.errorText);this.editor.setValue(i)}onFileInserted(t){const e=this.insertFile(t);return e?e.text:!1}handleFiles(t){Array.from(t).forEach(e=>{if(!this.isFileAllowed(e))return;const o=this.pendingPlaceholders.length,i=this.onFileInserted(e);if(!i)return;const r=this.pendingPlaceholders[o];this.uploadFile(e,r?.text===i?r:i)})}insertFile(t){if(!this.options.onFileReceived?.(t))return!1;const e={id:Symbol("inline-attacher-placeholder"),text:this.options.progressText};return this.pendingPlaceholders.push(e),this.lastValue=e.text,this.editor.insertValue(e.text),e}replacePlaceholder(t,e,o){const i=this.editor.getValue();if(!t||typeof t=="string")return i.replace(e,o);const r=this.pendingPlaceholders.findIndex(({id:a})=>a===t.id);return r===-1?i.replace(e,o):(this.pendingPlaceholders.splice(r,1),A(i,e,o,r))}onPaste(t){t.clipboardData?.files.length&&this.handleFiles(t.clipboardData.files)}onDrop(t){t.dataTransfer?.files.length&&this.handleFiles(t.dataTransfer.files)}}function U(n,t){const e=n.scrollTop,o=n.selectionStart??0,i=n.selectionEnd??o,r=Math.min(o,i),a=Math.max(o,i),{value:l}=n,d=l.slice(0,r),u=l.slice(a,l.length);n.value=d+t+u;const p=r+t.length;n.selectionStart=p,n.selectionEnd=p,n.scrollTop=e,n.focus()}class I{instance;constructor(t){this.instance=t}getValue(){return this.instance.value}insertValue(t){U(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 x extends v{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 x(...n).bind()}class D{instance;constructor(t){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 v{constructor(t,e={}){super(new D(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 S(...n){return new m(...n).bind()}function V(n={}){return h.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()}})}s.CodeMirrorInlineAttachmentAdapter=m,s.DEFAULT_OPTIONS=F,s.InlineAttachment=v,s.InputInlineAttachmentAdapter=x,s.attach=b,s.attachCodeMirror=S,s.inlineAttachmentExtension=V,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "inline-attacher",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "📎 A modern port from Inline Attachment",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"playground:deploy": "pnpm -C playground run deploy",
|
|
26
26
|
"lint": "eslint --fix --ext .ts src",
|
|
27
27
|
"prepublishOnly": "pnpm build",
|
|
28
|
-
"release": "
|
|
29
|
-
"size-check": "
|
|
28
|
+
"release": "npx standard-version && git push --follow-tags && npm publish",
|
|
29
|
+
"size-check": "npx vite-bundle-visualizer"
|
|
30
30
|
},
|
|
31
31
|
"keywords": [
|
|
32
32
|
"inline-attachment",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@codemirror/state": "^6.7.0",
|
|
59
|
+
"@codemirror/view": "^6.43.4",
|
|
59
60
|
"@types/node": "^22.20.0",
|
|
60
61
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
61
62
|
"@typescript-eslint/parser": "^6.21.0",
|
|
@@ -68,8 +69,5 @@
|
|
|
68
69
|
"typescript": "^6.0.2",
|
|
69
70
|
"vite": "^7.3.0",
|
|
70
71
|
"vitest": "^4.0.16"
|
|
71
|
-
},
|
|
72
|
-
"dependencies": {
|
|
73
|
-
"@codemirror/view": "^6.43.4"
|
|
74
72
|
}
|
|
75
73
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|