@syntrologie/adapt-faq 2.8.0-canary.31 → 2.8.0-canary.310

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.
Files changed (62) hide show
  1. package/dist/FAQWidgetLit.d.ts +85 -0
  2. package/dist/FAQWidgetLit.d.ts.map +1 -0
  3. package/dist/FAQWidgetLit.editable.d.ts +154 -0
  4. package/dist/FAQWidgetLit.editable.d.ts.map +1 -0
  5. package/dist/answerRendering.d.ts +4 -0
  6. package/dist/answerRendering.d.ts.map +1 -0
  7. package/dist/chunk-5WRI5ZAA.js +31 -0
  8. package/dist/chunk-5WRI5ZAA.js.map +7 -0
  9. package/dist/chunk-IGCYULL7.js +223 -0
  10. package/dist/chunk-IGCYULL7.js.map +7 -0
  11. package/dist/chunk-KRKRB4OL.js +598 -0
  12. package/dist/chunk-KRKRB4OL.js.map +7 -0
  13. package/dist/editor.d.ts +60 -33
  14. package/dist/editor.d.ts.map +1 -1
  15. package/dist/editor.js +5054 -313
  16. package/dist/editor.js.map +7 -0
  17. package/dist/faq-item-editor.d.ts +33 -0
  18. package/dist/faq-item-editor.d.ts.map +1 -0
  19. package/dist/faq-styles.d.ts +3 -1
  20. package/dist/faq-styles.d.ts.map +1 -1
  21. package/dist/faq-types.d.ts +4 -0
  22. package/dist/faq-types.d.ts.map +1 -1
  23. package/dist/runtime.d.ts +17 -5
  24. package/dist/runtime.d.ts.map +1 -1
  25. package/dist/runtime.js +841 -64
  26. package/dist/runtime.js.map +7 -0
  27. package/dist/schema.d.ts +1174 -555
  28. package/dist/schema.d.ts.map +1 -1
  29. package/dist/schema.js +290 -207
  30. package/dist/schema.js.map +7 -0
  31. package/dist/types.d.ts +19 -0
  32. package/dist/types.d.ts.map +1 -1
  33. package/node_modules/marked/LICENSE.md +44 -0
  34. package/node_modules/marked/README.md +107 -0
  35. package/node_modules/marked/bin/main.js +283 -0
  36. package/node_modules/marked/bin/marked.js +16 -0
  37. package/node_modules/marked/lib/marked.d.ts +759 -0
  38. package/node_modules/marked/lib/marked.esm.js +72 -0
  39. package/node_modules/marked/lib/marked.esm.js.map +7 -0
  40. package/node_modules/marked/lib/marked.umd.js +74 -0
  41. package/node_modules/marked/lib/marked.umd.js.map +7 -0
  42. package/node_modules/marked/man/marked.1 +113 -0
  43. package/node_modules/marked/man/marked.1.md +93 -0
  44. package/node_modules/marked/package.json +103 -0
  45. package/package.json +13 -18
  46. package/dist/FAQWidget.d.ts +0 -33
  47. package/dist/FAQWidget.d.ts.map +0 -1
  48. package/dist/FAQWidget.js +0 -388
  49. package/dist/cdn.d.ts +0 -70
  50. package/dist/cdn.d.ts.map +0 -1
  51. package/dist/cdn.js +0 -46
  52. package/dist/executors.js +0 -150
  53. package/dist/faq-styles.js +0 -204
  54. package/dist/faq-types.js +0 -7
  55. package/dist/state.js +0 -132
  56. package/dist/summarize.js +0 -62
  57. package/dist/types.js +0 -17
  58. package/node_modules/@syntrologie/sdk-contracts/dist/index.d.ts +0 -129
  59. package/node_modules/@syntrologie/sdk-contracts/dist/index.js +0 -15
  60. package/node_modules/@syntrologie/sdk-contracts/dist/schemas.d.ts +0 -2225
  61. package/node_modules/@syntrologie/sdk-contracts/dist/schemas.js +0 -162
  62. package/node_modules/@syntrologie/sdk-contracts/package.json +0 -33
