@getlupa/client 0.10.3 → 0.10.6

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.
@@ -36924,7 +36924,8 @@ let SearchResultsToolbar = class SearchResultsToolbar extends Vue$1 {
36924
36924
  : Boolean((_a = this.options.toolbar) === null || _a === void 0 ? void 0 : _a.layoutSelector);
36925
36925
  }
36926
36926
  get sortOptions() {
36927
- if (this.isBottomLocation) {
36927
+ var _a;
36928
+ if (this.isBottomLocation || !((_a = this.options.sort) === null || _a === void 0 ? void 0 : _a.length)) {
36928
36929
  return undefined;
36929
36930
  }
36930
36931
  return {
@@ -40218,25 +40219,42 @@ var store = new Vuex.Store({
40218
40219
  },
40219
40220
  });
40220
40221
 
40222
+ const createShadowDom = (shadowId, managerId) => {
40223
+ let host = document.getElementById(shadowId);
40224
+ let manager = document.getElementById(managerId);
40225
+ if (!host) {
40226
+ host = document.createElement("div");
40227
+ manager = document.createElement("div");
40228
+ }
40229
+ if (!manager) {
40230
+ manager = document.createElement("div");
40231
+ }
40232
+ host.setAttribute("id", shadowId);
40233
+ manager === null || manager === void 0 ? void 0 : manager.setAttribute("id", managerId);
40234
+ return { host, manager };
40235
+ };
40221
40236
  const attatchShadowDom = ({ host, manager, styleUrl, }) => {
40237
+ if (host.shadowRoot) {
40238
+ return;
40239
+ }
40222
40240
  const link = document.createElement("link");
40223
40241
  link.type = "text/css";
40224
40242
  link.rel = "stylesheet";
40225
40243
  link.href = styleUrl;
40226
40244
  // Fonts only work when added in host document head
40227
- const linkNode = document.createElement("link");
40228
- linkNode.type = "text/css";
40229
- linkNode.rel = "stylesheet";
40230
- linkNode.href =
40245
+ const fontLink = document.createElement("link");
40246
+ fontLink.type = "text/css";
40247
+ fontLink.rel = "stylesheet";
40248
+ fontLink.href =
40231
40249
  "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap";
40232
- document.head.appendChild(linkNode);
40250
+ document.head.appendChild(fontLink);
40233
40251
  // Add font for material icons
40234
- const linkNode2 = document.createElement("link");
40235
- linkNode2.type = "text/css";
40236
- linkNode2.rel = "stylesheet";
40237
- linkNode2.href =
40252
+ const materialIconLink = document.createElement("link");
40253
+ materialIconLink.type = "text/css";
40254
+ materialIconLink.rel = "stylesheet";
40255
+ materialIconLink.href =
40238
40256
  "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,1,-50..200";
40239
- document.head.appendChild(linkNode2);
40257
+ document.head.appendChild(materialIconLink);
40240
40258
  const shadow = host.attachShadow({ mode: "open" });
40241
40259
  shadow.appendChild(manager);
40242
40260
  shadow.appendChild(link);
@@ -40340,10 +40358,7 @@ const searchContainer = (options, mountOptions) => {
40340
40358
  Vue$1.use(Vuex);
40341
40359
  const id = "lupa-search-container-manager";
40342
40360
  const shadowId = "lupa-shadow-id";
40343
- const host = document.createElement("div");
40344
- const manager = document.createElement("div");
40345
- host.setAttribute("id", shadowId);
40346
- manager.setAttribute("id", id);
40361
+ const { host, manager } = createShadowDom(shadowId, id);
40347
40362
  attatchShadowDom({
40348
40363
  host,
40349
40364
  manager,
@@ -1,3 +1,7 @@
1
+ export declare const createShadowDom: (shadowId: string, managerId: string) => {
2
+ host: HTMLElement;
3
+ manager: HTMLElement;
4
+ };
1
5
  export declare const attatchShadowDom: ({ host, manager, styleUrl, }: {
2
6
  host: HTMLElement;
3
7
  manager: HTMLElement;
@@ -36920,7 +36920,8 @@ let SearchResultsToolbar = class SearchResultsToolbar extends Vue$1 {
36920
36920
  : Boolean((_a = this.options.toolbar) === null || _a === void 0 ? void 0 : _a.layoutSelector);
36921
36921
  }
36922
36922
  get sortOptions() {
36923
- if (this.isBottomLocation) {
36923
+ var _a;
36924
+ if (this.isBottomLocation || !((_a = this.options.sort) === null || _a === void 0 ? void 0 : _a.length)) {
36924
36925
  return undefined;
36925
36926
  }
36926
36927
  return {
@@ -40214,25 +40215,42 @@ var store = new Vuex.Store({
40214
40215
  },
40215
40216
  });
40216
40217
 
40218
+ const createShadowDom = (shadowId, managerId) => {
40219
+ let host = document.getElementById(shadowId);
40220
+ let manager = document.getElementById(managerId);
40221
+ if (!host) {
40222
+ host = document.createElement("div");
40223
+ manager = document.createElement("div");
40224
+ }
40225
+ if (!manager) {
40226
+ manager = document.createElement("div");
40227
+ }
40228
+ host.setAttribute("id", shadowId);
40229
+ manager === null || manager === void 0 ? void 0 : manager.setAttribute("id", managerId);
40230
+ return { host, manager };
40231
+ };
40217
40232
  const attatchShadowDom = ({ host, manager, styleUrl, }) => {
40233
+ if (host.shadowRoot) {
40234
+ return;
40235
+ }
40218
40236
  const link = document.createElement("link");
40219
40237
  link.type = "text/css";
40220
40238
  link.rel = "stylesheet";
40221
40239
  link.href = styleUrl;
40222
40240
  // Fonts only work when added in host document head
40223
- const linkNode = document.createElement("link");
40224
- linkNode.type = "text/css";
40225
- linkNode.rel = "stylesheet";
40226
- linkNode.href =
40241
+ const fontLink = document.createElement("link");
40242
+ fontLink.type = "text/css";
40243
+ fontLink.rel = "stylesheet";
40244
+ fontLink.href =
40227
40245
  "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap";
40228
- document.head.appendChild(linkNode);
40246
+ document.head.appendChild(fontLink);
40229
40247
  // Add font for material icons
40230
- const linkNode2 = document.createElement("link");
40231
- linkNode2.type = "text/css";
40232
- linkNode2.rel = "stylesheet";
40233
- linkNode2.href =
40248
+ const materialIconLink = document.createElement("link");
40249
+ materialIconLink.type = "text/css";
40250
+ materialIconLink.rel = "stylesheet";
40251
+ materialIconLink.href =
40234
40252
  "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,1,-50..200";
40235
- document.head.appendChild(linkNode2);
40253
+ document.head.appendChild(materialIconLink);
40236
40254
  const shadow = host.attachShadow({ mode: "open" });
40237
40255
  shadow.appendChild(manager);
40238
40256
  shadow.appendChild(link);
@@ -40336,10 +40354,7 @@ const searchContainer = (options, mountOptions) => {
40336
40354
  Vue$1.use(Vuex);
40337
40355
  const id = "lupa-search-container-manager";
40338
40356
  const shadowId = "lupa-shadow-id";
40339
- const host = document.createElement("div");
40340
- const manager = document.createElement("div");
40341
- host.setAttribute("id", shadowId);
40342
- manager.setAttribute("id", id);
40357
+ const { host, manager } = createShadowDom(shadowId, id);
40343
40358
  attatchShadowDom({
40344
40359
  host,
40345
40360
  manager,
@@ -1,3 +1,7 @@
1
+ export declare const createShadowDom: (shadowId: string, managerId: string) => {
2
+ host: HTMLElement;
3
+ manager: HTMLElement;
4
+ };
1
5
  export declare const attatchShadowDom: ({ host, manager, styleUrl, }: {
2
6
  host: HTMLElement;
3
7
  manager: HTMLElement;