@tbox.cn/app-module-promotion 0.2.0 → 0.9.4
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/AGENTS.md +16 -0
- package/README.md +90 -11
- package/dist/chunk-QOTX4XDS.js +1745 -0
- package/dist/chunk-S7CVFCML.js +1330 -0
- package/dist/client/index.d.ts +21 -3
- package/dist/client/index.js +4 -2
- package/dist/index.d.ts +4 -3
- package/dist/index.js +16 -4
- package/dist/promotion-6L7HLRC2.css +2135 -0
- package/dist/server/index.d.ts +2481 -41
- package/dist/server/index.js +13 -3
- package/package.json +28 -15
- package/skills/promotion/SKILL.md +137 -0
- package/skills/promotion/references/claim-loop.md +18 -0
- package/src/client/cards/index.ts +10 -0
- package/src/client/cards/promotion-activity-category-list/index.tsx +34 -0
- package/src/client/cards/promotion-activity-detail/index.tsx +84 -0
- package/src/client/cards/promotion-activity-list/index.tsx +56 -0
- package/src/client/cards/promotion-best-deal/index.tsx +18 -0
- package/src/client/cards/promotion-entitlement-list/index.tsx +161 -0
- package/src/client/cards/promotion-offer-detail/index.tsx +116 -0
- package/src/client/cards/promotion-offer-list/index.tsx +283 -0
- package/src/client/cards/view.ts +72 -0
- package/src/client/components/CouponQrCode.tsx +48 -0
- package/src/client/components/CouponSheet.tsx +124 -0
- package/src/client/components/ImageWithFallback.tsx +39 -0
- package/src/client/index.ts +23 -4
- package/src/client/styles/promotion.css +2135 -0
- package/src/client/types/css.d.ts +2 -0
- package/src/client/utils/sanitize-activity-html.ts +48 -0
- package/src/client/utils/scroll-card-bottom.ts +40 -0
- package/src/server/actions.ts +217 -0
- package/src/server/cards/index.ts +19 -0
- package/src/server/cards/promotion-activity-category-list/meta.ts +13 -0
- package/src/server/cards/promotion-activity-detail/meta.ts +29 -0
- package/src/server/cards/promotion-activity-list/meta.ts +13 -0
- package/src/server/cards/promotion-best-deal/meta.ts +20 -0
- package/src/server/cards/promotion-entitlement-list/meta.ts +17 -0
- package/src/server/cards/promotion-entitlement-list/samples.ts +51 -0
- package/src/server/cards/promotion-offer-detail/meta.ts +25 -0
- package/src/server/cards/promotion-offer-list/meta.ts +20 -0
- package/src/server/cards/promotion-offer-list/samples.ts +154 -0
- package/src/server/handler.ts +378 -16
- package/src/server/index.ts +117 -22
- package/src/server/navigation.ts +23 -0
- package/src/server/ports.ts +56 -0
- package/src/server/service.ts +243 -24
- package/src/server/tools.ts +789 -0
- package/tbox.module.json +126 -0
- package/tests/cards-render.test.tsx +656 -0
- package/tests/ports-resolve.test.ts +96 -0
- package/tests/pretool-coupons.test.ts +63 -0
- package/tests/promotion.test.ts +976 -0
- package/tests/samples.test.ts +42 -0
- package/tests/view.test.ts +61 -0
- package/tsup.config.ts +9 -1
- package/dist/chunk-AD6OLHSM.js +0 -86
- package/dist/chunk-LQGF6337.js +0 -32
- package/src/client/cards/coupon/index.tsx +0 -12
- package/src/server/cards/coupon/meta.ts +0 -23
- package/tbox.component.json +0 -20
- package/tests/service.test.ts +0 -31
package/dist/client/index.d.ts
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
import { CardComponent } from '@tbox.cn/app-contracts';
|
|
2
2
|
import { ClientContext } from '@tbox.cn/app-sdk/client';
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* module-promotion 客户端入口:9 个稳定传输卡型,renderer 内覆盖多个展示语义。
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
declare const cards: {
|
|
9
|
+
readonly 'promotion-offer-list': CardComponent;
|
|
10
|
+
readonly 'promotion-offer-detail': CardComponent;
|
|
11
|
+
readonly 'promotion-entitlement-list': CardComponent;
|
|
12
|
+
readonly 'promotion-activity-list': CardComponent;
|
|
13
|
+
readonly 'promotion-activity-detail': CardComponent;
|
|
14
|
+
readonly 'promotion-activity-category-list': CardComponent;
|
|
15
|
+
readonly 'promotion-best-deal': CardComponent;
|
|
16
|
+
};
|
|
5
17
|
declare const clientModule: {
|
|
6
18
|
cards: {
|
|
7
|
-
readonly
|
|
19
|
+
readonly 'promotion-offer-list': CardComponent;
|
|
20
|
+
readonly 'promotion-offer-detail': CardComponent;
|
|
21
|
+
readonly 'promotion-entitlement-list': CardComponent;
|
|
22
|
+
readonly 'promotion-activity-list': CardComponent;
|
|
23
|
+
readonly 'promotion-activity-detail': CardComponent;
|
|
24
|
+
readonly 'promotion-activity-category-list': CardComponent;
|
|
25
|
+
readonly 'promotion-best-deal': CardComponent;
|
|
8
26
|
};
|
|
9
27
|
register(ctx: ClientContext): void;
|
|
10
28
|
};
|
|
11
29
|
|
|
12
|
-
export { clientModule };
|
|
30
|
+
export { clientModule, cards as promotionClientCards };
|
package/dist/client/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { InMemoryPromotionService,
|
|
2
|
-
export { clientModule } from './client/index.js';
|
|
1
|
+
export { InMemoryPromotionService, inMemoryPromotion, promotionCards, resolvePromotionAcquisitionPort, resolvePromotionActivitiesPort, resolvePromotionEntitlementsPort, resolvePromotionOffersPort, serverModule } from './server/index.js';
|
|
2
|
+
export { clientModule, promotionClientCards } from './client/index.js';
|
|
3
|
+
import '@mastra/core/tools';
|
|
4
|
+
import '@tbox.cn/app-sdk/server';
|
|
3
5
|
import '@tbox.cn/app-contracts';
|
|
4
6
|
import 'zod';
|
|
5
|
-
import '@tbox.cn/app-sdk/server';
|
|
6
7
|
import '@tbox.cn/app-contracts-mall';
|
|
7
8
|
import '@tbox.cn/app-sdk/client';
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
InMemoryPromotionService,
|
|
3
|
-
|
|
3
|
+
inMemoryPromotion,
|
|
4
|
+
promotionCards,
|
|
5
|
+
resolvePromotionAcquisitionPort,
|
|
6
|
+
resolvePromotionActivitiesPort,
|
|
7
|
+
resolvePromotionEntitlementsPort,
|
|
8
|
+
resolvePromotionOffersPort,
|
|
4
9
|
serverModule
|
|
5
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QOTX4XDS.js";
|
|
6
11
|
import {
|
|
12
|
+
cards,
|
|
7
13
|
clientModule
|
|
8
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-S7CVFCML.js";
|
|
9
15
|
export {
|
|
10
16
|
InMemoryPromotionService,
|
|
11
17
|
clientModule,
|
|
12
|
-
|
|
18
|
+
inMemoryPromotion,
|
|
19
|
+
promotionCards,
|
|
20
|
+
cards as promotionClientCards,
|
|
21
|
+
resolvePromotionAcquisitionPort,
|
|
22
|
+
resolvePromotionActivitiesPort,
|
|
23
|
+
resolvePromotionEntitlementsPort,
|
|
24
|
+
resolvePromotionOffersPort,
|
|
13
25
|
serverModule
|
|
14
26
|
};
|