pageflow 15.7.1 → 16.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +33 -243
  3. data/README.md +1 -9
  4. data/Rakefile +4 -1
  5. data/admins/pageflow/accounts.rb +12 -16
  6. data/admins/pageflow/entry.rb +57 -28
  7. data/admins/pageflow/entry_templates.rb +5 -7
  8. data/admins/pageflow/sites.rb +50 -0
  9. data/admins/pageflow/user.rb +7 -0
  10. data/app/assets/javascripts/pageflow/admin/entries.js +53 -4
  11. data/app/assets/stylesheets/pageflow/admin/permalink_input.scss +65 -0
  12. data/app/assets/stylesheets/pageflow/admin.scss +1 -0
  13. data/app/assets/stylesheets/pageflow/editor/base.scss +2 -6
  14. data/app/assets/stylesheets/pageflow/editor/dialogs.scss +2 -0
  15. data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +9 -0
  16. data/app/assets/stylesheets/pageflow/editor/info_box.scss +13 -3
  17. data/app/assets/stylesheets/pageflow/mixins/buttons.scss +1 -0
  18. data/app/assets/stylesheets/pageflow/page.scss +0 -2
  19. data/app/assets/stylesheets/pageflow/themes/default/page.scss +1 -1
  20. data/app/assets/stylesheets/pageflow/ui/forms.scss +4 -1
  21. data/app/controllers/pageflow/editor/file_import_controller.rb +32 -42
  22. data/app/controllers/pageflow/entries_controller.rb +27 -3
  23. data/app/helpers/pageflow/admin/permalinks_helper.rb +15 -0
  24. data/app/helpers/pageflow/common_entry_seed_helper.rb +1 -1
  25. data/app/helpers/pageflow/embed_code_helper.rb +1 -1
  26. data/app/helpers/pageflow/entries_helper.rb +25 -17
  27. data/app/helpers/pageflow/sites_helper.rb +11 -0
  28. data/app/helpers/pageflow/social_share_helper.rb +2 -2
  29. data/app/inputs/pageflow_permalink_input.rb +47 -0
  30. data/app/models/concerns/pageflow/permalinkable.rb +12 -0
  31. data/app/models/concerns/pageflow/reusable_file.rb +5 -0
  32. data/app/models/concerns/pageflow/uploadable_file.rb +4 -0
  33. data/app/models/pageflow/account.rb +7 -33
  34. data/app/models/pageflow/{cname_theming_request_scope.rb → cname_site_request_scope.rb} +3 -3
  35. data/app/models/pageflow/customized_theme.rb +5 -3
  36. data/app/models/pageflow/entry.rb +8 -4
  37. data/app/models/pageflow/entry_at_revision.rb +4 -3
  38. data/app/models/pageflow/entry_duplicate.rb +8 -1
  39. data/app/models/pageflow/entry_template.rb +4 -4
  40. data/app/models/pageflow/home_button.rb +7 -7
  41. data/app/models/pageflow/image_file_url_templates.rb +2 -2
  42. data/app/models/pageflow/permalink.rb +39 -0
  43. data/app/models/pageflow/permalink_directory.rb +10 -0
  44. data/app/models/pageflow/published_entry.rb +19 -2
  45. data/app/models/pageflow/revision.rb +1 -1
  46. data/app/models/pageflow/site.rb +59 -0
  47. data/app/models/pageflow/theme_customization.rb +1 -1
  48. data/app/models/pageflow/theme_customization_file.rb +6 -1
  49. data/app/policies/pageflow/account_policy.rb +2 -2
  50. data/app/policies/pageflow/entry_policy.rb +2 -2
  51. data/app/policies/pageflow/entry_template_policy.rb +1 -1
  52. data/app/policies/pageflow/{theming_policy.rb → site_policy.rb} +13 -11
  53. data/app/views/admin/accounts/_entry_template_details.html.arb +1 -1
  54. data/app/views/admin/accounts/_form.html.erb +4 -22
  55. data/app/views/admin/accounts/_site_defaults_inline_help.html.erb +5 -0
  56. data/app/views/admin/entries/_form.html.erb +11 -12
  57. data/app/views/admin/entries/_permalink_inputs.html.erb +6 -0
  58. data/app/views/admin/entries/_site_input.html.erb +15 -0
  59. data/app/views/admin/entries/{entry_type_name_input.html.erb → entry_site_and_type_name_input.html.erb} +3 -0
  60. data/app/views/admin/entries/permalink_inputs.html.erb +7 -0
  61. data/app/views/admin/entry_templates/_form.html.erb +5 -5
  62. data/app/views/admin/sites/_attributes_table.html.arb +9 -0
  63. data/app/views/admin/sites/_fields.html.erb +17 -0
  64. data/app/views/admin/sites/_form.html.erb +5 -0
  65. data/app/views/components/pageflow/admin/entries_tab.rb +1 -2
  66. data/app/views/components/pageflow/admin/entry_templates_tab.rb +10 -11
  67. data/app/views/components/pageflow/admin/features_tab.rb +1 -1
  68. data/app/views/components/pageflow/admin/sites_tab.rb +32 -0
  69. data/app/views/components/pageflow/admin/users_tab.rb +1 -2
  70. data/app/views/pageflow/editor/entries/seed.json.erb +1 -1
  71. data/app/views/pageflow/editor/file_import/start_import_job.json.jbuilder +10 -0
  72. data/app/views/pageflow/editor/sites/_site.json.jbuilder +1 -0
  73. data/app/views/pageflow/entries/{_theming.css.erb → _site.css.erb} +0 -0
  74. data/app/views/pageflow/entries/stylesheet.css.erb +1 -1
  75. data/app/views/pageflow/files/_file.json.jbuilder +1 -0
  76. data/app/views/pageflow/social_share/_entry_meta_tags.html.erb +1 -1
  77. data/app/views/pageflow/social_share/_page_meta_tags.html.erb +1 -1
  78. data/config/initializers/admin_resource_tabs.rb +29 -12
  79. data/config/initializers/mime_types.rb +1 -0
  80. data/config/locales/de.yml +19 -17
  81. data/config/locales/en.yml +19 -17
  82. data/config/routes.rb +8 -5
  83. data/db/migrate/20221024100724_create_pageflow_permalink_directories.rb +10 -0
  84. data/db/migrate/20221025074049_add_permalink_attributes_to_entries.rb +5 -0
  85. data/db/migrate/20221027065022_create_pageflow_permalinks.rb +12 -0
  86. data/db/migrate/20221215101134_rename_theming_to_site.rb +9 -0
  87. data/db/migrate/20221215120856_associate_entry_templates_with_sites.rb +34 -0
  88. data/db/migrate/20221219203023_add_name_to_sites.rb +5 -0
  89. data/db/migrate/20230103155934_associate_theme_customizations_with_sites.rb +27 -0
  90. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +176 -179
  91. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +49 -7
  92. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-client.js +5 -5
  93. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-server.js +1 -1
  94. data/entry_types/paged/config/initializers/features.rb +2 -0
  95. data/entry_types/paged/config/locales/{new/help.de.yml → de.yml} +74 -65
  96. data/entry_types/paged/config/locales/{new/help.en.yml → en.yml} +66 -56
  97. data/entry_types/scrolled/app/helpers/pageflow_scrolled/favicon_helper.rb +39 -13
  98. data/entry_types/scrolled/app/helpers/pageflow_scrolled/generated_media_queries_helper.rb +55 -0
  99. data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +6 -2
  100. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +2 -0
  101. data/entry_types/scrolled/app/views/pageflow_scrolled/entries/_manifest.json.jbuilder +16 -0
  102. data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +9 -3
  103. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +5 -5
  104. data/entry_types/scrolled/app/views/pageflow_scrolled/favicons/_entry.html.erb +16 -10
  105. data/entry_types/scrolled/config/locales/de.yml +265 -76
  106. data/entry_types/scrolled/config/locales/en.yml +266 -77
  107. data/entry_types/scrolled/lib/pageflow_scrolled/configuration.rb +3 -3
  108. data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +14 -0
  109. data/entry_types/scrolled/lib/pageflow_scrolled/react_widget_type.rb +1 -1
  110. data/entry_types/scrolled/lib/pageflow_scrolled/seeds.rb +1 -1
  111. data/entry_types/scrolled/lib/pageflow_scrolled/web_app_manifest.rb +11 -0
  112. data/entry_types/scrolled/lib/pageflow_scrolled.rb +39 -1
  113. data/entry_types/scrolled/lib/tasks/pageflow_scrolled/storybook.rake +3 -2
  114. data/entry_types/scrolled/package/contentElements-editor.js +124 -38
  115. data/entry_types/scrolled/package/contentElements-frontend.css +1 -1
  116. data/entry_types/scrolled/package/contentElements-frontend.js +321 -27
  117. data/entry_types/scrolled/package/editor.js +1345 -739
  118. data/entry_types/scrolled/package/frontend/EditableInlineText.module-14c7b097.js +5314 -0
  119. data/entry_types/scrolled/package/frontend/{PhonePlatformContext-9fb97827.js → PhonePlatformContext-f6093cc6.js} +87 -223
  120. data/entry_types/scrolled/package/frontend/{Viewer-e2290ea0.js → Viewer-b6becc57.js} +6 -40
  121. data/entry_types/scrolled/package/frontend/arrowRight-78a7cee4.js +42 -0
  122. data/entry_types/scrolled/package/frontend/{components-6ab26015.js → components-b3160dd7.js} +546 -361
  123. data/entry_types/scrolled/package/frontend/index.css +1 -1
  124. data/entry_types/scrolled/package/frontend/index.js +398 -3692
  125. data/entry_types/scrolled/package/package.json +3 -2
  126. data/entry_types/scrolled/package/testHelpers.js +12 -2
  127. data/entry_types/scrolled/package/widgets/defaultNavigation.css +2 -2
  128. data/entry_types/scrolled/package/widgets/defaultNavigation.js +50 -40
  129. data/entry_types/scrolled/spec/fixtures/image.ico +0 -0
  130. data/lib/pageflow/ability_mixin.rb +16 -8
  131. data/lib/pageflow/admin/attributes_table_rows.rb +1 -1
  132. data/lib/pageflow/admin/form_inputs.rb +1 -1
  133. data/lib/pageflow/admin/tabs.rb +1 -1
  134. data/lib/pageflow/configuration/permissions.rb +3 -3
  135. data/lib/pageflow/configuration.rb +17 -17
  136. data/lib/pageflow/entry_export_import/entry_serialization.rb +1 -1
  137. data/lib/pageflow/entry_type.rb +6 -2
  138. data/lib/pageflow/primary_domain_entry_redirect.rb +7 -7
  139. data/lib/pageflow/seeds.rb +10 -10
  140. data/lib/pageflow/theme_customizations.rb +10 -10
  141. data/lib/pageflow/version.rb +1 -1
  142. data/package/editor.js +129 -156
  143. data/package/frontend.js +19 -2
  144. data/package/testHelpers.js +39 -6
  145. data/spec/factories/accounts.rb +5 -2
  146. data/spec/factories/draft_entries.rb +2 -2
  147. data/spec/factories/entries.rb +18 -1
  148. data/spec/factories/entry_templates.rb +1 -1
  149. data/spec/factories/permalink_directory.rb +6 -0
  150. data/spec/factories/permalinks.rb +4 -0
  151. data/spec/factories/published_entries.rb +4 -2
  152. data/spec/factories/sites.rb +9 -0
  153. metadata +50 -62
  154. data/app/assets/javascripts/pageflow/dist/editor.js +0 -11890
  155. data/app/assets/javascripts/pageflow/dist/frontend.js +0 -5800
  156. data/app/assets/javascripts/pageflow/dist/react-client.js +0 -22
  157. data/app/assets/javascripts/pageflow/dist/react-server.js +0 -19
  158. data/app/helpers/pageflow/themings_helper.rb +0 -11
  159. data/app/models/pageflow/theming.rb +0 -29
  160. data/app/views/admin/accounts/_theming_defaults_inline_help.html.erb +0 -5
  161. data/app/views/admin/accounts/_theming_details.html.arb +0 -5
  162. data/app/views/pageflow/editor/themings/_theming.json.jbuilder +0 -1
  163. data/entry_types/paged/config/locales/new/video_contain.de.yml +0 -7
  164. data/entry_types/paged/config/locales/new/video_contain.en.yml +0 -7
  165. data/entry_types/scrolled/config/locales/new/before_after_slider.de.yml +0 -8
  166. data/entry_types/scrolled/config/locales/new/before_after_slider.en.yml +0 -8
  167. data/entry_types/scrolled/config/locales/new/center_ragged.de.yml +0 -8
  168. data/entry_types/scrolled/config/locales/new/center_ragged.en.yml +0 -9
  169. data/entry_types/scrolled/config/locales/new/consent.de.yml +0 -25
  170. data/entry_types/scrolled/config/locales/new/consent.en.yml +0 -24
  171. data/entry_types/scrolled/config/locales/new/content_element_categories.de.yml +0 -39
  172. data/entry_types/scrolled/config/locales/new/content_element_categories.en.yml +0 -39
  173. data/entry_types/scrolled/config/locales/new/default_transition.de.yml +0 -14
  174. data/entry_types/scrolled/config/locales/new/default_transition.en.yml +0 -14
  175. data/entry_types/scrolled/config/locales/new/header_line_breaks.de.yml +0 -28
  176. data/entry_types/scrolled/config/locales/new/header_line_breaks.en.yml +0 -27
  177. data/entry_types/scrolled/config/locales/new/header_size.de.yml +0 -17
  178. data/entry_types/scrolled/config/locales/new/header_size.en.yml +0 -17
  179. data/entry_types/scrolled/config/locales/new/iframe_embed.de.yml +0 -39
  180. data/entry_types/scrolled/config/locales/new/iframe_embed.en.yml +0 -39
  181. data/entry_types/scrolled/config/locales/new/inline_loops.de.yml +0 -26
  182. data/entry_types/scrolled/config/locales/new/inline_loops.en.yml +0 -26
  183. data/entry_types/scrolled/config/locales/new/portrait_inline_image.de.yml +0 -9
  184. data/entry_types/scrolled/config/locales/new/portrait_inline_image.en.yml +0 -9
  185. data/entry_types/scrolled/config/locales/new/section_width.de.yml +0 -10
  186. data/entry_types/scrolled/config/locales/new/section_width.en.yml +0 -10
  187. data/entry_types/scrolled/config/locales/new/typography_variants.de.yml +0 -7
  188. data/entry_types/scrolled/config/locales/new/typography_variants.en.yml +0 -7
  189. data/entry_types/scrolled/config/locales/new/video_embed_poster.de.yml +0 -8
  190. data/entry_types/scrolled/config/locales/new/video_embed_poster.en.yml +0 -8
  191. data/entry_types/scrolled/config/locales/new/waveform_styles.de.yml +0 -11
  192. data/entry_types/scrolled/config/locales/new/waveform_styles.en.yml +0 -12
  193. data/entry_types/scrolled/config/locales/new/widgets.de.yml +0 -6
  194. data/entry_types/scrolled/config/locales/new/widgets.en.yml +0 -6
  195. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/browserconfig.xml +0 -9
  196. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/mstile-150x150.png +0 -0
  197. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/safari-pinned-tab.svg +0 -46
  198. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/site.webmanifest +0 -19
  199. data/entry_types/scrolled/package/frontend/EditableInlineText.module-b9923660.js +0 -993
  200. data/entry_types/scrolled/package/frontend/usePhonePlatform-2857c22b.js +0 -34
  201. data/spec/factories/themings.rb +0 -7
