@callimacus/thamyr-shopify 4.12.0 → 4.13.1

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.
@@ -0,0 +1,9 @@
1
+ /*!
2
+ * Copyright © 2025–2026 Solomei AI SRL. All rights reserved.
3
+ *
4
+ * Proprietary software, licensed for use by Callimacus customers only.
5
+ * See LICENSE.md for the full terms.
6
+ *
7
+ */
8
+ !function(){"use strict";const t={fg:{property:"--cal-fg",kind:"color"},bg:{property:"--cal-bg",kind:"color"},bodyFont:{property:"--cal-font-body",kind:"font"},bodyWeight:{property:"--cal-font-body-weight",kind:"keyword"},bodyStyle:{property:"--cal-font-body-style",kind:"keyword"},bodySize:{property:"--cal-body-size",kind:"length"},headingFont:{property:"--cal-font-heading",kind:"font"},headingWeight:{property:"--cal-font-heading-weight",kind:"keyword"},headingStyle:{property:"--cal-font-heading-style",kind:"keyword"},headingCase:{property:"--cal-heading-transform",kind:"keyword"},buttonBg:{property:"--cal-button-bg",kind:"color"},buttonFg:{property:"--cal-button-fg",kind:"color"},buttonBorderColor:{property:"--cal-button-border-color",kind:"color"},buttonBorderWidth:{property:"--cal-button-border-width",kind:"length"},buttonRadius:{property:"--cal-radius-button",kind:"length"},buttonCase:{property:"--cal-button-transform",kind:"keyword"},buttonSpacing:{property:"--cal-button-letter-spacing",kind:"length"},buttonFont:{property:"--cal-font-button",kind:"font"},buttonWeight:{property:"--cal-font-button-weight",kind:"keyword"},secondaryFg:{property:"--cal-button2-fg",kind:"color"},mediaRadius:{property:"--cal-radius-media",kind:"length"},cardRadius:{property:"--cal-radius-card",kind:"length"},pageWidth:{property:"--cal-page-width",kind:"length"}},o={color:/^(?:#[\da-f]{3,8}|transparent|(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color)\([\s\d%+,\-./a-z]{1,80}\))$/iu,font:/^[\p{Letter}\p{Number} "',\-_]{1,200}$/u,length:/^(?:normal|none|-?(?:\d+(?:\.\d*)?|\.\d+)(?:px|rem|em|%|ch|vw)?)$/iu,keyword:/^(?:normal|bold|bolder|lighter|italic|oblique|none|uppercase|lowercase|capitalize|[1-9]\d{0,2}|1000)$/iu};const e=/^#(?<digits>[\da-f]{3,8})$/u,n=/^rgba?\((?<channels>[^)]*)\)$/u;function r(t){const o=t.trim().toLowerCase(),r=e.exec(o)?.groups?.digits;if(void 0!==r){const t=r.length<=4?[...r].map(t=>t+t).join(""):r;if(6!==t.length&&8!==t.length)return;const o=o=>Number.parseInt(t.slice(o,o+2),16);return[o(0),o(2),o(4),8===t.length?o(6)/255:1]}const i=n.exec(o)?.groups?.channels?.split(/[\s,/]+/u).filter(t=>""!==t);if(void 0===i||i.length<3||i.length>4)return;const[a=NaN,d=NaN,u=NaN,c=1]=i.map((t,o)=>function(t,o){const e=Number(t.endsWith("%")?t.slice(0,-1):t);return t.endsWith("%")?3===o?e/100:2.55*e:e}(t,o));return[a,d,u,c].some(t=>Number.isNaN(t))?void 0:[a,d,u,c]}function i([t,o,e]){const n=t=>{const o=t/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4};return.2126*n(t)+.7152*n(o)+.0722*n(e)}function a(t,o){return(Math.max(i(t),i(o))+.05)/(Math.min(i(t),i(o))+.05)}function d(t){return null!==t.closest("[data-callimacus-ui], .cal-dock, .cal-stage, .cal-toast")}let u;function c(){return u?.isConnected||(u=document.createElement("div"),u.setAttribute("aria-hidden","true"),u.style.cssText="position:absolute;left:-9999px;top:0;width:400px;visibility:hidden;pointer-events:none;",document.body.append(u)),u}function l(t,o){const e=document.createElement("span");if(e.style.display="block",e.style[t]=o,""===e.style[t])return"";c().append(e);const n=getComputedStyle(e)[t];return e.remove(),n}function s(t){const o=t.getBoundingClientRect(),e=getComputedStyle(t);return o.width>4&&o.height>4&&"hidden"!==e.visibility&&"none"!==e.display}function b(t){return"transparent"===t||/^rgba\((?:[^),]*,){3}\s*0(?:\.0+)?\)$/u.test(t)||/\/\s*0(?:\.0+)?\)$/u.test(t)}function p(t,o=()=>!0){for(const e of t)for(const t of document.querySelectorAll(e))if(!d(t)&&s(t)&&o(t))return{node:t,selector:e}}function g(t){const o=[...t.classList].slice(0,2).map(t=>`.${t}`).join("");return`${t.tagName.toLowerCase()}${o}`}const f=/\b(?:add to (?:cart|bag|basket)|buy now|add)\b/iu,m=['form[action*="/cart/add"] button[type="submit"]','form[action*="/cart/add"] button[name="add"]','form[action*="/cart/add"] input[type="submit"]','form[action*="/cart/add"] button:not([type="button"])'],y=["main .button:not(.button--secondary):not(.button--tertiary)","main .btn:not(.btn--secondary)",'main a[class*="button"]','main button[class*="button"]',".shopify-section .button",".shopify-section .btn",'main button[type="submit"]'],h=[".shopify-payment-button__button--unbranded"],v=/secondary|outline|tertiary/iu,k=["main .button--secondary","main .btn--secondary",'main [class*="button-secondary"]'],w=["main h1","main h2","h1","h2",".h1",".h2"],C=['main a[href*="/products/"] img','a[href*="/products/"] img'],S=[".card","product-card",".product-card",'[class*="product-card"]',".grid-product",".grid-view-item",".product-item"],x=["main .page-width",".page-width","main .container","main .wrapper",".page-container .page-width","main .grid__item"],$=/banner|hero|slideshow|slider|carousel|video|image-with-text/iu;function F(t,o){const e=[];for(let n=t.parentElement;n&&e.length<o;n=n.parentElement)e.push(n);return e}function W(t){return t.matches('button, a[href], input[type="submit"], input[type="button"]')}function R(t){const o=[];let e=0,n=0;for(const[r,i]of[...t].entries())e+="("===i?1:")"===i?-1:0,","===i&&0===e&&(o.push(t.slice(n,r)),n=r+1);return o.push(t.slice(n)),o}function B(t){for(const o of["::after","::before"]){const e=R(getComputedStyle(t,o).boxShadow);for(const t of e){const e=/^(?<color>rgba?\([^)]*\))\s+0px\s+0px\s+0px\s+(?<width>[\d.]+)px$/u.exec(t.trim());if(void 0!==e?.groups?.color&&!b(e.groups.color))return{width:`${e.groups.width}px`,color:e.groups.color,how:`${o} outline`}}}}function N(t){return o=t.borderTopWidth,Number(o.replace(/px$/u,""))>0&&"none"!==t.borderTopStyle&&!b(t.borderTopColor);var o}function T(t){const o=t.getBoundingClientRect(),e=getComputedStyle(t);return o.width>=60&&o.height>=28&&!t.closest('header, nav, footer, [role="dialog"], dialog')&&(!b(e.backgroundColor)||N(e)||void 0!==B(t))}function L(t){let o=t.parentElement;for(let t=0;o&&t<8&&!o.matches("main, body");t+=1){if($.test(o.className)||"none"!==getComputedStyle(o).backgroundImage)return!0;o=o.parentElement}return!1}function E(t,o){return v.test(t.className)||getComputedStyle(t).backgroundColor===o}function z(t,o){const e=t=>o=>W(o)&&T(o)&&L(o)===t,n=p(m,e(!1))??function(){for(const t of document.querySelectorAll('main button, main a[href], main input[type="submit"]')){const o=t instanceof HTMLInputElement?t.value:t.textContent;if(f.test(o.trim())&&!d(t)&&s(t)&&T(t))return{node:t,selector:"a button labelled add to cart"}}}(),r=(n&&E(n.node,o)?p([...h,...y],t=>e(!1)(t)&&!E(t,o)):void 0)??n??p(y,e(!1))??void 0;return r?{node:r.node,how:`button ${g(r.node)}`}:void 0}function j(t,o){const e=getComputedStyle(document.body);t("fg",e.color,"body text");let n=e.backgroundColor;b(n)&&(n=getComputedStyle(document.documentElement).backgroundColor),t("bg",b(n)?"rgb(255, 255, 255)":n,b(n)?"browser default":"page background"),t("bodyFont",e.fontFamily,"body text"),t("bodyWeight",e.fontWeight,"body text"),t("bodyStyle",e.fontStyle,"body text"),t("bodySize",e.fontSize,"body text");const r=p(w,t=>""!==t.textContent.trim());if(r){const o=getComputedStyle(r.node),e=`heading ${g(r.node)}`;t("headingFont",o.fontFamily,e),t("headingWeight",o.fontWeight,e),t("headingStyle",o.fontStyle,e),t("headingCase",o.textTransform,e)}const i=z(0,b(n)?"rgb(255, 255, 255)":n);i&&function(t,o,e,n){const r=N(o),i=r||!n?void 0:B(n),a=r||void 0!==i;b(o.backgroundColor)?a&&t("buttonBg","transparent",`${e} (outline)`):t("buttonBg",o.backgroundColor,e),t("buttonFg",o.color,e),i?(t("buttonBorderColor",i.color,`${e} ${i.how}`),t("buttonBorderWidth",i.width,`${e} ${i.how}`)):(t("buttonBorderColor",r?o.borderTopColor:o.backgroundColor,e),t("buttonBorderWidth",r?o.borderTopWidth:"0px",e)),t("buttonRadius",o.borderTopLeftRadius,e),t("buttonCase",o.textTransform,e),t("buttonSpacing","normal"===o.letterSpacing?"0px":o.letterSpacing,e),t("buttonFont",o.fontFamily,e),t("buttonWeight",o.fontWeight,e)}(t,getComputedStyle(i.node),i.how,i.node);const a=p(k,t=>W(t)&&!L(t));a&&t("secondaryFg",getComputedStyle(a.node).color,`button ${g(a.node)}`);const d=p(C);if(d){const o=[d.node,...F(d.node,4)].find(t=>!["0px","0",""].includes(getComputedStyle(t).borderTopLeftRadius));t("mediaRadius",o?getComputedStyle(o).borderTopLeftRadius:"0px",o?`product image ${g(o)}`:`product image ${g(d.node)} (square)`)}const u=p(S);u&&t("cardRadius",getComputedStyle(u.node).borderTopLeftRadius,`card ${g(u.node)}`);const c=p(x,t=>"none"!==getComputedStyle(t).maxWidth&&t.getBoundingClientRect().width>300);c&&t("pageWidth",getComputedStyle(c.node).maxWidth,`content width ${g(c.node)}`)}const _=[{name:"Dawn",marker:"--font-body-family",read:{fg:"rgb(var(--color-foreground, var(--color-base-text)))",bg:"rgb(var(--color-background, var(--color-base-background-1)))",bodyFont:"var(--font-body-family)",headingFont:"var(--font-heading-family)",buttonBg:"rgb(var(--color-button, var(--color-base-accent-1)))",buttonFg:"rgb(var(--color-button-text, var(--color-base-solid-button-labels)))",buttonRadius:"var(--buttons-radius)",mediaRadius:"var(--media-radius)",cardRadius:"var(--product-card-corner-radius)",pageWidth:"var(--page-width)"}},{name:"Horizon",marker:"--font-body--family",read:{fg:"var(--color-foreground)",bg:"var(--color-background)",bodyFont:"var(--font-body--family)",headingFont:"var(--font-heading--family)",buttonRadius:"var(--style-border-radius-buttons-primary)"}}];function q(o,e){const{kind:n}=t[o];return l("color"===n?"color":"length"===n?"pageWidth"===o?"width":"borderTopLeftRadius":"fontFamily",e)}function A(e){const n={},r=(e,r,i)=>{const a=r.trim();!(""===a||!("buttonBg"===e&&"transparent"===a)&&"color"===t[e].kind&&b(a))&&void 0===n[e]&&function(t,e){return e.length<=200&&o[t].test(e.trim())}(t[e].kind,a)&&(n[e]={value:a,how:i})};return j(r),function(t){const o=getComputedStyle(document.documentElement),e=_.find(t=>""!==o.getPropertyValue(t.marker).trim());for(const[o,n]of Object.entries(e?.read??{}))t(o,q(o,n),`${e?.name??""} variable ${n}`)}(r),c().remove(),n}function I(t){return function(t){const o=void 0===t.bg?void 0:r(t.bg),e=void 0===t.buttonBg?void 0:r(t.buttonBg),n=void 0!==e&&e[3]>.5?e:o,i=void 0===t.buttonFg?void 0:r(t.buttonFg);if(void 0===n||void 0===i)return t;const d=a(i,n);if(d>=3)return t;let u;for(const o of[t.fg,t.bg]){const t=void 0===o?void 0:r(o),e=void 0===t?0:a(t,n);void 0!==o&&e>(u?.ratio??d)&&(u={value:o,ratio:e})}return void 0===u?t:{...t,buttonFg:u.value}}(function(t){return Object.fromEntries(Object.entries(t).map(([t,o])=>[t,o.value]))}(t))}Reflect.set(globalThis,"callimacusReadLook",()=>I(A()))}();
9
+ //# sourceMappingURL=look-reader.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"look-reader.min.js","sources":["../../../src/look.ts","../../../src/browser/runtime/util.ts","../../../src/browser/embed/style.ts","../../../src/browser/look-reader.ts"],"sourcesContent":[null,null,null,null],"names":["LOOK_TOKENS","fg","property","kind","bg","bodyFont","bodyWeight","bodyStyle","bodySize","headingFont","headingWeight","headingStyle","headingCase","buttonBg","buttonFg","buttonBorderColor","buttonBorderWidth","buttonRadius","buttonCase","buttonSpacing","buttonFont","buttonWeight","secondaryFg","mediaRadius","cardRadius","pageWidth","PATTERNS","color","font","length","keyword","HEX","RGB","parseColor","value","trim","toLowerCase","hex","exec","groups","digits","undefined","full","map","digit","join","channel","index","Number","parseInt","slice","parts","channels","split","filter","part","r","NaN","g","b","a","number","endsWith","channelOf","some","isNaN","luminance","linear","contrast","Math","max","min","isOurs","node","closest","probeHost","host","isConnected","document","createElement","setAttribute","style","cssText","body","append","computed","probe","display","result","getComputedStyle","remove","isVisible","box","getBoundingClientRect","width","height","visibility","isTransparent","test","firstVisible","selectors","isWanted","selector","querySelectorAll","describe","classes","classList","name","tagName","ADD_TO_CART","PRODUCT_BUTTONS","BUTTONS","PRIMARY_BUTTONS","SECONDARY","SECONDARY_BUTTONS","HEADINGS","CARD_IMAGES","CARDS","WIDTHS","HERO","ancestorsOf","count","ancestors","current","parentElement","push","isRealButton","matches","layersOf","layers","depth","start","char","entries","pseudoOutline","pseudo","shadows","boxShadow","shadow","match","how","hasBorder","borderTopWidth","replace","borderTopStyle","borderTopColor","isButtonShaped","backgroundColor","isHero","className","backgroundImage","isSecondary","pageBackground","mainButton","page","wanted","isHeroWanted","cartButton","label","HTMLInputElement","textContent","byText","found","measureElements","set","background","documentElement","fontFamily","fontWeight","fontStyle","fontSize","heading","textTransform","button","isBorder","isOutlined","borderTopLeftRadius","letterSpacing","readButton","secondary","image","rounded","find","includes","card","maxWidth","VARIABLE_FAMILIES","marker","read","readVariable","token","expression","measure","out","trimmed","isLookValue","root","family","candidate","getPropertyValue","Object","measureVariables","lookOfReadings","readings","look","ownFill","fill","text","best","rgba","ratio","guardLook","fromEntries","reading","valuesOf","Reflect","globalThis"],"mappings":";;;;;;;yBAcO,MAAMA,EAAc,CAC1BC,GAAI,CAACC,SAAU,WAAYC,KAAM,SACjCC,GAAI,CAACF,SAAU,WAAYC,KAAM,SACjCE,SAAU,CAACH,SAAU,kBAAmBC,KAAM,QAC9CG,WAAY,CAACJ,SAAU,yBAA0BC,KAAM,WACvDI,UAAW,CAACL,SAAU,wBAAyBC,KAAM,WACrDK,SAAU,CAACN,SAAU,kBAAmBC,KAAM,UAC9CM,YAAa,CAACP,SAAU,qBAAsBC,KAAM,QACpDO,cAAe,CAACR,SAAU,4BAA6BC,KAAM,WAC7DQ,aAAc,CAACT,SAAU,2BAA4BC,KAAM,WAC3DS,YAAa,CAACV,S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prietary software, licensed for use by Callimacus customers only.
5
+ * See LICENSE.md for the full terms.
6
+ *
7
+ */
8
+ const e="4.13.1",t={fg:{property:"--cal-fg",kind:"color"},bg:{property:"--cal-bg",kind:"color"},bodyFont:{property:"--cal-font-body",kind:"font"},bodyWeight:{property:"--cal-font-body-weight",kind:"keyword"},bodyStyle:{property:"--cal-font-body-style",kind:"keyword"},bodySize:{property:"--cal-body-size",kind:"length"},headingFont:{property:"--cal-font-heading",kind:"font"},headingWeight:{property:"--cal-font-heading-weight",kind:"keyword"},headingStyle:{property:"--cal-font-heading-style",kind:"keyword"},headingCase:{property:"--cal-heading-transform",kind:"keyword"},buttonBg:{property:"--cal-button-bg",kind:"color"},buttonFg:{property:"--cal-button-fg",kind:"color"},buttonBorderColor:{property:"--cal-button-border-color",kind:"color"},buttonBorderWidth:{property:"--cal-button-border-width",kind:"length"},buttonRadius:{property:"--cal-radius-button",kind:"length"},buttonCase:{property:"--cal-button-transform",kind:"keyword"},buttonSpacing:{property:"--cal-button-letter-spacing",kind:"length"},buttonFont:{property:"--cal-font-button",kind:"font"},buttonWeight:{property:"--cal-font-button-weight",kind:"keyword"},secondaryFg:{property:"--cal-button2-fg",kind:"color"},mediaRadius:{property:"--cal-radius-media",kind:"length"},cardRadius:{property:"--cal-radius-card",kind:"length"},pageWidth:{property:"--cal-page-width",kind:"length"}},o={color:/^(?:#[\da-f]{3,8}|transparent|(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color)\([\s\d%+,\-./a-z]{1,80}\))$/iu,font:/^[\p{Letter}\p{Number} "',\-_]{1,200}$/u,length:/^(?:normal|none|-?(?:\d+(?:\.\d*)?|\.\d+)(?:px|rem|em|%|ch|vw)?)$/iu,keyword:/^(?:normal|bold|bolder|lighter|italic|oblique|none|uppercase|lowercase|capitalize|[1-9]\d{0,2}|1000)$/iu};function n(e,t){return t.length<=200&&o[e].test(t.trim())}function s(e){return Object.hasOwn(t,e)}function r(e){if("object"!=typeof e||null===e||Array.isArray(e))return;const o={};for(const[r,a]of Object.entries(e)){if("string"!=typeof a||!s(r)||!n(t[r].kind,a))return;o[r]=a.trim()}return o}function a(e){return Object.entries(e).filter(e=>s(e[0])&&"string"==typeof e[1]).map(([e,o])=>`${t[e].property}:${o}`).join(";")}const i=/^#(?<digits>[\da-f]{3,8})$/u,p=/^rgba?\((?<channels>[^)]*)\)$/u;function d(e){const t=e.trim().toLowerCase(),o=i.exec(t)?.groups?.digits;if(void 0!==o){const e=o.length<=4?[...o].map(e=>e+e).join(""):o;if(6!==e.length&&8!==e.length)return;const t=t=>Number.parseInt(e.slice(t,t+2),16);return[t(0),t(2),t(4),8===e.length?t(6)/255:1]}const n=p.exec(t)?.groups?.channels?.split(/[\s,/]+/u).filter(e=>""!==e);if(void 0===n||n.length<3||n.length>4)return;const[s=NaN,r=NaN,a=NaN,d=1]=n.map((e,t)=>function(e,t){const o=Number(e.endsWith("%")?e.slice(0,-1):e);return e.endsWith("%")?3===t?o/100:2.55*o:o}(e,t));return[s,r,a,d].some(e=>Number.isNaN(e))?void 0:[s,r,a,d]}function h([e,t,o]){const n=e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return.2126*n(e)+.7152*n(t)+.0722*n(o)}function c(e,t){return(Math.max(h(e),h(t))+.05)/(Math.min(h(e),h(t))+.05)}function l(e){const t=void 0===e.bg?void 0:d(e.bg),o=void 0===e.buttonBg?void 0:d(e.buttonBg),n=void 0!==o&&o[3]>.5?o:t,s=void 0===e.buttonFg?void 0:d(e.buttonFg);if(void 0===n||void 0===s)return e;const r=c(s,n);if(r>=3)return e;let a;for(const t of[e.fg,e.bg]){const e=void 0===t?void 0:d(t),o=void 0===e?0:c(e,n);void 0!==t&&o>(a?.ratio??r)&&(a={value:t,ratio:o})}return void 0===a?e:{...e,buttonFg:a.value}}const u="product_browse",m=[{label:"solve_problem",description:"Describes a problem to solve or a situation to handle, rather than a kind of product: something that bothers them, a need to meet, an occasion to prepare for",examples:["my skin gets dry in winter","I am always cold at my desk","my feet hurt after a long day","how do I keep my kitchen tidy","what do I need for a first camping trip","my old one keeps breaking"]},{label:"material_info",description:"Asks what one material, ingredient or technology is, how it works or how it feels",examples:["what is merino wool?","how does this waterproof membrane work","is linen soft","what is hyaluronic acid","what does recycled polyester feel like","is stainless steel better than aluminium"]},{label:"size_or_care",description:"Asks about sizes, fit, dimensions, washing or care of a product",examples:["which size should I get?","do these run small?","how do I wash it?","what are the dimensions","can it go in the dishwasher","will it fit in a carry-on"]},{label:"compare_items",description:"Asks to compare two named products or ranges side by side, or which of two is better",examples:["which is better, the classic or the pro?","difference between the two jackets","linen vs cotton","the small one or the large one?","which is warmer, the wool or the down"]},{label:"store_info",description:"Asks about the store itself rather than its products: shipping and delivery, returns and exchanges, payment, privacy, terms, how to get in touch, or who is behind the store",examples:["what is your return policy?","how long does shipping take","do you ship abroad","can I exchange a gift","how do I contact you","who is behind the brand"]},{label:"inspiration",description:"Wants ideas or something to read rather than a product: tips, how-tos, styling or usage ideas, stories from the store's journal or blog",examples:["any tips for layering in winter","how should I style a linen shirt","ideas for a cosy bedroom","do you have a blog","how are your products made","what is in season right now"]},{label:u,description:"Looks for a kind of product, a style, a colour or a gift, with no problem to solve, material question, comparison or question about the store",examples:["show me what is new","I need a new bag","something in green","a gift for my mom","your best sellers","something for the weekend"]}],y=Object.freeze(m.map(e=>e.label));function f(e={}){return{category:"need",categoryDescription:"What kind of help the shopper needs: a problem to solve, what a material is, sizes or care, a comparison of two products, the store's own pages and policies, ideas to read, or simply looking for a kind of product",labels:m.map(t=>{const o=e[t.label];return{...t,examples:o&&o.length>0?[...o]:[...t.examples]}})}}const w={type:"not",value:{type:"receptorIs",value:"store_info"}};function g(e){return JSON.stringify(e)}const k={type:"string"};function b(e){return{type:"object",properties:e,required:Object.keys(e),additionalProperties:!1}}function v(e,t,o,n){return{specVersion:2,block:{type:e,data:t},contents:o,when:n,order:0}}function x(e){return[`You turn a shopper's message into a short product search query for ${e.name}, a store that sells ${e.catalogue}.`,"Output 1 to 4 lowercase words: the kind of product, the material or technology if one is named, and at most one size, colour or quality",'(examples: "linen shirt", "wool blanket queen", "black leather bag", "waterproof jacket").','When the message follows up on the chat history ("which of those", "in black", "cheaper ones", "for my partner"),',"keep the product type or material the earlier messages were about and add the new detail:",'after "what is merino?", "which of those come in navy?" becomes "merino navy".',"When the shopper describes a need or a problem without naming a kind of product, keep the query broad instead of guessing one product type:",'"I am always cold" becomes "warm layers", "something to relax in at home" becomes "loungewear".',"Output only the query, with no punctuation."].join(" ")}function q(e){return[`You turn a shopper's message into a short search query for the pages, policies and journal articles of ${e.name}, a store that sells ${e.catalogue}.`,'Output 1 to 5 lowercase words naming the topic (examples: "return policy", "shipping times abroad", "contact", "layering for winter", "linen care").','When the message follows up on the chat history ("and for sale items?", "how long does that take?"),',"keep the topic the earlier messages were about and add the new detail.","Output only the query, with no punctuation."].join(" ")}function j(e){return{id:"query",kind:"text",useDemosthenesTone:!1,output:{kind:"text"},template:"{{input.value}}",systemPrompt:e,useKb:!1}}function $(e){return{key:"editorialHero",name:"Storefront spread",prompt:"The editorial opening of the composed page: an eyebrow, a headline and a one-line dek over a photo of the best-matching product.",description:"An editorial opening for the page.",node:v("editorialHero",{query:"",lead:[],copy:{eyebrow:"",headline:"",dek:""}},[j(x(e)),{id:"lead",kind:"skesis",min:0,take:1,kinds:["product"],template:"{{content.query}}"},{id:"copy",kind:"text",useKb:!0,useDemosthenesTone:!0,systemPrompt:[`You write the opening of an editorial page that ${e.name}, a store for ${e.catalogue}, composes for one shopper's question.`,'Return: eyebrow, 2 to 4 words naming the topic (for example "Staying warm");',`headline, at most 8 words, speaking to the shopper's need in ${e.name}'s calm, confident voice, with no product names, no question mark and no exclamation mark;`,"dek, one sentence of at most 22 words saying what the page gathers for them.","Write the eyebrow and headline in sentence case (capitalise only the first word and proper names). Use only facts from the context."].join(" "),template:'The shopper said: "{{input.value}}"',output:{kind:"json",schemaJson:g(b({eyebrow:k,headline:k,dek:k}))}}],w)}}function I(e){return{key:"storefrontReply",name:"Storefront reply",prompt:"The written answer to whatever the shopper asked, two to four short sentences in the store's voice, streamed as it is written. Useful on every question.",description:"The answer, written out.",node:v("storefrontReply",{text:""},[{id:"text",kind:"demosthenes",streaming:!0,template:[`Answer the shopper in two to four short sentences, in ${e.name}'s voice, from what ${e.name} sells and what the knowledge base says.`,"If this follows up on an earlier question, build on that conversation instead of starting over.","Point to the one thing worth looking at first. The shopper said: {{input.value}}"].join(" ")}],{type:"always"})}}function S(e){return{key:"storefrontPicks",name:"Storefront selection",prompt:["Products from the catalogue that fit what the shopper asked for, found with a short product query derived from the message and the conversation.","Use on every question that could be answered with products."].join(" "),description:"Products that match the request.",node:v("storefrontPicks",{query:"",picks:[]},[j(x(e)),{id:"picks",kind:"skesis",min:1,take:8,kinds:["product"],template:"{{content.query}}"}],w)}}function T(e){return{key:"collectionGrid",name:"Storefront selection collections",prompt:[`The collections of ${e.name} that fit what the shopper is looking for, each a tile that opens the collection.`,"Use on questions that browse for a kind of product, a style, an occasion or ideas."].join(" "),description:"Collections that match the request.",node:v("collectionGrid",{query:"",collections:[]},[j(x(e)),{id:"collections",kind:"skesis",min:1,take:4,kinds:["collection"],template:"{{content.query}}"}],{type:"receptorAny",value:[u,"inspiration"]})}}function z(e){return{key:"storyCards",name:"Storefront topic stories",prompt:`Articles from ${e.name}'s journal that help with what the shopper asked (guides, ideas, stories), each a card that opens the article.`,description:"Articles from the store's journal.",node:v("storyCards",{query:"",stories:[]},[j(q(e)),{id:"stories",kind:"skesis",min:1,take:3,kinds:["article"],template:"{{content.query}}"}],{type:"receptorAny",value:["inspiration","solve_problem"]})}}function A(e){return{key:"pageAnswer",name:"Storefront reply from store pages",prompt:[`What ${e.name}'s own pages and policies say on the shopper's question (shipping, returns, payment, privacy, contact, the store itself),`,"in the store's own words, with a link to the page."].join(" "),description:"The store's own page or policy on the question.",node:v("pageAnswer",{query:"",pages:[]},[j(q(e)),{id:"pages",kind:"documents",type:"text",filter:!1,knowledgeScope:"excludeInternal",min:1,take:3,template:"{{content.query}}"}],{type:"receptorIs",value:"store_info"})}}function W(e){const t=b({title:k,body:k,shopFor:k});return{key:"problemGuide",name:"Storefront topic solve a problem",prompt:`A step-by-step guide for a problem the shopper wants to solve, each step tied to the kind of ${e.name} product that helps.`,description:"A guide to solving the shopper's problem.",node:v("problemGuide",{guide:{title:"",steps:[]}},[{id:"guide",kind:"text",useKb:!0,useDemosthenesTone:!0,systemPrompt:[`You write a short, practical guide for a ${e.name} shopper who has a problem to solve, using only ${e.name}'s products and the facts in the context.`,"Return a title of at most 7 words and 3 or 4 steps in the order the shopper should take them.","Each step has: title (at most 5 words);",`body (one or two sentences, at most 35 words, naming the ${e.name} product or technology that helps and why);`,"shopFor (a 1 to 3 word product search query for that step).","Give no medical, legal or safety advice."].join(" "),template:'The shopper said: "{{input.value}}"',output:{kind:"json",schemaJson:g(b({title:k,steps:{type:"array",items:t,minItems:3,maxItems:4}}))}}],{type:"receptorIs",value:"solve_problem"})}}function P(e){return{key:"materialStory",name:"Storefront topic material",prompt:`Explains one material, ingredient or technology that ${e.name}'s products use, with three facts and the products made of it.`,description:"What a material is and the products made of it.",node:v("materialStory",{story:{material:"",headline:"",body:"",facts:[]},products:[]},[{id:"story",kind:"text",useKb:!0,useDemosthenesTone:!0,systemPrompt:[`You explain one material, ingredient or technology that ${e.name} uses, for a shopper who asked about it, using only the facts in the context.`,`Return: material (its name as ${e.name}'s products use it, 1 to 4 words); headline (at most 8 words on how it feels or what it does, no question mark);`,"body (2 or 3 sentences, at most 60 words: what it is, how it works, how it feels);",`facts (exactly 3 short facts of at most 12 words each, such as which ${e.name} products use it).`,"If the shopper mentions several, choose the one they ask about first."].join(" "),template:'The shopper said: "{{input.value}}"',output:{kind:"json",schemaJson:g(b({material:k,headline:k,body:k,facts:{type:"array",items:k,minItems:3,maxItems:3}}))}},{id:"products",kind:"skesis",min:0,take:3,kinds:["product"],template:"{{content.story.material}}"}],{type:"receptorIs",value:"material_info"})}}function _(e){return{key:"sizeCare",name:"Storefront topic size and care",prompt:"Questions and answers on sizes, fit, dimensions, washing and care.",description:"Answers about sizes, fit and care.",node:v("sizeCare",{faq:[]},[{id:"faq",kind:"text",useKb:!0,useDemosthenesTone:!0,systemPrompt:[`You answer a ${e.name} shopper's question about sizes, fit or care as a short set of questions and answers, using only the facts in the context.`,"Return 3 to 5 items. The first answers exactly what the shopper asked; the others answer the next questions they are likely to have.","Each answer is concrete and at most 40 words (dimensions, which size to pick, what the product or its care label says).","When the context does not say, tell them to check the care label or the size details on the product page; never invent care instructions."].join(" "),template:'The shopper said: "{{input.value}}"',output:{kind:"json",schemaJson:g({type:"array",items:b({question:k,answer:k}),minItems:3,maxItems:5})}}],{type:"receptorIs",value:"size_or_care"})}}function F(e){const t=b({aspect:k,first:k,second:k});return{key:"compareSet",name:"Storefront topic compare",prompt:"Two named products or ranges side by side, with the differences that matter and who each one suits.",description:"A side-by-side comparison of two products.",node:v("compareSet",{pair:{first:"",second:""},first:[],second:[],verdict:{summary:"",rows:[]}},[{id:"pair",kind:"text",useKb:!1,useDemosthenesTone:!1,systemPrompt:[`The shopper wants to compare two ${e.name} products or ranges.`,"Return the two things being compared as short product search queries of 2 to 5 lowercase words each,",'using the product names the shopper or the conversation used (for example "classic wool coat" and "lightweight down coat").'].join(" "),template:"{{input.value}}",output:{kind:"json",schemaJson:g(b({first:k,second:k}))}},{id:"first",kind:"skesis",min:0,take:1,kinds:["product"],template:"{{content.pair.first}}"},{id:"second",kind:"skesis",min:0,take:1,kinds:["product"],template:"{{content.pair.second}}"},{id:"verdict",kind:"text",useKb:!0,useDemosthenesTone:!0,systemPrompt:[`You compare two ${e.name} products for a shopper, using only the facts in the context and the two retrieved products.`,"Return: summary (one or two sentences, at most 40 words, saying who each one suits);",'rows (3 to 5 rows, each with aspect, 1 to 3 words such as "Feel", "Weight", "Fit", "Price", "Sizes", and a short value for first and for second, at most 10 words each).',"Mention no product other than the two."].join(" "),template:'The shopper said: "{{input.value}}". First: {{content.pair.first}} (retrieved: {{content.first}}). Second: {{content.pair.second}} (retrieved: {{content.second}}).',output:{kind:"json",schemaJson:g(b({summary:k,rows:{type:"array",items:t,minItems:3,maxItems:5}}))}}],{type:"receptorIs",value:"compare_items"})}}function N(e){return{key:"completeSet",name:"Storefront tier two complete the set",prompt:"Complete the set: three companion products from other product types that go with what the shopper is looking for, each with a one-line reason.",description:"Companion products that complete the look.",node:v("completeSet",{companions:[]},[{id:"companions",kind:"text",useKb:!1,useDemosthenesTone:!0,systemPrompt:[`You suggest companion products from ${e.name} that complete what the shopper is looking for, the way a stylist completes a look.`,"Return exactly 3 items, each from a different product type than the one the shopper asked for.","Each item has: query (a 1 to 3 word product search query); why (at most 12 words on why it goes with what they asked for).",`Use only product types ${e.name} sells: ${e.catalogue}.`].join(" "),template:'The shopper said: "{{input.value}}"',output:{kind:"json",schemaJson:g({type:"array",items:b({query:k,why:k}),minItems:3,maxItems:3})}},{id:"companionHits",kind:"skesis",min:0,take:1,kinds:["product"],template:"{{item.query}}",each:{fromId:"companions",arrayPath:"companions",assignField:"product",pick:"first",extend:!1}}],{type:"receptorAny",value:[u,"solve_problem"]})}}function C(e){return{key:"followUps",name:"Storefront tier two follow ups",prompt:"Three self-contained next questions the shopper can tap to continue the conversation.",description:"Suggested next questions.",node:v("followUps",{next:[]},[{id:"next",kind:"text",useKb:!0,useDemosthenesTone:!1,systemPrompt:[`You suggest the three most useful next questions a ${e.name} shopper could ask after this one, written in the shopper's own voice.`,'Each item has: label (2 to 5 words for a button, for example "Warmer options");',"question (a complete question of at most 14 words that names the product or topic, so it makes sense on its own,",'for example "Which jackets are warm enough for winter?").',"Cover different directions: go deeper, a related product, a practical detail such as size or care.",`Ask only about what ${e.name} sells (${e.catalogue}) and the materials and brands in the context. Never mention anything else.`].join(" "),template:'The shopper said: "{{input.value}}"',output:{kind:"json",schemaJson:g({type:"array",items:b({label:k,question:k}),minItems:3,maxItems:3})}}],{type:"always"})}}function R(e){return[I(e),A(e),S(e),T(e),$(e),N(e),C(e),F(e),P(e),_(e),W(e),z(e)]}export{t as LOOK_TOKENS,u as NEED_DEFAULT_LABEL,y as NEED_LABELS,e as PACKAGE_VERSION,R as blockSpecs,l as guardLook,n as isLookValue,a as lookCss,f as needCategory,r as parseLook};
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/version.ts","../../../src/look.ts","../../../src/setup/receptor.ts","../../../src/setup/blocks.ts"],"sourcesContent":[null,null,null,null],"names":["PACKAGE_VERSION","LOOK_TOKENS","fg","property","kind","bg","bodyFont","bodyWeight","bodyStyle","bodySize","headingFont","headingWeight","headingStyle","headingCase","buttonBg","buttonFg","buttonBorderColor","buttonBorderWidth","buttonRadius","buttonCase","buttonSpacing","buttonFont","buttonWeight","secondaryFg","mediaRadius","cardRadius","pageWidth","PATTERNS","color","font","length","keyword","isLookValue","value","test","trim","isLookToken","name","Object","hasOwn","parseLook","Array","isArray","look","raw","entries","lookCss","filter","entry","map","join","HEX","RGB","parseColor","toLowerCase","hex","exec","groups","digits","undefined","full","digit","channel","index","Number","parseInt","slice","parts","channels","split","part","r","NaN","g","b","a","number","endsWith","channelOf","some","isNaN","luminance","linear","contrast","Math","max","min","guardLook","page","ownFill","fill","text","current","best","rgba","ratio","NEED_DEFAULT_LABEL","DEFAULT_LABELS","label","description","examples","NEED_LABELS","freeze","needCategory","category","categoryDescription","labels","override","notStoreInfo","type","schema","JSON","stringify","stringField","objectOf","properties","required","keys","additionalProperties","block","data","contents","when","specVersion","order","queryPrompt","store","catalogue","readingQueryPrompt","queryContent","systemPrompt","id","useDemosthenesTone","output","template","useKb","editorialHero","key","prompt","node","query","lead","copy","eyebrow","headline","dek","take","kinds","schemaJson","storefrontReply","streaming","storefrontPicks","picks","collectionGrid","collections","storyCards","stories","pageAnswer","pages","knowledgeScope","problemGuide","step","title","body","shopFor","guide","steps","items","minItems","maxItems","materialStory","story","material","facts","products","sizeCare","faq","question","answer","compareSet","row","aspect","first","second","pair","verdict","summary","rows","completeSet","companions","why","each","fromId","arrayPath","assignField","pick","extend","followUps","next","blockSpecs"],"mappings":";;;;;;;AAKO,MAAMA,EAAkB,SCSlBC,EAAc,CAC1BC,GAAI,CAACC,SAAU,WAAYC,KAAM,SACjCC,GAAI,CAACF,SAAU,WAAYC,KAAM,SACjCE,SAAU,CAACH,SAAU,kBAAmBC,KAAM,QAC9CG,WAAY,CAACJ,SAAU,yBAA0BC,KAAM,WACvDI,UAAW,CAACL,SAAU,wBAAyBC,KAAM,WACrDK,SAAU,CAACN,SAAU,kBAAmBC,KAAM,UAC9CM,YAAa,CAACP,SAAU,qBAAsBC,KAAM,QACpDO,cAAe,CAACR,SAAU,4BAA6BC,KAAM,WAC7DQ,aAAc,CAACT,SAAU,2BAA4BC,KAAM,WAC3DS,YAAa,CAACV,SAAU,0BAA2BC,KAAM,WACzDU,SAAU,CAACX,SAAU,kBAAmBC,KAAM,SAC9CW,SAAU,CAACZ,SAAU,kBAAmBC,KAAM,SAC9CY,kBAAmB,CAACb,SAAU,4BAA6BC,KAAM,SACjEa,kBAAmB,CAACd,SAAU,4BAA6BC,KAAM,UACjEc,aAAc,CAACf,SAAU,sBAAuBC,KAAM,UACtDe,WAAY,CAAChB,SAAU,yBAA0BC,KAAM,WACvDgB,cAAe,CAACjB,SAAU,8BAA+BC,KAAM,UAC/DiB,WAAY,CAAClB,SAAU,oBAAqBC,KAAM,QAClDkB,aAAc,CAACnB,SAAU,2BAA4BC,KAAM,WAC3DmB,YAAa,CAACpB,SAAU,mBAAoBC,KAAM,SAClDoB,YAAa,CAACrB,SAAU,qBAAsBC,KAAM,UACpDqB,WAAY,CAACtB,SAAU,oBAAqBC,KAAM,UAClDsB,UAAW,CAACvB,SAAU,mBAAoBC,KAAM,WAoB3CuB,EAAqC,CAC1CC,MARa,4GASbC,KAJY,0CAKZC,OATc,sEAUdC,QARe,2GAcV,SAAUC,EAAY5B,EAAgB6B,GAC3C,OAAOA,EAAMH,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1B,MAAO,CACNuB,EAAgBvB,GAChB+B,EAAW/B,GACXyB,EAAgBzB,GAChB2B,EAAe3B,GACfU,EAAcV,GACd8D,EAAY9D,GACZuE,EAAUvE,GACVqD,EAAWrD,GACX4C,EAAc5C,GACdiD,EAASjD,GACTkC,EAAalC,GACb6B,EAAW7B,GAEb"}
@@ -0,0 +1,211 @@
1
+ /*!
2
+ * Copyright © 2025–2026 Solomei AI SRL. All rights reserved.
3
+ *
4
+ * Proprietary software, licensed for use by Callimacus customers only.
5
+ * See LICENSE.md for the full terms.
6
+ *
7
+ */
8
+ /**
9
+ This package's version, from package.json. The build (rollup.config.js) and
10
+ the tests (vitest.config.ts) write it over the placeholder below, so the two
11
+ can never drift.
12
+ */
13
+ declare const PACKAGE_VERSION = "__PACKAGE_VERSION__";
14
+
15
+ /**
16
+ The theme's look as the storefront reads it from the page: about twenty
17
+ values (colours, fonts, lengths, keywords), each becoming a `--cal-*` custom
18
+ property on the page that every Callimacus stylesheet reads.
19
+
20
+ The browser reads a look on a product page and posts it to Callimacus, which
21
+ keeps it per theme and hands it to every later page. Both sides use this
22
+ list: the browser to name and apply the values, core to accept a posted look
23
+ only when every value is a plain colour, length, keyword or font name, so a
24
+ stored look can never carry anything else into a page.
25
+ */
26
+ type LookKind = 'color' | 'font' | 'length' | 'keyword';
27
+ declare const LOOK_TOKENS: {
28
+ readonly fg: {
29
+ readonly property: "--cal-fg";
30
+ readonly kind: "color";
31
+ };
32
+ readonly bg: {
33
+ readonly property: "--cal-bg";
34
+ readonly kind: "color";
35
+ };
36
+ readonly bodyFont: {
37
+ readonly property: "--cal-font-body";
38
+ readonly kind: "font";
39
+ };
40
+ readonly bodyWeight: {
41
+ readonly property: "--cal-font-body-weight";
42
+ readonly kind: "keyword";
43
+ };
44
+ readonly bodyStyle: {
45
+ readonly property: "--cal-font-body-style";
46
+ readonly kind: "keyword";
47
+ };
48
+ readonly bodySize: {
49
+ readonly property: "--cal-body-size";
50
+ readonly kind: "length";
51
+ };
52
+ readonly headingFont: {
53
+ readonly property: "--cal-font-heading";
54
+ readonly kind: "font";
55
+ };
56
+ readonly headingWeight: {
57
+ readonly property: "--cal-font-heading-weight";
58
+ readonly kind: "keyword";
59
+ };
60
+ readonly headingStyle: {
61
+ readonly property: "--cal-font-heading-style";
62
+ readonly kind: "keyword";
63
+ };
64
+ readonly headingCase: {
65
+ readonly property: "--cal-heading-transform";
66
+ readonly kind: "keyword";
67
+ };
68
+ readonly buttonBg: {
69
+ readonly property: "--cal-button-bg";
70
+ readonly kind: "color";
71
+ };
72
+ readonly buttonFg: {
73
+ readonly property: "--cal-button-fg";
74
+ readonly kind: "color";
75
+ };
76
+ readonly buttonBorderColor: {
77
+ readonly property: "--cal-button-border-color";
78
+ readonly kind: "color";
79
+ };
80
+ readonly buttonBorderWidth: {
81
+ readonly property: "--cal-button-border-width";
82
+ readonly kind: "length";
83
+ };
84
+ readonly buttonRadius: {
85
+ readonly property: "--cal-radius-button";
86
+ readonly kind: "length";
87
+ };
88
+ readonly buttonCase: {
89
+ readonly property: "--cal-button-transform";
90
+ readonly kind: "keyword";
91
+ };
92
+ readonly buttonSpacing: {
93
+ readonly property: "--cal-button-letter-spacing";
94
+ readonly kind: "length";
95
+ };
96
+ readonly buttonFont: {
97
+ readonly property: "--cal-font-button";
98
+ readonly kind: "font";
99
+ };
100
+ readonly buttonWeight: {
101
+ readonly property: "--cal-font-button-weight";
102
+ readonly kind: "keyword";
103
+ };
104
+ readonly secondaryFg: {
105
+ readonly property: "--cal-button2-fg";
106
+ readonly kind: "color";
107
+ };
108
+ readonly mediaRadius: {
109
+ readonly property: "--cal-radius-media";
110
+ readonly kind: "length";
111
+ };
112
+ readonly cardRadius: {
113
+ readonly property: "--cal-radius-card";
114
+ readonly kind: "length";
115
+ };
116
+ readonly pageWidth: {
117
+ readonly property: "--cal-page-width";
118
+ readonly kind: "length";
119
+ };
120
+ };
121
+ type LookToken = keyof typeof LOOK_TOKENS;
122
+ /**
123
+ A look: some of the tokens, each a CSS value as the browser computed it.
124
+ */
125
+ type Look = Partial<Record<LookToken, string>>;
126
+ /**
127
+ True when `value` is a plain value of `kind`.
128
+ */
129
+ declare function isLookValue(kind: LookKind, value: string): boolean;
130
+ /**
131
+ The look in `value`, or undefined when it is not one: an object of known
132
+ token names whose every value is a plain value of that token's kind. One
133
+ unknown name or one value of another shape refuses the whole look.
134
+ */
135
+ declare function parseLook(value: unknown): Look | undefined;
136
+ /**
137
+ The look as declarations for `:root`, `--cal-fg:rgb(…);…`, for a page to apply before it paints.
138
+ */
139
+ declare function lookCss(look: Look): string;
140
+ /**
141
+ The look with readable button text. When the button's text and its fill (the
142
+ page background, for an outline button) are closer than 3:1, the text takes
143
+ the page's text or background colour, whichever reads better on the fill.
144
+ A theme rule that repainted the button the reader measured, or a reading
145
+ that caught a hero button over a photo, can otherwise leave black on black.
146
+ */
147
+ declare function guardLook(look: Look): Look;
148
+
149
+ /**
150
+ The twelve storefront blocks core saves to a store's Callimacus project
151
+ (`POST /backoffice/blocks/save`). Generic versions of the blocks first built
152
+ by hand for one store: every store-specific word comes from `store`. They
153
+ show every kind of content the store's import brings: products, collections
154
+ and articles (Skesis record kinds), pages and policies (knowledge documents).
155
+
156
+ Inside a tier the server emits blocks in block NAME order, so the names are
157
+ part of the layout: renaming a block moves it. Saving again updates a block
158
+ in place but never renames it; a rename means delete and recreate.
159
+
160
+ Block keys are letters only and at most 15 characters (the server's
161
+ /blocks/validate does not check that; the tests do).
162
+ */
163
+ type BlockSpec = {
164
+ key: string;
165
+ name: string;
166
+ prompt: string;
167
+ description: string;
168
+ node: unknown;
169
+ };
170
+ type StoreProfile = {
171
+ /**
172
+ The store's name as shoppers know it.
173
+ */
174
+ name: string;
175
+ /**
176
+ A short phrase for what it sells, for example "outdoor clothing, boots and camping gear".
177
+ */
178
+ catalogue: string;
179
+ };
180
+ /**
181
+ The storefront blocks for one store, sorted by name.
182
+ */
183
+ declare function blockSpecs(store: StoreProfile): BlockSpec[];
184
+
185
+ /**
186
+ The `need` receptor category: what kind of help the shopper needs. The
187
+ storefront blocks key off it (a guide for a problem, a material story, sizes
188
+ and care, a comparison, the store's own pages and policies, stories from its
189
+ journal); `product_browse` is the neutral default.
190
+ */
191
+ type NeedLabel = {
192
+ label: string;
193
+ description: string;
194
+ examples: string[];
195
+ };
196
+ type NeedCategory = {
197
+ category: 'need';
198
+ categoryDescription: string;
199
+ labels: NeedLabel[];
200
+ };
201
+ declare const NEED_DEFAULT_LABEL = "product_browse";
202
+ declare const NEED_LABELS: readonly string[];
203
+ /**
204
+ The category to post to the tenant's receptor. Every label carries generic
205
+ default examples; `examples` replaces them per label (core can generate
206
+ examples from the store's own catalogue).
207
+ */
208
+ declare function needCategory(examples?: Partial<Record<string, string[]>>): NeedCategory;
209
+
210
+ export { LOOK_TOKENS, NEED_DEFAULT_LABEL, NEED_LABELS, PACKAGE_VERSION, blockSpecs, guardLook, isLookValue, lookCss, needCategory, parseLook };
211
+ export type { BlockSpec, Look, LookKind, LookToken, NeedCategory, NeedLabel, StoreProfile };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@callimacus/thamyr-shopify",
3
- "version": "4.12.0",
3
+ "version": "4.13.1",
4
4
  "private": false,
5
5
  "description": "Callimacus storefront for Shopify, as an app embed on any theme: the browser runtime, renderers and look reader, and the setup specs and look checks core uses",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -36,7 +36,7 @@
36
36
  "lint": "eslint src"
37
37
  },
38
38
  "devDependencies": {
39
- "@callimacus/thamyr-core": "^4.12.0",
39
+ "@callimacus/thamyr-core": "^4.13.1",
40
40
  "eslint-config-xo": "^7.0.0",
41
41
  "jsdom": "^30.1.3",
42
42
  "vitest": "^5.0.5"