playbook_ui_docs 14.1.0.pre.alpha.PA1477timestampkit3601 → 14.1.0.pre.alpha.PBNTR449rtepreviewerrails3605

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4fffe3685bd39602858926aaabda9ad24f5aae62ae94e95c93e2ad64caa607e
4
- data.tar.gz: 256e0c7c0eb8d622c5e62457c1a0f687a0970d542edcb2e27c418f0852e341bd
3
+ metadata.gz: 3676b191a74b77086758143b0ccf8471796f8c026d532da14db2a30bebe83390
4
+ data.tar.gz: 720aa1cca6181a3d7f0dad51270f8a9d4fec6b89bd992ae0897d596c09fac65a
5
5
  SHA512:
6
- metadata.gz: c16cc5610ee2b7eca6e606c4121562c6b38a947f431e03b83ba4c54c10c330b5503fd1418ab63e6311d2647c20b52f37eaa61a937fa115ca86f300bcb16cc0b0
7
- data.tar.gz: 4ab33015f8e2d087f8ee6e2223c17a9a6658bcd4799e74ee7085943e4090357a75d483b02d55306705434c4ddaa5d0ce90eef9af5de594a639f29291d69bfa1d
6
+ metadata.gz: b9484a54906adc8e1554399110aebf64c380b4595ad8922b21e0d5ab92028954ca9004196ffbf7efef38029ee005c1396b579f07badb87611291dc2483af426f
7
+ data.tar.gz: 5e7291b02efbdad1c9b4daeee7e8b5ce592ae23e448fdc90e91ae8a31a6e8ca8f0156b0257989a9f979b7897599ab0fb4c7132ea6285327d8fb40029bd053e8f
@@ -1,7 +1,7 @@
1
1
 
2
2
  <%= pb_rails("rich_text_editor", props: { id: "content-preview-editor" }) %>
3
3
  <div id="card-obfuscation" style="display:none">
4
- <%= pb_rails("card", props: { margin_top: "md" }) do %>
4
+ <%= pb_rails("card", props: { margin_top: "md", max_width: "md", padding: "sm" }) do %>
5
5
  <div id="content-preview" class="trix-content">
6
6
  </div>
7
7
  <% end %>
@@ -11,15 +11,25 @@
11
11
  <% end %>
12
12
 
13
13
  <script>
14
- // Button event handler
15
- const button = document.getElementById('preview-button');
16
- button.addEventListener('click', function() {
17
- const content = document.getElementById('content-preview-editor');
18
- const previewArea = document.getElementById('content-preview');
19
- const cardDiv = document.getElementById('card-obfuscation');
14
+ document.addEventListener('DOMContentLoaded', () => {
15
+ function handleButtonClick() {
16
+ const editorContainer = [...document.querySelectorAll('[data-react-props]')]
17
+ .find(element => element.getAttribute('data-react-props')?.includes('"id":"content-preview-editor"'))
20
18
 
21
- previewArea.innerHTML = content.value;
22
- cardDiv.classList.add('mt_md');
23
- cardDiv.style.display = 'block';
24
- });
19
+ const editorElement = editorContainer?.querySelector('trix-editor')
20
+ const inputId = editorElement?.getAttribute('input')
21
+ const inputElement = inputId && document.getElementById(inputId)
22
+
23
+ const editorContent = inputElement?.value || ''
24
+ const previewArea = document.getElementById('content-preview')
25
+ const cardDiv = document.getElementById('card-obfuscation')
26
+
27
+ if (previewArea && cardDiv) {
28
+ previewArea.innerHTML = editorContent
29
+ cardDiv.style.display = 'block'
30
+ }
31
+ }
32
+
33
+ document.getElementById('preview-button')?.addEventListener('click', handleButtonClick)
34
+ })
25
35
  </script>
@@ -8,7 +8,7 @@
8
8
  <br>
9
9
 
10
10
  <%= pb_rails("timestamp", props: {
11
- timestamp: DateTime.now - 3.months,
11
+ timestamp: DateTime.now,
12
12
  variant: "elapsed",
13
13
  show_user: false
14
14
  }) %>
@@ -16,7 +16,7 @@
16
16
  <br>
17
17
 
18
18
  <%= pb_rails("timestamp", props: {
19
- timestamp: DateTime.now - 320.days,
19
+ timestamp: DateTime.now,
20
20
  variant: "elapsed",
21
21
  show_user: false,
22
22
  hide_updated: true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.1.0.pre.alpha.PA1477timestampkit3601
4
+ version: 14.1.0.pre.alpha.PBNTR449rtepreviewerrails3605
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX