@wix/web5-core 1.57.1 → 1.58.0

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 (57) hide show
  1. package/dist/cjs/client/clientBundleUrl.js +40 -0
  2. package/dist/cjs/client/clientBundleUrl.js.map +1 -0
  3. package/dist/cjs/client/mergeClientConfig.js +59 -0
  4. package/dist/cjs/client/mergeClientConfig.js.map +1 -0
  5. package/dist/cjs/component/componentDefinitions/EntityCollectionSectionDefinition.js +159 -0
  6. package/dist/cjs/component/componentDefinitions/EntityCollectionSectionDefinition.js.map +1 -0
  7. package/dist/cjs/component/componentDefinitions/index.js +7 -1
  8. package/dist/cjs/component/componentDefinitions/index.js.map +1 -1
  9. package/dist/cjs/component/componentParser.js +38 -1
  10. package/dist/cjs/component/componentParser.js.map +1 -1
  11. package/dist/cjs/components/ui/SearchSection.css +66 -9
  12. package/dist/cjs/components/ui/SearchSection.js +23 -19
  13. package/dist/cjs/components/ui/SearchSection.js.map +1 -1
  14. package/dist/cjs/hostScope.js.map +1 -1
  15. package/dist/cjs/index.js +15 -3
  16. package/dist/cjs/index.js.map +1 -1
  17. package/dist/cjs/styles/prompt-input-tokens.css +41 -34
  18. package/dist/cjs/utils/matchDebug.js +93 -0
  19. package/dist/cjs/utils/matchDebug.js.map +1 -0
  20. package/dist/esm/client/clientBundleUrl.js +36 -0
  21. package/dist/esm/client/clientBundleUrl.js.map +1 -0
  22. package/dist/esm/client/mergeClientConfig.js +55 -0
  23. package/dist/esm/client/mergeClientConfig.js.map +1 -0
  24. package/dist/esm/component/componentDefinitions/EntityCollectionSectionDefinition.js +154 -0
  25. package/dist/esm/component/componentDefinitions/EntityCollectionSectionDefinition.js.map +1 -0
  26. package/dist/esm/component/componentDefinitions/index.js +7 -1
  27. package/dist/esm/component/componentDefinitions/index.js.map +1 -1
  28. package/dist/esm/component/componentParser.js +38 -1
  29. package/dist/esm/component/componentParser.js.map +1 -1
  30. package/dist/esm/components/ui/SearchSection.css +66 -9
  31. package/dist/esm/components/ui/SearchSection.js +5 -1
  32. package/dist/esm/components/ui/SearchSection.js.map +1 -1
  33. package/dist/esm/hostScope.js.map +1 -1
  34. package/dist/esm/index.js +8 -1
  35. package/dist/esm/index.js.map +1 -1
  36. package/dist/esm/styles/prompt-input-tokens.css +41 -34
  37. package/dist/esm/utils/matchDebug.js +85 -0
  38. package/dist/esm/utils/matchDebug.js.map +1 -0
  39. package/dist/types/client/clientBundleUrl.d.ts +17 -0
  40. package/dist/types/client/clientBundleUrl.d.ts.map +1 -0
  41. package/dist/types/client/mergeClientConfig.d.ts +28 -0
  42. package/dist/types/client/mergeClientConfig.d.ts.map +1 -0
  43. package/dist/types/component/componentDefinitions/EntityCollectionSectionDefinition.d.ts +51 -0
  44. package/dist/types/component/componentDefinitions/EntityCollectionSectionDefinition.d.ts.map +1 -0
  45. package/dist/types/component/componentDefinitions/index.d.ts +1 -0
  46. package/dist/types/component/componentDefinitions/index.d.ts.map +1 -1
  47. package/dist/types/component/componentParser.d.ts.map +1 -1
  48. package/dist/types/components/ui/SearchSection.d.ts.map +1 -1
  49. package/dist/types/hostScope.d.ts +26 -0
  50. package/dist/types/hostScope.d.ts.map +1 -1
  51. package/dist/types/index.d.ts +4 -1
  52. package/dist/types/index.d.ts.map +1 -1
  53. package/dist/types/utils/matchDebug.d.ts +38 -0
  54. package/dist/types/utils/matchDebug.d.ts.map +1 -0
  55. package/package.json +2 -2
  56. package/src/components/ui/SearchSection.css +66 -9
  57. package/src/styles/prompt-input-tokens.css +41 -34
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Section-match tracing (debug-only).
3
+ *
4
+ * Turns the otherwise silent matching loop in `tryParseComponent` into a
5
+ * console trace: which definitions the active registry holds and in what
6
+ * order, which patterns were tried against a block, why each one failed, and
7
+ * when a matching definition then returned `null` from `parse()` and let the
8
+ * block fall through to the next candidate.
9
+ *
10
+ * Answers the two questions a "my section isn't rendering" report always
11
+ * splits into — *is my definition even registered?* (a missing entry in the
12
+ * registry order line usually means a stale bundle or a `web5-core` version
13
+ * skew; see the warning in `ComponentRegistry.register`) and *did it lose the
14
+ * match, or lose the parse?*
15
+ *
16
+ * Off by default. Enable with `?web5DebugMatch=1` (one-shot, wins over
17
+ * storage) or `localStorage["web5_debug_match"] = "1"` (sticky). Resolved once
18
+ * per page load — the tracing is on the hot parse path, so it must not read
19
+ * storage per block.
20
+ */
21
+ export declare const MATCH_DEBUG_KEY = "web5_debug_match";
22
+ /** Query param that forces match tracing on, overriding localStorage. */
23
+ export declare const MATCH_DEBUG_QUERY_PARAM = "web5DebugMatch";
24
+ /**
25
+ * Whether match tracing is enabled. Memoized: the parse loop calls this for
26
+ * every block of every turn.
27
+ */
28
+ export declare const isMatchDebugEnabled: () => boolean;
29
+ /** Persist the toggle and apply it to the current page without a reload. */
30
+ export declare const setMatchDebug: (enabled: boolean) => void;
31
+ /** Drop the memoized value (tests, and after an external storage change). */
32
+ export declare const resetMatchDebugCache: () => void;
33
+ /**
34
+ * Log one trace line. Callers must gate on {@link isMatchDebugEnabled} before
35
+ * building expensive messages; this only guards the write.
36
+ */
37
+ export declare const logMatchDebug: (message: string) => void;
38
+ //# sourceMappingURL=matchDebug.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matchDebug.d.ts","sourceRoot":"","sources":["../../../src/utils/matchDebug.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAElD,yEAAyE;AACzE,eAAO,MAAM,uBAAuB,mBAAmB,CAAC;AAQxD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAO,OAyBtC,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,aAAa,YAAa,OAAO,KAAG,IAWhD,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,oBAAoB,QAAO,IAEvC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,YAAa,MAAM,KAAG,IAM/C,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wix/web5-core",
3
3
  "license": "MIT",
