@mhmo91/schmancy 0.9.18 → 0.9.20

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.
Files changed (78) hide show
  1. package/dist/agent/{flow-CaPi2G8y.js.map → flow-3RrZM-e7.js.map} +1 -1
  2. package/dist/agent/index.es-Dymj8REP.js +489 -0
  3. package/dist/agent/index.es-Dymj8REP.js.map +1 -0
  4. package/dist/agent/{rolldown-runtime-DsMetpgY.js → rolldown-runtime-BIIoCavz.js} +9 -2
  5. package/dist/agent/schmancy.agent.js +3330 -3805
  6. package/dist/agent/schmancy.agent.js.map +1 -1
  7. package/dist/agent/{vendor-highlight-CHJZQQB7.js → vendor-highlight-BmnMldIa.js} +90 -85
  8. package/dist/agent/{vendor-highlight-CHJZQQB7.js.map → vendor-highlight-BmnMldIa.js.map} +1 -1
  9. package/dist/agent/{vendor-jsqr-r7GNh4P3.js → vendor-jsqr-1wQ5xc49.js} +1 -1
  10. package/dist/agent/{vendor-jsqr-r7GNh4P3.js.map → vendor-jsqr-1wQ5xc49.js.map} +1 -1
  11. package/dist/agent/{vendor-material-color-Be96dpGE.js.map → vendor-material-color-33Mj762T.js.map} +1 -1
  12. package/dist/badge.cjs +1 -1
  13. package/dist/badge.js +1 -1
  14. package/dist/{code-highlight-zSYcSfCz.cjs → code-highlight-B_l8vDzn.cjs} +11 -11
  15. package/dist/code-highlight-B_l8vDzn.cjs.map +1 -0
  16. package/dist/{code-highlight-BgExKEto.js → code-highlight-CI_gqXYX.js} +30 -22
  17. package/dist/code-highlight-CI_gqXYX.js.map +1 -0
  18. package/dist/code-highlight.cjs +1 -1
  19. package/dist/code-highlight.js +1 -1
  20. package/dist/content-drawer.cjs +1 -1
  21. package/dist/content-drawer.js +1 -1
  22. package/dist/{flow-BGkHnOnd.js.map → flow-BPDtbhLe.js.map} +1 -1
  23. package/dist/{flow-ClAJ6Qby.cjs.map → flow-Dn9AZktE.cjs.map} +1 -1
  24. package/dist/handover/agent-runtime-followups.md +1 -1
  25. package/dist/handover/agent-runtime-v1.md +3 -3
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.es-BgmFX1JM.cjs +1 -0
  28. package/dist/index.es-BgmFX1JM.cjs.map +1 -0
  29. package/dist/index.es-CLyb_o3Y.js +489 -0
  30. package/dist/index.es-CLyb_o3Y.js.map +1 -0
  31. package/dist/index.js +5 -5
  32. package/dist/nav-drawer.cjs +1 -1
  33. package/dist/nav-drawer.js +1 -1
  34. package/dist/navigation-bar.cjs +1 -1
  35. package/dist/navigation-bar.js +1 -1
  36. package/dist/{splash-screen-COg3Z6n8.js.map → splash-screen-BHgb3c3Q.js.map} +1 -1
  37. package/dist/{splash-screen-C9HqX2nR.cjs.map → splash-screen-DteUfSV3.cjs.map} +1 -1
  38. package/dist/splash-screen.cjs +1 -1
  39. package/dist/splash-screen.js +1 -1
  40. package/dist/{src-C7niWYur.js → src-Dw-PjtMH.js} +5 -5
  41. package/dist/{src-C7niWYur.js.map → src-Dw-PjtMH.js.map} +1 -1
  42. package/dist/{src-I4M33WK2.cjs → src-sG7Ihf0e.cjs} +1 -1
  43. package/dist/{src-I4M33WK2.cjs.map → src-sG7Ihf0e.cjs.map} +1 -1
  44. package/dist/{table-B-DsOqzT.cjs → table-DFlJhG5E.cjs} +1 -1
  45. package/dist/{table-B-DsOqzT.cjs.map → table-DFlJhG5E.cjs.map} +1 -1
  46. package/dist/{table-hBEZRxM_.js → table-Dwt66SR6.js} +1 -1
  47. package/dist/{table-hBEZRxM_.js.map → table-Dwt66SR6.js.map} +1 -1
  48. package/dist/table.cjs +1 -1
  49. package/dist/table.js +1 -1
  50. package/dist/teleport.cjs +1 -1
  51. package/dist/teleport.js +1 -1
  52. package/dist/typewriter.cjs +123 -1
  53. package/dist/typewriter.cjs.map +1 -0
  54. package/dist/typewriter.js +214 -2
  55. package/dist/typewriter.js.map +1 -0
  56. package/dist/{utils-xBXLvebz.js.map → utils-Bp2jhyZc.js.map} +1 -1
  57. package/dist/{utils-2qrmPb78.cjs.map → utils-CBPQvxNW.cjs.map} +1 -1
  58. package/dist/utils.cjs +1 -1
  59. package/dist/utils.js +1 -1
  60. package/package.json +1 -1
  61. package/src/code-highlight/code-highlight.ts +56 -24
  62. package/src/typewriter/typewriter.ts +26 -4
  63. package/types/src/code-highlight/code-highlight.d.ts +8 -1
  64. package/types/src/typewriter/typewriter.d.ts +4 -1
  65. package/dist/code-highlight-BgExKEto.js.map +0 -1
  66. package/dist/code-highlight-zSYcSfCz.cjs.map +0 -1
  67. package/dist/typewriter-DyN7xa0n.js +0 -701
  68. package/dist/typewriter-DyN7xa0n.js.map +0 -1
  69. package/dist/typewriter-LK0S4NEr.cjs +0 -123
  70. package/dist/typewriter-LK0S4NEr.cjs.map +0 -1
  71. /package/dist/agent/{flow-CaPi2G8y.js → flow-3RrZM-e7.js} +0 -0
  72. /package/dist/agent/{vendor-material-color-Be96dpGE.js → vendor-material-color-33Mj762T.js} +0 -0
  73. /package/dist/{flow-BGkHnOnd.js → flow-BPDtbhLe.js} +0 -0
  74. /package/dist/{flow-ClAJ6Qby.cjs → flow-Dn9AZktE.cjs} +0 -0
  75. /package/dist/{splash-screen-COg3Z6n8.js → splash-screen-BHgb3c3Q.js} +0 -0
  76. /package/dist/{splash-screen-C9HqX2nR.cjs → splash-screen-DteUfSV3.cjs} +0 -0
  77. /package/dist/{utils-xBXLvebz.js → utils-Bp2jhyZc.js} +0 -0
  78. /package/dist/{utils-2qrmPb78.cjs → utils-CBPQvxNW.cjs} +0 -0