@@ -1,4 +1,5 @@
1
- import React, { useReducer, useMemo, useCallback, createContext as createContext$1, useContext } from 'react';
1
+ import { browser } from 'pageflow/frontend';
2
+ import React, { useReducer, useMemo, useCallback, createContext as createContext$1, useContext, useState, useEffect } from 'react';
2
3
  import I18n from 'i18n-js';
3
4
  import { createContext, useContextSelector } from 'use-context-selector';
4
5
  import { createSelectorCreator, defaultMemoize, createSelector } from 'reselect';
@@ -346,217 +347,11 @@ function useEntryMetadata() {
346
347
  }, [entries]);
347
348
  }
348
349
 
349
- function _objectWithoutPropertiesLoose(source, excluded) {
350
- if (source == null) return {};
351
- var target = {};
352
- var sourceKeys = Object.keys(source);
353
- var key, i;
354
-
355
- for (i = 0; i < sourceKeys.length; i++) {
356
- key = sourceKeys[i];
357
- if (excluded.indexOf(key) >= 0) continue;
358
- target[key] = source[key];
359
- }
360
-
361
- return target;
362
- }
363
-
364
- function _objectWithoutProperties(source, excluded) {
365
- if (source == null) return {};
366
- var target = _objectWithoutPropertiesLoose(source, excluded);
367
- var key, i;
368
-
369
- if (Object.getOwnPropertySymbols) {
370
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
371
-
372
- for (i = 0; i < sourceSymbolKeys.length; i++) {
373
- key = sourceSymbolKeys[i];
374
- if (excluded.indexOf(key) >= 0) continue;
375
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
376
- target[key] = source[key];
377
- }
378
- }
379
-
380
- return target;
381
- }
382
-
383
- function _extends() {
384
- _extends = Object.assign || function (target) {
385
- for (var i = 1; i < arguments.length; i++) {
386
- var source = arguments[i];
387
-
388
- for (var key in source) {
389
- if (Object.prototype.hasOwnProperty.call(source, key)) {
390
- target[key] = source[key];
391
- }
392
- }
393
- }
394
-
395
- return target;
396
- };
397
-
398
- return _extends.apply(this, arguments);
399
- }
400
- var EmailIcon = (function (_ref) {
401
- var _ref$styles = _ref.styles,
402
- props = _objectWithoutProperties(_ref, ["styles"]);
403
-
404
- return /*#__PURE__*/React.createElement("svg", _extends({
405
- xmlns: "http://www.w3.org/2000/svg",
406
- viewBox: "0 0 612 612"
407
- }, props), /*#__PURE__*/React.createElement("path", {
408
- d: "M573.75 57.375H38.25C17.136 57.375 0 74.511 0 95.625v420.75c0 21.133 17.136 38.25 38.25 38.25h535.5c21.133 0 38.25-17.117 38.25-38.25V95.625c0-21.114-17.117-38.25-38.25-38.25zM554.625 497.25H57.375V204.657l224.03 187.999c7.134 5.967 15.874 8.97 24.595 8.97 8.74 0 17.461-3.003 24.595-8.97l224.03-187.999V497.25zm0-367.487L306 338.379 57.375 129.763V114.75h497.25v15.013z"
409
- }));
410
- });
411
-
412
- function _extends$1() {
413
- _extends$1 = Object.assign || function (target) {
414
- for (var i = 1; i < arguments.length; i++) {
415
- var source = arguments[i];
416
-
417
- for (var key in source) {
418
- if (Object.prototype.hasOwnProperty.call(source, key)) {
419
- target[key] = source[key];
420
- }
421
- }
422
- }
423
-
424
- return target;
425
- };
426
-
427
- return _extends$1.apply(this, arguments);
428
- }
429
- var FacebookIcon = (function (_ref) {
430
- var _ref$styles = _ref.styles,
431
- props = _objectWithoutProperties(_ref, ["styles"]);
432
-
433
- return /*#__PURE__*/React.createElement("svg", _extends$1({
434
- xmlns: "http://www.w3.org/2000/svg",
435
- viewBox: "0 0 430.113 430.114"
436
- }, props), /*#__PURE__*/React.createElement("path", {
437
- d: "M158.081 83.3v59.218h-43.385v72.412h43.385v215.183h89.122V214.936h59.805s5.601-34.721 8.316-72.685H247.54V92.74c0-7.4 9.717-17.354 19.321-17.354h48.557V.001h-66.021C155.878-.004 158.081 72.48 158.081 83.3z"
438
- }));
439
- });
440
-
441
- function _extends$2() {
442
- _extends$2 = Object.assign || function (target) {
443
- for (var i = 1; i < arguments.length; i++) {
444
- var source = arguments[i];
445
-
446
- for (var key in source) {
447
- if (Object.prototype.hasOwnProperty.call(source, key)) {
448
- target[key] = source[key];
449
- }
450
- }
451
- }
452
-
453
- return target;
454
- };
455
-
456
- return _extends$2.apply(this, arguments);
457
- }
458
- var LinkedInIcon = (function (_ref) {
459
- var _ref$styles = _ref.styles,
460
- props = _objectWithoutProperties(_ref, ["styles"]);
461
-
462
- return /*#__PURE__*/React.createElement("svg", _extends$2({
463
- xmlns: "http://www.w3.org/2000/svg",
464
- viewBox: "0 0 430.117 430.117"
465
- }, props), /*#__PURE__*/React.createElement("path", {
466
- d: "M430.117 261.543V420.56h-92.188V272.193c0-37.271-13.334-62.707-46.703-62.707-25.473 0-40.632 17.142-47.301 33.724-2.432 5.928-3.058 14.179-3.058 22.477V420.56h-92.219s1.242-251.285 0-277.32h92.21v39.309c-.187.294-.43.611-.606.896h.606v-.896c12.251-18.869 34.13-45.824 83.102-45.824 60.673-.001 106.157 39.636 106.157 124.818zM52.183 9.558C20.635 9.558 0 30.251 0 57.463c0 26.619 20.038 47.94 50.959 47.94h.616c32.159 0 52.159-21.317 52.159-47.94-.606-27.212-20-47.905-51.551-47.905zM5.477 420.56h92.184V143.24H5.477v277.32z"
467
- }));
468
- });
469
-
470
- function _extends$3() {
471
- _extends$3 = Object.assign || function (target) {
472
- for (var i = 1; i < arguments.length; i++) {
473
- var source = arguments[i];
474
-
475
- for (var key in source) {
476
- if (Object.prototype.hasOwnProperty.call(source, key)) {
477
- target[key] = source[key];
478
- }
479
- }
480
- }
481
-
482
- return target;
483
- };
484
-
485
- return _extends$3.apply(this, arguments);
486
- }
487
- var TelegramIcon = (function (_ref) {
488
- var _ref$styles = _ref.styles,
489
- props = _objectWithoutProperties(_ref, ["styles"]);
490
-
491
- return /*#__PURE__*/React.createElement("svg", _extends$3({
492
- xmlns: "http://www.w3.org/2000/svg",
493
- viewBox: "0 0 512.004 512.004"
494
- }, props), /*#__PURE__*/React.createElement("path", {
495
- d: "M508.194 20.517c-4.43-4.96-11.42-6.29-17.21-3.76l-482 211a15.01 15.01 0 00-8.98 13.41 15.005 15.005 0 008.38 13.79l115.09 56.6 28.68 172.06c.93 6.53 6.06 11.78 12.74 12.73 4.8.69 9.57-1 12.87-4.4l90.86-90.86 129.66 92.62a15.02 15.02 0 0014.24 1.74 15.01 15.01 0 009.19-11.01l90-451c.89-4.47-.26-9.26-3.52-12.92zm-372.84 263.45l-84.75-41.68 334.82-146.57-250.07 188.25zm46.94 44.59l-13.95 69.75-15.05-90.3 183.97-138.49-150.88 151.39c-2.12 2.12-3.53 4.88-4.09 7.65zm9.13 107.3l15.74-78.67 36.71 26.22-52.45 52.45zm205.41 19.94l-176.73-126.23 252.47-253.31-75.74 379.54z"
496
- }));
497
- });
498
-
499
- function _extends$4() {
500
- _extends$4 = Object.assign || function (target) {
501
- for (var i = 1; i < arguments.length; i++) {
502
- var source = arguments[i];
503
-
504
- for (var key in source) {
505
- if (Object.prototype.hasOwnProperty.call(source, key)) {
506
- target[key] = source[key];
507
- }
508
- }
509
- }
510
-
511
- return target;
512
- };
513
-
514
- return _extends$4.apply(this, arguments);
515
- }
516
- var TwitterIcon = (function (_ref) {
517
- var _ref$styles = _ref.styles,
518
- props = _objectWithoutProperties(_ref, ["styles"]);
519
-
520
- return /*#__PURE__*/React.createElement("svg", _extends$4({
521
- xmlns: "http://www.w3.org/2000/svg",
522
- viewBox: "0 0 612 612"
523
- }, props), /*#__PURE__*/React.createElement("path", {
524
- d: "M612 116.258a250.714 250.714 0 01-72.088 19.772c25.929-15.527 45.777-40.155 55.184-69.411-24.322 14.379-51.169 24.82-79.775 30.48-22.907-24.437-55.49-39.658-91.63-39.658-69.334 0-125.551 56.217-125.551 125.513 0 9.828 1.109 19.427 3.251 28.606-104.326-5.24-196.835-55.223-258.75-131.174-10.823 18.51-16.98 40.078-16.98 63.101 0 43.559 22.181 81.993 55.835 104.479a125.556 125.556 0 01-56.867-15.756v1.568c0 60.806 43.291 111.554 100.693 123.104-10.517 2.83-21.607 4.398-33.08 4.398-8.107 0-15.947-.803-23.634-2.333 15.985 49.907 62.336 86.199 117.253 87.194-42.947 33.654-97.099 53.655-155.916 53.655-10.134 0-20.116-.612-29.944-1.721 55.567 35.681 121.536 56.485 192.438 56.485 230.948 0 357.188-191.291 357.188-357.188l-.421-16.253c24.666-17.593 46.005-39.697 62.794-64.861z"
525
- }));
526
- });
527
-
528
- function _extends$5() {
529
- _extends$5 = Object.assign || function (target) {
530
- for (var i = 1; i < arguments.length; i++) {
531
- var source = arguments[i];
532
-
533
- for (var key in source) {
534
- if (Object.prototype.hasOwnProperty.call(source, key)) {
535
- target[key] = source[key];
536
- }
537
- }
538
- }
539
-
540
- return target;
541
- };
542
-
543
- return _extends$5.apply(this, arguments);
544
- }
545
- var WhatsAppIcon = (function (_ref) {
546
- var _ref$styles = _ref.styles,
547
- props = _objectWithoutProperties(_ref, ["styles"]);
548
-
549
- return /*#__PURE__*/React.createElement("svg", _extends$5({
550
- xmlns: "http://www.w3.org/2000/svg",
551
- viewBox: "0 0 90 90"
552
- }, props), /*#__PURE__*/React.createElement("path", {
553
- d: "M90 43.841c0 24.213-19.779 43.841-44.182 43.841a44.256 44.256 0 01-21.357-5.455L0 90l7.975-23.522a43.38 43.38 0 01-6.34-22.637C1.635 19.628 21.416 0 45.818 0 70.223 0 90 19.628 90 43.841zM45.818 6.982c-20.484 0-37.146 16.535-37.146 36.859 0 8.065 2.629 15.534 7.076 21.61L11.107 79.14l14.275-4.537A37.122 37.122 0 0045.819 80.7c20.481 0 37.146-16.533 37.146-36.857S66.301 6.982 45.818 6.982zm22.311 46.956c-.273-.447-.994-.717-2.076-1.254-1.084-.537-6.41-3.138-7.4-3.495-.993-.358-1.717-.538-2.438.537-.721 1.076-2.797 3.495-3.43 4.212-.632.719-1.263.809-2.347.271-1.082-.537-4.571-1.673-8.708-5.333-3.219-2.848-5.393-6.364-6.025-7.441-.631-1.075-.066-1.656.475-2.191.488-.482 1.084-1.255 1.625-1.882.543-.628.723-1.075 1.082-1.793.363-.717.182-1.344-.09-1.883-.27-.537-2.438-5.825-3.34-7.977-.902-2.15-1.803-1.792-2.436-1.792-.631 0-1.354-.09-2.076-.09s-1.896.269-2.889 1.344c-.992 1.076-3.789 3.676-3.789 8.963 0 5.288 3.879 10.397 4.422 11.113.541.716 7.49 11.92 18.5 16.223C58.2 65.771 58.2 64.336 60.186 64.156c1.984-.179 6.406-2.599 7.312-5.107.9-2.512.9-4.663.631-5.111z"
554
- }));
555
- });
556
-
557
350
  /**
558
- * Returns a list of attributes (icon, name and url) of all configured share providers of the entry.
559
- * The url provides a %{url} placeholder where the link can be inserted.
351
+ * Returns a list of attributes (iconName, name and url) of all configured share
352
+ * providers of the entry. The url provides a %{url} placeholder where the link
353
+ * can be inserted. iconName can be passed to ThemeIcon to render a theme
354
+ * specific icon.
560
355
  *
561
356
  * @example
562
357
  *
@@ -564,12 +359,12 @@ var WhatsAppIcon = (function (_ref) {
564
359
  * shareProviders // =>
565
360
  * [
566
361
  * {
567
- * icon: <FacebookSVGIcon />,
362
+ * iconName: 'facebook',
568
363
  * name: 'Facebook',
569
364
  * url: http://www.facebook.com/sharer/sharer.php?u=%{url}
570
365
  * },
571
366
  * {
572
- * icon: <TwitterSVGIcon />,
367
+ * iconName: 'twitter',
573
368
  * name: 'Twitter',
574
369
  * url: https://twitter.com/intent/tweet?url=%{url}
575
370
  * }
@@ -585,32 +380,32 @@ function useShareProviders(_ref) {
585
380
  return useMemo(function () {
586
381
  var sharing = {
587
382
  email: {
588
- icon: EmailIcon,
383
+ iconName: 'email',
589
384
  name: 'Mail',
590
385
  url: urlTemplates.email
591
386
  },
592
387
  facebook: {
593
- icon: FacebookIcon,
388
+ iconName: 'facebook',
594
389
  name: 'Facebook',
595
390
  url: urlTemplates.facebook
596
391
  },
597
392
  linked_in: {
598
- icon: LinkedInIcon,
393
+ iconName: 'linkedIn',
599
394
  name: 'LinkedIn',
600
395
  url: urlTemplates.linked_in
601
396
  },
602
397
  telegram: {
603
- icon: TelegramIcon,
398
+ iconName: 'telegram',
604
399
  name: 'Telegram',
605
400
  url: urlTemplates.telegram
606
401
  },
607
402
  twitter: {
608
- icon: TwitterIcon,
403
+ iconName: 'twitter',
609
404
  name: 'Twitter',
610
405
  url: urlTemplates.twitter
611
406
  },
612
407
  whats_app: {
613
- icon: WhatsAppIcon,
408
+ iconName: 'whatsApp',
614
409
  name: 'WhatsApp',
615
410
  url: urlTemplates.whats_app
616
411
  }
@@ -619,7 +414,7 @@ function useShareProviders(_ref) {
619
414
  var config = sharing[provider];
620
415
  return {
621
416
  name: config.name,
622
- icon: config.icon,
417
+ iconName: config.iconName,
623
418
  url: config.url
624
419
  };
625
420
  });
@@ -820,11 +615,20 @@ function useSectionContentElements(_ref2) {
820
615
  };
821
616
  });
822
617
  }
618
+ function useChapter(_ref3) {
619
+ var permaId = _ref3.permaId;
620
+ var chapters = useChapters();
621
+ return useMemo(function () {
622
+ return chapters.find(function (chapter) {
623
+ return chapter.permaId === permaId;
624
+ });
625
+ }, [chapters, permaId]);
626
+ }
823
627
  function useChapters() {
824
628
  var chapters = useEntryStateCollectionItems('chapters');
825
629
  return useMemo(function () {
826
630
  var chapterSlugs = {};
827
- return chapters.map(function (chapter) {
631
+ return chapters.map(function (chapter, index) {
828
632
  var chapterSlug = chapter.configuration.title;
829
633
 
830
634
  if (chapterSlug) {
@@ -846,6 +650,7 @@ function useChapters() {
846
650
  return {
847
651
  id: chapter.id,
848
652
  permaId: chapter.permaId,
653
+ index: index,
849
654
  title: chapter.configuration.title,
850
655
  summary: chapter.configuration.summary,
851
656
  chapterSlug: chapterSlug
@@ -901,7 +706,7 @@ function getFileUrl(collectionName, file, quality, urlTemplates) {
901
706
  var template = templates[quality];
902
707
 
903
708
  if (template) {
904
- return template.replace(':id_partition', idPartition(file.id)).replace(':basename', file.basename).replace(':pageflow_hls_qualities', function () {
709
+ return template.replace(':id_partition', idPartition(file.id)).replace(':basename', file.basename).replace(':extension', file.extension).replace(':pageflow_hls_qualities', function () {
905
710
  return hlsQualities(file);
906
711
  });
907
712
  }
@@ -1180,6 +985,65 @@ function useI18n() {
1180
985
  };
1181
986
  }
1182
987
 
988
+ function _objectWithoutPropertiesLoose(source, excluded) {
989
+ if (source == null) return {};
990
+ var target = {};
991
+ var sourceKeys = Object.keys(source);
992
+ var key, i;
993
+
994
+ for (i = 0; i < sourceKeys.length; i++) {
995
+ key = sourceKeys[i];
996
+ if (excluded.indexOf(key) >= 0) continue;
997
+ target[key] = source[key];
998
+ }
999
+
1000
+ return target;
1001
+ }
1002
+
1003
+ function _objectWithoutProperties(source, excluded) {
1004
+ if (source == null) return {};
1005
+ var target = _objectWithoutPropertiesLoose(source, excluded);
1006
+ var key, i;
1007
+
1008
+ if (Object.getOwnPropertySymbols) {
1009
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
1010
+
1011
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
1012
+ key = sourceSymbolKeys[i];
1013
+ if (excluded.indexOf(key) >= 0) continue;
1014
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
1015
+ target[key] = source[key];
1016
+ }
1017
+ }
1018
+
1019
+ return target;
1020
+ }
1021
+
1022
+ var BrowserFeaturesAvailableContext = createContext$1(); // Browser feature detection is not available during server side
1023
+ // rendering. To prevent mismatches during hydration, we keep features
1024
+ // disabled in the initial render. Since hydration only starts after
1025
+ // feature detection has finished, we can immediately re-render once
1026
+ // the provider has mounted.
1027
+
1028
+ function BrowserFeaturesProvider(_ref) {
1029
+ var children = _ref.children;
1030
+
1031
+ var _useState = useState(false),
1032
+ _useState2 = _slicedToArray(_useState, 2),
1033
+ isAvailable = _useState2[0],
1034
+ setIsAvailable = _useState2[1];
1035
+
1036
+ useEffect(function () {
1037
+ return setIsAvailable(true);
1038
+ }, []);
1039
+ return /*#__PURE__*/React.createElement(BrowserFeaturesAvailableContext.Provider, {
1040
+ value: isAvailable
1041
+ }, children);
1042
+ }
1043
+ function useBrowserFeature(name) {
1044
+ return useContext(BrowserFeaturesAvailableContext) && browser.has(name);
1045
+ }
1046
+
1183
1047
  var PhonePlatformContext = React.createContext(false);
