tinymce-solid 0.0.4 → 0.0.6
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 +15 -16
- package/banner.svg +98 -98
- package/dist/{dev.mjs → dev.js} +28 -618
- package/dist/dev.jsx +11 -595
- package/dist/index.d.ts +5 -5
- package/dist/{index.mjs → index.js} +26 -616
- package/dist/index.jsx +10 -13
- package/package.json +13 -13
- package/src/Utils.ts +1 -1
- package/src/components/{SolidEditor.tsx → Editor.tsx} +8 -13
- package/src/index.tsx +2 -2
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { createComponent, Dynamic, mergeProps, memo } from 'solid-js/web';
|
|
2
|
+
import { createSignal, createEffect, on, onMount, onCleanup } from 'solid-js';
|
|
3
|
+
|
|
1
4
|
var __create = Object.create;
|
|
2
5
|
var __defProp = Object.defineProperty;
|
|
3
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -94,581 +97,6 @@ var require_prop_types = __commonJS({
|
|
|
94
97
|
}
|
|
95
98
|
});
|
|
96
99
|
|
|
97
|
-
// node_modules/solid-js/dist/solid.js
|
|
98
|
-
var sharedConfig = {
|
|
99
|
-
context: void 0,
|
|
100
|
-
registry: void 0
|
|
101
|
-
};
|
|
102
|
-
function setHydrateContext(context) {
|
|
103
|
-
sharedConfig.context = context;
|
|
104
|
-
}
|
|
105
|
-
var equalFn = (a, b) => a === b;
|
|
106
|
-
var signalOptions = {
|
|
107
|
-
equals: equalFn
|
|
108
|
-
};
|
|
109
|
-
var ERROR = null;
|
|
110
|
-
var runEffects = runQueue;
|
|
111
|
-
var STALE = 1;
|
|
112
|
-
var PENDING = 2;
|
|
113
|
-
var UNOWNED = {
|
|
114
|
-
owned: null,
|
|
115
|
-
cleanups: null,
|
|
116
|
-
context: null,
|
|
117
|
-
owner: null
|
|
118
|
-
};
|
|
119
|
-
var Owner = null;
|
|
120
|
-
var Transition = null;
|
|
121
|
-
var Scheduler = null;
|
|
122
|
-
var ExternalSourceConfig = null;
|
|
123
|
-
var Listener = null;
|
|
124
|
-
var Updates = null;
|
|
125
|
-
var Effects = null;
|
|
126
|
-
var ExecCount = 0;
|
|
127
|
-
function createSignal(value, options) {
|
|
128
|
-
options = options ? Object.assign({}, signalOptions, options) : signalOptions;
|
|
129
|
-
const s = {
|
|
130
|
-
value,
|
|
131
|
-
observers: null,
|
|
132
|
-
observerSlots: null,
|
|
133
|
-
comparator: options.equals || void 0
|
|
134
|
-
};
|
|
135
|
-
const setter = (value2) => {
|
|
136
|
-
if (typeof value2 === "function") {
|
|
137
|
-
if (Transition && Transition.running && Transition.sources.has(s)) value2 = value2(s.tValue);
|
|
138
|
-
else value2 = value2(s.value);
|
|
139
|
-
}
|
|
140
|
-
return writeSignal(s, value2);
|
|
141
|
-
};
|
|
142
|
-
return [readSignal.bind(s), setter];
|
|
143
|
-
}
|
|
144
|
-
function createRenderEffect(fn, value, options) {
|
|
145
|
-
const c = createComputation(fn, value, false, STALE);
|
|
146
|
-
if (Scheduler && Transition && Transition.running) Updates.push(c);
|
|
147
|
-
else updateComputation(c);
|
|
148
|
-
}
|
|
149
|
-
function createEffect(fn, value, options) {
|
|
150
|
-
runEffects = runUserEffects;
|
|
151
|
-
const c = createComputation(fn, value, false, STALE), s = SuspenseContext && useContext(SuspenseContext);
|
|
152
|
-
if (s) c.suspense = s;
|
|
153
|
-
c.user = true;
|
|
154
|
-
Effects ? Effects.push(c) : updateComputation(c);
|
|
155
|
-
}
|
|
156
|
-
function untrack(fn) {
|
|
157
|
-
if (!ExternalSourceConfig && Listener === null) return fn();
|
|
158
|
-
const listener = Listener;
|
|
159
|
-
Listener = null;
|
|
160
|
-
try {
|
|
161
|
-
if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);
|
|
162
|
-
return fn();
|
|
163
|
-
} finally {
|
|
164
|
-
Listener = listener;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
function on(deps, fn, options) {
|
|
168
|
-
const isArray = Array.isArray(deps);
|
|
169
|
-
let prevInput;
|
|
170
|
-
return (prevValue) => {
|
|
171
|
-
let input;
|
|
172
|
-
if (isArray) {
|
|
173
|
-
input = Array(deps.length);
|
|
174
|
-
for (let i = 0; i < deps.length; i++) input[i] = deps[i]();
|
|
175
|
-
} else input = deps();
|
|
176
|
-
const result = untrack(() => fn(input, prevInput, prevValue));
|
|
177
|
-
prevInput = input;
|
|
178
|
-
return result;
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
function onMount(fn) {
|
|
182
|
-
createEffect(() => untrack(fn));
|
|
183
|
-
}
|
|
184
|
-
function onCleanup(fn) {
|
|
185
|
-
if (Owner === null) ;
|
|
186
|
-
else if (Owner.cleanups === null) Owner.cleanups = [fn];
|
|
187
|
-
else Owner.cleanups.push(fn);
|
|
188
|
-
return fn;
|
|
189
|
-
}
|
|
190
|
-
function startTransition(fn) {
|
|
191
|
-
if (Transition && Transition.running) {
|
|
192
|
-
fn();
|
|
193
|
-
return Transition.done;
|
|
194
|
-
}
|
|
195
|
-
const l = Listener;
|
|
196
|
-
const o = Owner;
|
|
197
|
-
return Promise.resolve().then(() => {
|
|
198
|
-
Listener = l;
|
|
199
|
-
Owner = o;
|
|
200
|
-
let t;
|
|
201
|
-
if (Scheduler || SuspenseContext) {
|
|
202
|
-
t = Transition || (Transition = {
|
|
203
|
-
sources: /* @__PURE__ */ new Set(),
|
|
204
|
-
effects: [],
|
|
205
|
-
promises: /* @__PURE__ */ new Set(),
|
|
206
|
-
disposed: /* @__PURE__ */ new Set(),
|
|
207
|
-
queue: /* @__PURE__ */ new Set(),
|
|
208
|
-
running: true
|
|
209
|
-
});
|
|
210
|
-
t.done || (t.done = new Promise((res) => t.resolve = res));
|
|
211
|
-
t.running = true;
|
|
212
|
-
}
|
|
213
|
-
runUpdates(fn);
|
|
214
|
-
Listener = Owner = null;
|
|
215
|
-
return t ? t.done : void 0;
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
var [transPending, setTransPending] = /* @__PURE__ */ createSignal(false);
|
|
219
|
-
function useContext(context) {
|
|
220
|
-
return Owner && Owner.context && Owner.context[context.id] !== void 0 ? Owner.context[context.id] : context.defaultValue;
|
|
221
|
-
}
|
|
222
|
-
var SuspenseContext;
|
|
223
|
-
function readSignal() {
|
|
224
|
-
const runningTransition = Transition && Transition.running;
|
|
225
|
-
if (this.sources && (runningTransition ? this.tState : this.state)) {
|
|
226
|
-
if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);
|
|
227
|
-
else {
|
|
228
|
-
const updates = Updates;
|
|
229
|
-
Updates = null;
|
|
230
|
-
runUpdates(() => lookUpstream(this));
|
|
231
|
-
Updates = updates;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
if (Listener) {
|
|
235
|
-
const sSlot = this.observers ? this.observers.length : 0;
|
|
236
|
-
if (!Listener.sources) {
|
|
237
|
-
Listener.sources = [this];
|
|
238
|
-
Listener.sourceSlots = [sSlot];
|
|
239
|
-
} else {
|
|
240
|
-
Listener.sources.push(this);
|
|
241
|
-
Listener.sourceSlots.push(sSlot);
|
|
242
|
-
}
|
|
243
|
-
if (!this.observers) {
|
|
244
|
-
this.observers = [Listener];
|
|
245
|
-
this.observerSlots = [Listener.sources.length - 1];
|
|
246
|
-
} else {
|
|
247
|
-
this.observers.push(Listener);
|
|
248
|
-
this.observerSlots.push(Listener.sources.length - 1);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
if (runningTransition && Transition.sources.has(this)) return this.tValue;
|
|
252
|
-
return this.value;
|
|
253
|
-
}
|
|
254
|
-
function writeSignal(node, value, isComp) {
|
|
255
|
-
let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
|
|
256
|
-
if (!node.comparator || !node.comparator(current, value)) {
|
|
257
|
-
if (Transition) {
|
|
258
|
-
const TransitionRunning = Transition.running;
|
|
259
|
-
if (TransitionRunning || !isComp && Transition.sources.has(node)) {
|
|
260
|
-
Transition.sources.add(node);
|
|
261
|
-
node.tValue = value;
|
|
262
|
-
}
|
|
263
|
-
if (!TransitionRunning) node.value = value;
|
|
264
|
-
} else node.value = value;
|
|
265
|
-
if (node.observers && node.observers.length) {
|
|
266
|
-
runUpdates(() => {
|
|
267
|
-
for (let i = 0; i < node.observers.length; i += 1) {
|
|
268
|
-
const o = node.observers[i];
|
|
269
|
-
const TransitionRunning = Transition && Transition.running;
|
|
270
|
-
if (TransitionRunning && Transition.disposed.has(o)) continue;
|
|
271
|
-
if (TransitionRunning ? !o.tState : !o.state) {
|
|
272
|
-
if (o.pure) Updates.push(o);
|
|
273
|
-
else Effects.push(o);
|
|
274
|
-
if (o.observers) markDownstream(o);
|
|
275
|
-
}
|
|
276
|
-
if (!TransitionRunning) o.state = STALE;
|
|
277
|
-
else o.tState = STALE;
|
|
278
|
-
}
|
|
279
|
-
if (Updates.length > 1e6) {
|
|
280
|
-
Updates = [];
|
|
281
|
-
if (false) ;
|
|
282
|
-
throw new Error();
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
return value;
|
|
288
|
-
}
|
|
289
|
-
function updateComputation(node) {
|
|
290
|
-
if (!node.fn) return;
|
|
291
|
-
cleanNode(node);
|
|
292
|
-
const time = ExecCount;
|
|
293
|
-
runComputation(
|
|
294
|
-
node,
|
|
295
|
-
Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
|
|
296
|
-
time
|
|
297
|
-
);
|
|
298
|
-
if (Transition && !Transition.running && Transition.sources.has(node)) {
|
|
299
|
-
queueMicrotask(() => {
|
|
300
|
-
runUpdates(() => {
|
|
301
|
-
Transition && (Transition.running = true);
|
|
302
|
-
Listener = Owner = node;
|
|
303
|
-
runComputation(node, node.tValue, time);
|
|
304
|
-
Listener = Owner = null;
|
|
305
|
-
});
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
function runComputation(node, value, time) {
|
|
310
|
-
let nextValue;
|
|
311
|
-
const owner = Owner, listener = Listener;
|
|
312
|
-
Listener = Owner = node;
|
|
313
|
-
try {
|
|
314
|
-
nextValue = node.fn(value);
|
|
315
|
-
} catch (err) {
|
|
316
|
-
if (node.pure) {
|
|
317
|
-
if (Transition && Transition.running) {
|
|
318
|
-
node.tState = STALE;
|
|
319
|
-
node.tOwned && node.tOwned.forEach(cleanNode);
|
|
320
|
-
node.tOwned = void 0;
|
|
321
|
-
} else {
|
|
322
|
-
node.state = STALE;
|
|
323
|
-
node.owned && node.owned.forEach(cleanNode);
|
|
324
|
-
node.owned = null;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
node.updatedAt = time + 1;
|
|
328
|
-
return handleError(err);
|
|
329
|
-
} finally {
|
|
330
|
-
Listener = listener;
|
|
331
|
-
Owner = owner;
|
|
332
|
-
}
|
|
333
|
-
if (!node.updatedAt || node.updatedAt <= time) {
|
|
334
|
-
if (node.updatedAt != null && "observers" in node) {
|
|
335
|
-
writeSignal(node, nextValue, true);
|
|
336
|
-
} else if (Transition && Transition.running && node.pure) {
|
|
337
|
-
Transition.sources.add(node);
|
|
338
|
-
node.tValue = nextValue;
|
|
339
|
-
} else node.value = nextValue;
|
|
340
|
-
node.updatedAt = time;
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
function createComputation(fn, init, pure, state = STALE, options) {
|
|
344
|
-
const c = {
|
|
345
|
-
fn,
|
|
346
|
-
state,
|
|
347
|
-
updatedAt: null,
|
|
348
|
-
owned: null,
|
|
349
|
-
sources: null,
|
|
350
|
-
sourceSlots: null,
|
|
351
|
-
cleanups: null,
|
|
352
|
-
value: init,
|
|
353
|
-
owner: Owner,
|
|
354
|
-
context: Owner ? Owner.context : null,
|
|
355
|
-
pure
|
|
356
|
-
};
|
|
357
|
-
if (Transition && Transition.running) {
|
|
358
|
-
c.state = 0;
|
|
359
|
-
c.tState = state;
|
|
360
|
-
}
|
|
361
|
-
if (Owner === null) ;
|
|
362
|
-
else if (Owner !== UNOWNED) {
|
|
363
|
-
if (Transition && Transition.running && Owner.pure) {
|
|
364
|
-
if (!Owner.tOwned) Owner.tOwned = [c];
|
|
365
|
-
else Owner.tOwned.push(c);
|
|
366
|
-
} else {
|
|
367
|
-
if (!Owner.owned) Owner.owned = [c];
|
|
368
|
-
else Owner.owned.push(c);
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
if (ExternalSourceConfig && c.fn) {
|
|
372
|
-
const [track, trigger] = createSignal(void 0, {
|
|
373
|
-
equals: false
|
|
374
|
-
});
|
|
375
|
-
const ordinary = ExternalSourceConfig.factory(c.fn, trigger);
|
|
376
|
-
onCleanup(() => ordinary.dispose());
|
|
377
|
-
const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());
|
|
378
|
-
const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);
|
|
379
|
-
c.fn = (x) => {
|
|
380
|
-
track();
|
|
381
|
-
return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
return c;
|
|
385
|
-
}
|
|
386
|
-
function runTop(node) {
|
|
387
|
-
const runningTransition = Transition && Transition.running;
|
|
388
|
-
if ((runningTransition ? node.tState : node.state) === 0) return;
|
|
389
|
-
if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);
|
|
390
|
-
if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);
|
|
391
|
-
const ancestors = [node];
|
|
392
|
-
while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {
|
|
393
|
-
if (runningTransition && Transition.disposed.has(node)) return;
|
|
394
|
-
if (runningTransition ? node.tState : node.state) ancestors.push(node);
|
|
395
|
-
}
|
|
396
|
-
for (let i = ancestors.length - 1; i >= 0; i--) {
|
|
397
|
-
node = ancestors[i];
|
|
398
|
-
if (runningTransition) {
|
|
399
|
-
let top = node, prev = ancestors[i + 1];
|
|
400
|
-
while ((top = top.owner) && top !== prev) {
|
|
401
|
-
if (Transition.disposed.has(top)) return;
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
if ((runningTransition ? node.tState : node.state) === STALE) {
|
|
405
|
-
updateComputation(node);
|
|
406
|
-
} else if ((runningTransition ? node.tState : node.state) === PENDING) {
|
|
407
|
-
const updates = Updates;
|
|
408
|
-
Updates = null;
|
|
409
|
-
runUpdates(() => lookUpstream(node, ancestors[0]));
|
|
410
|
-
Updates = updates;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
function runUpdates(fn, init) {
|
|
415
|
-
if (Updates) return fn();
|
|
416
|
-
let wait = false;
|
|
417
|
-
Updates = [];
|
|
418
|
-
if (Effects) wait = true;
|
|
419
|
-
else Effects = [];
|
|
420
|
-
ExecCount++;
|
|
421
|
-
try {
|
|
422
|
-
const res = fn();
|
|
423
|
-
completeUpdates(wait);
|
|
424
|
-
return res;
|
|
425
|
-
} catch (err) {
|
|
426
|
-
if (!wait) Effects = null;
|
|
427
|
-
Updates = null;
|
|
428
|
-
handleError(err);
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
function completeUpdates(wait) {
|
|
432
|
-
if (Updates) {
|
|
433
|
-
if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);
|
|
434
|
-
else runQueue(Updates);
|
|
435
|
-
Updates = null;
|
|
436
|
-
}
|
|
437
|
-
if (wait) return;
|
|
438
|
-
let res;
|
|
439
|
-
if (Transition) {
|
|
440
|
-
if (!Transition.promises.size && !Transition.queue.size) {
|
|
441
|
-
const sources = Transition.sources;
|
|
442
|
-
const disposed = Transition.disposed;
|
|
443
|
-
Effects.push.apply(Effects, Transition.effects);
|
|
444
|
-
res = Transition.resolve;
|
|
445
|
-
for (const e2 of Effects) {
|
|
446
|
-
"tState" in e2 && (e2.state = e2.tState);
|
|
447
|
-
delete e2.tState;
|
|
448
|
-
}
|
|
449
|
-
Transition = null;
|
|
450
|
-
runUpdates(() => {
|
|
451
|
-
for (const d of disposed) cleanNode(d);
|
|
452
|
-
for (const v of sources) {
|
|
453
|
-
v.value = v.tValue;
|
|
454
|
-
if (v.owned) {
|
|
455
|
-
for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);
|
|
456
|
-
}
|
|
457
|
-
if (v.tOwned) v.owned = v.tOwned;
|
|
458
|
-
delete v.tValue;
|
|
459
|
-
delete v.tOwned;
|
|
460
|
-
v.tState = 0;
|
|
461
|
-
}
|
|
462
|
-
setTransPending(false);
|
|
463
|
-
});
|
|
464
|
-
} else if (Transition.running) {
|
|
465
|
-
Transition.running = false;
|
|
466
|
-
Transition.effects.push.apply(Transition.effects, Effects);
|
|
467
|
-
Effects = null;
|
|
468
|
-
setTransPending(true);
|
|
469
|
-
return;
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
const e = Effects;
|
|
473
|
-
Effects = null;
|
|
474
|
-
if (e.length) runUpdates(() => runEffects(e));
|
|
475
|
-
if (res) res();
|
|
476
|
-
}
|
|
477
|
-
function runQueue(queue) {
|
|
478
|
-
for (let i = 0; i < queue.length; i++) runTop(queue[i]);
|
|
479
|
-
}
|
|
480
|
-
function scheduleQueue(queue) {
|
|
481
|
-
for (let i = 0; i < queue.length; i++) {
|
|
482
|
-
const item = queue[i];
|
|
483
|
-
const tasks = Transition.queue;
|
|
484
|
-
if (!tasks.has(item)) {
|
|
485
|
-
tasks.add(item);
|
|
486
|
-
Scheduler(() => {
|
|
487
|
-
tasks.delete(item);
|
|
488
|
-
runUpdates(() => {
|
|
489
|
-
Transition.running = true;
|
|
490
|
-
runTop(item);
|
|
491
|
-
});
|
|
492
|
-
Transition && (Transition.running = false);
|
|
493
|
-
});
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
function runUserEffects(queue) {
|
|
498
|
-
let i, userLength = 0;
|
|
499
|
-
for (i = 0; i < queue.length; i++) {
|
|
500
|
-
const e = queue[i];
|
|
501
|
-
if (!e.user) runTop(e);
|
|
502
|
-
else queue[userLength++] = e;
|
|
503
|
-
}
|
|
504
|
-
if (sharedConfig.context) {
|
|
505
|
-
if (sharedConfig.count) {
|
|
506
|
-
sharedConfig.effects || (sharedConfig.effects = []);
|
|
507
|
-
sharedConfig.effects.push(...queue.slice(0, userLength));
|
|
508
|
-
return;
|
|
509
|
-
} else if (sharedConfig.effects) {
|
|
510
|
-
queue = [...sharedConfig.effects, ...queue];
|
|
511
|
-
userLength += sharedConfig.effects.length;
|
|
512
|
-
delete sharedConfig.effects;
|
|
513
|
-
}
|
|
514
|
-
setHydrateContext();
|
|
515
|
-
}
|
|
516
|
-
for (i = 0; i < userLength; i++) runTop(queue[i]);
|
|
517
|
-
}
|
|
518
|
-
function lookUpstream(node, ignore) {
|
|
519
|
-
const runningTransition = Transition && Transition.running;
|
|
520
|
-
if (runningTransition) node.tState = 0;
|
|
521
|
-
else node.state = 0;
|
|
522
|
-
for (let i = 0; i < node.sources.length; i += 1) {
|
|
523
|
-
const source = node.sources[i];
|
|
524
|
-
if (source.sources) {
|
|
525
|
-
const state = runningTransition ? source.tState : source.state;
|
|
526
|
-
if (state === STALE) {
|
|
527
|
-
if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
|
|
528
|
-
runTop(source);
|
|
529
|
-
} else if (state === PENDING) lookUpstream(source, ignore);
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
function markDownstream(node) {
|
|
534
|
-
const runningTransition = Transition && Transition.running;
|
|
535
|
-
for (let i = 0; i < node.observers.length; i += 1) {
|
|
536
|
-
const o = node.observers[i];
|
|
537
|
-
if (runningTransition ? !o.tState : !o.state) {
|
|
538
|
-
if (runningTransition) o.tState = PENDING;
|
|
539
|
-
else o.state = PENDING;
|
|
540
|
-
if (o.pure) Updates.push(o);
|
|
541
|
-
else Effects.push(o);
|
|
542
|
-
o.observers && markDownstream(o);
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
function cleanNode(node) {
|
|
547
|
-
let i;
|
|
548
|
-
if (node.sources) {
|
|
549
|
-
while (node.sources.length) {
|
|
550
|
-
const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers;
|
|
551
|
-
if (obs && obs.length) {
|
|
552
|
-
const n = obs.pop(), s = source.observerSlots.pop();
|
|
553
|
-
if (index < obs.length) {
|
|
554
|
-
n.sourceSlots[s] = index;
|
|
555
|
-
obs[index] = n;
|
|
556
|
-
source.observerSlots[index] = s;
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
if (Transition && Transition.running && node.pure) {
|
|
562
|
-
if (node.tOwned) {
|
|
563
|
-
for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);
|
|
564
|
-
delete node.tOwned;
|
|
565
|
-
}
|
|
566
|
-
reset(node, true);
|
|
567
|
-
} else if (node.owned) {
|
|
568
|
-
for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);
|
|
569
|
-
node.owned = null;
|
|
570
|
-
}
|
|
571
|
-
if (node.cleanups) {
|
|
572
|
-
for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
|
|
573
|
-
node.cleanups = null;
|
|
574
|
-
}
|
|
575
|
-
if (Transition && Transition.running) node.tState = 0;
|
|
576
|
-
else node.state = 0;
|
|
577
|
-
}
|
|
578
|
-
function reset(node, top) {
|
|
579
|
-
if (!top) {
|
|
580
|
-
node.tState = 0;
|
|
581
|
-
Transition.disposed.add(node);
|
|
582
|
-
}
|
|
583
|
-
if (node.owned) {
|
|
584
|
-
for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
function castError(err) {
|
|
588
|
-
if (err instanceof Error) return err;
|
|
589
|
-
return new Error(typeof err === "string" ? err : "Unknown error", {
|
|
590
|
-
cause: err
|
|
591
|
-
});
|
|
592
|
-
}
|
|
593
|
-
function runErrors(err, fns, owner) {
|
|
594
|
-
try {
|
|
595
|
-
for (const f of fns) f(err);
|
|
596
|
-
} catch (e) {
|
|
597
|
-
handleError(e, owner && owner.owner || null);
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
function handleError(err, owner = Owner) {
|
|
601
|
-
const fns = ERROR && owner && owner.context && owner.context[ERROR];
|
|
602
|
-
const error = castError(err);
|
|
603
|
-
if (!fns) throw error;
|
|
604
|
-
if (Effects)
|
|
605
|
-
Effects.push({
|
|
606
|
-
fn() {
|
|
607
|
-
runErrors(error, fns, owner);
|
|
608
|
-
},
|
|
609
|
-
state: STALE
|
|
610
|
-
});
|
|
611
|
-
else runErrors(error, fns, owner);
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
// node_modules/solid-js/web/dist/web.js
|
|
615
|
-
var booleans = [
|
|
616
|
-
"allowfullscreen",
|
|
617
|
-
"async",
|
|
618
|
-
"autofocus",
|
|
619
|
-
"autoplay",
|
|
620
|
-
"checked",
|
|
621
|
-
"controls",
|
|
622
|
-
"default",
|
|
623
|
-
"disabled",
|
|
624
|
-
"formnovalidate",
|
|
625
|
-
"hidden",
|
|
626
|
-
"indeterminate",
|
|
627
|
-
"inert",
|
|
628
|
-
"ismap",
|
|
629
|
-
"loop",
|
|
630
|
-
"multiple",
|
|
631
|
-
"muted",
|
|
632
|
-
"nomodule",
|
|
633
|
-
"novalidate",
|
|
634
|
-
"open",
|
|
635
|
-
"playsinline",
|
|
636
|
-
"readonly",
|
|
637
|
-
"required",
|
|
638
|
-
"reversed",
|
|
639
|
-
"seamless",
|
|
640
|
-
"selected"
|
|
641
|
-
];
|
|
642
|
-
/* @__PURE__ */ new Set([
|
|
643
|
-
"className",
|
|
644
|
-
"value",
|
|
645
|
-
"readOnly",
|
|
646
|
-
"formNoValidate",
|
|
647
|
-
"isMap",
|
|
648
|
-
"noModule",
|
|
649
|
-
"playsInline",
|
|
650
|
-
...booleans
|
|
651
|
-
]);
|
|
652
|
-
function template(html, isCE, isSVG) {
|
|
653
|
-
let node;
|
|
654
|
-
const create = () => {
|
|
655
|
-
const t = document.createElement("template");
|
|
656
|
-
t.innerHTML = html;
|
|
657
|
-
return t.content.firstChild;
|
|
658
|
-
};
|
|
659
|
-
const fn = () => (node || (node = create())).cloneNode(true);
|
|
660
|
-
fn.cloneNode = fn;
|
|
661
|
-
return fn;
|
|
662
|
-
}
|
|
663
|
-
function setAttribute(node, name, value) {
|
|
664
|
-
if (!!sharedConfig.context && node.isConnected) return;
|
|
665
|
-
if (value == null) node.removeAttribute(name);
|
|
666
|
-
else node.setAttribute(name, value);
|
|
667
|
-
}
|
|
668
|
-
function use(fn, element, arg) {
|
|
669
|
-
return untrack(() => fn(element, arg));
|
|
670
|
-
}
|
|
671
|
-
|
|
672
100
|
// src/components/EditorPropTypes.ts
|
|
673
101
|
var PropTypes = __toESM(require_prop_types(), 1);
|
|
674
102
|
var eventPropTypes = {
|
|
@@ -787,7 +215,7 @@ var EditorPropTypes = {
|
|
|
787
215
|
// src/Utils.ts
|
|
788
216
|
var isFunction = (x) => typeof x === "function";
|
|
789
217
|
var isEventProp = (name) => name in eventPropTypes;
|
|
790
|
-
var eventAttrToEventName = (attrName) => attrName.
|
|
218
|
+
var eventAttrToEventName = (attrName) => String(attrName.slice(2));
|
|
791
219
|
var configHandlers2 = (handlerLookup, on2, off, adapter, prevProps, props, boundHandlers) => {
|
|
792
220
|
const prevEventKeys = Object.keys(prevProps).filter(isEventProp);
|
|
793
221
|
const currEventKeys = Object.keys(props).filter(isEventProp);
|
|
@@ -982,14 +410,13 @@ var getTinymce = (view) => {
|
|
|
982
410
|
return global && global.tinymce ? global.tinymce : null;
|
|
983
411
|
};
|
|
984
412
|
|
|
985
|
-
// src/components/
|
|
986
|
-
var
|
|
987
|
-
var _tmpl$2 = /* @__PURE__ */ template(`<textarea>`);
|
|
988
|
-
var SolidEditor = (props) => {
|
|
413
|
+
// src/components/Editor.tsx
|
|
414
|
+
var Editor = (props) => {
|
|
989
415
|
const [id] = createSignal(props.id || uuid("solid-tinymce-editor"));
|
|
990
416
|
const initialValue = () => props.initialValue;
|
|
991
417
|
const value = () => props.value || "";
|
|
992
418
|
const skin = () => props.skin || "oxide";
|
|
419
|
+
const tagName = () => props.tagName || "div";
|
|
993
420
|
const contentCss = () => props.contentCss || "default";
|
|
994
421
|
const disabled = () => props.disabled || false;
|
|
995
422
|
const [editor, setEditor] = createSignal();
|
|
@@ -1250,44 +677,27 @@ var SolidEditor = (props) => {
|
|
|
1250
677
|
handleBeforeInput(evt);
|
|
1251
678
|
}
|
|
1252
679
|
};
|
|
1253
|
-
return
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
})
|
|
1271
|
-
var _el$2 = _tmpl$2();
|
|
1272
|
-
var _ref$2 = props.elementRef;
|
|
1273
|
-
typeof _ref$2 === "function" ? use(_ref$2, _el$2) : props.elementRef = _el$2;
|
|
1274
|
-
_el$2.style.setProperty("visibility", "hidden");
|
|
1275
|
-
createRenderEffect((_p$) => {
|
|
1276
|
-
var _v$4 = id(), _v$5 = props.testid, _v$6 = props.tabIndex;
|
|
1277
|
-
_v$4 !== _p$.e && setAttribute(_el$2, "id", _p$.e = _v$4);
|
|
1278
|
-
_v$5 !== _p$.t && setAttribute(_el$2, "data-testid", _p$.t = _v$5);
|
|
1279
|
-
_v$6 !== _p$.a && setAttribute(_el$2, "tabindex", _p$.a = _v$6);
|
|
1280
|
-
return _p$;
|
|
1281
|
-
}, {
|
|
1282
|
-
e: void 0,
|
|
1283
|
-
t: void 0,
|
|
1284
|
-
a: void 0
|
|
1285
|
-
});
|
|
1286
|
-
return _el$2;
|
|
1287
|
-
})();
|
|
680
|
+
return createComponent(Dynamic, mergeProps({
|
|
681
|
+
get component() {
|
|
682
|
+
return memo(() => !!props.inline)() ? tagName() : "textarea";
|
|
683
|
+
},
|
|
684
|
+
get id() {
|
|
685
|
+
return id();
|
|
686
|
+
},
|
|
687
|
+
get ["data-testid"]() {
|
|
688
|
+
return props.testid;
|
|
689
|
+
},
|
|
690
|
+
get tabIndex() {
|
|
691
|
+
return props.tabIndex;
|
|
692
|
+
},
|
|
693
|
+
ref(r$) {
|
|
694
|
+
var _ref$ = props.elementRef;
|
|
695
|
+
typeof _ref$ === "function" ? _ref$(r$) : props.elementRef = r$;
|
|
696
|
+
}
|
|
697
|
+
}, props));
|
|
1288
698
|
};
|
|
1289
699
|
|
|
1290
700
|
// src/index.tsx
|
|
1291
|
-
var src_default =
|
|
701
|
+
var src_default = Editor;
|
|
1292
702
|
|
|
1293
703
|
export { EditorPropTypes, src_default as default };
|