@steppy/player 0.5.0 → 0.6.0

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 CHANGED
@@ -189,3 +189,7 @@ inner layout uses logical properties only — `test/tour/small-modules.test.ts`
189
189
  rejects a physical `margin-left/right`. A running tour reloads when the host's
190
190
  `locale` (else `<html lang>`) changes; see `_swapLocale` in `host.ts`. Unlike the
191
191
  guide player, the overlay exposes `part=` attributes for `::part()` styling.
192
+ Its `--steppy-tour-*` tokens are one table, `TOUR_THEME_KEYS` in `theme.ts`: the
193
+ stylesheet, the host's `theme` property and the docs all follow it, and
194
+ `appearance="light"`/`"auto"` swap the defaults (`TOUR_LIGHT` in `ui/tokens.ts`,
195
+ AA-checked like the dark ones). Add a token there, never as a literal in `styles.ts`.
@@ -4428,12 +4428,23 @@ function ni(t) {
4428
4428
  ${t.ui.restart}
4429
4429
  </button>`;
4430
4430
  }
4431
+ function ai(t) {
4432
+ let e;
4433
+ try {
4434
+ e = new Intl.DisplayNames([t], { type: "language" }).of(t);
4435
+ } catch {
4436
+ return t;
4437
+ }
4438
+ return !e || e === t ? t : e.charAt(0).toLocaleUpperCase(t) + e.slice(1);
4439
+ }
4431
4440
  function $t(t) {
4432
4441
  return t.locales.length <= 1 ? b : _`<label class="steppy-field">
4433
4442
  ${t.ui.localeSwitcher}
4434
4443
  <select @change=${t.onLocaleChange} .value=${t.activeLocale}>
4435
4444
  ${t.locales.map(
4436
- (e) => _`<option value=${e} ?selected=${e === t.activeLocale}>${e}</option>`
4445
+ (e) => _`<option value=${e} lang=${e} ?selected=${e === t.activeLocale}>
4446
+ ${ai(e)}
4447
+ </option>`
4437
4448
  )}
4438
4449
  </select>
4439
4450
  </label>`;
@@ -4463,7 +4474,7 @@ function kt(t) {
4463
4474
  })}
4464
4475
  </div>`;
4465
4476
  }
