@searchcraft/javascript-sdk 0.5.0 → 0.5.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.
@@ -8,7 +8,7 @@ const utils = require('./utils-a17279a2.js');
8
8
  const index$1 = require('./index-5b0b9d4c.js');
9
9
 
10
10
  const name = "@searchcraft/javascript-sdk";
11
- const version = "0.5.0";
11
+ const version = "0.5.1";
12
12
  const description = "Searchcraft Javascript SDK";
13
13
  const author = "Searchcraft";
14
14
  const license = "Apache-2.0";
@@ -1,14 +1,4 @@
1
- /**
2
- * @fileoverview entry point for your component library
3
- *
4
- * This is the entry point for your component library. Use this file to export utilities,
5
- * constants or data structure that accompany your components.
6
- *
7
- * DO NOT use this file to export your components. Instead, use the recommended approaches
8
- * to consume components of this package as outlined in the `README.md`.
9
- */
10
1
  export { parseCustomStyles, serializeStyles, } from './utils/utils';
11
2
  export { useSearchcraftStore, useThemeStore } from './provider/store';
12
- export * from './components';
13
3
  export * from './types';
14
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,iBAAiB,EACjB,eAAe,GAChB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtE,cAAc,cAAc,CAAC;AAE7B,cAAc,SAAS,CAAC","sourcesContent":["/**\n * @fileoverview entry point for your component library\n *\n * This is the entry point for your component library. Use this file to export utilities,\n * constants or data structure that accompany your components.\n *\n * DO NOT use this file to export your components. Instead, use the recommended approaches\n * to consume components of this package as outlined in the `README.md`.\n */\n\nexport {\n parseCustomStyles,\n serializeStyles,\n} from './utils/utils';\n\nexport { useSearchcraftStore, useThemeStore } from './provider/store';\n\nexport * from './components';\n\nexport * from './types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,iBAAiB,EACjB,eAAe,GAChB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAItE,cAAc,SAAS,CAAC","sourcesContent":["/**\n * @fileoverview entry point for your component library\n *\n * This is the entry point for your component library. Use this file to export utilities,\n * constants or data structure that accompany your components.\n *\n * DO NOT use this file to export your components. Instead, use the recommended approaches\n * to consume components of this package as outlined in the `README.md`.\n */\nexport type * from './components';\n\nexport {\n parseCustomStyles,\n serializeStyles,\n} from './utils/utils';\n\nexport { useSearchcraftStore, useThemeStore } from './provider/store';\n\nexport { Components } from './components';\n\nexport * from './types';\n"]}
@@ -7,7 +7,7 @@ import { d as defineCustomElement$3 } from './p-16983367.js';
7
7
  import { d as defineCustomElement$2 } from './p-bd5fede3.js';
8
8
 
9
9
  const name = "@searchcraft/javascript-sdk";
10
- const version = "0.5.0";
10
+ const version = "0.5.1";
11
11
  const description = "Searchcraft Javascript SDK";
12
12
  const author = "Searchcraft";
13
13
  const license = "Apache-2.0";
@@ -4,7 +4,7 @@ import { p as parseCustomStyles } from './utils-c2ce411f.js';
4
4
  import { c as classNames } from './index-72ac5051.js';
5
5
 
6
6
  const name = "@searchcraft/javascript-sdk";
7
- const version = "0.5.0";
7
+ const version = "0.5.1";
8
8
  const description = "Searchcraft Javascript SDK";
9
9
  const author = "Searchcraft";
10
10
  const license = "Apache-2.0";
