poetry-core 0.0.2

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 (166) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +3 -0
  3. data/DESIGN.md +145 -0
  4. data/LICENSE.txt +21 -0
  5. data/README.md +30 -0
  6. data/THIRD_PARTY_NOTICES.md +507 -0
  7. data/app/components/poetry/core/box/component.rb +82 -0
  8. data/app/components/poetry/core/component.rb +390 -0
  9. data/app/components/poetry/core/concerns/agent_tools.rb +418 -0
  10. data/app/components/poetry/core/concerns/declared_attributes.rb +267 -0
  11. data/app/components/poetry/core/concerns/introspection.rb +533 -0
  12. data/app/components/poetry/core/concerns/options.rb +262 -0
  13. data/app/components/poetry/core/concerns/parts.rb +148 -0
  14. data/app/components/poetry/core/concerns/stimulus.rb +363 -0
  15. data/app/components/poetry/core/concerns/styles.rb +323 -0
  16. data/app/components/poetry/core/style.rb +150 -0
  17. data/app/components/poetry/core/wrapper/component.rb +90 -0
  18. data/app/javascript/poetry/core/accordion_controller.js +165 -0
  19. data/app/javascript/poetry/core/action_bar_controller.js +109 -0
  20. data/app/javascript/poetry/core/autocomplete_controller.js +220 -0
  21. data/app/javascript/poetry/core/calendar_controller.js +406 -0
  22. data/app/javascript/poetry/core/carousel_controller.js +167 -0
  23. data/app/javascript/poetry/core/checkbox_group_controller.js +97 -0
  24. data/app/javascript/poetry/core/checked_controller.js +208 -0
  25. data/app/javascript/poetry/core/clipboard_text_controller.js +111 -0
  26. data/app/javascript/poetry/core/combobox_controller.js +1095 -0
  27. data/app/javascript/poetry/core/command_controller.js +510 -0
  28. data/app/javascript/poetry/core/context_menu_controller.js +204 -0
  29. data/app/javascript/poetry/core/date_field_controller.js +584 -0
  30. data/app/javascript/poetry/core/date_picker_controller.js +111 -0
  31. data/app/javascript/poetry/core/deferred_controller.js +111 -0
  32. data/app/javascript/poetry/core/dialog_controller.js +206 -0
  33. data/app/javascript/poetry/core/dismissable_controller.js +182 -0
  34. data/app/javascript/poetry/core/drawer_controller.js +365 -0
  35. data/app/javascript/poetry/core/file_input_controller.js +191 -0
  36. data/app/javascript/poetry/core/focus_scope_controller.js +162 -0
  37. data/app/javascript/poetry/core/helpers/announce.js +228 -0
  38. data/app/javascript/poetry/core/helpers/breakpoint.js +28 -0
  39. data/app/javascript/poetry/core/helpers/collection.js +18 -0
  40. data/app/javascript/poetry/core/helpers/direction.js +15 -0
  41. data/app/javascript/poetry/core/helpers/escape.js +38 -0
  42. data/app/javascript/poetry/core/helpers/filter_rank.js +104 -0
  43. data/app/javascript/poetry/core/helpers/focus_guards.js +46 -0
  44. data/app/javascript/poetry/core/helpers/hotkey.js +43 -0
  45. data/app/javascript/poetry/core/helpers/id_integrity.js +65 -0
  46. data/app/javascript/poetry/core/helpers/incomplete_date.js +328 -0
  47. data/app/javascript/poetry/core/helpers/mask.js +283 -0
  48. data/app/javascript/poetry/core/helpers/portal.js +217 -0
  49. data/app/javascript/poetry/core/helpers/presence.js +210 -0
  50. data/app/javascript/poetry/core/helpers/registration_guard.js +76 -0
  51. data/app/javascript/poetry/core/helpers/scroll_lock.js +67 -0
  52. data/app/javascript/poetry/core/helpers/scroller_geometry.js +422 -0
  53. data/app/javascript/poetry/core/helpers/state.js +80 -0
  54. data/app/javascript/poetry/core/helpers/tabbable.js +56 -0
  55. data/app/javascript/poetry/core/helpers/turbo_cache.js +21 -0
  56. data/app/javascript/poetry/core/helpers/typeahead.js +85 -0
  57. data/app/javascript/poetry/core/hotkey_controller.js +55 -0
  58. data/app/javascript/poetry/core/hover_card_controller.js +431 -0
  59. data/app/javascript/poetry/core/index.js +218 -0
  60. data/app/javascript/poetry/core/mask_controller.js +500 -0
  61. data/app/javascript/poetry/core/menu_controller.js +1050 -0
  62. data/app/javascript/poetry/core/menubar_controller.js +329 -0
  63. data/app/javascript/poetry/core/message_scroller_controller.js +930 -0
  64. data/app/javascript/poetry/core/navigation_menu_controller.js +458 -0
  65. data/app/javascript/poetry/core/number_field_controller.js +404 -0
  66. data/app/javascript/poetry/core/optimistic_form_controller.js +56 -0
  67. data/app/javascript/poetry/core/otp_controller.js +219 -0
  68. data/app/javascript/poetry/core/popover_controller.js +300 -0
  69. data/app/javascript/poetry/core/popper_controller.js +439 -0
  70. data/app/javascript/poetry/core/pressed_controller.js +74 -0
  71. data/app/javascript/poetry/core/questionnaire_controller.js +468 -0
  72. data/app/javascript/poetry/core/radio_group_controller.js +197 -0
  73. data/app/javascript/poetry/core/resizable_controller.js +202 -0
  74. data/app/javascript/poetry/core/roving_focus_controller.js +215 -0
  75. data/app/javascript/poetry/core/scroll_spy_controller.js +84 -0
  76. data/app/javascript/poetry/core/search_field_controller.js +95 -0
  77. data/app/javascript/poetry/core/select_controller.js +924 -0
  78. data/app/javascript/poetry/core/sensitive_input_controller.js +195 -0
  79. data/app/javascript/poetry/core/sheet_controller.js +24 -0
  80. data/app/javascript/poetry/core/sidebar_controller.js +272 -0
  81. data/app/javascript/poetry/core/slider_controller.js +419 -0
  82. data/app/javascript/poetry/core/state_controller.js +82 -0
  83. data/app/javascript/poetry/core/table_selection_controller.js +153 -0
  84. data/app/javascript/poetry/core/tabs_controller.js +151 -0
  85. data/app/javascript/poetry/core/tag_group_controller.js +134 -0
  86. data/app/javascript/poetry/core/toast_controller.js +228 -0
  87. data/app/javascript/poetry/core/toast_trigger_controller.js +26 -0
  88. data/app/javascript/poetry/core/toaster_controller.js +197 -0
  89. data/app/javascript/poetry/core/toggle_group_controller.js +206 -0
  90. data/app/javascript/poetry/core/tooltip_controller.js +541 -0
  91. data/app/javascript/poetry/core/tree_controller.js +265 -0
  92. data/app/javascript/poetry/core/vendor/floating_ui_core.js +1043 -0
  93. data/app/javascript/poetry/core/vendor/floating_ui_dom.js +794 -0
  94. data/app/javascript/poetry/core/vendor/floating_ui_utils.js +141 -0
  95. data/app/javascript/poetry/core/vendor/floating_ui_utils_dom.js +170 -0
  96. data/app/views/poetry/core/preview.html.erb +13 -0
  97. data/config/component_registry.yml +20 -0
  98. data/config/controllers_manifest.json +1528 -0
  99. data/config/importmap.rb +11 -0
  100. data/config/state_vocabulary.json +31 -0
  101. data/lib/active_model/type/list.rb +33 -0
  102. data/lib/active_model/type/symbol.rb +36 -0
  103. data/lib/poetry/core/check/stable_identity.rb +104 -0
  104. data/lib/poetry/core/check.rb +1445 -0
  105. data/lib/poetry/core/config.rb +286 -0
  106. data/lib/poetry/core/contrib/wrapped_helper.rb +68 -0
  107. data/lib/poetry/core/css/bem_merger.rb +45 -0
  108. data/lib/poetry/core/css/bem_reference.rb +87 -0
  109. data/lib/poetry/core/css/override_scan.rb +110 -0
  110. data/lib/poetry/core/css/resolver.rb +161 -0
  111. data/lib/poetry/core/css/safelist.rb +41 -0
  112. data/lib/poetry/core/css/tailwind_merger.rb +102 -0
  113. data/lib/poetry/core/css/template_classes.rb +102 -0
  114. data/lib/poetry/core/css/theme_coverage.rb +72 -0
  115. data/lib/poetry/core/css/var_coverage.rb +75 -0
  116. data/lib/poetry/core/css/verifier.rb +106 -0
  117. data/lib/poetry/core/design_lint.rb +720 -0
  118. data/lib/poetry/core/design_md/import.rb +250 -0
  119. data/lib/poetry/core/design_md.rb +461 -0
  120. data/lib/poetry/core/engine.rb +71 -0
  121. data/lib/poetry/core/errors.rb +53 -0
  122. data/lib/poetry/core/html/attributes.rb +667 -0
  123. data/lib/poetry/core/icons.rb +157 -0
  124. data/lib/poetry/core/llms_text.rb +354 -0
  125. data/lib/poetry/core/page_architectures.rb +304 -0
  126. data/lib/poetry/core/part_contract.rb +285 -0
  127. data/lib/poetry/core/preview/abstract.rb +121 -0
  128. data/lib/poetry/core/preview/base.rb +227 -0
  129. data/lib/poetry/core/preview/sidecarable.rb +136 -0
  130. data/lib/poetry/core/preview/template.rb +186 -0
  131. data/lib/poetry/core/recipe_items.rb +82 -0
  132. data/lib/poetry/core/registry.rb +363 -0
  133. data/lib/poetry/core/registry_address.rb +115 -0
  134. data/lib/poetry/core/registry_client.rb +217 -0
  135. data/lib/poetry/core/registry_installer.rb +234 -0
  136. data/lib/poetry/core/registry_items.rb +184 -0
  137. data/lib/poetry/core/skill_text.rb +288 -0
  138. data/lib/poetry/core/stable_id.rb +110 -0
  139. data/lib/poetry/core/stimulus/builder.rb +395 -0
  140. data/lib/poetry/core/stimulus/declarations.rb +444 -0
  141. data/lib/poetry/core/stimulus/manifest.rb +68 -0
  142. data/lib/poetry/core/stimulus/merger.rb +131 -0
  143. data/lib/poetry/core/stimulus_contract.rb +263 -0
  144. data/lib/poetry/core/tag_helper.rb +10 -0
  145. data/lib/poetry/core/template_compile.rb +74 -0
  146. data/lib/poetry/core/token_import.rb +317 -0
  147. data/lib/poetry/core/tokens/color.rb +215 -0
  148. data/lib/poetry/core/tokens/contrast_gate.rb +120 -0
  149. data/lib/poetry/core/tokens/generator.rb +211 -0
  150. data/lib/poetry/core/tokens.rb +117 -0
  151. data/lib/poetry/core/version.rb +9 -0
  152. data/lib/poetry/core.rb +52 -0
  153. data/lib/poetry-core.rb +5 -0
  154. data/tokens/aliases.css +145 -0
  155. data/tokens/tailwind-theme.css +47 -0
  156. data/tokens/tokens.css +78 -0
  157. data/tokens/tokens.dtcg.json +779 -0
  158. data/vendor/floating-ui/LICENSE +20 -0
  159. data/vendor/floating-ui/VENDORED_VERSIONS +15 -0
  160. data/vendor/shadcn-tailwind/LICENSE +21 -0
  161. data/vendor/shadcn-tailwind/VENDORED_COMMIT +1 -0
  162. data/vendor/shadcn-tailwind/tailwind.css +629 -0
  163. data/vendor/tw-animate-css/LICENSE +21 -0
  164. data/vendor/tw-animate-css/VENDORED_VERSION +1 -0
  165. data/vendor/tw-animate-css/tw-animate.css +1 -0
  166. metadata +267 -0
