pageflow 15.1.0.beta6 → 15.1.0.rc0

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.

Potentially problematic release.


This version of pageflow might be problematic. Click here for more details.

Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/app/assets/javascripts/pageflow/dist/editor.js +613 -94
  4. data/app/assets/javascripts/pageflow/dist/ui.js +120 -3
  5. data/app/assets/stylesheets/pageflow/editor/base.scss +1 -0
  6. data/app/assets/stylesheets/pageflow/editor/composables.scss +9 -0
  7. data/app/assets/stylesheets/pageflow/editor/file_import.scss +7 -8
  8. data/app/helpers/pageflow/config_helper.rb +1 -1
  9. data/app/helpers/pageflow/entries_helper.rb +6 -1
  10. data/app/helpers/pageflow/social_share_links_helper.rb +5 -1
  11. data/config/locales/de.yml +34 -16
  12. data/config/locales/en.yml +34 -16
  13. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +613 -93
  14. data/entry_types/paged/app/views/layouts/pageflow_paged/application.html.erb +2 -1
  15. data/entry_types/paged/lib/pageflow_paged/engine.rb +1 -0
  16. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/chapters_controller.rb +9 -1
  17. data/entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb +2 -0
  18. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +28 -0
  19. data/entry_types/scrolled/config/locales/new/de.yml +46 -0
  20. data/entry_types/scrolled/config/locales/new/en.yml +46 -0
  21. data/entry_types/scrolled/lib/pageflow_scrolled/engine.rb +1 -0
  22. data/entry_types/scrolled/package/editor.js +2844 -78
  23. data/entry_types/scrolled/package/frontend.js +955 -443
  24. data/entry_types/scrolled/package/package.json +1 -0
  25. data/lib/pageflow/version.rb +1 -1
  26. data/packages/pageflow/editor.js +485 -90
  27. data/packages/pageflow/ui.js +120 -3
  28. metadata +5 -4
  29. data/config/locales/new/entry_metadata_configuration.de.yml +0 -17
  30. data/config/locales/new/entry_metadata_configuration.en.yml +0 -17
@@ -153,6 +153,48 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
153
153
  translationKeysWithSuffix: translationKeysWithSuffix
154
154
  });
155
155
 
156
+ function _arrayWithHoles(arr) {
157
+ if (Array.isArray(arr)) return arr;
158
+ }
159
+
160
+ function _iterableToArrayLimit(arr, i) {
161
+ if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
162
+ return;
163
+ }
164
+
165
+ var _arr = [];
166
+ var _n = true;
167
+ var _d = false;
168
+ var _e = undefined;
169
+
170
+ try {
171
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
172
+ _arr.push(_s.value);
173
+
174
+ if (i && _arr.length === i) break;
175
+ }
176
+ } catch (err) {
177
+ _d = true;
178
+ _e = err;
179
+ } finally {
180
+ try {
181
+ if (!_n && _i["return"] != null) _i["return"]();
182
+ } finally {
183
+ if (_d) throw _e;
184
+ }
185
+ }
186
+
187
+ return _arr;
188
+ }
189
+
190
+ function _nonIterableRest() {
191
+ throw new TypeError("Invalid attempt to destructure non-iterable instance");
192
+ }
193
+
194
+ function _slicedToArray(arr, i) {
195
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
196
+ }
197
+
156
198
  /**
157
199
  * Create object that can be passed to Marionette ui property from CSS
158
200
  * module object.
@@ -183,7 +225,7 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
183
225
  * <div class=${styles.container}></div>
184
226
  * `,
185
227
  *
186
- * ui: cssModulesUtils.ui(styles, 'container');
228
+ * ui: cssModulesUtils.ui(styles, 'container'),
187
229
  *
188
230
  * onRender() {
189
231
  * this.ui.container // => JQuery wrapper for container element
@@ -198,14 +240,87 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
198
240
  }
199
241
 
200
242
  return classNames.reduce(function (result, className) {
201
- result[className] = ".".concat(styles[className]);
243
+ result[className] = selector(styles, className);
244
+ return result;
245
+ }, {});
246
+ }
247
+ /**
248
+ * Create object that can be passed to Marionette events property from CSS
249
+ * module object.
250
+ *
251
+ * @param {Object} styles
252
+ * Class name mapping imported from `.module.css` file.
253
+ *
254
+ * @param {Object} mapping
255
+ * Events mapping using keys from the `styles` instead of CSS class names.
256
+ *
257
+ * @return {Object}
258
+ *
259
+ * @example
260
+ *
261
+ * // MyView.module.css
262
+ *
263
+ * .addButton {}
264
+ *
265
+ * // MyView.js
266
+ *
267
+ * import Marionette from 'marionette';
268
+ * import {cssModulesUtils} from 'pageflow/ui';
269
+ *
270
+ * import styles from './MyView.module.css';
271
+ *
272
+ * export const MyView = Marionette.ItemView({
273
+ * template: () => `
274
+ * <button class=${styles.addButton}></button>
275
+ * `,
276
+ *
277
+ * events: cssModulesUtils.ui(styles, {
278
+ * 'click addButton': () => console.log('clicked add button');
279
+ * })
280
+ * });
281
+ *
282
+ * @memberof cssModulesUtils
283
+ */
284
+
285
+ function events(styles, mapping) {
286
+ return Object.keys(mapping).reduce(function (result, key) {
287
+ var _key$split = key.split(' '),
288
+ _key$split2 = _slicedToArray(_key$split, 2),
289
+ event = _key$split2[0],
290
+ className = _key$split2[1];
291
+
292
+ result["".concat(event, " ").concat(selector(styles, className))] = mapping[key];
202
293
  return result;
203
294
  }, {});
204
295
  }
