@searchcraft/javascript-sdk 0.13.0 → 0.13.2
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/dist/components/{p-e30203b1.js → CoreInstanceRegistry.js} +2 -1
- package/dist/components/CoreInstanceRegistry.js.map +1 -0
- package/dist/components/defineCustomElements.js +23 -23
- package/dist/components/{p-b4b67072.js → html.js} +4 -3
- package/dist/components/html.js.map +1 -0
- package/dist/components/index.d.ts +73 -1
- package/dist/components/index.js +82 -658
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-5365011f.js → index2.js} +867 -186
- package/dist/components/index2.js.map +1 -0
- package/dist/components/index3.js +95 -0
- package/dist/components/index3.js.map +1 -0
- package/dist/components/purify.es.js +1379 -0
- package/dist/components/purify.es.js.map +1 -0
- package/dist/components/searchcraft-ad.js +2 -1
- package/dist/components/{p-87435aac.js → searchcraft-ad2.js} +14 -10
- package/dist/components/searchcraft-ad2.js.map +1 -0
- package/dist/components/searchcraft-button.js +2 -1
- package/dist/components/{p-acf23bab.js → searchcraft-button2.js} +12 -9
- package/dist/components/searchcraft-button2.js.map +1 -0
- package/dist/components/searchcraft-error-message.js +2 -1
- package/dist/components/{p-f2585cdf.js → searchcraft-error-message2.js} +10 -7
- package/dist/components/searchcraft-error-message2.js.map +1 -0
- package/dist/components/searchcraft-facet-list.js +2 -1
- package/dist/components/{p-e8d97093.js → searchcraft-facet-list2.js} +17 -12
- package/dist/components/searchcraft-facet-list2.js.map +1 -0
- package/dist/components/searchcraft-filter-panel.js +16 -13
- package/dist/components/searchcraft-filter-panel.js.map +1 -1
- package/dist/components/searchcraft-input-form.js +2 -1
- package/dist/components/{p-76d95772.js → searchcraft-input-form2.js} +21 -18
- package/dist/components/searchcraft-input-form2.js.map +1 -0
- package/dist/components/searchcraft-input-label.js +2 -1
- package/dist/components/{p-fa799946.js → searchcraft-input-label2.js} +11 -8
- package/dist/components/searchcraft-input-label2.js.map +1 -0
- package/dist/components/searchcraft-loading.js +2 -1
- package/dist/components/{p-46ddde99.js → searchcraft-loading2.js} +10 -7
- package/dist/components/searchcraft-loading2.js.map +1 -0
- package/dist/components/searchcraft-pagination.js +15 -11
- package/dist/components/searchcraft-pagination.js.map +1 -1
- package/dist/components/searchcraft-popover-button.js +11 -8
- package/dist/components/searchcraft-popover-button.js.map +1 -1
- package/dist/components/searchcraft-popover-footer.js +2 -1
- package/dist/components/{p-3d2107af.js → searchcraft-popover-footer2.js} +13 -10
- package/dist/components/searchcraft-popover-footer2.js.map +1 -0
- package/dist/components/searchcraft-popover-form.js +28 -25
- package/dist/components/searchcraft-popover-form.js.map +1 -1
- package/dist/components/searchcraft-popover-list-item.js +2 -1
- package/dist/components/{p-38b2dad0.js → searchcraft-popover-list-item2.js} +13 -10
- package/dist/components/searchcraft-popover-list-item2.js.map +1 -0
- package/dist/components/searchcraft-popover-list-view.js +2 -1
- package/dist/components/{p-90bc1590.js → searchcraft-popover-list-view2.js} +15 -12
- package/dist/components/searchcraft-popover-list-view2.js.map +1 -0
- package/dist/components/searchcraft-results-info.js +12 -9
- package/dist/components/searchcraft-results-info.js.map +1 -1
- package/dist/components/searchcraft-search-result.js +2 -1
- package/dist/components/{p-3286bbb3.js → searchcraft-search-result2.js} +12 -9
- package/dist/components/searchcraft-search-result2.js.map +1 -0
- package/dist/components/searchcraft-search-results-per-page.js +14 -10
- package/dist/components/searchcraft-search-results-per-page.js.map +1 -1
- package/dist/components/searchcraft-search-results.js +16 -13
- package/dist/components/searchcraft-search-results.js.map +1 -1
- package/dist/components/searchcraft-select.js +2 -1
- package/dist/components/{p-73db9122.js → searchcraft-select2.js} +11 -8
- package/dist/components/searchcraft-select2.js.map +1 -0
- package/dist/components/searchcraft-slider.js +2 -1
- package/dist/components/{p-afe7ce60.js → searchcraft-slider2.js} +14 -11
- package/dist/components/searchcraft-slider2.js.map +1 -0
- package/dist/components/searchcraft-summary-box.js +15 -70
- package/dist/components/searchcraft-summary-box.js.map +1 -1
- package/dist/components/searchcraft-theme.js +10 -7
- package/dist/components/searchcraft-theme.js.map +1 -1
- package/dist/components/searchcraft-toggle-button.js +2 -1
- package/dist/components/{p-16181756.js → searchcraft-toggle-button2.js} +13 -10
- package/dist/components/searchcraft-toggle-button2.js.map +1 -0
- package/dist/components/{p-d54771ef.js → units.js} +2 -1
- package/dist/components/units.js.map +1 -0
- package/dist/hydrate/index.d.ts +52 -7
- package/dist/hydrate/index.js +3374 -2599
- package/dist/hydrate/index.mjs +3374 -2601
- package/dist/types/classes/SearchcraftCore.d.ts +1 -0
- package/dist/types/clients/MeasureClient.d.ts +2 -1
- package/dist/types/clients/SearchClient.d.ts +1 -1
- package/dist/types/clients/ad-clients/AdClient.d.ts +1 -1
- package/dist/types/clients/ad-clients/NativoClient.d.ts +1 -1
- package/dist/types/components/searchcraft-popover-form/searchcraft-popover-form.d.ts +1 -1
- package/dist/types/components/searchcraft-popover-list-item/searchcraft-popover-list-item.d.ts +1 -1
- package/dist/types/components/searchcraft-popover-list-view/searchcraft-popover-list-view.d.ts +1 -1
- package/dist/types/components/searchcraft-search-results/searchcraft-search-results.d.ts +2 -2
- package/dist/types/components.d.ts +70 -0
- package/dist/types/stencil-public-runtime.d.ts +127 -8
- package/package.json +3 -3
- package/dist/components/p-16181756.js.map +0 -1
- package/dist/components/p-3286bbb3.js.map +0 -1
- package/dist/components/p-38b2dad0.js.map +0 -1
- package/dist/components/p-3d2107af.js.map +0 -1
- package/dist/components/p-46ddde99.js.map +0 -1
- package/dist/components/p-5365011f.js.map +0 -1
- package/dist/components/p-5cdc6210.js +0 -82
- package/dist/components/p-5cdc6210.js.map +0 -1
- package/dist/components/p-73db9122.js.map +0 -1
- package/dist/components/p-76d95772.js.map +0 -1
- package/dist/components/p-87435aac.js.map +0 -1
- package/dist/components/p-90bc1590.js.map +0 -1
- package/dist/components/p-acf23bab.js.map +0 -1
- package/dist/components/p-afe7ce60.js.map +0 -1
- package/dist/components/p-b4b67072.js.map +0 -1
- package/dist/components/p-d54771ef.js.map +0 -1
- package/dist/components/p-e2a10337.js +0 -1355
- package/dist/components/p-e2a10337.js.map +0 -1
- package/dist/components/p-e30203b1.js.map +0 -1
- package/dist/components/p-e8d97093.js.map +0 -1
- package/dist/components/p-f2585cdf.js.map +0 -1
- package/dist/components/p-fa799946.js.map +0 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
type CustomMethodDecorator<T> = (target: object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
|
|
2
|
+
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
3
|
+
type MixinInstance<F> = F extends (base: MixedInCtor) => MixedInCtor<infer I> ? I : never;
|
|
2
4
|
export interface ComponentDecorator {
|
|
3
5
|
(opts?: ComponentOptions): ClassDecorator;
|
|
4
6
|
}
|
|
@@ -123,6 +125,9 @@ export interface AttachInternalsDecorator {
|
|
|
123
125
|
export interface ListenDecorator {
|
|
124
126
|
(eventName: string, opts?: ListenOptions): CustomMethodDecorator<any>;
|
|
125
127
|
}
|
|
128
|
+
export interface ResolveVarFunction {
|
|
129
|
+
<T>(variable: T): string;
|
|
130
|
+
}
|
|
126
131
|
export interface ListenOptions {
|
|
127
132
|
/**
|
|
128
133
|
* Handlers can also be registered for an event other than the host itself.
|
|
@@ -151,7 +156,13 @@ export interface StateDecorator {
|
|
|
151
156
|
(): PropertyDecorator;
|
|
152
157
|
}
|
|
153
158
|
export interface WatchDecorator {
|
|
154
|
-
(propName:
|
|
159
|
+
(propName: any): CustomMethodDecorator<(newValue?: any, oldValue?: any, propName?: any, ...args: any[]) => any | void>;
|
|
160
|
+
}
|
|
161
|
+
export interface PropSerializeDecorator {
|
|
162
|
+
(propName: any): CustomMethodDecorator<(newValue?: any, propName?: string, ...args: any[]) => string | null>;
|
|
163
|
+
}
|
|
164
|
+
export interface AttrDeserializeDecorator {
|
|
165
|
+
(propName: any): CustomMethodDecorator<(newValue?: any, propName?: string, ...args: any[]) => any>;
|
|
155
166
|
}
|
|
156
167
|
export interface UserBuildConditionals {
|
|
157
168
|
isDev: boolean;
|
|
@@ -200,6 +211,24 @@ export declare const AttachInternals: AttachInternalsDecorator;
|
|
|
200
211
|
* https://stenciljs.com/docs/events#listen-decorator
|
|
201
212
|
*/
|
|
202
213
|
export declare const Listen: ListenDecorator;
|
|
214
|
+
/**
|
|
215
|
+
* The `resolveVar()` function is a compile-time utility that resolves const variables
|
|
216
|
+
* and object properties to their string literal values. This allows variables to be
|
|
217
|
+
* used in `@Listen` and `@Event` decorators instead of hardcoded strings.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```ts
|
|
221
|
+
* const MY_EVENT = 'myEvent';
|
|
222
|
+
* @Listen(resolveVar(MY_EVENT))
|
|
223
|
+
* ```
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* ```ts
|
|
227
|
+
* const EVENTS = { MY_EVENT: 'myEvent' } as const;
|
|
228
|
+
* @Event({ eventName: resolveVar(EVENTS.MY_EVENT) })
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
export declare const resolveVar: ResolveVarFunction;
|
|
203
232
|
/**
|
|
204
233
|
* The `@Method()` decorator is used to expose methods on the public API.
|
|
205
234
|
* Class methods decorated with the @Method() decorator can be called directly
|
|
@@ -233,6 +262,14 @@ export declare const State: StateDecorator;
|
|
|
233
262
|
* https://stenciljs.com/docs/reactive-data#watch-decorator
|
|
234
263
|
*/
|
|
235
264
|
export declare const Watch: WatchDecorator;
|
|
265
|
+
/**
|
|
266
|
+
* Decorator to serialize a property to an attribute string.
|
|
267
|
+
*/
|
|
268
|
+
export declare const PropSerialize: PropSerializeDecorator;
|
|
269
|
+
/**
|
|
270
|
+
* Decorator to deserialize an attribute string to a property.
|
|
271
|
+
*/
|
|
272
|
+
export declare const AttrDeserialize: AttrDeserializeDecorator;
|
|
236
273
|
export type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
|
|
237
274
|
export type ErrorHandler = (err: any, element?: HTMLElement) => void;
|
|
238
275
|
/**
|
|
@@ -260,6 +297,25 @@ export declare function setPlatformHelpers(helpers: {
|
|
|
260
297
|
* @returns the base path
|
|
261
298
|
*/
|
|
262
299
|
export declare function getAssetPath(path: string): string;
|
|
300
|
+
/**
|
|
301
|
+
* Method to render a virtual DOM tree to a container element.
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
* ```tsx
|
|
305
|
+
* import { render } from '@stencil/core';
|
|
306
|
+
*
|
|
307
|
+
* const vnode = (
|
|
308
|
+
* <div>
|
|
309
|
+
* <h1>Hello, world!</h1>
|
|
310
|
+
* </div>
|
|
311
|
+
* );
|
|
312
|
+
* render(vnode, document.body);
|
|
313
|
+
* ```
|
|
314
|
+
*
|
|
315
|
+
* @param vnode - The virtual DOM tree to render
|
|
316
|
+
* @param container - The container element to render the virtual DOM tree to
|
|
317
|
+
*/
|
|
318
|
+
export declare function render(vnode: VNode, container: Element): void;
|
|
263
319
|
/**
|
|
264
320
|
* Used to manually set the base path where assets can be found. For lazy-loaded
|
|
265
321
|
* builds the asset path is automatically set and assets copied to the correct
|
|
@@ -330,6 +386,58 @@ export declare function readTask(task: RafCallback): void;
|
|
|
330
386
|
* Unhandled exception raised while rendering, during event handling, or lifecycles will trigger the custom event handler.
|
|
331
387
|
*/
|
|
332
388
|
export declare const setErrorHandler: (handler: ErrorHandler) => void;
|
|
389
|
+
export type TagTransformer = (tag: string) => string;
|
|
390
|
+
/**
|
|
391
|
+
* Sets a tag transformer to be used when rendering your custom elements.
|
|
392
|
+
* ```ts
|
|
393
|
+
* setTagTransformer((tag) => {
|
|
394
|
+
* if (tag.startsWith('my-')) return `new-${tag}`
|
|
395
|
+
* return tag;
|
|
396
|
+
* });
|
|
397
|
+
* ```
|
|
398
|
+
* Will mean all your components that start with `my-` are defined instead with `new-my-` prefix.
|
|
399
|
+
*
|
|
400
|
+
* @param transformer the transformer function to use which must return a string.
|
|
401
|
+
*/
|
|
402
|
+
export declare function setTagTransformer(transformer: TagTransformer): void;
|
|
403
|
+
/**
|
|
404
|
+
* Transforms a tag name using a transformer set via `setTagTransformer`
|
|
405
|
+
*
|
|
406
|
+
* @param tag - the tag to transform e.g. `my-tag`
|
|
407
|
+
* @returns the transformed tag e.g. `new-my-tag`
|
|
408
|
+
*/
|
|
409
|
+
export declare function transformTag(tag: string): string;
|
|
410
|
+
/**
|
|
411
|
+
* @deprecated - Use `MixedInCtor` instead:
|
|
412
|
+
* ```ts
|
|
413
|
+
* import { MixedInCtor } from '@stencil/core';
|
|
414
|
+
*
|
|
415
|
+
* const AFactoryFn = <B extends MixedInCtor>(Base: B) => {class A extends Base { propA = A }; return A;}
|
|
416
|
+
* ```
|
|
417
|
+
*/
|
|
418
|
+
export type MixinFactory = (base: MixedInCtor) => MixedInCtor;
|
|
419
|
+
export type MixedInCtor<T = {}> = new (...args: any[]) => T;
|
|
420
|
+
/**
|
|
421
|
+
* Compose multiple mixin classes into a single constructor.
|
|
422
|
+
* The resulting class has the combined instance types of all mixed-in classes.
|
|
423
|
+
*
|
|
424
|
+
* Example:
|
|
425
|
+
* ```ts
|
|
426
|
+
* import { Mixin, MixedInCtor } from '@stencil/core';
|
|
427
|
+
*
|
|
428
|
+
* const AWrap = <B extends MixedInCtor>(Base: B) => {class A extends Base { propA = A }; return A;}
|
|
429
|
+
* const BWrap = <B extends MixedInCtor>(Base: B) => {class B extends Base { propB = B }; return B;}
|
|
430
|
+
* const CWrap = <B extends MixedInCtor>(Base: B) => {class C extends Base { propC = C }; return C;}
|
|
431
|
+
*
|
|
432
|
+
* class X extends Mixin(AWrap, BWrap, CWrap) {
|
|
433
|
+
* render() { return <div>{this.propA} {this.propB} {this.propC}</div>; }
|
|
434
|
+
* }
|
|
435
|
+
* ```
|
|
436
|
+
*
|
|
437
|
+
* @param mixinFactories mixin factory functions that return a class which extends from the provided class.
|
|
438
|
+
* @returns a class that is composed from extending each of the provided classes in the order they were provided.
|
|
439
|
+
*/
|
|
440
|
+
export declare function Mixin<const TMixins extends readonly MixinFactory[]>(...mixinFactories: TMixins): abstract new (...args: any[]) => UnionToIntersection<MixinInstance<TMixins[number]>>;
|
|
333
441
|
/**
|
|
334
442
|
* This file gets copied to all distributions of stencil component collections.
|
|
335
443
|
* - no imports
|
|
@@ -826,7 +934,8 @@ export declare namespace JSXBase {
|
|
|
826
934
|
}
|
|
827
935
|
interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
828
936
|
open?: boolean;
|
|
829
|
-
|
|
937
|
+
name?: string;
|
|
938
|
+
onToggle?: (event: ToggleEvent) => void;
|
|
830
939
|
}
|
|
831
940
|
interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
832
941
|
cite?: string;
|
|
@@ -1532,6 +1641,13 @@ export declare namespace JSXBase {
|
|
|
1532
1641
|
z?: number | string;
|
|
1533
1642
|
zoomAndPan?: string;
|
|
1534
1643
|
}
|
|
1644
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ToggleEvent) */
|
|
1645
|
+
interface ToggleEvent extends Event {
|
|
1646
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ToggleEvent/newState) */
|
|
1647
|
+
readonly newState: string;
|
|
1648
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ToggleEvent/oldState) */
|
|
1649
|
+
readonly oldState: string;
|
|
1650
|
+
}
|
|
1535
1651
|
interface DOMAttributes<T> extends JSXAttributes<T> {
|
|
1536
1652
|
slot?: string;
|
|
1537
1653
|
part?: string;
|
|
@@ -1548,6 +1664,10 @@ export declare namespace JSXBase {
|
|
|
1548
1664
|
onCompositionstartCapture?: (event: CompositionEvent) => void;
|
|
1549
1665
|
onCompositionupdate?: (event: CompositionEvent) => void;
|
|
1550
1666
|
onCompositionupdateCapture?: (event: CompositionEvent) => void;
|
|
1667
|
+
onBeforeToggle?: (event: ToggleEvent) => void;
|
|
1668
|
+
onBeforeToggleCapture?: (event: ToggleEvent) => void;
|
|
1669
|
+
onToggle?: (event: ToggleEvent) => void;
|
|
1670
|
+
onToggleCapture?: (event: ToggleEvent) => void;
|
|
1551
1671
|
onFocus?: (event: FocusEvent) => void;
|
|
1552
1672
|
onFocusCapture?: (event: FocusEvent) => void;
|
|
1553
1673
|
onFocusin?: (event: FocusEvent) => void;
|
|
@@ -1566,10 +1686,6 @@ export declare namespace JSXBase {
|
|
|
1566
1686
|
onSubmitCapture?: (event: Event) => void;
|
|
1567
1687
|
onInvalid?: (event: Event) => void;
|
|
1568
1688
|
onInvalidCapture?: (event: Event) => void;
|
|
1569
|
-
onBeforeToggle?: (event: Event) => void;
|
|
1570
|
-
onBeforeToggleCapture?: (event: Event) => void;
|
|
1571
|
-
onToggle?: (event: Event) => void;
|
|
1572
|
-
onToggleCapture?: (event: Event) => void;
|
|
1573
1689
|
onLoad?: (event: Event) => void;
|
|
1574
1690
|
onLoadCapture?: (event: Event) => void;
|
|
1575
1691
|
onError?: (event: Event) => void;
|
|
@@ -1581,7 +1697,7 @@ export declare namespace JSXBase {
|
|
|
1581
1697
|
onKeyUp?: (event: KeyboardEvent) => void;
|
|
1582
1698
|
onKeyUpCapture?: (event: KeyboardEvent) => void;
|
|
1583
1699
|
onAuxClick?: (event: MouseEvent) => void;
|
|
1584
|
-
onClick?: (event:
|
|
1700
|
+
onClick?: (event: PointerEvent) => void;
|
|
1585
1701
|
onClickCapture?: (event: MouseEvent) => void;
|
|
1586
1702
|
onContextMenu?: (event: MouseEvent) => void;
|
|
1587
1703
|
onContextMenuCapture?: (event: MouseEvent) => void;
|
|
@@ -1661,6 +1777,8 @@ export declare namespace JSXBase {
|
|
|
1661
1777
|
onTransitionRunCapture?: (event: TransitionEvent) => void;
|
|
1662
1778
|
onTransitionStart?: (event: TransitionEvent) => void;
|
|
1663
1779
|
onTransitionStartCapture?: (event: TransitionEvent) => void;
|
|
1780
|
+
[key: `aria-${string}`]: string | boolean | undefined;
|
|
1781
|
+
[key: `aria${string}`]: string | boolean | undefined;
|
|
1664
1782
|
}
|
|
1665
1783
|
}
|
|
1666
1784
|
export interface JSXAttributes<T = Element> {
|
|
@@ -1671,6 +1789,7 @@ export interface CustomElementsDefineOptions {
|
|
|
1671
1789
|
exclude?: string[];
|
|
1672
1790
|
resourcesUrl?: string;
|
|
1673
1791
|
syncQueue?: boolean;
|
|
1792
|
+
/** @deprecated in-favour of `setTagTransformer` and `transformTag` */
|
|
1674
1793
|
transformTagName?: (tagName: string) => string;
|
|
1675
1794
|
jmp?: (c: Function) => any;
|
|
1676
1795
|
raf?: (c: FrameRequestCallback) => number;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@searchcraft/javascript-sdk",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.13.
|
|
4
|
+
"version": "0.13.2",
|
|
5
5
|
"description": "Searchcraft Javascript SDK",
|
|
6
6
|
"author": "Searchcraft Inc.",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"nanoid": "^5.0.9"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@stencil/core": "
|
|
49
|
+
"@stencil/core": "4.39.0",
|
|
50
50
|
"@stencil/react-output-target": "^1.2.0",
|
|
51
51
|
"@stencil/sass": "^3.0.12",
|
|
52
52
|
"@stencil/vue-output-target": "^0.9.2",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"nanoid": "^5.0.9",
|
|
56
56
|
"zustand": "^5.0.1"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "1310ef77a55cc204f8b38fd0372211312746bc43"
|
|
59
59
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-16181756.js","mappings":";;;;MAqBa,uBAAuB;;;;;;;;;IAI1B,KAAK,GAAG,QAAQ,CAAC;;;;IAIjB,QAAQ,CAAqB;;;;IAI7B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,OAAO,EAAE,IAAI,CAAC,YAAY,EAC1B,IAAI,EAAC,QAAQ,IAEb,4DAAK,KAAK,EAAC,kCAAkC,GAAG,CACzC,CACL,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-toggle-button/searchcraft-toggle-button.tsx"],"sourcesContent":["import type { SearchcraftCore } from '@classes';\nimport { registry } from '@classes/CoreInstanceRegistry';\nimport {\n Component,\n Event,\n h,\n Prop,\n State,\n type EventEmitter,\n} from '@stencil/core';\nimport classNames from 'classnames';\n\n/**\n * This web component simulates a light switch functionality, providing a simple and intuitive toggle between two states—on and off.\n *\n * @internal\n */\n@Component({\n tag: 'searchcraft-toggle-button',\n shadow: false,\n})\nexport class SearchcraftToggleButton {\n /**\n * The label.\n */\n @Prop() label = 'Toggle';\n /**\n * The secondary label displayed below the main label.\n */\n @Prop() subLabel: string | undefined;\n /**\n * The id of the Searchcraft instance that this component should use.\n */\n @Prop() searchcraftId?: string;\n\n /**\n * When the toggle element is changed.\n */\n @Event() toggleUpdated?: EventEmitter<boolean>;\n\n @State() isActive = false;\n @State() lastSearchTerm: string | undefined;\n private unsubscribe: (() => void) | undefined;\n private cleanupCore?: () => void;\n\n private handleToggle = async () => {\n this.isActive = !this.isActive;\n this.toggleUpdated?.emit(this.isActive);\n };\n\n onCoreAvailable(core: SearchcraftCore) {\n /** When the query changes, sets toggle button state back to inactive. */\n this.unsubscribe = core.store.subscribe((state) => {\n if (\n state.searchTerm !== this.lastSearchTerm &&\n state.searchTerm.trim().length === 0\n ) {\n this.isActive = false;\n }\n this.lastSearchTerm = state.searchTerm;\n });\n }\n\n connectedCallback() {\n this.cleanupCore = registry.useCoreInstance(\n this.searchcraftId,\n this.onCoreAvailable.bind(this),\n );\n }\n\n disconnectedCallback() {\n this.unsubscribe?.();\n this.cleanupCore?.();\n }\n\n render() {\n return (\n <div\n class={classNames('searchcraft-toggle-button', {\n 'searchcraft-toggle-button-active': this.isActive,\n })}\n >\n <div>\n <p class='searchcraft-toggle-button-label'>{this.label}</p>\n {this.subLabel && (\n <p class='searchcraft-toggle-button-sub-label'>{this.subLabel}</p>\n )}\n </div>\n <button\n class='searchcraft-toggle-button-background'\n onClick={this.handleToggle}\n type='button'\n >\n <div class='searchcraft-toggle-button-handle' />\n </button>\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-3286bbb3.js","mappings":";;;;MAoBa,uBAAuB;;;;;IAC1B,IAAI,CAA4B;;;;IAIhC,KAAK,CAAU;;;;IAIf,gBAAgB,GAAG,CAAC,CAAC;;;;IAIrB,QAAQ,CAAkD;;;;IAI1D,aAAa,CAAU;IAEtB,YAAY,CAAqB;;IAE1C,IAAI,CAAmB;IACf,WAAW,CAAc;IAEjC,eAAe,CAAC,IAAqB;QACnC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;KAClB;IAED,iBAAiB;QACf,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,eAAe,CACzC,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAChC,CAAC;QAEF,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,IAAI;gBACF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,EAAE;oBAClE,IAAI;oBACJ,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY;iBACrC,CAAC,CAAC;aACJ;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;aACzD;SACF;KACF;IAED,oBAAoB;QAClB,IAAI,CAAC,WAAW,IAAI,CAAC;KACtB;IAED,0BAA0B,GAAG,CAAC,KAAiB;QAC7C,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;YACjB,OAAO;SACR;QAED,MAAM,MAAM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,CAAC,YAAY,EAC5B,OAAO,EAAE,IAAI,CAAC,0BAA0B,EACxC,SAAS,EAAE,IAAI,CAAC,aAAa,GAC7B,EACF;KACH;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-search-result/searchcraft-search-result.tsx"],"sourcesContent":["import type {\n SearchClientResponseItem,\n SearchResultTemplate,\n SearchResultTemplateData,\n} from '@types';\nimport { Component, Element, h, Prop, State } from '@stencil/core';\n\nimport { html } from '@utils';\nimport type { SearchcraftCore } from '@classes';\nimport { registry } from '@classes/CoreInstanceRegistry';\n\n/**\n * This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.\n *\n * @internal\n */\n@Component({\n tag: 'searchcraft-search-result',\n shadow: false,\n})\nexport class SearchcraftSearchResult {\n @Prop() item?: SearchClientResponseItem;\n /**\n * The index.\n */\n @Prop() index!: number;\n /**\n * The position in the document. Used with the \"document_clicked\" measure event.\n */\n @Prop() documentPosition = 0;\n /**\n * A callback function responsible for rendering a result.\n */\n @Prop() template?: SearchResultTemplate<SearchResultTemplateData>;\n /**\n * The id of the Searchcraft instance that this component should use.\n */\n @Prop() searchcraftId?: string;\n\n @State() templateHtml: string | undefined;\n @Element() hostElement?: HTMLElement;\n core?: SearchcraftCore;\n private cleanupCore?: () => void;\n\n onCoreAvailable(core: SearchcraftCore) {\n this.core = core;\n }\n\n connectedCallback() {\n this.cleanupCore = registry.useCoreInstance(\n this.searchcraftId,\n this.onCoreAvailable.bind(this),\n );\n\n if (this.item) {\n try {\n this.templateHtml = this.template?.(this.item.document, this.index, {\n html,\n source_index: this.item.source_index,\n });\n } catch (error) {\n console.error('Invalid search result template:', error);\n }\n }\n }\n\n disconnectedCallback() {\n this.cleanupCore?.();\n }\n\n handleResultContainerClick = (event: MouseEvent) => {\n if (!event.target) {\n return;\n }\n\n const target = event.target as HTMLElement;\n const link = target.closest('a');\n\n if (\n !link ||\n !this.hostElement?.contains(link) ||\n !this.core ||\n !this.core.measureClient\n ) {\n return;\n }\n\n const document_position = this.documentPosition;\n const search_term = this.core.store.getState().searchTerm;\n const number_of_documents =\n this.core.store.getState().searchClientResponseItems.length || 0;\n\n this.core.measureClient.sendMeasureEvent('document_clicked', {\n document_position,\n number_of_documents,\n search_term,\n });\n };\n\n handleKeyDown = () => {};\n\n render() {\n if (!this.item) {\n return;\n }\n\n if (typeof this.template === 'undefined') {\n return (\n <div\n class='searchcraft-search-result searchcraft-search-result-no-template'\n onClick={this.handleResultContainerClick}\n onKeyDown={this.handleKeyDown}\n >\n {Object.entries(this.item.document).map(([key, value]) => (\n <p key={key}>\n <strong>{key}</strong>: {value}\n </p>\n ))}\n </div>\n );\n }\n\n return (\n <div\n class='searchcraft-search-result'\n innerHTML={this.templateHtml}\n onClick={this.handleResultContainerClick}\n onKeyDown={this.handleKeyDown}\n />\n );\n }\n}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-38b2dad0.js","mappings":";;;;;MAmBa,0BAA0B;;;;;IAC7B,IAAI,CAAuC;IAC3C,qBAAqB,CAAoC;;IAEzD,gBAAgB,GAAG,CAAC,CAAC;;;;IAIrB,aAAa,CAAU;IAEtB,KAAK,CAAU;IACf,QAAQ,CAAU;IAClB,IAAI,CAAU;IACd,WAAW,CAAU;IACrB,QAAQ,CAAU;IAC3B,IAAI,CAAmB;IACf,WAAW,CAAc;IAEjC,qBAAqB,CAAC,QAAwB;QAC5C,IAAI,CAAC,KAAK,GAAG,uCAAuC,CAClD,QAAQ,EACR,IAAI,CAAC,qBAAqB,EAAE,KAAK,CAClC,CAAC;QACF,IAAI,CAAC,QAAQ,GAAG,uCAAuC,CACrD,QAAQ,EACR,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CACrC,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,uCAAuC,CACjD,QAAQ,EACR,IAAI,CAAC,qBAAqB,EAAE,IAAI,CACjC,CAAC;QACF,IAAI,CAAC,WAAW,GAAG,uCAAuC,CACxD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,CAAC,WAAW,KACf,4DAAK,KAAK,EAAC,6CAA6C,IACtD,4DACE,GAAG,EAAE,IAAI,CAAC,QAAQ,EAClB,GAAG,EAAE,IAAI,CAAC,WAAW,EACrB,KAAK,EAAC,qCAAqC,GAC3C,CACE,CACP,EACD,4DAAK,KAAK,EAAC,uCAAuC,IAC/C,IAAI,CAAC,KAAK,KACT,0DAAG,KAAK,EAAC,6CAA6C,IACnD,IAAI,CAAC,KAAK,CACT,CACL,EACA,IAAI,CAAC,QAAQ,KACZ,0DAAG,KAAK,EAAC,gDAAgD,IACtD,IAAI,CAAC,QAAQ,CACZ,CACL,CACG,CACJ,CACA,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-popover-list-item/searchcraft-popover-list-item.tsx"],"sourcesContent":["import type {\n SearchDocument,\n SearchClientResponseItem,\n PopoverResultMappings,\n} from '@types';\nimport { Component, h, Prop, State } from '@stencil/core';\nimport { getDocumentValueFromSearchResultMapping } from '@utils';\nimport type { SearchcraftCore } from '@classes';\nimport { registry } from '@classes/CoreInstanceRegistry';\n\n/**\n * A single list item rendered in a searchcraft-popover-list-view.\n *\n * @internal\n */\n@Component({\n tag: 'searchcraft-popover-list-item',\n shadow: false,\n})\nexport class SearchcraftPopoverListItem {\n @Prop() item: SearchClientResponseItem | undefined;\n @Prop() popoverResultMappings: PopoverResultMappings | undefined;\n /** The document position relative to the search results (For Measure) */\n @Prop() documentPosition = 0;\n /**\n * The id of the Searchcraft instance that this component should use.\n */\n @Prop() searchcraftId?: string;\n\n @State() title?: string;\n @State() subtitle?: string;\n @State() href?: string;\n @State() imageSource?: string;\n @State() imageAlt?: string;\n core?: SearchcraftCore;\n private cleanupCore?: () => void;\n\n mapValuesFromDocument(document: SearchDocument) {\n this.title = getDocumentValueFromSearchResultMapping(\n document,\n this.popoverResultMappings?.title,\n );\n this.subtitle = getDocumentValueFromSearchResultMapping(\n document,\n this.popoverResultMappings?.subtitle,\n );\n this.href = getDocumentValueFromSearchResultMapping(\n document,\n this.popoverResultMappings?.href,\n );\n this.imageSource = getDocumentValueFromSearchResultMapping(\n document,\n this.popoverResultMappings?.imageSource,\n );\n this.imageAlt = getDocumentValueFromSearchResultMapping(\n document,\n this.popoverResultMappings?.imageAlt,\n );\n }\n\n onCoreAvailable(core: SearchcraftCore) {\n this.core = core;\n }\n\n connectedCallback() {\n if (this.item) {\n this.mapValuesFromDocument(this.item.document);\n }\n this.cleanupCore = registry.useCoreInstance(\n this.searchcraftId,\n this.onCoreAvailable.bind(this),\n );\n }\n\n disconnectedCallback() {\n this.cleanupCore?.();\n }\n\n handleLinkClick = () => {\n if (this.core) {\n const document_position = this.documentPosition;\n const search_term = this.core.store.getState().searchTerm;\n const number_of_documents =\n this.core.store.getState().searchClientResponseItems.length || 0;\n\n this.core.measureClient?.sendMeasureEvent('document_clicked', {\n document_position,\n number_of_documents,\n search_term,\n });\n }\n };\n\n render() {\n return (\n <div class='searchcraft-popover-list-item'>\n <a\n class='searchcraft-popover-list-item-link'\n href={this.href}\n onClick={this.handleLinkClick.bind(this)}\n >\n {this.imageSource && (\n <div class='searchcraft-popover-list-item-image-wrapper'>\n <img\n alt={this.imageAlt}\n src={this.imageSource}\n class='searchcraft-popover-list-item-image'\n />\n </div>\n )}\n <div class='searchcraft-popover-list-item-content'>\n {this.title && (\n <p class='searchcraft-popover-list-item-content-title'>\n {this.title}\n </p>\n )}\n {this.subtitle && (\n <p class='searchcraft-popover-list-item-content-subtitle'>\n {this.subtitle}\n </p>\n )}\n </div>\n </a>\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-3d2107af.js","mappings":";;;;;MAea,wBAAwB;;;;;;;;IAI3B,aAAa,CAAU;IACtB,kBAAkB,CAAC;IAEpB,WAAW,GAAe,SAAQ,CAAC;IACnC,WAAW,CAAc;IAEjC,eAAe,CAAC,IAAqB;QACnC,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,kBAAkB,CAAC;QAEnE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,KAAK;YAC5C,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,kBAAkB,CAAC;SACpD,CAAC,CAAC;KACJ;IAED,iBAAiB;QACf,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,eAAe,CACzC,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAChC,CAAC;KACH;IAED,oBAAoB;QAClB,IAAI,CAAC,WAAW,IAAI,CAAC;QACrB,IAAI,CAAC,WAAW,IAAI,CAAC;KACtB;IAED,MAAM;QACJ,QACE,+DAAQ,KAAK,EAAC,4BAA4B,IACxC,0DAAG,KAAK,EAAC,yCAAyC,IAC/C,IAAI,CAAC,kBAAkB;cACpB,GAAG,sBAAsB,CAAC,IAAI,CAAC,kBAAkB,CAAC,gBAAgB;cAClE,GAAG,CACL,EACJ,0DACE,KAAK,EAAC,iCAAiC,EACvC,IAAI,EAAC,yBAAyB,EAC9B,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,YAAY,IAEhB,4DACE,KAAK,EAAC,uCAAuC,EAC7C,KAAK,EAAC,KAAK,EACX,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,YAAY,EACpB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,IAElC,yFAAqC,EACrC,6DACE,CAAC,EAAC,kmOAAkmO,EACpmO,IAAI,EAAC,cAAc,GACnB,CACE,CACJ,CACG,EACT;KACH;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-popover-footer/searchcraft-popover-footer.tsx"],"sourcesContent":["import type { SearchcraftCore } from '@classes';\nimport { registry } from '@classes/CoreInstanceRegistry';\nimport { Component, h, Prop, State } from '@stencil/core';\n\nimport { formatNumberWithCommas } from '@utils';\n\n/**\n * Renders the footer for the searchcraft-popover-form.\n *\n * @internal\n */\n@Component({\n tag: 'searchcraft-popover-footer',\n shadow: false,\n})\nexport class SearchcraftPopoverFooter {\n /**\n * The id of the Searchcraft instance that this component should use.\n */\n @Prop() searchcraftId?: string;\n @State() searchResultsCount;\n\n private unsubscribe: () => void = () => {};\n private cleanupCore?: () => void;\n\n onCoreAvailable(core: SearchcraftCore) {\n this.searchResultsCount = core.store.getState().searchResultsCount;\n\n this.unsubscribe = core.store.subscribe((state) => {\n this.searchResultsCount = state.searchResultsCount;\n });\n }\n\n connectedCallback() {\n this.cleanupCore = registry.useCoreInstance(\n this.searchcraftId,\n this.onCoreAvailable.bind(this),\n );\n }\n\n disconnectedCallback() {\n this.unsubscribe?.();\n this.cleanupCore?.();\n }\n\n render() {\n return (\n <footer class='searchcraft-popover-footer'>\n <p class='searchcraft-popover-footer-results-info'>\n {this.searchResultsCount\n ? `${formatNumberWithCommas(this.searchResultsCount)} Results Found`\n : ' '}\n </p>\n <a\n class='searchcraft-popover-footer-link'\n href='https://searchcraft.io/'\n target='_blank'\n rel='noreferrer'\n >\n <svg\n class='searchcraft-popover-footer-link-image'\n width='169'\n height='16'\n viewBox='0 0 169 16'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n >\n <title>Powered by Searchcraft</title>\n <path\n d='M5.07288 0.608C7.60088 0.608 8.84888 2.064 8.84888 4.112C8.84888 6.16 7.60088 7.616 5.07288 7.616H1.68088V12H0.336875V0.608H5.07288ZM5.07288 6.4C6.67288 6.4 7.45688 5.552 7.45688 4.112C7.45688 2.672 6.67288 1.824 5.07288 1.824H1.68088V6.4H5.07288ZM13.31 12.192C10.99 12.192 9.31 10.512 9.31 7.872C9.31 5.232 10.99 3.552 13.31 3.552C15.63 3.552 17.31 5.232 17.31 7.872C17.31 10.512 15.63 12.192 13.31 12.192ZM13.31 11.04C14.91 11.04 15.966 9.872 15.966 7.872C15.966 5.872 14.91 4.704 13.31 4.704C11.71 4.704 10.654 5.872 10.654 7.872C10.654 9.872 11.71 11.04 13.31 11.04ZM28.3826 3.744H29.7586L27.0066 12H25.6626L24.4466 8.176C24.1586 7.264 23.8706 6.304 23.6146 5.376C23.3426 6.304 23.0546 7.264 22.7666 8.176L21.5666 12H20.2226L17.4706 3.744H18.8466L20.0146 7.472C20.3346 8.48 20.6226 9.472 20.9106 10.48C21.1826 9.472 21.4706 8.48 21.7906 7.472L22.9426 3.744H24.2866L25.4386 7.472C25.7426 8.464 26.0466 9.456 26.3346 10.448C26.6066 9.456 26.9106 8.464 27.2146 7.472L28.3826 3.744ZM37.5194 7.872V8.32H31.2474C31.3754 10.176 32.3514 11.024 33.7914 11.024C34.9594 11.024 35.6954 10.416 35.9834 9.488H37.3114C36.9114 11.04 35.7274 12.192 33.7594 12.192C31.5034 12.192 29.9194 10.544 29.9194 7.872C29.9194 5.28 31.4394 3.552 33.7274 3.552C36.1914 3.552 37.5194 5.504 37.5194 7.872ZM33.7274 4.72C32.4314 4.72 31.4874 5.536 31.2794 7.168H36.1434C36.0154 5.808 35.1994 4.72 33.7274 4.72ZM42.9101 3.616C43.0381 3.616 43.1661 3.616 43.3421 3.632V4.864H43.0221C41.3741 4.864 40.3181 5.696 40.3181 7.296V12H39.0381V3.744H40.2541V5.2C40.7181 4.336 41.5661 3.616 42.9101 3.616ZM51.2538 7.872V8.32H44.9818C45.1098 10.176 46.0858 11.024 47.5258 11.024C48.6938 11.024 49.4298 10.416 49.7178 9.488H51.0458C50.6458 11.04 49.4618 12.192 47.4938 12.192C45.2378 12.192 43.6538 10.544 43.6538 7.872C43.6538 5.28 45.1738 3.552 47.4618 3.552C49.9258 3.552 51.2538 5.504 51.2538 7.872ZM47.4618 4.72C46.1658 4.72 45.2218 5.536 45.0138 7.168H49.8778C49.7498 5.808 48.9338 4.72 47.4618 4.72ZM58.9805 0.608H60.2605V12H59.0445V10.72C58.4205 11.664 57.4445 12.192 56.2125 12.192C53.8925 12.192 52.3725 10.512 52.3725 7.872C52.3725 5.232 53.8925 3.552 56.2125 3.552C57.4125 3.552 58.3565 4.048 58.9805 4.928V0.608ZM56.3725 11.04C57.9725 11.04 59.0285 9.872 59.0285 7.872C59.0285 5.872 57.9725 4.704 56.3725 4.704C54.7725 4.704 53.7165 5.936 53.7165 7.936C53.7165 9.936 54.7725 11.04 56.3725 11.04ZM69.2736 3.552C71.5936 3.552 73.1136 5.232 73.1136 7.872C73.1136 10.512 71.5936 12.192 69.2736 12.192C68.0416 12.192 67.0656 11.664 66.4416 10.72V12H65.2256V0.608H66.5056V4.928C67.1296 4.048 68.0736 3.552 69.2736 3.552ZM69.1136 11.04C70.7136 11.04 71.7696 9.808 71.7696 7.808C71.7696 5.808 70.7136 4.704 69.1136 4.704C67.5136 4.704 66.4576 5.872 66.4576 7.872C66.4576 9.872 67.5136 11.04 69.1136 11.04ZM79.3795 3.744H80.7715L77.2835 13.296C76.7555 14.752 75.9075 15.184 74.5955 15.184C74.3395 15.184 74.0995 15.168 73.8275 15.136V14.064H74.5795C75.3955 14.064 75.8275 13.696 76.0835 13.04C76.1795 12.8 76.2755 12.528 76.3715 12.272L73.2675 3.744H74.6755L75.8435 7.184C76.2595 8.384 76.6435 9.568 77.0275 10.752C77.3955 9.568 77.7955 8.368 78.2115 7.168L79.3795 3.744ZM89.1546 12.256C86.1146 12.256 84.2906 10.864 84.2746 8.24H86.4026C86.4346 10.032 87.6346 10.512 89.2186 10.512C90.7066 10.512 91.5226 9.936 91.5226 8.864C91.5226 7.968 90.9306 7.568 89.1866 7.216L88.2266 7.024C86.0186 6.608 84.5626 5.632 84.5626 3.568C84.5626 1.68 86.0506 0.351999 88.7866 0.351999C91.9866 0.351999 93.3466 1.856 93.4266 4H91.3306C91.2506 2.784 90.6266 2.096 88.8186 2.096C87.4426 2.096 86.7706 2.64 86.7706 3.504C86.7706 4.416 87.2986 4.832 88.9946 5.184L89.9866 5.376C92.6746 5.904 93.7626 6.944 93.7626 8.752C93.7626 11.008 92.0026 12.256 89.1546 12.256ZM102.952 8.016V8.496H96.7758C96.9198 9.968 97.7518 10.624 98.9198 10.624C99.8798 10.624 100.504 10.176 100.808 9.44H102.744C102.328 11.12 100.888 12.192 98.9038 12.192C96.4718 12.192 94.7918 10.512 94.7918 7.872C94.7918 5.28 96.4238 3.552 98.8718 3.552C101.4 3.552 102.952 5.392 102.952 8.016ZM98.8558 5.12C97.7838 5.12 96.9838 5.728 96.7918 7.088H100.936C100.776 5.92 100.056 5.12 98.8558 5.12ZM111.599 12H109.583C109.455 11.776 109.391 11.392 109.359 10.992C108.815 11.76 107.919 12.192 106.703 12.192C104.943 12.192 103.727 11.312 103.727 9.712C103.727 8.336 104.559 7.36 106.895 7.136L108.143 7.024C108.911 6.928 109.311 6.688 109.311 6.08C109.311 5.44 108.975 5.056 107.807 5.056C106.655 5.056 106.175 5.36 106.095 6.368H104.111C104.223 4.624 105.247 3.552 107.823 3.552C110.287 3.552 111.263 4.544 111.263 6.032V10.432C111.263 11.024 111.375 11.68 111.599 12ZM107.183 10.752C108.255 10.752 109.311 10.176 109.311 8.736V7.984C109.103 8.176 108.799 8.272 108.367 8.32L107.279 8.448C106.159 8.576 105.791 8.976 105.791 9.632C105.791 10.32 106.255 10.752 107.183 10.752ZM117.216 3.616C117.392 3.616 117.536 3.616 117.712 3.648V5.504H117.2C115.712 5.504 114.816 6.24 114.816 7.808V12H112.8V3.744H114.752V5.216C115.152 4.288 115.936 3.616 117.216 3.616ZM122.137 12.192C119.689 12.192 118.057 10.512 118.057 7.872C118.057 5.232 119.673 3.552 122.137 3.552C124.297 3.552 125.737 4.784 125.977 6.72H123.961C123.769 5.696 123.033 5.232 122.137 5.232C120.937 5.232 120.121 6.064 120.121 7.872C120.121 9.68 120.969 10.512 122.137 10.512C123.049 10.512 123.833 10.016 123.993 8.928H126.009C125.785 10.944 124.249 12.192 122.137 12.192ZM131.641 3.552C133.369 3.552 134.537 4.56 134.537 6.528V12H132.521V6.864C132.521 5.808 131.993 5.296 130.969 5.296C130.089 5.296 129.129 5.904 129.129 7.376V12H127.113V0.608H129.129V4.848C129.673 4.096 130.521 3.552 131.641 3.552ZM139.887 12.192C137.439 12.192 135.807 10.512 135.807 7.872C135.807 5.232 137.423 3.552 139.887 3.552C142.047 3.552 143.487 4.784 143.727 6.72H141.711C141.519 5.696 140.783 5.232 139.887 5.232C138.687 5.232 137.871 6.064 137.871 7.872C137.871 9.68 138.719 10.512 139.887 10.512C140.799 10.512 141.583 10.016 141.743 8.928H143.759C143.535 10.944 141.999 12.192 139.887 12.192ZM149.279 3.616C149.455 3.616 149.599 3.616 149.775 3.648V5.504H149.263C147.775 5.504 146.879 6.24 146.879 7.808V12H144.863V3.744H146.815V5.216C147.215 4.288 147.999 3.616 149.279 3.616ZM157.803 12H155.787C155.659 11.776 155.595 11.392 155.563 10.992C155.019 11.76 154.123 12.192 152.907 12.192C151.147 12.192 149.931 11.312 149.931 9.712C149.931 8.336 150.763 7.36 153.099 7.136L154.347 7.024C155.115 6.928 155.515 6.688 155.515 6.08C155.515 5.44 155.179 5.056 154.011 5.056C152.859 5.056 152.379 5.36 152.299 6.368H150.315C150.427 4.624 151.451 3.552 154.027 3.552C156.491 3.552 157.467 4.544 157.467 6.032V10.432C157.467 11.024 157.579 11.68 157.803 12ZM153.387 10.752C154.459 10.752 155.515 10.176 155.515 8.736V7.984C155.307 8.176 155.003 8.272 154.571 8.32L153.483 8.448C152.363 8.576 151.995 8.976 151.995 9.632C151.995 10.32 152.459 10.752 153.387 10.752ZM162.466 2.16C161.746 2.16 161.426 2.512 161.426 3.152V3.744H163.122V5.28H161.426V12H159.426V5.28H158.146V3.744H159.426V3.12C159.426 1.664 160.146 0.559999 162.13 0.559999C162.45 0.559999 162.882 0.575999 163.17 0.608V2.16H162.466ZM168.636 5.28H167.004V9.744C167.004 10.288 167.276 10.464 167.948 10.464H168.636V12C168.268 12.032 167.9 12.064 167.58 12.064C165.836 12.064 165.004 11.472 165.004 9.952V5.28H163.724V3.744H165.004V1.344H167.004V3.744H168.636V5.28Z'\n fill='currentColor'\n />\n </svg>\n </a>\n </footer>\n );\n }\n}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-46ddde99.js","mappings":";;MAWa,qBAAqB;;;;;IACxB,KAAK,CAAU;IAEvB,MAAM;QACJ,QACE,4DAAK,KAAK,EAAC,qBAAqB,IAC9B,4DAAK,KAAK,EAAC,0BAA0B,IACnC,4DAAK,KAAK,EAAC,2BAA2B,GAAG,EACzC,4DAAK,KAAK,EAAC,2BAA2B,GAAG,EACzC,4DAAK,KAAK,EAAC,2BAA2B,GAAG,EACzC,4DAAK,KAAK,EAAC,2BAA2B,GAAG,EACzC,4DAAK,KAAK,EAAC,2BAA2B,GAAG,EACzC,4DAAK,KAAK,EAAC,2BAA2B,GAAG,CACrC,EACN,0DAAG,KAAK,EAAC,2BAA2B,IAAE,IAAI,CAAC,KAAK,CAAK,CACjD,EACN;KACH;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-loading/searchcraft-loading.tsx"],"sourcesContent":["import { Component, h, Prop } from '@stencil/core';\n\n/**\n * Renders a loading spinner/loading state for use in things like the summary box.\n *\n * @internal\n */\n@Component({\n tag: 'searchcraft-loading',\n shadow: false,\n})\nexport class SearchcraftInputLabel {\n @Prop() label?: string;\n\n render() {\n return (\n <div class='searchcraft-loading'>\n <div class='searchcraft-loading-bars'>\n <div class='searchcraft-loading-bar-1' />\n <div class='searchcraft-loading-bar-2' />\n <div class='searchcraft-loading-bar-3' />\n <div class='searchcraft-loading-bar-4' />\n <div class='searchcraft-loading-bar-5' />\n <div class='searchcraft-loading-bar-6' />\n </div>\n <p class='searchcraft-loading-label'>{this.label}</p>\n </div>\n );\n }\n}\n"],"version":3}
|