1184
1048
 
1185
- export { updateContentElementConfiguration as A, EntryStateProvider as E, LocaleProvider as L, PhonePlatformContext as P, _objectWithoutProperties as _, _objectSpread2 as a, _defineProperty as b, _slicedToArray as c, useLocale as d, useLegalInfo as e, useTheme as f, useEntryMetadata as g, useNestedFiles as h, useFile as i, useSectionContentElements as j, useSectionsWithChapter as k, useEntryStructure as l, useWidget as m, getFileUrlTemplateHost as n, _toConsumableArray as o, useAvailableQualities as p, useEntryStateDispatch as q, useSection as r, setupI18n as s, useAdditionalSeedData as t, useI18n as u, useChapters as v, useCredits as w, useFileRights as x, useShareProviders as y, useShareUrl as z };
1049
+ export { useShareProviders as A, BrowserFeaturesProvider as B, useShareUrl as C, updateContentElementConfiguration as D, EntryStateProvider as E, _unsupportedIterableToArray as F, LocaleProvider as L, PhonePlatformContext as P, _objectWithoutProperties as _, _objectSpread2 as a, _defineProperty as b, _slicedToArray as c, useLocale as d, useLegalInfo as e, useTheme as f, useEntryMetadata as g, useNestedFiles as h, useFile as i, _toConsumableArray as j, useSectionContentElements as k, useAdditionalSeedData as l, useSectionsWithChapter as m, useBrowserFeature as n, useEntryStateDispatch as o, useSection as p, useChapter as q, useEntryStructure as r, useWidget as s, getFileUrlTemplateHost as t, useI18n as u, useAvailableQualities as v, setupI18n as w, useChapters as x, useCredits as y, useFileRights as z };
@@ -1,13 +1,13 @@
1
1
  import 'pageflow/frontend';
