@prezly/theme-kit-core 5.0.0-alpha.4 → 5.0.0-alpha.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.
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/build/utils/index.js.map +1 -1
- package/build/utils/isEmbargoStory.d.ts +1 -1
- package/build/utils/isEmbargoStory.js +2 -3
- package/build/utils/isEmbargoStory.js.map +1 -1
- package/build/utils/sdkHelpers.d.ts +32 -0
- package/build/utils/sdkHelpers.js +42 -0
- package/build/utils/sdkHelpers.js.map +1 -0
- package/package.json +2 -2
package/build/utils/index.d.ts
CHANGED
package/build/utils/index.js
CHANGED
|
@@ -25,4 +25,5 @@ __exportStar(require("./getPrivacyPortalUrl"), exports);
|
|
|
25
25
|
__exportStar(require("./getStoryPublicationDate"), exports);
|
|
26
26
|
__exportStar(require("./getUploadcareGroupUrl"), exports);
|
|
27
27
|
__exportStar(require("./isEmbargoStory"), exports);
|
|
28
|
+
__exportStar(require("./sdkHelpers"), exports);
|
|
28
29
|
//# sourceMappingURL=index.js.map
|
package/build/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,gDAA8B;AAC9B,8CAA4B;AAC5B,iDAA+B;AAC/B,uDAAqC;AACrC,6DAA2C;AAC3C,uDAAqC;AACrC,wDAAsC;AACtC,4DAA0C;AAC1C,0DAAwC;AACxC,mDAAiC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,gDAA8B;AAC9B,8CAA4B;AAC5B,iDAA+B;AAC/B,uDAAqC;AACrC,6DAA2C;AAC3C,uDAAqC;AACrC,wDAAsC;AACtC,4DAA0C;AAC1C,0DAAwC;AACxC,mDAAiC;AACjC,+CAA6B"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isEmbargoStory = void 0;
|
|
4
|
-
const
|
|
4
|
+
const sdkHelpers_1 = require("./sdkHelpers");
|
|
5
5
|
function isEmbargoStory(story) {
|
|
6
|
-
|
|
7
|
-
return sdk_1.Story.isScheduledEmbargo(story.status);
|
|
6
|
+
return (0, sdkHelpers_1.isScheduledEmbargo)(story.status);
|
|
8
7
|
}
|
|
9
8
|
exports.isEmbargoStory = isEmbargoStory;
|
|
10
9
|
//# sourceMappingURL=isEmbargoStory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isEmbargoStory.js","sourceRoot":"","sources":["../../src/utils/isEmbargoStory.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"isEmbargoStory.js","sourceRoot":"","sources":["../../src/utils/isEmbargoStory.ts"],"names":[],"mappings":";;;AAEA,6CAAkD;AAOlD,SAAgB,cAAc,CAAC,KAA4B;IACvD,OAAO,IAAA,+BAAkB,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC;AAFD,wCAEC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These helpers and enums are ported from @prezly/sdk to avoid leaking the dependency into the client bundle.
|
|
3
|
+
* The types are matching SDK v15.
|
|
4
|
+
*/
|
|
5
|
+
import type { Story } from '@prezly/sdk';
|
|
6
|
+
export declare enum Visibility {
|
|
7
|
+
PUBLIC = "public",
|
|
8
|
+
EMBARGO = "embargo",
|
|
9
|
+
PRIVATE = "private",
|
|
10
|
+
CONFIDENTIAL = "confidential"
|
|
11
|
+
}
|
|
12
|
+
export declare enum Status {
|
|
13
|
+
UNINITIALIZED = "uninitialized",
|
|
14
|
+
DRAFT = "draft",
|
|
15
|
+
SCHEDULED = "scheduled",
|
|
16
|
+
EMBARGO = "embargo",
|
|
17
|
+
PUBLISHED = "published"
|
|
18
|
+
}
|
|
19
|
+
export declare enum FormatVersion {
|
|
20
|
+
HTML = 1,
|
|
21
|
+
SLATEJS = 3
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @see https://github.com/prezly/javascript-sdk/blob/8c735968415ded334f60635a8cef66f76a20a73f/src/types/Story.ts#L337
|
|
25
|
+
*/
|
|
26
|
+
export declare function isStoryPublished(status: Status): boolean;
|
|
27
|
+
export declare function isStoryPublished(story: Pick<Story, 'status'>): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* @see https://github.com/prezly/javascript-sdk/blob/8c735968415ded334f60635a8cef66f76a20a73f/src/types/Story.ts#L328
|
|
30
|
+
*/
|
|
31
|
+
export declare function isScheduledEmbargo(status: Status): boolean;
|
|
32
|
+
export declare function isScheduledEmbargo(story: Pick<Story, 'status'>): boolean;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* These helpers and enums are ported from @prezly/sdk to avoid leaking the dependency into the client bundle.
|
|
4
|
+
* The types are matching SDK v15.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.isScheduledEmbargo = exports.isStoryPublished = exports.FormatVersion = exports.Status = exports.Visibility = void 0;
|
|
8
|
+
var Visibility;
|
|
9
|
+
(function (Visibility) {
|
|
10
|
+
Visibility["PUBLIC"] = "public";
|
|
11
|
+
Visibility["EMBARGO"] = "embargo";
|
|
12
|
+
Visibility["PRIVATE"] = "private";
|
|
13
|
+
Visibility["CONFIDENTIAL"] = "confidential";
|
|
14
|
+
})(Visibility = exports.Visibility || (exports.Visibility = {}));
|
|
15
|
+
var Status;
|
|
16
|
+
(function (Status) {
|
|
17
|
+
Status["UNINITIALIZED"] = "uninitialized";
|
|
18
|
+
Status["DRAFT"] = "draft";
|
|
19
|
+
Status["SCHEDULED"] = "scheduled";
|
|
20
|
+
Status["EMBARGO"] = "embargo";
|
|
21
|
+
Status["PUBLISHED"] = "published";
|
|
22
|
+
})(Status = exports.Status || (exports.Status = {}));
|
|
23
|
+
var FormatVersion;
|
|
24
|
+
(function (FormatVersion) {
|
|
25
|
+
FormatVersion[FormatVersion["HTML"] = 1] = "HTML";
|
|
26
|
+
FormatVersion[FormatVersion["SLATEJS"] = 3] = "SLATEJS";
|
|
27
|
+
})(FormatVersion = exports.FormatVersion || (exports.FormatVersion = {}));
|
|
28
|
+
function isStoryPublished(arg) {
|
|
29
|
+
if (typeof arg === 'object' && arg !== null) {
|
|
30
|
+
return isStoryPublished(arg.status);
|
|
31
|
+
}
|
|
32
|
+
return arg === Status.PUBLISHED;
|
|
33
|
+
}
|
|
34
|
+
exports.isStoryPublished = isStoryPublished;
|
|
35
|
+
function isScheduledEmbargo(arg) {
|
|
36
|
+
if (typeof arg === 'object' && arg !== null) {
|
|
37
|
+
return isScheduledEmbargo(arg.status);
|
|
38
|
+
}
|
|
39
|
+
return arg === Status.EMBARGO;
|
|
40
|
+
}
|
|
41
|
+
exports.isScheduledEmbargo = isScheduledEmbargo;
|
|
42
|
+
//# sourceMappingURL=sdkHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdkHelpers.js","sourceRoot":"","sources":["../../src/utils/sdkHelpers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,IAAY,UAKX;AALD,WAAY,UAAU;IAClB,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,2CAA6B,CAAA;AACjC,CAAC,EALW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAKrB;AAED,IAAY,MAMX;AAND,WAAY,MAAM;IACd,yCAA+B,CAAA;IAC/B,yBAAe,CAAA;IACf,iCAAuB,CAAA;IACvB,6BAAmB,CAAA;IACnB,iCAAuB,CAAA;AAC3B,CAAC,EANW,MAAM,GAAN,cAAM,KAAN,cAAM,QAMjB;AAED,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,iDAAQ,CAAA;IACR,uDAAW,CAAA;AACf,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB;AAOD,SAAgB,gBAAgB,CAAC,GAAmC;IAChE,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE;QACzC,OAAO,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;KACvC;IACD,OAAO,GAAG,KAAK,MAAM,CAAC,SAAS,CAAC;AACpC,CAAC;AALD,4CAKC;AAOD,SAAgB,kBAAkB,CAAC,GAAmC;IAClE,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE;QACzC,OAAO,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;KACzC;IACD,OAAO,GAAG,KAAK,MAAM,CAAC,OAAO,CAAC;AAClC,CAAC;AALD,gDAKC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prezly/theme-kit-core",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.6",
|
|
4
4
|
"description": "Data layer and utility library for developing Prezly themes with JavaScript",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "3c711b2b9a832fe441d27cf5227aba561053f247"
|
|
55
55
|
}
|