@yaoxiu/marketing-dsl 2.1.1 → 2.1.2

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.
@@ -1488,6 +1488,12 @@ var sections_default = sections9;
1488
1488
 
1489
1489
  // src/docs/meta.ts
1490
1490
  var changelog = [
1491
+ {
1492
+ date: "2026-08-24",
1493
+ items: [
1494
+ "\u3010\u4FEE\u590D\u3011\u5173\u95ED\u6309\u94AE\u4E0A\u914D\u7684\u57CB\u70B9\uFF08sequence: [track, close]\uFF09\u4E4B\u524D\u4F1A\u4E22\u5931\u3001\u8FD8\u4F1A\u4E32\u5230\u4E0B\u4E00\u6B21\u5173\u95ED\u7684\u4E0A\u62A5\u91CC \u2014\u2014 \u89E3\u91CA\u5668\u6D3E\u53D1 close \u4E8B\u4EF6\u65F6\u6162\u4E86\u4E00\u62CD\uFF0C\u5BBF\u4E3B\u8BFB\u4E0D\u5230\u57CB\u70B9\u540D\u3002\u73B0\u5DF2\u4FEE\u6B63\u987A\u5E8F\uFF0C\u8FD0\u8425\u7684\u914D\u7F6E\u5199\u6CD5\u4E0D\u7528\u6539"
1495
+ ]
1496
+ },
1491
1497
  {
1492
1498
  date: "2026-08-22",
1493
1499
  items: [
@@ -1363,6 +1363,12 @@ var sections_default = sections9;
1363
1363
 
1364
1364
  // src/docs/meta.ts
1365
1365
  var changelog = [
1366
+ {
1367
+ date: "2026-08-24",
1368
+ items: [
1369
+ "\u3010\u4FEE\u590D\u3011\u5173\u95ED\u6309\u94AE\u4E0A\u914D\u7684\u57CB\u70B9\uFF08sequence: [track, close]\uFF09\u4E4B\u524D\u4F1A\u4E22\u5931\u3001\u8FD8\u4F1A\u4E32\u5230\u4E0B\u4E00\u6B21\u5173\u95ED\u7684\u4E0A\u62A5\u91CC \u2014\u2014 \u89E3\u91CA\u5668\u6D3E\u53D1 close \u4E8B\u4EF6\u65F6\u6162\u4E86\u4E00\u62CD\uFF0C\u5BBF\u4E3B\u8BFB\u4E0D\u5230\u57CB\u70B9\u540D\u3002\u73B0\u5DF2\u4FEE\u6B63\u987A\u5E8F\uFF0C\u8FD0\u8425\u7684\u914D\u7F6E\u5199\u6CD5\u4E0D\u7528\u6539"
1370
+ ]
1371
+ },
1366
1372
  {
1367
1373
  date: "2026-08-22",
1368
1374
  items: [
package/dist/index.cjs CHANGED
@@ -1172,6 +1172,12 @@ function createRuntime(dsl, options = {}) {
1172
1172
  notify();
1173
1173
  fireLifecycle(name, "onShow");
1174
1174
  }
1175
+ function emitClose(why) {
1176
+ Promise.resolve().then(() => {
1177
+ if (destroyed) return;
1178
+ emit("close", { reason: why });
1179
+ });
1180
+ }
1175
1181
  function closeTop(reason) {
1176
1182
  const why = reason || "action";
1177
1183
  if (viewStack.length > 1) {
@@ -1188,12 +1194,12 @@ function createRuntime(dsl, options = {}) {
1188
1194
  return;
1189
1195
  }
1190
1196
  fireLifecycle(viewStack[0], "onClose", { closeReason: why });
1191
- emit("close", { reason: why });
1197
+ emitClose(why);
1192
1198
  }
1193
1199
  function closeAll(reason) {
1194
1200
  const why = reason || "action";
1195
1201
  viewStack.slice().reverse().forEach((name) => fireLifecycle(name, "onClose", { closeReason: why }));
1196
- emit("close", { reason: why });
1202
+ emitClose(why);
1197
1203
  }
1198
1204
  const dispatch = createDispatcher({
1199
1205
  setState,
package/dist/index.js CHANGED
@@ -644,6 +644,12 @@ function createRuntime(dsl, options = {}) {
644
644
  notify();
645
645
  fireLifecycle(name, "onShow");
646
646
  }
647
+ function emitClose(why) {
648
+ Promise.resolve().then(() => {
649
+ if (destroyed) return;
650
+ emit("close", { reason: why });
651
+ });
652
+ }
647
653
  function closeTop(reason) {
648
654
  const why = reason || "action";
649
655
  if (viewStack.length > 1) {
@@ -660,12 +666,12 @@ function createRuntime(dsl, options = {}) {
660
666
  return;
661
667
  }
662
668
  fireLifecycle(viewStack[0], "onClose", { closeReason: why });
663
- emit("close", { reason: why });
669
+ emitClose(why);
664
670
  }
665
671
  function closeAll(reason) {
666
672
  const why = reason || "action";
667
673
  viewStack.slice().reverse().forEach((name) => fireLifecycle(name, "onClose", { closeReason: why }));
668
- emit("close", { reason: why });
674
+ emitClose(why);
669
675
  }
670
676
  const dispatch = createDispatcher({
671
677
  setState,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaoxiu/marketing-dsl",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "type": "module",
5
5
  "description": "营销弹窗 DSL 解释器核心,纯逻辑无框架依赖",
6
6
  "license": "MIT",