@livepreso/api 6.55.2 → 6.56.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/.rush/temp/shrinkwrap-deps.json +1013 -1191
- package/CHANGELOG.json +17 -0
- package/CHANGELOG.md +12 -1
- package/cjs/api.js +3 -5
- package/cjs/api.js.map +1 -1
- package/cjs/auth.spec.js +11 -11
- package/cjs/auth.spec.js.map +1 -1
- package/cjs/collections/appointment-tags.js +14 -15
- package/cjs/collections/appointment-tags.js.map +1 -1
- package/cjs/collections/base.spec.js +30 -30
- package/cjs/collections/base.spec.js.map +1 -1
- package/cjs/fixtures.js +1 -2
- package/cjs/fixtures.js.map +1 -1
- package/cjs/models/appointment.js +7 -7
- package/cjs/models/appointment.js.map +1 -1
- package/cjs/models/base.js +30 -12
- package/cjs/models/base.js.map +1 -1
- package/cjs/models/cms-val.spec.js +2 -2
- package/cjs/models/cms-val.spec.js.map +1 -1
- package/cjs/models/deck-version.js +14 -34
- package/cjs/models/deck-version.js.map +1 -1
- package/cjs/models/manifest-json.js +41 -5
- package/cjs/models/manifest-json.js.map +1 -1
- package/cjs/models/pack.js +2 -1
- package/cjs/models/pack.js.map +1 -1
- package/cjs/models/snapshot.spec.js +2 -2
- package/cjs/models/snapshot.spec.js.map +1 -1
- package/cjs/models/template.js +10 -10
- package/cjs/models/template.js.map +1 -1
- package/cjs/models/timing-log.spec.js +2 -2
- package/cjs/models/timing-log.spec.js.map +1 -1
- package/cjs/models/user.spec.js +4 -4
- package/cjs/models/user.spec.js.map +1 -1
- package/cjs/presentation/presentation-deck.js +19 -9
- package/cjs/presentation/presentation-deck.js.map +1 -1
- package/cjs/presentation/presentation-deck.spec.js +6 -6
- package/cjs/presentation/presentation-deck.spec.js.map +1 -1
- package/cjs/presentation/presentation-section.js +30 -9
- package/cjs/presentation/presentation-section.js.map +1 -1
- package/cjs/presentation/presentation-section.spec.js +24 -16
- package/cjs/presentation/presentation-section.spec.js.map +1 -1
- package/cjs/presentation/presentation-slide.js +18 -7
- package/cjs/presentation/presentation-slide.js.map +1 -1
- package/cjs/presentation/presentation-slide.spec.js +21 -12
- package/cjs/presentation/presentation-slide.spec.js.map +1 -1
- package/cjs/presentation/presentation-subslide.spec.js +10 -10
- package/cjs/presentation/presentation-subslide.spec.js.map +1 -1
- package/cjs/presentation/presentation.js +26 -26
- package/cjs/presentation/presentation.js.map +1 -1
- package/cjs/sync.js +1 -3
- package/cjs/sync.js.map +1 -1
- package/cjs/utils.js +33 -3
- package/cjs/utils.js.map +1 -1
- package/package.json +3 -3
- package/src/api.js +3 -5
- package/src/models/base.js +27 -9
- package/src/models/deck-version.js +5 -31
- package/src/models/manifest-json.js +33 -5
- package/src/models/pack.js +1 -0
- package/src/presentation/presentation-deck.js +9 -9
- package/src/presentation/presentation-section.js +31 -11
- package/src/presentation/presentation-section.spec.js +8 -0
- package/src/presentation/presentation-slide.js +7 -4
- package/src/presentation/presentation-slide.spec.js +9 -0
- package/src/sync.js +1 -3
- package/src/utils.js +31 -2
|
@@ -9,7 +9,7 @@ import { PresentationSubSlide } from "./presentation-subslide.js";
|
|
|
9
9
|
import _ from "lodash";
|
|
10
10
|
import { getAssetRoot } from "../index.js";
|
|
11
11
|
import { register } from "../state-register.js";
|
|
12
|
-
import
|
|
12
|
+
import { resolveURL } from "../utils.js";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @constructor
|
|
@@ -88,6 +88,9 @@ export const PresentationSlide = BasePresentationModel.extend(
|
|
|
88
88
|
tagsEditable: "boolean",
|
|
89
89
|
tags: "array",
|
|
90
90
|
cmsvalkey_set: "array",
|
|
91
|
+
isWelcome: { type: "boolean", default: false },
|
|
92
|
+
isSlide: { type: "boolean", default: true },
|
|
93
|
+
isSection: { type: "boolean", default: false },
|
|
91
94
|
},
|
|
92
95
|
|
|
93
96
|
/**
|
|
@@ -365,8 +368,8 @@ PresentationSlide.createFromManifestJSON = function (
|
|
|
365
368
|
id: parseInt(_.uniqueId(), 10),
|
|
366
369
|
title: manifestJSON.titles[key],
|
|
367
370
|
index,
|
|
368
|
-
html:
|
|
369
|
-
css:
|
|
371
|
+
html: resolveURL(manifestJSON.getAssetPath(key), "index.html"),
|
|
372
|
+
css: resolveURL(manifestJSON.getAssetPath(key), "slide.css"),
|
|
370
373
|
key: slideKey,
|
|
371
374
|
editable: false,
|
|
372
375
|
titleEditable: false,
|
|
@@ -429,9 +432,9 @@ PresentationSlide.createFromTemplate = function (
|
|
|
429
432
|
titleEditable: false,
|
|
430
433
|
notesEditable: false,
|
|
431
434
|
tagsEditable: false,
|
|
432
|
-
thumbnail: null,
|
|
433
435
|
custom: false,
|
|
434
436
|
visible: true,
|
|
437
|
+
thumbnail: template.image_256,
|
|
435
438
|
section: sectionID,
|
|
436
439
|
// Makes sure templates are rendered with unique IDs
|
|
437
440
|
autoAdjunctID: Number(_.uniqueId()),
|
|
@@ -52,6 +52,9 @@ describe("#createFromSlide", () => {
|
|
|
52
52
|
html: "https://staging-test-cdn.salespreso.com/media/pack/410/assets/sections/test-deck/slides/slide-key/index.html",
|
|
53
53
|
id: 23219,
|
|
54
54
|
index: 13,
|
|
55
|
+
isSection: false,
|
|
56
|
+
isSlide: true,
|
|
57
|
+
isWelcome: false,
|
|
55
58
|
key: "slide-key",
|
|
56
59
|
namespacedKey: "test-deck/slide-key",
|
|
57
60
|
section: 1738,
|
|
@@ -166,6 +169,9 @@ describe("#createFromAdjunctSlide", () => {
|
|
|
166
169
|
image:
|
|
167
170
|
"https://staging-test-cdn.salespreso.com/media/autoadjunct/123.png",
|
|
168
171
|
index: 3,
|
|
172
|
+
isSection: false,
|
|
173
|
+
isSlide: true,
|
|
174
|
+
isWelcome: false,
|
|
169
175
|
key: "adjunct-10529",
|
|
170
176
|
section: null,
|
|
171
177
|
sequence: 3,
|
|
@@ -284,6 +290,9 @@ describe("#createFromAutoAdjunct", () => {
|
|
|
284
290
|
image:
|
|
285
291
|
"https://staging-test-cdn.salespreso.com/media/autoadjunct/123.png",
|
|
286
292
|
index: 3,
|
|
293
|
+
isSection: false,
|
|
294
|
+
isSlide: true,
|
|
295
|
+
isWelcome: false,
|
|
287
296
|
key: "autoadjunct-three",
|
|
288
297
|
sectionKey: "",
|
|
289
298
|
sequence: 3,
|
package/src/sync.js
CHANGED
|
@@ -4,7 +4,6 @@ import _ from "lodash";
|
|
|
4
4
|
import log from "./log.js";
|
|
5
5
|
import { middlewares } from "./middleware.js";
|
|
6
6
|
import superagent from "superagent";
|
|
7
|
-
import url2 from "url";
|
|
8
7
|
|
|
9
8
|
const defaults = _.defaults;
|
|
10
9
|
const assign = _.assign;
|
|
@@ -30,11 +29,10 @@ export const defaultFetchURL = function ({ model }) {
|
|
|
30
29
|
|
|
31
30
|
export const buildURL = function ({ method, model }) {
|
|
32
31
|
const url = model.url();
|
|
33
|
-
const urlParse = url2.parse(url);
|
|
34
32
|
|
|
35
33
|
// If not a GET request, strip the query params from the url
|
|
36
34
|
if (method !== "read") {
|
|
37
|
-
return url.
|
|
35
|
+
return url.split("?")[0];
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
return url;
|
package/src/utils.js
CHANGED
|
@@ -1,12 +1,41 @@
|
|
|
1
1
|
import _ from "lodash";
|
|
2
2
|
/* eslint-disable no-control-regex */
|
|
3
|
-
import url2 from "url";
|
|
4
3
|
|
|
5
4
|
export const DATE_FORMAT = "YYYY-MM-DD HH:mm:ss.SSSSSS[Z]";
|
|
6
5
|
export const DATE_FORMAT_T = "YYYY-MM-DDTHH:mm:ss.SSSSSS[Z]";
|
|
7
6
|
|
|
8
7
|
export function getShortURL(url) {
|
|
9
|
-
|
|
8
|
+
if (!url) return url;
|
|
9
|
+
if (typeof url !== "string") return url;
|
|
10
|
+
|
|
11
|
+
try {
|
|
12
|
+
return new URL(url, "http://a.b").pathname;
|
|
13
|
+
} catch (e) {
|
|
14
|
+
return url;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Resolves a target URL relative to a base URL in a manner similar to a Web browser resolving an anchor tag.
|
|
20
|
+
* Matches url.resolve() behavior but handles relative bases.
|
|
21
|
+
*/
|
|
22
|
+
export function resolveURL(base, relative) {
|
|
23
|
+
if (!base) return relative;
|
|
24
|
+
if (!relative) return base;
|
|
25
|
+
|
|
26
|
+
const dummyBase = "http://a.b";
|
|
27
|
+
try {
|
|
28
|
+
// Try resolving normally (if base is absolute)
|
|
29
|
+
return new URL(relative, base).href;
|
|
30
|
+
} catch (e) {
|
|
31
|
+
try {
|
|
32
|
+
// If base is relative, resolve it against a dummy base, then strip it
|
|
33
|
+
const resolved = new URL(relative, new URL(base, dummyBase));
|
|
34
|
+
return resolved.href.replace(dummyBase, "");
|
|
35
|
+
} catch (e2) {
|
|
36
|
+
return relative;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
10
39
|
}
|
|
11
40
|
|
|
12
41
|
/**
|