@prezly/theme-kit-core 9.7.0 → 9.8.0

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.
@@ -3,8 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.PRIVACY_PORTAL_URL = exports.OG_IMAGE_API_URL = exports.DEFAULT_PAGE_SIZE = exports.DEFAULT_GALLERY_PAGE_SIZE = exports.ASSETS_CDN_URL = void 0;
6
+ exports.PRIVACY_PORTAL_URL = exports.OG_IMAGE_API_URL = exports.DEFAULT_PAGE_SIZE = exports.DEFAULT_GALLERY_PAGE_SIZE = exports.ASSETS_SECONDARY_CDN_URL = exports.ASSETS_CDN_URL = void 0;
7
7
  var ASSETS_CDN_URL = exports.ASSETS_CDN_URL = 'https://cdn.uc.assets.prezly.com';
8
+ var ASSETS_SECONDARY_CDN_URL = exports.ASSETS_SECONDARY_CDN_URL = 'https://ucarecdn.com';
8
9
  var DEFAULT_PAGE_SIZE = exports.DEFAULT_PAGE_SIZE = 12;
9
10
  var DEFAULT_GALLERY_PAGE_SIZE = exports.DEFAULT_GALLERY_PAGE_SIZE = 6;
10
11
  var OG_IMAGE_API_URL = exports.OG_IMAGE_API_URL = 'https://og.prezly.com/api/og';
@@ -1,4 +1,5 @@
1
1
  export declare const ASSETS_CDN_URL = "https://cdn.uc.assets.prezly.com";
2
+ export declare const ASSETS_SECONDARY_CDN_URL = "https://ucarecdn.com";
2
3
  export declare const DEFAULT_PAGE_SIZE = 12;
3
4
  export declare const DEFAULT_GALLERY_PAGE_SIZE = 6;
4
5
  export declare const OG_IMAGE_API_URL = "https://og.prezly.com/api/og";
@@ -1,4 +1,5 @@
1
1
  export var ASSETS_CDN_URL = 'https://cdn.uc.assets.prezly.com';
2
+ export var ASSETS_SECONDARY_CDN_URL = 'https://ucarecdn.com';
2
3
  export var DEFAULT_PAGE_SIZE = 12;
3
4
  export var DEFAULT_GALLERY_PAGE_SIZE = 6;
4
5
  export var OG_IMAGE_API_URL = 'https://og.prezly.com/api/og';
@@ -170,7 +170,8 @@ function createClient(prezly, newsroomUuid, newsroomThemeUuid) {
170
170
  limit,
171
171
  category,
172
172
  locale,
173
- highlighted = 0
173
+ highlighted = 0,
174
+ tags
174
175
  } = params;
175
176
  var {
176
177
  include = []
@@ -197,7 +198,10 @@ function createClient(prezly, newsroomUuid, newsroomThemeUuid) {
197
198
  },
198
199
  ["visibility"]: {
199
200
  $in: [_sdk.Story.Visibility.PUBLIC]
200
- }
201
+ },
202
+ ["tag_names"]: tags !== null && tags !== void 0 && tags.length ? {
203
+ $in: [tags]
204
+ } : undefined
201
205
  }),
202
206
  include
203
207
  });
@@ -12,6 +12,7 @@ export declare namespace stories {
12
12
  interface SearchParams {
13
13
  search?: string;
14
14
  category?: Pick<Category, 'id'>;
15
+ tags?: string[];
15
16
  locale?: Pick<Culture, 'code'> | Culture.Code;
16
17
  limit: number;
17
18
  offset?: number;
@@ -164,7 +164,8 @@ export function createClient(prezly, newsroomUuid, newsroomThemeUuid) {
164
164
  limit,
165
165
  category,
166
166
  locale,
167
- highlighted = 0
167
+ highlighted = 0,
168
+ tags
168
169
  } = params;
169
170
  var {
170
171
  include = []
@@ -191,7 +192,10 @@ export function createClient(prezly, newsroomUuid, newsroomThemeUuid) {
191
192
  },
192
193
  ["visibility"]: {
193
194
  $in: [Story.Visibility.PUBLIC]
194
- }
195
+ },
196
+ ["tag_names"]: tags !== null && tags !== void 0 && tags.length ? {
197
+ $in: [tags]
198
+ } : undefined
195
199
  }),
196
200
  include
197
201
  });
@@ -34,5 +34,5 @@ function getCoverImage(gallery) {
34
34
  function getArchiveDownloadUrl(uuid, title) {
35
35
  // Uploadcare doesn't like slashes in filenames even in encoded form.
36
36
  var filename = encodeURIComponent(title.replace(/\//g, '_'));
37
- return "".concat(_constants.ASSETS_CDN_URL, "/").concat(uuid, "/archive/zip/").concat(filename, ".zip");
37
+ return "".concat(_constants.ASSETS_SECONDARY_CDN_URL, "/").concat(uuid, "/archive/zip/").concat(filename, ".zip");
38
38
  }
@@ -1,4 +1,4 @@
1
- import { ASSETS_CDN_URL } from "./constants.mjs";
1
+ import { ASSETS_SECONDARY_CDN_URL } from "./constants.mjs";
2
2
  export function isEmpty(gallery) {
3
3
  return gallery.images_number === 0 && gallery.videos_number === 0;
4
4
  }
@@ -26,5 +26,5 @@ export function getCoverImage(gallery) {
26
26
  export function getArchiveDownloadUrl(uuid, title) {
27
27
  // Uploadcare doesn't like slashes in filenames even in encoded form.
28
28
  var filename = encodeURIComponent(title.replace(/\//g, '_'));
29
- return "".concat(ASSETS_CDN_URL, "/").concat(uuid, "/archive/zip/").concat(filename, ".zip");
29
+ return "".concat(ASSETS_SECONDARY_CDN_URL, "/").concat(uuid, "/archive/zip/").concat(filename, ".zip");
30
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/theme-kit-core",
3
- "version": "9.7.0",
3
+ "version": "9.8.0",
4
4
  "description": "Data layer and utility library for developing Prezly themes with JavaScript",
5
5
  "main": "build/index.mjs",
6
6
  "types": "build/index.d.ts",
@@ -70,5 +70,5 @@
70
70
  "publishConfig": {
71
71
  "access": "public"
72
72
  },
73
- "gitHead": "2b06e5606c86eab6bdafeb8adf0d745da37986dd"
73
+ "gitHead": "da1b18a0ee4f3e57d058b8f81d699982fe2bd022"
74
74
  }