@prezly/sdk 16.5.0 → 16.7.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.
- package/dist/api/constants.cjs +1 -1
- package/dist/api/constants.js +1 -1
- package/dist/types/NewsroomTheme.cjs +1 -0
- package/dist/types/NewsroomTheme.d.ts +2 -1
- package/dist/types/NewsroomTheme.js +1 -0
- package/dist/types/Story.cjs +9 -1
- package/dist/types/Story.d.ts +8 -3
- package/dist/types/Story.js +9 -1
- package/package.json +1 -1
package/dist/api/constants.cjs
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DEFAULT_USER_AGENT = void 0;
|
|
7
|
-
const VERSION = "16.
|
|
7
|
+
const VERSION = "16.6.0";
|
|
8
8
|
const URL = 'https://github.com/prezly/javascript-sdk';
|
|
9
9
|
const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
|
|
10
10
|
exports.DEFAULT_USER_AGENT = DEFAULT_USER_AGENT;
|
package/dist/api/constants.js
CHANGED
|
@@ -27,6 +27,7 @@ exports.NewsroomTheme = NewsroomTheme;
|
|
|
27
27
|
Feature["SUBSCRIBE_FORM"] = "subscribe_form";
|
|
28
28
|
Feature["STORY_PINNING"] = "story_pinning";
|
|
29
29
|
Feature["TITLE_FORMATTING"] = "title_formatting";
|
|
30
|
+
Feature["CTA_BUTTONS"] = "cta_buttons";
|
|
30
31
|
})(Feature || (Feature = {}));
|
|
31
32
|
_NewsroomTheme.Feature = Feature;
|
|
32
33
|
function isFeatureSupported(theme, feature) {
|
|
@@ -30,7 +30,8 @@ export declare namespace NewsroomTheme {
|
|
|
30
30
|
HOMEPAGE_CONTACTS = "homepage_contacts",
|
|
31
31
|
SUBSCRIBE_FORM = "subscribe_form",
|
|
32
32
|
STORY_PINNING = "story_pinning",
|
|
33
|
-
TITLE_FORMATTING = "title_formatting"
|
|
33
|
+
TITLE_FORMATTING = "title_formatting",
|
|
34
|
+
CTA_BUTTONS = "cta_buttons"
|
|
34
35
|
}
|
|
35
36
|
function isFeatureSupported(theme: NewsroomTheme, feature: NewsroomTheme.Feature): boolean;
|
|
36
37
|
}
|
|
@@ -20,6 +20,7 @@ export let NewsroomTheme;
|
|
|
20
20
|
Feature["SUBSCRIBE_FORM"] = "subscribe_form";
|
|
21
21
|
Feature["STORY_PINNING"] = "story_pinning";
|
|
22
22
|
Feature["TITLE_FORMATTING"] = "title_formatting";
|
|
23
|
+
Feature["CTA_BUTTONS"] = "cta_buttons";
|
|
23
24
|
})(Feature || (Feature = {}));
|
|
24
25
|
_NewsroomTheme.Feature = Feature;
|
|
25
26
|
function isFeatureSupported(theme, feature) {
|
package/dist/types/Story.cjs
CHANGED
|
@@ -13,6 +13,7 @@ exports.Story = Story;
|
|
|
13
13
|
FormatVersion[FormatVersion["HTML"] = 1] = "HTML";
|
|
14
14
|
FormatVersion[FormatVersion["SLATEJS_V3"] = 3] = "SLATEJS_V3";
|
|
15
15
|
FormatVersion[FormatVersion["SLATEJS_V4"] = 4] = "SLATEJS_V4";
|
|
16
|
+
FormatVersion[FormatVersion["SLATEJS_V5"] = 5] = "SLATEJS_V5";
|
|
16
17
|
})(FormatVersion || (FormatVersion = {}));
|
|
17
18
|
_Story.FormatVersion = FormatVersion;
|
|
18
19
|
let Status;
|
|
@@ -111,7 +112,7 @@ exports.Story = Story;
|
|
|
111
112
|
if (typeof arg === 'object' && arg !== null) {
|
|
112
113
|
return isSlateFormat(arg.format_version);
|
|
113
114
|
}
|
|
114
|
-
return arg === FormatVersion.SLATEJS_V3 || arg === FormatVersion.SLATEJS_V4;
|
|
115
|
+
return arg === FormatVersion.SLATEJS_V3 || arg === FormatVersion.SLATEJS_V4 || arg === FormatVersion.SLATEJS_V5;
|
|
115
116
|
}
|
|
116
117
|
_Story.isSlateFormat = isSlateFormat;
|
|
117
118
|
function isSlateV3Format(arg) {
|
|
@@ -128,4 +129,11 @@ exports.Story = Story;
|
|
|
128
129
|
return arg === FormatVersion.SLATEJS_V4;
|
|
129
130
|
}
|
|
130
131
|
_Story.isSlateV4Format = isSlateV4Format;
|
|
132
|
+
function isSlateV5Format(arg) {
|
|
133
|
+
if (typeof arg === 'object' && arg !== null) {
|
|
134
|
+
return arg.format_version === FormatVersion.SLATEJS_V5;
|
|
135
|
+
}
|
|
136
|
+
return arg === FormatVersion.SLATEJS_V5;
|
|
137
|
+
}
|
|
138
|
+
_Story.isSlateV5Format = isSlateV5Format;
|
|
131
139
|
})(Story || (exports.Story = Story = {}));
|
package/dist/types/Story.d.ts
CHANGED
|
@@ -139,7 +139,8 @@ export declare namespace Story {
|
|
|
139
139
|
enum FormatVersion {
|
|
140
140
|
HTML = 1,
|
|
141
141
|
SLATEJS_V3 = 3,
|
|
142
|
-
SLATEJS_V4 = 4
|
|
142
|
+
SLATEJS_V4 = 4,
|
|
143
|
+
SLATEJS_V5 = 5
|
|
143
144
|
}
|
|
144
145
|
enum Status {
|
|
145
146
|
UNINITIALIZED = "uninitialized",
|
|
@@ -274,9 +275,9 @@ export declare namespace Story {
|
|
|
274
275
|
function isLegacyHtmlFormat<T extends Pick<Story, 'format_version'>>(story: T): story is T & {
|
|
275
276
|
format_version: FormatVersion.HTML;
|
|
276
277
|
};
|
|
277
|
-
function isSlateFormat(format: FormatVersion): format is FormatVersion.SLATEJS_V3 | FormatVersion.SLATEJS_V4;
|
|
278
|
+
function isSlateFormat(format: FormatVersion): format is FormatVersion.SLATEJS_V3 | FormatVersion.SLATEJS_V4 | FormatVersion.SLATEJS_V5;
|
|
278
279
|
function isSlateFormat<T extends Pick<Story, 'format_version'>>(story: Pick<Story, 'format_version'>): story is T & {
|
|
279
|
-
format_version: FormatVersion.SLATEJS_V3 | FormatVersion.SLATEJS_V4;
|
|
280
|
+
format_version: FormatVersion.SLATEJS_V3 | FormatVersion.SLATEJS_V4 | FormatVersion.SLATEJS_V5;
|
|
280
281
|
};
|
|
281
282
|
function isSlateV3Format(format: FormatVersion): format is FormatVersion.SLATEJS_V3;
|
|
282
283
|
function isSlateV3Format<T extends Pick<Story, 'format_version'>>(story: Pick<Story, 'format_version'>): story is T & {
|
|
@@ -286,6 +287,10 @@ export declare namespace Story {
|
|
|
286
287
|
function isSlateV4Format<T extends Pick<Story, 'format_version'>>(story: Pick<Story, 'format_version'>): story is T & {
|
|
287
288
|
format_version: FormatVersion.SLATEJS_V4;
|
|
288
289
|
};
|
|
290
|
+
function isSlateV5Format(format: FormatVersion): format is FormatVersion.SLATEJS_V5;
|
|
291
|
+
function isSlateV5Format<T extends Pick<Story, 'format_version'>>(story: Pick<Story, 'format_version'>): story is T & {
|
|
292
|
+
format_version: FormatVersion.SLATEJS_V5;
|
|
293
|
+
};
|
|
289
294
|
}
|
|
290
295
|
export interface ExtendedStory extends Story, Pick<Story.ExtraFields, 'thumbnail_image' | 'header_image' | 'preview_image' | 'social_image' | 'social_text' | 'tag_names' | 'content' | 'attached_gallery_content' | 'referenced_entities'> {
|
|
291
296
|
}
|
package/dist/types/Story.js
CHANGED
|
@@ -6,6 +6,7 @@ export let Story;
|
|
|
6
6
|
FormatVersion[FormatVersion["HTML"] = 1] = "HTML";
|
|
7
7
|
FormatVersion[FormatVersion["SLATEJS_V3"] = 3] = "SLATEJS_V3";
|
|
8
8
|
FormatVersion[FormatVersion["SLATEJS_V4"] = 4] = "SLATEJS_V4";
|
|
9
|
+
FormatVersion[FormatVersion["SLATEJS_V5"] = 5] = "SLATEJS_V5";
|
|
9
10
|
})(FormatVersion || (FormatVersion = {}));
|
|
10
11
|
_Story.FormatVersion = FormatVersion;
|
|
11
12
|
let Status;
|
|
@@ -104,7 +105,7 @@ export let Story;
|
|
|
104
105
|
if (typeof arg === 'object' && arg !== null) {
|
|
105
106
|
return isSlateFormat(arg.format_version);
|
|
106
107
|
}
|
|
107
|
-
return arg === FormatVersion.SLATEJS_V3 || arg === FormatVersion.SLATEJS_V4;
|
|
108
|
+
return arg === FormatVersion.SLATEJS_V3 || arg === FormatVersion.SLATEJS_V4 || arg === FormatVersion.SLATEJS_V5;
|
|
108
109
|
}
|
|
109
110
|
_Story.isSlateFormat = isSlateFormat;
|
|
110
111
|
function isSlateV3Format(arg) {
|
|
@@ -121,4 +122,11 @@ export let Story;
|
|
|
121
122
|
return arg === FormatVersion.SLATEJS_V4;
|
|
122
123
|
}
|
|
123
124
|
_Story.isSlateV4Format = isSlateV4Format;
|
|
125
|
+
function isSlateV5Format(arg) {
|
|
126
|
+
if (typeof arg === 'object' && arg !== null) {
|
|
127
|
+
return arg.format_version === FormatVersion.SLATEJS_V5;
|
|
128
|
+
}
|
|
129
|
+
return arg === FormatVersion.SLATEJS_V5;
|
|
130
|
+
}
|
|
131
|
+
_Story.isSlateV5Format = isSlateV5Format;
|
|
124
132
|
})(Story || (Story = {}));
|