296
+ /**
297
+ * Generates a CSS selector from a CSS module rule.
298
+ *
299
+ * @param {Object} styles
300
+ * Class name mapping imported from `.module.css` file.
301
+ *
302
+ * @param {String} className
303
+ * Key from the `styles` object.
304
+ *
305
+ * @return {String} CSS Selector
306
+ * @memberof cssModulesUtils
307
+ */
308
+
309
+ function selector(styles, className) {
310
+ var classNames = styles[className];
311
+
312
+ if (!classNames) {
313
+ throw new Error("Unknown class name ".concat(className, " in mapping. Knwon names: ").concat(Object.keys(styles).join(', '), "."));
314
+ }
315
+
316
+ return ".".concat(classNames.replace(/ /g, '.'));
317
+ }
205
318
 
206
319
  var cssModulesUtils = /*#__PURE__*/Object.freeze({
207
320
  __proto__: null,
208
- ui: ui
321
+ ui: ui,
322
+ events: events,
323
+ selector: selector
209
324
  });
210
325
 
211
326
  // https://github.com/jashkenas/backbone/issues/2601
@@ -1062,6 +1177,8 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
1062
1177
  this.$el.addClass('input');
1063
1178
  this.$el.addClass(this.model.modelName + '_' + this.options.propertyName);
1064
1179
  this.$el.data('inputPropertyName', this.options.propertyName);
1180
+ this.$el.data('labelText', this.labelText());
1181
+ this.$el.data('inlineHelpText', this.inlineHelpText());
1065
1182
  this.ui.labelText.text(this.labelText());
1066
1183
  this.ui.inlineHelp.html(this.inlineHelpText());
1067
1184
 
@@ -53,6 +53,7 @@
53
53
  text-decoration: none;
54
54
  }
55
55
 
56
+ @import "./composables";
56
57
  @import "./list";
57
58
  @import "./drop_down_button";
58
59
 
