@blazetrails/actiontext 0.0.0-stage → 0.1.0-alpha0.1

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 (149) hide show
  1. package/LICENSE +21 -0
  2. package/app/views/action-text/attachables/_content_attachment.html.tse +3 -0
  3. package/app/views/action-text/attachables/_missing_attachable.html.tse +1 -0
  4. package/app/views/action-text/attachables/_remote_image.html.tse +8 -0
  5. package/app/views/action-text/attachment-galleries/_attachment_gallery.html.tse +3 -0
  6. package/app/views/action-text/contents/_content.html.tse +1 -0
  7. package/app/views/active-storage/blobs/_blob.html.tse +14 -0
  8. package/app/views/layouts/action-text/contents/_content.html.tse +3 -0
  9. package/dist/.trails/views/action-text/attachables/_content_attachment.html.tse.js +35 -0
  10. package/dist/.trails/views/action-text/attachables/_content_attachment.html.tse.js.map +1 -0
  11. package/dist/.trails/views/action-text/attachables/_missing_attachable.html.tse.js +16 -0
  12. package/dist/.trails/views/action-text/attachables/_missing_attachable.html.tse.js.map +1 -0
  13. package/dist/.trails/views/action-text/attachables/_remote_image.html.tse.js +42 -0
  14. package/dist/.trails/views/action-text/attachables/_remote_image.html.tse.js.map +1 -0
  15. package/dist/.trails/views/action-text/attachment-galleries/_attachment_gallery.html.tse.js +37 -0
  16. package/dist/.trails/views/action-text/attachment-galleries/_attachment_gallery.html.tse.js.map +1 -0
  17. package/dist/.trails/views/action-text/contents/_content.html.tse.js +34 -0
  18. package/dist/.trails/views/action-text/contents/_content.html.tse.js.map +1 -0
  19. package/dist/.trails/views/active-storage/blobs/_blob.html.tse.js +57 -0
  20. package/dist/.trails/views/active-storage/blobs/_blob.html.tse.js.map +1 -0
  21. package/dist/.trails/views/layouts/action-text/contents/_content.html.tse.js +18 -0
  22. package/dist/.trails/views/layouts/action-text/contents/_content.html.tse.js.map +1 -0
  23. package/dist/action-text.js +73 -0
  24. package/dist/action-text.js.map +1 -0
  25. package/dist/app/helpers/action-text/content-helper.js +84 -0
  26. package/dist/app/helpers/action-text/content-helper.js.map +1 -0
  27. package/dist/app/helpers/action-text/tag-helper.js +115 -0
  28. package/dist/app/helpers/action-text/tag-helper.js.map +1 -0
  29. package/dist/app/views/action-text/attachables/_content_attachment.html.tse +3 -0
  30. package/dist/app/views/action-text/attachables/_missing_attachable.html.tse +1 -0
  31. package/dist/app/views/action-text/attachables/_remote_image.html.tse +8 -0
  32. package/dist/app/views/action-text/attachment-galleries/_attachment_gallery.html.tse +3 -0
  33. package/dist/app/views/action-text/contents/_content.html.tse +1 -0
  34. package/dist/app/views/active-storage/blobs/_blob.html.tse +14 -0
  35. package/dist/app/views/layouts/action-text/contents/_content.html.tse +3 -0
  36. package/dist/attachable.js +118 -0
  37. package/dist/attachable.js.map +1 -0
  38. package/dist/attachables/content-attachment.js +47 -0
  39. package/dist/attachables/content-attachment.js.map +1 -0
  40. package/dist/attachables/missing-attachable.js +30 -0
  41. package/dist/attachables/missing-attachable.js.map +1 -0
  42. package/dist/attachables/remote-image.js +46 -0
  43. package/dist/attachables/remote-image.js.map +1 -0
  44. package/dist/attachment-gallery.js +60 -0
  45. package/dist/attachment-gallery.js.map +1 -0
  46. package/dist/attachment.js +122 -0
  47. package/dist/attachment.js.map +1 -0
  48. package/dist/attachments/caching.js +17 -0
  49. package/dist/attachments/caching.js.map +1 -0
  50. package/dist/attachments/minification.js +15 -0
  51. package/dist/attachments/minification.js.map +1 -0
  52. package/dist/attachments/trix-conversion.js +37 -0
  53. package/dist/attachments/trix-conversion.js.map +1 -0
  54. package/dist/attribute.js +83 -0
  55. package/dist/attribute.js.map +1 -0
  56. package/dist/constants.encrypted-rich-text.generated.js +4 -0
  57. package/dist/constants.encrypted-rich-text.generated.js.map +1 -0
  58. package/dist/constants.generated.js +49 -0
  59. package/dist/constants.generated.js.map +1 -0
  60. package/dist/constants.rich-text.generated.js +4 -0
  61. package/dist/constants.rich-text.generated.js.map +1 -0
  62. package/dist/content.js +162 -0
  63. package/dist/content.js.map +1 -0
  64. package/dist/db/migrate/20180528164100_create_action_text_tables.js +31 -0
  65. package/dist/db/migrate/20180528164100_create_action_text_tables.js.map +1 -0
  66. package/dist/deprecator.js +8 -0
  67. package/dist/deprecator.js.map +1 -0
  68. package/dist/encrypted-rich-text.js +12 -0
  69. package/dist/encrypted-rich-text.js.map +1 -0
  70. package/dist/encryption.js +56 -0
  71. package/dist/encryption.js.map +1 -0
  72. package/dist/engine.js +124 -0
  73. package/dist/engine.js.map +1 -0
  74. package/dist/fixture-set.js +14 -0
  75. package/dist/fixture-set.js.map +1 -0
  76. package/dist/fragment.js +59 -0
  77. package/dist/fragment.js.map +1 -0
  78. package/dist/gem-version.js +18 -0
  79. package/dist/gem-version.js.map +1 -0
  80. package/dist/generators/action-text/install/install-generator.js +91 -0
  81. package/dist/generators/action-text/install/install-generator.js.map +1 -0
  82. package/dist/generators/action-text/install/templates/actiontext.css.tt +440 -0
  83. package/dist/generators/action-text/install/templates/actiontext.css.tt.js +12 -0
  84. package/dist/html-conversion.js +21 -0
  85. package/dist/html-conversion.js.map +1 -0
  86. package/dist/index.js +22 -0
  87. package/dist/index.js.map +1 -0
  88. package/dist/plain-text-conversion.js +126 -0
  89. package/dist/plain-text-conversion.js.map +1 -0
  90. package/dist/record.js +11 -0
  91. package/dist/record.js.map +1 -0
  92. package/dist/rendering.js +35 -0
  93. package/dist/rendering.js.map +1 -0
  94. package/dist/rich-text.js +70 -0
  95. package/dist/rich-text.js.map +1 -0
  96. package/dist/serialization.js +30 -0
  97. package/dist/serialization.js.map +1 -0
  98. package/dist/system-test-helper.js +38 -0
  99. package/dist/system-test-helper.js.map +1 -0
  100. package/dist/tasks/actiontext.rake.js +8 -0
  101. package/dist/tasks/actiontext.rake.js.map +1 -0
  102. package/dist/trails/generators/test-unit/install/install-generator.js +16 -0
  103. package/dist/trails/generators/test-unit/install/install-generator.js.map +1 -0
  104. package/dist/trails/generators/test-unit/install/templates/fixtures.yml.tt +4 -0
  105. package/dist/trails/generators/test-unit/install/templates/fixtures.yml.tt.js +12 -0
  106. package/dist/trix-attachment.js +105 -0
  107. package/dist/trix-attachment.js.map +1 -0
  108. package/dist/types/action-text.d.ts +75 -0
  109. package/dist/types/app/helpers/action-text/content-helper.d.ts +35 -0
  110. package/dist/types/app/helpers/action-text/tag-helper.d.ts +48 -0
  111. package/dist/types/attachable.d.ts +41 -0
  112. package/dist/types/attachables/content-attachment.d.ts +24 -0
  113. package/dist/types/attachables/missing-attachable.d.ts +9 -0
  114. package/dist/types/attachables/remote-image.d.ts +23 -0
  115. package/dist/types/attachment-gallery.d.ts +20 -0
  116. package/dist/types/attachment.d.ts +51 -0
  117. package/dist/types/attachments/caching.d.ts +15 -0
  118. package/dist/types/attachments/minification.d.ts +5 -0
  119. package/dist/types/attachments/trix-conversion.d.ts +17 -0
  120. package/dist/types/attribute.d.ts +27 -0
  121. package/dist/types/constants.encrypted-rich-text.generated.d.ts +2 -0
  122. package/dist/types/constants.generated.d.ts +2 -0
  123. package/dist/types/constants.rich-text.generated.d.ts +2 -0
  124. package/dist/types/content.d.ts +73 -0
  125. package/dist/types/db/migrate/20180528164100_create_action_text_tables.d.ts +9 -0
  126. package/dist/types/deprecator.d.ts +3 -0
  127. package/dist/types/encrypted-rich-text.d.ts +5 -0
  128. package/dist/types/encryption.d.ts +30 -0
  129. package/dist/types/engine.d.ts +27 -0
  130. package/dist/types/fixture-set.d.ts +6 -0
  131. package/dist/types/fragment.d.ts +19 -0
  132. package/dist/types/gem-version.d.ts +10 -0
  133. package/dist/types/generators/action-text/install/install-generator.d.ts +24 -0
  134. package/dist/types/html-conversion.d.ts +9 -0
  135. package/dist/types/index.d.ts +22 -0
  136. package/dist/types/plain-text-conversion.d.ts +41 -0
  137. package/dist/types/record.d.ts +4 -0
  138. package/dist/types/rendering.d.ts +15 -0
  139. package/dist/types/rich-text.d.ts +24 -0
  140. package/dist/types/serialization.d.ts +25 -0
  141. package/dist/types/system-test-helper.d.ts +18 -0
  142. package/dist/types/tasks/actiontext.rake.d.ts +2 -0
  143. package/dist/types/trails/generators/test-unit/install/install-generator.d.ts +5 -0
  144. package/dist/types/trix-attachment.d.ts +33 -0
  145. package/dist/types/version.d.ts +3 -0
  146. package/dist/version.js +7 -0
  147. package/dist/version.js.map +1 -0
  148. package/package.json +71 -3
  149. package/README.md +0 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Dean Marano and Trails contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ <figure class="attachment attachment--content">
