js-kompo-utils 1.0.7 → 1.0.8

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.
@@ -257,7 +257,7 @@
257
257
  <div v-show="cards.conditions" class="sb-card-body">
258
258
  <div class="sb-row">
259
259
  <label class="sb-lbl">Show If</label>
260
- <input :value="step.showIf || ''" @input="setStepProp('showIf', $event.target.value)" class="sb-input" placeholder="CSS selector">
260
+ <input :value="step.showIf || ''" @input="setStepProp('showIf', $event.target.value)" class="sb-input" placeholder="permission:X, role:X, selector:.css">
261
261
  </div>
262
262
  </div>
263
263
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js-kompo-utils",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "",
5
5
  "main": "app.js",
6
6
  "scripts": {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export class TutorialConfig {
5
5
  static DEFAULTS = {
6
- avatar: '/images/tutorial-avatar.png',
6
+ avatar: '/images/tutorial-avatar.webp',
7
7
  cursorImage: null,
8
8
  cursorSize: 'clamp(32px, 8vw, 48px)',
9
9
  avatarHeight: 'clamp(200px, 50vh, 475px)',
@@ -228,11 +228,17 @@ export class TutorialEngine {
228
228
  const devMode = this.config.get('devMode');
229
229
 
230
230
  if (step.showIf) {
231
- const sel = typeof step.showIf === 'string' ? step.showIf : step.showIf.selector;
232
- if (sel && !document.querySelector(sel)) {
233
- const nextIdx = index + this._lastDirection;
234
- if (nextIdx >= 0 && nextIdx < this.steps.length) this._showStep(nextIdx);
235
- return;
231
+ const raw = typeof step.showIf === 'string' ? step.showIf : step.showIf.selector;
232
+ // Client-side: only evaluate "selector:.css-selector" conditions
233
+ // Server-side conditions (permission:, setting:, role:) are already
234
+ // filtered by TutorialProcessor before reaching the client
235
+ if (raw && raw.startsWith('selector:')) {
236
+ const sel = raw.slice('selector:'.length);
237
+ if (sel && !document.querySelector(sel)) {
238
+ const nextIdx = index + this._lastDirection;
239
+ if (nextIdx >= 0 && nextIdx < this.steps.length) this._showStep(nextIdx);
240
+ return;
241
+ }
236
242
  }
237
243
  }
238
244