@@ -1,162 +0,0 @@
1
- /**
2
- * Shared Zod schemas for decision strategies, conditions, and event scoping.
3
- *
4
- * These are the canonical definitions — runtime-sdk and all adaptive packages
5
- * should import from here instead of duplicating.
6
- */
7
- import { z } from 'zod';
8
- // =============================================================================
9
- // ANCHOR ID SCHEMA
10
- // =============================================================================
11
- export const AnchorIdZ = z
12
- .object({
13
- selector: z.string(),
14
- route: z.union([z.string(), z.array(z.string())]),
15
- })
16
- .strict();
17
- // =============================================================================
18
- // CONDITION SCHEMAS
19
- // =============================================================================
20
- export const PageUrlConditionZ = z.object({
21
- type: z.literal('page_url'),
22
- url: z.string(),
23
- });
24
- export const RouteConditionZ = z.object({
25
- type: z.literal('route'),
26
- routeId: z.string(),
27
- });
28
- export const AnchorVisibleConditionZ = z.object({
29
- type: z.literal('anchor_visible'),
30
- anchorId: z.string(),
31
- state: z.enum(['visible', 'present', 'absent']),
32
- });
33
- export const EventOccurredConditionZ = z.object({
34
- type: z.literal('event_occurred'),
35
- eventName: z.string(),
36
- withinMs: z.number().optional(),
37
- });
38
- export const StateEqualsConditionZ = z.object({
39
- type: z.literal('state_equals'),
40
- key: z.string(),
41
- value: z.unknown(),
42
- });
43
- export const ViewportConditionZ = z.object({
44
- type: z.literal('viewport'),
45
- minWidth: z.number().optional(),
46
- maxWidth: z.number().optional(),
47
- minHeight: z.number().optional(),
48
- maxHeight: z.number().optional(),
49
- });
50
- export const SessionMetricConditionZ = z.object({
51
- type: z.literal('session_metric'),
52
- key: z.string(),
53
- operator: z.enum(['gte', 'lte', 'eq', 'gt', 'lt']),
54
- threshold: z.number(),
55
- });
56
- export const DismissedConditionZ = z.object({
57
- type: z.literal('dismissed'),
58
- key: z.string(),
59
- inverted: z.boolean().optional(),
60
- });
61
- export const CooldownActiveConditionZ = z.object({
62
- type: z.literal('cooldown_active'),
63
- key: z.string(),
64
- inverted: z.boolean().optional(),
65
- });
66
- export const FrequencyLimitConditionZ = z.object({
67
- type: z.literal('frequency_limit'),
68
- key: z.string(),
69
- limit: z.number(),
70
- inverted: z.boolean().optional(),
71
- });
72
- export const MatchOpZ = z.object({
73
- equals: z.union([z.string(), z.number(), z.boolean()]).optional(),
74
- contains: z.string().optional(),
75
- });
76
- export const CounterDefZ = z.object({
77
- events: z.array(z.string()).min(1),
78
- match: z.record(z.string(), MatchOpZ).optional(),
79
- });
80
- export const EventCountConditionZ = z.object({
81
- type: z.literal('event_count'),
82
- key: z.string(),
83
- operator: z.enum(['gte', 'lte', 'eq', 'gt', 'lt']),
84
- count: z.number().int().min(0),
85
- withinMs: z.number().positive().optional(),
86
- counter: CounterDefZ.optional(),
87
- });
88
- export const ConditionZ = z.discriminatedUnion('type', [
89
- PageUrlConditionZ,
90
- RouteConditionZ,
91
- AnchorVisibleConditionZ,
92
- EventOccurredConditionZ,
93
- StateEqualsConditionZ,
94
- ViewportConditionZ,
95
- SessionMetricConditionZ,
96
- DismissedConditionZ,
97
- CooldownActiveConditionZ,
98
- FrequencyLimitConditionZ,
99
- EventCountConditionZ,
100
- ]);
101
- // =============================================================================
102
- // STRATEGY SCHEMAS
103
- // =============================================================================
104
- export const RuleZ = z.object({
105
- conditions: z.array(ConditionZ),
106
- value: z.unknown(),
107
- });
108
- export const RuleStrategyZ = z.object({
109
- type: z.literal('rules'),
110
- rules: z.array(RuleZ),
111
- default: z.unknown(),
112
- });
113
- export const ScoreStrategyZ = z.object({
114
- type: z.literal('score'),
115
- field: z.string(),
116
- threshold: z.number(),
117
- above: z.unknown(),
118
- below: z.unknown(),
119
- });
120
- export const ModelStrategyZ = z.object({
121
- type: z.literal('model'),
122
- modelId: z.string(),
123
- inputs: z.array(z.string()),
124
- outputMapping: z.record(z.string(), z.unknown()),
125
- default: z.unknown(),
126
- });
127
- export const ExternalStrategyZ = z.object({
128
- type: z.literal('external'),
129
- endpoint: z.string(),
130
- method: z.enum(['GET', 'POST']).optional(),
131
- default: z.unknown(),
132
- timeoutMs: z.number().optional(),
133
- });
134
- export const DecisionStrategyZ = z.discriminatedUnion('type', [
135
- RuleStrategyZ,
136
- ScoreStrategyZ,
137
- ModelStrategyZ,
138
- ExternalStrategyZ,
139
- ]);
140
- /** Canonical Zod schema for the optional triggerWhen field on actions and adaptive items. */
141
- export const TriggerWhenZ = DecisionStrategyZ.nullable().optional();
142
- // =============================================================================
143
- // EVENT SCOPE SCHEMA
144
- // =============================================================================
145
- /** Scopes a widget to specific events/URLs. */
146
- export const EventScopeZ = z.object({
147
- events: z.array(z.string()),
148
- urlContains: z.string().optional(),
149
- props: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),
150
- });
151
- // =============================================================================
152
- // NOTIFY SCHEMA
153
- // =============================================================================
154
- /** Toast notification config for triggerWhen transitions. */
155
- export const NotifyZ = z
156
- .object({
157
- title: z.string().optional(),
158
- body: z.string().optional(),
159
- icon: z.string().optional(),
160
- })
161
- .nullable()
162
- .optional();
@@ -1,33 +0,0 @@
1
- {
2
- "name": "@syntrologie/sdk-contracts",
3
- "version": "0.0.0-semantically-released",
4
- "description": "Shared TypeScript contracts between runtime-sdk and adaptive packages",
5
- "license": "Proprietary",
6
- "private": true,
7
- "type": "module",
8
- "main": "dist/index.js",
9
- "types": "dist/index.d.ts",
10
- "exports": {
11
- ".": {
12
- "types": "./dist/index.d.ts",
13
- "import": "./dist/index.js"
14
- },
15
- "./schemas": {
16
- "types": "./dist/schemas.d.ts",
17
- "import": "./dist/schemas.js"
18
- }
19
- },
20
- "files": [
21
- "dist"
22
- ],
23
- "scripts": {
24
- "build": "tsc",
25
- "typecheck": "tsc --noEmit"
26
- },
27
- "dependencies": {
28
- "zod": "^3.25.76"
29
- },
30
- "devDependencies": {
31
- "typescript": "^5.9.3"
32
- }
33
- }