4466
- function ai(t) {
4477
+ function oi(t) {
4467
4478
  const e = t.steps.find((s) => s.status === "current") ?? t.steps[t.currentIndex - 1];
4468
4479
  return _`
4469
4480
  <div class="steppy-tpl-inline">
@@ -4481,7 +4492,7 @@ function ai(t) {
4481
4492
  </div>
4482
4493
  `;
4483
4494
  }
4484
- const oi = We`
4495
+ const li = We`
4485
4496
  .steppy-tpl-inline {
4486
4497
  display: flex;
4487
4498
  flex-direction: column;
@@ -4519,12 +4530,12 @@ const oi = We`
4519
4530
  margin-left: auto;
4520
4531
  flex-wrap: wrap;
4521
4532
  }
4522
- `, li = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4533
+ `, ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4523
4534
  __proto__: null,
4524
- render: ai,
4525
- styles: oi
4535
+ render: oi,
4536
+ styles: li
4526
4537
  }, Symbol.toStringTag, { value: "Module" }));
4527
- function ci(t) {
4538
+ function di(t) {
4528
4539
  return _`
4529
4540
  <div class="steppy-wrapper steppy-tpl-overlay">
4530
4541
  ${t.renderStage()}
@@ -4536,16 +4547,16 @@ function ci(t) {
4536
4547
  </div>
4537
4548
  `;
4538
4549
  }
4539
- const di = We`
4550
+ const ui = We`
4540
4551
  .steppy-tpl-overlay .steppy-seg {
4541
4552
  margin-left: auto;
4542
4553
  }
4543
- `, ui = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4554
+ `, pi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4544
4555
  __proto__: null,
4545
- render: ci,
4546
- styles: di
4556
+ render: di,
4557
+ styles: ui
4547
4558
  }, Symbol.toStringTag, { value: "Module" }));
4548
- function pi(t, e) {
4559
+ function hi(t, e) {
4549
4560
  const s = e.status === "completed" ? _`${t.ui.stepPassed} <span aria-hidden="true">✓</span>` : e.subLabel || b;
4550
4561
  return _`
4551
4562
  <li
@@ -4567,7 +4578,7 @@ function pi(t, e) {
4567
4578
  </li>
4568
4579
  `;
4569
4580
  }
4570
- function hi(t) {
4581
+ function fi(t) {
4571
4582
  return _`
4572
4583
  <div class="steppy-tpl-sidebar">
4573
4584
  <div class="steppy-sidebar-layout">
@@ -4586,7 +4597,7 @@ function hi(t) {
4586
4597
  </div>
4587
4598
  </div>
4588
4599
  <ol class="steppy-timeline">
4589
- ${t.steps.map((e) => pi(t, e))}
4600
+ ${t.steps.map((e) => hi(t, e))}
4590
4601
  </ol>
4591
4602
  <div class="steppy-rail-foot">
4592
4603
  ${xt(t)} ${bt(t)} ${hs(t)}
@@ -4598,7 +4609,7 @@ function hi(t) {
4598
4609
  </div>
4599
4610
  `;
4600
4611
  }
4601
- const fi = We`
4612
+ const mi = We`
4602
4613
  .steppy-tpl-sidebar {
4603
4614
  container-type: inline-size;
4604
4615
  }
@@ -4810,30 +4821,30 @@ const fi = We`
4810
4821
  align-self: start;
4811
4822
  }
4812
4823
  }
4813
- `, mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4824
+ `, yi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4814
4825
  __proto__: null,
4815
- render: hi,
4816
- styles: fi
4826
+ render: fi,
4827
+ styles: mi
4817
4828
  }, Symbol.toStringTag, { value: "Module" })), Be = {
4818
- overlay: ui,
4819
- sidebar: mi,
4820
- inline: li
4821
- }, yi = ["sidebar", "overlay", "inline"], gi = new Set(Object.keys(Be));
4829
+ overlay: pi,
4830
+ sidebar: yi,
4831
+ inline: ci
4832
+ }, gi = ["sidebar", "overlay", "inline"], vi = new Set(Object.keys(Be));
4822
4833
  function Oe(t) {
4823
- return typeof t == "string" && gi.has(t);
4834
+ return typeof t == "string" && vi.has(t);
4824
4835
  }
4825
- const vi = [si, ...Object.values(Be).map((t) => t.styles)];
4826
- var _i = Object.defineProperty, xi = Object.getOwnPropertyDescriptor, k = (t, e, s, r) => {
4827
- for (var i = r > 1 ? void 0 : r ? xi(e, s) : e, n = t.length - 1, a; n >= 0; n--)
4836
+ const _i = [si, ...Object.values(Be).map((t) => t.styles)];
4837
+ var xi = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, k = (t, e, s, r) => {
4838
+ for (var i = r > 1 ? void 0 : r ? bi(e, s) : e, n = t.length - 1, a; n >= 0; n--)
4828
4839
  (a = t[n]) && (i = (r ? a(e, s, i) : a(i)) || i);
4829
- return r && i && _i(e, s, i), i;
4840
+ return r && i && xi(e, s, i), i;
4830
4841
  };
4831
4842
  function Qt(t) {
4832
4843
  return { cursor: t.cursor, viewport: t.captureSize };
4833
4844
  }
4834
- const bi = ["arrow", "hotspot", "off"];
4845
+ const $i = ["arrow", "hotspot", "off"];
4835
4846
  function es(t) {
4836
- return typeof t == "string" && bi.includes(t);
4847
+ return typeof t == "string" && $i.includes(t);
4837
4848
  }
4838
4849
  let w = class extends ve {
4839
4850
  constructor() {
@@ -5269,7 +5280,7 @@ let w = class extends ve {
5269
5280
  nextDisabled: this.completed,
5270
5281
  locales: e.locales,
5271
5282
  layouts: r,
5272
- templates: yi,
5283
+ templates: gi,
5273
5284
  activeTemplate: this._activeTemplate,
5274
5285
  activeLocale: this.locale ?? "",
5275
5286
  activeLayout: this.variant,
@@ -5331,7 +5342,7 @@ let w = class extends ve {
5331
5342
  }
5332
5343
  };
5333
5344
  w.createAnimator = (t) => new X(t);
5334
- w.styles = vi;
5345
+ w.styles = _i;
5335
5346
  w.TEMPLATE_STORAGE_KEY = "steppy:active-template";
5336
5347
  k([
5337
5348
  z({ type: String, reflect: !0 })