@mixd-id/web-scaffold 0.1.230406158 → 0.1.230406160
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/package.json
CHANGED
package/src/utils/selection.js
CHANGED
|
@@ -16,7 +16,8 @@ const getSelection = (container) => {
|
|
|
16
16
|
end: start + range.toString().length,
|
|
17
17
|
container,
|
|
18
18
|
text: range.toString(),
|
|
19
|
-
element: range.startContainer
|
|
19
|
+
element: range.startContainer,
|
|
20
|
+
range
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -28,39 +29,11 @@ const saveSelection = (container) =>{
|
|
|
28
29
|
const restoreSelection = () => {
|
|
29
30
|
if(!selection) return
|
|
30
31
|
|
|
31
|
-
const range = document.createRange();
|
|
32
|
-
range.setStart(selection.container, 0);
|
|
33
|
-
range.collapse(true);
|
|
34
|
-
|
|
35
|
-
const savedSel = selection
|
|
36
|
-
|
|
37
|
-
let charIndex = 0
|
|
38
|
-
let nodeStack = [selection.container], node, foundStart = false, stop = false;
|
|
39
|
-
while (!stop && (node = nodeStack.pop())) {
|
|
40
|
-
if (node.nodeType === 3) {
|
|
41
|
-
var nextCharIndex = charIndex + node.length;
|
|
42
|
-
if (!foundStart && savedSel.start >= charIndex && savedSel.start <= nextCharIndex) {
|
|
43
|
-
range.setStart(node, savedSel.start - charIndex);
|
|
44
|
-
foundStart = true;
|
|
45
|
-
}
|
|
46
|
-
if (foundStart && savedSel.end >= charIndex && savedSel.end <= nextCharIndex) {
|
|
47
|
-
range.setEnd(node, savedSel.end - charIndex);
|
|
48
|
-
stop = true;
|
|
49
|
-
}
|
|
50
|
-
charIndex = nextCharIndex;
|
|
51
|
-
} else {
|
|
52
|
-
var i = node.childNodes.length;
|
|
53
|
-
while (i--) {
|
|
54
|
-
nodeStack.push(node.childNodes[i]);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
32
|
const sel = window.getSelection();
|
|
60
33
|
sel.removeAllRanges();
|
|
61
|
-
sel.addRange(range);
|
|
34
|
+
sel.addRange(selection.range);
|
|
62
35
|
|
|
63
|
-
return range
|
|
36
|
+
return selection.range
|
|
64
37
|
}
|
|
65
38
|
|
|
66
39
|
export {
|
|
@@ -257,9 +257,9 @@
|
|
|
257
257
|
<Tabs :items="previewModes" v-model="store.previewMode" variant="button"></Tabs>
|
|
258
258
|
|
|
259
259
|
<div class="flex-1">
|
|
260
|
-
<Textbox :readonly="1" :value="iframeSrc" class="w-full">
|
|
260
|
+
<Textbox :readonly="1" :value="iframeSrc" class="w-full rounded-xl">
|
|
261
261
|
<template #start>
|
|
262
|
-
<div class="flex flex-row items-center mr-
|
|
262
|
+
<div class="flex flex-row items-center mr-2">
|
|
263
263
|
<button @click="reloadIframe" class="p-3">
|
|
264
264
|
<svg width="14" height="14" viewBox="0 0 24 24" class="fill-text" xmlns="http://www.w3.org/2000/svg">
|
|
265
265
|
<path d="M3.75 12C3.75 7.44365 7.44365 3.75 12 3.75C14.7802 3.75 17.1982 5.12612 18.6816 7.24467L16.5022 7.23828C16.088 7.23707 15.7512 7.57187 15.75 7.98608C15.7488 8.4003 16.0836 8.73706 16.4978 8.73828L19.9491 8.74839C19.9817 8.75065 20.0147 8.75076 20.0477 8.74868L20.4978 8.75C20.6971 8.75058 20.8884 8.67182 21.0296 8.53111C21.1707 8.39039 21.25 8.19929 21.25 8L21.25 4C21.25 3.58579 20.9142 3.25 20.5 3.25C20.0858 3.25 19.75 3.58579 19.75 4L19.75 6.16237C17.9894 3.79113 15.2004 2.25 12 2.25C6.61522 2.25 2.25 6.61522 2.25 12C2.25 17.3848 6.61522 21.75 12 21.75C15.8354 21.75 19.0799 19.5367 20.6716 16.3338C20.856 15.9628 20.7047 15.5127 20.3338 15.3284C19.9628 15.144 19.5127 15.2953 19.3284 15.6662C17.9747 18.3902 15.2321 20.25 12 20.25C7.44365 20.25 3.75 16.5563 3.75 12Z"/>
|
|
@@ -314,10 +314,9 @@
|
|
|
314
314
|
<div v-if="currentItem" class="flex flex-col bg-base-400 dark:bg-base-300"
|
|
315
315
|
:style="section3Style">
|
|
316
316
|
|
|
317
|
-
<div class="px-6 pt-6 pb-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
</strong>
|
|
317
|
+
<div class="px-6 pt-6 pb-4 bg-base-300 flex flex-col">
|
|
318
|
+
<small class="text-xs">Properties</small>
|
|
319
|
+
<strong>{{ currentItem.type }}</strong>
|
|
321
320
|
</div>
|
|
322
321
|
|
|
323
322
|
<div class="px-4 bg-base-300 pt-2 relative">
|