@@ -1,2 +1,2 @@
1
- import{r as t,c as e,h as s}from"./p-d7d0b88c.js";import{u as r,i as c}from"./p-86911576.js";import{p as a}from"./p-f308d05d.js";import{c as i}from"./p-5cdc6210.js";const n="@searchcraft/javascript-sdk";const o="0.5.0";const d="Searchcraft Javascript SDK";const p="Searchcraft";const h="Apache-2.0";const u="dist/index.cjs.js";const f="dist/index.js";const l="dist/types/index.d.ts";const g="dist/collection/collection-manifest.json";const b="dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js";const y={".":{import:"./dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js",require:"./dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.cjs.js",types:"./dist/types/index.d.ts"},"./dist/*":{import:"./dist/*",types:"./dist/*"},"./components":{import:"./dist/components/index.js",types:"./dist/components/index.d.ts"},"./loader":{import:"./dist/loader/index.js",require:"./dist/loader/index.cjs",types:"./dist/loader/index.d.ts"}};const m={type:"git",url:"https://bitbucket.org/madebychalk/searchcraft-javascript-sdks/"};const v=["dist/"];const w={build:"stencil build",dev:"stencil build --dev --watch",test:"stencil test --spec --e2e","test.watch":"stencil test --spec --e2e --watchAll",generate:"stencil generate"};const F={classnames:"^2.3.2"};const x={"@searchcraft/core":"*","@searchcraft/javascript-sdk":"*","@stencil/core":"^4.7.0","@stencil/react-output-target":"^0.8.2","@stencil/sass":"^3.0.12","@types/node":"^16.18.11",zustand:"^5.0.1"};const k={name:n,private:false,version:o,description:d,author:p,license:h,main:u,module:f,types:l,collection:g,"collection:main":"dist/collection/index.js",unpkg:b,exports:y,repository:m,files:v,scripts:w,dependencies:F,devDependencies:x};const C=":root{--sc-spinner-size:20px;--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}.searchcraft-input-wrapper{position:relative;display:flex}.searchcraft-input-grid{display:grid;gap:4px 8px}.searchcraft-input-grid-buttonLeft{grid-template-rows:repeat(3, auto);grid-template-columns:auto 1fr}.searchcraft-input-grid-buttonLeft .searchcraft-input-button-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-label-wrapper{grid-column:2/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-error-wrapper{grid-column:2/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonRight{grid-template-rows:repeat(3, auto);grid-template-columns:1fr auto}.searchcraft-input-grid-buttonRight .searchcraft-input-button-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-label-wrapper{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-error-wrapper{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonNone{grid-template-rows:repeat(3, auto);grid-template-columns:auto}.searchcraft-input-grid-buttonNone .searchcraft-input-button-wrapper{display:none}.searchcraft-input-grid-buttonNone .searchcraft-input-label-wrapper{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonNone .searchcraft-input-error-wrapper{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonNone .searchcraft-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);background-color:var(--sc-surface-neutral-secondary);border:none;border-radius:var(--sc-input-border-radius);color:var(--sc-content-neutral-primary);outline:none;padding-left:var(--sc-input-padding-left);padding-right:var(--sc-input-padding-right);padding-top:12px;padding-bottom:12px;flex:1}.searchcraft-input::placeholder{color:var(--sc-content-disabled)}.searchcraft-input:focus{outline:var(--sc-border-brand) solid 2px}.searchcraft-input:focus::placeholder{opacity:0}.searchcraft-input.error{color:var(--sc-content-danger);outline:var(--sc-border-danger) solid 2px}.searchcraft-input.error:focus{outline:var(--sc-border-danger) solid 2px}.searchcraft-input-search-icon-wrapper{align-items:center;justify-content:center;display:flex;position:absolute;pointer-events:none;bottom:0;left:0;top:0;width:var(--sc-input-padding-left)}.searchcraft-input-search-icon{pointer-events:none;width:var(--sc-input-search-icon-size);height:var(--sc-input-search-icon-size)}.searchcraft-input-clear-button{all:unset;align-items:center;justify-content:center;cursor:pointer;display:flex;position:absolute;border:none;outline:none;bottom:0;right:0;top:0;width:var(--sc-input-padding-right)}.searchcraft-input-clear-icon{width:var(--sc-input-clear-icon-size);height:var(--sc-input-clear-icon-size)}";const j=C;const E=class{constructor(s){t(this,s);this.inputCleared=e(this,"inputCleared",7);this.noResultsReceived=e(this,"noResultsReceived",7);this.querySubmit=e(this,"querySubmit",7);this.inputFocus=e(this,"inputFocus",7);this.inputBlur=e(this,"inputBlur",7);this.debounceTimeout=null;this.searchStore=r.getState();this.handleOnInput=t=>{const e=t.target;this.inputValue=e.value;if(e.value.trim()===""){this.inputCleared.emit();return}if(!this.autoSearch){return}if(this.debounceDelay>0){if(this.debounceTimeout){clearTimeout(this.debounceTimeout)}this.debounceTimeout=setTimeout((()=>this.performSearch(e.value)),this.debounceDelay)}else{this.performSearch(e.value)}};this.performSearch=async t=>{if(t===r.getState().query){return}this.querySubmit.emit(t);this.searchTerm=t.trim();this.error=false;this.searchStore.setQuery(this.searchTerm);try{await this.searchStore.search()}catch(t){this.error=true;this.inputCleared.emit()}};this.handleClearInput=()=>{this.inputValue="";if(this.debounceTimeout){clearTimeout(this.debounceTimeout)}this.searchTerm="";this.searchStore.setQuery("");this.searchStore.setSearchResults(null);this.error=false;if(this.inputCleared){this.inputCleared.emit()}};this.handleFormSubmit=async t=>{t.preventDefault();await this.performSearch(this.searchTerm)};this.config=undefined;this.autoSearch=true;this.buttonPlacement="none";this.buttonLabel=undefined;this.inputLabel=undefined;this.customStyles={};this.placeholderValue="Enter Search";this.searchTerm="";this.debounceDelay=0;this.inputValue=this.searchTerm;this.error=false}init(){if(this.config){const t=new c(this.config,{sdkName:k.name,sdkVersion:k.version});this.searchStore.initialize(t,true)}}componentDidLoad(){this.init()}onConfigChange(){this.init()}render(){const t=a(this.customStyles);const e=this.inputValue.length>0;const r=i("searchcraft-input-grid",{"searchcraft-input-grid-buttonLeft":this.buttonPlacement==="left","searchcraft-input-grid-buttonRight":this.buttonPlacement==="right","searchcraft-input-grid-buttonNone":this.buttonPlacement==="none"});return s("form",{key:"ac7eeb57d1d06df0be4354f2bb64b36d954d9cac",class:"searchcraft-input-form",onSubmit:this.handleFormSubmit},s("div",{key:"544156a87b038bd8585ea1c5613fee9f6906c973",class:r},s("div",{key:"7ff6b5150e440c45eef51f103e41314bd68dbe43",class:"searchcraft-input-button-wrapper"},s("searchcraft-button",{key:"3b0c6c94485133259dc247905d0bd5b224f74e4e",onButtonClick:this.handleFormSubmit,label:this.buttonLabel})),s("div",{key:"8604e917290120905a92cf948a5a76f52197e882",class:"searchcraft-input-label-wrapper"},s("searchcraft-input-label",{key:"376e1c3e3b84f683872e118a14da2a229e4b8eb5",label:this.inputLabel})),this.error&&s("div",{key:"aa26f0b978e134ca026ea290eb149d6626185ac2",class:"searchcraft-input-error-wrapper"},s("searchcraft-error-message",{key:"87340701fd0a5fcbd0249d9798a607e920089080",errorMessage:"Please enter a search query."})),s("div",{key:"ebd7c6d07da299a7d2553ccb96fc618222e228df",class:"searchcraft-input-wrapper"},s("input",{key:"1961a43111858561b4d2e84935b3c47cec45397f",autoComplete:"off",class:"searchcraft-input",onFocus:()=>this.inputFocus.emit(),onBlur:()=>this.inputBlur.emit(),onInput:t=>{this.handleOnInput(t)},placeholder:this.placeholderValue,style:t,type:"text",value:this.inputValue}),s("div",{key:"966ac230dd6946dad185d9f657145ebab76a262a",class:"searchcraft-input-search-icon-wrapper"},s("svg",{key:"12d139c60fe38055df9ea502c877fb773b38682d",class:"searchcraft-input-search-icon",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"searchcraft-title"},s("title",{key:"b8eea376073c55c6e0e4bf29d40230f1d2220ce7",id:"searchcraft-title"},"Searchcraft Search Icon Light"),s("path",{key:"c513ef3b3cea3823e7838ac2574cd5a237e06ef1",d:"M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z",stroke:"#404040","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))),e&&s("button",{key:"35e056ea1d2530e045c3edae231204f9c490d10b",type:"button",class:"searchcraft-input-clear-button",onClick:this.handleClearInput},s("svg",{key:"3ab21fc44269d2f13ba91c21d24becd3ea5e2728",class:"searchcraft-input-clear-icon",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"icon-title"},s("title",{key:"c9c4c5c1a5772cac63e3cf5557cc6e90f0b1a1f1",id:"icon-title"},"Searchcraft Clear Input Icon Light"),s("path",{key:"36740b841f8ec8e439c8e7fbefd37dafafcf5d00",d:"M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))))))}static get watchers(){return{config:["onConfigChange"]}}};E.style=j;export{E as searchcraft_input_form};
2
- //# sourceMappingURL=p-7336f522.entry.js.map
1
+ import{r as t,c as e,h as s}from"./p-d7d0b88c.js";import{u as r,i as c}from"./p-86911576.js";import{p as a}from"./p-f308d05d.js";import{c as i}from"./p-5cdc6210.js";const n="@searchcraft/javascript-sdk";const o="0.5.1";const d="Searchcraft Javascript SDK";const p="Searchcraft";const h="Apache-2.0";const u="dist/index.cjs.js";const f="dist/index.js";const l="dist/types/index.d.ts";const g="dist/collection/collection-manifest.json";const b="dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js";const y={".":{import:"./dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js",require:"./dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.cjs.js",types:"./dist/types/index.d.ts"},"./dist/*":{import:"./dist/*",types:"./dist/*"},"./components":{import:"./dist/components/index.js",types:"./dist/components/index.d.ts"},"./loader":{import:"./dist/loader/index.js",require:"./dist/loader/index.cjs",types:"./dist/loader/index.d.ts"}};const m={type:"git",url:"https://bitbucket.org/madebychalk/searchcraft-javascript-sdks/"};const v=["dist/"];const w={build:"stencil build",dev:"stencil build --dev --watch",test:"stencil test --spec --e2e","test.watch":"stencil test --spec --e2e --watchAll",generate:"stencil generate"};const F={classnames:"^2.3.2"};const x={"@searchcraft/core":"*","@searchcraft/javascript-sdk":"*","@stencil/core":"^4.7.0","@stencil/react-output-target":"^0.8.2","@stencil/sass":"^3.0.12","@types/node":"^16.18.11",zustand:"^5.0.1"};const k={name:n,private:false,version:o,description:d,author:p,license:h,main:u,module:f,types:l,collection:g,"collection:main":"dist/collection/index.js",unpkg:b,exports:y,repository:m,files:v,scripts:w,dependencies:F,devDependencies:x};const C=":root{--sc-spinner-size:20px;--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}.searchcraft-input-wrapper{position:relative;display:flex}.searchcraft-input-grid{display:grid;gap:4px 8px}.searchcraft-input-grid-buttonLeft{grid-template-rows:repeat(3, auto);grid-template-columns:auto 1fr}.searchcraft-input-grid-buttonLeft .searchcraft-input-button-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-label-wrapper{grid-column:2/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-error-wrapper{grid-column:2/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonLeft .searchcraft-input-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonRight{grid-template-rows:repeat(3, auto);grid-template-columns:1fr auto}.searchcraft-input-grid-buttonRight .searchcraft-input-button-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-label-wrapper{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-error-wrapper{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonRight .searchcraft-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-grid-buttonNone{grid-template-rows:repeat(3, auto);grid-template-columns:auto}.searchcraft-input-grid-buttonNone .searchcraft-input-button-wrapper{display:none}.searchcraft-input-grid-buttonNone .searchcraft-input-label-wrapper{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-grid-buttonNone .searchcraft-input-error-wrapper{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-grid-buttonNone .searchcraft-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);background-color:var(--sc-surface-neutral-secondary);border:none;border-radius:var(--sc-input-border-radius);color:var(--sc-content-neutral-primary);outline:none;padding-left:var(--sc-input-padding-left);padding-right:var(--sc-input-padding-right);padding-top:12px;padding-bottom:12px;flex:1}.searchcraft-input::placeholder{color:var(--sc-content-disabled)}.searchcraft-input:focus{outline:var(--sc-border-brand) solid 2px}.searchcraft-input:focus::placeholder{opacity:0}.searchcraft-input.error{color:var(--sc-content-danger);outline:var(--sc-border-danger) solid 2px}.searchcraft-input.error:focus{outline:var(--sc-border-danger) solid 2px}.searchcraft-input-search-icon-wrapper{align-items:center;justify-content:center;display:flex;position:absolute;pointer-events:none;bottom:0;left:0;top:0;width:var(--sc-input-padding-left)}.searchcraft-input-search-icon{pointer-events:none;width:var(--sc-input-search-icon-size);height:var(--sc-input-search-icon-size)}.searchcraft-input-clear-button{all:unset;align-items:center;justify-content:center;cursor:pointer;display:flex;position:absolute;border:none;outline:none;bottom:0;right:0;top:0;width:var(--sc-input-padding-right)}.searchcraft-input-clear-icon{width:var(--sc-input-clear-icon-size);height:var(--sc-input-clear-icon-size)}";const j=C;const E=class{constructor(s){t(this,s);this.inputCleared=e(this,"inputCleared",7);this.noResultsReceived=e(this,"noResultsReceived",7);this.querySubmit=e(this,"querySubmit",7);this.inputFocus=e(this,"inputFocus",7);this.inputBlur=e(this,"inputBlur",7);this.debounceTimeout=null;this.searchStore=r.getState();this.handleOnInput=t=>{const e=t.target;this.inputValue=e.value;if(e.value.trim()===""){this.inputCleared.emit();return}if(!this.autoSearch){return}if(this.debounceDelay>0){if(this.debounceTimeout){clearTimeout(this.debounceTimeout)}this.debounceTimeout=setTimeout((()=>this.performSearch(e.value)),this.debounceDelay)}else{this.performSearch(e.value)}};this.performSearch=async t=>{if(t===r.getState().query){return}this.querySubmit.emit(t);this.searchTerm=t.trim();this.error=false;this.searchStore.setQuery(this.searchTerm);try{await this.searchStore.search()}catch(t){this.error=true;this.inputCleared.emit()}};this.handleClearInput=()=>{this.inputValue="";if(this.debounceTimeout){clearTimeout(this.debounceTimeout)}this.searchTerm="";this.searchStore.setQuery("");this.searchStore.setSearchResults(null);this.error=false;if(this.inputCleared){this.inputCleared.emit()}};this.handleFormSubmit=async t=>{t.preventDefault();await this.performSearch(this.searchTerm)};this.config=undefined;this.autoSearch=true;this.buttonPlacement="none";this.buttonLabel=undefined;this.inputLabel=undefined;this.customStyles={};this.placeholderValue="Enter Search";this.searchTerm="";this.debounceDelay=0;this.inputValue=this.searchTerm;this.error=false}init(){if(this.config){const t=new c(this.config,{sdkName:k.name,sdkVersion:k.version});this.searchStore.initialize(t,true)}}componentDidLoad(){this.init()}onConfigChange(){this.init()}render(){const t=a(this.customStyles);const e=this.inputValue.length>0;const r=i("searchcraft-input-grid",{"searchcraft-input-grid-buttonLeft":this.buttonPlacement==="left","searchcraft-input-grid-buttonRight":this.buttonPlacement==="right","searchcraft-input-grid-buttonNone":this.buttonPlacement==="none"});return s("form",{key:"ac7eeb57d1d06df0be4354f2bb64b36d954d9cac",class:"searchcraft-input-form",onSubmit:this.handleFormSubmit},s("div",{key:"544156a87b038bd8585ea1c5613fee9f6906c973",class:r},s("div",{key:"7ff6b5150e440c45eef51f103e41314bd68dbe43",class:"searchcraft-input-button-wrapper"},s("searchcraft-button",{key:"3b0c6c94485133259dc247905d0bd5b224f74e4e",onButtonClick:this.handleFormSubmit,label:this.buttonLabel})),s("div",{key:"8604e917290120905a92cf948a5a76f52197e882",class:"searchcraft-input-label-wrapper"},s("searchcraft-input-label",{key:"376e1c3e3b84f683872e118a14da2a229e4b8eb5",label:this.inputLabel})),this.error&&s("div",{key:"aa26f0b978e134ca026ea290eb149d6626185ac2",class:"searchcraft-input-error-wrapper"},s("searchcraft-error-message",{key:"87340701fd0a5fcbd0249d9798a607e920089080",errorMessage:"Please enter a search query."})),s("div",{key:"ebd7c6d07da299a7d2553ccb96fc618222e228df",class:"searchcraft-input-wrapper"},s("input",{key:"1961a43111858561b4d2e84935b3c47cec45397f",autoComplete:"off",class:"searchcraft-input",onFocus:()=>this.inputFocus.emit(),onBlur:()=>this.inputBlur.emit(),onInput:t=>{this.handleOnInput(t)},placeholder:this.placeholderValue,style:t,type:"text",value:this.inputValue}),s("div",{key:"966ac230dd6946dad185d9f657145ebab76a262a",class:"searchcraft-input-search-icon-wrapper"},s("svg",{key:"12d139c60fe38055df9ea502c877fb773b38682d",class:"searchcraft-input-search-icon",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"searchcraft-title"},s("title",{key:"b8eea376073c55c6e0e4bf29d40230f1d2220ce7",id:"searchcraft-title"},"Searchcraft Search Icon Light"),s("path",{key:"c513ef3b3cea3823e7838ac2574cd5a237e06ef1",d:"M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z",stroke:"#404040","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))),e&&s("button",{key:"35e056ea1d2530e045c3edae231204f9c490d10b",type:"button",class:"searchcraft-input-clear-button",onClick:this.handleClearInput},s("svg",{key:"3ab21fc44269d2f13ba91c21d24becd3ea5e2728",class:"searchcraft-input-clear-icon",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"icon-title"},s("title",{key:"c9c4c5c1a5772cac63e3cf5557cc6e90f0b1a1f1",id:"icon-title"},"Searchcraft Clear Input Icon Light"),s("path",{key:"36740b841f8ec8e439c8e7fbefd37dafafcf5d00",d:"M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))))))}static get watchers(){return{config:["onConfigChange"]}}};E.style=j;export{E as searchcraft_input_form};
2
+ //# sourceMappingURL=p-9d7eb732.entry.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,b as t}from"./p-d7d0b88c.js";export{s as setNonce}from"./p-d7d0b88c.js";import{g as a}from"./p-e1255160.js";var r=()=>{const t=import.meta.url;const a={};if(t!==""){a.resourcesUrl=new URL(".",t).href}return e(a)};r().then((async e=>{await a();return t([["p-8574b83f",[[0,"searchcraft-filter-panel",{items:[16],unsubscribe:[32],lastQuery:[32]}]]],["p-7336f522",[[0,"searchcraft-input-form",{config:[16],autoSearch:[4,"auto-search"],buttonPlacement:[1,"button-placement"],buttonLabel:[1,"button-label"],inputLabel:[1,"input-label"],customStyles:[1,"custom-styles"],placeholderValue:[1,"placeholder-value"],searchTerm:[1,"search-term"],debounceDelay:[2,"debounce-delay"],inputValue:[32],error:[32]},null,{config:["onConfigChange"]}]]],["p-6579c3b2",[[4,"searchcraft-base-search-results",{adInterval:[2,"ad-interval"],customStylesForResults:[1,"custom-styles-for-results"],searchResultMappings:[16],placeAdAtEnd:[4,"place-ad-at-end"],placeAdAtStart:[4,"place-ad-at-start"],resultImagePlacement:[1,"result-image-placement"],buttonLabel:[1,"button-label"],buttonTarget:[1,"button-target"],buttonRel:[1,"button-rel"],containerTarget:[1,"container-target"],containerRel:[1,"container-rel"],hasSearched:[32],query:[32],searchResults:[32]}]]],["p-61cf9d6c",[[0,"searchcraft-popover-form",{config:[16],type:[1],popoverResultMappings:[16]}]]],["p-a7a7b4e0",[[0,"searchcraft-popover-result"]]],["p-ca022b18",[[0,"searchcraft-results-info",{isRequesting:[32],resultsCount:[32],responseTime:[32],query:[32]}]]],["p-51eb71bd",[[0,"searchcraft-base-search-result",{titleContent:[1,"title-content"],subtitleContent:[1,"subtitle-content"],bodyContent:[1,"body-content"],footerContent:[1,"footer-content"],buttonLabel:[1,"button-label"],buttonHref:[1,"button-href"],buttonTarget:[1,"button-target"],buttonRel:[1,"button-rel"],containerHref:[1,"container-href"],containerTarget:[1,"container-target"],containerRel:[1,"container-rel"],imageSrc:[1,"image-src"],imageAlt:[1,"image-alt"],imagePlacement:[1,"image-placement"],customStyles:[1,"custom-styles"],documentPosition:[2,"document-position"]}]]],["p-adadf38a",[[0,"searchcraft-popover-list-view",{popoverResultMappings:[16]}]]],["p-04300412",[[0,"searchcraft-button",{iconElement:[16],iconOnly:[4,"icon-only"],iconPosition:[1,"icon-position"],label:[1],isRequesting:[32]}],[0,"searchcraft-input-label",{inputLabelClassName:[1,"input-label-class-name"],label:[1]}]]],["p-09c7fbef",[[0,"searchcraft-error-message",{errorMessage:[1,"error-message"]}]]],["p-64eadc05",[[0,"searchcraft-facet-list",{fieldName:[1,"field-name"],baseFacetRoot:[32],facetRoot:[32],selectedPaths:[32],lastTimeTaken:[32],hasNewSearchTerm:[32],lastQuery:[32],lastSearchMode:[32],lastSortType:[32],unsubscribe:[32]}],[0,"searchcraft-slider",{max:[2],min:[2],granularity:[2],dataType:[1,"data-type"],endValue:[32],startValue:[32],lastFocusedHandle:[32]}],[0,"searchcraft-toggle-button",{label:[1],subLabel:[1,"sub-label"],isActive:[32],unsubscribe:[32],lastQuery:[32]}]]]],e)}));
1
+ import{p as e,b as t}from"./p-d7d0b88c.js";export{s as setNonce}from"./p-d7d0b88c.js";import{g as a}from"./p-e1255160.js";var r=()=>{const t=import.meta.url;const a={};if(t!==""){a.resourcesUrl=new URL(".",t).href}return e(a)};r().then((async e=>{await a();return t([["p-8574b83f",[[0,"searchcraft-filter-panel",{items:[16],unsubscribe:[32],lastQuery:[32]}]]],["p-9d7eb732",[[0,"searchcraft-input-form",{config:[16],autoSearch:[4,"auto-search"],buttonPlacement:[1,"button-placement"],buttonLabel:[1,"button-label"],inputLabel:[1,"input-label"],customStyles:[1,"custom-styles"],placeholderValue:[1,"placeholder-value"],searchTerm:[1,"search-term"],debounceDelay:[2,"debounce-delay"],inputValue:[32],error:[32]},null,{config:["onConfigChange"]}]]],["p-6579c3b2",[[4,"searchcraft-base-search-results",{adInterval:[2,"ad-interval"],customStylesForResults:[1,"custom-styles-for-results"],searchResultMappings:[16],placeAdAtEnd:[4,"place-ad-at-end"],placeAdAtStart:[4,"place-ad-at-start"],resultImagePlacement:[1,"result-image-placement"],buttonLabel:[1,"button-label"],buttonTarget:[1,"button-target"],buttonRel:[1,"button-rel"],containerTarget:[1,"container-target"],containerRel:[1,"container-rel"],hasSearched:[32],query:[32],searchResults:[32]}]]],["p-61cf9d6c",[[0,"searchcraft-popover-form",{config:[16],type:[1],popoverResultMappings:[16]}]]],["p-a7a7b4e0",[[0,"searchcraft-popover-result"]]],["p-ca022b18",[[0,"searchcraft-results-info",{isRequesting:[32],resultsCount:[32],responseTime:[32],query:[32]}]]],["p-51eb71bd",[[0,"searchcraft-base-search-result",{titleContent:[1,"title-content"],subtitleContent:[1,"subtitle-content"],bodyContent:[1,"body-content"],footerContent:[1,"footer-content"],buttonLabel:[1,"button-label"],buttonHref:[1,"button-href"],buttonTarget:[1,"button-target"],buttonRel:[1,"button-rel"],containerHref:[1,"container-href"],containerTarget:[1,"container-target"],containerRel:[1,"container-rel"],imageSrc:[1,"image-src"],imageAlt:[1,"image-alt"],imagePlacement:[1,"image-placement"],customStyles:[1,"custom-styles"],documentPosition:[2,"document-position"]}]]],["p-adadf38a",[[0,"searchcraft-popover-list-view",{popoverResultMappings:[16]}]]],["p-04300412",[[0,"searchcraft-button",{iconElement:[16],iconOnly:[4,"icon-only"],iconPosition:[1,"icon-position"],label:[1],isRequesting:[32]}],[0,"searchcraft-input-label",{inputLabelClassName:[1,"input-label-class-name"],label:[1]}]]],["p-09c7fbef",[[0,"searchcraft-error-message",{errorMessage:[1,"error-message"]}]]],["p-64eadc05",[[0,"searchcraft-facet-list",{fieldName:[1,"field-name"],baseFacetRoot:[32],facetRoot:[32],selectedPaths:[32],lastTimeTaken:[32],hasNewSearchTerm:[32],lastQuery:[32],lastSearchMode:[32],lastSortType:[32],unsubscribe:[32]}],[0,"searchcraft-slider",{max:[2],min:[2],granularity:[2],dataType:[1,"data-type"],endValue:[32],startValue:[32],lastFocusedHandle:[32]}],[0,"searchcraft-toggle-button",{label:[1],subLabel:[1,"sub-label"],isActive:[32],unsubscribe:[32],lastQuery:[32]}]]]],e)}));
2
2
  //# sourceMappingURL=searchcraft-javascript-sdk.esm.js.map
@@ -7,7 +7,8 @@
7
7
  * DO NOT use this file to export your components. Instead, use the recommended approaches
8
8
  * to consume components of this package as outlined in the `README.md`.
9
9
  */
10
+ export type * from './components';
10
11
  export { parseCustomStyles, serializeStyles, } from './utils/utils';
11
12
  export { useSearchcraftStore, useThemeStore } from './provider/store';
12
- export * from './components';
13
+ export { Components } from './components';
13
14
  export * from './types';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@searchcraft/javascript-sdk",
3
3
  "private": false,
4
- "version": "0.5.0",
4
+ "version": "0.5.1",
5
5
  "description": "Searchcraft Javascript SDK",
6
6
  "author": "Searchcraft",
7
7
  "license": "Apache-2.0",