@@ -0,0 +1,141 @@
1
+ // Vendored from @floating-ui/utils@0.2.12 (dist/floating-ui.utils.mjs, MIT) - DO NOT EDIT.
2
+ // Import specifiers rewritten to @poetry/controllers/vendor/* so the file
3
+ // resolves via the importmap pins AND the npm exports map.
4
+ // Versions + license: vendor/floating-ui/ (repo root). Update by re-running
5
+ // the vendoring steps there against a newer npm tarball.
6
+ /**
7
+ * Custom positioning reference element.
8
+ * @see https://floating-ui.com/docs/virtual-elements
9
+ */
10
+
11
+ const sides = ['top', 'right', 'bottom', 'left'];
12
+ const alignments = ['start', 'end'];
13
+ const placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
14
+ const min = Math.min;
15
+ const max = Math.max;
16
+ const round = Math.round;
17
+ const floor = Math.floor;
18
+ const createCoords = v => ({
19
+ x: v,
20
+ y: v
21
+ });
22
+ const oppositeSideMap = {
23
+ left: 'right',
24
+ right: 'left',
25
+ bottom: 'top',
26
+ top: 'bottom'
27
+ };
28
+ function clamp(start, value, end) {
29
+ return max(start, min(value, end));
30
+ }
31
+ function evaluate(value, param) {
32
+ return typeof value === 'function' ? value(param) : value;
33
+ }
34
+ function getSide(placement) {
35
+ return placement.split('-')[0];
36
+ }
37
+ function getAlignment(placement) {
38
+ return placement.split('-')[1];
39
+ }
40
+ function getOppositeAxis(axis) {
41
+ return axis === 'x' ? 'y' : 'x';
42
+ }
43
+ function getAxisLength(axis) {
44
+ return axis === 'y' ? 'height' : 'width';
45
+ }
46
+ function getSideAxis(placement) {
47
+ const firstChar = placement[0];
48
+ return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';
49
+ }
50
+ function getAlignmentAxis(placement) {
51
+ return getOppositeAxis(getSideAxis(placement));
52
+ }
53
+ function getAlignmentSides(placement, rects, rtl) {
54
+ if (rtl === void 0) {
55
+ rtl = false;
56
+ }
57
+ const alignment = getAlignment(placement);
58
+ const alignmentAxis = getAlignmentAxis(placement);
59
+ const length = getAxisLength(alignmentAxis);
60
+ let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
61
+ if (rects.reference[length] > rects.floating[length]) {
62
+ mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
63
+ }
64
+ return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
65
+ }
66
+ function getExpandedPlacements(placement) {
67
+ const oppositePlacement = getOppositePlacement(placement);
68
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
69
+ }
70
+ function getOppositeAlignmentPlacement(placement) {
71
+ return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');
72
+ }
73
+ const lrPlacement = ['left', 'right'];
74
+ const rlPlacement = ['right', 'left'];
75
+ const tbPlacement = ['top', 'bottom'];
76
+ const btPlacement = ['bottom', 'top'];
77
+ function getSideList(side, isStart, rtl) {
78
+ switch (side) {
79
+ case 'top':
80
+ case 'bottom':
81
+ if (rtl) return isStart ? rlPlacement : lrPlacement;
82
+ return isStart ? lrPlacement : rlPlacement;
83
+ case 'left':
84
+ case 'right':
85
+ return isStart ? tbPlacement : btPlacement;
86
+ default:
87
+ return [];
88
+ }
89
+ }
90
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
91
+ const alignment = getAlignment(placement);
92
+ let list = getSideList(getSide(placement), direction === 'start', rtl);
93
+ if (alignment) {
94
+ list = list.map(side => side + "-" + alignment);
95
+ if (flipAlignment) {
96
+ list = list.concat(list.map(getOppositeAlignmentPlacement));
97
+ }
98
+ }
99
+ return list;
100
+ }
101
+ function getOppositePlacement(placement) {
102
+ const side = getSide(placement);
103
+ return oppositeSideMap[side] + placement.slice(side.length);
104
+ }
105
+ function expandPaddingObject(padding) {
106
+ var _padding$top, _padding$right, _padding$bottom, _padding$left;
107
+ return {
108
+ top: (_padding$top = padding.top) != null ? _padding$top : 0,
109
+ right: (_padding$right = padding.right) != null ? _padding$right : 0,
110
+ bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
111
+ left: (_padding$left = padding.left) != null ? _padding$left : 0
112
+ };
113
+ }
114
+ function getPaddingObject(padding) {
115
+ return typeof padding !== 'number' ? expandPaddingObject(padding) : {
116
+ top: padding,
117
+ right: padding,
118
+ bottom: padding,
119
+ left: padding
120
+ };
121
+ }
122
+ function rectToClientRect(rect) {
123
+ const {
124
+ x,
125
+ y,
126
+ width,
127
+ height
128
+ } = rect;
129
+ return {
130
+ width,
131
+ height,
132
+ top: y,
133
+ left: x,
134
+ right: x + width,
135
+ bottom: y + height,
136
+ x,
137
+ y
138
+ };
139
+ }
140
+
141
+ export { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };
@@ -0,0 +1,170 @@
1
+ // Vendored from @floating-ui/utils@0.2.12 (dist/floating-ui.utils.dom.mjs, MIT) - DO NOT EDIT.
2
+ // Import specifiers rewritten to @poetry/controllers/vendor/* so the file
3
+ // resolves via the importmap pins AND the npm exports map.
4
+ // Versions + license: vendor/floating-ui/ (repo root). Update by re-running
5
+ // the vendoring steps there against a newer npm tarball.
6
+ function hasWindow() {
7
+ return typeof window !== 'undefined';
8
+ }
9
+ function getNodeName(node) {
10
+ if (isNode(node)) {
11
+ return (node.nodeName || '').toLowerCase();
12
+ }
13
+ // Mocked nodes in testing environments may not be instances of Node. By
14
+ // returning `#document` an infinite loop won't occur.
15
+ // https://github.com/floating-ui/floating-ui/issues/2317
16
+ return '#document';
17
+ }
18
+ function getWindow(node) {
19
+ var _node$ownerDocument;
20
+ return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
21
+ }
22
+ function getDocumentElement(node) {
23
+ var _ref;
24
+ return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
25
+ }
26
+ function isNode(value) {
27
+ if (!hasWindow()) {
28
+ return false;
29
+ }
30
+ return value instanceof Node || value instanceof getWindow(value).Node;
31
+ }
32
+ function isElement(value) {
33
+ if (!hasWindow()) {
34
+ return false;
35
+ }
36
+ return value instanceof Element || value instanceof getWindow(value).Element;
37
+ }
38
+ function isHTMLElement(value) {
39
+ if (!hasWindow()) {
40
+ return false;
41
+ }
42
+ return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
43
+ }
44
+ function isShadowRoot(value) {
45
+ if (!hasWindow() || typeof ShadowRoot === 'undefined') {
46
+ return false;
47
+ }
48
+ return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
49
+ }
50
+ function isOverflowElement(element) {
51
+ const {
52
+ overflow,
53
+ overflowX,
54
+ overflowY,
55
+ display
56
+ } = getComputedStyle(element);
57
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';
58
+ }
59
+ function isTableElement(element) {
60
+ return /^(table|td|th)$/.test(getNodeName(element));
61
+ }
62
+ function isTopLayer(element) {
63
+ try {
64
+ if (element.matches(':popover-open')) {
65
+ return true;
66
+ }
67
+ } catch (_e) {
68
+ // no-op
69
+ }
70
+ try {
71
+ return element.matches(':modal');
72
+ } catch (_e) {
73
+ return false;
74
+ }
75
+ }
76
+ const willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
77
+ const containRe = /paint|layout|strict|content/;
78
+ const isNotNone = value => !!value && value !== 'none';
79
+ let isWebKitValue;
80
+ function isContainingBlock(elementOrCss) {
81
+ const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
82
+
83
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
84
+ // https://drafts.csswg.org/css-transforms-2/#individual-transforms
85
+ return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');
86
+ }
87
+ function getContainingBlock(element) {
88
+ let currentNode = getParentNode(element);
89
+ while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
90
+ if (isContainingBlock(currentNode)) {
91
+ return currentNode;
92
+ } else if (isTopLayer(currentNode)) {
93
+ return null;
94
+ }
95
+ currentNode = getParentNode(currentNode);
96
+ }
97
+ return null;
98
+ }
99
+ function isWebKit() {
100
+ if (isWebKitValue == null) {
101
+ isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');
102
+ }
103
+ return isWebKitValue;
104
+ }
105
+ function isLastTraversableNode(node) {
106
+ return /^(html|body|#document)$/.test(getNodeName(node));
107
+ }
108
+ function getComputedStyle(element) {
109
+ return getWindow(element).getComputedStyle(element);
110
+ }
111
+ function getNodeScroll(element) {
112
+ if (isElement(element)) {
113
+ return {
114
+ scrollLeft: element.scrollLeft,
115
+ scrollTop: element.scrollTop
116
+ };
117
+ }
118
+ return {
119
+ scrollLeft: element.scrollX,
120
+ scrollTop: element.scrollY
121
+ };
122
+ }
123
+ function getParentNode(node) {
124
+ if (getNodeName(node) === 'html') {
125
+ return node;
126
+ }
127
+ const result =
128
+ // Step into the shadow DOM of the parent of a slotted node.
129
+ node.assignedSlot ||
130
+ // DOM Element detected.
131
+ node.parentNode ||
132
+ // ShadowRoot detected.
133
+ isShadowRoot(node) && node.host ||
134
+ // Fallback.
135
+ getDocumentElement(node);
136
+ return isShadowRoot(result) ? result.host : result;
137
+ }
138
+ function getNearestOverflowAncestor(node) {
139
+ const parentNode = getParentNode(node);
140
+ if (isLastTraversableNode(parentNode)) {
141
+ return (node.ownerDocument || node).body;
142
+ }
143
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
144
+ return parentNode;
145
+ }
146
+ return getNearestOverflowAncestor(parentNode);
147
+ }
148
+ function getOverflowAncestors(node, list, traverseIframes) {
149
+ var _node$ownerDocument2;
150
+ if (list === void 0) {
151
+ list = [];
152
+ }
153
+ if (traverseIframes === void 0) {
154
+ traverseIframes = true;
155
+ }
156
+ const scrollableAncestor = getNearestOverflowAncestor(node);
157
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
158
+ const win = getWindow(scrollableAncestor);
159
+ if (isBody) {
160
+ const frameElement = getFrameElement(win);
161
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
162
+ } else {
163
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
164
+ }
165
+ }
166
+ function getFrameElement(win) {
167
+ return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
168
+ }
169
+
170
+ export { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };
@@ -0,0 +1,13 @@
1
+ <%# The default preview wrapper (Preview::Template's fallback): renders the
2
+ component passed by Preview::Base#render_component, with its content
3
+ block, inside the preview's configured container class. %>
4
+ <div class="<%= defined?(container_class) && container_class.presence || "p-4" %>">
5
+ <% if !defined?(component) || component.nil? %>
6
+ <%# The build error surfaces instead of crashing on render(nil). %>
7
+ <p class="text-sm text-destructive"><%= (defined?(error) && error) || "preview component could not be built" %></p>
8
+ <% elsif defined?(content_block) && content_block %>
9
+ <%= render(component, &content_block) %>
10
+ <% else %>
11
+ <%= render(component) %>
12
+ <% end %>
13
+ </div>
@@ -0,0 +1,20 @@
1
+ # poetry component registry - generated by `bin/rake registry:generate` FROM SOURCE.
2
+ # DO NOT EDIT: CI verifies this file matches a fresh build (rake registry:verify).
3
+ ---
4
+ components:
5
+ poetry/core/box:
6
+ class_name: Poetry::Core::Box::Component
7
+ identifier: poetry--core--box
8
+ bem_block: poetry-core-box
9
+ styles: []
10
+ options:
11
+ - name: html_tag
12
+ type: string
13
+ default: div
14
+ description: The element to render ('div', 'section', 'span', ...); void elements
15
+ (br, hr, img, ...) self-close and take no content block.
16
+ slots: []
17
+ identity: false
18
+ parts:
19
+ - name: box
20
+ description: The rendered element itself - the whole component is one part