@quietsapa/qsl 0.1.0 → 0.1.1

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/dist/qsl.mjs CHANGED
@@ -2,7 +2,7 @@ const core = {
2
2
  /**
3
3
  * Constants
4
4
  */
5
- VERSION: "0.1.0",
5
+ VERSION: "0.1.1",
6
6
  PREFIX: "qsl-",
7
7
  FLOW_TYPE: {
8
8
  DEFAULT: "default",
@@ -503,8 +503,7 @@ const core = {
503
503
  }
504
504
  }
505
505
  let flowsDone = this.flowOptions.size ? Array.from(this.flowOptions.values()).every((opt) => opt.status === this.FLOW_STATE.COMPLETED) : false;
506
- if (!flowsDone) return;
507
- let maybeComplete = true;
506
+ let maybeComplete = flowsDone;
508
507
  if (this.flows.size && this.completedFlowsActions.size) {
509
508
  for (const cb of this.completedFlowsActions) {
510
509
  maybeComplete = cb.call(this, flowsDone, this.flows, this.flowOptions);
@@ -1402,7 +1401,7 @@ function hoverTrigger(QSL) {
1402
1401
  cb();
1403
1402
  return;
1404
1403
  }
1405
- el.addEventListener("mouseenter", () => cb(), { once: true, passive: true });
1404
+ el.addEventListener("mouseover", () => cb(), { once: true, passive: true });
1406
1405
  });
1407
1406
  };
1408
1407
  });
@@ -1739,19 +1738,19 @@ function dynamic(QSL) {
1739
1738
  return [flowId, config];
1740
1739
  });
1741
1740
  QSL.flowIdFilters.add(function(flowIds) {
1741
+ if (flowIds.length === 1 && flowIds[0].includes("dynamic")) return flowIds;
1742
1742
  return flowIds.filter((fid) => !fid.includes("dynamic"));
1743
1743
  });
1744
1744
  QSL.completedFlowsActions.add(function(flowsDone, flows, flowOptions) {
1745
- if (!flowsDone || !flows || !flowOptions) return true;
1745
+ if (!flows || !flowOptions) return flowsDone;
1746
1746
  const nonDynamicFlowsDone = [...flowOptions.entries()].filter(([fid]) => !fid.includes("dynamic")).every(([, opt]) => opt.status === this.FLOW_STATE.COMPLETED);
1747
1747
  if (!nonDynamicFlowsDone) return false;
1748
1748
  const dynamicFlowIds = [...flows.keys()].filter((fid) => fid.includes("dynamic"));
1749
- if (dynamicFlowIds.length === 0) return true;
1749
+ if (dynamicFlowIds.length === 0) return flowsDone;
1750
1750
  for (const dynamicFlowId of dynamicFlowIds) {
1751
1751
  const dynamicOptions = flowOptions.get(dynamicFlowId);
1752
1752
  if (dynamicOptions && dynamicOptions.status !== this.FLOW_STATE.COMPLETED) {
1753
1753
  if (dynamicOptions.status === this.FLOW_STATE.READY) {
1754
- this.setFlowOptions({ status: this.FLOW_STATE.RUNNING }, dynamicFlowId);
1755
1754
  this.runFlow(dynamicFlowId);
1756
1755
  }
1757
1756
  return false;