@edc4it/reveal.js-external-code 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -2
- package/dist/code-samples/Dockerfile +7 -0
- package/dist/external-code.es.js +95 -92
- package/dist/external-code.umd.js +9 -9
- package/dist/impl/fetcher.d.ts +0 -1
- package/dist/impl/main.d.ts +0 -1
- package/dist/impl/parsers/file-parser.d.ts +0 -1
- package/dist/impl/stripper.d.ts +0 -1
- package/dist/impl/view/structure.d.ts +0 -1
- package/dist/options.d.ts +1 -2
- package/dist/plugin.d.ts +0 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -64,6 +64,24 @@ Any known [fragments](https://revealjs.com/fragments/) classes on the `object` a
|
|
|
64
64
|
</object>
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
+
## Escaping HTML Content
|
|
68
|
+
|
|
69
|
+
When including code that contains HTML special characters (`<`, `>`, `&`, `'`, `"`), you can use the `data-escape-code` attribute to automatically escape these characters.
|
|
70
|
+
|
|
71
|
+
```html
|
|
72
|
+
<object type="reveal.js/code"
|
|
73
|
+
data-src="code-samples/html-example.html"
|
|
74
|
+
data-escape-code>
|
|
75
|
+
</object>
|
|
76
|
+
```
|
|
77
|
+
With `data-escape-code` added, special characters will be converted to their HTML entity equivalents:
|
|
78
|
+
- `&` becomes `&`
|
|
79
|
+
- `<` becomes `<`
|
|
80
|
+
- `>` becomes `>`
|
|
81
|
+
- `'` becomes `'`
|
|
82
|
+
- `"` becomes `"`
|
|
83
|
+
|
|
84
|
+
|
|
67
85
|
## Limit lines
|
|
68
86
|
|
|
69
87
|
By default, all lines in the `data-src` are displayed (except the one with an optional `@reveal.js/code` annotation, see below).
|
|
@@ -156,5 +174,3 @@ Reveal.initialize({
|
|
|
156
174
|
- `codeBlock`
|
|
157
175
|
- `trim`: set to `false` to keep whitespace before first character/after last character
|
|
158
176
|
- `additionalClasses`: array of additional css classes to add to the `code` element
|
|
159
|
-
|
|
160
|
-
|
package/dist/external-code.es.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".reveal pre,.external-code-wrapper{width:100%}.external-code-wrapper footer.demo-ref{font-size:14px;margin-top:-18px;color:#0d99a5;text-align:right;cursor:help;transition:font-size .4s .1s}
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
class
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".reveal pre,.external-code-wrapper{width:100%}:is(.external-code-wrapper footer.demo-ref):before{color:#0d99a5;margin-right:.3em}.external-code-wrapper footer.demo-ref{font-size:14px;margin-top:-18px;color:#0d99a5;text-align:right;cursor:help;transition:font-size .4s .1s}:is(.external-code-wrapper footer.demo-ref):hover{font-size:28px;cursor:none}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
var z = Object.defineProperty;
|
|
3
|
+
var J = (e, t, s) => t in e ? z(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
4
|
+
var A = (e, t, s) => J(e, typeof t != "symbol" ? t + "" : t, s);
|
|
5
|
+
class Q extends Error {
|
|
6
6
|
constructor(t) {
|
|
7
7
|
super(t);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function P(e, t = !1) {
|
|
11
11
|
const s = t ? -1 : 0;
|
|
12
12
|
return e.replace(/\s/g, "").split(",").map((i) => {
|
|
13
13
|
if (/^[\d-]+$/.test(i)) {
|
|
14
|
-
const [o, c] = i.split("-").map((
|
|
14
|
+
const [o, c] = i.split("-").map((l) => Number.parseInt(l, 10) + s);
|
|
15
15
|
return isNaN(c) ? {
|
|
16
16
|
start: o,
|
|
17
17
|
end: o
|
|
@@ -19,21 +19,20 @@ function M(e, t = !1) {
|
|
|
19
19
|
start: o,
|
|
20
20
|
end: c
|
|
21
21
|
};
|
|
22
|
-
} else
|
|
23
|
-
throw new tt(`could not parse ${i}`);
|
|
22
|
+
} else throw new Q(`could not parse ${i}`);
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
|
-
function
|
|
25
|
+
function tt(e) {
|
|
27
26
|
var n, i;
|
|
28
27
|
const t = e.split(`
|
|
29
28
|
`), s = t[0];
|
|
30
29
|
if (s.includes("@reveal.js/code")) {
|
|
31
30
|
const o = (i = (n = s.match(/lines=(['"]?(?<range>[\d,\s-]+)['"]?)/)) == null ? void 0 : n.groups) == null ? void 0 : i.range, c = t.slice(1);
|
|
32
31
|
if (o) {
|
|
33
|
-
const
|
|
32
|
+
const f = P(o, !0);
|
|
34
33
|
return {
|
|
35
34
|
lines: c,
|
|
36
|
-
range:
|
|
35
|
+
range: f,
|
|
37
36
|
annotated: !0
|
|
38
37
|
};
|
|
39
38
|
} else
|
|
@@ -47,32 +46,32 @@ function et(e) {
|
|
|
47
46
|
annotated: !1
|
|
48
47
|
};
|
|
49
48
|
}
|
|
50
|
-
function
|
|
51
|
-
return e.map((s, n) =>
|
|
49
|
+
function et(e, t) {
|
|
50
|
+
return e.map((s, n) => st(n + 1, t) ? s : "…").filter((s, n, i) => !(s === "…" && i[n - 1] === "…"));
|
|
52
51
|
}
|
|
53
|
-
function
|
|
52
|
+
function st(e, t) {
|
|
54
53
|
return t.find((s) => e >= s.start && e <= s.end) !== void 0;
|
|
55
54
|
}
|
|
56
|
-
function
|
|
55
|
+
function nt(e, t) {
|
|
57
56
|
e.parentNode ? e.replaceWith(t) : console.error("The element to be replaced is not attached to the DOM.");
|
|
58
57
|
}
|
|
59
|
-
function
|
|
58
|
+
function it(e, t) {
|
|
60
59
|
e.forEach((s) => {
|
|
61
60
|
t.setAttribute(s.nodeName, s.nodeValue ?? "");
|
|
62
61
|
});
|
|
63
62
|
}
|
|
64
|
-
function
|
|
63
|
+
function rt(e) {
|
|
65
64
|
return e.split(".").pop();
|
|
66
65
|
}
|
|
67
|
-
class
|
|
66
|
+
class ot {
|
|
68
67
|
constructor(t, s, n, i, a) {
|
|
69
|
-
|
|
68
|
+
A(this, "providedLanguage");
|
|
70
69
|
var o;
|
|
71
70
|
this.attributes = t, this.src = s, this.href = n, this.codeStr = i, this.options = a, this.providedLanguage = (o = this.attributes.getNamedItem("data-lang")) == null ? void 0 : o.value;
|
|
72
71
|
}
|
|
73
72
|
create() {
|
|
74
73
|
const { wrapper: t, codeElement: s } = this._createElements(), n = this._codeClasses();
|
|
75
|
-
return s.classList.add(...n),
|
|
74
|
+
return s.classList.add(...n), it([...this.attributes].filter((i) => i.nodeName !== "class"), s), s.innerHTML = this.codeStr, t;
|
|
76
75
|
}
|
|
77
76
|
/**
|
|
78
77
|
* Create the required elements
|
|
@@ -88,7 +87,7 @@ class at {
|
|
|
88
87
|
* @private
|
|
89
88
|
*/
|
|
90
89
|
_codeClasses() {
|
|
91
|
-
const t =
|
|
90
|
+
const t = rt(this.src), s = this.providedLanguage ?? t ?? "";
|
|
92
91
|
return [...this.options.codeBlock.additionalClasses, s];
|
|
93
92
|
}
|
|
94
93
|
/**
|
|
@@ -110,7 +109,7 @@ class at {
|
|
|
110
109
|
return t.classList.add("external-code-wrapper"), t.classList.add(...((s = this.attributes.getNamedItem("class")) == null ? void 0 : s.value.split(" ")) ?? []), t;
|
|
111
110
|
}
|
|
112
111
|
}
|
|
113
|
-
async function
|
|
112
|
+
async function at(e, t) {
|
|
114
113
|
const s = await fetch(e);
|
|
115
114
|
if (s.ok) {
|
|
116
115
|
const n = await s.text();
|
|
@@ -118,20 +117,20 @@ async function ct(e, t) {
|
|
|
118
117
|
} else
|
|
119
118
|
throw new Error(s.statusText);
|
|
120
119
|
}
|
|
121
|
-
function
|
|
120
|
+
function ct(e, t) {
|
|
122
121
|
if (!(e instanceof t))
|
|
123
122
|
throw new TypeError("Cannot call a class as a function");
|
|
124
123
|
}
|
|
125
|
-
function
|
|
124
|
+
function lt(e, t) {
|
|
126
125
|
for (var s = 0; s < t.length; s++) {
|
|
127
126
|
var n = t[s];
|
|
128
127
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
|
|
129
128
|
}
|
|
130
129
|
}
|
|
131
130
|
function ut(e, t, s) {
|
|
132
|
-
return t &&
|
|
131
|
+
return t && lt(e.prototype, t), e;
|
|
133
132
|
}
|
|
134
|
-
var dt = Object.defineProperty,
|
|
133
|
+
var dt = Object.defineProperty, u = function(e, t) {
|
|
135
134
|
return dt(e, "name", { value: t, configurable: !0 });
|
|
136
135
|
}, ft = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
137
136
|
<path d="m8.94 8 4.2-4.193a.67.67 0 0 0-.947-.947L8 7.06l-4.193-4.2a.67.67 0 1 0-.947.947L7.06 8l-4.2 4.193a.667.667 0 0 0 .217 1.093.666.666 0 0 0 .73-.146L8 8.94l4.193 4.2a.666.666 0 0 0 1.094-.217.665.665 0 0 0-.147-.73L8.94 8Z" fill="currentColor"/>
|
|
@@ -148,35 +147,35 @@ var dt = Object.defineProperty, d = function(e, t) {
|
|
|
148
147
|
`, vt = `<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
149
148
|
<path d="M16.334 17.667a1.334 1.334 0 0 0 1.334-1.333v-5.333a1.333 1.333 0 0 0-2.665 0v5.333a1.333 1.333 0 0 0 1.33 1.333Zm-.508 5.227c.325.134.69.134 1.014 0 .165-.064.314-.159.44-.28a1.56 1.56 0 0 0 .28-.44c.076-.158.112-.332.107-.507a1.332 1.332 0 0 0-.387-.946 1.532 1.532 0 0 0-.44-.28 1.334 1.334 0 0 0-1.838 1.226 1.4 1.4 0 0 0 .385.947c.127.121.277.216.44.28Zm.508 6.773a13.333 13.333 0 1 0 0-26.667 13.333 13.333 0 0 0 0 26.667Zm0-24A10.667 10.667 0 1 1 16.54 27a10.667 10.667 0 0 1-.206-21.333Z" fill="currentColor"/>
|
|
150
149
|
</svg>
|
|
151
|
-
`, Ot =
|
|
150
|
+
`, Ot = u(function(e) {
|
|
152
151
|
return new DOMParser().parseFromString(e, "text/html").body.childNodes[0];
|
|
153
|
-
}, "stringToHTML"),
|
|
152
|
+
}, "stringToHTML"), m = u(function(e) {
|
|
154
153
|
var t = new DOMParser().parseFromString(e, "application/xml");
|
|
155
154
|
return document.importNode(t.documentElement, !0).outerHTML;
|
|
156
|
-
}, "getSvgNode"), r = { CONTAINER: "sn-notifications-container", NOTIFY: "sn-notify", NOTIFY_CONTENT: "sn-notify-content", NOTIFY_ICON: "sn-notify-icon", NOTIFY_CLOSE: "sn-notify-close", NOTIFY_TITLE: "sn-notify-title", NOTIFY_TEXT: "sn-notify-text", IS_X_CENTER: "sn-is-x-center", IS_Y_CENTER: "sn-is-y-center", IS_CENTER: "sn-is-center", IS_LEFT: "sn-is-left", IS_RIGHT: "sn-is-right", IS_TOP: "sn-is-top", IS_BOTTOM: "sn-is-bottom", NOTIFY_OUTLINE: "sn-notify-outline", NOTIFY_FILLED: "sn-notify-filled", NOTIFY_ERROR: "sn-notify-error", NOTIFY_WARNING: "sn-notify-warning", NOTIFY_SUCCESS: "sn-notify-success", NOTIFY_INFO: "sn-notify-info", NOTIFY_FADE: "sn-notify-fade", NOTIFY_FADE_IN: "sn-notify-fade-in", NOTIFY_SLIDE: "sn-notify-slide", NOTIFY_SLIDE_IN: "sn-notify-slide-in", NOTIFY_AUTOCLOSE: "sn-notify-autoclose" },
|
|
155
|
+
}, "getSvgNode"), r = { CONTAINER: "sn-notifications-container", NOTIFY: "sn-notify", NOTIFY_CONTENT: "sn-notify-content", NOTIFY_ICON: "sn-notify-icon", NOTIFY_CLOSE: "sn-notify-close", NOTIFY_TITLE: "sn-notify-title", NOTIFY_TEXT: "sn-notify-text", IS_X_CENTER: "sn-is-x-center", IS_Y_CENTER: "sn-is-y-center", IS_CENTER: "sn-is-center", IS_LEFT: "sn-is-left", IS_RIGHT: "sn-is-right", IS_TOP: "sn-is-top", IS_BOTTOM: "sn-is-bottom", NOTIFY_OUTLINE: "sn-notify-outline", NOTIFY_FILLED: "sn-notify-filled", NOTIFY_ERROR: "sn-notify-error", NOTIFY_WARNING: "sn-notify-warning", NOTIFY_SUCCESS: "sn-notify-success", NOTIFY_INFO: "sn-notify-info", NOTIFY_FADE: "sn-notify-fade", NOTIFY_FADE_IN: "sn-notify-fade-in", NOTIFY_SLIDE: "sn-notify-slide", NOTIFY_SLIDE_IN: "sn-notify-slide-in", NOTIFY_AUTOCLOSE: "sn-notify-autoclose" }, d = { ERROR: "error", WARNING: "warning", SUCCESS: "success", INFO: "info" }, Y = { OUTLINE: "outline", FILLED: "filled" }, y = { FADE: "fade", SLIDE: "slide" }, v = { CLOSE: m(ft), SUCCESS: m(mt), ERROR: m(ht), WARNING: m(vt), INFO: m(pt) }, x = u(function(e) {
|
|
157
156
|
e.wrapper.classList.add(r.NOTIFY_FADE), setTimeout(function() {
|
|
158
157
|
e.wrapper.classList.add(r.NOTIFY_FADE_IN);
|
|
159
158
|
}, 100);
|
|
160
|
-
}, "fadeIn"),
|
|
159
|
+
}, "fadeIn"), M = u(function(e) {
|
|
161
160
|
e.wrapper.classList.remove(r.NOTIFY_FADE_IN), setTimeout(function() {
|
|
162
161
|
e.wrapper.remove();
|
|
163
162
|
}, e.speed);
|
|
164
|
-
}, "fadeOut"), It =
|
|
163
|
+
}, "fadeOut"), It = u(function(e) {
|
|
165
164
|
e.wrapper.classList.add(r.NOTIFY_SLIDE), setTimeout(function() {
|
|
166
165
|
e.wrapper.classList.add(r.NOTIFY_SLIDE_IN);
|
|
167
166
|
}, 100);
|
|
168
|
-
}, "slideIn"), Et =
|
|
167
|
+
}, "slideIn"), Et = u(function(e) {
|
|
169
168
|
e.wrapper.classList.remove(r.NOTIFY_SLIDE_IN), setTimeout(function() {
|
|
170
169
|
e.wrapper.remove();
|
|
171
170
|
}, e.speed);
|
|
172
|
-
}, "slideOut"),
|
|
171
|
+
}, "slideOut"), D = function() {
|
|
173
172
|
function e(t) {
|
|
174
173
|
var s = this;
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
ct(this, e), this.notifyOut = u(function(K) {
|
|
175
|
+
K(s);
|
|
177
176
|
}, "notifyOut");
|
|
178
|
-
var n = t.notificationsGap, i = n === void 0 ? 20 : n, a = t.notificationsPadding, o = a === void 0 ? 20 : a, c = t.status,
|
|
179
|
-
if (this.customWrapper =
|
|
177
|
+
var n = t.notificationsGap, i = n === void 0 ? 20 : n, a = t.notificationsPadding, o = a === void 0 ? 20 : a, c = t.status, f = c === void 0 ? "success" : c, l = t.effect, h = l === void 0 ? y.FADE : l, I = t.type, g = I === void 0 ? "outline" : I, N = t.title, E = t.text, w = t.showIcon, $ = w === void 0 ? !0 : w, T = t.customIcon, B = T === void 0 ? "" : T, b = t.customClass, W = b === void 0 ? "" : b, L = t.speed, Z = L === void 0 ? 500 : L, C = t.showCloseButton, G = C === void 0 ? !0 : C, S = t.autoclose, H = S === void 0 ? !0 : S, _ = t.autotimeout, q = _ === void 0 ? 3e3 : _, F = t.position, X = F === void 0 ? "right top" : F, R = t.customWrapper, V = R === void 0 ? "" : R;
|
|
178
|
+
if (this.customWrapper = V, this.status = f, this.title = N, this.text = E, this.showIcon = $, this.customIcon = B, this.customClass = W, this.speed = Z, this.effect = h, this.showCloseButton = G, this.autoclose = H, this.autotimeout = q, this.notificationsGap = i, this.notificationsPadding = o, this.type = g, this.position = X, !this.checkRequirements()) {
|
|
180
179
|
console.error("You must specify 'title' or 'text' at least.");
|
|
181
180
|
return;
|
|
182
181
|
}
|
|
@@ -191,32 +190,32 @@ var dt = Object.defineProperty, d = function(e, t) {
|
|
|
191
190
|
this.container.classList[this.position === "center" ? "add" : "remove"](r.IS_CENTER), this.container.classList[this.position.includes("left") ? "add" : "remove"](r.IS_LEFT), this.container.classList[this.position.includes("right") ? "add" : "remove"](r.IS_RIGHT), this.container.classList[this.position.includes("top") ? "add" : "remove"](r.IS_TOP), this.container.classList[this.position.includes("bottom") ? "add" : "remove"](r.IS_BOTTOM), this.container.classList[this.position.includes("x-center") ? "add" : "remove"](r.IS_X_CENTER), this.container.classList[this.position.includes("y-center") ? "add" : "remove"](r.IS_Y_CENTER);
|
|
192
191
|
} }, { key: "setCloseButton", value: function() {
|
|
193
192
|
var s = this, n = document.createElement("div");
|
|
194
|
-
n.classList.add(r.NOTIFY_CLOSE), n.innerHTML =
|
|
193
|
+
n.classList.add(r.NOTIFY_CLOSE), n.innerHTML = v.CLOSE, this.wrapper.appendChild(n), n.addEventListener("click", function() {
|
|
195
194
|
s.close();
|
|
196
195
|
});
|
|
197
196
|
} }, { key: "setWrapper", value: function() {
|
|
198
197
|
var s = this;
|
|
199
198
|
switch (this.customWrapper ? this.wrapper = Ot(this.customWrapper) : this.wrapper = document.createElement("div"), this.wrapper.style.setProperty("--sn-notify-transition-duration", "".concat(this.speed, "ms")), this.wrapper.classList.add(r.NOTIFY), this.type) {
|
|
200
|
-
case
|
|
199
|
+
case Y.OUTLINE:
|
|
201
200
|
this.wrapper.classList.add(r.NOTIFY_OUTLINE);
|
|
202
201
|
break;
|
|
203
|
-
case
|
|
202
|
+
case Y.FILLED:
|
|
204
203
|
this.wrapper.classList.add(r.NOTIFY_FILLED);
|
|
205
204
|
break;
|
|
206
205
|
default:
|
|
207
206
|
this.wrapper.classList.add(r.NOTIFY_OUTLINE);
|
|
208
207
|
}
|
|
209
208
|
switch (this.status) {
|
|
210
|
-
case
|
|
209
|
+
case d.SUCCESS:
|
|
211
210
|
this.wrapper.classList.add(r.NOTIFY_SUCCESS);
|
|
212
211
|
break;
|
|
213
|
-
case
|
|
212
|
+
case d.ERROR:
|
|
214
213
|
this.wrapper.classList.add(r.NOTIFY_ERROR);
|
|
215
214
|
break;
|
|
216
|
-
case
|
|
215
|
+
case d.WARNING:
|
|
217
216
|
this.wrapper.classList.add(r.NOTIFY_WARNING);
|
|
218
217
|
break;
|
|
219
|
-
case
|
|
218
|
+
case d.INFO:
|
|
220
219
|
this.wrapper.classList.add(r.NOTIFY_INFO);
|
|
221
220
|
break;
|
|
222
221
|
}
|
|
@@ -229,25 +228,23 @@ var dt = Object.defineProperty, d = function(e, t) {
|
|
|
229
228
|
var n, i;
|
|
230
229
|
this.title && (n = document.createElement("div"), n.classList.add(r.NOTIFY_TITLE), n.textContent = this.title.trim(), this.showCloseButton || (n.style.paddingRight = "0")), this.text && (i = document.createElement("div"), i.classList.add(r.NOTIFY_TEXT), i.innerHTML = this.text.trim(), this.title || (i.style.marginTop = "0")), this.wrapper.appendChild(s), this.title && s.appendChild(n), this.text && s.appendChild(i);
|
|
231
230
|
} }, { key: "setIcon", value: function() {
|
|
232
|
-
var s =
|
|
231
|
+
var s = u(function(i) {
|
|
233
232
|
switch (i) {
|
|
234
|
-
case
|
|
235
|
-
return
|
|
236
|
-
case
|
|
237
|
-
return
|
|
238
|
-
case
|
|
239
|
-
return
|
|
240
|
-
case
|
|
241
|
-
return
|
|
233
|
+
case d.SUCCESS:
|
|
234
|
+
return v.SUCCESS;
|
|
235
|
+
case d.ERROR:
|
|
236
|
+
return v.ERROR;
|
|
237
|
+
case d.WARNING:
|
|
238
|
+
return v.WARNING;
|
|
239
|
+
case d.INFO:
|
|
240
|
+
return v.INFO;
|
|
242
241
|
}
|
|
243
242
|
}, "computedIcon"), n = document.createElement("div");
|
|
244
243
|
n.classList.add(r.NOTIFY_ICON), n.innerHTML = this.customIcon || s(this.status), (this.status || this.customIcon) && this.wrapper.appendChild(n);
|
|
245
244
|
} }, { key: "setObserver", value: function() {
|
|
246
245
|
var s = this, n = new IntersectionObserver(function(i) {
|
|
247
|
-
if (i[0].intersectionRatio <= 0)
|
|
248
|
-
|
|
249
|
-
else
|
|
250
|
-
return;
|
|
246
|
+
if (i[0].intersectionRatio <= 0) s.close();
|
|
247
|
+
else return;
|
|
251
248
|
}, { threshold: 0 });
|
|
252
249
|
setTimeout(function() {
|
|
253
250
|
n.observe(s.wrapper);
|
|
@@ -263,43 +260,49 @@ var dt = Object.defineProperty, d = function(e, t) {
|
|
|
263
260
|
this.notifyOut(this.selectedNotifyOutEffect);
|
|
264
261
|
} }, { key: "setEffect", value: function() {
|
|
265
262
|
switch (this.effect) {
|
|
266
|
-
case
|
|
267
|
-
this.selectedNotifyInEffect =
|
|
263
|
+
case y.FADE:
|
|
264
|
+
this.selectedNotifyInEffect = x, this.selectedNotifyOutEffect = M;
|
|
268
265
|
break;
|
|
269
|
-
case
|
|
266
|
+
case y.SLIDE:
|
|
270
267
|
this.selectedNotifyInEffect = It, this.selectedNotifyOutEffect = Et;
|
|
271
268
|
break;
|
|
272
269
|
default:
|
|
273
|
-
this.selectedNotifyInEffect =
|
|
270
|
+
this.selectedNotifyInEffect = x, this.selectedNotifyOutEffect = M;
|
|
274
271
|
}
|
|
275
272
|
} }]), e;
|
|
276
273
|
}();
|
|
277
|
-
|
|
278
|
-
var
|
|
279
|
-
globalThis.Notify =
|
|
274
|
+
u(D, "Notify");
|
|
275
|
+
var U = D;
|
|
276
|
+
globalThis.Notify = U;
|
|
280
277
|
function Nt(e, t) {
|
|
281
278
|
const s = window.location.href, n = new URL(s);
|
|
282
279
|
return `${n.port ? `${n.protocol}//${n.hostname}:${n.port}` : `${n.protocol}//${n.hostname}`}${e === "/" ? "" : e}/${t}`;
|
|
283
280
|
}
|
|
284
281
|
function yt(e, t) {
|
|
285
|
-
const { range: s, lines: n, annotated: i } =
|
|
286
|
-
return (o ?
|
|
282
|
+
const { range: s, lines: n, annotated: i } = tt(e), a = t ? P(t, i) : void 0, o = s ?? a;
|
|
283
|
+
return (o ? et(n, o) : n).join(`
|
|
287
284
|
`);
|
|
288
285
|
}
|
|
289
286
|
async function gt(e, t) {
|
|
290
287
|
const s = e.querySelectorAll("object[type='reveal.js/code']"), n = Array.from(s).map(async (i) => {
|
|
291
|
-
const a = i.getAttribute("data-src"), o = i.getAttribute("data-lines");
|
|
288
|
+
const a = i.getAttribute("data-src"), o = i.getAttribute("data-lines"), c = i.hasAttribute("data-escape-code");
|
|
292
289
|
if (a) {
|
|
293
|
-
const
|
|
290
|
+
const f = Nt(t.basePath, a);
|
|
294
291
|
try {
|
|
295
|
-
const l = await
|
|
292
|
+
const l = await at(f, t);
|
|
296
293
|
if (l) {
|
|
297
|
-
const
|
|
298
|
-
|
|
294
|
+
const h = c ? l.replace(/[&<>'"]/g, (E) => ({
|
|
295
|
+
"&": "&",
|
|
296
|
+
"<": "<",
|
|
297
|
+
">": ">",
|
|
298
|
+
"'": "'",
|
|
299
|
+
'"': """
|
|
300
|
+
})[E] || E) : l, I = yt(h, o), N = new ot(i.attributes, a, f, I, t).create();
|
|
301
|
+
nt(i, N);
|
|
299
302
|
}
|
|
300
303
|
} catch (l) {
|
|
301
|
-
const
|
|
302
|
-
t.enableNotify && new
|
|
304
|
+
const h = `exception while processing external code ${a}`;
|
|
305
|
+
t.enableNotify && new U({ text: h }), console.error(h, l);
|
|
303
306
|
}
|
|
304
307
|
} else
|
|
305
308
|
console.error("object[type='reveal.js/code'] has no src attribute", i);
|
|
@@ -326,29 +329,29 @@ function _t(e) {
|
|
|
326
329
|
function Ft(e) {
|
|
327
330
|
return Array.isArray(e) ? [] : {};
|
|
328
331
|
}
|
|
329
|
-
function
|
|
330
|
-
return t.clone !== !1 && t.isMergeableObject(e) ?
|
|
332
|
+
function O(e, t) {
|
|
333
|
+
return t.clone !== !1 && t.isMergeableObject(e) ? p(Ft(e), e, t) : e;
|
|
331
334
|
}
|
|
332
335
|
function Rt(e, t, s) {
|
|
333
336
|
return e.concat(t).map(function(n) {
|
|
334
|
-
return
|
|
337
|
+
return O(n, s);
|
|
335
338
|
});
|
|
336
339
|
}
|
|
337
340
|
function At(e, t) {
|
|
338
341
|
if (!t.customMerge)
|
|
339
|
-
return
|
|
342
|
+
return p;
|
|
340
343
|
var s = t.customMerge(e);
|
|
341
|
-
return typeof s == "function" ? s :
|
|
344
|
+
return typeof s == "function" ? s : p;
|
|
342
345
|
}
|
|
343
346
|
function Yt(e) {
|
|
344
347
|
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(t) {
|
|
345
348
|
return Object.propertyIsEnumerable.call(e, t);
|
|
346
349
|
}) : [];
|
|
347
350
|
}
|
|
348
|
-
function
|
|
351
|
+
function j(e) {
|
|
349
352
|
return Object.keys(e).concat(Yt(e));
|
|
350
353
|
}
|
|
351
|
-
function
|
|
354
|
+
function k(e, t) {
|
|
352
355
|
try {
|
|
353
356
|
return t in e;
|
|
354
357
|
} catch {
|
|
@@ -356,29 +359,29 @@ function D(e, t) {
|
|
|
356
359
|
}
|
|
357
360
|
}
|
|
358
361
|
function xt(e, t) {
|
|
359
|
-
return
|
|
362
|
+
return k(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t));
|
|
360
363
|
}
|
|
361
364
|
function Mt(e, t, s) {
|
|
362
365
|
var n = {};
|
|
363
|
-
return s.isMergeableObject(e) &&
|
|
364
|
-
n[i] =
|
|
365
|
-
}),
|
|
366
|
-
xt(e, i) || (
|
|
366
|
+
return s.isMergeableObject(e) && j(e).forEach(function(i) {
|
|
367
|
+
n[i] = O(e[i], s);
|
|
368
|
+
}), j(t).forEach(function(i) {
|
|
369
|
+
xt(e, i) || (k(e, i) && s.isMergeableObject(t[i]) ? n[i] = At(i, s)(e[i], t[i], s) : n[i] = O(t[i], s));
|
|
367
370
|
}), n;
|
|
368
371
|
}
|
|
369
|
-
function
|
|
370
|
-
s = s || {}, s.arrayMerge = s.arrayMerge || Rt, s.isMergeableObject = s.isMergeableObject || Tt, s.cloneUnlessOtherwiseSpecified =
|
|
372
|
+
function p(e, t, s) {
|
|
373
|
+
s = s || {}, s.arrayMerge = s.arrayMerge || Rt, s.isMergeableObject = s.isMergeableObject || Tt, s.cloneUnlessOtherwiseSpecified = O;
|
|
371
374
|
var n = Array.isArray(t), i = Array.isArray(e), a = n === i;
|
|
372
|
-
return a ? n ? s.arrayMerge(e, t, s) : Mt(e, t, s) :
|
|
375
|
+
return a ? n ? s.arrayMerge(e, t, s) : Mt(e, t, s) : O(t, s);
|
|
373
376
|
}
|
|
374
|
-
|
|
377
|
+
p.all = function(t, s) {
|
|
375
378
|
if (!Array.isArray(t))
|
|
376
379
|
throw new Error("first argument should be an array");
|
|
377
380
|
return t.reduce(function(n, i) {
|
|
378
|
-
return
|
|
381
|
+
return p(n, i, s);
|
|
379
382
|
}, {});
|
|
380
383
|
};
|
|
381
|
-
var jt =
|
|
384
|
+
var jt = p, Pt = jt;
|
|
382
385
|
const Dt = /* @__PURE__ */ wt(Pt), Ut = {
|
|
383
386
|
basePath: "/",
|
|
384
387
|
enableNotify: !0,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".reveal pre,.external-code-wrapper{width:100%}.external-code-wrapper footer.demo-ref{font-size:14px;margin-top:-18px;color:#0d99a5;text-align:right;cursor:help;transition:font-size .4s .1s}
|
|
2
|
-
(function(
|
|
3
|
-
`),
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".reveal pre,.external-code-wrapper{width:100%}:is(.external-code-wrapper footer.demo-ref):before{color:#0d99a5;margin-right:.3em}.external-code-wrapper footer.demo-ref{font-size:14px;margin-top:-18px;color:#0d99a5;text-align:right;cursor:help;transition:font-size .4s .1s}:is(.external-code-wrapper footer.demo-ref):hover{font-size:28px;cursor:none}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
(function(l,c){typeof exports=="object"&&typeof module<"u"?module.exports=c():typeof define=="function"&&define.amd?define(c):(l=typeof globalThis<"u"?globalThis:l||self,l.ClipCode=c())})(this,function(){"use strict";var Dt=Object.defineProperty;var Ut=(l,c,m)=>c in l?Dt(l,c,{enumerable:!0,configurable:!0,writable:!0,value:m}):l[c]=m;var B=(l,c,m)=>Ut(l,typeof c!="symbol"?c+"":c,m);class l extends Error{constructor(t){super(t)}}function c(e,t=!1){const s=t?-1:0;return e.replace(/\s/g,"").split(",").map(i=>{if(/^[\d-]+$/.test(i)){const[o,u]=i.split("-").map(d=>Number.parseInt(d,10)+s);return isNaN(u)?{start:o,end:o}:{start:o,end:u}}else throw new l(`could not parse ${i}`)})}function m(e){var n,i;const t=e.split(`
|
|
3
|
+
`),s=t[0];if(s.includes("@reveal.js/code")){const o=(i=(n=s.match(/lines=(['"]?(?<range>[\d,\s-]+)['"]?)/))==null?void 0:n.groups)==null?void 0:i.range,u=t.slice(1);if(o){const p=c(o,!0);return{lines:u,range:p,annotated:!0}}else return{lines:u,annotated:!0}}else return{lines:t,annotated:!1}}function W(e,t){return e.map((s,n)=>Z(n+1,t)?s:"…").filter((s,n,i)=>!(s==="…"&&i[n-1]==="…"))}function Z(e,t){return t.find(s=>e>=s.start&&e<=s.end)!==void 0}function G(e,t){e.parentNode?e.replaceWith(t):console.error("The element to be replaced is not attached to the DOM.")}function H(e,t){e.forEach(s=>{t.setAttribute(s.nodeName,s.nodeValue??"")})}function q(e){return e.split(".").pop()}class X{constructor(t,s,n,i,a){B(this,"providedLanguage");var o;this.attributes=t,this.src=s,this.href=n,this.codeStr=i,this.options=a,this.providedLanguage=(o=this.attributes.getNamedItem("data-lang"))==null?void 0:o.value}create(){const{wrapper:t,codeElement:s}=this._createElements(),n=this._codeClasses();return s.classList.add(...n),H([...this.attributes].filter(i=>i.nodeName!=="class"),s),s.innerHTML=this.codeStr,t}_createElements(){const t=this._createWrapper(),s=document.createElement("pre"),n=document.createElement("code"),i=this._footerHtml();return t.appendChild(s),s.appendChild(n),s.insertAdjacentHTML("afterend",i),{wrapper:t,codeElement:n}}_codeClasses(){const t=q(this.src),s=this.providedLanguage??t??"";return[...this.options.codeBlock.additionalClasses,s]}_footerHtml(){var s,n;return`<footer class="demo-ref"><a href="${(s=this.options)!=null&&s.local.absPath?`${this.options.local.scheme}${(n=this.options)==null?void 0:n.local.absPath}/${this.src}`:this.href}">${this.src}</a></footer>`}_createWrapper(){var s;const t=document.createElement("div");return t.classList.add("external-code-wrapper"),t.classList.add(...((s=this.attributes.getNamedItem("class"))==null?void 0:s.value.split(" "))??[]),t}}async function V(e,t){const s=await fetch(e);if(s.ok){const n=await s.text();return t.codeBlock.trim?n.trim():n}else throw new Error(s.statusText)}function K(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function z(e,t){for(var s=0;s<t.length;s++){var n=t[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function J(e,t,s){return t&&z(e.prototype,t),e}var Q=Object.defineProperty,f=function(e,t){return Q(e,"name",{value:t,configurable:!0})},tt=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
4
|
<path d="m8.94 8 4.2-4.193a.67.67 0 0 0-.947-.947L8 7.06l-4.193-4.2a.67.67 0 1 0-.947.947L7.06 8l-4.2 4.193a.667.667 0 0 0 .217 1.093.666.666 0 0 0 .73-.146L8 8.94l4.193 4.2a.666.666 0 0 0 1.094-.217.665.665 0 0 0-.147-.73L8.94 8Z" fill="currentColor"/>
|
|
5
5
|
</svg>
|
|
6
|
-
`,
|
|
6
|
+
`,et=`<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7
7
|
<path d="M16 2.667a13.333 13.333 0 1 0 0 26.666 13.333 13.333 0 0 0 0-26.666Zm0 24A10.667 10.667 0 0 1 5.333 16a10.56 10.56 0 0 1 2.254-6.533l14.946 14.946A10.56 10.56 0 0 1 16 26.667Zm8.413-4.134L9.467 7.587A10.56 10.56 0 0 1 16 5.333 10.667 10.667 0 0 1 26.667 16a10.56 10.56 0 0 1-2.254 6.533Z" fill="currentColor"/>
|
|
8
8
|
</svg>
|
|
9
|
-
`,
|
|
9
|
+
`,st=`<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
10
10
|
<path d="M16 14.667A1.333 1.333 0 0 0 14.667 16v5.333a1.333 1.333 0 0 0 2.666 0V16A1.333 1.333 0 0 0 16 14.667Zm.507-5.227a1.333 1.333 0 0 0-1.014 0 1.334 1.334 0 0 0-.44.28 1.56 1.56 0 0 0-.28.44c-.075.158-.11.332-.106.507a1.332 1.332 0 0 0 .386.946c.13.118.279.213.44.28a1.334 1.334 0 0 0 1.84-1.226 1.4 1.4 0 0 0-.386-.947 1.334 1.334 0 0 0-.44-.28ZM16 2.667a13.333 13.333 0 1 0 0 26.666 13.333 13.333 0 0 0 0-26.666Zm0 24a10.666 10.666 0 1 1 0-21.333 10.666 10.666 0 0 1 0 21.333Z" fill="currentColor"/>
|
|
11
11
|
</svg>
|
|
12
|
-
`,
|
|
12
|
+
`,nt=`<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
13
13
|
<path d="m19.627 11.72-5.72 5.733-2.2-2.2a1.334 1.334 0 1 0-1.88 1.881l3.133 3.146a1.333 1.333 0 0 0 1.88 0l6.667-6.667a1.333 1.333 0 1 0-1.88-1.893ZM16 2.667a13.333 13.333 0 1 0 0 26.666 13.333 13.333 0 0 0 0-26.666Zm0 24a10.666 10.666 0 1 1 0-21.333 10.666 10.666 0 0 1 0 21.333Z" fill="currentColor"/>
|
|
14
14
|
</svg>
|
|
15
|
-
`,
|
|
15
|
+
`,it=`<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
16
16
|
<path d="M16.334 17.667a1.334 1.334 0 0 0 1.334-1.333v-5.333a1.333 1.333 0 0 0-2.665 0v5.333a1.333 1.333 0 0 0 1.33 1.333Zm-.508 5.227c.325.134.69.134 1.014 0 .165-.064.314-.159.44-.28a1.56 1.56 0 0 0 .28-.44c.076-.158.112-.332.107-.507a1.332 1.332 0 0 0-.387-.946 1.532 1.532 0 0 0-.44-.28 1.334 1.334 0 0 0-1.838 1.226 1.4 1.4 0 0 0 .385.947c.127.121.277.216.44.28Zm.508 6.773a13.333 13.333 0 1 0 0-26.667 13.333 13.333 0 0 0 0 26.667Zm0-24A10.667 10.667 0 1 1 16.54 27a10.667 10.667 0 0 1-.206-21.333Z" fill="currentColor"/>
|
|
17
17
|
</svg>
|
|
18
|
-
`,
|
|
19
|
-
`)}async function
|
|
18
|
+
`,rt=f(function(e){return new DOMParser().parseFromString(e,"text/html").body.childNodes[0]},"stringToHTML"),I=f(function(e){var t=new DOMParser().parseFromString(e,"application/xml");return document.importNode(t.documentElement,!0).outerHTML},"getSvgNode"),r={CONTAINER:"sn-notifications-container",NOTIFY:"sn-notify",NOTIFY_CONTENT:"sn-notify-content",NOTIFY_ICON:"sn-notify-icon",NOTIFY_CLOSE:"sn-notify-close",NOTIFY_TITLE:"sn-notify-title",NOTIFY_TEXT:"sn-notify-text",IS_X_CENTER:"sn-is-x-center",IS_Y_CENTER:"sn-is-y-center",IS_CENTER:"sn-is-center",IS_LEFT:"sn-is-left",IS_RIGHT:"sn-is-right",IS_TOP:"sn-is-top",IS_BOTTOM:"sn-is-bottom",NOTIFY_OUTLINE:"sn-notify-outline",NOTIFY_FILLED:"sn-notify-filled",NOTIFY_ERROR:"sn-notify-error",NOTIFY_WARNING:"sn-notify-warning",NOTIFY_SUCCESS:"sn-notify-success",NOTIFY_INFO:"sn-notify-info",NOTIFY_FADE:"sn-notify-fade",NOTIFY_FADE_IN:"sn-notify-fade-in",NOTIFY_SLIDE:"sn-notify-slide",NOTIFY_SLIDE_IN:"sn-notify-slide-in",NOTIFY_AUTOCLOSE:"sn-notify-autoclose"},h={ERROR:"error",WARNING:"warning",SUCCESS:"success",INFO:"info"},b={OUTLINE:"outline",FILLED:"filled"},w={FADE:"fade",SLIDE:"slide"},E={CLOSE:I(tt),SUCCESS:I(nt),ERROR:I(et),WARNING:I(it),INFO:I(st)},L=f(function(e){e.wrapper.classList.add(r.NOTIFY_FADE),setTimeout(function(){e.wrapper.classList.add(r.NOTIFY_FADE_IN)},100)},"fadeIn"),C=f(function(e){e.wrapper.classList.remove(r.NOTIFY_FADE_IN),setTimeout(function(){e.wrapper.remove()},e.speed)},"fadeOut"),ot=f(function(e){e.wrapper.classList.add(r.NOTIFY_SLIDE),setTimeout(function(){e.wrapper.classList.add(r.NOTIFY_SLIDE_IN)},100)},"slideIn"),at=f(function(e){e.wrapper.classList.remove(r.NOTIFY_SLIDE_IN),setTimeout(function(){e.wrapper.remove()},e.speed)},"slideOut"),S=function(){function e(t){var s=this;K(this,e),this.notifyOut=f(function(Pt){Pt(s)},"notifyOut");var n=t.notificationsGap,i=n===void 0?20:n,a=t.notificationsPadding,o=a===void 0?20:a,u=t.status,p=u===void 0?"success":u,d=t.effect,O=d===void 0?w.FADE:d,y=t.type,A=y===void 0?"outline":y,T=t.title,g=t.text,Y=t.showIcon,St=Y===void 0?!0:Y,x=t.customIcon,_t=x===void 0?"":x,j=t.customClass,Ft=j===void 0?"":j,M=t.speed,Rt=M===void 0?500:M,P=t.showCloseButton,At=P===void 0?!0:P,D=t.autoclose,Yt=D===void 0?!0:D,U=t.autotimeout,xt=U===void 0?3e3:U,k=t.position,jt=k===void 0?"right top":k,$=t.customWrapper,Mt=$===void 0?"":$;if(this.customWrapper=Mt,this.status=p,this.title=T,this.text=g,this.showIcon=St,this.customIcon=_t,this.customClass=Ft,this.speed=Rt,this.effect=O,this.showCloseButton=At,this.autoclose=Yt,this.autotimeout=xt,this.notificationsGap=i,this.notificationsPadding=o,this.type=A,this.position=jt,!this.checkRequirements()){console.error("You must specify 'title' or 'text' at least.");return}this.setContainer(),this.setWrapper(),this.setPosition(),this.showIcon&&this.setIcon(),this.showCloseButton&&this.setCloseButton(),this.setContent(),this.container.prepend(this.wrapper),this.setEffect(),this.notifyIn(this.selectedNotifyInEffect),this.autoclose&&this.autoClose(),this.setObserver()}return J(e,[{key:"checkRequirements",value:function(){return!!(this.title||this.text)}},{key:"setContainer",value:function(){var s=document.querySelector(".".concat(r.CONTAINER));s?this.container=s:(this.container=document.createElement("div"),this.container.classList.add(r.CONTAINER),document.body.appendChild(this.container)),this.notificationsPadding&&this.container.style.setProperty("--sn-notifications-padding","".concat(this.notificationsPadding,"px")),this.notificationsGap&&this.container.style.setProperty("--sn-notifications-gap","".concat(this.notificationsGap,"px"))}},{key:"setPosition",value:function(){this.container.classList[this.position==="center"?"add":"remove"](r.IS_CENTER),this.container.classList[this.position.includes("left")?"add":"remove"](r.IS_LEFT),this.container.classList[this.position.includes("right")?"add":"remove"](r.IS_RIGHT),this.container.classList[this.position.includes("top")?"add":"remove"](r.IS_TOP),this.container.classList[this.position.includes("bottom")?"add":"remove"](r.IS_BOTTOM),this.container.classList[this.position.includes("x-center")?"add":"remove"](r.IS_X_CENTER),this.container.classList[this.position.includes("y-center")?"add":"remove"](r.IS_Y_CENTER)}},{key:"setCloseButton",value:function(){var s=this,n=document.createElement("div");n.classList.add(r.NOTIFY_CLOSE),n.innerHTML=E.CLOSE,this.wrapper.appendChild(n),n.addEventListener("click",function(){s.close()})}},{key:"setWrapper",value:function(){var s=this;switch(this.customWrapper?this.wrapper=rt(this.customWrapper):this.wrapper=document.createElement("div"),this.wrapper.style.setProperty("--sn-notify-transition-duration","".concat(this.speed,"ms")),this.wrapper.classList.add(r.NOTIFY),this.type){case b.OUTLINE:this.wrapper.classList.add(r.NOTIFY_OUTLINE);break;case b.FILLED:this.wrapper.classList.add(r.NOTIFY_FILLED);break;default:this.wrapper.classList.add(r.NOTIFY_OUTLINE)}switch(this.status){case h.SUCCESS:this.wrapper.classList.add(r.NOTIFY_SUCCESS);break;case h.ERROR:this.wrapper.classList.add(r.NOTIFY_ERROR);break;case h.WARNING:this.wrapper.classList.add(r.NOTIFY_WARNING);break;case h.INFO:this.wrapper.classList.add(r.NOTIFY_INFO);break}this.autoclose&&(this.wrapper.classList.add(r.NOTIFY_AUTOCLOSE),this.wrapper.style.setProperty("--sn-notify-autoclose-timeout","".concat(this.autotimeout+this.speed,"ms"))),this.customClass&&this.customClass.split(" ").forEach(function(n){s.wrapper.classList.add(n)})}},{key:"setContent",value:function(){var s=document.createElement("div");s.classList.add(r.NOTIFY_CONTENT);var n,i;this.title&&(n=document.createElement("div"),n.classList.add(r.NOTIFY_TITLE),n.textContent=this.title.trim(),this.showCloseButton||(n.style.paddingRight="0")),this.text&&(i=document.createElement("div"),i.classList.add(r.NOTIFY_TEXT),i.innerHTML=this.text.trim(),this.title||(i.style.marginTop="0")),this.wrapper.appendChild(s),this.title&&s.appendChild(n),this.text&&s.appendChild(i)}},{key:"setIcon",value:function(){var s=f(function(i){switch(i){case h.SUCCESS:return E.SUCCESS;case h.ERROR:return E.ERROR;case h.WARNING:return E.WARNING;case h.INFO:return E.INFO}},"computedIcon"),n=document.createElement("div");n.classList.add(r.NOTIFY_ICON),n.innerHTML=this.customIcon||s(this.status),(this.status||this.customIcon)&&this.wrapper.appendChild(n)}},{key:"setObserver",value:function(){var s=this,n=new IntersectionObserver(function(i){if(i[0].intersectionRatio<=0)s.close();else return},{threshold:0});setTimeout(function(){n.observe(s.wrapper)},this.speed)}},{key:"notifyIn",value:function(t){t(this)}},{key:"autoClose",value:function(){var s=this;setTimeout(function(){s.close()},this.autotimeout+this.speed)}},{key:"close",value:function(){this.notifyOut(this.selectedNotifyOutEffect)}},{key:"setEffect",value:function(){switch(this.effect){case w.FADE:this.selectedNotifyInEffect=L,this.selectedNotifyOutEffect=C;break;case w.SLIDE:this.selectedNotifyInEffect=ot,this.selectedNotifyOutEffect=at;break;default:this.selectedNotifyInEffect=L,this.selectedNotifyOutEffect=C}}}]),e}();f(S,"Notify");var _=S;globalThis.Notify=_;function ct(e,t){const s=window.location.href,n=new URL(s);return`${n.port?`${n.protocol}//${n.hostname}:${n.port}`:`${n.protocol}//${n.hostname}`}${e==="/"?"":e}/${t}`}function lt(e,t){const{range:s,lines:n,annotated:i}=m(e),a=t?c(t,i):void 0,o=s??a;return(o?W(n,o):n).join(`
|
|
19
|
+
`)}async function ut(e,t){const s=e.querySelectorAll("object[type='reveal.js/code']"),n=Array.from(s).map(async i=>{const a=i.getAttribute("data-src"),o=i.getAttribute("data-lines"),u=i.hasAttribute("data-escape-code");if(a){const p=ct(t.basePath,a);try{const d=await V(p,t);if(d){const O=u?d.replace(/[&<>'"]/g,g=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[g]||g):d,y=lt(O,o),T=new X(i.attributes,a,p,y,t).create();G(i,T)}}catch(d){const O=`exception while processing external code ${a}`;t.enableNotify&&new _({text:O}),console.error(O,d)}}else console.error("object[type='reveal.js/code'] has no src attribute",i)});return Promise.all(n)}function dt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ft=function(t){return ht(t)&&!pt(t)};function ht(e){return!!e&&typeof e=="object"}function pt(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Ot(e)}var mt=typeof Symbol=="function"&&Symbol.for,vt=mt?Symbol.for("react.element"):60103;function Ot(e){return e.$$typeof===vt}function It(e){return Array.isArray(e)?[]:{}}function N(e,t){return t.clone!==!1&&t.isMergeableObject(e)?v(It(e),e,t):e}function Et(e,t,s){return e.concat(t).map(function(n){return N(n,s)})}function Nt(e,t){if(!t.customMerge)return v;var s=t.customMerge(e);return typeof s=="function"?s:v}function yt(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function F(e){return Object.keys(e).concat(yt(e))}function R(e,t){try{return t in e}catch{return!1}}function gt(e,t){return R(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function wt(e,t,s){var n={};return s.isMergeableObject(e)&&F(e).forEach(function(i){n[i]=N(e[i],s)}),F(t).forEach(function(i){gt(e,i)||(R(e,i)&&s.isMergeableObject(t[i])?n[i]=Nt(i,s)(e[i],t[i],s):n[i]=N(t[i],s))}),n}function v(e,t,s){s=s||{},s.arrayMerge=s.arrayMerge||Et,s.isMergeableObject=s.isMergeableObject||ft,s.cloneUnlessOtherwiseSpecified=N;var n=Array.isArray(t),i=Array.isArray(e),a=n===i;return a?n?s.arrayMerge(e,t,s):wt(e,t,s):N(t,s)}v.all=function(t,s){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,i){return v(n,i,s)},{})};var Tt=v,bt=Tt;const Lt=dt(bt),Ct={basePath:"/",enableNotify:!0,codeBlock:{trim:!0,additionalClasses:[]},local:{scheme:"vscode://file//"}};return()=>({id:"external-code",init:e=>{const t=e.getRevealElement();if(!t)console.error("Cannot find reveal element");else{const n=e.getConfig().externalCode??{},i=Lt(Ct,n);return ut(t,i)}}})});
|
package/dist/impl/fetcher.d.ts
CHANGED
package/dist/impl/main.d.ts
CHANGED
package/dist/impl/stripper.d.ts
CHANGED
package/dist/options.d.ts
CHANGED
package/dist/plugin.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"syntax",
|
|
11
11
|
"diagrams"
|
|
12
12
|
],
|
|
13
|
-
"version": "1.0.
|
|
13
|
+
"version": "1.0.6",
|
|
14
14
|
"files": [
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"eslint-plugin-import": "^2.29.1",
|
|
43
43
|
"husky": "^9.0.11",
|
|
44
44
|
"lint-staged": "^15.2.2",
|
|
45
|
-
"postcss-nesting": "^
|
|
45
|
+
"postcss-nesting": "^13.0.0",
|
|
46
46
|
"typescript": "^5.2.2",
|
|
47
47
|
"vite": "^5.2.0",
|
|
48
48
|
"vite-plugin-css-injected-by-js": "^3.5.0",
|
|
49
|
-
"vite-plugin-dts": "^
|
|
49
|
+
"vite-plugin-dts": "^4.5.4",
|
|
50
50
|
"vite-plugin-remove-console": "^2.2.0",
|
|
51
|
-
"vitest": "^
|
|
51
|
+
"vitest": "^2.0.5"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"deepmerge": "^4.3.1",
|