@@ -0,0 +1,9 @@
1
+ // Class names that are reused in entry type CSS module files. Used
2
+ // for styles that would be hard to re-create without the SCSS mixins
3
+ // available here.
4
+
5
+ // See entry_type/scrolled/package/src/editor/buttons.module.css
6
+
7
+ .icon_button {
8
+ @include icon-button;
9
+ }
@@ -2,11 +2,11 @@
2
2
  .choose_importer_box {
3
3
  position: absolute;
4
4
  top: 20px;
5
- left: 20px;
5
+ left: 10px;
6
6
  bottom: 20px;
7
7
  right: 20px;
8
8
  max-width: 1100px;
9
- height: 70vh;
9
+ height: 75vh;
10
10
 
11
11
  .content {
12
12
  display: table;
@@ -60,11 +60,11 @@
60
60
  .file_importer_box {
61
61
  position: absolute;
62
62
  top: 20px;
63
- left: 20px;
63
+ left: 10px;
64
64
  bottom: 20px;
65
65
  right: 20px;
66
66
  max-width: 1100px;
67
- height: 70vh;
67
+ height: 75vh;
68
68
 
69
69
  .content_panel {
70
70
  width: 100%;
@@ -73,9 +73,9 @@
73
73
  .footer {
74
74
  width: 100%;
75
75
  position: absolute;
76
- bottom: 10px;
77
- right: 15px;
78
-
76
+ bottom: 20px;
77
+ right: 23px;
78
+ margin-bottom: -15px;
79
79
  .import {
80
80
  @include icon-button();
81
81
  }
@@ -94,7 +94,6 @@
94
94
  width: 25px;
95
95
  height: 30px;
96
96
  overflow: hidden;
97
- top: -3px;
98
97
  background-color: #a9a9a959;
99
98
 
100
99
  &:hover {
@@ -16,7 +16,7 @@ module Pageflow
16
16
  end
17
17
  end
18
18
 
19
- # Render seed data that can be used map model names in
19
+ # Render seed data that can be used to map model names in
20
20
  # parent_file_model_type attributes to file collection names.
21
21
  #
22
22
  # @param [JBuilder] json
@@ -9,6 +9,11 @@ module Pageflow
9
9
  pageflow.short_entry_url(entry.to_model, params)
10
10
  end
11
11
 
12
+ def entry_privacy_link_url(entry)
13
+ return unless entry.theming.privacy_link_url.present?
14
+ "#{entry.theming.privacy_link_url}?lang=#{entry.locale}"
15
+ end
16
+
12
17
  def entry_file_rights(entry)
13
18
  rights = Pageflow.config.file_types.map do |file_type|
14
19
  entry.find_files(file_type.model).map do |file|
@@ -46,7 +51,7 @@ module Pageflow
46
51
 
47
52
  if entry.theming.privacy_link_url.present?
48
53
  links << link_to(I18n.t('pageflow.public.privacy_notice'),
49
- "#{entry.theming.privacy_link_url}?lang=#{entry.locale}",
54
+ entry_privacy_link_url(entry),
50
55
  target: '_blank',
51
56
  tabindex: 2,
52
57
  class: 'privacy')
@@ -25,12 +25,16 @@ module Pageflow
25
25
  &block)
26
26
  end
27
27
 
28
+ def share_provider_url_templates
29
+ PROVIDER_URL_TEMPLATES
30
+ end
31
+
28
32
  private
29
33
 
30
34
  def social_share_link_url(provider, url)
31
35
  return nil if url.blank?
32
36
  encoded_url = ERB::Util.url_encode(url)
33
- PROVIDER_URL_TEMPLATES[provider] % {url: encoded_url}
37
+ format(PROVIDER_URL_TEMPLATES[provider], url: encoded_url)
34
38
  end
35
39
  end
36
40
  end
@@ -181,15 +181,9 @@ de:
181
181
  credits: Credits
182
182
  edited_at: Geändert am
183
183
  embed_code: Einbetten
184
- emphasize_chapter_beginning: Kapitelanfang hervorheben
185
- emphasize_new_pages: Neue Seiten hervorheben
186
184
  first_published_at: Erstmals veröffentlicht am
187
- home_button_enabled: Home-Button anzeigen
188
- home_url: Home-Button URL
189
185
  keywords: Schlüsselwörter
190
186
  locale: Sprache
191
- manual_start: Multimedia Hinweis vor dem Start anzeigen
192
- overview_button_enabled: Übersicht-Button anzeigen
193
187
  own_role: Rolle
194
188
  published?: Veröffentlichungstatus
195
189
  published_at: Veröffentlicht seit
@@ -1361,6 +1355,12 @@ de:
1361
1355
  Kapitel einschließlich ALLER enthaltener Seiten wirklich löschen?
1362
1356
 
1363
1357
  Dieser Schritt kann nicht rückgängig gemacht werden.
1358
+ edit_configuration:
1359
+ back: Gliederung
1360
+ confirm_destroy: Wirklich löschen?
1361
+ destroy: Löschen
1362
+ retry: Erneut versuchen
1363
+ save_error: Fehler beim Speichern
1364
1364
  edit_entry_view:
1365
1365
  cannot_publish: Sie sind nicht berechtigt diesen Beitrag zu veröffentlichen.
1366
1366
  edit_page_view:
@@ -1436,6 +1436,34 @@ de:
1436
1436
  feature_name: Editor Phone Emulationsmodus
1437
1437
  entry:
1438
1438
  duplicated_title: Kopie von %{title}
1439
+ entry_types:
1440
+ paged:
1441
+ editor:
1442
+ entry_metadata_configuration_attributes:
1443
+ emphasize_chapter_beginning:
1444
+ inline_help: Mit dieser Option wird der Titel der jeweils ersten Seite eines Kapitels größer dargestellt.
1445
+ label: Kapitelanfang hervorheben
1446
+ emphasize_new_pages:
1447
+ inline_help: Zeigt zum Start des Pageflows in einer Info-Box die seit dem letzten Besuch neu erstellten Seiten an.
1448
+ label: Neue Seiten hervorheben
1449
+ home_button_enabled:
1450
+ inline_help: Es gibt die Möglichkeit, in der Navigation einen Button anzuzeigen, der auf eine externe Seite verlinkt, z.B. zurück auf die Homepage, von der aus Du den Pageflow verlinkt hast.
1451
+ label: Home-Button anzeigen
1452
+ home_button_enabled_disabled:
1453
+ inline_help: Diese Funktion steht in diesem Theme nicht zur Verfügung.
1454
+ home_url:
1455
+ inline_help: URL der Übersichtseite. Leer lassen, um Standard zu übernehmen.
1456
+ label: Home-Button-URL
1457
+ home_url_disabled:
1458
+ inline_help: Diese Funktion steht in diesem Theme nicht zur Verfügung.
1459
+ manual_start:
1460
+ inline_help: Entscheide, ob zu Beginn Deines Pageflows ein Hinweis angezeigt wird.
1461
+ label: Multimedia-Hinweis vor dem Start anzeigen
1462
+ overview_button_enabled:
1463
+ inline_help: In der Übersicht werden die Kapitel und Seiten des Haupterzählstrangs angezeigt.
1464
+ label: Übersicht-Button anzeigen
1465
+ overview_button_enabled_disabled:
1466
+ inline_help: Diese Funktion steht in diesem Theme nicht zur Verfügung.
1439
1467
  help_entries:
1440
1468
  atmo:
1441
1469
  menu_item: Atmo Audio
@@ -1838,16 +1866,7 @@ de:
1838
1866
  pageflow/entry:
1839
1867
  author: Name des Autors.
1840
1868
  credits: Text wird zusammen mit dem Impressumsverweis angezeigt.
1841
- emphasize_chapter_beginning: Mit dieser Option wird der Titel der jeweils ersten Seite eines Kapitels größer dargestellt.
1842
- emphasize_new_pages: Zeigt zum Start des Pageflows in einer Info-Box die seit dem letzten Besuch neu erstellen Seiten an.
1843
- home_button_enabled: Es gibt die Möglichkeit, in der Navigation einen Button anzuzeigen, der auf eine externe Seite verlinkt, z.B. zurück auf die Homepage, von der aus Du den Pageflow verlinkt hast.
1844
- home_button_enabled_disabled: Diese Funktion steht in diesem Theme nicht zur Verfügung.
1845
- home_url: URL der Übersichtseite. Leer lassen, um Standard zu übernehmen.
1846
- home_url_disabled: Diese Funktion steht in diesem Theme nicht zur Verfügung.
1847
1869
  keywords: Schlüsselwörter als Vorschlag für Suchmaschinen.
1848
- manual_start: Entscheide, ob zu Beginn Deines Pageflows ein Hinweis angezeigt wird.
1849
- overview_button_enabled: In der Übersicht werden die Kapitel und Seiten des Haupterzählstrangs angezeigt.
1850
- overview_button_enabled_disabled: Diese Funktion steht in diesem Theme nicht zur Verfügung.
1851
1870
  publisher: Name oder Firmenname des Herausgeber.
1852
1871
  share_providers: Social Media Plattformen, die unter dem Menüpunkt "Teilen" des Beitrags angezeigt werden sollen
1853
1872
  share_url: URL, die geteilt werden soll, wenn der Benutzer auf einen der Social Media Buttons klickt. Feld frei lassen, um URL des veröffentlichten Beitrags zu verwenden.
@@ -1890,7 +1909,6 @@ de:
1890
1909
  link_type:
1891
1910
  page_link: Seite
1892
1911
  url: URL
1893
- ok: DELETED
1894
1912
  open_in_new_tab: In neuem Tab öffnen
1895
1913
  open_in_new_tab_help: Empfohlen, damit der Beitrag nach Betrachten des Links nicht erneut geladen werden muss. Bitte beachte, dass Links in der Editor-Vorschau immer in einem neuen Tab geöffnet werden.
1896
1914
  remove_link: Link entfernen
@@ -181,15 +181,9 @@ en:
181
181
  credits: Credits
182
182
  edited_at: Updated at
183
183
  embed_code: Embed
184
- emphasize_chapter_beginning: Emphasize chapter beginning
185
- emphasize_new_pages: Emphasize new pages
186
184
  first_published_at: First published at
187
- home_button_enabled: Show 'Home' button
188
- home_url: "'Home' Button URL"
189
185
  keywords: Keywords
190
186
  locale: Language
191
- manual_start: Show Instruction-Overlay
192
- overview_button_enabled: Show 'Overview' button
193
187
  own_role: Role
194
188
  published?: Publication state
195
189
  published_at: Published since
@@ -1361,6 +1355,12 @@ en:
1361
1355
  Really delete this chapter including ALL its pages?
1362
1356
 
1363
1357
  This operation cannot be undone.
1358
+ edit_configuration:
1359
+ back: Outline
1360
+ confirm_destroy: Really delete this record? This action cannot be undone.
1361
+ destroy: Delete
1362
+ retry: Retry
1363
+ save_error: Saving the record failed.
1364
1364
  edit_entry_view:
1365
1365
  cannot_publish: You do not have sufficient rights to publish this story.
1366
1366
  edit_page_view:
@@ -1436,6 +1436,34 @@ en:
1436
1436
  feature_name: Editor phone emulation mode
1437
1437
  entry:
1438
1438
  duplicated_title: Copy of %{title}
1439
+ entry_types:
1440
+ paged:
1441
+ editor:
1442
+ entry_metadata_configuration_attributes:
1443
+ emphasize_chapter_beginning:
1444
+ inline_help: This option emphasizes the title of the first page of a chapter.
1445
+ label: Emphasize chapter beginning
1446
+ emphasize_new_pages:
1447
+ inline_help: At the beginning of a Pageflow an info box shows news pages that were created since the last visit.
1448
+ label: Emphasize new pages
1449
+ home_button_enabled:
1450
+ inline_help: Pageflow can display a button in the navigation that links to an external website, for example back to the website from which you linked the Pageflow.
1451
+ label: Show 'Home' button
1452
+ home_button_enabled_disabled:
1453
+ inline_help: This option is not available for your theme.
1454
+ home_url:
1455
+ inline_help: URL of your home page. Leave empty to use your account's default setting.
1456
+ label: "'Home' button URL"
1457
+ home_url_disabled:
1458
+ inline_help: This option is not available for your theme.
1459
+ manual_start:
1460
+ inline_help: Decide if tips or advice should be shown at the beginning of your Pageflow.
1461
+ label: Show instruction overlay
1462
+ overview_button_enabled:
1463
+ inline_help: The overview displays chapters and pages of the main storyline.
1464
+ label: Show 'Overview' button
1465
+ overview_button_enabled_disabled:
1466
+ inline_help: This option is not available for your theme.
1439
1467
  help_entries:
1440
1468
  atmo:
1441
1469
  menu_item: Atmo Audio
@@ -1810,16 +1838,7 @@ en:
1810
1838
  pageflow/entry:
1811
1839
  author: The author's name.
1812
1840
  credits: Will be shown in the info box.
1813
- emphasize_chapter_beginning: This option emphasizes the title of the first page of a chapter.
1814
- emphasize_new_pages: At the beginning of a Pageflow an info-box shows news pages that were created since the last visit.
1815
- home_button_enabled: Pageflow can display a button in the navigation, which hyperlinks to an external website, for example back to the website from which you hyperlinked to the Pageflow.
1816
- home_button_enabled_disabled: This option is not available for your theme.
1817
- home_url: URL of your home page. Leave empty to use your accounts default setting.
1818
- home_url_disabled: This option is not available for your theme.
1819
1841
  keywords: Keywords as a suggestion for search engines.
1820
- manual_start: Decide if tips or advice should be shown at the beginning of your Pageflow.
1821
- overview_button_enabled: The overview displays chapters and pages of the main storyline.
1822
- overview_button_enabled_disabled: This option is not available for your theme.
1823
1842
  publisher: The publisher's name or company name.
1824
1843
  share_providers: Social media platforms to be listed in the "Share"-dialog of the entry
1825
1844
  share_url: URL to share via social media buttons. Leave blank to use URL of published story.
@@ -1865,7 +1884,6 @@ en:
1865
1884
  link_type:
1866
1885
  page_link: Page
1867
1886
  url: URL
1868
- ok: DELETED
1869
1887
  open_in_new_tab: Open in new tab
1870
1888
  open_in_new_tab_help: Recommended. Otherwise the entry has to be reloaded when returning from the link. Please note that inside the editor preview links always open in a new tab.
1871
1889
  remove_link: Remove link