@solid2-aria/core 0.0.1 → 0.1.0
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.
- package/README.md +14 -0
- package/dist/NOTICE.txt +33 -11
- package/dist/browser/actiongroup/create-action-group.js +2 -1
- package/dist/browser/actiongroup/create-action-group.js.map +1 -1
- package/dist/browser/combobox/create-combo-box.js +2 -2
- package/dist/browser/combobox/create-combo-box.js.map +1 -1
- package/dist/browser/dnd/drag-preview.js +7 -8
- package/dist/browser/dnd/drag-preview.js.map +1 -1
- package/dist/browser/focus/focus-scope.js +2 -2
- package/dist/browser/focus/focus-scope.js.map +1 -1
- package/dist/browser/focus/virtual-focus.d.ts +1 -0
- package/dist/browser/focus/virtual-focus.js +20 -5
- package/dist/browser/focus/virtual-focus.js.map +1 -1
- package/dist/browser/grid/create-grid-cell.js +4 -4
- package/dist/browser/grid/create-grid-cell.js.map +1 -1
- package/dist/browser/gridlist/create-grid-list-item.js +3 -3
- package/dist/browser/gridlist/create-grid-list-item.js.map +1 -1
- package/dist/browser/interactions/create-hover.js +6 -3
- package/dist/browser/interactions/create-hover.js.map +1 -1
- package/dist/browser/interactions/create-press.js +5 -4
- package/dist/browser/interactions/create-press.js.map +1 -1
- package/dist/browser/interactions/utils.js +4 -3
- package/dist/browser/interactions/utils.js.map +1 -1
- package/dist/browser/landmark/create-landmark.js +2 -2
- package/dist/browser/landmark/create-landmark.js.map +1 -1
- package/dist/browser/overlays/aria-hide-outside.js +5 -3
- package/dist/browser/overlays/aria-hide-outside.js.map +1 -1
- package/dist/browser/overlays/calculate-position.js +3 -3
- package/dist/browser/overlays/calculate-position.js.map +1 -1
- package/dist/browser/overlays/create-modal.js +15 -18
- package/dist/browser/overlays/create-modal.js.map +1 -1
- package/dist/browser/overlays/create-prevent-scroll.js +3 -3
- package/dist/browser/overlays/create-prevent-scroll.js.map +1 -1
- package/dist/browser/overlays/overlay.js +7 -8
- package/dist/browser/overlays/overlay.js.map +1 -1
- package/dist/browser/select/create-select.js +1 -1
- package/dist/browser/select/create-select.js.map +1 -1
- package/dist/browser/select/hidden-select.js +61 -64
- package/dist/browser/select/hidden-select.js.map +1 -1
- package/dist/browser/selection/create-selectable-item.js +2 -2
- package/dist/browser/selection/create-selectable-item.js.map +1 -1
- package/dist/browser/selection/create-type-select.js +11 -3
- package/dist/browser/selection/create-type-select.js.map +1 -1
- package/dist/browser/selection/list-keyboard-delegate.js +1 -1
- package/dist/browser/selection/list-keyboard-delegate.js.map +1 -1
- package/dist/browser/tokenfield/create-token-field.js +3 -3
- package/dist/browser/tokenfield/create-token-field.js.map +1 -1
- package/dist/browser/tokenfield/create-token.js +2 -1
- package/dist/browser/tokenfield/create-token.js.map +1 -1
- package/dist/browser/toolbar/create-toolbar.js +2 -2
- package/dist/browser/toolbar/create-toolbar.js.map +1 -1
- package/dist/browser/utils/dom-helpers.d.ts +2 -15
- package/dist/browser/utils/dom-helpers.js +1 -28
- package/dist/browser/utils/dom-helpers.js.map +1 -1
- package/dist/browser/utils/dom-value.js +2 -1
- package/dist/browser/utils/dom-value.js.map +1 -1
- package/dist/browser/utils/get-scroll-parent.js +3 -2
- package/dist/browser/utils/get-scroll-parent.js.map +1 -1
- package/dist/browser/utils/get-scroll-parents.js +2 -1
- package/dist/browser/utils/get-scroll-parents.js.map +1 -1
- package/dist/browser/utils/is-element-visible.js +3 -1
- package/dist/browser/utils/is-element-visible.js.map +1 -1
- package/dist/browser/utils/is-focusable.js +2 -1
- package/dist/browser/utils/is-focusable.js.map +1 -1
- package/dist/browser/utils/shadowdom/dom-functions.d.ts +8 -0
- package/dist/browser/utils/shadowdom/dom-functions.js +26 -7
- package/dist/browser/utils/shadowdom/dom-functions.js.map +1 -1
- package/dist/browser/utils/shadowdom/shadow-tree-walker.js +1 -1
- package/dist/browser/utils/shadowdom/shadow-tree-walker.js.map +1 -1
- package/dist/browser/utils/type-helpers.d.ts +42 -0
- package/dist/browser/utils/type-helpers.js +55 -0
- package/dist/browser/utils/type-helpers.js.map +1 -0
- package/dist/server/actiongroup/create-action-group.js +2 -1
- package/dist/server/actiongroup/create-action-group.js.map +1 -1
- package/dist/server/combobox/create-combo-box.js +2 -2
- package/dist/server/combobox/create-combo-box.js.map +1 -1
- package/dist/server/dnd/drag-preview.js +9 -12
- package/dist/server/dnd/drag-preview.js.map +1 -1
- package/dist/server/focus/focus-scope.js +2 -2
- package/dist/server/focus/focus-scope.js.map +1 -1
- package/dist/server/focus/virtual-focus.js +20 -5
- package/dist/server/focus/virtual-focus.js.map +1 -1
- package/dist/server/grid/create-grid-cell.js +4 -4
- package/dist/server/grid/create-grid-cell.js.map +1 -1
- package/dist/server/gridlist/create-grid-list-item.js +3 -3
- package/dist/server/gridlist/create-grid-list-item.js.map +1 -1
- package/dist/server/interactions/create-hover.js +6 -3
- package/dist/server/interactions/create-hover.js.map +1 -1
- package/dist/server/interactions/create-press.js +5 -4
- package/dist/server/interactions/create-press.js.map +1 -1
- package/dist/server/interactions/utils.js +4 -3
- package/dist/server/interactions/utils.js.map +1 -1
- package/dist/server/landmark/create-landmark.js +2 -2
- package/dist/server/landmark/create-landmark.js.map +1 -1
- package/dist/server/overlays/aria-hide-outside.js +5 -3
- package/dist/server/overlays/aria-hide-outside.js.map +1 -1
- package/dist/server/overlays/calculate-position.js +3 -3
- package/dist/server/overlays/calculate-position.js.map +1 -1
- package/dist/server/overlays/create-modal.js +7 -27
- package/dist/server/overlays/create-modal.js.map +1 -1
- package/dist/server/overlays/create-prevent-scroll.js +3 -3
- package/dist/server/overlays/create-prevent-scroll.js.map +1 -1
- package/dist/server/overlays/overlay.js +8 -18
- package/dist/server/overlays/overlay.js.map +1 -1
- package/dist/server/select/create-select.js +1 -1
- package/dist/server/select/create-select.js.map +1 -1
- package/dist/server/select/hidden-select.js +85 -138
- package/dist/server/select/hidden-select.js.map +1 -1
- package/dist/server/selection/create-selectable-item.js +2 -2
- package/dist/server/selection/create-selectable-item.js.map +1 -1
- package/dist/server/selection/create-type-select.js +11 -3
- package/dist/server/selection/create-type-select.js.map +1 -1
- package/dist/server/selection/list-keyboard-delegate.js +1 -1
- package/dist/server/selection/list-keyboard-delegate.js.map +1 -1
- package/dist/server/tokenfield/create-token-field.js +3 -3
- package/dist/server/tokenfield/create-token-field.js.map +1 -1
- package/dist/server/tokenfield/create-token.js +2 -1
- package/dist/server/tokenfield/create-token.js.map +1 -1
- package/dist/server/toolbar/create-toolbar.js +2 -2
- package/dist/server/toolbar/create-toolbar.js.map +1 -1
- package/dist/server/utils/dom-helpers.js +1 -28
- package/dist/server/utils/dom-helpers.js.map +1 -1
- package/dist/server/utils/dom-value.js +2 -1
- package/dist/server/utils/dom-value.js.map +1 -1
- package/dist/server/utils/get-scroll-parent.js +3 -2
- package/dist/server/utils/get-scroll-parent.js.map +1 -1
- package/dist/server/utils/get-scroll-parents.js +2 -1
- package/dist/server/utils/get-scroll-parents.js.map +1 -1
- package/dist/server/utils/is-element-visible.js +3 -1
- package/dist/server/utils/is-element-visible.js.map +1 -1
- package/dist/server/utils/is-focusable.js +2 -1
- package/dist/server/utils/is-focusable.js.map +1 -1
- package/dist/server/utils/shadowdom/dom-functions.js +26 -7
- package/dist/server/utils/shadowdom/dom-functions.js.map +1 -1
- package/dist/server/utils/shadowdom/shadow-tree-walker.js +1 -1
- package/dist/server/utils/shadowdom/shadow-tree-walker.js.map +1 -1
- package/dist/server/utils/type-helpers.js +55 -0
- package/dist/server/utils/type-helpers.js.map +1 -0
- package/dist/server/virtualizer/scroll-view.js +3 -1
- package/dist/server/virtualizer/scroll-view.js.map +1 -1
- package/package.json +16 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-element-visible.js","names":[],"sources":["../../../src/utils/is-element-visible.ts"],"sourcesContent":["/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-aria/src/utils/isElementVisible.ts.\n * Modified for Solid Aria: adapted hooks, reactive getters, DOM types, and imports for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\n/**\n * Adapted from https://github.com/testing-library/jest-dom and\n * https://github.com/vuejs/vue-test-utils-next/.\n * Licensed under the MIT License.\n *\n * @param element - Element to evaluate for display or visibility.\n */\n\nimport { getOwnerWindow } from \"./dom-helpers\";\n\nconst supportsCheckVisibility =\n typeof Element !== \"undefined\" && \"checkVisibility\" in Element.prototype;\n\nfunction isStyleVisible(element: Element) {\n const windowObject = getOwnerWindow(element);\n\n if (\n !(element instanceof windowObject.HTMLElement) &&\n !(element instanceof windowObject.SVGElement)\n ) {\n return false;\n }\n\n const { display, visibility } = element.style;\n\n let isVisible =\n display !== \"none\" && visibility !== \"hidden\" && visibility !== \"collapse\";\n\n if (isVisible) {\n const { display: computedDisplay, visibility: computedVisibility } =\n windowObject.getComputedStyle(element);\n\n isVisible =\n computedDisplay !== \"none\" &&\n computedVisibility !== \"hidden\" &&\n computedVisibility !== \"collapse\";\n }\n\n return isVisible;\n}\n\nfunction isAttributeVisible(element: Element, childElement?: Element) {\n return (\n !element.hasAttribute(\"hidden\") &&\n // Ignore HiddenSelect when tree walking.\n element.attributes.getNamedItem(\"data-react-aria-prevent-focus\") === null &&\n (element.nodeName === \"DETAILS\" &&\n childElement &&\n childElement.nodeName !== \"SUMMARY\"\n ? element.hasAttribute(\"open\")\n : true)\n );\n}\n\nexport function isElementVisible(\n element: Element,\n childElement?: Element\n): boolean {\n if (supportsCheckVisibility) {\n return (\n element.checkVisibility({ visibilityProperty: true }) &&\n !element.closest(\"[data-react-aria-prevent-focus]\")\n );\n }\n\n return (\n element.nodeName !== \"#comment\" &&\n isStyleVisible(element) &&\n isAttributeVisible(element, childElement) &&\n (!
|
|
1
|
+
{"version":3,"file":"is-element-visible.js","names":[],"sources":["../../../src/utils/is-element-visible.ts"],"sourcesContent":["/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-aria/src/utils/isElementVisible.ts.\n * Modified for Solid Aria: adapted hooks, reactive getters, DOM types, and imports for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\n/**\n * Adapted from https://github.com/testing-library/jest-dom and\n * https://github.com/vuejs/vue-test-utils-next/.\n * Licensed under the MIT License.\n *\n * @param element - Element to evaluate for display or visibility.\n */\n\nimport { getOwnerWindow } from \"./dom-helpers\";\nimport { getParentElement } from \"./shadowdom/dom-functions\";\n\nconst supportsCheckVisibility =\n typeof Element !== \"undefined\" && \"checkVisibility\" in Element.prototype;\n\nfunction isStyleVisible(element: Element) {\n const windowObject = getOwnerWindow(element);\n\n if (\n !(element instanceof windowObject.HTMLElement) &&\n !(element instanceof windowObject.SVGElement)\n ) {\n return false;\n }\n\n const { display, visibility } = element.style;\n\n let isVisible =\n display !== \"none\" && visibility !== \"hidden\" && visibility !== \"collapse\";\n\n if (isVisible) {\n const { display: computedDisplay, visibility: computedVisibility } =\n windowObject.getComputedStyle(element);\n\n isVisible =\n computedDisplay !== \"none\" &&\n computedVisibility !== \"hidden\" &&\n computedVisibility !== \"collapse\";\n }\n\n return isVisible;\n}\n\nfunction isAttributeVisible(element: Element, childElement?: Element) {\n return (\n !element.hasAttribute(\"hidden\") &&\n // Ignore HiddenSelect when tree walking.\n element.attributes.getNamedItem(\"data-react-aria-prevent-focus\") === null &&\n (element.nodeName === \"DETAILS\" &&\n childElement &&\n childElement.nodeName !== \"SUMMARY\"\n ? element.hasAttribute(\"open\")\n : true)\n );\n}\n\nexport function isElementVisible(\n element: Element,\n childElement?: Element\n): boolean {\n if (supportsCheckVisibility) {\n return (\n element.checkVisibility({ visibilityProperty: true }) &&\n !element.closest(\"[data-react-aria-prevent-focus]\")\n );\n }\n\n const parentElement = getParentElement(element);\n\n return (\n element.nodeName !== \"#comment\" &&\n isStyleVisible(element) &&\n isAttributeVisible(element, childElement) &&\n (!parentElement || isElementVisible(parentElement, element))\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,0BACJ,OAAO,YAAY,eAAe,qBAAqB,QAAQ;AAEjE,SAAS,eAAe,SAAkB;CACxC,MAAM,eAAe,eAAe,OAAO;CAE3C,IACE,EAAE,mBAAmB,aAAa,gBAClC,EAAE,mBAAmB,aAAa,aAElC,OAAO;CAGT,MAAM,EAAE,SAAS,eAAe,QAAQ;CAExC,IAAI,YACF,YAAY,UAAU,eAAe,YAAY,eAAe;CAElE,IAAI,WAAW;EACb,MAAM,EAAE,SAAS,iBAAiB,YAAY,uBAC5C,aAAa,iBAAiB,OAAO;EAEvC,YACE,oBAAoB,UACpB,uBAAuB,YACvB,uBAAuB;CAC3B;CAEA,OAAO;AACT;AAEA,SAAS,mBAAmB,SAAkB,cAAwB;CACpE,OACE,CAAC,QAAQ,aAAa,QAAQ,KAE9B,QAAQ,WAAW,aAAa,+BAA+B,MAAM,SACpE,QAAQ,aAAa,aACtB,gBACA,aAAa,aAAa,YACtB,QAAQ,aAAa,MAAM,IAC3B;AAER;AAEA,SAAgB,iBACd,SACA,cACS;CACT,IAAI,yBACF,OACE,QAAQ,gBAAgB,EAAE,oBAAoB,KAAK,CAAC,KACpD,CAAC,QAAQ,QAAQ,iCAAiC;CAItD,MAAM,gBAAgB,iBAAiB,OAAO;CAE9C,OACE,QAAQ,aAAa,cACrB,eAAe,OAAO,KACtB,mBAAmB,SAAS,YAAY,MACvC,CAAC,iBAAiB,iBAAiB,eAAe,OAAO;AAE9D"}
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
import { getTruthyValue, whenTruthy } from "./truthy.js";
|
|
18
18
|
import { isPresent } from "./is-present.js";
|
|
19
19
|
import { getOwnerWindow } from "./dom-helpers.js";
|
|
20
|
+
import { getParentElement } from "./shadowdom/dom-functions.js";
|
|
20
21
|
import { isElementVisible } from "./is-element-visible.js";
|
|
21
22
|
// src/utils/is-focusable.ts
|
|
22
23
|
const focusableElements = [
|
|
@@ -48,7 +49,7 @@ function isInert(element) {
|
|
|
48
49
|
let node = element;
|
|
49
50
|
while (isPresent(node)) {
|
|
50
51
|
if (node instanceof getOwnerWindow(node).HTMLElement && node.inert) return true;
|
|
51
|
-
node = node
|
|
52
|
+
node = getParentElement(node);
|
|
52
53
|
}
|
|
53
54
|
return false;
|
|
54
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-focusable.js","names":[],"sources":["../../../src/utils/is-focusable.ts"],"sourcesContent":["/*\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-aria/src/utils/isFocusable.ts.\n * Modified for Solid Aria: adapted hooks, reactive getters, DOM types, and imports for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport { getOwnerWindow } from \"./dom-helpers\";\nimport { isElementVisible } from \"./is-element-visible\";\nimport { isPresent } from \"./is-present\";\nimport { getTruthyValue, whenTruthy } from \"./truthy\";\n\nconst focusableElements = [\n \"input:not([disabled]):not([type=hidden])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n \"button:not([disabled])\",\n \"a[href]\",\n \"area[href]\",\n \"summary\",\n \"iframe\",\n \"object\",\n \"embed\",\n \"audio[controls]\",\n \"video[controls]\",\n '[contenteditable]:not([contenteditable^=\"false\"])',\n \"permission\",\n];\n\nconst FOCUSABLE_ELEMENT_SELECTOR = `${focusableElements.join(\n \":not([hidden]),\"\n)},[tabindex]:not([disabled]):not([hidden])`;\n\nfocusableElements.push('[tabindex]:not([tabindex=\"-1\"]):not([disabled])');\n\nconst TABBABLE_ELEMENT_SELECTOR = focusableElements.join(\n ':not([hidden]):not([tabindex=\"-1\"]),'\n);\n\nexport function isFocusable(\n element: Element,\n options?: {\n skipVisibilityCheck?: boolean;\n }\n): boolean {\n return whenTruthy(\n whenTruthy(\n element.matches(FOCUSABLE_ELEMENT_SELECTOR),\n () => !isInert(element)\n ),\n () =>\n getTruthyValue(options?.skipVisibilityCheck) ?? isElementVisible(element)\n );\n}\n\nexport function isTabbable(element: Element): boolean {\n return (\n element.matches(TABBABLE_ELEMENT_SELECTOR) &&\n isElementVisible(element) &&\n !isInert(element)\n );\n}\n\nfunction isInert(element: Element): boolean {\n let node: Element | null = element;\n\n while (isPresent(node)) {\n if (node instanceof getOwnerWindow(node).HTMLElement && node.inert) {\n return true;\n }\n\n node = node
|
|
1
|
+
{"version":3,"file":"is-focusable.js","names":[],"sources":["../../../src/utils/is-focusable.ts"],"sourcesContent":["/*\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-aria/src/utils/isFocusable.ts.\n * Modified for Solid Aria: adapted hooks, reactive getters, DOM types, and imports for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport { getOwnerWindow } from \"./dom-helpers\";\nimport { isElementVisible } from \"./is-element-visible\";\nimport { isPresent } from \"./is-present\";\nimport { getParentElement } from \"./shadowdom/dom-functions\";\nimport { getTruthyValue, whenTruthy } from \"./truthy\";\n\nconst focusableElements = [\n \"input:not([disabled]):not([type=hidden])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n \"button:not([disabled])\",\n \"a[href]\",\n \"area[href]\",\n \"summary\",\n \"iframe\",\n \"object\",\n \"embed\",\n \"audio[controls]\",\n \"video[controls]\",\n '[contenteditable]:not([contenteditable^=\"false\"])',\n \"permission\",\n];\n\nconst FOCUSABLE_ELEMENT_SELECTOR = `${focusableElements.join(\n \":not([hidden]),\"\n)},[tabindex]:not([disabled]):not([hidden])`;\n\nfocusableElements.push('[tabindex]:not([tabindex=\"-1\"]):not([disabled])');\n\nconst TABBABLE_ELEMENT_SELECTOR = focusableElements.join(\n ':not([hidden]):not([tabindex=\"-1\"]),'\n);\n\nexport function isFocusable(\n element: Element,\n options?: {\n skipVisibilityCheck?: boolean;\n }\n): boolean {\n return whenTruthy(\n whenTruthy(\n element.matches(FOCUSABLE_ELEMENT_SELECTOR),\n () => !isInert(element)\n ),\n () =>\n getTruthyValue(options?.skipVisibilityCheck) ?? isElementVisible(element)\n );\n}\n\nexport function isTabbable(element: Element): boolean {\n return (\n element.matches(TABBABLE_ELEMENT_SELECTOR) &&\n isElementVisible(element) &&\n !isInert(element)\n );\n}\n\nfunction isInert(element: Element): boolean {\n let node: Element | null = element;\n\n while (isPresent(node)) {\n if (node instanceof getOwnerWindow(node).HTMLElement && node.inert) {\n return true;\n }\n\n node = getParentElement(node);\n }\n\n return false;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAM,oBAAoB;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,6BAA6B,GAAG,kBAAkB,KACtD,iBACF,EAAE;AAEF,kBAAkB,KAAK,mDAAiD;AAExE,MAAM,4BAA4B,kBAAkB,KAClD,wCACF;AAEA,SAAgB,YACd,SACA,SAGS;CACT,OAAO,WACL,WACE,QAAQ,QAAQ,0BAA0B,SACpC,CAAC,QAAQ,OAAO,CACxB,SAEE,eAAe,SAAS,mBAAmB,KAAK,iBAAiB,OAAO,CAC5E;AACF;AAEA,SAAgB,WAAW,SAA2B;CACpD,OACE,QAAQ,QAAQ,yBAAyB,KACzC,iBAAiB,OAAO,KACxB,CAAC,QAAQ,OAAO;AAEpB;AAEA,SAAS,QAAQ,SAA2B;CAC1C,IAAI,OAAuB;CAE3B,OAAO,UAAU,IAAI,GAAG;EACtB,IAAI,gBAAgB,eAAe,IAAI,CAAC,CAAC,eAAe,KAAK,OAC3D,OAAO;EAGT,OAAO,iBAAiB,IAAI;CAC9B;CAEA,OAAO;AACT"}
|
|
@@ -4,22 +4,41 @@
|
|
|
4
4
|
* Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
|
|
5
5
|
*/
|
|
6
6
|
import { isPresent } from "../is-present.js";
|
|
7
|
-
import {
|
|
7
|
+
import { isElement, isNode, isShadowRoot } from "../type-helpers.js";
|
|
8
|
+
import { getOwnerWindow } from "../dom-helpers.js";
|
|
8
9
|
import { shadowDOM } from "@solid2-aria/stately/flags/flags";
|
|
9
10
|
// src/utils/shadowdom/dom-functions.ts
|
|
10
11
|
/**
|
|
12
|
+
* ShadowDOM safe version of Node.parentNode.
|
|
13
|
+
*/
|
|
14
|
+
function getParentNode(node) {
|
|
15
|
+
if (!shadowDOM()) return node?.parentNode ?? null;
|
|
16
|
+
if (!node) return null;
|
|
17
|
+
let currentNode = node;
|
|
18
|
+
const assignedSlot = "assignedSlot" in currentNode ? currentNode.assignedSlot : null;
|
|
19
|
+
if ((!("assignedElements" in currentNode) || typeof currentNode.assignedElements !== "function") && assignedSlot instanceof getOwnerWindow(currentNode).HTMLSlotElement && assignedSlot.parentNode) currentNode = assignedSlot.parentNode;
|
|
20
|
+
else if (isShadowRoot(currentNode)) currentNode = currentNode.host;
|
|
21
|
+
else currentNode = currentNode.parentNode;
|
|
22
|
+
return currentNode;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* ShadowDOM safe version of element.parentElement.
|
|
26
|
+
*/
|
|
27
|
+
function getParentElement(node) {
|
|
28
|
+
let parentNode = getParentNode(node);
|
|
29
|
+
while (parentNode && !isElement(parentNode)) parentNode = getParentNode(parentNode);
|
|
30
|
+
return parentNode;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
11
33
|
* ShadowDOM safe version of Node.contains.
|
|
12
34
|
*/
|
|
13
35
|
function nodeContains(node, otherNode) {
|
|
14
36
|
if (!isNode(node) || !isNode(otherNode)) return false;
|
|
15
37
|
if (!shadowDOM()) return node.contains(otherNode);
|
|
16
38
|
let currentNode = otherNode;
|
|
17
|
-
while (
|
|
39
|
+
while (currentNode) {
|
|
18
40
|
if (currentNode === node) return true;
|
|
19
|
-
|
|
20
|
-
if ((!("assignedElements" in currentNode) || typeof currentNode.assignedElements !== "function") && assignedSlot instanceof getOwnerWindow(currentNode).HTMLSlotElement && assignedSlot.parentNode) currentNode = assignedSlot.parentNode;
|
|
21
|
-
else if (isShadowRoot(currentNode)) currentNode = currentNode.host;
|
|
22
|
-
else currentNode = currentNode.parentNode;
|
|
41
|
+
currentNode = getParentNode(currentNode);
|
|
23
42
|
}
|
|
24
43
|
return false;
|
|
25
44
|
}
|
|
@@ -75,6 +94,6 @@ function isFocusWithin(node) {
|
|
|
75
94
|
const { activeElement } = root;
|
|
76
95
|
return isPresent(activeElement) && node.contains(activeElement);
|
|
77
96
|
}
|
|
78
|
-
export { getActiveElement, getEventTarget, getPropagationTargets, isFocusWithin, nodeContains };
|
|
97
|
+
export { getActiveElement, getEventTarget, getParentElement, getParentNode, getPropagationTargets, isFocusWithin, nodeContains };
|
|
79
98
|
|
|
80
99
|
//# sourceMappingURL=dom-functions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom-functions.js","names":[],"sources":["../../../../src/utils/shadowdom/dom-functions.ts"],"sourcesContent":["/*\n * Derived from Adobe React Spectrum: packages/react-aria/src/utils/shadowdom/DOMFunctions.ts.\n * Modified for Solid Aria: adapted hooks, reactive getters, DOM types, and imports for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport { shadowDOM } from \"@solid2-aria/stately/flags/flags\";\nimport type { EventTargetType } from \"@solid2-aria/types-shared\";\n\nimport { getOwnerWindow
|
|
1
|
+
{"version":3,"file":"dom-functions.js","names":[],"sources":["../../../../src/utils/shadowdom/dom-functions.ts"],"sourcesContent":["/*\n * Derived from Adobe React Spectrum: packages/react-aria/src/utils/shadowdom/DOMFunctions.ts.\n * Modified for Solid Aria: adapted hooks, reactive getters, DOM types, and imports for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport { shadowDOM } from \"@solid2-aria/stately/flags/flags\";\nimport type { EventTargetType } from \"@solid2-aria/types-shared\";\n\nimport { getOwnerWindow } from \"../dom-helpers\";\nimport { isPresent } from \"../is-present\";\nimport { isElement, isShadowRoot, isNode } from \"../type-helpers\";\n\n// Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16\n\n/**\n * ShadowDOM safe version of Node.parentNode.\n */\nexport function getParentNode(node: Node | null | undefined): Node | null {\n if (!shadowDOM()) {\n return node?.parentNode ?? null;\n }\n\n if (!node) {\n return null;\n }\n\n let currentNode: Node | null = node;\n\n const assignedSlot: unknown =\n \"assignedSlot\" in currentNode ? currentNode.assignedSlot : null;\n\n if (\n (!(\"assignedElements\" in currentNode) ||\n typeof currentNode.assignedElements !== \"function\") &&\n assignedSlot instanceof getOwnerWindow(currentNode).HTMLSlotElement &&\n assignedSlot.parentNode\n ) {\n // Element is slotted.\n currentNode = assignedSlot.parentNode;\n } else if (isShadowRoot(currentNode)) {\n // Element is in shadow root\n currentNode = currentNode.host;\n } else {\n currentNode = currentNode.parentNode;\n }\n\n return currentNode;\n}\n\n/**\n * ShadowDOM safe version of element.parentElement.\n */\nexport function getParentElement(\n node: Node | null | undefined\n): Element | null {\n let parentNode = getParentNode(node);\n\n while (parentNode && !isElement(parentNode)) {\n parentNode = getParentNode(parentNode);\n }\n\n return parentNode;\n}\n\n/**\n * ShadowDOM safe version of Node.contains.\n */\nexport function nodeContains(\n node: EventTarget | null | undefined,\n otherNode: EventTarget | null | undefined\n): boolean {\n if (!isNode(node) || !isNode(otherNode)) {\n return false;\n }\n\n if (!shadowDOM()) {\n return node.contains(otherNode);\n }\n\n let currentNode: Node | null = otherNode;\n\n while (currentNode) {\n if (currentNode === node) {\n return true;\n }\n\n currentNode = getParentNode(currentNode);\n }\n\n return false;\n}\n\n/**\n * ShadowDOM safe version of document.activeElement.\n */\nexport const getActiveElement = (doc: Document = document): Element | null => {\n if (!shadowDOM()) {\n return doc.activeElement;\n }\n\n let activeElement: Element | null = doc.activeElement;\n\n while (\n activeElement &&\n \"shadowRoot\" in activeElement &&\n activeElement.shadowRoot?.activeElement\n ) {\n ({ activeElement } = activeElement.shadowRoot);\n }\n\n return activeElement;\n};\n\n// Possibly we can improve the types for this using https://github.com/adobe/react-spectrum/pull/8991/changes#diff-2d491c0c91701d28d08e1cf9fcadbdb21a030b67ab681460c9934140f29127b8R68 but it was more changes than I\n// wanted to make to fix the function.\n/**\n * ShadowDOM safe version of event.target.\n */\ntype ResolvedEventTarget<T> =\n unknown extends EventTargetType<T> ? EventTarget | null : EventTargetType<T>;\n\nexport function getEventTarget<T extends Event>(\n event: T\n): ResolvedEventTarget<T> {\n let { target } = event;\n\n if (\n shadowDOM() &&\n target instanceof Element &&\n target.shadowRoot &&\n \"composedPath\" in event\n ) {\n target = event.composedPath()[0] ?? null;\n }\n\n // SAFETY: This preserves the event's target contract after resolving its composed path; erased targets retain the native nullable EventTarget type.\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- TypeScript cannot derive this conditional event-target type from the runtime path.\n return target as ResolvedEventTarget<T>;\n}\n\n/**\n * Returns the set of event targets a listener must be attached to in order to\n * globally observe an event.\n *\n * @param from - The target element to start from.\n * @param to - The element to stop at when bubbling. @default getOwnerWindow(from)\n * `to` is generally going to be either `document` or `window`, but\n * it can be any intermediate node.\n * @returns [global, ...shadowRoots]\n */\nexport function getPropagationTargets(\n from: Element | Document | Window | null | undefined,\n to?: Document | Window | Element | null\n): EventTarget[] {\n let currentTo = to;\n\n // If `to` is coming from a ref, its type technically allows `null`.\n // In practice, this function will generally be called from within an effect.\n // If the ref has not resolved by that point, then a coding error has been made.\n // Better to return an empty array than `[window]`, which may appear to work\n // in the light DOM, but fail in the shadow DOM.\n if (currentTo === null) {\n return [];\n }\n\n currentTo ??= getOwnerWindow(from);\n const targets: EventTarget[] = [currentTo];\n\n if (!shadowDOM() || !from || from === currentTo) {\n return targets;\n }\n\n // The root `to` itself lives in. The event already reaches `to` once\n // it is inside this root, so we must NOT collect this root or anything above\n // it — only the shadow roots strictly between `refNode` and `to`.\n // `window` has no getRootNode; its boundary is the document, which the walk\n // reaches naturally (the document is not a ShadowRoot, so the loop exits).\n const toRoot = \"getRootNode\" in currentTo ? currentTo.getRootNode() : null;\n let current: Node | null = \"getRootNode\" in from ? from.getRootNode() : null;\n\n while (isShadowRoot(current) && current !== toRoot) {\n // order shouldn't matter\n targets.push(current);\n current = current.host.getRootNode();\n }\n\n return targets;\n}\n\n/**\n * ShadowDOM safe fast version of node.contains(document.activeElement).\n *\n * @param node - The element whose subtree may contain focus.\n * @returns Whether the element contains the active element.\n */\nexport function isFocusWithin(node: Element | null | undefined): boolean {\n if (!node) {\n return false;\n }\n\n // Get the active element within the node's parent shadow root (or the document). Can return null.\n const root = node.getRootNode();\n const ownerWindow = getOwnerWindow(node);\n\n if (\n !(root instanceof ownerWindow.Document) &&\n !(root instanceof ownerWindow.ShadowRoot)\n ) {\n return false;\n }\n\n const { activeElement } = root;\n\n // Check if the active element is within this node. These nodes are within the same shadow root.\n return isPresent(activeElement) && node.contains(activeElement);\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,SAAgB,cAAc,MAA4C;CACxE,IAAI,CAAC,UAAU,GACb,OAAO,MAAM,cAAc;CAG7B,IAAI,CAAC,MACH,OAAO;CAGT,IAAI,cAA2B;CAE/B,MAAM,eACJ,kBAAkB,cAAc,YAAY,eAAe;CAE7D,KACG,EAAE,sBAAsB,gBACvB,OAAO,YAAY,qBAAqB,eAC1C,wBAAwB,eAAe,WAAW,CAAC,CAAC,mBACpD,aAAa,YAGb,cAAc,aAAa;MACtB,IAAI,aAAa,WAAW,GAEjC,cAAc,YAAY;MAE1B,cAAc,YAAY;CAG5B,OAAO;AACT;;;;AAKA,SAAgB,iBACd,MACgB;CAChB,IAAI,aAAa,cAAc,IAAI;CAEnC,OAAO,cAAc,CAAC,UAAU,UAAU,GACxC,aAAa,cAAc,UAAU;CAGvC,OAAO;AACT;;;;AAKA,SAAgB,aACd,MACA,WACS;CACT,IAAI,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,SAAS,GACpC,OAAO;CAGT,IAAI,CAAC,UAAU,GACb,OAAO,KAAK,SAAS,SAAS;CAGhC,IAAI,cAA2B;CAE/B,OAAO,aAAa;EAClB,IAAI,gBAAgB,MAClB,OAAO;EAGT,cAAc,cAAc,WAAW;CACzC;CAEA,OAAO;AACT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
|
|
7
|
-
import { isShadowRoot } from "../
|
|
7
|
+
import { isShadowRoot } from "../type-helpers.js";
|
|
8
8
|
import { nodeContains } from "./dom-functions.js";
|
|
9
9
|
import { requireElement } from "../dom-value.js";
|
|
10
10
|
import { shadowDOM } from "@solid2-aria/stately/flags/flags";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadow-tree-walker.js","names":[],"sources":["../../../../src/utils/shadowdom/shadow-tree-walker.ts"],"sourcesContent":["/*\n * Derived from Adobe React Spectrum: packages/react-aria/src/utils/shadowdom/ShadowTreeWalker.ts.\n * Modified for Solid Aria: adapted hooks, reactive getters, DOM types, and imports for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport { shadowDOM } from \"@solid2-aria/stately/flags/flags\";\n\nimport { isShadowRoot } from \"../dom-helpers\";\nimport { requireElement } from \"../dom-value\";\nimport { isTruthy } from \"../truthy\";\n// https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/ShadowTreeWalker.ts\nimport { nodeContains } from \"./dom-functions\";\n\nexport class ShadowTreeWalker implements TreeWalker {\n public readonly filter: NodeFilter | null;\n public readonly root: Node;\n public readonly whatToShow: number;\n private readonly _doc: Document;\n private _walkerStack: TreeWalker[] = [];\n private _currentNode: Node;\n private readonly _currentSetFor = new Set<TreeWalker>();\n constructor(\n doc: Document,\n root: Node,\n whatToShow?: number,\n filter?: NodeFilter | null\n ) {\n this._doc = doc;\n this.root = root;\n this.filter = filter ?? null;\n this.whatToShow = whatToShow ?? NodeFilter.SHOW_ALL;\n this._currentNode = root;\n this._walkerStack.unshift(\n doc.createTreeWalker(root, whatToShow, this._acceptNode)\n );\n\n const shadowRoot =\n root.nodeType === Node.ELEMENT_NODE\n ? requireElement(root).shadowRoot\n : null;\n\n if (shadowRoot) {\n const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, {\n acceptNode: this._acceptNode,\n });\n\n this._walkerStack.unshift(walker);\n }\n }\n private readonly _acceptNode = (node: Node): number => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n const { shadowRoot } = requireElement(node);\n\n if (shadowRoot) {\n const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, {\n acceptNode: this._acceptNode,\n });\n\n this._walkerStack.unshift(walker);\n\n return NodeFilter.FILTER_ACCEPT;\n }\n\n if (typeof this.filter === \"function\") {\n return this.filter(node);\n } else if (this.filter?.acceptNode) {\n return this.filter.acceptNode(node);\n } else if (this.filter === null) {\n return NodeFilter.FILTER_ACCEPT;\n }\n }\n\n return NodeFilter.FILTER_SKIP;\n };\n public get currentNode(): Node {\n return this._currentNode;\n }\n public set currentNode(node: Node) {\n if (!nodeContains(this.root, node)) {\n throw new Error(\n \"Cannot set currentNode to a node that is not contained by the root node.\"\n );\n }\n\n const walkers: TreeWalker[] = [];\n let curNode: Node | null | undefined = node;\n let currentWalkerCurrentNode = node;\n this._currentNode = node;\n\n while (curNode && curNode !== this.root) {\n if (isShadowRoot(curNode)) {\n const shadowRoot: ShadowRoot = curNode;\n\n const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, {\n acceptNode: this._acceptNode,\n });\n\n walkers.push(walker);\n walker.currentNode = currentWalkerCurrentNode;\n this._currentSetFor.add(walker);\n currentWalkerCurrentNode = shadowRoot.host;\n curNode = currentWalkerCurrentNode;\n } else {\n curNode = curNode.parentNode;\n }\n }\n\n const walker = this._doc.createTreeWalker(this.root, this.whatToShow, {\n acceptNode: this._acceptNode,\n });\n\n walkers.push(walker);\n walker.currentNode = currentWalkerCurrentNode;\n this._currentSetFor.add(walker);\n this._walkerStack = walkers;\n }\n public get doc(): Document {\n return this._doc;\n }\n public firstChild(): Node | null {\n const { currentNode } = this;\n const newNode = this.nextNode();\n\n if (!nodeContains(currentNode, newNode)) {\n this.currentNode = currentNode;\n\n return null;\n }\n\n if (newNode) {\n this.currentNode = newNode;\n }\n\n return newNode;\n }\n public lastChild(): Node | null {\n const [walker] = this._walkerStack;\n const newNode = walker?.lastChild() ?? null;\n\n if (newNode) {\n this.currentNode = newNode;\n }\n\n return newNode;\n }\n public nextNode(): Node | null {\n const nextNode = this._walkerStack[0]?.nextNode() ?? null;\n\n if (nextNode) {\n const { shadowRoot } = requireElement(nextNode);\n\n if (shadowRoot) {\n let nodeResult: number | undefined;\n\n if (typeof this.filter === \"function\") {\n nodeResult = this.filter(nextNode);\n } else if (this.filter?.acceptNode) {\n nodeResult = this.filter.acceptNode(nextNode);\n }\n\n if (nodeResult === NodeFilter.FILTER_ACCEPT) {\n this.currentNode = nextNode;\n\n return nextNode;\n }\n\n // _acceptNode should have added new walker for this shadow,\n // go in recursively.\n const newNode = this.nextNode();\n\n if (newNode) {\n this.currentNode = newNode;\n }\n\n return newNode;\n }\n\n if (isTruthy(nextNode)) {\n this.currentNode = nextNode;\n }\n\n return nextNode;\n }\n\n if (this._walkerStack.length > 1) {\n this._walkerStack.shift();\n const newNode = this.nextNode();\n\n if (newNode) {\n this.currentNode = newNode;\n }\n\n return newNode;\n }\n\n return null;\n }\n public previousNode(): Node | null {\n const [currentWalker] = this._walkerStack;\n\n if (!currentWalker) {\n return null;\n }\n\n if (currentWalker.currentNode === currentWalker.root) {\n if (this._currentSetFor.has(currentWalker)) {\n this._currentSetFor.delete(currentWalker);\n\n if (this._walkerStack.length > 1) {\n this._walkerStack.shift();\n const newNode = this.previousNode();\n\n if (newNode) {\n this.currentNode = newNode;\n }\n\n return newNode;\n }\n\n return null;\n }\n\n return null;\n }\n\n const previousNode = currentWalker.previousNode();\n\n if (previousNode) {\n const { shadowRoot } = requireElement(previousNode);\n\n if (shadowRoot) {\n let nodeResult: number | undefined;\n\n if (typeof this.filter === \"function\") {\n nodeResult = this.filter(previousNode);\n } else if (this.filter?.acceptNode) {\n nodeResult = this.filter.acceptNode(previousNode);\n }\n\n if (nodeResult === NodeFilter.FILTER_ACCEPT) {\n if (isTruthy(previousNode)) {\n this.currentNode = previousNode;\n }\n\n return previousNode;\n }\n\n // _acceptNode should have added new walker for this shadow,\n // go in recursively.\n const newNode = this.lastChild();\n\n if (newNode) {\n this.currentNode = newNode;\n }\n\n return newNode;\n }\n\n if (isTruthy(previousNode)) {\n this.currentNode = previousNode;\n }\n\n return previousNode;\n }\n\n if (this._walkerStack.length > 1) {\n this._walkerStack.shift();\n const newNode = this.previousNode();\n\n if (newNode) {\n this.currentNode = newNode;\n }\n\n return newNode;\n }\n\n return null;\n }\n /**\n * @deprecated\n */\n public nextSibling(): Node | null {\n // if (__DEV__) {\n // throw new Error(\"Method not implemented.\");\n // }\n return null;\n }\n /**\n * @deprecated\n */\n public previousSibling(): Node | null {\n // if (__DEV__) {\n // throw new Error(\"Method not implemented.\");\n // }\n return null;\n }\n /**\n * @deprecated\n */\n public parentNode(): Node | null {\n // if (__DEV__) {\n // throw new Error(\"Method not implemented.\");\n // }\n return null;\n }\n}\n\n/**\n * ShadowDOM safe version of document.createTreeWalker.\n */\nexport function createShadowTreeWalker(\n doc: Document,\n root: Node,\n whatToShow?: number,\n filter?: NodeFilter | null\n): TreeWalker {\n if (shadowDOM()) {\n return new ShadowTreeWalker(doc, root, whatToShow, filter);\n }\n\n return doc.createTreeWalker(root, whatToShow, filter);\n}\n"],"mappings":";;;;;;;;;;;AAcA,IAAa,mBAAb,MAAoD;CAClD;CACA;CACA;CACA;CACA,eAAqC,CAAC;CACtC;CACA,iCAAkC,IAAI,IAAgB;CACtD,YACE,KACA,MACA,YACA,QACA;EACA,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,SAAS,UAAU;EACxB,KAAK,aAAa,cAAc,WAAW;EAC3C,KAAK,eAAe;EACpB,KAAK,aAAa,QAChB,IAAI,iBAAiB,MAAM,YAAY,KAAK,WAAW,CACzD;EAEA,MAAM,aACJ,KAAK,aAAa,KAAK,eACnB,eAAe,IAAI,CAAC,CAAC,aACrB;EAEN,IAAI,YAAY;GACd,MAAM,SAAS,KAAK,KAAK,i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AK,aAAa,SAAS,GAAG;KAChC,KAAK,aAAa,MAAM;KACxB,MAAM,UAAU,KAAK,aAAa;KAElC,IAAI,SACF,KAAK,cAAc;KAGrB,OAAO;IACT;IAEA,OAAO;GACT;GAEA,OAAO;EACT;EAEA,MAAM,eAAe,cAAc,aAAa;EAEhD,IAAI,cAAc;GAChB,MAAM,EAAE,eAAe,eAAe,YAAY;GAElD,IAAI,YAAY;IACd,IAAI;IAEJ,IAAI,OAAO,KAAK,WAAW,YACzB,aAAa,KAAK,OAAO,YAAY;SAChC,IAAI,KAAK,QAAQ,YACtB,aAAa,KAAK,OAAO,WAAW,YAAY;IAGlD,IAAI,eAAe,WAAW,eAAe;KAC3C,IAAI,SAAS,YAAY,GACvB,KAAK,cAAc;KAGrB,OAAO;IACT;IAIA,MAAM,UAAU,KAAK,UAAU;IAE/B,IAAI,SACF,KAAK,cAAc;IAGrB,OAAO;GACT;GAEA,IAAI,SAAS,YAAY,GACvB,KAAK,cAAc;GAGrB,OAAO;EACT;EAEA,IAAI,KAAK,aAAa,SAAS,GAAG;GAChC,KAAK,aAAa,MAAM;GACxB,MAAM,UAAU,KAAK,aAAa;GAElC,IAAI,SACF,KAAK,cAAc;GAGrB,OAAO;EACT;EAEA,OAAO;CACT;;;;CAIA,cAAkC;EAIhC,OAAO;CACT;;;;CAIA,kBAAsC;EAIpC,OAAO;CACT;;;;CAIA,aAAiC;EAI/B,OAAO;CACT;AACF;;;;AAKA,SAAgB,uBACd,KACA,MACA,YACA,QACY;CACZ,IAAI,UAAU,GACZ,OAAO,IAAI,iBAAiB,KAAK,MAAM,YAAY,MAAM;CAG3D,OAAO,IAAI,iBAAiB,MAAM,YAAY,MAAM;AACtD"}
|
|
1
|
+
{"version":3,"file":"shadow-tree-walker.js","names":[],"sources":["../../../../src/utils/shadowdom/shadow-tree-walker.ts"],"sourcesContent":["/*\n * Derived from Adobe React Spectrum: packages/react-aria/src/utils/shadowdom/ShadowTreeWalker.ts.\n * Modified for Solid Aria: adapted hooks, reactive getters, DOM types, and imports for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport { shadowDOM } from \"@solid2-aria/stately/flags/flags\";\n\nimport { requireElement } from \"../dom-value\";\nimport { isTruthy } from \"../truthy\";\nimport { isShadowRoot } from \"../type-helpers\";\n// https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/ShadowTreeWalker.ts\nimport { nodeContains } from \"./dom-functions\";\n\nexport class ShadowTreeWalker implements TreeWalker {\n public readonly filter: NodeFilter | null;\n public readonly root: Node;\n public readonly whatToShow: number;\n private readonly _doc: Document;\n private _walkerStack: TreeWalker[] = [];\n private _currentNode: Node;\n private readonly _currentSetFor = new Set<TreeWalker>();\n constructor(\n doc: Document,\n root: Node,\n whatToShow?: number,\n filter?: NodeFilter | null\n ) {\n this._doc = doc;\n this.root = root;\n this.filter = filter ?? null;\n this.whatToShow = whatToShow ?? NodeFilter.SHOW_ALL;\n this._currentNode = root;\n this._walkerStack.unshift(\n doc.createTreeWalker(root, whatToShow, this._acceptNode)\n );\n\n const shadowRoot =\n root.nodeType === Node.ELEMENT_NODE\n ? requireElement(root).shadowRoot\n : null;\n\n if (shadowRoot) {\n const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, {\n acceptNode: this._acceptNode,\n });\n\n this._walkerStack.unshift(walker);\n }\n }\n private readonly _acceptNode = (node: Node): number => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n const { shadowRoot } = requireElement(node);\n\n if (shadowRoot) {\n const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, {\n acceptNode: this._acceptNode,\n });\n\n this._walkerStack.unshift(walker);\n\n return NodeFilter.FILTER_ACCEPT;\n }\n\n if (typeof this.filter === \"function\") {\n return this.filter(node);\n } else if (this.filter?.acceptNode) {\n return this.filter.acceptNode(node);\n } else if (this.filter === null) {\n return NodeFilter.FILTER_ACCEPT;\n }\n }\n\n return NodeFilter.FILTER_SKIP;\n };\n public get currentNode(): Node {\n return this._currentNode;\n }\n public set currentNode(node: Node) {\n if (!nodeContains(this.root, node)) {\n throw new Error(\n \"Cannot set currentNode to a node that is not contained by the root node.\"\n );\n }\n\n const walkers: TreeWalker[] = [];\n let curNode: Node | null | undefined = node;\n let currentWalkerCurrentNode = node;\n this._currentNode = node;\n\n while (curNode && curNode !== this.root) {\n if (isShadowRoot(curNode)) {\n const shadowRoot: ShadowRoot = curNode;\n\n const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, {\n acceptNode: this._acceptNode,\n });\n\n walkers.push(walker);\n walker.currentNode = currentWalkerCurrentNode;\n this._currentSetFor.add(walker);\n currentWalkerCurrentNode = shadowRoot.host;\n curNode = currentWalkerCurrentNode;\n } else {\n curNode = curNode.parentNode;\n }\n }\n\n const walker = this._doc.createTreeWalker(this.root, this.whatToShow, {\n acceptNode: this._acceptNode,\n });\n\n walkers.push(walker);\n walker.currentNode = currentWalkerCurrentNode;\n this._currentSetFor.add(walker);\n this._walkerStack = walkers;\n }\n public get doc(): Document {\n return this._doc;\n }\n public firstChild(): Node | null {\n const { currentNode } = this;\n const newNode = this.nextNode();\n\n if (!nodeContains(currentNode, newNode)) {\n this.currentNode = currentNode;\n\n return null;\n }\n\n if (newNode) {\n this.currentNode = newNode;\n }\n\n return newNode;\n }\n public lastChild(): Node | null {\n const [walker] = this._walkerStack;\n const newNode = walker?.lastChild() ?? null;\n\n if (newNode) {\n this.currentNode = newNode;\n }\n\n return newNode;\n }\n public nextNode(): Node | null {\n const nextNode = this._walkerStack[0]?.nextNode() ?? null;\n\n if (nextNode) {\n const { shadowRoot } = requireElement(nextNode);\n\n if (shadowRoot) {\n let nodeResult: number | undefined;\n\n if (typeof this.filter === \"function\") {\n nodeResult = this.filter(nextNode);\n } else if (this.filter?.acceptNode) {\n nodeResult = this.filter.acceptNode(nextNode);\n }\n\n if (nodeResult === NodeFilter.FILTER_ACCEPT) {\n this.currentNode = nextNode;\n\n return nextNode;\n }\n\n // _acceptNode should have added new walker for this shadow,\n // go in recursively.\n const newNode = this.nextNode();\n\n if (newNode) {\n this.currentNode = newNode;\n }\n\n return newNode;\n }\n\n if (isTruthy(nextNode)) {\n this.currentNode = nextNode;\n }\n\n return nextNode;\n }\n\n if (this._walkerStack.length > 1) {\n this._walkerStack.shift();\n const newNode = this.nextNode();\n\n if (newNode) {\n this.currentNode = newNode;\n }\n\n return newNode;\n }\n\n return null;\n }\n public previousNode(): Node | null {\n const [currentWalker] = this._walkerStack;\n\n if (!currentWalker) {\n return null;\n }\n\n if (currentWalker.currentNode === currentWalker.root) {\n if (this._currentSetFor.has(currentWalker)) {\n this._currentSetFor.delete(currentWalker);\n\n if (this._walkerStack.length > 1) {\n this._walkerStack.shift();\n const newNode = this.previousNode();\n\n if (newNode) {\n this.currentNode = newNode;\n }\n\n return newNode;\n }\n\n return null;\n }\n\n return null;\n }\n\n const previousNode = currentWalker.previousNode();\n\n if (previousNode) {\n const { shadowRoot } = requireElement(previousNode);\n\n if (shadowRoot) {\n let nodeResult: number | undefined;\n\n if (typeof this.filter === \"function\") {\n nodeResult = this.filter(previousNode);\n } else if (this.filter?.acceptNode) {\n nodeResult = this.filter.acceptNode(previousNode);\n }\n\n if (nodeResult === NodeFilter.FILTER_ACCEPT) {\n if (isTruthy(previousNode)) {\n this.currentNode = previousNode;\n }\n\n return previousNode;\n }\n\n // _acceptNode should have added new walker for this shadow,\n // go in recursively.\n const newNode = this.lastChild();\n\n if (newNode) {\n this.currentNode = newNode;\n }\n\n return newNode;\n }\n\n if (isTruthy(previousNode)) {\n this.currentNode = previousNode;\n }\n\n return previousNode;\n }\n\n if (this._walkerStack.length > 1) {\n this._walkerStack.shift();\n const newNode = this.previousNode();\n\n if (newNode) {\n this.currentNode = newNode;\n }\n\n return newNode;\n }\n\n return null;\n }\n /**\n * @deprecated\n */\n public nextSibling(): Node | null {\n // if (__DEV__) {\n // throw new Error(\"Method not implemented.\");\n // }\n return null;\n }\n /**\n * @deprecated\n */\n public previousSibling(): Node | null {\n // if (__DEV__) {\n // throw new Error(\"Method not implemented.\");\n // }\n return null;\n }\n /**\n * @deprecated\n */\n public parentNode(): Node | null {\n // if (__DEV__) {\n // throw new Error(\"Method not implemented.\");\n // }\n return null;\n }\n}\n\n/**\n * ShadowDOM safe version of document.createTreeWalker.\n */\nexport function createShadowTreeWalker(\n doc: Document,\n root: Node,\n whatToShow?: number,\n filter?: NodeFilter | null\n): TreeWalker {\n if (shadowDOM()) {\n return new ShadowTreeWalker(doc, root, whatToShow, filter);\n }\n\n return doc.createTreeWalker(root, whatToShow, filter);\n}\n"],"mappings":";;;;;;;;;;;AAcA,IAAa,mBAAb,MAAoD;CAClD;CACA;CACA;CACA;CACA,eAAqC,CAAC;CACtC;CACA,iCAAkC,IAAI,IAAgB;CACtD,YACE,KACA,MACA,YACA,QACA;EACA,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,SAAS,UAAU;EACxB,KAAK,aAAa,cAAc,WAAW;EAC3C,KAAK,eAAe;EACpB,KAAK,aAAa,QAChB,IAAI,iBAAiB,MAAM,YAAY,KAAK,WAAW,CACzD;EAEA,MAAM,aACJ,KAAK,aAAa,KAAK,eACnB,eAAe,IAAI,CAAC,CAAC,aACrB;EAEN,IAAI,YAAY;GACd,MAAM,SAAS,KAAK,KAAK,iBAAiB,YAAY,KAAK,YAAY,EACrE,YAAY,KAAK,YACnB,CAAC;GAED,KAAK,aAAa,QAAQ,MAAM;EAClC;CACF;CACA,eAAgC,SAAuB;EACrD,IAAI,KAAK,aAAa,KAAK,cAAc;GACvC,MAAM,EAAE,eAAe,eAAe,IAAI;GAE1C,IAAI,YAAY;IACd,MAAM,SAAS,KAAK,KAAK,iBAAiB,YAAY,KAAK,YAAY,EACrE,YAAY,KAAK,YACnB,CAAC;IAED,KAAK,aAAa,QAAQ,MAAM;IAEhC,OAAO,WAAW;GACpB;GAEA,IAAI,OAAO,KAAK,WAAW,YACzB,OA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,YAAY;IAGlD,IAAI,eAAe,WAAW,eAAe;KAC3C,IAAI,SAAS,YAAY,GACvB,KAAK,cAAc;KAGrB,OAAO;IACT;IAIA,MAAM,UAAU,KAAK,UAAU;IAE/B,IAAI,SACF,KAAK,cAAc;IAGrB,OAAO;GACT;GAEA,IAAI,SAAS,YAAY,GACvB,KAAK,cAAc;GAGrB,OAAO;EACT;EAEA,IAAI,KAAK,aAAa,SAAS,GAAG;GAChC,KAAK,aAAa,MAAM;GACxB,MAAM,UAAU,KAAK,aAAa;GAElC,IAAI,SACF,KAAK,cAAc;GAGrB,OAAO;EACT;EAEA,OAAO;CACT;;;;CAIA,cAAkC;EAIhC,OAAO;CACT;;;;CAIA,kBAAsC;EAIpC,OAAO;CACT;;;;CAIA,aAAiC;EAI/B,OAAO;CACT;AACF;;;;AAKA,SAAgB,uBACd,KACA,MACA,YACA,QACY;CACZ,IAAI,UAAU,GACZ,OAAO,IAAI,iBAAiB,KAAK,MAAM,YAAY,MAAM;CAG3D,OAAO,IAAI,iBAAiB,MAAM,YAAY,MAAM;AACtD"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
/*
|
|
13
|
+
* Derived from Adobe React Spectrum: packages/react-aria/src/utils/typeHelpers.ts.
|
|
14
|
+
* Modified for Solid Aria: adapted type guard narrowing and formatting for Solid 2.
|
|
15
|
+
* Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
|
|
16
|
+
*/
|
|
17
|
+
// src/utils/type-helpers.ts
|
|
18
|
+
/**
|
|
19
|
+
* Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType
|
|
20
|
+
* property.
|
|
21
|
+
*/
|
|
22
|
+
function isNode(value) {
|
|
23
|
+
return value !== null && typeof value === "object" && "nodeType" in value && typeof value.nodeType === "number";
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Type guard that checks if a value is a Window. Uses window self reference checks to
|
|
27
|
+
* distinguish Window from other values.
|
|
28
|
+
*/
|
|
29
|
+
function isWindow(value) {
|
|
30
|
+
return typeof value === "object" && value !== null && value !== void 0 && "window" in value && value.window === value;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Type guard that checks if a value is a Document. Uses nodeType and host property checks to
|
|
34
|
+
* distinguish Document from other values.
|
|
35
|
+
*/
|
|
36
|
+
function isDocument(value) {
|
|
37
|
+
return isNode(value) && value.nodeType === 9;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Type guard that checks if a value is a ShadowRoot. Uses nodeType and host property checks to
|
|
41
|
+
* distinguish ShadowRoot from other values.
|
|
42
|
+
*/
|
|
43
|
+
function isShadowRoot(value) {
|
|
44
|
+
return isNode(value) && value.nodeType === 11 && "host" in value;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Type guard that checks if a value is an Element. Uses nodeType checks to distinguish Element
|
|
48
|
+
* from other values.
|
|
49
|
+
*/
|
|
50
|
+
function isElement(value) {
|
|
51
|
+
return isNode(value) && value.nodeType === 1;
|
|
52
|
+
}
|
|
53
|
+
export { isDocument, isElement, isNode, isShadowRoot, isWindow };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=type-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-helpers.js","names":[],"sources":["../../../src/utils/type-helpers.ts"],"sourcesContent":["/*\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-aria/src/utils/typeHelpers.ts.\n * Modified for Solid Aria: adapted type guard narrowing and formatting for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\n/**\n * Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType\n * property.\n */\nexport function isNode<T>(value: T): value is T & Node {\n return (\n value !== null &&\n typeof value === \"object\" &&\n \"nodeType\" in value &&\n typeof value.nodeType === \"number\"\n );\n}\n\n/**\n * Type guard that checks if a value is a Window. Uses window self reference checks to\n * distinguish Window from other values.\n */\nexport function isWindow<T>(value: T): value is T & Window & typeof globalThis {\n return (\n typeof value === \"object\" &&\n value !== null &&\n value !== undefined &&\n \"window\" in value &&\n value.window === value\n );\n}\n\n/**\n * Type guard that checks if a value is a Document. Uses nodeType and host property checks to\n * distinguish Document from other values.\n */\nexport function isDocument<T>(value: T): value is T & Document {\n return isNode(value) && value.nodeType === 9;\n}\n\n/**\n * Type guard that checks if a value is a ShadowRoot. Uses nodeType and host property checks to\n * distinguish ShadowRoot from other values.\n */\nexport function isShadowRoot<T>(value: T): value is T & ShadowRoot {\n // 11 = DOCUMENT_FRAGMENT_NODE\n return isNode(value) && value.nodeType === 11 && \"host\" in value;\n}\n\n/**\n * Type guard that checks if a value is an Element. Uses nodeType checks to distinguish Element\n * from other values.\n */\nexport function isElement(value: unknown): value is Element {\n // 1 = ELEMENT_NODE\n return isNode(value) && value.nodeType === 1;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,SAAgB,OAAU,OAA6B;CACrD,OACE,UAAU,QACV,OAAO,UAAU,YACjB,cAAc,SACd,OAAO,MAAM,aAAa;AAE9B;;;;;AAMA,SAAgB,SAAY,OAAmD;CAC7E,OACE,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,KAAA,KACV,YAAY,SACZ,MAAM,WAAW;AAErB;;;;;AAMA,SAAgB,WAAc,OAAiC;CAC7D,OAAO,OAAO,KAAK,KAAK,MAAM,aAAa;AAC7C;;;;;AAMA,SAAgB,aAAgB,OAAmC;CAEjE,OAAO,OAAO,KAAK,KAAK,MAAM,aAAa,MAAM,UAAU;AAC7D;;;;;AAMA,SAAgB,UAAU,OAAkC;CAE1D,OAAO,OAAO,KAAK,KAAK,MAAM,aAAa;AAC7C"}
|
|
@@ -33,7 +33,9 @@ function ScrollView(props) {
|
|
|
33
33
|
return ssrElement("div", [{ role: "presentation" }, () => {
|
|
34
34
|
return aria.scrollViewProps;
|
|
35
35
|
}], () => {
|
|
36
|
-
return ssrElement("div",
|
|
36
|
+
return ssrElement("div", () => {
|
|
37
|
+
return aria.contentProps;
|
|
38
|
+
}, () => {
|
|
37
39
|
return scope(() => {
|
|
38
40
|
return escape(props.children);
|
|
39
41
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-view.js","names":["<div\n role=\"presentation\"\n {...aria.scrollViewProps}\n ref={[\n props.ref,\n (node) => {\n setRef(node);\n },\n ]}\n >\n <div {...aria.contentProps}>{props.children}</div>\n </div>","role=\"presentation\"","<div {...aria.contentProps}>{props.children}</div>","{props.children}","props.children","_$ssrElement","_$scope","_$escape"],"sources":["../../../src/virtualizer/scroll-view.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-aria/src/virtualizer/ScrollView.tsx.\n * Modified for Solid Aria: adapted components, imports, and reactive lifecycle for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport { Point } from \"@solid2-aria/stately/virtualizer/point\";\nimport { Rect } from \"@solid2-aria/stately/virtualizer/rect\";\nimport { Size } from \"@solid2-aria/stately/virtualizer/size\";\nimport { createEffect, createSignal, omit, onSettled, flush } from \"solid-js\";\nimport type { Accessor, Element as SolidElement } from \"solid-js\";\n\nimport { createLocale } from \"../i18n/i18n-provider\";\nimport type { CSSProperties, HTMLAttributes, Ref } from \"../types\";\nimport { createResizeObserver } from \"../utils/create-resize-observer\";\nimport { addEvent, getOwnerDocument } from \"../utils/dom-helpers\";\nimport { requireElement } from \"../utils/dom-value\";\nimport {\n getEventTarget,\n getPropagationTargets,\n nodeContains,\n} from \"../utils/shadowdom/dom-functions\";\nimport { isTruthy } from \"../utils/truthy\";\nimport { getScrollLeft } from \"./utils\";\n\nexport interface ScrollViewProps extends Omit<\n HTMLAttributes,\n \"onScroll\" | \"ref\" | \"style\"\n> {\n style?: CSSProperties;\n contentSize: Size;\n onVisibleRectChange: (rect: Rect) => void;\n onSizeChange?: (size: Size) => void;\n children?: SolidElement;\n innerStyle?: CSSProperties;\n onScrollStart?: () => void;\n onScrollEnd?: () => void;\n scrollDirection?: \"horizontal\" | \"vertical\" | \"both\";\n onScroll?: (event: Event) => void;\n allowsWindowScrolling?: boolean;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport function ScrollView(props: ScrollViewProps): SolidElement {\n const [ref, setRef] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const aria = createScrollView(props, ref);\n\n return (\n <div\n role=\"presentation\"\n {...aria.scrollViewProps}\n ref={[\n props.ref,\n (node) => {\n setRef(node);\n },\n ]}\n >\n <div {...aria.contentProps}>{props.children}</div>\n </div>\n );\n}\n\nexport interface ScrollViewAria {\n isScrolling: boolean;\n scrollViewProps: Omit<HTMLAttributes<HTMLDivElement>, \"ref\">;\n contentProps: Omit<HTMLAttributes<HTMLDivElement>, \"ref\">;\n}\n\nexport function createScrollView(\n props: ScrollViewProps,\n ref: Accessor<HTMLElement | null>\n): ScrollViewAria {\n const locale = createLocale();\n const [isScrolling, setScrolling] = createSignal(false);\n let measuredSize = new Size();\n const [size, setSize] = createSignal(measuredSize, { ownedWrite: true });\n\n interface ScrollViewState {\n isScrolling: boolean;\n lastVisibleRect: Rect;\n scrollEndTime: number;\n scrollPosition: Point;\n scrollTimeout: ReturnType<typeof setTimeout> | null;\n viewportOffset: Point;\n viewportSize: Size;\n }\n\n const state: ScrollViewState = {\n isScrolling: false,\n lastVisibleRect: new Rect(),\n scrollEndTime: 0,\n scrollPosition: new Point(),\n scrollTimeout: null,\n viewportOffset: new Point(),\n viewportSize: new Size(),\n };\n\n let updatingSize = false;\n\n const updateVisibleRect = () => {\n const dimensions = measuredSize;\n\n const rect = isTruthy(props.allowsWindowScrolling)\n ? new Rect(\n state.viewportOffset.x + state.scrollPosition.x,\n state.viewportOffset.y + state.scrollPosition.y,\n Math.max(\n 0,\n Math.min(\n dimensions.width - state.viewportOffset.x,\n state.viewportSize.width\n )\n ),\n Math.max(\n 0,\n Math.min(\n dimensions.height - state.viewportOffset.y,\n state.viewportSize.height\n )\n )\n )\n : new Rect(\n state.scrollPosition.x,\n state.scrollPosition.y,\n dimensions.width,\n dimensions.height\n );\n\n if (rect.area > 0 || state.lastVisibleRect.area > 0) {\n props.onVisibleRectChange(rect);\n state.lastVisibleRect = rect;\n }\n };\n\n const onScroll = (event: Event) => {\n const target = requireElement(getEventTarget(event));\n const element = ref();\n\n if (!element || !nodeContains(target, element)) {\n return;\n }\n\n if (target === element) {\n props.onScroll?.(event);\n state.scrollPosition = new Point(\n Math.max(\n 0,\n Math.min(\n getScrollLeft(target, locale.direction),\n props.contentSize.width - measuredSize.width\n )\n ),\n Math.max(\n 0,\n Math.min(\n target.scrollTop,\n props.contentSize.height - measuredSize.height\n )\n )\n );\n } else {\n const bounds = element.getBoundingClientRect();\n\n const x = Math.max(0, -bounds.x);\n const y = Math.max(0, -bounds.y);\n\n if (x === state.viewportOffset.x && y === state.viewportOffset.y) {\n return;\n }\n\n state.viewportOffset = new Point(x, y);\n }\n\n updateVisibleRect();\n\n if (!state.isScrolling) {\n state.isScrolling = true;\n setScrolling(true);\n window.dispatchEvent(new Event(\"tk.disconnect-observer\"));\n props.onScrollStart?.();\n }\n\n const now = Date.now();\n\n if (state.scrollEndTime <= now + 50) {\n state.scrollEndTime = now + 300;\n\n if (state.scrollTimeout !== null) {\n clearTimeout(state.scrollTimeout);\n }\n\n state.scrollTimeout = setTimeout(() => {\n state.isScrolling = false;\n setScrolling(false);\n state.scrollTimeout = null;\n window.dispatchEvent(new Event(\"tk.connect-observer\"));\n props.onScrollEnd?.();\n }, 300);\n }\n\n flush();\n };\n\n const updateSize = () => {\n const element = ref();\n\n if (!element || updatingSize) {\n return;\n }\n\n updatingSize = true;\n\n try {\n state.viewportSize = new Size(window.innerWidth, window.innerHeight);\n\n // Account for scrollbars appearing or disappearing in at most two passes.\n for (let pass = 0; pass < 2; pass += 1) {\n const next = new Size(element.clientWidth, element.clientHeight);\n const previous = measuredSize;\n\n if (pass > 0 && next.equals(previous)) {\n break;\n }\n\n measuredSize = next;\n setSize(next);\n props.onSizeChange?.(next);\n updateVisibleRect();\n }\n } finally {\n updatingSize = false;\n }\n };\n\n onSettled(() => {\n updateSize();\n\n const removeScroll = addEvent(\n getPropagationTargets(ref(), getOwnerDocument(ref())),\n \"scroll\",\n onScroll,\n true\n );\n\n window.addEventListener(\"resize\", updateSize);\n\n return () => {\n removeScroll();\n window.removeEventListener(\"resize\", updateSize);\n\n if (state.scrollTimeout !== null) {\n clearTimeout(state.scrollTimeout);\n }\n\n if (state.isScrolling) {\n window.dispatchEvent(new Event(\"tk.connect-observer\"));\n }\n };\n });\n createEffect(\n () => [props.contentSize.width, props.contentSize.height],\n () => {\n queueMicrotask(updateSize);\n }\n );\n createResizeObserver({ box: \"border-box\", onResize: updateSize, ref });\n\n const scrollViewProps: ScrollViewAria[\"scrollViewProps\"] = omit(\n props,\n \"contentSize\",\n \"onVisibleRectChange\",\n \"onSizeChange\",\n \"children\",\n \"innerStyle\",\n \"onScrollStart\",\n \"onScrollEnd\",\n \"scrollDirection\",\n \"onScroll\",\n \"allowsWindowScrolling\",\n \"ref\",\n \"style\"\n );\n\n Object.defineProperty(scrollViewProps, \"style\", {\n enumerable: true,\n get(): CSSProperties {\n const horizontal = props.scrollDirection === \"horizontal\";\n\n const vertical =\n props.scrollDirection === \"vertical\" ||\n props.contentSize.width === size().width;\n\n return {\n padding: 0,\n ...props.style,\n \"overflow-x\": !horizontal && vertical ? \"hidden\" : \"auto\",\n \"overflow-y\": horizontal ? \"hidden\" : \"auto\",\n };\n },\n });\n\n const contentProps: ScrollViewAria[\"contentProps\"] = {\n role: \"presentation\",\n get style(): CSSProperties {\n return {\n height: Number.isFinite(props.contentSize.height)\n ? `${props.contentSize.height}px`\n : undefined,\n \"pointer-events\": isScrolling() ? \"none\" : \"auto\",\n position: \"relative\",\n width: Number.isFinite(props.contentSize.width)\n ? `${props.contentSize.width}px`\n : undefined,\n ...props.innerStyle,\n };\n },\n };\n\n return {\n contentProps,\n get isScrolling() {\n return isScrolling();\n },\n scrollViewProps,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,SAAgB,WAAW,OAAsC;CAC/D,MAAM,CAAC,KAAK,UAAU,aAAoC,MAAM,EAC9D,YAAY,KACd,CAAC;CAED,MAAM,OAAO,iBAAiB,OAAO,GAAG;CAExC,OACEA,WAAAA,OAAAA,CAEE,EAD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M,YAAY,MAAM,IAC5C,GAAG,MAAM,YAAY,OAAO,MAC5B,KAAA;KACJ,kBAAkB,YAAY,IAAI,SAAS;KAC3C,UAAU;KACV,OAAO,OAAO,SAAS,MAAM,YAAY,KAAK,IAC1C,GAAG,MAAM,YAAY,MAAM,MAC3B,KAAA;KACJ,GAAG,MAAM;IACX;GACF;EAIA;EACA,IAAI,cAAc;GAChB,OAAO,YAAY;EACrB;EACA;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"scroll-view.js","names":["<div\n role=\"presentation\"\n {...aria.scrollViewProps}\n ref={[\n props.ref,\n (node) => {\n setRef(node);\n },\n ]}\n >\n <div {...aria.contentProps}>{props.children}</div>\n </div>","role=\"presentation\"","<div {...aria.contentProps}>{props.children}</div>","{props.children}","props.children","_$ssrElement","_$scope","_$escape"],"sources":["../../../src/virtualizer/scroll-view.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-aria/src/virtualizer/ScrollView.tsx.\n * Modified for Solid Aria: adapted components, imports, and reactive lifecycle for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport { Point } from \"@solid2-aria/stately/virtualizer/point\";\nimport { Rect } from \"@solid2-aria/stately/virtualizer/rect\";\nimport { Size } from \"@solid2-aria/stately/virtualizer/size\";\nimport { createEffect, createSignal, omit, onSettled, flush } from \"solid-js\";\nimport type { Accessor, Element as SolidElement } from \"solid-js\";\n\nimport { createLocale } from \"../i18n/i18n-provider\";\nimport type { CSSProperties, HTMLAttributes, Ref } from \"../types\";\nimport { createResizeObserver } from \"../utils/create-resize-observer\";\nimport { addEvent, getOwnerDocument } from \"../utils/dom-helpers\";\nimport { requireElement } from \"../utils/dom-value\";\nimport {\n getEventTarget,\n getPropagationTargets,\n nodeContains,\n} from \"../utils/shadowdom/dom-functions\";\nimport { isTruthy } from \"../utils/truthy\";\nimport { getScrollLeft } from \"./utils\";\n\nexport interface ScrollViewProps extends Omit<\n HTMLAttributes,\n \"onScroll\" | \"ref\" | \"style\"\n> {\n style?: CSSProperties;\n contentSize: Size;\n onVisibleRectChange: (rect: Rect) => void;\n onSizeChange?: (size: Size) => void;\n children?: SolidElement;\n innerStyle?: CSSProperties;\n onScrollStart?: () => void;\n onScrollEnd?: () => void;\n scrollDirection?: \"horizontal\" | \"vertical\" | \"both\";\n onScroll?: (event: Event) => void;\n allowsWindowScrolling?: boolean;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport function ScrollView(props: ScrollViewProps): SolidElement {\n const [ref, setRef] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const aria = createScrollView(props, ref);\n\n return (\n <div\n role=\"presentation\"\n {...aria.scrollViewProps}\n ref={[\n props.ref,\n (node) => {\n setRef(node);\n },\n ]}\n >\n <div {...aria.contentProps}>{props.children}</div>\n </div>\n );\n}\n\nexport interface ScrollViewAria {\n isScrolling: boolean;\n scrollViewProps: Omit<HTMLAttributes<HTMLDivElement>, \"ref\">;\n contentProps: Omit<HTMLAttributes<HTMLDivElement>, \"ref\">;\n}\n\nexport function createScrollView(\n props: ScrollViewProps,\n ref: Accessor<HTMLElement | null>\n): ScrollViewAria {\n const locale = createLocale();\n const [isScrolling, setScrolling] = createSignal(false);\n let measuredSize = new Size();\n const [size, setSize] = createSignal(measuredSize, { ownedWrite: true });\n\n interface ScrollViewState {\n isScrolling: boolean;\n lastVisibleRect: Rect;\n scrollEndTime: number;\n scrollPosition: Point;\n scrollTimeout: ReturnType<typeof setTimeout> | null;\n viewportOffset: Point;\n viewportSize: Size;\n }\n\n const state: ScrollViewState = {\n isScrolling: false,\n lastVisibleRect: new Rect(),\n scrollEndTime: 0,\n scrollPosition: new Point(),\n scrollTimeout: null,\n viewportOffset: new Point(),\n viewportSize: new Size(),\n };\n\n let updatingSize = false;\n\n const updateVisibleRect = () => {\n const dimensions = measuredSize;\n\n const rect = isTruthy(props.allowsWindowScrolling)\n ? new Rect(\n state.viewportOffset.x + state.scrollPosition.x,\n state.viewportOffset.y + state.scrollPosition.y,\n Math.max(\n 0,\n Math.min(\n dimensions.width - state.viewportOffset.x,\n state.viewportSize.width\n )\n ),\n Math.max(\n 0,\n Math.min(\n dimensions.height - state.viewportOffset.y,\n state.viewportSize.height\n )\n )\n )\n : new Rect(\n state.scrollPosition.x,\n state.scrollPosition.y,\n dimensions.width,\n dimensions.height\n );\n\n if (rect.area > 0 || state.lastVisibleRect.area > 0) {\n props.onVisibleRectChange(rect);\n state.lastVisibleRect = rect;\n }\n };\n\n const onScroll = (event: Event) => {\n const target = requireElement(getEventTarget(event));\n const element = ref();\n\n if (!element || !nodeContains(target, element)) {\n return;\n }\n\n if (target === element) {\n props.onScroll?.(event);\n state.scrollPosition = new Point(\n Math.max(\n 0,\n Math.min(\n getScrollLeft(target, locale.direction),\n props.contentSize.width - measuredSize.width\n )\n ),\n Math.max(\n 0,\n Math.min(\n target.scrollTop,\n props.contentSize.height - measuredSize.height\n )\n )\n );\n } else {\n const bounds = element.getBoundingClientRect();\n\n const x = Math.max(0, -bounds.x);\n const y = Math.max(0, -bounds.y);\n\n if (x === state.viewportOffset.x && y === state.viewportOffset.y) {\n return;\n }\n\n state.viewportOffset = new Point(x, y);\n }\n\n updateVisibleRect();\n\n if (!state.isScrolling) {\n state.isScrolling = true;\n setScrolling(true);\n window.dispatchEvent(new Event(\"tk.disconnect-observer\"));\n props.onScrollStart?.();\n }\n\n const now = Date.now();\n\n if (state.scrollEndTime <= now + 50) {\n state.scrollEndTime = now + 300;\n\n if (state.scrollTimeout !== null) {\n clearTimeout(state.scrollTimeout);\n }\n\n state.scrollTimeout = setTimeout(() => {\n state.isScrolling = false;\n setScrolling(false);\n state.scrollTimeout = null;\n window.dispatchEvent(new Event(\"tk.connect-observer\"));\n props.onScrollEnd?.();\n }, 300);\n }\n\n flush();\n };\n\n const updateSize = () => {\n const element = ref();\n\n if (!element || updatingSize) {\n return;\n }\n\n updatingSize = true;\n\n try {\n state.viewportSize = new Size(window.innerWidth, window.innerHeight);\n\n // Account for scrollbars appearing or disappearing in at most two passes.\n for (let pass = 0; pass < 2; pass += 1) {\n const next = new Size(element.clientWidth, element.clientHeight);\n const previous = measuredSize;\n\n if (pass > 0 && next.equals(previous)) {\n break;\n }\n\n measuredSize = next;\n setSize(next);\n props.onSizeChange?.(next);\n updateVisibleRect();\n }\n } finally {\n updatingSize = false;\n }\n };\n\n onSettled(() => {\n updateSize();\n\n const removeScroll = addEvent(\n getPropagationTargets(ref(), getOwnerDocument(ref())),\n \"scroll\",\n onScroll,\n true\n );\n\n window.addEventListener(\"resize\", updateSize);\n\n return () => {\n removeScroll();\n window.removeEventListener(\"resize\", updateSize);\n\n if (state.scrollTimeout !== null) {\n clearTimeout(state.scrollTimeout);\n }\n\n if (state.isScrolling) {\n window.dispatchEvent(new Event(\"tk.connect-observer\"));\n }\n };\n });\n createEffect(\n () => [props.contentSize.width, props.contentSize.height],\n () => {\n queueMicrotask(updateSize);\n }\n );\n createResizeObserver({ box: \"border-box\", onResize: updateSize, ref });\n\n const scrollViewProps: ScrollViewAria[\"scrollViewProps\"] = omit(\n props,\n \"contentSize\",\n \"onVisibleRectChange\",\n \"onSizeChange\",\n \"children\",\n \"innerStyle\",\n \"onScrollStart\",\n \"onScrollEnd\",\n \"scrollDirection\",\n \"onScroll\",\n \"allowsWindowScrolling\",\n \"ref\",\n \"style\"\n );\n\n Object.defineProperty(scrollViewProps, \"style\", {\n enumerable: true,\n get(): CSSProperties {\n const horizontal = props.scrollDirection === \"horizontal\";\n\n const vertical =\n props.scrollDirection === \"vertical\" ||\n props.contentSize.width === size().width;\n\n return {\n padding: 0,\n ...props.style,\n \"overflow-x\": !horizontal && vertical ? \"hidden\" : \"auto\",\n \"overflow-y\": horizontal ? \"hidden\" : \"auto\",\n };\n },\n });\n\n const contentProps: ScrollViewAria[\"contentProps\"] = {\n role: \"presentation\",\n get style(): CSSProperties {\n return {\n height: Number.isFinite(props.contentSize.height)\n ? `${props.contentSize.height}px`\n : undefined,\n \"pointer-events\": isScrolling() ? \"none\" : \"auto\",\n position: \"relative\",\n width: Number.isFinite(props.contentSize.width)\n ? `${props.contentSize.width}px`\n : undefined,\n ...props.innerStyle,\n };\n },\n };\n\n return {\n contentProps,\n get isScrolling() {\n return isScrolling();\n },\n scrollViewProps,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,SAAgB,WAAW,OAAsC;CAC/D,MAAM,CAAC,KAAK,UAAU,aAAoC,MAAM,EAC9D,YAAY,KACd,CAAC;CAED,MAAM,OAAO,iBAAiB,OAAO,GAAG;CAExC,OACEA,WAAAA,OAAAA,CAEE,EADAC,MAAAA,eACwB,SAApB;EAAK,OAAA,KAAA;CAAc,CAAA,SAFzB;EAUEC,OAAAA,WAAAA,aAAS;GAAK,OAAA,KAAA;EAAW,SAAzB;GAA4BC,OAAAA,YAAAA;IAACC,OAAAA,OAAAA,MAAM,QAAO;GAAC,CAAA;EAAM,GAAjD,KAAiD;CAC9C,GAXL,IAWK;AAET;AAQA,SAAgB,iBACd,OACA,KACgB;CAChB,MAAM,SAAS,aAAa;CAC5B,MAAM,CAAC,aAAa,gBAAgB,aAAa,KAAK;CACtD,IAAI,eAAe,IAAI,KAAK;CAC5B,MAAM,CAAC,MAAM,WAAW,aAAa,cAAc,EAAE,YAAY,KAAK,CAAC;CAYvE,MAAM,QAAyB;EAC7B,aAAa;EACb,iBAAiB,IAAI,KAAK;EAC1B,eAAe;EACf,gBAAgB,IAAI,MAAM;EAC1B,eAA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M,aAAa;GAGlC,IAAI,MAAM,aACR,OAAO,cAAc,IAAI,MAAM,qBAAqB,CAAC;EAEzD;CACF,CAAC;CACD,mBACQ,CAAC,MAAM,YAAY,OAAO,MAAM,YAAY,MAAM,SAClD;EACJ,eAAe,UAAU;CAC3B,CACF;CACA,qBAAqB;EAAE,KAAK;EAAc,UAAU;EAAY;CAAI,CAAC;CAErE,MAAM,kBAAqD,KACzD,OACA,eACA,uBACA,gBACA,YACA,cACA,iBACA,eACA,mBACA,YACA,yBACA,OACA,OACF;CAEA,OAAO,eAAe,iBAAiB,SAAS;EAC9C,YAAY;EACZ,MAAqB;GACnB,MAAM,aAAa,MAAM,oBAAoB;GAE7C,MAAM,WACJ,MAAM,oBAAoB,cAC1B,MAAM,YAAY,UAAU,KAAK,CAAC,CAAC;GAErC,OAAO;IACL,SAAS;IACT,GAAG,MAAM;IACT,cAAc,CAAC,cAAc,WAAW,WAAW;IACnD,cAAc,aAAa,WAAW;GACxC;EACF;CACF,CAAC;CAmBD,OAAO;EACL,cAAA;GAjBA,MAAM;GACN,IAAI,QAAuB;IACzB,OAAO;KACL,QAAQ,OAAO,SAAS,MAAM,YAAY,MAAM,IAC5C,GAAG,MAAM,YAAY,OAAO,MAC5B,KAAA;KACJ,kBAAkB,YAAY,IAAI,SAAS;KAC3C,UAAU;KACV,OAAO,OAAO,SAAS,MAAM,YAAY,KAAK,IAC1C,GAAG,MAAM,YAAY,MAAM,MAC3B,KAAA;KACJ,GAAG,MAAM;IACX;GACF;EAIA;EACA,IAAI,cAAc;GAChB,OAAO,YAAY;EACrB;EACA;CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solid2-aria/core",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"keywords": [
|
|
6
6
|
"solid",
|
|
@@ -1283,6 +1283,11 @@
|
|
|
1283
1283
|
"browser": "./dist/browser/utils/truthy.js",
|
|
1284
1284
|
"default": "./dist/server/utils/truthy.js"
|
|
1285
1285
|
},
|
|
1286
|
+
"./utils/type-helpers": {
|
|
1287
|
+
"types": "./dist/browser/utils/type-helpers.d.ts",
|
|
1288
|
+
"browser": "./dist/browser/utils/type-helpers.js",
|
|
1289
|
+
"default": "./dist/server/utils/type-helpers.js"
|
|
1290
|
+
},
|
|
1286
1291
|
"./virtualizer/create-virtualizer-item": {
|
|
1287
1292
|
"types": "./dist/browser/virtualizer/create-virtualizer-item.d.ts",
|
|
1288
1293
|
"browser": "./dist/browser/virtualizer/create-virtualizer-item.js",
|
|
@@ -1337,24 +1342,25 @@
|
|
|
1337
1342
|
"@internationalized/date": "^3.12.4",
|
|
1338
1343
|
"@internationalized/number": "^3.6.9",
|
|
1339
1344
|
"@internationalized/string": "^3.2.10",
|
|
1340
|
-
"@solid2-aria/stately": "^0.0
|
|
1341
|
-
"@solid2-aria/types-shared": "^0.0
|
|
1342
|
-
"@solid2-aria/types-shared-web": "^0.0
|
|
1345
|
+
"@solid2-aria/stately": "^0.1.0",
|
|
1346
|
+
"@solid2-aria/types-shared": "^0.1.0",
|
|
1347
|
+
"@solid2-aria/types-shared-web": "^0.1.0",
|
|
1343
1348
|
"aria-hidden": "^1.2.3",
|
|
1344
1349
|
"clsx": "^2.0.0"
|
|
1345
1350
|
},
|
|
1346
1351
|
"devDependencies": {
|
|
1347
|
-
"@solidjs/compiler": "^2.0.0
|
|
1348
|
-
"@solidjs/web": "^2.0.0
|
|
1352
|
+
"@solidjs/compiler": "^2.0.0",
|
|
1353
|
+
"@solidjs/web": "^2.0.0",
|
|
1349
1354
|
"@types/bun": "^1.4.4",
|
|
1350
1355
|
"happy-dom": "^21.0.4",
|
|
1351
|
-
"solid-
|
|
1356
|
+
"rolldown-plugin-solid-compiler": "^1.0.0",
|
|
1357
|
+
"solid-js": "^2.0.0",
|
|
1352
1358
|
"tsdown": "^0.23.2",
|
|
1353
|
-
"tsrs": "^
|
|
1359
|
+
"tsrs": "^7.1.0-beta.tsrs3",
|
|
1354
1360
|
"typescript": "^7.1.0-beta"
|
|
1355
1361
|
},
|
|
1356
1362
|
"peerDependencies": {
|
|
1357
|
-
"@solidjs/web": "^2.0.0
|
|
1358
|
-
"solid-js": "^2.0.0
|
|
1363
|
+
"@solidjs/web": "^2.0.0",
|
|
1364
|
+
"solid-js": "^2.0.0"
|
|
1359
1365
|
}
|
|
1360
1366
|
}
|