@pie-element/venn-classification 0.1.1-next.8 → 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/dist/author/index.d.ts +2 -18
- package/dist/author/index.js +1107 -781
- package/dist/author/index.js.map +1 -1
- package/dist/browser/{VennClassification-BgmjHIWB.js → VennClassification-Dh-jgyW3.js} +1232 -1072
- package/dist/browser/VennClassification-Dh-jgyW3.js.map +1 -0
- package/dist/browser/author/index.js +3856 -3710
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +2 -2
- package/dist/browser/{controller-CmzKcNfc.js → controller-bkBJ6-j1.js} +8 -3
- package/dist/browser/{controller-CmzKcNfc.js.map → controller-bkBJ6-j1.js.map} +1 -1
- package/dist/browser/delivery/index.js +2 -2
- package/dist/browser/editor-runtime/VennClassification-Dh-jgyW3.js +3776 -0
- package/dist/browser/editor-runtime/VennClassification-Dh-jgyW3.js.map +1 -0
- package/dist/browser/editor-runtime/author/index.js +951 -0
- package/dist/browser/editor-runtime/author/index.js.map +1 -0
- package/dist/browser/editor-runtime/controller/index.js +2 -0
- package/dist/browser/editor-runtime/controller-bkBJ6-j1.js +1779 -0
- package/dist/browser/editor-runtime/controller-bkBJ6-j1.js.map +1 -0
- package/dist/browser/editor-runtime/delivery/index.js +95 -0
- package/dist/browser/editor-runtime/delivery/index.js.map +1 -0
- package/dist/controller/defaults.d.ts +5 -0
- package/dist/controller/index.js +6 -1
- package/dist/controller/index.js.map +1 -1
- package/dist/delivery/index.js +375 -206
- package/dist/delivery/index.js.map +1 -1
- package/dist/index.iife.js +6 -6
- package/package.json +20 -4
- package/dist/browser/VennClassification-BgmjHIWB.js.map +0 -1
package/dist/author/index.js
CHANGED
|
@@ -1,72 +1,16 @@
|
|
|
1
|
-
//#region
|
|
2
|
-
var _e;
|
|
3
|
-
var _e2;
|
|
4
|
-
var _e3;
|
|
5
|
-
var _e4;
|
|
6
|
-
var _e5;
|
|
7
|
-
var e$3 = (_e = class e extends CustomEvent {
|
|
8
|
-
constructor(t, n = !1) {
|
|
9
|
-
super(e.TYPE, {
|
|
10
|
-
bubbles: !0,
|
|
11
|
-
detail: {
|
|
12
|
-
update: t,
|
|
13
|
-
reset: n
|
|
14
|
-
}
|
|
15
|
-
}), this.update = t, this.reset = n;
|
|
16
|
-
}
|
|
17
|
-
}, _e.TYPE = "model.updated", _e);
|
|
18
|
-
_e2 = class e extends CustomEvent {
|
|
19
|
-
constructor(t, n) {
|
|
20
|
-
super(e.TYPE, {
|
|
21
|
-
bubbles: !0,
|
|
22
|
-
detail: {
|
|
23
|
-
src: t,
|
|
24
|
-
done: n
|
|
25
|
-
}
|
|
26
|
-
}), this.src = t, this.done = n;
|
|
27
|
-
}
|
|
28
|
-
}, _e2.TYPE = "delete.image";
|
|
29
|
-
_e3 = class e extends CustomEvent {
|
|
30
|
-
constructor(t) {
|
|
31
|
-
super(e.TYPE, {
|
|
32
|
-
bubbles: !0,
|
|
33
|
-
detail: t
|
|
34
|
-
}), this.handler = t;
|
|
35
|
-
}
|
|
36
|
-
}, _e3.TYPE = "insert.image";
|
|
37
|
-
_e4 = class e extends CustomEvent {
|
|
38
|
-
constructor(t, n) {
|
|
39
|
-
super(e.TYPE, {
|
|
40
|
-
bubbles: !0,
|
|
41
|
-
detail: {
|
|
42
|
-
src: t,
|
|
43
|
-
done: n
|
|
44
|
-
}
|
|
45
|
-
}), this.src = t, this.done = n;
|
|
46
|
-
}
|
|
47
|
-
}, _e4.TYPE = "delete.sound";
|
|
48
|
-
_e5 = class e extends CustomEvent {
|
|
49
|
-
constructor(t) {
|
|
50
|
-
super(e.TYPE, {
|
|
51
|
-
bubbles: !0,
|
|
52
|
-
detail: t
|
|
53
|
-
}), this.handler = t;
|
|
54
|
-
}
|
|
55
|
-
}, _e5.TYPE = "insert.sound";
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/disclose-version.js
|
|
1
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/disclose-version.js
|
|
58
2
|
if (typeof window !== "undefined") {
|
|
59
3
|
var _window$__svelte, _window;
|
|
60
4
|
((_window$__svelte = (_window = window).__svelte ?? (_window.__svelte = {})).v ?? (_window$__svelte.v = /* @__PURE__ */ new Set())).add("5");
|
|
61
5
|
}
|
|
62
6
|
//#endregion
|
|
63
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
7
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/constants.js
|
|
64
8
|
var HYDRATION_ERROR = {};
|
|
65
9
|
var UNINITIALIZED = Symbol("uninitialized");
|
|
66
10
|
var NAMESPACE_SVG = "http://www.w3.org/2000/svg";
|
|
67
11
|
var NAMESPACE_MATHML = "http://www.w3.org/1998/Math/MathML";
|
|
68
12
|
//#endregion
|
|
69
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
13
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/shared/utils.js
|
|
70
14
|
var is_array = Array.isArray;
|
|
71
15
|
var index_of = Array.prototype.indexOf;
|
|
72
16
|
var includes = Array.prototype.includes;
|
|
@@ -177,13 +121,6 @@ var EFFECT_TRANSPARENT = 65536;
|
|
|
177
121
|
var EFFECT_PRESERVED = 1 << 19;
|
|
178
122
|
var USER_EFFECT = 1 << 20;
|
|
179
123
|
var EFFECT_OFFSCREEN = 1 << 25;
|
|
180
|
-
/**
|
|
181
|
-
* Tells that we marked this derived and its reactions as visited during the "mark as (maybe) dirty"-phase.
|
|
182
|
-
* Will be lifted during execution of the derived and during checking its dirty state (both are necessary
|
|
183
|
-
* because a derived might be checked but not executed). This is a pure performance optimization flag and
|
|
184
|
-
* should not be used for any other purpose!
|
|
185
|
-
*/
|
|
186
|
-
var WAS_MARKED = 65536;
|
|
187
124
|
var REACTION_IS_UPDATING = 1 << 21;
|
|
188
125
|
var ASYNC = 1 << 22;
|
|
189
126
|
var ERROR_VALUE = 1 << 23;
|
|
@@ -226,7 +163,7 @@ function svelte_boundary_reset_noop() {
|
|
|
226
163
|
console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
|
|
227
164
|
}
|
|
228
165
|
//#endregion
|
|
229
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
166
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/hydration.js
|
|
230
167
|
/** @import { TemplateNode } from '#client' */
|
|
231
168
|
/**
|
|
232
169
|
* Use this variable to guard everything related to hydration code so it can be treeshaken out
|
|
@@ -305,7 +242,7 @@ function read_hydration_instruction(node) {
|
|
|
305
242
|
return node.data;
|
|
306
243
|
}
|
|
307
244
|
//#endregion
|
|
308
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
245
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/reactivity/equality.js
|
|
309
246
|
/** @import { Equals } from '#client' */
|
|
310
247
|
/** @type {Equals} */
|
|
311
248
|
function equals(value) {
|
|
@@ -332,7 +269,7 @@ function lifecycle_outside_component(name) {
|
|
|
332
269
|
throw new Error(`https://svelte.dev/e/lifecycle_outside_component`);
|
|
333
270
|
}
|
|
334
271
|
//#endregion
|
|
335
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
272
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/errors.js
|
|
336
273
|
/**
|
|
337
274
|
* Cannot create a `$derived(...)` with an `await` expression outside of an effect tree
|
|
338
275
|
* @returns {never}
|
|
@@ -424,13 +361,13 @@ function svelte_boundary_reset_onerror() {
|
|
|
424
361
|
throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
|
|
425
362
|
}
|
|
426
363
|
//#endregion
|
|
427
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
364
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/flags/index.js
|
|
428
365
|
/** True if experimental.async=true */
|
|
429
366
|
var async_mode_flag = false;
|
|
430
367
|
/** True if we're not certain that we only have Svelte 5 code in the compilation */
|
|
431
368
|
var legacy_mode_flag = false;
|
|
432
369
|
//#endregion
|
|
433
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
370
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/context.js
|
|
434
371
|
/** @import { ComponentContext, DevStackEntry, Effect } from '#client' */
|
|
435
372
|
/** @type {ComponentContext | null} */
|
|
436
373
|
var component_context = null;
|
|
@@ -490,7 +427,7 @@ function is_runes() {
|
|
|
490
427
|
return !legacy_mode_flag || component_context !== null && component_context.l === null;
|
|
491
428
|
}
|
|
492
429
|
//#endregion
|
|
493
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
430
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/task.js
|
|
494
431
|
/** @type {Array<() => void>} */
|
|
495
432
|
var micro_tasks = [];
|
|
496
433
|
function run_micro_tasks() {
|
|
@@ -517,7 +454,7 @@ function flush_tasks() {
|
|
|
517
454
|
while (micro_tasks.length > 0) run_micro_tasks();
|
|
518
455
|
}
|
|
519
456
|
//#endregion
|
|
520
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
457
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/reactivity/status.js
|
|
521
458
|
/** @import { Derived, Signal } from '#client' */
|
|
522
459
|
var STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);
|
|
523
460
|
/**
|
|
@@ -536,22 +473,8 @@ function update_derived_status(derived) {
|
|
|
536
473
|
else set_signal_status(derived, MAYBE_DIRTY);
|
|
537
474
|
}
|
|
538
475
|
//#endregion
|
|
539
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
540
|
-
/** @import {
|
|
541
|
-
/**
|
|
542
|
-
* @param {Value[] | null} deps
|
|
543
|
-
*/
|
|
544
|
-
function clear_marked(deps) {
|
|
545
|
-
if (deps === null) return;
|
|
546
|
-
for (const dep of deps) {
|
|
547
|
-
if ((dep.f & 2) === 0 || (dep.f & 65536) === 0) continue;
|
|
548
|
-
dep.f ^= WAS_MARKED;
|
|
549
|
-
clear_marked(
|
|
550
|
-
/** @type {Derived} */
|
|
551
|
-
dep.deps
|
|
552
|
-
);
|
|
553
|
-
}
|
|
554
|
-
}
|
|
476
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/reactivity/utils.js
|
|
477
|
+
/** @import { Effect } from '#client' */
|
|
555
478
|
/**
|
|
556
479
|
* @param {Effect} effect
|
|
557
480
|
* @param {Set<Effect>} dirty_effects
|
|
@@ -560,41 +483,10 @@ function clear_marked(deps) {
|
|
|
560
483
|
function defer_effect(effect, dirty_effects, maybe_dirty_effects) {
|
|
561
484
|
if ((effect.f & 2048) !== 0) dirty_effects.add(effect);
|
|
562
485
|
else if ((effect.f & 4096) !== 0) maybe_dirty_effects.add(effect);
|
|
563
|
-
clear_marked(effect.deps);
|
|
564
486
|
set_signal_status(effect, CLEAN);
|
|
565
487
|
}
|
|
566
488
|
//#endregion
|
|
567
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
568
|
-
/**
|
|
569
|
-
* We set this to `true` when updating a store so that we correctly
|
|
570
|
-
* schedule effects if the update takes place inside a `$:` effect
|
|
571
|
-
*/
|
|
572
|
-
var legacy_is_updating_store = false;
|
|
573
|
-
/**
|
|
574
|
-
* Whether or not the prop currently being read is a store binding, as in
|
|
575
|
-
* `<Child bind:x={$y} />`. If it is, we treat the prop as mutable even in
|
|
576
|
-
* runes mode, and skip `binding_property_non_reactive` validation
|
|
577
|
-
*/
|
|
578
|
-
var is_store_binding = false;
|
|
579
|
-
/**
|
|
580
|
-
* Returns a tuple that indicates whether `fn()` reads a prop that is a store binding.
|
|
581
|
-
* Used to prevent `binding_property_non_reactive` validation false positives and
|
|
582
|
-
* ensure that these props are treated as mutable even in runes mode
|
|
583
|
-
* @template T
|
|
584
|
-
* @param {() => T} fn
|
|
585
|
-
* @returns {[T, boolean]}
|
|
586
|
-
*/
|
|
587
|
-
function capture_store_binding(fn) {
|
|
588
|
-
var previous_is_store_binding = is_store_binding;
|
|
589
|
-
try {
|
|
590
|
-
is_store_binding = false;
|
|
591
|
-
return [fn(), is_store_binding];
|
|
592
|
-
} finally {
|
|
593
|
-
is_store_binding = previous_is_store_binding;
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
//#endregion
|
|
597
|
-
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/misc.js
|
|
489
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/elements/misc.js
|
|
598
490
|
var listening_to_form_reset = false;
|
|
599
491
|
function add_form_reset_listener() {
|
|
600
492
|
if (!listening_to_form_reset) {
|
|
@@ -608,7 +500,7 @@ function add_form_reset_listener() {
|
|
|
608
500
|
}
|
|
609
501
|
}
|
|
610
502
|
//#endregion
|
|
611
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
503
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js
|
|
612
504
|
/**
|
|
613
505
|
* @template T
|
|
614
506
|
* @param {() => T} fn
|
|
@@ -626,7 +518,7 @@ function without_reactive_context(fn) {
|
|
|
626
518
|
}
|
|
627
519
|
}
|
|
628
520
|
//#endregion
|
|
629
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
521
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/reactivity/async.js
|
|
630
522
|
/** @import { Blocker, Effect, Source, Value } from '#client' */
|
|
631
523
|
/**
|
|
632
524
|
* @param {Blocker[]} blockers
|
|
@@ -859,7 +751,6 @@ function execute_derived(derived) {
|
|
|
859
751
|
}
|
|
860
752
|
set_active_effect(parent);
|
|
861
753
|
try {
|
|
862
|
-
derived.f &= ~WAS_MARKED;
|
|
863
754
|
destroy_derived_effects(derived);
|
|
864
755
|
value = update_reaction(derived);
|
|
865
756
|
} finally {
|
|
@@ -946,7 +837,7 @@ function _classPrivateFieldGet2(s, a) {
|
|
|
946
837
|
return s.get(_assertClassBrand(s, a));
|
|
947
838
|
}
|
|
948
839
|
//#endregion
|
|
949
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
840
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/reactivity/batch.js
|
|
950
841
|
/** @import { Fork } from 'svelte' */
|
|
951
842
|
/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
|
|
952
843
|
var _Batch;
|
|
@@ -997,7 +888,7 @@ var _discard_callbacks = /* @__PURE__ */ new WeakMap();
|
|
|
997
888
|
var _pending = /* @__PURE__ */ new WeakMap();
|
|
998
889
|
var _blocking_pending = /* @__PURE__ */ new WeakMap();
|
|
999
890
|
var _deferred = /* @__PURE__ */ new WeakMap();
|
|
1000
|
-
var
|
|
891
|
+
var _scheduled = /* @__PURE__ */ new WeakMap();
|
|
1001
892
|
var _new_effects = /* @__PURE__ */ new WeakMap();
|
|
1002
893
|
var _dirty_effects$1 = /* @__PURE__ */ new WeakMap();
|
|
1003
894
|
var _maybe_dirty_effects$1 = /* @__PURE__ */ new WeakMap();
|
|
@@ -1045,7 +936,7 @@ var Batch = class Batch {
|
|
|
1045
936
|
_classPrivateFieldInitSpec(this, _pending, 0);
|
|
1046
937
|
_classPrivateFieldInitSpec(this, _blocking_pending, /* @__PURE__ */ new Map());
|
|
1047
938
|
_classPrivateFieldInitSpec(this, _deferred, null);
|
|
1048
|
-
_classPrivateFieldInitSpec(this,
|
|
939
|
+
_classPrivateFieldInitSpec(this, _scheduled, []);
|
|
1049
940
|
_classPrivateFieldInitSpec(this, _new_effects, []);
|
|
1050
941
|
_classPrivateFieldInitSpec(this, _dirty_effects$1, /* @__PURE__ */ new Set());
|
|
1051
942
|
_classPrivateFieldInitSpec(this, _maybe_dirty_effects$1, /* @__PURE__ */ new Set());
|
|
@@ -1234,20 +1125,7 @@ var Batch = class Batch {
|
|
|
1234
1125
|
effect.b.defer_effect(effect);
|
|
1235
1126
|
return;
|
|
1236
1127
|
}
|
|
1237
|
-
|
|
1238
|
-
while (e.parent !== null) {
|
|
1239
|
-
e = e.parent;
|
|
1240
|
-
var flags = e.f;
|
|
1241
|
-
if (collected_effects !== null && e === active_effect) {
|
|
1242
|
-
if (async_mode_flag) return;
|
|
1243
|
-
if ((active_reaction === null || (active_reaction.f & 2) === 0) && !legacy_is_updating_store) return;
|
|
1244
|
-
}
|
|
1245
|
-
if ((flags & 96) !== 0) {
|
|
1246
|
-
if ((flags & 1024) === 0) return;
|
|
1247
|
-
e.f ^= CLEAN;
|
|
1248
|
-
}
|
|
1249
|
-
}
|
|
1250
|
-
_classPrivateFieldGet2(_roots, this).push(e);
|
|
1128
|
+
_classPrivateFieldGet2(_scheduled, this).push(effect);
|
|
1251
1129
|
}
|
|
1252
1130
|
};
|
|
1253
1131
|
_Batch = Batch;
|
|
@@ -1267,12 +1145,40 @@ function _is_deferred() {
|
|
|
1267
1145
|
}
|
|
1268
1146
|
return false;
|
|
1269
1147
|
}
|
|
1148
|
+
/**
|
|
1149
|
+
* Convert the effects that were scheduled in this batch into the root effects
|
|
1150
|
+
* that need to be traversed, marking the path to each effect (by clearing the
|
|
1151
|
+
* `CLEAN` flag on ancestor branches) so that the traversal can find them.
|
|
1152
|
+
* This happens right before traversal rather than at scheduling time, so that
|
|
1153
|
+
* the markers left on the (shared) effect tree are created and consumed within
|
|
1154
|
+
* a single traversal — scheduling into other batches can never observe them
|
|
1155
|
+
* @returns {Effect[]}
|
|
1156
|
+
*/
|
|
1157
|
+
function _resolve$1() {
|
|
1158
|
+
/** @type {Effect[]} */
|
|
1159
|
+
var roots = [];
|
|
1160
|
+
for (const effect of _classPrivateFieldGet2(_scheduled, this)) {
|
|
1161
|
+
if ((effect.f & 16384) !== 0 || (effect.f & 6144) === 0) continue;
|
|
1162
|
+
var e = effect;
|
|
1163
|
+
var covered = false;
|
|
1164
|
+
while (e.parent !== null) {
|
|
1165
|
+
e = e.parent;
|
|
1166
|
+
var flags = e.f;
|
|
1167
|
+
if ((flags & 96) !== 0) {
|
|
1168
|
+
if ((flags & 1024) === 0) {
|
|
1169
|
+
covered = true;
|
|
1170
|
+
break;
|
|
1171
|
+
}
|
|
1172
|
+
e.f ^= CLEAN;
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
if (!covered) roots.push(e);
|
|
1176
|
+
}
|
|
1177
|
+
_classPrivateFieldSet2(_scheduled, this, []);
|
|
1178
|
+
return roots;
|
|
1179
|
+
}
|
|
1270
1180
|
function _process() {
|
|
1271
1181
|
_classPrivateFieldSet2(_started, this, true);
|
|
1272
|
-
if (flush_count++ > 1e3) {
|
|
1273
|
-
_assertClassBrand(_Batch_brand, this, _unlink).call(this);
|
|
1274
|
-
infinite_loop_guard();
|
|
1275
|
-
}
|
|
1276
1182
|
for (const e of _classPrivateFieldGet2(_dirty_effects$1, this)) {
|
|
1277
1183
|
_classPrivateFieldGet2(_maybe_dirty_effects$1, this).delete(e);
|
|
1278
1184
|
set_signal_status(e, DIRTY);
|
|
@@ -1282,8 +1188,6 @@ function _process() {
|
|
|
1282
1188
|
set_signal_status(e, MAYBE_DIRTY);
|
|
1283
1189
|
this.schedule(e);
|
|
1284
1190
|
}
|
|
1285
|
-
const roots = _classPrivateFieldGet2(_roots, this);
|
|
1286
|
-
_classPrivateFieldSet2(_roots, this, []);
|
|
1287
1191
|
this.apply();
|
|
1288
1192
|
/** @type {Effect[]} */
|
|
1289
1193
|
var effects = collected_effects = [];
|
|
@@ -1294,12 +1198,18 @@ function _process() {
|
|
|
1294
1198
|
* @deprecated when we get rid of legacy mode and stores, we can get rid of this
|
|
1295
1199
|
*/
|
|
1296
1200
|
var updates = legacy_updates = [];
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1201
|
+
while (_classPrivateFieldGet2(_scheduled, this).length > 0) {
|
|
1202
|
+
if (flush_count++ > 1e3) {
|
|
1203
|
+
_assertClassBrand(_Batch_brand, this, _unlink).call(this);
|
|
1204
|
+
infinite_loop_guard();
|
|
1205
|
+
}
|
|
1206
|
+
for (const root of _assertClassBrand(_Batch_brand, this, _resolve$1).call(this)) try {
|
|
1207
|
+
_assertClassBrand(_Batch_brand, this, _traverse).call(this, root, effects, render_effects);
|
|
1208
|
+
} catch (e) {
|
|
1209
|
+
reset_all(root);
|
|
1210
|
+
if (!_assertClassBrand(_Batch_brand, this, _is_deferred).call(this)) this.discard();
|
|
1211
|
+
throw e;
|
|
1212
|
+
}
|
|
1303
1213
|
}
|
|
1304
1214
|
current_batch = null;
|
|
1305
1215
|
if (updates.length > 0) {
|
|
@@ -1333,16 +1243,16 @@ function _process() {
|
|
|
1333
1243
|
previous_batch = null;
|
|
1334
1244
|
_classPrivateFieldGet2(_deferred, this)?.resolve();
|
|
1335
1245
|
var next_batch = current_batch;
|
|
1336
|
-
if (_classPrivateFieldGet2(_pending, this) === 0 && (_classPrivateFieldGet2(
|
|
1246
|
+
if (_classPrivateFieldGet2(_pending, this) === 0 && (_classPrivateFieldGet2(_scheduled, this).length === 0 || next_batch !== null)) {
|
|
1337
1247
|
_assertClassBrand(_Batch_brand, this, _unlink).call(this);
|
|
1338
1248
|
if (async_mode_flag) {
|
|
1339
1249
|
_assertClassBrand(_Batch_brand, this, _commit$1).call(this);
|
|
1340
1250
|
current_batch = next_batch;
|
|
1341
1251
|
}
|
|
1342
1252
|
}
|
|
1343
|
-
if (_classPrivateFieldGet2(
|
|
1344
|
-
const
|
|
1345
|
-
|
|
1253
|
+
if (_classPrivateFieldGet2(_scheduled, this).length > 0) if (next_batch !== null) {
|
|
1254
|
+
for (const e of _classPrivateFieldGet2(_scheduled, this)) _classPrivateFieldGet2(_scheduled, next_batch).push(e);
|
|
1255
|
+
_classPrivateFieldSet2(_scheduled, this, []);
|
|
1346
1256
|
} else next_batch = this;
|
|
1347
1257
|
if (next_batch !== null) {
|
|
1348
1258
|
old_values.clear();
|
|
@@ -1492,10 +1402,9 @@ function _commit$1() {
|
|
|
1492
1402
|
batch.schedule(effect);
|
|
1493
1403
|
} else _classPrivateFieldGet2(_dirty_effects$1, batch).add(effect);
|
|
1494
1404
|
}
|
|
1495
|
-
if (_classPrivateFieldGet2(
|
|
1405
|
+
if (_classPrivateFieldGet2(_scheduled, batch).length > 0 && !_classPrivateFieldGet2(_decrement_queued, batch)) {
|
|
1496
1406
|
batch.apply();
|
|
1497
|
-
for (var root of
|
|
1498
|
-
_classPrivateFieldSet2(_roots, batch, []);
|
|
1407
|
+
for (var root of _assertClassBrand(_Batch_brand, batch, _resolve$1).call(batch)) _assertClassBrand(_Batch_brand, batch, _traverse).call(batch, root, [], []);
|
|
1499
1408
|
}
|
|
1500
1409
|
batch.deactivate();
|
|
1501
1410
|
}
|
|
@@ -1662,7 +1571,7 @@ function reset_all(effect) {
|
|
|
1662
1571
|
}
|
|
1663
1572
|
}
|
|
1664
1573
|
//#endregion
|
|
1665
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
1574
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/reactivity/sources.js
|
|
1666
1575
|
/** @import { Derived, Effect, Source, Value } from '#client' */
|
|
1667
1576
|
/** @type {Set<Effect>} */
|
|
1668
1577
|
var eager_effects = /* @__PURE__ */ new Set();
|
|
@@ -1724,6 +1633,16 @@ function set(source, value, should_proxy = false) {
|
|
|
1724
1633
|
return internal_set(source, should_proxy ? proxy(value) : value, legacy_updates);
|
|
1725
1634
|
}
|
|
1726
1635
|
/**
|
|
1636
|
+
* A set of signals we have already seen while traversing in mark_reactions.
|
|
1637
|
+
* Not always set to balance the common case of sources only having a couple
|
|
1638
|
+
* of (transitive) dependencies (where always creating a Set would be bad for perf)
|
|
1639
|
+
* with the edge case of extremely deep or wide dependency arrays with cycles.
|
|
1640
|
+
* @type {Set<any> | null}
|
|
1641
|
+
*/
|
|
1642
|
+
var seen = null;
|
|
1643
|
+
/** Number of transitive dependencies, see {@link seen} for more info */
|
|
1644
|
+
var count_deps = 0;
|
|
1645
|
+
/**
|
|
1727
1646
|
* @template V
|
|
1728
1647
|
* @param {Source<V>} source
|
|
1729
1648
|
* @param {V} value
|
|
@@ -1742,7 +1661,10 @@ function internal_set(source, value, updated_during_traversal = null) {
|
|
|
1742
1661
|
if (batch_values === null) update_derived_status(derived);
|
|
1743
1662
|
}
|
|
1744
1663
|
source.wv = increment_write_version();
|
|
1664
|
+
seen = null;
|
|
1665
|
+
count_deps = 0;
|
|
1745
1666
|
mark_reactions(source, DIRTY, updated_during_traversal);
|
|
1667
|
+
seen = null;
|
|
1746
1668
|
if (is_runes() && active_effect !== null && (active_effect.f & 1024) !== 0 && (active_effect.f & 96) === 0) if (untracked_writes === null) set_untracked_writes([source]);
|
|
1747
1669
|
else untracked_writes.push(source);
|
|
1748
1670
|
if (!batch.is_fork && eager_effects.size > 0 && !eager_effects_deferred) flush_eager_effects();
|
|
@@ -1781,6 +1703,12 @@ function mark_reactions(signal, status, updated_during_traversal) {
|
|
|
1781
1703
|
if (reactions === null) return;
|
|
1782
1704
|
var runes = is_runes();
|
|
1783
1705
|
var length = reactions.length;
|
|
1706
|
+
count_deps += length;
|
|
1707
|
+
if (count_deps > 1e5 && seen === null) seen = /* @__PURE__ */ new Set();
|
|
1708
|
+
if (seen !== null) {
|
|
1709
|
+
if (seen.has(signal)) return;
|
|
1710
|
+
seen.add(signal);
|
|
1711
|
+
}
|
|
1784
1712
|
for (var i = 0; i < length; i++) {
|
|
1785
1713
|
var reaction = reactions[i];
|
|
1786
1714
|
var flags = reaction.f;
|
|
@@ -1791,10 +1719,7 @@ function mark_reactions(signal, status, updated_during_traversal) {
|
|
|
1791
1719
|
else if ((flags & 2) !== 0) {
|
|
1792
1720
|
var derived = reaction;
|
|
1793
1721
|
batch_values?.delete(derived);
|
|
1794
|
-
|
|
1795
|
-
if (flags & 512 && (active_effect === null || (active_effect.f & 2097152) === 0)) reaction.f |= WAS_MARKED;
|
|
1796
|
-
mark_reactions(derived, MAYBE_DIRTY, updated_during_traversal);
|
|
1797
|
-
}
|
|
1722
|
+
mark_reactions(derived, MAYBE_DIRTY, updated_during_traversal);
|
|
1798
1723
|
} else if (not_dirty) {
|
|
1799
1724
|
var effect = reaction;
|
|
1800
1725
|
if ((flags & 16) !== 0 && eager_block_effects !== null) eager_block_effects.add(effect);
|
|
@@ -1882,14 +1807,14 @@ function proxy(value) {
|
|
|
1882
1807
|
return Reflect.get(target, prop, receiver);
|
|
1883
1808
|
},
|
|
1884
1809
|
getOwnPropertyDescriptor(target, prop) {
|
|
1810
|
+
this.has?.(target, prop);
|
|
1885
1811
|
var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
if (source !== void 0 && value !== UNINITIALIZED) return {
|
|
1812
|
+
var s = sources.get(prop);
|
|
1813
|
+
if (s !== void 0) {
|
|
1814
|
+
var value = get$1(s);
|
|
1815
|
+
if (value === UNINITIALIZED) return;
|
|
1816
|
+
if (descriptor && "value" in descriptor) descriptor.value = value;
|
|
1817
|
+
else return {
|
|
1893
1818
|
enumerable: true,
|
|
1894
1819
|
configurable: true,
|
|
1895
1820
|
value,
|
|
@@ -1962,7 +1887,7 @@ function proxy(value) {
|
|
|
1962
1887
|
});
|
|
1963
1888
|
}
|
|
1964
1889
|
//#endregion
|
|
1965
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
1890
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/operations.js
|
|
1966
1891
|
/** @import { Effect, TemplateNode } from '#client' */
|
|
1967
1892
|
/** @type {Window} */
|
|
1968
1893
|
var $window;
|
|
@@ -2187,7 +2112,7 @@ function invoke_error_boundary(error, effect) {
|
|
|
2187
2112
|
throw error;
|
|
2188
2113
|
}
|
|
2189
2114
|
//#endregion
|
|
2190
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
2115
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/reactivity/effects.js
|
|
2191
2116
|
/** @import { Blocker, ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */
|
|
2192
2117
|
/**
|
|
2193
2118
|
* @param {'$effect' | '$effect.pre' | '$inspect'} rune
|
|
@@ -2587,14 +2512,14 @@ function move_effect(effect, fragment) {
|
|
|
2587
2512
|
}
|
|
2588
2513
|
}
|
|
2589
2514
|
//#endregion
|
|
2590
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
2515
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/legacy.js
|
|
2591
2516
|
/**
|
|
2592
2517
|
* @type {Set<Value> | null}
|
|
2593
2518
|
* @deprecated
|
|
2594
2519
|
*/
|
|
2595
2520
|
var captured_signals = null;
|
|
2596
2521
|
//#endregion
|
|
2597
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
2522
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/runtime.js
|
|
2598
2523
|
/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
|
|
2599
2524
|
/**
|
|
2600
2525
|
* True if updating in an effect context that is reactive (i.e. not branch/root effects)
|
|
@@ -2626,7 +2551,7 @@ function set_active_effect(effect) {
|
|
|
2626
2551
|
var current_sources = null;
|
|
2627
2552
|
/** @param {Value} value */
|
|
2628
2553
|
function push_reaction_value(value) {
|
|
2629
|
-
if (active_reaction !== null && (!async_mode_flag || (active_reaction.f & 2) !== 0)) (current_sources ?? (current_sources = /* @__PURE__ */ new Set())).add(value);
|
|
2554
|
+
if (active_reaction !== null && (!async_mode_flag && (active_reaction.f & 2097152) !== 0 || (active_reaction.f & 2) !== 0)) (current_sources ?? (current_sources = /* @__PURE__ */ new Set())).add(value);
|
|
2630
2555
|
}
|
|
2631
2556
|
/**
|
|
2632
2557
|
* The dependencies of the reaction that is currently being executed. In many cases,
|
|
@@ -2670,7 +2595,6 @@ function increment_write_version() {
|
|
|
2670
2595
|
function is_dirty(reaction) {
|
|
2671
2596
|
var flags = reaction.f;
|
|
2672
2597
|
if ((flags & 2048) !== 0) return true;
|
|
2673
|
-
if (flags & 2) reaction.f &= ~WAS_MARKED;
|
|
2674
2598
|
if ((flags & 4096) !== 0) {
|
|
2675
2599
|
var dependencies = reaction.deps;
|
|
2676
2600
|
var length = dependencies.length;
|
|
@@ -2802,10 +2726,7 @@ function remove_reaction(signal, dependency) {
|
|
|
2802
2726
|
}
|
|
2803
2727
|
if (reactions === null && (dependency.f & 2) !== 0 && (new_deps === null || !includes.call(new_deps, dependency))) {
|
|
2804
2728
|
var derived = dependency;
|
|
2805
|
-
if ((derived.f & 512) !== 0)
|
|
2806
|
-
derived.f ^= 512;
|
|
2807
|
-
derived.f &= ~WAS_MARKED;
|
|
2808
|
-
}
|
|
2729
|
+
if ((derived.f & 512) !== 0) derived.f ^= 512;
|
|
2809
2730
|
if (derived.v !== UNINITIALIZED) update_derived_status(derived);
|
|
2810
2731
|
if (derived.ac !== null) without_reactive_context(() => {
|
|
2811
2732
|
/** @type {AbortController} */ derived.ac.abort(STALE_REACTION);
|
|
@@ -2966,7 +2887,7 @@ function untrack(fn) {
|
|
|
2966
2887
|
}
|
|
2967
2888
|
}
|
|
2968
2889
|
//#endregion
|
|
2969
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
2890
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/elements/events.js
|
|
2970
2891
|
/**
|
|
2971
2892
|
* Used on elements, as a map of event type -> event handler,
|
|
2972
2893
|
* and on events themselves to track which element handled an event
|
|
@@ -2992,10 +2913,12 @@ function create_event(event_name, dom, handler, options = {}) {
|
|
|
2992
2913
|
return handler?.call(this, event);
|
|
2993
2914
|
});
|
|
2994
2915
|
}
|
|
2995
|
-
if (event_name.startsWith("pointer") || event_name.startsWith("touch") || event_name === "wheel")
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2916
|
+
if (event_name.startsWith("pointer") || event_name.startsWith("touch") || event_name === "wheel") {
|
|
2917
|
+
target_handler.__removed = false;
|
|
2918
|
+
queue_micro_task(() => {
|
|
2919
|
+
if (!target_handler.__removed) dom.addEventListener(event_name, target_handler, options);
|
|
2920
|
+
});
|
|
2921
|
+
} else dom.addEventListener(event_name, target_handler, options);
|
|
2999
2922
|
return target_handler;
|
|
3000
2923
|
}
|
|
3001
2924
|
/**
|
|
@@ -3013,6 +2936,7 @@ function event(event_name, dom, handler, capture, passive) {
|
|
|
3013
2936
|
};
|
|
3014
2937
|
var target_handler = create_event(event_name, dom, handler, options);
|
|
3015
2938
|
if (dom === document.body || dom === window || dom === document || dom instanceof HTMLMediaElement) teardown(() => {
|
|
2939
|
+
target_handler.__removed = true;
|
|
3016
2940
|
dom.removeEventListener(event_name, target_handler, options);
|
|
3017
2941
|
});
|
|
3018
2942
|
}
|
|
@@ -3114,7 +3038,7 @@ function handle_event_propagation(event) {
|
|
|
3114
3038
|
}
|
|
3115
3039
|
}
|
|
3116
3040
|
//#endregion
|
|
3117
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
3041
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/reconciler.js
|
|
3118
3042
|
var policy = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", {
|
|
3119
3043
|
/** @param {string} html */
|
|
3120
3044
|
createHTML: (html) => {
|
|
@@ -3133,7 +3057,7 @@ function create_fragment_from_html(html) {
|
|
|
3133
3057
|
return elem.content;
|
|
3134
3058
|
}
|
|
3135
3059
|
//#endregion
|
|
3136
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
3060
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/template.js
|
|
3137
3061
|
/** @import { Effect, EffectNodes, TemplateNode } from '#client' */
|
|
3138
3062
|
/** @import { TemplateStructure } from './types' */
|
|
3139
3063
|
/**
|
|
@@ -3278,7 +3202,7 @@ function is_passive_event(name) {
|
|
|
3278
3202
|
return PASSIVE_EVENTS.includes(name);
|
|
3279
3203
|
}
|
|
3280
3204
|
//#endregion
|
|
3281
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
3205
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/reactivity/create-subscriber.js
|
|
3282
3206
|
/**
|
|
3283
3207
|
* Returns a `subscribe` function that integrates external event-based systems with Svelte's reactivity.
|
|
3284
3208
|
* It's particularly useful for integrating with web APIs like `MediaQuery`, `IntersectionObserver`, or `WebSocket`.
|
|
@@ -3351,7 +3275,7 @@ function createSubscriber(start) {
|
|
|
3351
3275
|
};
|
|
3352
3276
|
}
|
|
3353
3277
|
//#endregion
|
|
3354
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
3278
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/blocks/boundary.js
|
|
3355
3279
|
/** @import { Effect, Source, TemplateNode, } from '#client' */
|
|
3356
3280
|
/**
|
|
3357
3281
|
* @typedef {{
|
|
@@ -3921,7 +3845,7 @@ function unmount(component, options) {
|
|
|
3921
3845
|
return Promise.resolve();
|
|
3922
3846
|
}
|
|
3923
3847
|
//#endregion
|
|
3924
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
3848
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/blocks/branches.js
|
|
3925
3849
|
/** @import { Effect, TemplateNode } from '#client' */
|
|
3926
3850
|
var _batches = /* @__PURE__ */ new WeakMap();
|
|
3927
3851
|
var _onscreen = /* @__PURE__ */ new WeakMap();
|
|
@@ -4044,7 +3968,7 @@ var BranchManager = class {
|
|
|
4044
3968
|
}
|
|
4045
3969
|
};
|
|
4046
3970
|
//#endregion
|
|
4047
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
3971
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/blocks/snippet.js
|
|
4048
3972
|
/** @import { Snippet } from 'svelte' */
|
|
4049
3973
|
/** @import { TemplateNode } from '#client' */
|
|
4050
3974
|
/** @import { Getters } from '#shared' */
|
|
@@ -4110,7 +4034,7 @@ function init_update_callbacks(context) {
|
|
|
4110
4034
|
});
|
|
4111
4035
|
}
|
|
4112
4036
|
//#endregion
|
|
4113
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
4037
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/blocks/if.js
|
|
4114
4038
|
/** @import { TemplateNode } from '#client' */
|
|
4115
4039
|
/**
|
|
4116
4040
|
* @param {TemplateNode} node
|
|
@@ -4156,7 +4080,7 @@ function if_block(node, fn, elseif = false) {
|
|
|
4156
4080
|
}, flags);
|
|
4157
4081
|
}
|
|
4158
4082
|
//#endregion
|
|
4159
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
4083
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/blocks/each.js
|
|
4160
4084
|
/** @import { EachItem, EachOutroGroup, EachState, Effect, EffectNodes, MaybeSource, Source, TemplateNode, TransitionManager, Value } from '#client' */
|
|
4161
4085
|
/** @import { Batch } from '../../reactivity/batch.js'; */
|
|
4162
4086
|
/**
|
|
@@ -4628,7 +4552,7 @@ function html(node, get_value, is_controlled = false, svg = false, mathml = fals
|
|
|
4628
4552
|
});
|
|
4629
4553
|
}
|
|
4630
4554
|
//#endregion
|
|
4631
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
4555
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/css.js
|
|
4632
4556
|
/**
|
|
4633
4557
|
* @param {Node} anchor
|
|
4634
4558
|
* @param {{ hash: string, code: string }} css
|
|
@@ -4647,7 +4571,7 @@ function append_styles$1(anchor, css) {
|
|
|
4647
4571
|
});
|
|
4648
4572
|
}
|
|
4649
4573
|
//#endregion
|
|
4650
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
4574
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/shared/attributes.js
|
|
4651
4575
|
var whitespace$1 = [..." \n\r\f\xA0\v"];
|
|
4652
4576
|
/**
|
|
4653
4577
|
* @param {any} value
|
|
@@ -4757,7 +4681,7 @@ function to_style(value, styles) {
|
|
|
4757
4681
|
return value == null ? null : String(value);
|
|
4758
4682
|
}
|
|
4759
4683
|
//#endregion
|
|
4760
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
4684
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/elements/class.js
|
|
4761
4685
|
/**
|
|
4762
4686
|
* @param {Element} dom
|
|
4763
4687
|
* @param {boolean | number} is_html
|
|
@@ -4782,7 +4706,7 @@ function set_class(dom, is_html, value, hash, prev_classes, next_classes) {
|
|
|
4782
4706
|
return next_classes;
|
|
4783
4707
|
}
|
|
4784
4708
|
//#endregion
|
|
4785
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
4709
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/elements/style.js
|
|
4786
4710
|
/**
|
|
4787
4711
|
* @param {Element & ElementCSSInlineStyle} dom
|
|
4788
4712
|
* @param {Record<string, any>} prev
|
|
@@ -4816,7 +4740,7 @@ function set_style(dom, value, prev_styles, next_styles) {
|
|
|
4816
4740
|
return next_styles;
|
|
4817
4741
|
}
|
|
4818
4742
|
//#endregion
|
|
4819
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
4743
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/elements/attributes.js
|
|
4820
4744
|
/** @import { Blocker, Effect } from '#client' */
|
|
4821
4745
|
var IS_CUSTOM_ELEMENT = Symbol("is custom element");
|
|
4822
4746
|
var IS_HTML = Symbol("is html");
|
|
@@ -4917,7 +4841,7 @@ function get_setters(element) {
|
|
|
4917
4841
|
return setters;
|
|
4918
4842
|
}
|
|
4919
4843
|
//#endregion
|
|
4920
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
4844
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/elements/bindings/size.js
|
|
4921
4845
|
var _ResizeObserverSingleton;
|
|
4922
4846
|
var _listeners = /* @__PURE__ */ new WeakMap();
|
|
4923
4847
|
var _observer = /* @__PURE__ */ new WeakMap();
|
|
@@ -4982,7 +4906,7 @@ function bind_element_size(element, type, set) {
|
|
|
4982
4906
|
});
|
|
4983
4907
|
}
|
|
4984
4908
|
//#endregion
|
|
4985
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
4909
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/elements/bindings/this.js
|
|
4986
4910
|
/** @import { ComponentContext, Effect } from '#client' */
|
|
4987
4911
|
/**
|
|
4988
4912
|
* @param {any} bound_value
|
|
@@ -5033,6 +4957,31 @@ function bind_this(element_or_component = mark_as_component(), update, get_value
|
|
|
5033
4957
|
});
|
|
5034
4958
|
return element_or_component;
|
|
5035
4959
|
}
|
|
4960
|
+
//#endregion
|
|
4961
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/reactivity/store.js
|
|
4962
|
+
/**
|
|
4963
|
+
* Whether or not the prop currently being read is a store binding, as in
|
|
4964
|
+
* `<Child bind:x={$y} />`. If it is, we treat the prop as mutable even in
|
|
4965
|
+
* runes mode, and skip `binding_property_non_reactive` validation
|
|
4966
|
+
*/
|
|
4967
|
+
var is_store_binding = false;
|
|
4968
|
+
/**
|
|
4969
|
+
* Returns a tuple that indicates whether `fn()` reads a prop that is a store binding.
|
|
4970
|
+
* Used to prevent `binding_property_non_reactive` validation false positives and
|
|
4971
|
+
* ensure that these props are treated as mutable even in runes mode
|
|
4972
|
+
* @template T
|
|
4973
|
+
* @param {() => T} fn
|
|
4974
|
+
* @returns {[T, boolean]}
|
|
4975
|
+
*/
|
|
4976
|
+
function capture_store_binding(fn) {
|
|
4977
|
+
var previous_is_store_binding = is_store_binding;
|
|
4978
|
+
try {
|
|
4979
|
+
is_store_binding = false;
|
|
4980
|
+
return [fn(), is_store_binding];
|
|
4981
|
+
} finally {
|
|
4982
|
+
is_store_binding = previous_is_store_binding;
|
|
4983
|
+
}
|
|
4984
|
+
}
|
|
5036
4985
|
/**
|
|
5037
4986
|
* This function is responsible for synchronizing a possibly bound prop with the inner component state.
|
|
5038
4987
|
* It is used whenever the compiler sees that the component writes to the prop, or when it has a default prop_value.
|
|
@@ -5124,7 +5073,7 @@ function prop(props, key, flags, fallback) {
|
|
|
5124
5073
|
});
|
|
5125
5074
|
}
|
|
5126
5075
|
//#endregion
|
|
5127
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
5076
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/legacy/legacy-client.js
|
|
5128
5077
|
/** @import { ComponentConstructorOptions, ComponentType, SvelteComponent, Component } from 'svelte' */
|
|
5129
5078
|
/**
|
|
5130
5079
|
* Takes the same options as a Svelte 4 component and the component function and returns a Svelte 4 compatible component.
|
|
@@ -5243,7 +5192,7 @@ var Svelte4Component = class {
|
|
|
5243
5192
|
}
|
|
5244
5193
|
};
|
|
5245
5194
|
//#endregion
|
|
5246
|
-
//#region ../../../node_modules/.bun/svelte@5.57.
|
|
5195
|
+
//#region ../../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/client/dom/elements/custom-element.js
|
|
5247
5196
|
/**
|
|
5248
5197
|
* @typedef {Object} CustomElementPropDefinition
|
|
5249
5198
|
* @property {string} [attribute]
|
|
@@ -5528,6 +5477,177 @@ function create_custom_element(Component, props_definition, slots, exports, shad
|
|
|
5528
5477
|
return Class;
|
|
5529
5478
|
}
|
|
5530
5479
|
//#endregion
|
|
5480
|
+
//#region ../../shared/configure-events/dist/index.js
|
|
5481
|
+
var _e;
|
|
5482
|
+
var _e2;
|
|
5483
|
+
var _e3;
|
|
5484
|
+
var _e4;
|
|
5485
|
+
var _e5;
|
|
5486
|
+
var e$3 = (_e = class e extends CustomEvent {
|
|
5487
|
+
constructor(t, n = !1) {
|
|
5488
|
+
super(e.TYPE, {
|
|
5489
|
+
bubbles: !0,
|
|
5490
|
+
detail: {
|
|
5491
|
+
update: t,
|
|
5492
|
+
reset: n
|
|
5493
|
+
}
|
|
5494
|
+
}), this.update = t, this.reset = n;
|
|
5495
|
+
}
|
|
5496
|
+
}, _e.TYPE = "model.updated", _e);
|
|
5497
|
+
_e2 = class e extends CustomEvent {
|
|
5498
|
+
constructor(t, n) {
|
|
5499
|
+
super(e.TYPE, {
|
|
5500
|
+
bubbles: !0,
|
|
5501
|
+
detail: {
|
|
5502
|
+
src: t,
|
|
5503
|
+
done: n
|
|
5504
|
+
}
|
|
5505
|
+
}), this.src = t, this.done = n;
|
|
5506
|
+
}
|
|
5507
|
+
}, _e2.TYPE = "delete.image";
|
|
5508
|
+
_e3 = class e extends CustomEvent {
|
|
5509
|
+
constructor(t) {
|
|
5510
|
+
super(e.TYPE, {
|
|
5511
|
+
bubbles: !0,
|
|
5512
|
+
detail: t
|
|
5513
|
+
}), this.handler = t;
|
|
5514
|
+
}
|
|
5515
|
+
}, _e3.TYPE = "insert.image";
|
|
5516
|
+
_e4 = class e extends CustomEvent {
|
|
5517
|
+
constructor(t, n) {
|
|
5518
|
+
super(e.TYPE, {
|
|
5519
|
+
bubbles: !0,
|
|
5520
|
+
detail: {
|
|
5521
|
+
src: t,
|
|
5522
|
+
done: n
|
|
5523
|
+
}
|
|
5524
|
+
}), this.src = t, this.done = n;
|
|
5525
|
+
}
|
|
5526
|
+
}, _e4.TYPE = "delete.sound";
|
|
5527
|
+
_e5 = class e extends CustomEvent {
|
|
5528
|
+
constructor(t) {
|
|
5529
|
+
super(e.TYPE, {
|
|
5530
|
+
bubbles: !0,
|
|
5531
|
+
detail: t
|
|
5532
|
+
}), this.handler = t;
|
|
5533
|
+
}
|
|
5534
|
+
}, _e5.TYPE = "insert.sound";
|
|
5535
|
+
//#endregion
|
|
5536
|
+
//#region ../../lib-svelte/config-ui-svelte/dist/index.js
|
|
5537
|
+
var t$3 = /* @__PURE__ */ from_html("<aside class=\"pie-config-layout-settings svelte-9dr0jr\" aria-label=\"Settings\"><!></aside>");
|
|
5538
|
+
var n$1 = /* @__PURE__ */ from_html("<div class=\"pie-config-layout svelte-9dr0jr\"><div class=\"pie-config-layout-contents svelte-9dr0jr\"><div class=\"pie-config-layout-design svelte-9dr0jr\"><!></div> <!></div></div>");
|
|
5539
|
+
var r$2 = {
|
|
5540
|
+
hash: "svelte-9dr0jr",
|
|
5541
|
+
code: ".pie-config-layout.svelte-9dr0jr {container-type:inline-size;}.pie-config-layout-contents.svelte-9dr0jr {display:flex;flex-direction:column;gap:16px;}.pie-config-layout-design.svelte-9dr0jr {flex:1 1 auto;min-width:0;}\n\n @container (min-width: 1135px) {.pie-config-layout-contents.svelte-9dr0jr {flex-direction:row;align-items:flex-start;}.pie-config-layout-settings.svelte-9dr0jr {flex:0 0 300px;position:sticky;top:0;}\n }"
|
|
5542
|
+
};
|
|
5543
|
+
function i$2(i, a) {
|
|
5544
|
+
append_styles$1(i, r$2);
|
|
5545
|
+
let o = prop(a, "hideSettings", 3, !1);
|
|
5546
|
+
var s = n$1(), c = child(s), l = child(c);
|
|
5547
|
+
snippet(child(l), () => a.children), reset$1(l);
|
|
5548
|
+
var d = sibling(l, 2), f = (n) => {
|
|
5549
|
+
var r = t$3();
|
|
5550
|
+
snippet(child(r), () => a.settings), reset$1(r), append(n, r);
|
|
5551
|
+
};
|
|
5552
|
+
if_block(d, (e) => {
|
|
5553
|
+
a.settings && !o() && e(f);
|
|
5554
|
+
}), reset$1(c), reset$1(s), append(i, s);
|
|
5555
|
+
}
|
|
5556
|
+
var a$1 = (e) => typeof e == "object" && !!e && !Array.isArray(e);
|
|
5557
|
+
function o$1(e, t) {
|
|
5558
|
+
if (!a$1(t)) return e;
|
|
5559
|
+
let n = { ...e };
|
|
5560
|
+
for (let [r, i] of Object.entries(t)) {
|
|
5561
|
+
let t = e[r];
|
|
5562
|
+
n[r] = a$1(t) && a$1(i) ? {
|
|
5563
|
+
...t,
|
|
5564
|
+
...i
|
|
5565
|
+
} : i;
|
|
5566
|
+
}
|
|
5567
|
+
return n;
|
|
5568
|
+
}
|
|
5569
|
+
function s$1(e) {
|
|
5570
|
+
return a$1(e) ? Object.values(e).some((e) => a$1(e) && (e.settings === !0 || s$1(e))) : !1;
|
|
5571
|
+
}
|
|
5572
|
+
var c$1 = (e, t = !1, n = !1) => ({
|
|
5573
|
+
type: "toggle",
|
|
5574
|
+
label: e,
|
|
5575
|
+
isConfigProperty: t,
|
|
5576
|
+
disabled: n
|
|
5577
|
+
});
|
|
5578
|
+
var l$1 = (e, t, n = !1) => ({
|
|
5579
|
+
type: "radio",
|
|
5580
|
+
label: e,
|
|
5581
|
+
choices: t.map((e) => typeof e == "string" ? {
|
|
5582
|
+
label: e,
|
|
5583
|
+
value: e
|
|
5584
|
+
} : e),
|
|
5585
|
+
isConfigProperty: n
|
|
5586
|
+
});
|
|
5587
|
+
function u$1(e, t) {
|
|
5588
|
+
let n = e;
|
|
5589
|
+
for (let e of t.split(".")) {
|
|
5590
|
+
if (!a$1(n)) return;
|
|
5591
|
+
n = n[e];
|
|
5592
|
+
}
|
|
5593
|
+
return n;
|
|
5594
|
+
}
|
|
5595
|
+
function d$1(e, t, n) {
|
|
5596
|
+
let [r, ...i] = t.split("."), o = e[r], s = i.length === 0 ? n : d$1(a$1(o) ? o : {}, i.join("."), n);
|
|
5597
|
+
return {
|
|
5598
|
+
...e,
|
|
5599
|
+
[r]: s
|
|
5600
|
+
};
|
|
5601
|
+
}
|
|
5602
|
+
var f$1 = /* @__PURE__ */ from_html("<label class=\"pie-settings-toggle svelte-1ang3sw\"><span> </span> <input type=\"checkbox\" role=\"switch\" class=\"svelte-1ang3sw\"/></label>");
|
|
5603
|
+
var p$1 = /* @__PURE__ */ from_html("<label class=\"pie-settings-choice-row svelte-1ang3sw\"><input type=\"radio\" class=\"svelte-1ang3sw\"/> <span> </span></label>");
|
|
5604
|
+
var m$1 = /* @__PURE__ */ from_html("<fieldset class=\"pie-settings-choice svelte-1ang3sw\"><legend class=\"svelte-1ang3sw\"> </legend> <!></fieldset>");
|
|
5605
|
+
var h$2 = /* @__PURE__ */ from_html("<fieldset class=\"pie-settings-group svelte-1ang3sw\"><legend class=\"pie-settings-group-name svelte-1ang3sw\"> </legend> <!></fieldset>");
|
|
5606
|
+
var g$1 = /* @__PURE__ */ from_html("<div class=\"pie-settings-panel svelte-1ang3sw\"></div>");
|
|
5607
|
+
var _$1 = {
|
|
5608
|
+
hash: "svelte-1ang3sw",
|
|
5609
|
+
code: ".pie-settings-panel.svelte-1ang3sw {display:flex;flex-direction:column;gap:16px;padding:16px;border:1px solid var(--pie-border-light, #ccc);border-radius:4px;color:var(--pie-text, #212121);}fieldset.svelte-1ang3sw {margin:0;padding:0;border:0;min-width:0;}.pie-settings-group.svelte-1ang3sw {display:flex;flex-direction:column;gap:8px;}.pie-settings-group-name.svelte-1ang3sw {margin-bottom:8px;font-weight:600;}.pie-settings-toggle.svelte-1ang3sw {display:flex;align-items:center;justify-content:space-between;gap:12px;}.pie-settings-choice.svelte-1ang3sw legend:where(.svelte-1ang3sw) {margin-bottom:4px;}.pie-settings-choice-row.svelte-1ang3sw {display:flex;align-items:center;gap:8px;}input.svelte-1ang3sw {accent-color:var(--pie-primary, #3f51b5);}input.svelte-1ang3sw:focus-visible {outline:2px solid var(--pie-focus-outline, #1a73e8);outline-offset:2px;}"
|
|
5610
|
+
};
|
|
5611
|
+
function v$1(t, n) {
|
|
5612
|
+
push(n, !0), append_styles$1(t, _$1);
|
|
5613
|
+
let r = prop(n, "configuration", 19, () => ({})), i = Math.random().toString(36).slice(2, 10), a = /* @__PURE__ */ user_derived(() => Object.entries(n.groups).map(([e, t]) => [e, Object.entries(t).filter((e) => !!e[1])]).filter(([, e]) => e.length > 0)), o = (e, t) => u$1(t.isConfigProperty ? r() : n.model, e);
|
|
5614
|
+
function s(e, t, i) {
|
|
5615
|
+
t.isConfigProperty ? n.onChangeConfiguration?.(d$1(r(), e, i), e) : n.onChangeModel(d$1(n.model, e, i), e);
|
|
5616
|
+
}
|
|
5617
|
+
var c = g$1();
|
|
5618
|
+
each(c, 21, () => get$1(a), ([e, t]) => e, (t, n) => {
|
|
5619
|
+
var r = /* @__PURE__ */ user_derived(() => to_array(get$1(n), 2));
|
|
5620
|
+
let a = () => get$1(r)[0], c = () => get$1(r)[1];
|
|
5621
|
+
var l = h$2(), u = child(l), d = only_child(u, !0);
|
|
5622
|
+
each(sibling(u, 2), 17, c, ([e, t]) => e, (t, n) => {
|
|
5623
|
+
var r = /* @__PURE__ */ user_derived(() => to_array(get$1(n), 2));
|
|
5624
|
+
let a = () => get$1(r)[0], c = () => get$1(r)[1];
|
|
5625
|
+
var l = comment(), u = first_child(l), d = (t) => {
|
|
5626
|
+
var n = f$1(), r = child(n), i = only_child(r, !0), l = sibling(r, 2);
|
|
5627
|
+
remove_input_defaults(l), reset$1(n), template_effect((t) => {
|
|
5628
|
+
set_text(i, c().label), set_checked(l, t), l.disabled = c().disabled;
|
|
5629
|
+
}, [() => !!o(a(), c())]), delegated("change", l, (e) => s(a(), c(), e.currentTarget.checked)), append(t, n);
|
|
5630
|
+
}, h = (t) => {
|
|
5631
|
+
var n = m$1(), r = child(n), l = only_child(r, !0);
|
|
5632
|
+
each(sibling(r, 2), 17, () => c().choices, (e) => e.value, (t, n) => {
|
|
5633
|
+
var r = p$1(), l = child(r);
|
|
5634
|
+
remove_input_defaults(l);
|
|
5635
|
+
var d = only_child(sibling(l, 2), !0);
|
|
5636
|
+
reset$1(r), template_effect((t) => {
|
|
5637
|
+
set_attribute(l, "name", `${i}-${a()}`), set_value(l, get$1(n).value), set_checked(l, t), set_text(d, get$1(n).label);
|
|
5638
|
+
}, [() => o(a(), c()) === get$1(n).value]), delegated("change", l, () => s(a(), c(), get$1(n).value)), append(t, r);
|
|
5639
|
+
}), reset$1(n), template_effect(() => set_text(l, c().label)), append(t, n);
|
|
5640
|
+
};
|
|
5641
|
+
if_block(u, (e) => {
|
|
5642
|
+
c().type === "toggle" ? e(d) : c().type === "radio" && e(h, 1);
|
|
5643
|
+
}), append(t, l);
|
|
5644
|
+
}), reset$1(l), template_effect(() => set_text(d, a())), append(t, l);
|
|
5645
|
+
}), reset$1(c), append(t, c), pop();
|
|
5646
|
+
}
|
|
5647
|
+
delegate(["change"]);
|
|
5648
|
+
var y$1 = i$2;
|
|
5649
|
+
var b$1 = v$1;
|
|
5650
|
+
//#endregion
|
|
5531
5651
|
//#region ../../../node_modules/.bun/@tiptap+core@3.31.3+ef29727eaaf819d3/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js
|
|
5532
5652
|
var __defProp = Object.defineProperty;
|
|
5533
5653
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -5622,7 +5742,7 @@ OrderedMap.from = function(value) {
|
|
|
5622
5742
|
return new OrderedMap(content);
|
|
5623
5743
|
};
|
|
5624
5744
|
//#endregion
|
|
5625
|
-
//#region ../../../node_modules/.bun/prosemirror-model@1.25.
|
|
5745
|
+
//#region ../../../node_modules/.bun/prosemirror-model@1.25.12/node_modules/prosemirror-model/dist/index.js
|
|
5626
5746
|
function findDiffStart(a, b, pos) {
|
|
5627
5747
|
for (let i = 0;; i++) {
|
|
5628
5748
|
if (i == a.childCount || i == b.childCount) return a.childCount == b.childCount ? null : pos;
|
|
@@ -6068,9 +6188,7 @@ var Mark$1 = class Mark$1 {
|
|
|
6068
6188
|
if (!json) throw new RangeError("Invalid input for Mark.fromJSON");
|
|
6069
6189
|
let type = schema.marks[json.type];
|
|
6070
6190
|
if (!type) throw new RangeError(`There is no mark type ${json.type} in this schema`);
|
|
6071
|
-
|
|
6072
|
-
type.checkAttrs(mark.attrs);
|
|
6073
|
-
return mark;
|
|
6191
|
+
return type.create(json.attrs);
|
|
6074
6192
|
}
|
|
6075
6193
|
/**
|
|
6076
6194
|
Test whether two sets of marks are identical.
|
|
@@ -6967,11 +7085,11 @@ var Node$2 = class Node$2 {
|
|
|
6967
7085
|
*/
|
|
6968
7086
|
check() {
|
|
6969
7087
|
this.type.checkContent(this.content);
|
|
6970
|
-
this.type.
|
|
7088
|
+
checkAttrs(this.type.attrs, this.attrs, "node", this.type.name);
|
|
6971
7089
|
let copy = Mark$1.none;
|
|
6972
7090
|
for (let i = 0; i < this.marks.length; i++) {
|
|
6973
7091
|
let mark = this.marks[i];
|
|
6974
|
-
mark.type.
|
|
7092
|
+
checkAttrs(mark.type.attrs, mark.attrs, "mark", mark.type.name);
|
|
6975
7093
|
copy = mark.addToSet(copy);
|
|
6976
7094
|
}
|
|
6977
7095
|
if (!Mark$1.sameSet(copy, this.marks)) throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((m) => m.type.name)}`);
|
|
@@ -7005,9 +7123,7 @@ var Node$2 = class Node$2 {
|
|
|
7005
7123
|
return schema.text(json.text, marks);
|
|
7006
7124
|
}
|
|
7007
7125
|
let content = Fragment.fromJSON(schema, json.content);
|
|
7008
|
-
|
|
7009
|
-
node.type.checkAttrs(node.attrs);
|
|
7010
|
-
return node;
|
|
7126
|
+
return schema.nodeType(json.type).create(json.attrs, content, marks);
|
|
7011
7127
|
}
|
|
7012
7128
|
};
|
|
7013
7129
|
Node$2.prototype.text = void 0;
|
|
@@ -7057,6 +7173,10 @@ function wrapMarks(marks, str) {
|
|
|
7057
7173
|
for (let i = marks.length - 1; i >= 0; i--) str = marks[i].type.name + "(" + str + ")";
|
|
7058
7174
|
return str;
|
|
7059
7175
|
}
|
|
7176
|
+
function checkAttrs(attrs, values, type, name) {
|
|
7177
|
+
for (let attr in values) if (!(attr in attrs)) throw new RangeError(`Unsupported attribute ${attr} for ${type} of type ${name}`);
|
|
7178
|
+
for (let attr in attrs) if (attrs[attr].validate) attrs[attr].validate(values[attr]);
|
|
7179
|
+
}
|
|
7060
7180
|
/**
|
|
7061
7181
|
Instances of this class represent a match state of a node type's
|
|
7062
7182
|
[content expression](https://prosemirror.net/docs/ref/#model.NodeSpec.content), and can be used to
|
|
@@ -7465,20 +7585,15 @@ function defaultAttrs(attrs) {
|
|
|
7465
7585
|
function computeAttrs(attrs, value) {
|
|
7466
7586
|
let built = Object.create(null);
|
|
7467
7587
|
for (let name in attrs) {
|
|
7588
|
+
let attr = attrs[name];
|
|
7468
7589
|
let given = value && value[name];
|
|
7469
|
-
if (given === void 0)
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
else throw new RangeError("No value supplied for attribute " + name);
|
|
7473
|
-
}
|
|
7590
|
+
if (given === void 0) if (attr.hasDefault) given = attr.default;
|
|
7591
|
+
else throw new RangeError("No value supplied for attribute " + name);
|
|
7592
|
+
else if (attr.validate) attr.validate(given);
|
|
7474
7593
|
built[name] = given;
|
|
7475
7594
|
}
|
|
7476
7595
|
return built;
|
|
7477
7596
|
}
|
|
7478
|
-
function checkAttrs(attrs, values, type, name) {
|
|
7479
|
-
for (let attr in values) if (!(attr in attrs)) throw new RangeError(`Unsupported attribute ${attr} for ${type} of type ${name}`);
|
|
7480
|
-
for (let attr in attrs) if (attrs[attr].validate) attrs[attr].validate(values[attr]);
|
|
7481
|
-
}
|
|
7482
7597
|
function initAttrs(typeName, attrs) {
|
|
7483
7598
|
let result = Object.create(null);
|
|
7484
7599
|
if (attrs) for (let name in attrs) result[name] = new Attribute(typeName, name, attrs[name]);
|
|
@@ -7633,11 +7748,9 @@ var NodeType$1 = class NodeType$1 {
|
|
|
7633
7748
|
if (!this.validContent(content)) throw new RangeError(`Invalid content for node ${this.name}: ${content.toString().slice(0, 50)}`);
|
|
7634
7749
|
}
|
|
7635
7750
|
/**
|
|
7636
|
-
@internal
|
|
7751
|
+
@internal no longer useful, but called by old prosemirror-view versions
|
|
7637
7752
|
*/
|
|
7638
|
-
checkAttrs(attrs) {
|
|
7639
|
-
checkAttrs(this.attrs, attrs, "node", this.name);
|
|
7640
|
-
}
|
|
7753
|
+
checkAttrs(attrs) {}
|
|
7641
7754
|
/**
|
|
7642
7755
|
Check whether the given mark type is allowed in this node.
|
|
7643
7756
|
*/
|
|
@@ -7748,12 +7861,6 @@ var MarkType = class MarkType {
|
|
|
7748
7861
|
for (let i = 0; i < set.length; i++) if (set[i].type == this) return set[i];
|
|
7749
7862
|
}
|
|
7750
7863
|
/**
|
|
7751
|
-
@internal
|
|
7752
|
-
*/
|
|
7753
|
-
checkAttrs(attrs) {
|
|
7754
|
-
checkAttrs(this.attrs, attrs, "mark", this.name);
|
|
7755
|
-
}
|
|
7756
|
-
/**
|
|
7757
7864
|
Queries whether a given mark type is
|
|
7758
7865
|
[excluded](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) by this one.
|
|
7759
7866
|
*/
|
|
@@ -8612,7 +8719,7 @@ function renderSpec(doc, structure, xmlNS, blockArraysIn) {
|
|
|
8612
8719
|
};
|
|
8613
8720
|
}
|
|
8614
8721
|
//#endregion
|
|
8615
|
-
//#region ../../../node_modules/.bun/prosemirror-transform@1.12.
|
|
8722
|
+
//#region ../../../node_modules/.bun/prosemirror-transform@1.12.2/node_modules/prosemirror-transform/dist/index.js
|
|
8616
8723
|
var lower16 = 65535;
|
|
8617
8724
|
var factor16 = Math.pow(2, 16);
|
|
8618
8725
|
function makeRecover(index, offset) {
|
|
@@ -8715,8 +8822,11 @@ var StepMap = class StepMap {
|
|
|
8715
8822
|
let result = start + diff + (side < 0 ? 0 : newSize);
|
|
8716
8823
|
if (simple) return result;
|
|
8717
8824
|
let recover = pos == (assoc < 0 ? start : end) ? null : makeRecover(i / 3, pos - start);
|
|
8718
|
-
let del =
|
|
8719
|
-
if (
|
|
8825
|
+
let del = 0;
|
|
8826
|
+
if (oldSize) {
|
|
8827
|
+
del |= pos == start ? DEL_AFTER : pos == end ? DEL_BEFORE : DEL_ACROSS;
|
|
8828
|
+
if (assoc < 0 ? pos != start : pos != end) del |= DEL_SIDE;
|
|
8829
|
+
}
|
|
8720
8830
|
return new MapResult(result, del, recover);
|
|
8721
8831
|
}
|
|
8722
8832
|
diff += newSize - oldSize;
|
|
@@ -9837,9 +9947,9 @@ var Fitter = class {
|
|
|
9837
9947
|
}
|
|
9838
9948
|
openMore() {
|
|
9839
9949
|
let { content, openStart, openEnd } = this.unplaced;
|
|
9840
|
-
|
|
9841
|
-
if (
|
|
9842
|
-
this.unplaced = new Slice(content, openStart + 1,
|
|
9950
|
+
if (maxOpen(content, -1) <= openStart) return false;
|
|
9951
|
+
if (this.unplaced.size > 1 && maxOpen(content, 1) > openEnd) openEnd++;
|
|
9952
|
+
this.unplaced = new Slice(content, openStart + 1, openEnd);
|
|
9843
9953
|
return true;
|
|
9844
9954
|
}
|
|
9845
9955
|
dropNode() {
|
|
@@ -9973,6 +10083,13 @@ function invalidMarks(type, fragment, start) {
|
|
|
9973
10083
|
function definesContent(type) {
|
|
9974
10084
|
return type.spec.defining || type.spec.definingForContent;
|
|
9975
10085
|
}
|
|
10086
|
+
function maxOpen(frag, side) {
|
|
10087
|
+
for (let count = 0;; count++) {
|
|
10088
|
+
let ch = side < 0 ? frag.firstChild : frag.lastChild;
|
|
10089
|
+
if (!ch || ch.isAtom) return count;
|
|
10090
|
+
frag = ch.content;
|
|
10091
|
+
}
|
|
10092
|
+
}
|
|
9976
10093
|
function replaceRange(tr, from, to, slice) {
|
|
9977
10094
|
if (!slice.size) return tr.deleteRange(from, to);
|
|
9978
10095
|
let $from = tr.doc.resolve(from), $to = tr.doc.resolve(to);
|
|
@@ -11418,7 +11535,7 @@ var PluginKey = class {
|
|
|
11418
11535
|
}
|
|
11419
11536
|
};
|
|
11420
11537
|
//#endregion
|
|
11421
|
-
//#region ../../../node_modules/.bun/prosemirror-commands@1.7.
|
|
11538
|
+
//#region ../../../node_modules/.bun/prosemirror-commands@1.7.2/node_modules/prosemirror-commands/dist/index.js
|
|
11422
11539
|
/**
|
|
11423
11540
|
Delete the selection, if there is one.
|
|
11424
11541
|
*/
|
|
@@ -11740,20 +11857,23 @@ a custom function to determine the type of the newly split off block.
|
|
|
11740
11857
|
*/
|
|
11741
11858
|
function splitBlockAs(splitNode) {
|
|
11742
11859
|
return (state, dispatch) => {
|
|
11743
|
-
let { $from, $to } = state.selection;
|
|
11744
11860
|
if (state.selection instanceof NodeSelection && state.selection.node.isBlock) {
|
|
11861
|
+
let { $from } = state.selection;
|
|
11745
11862
|
if (!$from.parentOffset || !canSplit(state.doc, $from.pos)) return false;
|
|
11746
11863
|
if (dispatch) dispatch(state.tr.split($from.pos).scrollIntoView());
|
|
11747
11864
|
return true;
|
|
11748
11865
|
}
|
|
11749
|
-
if (
|
|
11866
|
+
if (!state.selection.$from.depth) return false;
|
|
11867
|
+
let tr = state.tr;
|
|
11868
|
+
if (!state.selection.empty && (state.selection instanceof TextSelection || state.selection instanceof AllSelection)) tr.deleteSelection();
|
|
11869
|
+
let { $from } = tr.selection, mapFrom = tr.steps.length;
|
|
11750
11870
|
let types = [];
|
|
11751
11871
|
let splitDepth, deflt, atEnd = false, atStart = false;
|
|
11752
11872
|
for (let d = $from.depth;; d--) if ($from.node(d).isBlock) {
|
|
11753
11873
|
atEnd = $from.end(d) == $from.pos + ($from.depth - d);
|
|
11754
11874
|
atStart = $from.start(d) == $from.pos - ($from.depth - d);
|
|
11755
11875
|
deflt = defaultBlockAt$1($from.node(d - 1).contentMatchAt($from.indexAfter(d - 1)));
|
|
11756
|
-
let splitType = splitNode && splitNode($
|
|
11876
|
+
let splitType = splitNode && splitNode($from.parent, atEnd, $from);
|
|
11757
11877
|
types.unshift(splitType || (atEnd && deflt ? { type: deflt } : null));
|
|
11758
11878
|
splitDepth = d;
|
|
11759
11879
|
break;
|
|
@@ -11761,9 +11881,7 @@ function splitBlockAs(splitNode) {
|
|
|
11761
11881
|
if (d == 1) return false;
|
|
11762
11882
|
types.unshift(null);
|
|
11763
11883
|
}
|
|
11764
|
-
let
|
|
11765
|
-
if (state.selection instanceof TextSelection || state.selection instanceof AllSelection) tr.deleteSelection();
|
|
11766
|
-
let splitPos = tr.mapping.map($from.pos);
|
|
11884
|
+
let splitPos = $from.pos;
|
|
11767
11885
|
let can = canSplit(tr.doc, splitPos, types.length, types);
|
|
11768
11886
|
if (!can) {
|
|
11769
11887
|
types[0] = deflt ? { type: deflt } : null;
|
|
@@ -11772,8 +11890,9 @@ function splitBlockAs(splitNode) {
|
|
|
11772
11890
|
if (!can) return false;
|
|
11773
11891
|
tr.split(splitPos, types.length, types);
|
|
11774
11892
|
if (!atEnd && atStart && $from.node(splitDepth).type != deflt) {
|
|
11775
|
-
let
|
|
11776
|
-
|
|
11893
|
+
let mapping = tr.mapping.slice(mapFrom);
|
|
11894
|
+
let first = mapping.map($from.before(splitDepth)), $first = tr.doc.resolve(first);
|
|
11895
|
+
if (deflt && $from.node(splitDepth - 1).canReplaceWith($first.index(), $first.index() + 1, deflt)) tr.setNodeMarkup(mapping.map($from.before(splitDepth)), deflt);
|
|
11777
11896
|
}
|
|
11778
11897
|
if (dispatch) dispatch(tr.scrollIntoView());
|
|
11779
11898
|
return true;
|
|
@@ -12099,7 +12218,7 @@ function sinkListItem(itemType) {
|
|
|
12099
12218
|
};
|
|
12100
12219
|
}
|
|
12101
12220
|
//#endregion
|
|
12102
|
-
//#region ../../../node_modules/.bun/prosemirror-view@1.42.
|
|
12221
|
+
//#region ../../../node_modules/.bun/prosemirror-view@1.42.6/node_modules/prosemirror-view/dist/index.js
|
|
12103
12222
|
var domIndex = function(node) {
|
|
12104
12223
|
for (var index = 0;; index++) {
|
|
12105
12224
|
node = node.previousSibling;
|
|
@@ -12130,12 +12249,12 @@ function scanFor(node, off, targetNode, targetOff, dir) {
|
|
|
12130
12249
|
if (node == targetNode && off == targetOff) return true;
|
|
12131
12250
|
if (off == (dir < 0 ? 0 : nodeSize(node))) {
|
|
12132
12251
|
let parent = node.parentNode;
|
|
12133
|
-
if (!parent || parent
|
|
12252
|
+
if (!parent || !isElt(parent) || hasBlockDesc(node) || atomElements.test(node.nodeName) || node.contentEditable == "false") return false;
|
|
12134
12253
|
off = domIndex(node) + (dir < 0 ? 0 : 1);
|
|
12135
12254
|
node = parent;
|
|
12136
|
-
} else if (node
|
|
12255
|
+
} else if (isElt(node)) {
|
|
12137
12256
|
let child = node.childNodes[off + (dir < 0 ? -1 : 0)];
|
|
12138
|
-
if (child
|
|
12257
|
+
if (isElt(child) && child.contentEditable == "false") if ((_a = child.pmViewDesc) === null || _a === void 0 ? void 0 : _a.ignoreForSelection) off += dir;
|
|
12139
12258
|
else return false;
|
|
12140
12259
|
else {
|
|
12141
12260
|
node = child;
|
|
@@ -12147,10 +12266,19 @@ function scanFor(node, off, targetNode, targetOff, dir) {
|
|
|
12147
12266
|
function nodeSize(node) {
|
|
12148
12267
|
return node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length;
|
|
12149
12268
|
}
|
|
12269
|
+
function isElt(node) {
|
|
12270
|
+
return node.nodeType == 1;
|
|
12271
|
+
}
|
|
12272
|
+
function isText(node) {
|
|
12273
|
+
return node.nodeType == 3;
|
|
12274
|
+
}
|
|
12275
|
+
function contains(parent, child) {
|
|
12276
|
+
return child ? parent.contains(isElt(child) ? child : child.parentNode) : false;
|
|
12277
|
+
}
|
|
12150
12278
|
function textNodeBefore$1(node, offset) {
|
|
12151
12279
|
for (;;) {
|
|
12152
|
-
if (node
|
|
12153
|
-
if (node
|
|
12280
|
+
if (isText(node) && offset) return node;
|
|
12281
|
+
if (isElt(node) && offset > 0) {
|
|
12154
12282
|
if (node.contentEditable == "false") return null;
|
|
12155
12283
|
node = node.childNodes[offset - 1];
|
|
12156
12284
|
offset = nodeSize(node);
|
|
@@ -12162,8 +12290,8 @@ function textNodeBefore$1(node, offset) {
|
|
|
12162
12290
|
}
|
|
12163
12291
|
function textNodeAfter$1(node, offset) {
|
|
12164
12292
|
for (;;) {
|
|
12165
|
-
if (node
|
|
12166
|
-
if (node
|
|
12293
|
+
if (isText(node) && offset < node.nodeValue.length) return node;
|
|
12294
|
+
if (isElt(node) && offset < node.childNodes.length) {
|
|
12167
12295
|
if (node.contentEditable == "false") return null;
|
|
12168
12296
|
node = node.childNodes[offset];
|
|
12169
12297
|
offset = 0;
|
|
@@ -12274,13 +12402,12 @@ function scrollRectIntoView(view, rect, startDOM) {
|
|
|
12274
12402
|
let doc = view.dom.ownerDocument;
|
|
12275
12403
|
for (let parent = startDOM || view.dom;;) {
|
|
12276
12404
|
if (!parent) break;
|
|
12277
|
-
if (parent
|
|
12405
|
+
if (!isElt(parent)) {
|
|
12278
12406
|
parent = parentNode(parent);
|
|
12279
12407
|
continue;
|
|
12280
12408
|
}
|
|
12281
|
-
let
|
|
12282
|
-
let
|
|
12283
|
-
let bounding = atTop ? windowRect(doc) : clientRect(elt);
|
|
12409
|
+
let atTop = parent == doc.body;
|
|
12410
|
+
let bounding = atTop ? windowRect(doc) : clientRect(parent);
|
|
12284
12411
|
let moveX = 0, moveY = 0;
|
|
12285
12412
|
if (rect.top < bounding.top + getSide(scrollThreshold, "top")) moveY = -(bounding.top - rect.top + getSide(scrollMargin, "top"));
|
|
12286
12413
|
else if (rect.bottom > bounding.bottom - getSide(scrollThreshold, "bottom")) moveY = rect.bottom - rect.top > bounding.bottom - bounding.top ? rect.top + getSide(scrollMargin, "top") - bounding.top : rect.bottom - bounding.bottom + getSide(scrollMargin, "bottom");
|
|
@@ -12288,10 +12415,10 @@ function scrollRectIntoView(view, rect, startDOM) {
|
|
|
12288
12415
|
else if (rect.right > bounding.right - getSide(scrollThreshold, "right")) moveX = rect.right - bounding.right + getSide(scrollMargin, "right");
|
|
12289
12416
|
if (moveX || moveY) if (atTop) doc.defaultView.scrollBy(moveX, moveY);
|
|
12290
12417
|
else {
|
|
12291
|
-
let startX =
|
|
12292
|
-
if (moveY)
|
|
12293
|
-
if (moveX)
|
|
12294
|
-
let dX =
|
|
12418
|
+
let startX = parent.scrollLeft, startY = parent.scrollTop;
|
|
12419
|
+
if (moveY) parent.scrollTop += moveY;
|
|
12420
|
+
if (moveX) parent.scrollLeft += moveX;
|
|
12421
|
+
let dX = parent.scrollLeft - startX, dY = parent.scrollTop - startY;
|
|
12295
12422
|
rect = {
|
|
12296
12423
|
left: rect.left - dX,
|
|
12297
12424
|
top: rect.top - dY,
|
|
@@ -12361,13 +12488,14 @@ function focusPreventScroll(dom) {
|
|
|
12361
12488
|
}
|
|
12362
12489
|
}
|
|
12363
12490
|
function findOffsetInNode(node, coords) {
|
|
12364
|
-
let closest
|
|
12491
|
+
let closest;
|
|
12492
|
+
let dxClosest = 2e8, coordsClosest, offset = 0;
|
|
12365
12493
|
let rowBot = coords.top, rowTop = coords.top;
|
|
12366
12494
|
let firstBelow, coordsBelow;
|
|
12367
12495
|
for (let child = node.firstChild, childIndex = 0; child; child = child.nextSibling, childIndex++) {
|
|
12368
12496
|
let rects;
|
|
12369
|
-
if (child
|
|
12370
|
-
else if (child
|
|
12497
|
+
if (isElt(child)) rects = child.getClientRects();
|
|
12498
|
+
else if (isText(child)) rects = textRange(child).getClientRects();
|
|
12371
12499
|
else continue;
|
|
12372
12500
|
for (let i = 0; i < rects.length; i++) {
|
|
12373
12501
|
let rect = rects[i];
|
|
@@ -12378,11 +12506,11 @@ function findOffsetInNode(node, coords) {
|
|
|
12378
12506
|
if (dx < dxClosest) {
|
|
12379
12507
|
closest = child;
|
|
12380
12508
|
dxClosest = dx;
|
|
12381
|
-
coordsClosest = dx && closest
|
|
12509
|
+
coordsClosest = dx && isText(closest) ? {
|
|
12382
12510
|
left: rect.right < coords.left ? rect.right : rect.left,
|
|
12383
12511
|
top: coords.top
|
|
12384
12512
|
} : coords;
|
|
12385
|
-
if (child
|
|
12513
|
+
if (isElt(child) && dx) offset = childIndex + (coords.left >= (rect.left + rect.right) / 2 ? 1 : 0);
|
|
12386
12514
|
continue;
|
|
12387
12515
|
}
|
|
12388
12516
|
} else if (rect.top > coords.top && !firstBelow && rect.left <= coords.left && rect.right >= coords.left) {
|
|
@@ -12400,8 +12528,8 @@ function findOffsetInNode(node, coords) {
|
|
|
12400
12528
|
coordsClosest = coordsBelow;
|
|
12401
12529
|
dxClosest = 0;
|
|
12402
12530
|
}
|
|
12403
|
-
if (closest && closest
|
|
12404
|
-
if (!closest || dxClosest
|
|
12531
|
+
if (closest && isText(closest)) return findOffsetInText(closest, coordsClosest);
|
|
12532
|
+
if (!closest || dxClosest) return {
|
|
12405
12533
|
node,
|
|
12406
12534
|
offset
|
|
12407
12535
|
};
|
|
@@ -12439,7 +12567,7 @@ function targetKludge(dom, coords) {
|
|
|
12439
12567
|
}
|
|
12440
12568
|
function posFromElement(view, elt, coords) {
|
|
12441
12569
|
let { node, offset } = findOffsetInNode(elt, coords), bias = -1;
|
|
12442
|
-
if (node
|
|
12570
|
+
if (isElt(node) && !node.firstChild) {
|
|
12443
12571
|
let rect = node.getBoundingClientRect();
|
|
12444
12572
|
bias = rect.left != rect.right && coords.left > (rect.left + rect.right) / 2 ? 1 : -1;
|
|
12445
12573
|
}
|
|
@@ -12451,7 +12579,7 @@ function posFromCaret(view, node, offset, coords) {
|
|
|
12451
12579
|
if (cur == view.dom) break;
|
|
12452
12580
|
let desc = view.docView.nearestDesc(cur, true), rect;
|
|
12453
12581
|
if (!desc) return null;
|
|
12454
|
-
if (desc.dom
|
|
12582
|
+
if (isElt(desc.dom) && (desc.node.isBlock && desc.parent || !desc.contentDOM) && ((rect = desc.dom.getBoundingClientRect()).width || rect.height)) {
|
|
12455
12583
|
if (desc.node.isBlock && desc.parent && !/^T(R|BODY|HEAD|FOOT)$/.test(desc.dom.nodeName)) {
|
|
12456
12584
|
if (!sawBlock && rect.left > coords.left || rect.top > coords.top) outsideBlock = desc.posBefore;
|
|
12457
12585
|
else if (!sawBlock && rect.right < coords.left || rect.bottom < coords.top) outsideBlock = desc.posAfter;
|
|
@@ -12467,7 +12595,7 @@ function elementFromPoint(element, coords, box) {
|
|
|
12467
12595
|
let len = element.childNodes.length;
|
|
12468
12596
|
if (len && box.top < box.bottom) for (let startI = Math.max(0, Math.min(len - 1, Math.floor(len * (coords.top - box.top) / (box.bottom - box.top)) - 2)), i = startI;;) {
|
|
12469
12597
|
let child = element.childNodes[i];
|
|
12470
|
-
if (child
|
|
12598
|
+
if (isElt(child)) {
|
|
12471
12599
|
let rects = child.getClientRects();
|
|
12472
12600
|
for (let j = 0; j < rects.length; j++) {
|
|
12473
12601
|
let rect = rects[j];
|
|
@@ -12484,7 +12612,7 @@ function posAtCoords(view, coords) {
|
|
|
12484
12612
|
if (caret) ({node, offset} = caret);
|
|
12485
12613
|
let elt = (view.root.elementFromPoint ? view.root : doc).elementFromPoint(coords.left, coords.top);
|
|
12486
12614
|
let pos;
|
|
12487
|
-
if (!elt || !view.dom.contains(elt
|
|
12615
|
+
if (!elt || !view.dom.contains(elt)) {
|
|
12488
12616
|
let box = view.dom.getBoundingClientRect();
|
|
12489
12617
|
if (!inRect(coords, box)) return null;
|
|
12490
12618
|
elt = elementFromPoint(view.dom, coords, box);
|
|
@@ -12495,7 +12623,7 @@ function posAtCoords(view, coords) {
|
|
|
12495
12623
|
}
|
|
12496
12624
|
elt = targetKludge(elt, coords);
|
|
12497
12625
|
if (node) {
|
|
12498
|
-
if (gecko && node
|
|
12626
|
+
if (gecko && isElt(node)) {
|
|
12499
12627
|
offset = Math.min(offset, node.childNodes.length);
|
|
12500
12628
|
if (offset < node.childNodes.length) {
|
|
12501
12629
|
let next = node.childNodes[offset], box;
|
|
@@ -12503,9 +12631,9 @@ function posAtCoords(view, coords) {
|
|
|
12503
12631
|
}
|
|
12504
12632
|
}
|
|
12505
12633
|
let prev;
|
|
12506
|
-
if (webkit && offset && node
|
|
12507
|
-
if (node == view.dom && offset == node.childNodes.length - 1 && node.lastChild
|
|
12508
|
-
else if (offset == 0 || node
|
|
12634
|
+
if (webkit && offset && isElt(node) && isElt(prev = node.childNodes[offset - 1]) && prev.contentEditable == "false" && prev.getBoundingClientRect().top >= coords.top) offset--;
|
|
12635
|
+
if (node == view.dom && offset == node.childNodes.length - 1 && isElt(node.lastChild) && coords.top > node.lastChild.getBoundingClientRect().bottom) pos = view.state.doc.content.size;
|
|
12636
|
+
else if (offset == 0 || !isElt(node) || node.childNodes[offset - 1].nodeName != "BR") pos = posFromCaret(view, node, offset, coords);
|
|
12509
12637
|
}
|
|
12510
12638
|
if (pos == null) pos = posFromElement(view, elt, coords);
|
|
12511
12639
|
let desc = view.docView.nearestDesc(elt, true);
|
|
@@ -12529,7 +12657,7 @@ var BIDI = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
|
|
|
12529
12657
|
function coordsAtPos(view, pos, side) {
|
|
12530
12658
|
let { node, offset, atom } = view.docView.domFromPos(pos, side < 0 ? -1 : 1);
|
|
12531
12659
|
let supportEmptyRange = webkit || gecko;
|
|
12532
|
-
if (node
|
|
12660
|
+
if (isText(node)) if (supportEmptyRange && (BIDI.test(node.nodeValue) || (side < 0 ? !offset : offset == node.nodeValue.length))) {
|
|
12533
12661
|
let rect = singleRect(textRange(node, offset, offset), side);
|
|
12534
12662
|
if (gecko && offset && /\s/.test(node.nodeValue[offset - 1]) && offset < node.nodeValue.length) {
|
|
12535
12663
|
let rectBefore = singleRect(textRange(node, offset - 1, offset - 1), -1);
|
|
@@ -12554,26 +12682,26 @@ function coordsAtPos(view, pos, side) {
|
|
|
12554
12682
|
if (!view.state.doc.resolve(pos - (atom || 0)).parent.inlineContent) {
|
|
12555
12683
|
if (atom == null && offset && (side < 0 || offset == nodeSize(node))) {
|
|
12556
12684
|
let before = node.childNodes[offset - 1];
|
|
12557
|
-
if (before
|
|
12685
|
+
if (isElt(before)) return flattenH(before.getBoundingClientRect(), false);
|
|
12558
12686
|
}
|
|
12559
12687
|
if (atom == null && offset < nodeSize(node)) {
|
|
12560
12688
|
let after = node.childNodes[offset];
|
|
12561
|
-
if (after
|
|
12689
|
+
if (isElt(after)) return flattenH(after.getBoundingClientRect(), true);
|
|
12562
12690
|
}
|
|
12563
12691
|
return flattenH(node.getBoundingClientRect(), side >= 0);
|
|
12564
12692
|
}
|
|
12565
12693
|
if (atom == null && offset && (side < 0 || offset == nodeSize(node))) {
|
|
12566
12694
|
let before = node.childNodes[offset - 1];
|
|
12567
|
-
let target = before
|
|
12695
|
+
let target = isText(before) ? textRange(before, nodeSize(before) - (supportEmptyRange ? 0 : 1)) : isElt(before) && (before.nodeName != "BR" || !before.nextSibling) ? before : null;
|
|
12568
12696
|
if (target) return flattenV(singleRect(target, 1), false);
|
|
12569
12697
|
}
|
|
12570
12698
|
if (atom == null && offset < nodeSize(node)) {
|
|
12571
12699
|
let after = node.childNodes[offset];
|
|
12572
12700
|
while (after.pmViewDesc && after.pmViewDesc.ignoreForCoords) after = after.nextSibling;
|
|
12573
|
-
let target = !after ? null : after
|
|
12701
|
+
let target = !after ? null : isText(after) ? textRange(after, 0, supportEmptyRange ? 0 : 1) : isElt(after) ? after : null;
|
|
12574
12702
|
if (target) return flattenV(singleRect(target, -1), true);
|
|
12575
12703
|
}
|
|
12576
|
-
return flattenV(singleRect(node
|
|
12704
|
+
return flattenV(singleRect(isText(node) ? textRange(node) : node, -side), side >= 0);
|
|
12577
12705
|
}
|
|
12578
12706
|
function flattenV(rect, left) {
|
|
12579
12707
|
if (rect.width == 0) return rect;
|
|
@@ -12623,8 +12751,8 @@ function endOfTextblockVertical(view, state, dir) {
|
|
|
12623
12751
|
let coords = coordsAtPos(view, $pos.pos, 1);
|
|
12624
12752
|
for (let child = dom.firstChild; child; child = child.nextSibling) {
|
|
12625
12753
|
let boxes;
|
|
12626
|
-
if (child
|
|
12627
|
-
else if (child
|
|
12754
|
+
if (isElt(child)) boxes = child.getClientRects();
|
|
12755
|
+
else if (isText(child)) boxes = textRange(child, 0, child.nodeValue.length).getClientRects();
|
|
12628
12756
|
else continue;
|
|
12629
12757
|
for (let i = 0; i < boxes.length; i++) {
|
|
12630
12758
|
let box = boxes[i];
|
|
@@ -12648,7 +12776,7 @@ function endOfTextblockHorizontal(view, state, dir) {
|
|
|
12648
12776
|
sel.modify("move", dir, "character");
|
|
12649
12777
|
let parentDOM = $head.depth ? view.docView.domAfterPos($head.before()) : view.dom;
|
|
12650
12778
|
let { focusNode: newNode, focusOffset: newOff } = view.domSelectionRange();
|
|
12651
|
-
let result = newNode && !
|
|
12779
|
+
let result = newNode && !contains(parentDOM, newNode) || oldNode == newNode && oldOff == newOff;
|
|
12652
12780
|
try {
|
|
12653
12781
|
sel.collapse(anchorNode, anchorOffset);
|
|
12654
12782
|
if (oldNode && (oldNode != anchorNode || oldOff != anchorOffset) && sel.extend) sel.extend(oldNode, oldOff);
|
|
@@ -12730,7 +12858,7 @@ var ViewDesc = class {
|
|
|
12730
12858
|
return this.posAtStart + this.size - 2 * this.border;
|
|
12731
12859
|
}
|
|
12732
12860
|
localPosFromDOM(dom, offset, bias) {
|
|
12733
|
-
if (this.contentDOM && this.contentDOM
|
|
12861
|
+
if (this.contentDOM && contains(this.contentDOM, dom)) if (bias < 0) {
|
|
12734
12862
|
let domBefore, desc;
|
|
12735
12863
|
if (dom == this.contentDOM) domBefore = dom.childNodes[offset - 1];
|
|
12736
12864
|
else {
|
|
@@ -12751,7 +12879,7 @@ var ViewDesc = class {
|
|
|
12751
12879
|
}
|
|
12752
12880
|
let atEnd;
|
|
12753
12881
|
if (dom == this.dom && this.contentDOM) atEnd = offset > domIndex(this.contentDOM);
|
|
12754
|
-
else if (this.contentDOM && this.contentDOM != this.dom && this.dom.contains(this.contentDOM)) atEnd = dom.compareDocumentPosition(this.contentDOM) &
|
|
12882
|
+
else if (this.contentDOM && this.contentDOM != this.dom && this.dom.contains(this.contentDOM)) atEnd = !!(dom.compareDocumentPosition(this.contentDOM) & 4);
|
|
12755
12883
|
else if (this.dom.firstChild) {
|
|
12756
12884
|
if (offset == 0) for (let search = dom;; search = search.parentNode) {
|
|
12757
12885
|
if (search == this.dom) {
|
|
@@ -12773,7 +12901,7 @@ var ViewDesc = class {
|
|
|
12773
12901
|
nearestDesc(dom, onlyNodes = false) {
|
|
12774
12902
|
for (let first = true, cur = dom; cur; cur = cur.parentNode) {
|
|
12775
12903
|
let desc = this.getDesc(cur), nodeDOM;
|
|
12776
|
-
if (desc && (!onlyNodes || desc.node)) if (first && (nodeDOM = desc.nodeDOM) && !(nodeDOM
|
|
12904
|
+
if (desc && (!onlyNodes || desc.node)) if (first && (nodeDOM = desc.nodeDOM) && !(isElt(nodeDOM) ? contains(nodeDOM, dom) : nodeDOM == dom)) first = false;
|
|
12777
12905
|
else return desc;
|
|
12778
12906
|
}
|
|
12779
12907
|
}
|
|
@@ -12814,14 +12942,17 @@ var ViewDesc = class {
|
|
|
12814
12942
|
let i = 0, offset = 0;
|
|
12815
12943
|
for (let curPos = 0; i < this.children.length; i++) {
|
|
12816
12944
|
let child = this.children[i], end = curPos + child.size;
|
|
12817
|
-
if (end > pos
|
|
12945
|
+
if (end > pos) {
|
|
12818
12946
|
offset = pos - curPos;
|
|
12819
12947
|
break;
|
|
12820
12948
|
}
|
|
12821
12949
|
curPos = end;
|
|
12822
12950
|
}
|
|
12823
12951
|
if (offset) return this.children[i].domFromPos(offset - this.children[i].border, side);
|
|
12824
|
-
for (
|
|
12952
|
+
for (; i > 0; i--) {
|
|
12953
|
+
let prev = this.children[i - 1];
|
|
12954
|
+
if (prev.size || !(prev instanceof BufferHackViewDesc || prev instanceof WidgetViewDesc && prev.side >= 0)) break;
|
|
12955
|
+
}
|
|
12825
12956
|
if (side <= 0) {
|
|
12826
12957
|
let prev, enter = true;
|
|
12827
12958
|
for (;; i--, enter = false) {
|
|
@@ -12901,7 +13032,7 @@ var ViewDesc = class {
|
|
|
12901
13032
|
}
|
|
12902
13033
|
domAfterPos(pos) {
|
|
12903
13034
|
let { node, offset } = this.domFromPos(pos, 0);
|
|
12904
|
-
if (node
|
|
13035
|
+
if (!isElt(node) || offset == node.childNodes.length) throw new RangeError("No node after pos " + pos);
|
|
12905
13036
|
return node.childNodes[offset];
|
|
12906
13037
|
}
|
|
12907
13038
|
setSelection(anchor, head, view, force = false) {
|
|
@@ -12918,7 +13049,7 @@ var ViewDesc = class {
|
|
|
12918
13049
|
let brKludge = false;
|
|
12919
13050
|
if ((gecko || safari) && anchor == head) {
|
|
12920
13051
|
let { node, offset } = anchorDOM;
|
|
12921
|
-
if (node
|
|
13052
|
+
if (isText(node)) {
|
|
12922
13053
|
brKludge = !!(offset && node.nodeValue[offset - 1] == "\n");
|
|
12923
13054
|
if (brKludge && offset == node.nodeValue.length) for (let scan = node, after; scan; scan = scan.parentNode) {
|
|
12924
13055
|
if (after = scan.nextSibling) {
|
|
@@ -12936,7 +13067,7 @@ var ViewDesc = class {
|
|
|
12936
13067
|
brKludge = prev && (prev.nodeName == "BR" || prev.contentEditable == "false");
|
|
12937
13068
|
}
|
|
12938
13069
|
}
|
|
12939
|
-
if (gecko && selRange.focusNode && selRange.focusNode != headDOM.node && selRange.focusNode
|
|
13070
|
+
if (gecko && selRange.focusNode && selRange.focusNode != headDOM.node && isElt(selRange.focusNode)) {
|
|
12940
13071
|
let after = selRange.focusNode.childNodes[selRange.focusOffset];
|
|
12941
13072
|
if (after && after.contentEditable == "false") force = true;
|
|
12942
13073
|
}
|
|
@@ -13012,13 +13143,10 @@ var WidgetViewDesc = class extends ViewDesc {
|
|
|
13012
13143
|
if (self.parent) return self.parent.posBeforeChild(self);
|
|
13013
13144
|
});
|
|
13014
13145
|
if (!widget.type.spec.raw) {
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
|
|
13019
|
-
}
|
|
13020
|
-
if (!dom.hasAttribute("contenteditable")) dom.contentEditable = "false";
|
|
13021
|
-
dom.classList.add("ProseMirror-widget");
|
|
13146
|
+
let elt = isElt(dom) ? dom : document.createElement("span");
|
|
13147
|
+
if (elt != dom) elt.appendChild(dom);
|
|
13148
|
+
if (!elt.hasAttribute("contenteditable")) elt.contentEditable = "false";
|
|
13149
|
+
elt.classList.add("ProseMirror-widget");
|
|
13022
13150
|
}
|
|
13023
13151
|
super(parent, [], dom, null);
|
|
13024
13152
|
this.widget = widget;
|
|
@@ -13141,7 +13269,7 @@ var NodeViewDesc = class NodeViewDesc extends ViewDesc {
|
|
|
13141
13269
|
let dom = spec && spec.dom, contentDOM = spec && spec.contentDOM;
|
|
13142
13270
|
if (node.isText) {
|
|
13143
13271
|
if (!dom) dom = document.createTextNode(node.text);
|
|
13144
|
-
else if (dom
|
|
13272
|
+
else if (!isText(dom)) throw new RangeError("Text must be rendered as a DOM text node");
|
|
13145
13273
|
} else if (!dom) {
|
|
13146
13274
|
let spec = DOMSerializer.renderSpec(document, node.type.spec.toDOM(node), null, node.attrs);
|
|
13147
13275
|
({dom, contentDOM} = spec);
|
|
@@ -13174,7 +13302,7 @@ var NodeViewDesc = class NodeViewDesc extends ViewDesc {
|
|
|
13174
13302
|
}
|
|
13175
13303
|
}
|
|
13176
13304
|
if (!rule.contentElement) {
|
|
13177
|
-
let found = addedNodes && addedNodes.find((n) => n
|
|
13305
|
+
let found = addedNodes && addedNodes.find((n) => isElt(n) && addedNodes.indexOf(n.parentNode) < 0 && this.dom.contains(n));
|
|
13178
13306
|
if (found) rule.contentElement = found;
|
|
13179
13307
|
else rule.getContent = () => Fragment.empty;
|
|
13180
13308
|
}
|
|
@@ -13196,18 +13324,21 @@ var NodeViewDesc = class NodeViewDesc extends ViewDesc {
|
|
|
13196
13324
|
let localComposition = composition && composition.pos > -1 ? composition : null;
|
|
13197
13325
|
let compositionInChild = composition && composition.pos < 0;
|
|
13198
13326
|
let updater = new ViewTreeUpdater(this, localComposition && localComposition.node, view);
|
|
13327
|
+
let addBuffers = this.node.inlineContent, atBufferPos = addBuffers && this.node.isBlock;
|
|
13199
13328
|
iterDeco(this.node, this.innerDeco, (widget, i, insideNode) => {
|
|
13200
13329
|
if (widget.spec.marks) updater.syncToMarks(widget.spec.marks, inline, view, i);
|
|
13201
13330
|
else if (widget.type.side >= 0 && !insideNode) updater.syncToMarks(i == this.node.childCount ? Mark$1.none : this.node.child(i).marks, inline, view, i);
|
|
13202
13331
|
updater.placeWidget(widget, view, off);
|
|
13203
13332
|
}, (child, outerDeco, innerDeco, i) => {
|
|
13204
13333
|
updater.syncToMarks(child.marks, inline, view, i);
|
|
13334
|
+
if (atBufferPos && child.isAtom && !child.isText) updater.addHackNode("IMG", updater.top);
|
|
13205
13335
|
let compIndex;
|
|
13206
13336
|
if (updater.findNodeMatch(child, outerDeco, innerDeco, i));
|
|
13207
13337
|
else if (compositionInChild && view.state.selection.from > off && view.state.selection.to < off + child.nodeSize && (compIndex = updater.findIndexWithChild(composition.node)) > -1 && updater.updateNodeAt(child, outerDeco, innerDeco, compIndex, view));
|
|
13208
13338
|
else if (updater.updateNextNode(child, outerDeco, innerDeco, view, i, off));
|
|
13209
13339
|
else updater.addNode(child, outerDeco, innerDeco, view, off);
|
|
13210
13340
|
off += child.nodeSize;
|
|
13341
|
+
if (addBuffers) atBufferPos = child.isAtom && !child.isText;
|
|
13211
13342
|
});
|
|
13212
13343
|
updater.syncToMarks([], inline, view, 0);
|
|
13213
13344
|
if (this.node.isTextblock) updater.addTextblockHacks();
|
|
@@ -13264,7 +13395,7 @@ var NodeViewDesc = class NodeViewDesc extends ViewDesc {
|
|
|
13264
13395
|
}
|
|
13265
13396
|
updateOuterDeco(outerDeco) {
|
|
13266
13397
|
if (sameOuterDeco(outerDeco, this.outerDeco)) return;
|
|
13267
|
-
let needsWrap = this.nodeDOM
|
|
13398
|
+
let needsWrap = !isElt(this.nodeDOM);
|
|
13268
13399
|
let oldDOM = this.dom;
|
|
13269
13400
|
this.dom = patchOuterDeco(this.dom, this.nodeDOM, computeOuterDeco(this.outerDeco, this.node, needsWrap), computeOuterDeco(outerDeco, this.node, needsWrap));
|
|
13270
13401
|
if (this.dom != oldDOM) {
|
|
@@ -13274,13 +13405,13 @@ var NodeViewDesc = class NodeViewDesc extends ViewDesc {
|
|
|
13274
13405
|
this.outerDeco = outerDeco;
|
|
13275
13406
|
}
|
|
13276
13407
|
selectNode() {
|
|
13277
|
-
if (this.nodeDOM
|
|
13408
|
+
if (isElt(this.nodeDOM)) {
|
|
13278
13409
|
this.nodeDOM.classList.add("ProseMirror-selectednode");
|
|
13279
13410
|
if (this.contentDOM || !this.node.type.spec.draggable) this.nodeDOM.draggable = true;
|
|
13280
13411
|
}
|
|
13281
13412
|
}
|
|
13282
13413
|
deselectNode() {
|
|
13283
|
-
if (this.nodeDOM
|
|
13414
|
+
if (isElt(this.nodeDOM)) {
|
|
13284
13415
|
this.nodeDOM.classList.remove("ProseMirror-selectednode");
|
|
13285
13416
|
if (this.contentDOM || !this.node.type.spec.draggable) this.nodeDOM.removeAttribute("draggable");
|
|
13286
13417
|
}
|
|
@@ -13348,7 +13479,7 @@ var TextViewDesc = class TextViewDesc extends NodeViewDesc {
|
|
|
13348
13479
|
return this.node.text == text;
|
|
13349
13480
|
}
|
|
13350
13481
|
};
|
|
13351
|
-
var
|
|
13482
|
+
var BufferHackViewDesc = class extends ViewDesc {
|
|
13352
13483
|
parseRule() {
|
|
13353
13484
|
return { ignore: true };
|
|
13354
13485
|
}
|
|
@@ -13484,7 +13615,7 @@ function patchAttributes(dom, prev, cur) {
|
|
|
13484
13615
|
}
|
|
13485
13616
|
}
|
|
13486
13617
|
function applyOuterDeco(dom, deco, node) {
|
|
13487
|
-
return patchOuterDeco(dom, dom, noDeco, computeOuterDeco(deco, node, dom
|
|
13618
|
+
return patchOuterDeco(dom, dom, noDeco, computeOuterDeco(deco, node, !isElt(dom)));
|
|
13488
13619
|
}
|
|
13489
13620
|
function sameOuterDeco(a, b) {
|
|
13490
13621
|
if (a.length != b.length) return false;
|
|
@@ -13674,14 +13805,14 @@ var ViewTreeUpdater = class {
|
|
|
13674
13805
|
dom.alt = "";
|
|
13675
13806
|
}
|
|
13676
13807
|
if (nodeName == "BR") dom.className = "ProseMirror-trailingBreak";
|
|
13677
|
-
let hack = new
|
|
13808
|
+
let hack = new BufferHackViewDesc(this.top, [], dom, null);
|
|
13678
13809
|
if (parent != this.top) parent.children.push(hack);
|
|
13679
13810
|
else parent.children.splice(this.index++, 0, hack);
|
|
13680
13811
|
this.changed = true;
|
|
13681
13812
|
}
|
|
13682
13813
|
}
|
|
13683
13814
|
isLocked(node) {
|
|
13684
|
-
return this.lock && (node == this.lock || node
|
|
13815
|
+
return this.lock && (node == this.lock || isElt(node) && node.contains(this.lock.parentNode));
|
|
13685
13816
|
}
|
|
13686
13817
|
};
|
|
13687
13818
|
function preMatch(frag, parentDesc) {
|
|
@@ -13825,10 +13956,15 @@ function selectionFromDOM(view, origin = null) {
|
|
|
13825
13956
|
if (selectionCollapsed(domSel)) {
|
|
13826
13957
|
anchor = head;
|
|
13827
13958
|
while (nearestDesc && !nearestDesc.node) nearestDesc = nearestDesc.parent;
|
|
13828
|
-
|
|
13829
|
-
if (nearestDesc && nearestDescNode.isAtom && NodeSelection.isSelectable(nearestDescNode) && nearestDesc.parent && !(nearestDescNode.isInline && isOnEdge(domSel.focusNode, domSel.focusOffset, nearestDesc.dom))) {
|
|
13959
|
+
if (nearestDesc && nearestDesc.node.isAtom && NodeSelection.isSelectable(nearestDesc.node) && nearestDesc.parent && !(nearestDesc.node.isInline && isOnEdge(domSel.focusNode, domSel.focusOffset, nearestDesc.dom))) {
|
|
13830
13960
|
let pos = nearestDesc.posBefore;
|
|
13831
13961
|
selection = new NodeSelection(head == pos ? $head : doc.resolve(pos));
|
|
13962
|
+
} else if (gecko && origin == "key" && head > view.state.selection.to && isElt(domSel.focusNode) && domSel.focusOffset == domSel.focusNode.childNodes.length && nearestDesc && nearestDesc.posAtStart > view.state.selection.to) for (let scan = domSel.focusNode;; scan = scan.parentNode) {
|
|
13963
|
+
if (getComputedStyle(scan).overflow != "visible") {
|
|
13964
|
+
selection = Selection$1.findFrom(doc.resolve(nearestDesc.posAtStart), 1);
|
|
13965
|
+
break;
|
|
13966
|
+
}
|
|
13967
|
+
if (scan == nearestDesc.dom || scan.nextSibling || !scan.parentNode || !isElt(scan.parentNode)) break;
|
|
13832
13968
|
}
|
|
13833
13969
|
} else {
|
|
13834
13970
|
if (domSel instanceof view.dom.ownerDocument.defaultView.Selection && domSel.rangeCount > 1) {
|
|
@@ -13966,7 +14102,7 @@ function hasSelection(view) {
|
|
|
13966
14102
|
let sel = view.domSelectionRange();
|
|
13967
14103
|
if (!sel.anchorNode) return false;
|
|
13968
14104
|
try {
|
|
13969
|
-
return view.dom
|
|
14105
|
+
return contains(view.dom, sel.anchorNode) && (view.editable || contains(view.dom, sel.focusNode));
|
|
13970
14106
|
} catch (_) {
|
|
13971
14107
|
return false;
|
|
13972
14108
|
}
|
|
@@ -14005,8 +14141,7 @@ function selectHorizontally(view, dir, mods) {
|
|
|
14005
14141
|
let nodePos = dir < 0 ? $head.pos - node.nodeSize : $head.pos;
|
|
14006
14142
|
if (!(node.isAtom || (desc = view.docView.descAt(nodePos)) && !desc.contentDOM)) return false;
|
|
14007
14143
|
if (NodeSelection.isSelectable(node)) return apply(view, new NodeSelection(dir < 0 ? view.state.doc.resolve($head.pos - node.nodeSize) : $head));
|
|
14008
|
-
else
|
|
14009
|
-
else return false;
|
|
14144
|
+
else return apply(view, new TextSelection(view.state.doc.resolve(dir < 0 ? nodePos : nodePos + node.nodeSize)));
|
|
14010
14145
|
}
|
|
14011
14146
|
} else if (sel instanceof NodeSelection && sel.node.isInline) return apply(view, new TextSelection(dir > 0 ? sel.$to : sel.$from));
|
|
14012
14147
|
else {
|
|
@@ -14015,12 +14150,9 @@ function selectHorizontally(view, dir, mods) {
|
|
|
14015
14150
|
return false;
|
|
14016
14151
|
}
|
|
14017
14152
|
}
|
|
14018
|
-
function nodeLen(node) {
|
|
14019
|
-
return node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length;
|
|
14020
|
-
}
|
|
14021
14153
|
function isIgnorable(dom, dir) {
|
|
14022
14154
|
let desc = dom.pmViewDesc;
|
|
14023
|
-
return desc
|
|
14155
|
+
return desc ? desc.size == 0 && (dir < 0 || dom.nextSibling || dom.nodeName != "BR") : isElt(dom) && dom.contentEditable == "false";
|
|
14024
14156
|
}
|
|
14025
14157
|
function skipIgnoredNodes(view, dir) {
|
|
14026
14158
|
return dir < 0 ? skipIgnoredNodesBefore(view) : skipIgnoredNodesAfter(view);
|
|
@@ -14030,19 +14162,18 @@ function skipIgnoredNodesBefore(view) {
|
|
|
14030
14162
|
let node = sel.focusNode, offset = sel.focusOffset;
|
|
14031
14163
|
if (!node) return;
|
|
14032
14164
|
let moveNode, moveOffset, force = false;
|
|
14033
|
-
if (gecko && node
|
|
14034
|
-
for (;;) if (offset > 0)
|
|
14035
|
-
|
|
14165
|
+
if (gecko && isElt(node) && offset < nodeSize(node) && isIgnorable(node.childNodes[offset], -1)) force = true;
|
|
14166
|
+
for (;;) if (offset > 0) {
|
|
14167
|
+
if (!isElt(node)) break;
|
|
14036
14168
|
let before = node.childNodes[offset - 1];
|
|
14037
14169
|
if (isIgnorable(before, -1)) {
|
|
14038
14170
|
moveNode = node;
|
|
14039
14171
|
moveOffset = --offset;
|
|
14040
|
-
} else if (before
|
|
14172
|
+
} else if (isText(before)) {
|
|
14041
14173
|
node = before;
|
|
14042
14174
|
offset = node.nodeValue.length;
|
|
14043
14175
|
} else break;
|
|
14044
|
-
}
|
|
14045
|
-
else if (isBlockNode(node)) break;
|
|
14176
|
+
} else if (isBlockNode(node)) break;
|
|
14046
14177
|
else {
|
|
14047
14178
|
let prev = node.previousSibling;
|
|
14048
14179
|
while (prev && isIgnorable(prev, -1)) {
|
|
@@ -14056,7 +14187,7 @@ function skipIgnoredNodesBefore(view) {
|
|
|
14056
14187
|
offset = 0;
|
|
14057
14188
|
} else {
|
|
14058
14189
|
node = prev;
|
|
14059
|
-
offset =
|
|
14190
|
+
offset = nodeSize(node);
|
|
14060
14191
|
}
|
|
14061
14192
|
}
|
|
14062
14193
|
if (force) setSelFocus(view, node, offset);
|
|
@@ -14066,10 +14197,10 @@ function skipIgnoredNodesAfter(view) {
|
|
|
14066
14197
|
let sel = view.domSelectionRange();
|
|
14067
14198
|
let node = sel.focusNode, offset = sel.focusOffset;
|
|
14068
14199
|
if (!node) return;
|
|
14069
|
-
let len =
|
|
14200
|
+
let len = nodeSize(node);
|
|
14070
14201
|
let moveNode, moveOffset;
|
|
14071
14202
|
for (;;) if (offset < len) {
|
|
14072
|
-
if (node
|
|
14203
|
+
if (!isElt(node)) break;
|
|
14073
14204
|
let after = node.childNodes[offset];
|
|
14074
14205
|
if (isIgnorable(after, 1)) {
|
|
14075
14206
|
moveNode = node;
|
|
@@ -14090,7 +14221,7 @@ function skipIgnoredNodesAfter(view) {
|
|
|
14090
14221
|
} else {
|
|
14091
14222
|
node = next;
|
|
14092
14223
|
offset = 0;
|
|
14093
|
-
len =
|
|
14224
|
+
len = nodeSize(node);
|
|
14094
14225
|
}
|
|
14095
14226
|
}
|
|
14096
14227
|
if (moveNode) setSelFocus(view, moveNode, moveOffset);
|
|
@@ -14106,8 +14237,8 @@ function textNodeAfter(node, offset) {
|
|
|
14106
14237
|
}
|
|
14107
14238
|
while (node && offset < node.childNodes.length) {
|
|
14108
14239
|
let next = node.childNodes[offset];
|
|
14109
|
-
if (next
|
|
14110
|
-
if (next
|
|
14240
|
+
if (isText(next)) return next;
|
|
14241
|
+
if (isElt(next) && next.contentEditable == "false") break;
|
|
14111
14242
|
node = next;
|
|
14112
14243
|
offset = 0;
|
|
14113
14244
|
}
|
|
@@ -14119,14 +14250,14 @@ function textNodeBefore(node, offset) {
|
|
|
14119
14250
|
}
|
|
14120
14251
|
while (node && offset) {
|
|
14121
14252
|
let next = node.childNodes[offset - 1];
|
|
14122
|
-
if (next
|
|
14123
|
-
if (next
|
|
14253
|
+
if (isText(next)) return next;
|
|
14254
|
+
if (isElt(next) && next.contentEditable == "false") break;
|
|
14124
14255
|
node = next;
|
|
14125
14256
|
offset = node.childNodes.length;
|
|
14126
14257
|
}
|
|
14127
14258
|
}
|
|
14128
14259
|
function setSelFocus(view, node, offset) {
|
|
14129
|
-
if (node
|
|
14260
|
+
if (!isText(node)) {
|
|
14130
14261
|
let before, after;
|
|
14131
14262
|
if (after = textNodeAfter(node, offset)) {
|
|
14132
14263
|
node = after;
|
|
@@ -14208,7 +14339,7 @@ function switchEditable(view, node, state) {
|
|
|
14208
14339
|
function safariDownArrowBug(view) {
|
|
14209
14340
|
if (!safari || view.state.selection.$head.parentOffset > 0) return false;
|
|
14210
14341
|
let { focusNode, focusOffset } = view.domSelectionRange();
|
|
14211
|
-
if (focusNode && focusNode
|
|
14342
|
+
if (focusNode && isElt(focusNode) && focusOffset == 0 && focusNode.firstChild && isElt(focusNode.firstChild) && focusNode.firstChild.contentEditable == "false") {
|
|
14212
14343
|
let child = focusNode.firstChild;
|
|
14213
14344
|
switchEditable(view, child, "true");
|
|
14214
14345
|
setTimeout(() => switchEditable(view, child, "false"), 20);
|
|
@@ -14255,7 +14386,7 @@ function serializeForClipboard(view, slice) {
|
|
|
14255
14386
|
let doc = detachedDoc(), wrap = doc.createElement("div");
|
|
14256
14387
|
wrap.appendChild(serializer.serializeFragment(content, { document: doc }));
|
|
14257
14388
|
let firstChild = wrap.firstChild, needsWrap, wrappers = 0;
|
|
14258
|
-
while (firstChild && firstChild
|
|
14389
|
+
while (firstChild && isElt(firstChild) && (needsWrap = wrapMap[firstChild.nodeName.toLowerCase()])) {
|
|
14259
14390
|
for (let i = needsWrap.length - 1; i >= 0; i--) {
|
|
14260
14391
|
let wrapper = doc.createElement(needsWrap[i]);
|
|
14261
14392
|
while (wrap.firstChild) wrapper.appendChild(wrap.firstChild);
|
|
@@ -14264,7 +14395,7 @@ function serializeForClipboard(view, slice) {
|
|
|
14264
14395
|
}
|
|
14265
14396
|
firstChild = wrap.firstChild;
|
|
14266
14397
|
}
|
|
14267
|
-
if (firstChild && firstChild
|
|
14398
|
+
if (firstChild && isElt(firstChild)) firstChild.setAttribute("data-pm-slice", `${openStart} ${openEnd}${wrappers ? ` -${wrappers}` : ""} ${JSON.stringify(context)}`);
|
|
14268
14399
|
return {
|
|
14269
14400
|
dom: wrap,
|
|
14270
14401
|
text: view.someProp("clipboardTextSerializer", (f) => f(slice, view)) || slice.content.textBetween(0, slice.content.size, "\n\n"),
|
|
@@ -14309,7 +14440,7 @@ function parseFromClipboard(view, text, html, plainText, $context) {
|
|
|
14309
14440
|
let sliceData = contextNode && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(contextNode.getAttribute("data-pm-slice") || "");
|
|
14310
14441
|
if (sliceData && sliceData[3]) for (let i = +sliceData[3]; i > 0; i--) {
|
|
14311
14442
|
let child = dom.firstChild;
|
|
14312
|
-
while (child && child
|
|
14443
|
+
while (child && !isElt(child)) child = child.nextSibling;
|
|
14313
14444
|
if (!child) break;
|
|
14314
14445
|
dom = child;
|
|
14315
14446
|
}
|
|
@@ -14462,11 +14593,10 @@ function addContext(slice, context) {
|
|
|
14462
14593
|
let type = schema.nodes[array[i]];
|
|
14463
14594
|
if (!type || type.hasRequiredAttrs()) break;
|
|
14464
14595
|
try {
|
|
14465
|
-
type.
|
|
14596
|
+
content = Fragment.from(type.create(array[i + 1], content));
|
|
14466
14597
|
} catch (e) {
|
|
14467
14598
|
break;
|
|
14468
14599
|
}
|
|
14469
|
-
content = Fragment.from(type.create(array[i + 1], content));
|
|
14470
14600
|
openStart++;
|
|
14471
14601
|
openEnd++;
|
|
14472
14602
|
}
|
|
@@ -14610,14 +14740,14 @@ function updateSelection(view, selection, origin) {
|
|
|
14610
14740
|
if (!view.focused) view.focus();
|
|
14611
14741
|
if (view.state.selection.eq(selection)) return;
|
|
14612
14742
|
let tr = view.state.tr.setSelection(selection);
|
|
14613
|
-
|
|
14743
|
+
tr.setMeta("pointer", true);
|
|
14614
14744
|
view.dispatch(tr);
|
|
14615
14745
|
}
|
|
14616
14746
|
function selectClickedLeaf(view, inside) {
|
|
14617
14747
|
if (inside == -1) return false;
|
|
14618
14748
|
let $pos = view.state.doc.resolve(inside), node = $pos.nodeAfter;
|
|
14619
14749
|
if (node && node.isAtom && NodeSelection.isSelectable(node)) {
|
|
14620
|
-
updateSelection(view, new NodeSelection($pos)
|
|
14750
|
+
updateSelection(view, new NodeSelection($pos));
|
|
14621
14751
|
return true;
|
|
14622
14752
|
}
|
|
14623
14753
|
return false;
|
|
@@ -14636,7 +14766,7 @@ function selectClickedNode(view, inside) {
|
|
|
14636
14766
|
}
|
|
14637
14767
|
}
|
|
14638
14768
|
if (selectAt != null) {
|
|
14639
|
-
updateSelection(view, NodeSelection.create(view.state.doc, selectAt)
|
|
14769
|
+
updateSelection(view, NodeSelection.create(view.state.doc, selectAt));
|
|
14640
14770
|
return true;
|
|
14641
14771
|
} else return false;
|
|
14642
14772
|
}
|
|
@@ -14653,7 +14783,7 @@ function defaultTripleClick(view, inside, event) {
|
|
|
14653
14783
|
if (event.button != 0) return false;
|
|
14654
14784
|
let selection = selectionForTripleClick(view, inside, true), doc = view.state.doc;
|
|
14655
14785
|
if (!selection) return false;
|
|
14656
|
-
updateSelection(view, selection
|
|
14786
|
+
updateSelection(view, selection);
|
|
14657
14787
|
if (selection instanceof TextSelection && doc.eq(view.state.doc)) view.input.mouseDown = new TripleClickDrag(view, selection);
|
|
14658
14788
|
return true;
|
|
14659
14789
|
}
|
|
@@ -14739,7 +14869,7 @@ var LeftMouseDown = class extends MouseDown {
|
|
|
14739
14869
|
}
|
|
14740
14870
|
const target = flushed ? null : event.target;
|
|
14741
14871
|
const targetDesc = target ? view.docView.nearestDesc(target, true) : null;
|
|
14742
|
-
this.target = targetDesc && targetDesc.nodeDOM
|
|
14872
|
+
this.target = targetDesc && isElt(targetDesc.nodeDOM) ? targetDesc.nodeDOM : null;
|
|
14743
14873
|
let { selection } = view.state;
|
|
14744
14874
|
if (event.button == 0 && (targetNode.type.spec.draggable && targetNode.type.spec.selectable !== false || selection instanceof NodeSelection && selection.from <= targetPos && selection.to > targetPos)) this.mightDrag = {
|
|
14745
14875
|
node: targetNode,
|
|
@@ -14778,7 +14908,7 @@ var LeftMouseDown = class extends MouseDown {
|
|
|
14778
14908
|
if (this.allowDefault || !pos) setSelectionOrigin(this.view, "pointer");
|
|
14779
14909
|
else if (handleSingleClick(this.view, pos.pos, pos.inside, event, this.selectNode)) event.preventDefault();
|
|
14780
14910
|
else if (event.button == 0 && (this.flushed || safari && this.mightDrag && !this.mightDrag.node.isAtom || chrome && !this.view.state.selection.visible && Math.min(Math.abs(pos.pos - this.view.state.selection.from), Math.abs(pos.pos - this.view.state.selection.to)) <= 2)) {
|
|
14781
|
-
updateSelection(this.view, Selection$1.near(this.view.state.doc.resolve(pos.pos))
|
|
14911
|
+
updateSelection(this.view, Selection$1.near(this.view.state.doc.resolve(pos.pos)));
|
|
14782
14912
|
event.preventDefault();
|
|
14783
14913
|
} else setSelectionOrigin(this.view, "pointer");
|
|
14784
14914
|
}
|
|
@@ -14814,7 +14944,7 @@ var TripleClickDrag = class extends MouseDown {
|
|
|
14814
14944
|
if (!target) return;
|
|
14815
14945
|
let { doc } = this.view.state, start = this.startSelection;
|
|
14816
14946
|
let [anchor, head] = target.from < start.from ? [start.to, target.from] : [start.from, target.to];
|
|
14817
|
-
updateSelection(this.view, TextSelection.create(doc, anchor, head)
|
|
14947
|
+
updateSelection(this.view, TextSelection.create(doc, anchor, head));
|
|
14818
14948
|
}
|
|
14819
14949
|
};
|
|
14820
14950
|
handlers.touchstart = (view) => {
|
|
@@ -14840,7 +14970,7 @@ editHandlers.compositionstart = editHandlers.compositionupdate = (view) => {
|
|
|
14840
14970
|
if (!view.composing) {
|
|
14841
14971
|
view.domObserver.flush();
|
|
14842
14972
|
let { state } = view, $pos = state.selection.$to;
|
|
14843
|
-
if (state.selection instanceof TextSelection && (state.storedMarks || !$pos.textOffset && $pos.parentOffset && $pos.nodeBefore.marks.some((m) => m.type.spec.inclusive === false) || chrome && windows$1 && selectionBeforeUneditable(view))) {
|
|
14973
|
+
if (state.selection instanceof TextSelection && state.selection.empty && (state.storedMarks || !$pos.textOffset && $pos.parentOffset && $pos.nodeBefore.marks.some((m) => m.type.spec.inclusive === false) || chrome && windows$1 && selectionBeforeUneditable(view))) {
|
|
14844
14974
|
view.markCursor = view.state.storedMarks || $pos.marks();
|
|
14845
14975
|
endComposition(view, true);
|
|
14846
14976
|
view.markCursor = null;
|
|
@@ -14848,10 +14978,10 @@ editHandlers.compositionstart = editHandlers.compositionupdate = (view) => {
|
|
|
14848
14978
|
endComposition(view, !state.selection.empty);
|
|
14849
14979
|
if (gecko && state.selection.empty && $pos.parentOffset && !$pos.textOffset && $pos.nodeBefore.marks.length) {
|
|
14850
14980
|
let sel = view.domSelectionRange();
|
|
14851
|
-
for (let node = sel.focusNode, offset = sel.focusOffset; node && node
|
|
14981
|
+
for (let node = sel.focusNode, offset = sel.focusOffset; node && isElt(node) && offset != 0;) {
|
|
14852
14982
|
let before = offset < 0 ? node.lastChild : node.childNodes[offset - 1];
|
|
14853
14983
|
if (!before) break;
|
|
14854
|
-
if (before
|
|
14984
|
+
if (isText(before)) {
|
|
14855
14985
|
let sel = view.domSelection();
|
|
14856
14986
|
if (sel) sel.collapse(before, before.nodeValue.length);
|
|
14857
14987
|
break;
|
|
@@ -14868,9 +14998,9 @@ editHandlers.compositionstart = editHandlers.compositionupdate = (view) => {
|
|
|
14868
14998
|
};
|
|
14869
14999
|
function selectionBeforeUneditable(view) {
|
|
14870
15000
|
let { focusNode, focusOffset } = view.domSelectionRange();
|
|
14871
|
-
if (!focusNode || focusNode
|
|
15001
|
+
if (!focusNode || !isElt(focusNode) || focusOffset >= focusNode.childNodes.length) return false;
|
|
14872
15002
|
let next = focusNode.childNodes[focusOffset];
|
|
14873
|
-
return next
|
|
15003
|
+
return isElt(next) && next.contentEditable == "false";
|
|
14874
15004
|
}
|
|
14875
15005
|
editHandlers.compositionend = (view, event) => {
|
|
14876
15006
|
if (view.composing) {
|
|
@@ -15023,7 +15153,7 @@ handlers.dragstart = (view, _event) => {
|
|
|
15023
15153
|
let node;
|
|
15024
15154
|
if (pos && pos.pos >= sel.from && pos.pos <= (sel instanceof NodeSelection ? sel.to - 1 : sel.to));
|
|
15025
15155
|
else if (mouseDown && mouseDown.mightDrag) node = NodeSelection.create(view.state.doc, mouseDown.mightDrag.pos);
|
|
15026
|
-
else if (event.target && event.target
|
|
15156
|
+
else if (event.target && isElt(event.target)) {
|
|
15027
15157
|
let desc = view.docView.nearestDesc(event.target, true);
|
|
15028
15158
|
if (desc && desc.node.type.spec.draggable && desc != view.docView) node = NodeSelection.create(view.state.doc, desc.posBefore);
|
|
15029
15159
|
}
|
|
@@ -15796,7 +15926,7 @@ var DOMObserver = class {
|
|
|
15796
15926
|
let desc = container && this.view.docView.nearestDesc(container);
|
|
15797
15927
|
if (desc && desc.ignoreMutation({
|
|
15798
15928
|
type: "selection",
|
|
15799
|
-
target: container
|
|
15929
|
+
target: isText(container) ? container.parentNode : container
|
|
15800
15930
|
})) {
|
|
15801
15931
|
this.setCurSelection();
|
|
15802
15932
|
return true;
|
|
@@ -15825,7 +15955,7 @@ var DOMObserver = class {
|
|
|
15825
15955
|
if (added.some((n) => n.nodeName == "BR") && (view.input.lastKeyCode == 8 || view.input.lastKeyCode == 46 || chrome && (view.composing || view.input.compositionEndedAt > Date.now() - 50) && mutations.some((m) => m.type == "childList" && m.removedNodes.length))) {
|
|
15826
15956
|
for (let node of added) if (node.nodeName == "BR" && node.parentNode) {
|
|
15827
15957
|
let after = node.nextSibling;
|
|
15828
|
-
while (after && after
|
|
15958
|
+
while (after && isElt(after)) {
|
|
15829
15959
|
if (after.contentEditable == "false") {
|
|
15830
15960
|
node.parentNode.removeChild(node);
|
|
15831
15961
|
break;
|
|
@@ -15877,7 +16007,7 @@ var DOMObserver = class {
|
|
|
15877
16007
|
for (let i = 0; i < mut.addedNodes.length; i++) {
|
|
15878
16008
|
let node = mut.addedNodes[i];
|
|
15879
16009
|
added.push(node);
|
|
15880
|
-
if (node
|
|
16010
|
+
if (isText(node)) this.lastChangedTextNode = node;
|
|
15881
16011
|
}
|
|
15882
16012
|
if (desc.contentDOM && desc.contentDOM != desc.dom && !desc.contentDOM.contains(mut.target)) return {
|
|
15883
16013
|
from: desc.posBefore,
|
|
@@ -15976,7 +16106,7 @@ function fixUpBadSafariComposition(view, addedNodes) {
|
|
|
15976
16106
|
let parent = nextCell;
|
|
15977
16107
|
for (;;) {
|
|
15978
16108
|
let first = parent.firstChild;
|
|
15979
|
-
if (!first || first
|
|
16109
|
+
if (!first || !isElt(first) || first.contentEditable == "false" || /^(BR|IMG)$/.test(first.nodeName)) break;
|
|
15980
16110
|
parent = first;
|
|
15981
16111
|
}
|
|
15982
16112
|
parent.insertBefore(node, parent.firstChild);
|
|
@@ -15989,7 +16119,7 @@ function parseBetween(view, from_, to_, addedNodes) {
|
|
|
15989
16119
|
let domSel = view.domSelectionRange();
|
|
15990
16120
|
let find;
|
|
15991
16121
|
let anchor = domSel.anchorNode;
|
|
15992
|
-
if (anchor && view.dom
|
|
16122
|
+
if (anchor && contains(view.dom, anchor)) {
|
|
15993
16123
|
find = [{
|
|
15994
16124
|
node: anchor,
|
|
15995
16125
|
offset: domSel.anchorOffset
|
|
@@ -16083,7 +16213,7 @@ function readDOMChange(view, from, to, typeOver, addedNodes) {
|
|
|
16083
16213
|
view.input.lastKeyCode = null;
|
|
16084
16214
|
let change = findDiff(compare.content, parse.doc.content, parse.from, preferredPos, preferredSide);
|
|
16085
16215
|
if (change) view.input.domChangeCount++;
|
|
16086
|
-
if ((ios && view.input.lastIOSEnter > Date.now() - 225 || android) && addedNodes.some((n) => n
|
|
16216
|
+
if ((ios && view.input.lastIOSEnter > Date.now() - 225 || android) && addedNodes.some((n) => isElt(n) && !isInline.test(n.nodeName)) && (!change || change.endA >= change.endB) && view.someProp("handleKeyDown", (f) => f(view, keyEvent(13, "Enter")))) {
|
|
16087
16217
|
view.input.lastIOSEnter = 0;
|
|
16088
16218
|
return;
|
|
16089
16219
|
}
|
|
@@ -16119,7 +16249,7 @@ function readDOMChange(view, from, to, typeOver, addedNodes) {
|
|
|
16119
16249
|
let $to = parse.doc.resolveNoCache(change.endB - parse.from);
|
|
16120
16250
|
let $fromA = doc.resolve(change.start);
|
|
16121
16251
|
let inlineChange = $from.sameParent($to) && $from.parent.inlineContent && $fromA.end() >= change.endA;
|
|
16122
|
-
if ((ios && view.input.lastIOSEnter > Date.now() - 225 && (!inlineChange || addedNodes.some((n) => n.nodeName == "DIV" || n.nodeName == "P")) || !inlineChange &&
|
|
16252
|
+
if ((ios && view.input.lastIOSEnter > Date.now() - 225 && (!inlineChange || addedNodes.some((n) => n.nodeName == "DIV" || n.nodeName == "P")) || !inlineChange && looksLikeEnter(parse.doc, $from.pos, $to.pos)) && view.someProp("handleKeyDown", (f) => f(view, keyEvent(13, "Enter")))) {
|
|
16123
16253
|
view.input.lastIOSEnter = 0;
|
|
16124
16254
|
return;
|
|
16125
16255
|
}
|
|
@@ -16206,6 +16336,14 @@ function looksLikeBackspace(old, start, end, $newStart, $newEnd) {
|
|
|
16206
16336
|
if (!$next.parent.isTextblock || $next.pos > end || skipClosingAndOpening($next, true, false) < end) return false;
|
|
16207
16337
|
return $newStart.parent.content.cut($newStart.parentOffset).eq($next.parent.content);
|
|
16208
16338
|
}
|
|
16339
|
+
function looksLikeEnter(content, from, to) {
|
|
16340
|
+
let newTextlines = 0, newLeaves = 0;
|
|
16341
|
+
content.nodesBetween(from, to, (node, pos) => {
|
|
16342
|
+
if (node.isTextblock && pos >= from && pos < to) newTextlines++;
|
|
16343
|
+
else if (node.isText ? /\S/.test(node.text.slice(Math.max(0, from - pos), Math.min(node.nodeSize, to - pos))) : node.isLeaf) newLeaves++;
|
|
16344
|
+
});
|
|
16345
|
+
return newLeaves == 0 && newTextlines == 1;
|
|
16346
|
+
}
|
|
16209
16347
|
function skipClosingAndOpening($pos, fromEnd, mayOpen) {
|
|
16210
16348
|
let depth = $pos.depth, end = fromEnd ? $pos.end() : $pos.pos;
|
|
16211
16349
|
while (depth > 0 && (fromEnd || $pos.indexAfter(depth) == $pos.node(depth).childCount)) {
|
|
@@ -16430,11 +16568,11 @@ var EditorView = class {
|
|
|
16430
16568
|
*/
|
|
16431
16569
|
scrollToSelection() {
|
|
16432
16570
|
let startDOM = this.domSelectionRange().focusNode;
|
|
16433
|
-
if (!startDOM || !this.dom
|
|
16571
|
+
if (!startDOM || !contains(this.dom, startDOM));
|
|
16434
16572
|
else if (this.someProp("handleScrollToSelection", (f) => f(this)));
|
|
16435
16573
|
else if (this.state.selection instanceof NodeSelection) {
|
|
16436
16574
|
let target = this.docView.domAfterPos(this.state.selection.from);
|
|
16437
|
-
if (target
|
|
16575
|
+
if (isElt(target)) scrollRectIntoView(this, target.getBoundingClientRect(), startDOM);
|
|
16438
16576
|
} else scrollRectIntoView(this, this.coordsAtPos(this.state.selection.head, 1), startDOM);
|
|
16439
16577
|
}
|
|
16440
16578
|
destroyPluginViews() {
|
|
@@ -16663,7 +16801,7 @@ var EditorView = class {
|
|
|
16663
16801
|
@internal
|
|
16664
16802
|
*/
|
|
16665
16803
|
domSelectionRange() {
|
|
16666
|
-
let sel = this.domSelection();
|
|
16804
|
+
let sel = this.dom.isConnected !== false && this.domSelection();
|
|
16667
16805
|
if (!sel) return {
|
|
16668
16806
|
focusNode: null,
|
|
16669
16807
|
focusOffset: 0,
|
|
@@ -16826,11 +16964,11 @@ var shift = {
|
|
|
16826
16964
|
};
|
|
16827
16965
|
var mac$1 = typeof navigator != "undefined" && /Mac/.test(navigator.platform);
|
|
16828
16966
|
var ie = typeof navigator != "undefined" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
16829
|
-
for (var i = 0; i < 10; i++) base[48 + i] = base[96 + i] = String(i);
|
|
16830
|
-
for (var i = 1; i <= 24; i++) base[i + 111] = "F" + i;
|
|
16831
|
-
for (var i = 65; i <= 90; i++) {
|
|
16832
|
-
base[i] = String.fromCharCode(i + 32);
|
|
16833
|
-
shift[i] = String.fromCharCode(i);
|
|
16967
|
+
for (var i$1 = 0; i$1 < 10; i$1++) base[48 + i$1] = base[96 + i$1] = String(i$1);
|
|
16968
|
+
for (var i$1 = 1; i$1 <= 24; i$1++) base[i$1 + 111] = "F" + i$1;
|
|
16969
|
+
for (var i$1 = 65; i$1 <= 90; i$1++) {
|
|
16970
|
+
base[i$1] = String.fromCharCode(i$1 + 32);
|
|
16971
|
+
shift[i$1] = String.fromCharCode(i$1);
|
|
16834
16972
|
}
|
|
16835
16973
|
for (var code in base) if (!shift.hasOwnProperty(code)) shift[code] = base[code];
|
|
16836
16974
|
function keyName(event) {
|
|
@@ -22840,7 +22978,7 @@ function render(tag, attributes) {
|
|
|
22840
22978
|
]);
|
|
22841
22979
|
return createJSXElement([tag, rest]);
|
|
22842
22980
|
}
|
|
22843
|
-
var h = (tag, attributes) => render(tag, attributes);
|
|
22981
|
+
var h$1 = (tag, attributes) => render(tag, attributes);
|
|
22844
22982
|
//#endregion
|
|
22845
22983
|
//#region ../../../node_modules/.bun/@tiptap+extension-blockquote@3.31.3+9ea2bbe04937c6bd/node_modules/@tiptap/extension-blockquote/dist/index.js
|
|
22846
22984
|
/**
|
|
@@ -22905,9 +23043,9 @@ var Blockquote = Node$1.create({
|
|
|
22905
23043
|
return [{ tag: "blockquote" }];
|
|
22906
23044
|
},
|
|
22907
23045
|
renderHTML({ HTMLAttributes }) {
|
|
22908
|
-
return /* @__PURE__ */ h("blockquote", {
|
|
23046
|
+
return /* @__PURE__ */ h$1("blockquote", {
|
|
22909
23047
|
...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
|
|
22910
|
-
children: /* @__PURE__ */ h("slot", {})
|
|
23048
|
+
children: /* @__PURE__ */ h$1("slot", {})
|
|
22911
23049
|
});
|
|
22912
23050
|
},
|
|
22913
23051
|
parseMarkdown: (token, helpers) => {
|
|
@@ -23001,9 +23139,9 @@ var Bold = Mark.create({
|
|
|
23001
23139
|
];
|
|
23002
23140
|
},
|
|
23003
23141
|
renderHTML({ HTMLAttributes }) {
|
|
23004
|
-
return /* @__PURE__ */ h("strong", {
|
|
23142
|
+
return /* @__PURE__ */ h$1("strong", {
|
|
23005
23143
|
...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
|
|
23006
|
-
children: /* @__PURE__ */ h("slot", {})
|
|
23144
|
+
children: /* @__PURE__ */ h$1("slot", {})
|
|
23007
23145
|
});
|
|
23008
23146
|
},
|
|
23009
23147
|
markdownTokenName: "strong",
|
|
@@ -27241,7 +27379,7 @@ var Underline = Mark.create({
|
|
|
27241
27379
|
}
|
|
27242
27380
|
});
|
|
27243
27381
|
//#endregion
|
|
27244
|
-
//#region ../../../node_modules/.bun/prosemirror-dropcursor@1.8.
|
|
27382
|
+
//#region ../../../node_modules/.bun/prosemirror-dropcursor@1.8.4/node_modules/prosemirror-dropcursor/dist/index.js
|
|
27245
27383
|
/**
|
|
27246
27384
|
Create a plugin that, when added to a ProseMirror instance,
|
|
27247
27385
|
causes a decoration to show up at the drop position when something
|
|
@@ -27264,6 +27402,7 @@ var DropCursorView = class {
|
|
|
27264
27402
|
this.cursorPos = null;
|
|
27265
27403
|
this.element = null;
|
|
27266
27404
|
this.timeout = -1;
|
|
27405
|
+
this.lastDragEvent = null;
|
|
27267
27406
|
this.width = (_a = options.width) !== null && _a !== void 0 ? _a : 1;
|
|
27268
27407
|
this.color = options.color === false ? void 0 : options.color || "black";
|
|
27269
27408
|
this.class = options.class;
|
|
@@ -27284,11 +27423,15 @@ var DropCursorView = class {
|
|
|
27284
27423
|
});
|
|
27285
27424
|
}
|
|
27286
27425
|
destroy() {
|
|
27426
|
+
this.setCursor(null);
|
|
27287
27427
|
this.handlers.forEach(({ name, handler }) => this.editorView.dom.removeEventListener(name, handler));
|
|
27288
27428
|
}
|
|
27289
27429
|
update(editorView, prevState) {
|
|
27290
|
-
if (this.cursorPos != null && prevState.doc != editorView.state.doc) if (this.
|
|
27291
|
-
|
|
27430
|
+
if (this.cursorPos != null && prevState.doc != editorView.state.doc) if (this.lastDragEvent) {
|
|
27431
|
+
let target = this.computeTarget(this.lastDragEvent);
|
|
27432
|
+
if (target == this.cursorPos) this.updateOverlay();
|
|
27433
|
+
else this.setCursor(target);
|
|
27434
|
+
} else this.updateOverlay();
|
|
27292
27435
|
}
|
|
27293
27436
|
setCursor(pos) {
|
|
27294
27437
|
if (pos == this.cursorPos) return;
|
|
@@ -27359,8 +27502,7 @@ var DropCursorView = class {
|
|
|
27359
27502
|
clearTimeout(this.timeout);
|
|
27360
27503
|
this.timeout = setTimeout(() => this.setCursor(null), timeout);
|
|
27361
27504
|
}
|
|
27362
|
-
|
|
27363
|
-
if (!this.editorView.editable) return;
|
|
27505
|
+
computeTarget(event) {
|
|
27364
27506
|
let pos = this.editorView.posAtCoords({
|
|
27365
27507
|
left: event.clientX,
|
|
27366
27508
|
top: event.clientY
|
|
@@ -27368,12 +27510,19 @@ var DropCursorView = class {
|
|
|
27368
27510
|
let node = pos && pos.inside >= 0 && this.editorView.state.doc.nodeAt(pos.inside);
|
|
27369
27511
|
let disableDropCursor = node && node.type.spec.disableDropCursor;
|
|
27370
27512
|
let disabled = typeof disableDropCursor == "function" ? disableDropCursor(this.editorView, pos, event) : disableDropCursor;
|
|
27371
|
-
if (pos
|
|
27372
|
-
|
|
27373
|
-
|
|
27374
|
-
|
|
27375
|
-
|
|
27376
|
-
|
|
27513
|
+
if (!pos || disabled) return null;
|
|
27514
|
+
let target = pos.pos;
|
|
27515
|
+
if (this.editorView.dragging && this.editorView.dragging.slice) {
|
|
27516
|
+
let point = dropPoint(this.editorView.state.doc, target, this.editorView.dragging.slice);
|
|
27517
|
+
if (point != null) target = point;
|
|
27518
|
+
}
|
|
27519
|
+
return target;
|
|
27520
|
+
}
|
|
27521
|
+
dragover(event) {
|
|
27522
|
+
if (!this.editorView.editable) return;
|
|
27523
|
+
this.lastDragEvent = event;
|
|
27524
|
+
let target = this.computeTarget(event);
|
|
27525
|
+
if (target != null) {
|
|
27377
27526
|
this.setCursor(target);
|
|
27378
27527
|
this.scheduleRemoval(5e3);
|
|
27379
27528
|
}
|
|
@@ -31990,6 +32139,7 @@ function EditableHtml$1($$anchor, $$props) {
|
|
|
31990
32139
|
return {
|
|
31991
32140
|
role: "textbox",
|
|
31992
32141
|
"aria-multiline": "true",
|
|
32142
|
+
class: "mathjax_ignore",
|
|
31993
32143
|
...$$props.ariaLabel ? { "aria-label": $$props.ariaLabel } : {}
|
|
31994
32144
|
};
|
|
31995
32145
|
}
|
|
@@ -34966,80 +35116,244 @@ create_custom_element(RegionPicker, {
|
|
|
34966
35116
|
}, [], [], { mode: "open" });
|
|
34967
35117
|
//#endregion
|
|
34968
35118
|
//#region ../../shared/math-rendering-mathjax/dist/index.js
|
|
34969
|
-
var e =
|
|
34970
|
-
|
|
34971
|
-
|
|
34972
|
-
|
|
34973
|
-
|
|
34974
|
-
|
|
34975
|
-
|
|
34976
|
-
|
|
34977
|
-
|
|
34978
|
-
|
|
34979
|
-
|
|
34980
|
-
|
|
34981
|
-
|
|
34982
|
-
|
|
34983
|
-
|
|
34984
|
-
|
|
35119
|
+
var e = "https://github.com/pie-framework/pie-players/blob/develop/docs/item-player/loading-strategies.md#one-mathjax-version-per-page";
|
|
35120
|
+
var t = "pie-mathjax-version-conflict";
|
|
35121
|
+
var n = Symbol.for("@pie-element/shared-math-rendering-mathjax/unsupported-page");
|
|
35122
|
+
function r(r, i) {
|
|
35123
|
+
if (typeof window > "u") return;
|
|
35124
|
+
let a = globalThis;
|
|
35125
|
+
a[n] ?? (a[n] = {
|
|
35126
|
+
logged: !1,
|
|
35127
|
+
conditions: []
|
|
35128
|
+
});
|
|
35129
|
+
let o = a[n];
|
|
35130
|
+
if (o.conditions.includes(r)) return;
|
|
35131
|
+
o.conditions.push(r);
|
|
35132
|
+
let s = `[math-rendering] Unsupported page (${r}): ${i}. PIE supports one MathJax major version per page; with MathJax 3 and 4 on one page, math rendering is best effort and may break. See ${e}`;
|
|
35133
|
+
o.logged || (o.logged = !0, console.error(s)), window.dispatchEvent(new CustomEvent(t, { detail: {
|
|
35134
|
+
condition: r,
|
|
35135
|
+
message: s,
|
|
35136
|
+
docsUrl: e
|
|
35137
|
+
} }));
|
|
35138
|
+
}
|
|
35139
|
+
function i() {
|
|
35140
|
+
let e = window.MathJax?.version;
|
|
35141
|
+
return typeof e == "string" && e.startsWith("3.") ? e : void 0;
|
|
35142
|
+
}
|
|
35143
|
+
var a = "https://cdn.jsdelivr.net/npm/mathjax@4.1.3/tex-mml-chtml.js";
|
|
35144
|
+
var o = {
|
|
35145
|
+
parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
|
|
35146
|
+
overarc: "\\overparen",
|
|
35147
|
+
napprox: "\\not\\approx",
|
|
35148
|
+
longdiv: "\\enclose{longdiv}",
|
|
35149
|
+
abs: ["\\left|#1\\right|", 1]
|
|
35150
|
+
};
|
|
35151
|
+
var s = "[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)";
|
|
35152
|
+
var c = /\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/;
|
|
35153
|
+
var l = /\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/;
|
|
35154
|
+
var u = /\\embed\{newLine\}\[\]/g;
|
|
35155
|
+
var d = [
|
|
35156
|
+
["$$", "$$"],
|
|
35157
|
+
["$", "$"],
|
|
35158
|
+
["\\[", "\\]"],
|
|
35159
|
+
["\\(", "\\)"]
|
|
35160
|
+
];
|
|
35161
|
+
var f = Symbol.for("@pie-element/shared-math-rendering-mathjax/loading");
|
|
35162
|
+
var p = "PIE-MJX-CHTML-styles";
|
|
35163
|
+
var m = "MJX-CHTML-styles";
|
|
35164
|
+
var h = [m, "MJX-SVG-styles"];
|
|
35165
|
+
var g = 201;
|
|
35166
|
+
function _(e) {
|
|
35167
|
+
let t = [...e.matches("mjx-container") ? [e] : [], ...e.querySelectorAll("mjx-container")];
|
|
35168
|
+
for (let e of t) for (let t of [e, ...e.querySelectorAll("[data-latex],[data-latex-item]")]) t.removeAttribute("data-latex"), t.removeAttribute("data-latex-item");
|
|
35169
|
+
}
|
|
35170
|
+
function v() {
|
|
35171
|
+
return window.MathJax;
|
|
35172
|
+
}
|
|
35173
|
+
function y(e) {
|
|
35174
|
+
for (let [t, n] of d) if (e.startsWith(t) && e.endsWith(n)) return e.substring(t.length, e.length - n.length);
|
|
35175
|
+
return e;
|
|
35176
|
+
}
|
|
35177
|
+
function b(e) {
|
|
35178
|
+
return y(e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e);
|
|
35179
|
+
}
|
|
35180
|
+
var x = "mathjax_ignore";
|
|
35181
|
+
var S = "mathjax_process";
|
|
35182
|
+
function C(e, t) {
|
|
35183
|
+
let n = e.closest(`.${x}, .${S}`);
|
|
35184
|
+
return n !== null && t.contains(n) && !n.classList.contains(S);
|
|
35185
|
+
}
|
|
35186
|
+
function w(e) {
|
|
35187
|
+
for (let t of e.querySelectorAll("[data-latex]")) {
|
|
35188
|
+
if (t.dataset.mathHandled || t.closest("mjx-container") || C(t, e)) continue;
|
|
35189
|
+
let n = t.textContent;
|
|
35190
|
+
n && (t.textContent = `\\(${b(n)}\\)`.replace(u, "\\newline "), t.dataset.mathHandled = "true");
|
|
35191
|
+
}
|
|
35192
|
+
}
|
|
35193
|
+
function T(e, t) {
|
|
35194
|
+
for (let t of e.querySelectorAll("math")) if (!t.closest("mjx-assistive-mml")) return !0;
|
|
35195
|
+
return (t ? l : c).test(e.textContent ?? "");
|
|
35196
|
+
}
|
|
35197
|
+
function E(e) {
|
|
35198
|
+
return new Promise((t, n) => {
|
|
35199
|
+
let { useSingleDollar: r = !1, accessibility: i = !0, loadFonts: c = !0, srcUrl: l } = e, u = {
|
|
35200
|
+
loader: {
|
|
35201
|
+
load: i ? ["a11y/assistive-mml"] : [],
|
|
35202
|
+
failed: (e) => n(e)
|
|
35203
|
+
},
|
|
35204
|
+
startup: {
|
|
35205
|
+
typeset: !1,
|
|
35206
|
+
ready: () => {
|
|
35207
|
+
let e = v(), r = e?.startup, i = !!e?.version?.startsWith("4.");
|
|
35208
|
+
i && D(e), r?.defaultReady?.(), i && O(r?.document), Promise.resolve(r?.promise).then(() => t(), n);
|
|
34985
35209
|
}
|
|
34986
35210
|
},
|
|
35211
|
+
tex: { macros: { ...o } },
|
|
34987
35212
|
options: {
|
|
34988
35213
|
enableMenu: i,
|
|
34989
|
-
|
|
34990
|
-
|
|
34991
|
-
|
|
34992
|
-
|
|
34993
|
-
|
|
34994
|
-
window.MathJax?.startup.defaultReady && (window.MathJax.startup.defaultReady(), e());
|
|
34995
|
-
},
|
|
34996
|
-
defaultReady: () => {}
|
|
35214
|
+
menuOptions: { settings: {
|
|
35215
|
+
assistiveMml: i,
|
|
35216
|
+
enrich: !1,
|
|
35217
|
+
inTabOrder: !1
|
|
35218
|
+
} }
|
|
34997
35219
|
}
|
|
34998
35220
|
};
|
|
34999
|
-
r &&
|
|
35000
|
-
let
|
|
35001
|
-
|
|
35002
|
-
|
|
35003
|
-
|
|
35004
|
-
|
|
35005
|
-
|
|
35006
|
-
|
|
35007
|
-
}
|
|
35008
|
-
function
|
|
35009
|
-
|
|
35010
|
-
|
|
35011
|
-
e.
|
|
35012
|
-
|
|
35013
|
-
|
|
35221
|
+
r && u.tex && (console.warn(s), u.tex.inlineMath = [["$", "$"], ["\\(", "\\)"]], u.tex.processEscapes = !0), c || (u.chtml = { fontURL: "" }), window.MathJax = u;
|
|
35222
|
+
let d = document.createElement("script");
|
|
35223
|
+
d.src = l || a, d.async = !0, d.onerror = () => n(/* @__PURE__ */ Error("Failed to load MathJax")), document.head.appendChild(d);
|
|
35224
|
+
});
|
|
35225
|
+
}
|
|
35226
|
+
function D(e) {
|
|
35227
|
+
let t = e?._?.output?.chtml_ts?.CHTML;
|
|
35228
|
+
t && (t.STYLESHEETID = p);
|
|
35229
|
+
}
|
|
35230
|
+
function O(e) {
|
|
35231
|
+
if (!e) return;
|
|
35232
|
+
let t = /* @__PURE__ */ new WeakSet(), n = (e) => {
|
|
35233
|
+
let n = e.typesetRoot;
|
|
35234
|
+
!n || t.has(n) || (_(n), t.add(n));
|
|
35235
|
+
};
|
|
35236
|
+
e.addRenderAction?.("pie-strip-latex", g, (e) => {
|
|
35237
|
+
for (let t of e.math ?? []) n(t);
|
|
35238
|
+
return !1;
|
|
35239
|
+
}, (e) => {
|
|
35240
|
+
let t = e.typesetRoot;
|
|
35241
|
+
return t && _(t), !1;
|
|
35242
|
+
});
|
|
35243
|
+
let r = e.outputJax?.chtmlStyles;
|
|
35244
|
+
r?.id === m && (r.id = p), j();
|
|
35245
|
+
}
|
|
35246
|
+
function k(e) {
|
|
35247
|
+
return e instanceof HTMLStyleElement && h.includes(e.id);
|
|
35248
|
+
}
|
|
35249
|
+
function A(e) {
|
|
35250
|
+
r("foreign-output-stylesheet", `another MathJax added <style id="${e.id}"> to <head>`);
|
|
35251
|
+
}
|
|
35252
|
+
function j() {
|
|
35253
|
+
let e = document.head, t = [...e.children].find(k);
|
|
35254
|
+
if (t) {
|
|
35255
|
+
A(t);
|
|
35256
|
+
return;
|
|
35014
35257
|
}
|
|
35258
|
+
let n = new MutationObserver((e) => {
|
|
35259
|
+
for (let t of e) {
|
|
35260
|
+
let e = [...t.addedNodes].find(k);
|
|
35261
|
+
if (e) {
|
|
35262
|
+
A(e), n.disconnect();
|
|
35263
|
+
return;
|
|
35264
|
+
}
|
|
35265
|
+
}
|
|
35266
|
+
});
|
|
35267
|
+
n.observe(e, { childList: !0 });
|
|
35268
|
+
}
|
|
35269
|
+
function M(e) {
|
|
35270
|
+
return new Promise((t, n) => {
|
|
35271
|
+
let r = e.startup ?? {};
|
|
35272
|
+
e.startup = r;
|
|
35273
|
+
let i = r.ready;
|
|
35274
|
+
r.ready = () => {
|
|
35275
|
+
let e = v()?.startup;
|
|
35276
|
+
i ? i.call(r) : e?.defaultReady?.(), Promise.resolve(e?.promise).then(() => t(), n);
|
|
35277
|
+
};
|
|
35278
|
+
});
|
|
35279
|
+
}
|
|
35280
|
+
function N(e) {
|
|
35281
|
+
let t = v();
|
|
35282
|
+
return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() : M(t) : E(e);
|
|
35015
35283
|
}
|
|
35016
|
-
function
|
|
35017
|
-
return
|
|
35018
|
-
|
|
35019
|
-
|
|
35284
|
+
function P(e) {
|
|
35285
|
+
return N(e).then(() => {
|
|
35286
|
+
typeof v()?.typesetPromise != "function" && console.warn("[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.");
|
|
35287
|
+
});
|
|
35288
|
+
}
|
|
35289
|
+
function F(e) {
|
|
35290
|
+
let t = globalThis, n = t[f];
|
|
35291
|
+
return n || (n = P(e), t[f] = n), n;
|
|
35292
|
+
}
|
|
35293
|
+
function I(e = {}) {
|
|
35294
|
+
let t = e.useSingleDollar ?? !1;
|
|
35295
|
+
return async (n) => {
|
|
35296
|
+
if (typeof window > "u") return;
|
|
35297
|
+
let a = i();
|
|
35298
|
+
a && r("mathjax-3-global", `window.MathJax is MathJax ${a}`), w(n);
|
|
35299
|
+
let o = F(e);
|
|
35300
|
+
if (!T(n, t)) {
|
|
35301
|
+
o.catch(() => {});
|
|
35020
35302
|
return;
|
|
35021
35303
|
}
|
|
35022
|
-
await
|
|
35304
|
+
await o;
|
|
35305
|
+
let s = v();
|
|
35306
|
+
await s?.startup?.promise, typeof s?.typesetPromise == "function" && (await s.typesetPromise([n]), _(n));
|
|
35023
35307
|
};
|
|
35024
35308
|
}
|
|
35025
|
-
var
|
|
35026
|
-
|
|
35027
|
-
|
|
35028
|
-
|
|
35029
|
-
|
|
35030
|
-
|
|
35309
|
+
var R = "@pie-lib/math-rendering";
|
|
35310
|
+
var z = "@pie-lib/math-rendering@2";
|
|
35311
|
+
var B = "pie-print";
|
|
35312
|
+
var V = 50;
|
|
35313
|
+
var H = 1e4;
|
|
35314
|
+
var U = null;
|
|
35315
|
+
function W() {
|
|
35316
|
+
return !!window[z]?.opts?.useSingleDollar;
|
|
35031
35317
|
}
|
|
35032
|
-
function
|
|
35318
|
+
function G() {
|
|
35319
|
+
return U || (U = I({ useSingleDollar: W() })), U;
|
|
35320
|
+
}
|
|
35321
|
+
function K() {
|
|
35033
35322
|
if (typeof window > "u") return null;
|
|
35034
|
-
let e = window[
|
|
35035
|
-
return typeof e?.renderMath == "function" ? e : null;
|
|
35323
|
+
let e = window[R];
|
|
35324
|
+
return typeof e?.renderMath == "function" && e.renderMath !== X ? e : null;
|
|
35325
|
+
}
|
|
35326
|
+
function q(e) {
|
|
35327
|
+
let t = e;
|
|
35328
|
+
for (; t;) {
|
|
35329
|
+
if (t instanceof Element && t.localName === B) return t;
|
|
35330
|
+
t = t instanceof ShadowRoot ? t.host : t.parentNode;
|
|
35331
|
+
}
|
|
35332
|
+
return null;
|
|
35333
|
+
}
|
|
35334
|
+
function J() {
|
|
35335
|
+
let e = window.renderMath;
|
|
35336
|
+
return typeof e == "function" ? e : null;
|
|
35337
|
+
}
|
|
35338
|
+
async function Y(e) {
|
|
35339
|
+
let t = q(e);
|
|
35340
|
+
if (!t) return null;
|
|
35341
|
+
let n = J();
|
|
35342
|
+
if (n || t.mathRenderingModuleUrlImported !== !0) return n;
|
|
35343
|
+
let r = Date.now() + H;
|
|
35344
|
+
for (; Date.now() < r;) {
|
|
35345
|
+
await new Promise((e) => setTimeout(e, V));
|
|
35346
|
+
let e = J();
|
|
35347
|
+
if (e) return e;
|
|
35348
|
+
}
|
|
35349
|
+
return null;
|
|
35036
35350
|
}
|
|
35037
|
-
var
|
|
35351
|
+
var X = async (e) => {
|
|
35038
35352
|
if (typeof window > "u") return;
|
|
35039
35353
|
let t = typeof e == "string", n;
|
|
35040
35354
|
t ? (n = document.createElement("div"), n.innerHTML = e) : n = e || document.body;
|
|
35041
|
-
let r =
|
|
35042
|
-
return r ? await r.renderMath?.(n) : await
|
|
35355
|
+
let r = K(), i = r || t ? null : await Y(n);
|
|
35356
|
+
return r ? await r.renderMath?.(n) : i && i !== X ? await i(n) : await G()(n), t ? n.innerHTML : void 0;
|
|
35043
35357
|
};
|
|
35044
35358
|
//#endregion
|
|
35045
35359
|
//#region src/delivery/tile-accessible-name.ts
|
|
@@ -35893,7 +36207,12 @@ var defaults_default = {
|
|
|
35893
36207
|
scoringPolicy: {
|
|
35894
36208
|
label: "Scoring policy",
|
|
35895
36209
|
settings: true
|
|
35896
|
-
}
|
|
36210
|
+
},
|
|
36211
|
+
teacherInstructions: {
|
|
36212
|
+
label: "Teacher Instructions",
|
|
36213
|
+
settings: true
|
|
36214
|
+
},
|
|
36215
|
+
settingsPanelDisabled: false
|
|
35897
36216
|
}
|
|
35898
36217
|
};
|
|
35899
36218
|
//#endregion
|
|
@@ -36037,8 +36356,8 @@ var root_8$1 = /* @__PURE__ */ from_svg(`<circle fill="none" stroke="#1e293b"></
|
|
|
36037
36356
|
var root_9$1 = /* @__PURE__ */ from_svg(`<text font-weight="600" fill="#0f172a"> </text>`);
|
|
36038
36357
|
var root_10$1 = /* @__PURE__ */ from_html(`<div class="region-aria svelte-gkcqor" role="region"></div>`);
|
|
36039
36358
|
var root_11$1 = /* @__PURE__ */ from_html(`<div class="tile-wrapper svelte-gkcqor"><!></div>`);
|
|
36040
|
-
var root_12 = /* @__PURE__ */ from_html(`<div class="venn-diagram svelte-gkcqor"><svg preserveAspectRatio="xMidYMid meet" aria-hidden="true" class="svelte-gkcqor"><defs><mask maskUnits="userSpaceOnUse" x="0" y="0"><rect x="0" y="0" fill="black"></rect><circle fill="white"></circle><circle fill="black"></circle></mask><mask maskUnits="userSpaceOnUse" x="0" y="0"><rect x="0" y="0" fill="black"></rect><circle fill="white"></circle><circle fill="black"></circle></mask><clipPath clipPathUnits="userSpaceOnUse"><circle></circle></clipPath><mask maskUnits="userSpaceOnUse" x="0" y="0"><rect x="0" y="0" fill="white"></rect><circle fill="black"></circle><circle fill="black"></circle></mask></defs><rect fill="#ffffff" stroke="#cbd5e1"></rect><!><!><!><!><!><!><!><line stroke="#cbd5e1"></line></svg> <div class="region-labels svelte-gkcqor" aria-hidden="false"></div> <div class="placed-tiles svelte-gkcqor"></div></div> <!>`, 1);
|
|
36041
|
-
var root_13 = /* @__PURE__ */ from_html(`<div class="drag-ghost svelte-gkcqor"><!></div>`);
|
|
36359
|
+
var root_12$1 = /* @__PURE__ */ from_html(`<div class="venn-diagram svelte-gkcqor"><svg preserveAspectRatio="xMidYMid meet" aria-hidden="true" class="svelte-gkcqor"><defs><mask maskUnits="userSpaceOnUse" x="0" y="0"><rect x="0" y="0" fill="black"></rect><circle fill="white"></circle><circle fill="black"></circle></mask><mask maskUnits="userSpaceOnUse" x="0" y="0"><rect x="0" y="0" fill="black"></rect><circle fill="white"></circle><circle fill="black"></circle></mask><clipPath clipPathUnits="userSpaceOnUse"><circle></circle></clipPath><mask maskUnits="userSpaceOnUse" x="0" y="0"><rect x="0" y="0" fill="white"></rect><circle fill="black"></circle><circle fill="black"></circle></mask></defs><rect fill="#ffffff" stroke="#cbd5e1"></rect><!><!><!><!><!><!><!><line stroke="#cbd5e1"></line></svg> <div class="region-labels svelte-gkcqor" aria-hidden="false"></div> <div class="placed-tiles svelte-gkcqor"></div></div> <!>`, 1);
|
|
36360
|
+
var root_13$1 = /* @__PURE__ */ from_html(`<div class="drag-ghost svelte-gkcqor"><!></div>`);
|
|
36042
36361
|
var root_14 = /* @__PURE__ */ from_html(`<div class="venn-root svelte-gkcqor"><!> <!> <!> <!> <!> <div class="sr-only svelte-gkcqor" aria-live="polite" aria-atomic="true"></div></div>`);
|
|
36043
36362
|
var $$css$1 = {
|
|
36044
36363
|
hash: "svelte-gkcqor",
|
|
@@ -36355,7 +36674,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
36355
36674
|
if (!containerEl) return;
|
|
36356
36675
|
const warn = (err) => console.warn("venn-classification: MathJax render failed", err);
|
|
36357
36676
|
try {
|
|
36358
|
-
Promise.resolve(
|
|
36677
|
+
Promise.resolve(X(containerEl)).catch(warn);
|
|
36359
36678
|
} catch (err) {
|
|
36360
36679
|
warn(err);
|
|
36361
36680
|
}
|
|
@@ -36438,7 +36757,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
36438
36757
|
append($$anchor, div_2);
|
|
36439
36758
|
};
|
|
36440
36759
|
var alternate_1 = ($$anchor) => {
|
|
36441
|
-
var fragment_1 = root_12();
|
|
36760
|
+
var fragment_1 = root_12$1();
|
|
36442
36761
|
var div_3 = first_child(fragment_1);
|
|
36443
36762
|
let styles;
|
|
36444
36763
|
var svg_2 = child(div_3);
|
|
@@ -36760,7 +37079,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
36760
37079
|
});
|
|
36761
37080
|
var node_17 = sibling(node_4, 2);
|
|
36762
37081
|
var consequent_10 = ($$anchor) => {
|
|
36763
|
-
var div_8 = root_13();
|
|
37082
|
+
var div_8 = root_13$1();
|
|
36764
37083
|
Tile(child(div_8), {
|
|
36765
37084
|
get id() {
|
|
36766
37085
|
return get$1(draggedTile).id;
|
|
@@ -36802,52 +37121,55 @@ create_custom_element(VennClassification, {
|
|
|
36802
37121
|
}, [], []);
|
|
36803
37122
|
//#endregion
|
|
36804
37123
|
//#region src/author/Author.svelte
|
|
36805
|
-
var root = /* @__PURE__ */ from_html(`<
|
|
36806
|
-
var root_1 = /* @__PURE__ */ from_html(`<
|
|
37124
|
+
var root = /* @__PURE__ */ from_html(`<div class="field-group svelte-13ppn6m"><div class="field-header svelte-13ppn6m"> </div> <!></div>`);
|
|
37125
|
+
var root_1 = /* @__PURE__ */ from_html(`<label class="circle-label-row svelte-13ppn6m"><span></span> <input type="text" class="svelte-13ppn6m"/></label>`);
|
|
37126
|
+
var root_2 = /* @__PURE__ */ from_html(`<div class="hint svelte-13ppn6m">Add at least one tile; each tile needs a correct region and either a label (text or simple HTML) or an
|
|
36807
37127
|
image URL plus short alt text.</div>`);
|
|
36808
|
-
var
|
|
36809
|
-
var
|
|
36810
|
-
var
|
|
36811
|
-
var
|
|
36812
|
-
var
|
|
36813
|
-
var
|
|
36814
|
-
var
|
|
36815
|
-
var
|
|
36816
|
-
var
|
|
36817
|
-
var
|
|
36818
|
-
arrow keys when it is focused) to change the editor / preview split.</div> <div class="preview-summary svelte-13ppn6m"><div><strong>Circles:</strong> </div> <div><strong>Scoring:</strong> </div> <div><strong>Tiles:</strong> </div></div> <!> <!></div></div
|
|
37128
|
+
var root_3 = /* @__PURE__ */ from_html(`<div class="tile-field-full svelte-13ppn6m"><button type="button" class="btn-ghost svelte-13ppn6m">Remove image</button></div>`);
|
|
37129
|
+
var root_4 = /* @__PURE__ */ from_html(`<li class="tile-row svelte-13ppn6m"><div class="tile-row-header svelte-13ppn6m"><div class="tile-inputs svelte-13ppn6m"><label class="svelte-13ppn6m"><span>ID</span> <input type="text" class="svelte-13ppn6m"/></label> <label class="label-input svelte-13ppn6m"><span>Label</span> <input type="text" class="svelte-13ppn6m"/></label> <label class="label-input tile-field-full svelte-13ppn6m"><span>Image URL (optional)</span> <input type="text" placeholder="https://… or data:image/…" class="svelte-13ppn6m"/></label> <label class="label-input tile-field-full svelte-13ppn6m"><span>Image alt (required if image URL is set)</span> <input type="text" class="svelte-13ppn6m"/></label> <!></div> <div class="tile-actions svelte-13ppn6m"><button type="button" class="btn-ghost svelte-13ppn6m" aria-label="Move up">↑</button> <button type="button" class="btn-ghost svelte-13ppn6m" aria-label="Move down">↓</button> <button type="button" class="btn-ghost danger svelte-13ppn6m" aria-label="Remove">✕</button></div></div> <div class="tile-region svelte-13ppn6m"><div class="region-header svelte-13ppn6m">Correct region</div> <!></div></li>`);
|
|
37130
|
+
var root_5 = /* @__PURE__ */ from_html(`<label class="override-row svelte-13ppn6m"><span class="override-key svelte-13ppn6m"> </span> <input type="text" class="svelte-13ppn6m"/></label>`);
|
|
37131
|
+
var root_6 = /* @__PURE__ */ from_html(`<div class="preview-diagram svelte-13ppn6m"><!></div>`);
|
|
37132
|
+
var root_7 = /* @__PURE__ */ from_html(`<p class="hint preview-diagram-placeholder svelte-13ppn6m">Add at least one tile to see the diagram.</p>`);
|
|
37133
|
+
var root_8 = /* @__PURE__ */ from_html(`<p class="hint preview-diagram-placeholder svelte-13ppn6m">Exactly two circles are required for the preview.</p>`);
|
|
37134
|
+
var root_9 = /* @__PURE__ */ from_html(`<img alt="" class="preview-thumb svelte-13ppn6m" aria-hidden="true"/>`);
|
|
37135
|
+
var root_10 = /* @__PURE__ */ from_html(`<li class="svelte-13ppn6m"><span class="preview-tile svelte-13ppn6m"><!> </span> <span class="preview-arrow svelte-13ppn6m">→</span> <span class="preview-region svelte-13ppn6m"> </span></li>`);
|
|
37136
|
+
var root_11 = /* @__PURE__ */ from_html(`<div class="preview-list-heading svelte-13ppn6m">Correct regions</div> <ol class="preview-list svelte-13ppn6m"></ol>`, 1);
|
|
37137
|
+
var root_12 = /* @__PURE__ */ from_html(`<div class="author-shell svelte-13ppn6m"><div class="editor-column svelte-13ppn6m"><!> <!> <div class="field-group svelte-13ppn6m"><div class="field-header svelte-13ppn6m">Circles</div> <p class="hint circle-count-note svelte-13ppn6m">2 circles (4 regions).</p> <div class="circle-labels svelte-13ppn6m"></div></div> <div class="field-group svelte-13ppn6m"><div class="field-header-row svelte-13ppn6m"><span class="field-header svelte-13ppn6m">Tiles</span> <button type="button" class="btn-add svelte-13ppn6m">+ Add tile</button></div> <!> <ul class="tile-list svelte-13ppn6m"></ul></div> <details class="field-group svelte-13ppn6m"><summary class="field-header svelte-13ppn6m">Region labels (advanced)</summary> <p class="hint svelte-13ppn6m">Override the auto-composed region labels that delivery uses for aria-labels and visible region chrome.</p> <!></details></div> <button type="button" class="split-gutter svelte-13ppn6m" role="slider" aria-orientation="vertical" aria-label="Resize editor and preview panels"></button> <div class="preview-column svelte-13ppn6m"><div class="preview-header svelte-13ppn6m">Preview</div> <div class="preview-note svelte-13ppn6m">Live diagram with each tile in its authored <em>correct region</em>. Drag the vertical handle (or use
|
|
37138
|
+
arrow keys when it is focused) to change the editor / preview split.</div> <div class="preview-summary svelte-13ppn6m"><div><strong>Circles:</strong> </div> <div><strong>Scoring:</strong> </div> <div><strong>Tiles:</strong> </div></div> <!> <!></div></div>`);
|
|
37139
|
+
var root_13 = /* @__PURE__ */ from_html(`<div class="venn-author svelte-13ppn6m"><!></div>`);
|
|
36819
37140
|
var $$css = {
|
|
36820
37141
|
hash: "svelte-13ppn6m",
|
|
36821
|
-
code: ".venn-author.svelte-13ppn6m {padding:24px;font-family:system-ui, -apple-system, Segoe UI, Roboto, sans-serif;color:#0f172a;box-sizing:border-box;--vc-focus-ring: var(\n --pie-focus-outline,\n var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565c0))\n );}.author-shell.svelte-13ppn6m {display:flex;flex-direction:row;align-items:stretch;gap:0;width:100%;min-height:min(72vh, 720px);max-height:min(85vh, 960px);box-sizing:border-box;}.editor-column.svelte-13ppn6m {display:flex;flex-direction:column;gap:20px;flex-shrink:0;overflow:auto;min-width:0;}.split-gutter.svelte-13ppn6m {flex:0 0 6px;width:6px;margin:0;padding:0;border:none;border-left:1px solid #cbd5e1;border-right:1px solid #cbd5e1;cursor:col-resize;touch-action:none;background:#e2e8f0;align-self:stretch;}.split-gutter.svelte-13ppn6m:hover,\n .split-gutter.svelte-13ppn6m:focus-visible {background:#cbd5e1;}.split-gutter.svelte-13ppn6m:focus-visible {outline:2px solid var(--vc-focus-ring, #1565c0);outline-offset:2px;}\n @media (max-width: 900px) {.author-shell.svelte-13ppn6m {flex-direction:column;min-height:unset;max-height:unset;}.editor-column.svelte-13ppn6m {width:100% !important;flex:none;max-width:none;}.split-gutter.svelte-13ppn6m {display:none;}.preview-column.svelte-13ppn6m {flex:none;width:100%;}\n }.field-group.svelte-13ppn6m {border:1px solid #e2e8f0;border-radius:8px;padding:16px;background:#ffffff;}.field-header.svelte-13ppn6m,\n .field-header-row.svelte-13ppn6m {display:flex;align-items:center;justify-content:space-between;font-weight:600;font-size:14px;margin-bottom:12px;color:#0f172a;}.field-header
|
|
37142
|
+
code: ".venn-author.svelte-13ppn6m {padding:24px;font-family:system-ui, -apple-system, Segoe UI, Roboto, sans-serif;color:#0f172a;box-sizing:border-box;--vc-focus-ring: var(\n --pie-focus-outline,\n var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565c0))\n );}.author-shell.svelte-13ppn6m {display:flex;flex-direction:row;align-items:stretch;gap:0;width:100%;min-height:min(72vh, 720px);max-height:min(85vh, 960px);box-sizing:border-box;}.editor-column.svelte-13ppn6m {display:flex;flex-direction:column;gap:20px;flex-shrink:0;overflow:auto;min-width:0;}.split-gutter.svelte-13ppn6m {flex:0 0 6px;width:6px;margin:0;padding:0;border:none;border-left:1px solid #cbd5e1;border-right:1px solid #cbd5e1;cursor:col-resize;touch-action:none;background:#e2e8f0;align-self:stretch;}.split-gutter.svelte-13ppn6m:hover,\n .split-gutter.svelte-13ppn6m:focus-visible {background:#cbd5e1;}.split-gutter.svelte-13ppn6m:focus-visible {outline:2px solid var(--vc-focus-ring, #1565c0);outline-offset:2px;}\n @media (max-width: 900px) {.author-shell.svelte-13ppn6m {flex-direction:column;min-height:unset;max-height:unset;}.editor-column.svelte-13ppn6m {width:100% !important;flex:none;max-width:none;}.split-gutter.svelte-13ppn6m {display:none;}.preview-column.svelte-13ppn6m {flex:none;width:100%;}\n }.field-group.svelte-13ppn6m {border:1px solid #e2e8f0;border-radius:8px;padding:16px;background:#ffffff;}.field-header.svelte-13ppn6m,\n .field-header-row.svelte-13ppn6m {display:flex;align-items:center;justify-content:space-between;font-weight:600;font-size:14px;margin-bottom:12px;color:#0f172a;}.field-header-row.svelte-13ppn6m {gap:8px;}.btn-add.svelte-13ppn6m {background:#2563eb;color:#ffffff;border:none;padding:6px 10px;border-radius:6px;font-size:12px;cursor:pointer;}.btn-add.svelte-13ppn6m:hover {background:#1d4ed8;}.btn-ghost.svelte-13ppn6m {background:transparent;border:1px solid #cbd5e1;border-radius:4px;padding:2px 8px;cursor:pointer;font-size:13px;}.btn-ghost.svelte-13ppn6m:hover:not(:disabled) {background:#f1f5f9;}.btn-ghost.svelte-13ppn6m:disabled {opacity:0.4;cursor:not-allowed;}.btn-ghost.danger.svelte-13ppn6m {color:#bf0d00;}.circle-labels.svelte-13ppn6m {display:flex;flex-direction:column;gap:8px;}.circle-count-note.svelte-13ppn6m {margin:0 0 4px 0;}.circle-label-row.svelte-13ppn6m {display:grid;grid-template-columns:120px minmax(0, 1fr);align-items:center;gap:8px;font-size:13px;}.circle-label-row.svelte-13ppn6m input:where(.svelte-13ppn6m),\n .tile-inputs.svelte-13ppn6m input:where(.svelte-13ppn6m),\n .override-row.svelte-13ppn6m input:where(.svelte-13ppn6m) {padding:6px 8px;border:1px solid #cbd5e1;border-radius:4px;font-size:13px;width:100%;box-sizing:border-box;}.tile-list.svelte-13ppn6m {list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px;}.tile-row.svelte-13ppn6m {border:1px solid #e2e8f0;border-radius:6px;padding:10px 12px;background:#f8fafc;}.tile-row-header.svelte-13ppn6m {display:flex;gap:8px;align-items:center;}.tile-inputs.svelte-13ppn6m {flex:1;display:grid;grid-template-columns:140px 1fr;gap:8px;}.tile-inputs.svelte-13ppn6m label:where(.svelte-13ppn6m) {display:flex;flex-direction:column;gap:2px;font-size:12px;color:#475569;}.tile-inputs.svelte-13ppn6m .tile-field-full:where(.svelte-13ppn6m) {grid-column:1 / -1;}.tile-actions.svelte-13ppn6m {display:flex;gap:4px;}.tile-region.svelte-13ppn6m {margin-top:8px;}.region-header.svelte-13ppn6m {font-size:12px;font-weight:600;color:#475569;margin-bottom:6px;}.override-row.svelte-13ppn6m {display:grid;grid-template-columns:100px minmax(0, 1fr);align-items:center;gap:8px;font-size:13px;margin-top:6px;}.override-key.svelte-13ppn6m {font-family:ui-monospace, SFMono-Regular, Menlo, monospace;font-size:12px;color:#64748b;}.hint.svelte-13ppn6m {font-size:12px;color:#64748b;margin:8px 0;}.preview-column.svelte-13ppn6m {flex:1 1 auto;min-width:0;overflow:auto;border:1px solid #e2e8f0;border-radius:8px;padding:16px;background:#ffffff;}.preview-diagram.svelte-13ppn6m {margin:12px 0 16px 0;max-width:100%;overflow-x:auto;}.preview-diagram.svelte-13ppn6m .venn-root {padding-top:8px;}.preview-list-heading.svelte-13ppn6m {font-size:12px;font-weight:600;color:#475569;margin:8px 0 6px 0;}.preview-diagram-placeholder.svelte-13ppn6m {margin:12px 0;}.preview-header.svelte-13ppn6m {font-weight:600;font-size:14px;margin-bottom:8px;}.preview-note.svelte-13ppn6m {font-size:12px;color:#64748b;margin-bottom:12px;}.preview-summary.svelte-13ppn6m {font-size:13px;line-height:1.5;color:#334155;margin-bottom:10px;}.preview-list.svelte-13ppn6m {list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:4px;}.preview-list.svelte-13ppn6m li:where(.svelte-13ppn6m) {display:flex;align-items:center;gap:6px;font-size:13px;}.preview-tile.svelte-13ppn6m {display:inline-flex;align-items:center;gap:6px;background:#eff6ff;border:1px solid #bfdbfe;border-radius:4px;padding:2px 6px;color:#1d4ed8;}.preview-thumb.svelte-13ppn6m {width:22px;height:22px;object-fit:contain;flex-shrink:0;}.preview-arrow.svelte-13ppn6m {color:#94a3b8;}.preview-region.svelte-13ppn6m {color:#0f172a;}"
|
|
36822
37143
|
};
|
|
36823
37144
|
function Author($$anchor, $$props) {
|
|
36824
37145
|
push($$props, true);
|
|
36825
37146
|
append_styles$1($$anchor, $$css);
|
|
36826
|
-
let model = prop($$props, "model",
|
|
36827
|
-
|
|
37147
|
+
let model = prop($$props, "model", 7), configuration = prop($$props, "configuration", 7);
|
|
37148
|
+
const config = /* @__PURE__ */ user_derived(() => o$1(defaults_default.configuration, configuration()));
|
|
37149
|
+
const SCORING_POLICY_CHOICES = [{
|
|
37150
|
+
label: "Partial credit per tile",
|
|
37151
|
+
value: "partialPerTile"
|
|
37152
|
+
}, {
|
|
37153
|
+
label: "All or nothing",
|
|
37154
|
+
value: "allOrNothing"
|
|
37155
|
+
}];
|
|
37156
|
+
/**
|
|
37157
|
+
* Keeps the edit as the element's model, so the next edit builds on it,
|
|
37158
|
+
* assigning it through the host: a remount after a detach starts from the
|
|
37159
|
+
* host's property. Announces it as a bubbling `model.updated` for the player
|
|
37160
|
+
* listening at its root.
|
|
37161
|
+
*/
|
|
36828
37162
|
function emit(next) {
|
|
36829
|
-
|
|
36830
|
-
|
|
36831
|
-
model(next);
|
|
36832
|
-
onChange()?.(next);
|
|
36833
|
-
}
|
|
37163
|
+
$$props.$$host.model = next;
|
|
37164
|
+
$$props.$$host.dispatchEvent(new e$3(next));
|
|
36834
37165
|
}
|
|
36835
37166
|
/**
|
|
36836
|
-
* The model with the
|
|
36837
|
-
*
|
|
36838
|
-
*
|
|
37167
|
+
* The model with the controller's defaults filled in. Every other field, `id`
|
|
37168
|
+
* and `element` included, passes through untouched: the player owns those two,
|
|
37169
|
+
* and an edit must not drop what the form does not show.
|
|
36839
37170
|
*/
|
|
36840
37171
|
function safeModel() {
|
|
36841
|
-
|
|
36842
|
-
return {
|
|
36843
|
-
...m,
|
|
36844
|
-
prompt: m.prompt ?? "",
|
|
36845
|
-
promptEnabled: m.promptEnabled !== false,
|
|
36846
|
-
circles: Array.isArray(m.circles) && m.circles.length > 0 ? m.circles : [{ label: "Set A" }, { label: "Set B" }],
|
|
36847
|
-
tiles: Array.isArray(m.tiles) ? m.tiles : [],
|
|
36848
|
-
regionLabels: m.regionLabels ?? {},
|
|
36849
|
-
scoringPolicy: m.scoringPolicy ?? "partialPerTile"
|
|
36850
|
-
};
|
|
37172
|
+
return createDefaultModel(model() || void 0);
|
|
36851
37173
|
}
|
|
36852
37174
|
function update(patch) {
|
|
36853
37175
|
emit({
|
|
@@ -36858,9 +37180,6 @@ function Author($$anchor, $$props) {
|
|
|
36858
37180
|
function onPromptChange(html) {
|
|
36859
37181
|
update({ prompt: html });
|
|
36860
37182
|
}
|
|
36861
|
-
function setPromptEnabled(enabled) {
|
|
36862
|
-
update({ promptEnabled: enabled });
|
|
36863
|
-
}
|
|
36864
37183
|
function setCircleLabel(idx, label) {
|
|
36865
37184
|
update({ circles: safeModel().circles.map((c, i) => i === idx ? {
|
|
36866
37185
|
...c,
|
|
@@ -36931,9 +37250,6 @@ function Author($$anchor, $$props) {
|
|
|
36931
37250
|
correctRegion: normalizeRegion(region)
|
|
36932
37251
|
} : t) });
|
|
36933
37252
|
}
|
|
36934
|
-
function setScoringPolicy(policy) {
|
|
36935
|
-
update({ scoringPolicy: policy });
|
|
36936
|
-
}
|
|
36937
37253
|
function setRegionLabelOverride(key, label) {
|
|
36938
37254
|
const next = { ...safeModel().regionLabels || {} };
|
|
36939
37255
|
if (label.trim().length === 0) delete next[key];
|
|
@@ -37038,278 +37354,321 @@ function Author($$anchor, $$props) {
|
|
|
37038
37354
|
model($$value);
|
|
37039
37355
|
flushSync();
|
|
37040
37356
|
},
|
|
37041
|
-
get
|
|
37042
|
-
return
|
|
37043
|
-
},
|
|
37044
|
-
set onChange($$value) {
|
|
37045
|
-
onChange($$value);
|
|
37046
|
-
flushSync();
|
|
37047
|
-
},
|
|
37048
|
-
get onModelChange() {
|
|
37049
|
-
return onModelChange();
|
|
37357
|
+
get configuration() {
|
|
37358
|
+
return configuration();
|
|
37050
37359
|
},
|
|
37051
|
-
set
|
|
37052
|
-
|
|
37360
|
+
set configuration($$value) {
|
|
37361
|
+
configuration($$value);
|
|
37053
37362
|
flushSync();
|
|
37054
37363
|
}
|
|
37055
37364
|
};
|
|
37056
|
-
var div =
|
|
37057
|
-
var
|
|
37058
|
-
|
|
37059
|
-
|
|
37060
|
-
|
|
37061
|
-
|
|
37062
|
-
|
|
37063
|
-
|
|
37064
|
-
|
|
37065
|
-
|
|
37066
|
-
|
|
37067
|
-
|
|
37068
|
-
|
|
37069
|
-
|
|
37070
|
-
|
|
37071
|
-
|
|
37072
|
-
|
|
37073
|
-
|
|
37074
|
-
|
|
37075
|
-
|
|
37076
|
-
|
|
37077
|
-
|
|
37078
|
-
|
|
37079
|
-
|
|
37080
|
-
|
|
37081
|
-
if (get$1(m).promptEnabled !== false) $$render(consequent);
|
|
37082
|
-
});
|
|
37083
|
-
reset$1(div_3);
|
|
37084
|
-
var div_4 = sibling(div_3, 2);
|
|
37085
|
-
var div_5 = sibling(child(div_4), 4);
|
|
37086
|
-
each(div_5, 21, () => get$1(m).circles, index, ($$anchor, circle, idx) => {
|
|
37087
|
-
var label_2 = root();
|
|
37088
|
-
var span = child(label_2);
|
|
37089
|
-
span.textContent = `Circle ${idx + 1} label`;
|
|
37090
|
-
var input_1 = sibling(span, 2);
|
|
37091
|
-
remove_input_defaults(input_1);
|
|
37092
|
-
reset$1(label_2);
|
|
37093
|
-
template_effect(() => set_value(input_1, get$1(circle).label));
|
|
37094
|
-
delegated("input", input_1, (e) => setCircleLabel(idx, e.currentTarget.value));
|
|
37095
|
-
append($$anchor, label_2);
|
|
37096
|
-
});
|
|
37097
|
-
reset$1(div_5);
|
|
37098
|
-
reset$1(div_4);
|
|
37099
|
-
var div_6 = sibling(div_4, 2);
|
|
37100
|
-
var div_7 = child(div_6);
|
|
37101
|
-
var button = sibling(child(div_7), 2);
|
|
37102
|
-
reset$1(div_7);
|
|
37103
|
-
var node_1 = sibling(div_7, 2);
|
|
37104
|
-
var consequent_1 = ($$anchor) => {
|
|
37105
|
-
append($$anchor, root_1());
|
|
37106
|
-
};
|
|
37107
|
-
if_block(node_1, ($$render) => {
|
|
37108
|
-
if (get$1(m).tiles.length === 0) $$render(consequent_1);
|
|
37109
|
-
});
|
|
37110
|
-
var ul = sibling(node_1, 2);
|
|
37111
|
-
each(ul, 21, () => get$1(m).tiles, index, ($$anchor, tile, idx) => {
|
|
37112
|
-
var li = root_3();
|
|
37113
|
-
var div_9 = child(li);
|
|
37114
|
-
var div_10 = child(div_9);
|
|
37115
|
-
var label_3 = child(div_10);
|
|
37116
|
-
var input_2 = sibling(child(label_3), 2);
|
|
37117
|
-
remove_input_defaults(input_2);
|
|
37118
|
-
reset$1(label_3);
|
|
37119
|
-
var label_4 = sibling(label_3, 2);
|
|
37120
|
-
var input_3 = sibling(child(label_4), 2);
|
|
37121
|
-
remove_input_defaults(input_3);
|
|
37122
|
-
reset$1(label_4);
|
|
37123
|
-
var label_5 = sibling(label_4, 2);
|
|
37124
|
-
var input_4 = sibling(child(label_5), 2);
|
|
37125
|
-
remove_input_defaults(input_4);
|
|
37126
|
-
reset$1(label_5);
|
|
37127
|
-
var label_6 = sibling(label_5, 2);
|
|
37128
|
-
var input_5 = sibling(child(label_6), 2);
|
|
37129
|
-
remove_input_defaults(input_5);
|
|
37130
|
-
reset$1(label_6);
|
|
37131
|
-
var node_2 = sibling(label_6, 2);
|
|
37132
|
-
var consequent_2 = ($$anchor) => {
|
|
37133
|
-
var div_11 = root_2();
|
|
37134
|
-
delegated("click", only_child(div_11), () => clearTileImage(idx));
|
|
37135
|
-
append($$anchor, div_11);
|
|
37365
|
+
var div = root_13();
|
|
37366
|
+
var node = child(div);
|
|
37367
|
+
{
|
|
37368
|
+
const settings = ($$anchor) => {
|
|
37369
|
+
{
|
|
37370
|
+
let $0 = /* @__PURE__ */ user_derived(() => ({
|
|
37371
|
+
Settings: { promptEnabled: get$1(config).prompt?.settings && c$1(get$1(config).prompt.label) },
|
|
37372
|
+
Properties: {
|
|
37373
|
+
teacherInstructionsEnabled: get$1(config).teacherInstructions?.settings && c$1(get$1(config).teacherInstructions.label),
|
|
37374
|
+
scoringPolicy: get$1(config).scoringPolicy?.settings && l$1(get$1(config).scoringPolicy.label, SCORING_POLICY_CHOICES)
|
|
37375
|
+
}
|
|
37376
|
+
}));
|
|
37377
|
+
b$1($$anchor, {
|
|
37378
|
+
get model() {
|
|
37379
|
+
return get$1(m);
|
|
37380
|
+
},
|
|
37381
|
+
get configuration() {
|
|
37382
|
+
return get$1(config);
|
|
37383
|
+
},
|
|
37384
|
+
get groups() {
|
|
37385
|
+
return get$1($0);
|
|
37386
|
+
},
|
|
37387
|
+
onChangeModel: (next) => update(next)
|
|
37388
|
+
});
|
|
37389
|
+
}
|
|
37136
37390
|
};
|
|
37137
|
-
|
|
37138
|
-
|
|
37139
|
-
|
|
37140
|
-
|
|
37141
|
-
reset$1(div_10);
|
|
37142
|
-
var div_12 = sibling(div_10, 2);
|
|
37143
|
-
var button_2 = child(div_12);
|
|
37144
|
-
button_2.disabled = idx === 0;
|
|
37145
|
-
var button_3 = sibling(button_2, 2);
|
|
37146
|
-
var button_4 = sibling(button_3, 2);
|
|
37147
|
-
reset$1(div_12);
|
|
37148
|
-
reset$1(div_9);
|
|
37149
|
-
var div_13 = sibling(div_9, 2);
|
|
37150
|
-
RegionPicker(sibling(child(div_13), 2), {
|
|
37151
|
-
get circles() {
|
|
37152
|
-
return get$1(m).circles;
|
|
37153
|
-
},
|
|
37154
|
-
get regionLabels() {
|
|
37155
|
-
return get$1(m).regionLabels;
|
|
37391
|
+
let $0 = /* @__PURE__ */ user_derived(() => get$1(config).settingsPanelDisabled === true || !s$1(get$1(config)));
|
|
37392
|
+
y$1(node, {
|
|
37393
|
+
get hideSettings() {
|
|
37394
|
+
return get$1($0);
|
|
37156
37395
|
},
|
|
37157
|
-
|
|
37158
|
-
|
|
37159
|
-
|
|
37160
|
-
|
|
37161
|
-
|
|
37162
|
-
|
|
37163
|
-
|
|
37164
|
-
|
|
37165
|
-
|
|
37166
|
-
|
|
37167
|
-
|
|
37168
|
-
|
|
37169
|
-
|
|
37170
|
-
|
|
37171
|
-
|
|
37172
|
-
|
|
37173
|
-
|
|
37174
|
-
|
|
37175
|
-
|
|
37176
|
-
|
|
37177
|
-
|
|
37178
|
-
|
|
37179
|
-
|
|
37180
|
-
|
|
37181
|
-
|
|
37182
|
-
|
|
37183
|
-
|
|
37184
|
-
|
|
37185
|
-
|
|
37186
|
-
|
|
37187
|
-
|
|
37188
|
-
|
|
37189
|
-
|
|
37190
|
-
|
|
37191
|
-
|
|
37192
|
-
|
|
37193
|
-
|
|
37194
|
-
|
|
37195
|
-
|
|
37196
|
-
|
|
37197
|
-
|
|
37198
|
-
|
|
37199
|
-
|
|
37200
|
-
|
|
37201
|
-
|
|
37202
|
-
|
|
37203
|
-
|
|
37204
|
-
|
|
37205
|
-
|
|
37206
|
-
|
|
37207
|
-
|
|
37208
|
-
|
|
37209
|
-
|
|
37210
|
-
|
|
37211
|
-
|
|
37212
|
-
|
|
37213
|
-
|
|
37214
|
-
|
|
37215
|
-
|
|
37216
|
-
|
|
37217
|
-
|
|
37218
|
-
|
|
37219
|
-
|
|
37220
|
-
|
|
37221
|
-
|
|
37222
|
-
|
|
37223
|
-
|
|
37224
|
-
|
|
37225
|
-
|
|
37226
|
-
|
|
37227
|
-
|
|
37228
|
-
|
|
37229
|
-
|
|
37230
|
-
|
|
37231
|
-
|
|
37232
|
-
|
|
37233
|
-
|
|
37396
|
+
settings,
|
|
37397
|
+
children: ($$anchor, $$slotProps) => {
|
|
37398
|
+
var div_1 = root_12();
|
|
37399
|
+
var div_2 = child(div_1);
|
|
37400
|
+
let styles;
|
|
37401
|
+
var node_1 = child(div_2);
|
|
37402
|
+
var consequent = ($$anchor) => {
|
|
37403
|
+
var div_3 = root();
|
|
37404
|
+
var div_4 = child(div_3);
|
|
37405
|
+
var text = only_child(div_4, true);
|
|
37406
|
+
var node_2 = sibling(div_4, 2);
|
|
37407
|
+
{
|
|
37408
|
+
let $0 = /* @__PURE__ */ user_derived(() => get$1(m).teacherInstructions || "");
|
|
37409
|
+
let $1 = /* @__PURE__ */ user_derived(() => get$1(config).teacherInstructions?.label);
|
|
37410
|
+
EditableHtml(node_2, {
|
|
37411
|
+
get markup() {
|
|
37412
|
+
return get$1($0);
|
|
37413
|
+
},
|
|
37414
|
+
onChange: (html) => update({ teacherInstructions: html }),
|
|
37415
|
+
get ariaLabel() {
|
|
37416
|
+
return get$1($1);
|
|
37417
|
+
}
|
|
37418
|
+
});
|
|
37419
|
+
}
|
|
37420
|
+
reset$1(div_3);
|
|
37421
|
+
template_effect(() => set_text(text, get$1(config).teacherInstructions?.label));
|
|
37422
|
+
append($$anchor, div_3);
|
|
37423
|
+
};
|
|
37424
|
+
if_block(node_1, ($$render) => {
|
|
37425
|
+
if (get$1(m).teacherInstructionsEnabled !== false) $$render(consequent);
|
|
37426
|
+
});
|
|
37427
|
+
var node_3 = sibling(node_1, 2);
|
|
37428
|
+
var consequent_1 = ($$anchor) => {
|
|
37429
|
+
var div_5 = root();
|
|
37430
|
+
var div_6 = child(div_5);
|
|
37431
|
+
var text_1 = only_child(div_6, true);
|
|
37432
|
+
var node_4 = sibling(div_6, 2);
|
|
37433
|
+
{
|
|
37434
|
+
let $0 = /* @__PURE__ */ user_derived(() => get$1(m).prompt || "");
|
|
37435
|
+
let $1 = /* @__PURE__ */ user_derived(() => get$1(config).prompt?.label);
|
|
37436
|
+
EditableHtml(node_4, {
|
|
37437
|
+
get markup() {
|
|
37438
|
+
return get$1($0);
|
|
37439
|
+
},
|
|
37440
|
+
onChange: onPromptChange,
|
|
37441
|
+
placeholder: "Enter a prompt for the Venn classification question...",
|
|
37442
|
+
get ariaLabel() {
|
|
37443
|
+
return get$1($1);
|
|
37444
|
+
}
|
|
37445
|
+
});
|
|
37446
|
+
}
|
|
37447
|
+
reset$1(div_5);
|
|
37448
|
+
template_effect(() => set_text(text_1, get$1(config).prompt?.label));
|
|
37449
|
+
append($$anchor, div_5);
|
|
37450
|
+
};
|
|
37451
|
+
if_block(node_3, ($$render) => {
|
|
37452
|
+
if (get$1(m).promptEnabled !== false) $$render(consequent_1);
|
|
37453
|
+
});
|
|
37454
|
+
var div_7 = sibling(node_3, 2);
|
|
37455
|
+
var div_8 = sibling(child(div_7), 4);
|
|
37456
|
+
each(div_8, 21, () => get$1(m).circles, index, ($$anchor, circle, idx) => {
|
|
37457
|
+
var label_1 = root_1();
|
|
37458
|
+
var span = child(label_1);
|
|
37459
|
+
span.textContent = `Circle ${idx + 1} label`;
|
|
37460
|
+
var input = sibling(span, 2);
|
|
37461
|
+
remove_input_defaults(input);
|
|
37462
|
+
reset$1(label_1);
|
|
37463
|
+
template_effect(() => set_value(input, get$1(circle).label));
|
|
37464
|
+
delegated("input", input, (e) => setCircleLabel(idx, e.currentTarget.value));
|
|
37465
|
+
append($$anchor, label_1);
|
|
37466
|
+
});
|
|
37467
|
+
reset$1(div_8);
|
|
37468
|
+
reset$1(div_7);
|
|
37469
|
+
var div_9 = sibling(div_7, 2);
|
|
37470
|
+
var div_10 = child(div_9);
|
|
37471
|
+
var button = sibling(child(div_10), 2);
|
|
37472
|
+
reset$1(div_10);
|
|
37473
|
+
var node_5 = sibling(div_10, 2);
|
|
37474
|
+
var consequent_2 = ($$anchor) => {
|
|
37475
|
+
append($$anchor, root_2());
|
|
37476
|
+
};
|
|
37477
|
+
if_block(node_5, ($$render) => {
|
|
37478
|
+
if (get$1(m).tiles.length === 0) $$render(consequent_2);
|
|
37479
|
+
});
|
|
37480
|
+
var ul = sibling(node_5, 2);
|
|
37481
|
+
each(ul, 21, () => get$1(m).tiles, index, ($$anchor, tile, idx) => {
|
|
37482
|
+
var li = root_4();
|
|
37483
|
+
var div_12 = child(li);
|
|
37484
|
+
var div_13 = child(div_12);
|
|
37485
|
+
var label_2 = child(div_13);
|
|
37486
|
+
var input_1 = sibling(child(label_2), 2);
|
|
37487
|
+
remove_input_defaults(input_1);
|
|
37488
|
+
reset$1(label_2);
|
|
37489
|
+
var label_3 = sibling(label_2, 2);
|
|
37490
|
+
var input_2 = sibling(child(label_3), 2);
|
|
37491
|
+
remove_input_defaults(input_2);
|
|
37492
|
+
reset$1(label_3);
|
|
37493
|
+
var label_4 = sibling(label_3, 2);
|
|
37494
|
+
var input_3 = sibling(child(label_4), 2);
|
|
37495
|
+
remove_input_defaults(input_3);
|
|
37496
|
+
reset$1(label_4);
|
|
37497
|
+
var label_5 = sibling(label_4, 2);
|
|
37498
|
+
var input_4 = sibling(child(label_5), 2);
|
|
37499
|
+
remove_input_defaults(input_4);
|
|
37500
|
+
reset$1(label_5);
|
|
37501
|
+
var node_6 = sibling(label_5, 2);
|
|
37502
|
+
var consequent_3 = ($$anchor) => {
|
|
37503
|
+
var div_14 = root_3();
|
|
37504
|
+
delegated("click", only_child(div_14), () => clearTileImage(idx));
|
|
37505
|
+
append($$anchor, div_14);
|
|
37506
|
+
};
|
|
37507
|
+
var d = /* @__PURE__ */ user_derived(() => (get$1(tile).imageUrl ?? "").trim());
|
|
37508
|
+
if_block(node_6, ($$render) => {
|
|
37509
|
+
if (get$1(d)) $$render(consequent_3);
|
|
37510
|
+
});
|
|
37511
|
+
reset$1(div_13);
|
|
37512
|
+
var div_15 = sibling(div_13, 2);
|
|
37513
|
+
var button_2 = child(div_15);
|
|
37514
|
+
button_2.disabled = idx === 0;
|
|
37515
|
+
var button_3 = sibling(button_2, 2);
|
|
37516
|
+
var button_4 = sibling(button_3, 2);
|
|
37517
|
+
reset$1(div_15);
|
|
37518
|
+
reset$1(div_12);
|
|
37519
|
+
var div_16 = sibling(div_12, 2);
|
|
37520
|
+
RegionPicker(sibling(child(div_16), 2), {
|
|
37521
|
+
get circles() {
|
|
37522
|
+
return get$1(m).circles;
|
|
37523
|
+
},
|
|
37524
|
+
get regionLabels() {
|
|
37525
|
+
return get$1(m).regionLabels;
|
|
37526
|
+
},
|
|
37527
|
+
get value() {
|
|
37528
|
+
return get$1(tile).correctRegion;
|
|
37529
|
+
},
|
|
37530
|
+
onchange: (region) => setTileRegion(idx, region)
|
|
37531
|
+
});
|
|
37532
|
+
reset$1(div_16);
|
|
37533
|
+
reset$1(li);
|
|
37534
|
+
template_effect(() => {
|
|
37535
|
+
set_value(input_1, get$1(tile).id);
|
|
37536
|
+
set_value(input_2, get$1(tile).label);
|
|
37537
|
+
set_value(input_3, get$1(tile).imageUrl ?? "");
|
|
37538
|
+
set_value(input_4, get$1(tile).imageAlt ?? "");
|
|
37539
|
+
button_3.disabled = idx === get$1(m).tiles.length - 1;
|
|
37540
|
+
});
|
|
37541
|
+
delegated("input", input_1, (e) => setTileId(idx, e.currentTarget.value));
|
|
37542
|
+
delegated("input", input_2, (e) => setTileLabel(idx, e.currentTarget.value));
|
|
37543
|
+
delegated("input", input_3, (e) => setTileImageUrl(idx, e.currentTarget.value));
|
|
37544
|
+
delegated("input", input_4, (e) => setTileImageAlt(idx, e.currentTarget.value));
|
|
37545
|
+
delegated("click", button_2, () => moveTile(idx, -1));
|
|
37546
|
+
delegated("click", button_3, () => moveTile(idx, 1));
|
|
37547
|
+
delegated("click", button_4, () => removeTile(idx));
|
|
37548
|
+
append($$anchor, li);
|
|
37549
|
+
});
|
|
37550
|
+
reset$1(ul);
|
|
37551
|
+
reset$1(div_9);
|
|
37552
|
+
var details = sibling(div_9, 2);
|
|
37553
|
+
each(sibling(child(details), 4), 17, () => get$1(regions), (region) => regionKey(region), ($$anchor, region) => {
|
|
37554
|
+
const key = /* @__PURE__ */ user_derived(() => regionKey(get$1(region)));
|
|
37555
|
+
const placeholder = /* @__PURE__ */ user_derived(() => composeRegionLabel(get$1(m).circles || [], get$1(region)));
|
|
37556
|
+
var label_6 = root_5();
|
|
37557
|
+
var span_1 = child(label_6);
|
|
37558
|
+
var text_2 = only_child(span_1, true);
|
|
37559
|
+
var input_5 = sibling(span_1, 2);
|
|
37560
|
+
remove_input_defaults(input_5);
|
|
37561
|
+
reset$1(label_6);
|
|
37562
|
+
template_effect(() => {
|
|
37563
|
+
set_text(text_2, get$1(key) || "(outside)");
|
|
37564
|
+
set_attribute(input_5, "placeholder", get$1(placeholder));
|
|
37565
|
+
set_value(input_5, get$1(m).regionLabels?.[get$1(key)] ?? "");
|
|
37566
|
+
});
|
|
37567
|
+
delegated("input", input_5, (e) => setRegionLabelOverride(get$1(key), e.currentTarget.value));
|
|
37568
|
+
append($$anchor, label_6);
|
|
37569
|
+
});
|
|
37570
|
+
reset$1(details);
|
|
37571
|
+
reset$1(div_2);
|
|
37572
|
+
var button_5 = sibling(div_2, 2);
|
|
37573
|
+
set_attribute(button_5, "aria-valuemin", MIN_EDITOR_W);
|
|
37574
|
+
var div_17 = sibling(button_5, 2);
|
|
37575
|
+
var div_18 = sibling(child(div_17), 4);
|
|
37576
|
+
var div_19 = child(div_18);
|
|
37577
|
+
var text_3 = sibling(child(div_19));
|
|
37578
|
+
reset$1(div_19);
|
|
37579
|
+
var div_20 = sibling(div_19, 2);
|
|
37580
|
+
var text_4 = sibling(child(div_20));
|
|
37581
|
+
reset$1(div_20);
|
|
37582
|
+
var div_21 = sibling(div_20, 2);
|
|
37583
|
+
var text_5 = sibling(child(div_21));
|
|
37584
|
+
reset$1(div_21);
|
|
37585
|
+
reset$1(div_18);
|
|
37586
|
+
var node_9 = sibling(div_18, 2);
|
|
37587
|
+
var consequent_4 = ($$anchor) => {
|
|
37588
|
+
var div_22 = root_6();
|
|
37589
|
+
VennClassification(child(div_22), {
|
|
37590
|
+
get model() {
|
|
37591
|
+
return get$1(previewModel);
|
|
37592
|
+
},
|
|
37593
|
+
get session() {
|
|
37594
|
+
return get$1(previewSession);
|
|
37595
|
+
}
|
|
37596
|
+
});
|
|
37597
|
+
reset$1(div_22);
|
|
37598
|
+
append($$anchor, div_22);
|
|
37599
|
+
};
|
|
37600
|
+
var consequent_5 = ($$anchor) => {
|
|
37601
|
+
append($$anchor, root_7());
|
|
37602
|
+
};
|
|
37603
|
+
var alternate = ($$anchor) => {
|
|
37604
|
+
append($$anchor, root_8());
|
|
37605
|
+
};
|
|
37606
|
+
if_block(node_9, ($$render) => {
|
|
37607
|
+
if (get$1(m).tiles.length > 0 && get$1(m).circles?.length === 2) $$render(consequent_4);
|
|
37608
|
+
else if (get$1(m).tiles.length === 0) $$render(consequent_5, 1);
|
|
37609
|
+
else $$render(alternate, -1);
|
|
37610
|
+
});
|
|
37611
|
+
var node_11 = sibling(node_9, 2);
|
|
37612
|
+
var consequent_7 = ($$anchor) => {
|
|
37613
|
+
var fragment_1 = root_11();
|
|
37614
|
+
var ol = sibling(first_child(fragment_1), 2);
|
|
37615
|
+
each(ol, 21, () => get$1(m).tiles, index, ($$anchor, tile) => {
|
|
37616
|
+
var li_1 = root_10();
|
|
37617
|
+
var span_2 = child(li_1);
|
|
37618
|
+
var node_12 = child(span_2);
|
|
37619
|
+
var consequent_6 = ($$anchor) => {
|
|
37620
|
+
var img = root_9();
|
|
37621
|
+
template_effect(() => set_attribute(img, "src", get$1(tile).imageUrl));
|
|
37622
|
+
append($$anchor, img);
|
|
37623
|
+
};
|
|
37624
|
+
var d_1 = /* @__PURE__ */ user_derived(() => (get$1(tile).imageUrl ?? "").trim());
|
|
37625
|
+
if_block(node_12, ($$render) => {
|
|
37626
|
+
if (get$1(d_1)) $$render(consequent_6);
|
|
37627
|
+
});
|
|
37628
|
+
var text_6 = sibling(node_12);
|
|
37629
|
+
reset$1(span_2);
|
|
37630
|
+
var text_7 = only_child(sibling(span_2, 4), true);
|
|
37631
|
+
reset$1(li_1);
|
|
37632
|
+
template_effect(($0, $1) => {
|
|
37633
|
+
set_text(text_6, ` ${$0 ?? ""}`);
|
|
37634
|
+
set_text(text_7, $1);
|
|
37635
|
+
}, [() => stripHtml(get$1(tile).label) || (get$1(tile).imageAlt ?? "").trim() || get$1(tile).id, () => getRegionLabel(get$1(m), get$1(tile).correctRegion)]);
|
|
37636
|
+
append($$anchor, li_1);
|
|
37637
|
+
});
|
|
37638
|
+
reset$1(ol);
|
|
37639
|
+
append($$anchor, fragment_1);
|
|
37640
|
+
};
|
|
37641
|
+
if_block(node_11, ($$render) => {
|
|
37642
|
+
if (get$1(m).tiles.length > 0) $$render(consequent_7);
|
|
37643
|
+
});
|
|
37644
|
+
reset$1(div_17);
|
|
37645
|
+
reset$1(div_1);
|
|
37646
|
+
bind_this(div_1, ($$value) => set(authorShellEl, $$value), () => get$1(authorShellEl));
|
|
37647
|
+
template_effect(($0, $1) => {
|
|
37648
|
+
styles = set_style(div_2, "", styles, { width: get$1(editorColumnWidth) });
|
|
37649
|
+
set_attribute(button_5, "aria-valuemax", get$1(shellWidth) > 0 ? get$1(shellWidth) - MIN_PREVIEW_W - SPLITTER_W : 360);
|
|
37650
|
+
set_attribute(button_5, "aria-valuenow", $0);
|
|
37651
|
+
set_text(text_3, ` ${$1 ?? ""}`);
|
|
37652
|
+
set_text(text_4, ` ${get$1(m).scoringPolicy === "allOrNothing" ? "All or nothing" : "Partial per tile"}`);
|
|
37653
|
+
set_text(text_5, ` ${get$1(m).tiles.length ?? ""}`);
|
|
37654
|
+
}, [() => get$1(editorWidthPx) ?? (get$1(shellWidth) > 0 ? Math.floor((get$1(shellWidth) - SPLITTER_W) / 2) : MIN_EDITOR_W), () => get$1(m).circles.map((c) => c.label).join(", ")]);
|
|
37655
|
+
delegated("click", button, addTile);
|
|
37656
|
+
delegated("pointerdown", button_5, onSplitPointerDown);
|
|
37657
|
+
delegated("keydown", button_5, onSplitKeyDown);
|
|
37658
|
+
bind_element_size(div_1, "clientWidth", ($$value) => set(shellWidth, $$value));
|
|
37659
|
+
append($$anchor, div_1);
|
|
37234
37660
|
},
|
|
37235
|
-
|
|
37236
|
-
|
|
37661
|
+
$$slots: {
|
|
37662
|
+
settings: true,
|
|
37663
|
+
default: true
|
|
37237
37664
|
}
|
|
37238
37665
|
});
|
|
37239
|
-
|
|
37240
|
-
append($$anchor, div_20);
|
|
37241
|
-
};
|
|
37242
|
-
var consequent_4 = ($$anchor) => {
|
|
37243
|
-
append($$anchor, root_6());
|
|
37244
|
-
};
|
|
37245
|
-
var alternate = ($$anchor) => {
|
|
37246
|
-
append($$anchor, root_7());
|
|
37247
|
-
};
|
|
37248
|
-
if_block(node_5, ($$render) => {
|
|
37249
|
-
if (get$1(m).tiles.length > 0 && get$1(m).circles?.length === 2) $$render(consequent_3);
|
|
37250
|
-
else if (get$1(m).tiles.length === 0) $$render(consequent_4, 1);
|
|
37251
|
-
else $$render(alternate, -1);
|
|
37252
|
-
});
|
|
37253
|
-
var node_7 = sibling(node_5, 2);
|
|
37254
|
-
var consequent_6 = ($$anchor) => {
|
|
37255
|
-
var fragment_1 = root_10();
|
|
37256
|
-
var ol = sibling(first_child(fragment_1), 2);
|
|
37257
|
-
each(ol, 21, () => get$1(m).tiles, index, ($$anchor, tile) => {
|
|
37258
|
-
var li_1 = root_9();
|
|
37259
|
-
var span_2 = child(li_1);
|
|
37260
|
-
var node_8 = child(span_2);
|
|
37261
|
-
var consequent_5 = ($$anchor) => {
|
|
37262
|
-
var img = root_8();
|
|
37263
|
-
template_effect(() => set_attribute(img, "src", get$1(tile).imageUrl));
|
|
37264
|
-
append($$anchor, img);
|
|
37265
|
-
};
|
|
37266
|
-
var d_1 = /* @__PURE__ */ user_derived(() => (get$1(tile).imageUrl ?? "").trim());
|
|
37267
|
-
if_block(node_8, ($$render) => {
|
|
37268
|
-
if (get$1(d_1)) $$render(consequent_5);
|
|
37269
|
-
});
|
|
37270
|
-
var text_4 = sibling(node_8);
|
|
37271
|
-
reset$1(span_2);
|
|
37272
|
-
var text_5 = only_child(sibling(span_2, 4), true);
|
|
37273
|
-
reset$1(li_1);
|
|
37274
|
-
template_effect(($0, $1) => {
|
|
37275
|
-
set_text(text_4, ` ${$0 ?? ""}`);
|
|
37276
|
-
set_text(text_5, $1);
|
|
37277
|
-
}, [() => stripHtml(get$1(tile).label) || (get$1(tile).imageAlt ?? "").trim() || get$1(tile).id, () => getRegionLabel(get$1(m), get$1(tile).correctRegion)]);
|
|
37278
|
-
append($$anchor, li_1);
|
|
37279
|
-
});
|
|
37280
|
-
reset$1(ol);
|
|
37281
|
-
append($$anchor, fragment_1);
|
|
37282
|
-
};
|
|
37283
|
-
if_block(node_7, ($$render) => {
|
|
37284
|
-
if (get$1(m).tiles.length > 0) $$render(consequent_6);
|
|
37285
|
-
});
|
|
37286
|
-
reset$1(div_15);
|
|
37287
|
-
reset$1(div_1);
|
|
37288
|
-
bind_this(div_1, ($$value) => set(authorShellEl, $$value), () => get$1(authorShellEl));
|
|
37666
|
+
}
|
|
37289
37667
|
reset$1(div);
|
|
37290
|
-
template_effect(($0, $1) => {
|
|
37291
|
-
styles = set_style(div_2, "", styles, { width: get$1(editorColumnWidth) });
|
|
37292
|
-
set_checked(input, get$1(m).promptEnabled !== false);
|
|
37293
|
-
set_checked(input_6, get$1(m).scoringPolicy !== "allOrNothing");
|
|
37294
|
-
set_checked(input_7, get$1(m).scoringPolicy === "allOrNothing");
|
|
37295
|
-
set_attribute(button_5, "aria-valuemax", get$1(shellWidth) > 0 ? get$1(shellWidth) - MIN_PREVIEW_W - SPLITTER_W : 360);
|
|
37296
|
-
set_attribute(button_5, "aria-valuenow", $0);
|
|
37297
|
-
set_text(text_1, ` ${$1 ?? ""}`);
|
|
37298
|
-
set_text(text_2, ` ${get$1(m).scoringPolicy === "allOrNothing" ? "All or nothing" : "Partial per tile"}`);
|
|
37299
|
-
set_text(text_3, ` ${get$1(m).tiles.length ?? ""}`);
|
|
37300
|
-
}, [() => get$1(editorWidthPx) ?? (get$1(shellWidth) > 0 ? Math.floor((get$1(shellWidth) - SPLITTER_W) / 2) : MIN_EDITOR_W), () => get$1(m).circles.map((c) => c.label).join(", ")]);
|
|
37301
|
-
delegated("change", input, (e) => setPromptEnabled(e.currentTarget.checked));
|
|
37302
|
-
delegated("click", button, addTile);
|
|
37303
|
-
delegated("change", input_6, () => setScoringPolicy("partialPerTile"));
|
|
37304
|
-
delegated("change", input_7, () => setScoringPolicy("allOrNothing"));
|
|
37305
|
-
delegated("pointerdown", button_5, onSplitPointerDown);
|
|
37306
|
-
delegated("keydown", button_5, onSplitKeyDown);
|
|
37307
|
-
bind_element_size(div_1, "clientWidth", ($$value) => set(shellWidth, $$value));
|
|
37308
37668
|
append($$anchor, div);
|
|
37309
37669
|
return pop($$exports);
|
|
37310
37670
|
}
|
|
37311
37671
|
delegate([
|
|
37312
|
-
"change",
|
|
37313
37672
|
"input",
|
|
37314
37673
|
"click",
|
|
37315
37674
|
"pointerdown",
|
|
@@ -37317,45 +37676,12 @@ delegate([
|
|
|
37317
37676
|
]);
|
|
37318
37677
|
create_custom_element(Author, {
|
|
37319
37678
|
model: { type: "Object" },
|
|
37320
|
-
|
|
37321
|
-
onChange: {}
|
|
37679
|
+
configuration: { type: "Object" }
|
|
37322
37680
|
}, [], []);
|
|
37323
37681
|
//#endregion
|
|
37324
37682
|
//#region src/author/index.ts
|
|
37325
|
-
var
|
|
37326
|
-
var VennClassificationAuthor = class extends SvelteElementClass {
|
|
37327
|
-
/**
|
|
37328
|
-
* The component reports each edit through its `onModelChange` prop, assigned
|
|
37329
|
-
* here through the accessor Svelte generates for it. The host keeps the
|
|
37330
|
-
* edited model, renders from it, and announces it as `model.updated`, which
|
|
37331
|
-
* bubbles to the listener an authoring player registers at its root.
|
|
37332
|
-
*/
|
|
37333
|
-
constructor() {
|
|
37334
|
-
super();
|
|
37335
|
-
_defineProperty(this, "_model", null);
|
|
37336
|
-
_defineProperty(this, "_onChange", null);
|
|
37337
|
-
this.onModelChange = (update) => {
|
|
37338
|
-
this._model = update;
|
|
37339
|
-
super.model = update;
|
|
37340
|
-
this._onChange?.(update);
|
|
37341
|
-
this.dispatchEvent(new e$3(update, false));
|
|
37342
|
-
};
|
|
37343
|
-
}
|
|
37344
|
-
set model(m) {
|
|
37345
|
-
this._model = m;
|
|
37346
|
-
super.model = m;
|
|
37347
|
-
}
|
|
37348
|
-
get model() {
|
|
37349
|
-
return this._model;
|
|
37350
|
-
}
|
|
37351
|
-
set onChange(fn) {
|
|
37352
|
-
this._onChange = fn;
|
|
37353
|
-
}
|
|
37354
|
-
get onChange() {
|
|
37355
|
-
return this._onChange || (() => {});
|
|
37356
|
-
}
|
|
37357
|
-
};
|
|
37683
|
+
var author_default = Author.element;
|
|
37358
37684
|
//#endregion
|
|
37359
|
-
export {
|
|
37685
|
+
export { author_default as default };
|
|
37360
37686
|
|
|
37361
37687
|
//# sourceMappingURL=index.js.map
|