@breadstone/mosaik-elements-svelte 0.1.64 → 0.1.65

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 (3) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/index.mjs +137 -37
  3. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.1.65 (2026-07-29)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **tour:** add more tour functionality ([a2da8233ed](https://github.com/RueDeRennes/mosaik/commit/a2da8233ed))
6
+
1
7
  ## 0.1.64 (2026-07-29)
2
8
 
3
9
  ### 🚀 Features
package/index.mjs CHANGED
@@ -173802,7 +173802,7 @@ function k_e(e) {
173802
173802
  .isFirstStep="${e.isFirstStep}"
173803
173803
  .isLastStep="${e.isLastStep}"
173804
173804
  .stepIndex="${e.currentStepIndex}"
173805
- .stepCount="${e.steps.length}"
173805
+ .stepCount="${e.stepCount}"
173806
173806
  .showProgress="${e.showProgress}"
173807
173807
  .showAutoAdvanceControl="${e.showAutoAdvanceControls && ((e.currentStep?.duration ?? 0) > 0 || e.isAutoAdvancePaused)}"
173808
173808
  .isAutoAdvancePaused="${e.isAutoAdvancePaused}"
@@ -174807,6 +174807,8 @@ var F4 = function(e, t, n, r) {
174807
174807
  _stepActions;
174808
174808
  _instanceId;
174809
174809
  _steps;
174810
+ _context;
174811
+ _currentStep;
174810
174812
  _currentStepIndex;
174811
174813
  _tourId;
174812
174814
  _labels;
@@ -174828,9 +174830,10 @@ var F4 = function(e, t, n, r) {
174828
174830
  _transitionSequence;
174829
174831
  _transitionOriginStepIndex;
174830
174832
  _queuedTourAction;
174833
+ _isContextRefreshQueued;
174831
174834
  _resolutionFailureReason;
174832
174835
  constructor() {
174833
- super(), this._steps = [], this._inlineStyleController = new ux(this), this._currentStepIndex = -1, this._tourId = "default", this._labels = {}, this._showProgress = !0, this._showAutoAdvanceControls = !1, this._restoreFocus = !0, this._stepActivator = null, this._tooltipStyles = this.createHiddenTooltipStyles(), this._spotlightStyles = this.createHiddenSpotlightStyles(), this._backdropStyles = [], this._positionFrameId = null, this._anchorResizeObserver = null, this._previousFocusedElement = null, this._pendingEndReason = "programmatic", this._isRunning = !1, this._isTransitioning = !1, this._isAutoAdvancePausedByUser = !1, this._spotlightTransitionsEnabled = !1, this._transitionSequence = 0, this._transitionOriginStepIndex = null, this._queuedTourAction = null, this._resolutionFailureReason = null, this._instanceId = ++L4._instanceCount, this._tourStarted = new b(this, "tourStarted"), this._tourEnded = new b(this, "tourEnded"), this._tourStepChanged = new b(this, "tourStepChanged"), this._tourFailed = new b(this, "tourFailed"), this._boundHandleViewportChange = () => this.schedulePositionUpdate(), this._boundHandleDocumentVisibilityChange = () => this.handleDocumentVisibilityChange(), this._boundHandleTourKeyDown = (e) => this.handleTourKeyDown(e), this._boundHandleAnchorInteraction = (e) => this.handleAnchorInteraction(e), this._executedStepActions = /* @__PURE__ */ new Set(), this._stepActions = {
174836
+ super(), this._steps = [], this._context = void 0, this._currentStep = null, this._inlineStyleController = new ux(this), this._currentStepIndex = -1, this._tourId = "default", this._labels = {}, this._showProgress = !0, this._showAutoAdvanceControls = !1, this._restoreFocus = !0, this._stepActivator = null, this._tooltipStyles = this.createHiddenTooltipStyles(), this._spotlightStyles = this.createHiddenSpotlightStyles(), this._backdropStyles = [], this._positionFrameId = null, this._anchorResizeObserver = null, this._previousFocusedElement = null, this._pendingEndReason = "programmatic", this._isRunning = !1, this._isTransitioning = !1, this._isAutoAdvancePausedByUser = !1, this._spotlightTransitionsEnabled = !1, this._transitionSequence = 0, this._transitionOriginStepIndex = null, this._queuedTourAction = null, this._isContextRefreshQueued = !1, this._resolutionFailureReason = null, this._instanceId = ++L4._instanceCount, this._tourStarted = new b(this, "tourStarted"), this._tourEnded = new b(this, "tourEnded"), this._tourStepChanged = new b(this, "tourStepChanged"), this._tourFailed = new b(this, "tourFailed"), this._boundHandleViewportChange = () => this.schedulePositionUpdate(), this._boundHandleDocumentVisibilityChange = () => this.handleDocumentVisibilityChange(), this._boundHandleTourKeyDown = (e) => this.handleTourKeyDown(e), this._boundHandleAnchorInteraction = (e) => this.handleAnchorInteraction(e), this._executedStepActions = /* @__PURE__ */ new Set(), this._stepActions = {
174834
174837
  previous: () => void this.previous(),
174835
174838
  next: () => void this.next(),
174836
174839
  finish: () => void this.finish(),
@@ -174860,7 +174863,13 @@ var F4 = function(e, t, n, r) {
174860
174863
  return this._steps;
174861
174864
  }
174862
174865
  set steps(e) {
174863
- this._steps !== e && (this._steps = e ? [...e] : [], this._isRunning || (this._currentStepIndex = -1), this.requestUpdate("steps"), this.schedulePositionUpdate());
174866
+ this._steps !== e && (this._steps = e ? [...e] : [], this._isRunning || (this._currentStepIndex = -1, this._currentStep = null), this.requestUpdate("steps"), this.schedulePositionUpdate());
174867
+ }
174868
+ get context() {
174869
+ return this._context;
174870
+ }
174871
+ set context(e) {
174872
+ Object.is(this._context, e) || (this._context = e, this.requestUpdate("context"));
174864
174873
  }
174865
174874
  get labels() {
174866
174875
  return this._labels;
@@ -174893,16 +174902,19 @@ var F4 = function(e, t, n, r) {
174893
174902
  this._stepActivator !== e && (this._stepActivator = e, this.requestUpdate("stepActivator"));
174894
174903
  }
174895
174904
  get currentStep() {
174896
- return this._steps[this._currentStepIndex] ?? null;
174905
+ return this._currentStep;
174897
174906
  }
174898
174907
  get currentStepIndex() {
174899
- return this._currentStepIndex;
174908
+ return this._currentStepIndex < 0 ? -1 : this._steps.slice(0, this._currentStepIndex).filter((e) => this.isPotentiallyAvailable(e)).length;
174909
+ }
174910
+ get stepCount() {
174911
+ return this._steps.filter((e) => this.isPotentiallyAvailable(e)).length;
174900
174912
  }
174901
174913
  get isFirstStep() {
174902
- return this._currentStepIndex <= 0 || !this._steps.slice(0, this._currentStepIndex).some((e) => this.isPotentiallyAvailable(e));
174914
+ return this.currentStepIndex <= 0;
174903
174915
  }
174904
174916
  get isLastStep() {
174905
- return this._currentStepIndex >= this._steps.length - 1 || !this._steps.slice(this._currentStepIndex + 1).some((e) => this.isPotentiallyAvailable(e));
174917
+ return this.currentStepIndex >= this.stepCount - 1;
174906
174918
  }
174907
174919
  get isVisible() {
174908
174920
  return this.isOpen && this.currentStep !== null;
@@ -174953,11 +174965,13 @@ var F4 = function(e, t, n, r) {
174953
174965
  if (this._isRunning || this._isTransitioning || !this.validateConfiguration()) return !1;
174954
174966
  let t = e === void 0 ? 0 : this._steps.findIndex((t) => t.id === e);
174955
174967
  if (t < 0) return this.fail("invalid-step", `Tour step "${e}" does not exist.`, null);
174956
- this._isAutoAdvancePausedByUser = !1, this._executedStepActions.clear(), this._transitionOriginStepIndex = -1, this._queuedTourAction = null, this.requestUpdate(), this._isTransitioning = !0;
174968
+ this._isAutoAdvancePausedByUser = !1, this._executedStepActions.clear(), this._transitionOriginStepIndex = -1, this._queuedTourAction = null, this._isContextRefreshQueued = !1, this.requestUpdate(), this._isTransitioning = !0;
174957
174969
  let n = ++this._transitionSequence;
174958
174970
  try {
174959
174971
  let e = await this.resolveAvailableStepIndex(t, 1, !0);
174960
- if (n !== this._transitionSequence || e < 0 || (this._previousFocusedElement = this.resolveDeepActiveElement(), this._pendingEndReason = "programmatic", this._tooltipStyles = this.createHiddenTooltipStyles(), this._spotlightStyles = this.createHiddenSpotlightStyles(), this._backdropStyles = [], this._spotlightTransitionsEnabled = !1, this._currentStepIndex = e, this._isRunning = !0, this.activateCurrentAnchor(), await this.scrollCurrentAnchorIntoView(), n !== this._transitionSequence || !this._isRunning)) return !1;
174972
+ if (n !== this._transitionSequence || e < 0) return !1;
174973
+ if (this._previousFocusedElement = this.resolveDeepActiveElement(), this._pendingEndReason = "programmatic", this._tooltipStyles = this.createHiddenTooltipStyles(), this._spotlightStyles = this.createHiddenSpotlightStyles(), this._backdropStyles = [], this._spotlightTransitionsEnabled = !1, this._currentStepIndex = e, this._currentStep = this.resolveStep(this._steps[e]), !this._currentStep) return this.fail("invalid-step", `Tour step "${this._steps[e].id}" did not resolve valid title and content text.`, this._steps[e]);
174974
+ if (this._isRunning = !0, this.activateCurrentAnchor(), await this.scrollCurrentAnchorIntoView(), n !== this._transitionSequence || !this._isRunning) return !1;
174961
174975
  this.requestUpdate(), await this.open(), await this.updateComplete, this.activateInteractionResources(), this.observeCurrentAnchor();
174962
174976
  let r = this.enter;
174963
174977
  if (this.updatePositions(!r), await this.updateComplete, await this.enableSpotlightTransitions(), r && await this.playPositionedEnterAnimation(r), n !== this._transitionSequence || !this._isRunning) return !1;
@@ -174966,11 +174980,11 @@ var F4 = function(e, t, n, r) {
174966
174980
  return i ? (this._tourStarted.emit({
174967
174981
  tourId: this._tourId,
174968
174982
  currentStep: i,
174969
- stepIndex: this._currentStepIndex,
174970
- stepCount: this._steps.length
174983
+ stepIndex: this.currentStepIndex,
174984
+ stepCount: this.stepCount
174971
174985
  }), this.emitStepChanged(null, i), this.restartAutoAdvance(), !0) : !1;
174972
174986
  } finally {
174973
- this._isTransitioning = !1, this._transitionOriginStepIndex = null, this.flushQueuedTourAction();
174987
+ this._isTransitioning = !1, this._transitionOriginStepIndex = null, this.flushQueuedContextRefresh() || this.flushQueuedTourAction();
174974
174988
  }
174975
174989
  }
174976
174990
  async next() {
@@ -175023,55 +175037,65 @@ var F4 = function(e, t, n, r) {
175023
175037
  onShowAutoAdvanceControlsChanged(e, t) {
175024
175038
  t || !this._isAutoAdvancePausedByUser || (this._isAutoAdvancePausedByUser = !1, this._isRunning && (this.currentStep?.duration ?? 0) > 0 && this._autoAdvanceController.resume(L4.AUTO_ADVANCE_USER_PAUSE_REASON), this.requestUpdate());
175025
175039
  }
175040
+ onContextChanged(e, t) {
175041
+ this.refreshForContextChange();
175042
+ }
175026
175043
  requestClose(e) {
175027
175044
  let t = super.requestClose(e);
175028
175045
  return t && (this._pendingEndReason = e === "escape" ? "escape" : "outside"), t;
175029
175046
  }
175030
- async moveToStep(e, t, n = !1) {
175047
+ async moveToStep(e, t, n = !1, r = !0) {
175031
175048
  this._autoAdvanceController.stop(), this.cancelPositionUpdate(), this._transitionOriginStepIndex = this._currentStepIndex, this._isTransitioning = !0;
175032
- let r = ++this._transitionSequence;
175049
+ let i = ++this._transitionSequence;
175033
175050
  try {
175034
- let i = this.currentStep, a = this.exit, o = a ? this.captureAnimationStyles(a) : null;
175035
- if (a && await this.play(a), r !== this._transitionSequence || !this._isRunning) return !1;
175036
- if (o && this.restoreAnimationStyles(o), this.preserveTooltipFocus(), E4.instance.activate(this._tourId, null), this._tooltipStyles = this.createHiddenTooltipStyles(), this._spotlightStyles = this.createHiddenSpotlightStyles(), this._backdropStyles = [], this.requestUpdate(), await this.updateComplete, t === 1 && i && !await this.executeStepActions(i, "advance", i.advanceActions ?? [])) return await this.closeAfterCompletedExit("step-action-failed"), !1;
175037
- let s = await this.resolveAvailableStepIndex(e, t);
175038
- if (r !== this._transitionSequence || !this._isRunning) return !1;
175039
- if (s < 0) {
175051
+ let a = this.currentStep, o = this.exit, s = o ? this.captureAnimationStyles(o) : null;
175052
+ if (o && await this.play(o), i !== this._transitionSequence || !this._isRunning) return !1;
175053
+ if (s && this.restoreAnimationStyles(s), this.preserveTooltipFocus(), E4.instance.activate(this._tourId, null), this._tooltipStyles = this.createHiddenTooltipStyles(), this._spotlightStyles = this.createHiddenSpotlightStyles(), this._backdropStyles = [], this.requestUpdate(), await this.updateComplete, r && t === 1 && a && !await this.executeStepActions(a, "advance", a.advanceActions ?? [])) return await this.closeAfterCompletedExit("step-action-failed"), !1;
175054
+ let c = await this.resolveAvailableStepIndex(e, t);
175055
+ if (i !== this._transitionSequence || !this._isRunning) return !1;
175056
+ if (c < 0) {
175040
175057
  if (this._resolutionFailureReason) return await this.closeAfterCompletedExit(this._resolutionFailureReason), !1;
175041
175058
  if (n) return this.closeAfterCompletedExit("finished");
175042
175059
  this.activateCurrentAnchor(), this.requestUpdate(), await this.updateComplete, this.observeCurrentAnchor();
175043
175060
  let e = this.enter;
175044
175061
  return this.updatePositions(!e), await this.updateComplete, e && await this.playPositionedEnterAnimation(e), this.focusTooltip(), this.restartAutoAdvance(), !1;
175045
175062
  }
175046
- if (this._currentStepIndex = s, this.activateCurrentAnchor(), await this.scrollCurrentAnchorIntoView(), r !== this._transitionSequence || !this._isRunning) return !1;
175047
- this.requestUpdate(), this.emitStepChanged(i, this.currentStep), await this.updateComplete, this.observeCurrentAnchor();
175048
- let c = this.enter;
175049
- return this.updatePositions(!c), await this.updateComplete, c && await this.playPositionedEnterAnimation(c), r !== this._transitionSequence || !this._isRunning ? !1 : (this.focusTooltip(), this.restartAutoAdvance(), !0);
175063
+ if (this._currentStepIndex = c, this._currentStep = this.resolveStep(this._steps[c]), !this._currentStep) return this._resolutionFailureReason = "invalid-step", this.fail("invalid-step", `Tour step "${this._steps[c].id}" did not resolve valid title and content text.`, this._steps[c]), await this.closeAfterCompletedExit("invalid-step"), !1;
175064
+ if (this.activateCurrentAnchor(), await this.scrollCurrentAnchorIntoView(), i !== this._transitionSequence || !this._isRunning) return !1;
175065
+ this.requestUpdate(), this.emitStepChanged(a, this.currentStep), await this.updateComplete, this.observeCurrentAnchor();
175066
+ let l = this.enter;
175067
+ return this.updatePositions(!l), await this.updateComplete, l && await this.playPositionedEnterAnimation(l), i !== this._transitionSequence || !this._isRunning ? !1 : (this.focusTooltip(), this.restartAutoAdvance(), !0);
175050
175068
  } finally {
175051
- this._isTransitioning = !1, this._transitionOriginStepIndex = null, this.flushQueuedTourAction();
175069
+ this._isTransitioning = !1, this._transitionOriginStepIndex = null, this.flushQueuedContextRefresh() || this.flushQueuedTourAction();
175052
175070
  }
175053
175071
  }
175054
175072
  async resolveAvailableStepIndex(e, t, n = !1) {
175055
175073
  this._resolutionFailureReason = null;
175056
175074
  for (let n = e; n >= 0 && n < this._steps.length; n += t) {
175057
- let e = this._steps[n];
175058
- if (!await this.activateStep(e)) return this._resolutionFailureReason = "step-activation-failed", this.fail("step-activation-failed", `Tour step "${e.id}" could not activate its required application state.`, e), -1;
175059
- if (!await this.executeStepActions(e, "enter", e.enterActions ?? [])) return this._resolutionFailureReason = "step-action-failed", -1;
175060
- if (await E4.instance.waitFor(this._tourId, e.anchorId, Math.max(e.anchorWaitTimeout ?? 0, 0))) return n;
175061
- if (!e.isOptional) return this._resolutionFailureReason = "anchor-missing", this.fail("anchor-missing", `Tour anchor "${e.anchorId}" is not registered for tour "${this._tourId}".`, e), -1;
175075
+ let e = this._steps[n], t = this.resolveContextActivation(e);
175076
+ if (t === null) return this._resolutionFailureReason = "invalid-step", -1;
175077
+ if (t) {
175078
+ if (!this.resolveStep(e)) return this._resolutionFailureReason = "invalid-step", this.fail("invalid-step", `Tour step "${e.id}" did not resolve valid title and content text.`, e), -1;
175079
+ if (!await this.activateStep(e)) return this._resolutionFailureReason = "step-activation-failed", this.fail("step-activation-failed", `Tour step "${e.id}" could not activate its required application state.`, e), -1;
175080
+ if (!await this.executeStepActions(e, "enter", e.enterActions ?? [])) return this._resolutionFailureReason = "step-action-failed", -1;
175081
+ if (await E4.instance.waitFor(this._tourId, e.anchorId, Math.max(e.anchorWaitTimeout ?? 0, 0))) return n;
175082
+ if (!e.isOptional) return this._resolutionFailureReason = "anchor-missing", this.fail("anchor-missing", `Tour anchor "${e.anchorId}" is not registered for tour "${this._tourId}".`, e), -1;
175083
+ }
175062
175084
  }
175063
- return n && (this._resolutionFailureReason = "anchor-missing", this.fail("anchor-missing", `Tour "${this._tourId}" does not have a reachable anchor.`, null)), -1;
175085
+ return n && (this._steps.some((e) => this.isContextActive(e)) ? (this._resolutionFailureReason = "anchor-missing", this.fail("anchor-missing", `Tour "${this._tourId}" does not have a reachable anchor.`, null)) : this.fail("empty-tour", `Tour "${this._tourId}" does not contain an active step for its current context.`, null)), -1;
175064
175086
  }
175065
175087
  validateConfiguration() {
175066
175088
  if (!this._tourId.trim()) return this.fail("invalid-tour-id", "The tour identifier must not be empty.", null);
175067
175089
  if (this._steps.length === 0) return this.fail("empty-tour", `Tour "${this._tourId}" does not contain any steps.`, null);
175068
175090
  let e = /* @__PURE__ */ new Set();
175069
175091
  for (let t of this._steps) {
175070
- if (!t.id?.trim() || !t.anchorId?.trim() || !t.title?.trim() || !t.content?.trim()) return this.fail("invalid-step", `Every step in tour "${this._tourId}" requires an id, anchorId, title, and content.`, t);
175092
+ let n = typeof t.title == "function" || typeof t.title == "string" && !!t.title.trim(), r = typeof t.content == "function" || typeof t.content == "string" && !!t.content.trim();
175093
+ if (!t.id?.trim() || !t.anchorId?.trim() || !n || !r) return this.fail("invalid-step", `Every step in tour "${this._tourId}" requires an id, anchorId, title, and content.`, t);
175071
175094
  if (e.has(t.id)) return this.fail("duplicate-step-id", `Tour step identifier "${t.id}" is duplicated in tour "${this._tourId}".`, t);
175072
175095
  if ((t.anchorWaitTimeout ?? 0) < 0) return this.fail("invalid-step", `Tour step "${t.id}" has a negative anchor wait timeout.`, t);
175073
175096
  if (t.duration !== void 0 && (!Number.isFinite(t.duration) || t.duration < 0)) return this.fail("invalid-step", `Tour step "${t.id}" has an invalid duration.`, t);
175074
175097
  if (t.route !== void 0 && !t.route.trim()) return this.fail("invalid-step", `Tour step "${t.id}" has an empty route.`, t);
175098
+ if (t.canActivate !== void 0 && typeof t.canActivate != "function") return this.fail("invalid-step", `Tour step "${t.id}" has an invalid canActivate predicate.`, t);
175075
175099
  if (t.scrollTimeout !== void 0 && (!Number.isFinite(t.scrollTimeout) || t.scrollTimeout < 0)) return this.fail("invalid-step", `Tour step "${t.id}" has an invalid scroll timeout.`, t);
175076
175100
  if (!this.validateStepActions(t, "enter", t.enterActions ?? []) || !this.validateStepActions(t, "advance", t.advanceActions ?? [])) return !1;
175077
175101
  e.add(t.id);
@@ -175079,7 +175103,37 @@ var F4 = function(e, t, n, r) {
175079
175103
  return !0;
175080
175104
  }
175081
175105
  isPotentiallyAvailable(e) {
175082
- return !e.isOptional || !!e.route?.trim() || (e.anchorWaitTimeout ?? 0) > 0 || E4.instance.resolve(this._tourId, e.anchorId) !== null;
175106
+ return this.isContextActive(e) ? !e.isOptional || !!e.route?.trim() || (e.anchorWaitTimeout ?? 0) > 0 || E4.instance.resolve(this._tourId, e.anchorId) !== null : !1;
175107
+ }
175108
+ resolveContextActivation(e) {
175109
+ try {
175110
+ let t = e.canActivate;
175111
+ if (!t) return !0;
175112
+ let n = t(this._context);
175113
+ return typeof n == "boolean" ? n : (this.fail("invalid-step", `Tour step "${e.id}" returned a non-boolean canActivate result.`, e), null);
175114
+ } catch {
175115
+ return this.fail("invalid-step", `Tour step "${e.id}" failed while evaluating its canActivate predicate.`, e), null;
175116
+ }
175117
+ }
175118
+ isContextActive(e) {
175119
+ try {
175120
+ let t = e.canActivate;
175121
+ return !t || t(this._context) === !0;
175122
+ } catch {
175123
+ return !1;
175124
+ }
175125
+ }
175126
+ resolveStep(e) {
175127
+ try {
175128
+ let t = e, n = typeof t.title == "function" ? t.title(this._context) : t.title, r = typeof t.content == "function" ? t.content(this._context) : t.content;
175129
+ return typeof n != "string" || !n.trim() || typeof r != "string" || !r.trim() ? null : {
175130
+ ...e,
175131
+ title: n,
175132
+ content: r
175133
+ };
175134
+ } catch {
175135
+ return null;
175136
+ }
175083
175137
  }
175084
175138
  fail(e, t, n) {
175085
175139
  return this._tourFailed.emit({
@@ -175141,7 +175195,7 @@ var F4 = function(e, t, n, r) {
175141
175195
  finalizeEnd() {
175142
175196
  if (!this._isRunning) return;
175143
175197
  let e = this.currentStep;
175144
- this._isRunning = !1, this._isTransitioning = !1, this._isAutoAdvancePausedByUser = !1, this._transitionOriginStepIndex = null, this._queuedTourAction = null, ++this._transitionSequence, this._currentStepIndex = -1, this._backdropStyles = [], this._resolutionFailureReason = null, this._executedStepActions.clear(), E4.instance.activate(this._tourId, null), this.deactivateInteractionResources(), this.requestUpdate(), this.emitStepChanged(e, null), this._tourEnded.emit({
175198
+ this._isRunning = !1, this._isTransitioning = !1, this._isAutoAdvancePausedByUser = !1, this._transitionOriginStepIndex = null, this._queuedTourAction = null, this._isContextRefreshQueued = !1, ++this._transitionSequence, this._currentStep = null, this._currentStepIndex = -1, this._backdropStyles = [], this._resolutionFailureReason = null, this._executedStepActions.clear(), E4.instance.activate(this._tourId, null), this.deactivateInteractionResources(), this.requestUpdate(), this.emitStepChanged(e, null), this._tourEnded.emit({
175145
175199
  tourId: this._tourId,
175146
175200
  reason: this._pendingEndReason
175147
175201
  }), this.restorePreviousFocus(), this._pendingEndReason = "programmatic";
@@ -175151,8 +175205,8 @@ var F4 = function(e, t, n, r) {
175151
175205
  tourId: this._tourId,
175152
175206
  previousStep: e,
175153
175207
  currentStep: t,
175154
- stepIndex: this._currentStepIndex,
175155
- stepCount: this._steps.length
175208
+ stepIndex: this.currentStepIndex,
175209
+ stepCount: this.stepCount
175156
175210
  });
175157
175211
  }
175158
175212
  activateCurrentAnchor() {
@@ -175282,6 +175336,43 @@ var F4 = function(e, t, n, r) {
175282
175336
  this._positionFrameId = null, !this._isTransitioning && this.updatePositions();
175283
175337
  }));
175284
175338
  }
175339
+ async refreshForContextChange() {
175340
+ if (!this._isRunning) return;
175341
+ if (this._isTransitioning) {
175342
+ this._isContextRefreshQueued = !0;
175343
+ return;
175344
+ }
175345
+ let e = this._steps[this._currentStepIndex];
175346
+ if (!e) return;
175347
+ let t = this.resolveContextActivation(e);
175348
+ if (t === null) {
175349
+ await this.end("invalid-step");
175350
+ return;
175351
+ }
175352
+ if (!t) {
175353
+ await this.moveToStep(this._currentStepIndex + 1, 1, !0, !1);
175354
+ return;
175355
+ }
175356
+ let n = this.resolveStep(e);
175357
+ if (!n) {
175358
+ this.fail("invalid-step", `Tour step "${e.id}" did not resolve valid title and content text.`, e), await this.end("invalid-step");
175359
+ return;
175360
+ }
175361
+ let r = this._currentStep;
175362
+ if (r && r.title === n.title && r.content === n.content) {
175363
+ await this.updateComplete, this.schedulePositionUpdate();
175364
+ return;
175365
+ }
175366
+ this._currentStep = n, this.requestUpdate("currentStep"), this.emitStepChanged(r, n), await this.updateComplete, this.schedulePositionUpdate();
175367
+ }
175368
+ flushQueuedContextRefresh() {
175369
+ let e = this._isContextRefreshQueued;
175370
+ return this._isContextRefreshQueued = !1, !e || !this._isRunning ? !1 : (queueMicrotask(() => {
175371
+ !this._isRunning || this._isTransitioning || this.refreshForContextChange().finally(() => {
175372
+ this._isTransitioning || this.flushQueuedTourAction();
175373
+ });
175374
+ }), !0);
175375
+ }
175285
175376
  queueIncomingStepAction(e) {
175286
175377
  return this._transitionOriginStepIndex === null || this._currentStepIndex === this._transitionOriginStepIndex || (this._queuedTourAction = e), !1;
175287
175378
  }
@@ -175588,6 +175679,10 @@ F4([
175588
175679
  k({ type: Object }),
175589
175680
  I4("design:type", Object),
175590
175681
  I4("design:paramtypes", [Object])
175682
+ ], R4.prototype, "context", null), F4([
175683
+ k({ type: Object }),
175684
+ I4("design:type", Object),
175685
+ I4("design:paramtypes", [Object])
175591
175686
  ], R4.prototype, "labels", null), F4([
175592
175687
  w({
175593
175688
  type: Boolean,
@@ -175639,7 +175734,12 @@ F4([
175639
175734
  I4("design:type", Function),
175640
175735
  I4("design:paramtypes", [Boolean, Boolean]),
175641
175736
  I4("design:returntype", void 0)
175642
- ], R4.prototype, "onShowAutoAdvanceControlsChanged", null), R4 = L4 = F4([L({
175737
+ ], R4.prototype, "onShowAutoAdvanceControlsChanged", null), F4([
175738
+ M("context"),
175739
+ I4("design:type", Function),
175740
+ I4("design:paramtypes", [Object, Object]),
175741
+ I4("design:returntype", void 0)
175742
+ ], R4.prototype, "onContextChanged", null), R4 = L4 = F4([L({
175643
175743
  selector: "mosaik-tour",
175644
175744
  template: k_e,
175645
175745
  themes: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breadstone/mosaik-elements-svelte",
3
- "version": "0.1.64",
3
+ "version": "0.1.65",
4
4
  "description": "Mosaik elements for Svelte.",
5
5
  "license": "MIT",
6
6
  "author": "andre.wehlert <awehlert@breadstone.de> (https://www.breadstone.de)",
@@ -11,8 +11,8 @@
11
11
  "url": "git+ssh://git@github.com/RueDeRennes/mosaik.git"
12
12
  },
13
13
  "dependencies": {
14
- "@breadstone/mosaik-elements": "0.1.64",
15
- "@breadstone/mosaik-elements-foundation": "0.1.64",
14
+ "@breadstone/mosaik-elements": "0.1.65",
15
+ "@breadstone/mosaik-elements-foundation": "0.1.65",
16
16
  "tslib": "2.8.1"
17
17
  },
18
18
  "peerDependencies": {