2
2
  import React, { useMemo, useEffect, useRef, useState } from 'react';
3
3
  import ReactDOM from 'react-dom';
4
- import { _ as _objectWithoutProperties, u as useI18n, b as _defineProperty, c as _slicedToArray } from './PhonePlatformContext-9fb97827.js';
4
+ import { _ as _objectWithoutProperties, u as useI18n, b as _defineProperty, n as useBrowserFeature, c as _slicedToArray } from './PhonePlatformContext-f6093cc6.js';
5
5
  import 'i18n-js';
6
6
  import 'use-context-selector';
7
7
  import 'reselect';
8
8
  import 'slugify';
9
9
  import classNames from 'classnames';
10
- import { u as useBrowserFeature, a as usePhonePlatform } from './usePhonePlatform-2857c22b.js';
10
+ import { A as ArrowRightIcon, u as usePhonePlatform } from './arrowRight-78a7cee4.js';
11
11
  import { PanoViewer } from '@egjs/view360';
12
12
  import screenfull from 'screenfull';
13
13
 
@@ -165,40 +165,6 @@ var ArrowLeftIcon = (function (_ref) {
165
165
  }));
166
166
  });
167
167
 
168
- function _extends$3() {
169
- _extends$3 = Object.assign || function (target) {
170
- for (var i = 1; i < arguments.length; i++) {
171
- var source = arguments[i];
172
-
173
- for (var key in source) {
174
- if (Object.prototype.hasOwnProperty.call(source, key)) {
175
- target[key] = source[key];
176
- }
177
- }
178
- }
179
-
180
- return target;
181
- };
182
-
183
- return _extends$3.apply(this, arguments);
184
- }
185
- var ArrowRightIcon = (function (_ref) {
186
- var _ref$styles = _ref.styles,
187
- styles = _ref$styles === void 0 ? {} : _ref$styles,
188
- props = _objectWithoutProperties(_ref, ["styles"]);
189
-
190
- return /*#__PURE__*/React.createElement("svg", _extends$3({
191
- xmlns: "http://www.w3.org/2000/svg",
192
- className: (styles["h-5"] || "h-5") + " " + (styles["w-5"] || "w-5"),
193
- viewBox: "0 0 20 20",
194
- fill: "currentColor"
195
- }, props), /*#__PURE__*/React.createElement("path", {
196
- fillRule: "evenodd",
197
- d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",
198
- clipRule: "evenodd"
199
- }));
200
- });
201
-
202
168
  var styles$2 = {"indicator":"PanoramaIndicator-module_indicator__3A90v","visible":"PanoramaIndicator-module_visible__3LOgm","arrow":"PanoramaIndicator-module_arrow__QV1Pd","arrowLeft":"PanoramaIndicator-module_arrowLeft__Jh7GC PanoramaIndicator-module_arrow__QV1Pd","arrowRight":"PanoramaIndicator-module_arrowRight__ZZBtO PanoramaIndicator-module_arrow__QV1Pd","nudgeLeft":"PanoramaIndicator-module_nudgeLeft__IU_Iy","nudgeRight":"PanoramaIndicator-module_nudgeRight__3XzNu","text":"PanoramaIndicator-module_text__2FzUy"};
