js-kompo-utils 1.0.6 → 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="
|
|
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>
|
|
@@ -350,8 +350,9 @@ export class KompoJsInitializer {
|
|
|
350
350
|
|
|
351
351
|
bootBroadcastingIfRequired() {
|
|
352
352
|
if (this.config.includeBroadcasting) {
|
|
353
|
-
const
|
|
354
|
-
|
|
353
|
+
const EchoModule = require("laravel-echo");
|
|
354
|
+
const Echo = EchoModule.default || EchoModule;
|
|
355
|
+
this.window.Pusher = require('pusher-js');
|
|
355
356
|
|
|
356
357
|
this.window.Echo = new Echo(this.config.echoBroadcasterConfig);
|
|
357
358
|
}
|
package/package.json
CHANGED
|
@@ -228,11 +228,17 @@ export class TutorialEngine {
|
|
|
228
228
|
const devMode = this.config.get('devMode');
|
|
229
229
|
|
|
230
230
|
if (step.showIf) {
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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
|
|