@@ -1,701 +0,0 @@
1
- import { a as e } from "./tailwind.mixin-H5Pn7vSJ.js";
2
- import { t } from "./decorate-D_utPUsC.js";
3
- import { t as n } from "./litElement.mixin-BnNYZ24e.js";
4
- import "./mixins.js";
5
- import { n as r } from "./delay-DwX65fSc.js";
6
- import { t as i } from "./hashContent-B2IntJQf.js";
7
- import { t as a } from "./intersection-BrXp4YTO.js";
8
- import { customElement as o, property as s, query as c, queryAssignedElements as l, queryAssignedNodes as u } from "lit/decorators.js";
9
- import { css as d, html as f } from "lit";
10
- var p = (e) => Array.isArray(e), m = (e) => p(e) ? e : [e], h = "data-typeit-id", g = "ti-cursor", _ = {
11
- started: !1,
12
- completed: !1,
13
- frozen: !1,
14
- destroyed: !1
15
- }, v = {
16
- breakLines: !0,
17
- cursor: {
18
- autoPause: !0,
19
- autoPauseDelay: 500,
20
- animation: {
21
- frames: [
22
- 0,
23
- 0,
24
- 1
25
- ].map((e) => ({ opacity: e })),
26
- options: {
27
- iterations: Infinity,
28
- easing: "steps(2, start)",
29
- fill: "forwards"
30
- }
31
- }
32
- },
33
- cursorChar: "|",
34
- cursorSpeed: 1e3,
35
- deleteSpeed: null,
36
- html: !0,
37
- lifeLike: !0,
38
- loop: !1,
39
- loopDelay: 750,
40
- nextStringDelay: 750,
41
- speed: 100,
42
- startDelay: 250,
43
- startDelete: !1,
44
- strings: [],
45
- waitUntilVisible: !1,
46
- beforeString: () => {},
47
- afterString: () => {},
48
- beforeStep: () => {},
49
- afterStep: () => {},
50
- afterComplete: () => {}
51
- }, y = `[${h}]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}`, b = (e) => document.createElement(e), x = (e) => document.createTextNode(e), S = (e, t = "") => {
52
- let n = b("style");
53
- n.id = t, n.appendChild(x(e)), document.head.appendChild(n);
54
- }, C = (e) => (p(e) || (e = [e / 2, e / 2]), e), w = (e, t) => Math.abs(Math.random() * (e + t - (e - t)) + (e - t)), T = (e) => e / 2, E = (e) => Array.from(e), D = (e) => ([...e.childNodes].forEach((e) => {
55
- if (e.nodeValue) return [...e.nodeValue].forEach((t) => {
56
- e.parentNode.insertBefore(x(t), e);
57
- }), void e.remove();
58
- D(e);
59
- }), e), O = (e) => {
60
- let t = document.implementation.createHTMLDocument();
61
- return t.body.innerHTML = e, D(t.body);
62
- };
63
- function k(e, t = !1, n = !1) {
64
- let r, i = e.querySelector(`.${g}`), a = document.createTreeWalker(e, NodeFilter.SHOW_ALL, { acceptNode: (e) => {
65
- if (i && n) {
66
- if (e.classList?.contains(g)) return NodeFilter.FILTER_ACCEPT;
67
- if (i.contains(e)) return NodeFilter.FILTER_REJECT;
68
- }
69
- return e.classList?.contains(g) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
70
- } }), o = [];
71
- for (; r = a.nextNode();) r.originalParent ||= r.parentNode, o.push(r);
72
- return t ? o.reverse() : o;
73
- }
74
- function A(e, t = !0) {
75
- return t ? k(O(e)) : E(e).map(x);
76
- }
77
- var j = ({ index: e, newIndex: t, queueItems: n, cleanUp: r }) => {
78
- for (let i = e + 1; i < t + 1; i++) r(n[i][0]);
79
- }, M = (e) => Number.isInteger(e), N = ({ queueItems: e, selector: t, cursorPosition: n, to: r }) => {
80
- if (M(t)) return -1 * t;
81
- let i = (/* @__PURE__ */ RegExp("END", "i")).test(r), a = t ? [...e].reverse().findIndex(({ char: e }) => {
82
- let n = e.parentElement, r = n.matches(t);
83
- return !(!i || !r) || r && n.firstChild.isSameNode(e);
84
- }) : -1;
85
- return a < 0 && (a = i ? 0 : e.length - 1), a - n + +!i;
86
- }, P = (e, t) => Array(t).fill(e), F = (e) => new Promise((t) => {
87
- requestAnimationFrame(async () => {
88
- t(await e());
89
- });
90
- }), I = (e) => e?.getAnimations().find((t) => t.id === e.dataset.tiAnimationId), L = ({ cursor: e, frames: t, options: n }) => {
91
- let r = e.animate(t, n);
92
- return r.pause(), r.id = e.dataset.tiAnimationId, F(() => {
93
- F(() => {
94
- r.play();
95
- });
96
- }), r;
97
- }, R = (e) => e.func?.call(null), z = async ({ index: e, queueItems: t, wait: n, cursor: r, cursorOptions: i }) => {
98
- let a = t[e][1], o = [], s = e, c = a, l = () => c && !c.delay, u = a.shouldPauseCursor() && i.autoPause;
99
- for (; l();) o.push(c), l() && s++, c = t[s] ? t[s][1] : null;
100
- if (o.length) return await F(async () => {
101
- for (let e of o) await R(e);
102
- }), s - 1;
103
- let d, f = I(r);
104
- return f && (d = {
105
- ...f.effect.getComputedTiming(),
106
- delay: u ? i.autoPauseDelay : 0
107
- }), await n(async () => {
108
- f && u && f.cancel(), await F(() => {
109
- R(a);
110
- });
111
- }, a.delay), await (({ cursor: e, options: t, cursorOptions: n }) => {
112
- if (!e || !n) return;
113
- let r, i = I(e);
114
- i && (t.delay = i.effect.getComputedTiming().delay, r = i.currentTime, i.cancel());
115
- let a = L({
116
- cursor: e,
117
- frames: n.animation.frames,
118
- options: t
119
- });
120
- return r && (a.currentTime = r), a;
121
- })({
122
- cursor: r,
123
- options: d,
124
- cursorOptions: i
125
- }), e;
126
- }, B = (e) => "value" in e, V = (e) => typeof e == "function" ? e() : e, H = (e, t = document, n = !1) => t["querySelector" + (n ? "All" : "")](e), U = (e, t) => Object.assign({}, e, t), W = {
127
- "font-family": "",
128
- "font-weight": "",
129
- "font-size": "",
130
- "font-style": "",
131
- "line-height": "",
132
- color: "",
133
- transform: "translateX(-.125em)"
134
- }, G = class {
135
- element;
136
- timeouts;
137
- cursorPosition;
138
- predictedCursorPosition;
139
- statuses = {
140
- started: !1,
141
- completed: !1,
142
- frozen: !1,
143
- destroyed: !1,
144
- firing: !1
145
- };
146
- opts;
147
- id;
148
- queue;
149
- cursor;
150
- flushCallback = null;
151
- unfreeze = () => {};
152
- constructor(e, t = {}) {
153
- var n;
154
- this.opts = U(v, t), this.element = typeof (n = e) == "string" ? H(n) : n, this.timeouts = [], this.cursorPosition = 0, this.unfreeze = () => {}, this.predictedCursorPosition = null, this.statuses = U({}, _), this.id = Math.random().toString().substring(2, 9), this.queue = function(e) {
155
- let t = function(e) {
156
- return m(e).forEach((e) => a.set(Symbol(e.char?.innerText), n({ ...e }))), this;
157
- }, n = (e) => (e.shouldPauseCursor = function() {
158
- return !!(this.typeable || this.cursorable || this.deletable);
159
- }, e), r = () => a, i = () => Array.from(a.values()), a = /* @__PURE__ */ new Map();
160
- return t(e), {
161
- add: t,
162
- set: function(e, t) {
163
- let r = [...a.keys()];
164
- a.set(r[e], n(t));
165
- },
166
- wipe: function() {
167
- a = /* @__PURE__ */ new Map(), t(e);
168
- },
169
- done: (e, t = !1) => t ? a.delete(e) : a.get(e).done = !0,
170
- reset: function() {
171
- a.forEach((e) => delete e.done);
172
- },
173
- destroy: (e) => a.delete(e),
174
- getItems: (e = !1) => e ? i() : i().filter((e) => !e.done),
175
- getQueue: r,
176
- getTypeable: () => i().filter((e) => e.typeable),
177
- getPendingQueueItems: () => {
178
- let e = [];
179
- for (let [, t] of r()) t.done || e.push(t);
180
- return e;
181
- }
182
- };
183
- }([{ delay: this.opts.startDelay }]), this.#p(t), this.cursor = this.#h(), this.element.dataset.typeitId = this.id, S(y), this.opts.strings.length && this.#f();
184
- }
185
- go() {
186
- return this.statuses.started ? this : (this.#o(), this.opts.waitUntilVisible ? (e = this.element, t = this.#t.bind(this), new IntersectionObserver((n, r) => {
187
- n.forEach((n) => {
188
- n.isIntersecting && (t(), r.unobserve(e));
189
- });
190
- }, { threshold: 1 }).observe(e), this) : (this.#t(), this));
191
- var e, t;
192
- }
193
- destroy(e = !0) {
194
- this.timeouts = (this.timeouts.forEach(clearTimeout), []), V(e) && this.cursor && this.#y(this.cursor), this.statuses.destroyed = !0;
195
- }
196
- reset(e) {
197
- !this.is("destroyed") && this.destroy(), e ? (this.queue.wipe(), e(this)) : this.queue.reset(), this.cursorPosition = 0;
198
- for (let e in this.statuses) this.statuses[e] = !1;
199
- return this.element[this.#s() ? "value" : "innerHTML"] = "", this;
200
- }
201
- is = function(e) {
202
- return this.statuses[e];
203
- };
204
- type(e, t = {}) {
205
- e = V(e);
206
- let { instant: n } = t, r = this.#u(t), i = A(e, this.opts.html).map((e) => {
207
- return {
208
- func: () => this.#_(e),
209
- char: e,
210
- delay: n || (t = e, /<(.+)>(.*?)<\/(.+)>/.test(t.outerHTML)) ? 0 : this.#b(),
211
- typeable: e.nodeType === Node.TEXT_NODE
212
- };
213
- var t;
214
- }), a = [
215
- r[0],
216
- { func: async () => await this.opts.beforeString(e, this) },
217
- ...i,
218
- { func: async () => await this.opts.afterString(e, this) },
219
- r[1]
220
- ];
221
- return this.#c(a, t);
222
- }
223
- break(e = {}) {
224
- return this.#c({
225
- func: () => this.#_(b("BR")),
226
- typeable: !0
227
- }, e);
228
- }
229
- move(e, t = {}) {
230
- e = V(e);
231
- let n = this.#u(t), { instant: r, to: i } = t, a = N({
232
- queueItems: this.queue.getTypeable(),
233
- selector: e === null ? "" : e,
234
- to: i,
235
- cursorPosition: this.#x
236
- }), o = a < 0 ? -1 : 1;
237
- return this.predictedCursorPosition = this.#x + a, this.#c([
238
- n[0],
239
- ...P({
240
- func: () => this.#n(o),
241
- delay: r ? 0 : this.#b(),
242
- cursorable: !0
243
- }, Math.abs(a)),
244
- n[1]
245
- ], t);
246
- }
247
- exec(e, t = {}) {
248
- let n = this.#u(t);
249
- return this.#c([
250
- n[0],
251
- { func: () => e(this) },
252
- n[1]
253
- ], t);
254
- }
255
- options(e, t = {}) {
256
- return e = V(e), this.#d(e), this.#c({}, t);
257
- }
258
- pause(e, t = {}) {
259
- return this.#c({ delay: V(e) }, t);
260
- }
261
- delete(e = null, t = {}) {
262
- e = V(e);
263
- let n = this.#u(t), r = e, { instant: i, to: a } = t, o = this.queue.getTypeable(), s = r === null ? o.length : M(r) ? r : N({
264
- queueItems: o,
265
- selector: r,
266
- cursorPosition: this.#x,
267
- to: a
268
- });
269
- return this.#c([
270
- n[0],
271
- ...P({
272
- func: this.#v.bind(this),
273
- delay: i ? 0 : this.#b(1),
274
- deletable: !0
275
- }, s),
276
- n[1]
277
- ], t);
278
- }
279
- freeze() {
280
- this.statuses.frozen = !0;
281
- }
282
- flush(e = null) {
283
- return this.flushCallback = e || this.flushCallback, this.statuses.firing || (this.#o(), this.#t(!1).then(() => {
284
- if (this.queue.getPendingQueueItems().length > 0) return this.flush();
285
- this.flushCallback(), this.flushCallback = null;
286
- })), this;
287
- }
288
- getQueue() {
289
- return this.queue;
290
- }
291
- getOptions() {
292
- return this.opts;
293
- }
294
- updateOptions(e) {
295
- return this.#d(e);
296
- }
297
- getElement() {
298
- return this.element;
299
- }
300
- empty(e = {}) {
301
- return this.#c({ func: this.#e.bind(this) }, e);
302
- }
303
- async #e() {
304
- this.#s() ? this.element.value = "" : this.#w.forEach(this.#y.bind(this));
305
- }
306
- async #t(e = !0) {
307
- this.statuses.started = !0, this.statuses.firing = !0;
308
- let t = (t) => {
309
- this.queue.done(t, !e);
310
- };
311
- try {
312
- let n = [...this.queue.getQueue()];
313
- for (let e = 0; e < n.length; e++) {
314
- let [r, i] = n[e];
315
- if (!i.done) {
316
- if (!i.deletable || i.deletable && this.#w.length) {
317
- let r = await this.#i(e, n);
318
- j({
319
- index: e,
320
- newIndex: r,
321
- queueItems: n,
322
- cleanUp: t
323
- }), e = r;
324
- }
325
- t(r);
326
- }
327
- }
328
- if (!e) return this.statuses.firing = !1, this;
329
- if (this.statuses.completed = !0, this.statuses.firing = !1, await this.opts.afterComplete(this), !this.opts.loop) throw "";
330
- let r = this.opts.loopDelay;
331
- this.#a(async () => {
332
- await this.#r(r[0]), this.#t();
333
- }, r[1]);
334
- } catch {}
335
- return this.statuses.firing = !1, this;
336
- }
337
- async #n(e) {
338
- var t, n, r;
339
- this.cursorPosition = (t = e, n = this.cursorPosition, r = this.#w, Math.min(Math.max(n + t, 0), r.length)), ((e, t, n) => {
340
- let r = t[n - 1], i = H(`.${g}`, e);
341
- (e = r?.parentNode || e).insertBefore(i, r || null);
342
- })(this.element, this.#w, this.cursorPosition);
343
- }
344
- async #r(e) {
345
- let t = this.#x;
346
- t && await this.#n({ value: t });
347
- let n = this.#w.map((e) => [Symbol(), {
348
- func: this.#v.bind(this),
349
- delay: this.#b(1),
350
- deletable: !0,
351
- shouldPauseCursor: () => !0
352
- }]);
353
- for (let e = 0; e < n.length; e++) await this.#i(e, n);
354
- this.queue.reset(), this.queue.set(0, { delay: e });
355
- }
356
- #i(e, t) {
357
- return z({
358
- index: e,
359
- queueItems: t,
360
- wait: this.#a.bind(this),
361
- cursor: this.cursor,
362
- cursorOptions: this.opts.cursor
363
- });
364
- }
365
- async #a(e, t, n = !1) {
366
- this.statuses.frozen && await new Promise((e) => {
367
- this.unfreeze = () => {
368
- this.statuses.frozen = !1, e();
369
- };
370
- }), n || await this.opts.beforeStep(this), await ((e, t, n) => new Promise((r) => {
371
- n.push(setTimeout(async () => {
372
- await e(), r();
373
- }, t || 0));
374
- }))(e, t, this.timeouts), n || await this.opts.afterStep(this);
375
- }
376
- async #o() {
377
- if (!this.#s() && this.cursor && this.element.appendChild(this.cursor), this.#C) {
378
- ((e, t) => {
379
- let n = `[${h}='${e}'] .${g}`, r = getComputedStyle(t);
380
- S(`${n} { display: inline-block; width: 0; ${Object.entries(W).reduce((e, [t, n]) => `${e} ${t}: var(--ti-cursor-${t}, ${n || r[t]});`, "")} }`, e);
381
- })(this.id, this.element), this.cursor.dataset.tiAnimationId = this.id;
382
- let { animation: e } = this.opts.cursor, { frames: t, options: n } = e;
383
- L({
384
- frames: t,
385
- cursor: this.cursor,
386
- options: {
387
- duration: this.opts.cursorSpeed,
388
- ...n
389
- }
390
- });
391
- }
392
- }
393
- #s() {
394
- return B(this.element);
395
- }
396
- #c(e, t) {
397
- return this.queue.add(e), this.#l(t), this;
398
- }
399
- #l(e = {}) {
400
- let t = e.delay;
401
- t && this.queue.add({ delay: t });
402
- }
403
- #u(e = {}) {
404
- return [{ func: () => this.#d(e) }, { func: () => this.#d(this.opts) }];
405
- }
406
- async #d(e) {
407
- this.opts = U(this.opts, e);
408
- }
409
- #f() {
410
- let e = this.opts.strings.filter((e) => !!e);
411
- e.forEach((t, n) => {
412
- if (this.type(t), n + 1 === e.length) return;
413
- let r = this.opts.breakLines ? [{
414
- func: () => this.#_(b("BR")),
415
- typeable: !0
416
- }] : P({
417
- func: this.#v.bind(this),
418
- delay: this.#b(1)
419
- }, this.queue.getTypeable().length);
420
- this.#g(r);
421
- });
422
- }
423
- #p = (e) => {
424
- this.opts.cursor = ((e) => {
425
- if (typeof e == "object") {
426
- let t = {}, { frames: n, options: r } = v.cursor.animation;
427
- return t.animation = e.animation || {}, t.animation.frames = e.animation?.frames || n, t.animation.options = U(r, e.animation?.options || {}), t.autoPause = e.autoPause ?? v.cursor.autoPause, t.autoPauseDelay = e.autoPauseDelay || v.cursor.autoPauseDelay, t;
428
- }
429
- return !0 === e ? v.cursor : e;
430
- })(e.cursor ?? v.cursor), this.opts.strings = this.#m(m(this.opts.strings)), this.opts = U(this.opts, {
431
- html: !this.#S && this.opts.html,
432
- nextStringDelay: C(this.opts.nextStringDelay),
433
- loopDelay: C(this.opts.loopDelay)
434
- });
435
- };
436
- #m(e) {
437
- let t = this.element.innerHTML;
438
- return t ? (this.element.innerHTML = "", this.opts.startDelete ? (this.element.innerHTML = t, D(this.element), this.#g(P({
439
- func: this.#v.bind(this),
440
- delay: this.#b(1),
441
- deletable: !0
442
- }, this.#w.length)), e) : (n = t, n.replace(/<!--(.+?)-->/g, "").trim().split(/<br(?:\s*?)(?:\/)?>/)).concat(e)) : e;
443
- var n;
444
- }
445
- #h() {
446
- if (this.#S) return null;
447
- let e = b("span");
448
- return e.className = g, this.#C ? (e.innerHTML = O(this.opts.cursorChar).innerHTML, e) : (e.style.visibility = "hidden", e);
449
- }
450
- #g(e) {
451
- let t = this.opts.nextStringDelay;
452
- this.queue.add([
453
- { delay: t[0] },
454
- ...e,
455
- { delay: t[1] }
456
- ]);
457
- }
458
- #_(e) {
459
- ((e, t) => {
460
- if (B(e)) return void (e.value = `${e.value}${t.textContent}`);
461
- t.innerHTML = "";
462
- let n = (r = t.originalParent, /body/i.test(r?.tagName) ? e : t.originalParent || e);
463
- var r;
464
- let i = H("." + g, n) || null;
465
- i && i.parentElement !== n && (n = i.parentElement), n.insertBefore(t, i);
466
- })(this.element, e);
467
- }
468
- #v() {
469
- this.#w.length && (this.#S ? this.element.value = this.element.value.slice(0, -1) : this.#y(this.#w[this.cursorPosition]));
470
- }
471
- #y(e) {
472
- ((e, t) => {
473
- if (!e) return;
474
- let n = e.parentNode;
475
- (n.childNodes.length > 1 || n.isSameNode(t) ? e : n).remove();
476
- })(e, this.element);
477
- }
478
- #b(e = 0) {
479
- return function(e) {
480
- let { speed: t, deleteSpeed: n, lifeLike: r } = e;
481
- return n = n === null ? t / 3 : n, r ? [w(t, T(t)), w(n, T(n))] : [t, n];
482
- }(this.opts)[e];
483
- }
484
- get #x() {
485
- return this.predictedCursorPosition ?? this.cursorPosition;
486
- }
487
- get #S() {
488
- return B(this.element);
489
- }
490
- get #C() {
491
- return !!this.opts.cursor && !this.#S;
492
- }
493
- get #w() {
494
- return e = this.element, B(e) ? E(e.value) : k(e, !0).filter((e) => !(e.childNodes.length > 0));
495
- var e;
496
- }
497
- }, K = class extends n(d`
498
- :host {
499
- display: inline-block;
500
- }
501
-
502
- #typewriter {
503
- position: relative;
504
- }
505
-
506
- /* Enhanced cursor with glow effect */
507
- #typewriter :global(.ti-cursor) {
508
- animation: cursor-pulse 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
509
- color: currentColor;
510
- filter: drop-shadow(0 0 8px currentColor);
511
- }
512
-
513
- @keyframes cursor-pulse {
514
- 0%, 100% {
515
- opacity: 1;
516
- transform: scale(1);
517
- }
518
- 50% {
519
- opacity: 0.3;
520
- transform: scale(0.95);
521
- }
522
- }
523
-
524
- /* Character entrance animation */
525
- #typewriter :global(.ti-container *) {
526
- animation: char-entrance 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
527
- }
528
-
529
- @keyframes char-entrance {
530
- 0% {
531
- opacity: 0;
532
- transform: scale(0.3) translateY(10px);
533
- filter: blur(4px);
534
- }
535
- 50% {
536
- opacity: 0.8;
537
- transform: scale(1.1) translateY(-2px);
538
- }
539
- 100% {
540
- opacity: 1;
541
- transform: scale(1) translateY(0);
542
- filter: blur(0);
543
- }
544
- }
545
-
546
- /* Subtle character wobble on appear */
547
- #typewriter :global(.ti-container *:nth-child(odd)) {
548
- animation: char-entrance 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) backwards,
549
- char-wobble 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s backwards;
550
- }
551
-
552
- @keyframes char-wobble {
553
- 0%, 100% {
554
- transform: rotate(0deg);
555
- }
556
- 25% {
557
- transform: rotate(2deg);
558
- }
559
- 75% {
560
- transform: rotate(-2deg);
561
- }
562
- }
563
-
564
- /* Deletion animation - fade out and scale down */
565
- #typewriter :global(.ti-container .deleting) {
566
- animation: char-delete 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
567
- }
568
-
569
- @keyframes char-delete {
570
- 0% {
571
- opacity: 1;
572
- transform: scale(1);
573
- filter: blur(0);
574
- }
575
- 50% {
576
- opacity: 0.5;
577
- transform: scale(0.8) translateY(-3px);
578
- }
579
- 100% {
580
- opacity: 0;
581
- transform: scale(0.4) translateY(-8px);
582
- filter: blur(3px);
583
- }
584
- }
585
-
586
- /* Gradient text effect on typed text */
587
- #typewriter :global(.ti-container) {
588
- background: linear-gradient(
589
- 90deg,
590
- currentColor 0%,
591
- currentColor 70%,
592
- transparent 100%
593
- );
594
- -webkit-background-clip: text;
595
- background-clip: text;
596
- animation: gradient-shift 3s ease-in-out infinite;
597
- }
598
-
599
- @keyframes gradient-shift {
600
- 0%, 100% {
601
- filter: brightness(1) saturate(1);
602
- }
603
- 50% {
604
- filter: brightness(1.15) saturate(1.2);
605
- }
606
- }
607
-
608
- /* Smooth transitions for all text */
609
- #typewriter * {
610
- transition: opacity 0.15s ease-out, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
611
- }
612
- `) {
613
- constructor(...e) {
614
- super(...e), this.speed = 35, this.delay = 0, this.autoStart = !0, this.cursorChar = "", this.deleteSpeed = 20, this.once = !0, this.loop = !1, this.cyclePause = 1500, this.typeItInstance = null, this.sessionKey = "";
615
- }
616
- disconnectedCallback() {
617
- super.disconnectedCallback(), this._destroyTypeIt();
618
- }
619
- _startTyping() {
620
- if (this._destroyTypeIt(), this.sessionKey = this.generateSessionKey(), this.once && sessionStorage.getItem(this.sessionKey) === "true") return void this.shadowRoot?.querySelector("slot")?.removeAttribute("hidden");
621
- if (!this.typewriterContainer) return;
622
- let e = {
623
- speed: this.speed,
624
- startDelay: this.delay,
625
- cursor: !!this.cursorChar,
626
- cursorChar: this.cursorChar,
627
- deleteSpeed: this.deleteSpeed,
628
- loop: this.loop,
629
- afterComplete: () => {
630
- if (this.once && !this.loop) try {
631
- sessionStorage.setItem(this.sessionKey, "true");
632
- } catch {}
633
- this.dispatchEvent(new CustomEvent("typeit-complete", {
634
- bubbles: !0,
635
- composed: !0
636
- })), this.loop || this.typewriterContainer.style.setProperty("--ti-cursor-display", "none");
637
- }
638
- };
639
- this.typeItInstance = new G(this.typewriterContainer, e), this._getSlottedNodes.forEach((e) => {
640
- if (e.nodeType === Node.TEXT_NODE) {
641
- let t = e.textContent || "";
642
- t.trim() && this.typeItInstance?.type(t);
643
- } else e instanceof HTMLElement && this._processCustomElement(e);
644
- }), a(this.shadowRoot?.host).subscribe(() => {
645
- this.typeItInstance?.go();
646
- });
647
- }
648
- generateSessionKey() {
649
- let e = this._getSlottedElements.map((e) => e.outerHTML).join("");
650
- return this.once ? i(e) : "";
651
- }
652
- _destroyTypeIt() {
653
- if (this.typeItInstance) {
654
- try {
655
- this.typeItInstance.destroy();
656
- } catch {}
657
- this.typeItInstance = null;
658
- }
659
- }
660
- _processCustomElement(e) {
661
- let t = e.getAttribute("action"), n = e.getAttribute("value"), r = e.getAttribute("cycle");
662
- if (r) {
663
- let t = r.split("|").map((e) => e.trim());
664
- this._processCycle(t, e);
665
- return;
666
- }
667
- switch (t) {
668
- case "pause":
669
- this.typeItInstance?.pause(parseInt(n || "0", 10));
670
- break;
671
- case "delete":
672
- this.typeItInstance?.delete(parseInt(n || "0", 10));
673
- break;
674
- default: e.tagName === "P" && this.typeItInstance?.break(), this.typeItInstance?.type(e.textContent || "");
675
- }
676
- }
677
- _processCycle(e, t) {
678
- if (e.length === 0) return;
679
- let n = t.getAttribute("pause"), r = n ? parseInt(n, 10) : this.cyclePause;
680
- e.forEach((t, n) => {
681
- this.typeItInstance?.type(t), (n < e.length - 1 || this.loop) && this.typeItInstance?.pause(r), (n < e.length - 1 || this.loop) && this.typeItInstance?.delete(t.length);
682
- });
683
- }
684
- render() {
685
- return f`<div id="typewriter" aria-live="polite"></div>
686
-
687
- <div class="typewriter">
688
- <slot
689
- hidden
690
- @slotchange=${() => {
691
- this._startTyping();
692
- }}
693
- ></slot>
694
- </div> `;
695
- }
696
- };
697
- t([s({ type: Number })], K.prototype, "speed", void 0), t([e({
698
- context: r,
699
- subscribe: !0
700
- }), s({ type: Number })], K.prototype, "delay", void 0), t([s({ type: Boolean })], K.prototype, "autoStart", void 0), t([s({ type: String })], K.prototype, "cursorChar", void 0), t([s({ type: Number })], K.prototype, "deleteSpeed", void 0), t([s({ type: Boolean })], K.prototype, "once", void 0), t([s({ type: Boolean })], K.prototype, "loop", void 0), t([s({ type: Number })], K.prototype, "cyclePause", void 0), t([c("#typewriter")], K.prototype, "typewriterContainer", void 0), t([u({ flatten: !0 })], K.prototype, "_getSlottedNodes", void 0), t([l({ flatten: !0 })], K.prototype, "_getSlottedElements", void 0), K = t([o("schmancy-typewriter")], K);
701
- export { K as t };