203
169
 
204
170
  function PanoramaIndicator(_ref) {
@@ -258,8 +224,8 @@ function FullscreenIndicator(_ref) {
258
224
 
259
225
  var styles$4 = {"full":"Viewer-module_full__1q18y","container":"Viewer-module_container__3eJ34 Viewer-module_full__1q18y","controls":"Viewer-module_controls__3BTof","spinner":"Viewer-module_spinner__2oRve","spin":"Viewer-module_spin__3jBR2","isLoading":"Viewer-module_isLoading__sQuGw"};
260
226
 
261
- function _extends$4() {
262
- _extends$4 = Object.assign || function (target) {
227
+ function _extends$3() {
228
+ _extends$3 = Object.assign || function (target) {
263
229
  for (var i = 1; i < arguments.length; i++) {
264
230
  var source = arguments[i];
265
231
 
@@ -273,13 +239,13 @@ function _extends$4() {
273
239
  return target;
274
240
  };
275
241
 
276
- return _extends$4.apply(this, arguments);
242
+ return _extends$3.apply(this, arguments);
277
243
  }
278
244
  var SpinnerIcon = (function (_ref) {
279
245
  var _ref$styles = _ref.styles,
280
246
  props = _objectWithoutProperties(_ref, ["styles"]);
281
247
 
282
- return /*#__PURE__*/React.createElement("svg", _extends$4({
248
+ return /*#__PURE__*/React.createElement("svg", _extends$3({
283
249
  xmlns: "http://www.w3.org/2000/svg",
284
250
  fill: "none",
285
251
  viewBox: "0 0 24 24"
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import { P as PhonePlatformContext, _ as _objectWithoutProperties } from './PhonePlatformContext-f6093cc6.js';
3
+
4
+ function usePhonePlatform() {
5
+ return React.useContext(PhonePlatformContext);
6
+ }
7
+
8
+ function _extends() {
9
+ _extends = Object.assign || function (target) {
10
+ for (var i = 1; i < arguments.length; i++) {
11
+ var source = arguments[i];
12
+
13
+ for (var key in source) {
14
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
15
+ target[key] = source[key];
16
+ }
17
+ }
18
+ }
19
+
20
+ return target;
21
+ };
22
+
23
+ return _extends.apply(this, arguments);
24
+ }
25
+ var ArrowRightIcon = (function (_ref) {
26
+ var _ref$styles = _ref.styles,
27
+ styles = _ref$styles === void 0 ? {} : _ref$styles,
28
+ props = _objectWithoutProperties(_ref, ["styles"]);
29
+
30
+ return /*#__PURE__*/React.createElement("svg", _extends({
31
+ xmlns: "http://www.w3.org/2000/svg",
32
+ className: (styles["h-5"] || "h-5") + " " + (styles["w-5"] || "w-5"),
33
+ viewBox: "0 0 20 20",
34
+ fill: "currentColor"
35
+ }, props), /*#__PURE__*/React.createElement("path", {
36
+ fillRule: "evenodd",
37
+ d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",
38
+ clipRule: "evenodd"
39
+ }));
40
+ });
41
+
42
+ export { ArrowRightIcon as A, usePhonePlatform as u };