@flourish/sdk 5.2.2 → 5.2.4

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.
Files changed (55) hide show
  1. package/.c8rc +4 -0
  2. package/RELEASE_NOTES.md +12 -0
  3. package/common/embed/credit.js +26 -11
  4. package/common/embed/embedding.js +1 -1
  5. package/common/embed/localizations.d.ts +46 -2
  6. package/common/embed/localizations.js +48 -37
  7. package/common/package.json +2 -2
  8. package/common/tsconfig.sdk.tsbuildinfo +1 -1
  9. package/common/utils/data.d.ts +2 -2
  10. package/common/utils/data.js +2 -1
  11. package/common/utils/types.d.ts +1 -2
  12. package/coverage-sdk/lcov-report/base.css +224 -0
  13. package/coverage-sdk/lcov-report/block-navigation.js +87 -0
  14. package/coverage-sdk/lcov-report/common/utils/columns.js.html +646 -0
  15. package/coverage-sdk/lcov-report/common/utils/index.html +131 -0
  16. package/coverage-sdk/lcov-report/common/utils/state.js.html +559 -0
  17. package/coverage-sdk/lcov-report/favicon.png +0 -0
  18. package/coverage-sdk/lcov-report/index.html +146 -0
  19. package/coverage-sdk/lcov-report/lib/common.js.html +181 -0
  20. package/coverage-sdk/lcov-report/lib/index.html +161 -0
  21. package/coverage-sdk/lcov-report/lib/log.js.html +178 -0
  22. package/coverage-sdk/lcov-report/lib/sdk.js.html +2008 -0
  23. package/coverage-sdk/lcov-report/lib/validate_config.js.html +1459 -0
  24. package/coverage-sdk/lcov-report/prettify.css +1 -0
  25. package/coverage-sdk/lcov-report/prettify.js +2 -0
  26. package/coverage-sdk/lcov-report/sort-arrow-sprite.png +0 -0
  27. package/coverage-sdk/lcov-report/sorter.js +210 -0
  28. package/coverage-sdk/lcov-report/test/lib/index.html +131 -0
  29. package/coverage-sdk/lcov-report/test/lib/sdk.js.html +532 -0
  30. package/coverage-sdk/lcov-report/test/lib/validate_config.js.html +3307 -0
  31. package/coverage-sdk/lcov.info +3556 -0
  32. package/coverage-sdk/tmp/coverage-36833-1757890375186-0.json +1 -0
  33. package/coverage-sdk/tmp/coverage-36834-1757890374890-0.json +1 -0
  34. package/lib/cmd/publish.js +1 -0
  35. package/lib/validate_config.js +31 -0
  36. package/package.json +7 -6
  37. package/server/columns.js +150 -0
  38. package/server/comms_js.js +13 -0
  39. package/server/data.js +132 -0
  40. package/server/json.js +40 -0
  41. package/server/views/index.html +13 -29
  42. package/site/embedded.js +2 -2
  43. package/site/images/embed_flourish_in_canva.png +0 -0
  44. package/site/images/flourish_app_icon.png +0 -0
  45. package/site/images/icon-arrow-down.svg +3 -0
  46. package/site/images/icon-arrow-left.svg +3 -0
  47. package/site/images/icon-close.svg +3 -0
  48. package/site/images/icon-login.svg +4 -0
  49. package/site/images/icon-sso.svg +4 -0
  50. package/site/images/share_image.jpg +0 -0
  51. package/site/images/upsell-presenter.jpg +0 -0
  52. package/site/images/upsell-publisher.jpg +0 -0
  53. package/site/script.js +3 -3
  54. package/site/sdk.css +1 -1
  55. package/test/lib/validate_config.js +126 -0
