@callimacus/thamyr-shopify 4.18.0 → 4.20.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.
package/CHANGELOG.core.md CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.20.0](https://github.com/callimacus/thamyr-sdk/compare/thamyr-core-v4.19.0...thamyr-core-v4.20.0) (2026-11-03)
7
+
8
+
9
+ ### Features
10
+
11
+ * **shopify:** the chat's add keeps its reply, offers the option choice, and is one runner with thamyr-react ([#881](https://github.com/callimacus/thamyr-sdk/issues/881)) ([c99096c](https://github.com/callimacus/thamyr-sdk/commit/c99096c294a44a992e7d97f0d4726102df189fb7))
12
+
13
+ ## [4.19.0](https://github.com/callimacus/thamyr-sdk/compare/thamyr-core-v4.18.0...thamyr-core-v4.19.0) (2026-11-03)
14
+
15
+
16
+ ### Features
17
+
18
+ * **core:** onWarning reports the blocks a round dropped because a content failed ([#882](https://github.com/callimacus/thamyr-sdk/issues/882)) ([1a044b3](https://github.com/callimacus/thamyr-sdk/commit/1a044b35cea13040965ad04a9ba7c919532ca816))
19
+
6
20
  ## [4.18.0](https://github.com/callimacus/thamyr-sdk/compare/thamyr-core-v4.17.3...thamyr-core-v4.18.0) (2026-11-03)
7
21
 
8
22
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.20.0](https://github.com/callimacus/thamyr-sdk/compare/thamyr-shopify-v4.19.0...thamyr-shopify-v4.20.0) (2026-11-03)
4
+
5
+
6
+ ### Features
7
+
8
+ * **shopify:** the chat's add keeps its reply, offers the option choice, and is one runner with thamyr-react ([#881](https://github.com/callimacus/thamyr-sdk/issues/881)) ([c99096c](https://github.com/callimacus/thamyr-sdk/commit/c99096c294a44a992e7d97f0d4726102df189fb7))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * devDependencies
15
+ * @callimacus/thamyr-core bumped from ^4.19.0 to ^4.20.0
16
+
17
+ ## [4.19.0](https://github.com/callimacus/thamyr-sdk/compare/thamyr-shopify-v4.18.0...thamyr-shopify-v4.19.0) (2026-11-03)
18
+
19
+
20
+ ### Miscellaneous Chores
21
+
22
+ * **thamyr-shopify:** Synchronize thamyr versions
23
+
24
+
25
+ ### Dependencies
26
+
27
+ * The following workspace dependencies were updated
28
+ * devDependencies
29
+ * @callimacus/thamyr-core bumped from ^4.18.0 to ^4.19.0
30
+
3
31
  ## [4.18.0](https://github.com/callimacus/thamyr-sdk/compare/thamyr-shopify-v4.17.3...thamyr-shopify-v4.18.0) (2026-11-03)
4
32
 
5
33
 
package/README.md CHANGED
@@ -224,7 +224,7 @@ window.callimacusRenderers.push({
224
224
 
225
225
  | Member | What |
226
226
  |---|---|
227
- | `ctx.chapter` | `{id, index, isFirst, question, done, blocks}` (`blocks` is a frozen copy of the chapter's merged blocks) |
227
+ | `ctx.chapter` | `{id, index, isFirst, question, done, blocks, addedToCart}` (`blocks` is a frozen copy of the chapter's merged blocks; `addedToCart` when the chat added to the bag in that round, so a reply that stands alone is no refusal) |
228
228
  | `ctx.final` | `ctx.chapter.done` |
229
229
  | `ctx.settings` | The global config |
230
230
  | `ctx.text(block)` | First non-empty string of `block.data` (direct or under `text`) |
@@ -234,7 +234,7 @@ window.callimacusRenderers.push({
234
234
  | `ctx.url(item)` | The storefront link under `rootUrl`: `products/<handle>`, `collections/<handle>`, `blogs/<blogHandle>/<handle>`, or a page's or policy's `meta.url`; `''` when it has none |
235
235
  | `ctx.imageUrl(hit, {width = 800, index = 0})` | Shopify CDN URL with `width`; falls back to image 0 |
236
236
  | `ctx.variantId(hit)` | Numeric id of the first orderable variant |
237
- | `ctx.addToCart(variantId, quantity = 1)` | The theme's cart where the kit knows it, else Shopify's cart API and our confirmation (see Cart). Rejects with a readable `Error` |
237
+ | `ctx.addToCart(variantId, quantity = 1)` | The theme's cart where the kit knows it, else Shopify's cart API and our confirmation (see Cart). Rejects with a readable `Error`: a `CartAddError` whose `code` is `refused` (Shopify's own words), `cart_unavailable` (no cart answered) or `failed` |
238
238
  | `ctx.ask(question)` | Continue the thread with a follow-up; queued while a round is in flight |
239
239
  | `ctx.remember(kind, value)` | Personalisation memory (`questions`, `viewed`, `added`) |
240
240
 
@@ -307,6 +307,26 @@ Cart (`src/browser/embed/kit.ts`, `src/browser/cart.ts`):
307
307
  - **Any other theme**: `POST {cart_add_url}.js`, our confirmation (`.cal-toast`, "View cart"), and
308
308
  the header's cart link redrawn from a fresh copy of its section.
309
309
 
310
+ The chat's adds to the bag (`src/browser/runtime/index.ts`, `src/browser/runtime/chat-cart.ts`):
311
+
312
+ - Every round says the theme's cart runs here (`context.shopifyCart`), so the chat may answer
313
+ "add the black one in M to my bag" with a `cart-command`. On a product page, a round about that
314
+ product also carries it as an item on screen, so "this one" can mean it; once the shopper removes
315
+ the "About" chip it does not.
316
+ - A command runs only for a Shopify variant, in this tab's story, at most once per round
317
+ (thamyr-core's cart runner, the rounds kept in sessionStorage), and at most 10 of it. It adds
318
+ through `ctx.addToCart`, so the theme's cart redraws as for a card's button.
319
+ - What it came to is a line in the chapter that asked (`.cal-cart-notice`, `role="status"`,
320
+ `data-outcome` `added`, `refused`, `unavailable` or `failed`), below the reply. A chapter whose
321
+ add ran offers no "Ask again", which would add again, and its reply is never taken for a refusal
322
+ when it stands alone. Both, and the line, are kept with the thread, so the next page shows the
323
+ round as this one did. The embed reports no add to Callimacus.
324
+ - The status line says the same for a few seconds, and `callimacus:cart` on `document` tells the theme
325
+ (`{outcome, variantId, quantity, message?}`, `message` when it was not added).
326
+ - When the chat cannot tell which variant to add, it sends the option choice
327
+ (`custom:addToCartResult`): a button per variant with all its options, sold-out ones disabled;
328
+ a tap adds that variant and shows the same line. One add runs at a time.
329
+
310
330
  ### Page surface and events
311
331
 
312
332
  `window.callimacus = {ask, thread, ctx, timings, state, storyId, reset, style, embed}`: `style` is
@@ -527,6 +527,15 @@ text-decoration: underline;
527
527
  text-underline-offset: 3px;
528
528
  cursor: pointer;
529
529
  }
530
+ :is(html,#callimacus#callimacus) .cal-cart-notice {
531
+ margin: 0;
532
+ padding-block: 8px 16px;
533
+ color: var(--cal-fg);
534
+ font-size: 14px;
535
+ }
536
+ :is(html,#callimacus#callimacus) .cal-cart-notice:not([data-outcome='added']) {
537
+ color: color-mix(in srgb, var(--cal-fg) 75%, transparent);
538
+ }
530
539
  :is(html,#callimacus#callimacus) .cal-slot {
531
540
  min-width: 0;
532
541
  }
@@ -1164,6 +1173,35 @@ gap: 16px;
1164
1173
  :is(html,#callimacus#callimacus) .cal-next__title {
1165
1174
  margin: 0;
1166
1175
  }
1176
+ :is(html,#callimacus#callimacus) .cal-choice .cal-section__inner {
1177
+ display: grid;
1178
+ justify-items: start;
1179
+ gap: 12px;
1180
+ }
1181
+ :is(html,#callimacus#callimacus) .cal-choice__title {
1182
+ margin: 0;
1183
+ }
1184
+ :is(html,#callimacus#callimacus) .cal-choice__options {
1185
+ display: flex;
1186
+ flex-wrap: wrap;
1187
+ gap: 10px;
1188
+ }
1189
+ :is(html,#callimacus#callimacus) button.cal-choice__option {
1190
+ gap: 8px;
1191
+ min-width: 0;
1192
+ max-width: 100%;
1193
+ min-height: 44px;
1194
+ padding: 10px 18px;
1195
+ font-size: 14px;
1196
+ line-height: 1.3;
1197
+ }
1198
+ :is(html,#callimacus#callimacus) .cal-choice__sold-out {
1199
+ color: color-mix(in srgb, currentcolor 70%, transparent);
1200
+ font-size: 12px;
1201
+ }
1202
+ :is(html,#callimacus#callimacus) .cal-choice__status:empty {
1203
+ display: none;
1204
+ }
1167
1205
  :is(html,#callimacus#callimacus) .cal-redirect .cal-section__inner {
1168
1206
  gap: 24px;
1169
1207
  }