4
- "version": "1.57.1",
4
+ "version": "1.58.0",
5
5
  "author": {
6
6
  "name": "tsachis",
7
7
  "email": "tsachis@wix.com"
@@ -100,5 +100,5 @@
100
100
  "wallaby": {
101
101
  "autoDetect": true
102
102
  },
103
- "falconPackageHash": "bd6f112ba8f9815eacc2dbd05fbf5e959ccb53f27ba03ea868d5882c"
103
+ "falconPackageHash": "13170d1c2ae66823381f08daccc041ed2f0aeb0065eaea2486efa25d"
104
104
  }
@@ -152,15 +152,20 @@
152
152
  flex-direction: column-reverse;
153
153
  }
154
154
 
155
+ /* Chips stack vertically above the pill, left-aligned to it, and share the
156
+ pill's width so the two edges line up as it expands on focus. */
155
157
  .web5-prompt-shell__chips {
156
158
  display: flex;
157
- flex-wrap: wrap;
158
- justify-content: center;
159
+ flex-direction: column;
160
+ flex-wrap: nowrap;
161
+ align-items: flex-start;
162
+ justify-content: flex-start;
159
163
  gap: var(--pi-chip-gap);
160
164
  margin: 0 auto;
161
165
  width: 100%;
162
- max-width: 835px;
166
+ max-width: var(--pi-content-max-w);
163
167
  overflow: hidden;
168
+ /* `max-width` omitted for the same reason as `.web5-prompt-search__inner`. */
164
169
  transition: transform var(--pi-transition-medium),
165
170
  opacity var(--pi-transition-medium), max-height var(--pi-transition-medium);
166
171
  pointer-events: auto;
@@ -169,10 +174,45 @@
169
174
  .web5-prompt-shell__chips--visible {
170
175
  transform: translateY(0);
171
176
  opacity: 1;
172
- max-height: 8rem;
177
+ max-height: 260px;
173
178
  overflow: visible;
174
179
  }
175
180
 
181
+ /* Each chip rises into place, the one nearest the pill first. */
182
+ @keyframes web5-prompt-chip-float-up {
183
+ from {
184
+ opacity: 0;
185
+ transform: translateY(12px);
186
+ }
187
+ to {
188
+ opacity: 1;
189
+ transform: translateY(0);
190
+ }
191
+ }
192
+
193
+ .web5-prompt-shell__chips--visible .web5-prompt-chip {
194
+ animation: web5-prompt-chip-float-up 400ms cubic-bezier(0.22, 0.61, 0.36, 1)
195
+ both;
196
+ }
197
+
198
+ .web5-prompt-shell__chips--visible .web5-prompt-chip:nth-child(1) {
199
+ animation-delay: 400ms;
200
+ }
201
+
202
+ .web5-prompt-shell__chips--visible .web5-prompt-chip:nth-child(2) {
203
+ animation-delay: 300ms;
204
+ }
205
+
206
+ .web5-prompt-shell__chips--visible .web5-prompt-chip:nth-child(n + 3) {
207
+ animation-delay: 200ms;
208
+ }
209
+
210
+ @media (prefers-reduced-motion: reduce) {
211
+ .web5-prompt-shell__chips--visible .web5-prompt-chip {
212
+ animation: none;
213
+ }
214
+ }
215
+
176
216
  .web5-prompt-shell__chips--hidden {
177
217
  transform: translateY(1rem);
178
218
  opacity: 0;
@@ -189,6 +229,7 @@
189
229
  border: 1px solid var(--pi-chip-border, transparent);
190
230
  border-radius: var(--pi-chip-radius);
191
231
  background: var(--pi-chip-bg);
232
+ backdrop-filter: blur(var(--pi-chip-blur));
192
233
  box-shadow: var(--pi-chip-shadow);
193
234
  color: var(--pi-chip-text);
194
235
  font-family: var(--pi-field-font-family);
@@ -209,7 +250,7 @@
209
250
  /* Inset ring so the focus indicator isn't clipped by the chips container's overflow: hidden */
210
251
  .web5-prompt-chip:focus-visible {
211
252
  outline: none;
212
- box-shadow: inset 0 0 0 2px rgba(128, 0, 177, 0.8), var(--pi-chip-shadow);
253
+ box-shadow: inset 0 0 0 2px var(--pi-chip-focus-ring), var(--pi-chip-shadow);
213
254
  }
214
255
 
215
256
  .web5-prompt-search {
@@ -220,12 +261,26 @@
220
261
 
221
262
  .web5-prompt-search__inner {
222
263
  position: relative;
223
- width: min(100%, var(--pi-content-max-w));
264
+ /* `width: 100%` + a plain-length `max-width`, not `width: min(100%, )`:
265
+ Chrome cannot interpolate between two min() values, which would freeze the
266
+ focus transition below at 0 progress. */
267
+ width: 100%;
268
+ max-width: var(--pi-content-max-w);
224
269
  min-width: min(100%, var(--pi-content-min-w));
225
270
  margin-inline: auto;
271
+ /* `max-width` is deliberately NOT transitioned: with a transition declared on
272
+ it, Chrome never runs the swap and the pill stays pinned at the idle width
273
+ (verified against the seed widget, which shares this rule shape). The widen
274
+ is therefore instant rather than the mock's 250ms ease. */
226
275
  pointer-events: auto;
227
276
  }
228
277
 
278
+ /* Focus widens the pill (and the chip column above it) from the idle width. */
279
+ .web5-prompt-shell--focused .web5-prompt-search__inner,
280
+ .web5-prompt-shell--focused .web5-prompt-shell__chips {
281
+ max-width: var(--pi-content-max-w-focused);
282
+ }
283
+
229
284
  .web5-prompt-field-wrap {
230
285
  position: relative;
231
286
  display: flex;
@@ -243,6 +298,7 @@
243
298
  border: var(--pi-field-border-width) solid var(--pi-field-border);
244
299
  border-radius: var(--pi-field-radius-pill);
245
300
  background: var(--pi-field-bg);
301
+ backdrop-filter: blur(var(--pi-field-blur));
246
302
  box-shadow: var(--pi-field-shadow);
247
303
  transition: min-height var(--pi-transition-medium),
248
304
  border-radius var(--pi-transition-medium),
@@ -264,7 +320,8 @@
264
320
  min-width: 0;
265
321
  min-height: var(--pi-field-line-height);
266
322
  max-height: calc(var(--pi-field-max-h) - var(--pi-field-line-height));
267
- padding: 0 56px 0 0;
323
+ /* Clear the absolutely-positioned submit button. */
324
+ padding: 0 calc(var(--pi-submit-size) + 8px) 0 0;
268
325
  border: 0;
269
326
  outline: none;
270
327
  background: transparent;
@@ -481,12 +538,12 @@
481
538
  font-size: max(16px, var(--pi-field-font-size));
482
539
  }
483
540
 
541
+ /* Keeps the chip fill: `--pi-chip-text` is light, so a transparent chip on
542
+ the white mobile panel would be unreadable. */
484
543
  .web5-prompt-chip {
485
544
  width: 100%;
486
545
  justify-content: flex-start;
487
546
  padding: 10px 18px;
488
- background: transparent;
489
- box-shadow: none;
490
547
  font-size: 16px;
491
548
  line-height: 20px;
492
549
  white-space: normal;
@@ -56,53 +56,60 @@
56
56
  );
57
57
  --pi-home-entry-panel-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
58
58
  --pi-home-entry-panel-blur: 20px;
59
- --pi-content-max-w: 651px;
59
+ /* Idle pill width; widens to `--pi-content-max-w-focused` while the field
60
+ (or a chip) holds focus. */
61
+ --pi-content-max-w: 320px;
62
+ --pi-content-max-w-focused: 550px;
60
63
  --pi-content-min-w: 250px;
61
64
  --pi-stack-gap: 15px;
62
- --pi-chip-gap: 10px;
65
+ --pi-chip-gap: 6px;
63
66
  --pi-chip-mobile-gap: 0;
64
67
  --pi-chip-mobile-overflow-y: scroll;
65
- --pi-field-min-h: 56px;
66
- --pi-field-max-h: 227px;
67
- --pi-field-border-width: 1px;
68
+ --pi-field-min-h: 48px;
69
+ --pi-field-max-h: 200px;
70
+ --pi-field-border-width: 0;
68
71
  --pi-home-entry-field-radius: 10px;
69
- --pi-field-radius-pill: 80px;
70
- --pi-field-radius-multiline: 25px;
71
- --pi-field-border: #8000b1;
72
- --pi-field-bg: #ffffff;
73
- --pi-field-padding-top: 12px;
74
- --pi-field-padding-right: 12px;
75
- --pi-field-padding-bottom: 12px;
76
- --pi-field-padding-left: 24px;
77
- --pi-field-padding-top-multiline: 20px;
72
+ --pi-field-radius-pill: 24px;
73
+ --pi-field-radius-multiline: 24px;
74
+ --pi-field-border: transparent;
75
+ --pi-field-bg: rgba(255, 255, 255, 0.9);
76
+ /* Frosted pill: the host page shows through the translucent `--pi-field-bg`. */
77
+ --pi-field-blur: 10px;
78
+ --pi-field-padding-top: 13px;
79
+ --pi-field-padding-right: 10px;
80
+ --pi-field-padding-bottom: 13px;
81
+ --pi-field-padding-left: 26px;
82
+ --pi-field-padding-top-multiline: 16px;
78
83
  --pi-field-text: #2b2b2b;
79
- --pi-field-placeholder: #52575b;
84
+ --pi-field-placeholder: #6c6f74;
80
85
  --pi-field-caret: #2b2b2b;
81
86
  --pi-field-font-family: Poppins, ui-sans-serif, sans-serif, system-ui;
82
- --pi-field-font-size: 15px;
83
- --pi-field-line-height: 32px;
84
- --pi-field-line-height-multiline: 24px;
85
- --pi-field-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
86
- 0 2px 4px -2px rgba(0, 0, 0, 0.1);
87
- --pi-chip-padding-y: 10px;
88
- --pi-chip-padding-x: 18px;
89
- --pi-chip-radius: 5px;
87
+ --pi-field-font-size: 14px;
88
+ --pi-field-line-height: 21px;
89
+ --pi-field-line-height-multiline: 21px;
90
+ --pi-field-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.05),
91
+ 0 1px 3px 0 rgba(9, 14, 21, 0.2), 0 6px 14px 0 rgba(0, 0, 0, 0.24);
92
+ --pi-chip-padding-y: 8px;
93
+ --pi-chip-padding-x: 16px;
94
+ --pi-chip-radius: 20px;
90
95
  --pi-chip-border: transparent;
91
- --pi-chip-bg: #ffffff;
92
- --pi-chip-text: #2b2b2b;
96
+ --pi-chip-bg: rgba(42, 42, 42, 0.5);
97
+ --pi-chip-text: #ffffff;
98
+ --pi-chip-blur: 100px;
93
99
  --pi-chip-font-size: 14px;
94
- --pi-chip-line-height: 14px;
95
- --pi-chip-shadow: 0 4px 6px 0 rgba(0, 0, 0, 0.1),
96
- 0 2px 4px 0 rgba(0, 0, 0, 0.1);
97
- --pi-chip-hover-bg: #f6f6f6;
100
+ --pi-chip-line-height: 20px;
101
+ --pi-chip-shadow: 0 1px 2px 0 rgba(9, 14, 21, 0.2);
102
+ --pi-chip-hover-bg: rgba(42, 42, 42, 0.58);
98
103
  --pi-chip-hover-transform: translateY(-1px);
99
- --pi-submit-size: 34px;
100
- --pi-submit-radius: 80px;
101
- --pi-submit-bg: #e5e5e5;
102
- --pi-submit-fg: #909090;
104
+ /* Chips sit on a dark translucent fill — the ring has to read light. */
105
+ --pi-chip-focus-ring: rgba(255, 255, 255, 0.9);
106
+ --pi-submit-size: 32px;
107
+ --pi-submit-radius: 999px;
108
+ --pi-submit-bg: rgba(43, 43, 43, 0.1);
109
+ --pi-submit-fg: #6c6f74;
103
110
  --pi-submit-active-bg: #2b2b2b;
104
111
  --pi-submit-active-fg: #ffffff;
105
- --pi-submit-bottom: 12px;
112
+ --pi-submit-bottom: 8px;
106
113
  --pi-submit-icon-size: 16px;
107
114
  --pi-collapsed-btn-min-h: 48px;
108
115
  --pi-collapsed-btn-padding-y: 12px;