@coveops/abi 0.4.1 → 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.
Files changed (61) hide show
  1. package/dist/abi/abi.css +1 -1
  2. package/dist/abi/abi.esm.js +1 -1
  3. package/dist/abi/p-0f4a7ce9.js +49 -0
  4. package/dist/abi/p-52c70e74.js +2 -0
  5. package/dist/abi/p-5a5f74eb.entry.js +1 -0
  6. package/dist/abi/p-adb4a9f9.entry.js +1 -0
  7. package/dist/abi/p-b62c5f66.entry.js +1 -0
  8. package/dist/abi/p-b83bab81.js +1 -0
  9. package/dist/abi/p-d20ee37c.js +18 -0
  10. package/dist/abi/p-f23dd119.entry.js +1 -0
  11. package/dist/bundle/index.css +1 -1
  12. package/dist/bundle/index.html +6 -6
  13. package/dist/bundle/index.js +172 -93
  14. package/dist/cjs/abi.cjs.js +2 -2
  15. package/dist/cjs/faq-popup-component.cjs.entry.js +10 -36
  16. package/dist/cjs/{index-daa118f5.js → headless.esm-085e70ed-f2e18485.js} +0 -96
  17. package/dist/cjs/index-03be0841.js +100 -0
  18. package/dist/cjs/{index-bea59ea1.js → index-9c1d2337.js} +25 -0
  19. package/dist/cjs/loader.cjs.js +2 -2
  20. package/dist/cjs/result-template-decorators-881a4c8e-4ff46481.js +33 -0
  21. package/dist/cjs/results-manager.cjs.entry.js +11 -11
  22. package/dist/cjs/sample-component.cjs.entry.js +3 -2
  23. package/dist/cjs/strip-html-component.cjs.entry.js +60 -0
  24. package/dist/collection/collection-manifest.json +2 -1
  25. package/dist/collection/components/strip-html-component/strip-html-component.css +3 -0
  26. package/dist/collection/components/strip-html-component/strip-html-component.js +64 -0
  27. package/dist/components/index.d.ts +6 -0
  28. package/dist/components/index.js +92 -12
  29. package/dist/esm/abi.js +2 -2
  30. package/dist/esm/faq-popup-component.entry.js +4 -30
  31. package/dist/esm/{index-77ebb3d5.js → headless.esm-085e70ed-c4dfb380.js} +1 -93
  32. package/dist/esm/index-42e9a708.js +95 -0
  33. package/dist/esm/{index-51334f26.js → index-8b0b351b.js} +25 -0
  34. package/dist/esm/loader.js +2 -2
  35. package/dist/esm/result-template-decorators-881a4c8e-ed85ad21.js +31 -0
  36. package/dist/esm/results-manager.entry.js +11 -11
  37. package/dist/esm/sample-component.entry.js +3 -2
  38. package/dist/esm/strip-html-component.entry.js +56 -0
  39. package/dist/types/components/strip-html-component/strip-html-component.d.ts +14 -0
  40. package/dist/types/components.d.ts +13 -0
  41. package/package.json +1 -1
  42. package/src/components/results-manager/AppTemplate.html +33 -15
  43. package/src/components/results-manager/DocumentsTemplate.html +16 -4
  44. package/src/components/results-manager/ELearningTemplate.html +10 -8
  45. package/src/components/results-manager/FAQTemplate.html +11 -6
  46. package/src/components/results-manager/KATemplate.html +12 -8
  47. package/src/components/results-manager/MediaTemplate.html +18 -0
  48. package/src/components/results-manager/PeopleTemplate.html +3 -3
  49. package/src/components/results-manager/QuickLinksTemplate.html +16 -4
  50. package/src/components/results-manager/SitePagesTemplate.html +8 -2
  51. package/src/components/results-manager/template-1.html +83 -41
  52. package/src/components/strip-html-component/strip-html-component.css +3 -0
  53. package/src/components/strip-html-component/strip-html-component.tsx +77 -0
  54. package/src/components.d.ts +13 -0
  55. package/src/pages/index.html +6 -6
  56. package/src/style/index.css +13 -4
  57. package/dist/abi/p-0ae1e588.js +0 -2
  58. package/dist/abi/p-27bd9f1c.entry.js +0 -1
  59. package/dist/abi/p-63fd8dcd.js +0 -66
  60. package/dist/abi/p-e04b6a2c.entry.js +0 -1
  61. package/dist/abi/p-fc39046e.entry.js +0 -1
@@ -217,6 +217,31 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
217
217
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
218
218
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
219
219
  }
220
+ else if (memberName === 'style') {
221
+ // update style attribute, css properties and values
222
+ {
223
+ for (const prop in oldValue) {
224
+ if (!newValue || newValue[prop] == null) {
225
+ if (prop.includes('-')) {
226
+ elm.style.removeProperty(prop);
227
+ }
228
+ else {
229
+ elm.style[prop] = '';
230
+ }
231
+ }
232
+ }
233
+ }
234
+ for (const prop in newValue) {
235
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
236
+ if (prop.includes('-')) {
237
+ elm.style.setProperty(prop, newValue[prop]);
238
+ }
239
+ else {
240
+ elm.style[prop] = newValue[prop];
241
+ }
242
+ }
243
+ }
244
+ }
220
245
  else if ((!isProp ) &&
221
246
  memberName[0] === 'o' &&
222
247
  memberName[1] === 'n') {
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-51334f26.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-8b0b351b.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Esm v2.17.3 | MIT Licensed | https://stenciljs.com
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["faq-popup-component",[[1,"faq-popup-component",{"result":[32]}]]],["results-manager",[[0,"results-manager"]]],["sample-component",[[1,"sample-component",{"pagerState":[32],"statusState":[32]}]]]], options);
13
+ return bootstrapLazy([["faq-popup-component",[[1,"faq-popup-component",{"result":[32]}]]],["results-manager",[[0,"results-manager"]]],["sample-component",[[1,"sample-component",{"pagerState":[32],"statusState":[32]}]]],["strip-html-component",[[1,"strip-html-component",{"result":[32]}]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -0,0 +1,31 @@
1
+ import { b as buildCustomEvent, c as closest } from './headless.esm-085e70ed-c4dfb380.js';
2
+
3
+ class MissingResultParentError extends Error {
4
+ constructor(elementName) {
5
+ super(`The "${elementName}" element must be the child of an "atomic-result" element.`);
6
+ }
7
+ }
8
+ const resultContextEventName = 'atomic/resolveResult';
9
+ /**
10
+ * Retrieves `Result` on a rendered `atomic-result`.
11
+ *
12
+ * This method is useful for building custom result template elements, see [Create a Result List](https://docs.coveo.com/en/atomic/latest/usage/create-a-result-list/) for more information.
13
+ *
14
+ * You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).
15
+ *
16
+ * @param element The element that the event is dispatched to, which must be the child of a rendered "atomic-result".
17
+ * @returns A promise that resolves on initialization of the parent "atomic-result" element, or rejects when there is no parent "atomic-result" element.
18
+ */
19
+ function resultContext(element) {
20
+ return new Promise((resolve, reject) => {
21
+ const event = buildCustomEvent(resultContextEventName, (result) => {
22
+ return resolve(result);
23
+ });
24
+ element.dispatchEvent(event);
25
+ if (!closest(element, 'atomic-result')) {
26
+ reject(new MissingResultParentError(element.nodeName.toLowerCase()));
27
+ }
28
+ });
29
+ }
30
+
31
+ export { resultContext as r };