@@ -235,6 +235,54 @@ describe("validate_config", function() {
235
235
 
236
236
  describe("svg_download", testBoolean("svg_download"));
237
237
 
238
+ describe("allowed_standalone_download_origins", function() {
239
+ it("should accept an empty array", function() {
240
+ expectSuccess(metadataPlus({ allowed_standalone_download_origins: [] }));
241
+ });
242
+ it("should accept a single URL", function() {
243
+ expectSuccess(metadataPlus({ allowed_standalone_download_origins: ["https://example.com"] }));
244
+ });
245
+ it("should accept multiple URLs", function() {
246
+ expectSuccess(metadataPlus({ allowed_standalone_download_origins: [
247
+ "https://tiles.flourish.studio",
248
+ "https://icons.flourish.studio",
249
+ "http://legacy-api.example.com",
250
+ ] }));
251
+ });
252
+ it("should reject null", function() {
253
+ expectFailure(metadataPlus({ allowed_standalone_download_origins: null }),
254
+ "template.yml: “allowed_standalone_download_origins” must be an array");
255
+ });
256
+ it("should reject undefined", function() {
257
+ expectFailure(metadataPlus({ allowed_standalone_download_origins: undefined }),
258
+ "template.yml: “allowed_standalone_download_origins” must be an array");
259
+ });
260
+ it("should reject a string", function() {
261
+ expectFailure(metadataPlus({ allowed_standalone_download_origins: "https://example.com" }),
262
+ "template.yml: “allowed_standalone_download_origins” must be an array");
263
+ });
264
+ it("should reject a number", function() {
265
+ expectFailure(metadataPlus({ allowed_standalone_download_origins: 23 }),
266
+ "template.yml: “allowed_standalone_download_origins” must be an array");
267
+ });
268
+ it("should reject an object", function() {
269
+ expectFailure(metadataPlus({ allowed_standalone_download_origins: {} }),
270
+ "template.yml: “allowed_standalone_download_origins” must be an array");
271
+ });
272
+ it("should reject array with non-string entry", function() {
273
+ expectFailure(metadataPlus({ allowed_standalone_download_origins: ["https://example.com", 123] }),
274
+ "template.yml: allowed_standalone_download_origins entry “123” is not a string");
275
+ });
276
+ it("should reject URL without http:// or https://", function() {
277
+ expectFailure(metadataPlus({ allowed_standalone_download_origins: ["example.com"] }),
278
+ "template.yml: allowed_standalone_download_origins entry “example.com” must be a valid HTTP(S) URL");
279
+ });
280
+ it("should reject URL with invalid protocol", function() {
281
+ expectFailure(metadataPlus({ allowed_standalone_download_origins: ["ftp://example.com"] }),
282
+ "template.yml: allowed_standalone_download_origins entry “ftp://example.com” must be a valid HTTP(S) URL");
283
+ });
284
+ });
285
+
238
286
  describe("build rules", function() {
239
287
  testObject("build_rules", "template.yml “build” must be a mapping");
240
288
  it("should reject null", function() {
@@ -540,6 +588,39 @@ describe("validate_config", function() {
540
588
  it("should ignore headings", function() {
541
589
  expectSuccess(metadataPlus({ data: ["Heading", binding] }));
542
590
  });
591
+
592
+ describe("cacheable_for_standalone_downloads", function() {
593
+ it("should accept true", function() {
594
+ expectSuccess(bindingPlus({ cacheable_for_standalone_downloads: true }));
595
+ });
596
+ it("should accept false", function() {
597
+ expectSuccess(bindingPlus({ cacheable_for_standalone_downloads: false }));
598
+ });
599
+ it("should reject null", function() {
600
+ expectFailure(bindingPlus({ cacheable_for_standalone_downloads: null }),
601
+ "template.yml “cacheable_for_standalone_downloads” property of data binding “My binding” must be a boolean");
602
+ });
603
+ it("should reject undefined", function() {
604
+ expectFailure(bindingPlus({ cacheable_for_standalone_downloads: undefined }),
605
+ "template.yml “cacheable_for_standalone_downloads” property of data binding “My binding” must be a boolean");
606
+ });
607
+ it("should reject strings", function() {
608
+ expectFailure(bindingPlus({ cacheable_for_standalone_downloads: "true" }),
609
+ "template.yml “cacheable_for_standalone_downloads” property of data binding “My binding” must be a boolean");
610
+ });
611
+ it("should reject numbers", function() {
612
+ expectFailure(bindingPlus({ cacheable_for_standalone_downloads: 123 }),
613
+ "template.yml “cacheable_for_standalone_downloads” property of data binding “My binding” must be a boolean");
614
+ });
615
+ it("should reject arrays", function() {
616
+ expectFailure(bindingPlus({ cacheable_for_standalone_downloads: [] }),
617
+ "template.yml “cacheable_for_standalone_downloads” property of data binding “My binding” must be a boolean");
618
+ });
619
+ it("should reject objects", function() {
620
+ expectFailure(bindingPlus({ cacheable_for_standalone_downloads: {} }),
621
+ "template.yml “cacheable_for_standalone_downloads” property of data binding “My binding” must be a boolean");
622
+ });
623
+ });
543
624
  });
544
625
 
545
626
  describe("settings", function() {
@@ -1030,6 +1111,51 @@ describe("validate_config", function() {
1030
1111
  });
1031
1112
  });
1032
1113
 
1114
+ describe("cacheable_for_standalone_downloads", function() {
1115
+ it("should accept true for url type", function() {
1116
+ expectSuccess(settingPlus({ type: "url", cacheable_for_standalone_downloads: true }));
1117
+ });
1118
+ it("should accept false for url type", function() {
1119
+ expectSuccess(settingPlus({ type: "url", cacheable_for_standalone_downloads: false }));
1120
+ });
1121
+ it("should reject it for string type", function() {
1122
+ expectFailure(settingPlus({ type: "string", cacheable_for_standalone_downloads: true }),
1123
+ "template.yml setting “foo” has “cacheable_for_standalone_downloads” property, but is not of type “url”");
1124
+ });
1125
+ it("should reject it for number type", function() {
1126
+ expectFailure(settingPlus({ type: "number", cacheable_for_standalone_downloads: true }),
1127
+ "template.yml setting “foo” has “cacheable_for_standalone_downloads” property, but is not of type “url”");
1128
+ });
1129
+ it("should reject it for boolean type", function() {
1130
+ expectFailure(settingPlus({ type: "boolean", cacheable_for_standalone_downloads: true }),
1131
+ "template.yml setting “foo” has “cacheable_for_standalone_downloads” property, but is not of type “url”");
1132
+ });
1133
+ it("should reject null", function() {
1134
+ expectFailure(settingPlus({ type: "url", cacheable_for_standalone_downloads: null }),
1135
+ "template.yml setting “foo” has an invalid value for “cacheable_for_standalone_downloads”: should be true or false");
1136
+ });
1137
+ it("should reject undefined", function() {
1138
+ expectFailure(settingPlus({ type: "url", cacheable_for_standalone_downloads: undefined }),
1139
+ "template.yml setting “foo” has an invalid value for “cacheable_for_standalone_downloads”: should be true or false");
1140
+ });
1141
+ it("should reject strings", function() {
1142
+ expectFailure(settingPlus({ type: "url", cacheable_for_standalone_downloads: "true" }),
1143
+ "template.yml setting “foo” has an invalid value for “cacheable_for_standalone_downloads”: should be true or false");
1144
+ });
1145
+ it("should reject numbers", function() {
1146
+ expectFailure(settingPlus({ type: "url", cacheable_for_standalone_downloads: 1 }),
1147
+ "template.yml setting “foo” has an invalid value for “cacheable_for_standalone_downloads”: should be true or false");
1148
+ });
1149
+ it("should reject arrays", function() {
1150
+ expectFailure(settingPlus({ type: "url", cacheable_for_standalone_downloads: [] }),
1151
+ "template.yml setting “foo” has an invalid value for “cacheable_for_standalone_downloads”: should be true or false");
1152
+ });
1153
+ it("should reject objects", function() {
1154
+ expectFailure(settingPlus({ type: "url", cacheable_for_standalone_downloads: {} }),
1155
+ "template.yml setting “foo” has an invalid value for “cacheable_for_standalone_downloads”: should be true or false");
1156
+ });
1157
+ });
1158
+
1033
1159
  describe("width", function() {
1034
1160
  it("should accept “full”", function() {
1035
1161
  expectSuccess(settingPlus({ width: "full" }));