2
+ <%= await content_attachment.attachable.toString() %>
3
+ </figure>
@@ -0,0 +1,8 @@
1
+ <figure class="attachment attachment--preview">
2
+ <%= imageTag(remote_image.url, { width: remote_image.width, height: remote_image.height }) %>
3
+ <% const caption = remote_image.caption; if (caption != null) { %>
4
+ <figcaption class="attachment__caption">
5
+ <%= caption %>
6
+ </figcaption>
7
+ <% } %>
8
+ </figure>
@@ -0,0 +1,3 @@
1
+ <div class="attachment-gallery attachment-gallery--<%= await attachment_gallery.size() %>">
2
+ <%= yield() %>
3
+ </div>
@@ -0,0 +1 @@
1
+ <%= await renderActionTextContent(content) %>
@@ -0,0 +1,14 @@
1
+ <figure class="attachment attachment--<%= blob.isRepresentable() ? "preview" : "file" %> attachment--<%= blob.filename.extension() %>">
2
+ <% if (blob.isRepresentable()) { %>
3
+ <%= imageTag(blob.representation({ resizeToLimit: localAssigns.inGallery ? [ 800, 600 ] : [ 1024, 768 ] })) %>
4
+ <% } %>
5
+
6
+ <figcaption class="attachment__caption">
7
+ <% const caption = blob.caption; if (caption != null) { %>
8
+ <%= caption %>
9
+ <% } else { %>
10
+ <span class="attachment__name"><%= blob.filename %></span>
11
+ <span class="attachment__size"><%= numberToHumanSize(blob.byte_size) %></span>
12
+ <% } %>
13
+ </figcaption>
14
+ </figure>
@@ -0,0 +1,3 @@
1
+ <div class="trix-content">
2
+ <%= yield() -%>
3
+ </div>
@@ -0,0 +1,35 @@
1
+ import { hashAref as __hashAref, keys as __keys } from "@blazetrails/ruby-compat";
2
+ import { TopLevel } from "@blazetrails/actionview";
3
+ export default async function render(context, locals, __block) {
4
+ void context;
5
+ void locals;
6
+ const localAssigns = locals;
7
+ void localAssigns;
8
+ const __view = context;
9
+ context = Object.create(__view, { yield: { value: (...name) => (name.length > 0 ? __block(...name) : __block !== undefined ? __block() : Reflect.get(__view, "yield")) } });
10
+ const _ob = context.outputBuffer;
11
+ const __own = Object.create(null);
12
+ const __lookup = (name, guarded = false) => { for (const scope of [...[locals, this, TopLevel], __own, globalThis])
13
+ if (scope === localAssigns ? __keys(localAssigns).includes(name) : name in scope) {
14
+ const value = scope === localAssigns ? __hashAref(localAssigns, name) : Reflect.get(scope, name);
15
+ return scope === this && typeof value === "function" ? value.bind(this) : value;
16
+ } if (guarded)
17
+ return undefined; const error = new ReferenceError(name + " is not defined"); Error.captureStackTrace?.(error, __lookup); throw error; };
18
+ const __assign = (name, value) => { for (const scope of [locals, this, TopLevel])
19
+ if (name in scope) {
20
+ Reflect.set(scope, name, value);
21
+ return value;
22
+ } __own[name] = value; return value; };
23
+ void __assign;
24
+ const __sink = new Proxy({}, { set: (_target, name, value) => (__assign(name, value), true) });
25
+ void __sink;
26
+ if (__view.annotateRenderedViewWithFilenames)
27
+ _ob.safeAppend("<!-- BEGIN /home/dean/github/blazetrailsdev/worktrees/manual-publish/packages/actiontext/dist/app/views/action-text/attachables/_content_attachment.html.tse -->");
28
+ _ob.safeAppend("<figure class=\"attachment attachment--content\">\n ");
29
+ _ob.append(await (await __lookup("content_attachment").attachable.toString()));
30
+ _ob.safeAppend("\n</figure>\n");
31
+ if (__view.annotateRenderedViewWithFilenames)
32
+ _ob.safeAppend("<!-- END /home/dean/github/blazetrailsdev/worktrees/manual-publish/packages/actiontext/dist/app/views/action-text/attachables/_content_attachment.html.tse -->");
33
+ return _ob;
34
+ }
35
+ //# sourceMappingURL=_content_attachment.html.tse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_content_attachment.html.tse.js","sourceRoot":"","sources":["../../../../app/views/action-text/attachables/_content_attachment.html.tse"],"sourcesContent":["<figure class=\"attachment attachment--content\">\n <%= await content_attachment.attachable.toString() %>\n</figure>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;IAAE,GAAG,CAAC,UAAU,CAAC,uDAAuD,CAAC,CAAC;IACpE,GAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAM,8BAAkB,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAArD,GAAG,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ export default async function render(context, locals, __block) {
2
+ void context;
3
+ void locals;
4
+ const localAssigns = locals;
5
+ void localAssigns;
6
+ const __view = context;
7
+ context = Object.create(__view, { yield: { value: (...name) => (name.length > 0 ? __block(...name) : __block !== undefined ? __block() : Reflect.get(__view, "yield")) } });
8
+ const _ob = context.outputBuffer;
9
+ if (__view.annotateRenderedViewWithFilenames)
10
+ _ob.safeAppend("<!-- BEGIN /home/dean/github/blazetrailsdev/worktrees/manual-publish/packages/actiontext/dist/app/views/action-text/attachables/_missing_attachable.html.tse -->");
11
+ _ob.append(await ("☒"));
12
+ if (__view.annotateRenderedViewWithFilenames)
13
+ _ob.safeAppend("<!-- END /home/dean/github/blazetrailsdev/worktrees/manual-publish/packages/actiontext/dist/app/views/action-text/attachables/_missing_attachable.html.tse -->");
14
+ return _ob;
15
+ }
16
+ //# sourceMappingURL=_missing_attachable.html.tse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_missing_attachable.html.tse.js","sourceRoot":"","sources":["../../../../app/views/action-text/attachables/_missing_attachable.html.tse"],"sourcesContent":["<%= \"☒\" -%>\n"],"mappings":";;;;;;;;;;IAAI,GAAA,CAAA,MAAA,CAAA,MAAA,CAAA,GAAG,CAAC,CAAC,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { hashAref as __hashAref, keys as __keys } from "@blazetrails/ruby-compat";
2
+ import { TopLevel } from "@blazetrails/actionview";
3
+ export default async function render(context, locals, __block) {
4
+ void context;
5
+ void locals;
6
+ const localAssigns = locals;
7
+ void localAssigns;
8
+ const __view = context;
9
+ context = Object.create(__view, { yield: { value: (...name) => (name.length > 0 ? __block(...name) : __block !== undefined ? __block() : Reflect.get(__view, "yield")) } });
10
+ const _ob = context.outputBuffer;
11
+ const __own = Object.create(null);
12
+ const __lookup = (name, guarded = false) => { for (const scope of [...[locals, this, TopLevel], __own, globalThis])
13
+ if (scope === localAssigns ? __keys(localAssigns).includes(name) : name in scope) {
14
+ const value = scope === localAssigns ? __hashAref(localAssigns, name) : Reflect.get(scope, name);
15
+ return scope === this && typeof value === "function" ? value.bind(this) : value;
16
+ } if (guarded)
17
+ return undefined; const error = new ReferenceError(name + " is not defined"); Error.captureStackTrace?.(error, __lookup); throw error; };
18
+ const __assign = (name, value) => { for (const scope of [locals, this, TopLevel])
19
+ if (name in scope) {
20
+ Reflect.set(scope, name, value);
21
+ return value;
22
+ } __own[name] = value; return value; };
23
+ void __assign;
24
+ const __sink = new Proxy({}, { set: (_target, name, value) => (__assign(name, value), true) });
25
+ void __sink;
26
+ if (__view.annotateRenderedViewWithFilenames)
27
+ _ob.safeAppend("<!-- BEGIN /home/dean/github/blazetrailsdev/worktrees/manual-publish/packages/actiontext/dist/app/views/action-text/attachables/_remote_image.html.tse -->");
28
+ _ob.safeAppend("<figure class=\"attachment attachment--preview\">\n ");
29
+ _ob.append(await (__lookup("imageTag")(__lookup("remote_image").url, { width: __lookup("remote_image").width, height: __lookup("remote_image").height })));
30
+ _ob.safeAppend("\n");
31
+ const caption = __lookup("remote_image").caption;
32
+ if (caption != null) {
33
+ _ob.safeAppend(" <figcaption class=\"attachment__caption\">\n ");
34
+ _ob.append(await (caption));
35
+ _ob.safeAppend("\n </figcaption>\n");
36
+ }
37
+ _ob.safeAppend("</figure>\n");
38
+ if (__view.annotateRenderedViewWithFilenames)
39
+ _ob.safeAppend("<!-- END /home/dean/github/blazetrailsdev/worktrees/manual-publish/packages/actiontext/dist/app/views/action-text/attachables/_remote_image.html.tse -->");
40
+ return _ob;
41
+ }
42
+ //# sourceMappingURL=_remote_image.html.tse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_remote_image.html.tse.js","sourceRoot":"","sources":["../../../../app/views/action-text/attachables/_remote_image.html.tse"],"sourcesContent":["<figure class=\"attachment attachment--preview\">\n <%= imageTag(remote_image.url, { width: remote_image.width, height: remote_image.height }) %>\n <% const caption = remote_image.caption; if (caption != null) { %>\n <figcaption class=\"attachment__caption\">\n <%= caption %>\n </figcaption>\n <% } %>\n</figure>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;IAAE,GAAG,CAAC,UAAU,CAAC,uDAAuD,CAAC,CAAC;IACpE,GAAA,CAAA,MAAA,CAAA,MAAA,CAAA,oBAAQ,CAAC,wBAAY,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,wBAAY,CAAC,KAAK,EAAE,MAAM,EAAE,wBAAY,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;IAA7F,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAClB,MAAM,OAAO,GAAG,wBAAY,CAAC,OAAO,CAAC;IAAC,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QAC/D,GAAG,CAAC,UAAU,CAAC,wDAAwD,CAAC,CAAC;QACjE,GAAA,CAAA,MAAA,CAAA,MAAA,CAAA,OAAO,CAAC,CAAC,CAAC;QAAlB,GAAG,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;IAErC,CAAC;IACJ,GAAG,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { hashAref as __hashAref, keys as __keys } from "@blazetrails/ruby-compat";
2
+ import { TopLevel } from "@blazetrails/actionview";
3
+ export default async function render(context, locals, __block) {
4
+ void context;
5
+ void locals;
6
+ const localAssigns = locals;
7
+ void localAssigns;
8
+ const __view = context;
9
+ context = Object.create(__view, { yield: { value: (...name) => (name.length > 0 ? __block(...name) : __block !== undefined ? __block() : Reflect.get(__view, "yield")) } });
10
+ const _ob = context.outputBuffer;
11
+ const __own = Object.create(null);
12
+ const __lookup = (name, guarded = false) => { for (const scope of [...[locals, this, TopLevel], __own, globalThis])
13
+ if (scope === localAssigns ? __keys(localAssigns).includes(name) : name in scope) {
14
+ const value = scope === localAssigns ? __hashAref(localAssigns, name) : Reflect.get(scope, name);
15
+ return scope === this && typeof value === "function" ? value.bind(this) : value;
16
+ } if (guarded)
17
+ return undefined; const error = new ReferenceError(name + " is not defined"); Error.captureStackTrace?.(error, __lookup); throw error; };
18
+ const __assign = (name, value) => { for (const scope of [locals, this, TopLevel])
19
+ if (name in scope) {
20
+ Reflect.set(scope, name, value);
21
+ return value;
22
+ } __own[name] = value; return value; };
23
+ void __assign;
24
+ const __sink = new Proxy({}, { set: (_target, name, value) => (__assign(name, value), true) });
25
+ void __sink;
26
+ if (__view.annotateRenderedViewWithFilenames)
27
+ _ob.safeAppend("<!-- BEGIN /home/dean/github/blazetrailsdev/worktrees/manual-publish/packages/actiontext/dist/app/views/action-text/attachment-galleries/_attachment_gallery.html.tse -->");
28
+ _ob.safeAppend("<div class=\"attachment-gallery attachment-gallery--");
29
+ _ob.append(await (await __lookup("attachment_gallery").size()));
30
+ _ob.safeAppend("\">\n ");
31
+ _ob.append(await (context.yield()));
32
+ _ob.safeAppend("\n</div>\n");
33
+ if (__view.annotateRenderedViewWithFilenames)
34
+ _ob.safeAppend("<!-- END /home/dean/github/blazetrailsdev/worktrees/manual-publish/packages/actiontext/dist/app/views/action-text/attachment-galleries/_attachment_gallery.html.tse -->");
35
+ return _ob;
36
+ }
37
+ //# sourceMappingURL=_attachment_gallery.html.tse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_attachment_gallery.html.tse.js","sourceRoot":"","sources":["../../../../app/views/action-text/attachment-galleries/_attachment_gallery.html.tse"],"sourcesContent":["<div class=\"attachment-gallery attachment-gallery--<%= await attachment_gallery.size() %>\">\n <%= yield() %>\n</div>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;IAAE,GAAG,CAAC,UAAU,CAAC,sDAAsD,CAAC,CAAC;IAAlB,GAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAM,8BAAkB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAAvF,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACtB,GAAA,CAAA,MAAA,CAAA,MAAA,CAAA,OAAO,CAAC,KAAD,EAAE,CAAC,CAAC,CAAC;IAAhB,GAAG,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { hashAref as __hashAref, keys as __keys } from "@blazetrails/ruby-compat";
2
+ import { TopLevel } from "@blazetrails/actionview";
3
+ export default async function render(context, locals, __block) {
4
+ void context;
5
+ void locals;
6
+ const localAssigns = locals;
7
+ void localAssigns;
8
+ const __view = context;
9
+ context = Object.create(__view, { yield: { value: (...name) => (name.length > 0 ? __block(...name) : __block !== undefined ? __block() : Reflect.get(__view, "yield")) } });
10
+ const _ob = context.outputBuffer;
11
+ const __own = Object.create(null);
12
+ const __lookup = (name, guarded = false) => { for (const scope of [...[locals, this, TopLevel], __own, globalThis])
13
+ if (scope === localAssigns ? __keys(localAssigns).includes(name) : name in scope) {
14
+ const value = scope === localAssigns ? __hashAref(localAssigns, name) : Reflect.get(scope, name);
15
+ return scope === this && typeof value === "function" ? value.bind(this) : value;
16
+ } if (guarded)
17
+ return undefined; const error = new ReferenceError(name + " is not defined"); Error.captureStackTrace?.(error, __lookup); throw error; };
18
+ const __assign = (name, value) => { for (const scope of [locals, this, TopLevel])
19
+ if (name in scope) {
20
+ Reflect.set(scope, name, value);
21
+ return value;
22
+ } __own[name] = value; return value; };
23
+ void __assign;
24
+ const __sink = new Proxy({}, { set: (_target, name, value) => (__assign(name, value), true) });
25
+ void __sink;
26
+ if (__view.annotateRenderedViewWithFilenames)
27
+ _ob.safeAppend("<!-- BEGIN /home/dean/github/blazetrailsdev/worktrees/manual-publish/packages/actiontext/dist/app/views/action-text/contents/_content.html.tse -->");
28
+ _ob.append(await (await __lookup("renderActionTextContent")(__lookup("content"))));
29
+ _ob.safeAppend("\n");
30
+ if (__view.annotateRenderedViewWithFilenames)
31
+ _ob.safeAppend("<!-- END /home/dean/github/blazetrailsdev/worktrees/manual-publish/packages/actiontext/dist/app/views/action-text/contents/_content.html.tse -->");
32
+ return _ob;
33
+ }
34
+ //# sourceMappingURL=_content.html.tse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_content.html.tse.js","sourceRoot":"","sources":["../../../../app/views/action-text/contents/_content.html.tse"],"sourcesContent":["<%= await renderActionTextContent(content) %>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;IAAI,GAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAM,mCAAuB,CAAC,mBAAO,CAAC,CAAC,CAAC,CAAC;IAA3C,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { hashAref as __hashAref, keys as __keys } from "@blazetrails/ruby-compat";
2
+ import { TopLevel } from "@blazetrails/actionview";
3
+ export default async function render(context, locals, __block) {
4
+ void context;
5
+ void locals;
6
+ const localAssigns = locals;
7
+ void localAssigns;
8
+ const __view = context;
9
+ context = Object.create(__view, { yield: { value: (...name) => (name.length > 0 ? __block(...name) : __block !== undefined ? __block() : Reflect.get(__view, "yield")) } });
10
+ const _ob = context.outputBuffer;
11
+ const __own = Object.create(null);
12
+ const __lookup = (name, guarded = false) => { for (const scope of [...[locals, this, TopLevel], __own, globalThis])
13
+ if (scope === localAssigns ? __keys(localAssigns).includes(name) : name in scope) {
14
+ const value = scope === localAssigns ? __hashAref(localAssigns, name) : Reflect.get(scope, name);
15
+ return scope === this && typeof value === "function" ? value.bind(this) : value;
16
+ } if (guarded)
17
+ return undefined; const error = new ReferenceError(name + " is not defined"); Error.captureStackTrace?.(error, __lookup); throw error; };
18
+ const __assign = (name, value) => { for (const scope of [locals, this, TopLevel])
19
+ if (name in scope) {
20
+ Reflect.set(scope, name, value);
21
+ return value;
22
+ } __own[name] = value; return value; };
23
+ void __assign;
24
+ const __sink = new Proxy({}, { set: (_target, name, value) => (__assign(name, value), true) });
25
+ void __sink;
26
+ if (__view.annotateRenderedViewWithFilenames)
27
+ _ob.safeAppend("<!-- BEGIN /home/dean/github/blazetrailsdev/worktrees/manual-publish/packages/actiontext/dist/app/views/active-storage/blobs/_blob.html.tse -->");
28
+ _ob.safeAppend("<figure class=\"attachment attachment--");
29
+ _ob.append(await (__lookup("blob").isRepresentable() ? "preview" : "file"));
30
+ _ob.safeAppend(" attachment--");
31
+ _ob.append(await (__lookup("blob").filename.extension()));
32
+ _ob.safeAppend("\">\n");
33
+ if (__lookup("blob").isRepresentable()) {
34
+ _ob.safeAppend(" ");
35
+ _ob.append(await (__lookup("imageTag")(__lookup("blob").representation({ resizeToLimit: localAssigns.inGallery ? [800, 600] : [1024, 768] }))));
36
+ _ob.safeAppend("\n");
37
+ }
38
+ _ob.safeAppend("\n <figcaption class=\"attachment__caption\">\n");
39
+ const caption = __lookup("blob").caption;
40
+ if (caption != null) {
41
+ _ob.safeAppend(" ");
42
+ _ob.append(await (caption));
43
+ _ob.safeAppend("\n");
44
+ }
45
+ else {
46
+ _ob.safeAppend(" <span class=\"attachment__name\">");
47
+ _ob.append(await (__lookup("blob").filename));
48
+ _ob.safeAppend("</span>\n <span class=\"attachment__size\">");
49
+ _ob.append(await (__lookup("numberToHumanSize")(__lookup("blob").byte_size)));
50
+ _ob.safeAppend("</span>\n");
51
+ }
52
+ _ob.safeAppend(" </figcaption>\n</figure>\n");
53
+ if (__view.annotateRenderedViewWithFilenames)
54
+ _ob.safeAppend("<!-- END /home/dean/github/blazetrailsdev/worktrees/manual-publish/packages/actiontext/dist/app/views/active-storage/blobs/_blob.html.tse -->");
55
+ return _ob;
56
+ }
57
+ //# sourceMappingURL=_blob.html.tse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_blob.html.tse.js","sourceRoot":"","sources":["../../../../app/views/active-storage/blobs/_blob.html.tse"],"sourcesContent":["<figure class=\"attachment attachment--<%= blob.isRepresentable() ? \"preview\" : \"file\" %> attachment--<%= blob.filename.extension() %>\">\n <% if (blob.isRepresentable()) { %>\n <%= imageTag(blob.representation({ resizeToLimit: localAssigns.inGallery ? [ 800, 600 ] : [ 1024, 768 ] })) %>\n <% } %>\n\n <figcaption class=\"attachment__caption\">\n <% const caption = blob.caption; if (caption != null) { %>\n <%= caption %>\n <% } else { %>\n <span class=\"attachment__name\"><%= blob.filename %></span>\n <span class=\"attachment__size\"><%= numberToHumanSize(blob.byte_size) %></span>\n <% } %>\n </figcaption>\n</figure>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;IAAE,GAAG,CAAC,UAAU,CA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QAAvD,GAAG,CAAC,UAAU,CAAC,kDAAkD,CAAC,CAAC;QAC5B,GAAA,CAAA,MAAA,CAAA,MAAA,CAAA,6BAAiB,CAAC,gBAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAA3E,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IACvB,CAAC;IACN,GAAG,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ export default async function render(context, locals, __block) {
2
+ void context;
3
+ void locals;
4
+ const localAssigns = locals;
5
+ void localAssigns;
6
+ const __view = context;
7
+ context = Object.create(__view, { yield: { value: (...name) => (name.length > 0 ? __block(...name) : __block !== undefined ? __block() : Reflect.get(__view, "yield")) } });
8
+ const _ob = context.outputBuffer;
9
+ if (__view.annotateRenderedViewWithFilenames)
10
+ _ob.safeAppend("<!-- BEGIN /home/dean/github/blazetrailsdev/worktrees/manual-publish/packages/actiontext/dist/app/views/layouts/action-text/contents/_content.html.tse -->");
11
+ _ob.safeAppend("<div class=\"trix-content\">\n ");
12
+ _ob.append(await (context.yield()));
13
+ _ob.safeAppend("</div>\n");
14
+ if (__view.annotateRenderedViewWithFilenames)
15
+ _ob.safeAppend("<!-- END /home/dean/github/blazetrailsdev/worktrees/manual-publish/packages/actiontext/dist/app/views/layouts/action-text/contents/_content.html.tse -->");
16
+ return _ob;
17
+ }
18
+ //# sourceMappingURL=_content.html.tse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_content.html.tse.js","sourceRoot":"","sources":["../../../../../app/views/layouts/action-text/contents/_content.html.tse"],"sourcesContent":["<div class=\"trix-content\">\n <%= yield() -%>\n</div>\n"],"mappings":";;;;;;;;;;IAAE,GAAG,CAAC,UAAU,CAAC,kCAAkC,CAAC,CAAC;IAC/C,GAAA,CAAA,MAAA,CAAA,MAAA,CAAA,OAAO,CAAC,KAAD,EAAE,CAAC,CAAC,CAAC;IAChB,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC"}
@@ -0,0 +1,73 @@
1
+ import { Autoload, extend } from "@blazetrails/activesupport";
2
+ import { HTML5 } from "@blazetrails/nokogiri";
3
+ import { TopLevel, constSet } from "@blazetrails/ruby-compat";
4
+ const loadPath = {
5
+ "action_text/attachable": () => import("./attachable.js"),
6
+ "action_text/attachables/content_attachment": () => import("./attachables/content-attachment.js"),
7
+ "action_text/attachables/missing_attachable": () => import("./attachables/missing-attachable.js"),
8
+ "action_text/attachables/remote_image": () => import("./attachables/remote-image.js"),
9
+ "action_text/attachment": () => import("./attachment.js"),
10
+ "action_text/attachment_gallery": () => import("./attachment-gallery.js"),
11
+ "action_text/attribute": () => import("./attribute.js"),
12
+ "action_text/attachments/caching": () => import("./attachments/caching.js"),
13
+ "action_text/attachments/minification": () => import("./attachments/minification.js"),
14
+ "action_text/attachments/trix_conversion": () => import("./attachments/trix-conversion.js"),
15
+ "action_text/content": () => import("./content.js"),
16
+ "action_text/encryption": () => import("./encryption.js"),
17
+ "action_text/fixture_set": () => import("./fixture-set.js"),
18
+ "action_text/fragment": () => import("./fragment.js"),
19
+ "action_text/html_conversion": () => import("./html-conversion.js"),
20
+ "action_text/plain_text_conversion": () => import("./plain-text-conversion.js"),
21
+ "action_text/rendering": () => import("./rendering.js"),
22
+ "action_text/serialization": () => import("./serialization.js"),
23
+ "action_text/system_test_helper": () => import("@blazetrails/actiontext/system-test-helper"),
24
+ "action_text/trix_attachment": () => import("./trix-attachment.js"),
25
+ };
26
+ export const ActionText = {
27
+ name: "ActionText",
28
+ loadPath,
29
+ htmlDocumentClass() {
30
+ if (Object.hasOwn(this, "_htmlDocumentClass"))
31
+ return this._htmlDocumentClass;
32
+ return (this._htmlDocumentClass =
33
+ TopLevel.Nokogiri.HTML5 !== undefined
34
+ ? HTML5.Document
35
+ : TopLevel.Nokogiri.HTML4.Document);
36
+ },
37
+ htmlDocumentFragmentClass() {
38
+ if (Object.hasOwn(this, "_htmlDocumentFragmentClass"))
39
+ return this._htmlDocumentFragmentClass;
40
+ return (this._htmlDocumentFragmentClass =
41
+ TopLevel.Nokogiri.HTML5 !== undefined
42
+ ? HTML5.DocumentFragment
43
+ : TopLevel.Nokogiri.HTML4.DocumentFragment);
44
+ },
45
+ };
46
+ extend(ActionText, Autoload);
47
+ constSet(TopLevel, "ActionText", ActionText);
48
+ ActionText.autoload("Attachable");
49
+ ActionText.autoload("Attachment");
50
+ ActionText.autoload("AttachmentGallery");
51
+ ActionText.autoload("Attribute");
52
+ ActionText.autoload("Content");
53
+ ActionText.autoload("Encryption");
54
+ ActionText.autoload("FixtureSet");
55
+ ActionText.autoload("Fragment");
56
+ ActionText.autoload("HtmlConversion");
57
+ ActionText.autoload("PlainTextConversion");
58
+ ActionText.autoload("Rendering");
59
+ ActionText.autoload("Serialization");
60
+ ActionText.autoload("TrixAttachment");
61
+ const Attachments = { name: "ActionText::Attachments", loadPath };
62
+ extend(Attachments, Autoload);
63
+ ActionText.Attachments = Attachments;
64
+ Attachments.autoload("Caching");
65
+ Attachments.autoload("Minification");
66
+ Attachments.autoload("TrixConversion");
67
+ const Attachables = { name: "ActionText::Attachables", loadPath };
68
+ extend(Attachables, Autoload);
69
+ ActionText.Attachables = Attachables;
70
+ Attachables.autoload("ContentAttachment");
71
+ Attachables.autoload("MissingAttachable");
72
+ Attachables.autoload("RemoteImage");
73
+ //# sourceMappingURL=action-text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-text.js","sourceRoot":"","sources":["../lib/action-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAmC,MAAM,4BAA4B,CAAC;AAC/F,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AA8BxE,MAAM,QAAQ,GAA2C;IACvD,wBAAwB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC;IACzD,4CAA4C,EAAE,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AAQ,CAAC,UAAU,CAAC,CAAC;AAChC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AACtC,UAAU,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;AAC3C,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACjC,UAAU,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;AACrC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAEtC,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,yBAAyB,EAAE,QAAQ,EAI9D,CAAC;AACF,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAC9B,UAAU,CAAC,WAAW,GAAG,WAAW,CAAC;AAErC,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAChC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;AACrC,WAAW,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAEvC,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,yBAAyB,EAAE,QAAQ,EAI9D,CAAC;AACF,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAC9B,UAAU,CAAC,WAAW,GAAG,WAAW,CAAC;AAErC,WAAW,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;AAC1C,WAAW,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;AAC1C,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC"}
@@ -0,0 +1,84 @@
1
+ import { htmlSafe, mattrAccessor } from "@blazetrails/activesupport";
2
+ import { HTML4 } from "@blazetrails/html-sanitizer";
3
+ import { chomp, classModule, rbObjRespondTo } from "@blazetrails/ruby-compat";
4
+ import { ActionText } from "../../../action-text.js";
5
+ import { Attachment } from "../../../attachment.js";
6
+ export class ContentHelper {
7
+ /** @noRailsEquivalent PERMANENT */
8
+ static [classModule] = true;
9
+ static {
10
+ mattrAccessor.call(this, "sanitizer", { default: new HTML4.SafeListSanitizer() });
11
+ mattrAccessor.call(this, "allowedTags");
12
+ mattrAccessor.call(this, "allowedAttributes");
13
+ mattrAccessor.call(this, "scrubber");
14
+ }
15
+ async renderActionTextContent(content) {
16
+ this.prefixPartialPathWithControllerNamespace = false;
17
+ return this.sanitizeActionTextContent(await this.renderActionTextAttachments(content));
18
+ }
19
+ sanitizeContentAttachment(contentAttachment) {
20
+ return this.sanitizer.sanitize(contentAttachment, {
21
+ tags: this.sanitizerAllowedTags(),
22
+ attributes: this.sanitizerAllowedAttributes(),
23
+ scrubber: this.scrubber,
24
+ });
25
+ }
26
+ sanitizeActionTextContent(content) {
27
+ return htmlSafe(this.sanitizer.sanitize(content.toHtml(), {
28
+ tags: this.sanitizerAllowedTags(),
29
+ attributes: this.sanitizerAllowedAttributes(),
30
+ scrubber: this.scrubber,
31
+ }));
32
+ }
33
+ /** @missingRailsArgs join — PERMANENT */
34
+ async renderActionTextAttachments(content) {
35
+ return (await content.renderAttachments(undefined, async (attachment) => {
36
+ if (!(await content.galleryAttachments()).includes(attachment)) {
37
+ const node = attachment.node;
38
+ node.setInnerHtml(await this.renderActionTextAttachment(attachment, { locals: { inGallery: false } }));
39
+ return node;
40
+ }
41
+ return null;
42
+ })).renderAttachmentGalleries(async (attachmentGallery) => {
43
+ return chomp(String(await this.render({ layout: attachmentGallery, object: attachmentGallery }, undefined, async () => {
44
+ const html = [];
45
+ for (const attachment of await attachmentGallery.attachments()) {
46
+ attachment.node.setInnerHtml(await this.renderActionTextAttachment(attachment, {
47
+ locals: { inGallery: true },
48
+ }));
49
+ html.push(attachment.toHtml());
50
+ }
51
+ return htmlSafe(html.join(""));
52
+ })));
53
+ });
54
+ }
55
+ /** @internal */
56
+ async renderActionTextAttachment(attachment, { locals = {} } = {}) {
57
+ const options = { locals: locals, object: attachment, partial: attachment };
58
+ if (rbObjRespondTo(attachment, "toAttachablePartialPath")) {
59
+ options.partial = attachment.toAttachablePartialPath();
60
+ }
61
+ if (rbObjRespondTo(attachment, "modelName")) {
62
+ options.as = attachment.modelName.element;
63
+ }
64
+ return chomp(String(await this.render(options)));
65
+ }
66
+ sanitizerAllowedTags() {
67
+ return (this.allowedTags ??
68
+ new Set([
69
+ ...this.sanitizer.constructor.allowedTags,
70
+ Attachment.tagName,
71
+ "figure",
72
+ "figcaption",
73
+ ]));
74
+ }
75
+ sanitizerAllowedAttributes() {
76
+ return (this.allowedAttributes ??
77
+ new Set([
78
+ ...this.sanitizer.constructor.allowedAttributes,
79
+ ...Attachment.ATTRIBUTES,
80
+ ]));
81
+ }
82
+ }
83
+ ActionText.ContentHelper = ContentHelper;
84
+ //# sourceMappingURL=content-helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-helper.js","sourceRoot":"","sources":["../../../../lib/app/helpers/action-text/content-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAmB,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAE,KAAK,EAAwC,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAapD,MAAM,OAAO,aAAa;IACxB,mCAAmC;IACnC,MAAM,CAAU,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;IAOrC;QACE,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,KAAK,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;QAClF,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QACxC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;QAC9C,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACvC,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