@vireo-ai/trellis-ui 0.1.50 → 0.1.52
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/package.json +6 -1
- package/packages/client/src/components/data-grid/styles.css +13 -10
- package/packages/client/src/components/import-flow/styles.css +20 -0
- package/packages/client/src/components/import-mapper/styles.css +8 -0
- package/packages/client/src/components/select/styles.css +19 -0
- package/packages/client/src/styles/components.css +2 -0
- package/packages/client/src/styles/generated-sources.css +1 -1
- package/packages/client/src/styles/theme-support.css +267 -0
- package/packages/client/src/styles/theme.css +1 -268
- package/packages/client/types/assets/full-runtime.generated.d.ts +1 -1
- package/packages/client/types/components/date-picker/contract.d.ts +15 -6
- package/packages/client/types/components/date-picker/machine.d.ts +4 -2
- package/packages/client/types/components/entry.generated.d.ts +2 -0
- package/packages/client/types/components/formset/contract.d.ts +10 -0
- package/packages/client/types/components/formset/entry.generated.d.ts +5 -0
- package/packages/client/types/components/formset/index.d.ts +41 -0
- package/packages/client/types/components/formset/machine.d.ts +22 -0
- package/packages/client/types/components/formset/runtime-docs.d.ts +2 -0
- package/packages/client/types/components/heading/contract.d.ts +4 -2
- package/packages/client/types/components/import-flow/contract.d.ts +13 -0
- package/packages/client/types/components/import-flow/index.d.ts +2 -0
- package/packages/client/types/components/import-mapper/entry.generated.d.ts +5 -0
- package/packages/client/types/components/import-mapper/index.d.ts +25 -0
- package/packages/client/types/components/runtime.d.ts +2 -0
- package/packages/client/types/components/select/contract.d.ts +1 -0
- package/packages/client/types/components/select/machine.d.ts +3 -0
- package/packages/client/types/components/text/contract.d.ts +4 -2
- package/packages/client/types/components/virtualizer/index.d.ts +4 -1
- package/packages/client/types/runtime/cursor-data-source.d.ts +19 -1
- package/packages/client/types/runtime/engine/stream.d.ts +1 -0
- package/packages/client/types/runtime/virtualizer-schema.d.ts +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.css +56 -12
- package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.min.css +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/build-metadata.json +393 -323
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/motion.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/sortable.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-motion-DQitxnHn.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-motion-BeZZfCbD.js.map → capability-motion-DQitxnHn.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-Dzv1zWaL.js +3 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-sortable-D5jfePOE.js.map → capability-sortable-Dzv1zWaL.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/core-DMbnlSdM.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{core-CGPV218r.js.map → core-DMbnlSdM.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/cursor-data-source-DvHNTjt1.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/cursor-data-source-DvHNTjt1.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BGqM-PEq.js → entry.generated-2QEJDMe-.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BGqM-PEq.js.map → entry.generated-2QEJDMe-.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BsJJMR1g.js → entry.generated-BB7wWQfT.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BsJJMR1g.js.map → entry.generated-BB7wWQfT.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-C07Tn0r-.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-C07Tn0r-.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-qYKh9MwP.js → entry.generated-C2gP0OfV.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-qYKh9MwP.js.map → entry.generated-C2gP0OfV.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CRj4-Ef1.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CRj4-Ef1.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-ByvN55ox.js → entry.generated-CirM6w9Q.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-ByvN55ox.js.map → entry.generated-CirM6w9Q.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DVk-PDBl.js → entry.generated-CvcufWkj.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DVk-PDBl.js.map → entry.generated-CvcufWkj.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D3w3QaSO.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D3w3QaSO.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DCLIvEtJ.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DCLIvEtJ.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-B3F9jaO_.js → entry.generated-DVQaci6w.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-B3F9jaO_.js.map → entry.generated-DVQaci6w.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D_FlEfdN.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D_FlEfdN.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-ZTRbQ10A.js → entry.generated-DvvVMsQo.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-ZTRbQ10A.js.map → entry.generated-DvvVMsQo.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry2.generated-QspMEPHx.js → entry.generated-QspMEPHx.js} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-QspMEPHx.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-Rx9NofFi.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-Rx9NofFi.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry2.generated-gxr2-89M.js → entry.generated-gxr2-89M.js} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-gxr2-89M.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-oz1RCU1b.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-oz1RCU1b.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-yg-lGtcT.js → entry.generated-payXlXhL.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-yg-lGtcT.js.map → entry.generated-payXlXhL.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-Cwv0HSDM.js → entry.generated-wEt8LYAv.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-Cwv0HSDM.js.map → entry.generated-wEt8LYAv.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-CpoK52gE.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-CpoK52gE.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-D1X0sDop.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-D1X0sDop.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-DXDHgDsN.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-DXDHgDsN.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-_UPpJlWp.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-_UPpJlWp.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{form-control-BkVb2Qed.js → form-control-DjbUb602.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/form-control-DjbUb602.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/morph-Cq3V_23_.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/morph-Cq3V_23_.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{motion-C3XtSJ4O.js → motion-BDQdr83d.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{motion-C3XtSJ4O.js.map → motion-BDQdr83d.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-SdoiMWig.js +4 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-SdoiMWig.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/accordion.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/checkbox.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/data-grid.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/date-picker.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/dropdown.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/file-upload.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/formset.js +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/import-mapper.js +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/index.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/index.js.map +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/input.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/modal.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/panels.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/radio.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/scroll-area.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/select.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/sidebar.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/slider.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/switch.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/table.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tabs.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/toast.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tooltip.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/virtualizer.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/core.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js.map +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/logical-entry-manifest.json +168 -126
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.js +8 -8
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.min.js +8 -8
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-motion-BeZZfCbD.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-D5jfePOE.js +0 -3
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/core-CGPV218r.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-6_ClPYhC.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-6_ClPYhC.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-B6Gjj1Mu.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-B6Gjj1Mu.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-By-7ucpB.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-By-7ucpB.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CvHs5hfG.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CvHs5hfG.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DFkEr0wI.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DFkEr0wI.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-N4M4QtmC.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-N4M4QtmC.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-Wl7imdNP.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-Wl7imdNP.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-qNEmG1Ht.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-qNEmG1Ht.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-Dzq4GSqn.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-Dzq4GSqn.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-QspMEPHx.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-gxr2-89M.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/form-control-BkVb2Qed.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-BHBokFNi.js +0 -4
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-BHBokFNi.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/virtualizer-CSk2RJEN.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/virtualizer-CSk2RJEN.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry.generated-N4M4QtmC.js","names":[],"sources":["../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@2.0.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/external/file.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@2.0.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-entering-window.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@2.0.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/external-adapter.js","../../../../../../../../client/src/components/file-upload/contract.ts","../../../../../../../../client/src/components/file-upload/machine.ts","../../../../../../../../client/src/components/file-upload/styles.ts","../../../../../../../../client/src/components/file-upload/index.ts","../../../../../../../../client/src/components/file-upload/entry.generated.ts"],"sourcesContent":["export function containsFiles(_ref) {\n var source = _ref.source;\n return source.types.includes('Files');\n}\n\n/** Obtain an array of the dragged `File`s */\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function getFiles(_ref2) {\n var source = _ref2.source;\n return source.items\n // unlike other media types, for files:\n // item.kind is 'file'\n // item.type is the type of file eg 'image/jpg'\n // for other media types, item.type is the mime format\n .filter(function (item) {\n return item.kind === 'file';\n }).map(function (item) {\n return item.getAsFile();\n }).filter(function (file) {\n return file != null;\n });\n}","import { isFirefox } from '../is-firefox';\nimport { isSafari } from '../is-safari';\nimport { isEnteringWindowInSafari } from './count-events-for-safari';\nimport { isFromAnotherWindow } from './is-from-another-window';\nexport function isEnteringWindow(_ref) {\n var dragEnter = _ref.dragEnter;\n var type = dragEnter.type,\n relatedTarget = dragEnter.relatedTarget;\n if (type !== 'dragenter') {\n return false;\n }\n if (isSafari()) {\n return isEnteringWindowInSafari({\n dragEnter: dragEnter\n });\n }\n\n // standard check\n if (relatedTarget == null) {\n return true;\n }\n\n /**\n * 🦊 Exception: `iframe` in Firefox (`125.0`)\n *\n * Case 1: parent `window` → child `iframe`\n * `relatedTarget` is the `iframe` element in the parent `window`\n * (foreign element)\n *\n * Case 2: child `iframe` → parent `window`\n * `relatedTarget` is an element inside the child `iframe`\n * (foreign element)\n */\n\n if (isFirefox()) {\n return isFromAnotherWindow(relatedTarget);\n }\n\n /**\n * 🌏 Exception: `iframe` in Chrome (`124.0`)\n *\n * Case 1: parent `window` → child `iframe`\n * `relatedTarget` is `null` *(standard check)*\n *\n * Case 2: child `iframe` → parent `window`\n * `relatedTarget` is the `iframe` element in the parent `window`\n */\n\n // Case 2\n // Using `instanceof` check as the element will be in the same `window`\n return relatedTarget instanceof HTMLIFrameElement;\n}","import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport { bind, bindAll } from 'bind-event-listener';\nimport { makeAdapter } from '../make-adapter/make-adapter';\nimport { androidFallbackText } from '../util/android';\nimport { isEnteringWindow } from '../util/changing-window/is-entering-window';\nimport { getBindingsForBrokenDrags } from '../util/detect-broken-drag';\nimport { textMediaType } from '../util/media-types/text-media-type';\nimport { elementAdapterNativeDataKey } from './element-adapter-native-data-key';\nexport function isAnAvailableType(_ref) {\n var type = _ref.type,\n value = _ref.value;\n // We don't want to expose our private elementAdapter key / value\n if (type === elementAdapterNativeDataKey) {\n return false;\n }\n // Not exposing \"text/plain\" if it contains the android fallback text\n // We _could_ add an `isAndroid()` check, but it's probably safest\n // to trim this data out, regardless of what OS we see it on.\n if (type === textMediaType && value === androidFallbackText) {\n return false;\n }\n return true;\n}\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function getAvailableTypes(transfer) {\n return Array.from(transfer.types).filter(function (type) {\n return isAnAvailableType({\n type: type,\n value: transfer.getData(type)\n });\n });\n}\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function getAvailableItems(dataTransfer) {\n // item.kind is 'string' | 'file'\n // For 'string' item.type is the mimeType (eg 'text/plain')\n // For 'file' item.type is the file type (eg 'image/jpg')\n\n return Array.from(dataTransfer.items).filter(function (item) {\n return item.kind === 'file' || isAnAvailableType({\n type: item.type,\n value: dataTransfer.getData(item.type)\n });\n });\n}\nvar didDragStartLocally = false;\nvar adapter = makeAdapter({\n typeKey: 'external',\n // for external drags, we are generally making a copy of something that is being dragged\n defaultDropEffect: 'copy',\n mount: function mount(api) {\n // Binding to the `window` so that the element adapter\n // has a chance to get in first on the`document`.\n // We are giving preference to the element adapter.\n return bind(window, {\n type: 'dragenter',\n listener: function listener(event) {\n // drag operation was started within the document, it won't be an \"external\" drag\n if (didDragStartLocally) {\n return;\n }\n\n // Note: not checking if event was cancelled (`event.defaultPrevented`) as\n // cancelling a \"dragenter\" accepts the drag operation (not prevent it)\n\n // Something has gone wrong with our drag event\n if (!event.dataTransfer) {\n // Including this code on \"test\" and \"development\" environments:\n // - Browser tests commonly run against \"development\" builds\n // - Unit tests commonly run in \"test\"\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(\"\\n It appears as though you have are not testing DragEvents correctly.\\n\\n - If you are unit testing, ensure you have polyfilled DragEvent.\\n - If you are browser testing, ensure you are dispatching drag events correctly.\\n\\n Please see our testing guides for more information:\\n https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing\\n \".replace(/ {2}/g, ''));\n }\n return;\n }\n if (!api.canStart(event)) {\n return;\n }\n if (!isEnteringWindow({\n dragEnter: event\n })) {\n return;\n }\n\n // Note: not checking types for `elementAdapterNativeDataKey` as we expect to see that\n // key when pdnd started the drag in another document\n var types = getAvailableTypes(event.dataTransfer);\n if (!types.length) {\n return;\n }\n var locked = {\n types: types,\n items: [],\n getStringData: function getStringData() {\n return null;\n }\n };\n api.start({\n event: event,\n dragType: {\n type: 'external',\n startedFrom: 'external',\n payload: locked,\n getDropPayload: function getDropPayload(event) {\n // this would be a platform error\n // trying to handle it gracefully rather than throwing (for now)\n if (!event.dataTransfer) {\n return locked;\n }\n var items = getAvailableItems(event.dataTransfer);\n // need to use `.bind` as `getData` is required\n // to be run with `event.dataTransfer` as the \"this\" context\n var nativeGetData = event.dataTransfer.getData.bind(event.dataTransfer);\n return {\n types: types,\n items: items,\n // return `null` if there is no result, otherwise string\n getStringData: function getStringData(mediaType) {\n // not dragging the requested type\n // return `null` (no result)\n if (!types.includes(mediaType)) {\n return null;\n }\n\n // nativeGetData will return `\"\"` when there is no value,\n // but at this point we know we will only get explicitly set\n // values back as we have checked the `types`.\n // `\"\"` can be an explicitly set value.\n var value = nativeGetData(mediaType);\n\n // not exposing data for unavailable types\n if (!isAnAvailableType({\n type: mediaType,\n value: value\n })) {\n return null;\n }\n return value;\n }\n };\n }\n }\n });\n }\n });\n }\n});\n\n/**\n * Some events don't make sense for the external adapter\n *\n * `onGenerateDragPreview`\n * The browser creates the drag preview for external drags, so we don't\n * need an event to generate the preview for _monitors_ or the _dropTarget_\n *\n * `onDragStart`\n * An external drag can never start from in the `window`, so _dropTarget_'s\n * don't need `onDragStart`\n */\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function dropTargetForExternal(args) {\n // not removing unused events, just leaning on the type system\n return adapter.dropTarget(args);\n}\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function monitorForExternal(args) {\n // not removing unused events, just leaning on the type system\n return adapter.monitor(args);\n}\n(function startup() {\n // server side rendering check\n if (typeof window === 'undefined') {\n return;\n }\n\n // A shared single usage registration as we want to capture\n // all external drag operations, even if there are no drop targets\n // on the page yet\n adapter.registerUsage();\n // independent of pdnd, we need to keep track of\n // all drag operations so that we can know if a drag operation\n // has started locally\n\n var idle = {\n type: 'idle'\n };\n var state = idle;\n function clear() {\n if (state.type !== 'dragging') {\n return;\n }\n didDragStartLocally = false;\n state.cleanup();\n state = idle;\n }\n function bindEndEvents() {\n return bindAll(window, [{\n type: 'dragend',\n listener: clear\n }].concat(_toConsumableArray(getBindingsForBrokenDrags({\n onDragEnd: clear\n }))),\n // we want to make sure we get all the events,\n // and this helps avoid not seeing events when folks stop\n // them later on the event path\n {\n capture: true\n });\n }\n\n // we always keep this event listener active\n bind(window, {\n type: 'dragstart',\n listener: function listener() {\n // something bad has happened if this is true!\n if (state.type !== 'idle') {\n return;\n }\n // set our global flag\n didDragStartLocally = true;\n state = {\n type: 'dragging',\n cleanup: bindEndEvents()\n };\n },\n // binding in the capture phase so these listeners are called\n // before our listeners in the adapters `mount` function\n options: {\n capture: true\n }\n });\n})();\n\n/** Common event payload for all events */\n\n/** A map containing payloads for all events */\n\n/** Common event payload for all drop target events */\n\n/** A map containing payloads for all events on drop targets */\n\n/** Arguments given to all feedback functions (eg `canDrop()`) on a `dropTargetForExternal` */\n\n/** Arguments given to all monitor feedback functions (eg `canMonitor()`) for a `monitorForExternal` */","import {attribute, bool, number, oneOf, string, type SchemaToProps} from '../../runtime';\n\nconst FILE_UPLOAD_LAYOUTS = ['stack', 'inline'] as const;\nconst FILE_UPLOAD_PREVIEWS = ['auto', 'image', 'none'] as const;\nconst FILE_UPLOAD_SIZES = ['sm', 'md', 'lg'] as const;\nconst FILE_UPLOAD_TRANSPORTS = ['native', 'direct'] as const;\n\ntype FileUploadLayout = (typeof FILE_UPLOAD_LAYOUTS)[number];\ntype FileUploadPreview = (typeof FILE_UPLOAD_PREVIEWS)[number];\ntype FileUploadSize = (typeof FILE_UPLOAD_SIZES)[number];\ntype FileUploadTransport = (typeof FILE_UPLOAD_TRANSPORTS)[number];\n\nconst fileUploadSchema = {\n name: string,\n accept: string,\n capture: string,\n multiple: bool,\n required: bool,\n disabled: bool,\n invalid: bool,\n preview: oneOf(FILE_UPLOAD_PREVIEWS, 'auto' as FileUploadPreview),\n layout: oneOf(FILE_UPLOAD_LAYOUTS, 'stack' as FileUploadLayout),\n size: oneOf(FILE_UPLOAD_SIZES, 'md' as FileUploadSize),\n heading: string.default('Drop files here or browse'),\n text: string,\n browseLabel: string,\n empty: attribute(string, 'empty-label'),\n maxItems: number.min(0).default(0),\n clearable: bool.default(true),\n transport: oneOf(FILE_UPLOAD_TRANSPORTS, 'native' as FileUploadTransport),\n rootClass: string,\n dropzoneClass: string,\n listClass: string,\n itemClass: string,\n class: string,\n};\n\nconst fileUploadDropzoneSchema = {\n heading: string.default('Drop files here or browse'),\n text: string,\n icon: string.default('cloud__upload'),\n layout: oneOf(FILE_UPLOAD_LAYOUTS, 'stack' as FileUploadLayout),\n size: oneOf(FILE_UPLOAD_SIZES, 'md' as FileUploadSize),\n disabled: bool,\n invalid: bool,\n class: string,\n};\n\nconst fileUploadListSchema = {\n class: string,\n};\n\nconst fileUploadItemSchema = {\n filename: string,\n filesize: string,\n mime: string,\n preview: string,\n icon: string.default('document__blank'),\n invalid: bool,\n error: string,\n class: string,\n};\n\nconst fileUploadRemoveSchema = {\n label: string.default('Remove file'),\n class: string,\n};\n\ntype FileUploadProps = SchemaToProps<typeof fileUploadSchema>;\n\nexport {\n FILE_UPLOAD_LAYOUTS,\n FILE_UPLOAD_PREVIEWS,\n FILE_UPLOAD_SIZES,\n FILE_UPLOAD_TRANSPORTS,\n fileUploadDropzoneSchema,\n fileUploadItemSchema,\n fileUploadListSchema,\n fileUploadRemoveSchema,\n fileUploadSchema,\n};\nexport type {\n FileUploadLayout,\n FileUploadPreview,\n FileUploadProps,\n FileUploadSize,\n FileUploadTransport,\n};\n","import {\n createMachine,\n type Machine,\n type MachineEventObject,\n type MachineScope,\n} from '../../runtime/state-machine';\nimport {defineHook, type TransitionHookDefinition} from '../../runtime/transition-coordinator';\nimport type {FileUploadProps} from './contract';\n\ntype FileSelectionSource = 'picker' | 'drop' | 'remove' | 'props' | 'clear';\ntype FileTransferStatus = 'selected' | 'uploading' | 'complete' | 'failed' | 'canceled';\n\ntype FileUploadMetadata = {\n id: string;\n name: string;\n bytes: number;\n size: string;\n type: string;\n};\n\ntype FileUploadRecord = FileUploadMetadata & {\n status: FileTransferStatus;\n progress: number;\n};\n\ntype FileUploadContext = {\n selection: {\n files: FileUploadMetadata[];\n limitReached: boolean;\n rejectedCount: number;\n limitRejectedCount: number;\n source: FileSelectionSource;\n };\n existing: {present: boolean; cleared: boolean};\n transfer: {\n status: 'native' | 'idle' | 'uploading' | 'complete' | 'failed' | 'canceled';\n activeIds: string[];\n progress: Record<string, number>;\n results: Record<string, Exclude<FileTransferStatus, 'selected' | 'uploading'>>;\n error: string;\n };\n};\n\ntype FileUploadMachineEffects = {\n commitSelection(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n reconcileSelection(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n resetSelection(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n syncProps(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n syncDragging(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n clearExisting(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n syncTransfer(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n emitComplete(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n emitError(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n emitCancel(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n};\n\ntype CreateFileUploadMachineOptions = {\n props: FileUploadProps;\n context: FileUploadContext;\n effects: FileUploadMachineEffects;\n};\n\ntype FileRecordsEvent = MachineEventObject & {\n records: FileUploadMetadata[];\n append?: boolean;\n source?: FileSelectionSource;\n};\n\nconst uploadingHook = defineHook({\n name: 'uploading',\n state: 'transfer.direct.uploading',\n project: (snapshot) => ({\n files: snapshot.context.selection.files.filter(({id}) => snapshot.context.transfer.activeIds.includes(id)),\n }),\n onDone: 'UPLOADING_DONE',\n onError: 'UPLOADING_ERROR',\n required: true,\n sends: {\n progress: (id: string, loaded: number, total: number) => ({type: 'UPLOAD_PROGRESS', id, loaded, total}),\n cancel: () => ({type: 'CANCEL_UPLOAD'}),\n },\n} satisfies TransitionHookDefinition<\n FileUploadContext,\n FileUploadProps,\n {files: FileUploadMetadata[]},\n 'uploading'\n>);\n\nconst fileUploadHooks = [uploadingHook] as const;\n\nconst recordsEvent = (event: MachineEventObject): FileRecordsEvent => event as FileRecordsEvent;\nconst eventSource = (event: MachineEventObject): FileSelectionSource => {\n const source = event.source;\n return source === 'picker' || source === 'drop' || source === 'remove' || source === 'props' ? source : 'clear';\n};\n\nconst acceptedByAccept = (file: FileUploadMetadata, accept: string): boolean => {\n const tokens = accept.split(',').map((token) => token.trim().toLowerCase()).filter(Boolean);\n if (tokens.length === 0) return true;\n const name = file.name.toLowerCase();\n const type = file.type.toLowerCase();\n return tokens.some((token) => {\n if (token.startsWith('.')) return name.endsWith(token);\n if (token.endsWith('/*')) return type.startsWith(token.slice(0, -1));\n return token.includes('/') && type === token;\n });\n};\n\nconst selectionPlan = (\n context: Readonly<FileUploadContext>,\n props: Readonly<FileUploadProps>,\n event: MachineEventObject,\n): FileUploadContext['selection'] => {\n const candidate = recordsEvent(event).records ?? [];\n const accepted = candidate.filter((file) => acceptedByAccept(file, props.accept));\n const base = recordsEvent(event).append && props.multiple ? [...context.selection.files] : [];\n const combined = props.multiple ? [...base, ...accepted] : accepted.slice(0, 1);\n const files = props.maxItems > 0 ? combined.slice(0, props.maxItems) : combined;\n return {\n files,\n limitReached: props.maxItems > 0 && files.length >= props.maxItems,\n rejectedCount: candidate.length - accepted.length + combined.length - files.length,\n limitRejectedCount: combined.length - files.length,\n source: eventSource(event),\n };\n};\n\nconst plannedFiles = ({context, props, event}: MachineScope<FileUploadContext, FileUploadProps>): FileUploadMetadata[] => (\n selectionPlan(context, props, event).files\n);\nconst planIsEmpty = (scope: MachineScope<FileUploadContext, FileUploadProps>): boolean => plannedFiles(scope).length === 0;\nconst planIsCapped = ({context, props, event}: MachineScope<FileUploadContext, FileUploadProps>): boolean => (\n selectionPlan(context, props, event).limitReached\n);\nconst canMutate = ({context, props}: MachineScope<FileUploadContext, FileUploadProps>): boolean => (\n !props.disabled && context.transfer.status !== 'uploading'\n);\nconst isDirect = ({props}: MachineScope<FileUploadContext, FileUploadProps>): boolean => props.transport === 'direct';\nconst isNative = ({props}: MachineScope<FileUploadContext, FileUploadProps>): boolean => props.transport === 'native';\nconst shouldUpload = (scope: MachineScope<FileUploadContext, FileUploadProps>): boolean => (\n isDirect(scope)\n && (eventSource(scope.event) === 'picker' || eventSource(scope.event) === 'drop')\n && plannedFiles(scope).length > 0\n);\n\nconst planSelection = ({context, props, event}: MachineScope<FileUploadContext, FileUploadProps>) => ({\n context: {selection: selectionPlan(context, props, event)},\n});\nconst clearSelection = ({context}: MachineScope<FileUploadContext, FileUploadProps>) => ({\n context: {selection: {...context.selection, files: [], limitReached: false, rejectedCount: 0, limitRejectedCount: 0, source: 'clear' as const}},\n});\nconst beginUpload = ({context, props, event}: MachineScope<FileUploadContext, FileUploadProps>) => {\n const files = selectionPlan(context, props, event).files;\n const previousIds = new Set(context.selection.files.map(({id}) => id));\n const activeIds = recordsEvent(event).append ? files.filter(({id}) => !previousIds.has(id)).map(({id}) => id) : files.map(({id}) => id);\n return {context: {transfer: {\n ...context.transfer,\n status: 'uploading' as const,\n activeIds,\n progress: {...context.transfer.progress, ...Object.fromEntries(activeIds.map((id) => [id, 0]))},\n error: '',\n }}};\n};\nconst setTransferStatus = (\n context: Readonly<FileUploadContext>,\n status: 'native' | 'idle' | 'complete' | 'failed' | 'canceled',\n error = '',\n): FileUploadContext['transfer'] => ({...context.transfer, status, error});\nconst finishUpload = ({context}: MachineScope<FileUploadContext, FileUploadProps>) => ({context: {transfer: {\n ...setTransferStatus(context, 'complete'),\n progress: {...context.transfer.progress, ...Object.fromEntries(context.transfer.activeIds.map((id) => [id, 1]))},\n results: {...context.transfer.results, ...Object.fromEntries(context.transfer.activeIds.map((id) => [id, 'complete' as const]))},\n}}});\nconst failUpload = ({context, event}: MachineScope<FileUploadContext, FileUploadProps>) => ({context: {transfer: {\n ...setTransferStatus(context, 'failed', event.error instanceof Error ? event.error.message : String(event.error ?? 'Upload failed.')),\n results: {...context.transfer.results, ...Object.fromEntries(context.transfer.activeIds.map((id) => [id, 'failed' as const]))},\n}}});\nconst cancelUpload = ({context}: MachineScope<FileUploadContext, FileUploadProps>) => ({context: {transfer: {\n ...setTransferStatus(context, 'canceled'),\n results: {...context.transfer.results, ...Object.fromEntries(context.transfer.activeIds.map((id) => [id, 'canceled' as const]))},\n}}});\nconst updateProgress = ({context, event}: MachineScope<FileUploadContext, FileUploadProps>) => {\n const id = typeof event.id === 'string' ? event.id : '';\n if (!context.transfer.activeIds.includes(id)) return;\n const loaded = Number(event.loaded);\n const total = Number(event.total);\n const progress = Number.isFinite(loaded) && Number.isFinite(total) && total > 0 ? Math.min(1, Math.max(0, loaded / total)) : 0;\n return {context: {transfer: {...context.transfer, progress: {...context.transfer.progress, [id]: progress}}}};\n};\n\nconst canMutateToEmpty = (scope: MachineScope<FileUploadContext, FileUploadProps>): boolean => canMutate(scope) && planIsEmpty(scope);\nconst canMutateToCapped = (scope: MachineScope<FileUploadContext, FileUploadProps>): boolean => canMutate(scope) && planIsCapped(scope);\n\nconst inventoryTransitions = (effect: 'commitSelection' | 'reconcileSelection') => [\n {target: '#inventory-empty', guard: canMutateToEmpty, reduce: 'planSelection', effects: effect},\n {target: '#inventory-capped', guard: canMutateToCapped, reduce: 'planSelection', effects: effect},\n {target: '#inventory-populated', guard: canMutate, reduce: 'planSelection', effects: effect},\n];\n\nconst createFileUploadMachine = ({props, context, effects}: CreateFileUploadMachineOptions): Machine<FileUploadContext, FileUploadProps> => createMachine<FileUploadContext, FileUploadProps>({\n type: 'parallel',\n on: {PROPS_CHANGED: {reduce: 'replaceProps', effects: 'syncProps'}},\n states: {\n interaction: {\n initial: 'idle',\n states: {\n idle: {on: {DRAG_ENTER: {target: 'dragging', guard: canMutate, effects: 'syncDragging'}}},\n dragging: {tags: ['dragging'], on: {\n DRAG_LEAVE: {target: 'idle', effects: 'syncDragging'},\n DROP: {target: 'idle', effects: 'syncDragging'},\n RECONCILE: {target: 'idle', guard: ({props: currentProps}) => currentProps.disabled, effects: 'syncDragging'},\n }},\n },\n },\n inventory: {\n initial: 'empty',\n on: {\n FILES_CHANGED: inventoryTransitions('commitSelection'),\n RECONCILE: inventoryTransitions('reconcileSelection'),\n FILES_RESET: {target: '#inventory-empty', guard: canMutate, reduce: 'clearSelection', effects: 'resetSelection'},\n CLEAR_EXISTING: {guard: canMutate, reduce: 'clearExisting', effects: 'clearExisting'},\n },\n states: {\n empty: {id: 'inventory-empty', tags: ['empty']},\n populated: {id: 'inventory-populated', tags: ['has-files']},\n capped: {id: 'inventory-capped', tags: ['has-files', 'limit-reached']},\n },\n },\n transfer: {\n initial: 'inactive',\n states: {\n inactive: {on: {\n RECONCILE: [{target: '#transfer-direct-idle', guard: isDirect, reduce: 'setDirectIdle', effects: 'syncTransfer'}, {target: '#transfer-native', reduce: 'setNative', effects: 'syncTransfer'}],\n }},\n native: {id: 'transfer-native', on: {\n RECONCILE: {target: '#transfer-direct-idle', guard: isDirect, reduce: 'setDirectIdle', effects: 'syncTransfer'},\n }},\n direct: {\n initial: 'idle',\n on: {RECONCILE: {target: '#transfer-native', guard: isNative, reduce: 'setNative', effects: 'syncTransfer'}},\n states: {\n idle: {id: 'transfer-direct-idle', on: {FILES_CHANGED: {target: 'uploading', guard: shouldUpload, reduce: 'beginUpload', effects: 'syncTransfer'}}},\n uploading: {id: 'transfer-uploading', tags: ['uploading'], on: {\n UPLOAD_PROGRESS: {reduce: 'updateProgress', effects: 'syncTransfer'},\n UPLOADING_DONE: {target: 'complete', reduce: 'finishUpload', effects: ['syncTransfer', 'emitComplete']},\n UPLOADING_ERROR: {target: 'failed', reduce: 'failUpload', effects: ['syncTransfer', 'emitError']},\n CANCEL_UPLOAD: {target: 'canceled', reduce: 'cancelUpload', effects: ['syncTransfer', 'emitCancel']},\n RECONCILE: {target: 'canceled', guard: ({props: currentProps}) => currentProps.disabled || currentProps.transport !== 'direct', reduce: 'cancelUpload', effects: ['syncTransfer', 'emitCancel']},\n }},\n complete: {on: {FILES_CHANGED: {target: 'uploading', guard: shouldUpload, reduce: 'beginUpload', effects: 'syncTransfer'}}},\n failed: {tags: ['upload-failed'], on: {\n RETRY_UPLOAD: {target: 'uploading', reduce: 'retryUpload', effects: 'syncTransfer'},\n FILES_CHANGED: {target: 'uploading', guard: shouldUpload, reduce: 'beginUpload', effects: 'syncTransfer'},\n }},\n canceled: {on: {\n RETRY_UPLOAD: {target: 'uploading', reduce: 'retryUpload', effects: 'syncTransfer'},\n FILES_CHANGED: {target: 'uploading', guard: shouldUpload, reduce: 'beginUpload', effects: 'syncTransfer'},\n }},\n },\n },\n },\n },\n },\n}, {\n context,\n props,\n reducers: {\n replaceProps: ({event, props: currentProps}) => ({props: event.props as FileUploadProps ?? currentProps}),\n planSelection,\n clearSelection,\n clearExisting: ({context: current}) => ({context: {existing: {...current.existing, cleared: true}}}),\n beginUpload,\n retryUpload: ({context: current}) => ({context: {transfer: {...current.transfer, status: 'uploading', error: '', activeIds: current.selection.files.filter(({id}) => current.transfer.results[id] !== 'complete').map(({id}) => id)}}}),\n finishUpload,\n failUpload,\n cancelUpload,\n updateProgress,\n setNative: ({context: current}) => ({context: {transfer: setTransferStatus(current, 'native')}}),\n setDirectIdle: ({context: current}) => ({context: {transfer: setTransferStatus(current, 'idle')}}),\n },\n effects: {\n commitSelection: effects.commitSelection,\n reconcileSelection: effects.reconcileSelection,\n resetSelection: effects.resetSelection,\n syncProps: effects.syncProps,\n syncDragging: effects.syncDragging,\n clearExisting: effects.clearExisting,\n syncTransfer: effects.syncTransfer,\n emitComplete: effects.emitComplete,\n emitError: effects.emitError,\n emitCancel: effects.emitCancel,\n },\n});\n\nconst recordsFromSnapshot = (context: Readonly<FileUploadContext>): FileUploadRecord[] => context.selection.files.map((file) => ({\n ...file,\n status: context.transfer.activeIds.includes(file.id) && context.transfer.status === 'uploading'\n ? 'uploading'\n : context.transfer.results[file.id] ?? 'selected',\n progress: context.transfer.progress[file.id] ?? 0,\n}));\n\nexport {createFileUploadMachine, fileUploadHooks, recordsFromSnapshot};\nexport type {\n CreateFileUploadMachineOptions,\n FileSelectionSource,\n FileTransferStatus,\n FileUploadContext,\n FileUploadMachineEffects,\n FileUploadMetadata,\n FileUploadRecord,\n};\n","import {defineStyles} from '../../runtime';\n\nconst fileUploadStyles = defineStyles({definition: {\n component: 'ui.file-upload',\n parts: {\n root: {\n base: [\n 'grid w-full min-w-0 gap-3',\n ],\n },\n control: {\n base: 'relative grid min-w-0 gap-3',\n },\n input: {\n base: 'sr-only',\n },\n dropzone: {\n base: [\n 'relative grid min-w-0 overflow-hidden rounded-surface-md text-inherit outline-none',\n ],\n variants: {\n layout: {\n stack: 'justify-items-center text-center',\n inline: 'grid-cols-[auto_minmax(0,1fr)_auto] items-center text-left',\n },\n size: {\n sm: 'gap-2 p-3',\n md: 'gap-3 p-4',\n lg: 'gap-3 p-5',\n },\n },\n defaults: {\n layout: 'stack',\n size: 'md',\n },\n },\n icon: {\n base: 'size-icon-lg shrink-0 fill-current text-surface-ink-muted',\n },\n body: {\n base: 'grid min-w-0 gap-1',\n },\n heading: {\n base: 'text-sm font-medium text-inherit',\n },\n text: {\n base: 'text-xs font-normal text-surface-ink-muted',\n },\n browse: {\n base: [\n 'inline-flex min-w-0 items-center justify-center rounded-control-md px-2 py-1 text-xs font-medium',\n ],\n },\n list: {\n base: 'grid min-w-0 gap-2',\n },\n empty: {\n base: 'text-xs text-surface-ink-muted',\n },\n item: {\n base: [\n 'grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 rounded-surface-sm px-3 py-2',\n ],\n },\n preview: {\n base: 'flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-surface-xs bg-interaction-hover text-surface-ink-muted',\n },\n previewImage: {\n base: 'size-full',\n },\n itemIcon: {\n base: 'size-icon fill-current',\n },\n itemBody: {\n base: 'grid min-w-0 gap-0.5',\n },\n itemName: {\n base: 'truncate text-sm font-medium text-inherit',\n },\n itemMeta: {\n base: 'truncate text-xs font-normal text-surface-ink-muted',\n },\n itemError: {\n base: 'truncate text-xs font-normal text-intent-danger-text',\n },\n remove: {\n base: [\n 'relative z-20 inline-flex size-control-sm shrink-0 items-center justify-center rounded-control-md border-0 bg-transparent',\n 'text-surface-ink-muted outline-none',\n ],\n },\n removeIcon: {\n base: 'size-icon-xs fill-current leading-none',\n },\n clear: {\n base: 'sr-only',\n },\n },\n}});\n\nexport {fileUploadStyles};\n","import {containsFiles, getFiles} from '@atlaskit/pragmatic-drag-and-drop/external/file';\nimport {dropTargetForExternal, monitorForExternal, type ExternalDropTargetEventPayloadMap} from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\nimport type Alpine from 'alpinejs';\n\nimport {\n createAlpineMachine,\n defineAlpineData,\n type AlpineMachine,\n type TransitionForHook,\n type TrellisAlpineComponent,\n} from '@client/runtime';\nimport {syncControlPresence, syncNativeControl} from '@client/runtime/form-control';\nimport {resolveStyle} from '@client/runtime/styles';\nimport {addListener, dispatch, setPresence, type CleanupStack} from '@client/utils';\nimport {fileUploadSchema, type FileUploadProps} from './contract';\nimport {\n createFileUploadMachine,\n fileUploadHooks,\n recordsFromSnapshot,\n type FileSelectionSource,\n type FileTransferStatus,\n type FileUploadContext,\n type FileUploadMetadata,\n type FileUploadRecord,\n} from './machine';\nimport {fileUploadStyles} from './styles';\n\ntype FileUploadTransitionName = (typeof fileUploadHooks)[number]['name'];\ntype FileUploadTransition<TName extends FileUploadTransitionName = FileUploadTransitionName> = TransitionForHook<\n Extract<(typeof fileUploadHooks)[number], {name: TName}>,\n HTMLElement\n>;\n\n/**\n * Public Alpine API for `ui.file-upload`.\n *\n * @public\n */\ninterface UiFileUploadApi {\n /** Serializable metadata for the current pending or transferred files. */\n readonly files: readonly FileUploadRecord[];\n /** Whether pending or existing file content is present. */\n readonly hasFiles: boolean;\n /** Whether an external file is over the drop target. */\n readonly isDragging: boolean;\n /** Whether the direct transport hook is pending. */\n readonly isUploading: boolean;\n /** Whether the configured client-side item limit is full. */\n readonly isLimitReached: boolean;\n /** Opens the native file picker when interaction is available. */\n browse(): void;\n /** Removes a pending file by its stable record id. */\n remove(id: string): void;\n /** Retries failed or canceled direct-upload records. */\n retry(): void;\n /** Cancels the active direct-upload batch. */\n cancel(): void;\n /** Returns the original browser File for transport code without cloning it. */\n file(id: string): File | null;\n /** Returns a component-managed preview URL when the selected file is previewable. */\n preview(id: string): string | null;\n}\n\ntype FileUploadData = AlpineMachine<FileUploadContext, FileUploadProps, typeof fileUploadHooks> & UiFileUploadApi & {\n init(): void;\n destroy(): void;\n};\n\nconst formatBytes = (bytes: number): string => {\n if (bytes === 0) return '0 B';\n const units = ['B', 'KB', 'MB', 'GB'];\n const unitIndex = Math.min(Math.floor(Math.log(bytes) / Math.log(1024)), units.length - 1);\n const value = bytes / (1024 ** unitIndex);\n const display = value >= 10 || unitIndex === 0 ? Math.round(value) : Number(value.toFixed(1));\n return `${display} ${units[unitIndex]}`;\n};\n\nconst filesFromList = (list: FileList | null): File[] => list ? Array.from(list) : [];\nconst isImageFile = (file: File): boolean => file.type.startsWith('image/');\nconst canPreviewFile = (file: File, preview: FileUploadProps['preview']): boolean => preview !== 'none' && (preview === 'image' || isImageFile(file));\n\nconst toFileList = (files: File[]): FileList | null => {\n if (typeof DataTransfer === 'undefined') return null;\n const transfer = new DataTransfer();\n files.forEach((file) => transfer.items.add(file));\n return transfer.files;\n};\n\nconst setInputFiles = (input: HTMLInputElement, files: File[]): boolean => {\n const list = toFileList(files);\n if (!list) return false;\n try {\n input.files = list;\n return true;\n } catch {\n return false;\n }\n};\n\nconst iconSvg = (pathData: string, className: string): SVGSVGElement => {\n const namespace = 'http://www.w3.org/2000/svg';\n const icon = document.createElementNS(namespace, 'svg');\n const path = document.createElementNS(namespace, 'path');\n icon.setAttribute('viewBox', '0 0 32 32');\n icon.setAttribute('aria-hidden', 'true');\n icon.setAttribute('class', className);\n path.setAttribute('d', pathData);\n icon.append(path);\n return icon;\n};\n\nconst closeIcon = (className: string): SVGSVGElement => {\n const namespace = 'http://www.w3.org/2000/svg';\n const icon = document.createElementNS(namespace, 'svg');\n const polygon = document.createElementNS(namespace, 'polygon');\n icon.setAttribute('viewBox', '0 0 32 32');\n icon.setAttribute('aria-hidden', 'true');\n icon.setAttribute('class', className);\n polygon.setAttribute('points', '17.4141 16 24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16');\n icon.append(polygon);\n return icon;\n};\n\nconst UiFileUpload = (): TrellisAlpineComponent<FileUploadData> => {\n let rootEl: (HTMLElement & Alpine.ElementWithXAttributes) | null = null;\n let cleanup: CleanupStack = [];\n let ignoreNativeChange = false;\n let fileSequence = 0;\n const rawFiles = new Map<string, File>();\n const previewUrls = new Map<string, string>();\n\n const root = (): HTMLElement => {\n if (!rootEl) throw new Error('File upload has not been initialized.');\n return rootEl;\n };\n const input = (): HTMLInputElement => {\n const control = root().querySelector<HTMLInputElement>('[data-ui-file-upload-input]');\n if (!control) throw new Error('File upload requires a native file input.');\n return control;\n };\n const dropzone = (): HTMLElement | null => root().querySelector<HTMLElement>('[data-ui-file-upload-dropzone]');\n const list = (): HTMLElement | null => root().querySelector<HTMLElement>('[data-ui-file-upload-list]');\n const currentProps = (): Readonly<FileUploadProps> => bridge.getSnapshot().props;\n const currentContext = (): Readonly<FileUploadContext> => bridge.getSnapshot().context;\n\n const metadataFor = (file: File): FileUploadMetadata => ({\n id: `file-${++fileSequence}`,\n name: file.name,\n bytes: file.size,\n size: formatBytes(file.size),\n type: file.type || 'File',\n });\n const registerFiles = (files: File[]): FileUploadMetadata[] => files.map((file) => {\n const metadata = metadataFor(file);\n rawFiles.set(metadata.id, file);\n return metadata;\n });\n const revokePreview = (id: string): void => {\n const url = previewUrls.get(id);\n if (url) URL.revokeObjectURL(url);\n previewUrls.delete(id);\n };\n const previewFor = (id: string): string | null => {\n const file = rawFiles.get(id);\n if (!file || !canPreviewFile(file, currentProps().preview)) return null;\n const existing = previewUrls.get(id);\n if (existing) return existing;\n const url = URL.createObjectURL(file);\n previewUrls.set(id, url);\n return url;\n };\n const dispatchNativeChange = (): void => {\n if (currentProps().transport === 'direct') return;\n ignoreNativeChange = true;\n input().dispatchEvent(new Event('input', {bubbles: true}));\n input().dispatchEvent(new Event('change', {bubbles: true}));\n };\n const sendFiles = (records: FileUploadMetadata[], source: FileSelectionSource, append = false): void => {\n if (currentProps().disabled || bridge.hasTag('uploading')) return;\n bridge.send({type: 'FILES_CHANGED', records, source, append});\n };\n\n const renderFiles = (context: Readonly<FileUploadContext>, props: Readonly<FileUploadProps>): void => {\n const container = list();\n if (!container) return;\n container.querySelectorAll('[data-ui-file-upload-pending]').forEach((item) => item.remove());\n const records = recordsFromSnapshot(context);\n const selectedIds = new Set(records.map(({id}) => id));\n [...previewUrls.keys()].filter((id) => !selectedIds.has(id)).forEach(revokePreview);\n [...rawFiles.keys()].filter((id) => !selectedIds.has(id)).forEach((id) => rawFiles.delete(id));\n const existing = container.querySelector<HTMLElement>('[data-existing-file]:not([hidden])');\n const empty = container.querySelector<HTMLElement>('[data-ui-file-upload-empty]');\n if (empty) empty.hidden = records.length > 0 || Boolean(existing);\n\n const itemClass = resolveStyle({part: fileUploadStyles.parts.item, className: props.itemClass});\n const previewClass = resolveStyle({part: fileUploadStyles.parts.preview});\n const imageClass = resolveStyle({part: fileUploadStyles.parts.previewImage});\n const bodyClass = resolveStyle({part: fileUploadStyles.parts.itemBody});\n const nameClass = resolveStyle({part: fileUploadStyles.parts.itemName});\n const metaClass = resolveStyle({part: fileUploadStyles.parts.itemMeta});\n const removeClass = resolveStyle({part: fileUploadStyles.parts.remove});\n const removeIconClass = resolveStyle({part: fileUploadStyles.parts.removeIcon});\n const itemIconClass = resolveStyle({part: fileUploadStyles.parts.itemIcon});\n\n records.forEach((record) => {\n const item = document.createElement('li');\n item.dataset.uiFileUploadItem = '';\n item.dataset.uiFileUploadPending = '';\n item.dataset.fileId = record.id;\n item.dataset.status = record.status;\n item.dataset.progress = String(record.progress);\n item.className = itemClass;\n\n const preview = document.createElement('span');\n preview.dataset.uiFileUploadPreview = '';\n preview.className = previewClass;\n preview.setAttribute('aria-hidden', 'true');\n const url = previewFor(record.id);\n if (url) {\n const image = document.createElement('img');\n image.src = url;\n image.alt = '';\n image.loading = 'lazy';\n image.decoding = 'async';\n image.className = `outline outline-1 -outline-offset-1 outline-black/10 dark:outline-white/10 block size-full object-cover ${imageClass}`;\n preview.append(image);\n } else {\n preview.append(iconSvg('M25.7,9.3l-7-7A.9078.9078,0,0,0,18,2H8A2.0059,2.0059,0,0,0,6,4V28a2.0059,2.0059,0,0,0,2,2H24a2.0059,2.0059,0,0,0,2-2V10A.9078.9078,0,0,0,25.7,9.3ZM18,4.4,23.6,10H18ZM24,28H8V4h8v6a2.0059,2.0059,0,0,0,2,2h6Z', itemIconClass));\n }\n\n const body = document.createElement('span');\n body.className = bodyClass;\n const name = document.createElement('span');\n name.dataset.uiFileUploadItemName = '';\n name.className = nameClass;\n name.textContent = record.name;\n const meta = document.createElement('span');\n meta.dataset.uiFileUploadItemMeta = '';\n meta.className = metaClass;\n meta.textContent = [record.size, record.type].filter(Boolean).join(' · ');\n body.append(name, meta);\n\n const remove = document.createElement('button');\n remove.type = 'button';\n remove.dataset.uiFileUploadRemove = '';\n remove.dataset.fileId = record.id;\n remove.className = removeClass;\n remove.disabled = bridge.hasTag('uploading');\n remove.setAttribute('aria-label', `Remove ${record.name}`);\n remove.append(closeIcon(removeIconClass));\n item.append(preview, body, remove);\n container.append(item);\n });\n };\n\n const syncDom = (\n context: Readonly<FileUploadContext> = currentContext(),\n props: Readonly<FileUploadProps> = currentProps(),\n ): void => {\n const records = recordsFromSnapshot(context);\n const existing = context.existing.present && !context.existing.cleared;\n const hasFiles = records.length > 0 || existing;\n const unavailable = props.disabled || context.selection.limitReached || context.transfer.status === 'uploading';\n const control = input();\n syncNativeControl({input: control, state: {disabled: props.disabled, required: props.required, invalid: props.invalid}});\n if (props.transport === 'native' && props.name) control.name = props.name;\n else control.removeAttribute('name');\n control.multiple = props.multiple;\n props.accept ? control.setAttribute('accept', props.accept) : control.removeAttribute('accept');\n props.capture ? control.setAttribute('capture', props.capture) : control.removeAttribute('capture');\n if (unavailable && !props.disabled) {\n control.setAttribute('aria-disabled', 'true');\n control.tabIndex = -1;\n } else if (!props.disabled) {\n control.removeAttribute('aria-disabled');\n control.removeAttribute('tabindex');\n }\n if (control.form) control.form.enctype = 'multipart/form-data';\n\n syncControlPresence({el: root(), state: props, value: 'true'});\n setPresence({el: root(), attr: 'data-empty', present: !hasFiles, value: 'true'});\n setPresence({el: root(), attr: 'data-has-files', present: hasFiles, value: 'true'});\n setPresence({el: root(), attr: 'data-multiple', present: props.multiple, value: 'true'});\n setPresence({el: root(), attr: 'data-max-items-reached', present: context.selection.limitReached, value: 'true'});\n setPresence({el: root(), attr: 'data-has-existing-file', present: existing, value: 'true'});\n root().dataset.transport = props.transport;\n root().dataset.transferState = context.transfer.status;\n const zone = dropzone();\n if (zone) {\n syncControlPresence({el: zone, state: {disabled: unavailable, invalid: props.invalid}, value: 'true'});\n setPresence({el: zone, attr: 'data-multiple', present: props.multiple, value: 'true'});\n setPresence({el: zone, attr: 'data-has-files', present: hasFiles, value: 'true'});\n setPresence({el: zone, attr: 'data-max-items-reached', present: context.selection.limitReached, value: 'true'});\n }\n renderFiles(context, props);\n };\n\n const initialContext = (props: FileUploadProps): FileUploadContext => ({\n selection: {files: [], limitReached: false, rejectedCount: 0, limitRejectedCount: 0, source: 'clear'},\n existing: {present: Boolean(root().querySelector('[data-ui-file-upload-item][data-existing-file]')), cleared: false},\n transfer: {status: props.transport === 'native' ? 'native' : 'idle', activeIds: [], progress: {}, results: {}, error: ''},\n });\n const syncSelection = (scope: {context: Readonly<FileUploadContext>; props: Readonly<FileUploadProps>}): boolean => {\n const selectedFiles = scope.context.selection.files.flatMap(({id}) => rawFiles.get(id) ?? []);\n if (!setInputFiles(input(), selectedFiles)) {\n input().value = '';\n bridge.send('FILES_RESET');\n return false;\n }\n syncDom(scope.context, scope.props);\n return true;\n };\n\n const bridge = createAlpineMachine({\n schema: fileUploadSchema,\n hooks: fileUploadHooks,\n createMachine: ({props}) => createFileUploadMachine({\n props,\n context: initialContext(props),\n effects: {\n commitSelection: (scope) => {\n if (!syncSelection(scope)) return;\n if (scope.context.selection.limitRejectedCount > 0) {\n dispatch({el: root(), name: 'ui:file-upload-limit', detail: {rejectedCount: scope.context.selection.limitRejectedCount}});\n }\n if (scope.context.selection.source !== 'picker') dispatchNativeChange();\n dispatch({\n el: root(),\n name: 'ui:file-upload-change',\n detail: {files: recordsFromSnapshot(scope.context), source: scope.context.selection.source},\n });\n },\n reconcileSelection: (scope) => { syncSelection(scope); },\n resetSelection: (scope) => { input().value = ''; syncDom(scope.context, scope.props); },\n syncProps: (scope) => {\n syncDom(scope.context, scope.props);\n bridge.send({type: 'RECONCILE', records: scope.context.selection.files, source: 'props'});\n },\n syncDragging: (scope) => {\n const dragging = scope.snapshot.tags.includes('dragging');\n setPresence({el: root(), attr: 'data-dragging', present: dragging, value: 'true'});\n const zone = dropzone();\n if (zone) setPresence({el: zone, attr: 'data-dragging', present: dragging, value: 'true'});\n },\n clearExisting: (scope) => {\n const clear = root().querySelector<HTMLInputElement>('[data-ui-file-upload-clear]');\n if (clear) {\n clear.checked = true;\n clear.dispatchEvent(new Event('change', {bubbles: true}));\n }\n const existing = root().querySelector<HTMLElement>('[data-ui-file-upload-item][data-existing-file]');\n if (existing) existing.hidden = true;\n syncDom(scope.context, scope.props);\n dispatch({\n el: root(),\n name: 'ui:file-upload-change',\n detail: {files: recordsFromSnapshot(scope.context), source: scope.context.selection.source},\n });\n },\n syncTransfer: (scope) => syncDom(scope.context, scope.props),\n emitComplete: (scope) => dispatch({el: root(), name: 'ui:file-upload-complete', detail: {files: recordsFromSnapshot(scope.context)}}),\n emitError: (scope) => dispatch({el: root(), name: 'ui:file-upload-error', detail: {files: recordsFromSnapshot(scope.context), error: scope.context.transfer.error}}),\n emitCancel: (scope) => dispatch({el: root(), name: 'ui:file-upload-cancel', detail: {files: recordsFromSnapshot(scope.context)}}),\n },\n }),\n });\n\n const component: TrellisAlpineComponent<FileUploadData> = {\n ...bridge,\n get files() { return this.snapshot.current ? recordsFromSnapshot(this.snapshot.current.context) : []; },\n get hasFiles() { return (this.snapshot.current?.context.selection.files.length ?? 0) > 0 || Boolean(this.snapshot.current?.context.existing.present && !this.snapshot.current.context.existing.cleared); },\n get isDragging() { return this.snapshot.current?.tags.includes('dragging') ?? false; },\n get isUploading() { return this.snapshot.current?.tags.includes('uploading') ?? false; },\n get isLimitReached() { return this.snapshot.current?.context.selection.limitReached ?? false; },\n init() {\n rootEl = this.$el;\n bridge.connect(this.$el, this.snapshot);\n const control = input();\n addListener({target: control, event: 'input', handler: (event) => {\n if (currentProps().transport === 'direct') event.stopPropagation();\n }, cleanup});\n addListener({target: control, event: 'change', handler: (event) => {\n if (currentProps().transport === 'direct') event.stopPropagation();\n if (ignoreNativeChange) { ignoreNativeChange = false; return; }\n sendFiles(registerFiles(filesFromList(control.files)), 'picker');\n }, cleanup});\n addListener({target: root(), event: 'click', handler: (event) => {\n const target = event.target;\n if (!(target instanceof Element)) return;\n const remove = target.closest<HTMLElement>('[data-ui-file-upload-remove][data-file-id]');\n if (remove?.dataset.fileId) { event.preventDefault(); component.remove(remove.dataset.fileId); return; }\n const existing = target.closest('[data-ui-file-upload-remove][data-existing-file]');\n if (existing) { event.preventDefault(); bridge.send('CLEAR_EXISTING'); }\n }, cleanup});\n const zone = dropzone();\n if (zone) {\n cleanup.push(dropTargetForExternal({\n element: zone,\n canDrop: ({source}) => !currentProps().disabled && !bridge.hasTag('uploading') && containsFiles({source}),\n getDropEffect: () => 'copy',\n onDragEnter: () => bridge.send('DRAG_ENTER'),\n onDragLeave: () => bridge.send('DRAG_LEAVE'),\n onDrop: ({source}: ExternalDropTargetEventPayloadMap['onDrop']) => {\n bridge.send('DROP');\n if (!containsFiles({source})) return;\n sendFiles(registerFiles(getFiles({source})), 'drop', currentProps().multiple);\n },\n }));\n cleanup.push(monitorForExternal({canMonitor: ({source}) => containsFiles({source}), onDrop: () => bridge.send('DRAG_LEAVE')}));\n }\n syncDom();\n bridge.send({type: 'RECONCILE', records: [], source: 'props'});\n },\n destroy() {\n cleanup.forEach((dispose) => dispose());\n cleanup = [];\n previewUrls.forEach((url) => URL.revokeObjectURL(url));\n previewUrls.clear();\n rawFiles.clear();\n bridge.disconnect();\n rootEl = null;\n },\n browse() { if (!currentProps().disabled && !bridge.hasTag('uploading')) input().click(); },\n remove(id) {\n if (currentProps().disabled || bridge.hasTag('uploading') || !rawFiles.has(id)) return;\n const records = currentContext().selection.files.filter((record) => record.id !== id);\n sendFiles(records, 'remove');\n },\n retry() { bridge.send('RETRY_UPLOAD'); },\n cancel() { bridge.send('CANCEL_UPLOAD'); },\n file(id) { return rawFiles.get(id) ?? null; },\n preview(id) { return previewFor(id); },\n };\n return component;\n};\n\nconst registerFileUpload = defineAlpineData('UiFileUpload', UiFileUpload);\n\nexport {registerFileUpload, UiFileUpload};\nexport type {\n FileTransferStatus,\n FileUploadData,\n FileUploadMetadata,\n FileUploadRecord,\n FileUploadTransition,\n UiFileUploadApi,\n};\n","// Generated by scripts/generate_component_entries.mjs from packages/client/component-entries.json.\n// Do not edit by hand.\nimport type {Alpine as AlpineType} from 'alpinejs';\n\nimport {registerFileUpload as registerComponent} from './index';\n\nconst registered = new WeakSet<AlpineType>();\n\nconst registerFileUpload = (AlpineInstance: AlpineType): void => {\n if (registered.has(AlpineInstance)) return;\n registered.add(AlpineInstance);\n\n registerComponent(AlpineInstance);\n};\n\nexport {registerFileUpload};\nexport default registerFileUpload;\nexport * from './index';\n"],"x_google_ignoreList":[0,1,2],"mappings":"8dAAA,SAAgB,EAAc,EAAM,CAElC,OADa,EAAK,OACJ,MAAM,SAAS,OAAO,CACtC,CAIA,SAAgB,EAAS,EAAO,CAE9B,OADa,EAAM,OACL,MAKb,OAAO,SAAU,EAAM,CACtB,OAAO,EAAK,OAAS,MACvB,CAAC,EAAE,IAAI,SAAU,EAAM,CACrB,OAAO,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AAC,YAAY,EAAc,CAAC,QAAM,CAAC,EAAG,WAAc,EAAO,KAAK,YAAY,CAAC,CAAC,CAAC,GAEjI,EAAQ,EACR,EAAO,KAAK,CAAC,KAAM,YAAa,QAAS,CAAC,EAAG,OAAQ,OAAO,CAAC,CACjE,EACA,SAAU,CACN,EAAQ,QAAS,GAAY,EAAQ,CAAC,EACtC,EAAU,CAAC,EACX,EAAY,QAAS,GAAQ,IAAI,gBAAgB,CAAG,CAAC,EACrD,EAAY,MAAM,EAClB,EAAS,MAAM,EACf,EAAO,WAAW,EAClB,EAAS,IACb,EACA,QAAS,CAAM,CAAC,EAAa,EAAE,UAAY,CAAC,EAAO,OAAO,WAAW,GAAG,EAAM,EAAE,MAAM,CAAG,EACzF,OAAO,EAAI,CACH,EAAa,EAAE,UAAY,EAAO,OAAO,WAAW,GAAK,CAAC,EAAS,IAAI,CAAE,GAE7E,EADgB,EAAe,EAAE,UAAU,MAAM,OAAQ,GAAW,EAAO,KAAO,CACxE,EAAS,QAAQ,CAC/B,EACA,OAAQ,CAAE,EAAO,KAAK,cAAc,CAAG,EACvC,QAAS,CAAE,EAAO,KAAK,eAAe,CAAG,EACzC,KAAK,EAAI,CAAE,OAAO,EAAS,IAAI,CAAE,GAAK,IAAM,EAC5C,QAAQ,EAAI,CAAE,OAAO,EAAW,CAAE,CAAG,CACzC,EACA,OAAO,CACX,EAEM,GAAqB,EAAiB,eAAgB,CAAY,EC9alE,EAAa,IAAI,QAEjB,GAAsB,GAAqC,CACzD,EAAW,IAAI,CAAc,IACjC,EAAW,IAAI,CAAc,EAE7B,GAAkB,CAAc,EACpC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{g as e}from"./ui-BHBokFNi.js";import{t}from"./capability-motion-BeZZfCbD.js";import{c as n,f as r,l as i,n as a,t as o}from"./codecs-Cb1ns_47.js";import{r as s,t as c}from"./dom-qAeVl7dc.js";import{i as l,t as u}from"./alpine-machine-BTDXpEr6.js";import{t as d}from"./alpine-data-CytyCyfk.js";import{n as f}from"./anchored-popover-BXEMsLrA.js";import{n as p,t as m}from"./styles-TfvwVPGw.js";import{t as h}from"./merge-bindings-C8ewA_FD.js";import{t as g}from"./machine-Dqut4h89.js";import{t as _}from"./semantic-observer-CdRbZHir.js";import{F as v,I as y,R as b,d as x,t as S}from"./common-Dfj6NCjU.js";import{o as C}from"./capability-shortcut-CGpfLNL-.js";import{n as w,t as T}from"./controller-xDNH-xzt.js";var E={side:i(y,`bottom`),align:i(S,`center`),offset:n.clamp(-100,100).default(0),gap:n.clamp(0,50).default(8),openDelay:n.clamp(0,5e3).default(400),closeDelay:n.clamp(0,5e3).default(150),color:i([`neutral`,`accent`,`success`,`warning`,`danger`],`neutral`),variant:i([`surface`,`soft`,`solid`],`surface`),surface:i(b,`2`),elevation:i(x,`4`),disabled:a,class:r},D={side:o(E.side,`ui-tooltip-side`),align:o(E.align,`ui-tooltip-align`),offset:o(E.offset,`ui-tooltip-offset`),gap:o(E.gap,`ui-tooltip-gap`),openDelay:o(E.openDelay,`ui-tooltip-open-delay`),closeDelay:o(E.closeDelay,`ui-tooltip-close-delay`),color:o(E.color,`ui-tooltip-color`),variant:o(E.variant,`ui-tooltip-variant`),surface:o(E.surface,`ui-tooltip-surface`),elevation:o(E.elevation,`ui-tooltip-elevation`),disabled:o(E.disabled,`ui-tooltip-disabled`)},O=({context:e})=>e.transition,k=[l({name:`opening`,state:`opening`,project:O,onDone:`OPENING_DONE`,onError:`OPENING_ERROR`}),l({name:`closing`,state:`closing`,project:O,onDone:`CLOSING_DONE`,onError:`CLOSING_ERROR`})],A=e=>{let t=e.reason;return t===`focus`||t===`escape`||t===`activation`||t===`scroll`||t===`blur`||t===`disabled`||t===`replacement`?t:`pointer`},j=(e,t)=>g({initial:`closed`,states:{closed:{tags:[`closed`],on:{OPEN:{target:`opening`,guard:`canOpen`,reduce:`transition`,effects:`prepareOpen`},PROPS_CHANGED:{reduce:`replaceProps`,effects:`syncProps`}}},opening:{tags:[`visible`,`expanded`,`transitioning`],on:{OPENING_DONE:{target:`open`,effects:`finishOpen`},OPENING_ERROR:{target:`open`,effects:`finishOpen`},CLOSE:{target:`closing`,reduce:`transition`,effects:`prepareClose`},PROPS_CHANGED:[{target:`closing`,guard:`becomesDisabled`,reduce:`replacePropsDisabled`,effects:[`syncProps`,`prepareClose`]},{reduce:`replaceProps`,effects:`syncProps`}]}},open:{tags:[`visible`,`expanded`,`open`],on:{CLOSE:{target:`closing`,reduce:`transition`,effects:`prepareClose`},PROPS_CHANGED:[{target:`closing`,guard:`becomesDisabled`,reduce:`replacePropsDisabled`,effects:[`syncProps`,`prepareClose`]},{reduce:`replaceProps`,effects:`syncProps`}]}},closing:{tags:[`visible`,`transitioning`],on:{CLOSING_DONE:{target:`closed`,effects:`finishClose`},CLOSING_ERROR:{target:`closed`,effects:`finishClose`},OPEN:{target:`opening`,guard:`canOpen`,reduce:`transition`,effects:`prepareOpen`},PROPS_CHANGED:{reduce:`replaceProps`,effects:`syncProps`}}}}},{context:{transition:{reason:`pointer`,instant:!1}},props:e,reducers:{transition:({context:e,props:t,event:n})=>({context:{transition:{reason:A(n),instant:n.instant===!0}},props:t}),replaceProps:({context:e,props:t,event:n})=>({context:e,props:n.props??t}),replacePropsDisabled:({context:e,props:t,event:n})=>({context:{transition:{reason:`disabled`,instant:!0}},props:n.props??t})},guards:{canOpen:({props:e})=>!e.disabled,becomesDisabled:({event:e})=>e.props?.disabled===!0},effects:t}),M=m({definition:{component:`ui.tooltip`,parts:{root:{base:`contents`},content:{base:[v,`pointer-events-auto min-h-control-md max-w-72 auto-cols-max grid-flow-col items-center gap-2 rounded-overlay-sm px-2 py-1`,`font-body text-1 [font-weight:var(--font-weight-normal)]`,`data-[state=closed]:pointer-events-none data-[state=closed]:opacity-0`],variants:{color:{neutral:``,accent:``,success:``,warning:``,danger:``},variant:{surface:``,soft:``,solid:``}},defaults:{color:`neutral`,variant:`surface`}},shortcut:{base:`ml-1 inline-flex items-center gap-1 text-[var(--ui-semantic-surface-ink-muted)]`}}}}),N=new WeakMap,P=e=>{let t=N.get(e);return t||(t={active:null},N.set(e,t)),t},F=(e,t)=>{let n=new Set((e.getAttribute(`aria-describedby`)??``).split(/\s+/).filter(Boolean));n.add(t),e.setAttribute(`aria-describedby`,[...n].join(` `))},I=(e,t)=>{let n=(e.getAttribute(`aria-describedby`)??``).split(/\s+/).filter(e=>e&&e!==t);n.length?e.setAttribute(`aria-describedby`,n.join(` `)):e.removeAttribute(`aria-describedby`)},L=({owner:t,trigger:n,content:r,schema:i,syncShortcut:a})=>{let o=[],l=null,d=null,m=null,h=``,g=!1,v=!1,y=e=>{let t=e===`open`?d:m;t!==null&&clearTimeout(t),e===`open`?d=null:m=null},b=()=>w.getSnapshot().props,x=()=>w.hasTag(`visible`),S=()=>{let e=b(),t=r();t.dataset.state=w.hasTag(`expanded`)?`open`:`closed`,t.setAttribute(`data-ui-semantic-surface`,``),t.dataset.color=e.color,t.dataset.variant=e.variant,t.dataset.uiSurface=e.surface,t.dataset.uiElevation=e.elevation,t.className=p({part:M.parts.content,props:e,className:t.dataset.class}),a?.(n().dataset.uiTooltipShortcut??``),l?.sync()},C={prepareOpen(){r().hidden=!1,l?.open(),S()},finishOpen(){S(),s({el:t(),name:`ui:open`})},prepareClose(){S()},finishClose:()=>{l?.close(),r().hidden=!0,S();let e=P(t().ownerDocument);e.active===A&&(e.active=null),s({el:t(),name:`ui:close`})},syncProps(){S(),b().disabled&&x()&&A.close(`disabled`,!0)}},w=u({schema:i,hooks:k,createMachine:({props:e})=>j(e,C)}),T=(e,n=!1)=>{if(y(`open`),y(`close`),b().disabled||w.hasTag(`expanded`))return;let r=P(t().ownerDocument),i=r.active!==null&&r.active!==A;r.active&&r.active!==A&&r.active.close(`replacement`,!0),r.active=A,w.send({type:`OPEN`,reason:e,instant:n||i})},E=(e,t=!1)=>{y(`open`),y(`close`),x()&&w.send({type:`CLOSE`,reason:e,instant:t})},D=()=>{if(y(`close`),x()||b().disabled)return;let e=P(t().ownerDocument).active?0:b().openDelay;y(`open`),d=setTimeout(()=>T(`pointer`,e===0),e)},O=()=>{y(`open`),x()&&(y(`close`),m=setTimeout(()=>E(`pointer`),b().closeDelay))},A={bridge:w,connect(i){w.connect(t(),i),h=r().id||`ui-tooltip-${crypto.randomUUID()}`,r().id=h,r().setAttribute(`role`,`tooltip`),r().setAttribute(`popover`,`manual`),r().setAttribute(`data-ui-tooltip-content`,``),r().hidden=!0,n().setAttribute(`data-ui-tooltip-trigger`,``),F(n(),h),e(n(),`aria-describedby`,`data-ui-tooltip-trigger`),l=f({reference:n,floating:r,position:()=>b().side,align:()=>b().align,gap:()=>b().gap,offset:()=>b().offset}),S(),o=[c({target:n(),event:`pointerenter`,handler:()=>{g=!0,D()}}),c({target:n(),event:`pointermove`,handler:D}),c({target:n(),event:`pointerleave`,handler:()=>{g=!1,v||O()}}),c({target:r(),event:`pointerenter`,handler:()=>{v=!0,y(`close`)}}),c({target:r(),event:`pointerleave`,handler:()=>{v=!1,g||O()}}),c({target:n(),event:`focusin`,handler:()=>T(`focus`,!0)}),c({target:n(),event:`focusout`,handler:()=>{!g&&!v&&E(`blur`,!0)}}),c({target:n(),event:`pointerdown`,handler:()=>E(`activation`,!0)}),c({target:n(),event:`click`,handler:()=>E(`activation`,!0)}),c({target:t().ownerDocument,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&x()&&E(`escape`,!0)}}),c({target:t().ownerDocument,event:`scroll`,options:{capture:!0},handler:()=>{x()&&E(`scroll`,!0)}}),_({targets:n(),read:()=>n().dataset.uiTooltipShortcut??``,onChange:S,observer:{attributes:!0,attributeFilter:[`data-ui-tooltip-shortcut`]}})]},close:E,sync:S,destroy(){y(`open`),y(`close`),o.forEach(e=>e()),o=[];let e=P(t().ownerDocument);e.active===A&&(e.active=null),l?.destroy(),l=null,I(n(),h),n().removeAttribute(`data-ui-tooltip-trigger`),w.disconnect()}};return A},R=()=>{let e=null,t=null,n=()=>{if(!e)throw Error(`Tooltip has not been initialized.`);return e},r=()=>{let e=n().querySelector(`:scope > [data-ui-tooltip-content]`);if(!(e instanceof HTMLElement))throw Error(`Tooltip requires ui.tooltip.content.`);return e},i=()=>{let e=Array.from(n().children).find(e=>e instanceof HTMLElement&&e!==r());if(!(e instanceof HTMLElement))throw Error(`Tooltip requires an interactive trigger before its content.`);return e};return{...u({schema:E,hooks:k,createMachine:({props:e})=>j(e,{prepareOpen(){},finishOpen(){},prepareClose(){},finishClose(){},syncProps(){}})}),init(){e=this.$el,t=L({owner:n,trigger:i,content:r,schema:E}),t.connect(this.snapshot)},destroy(){t?.destroy(),t=null,e=null},get root(){return h({inputs:[p({part:M.parts.root,props:this.snapshot.current?.props??{}}),{"data-ui-tooltip-root":``}]})},get content(){return{"data-ui-tooltip-content":``}}}},z=t=>{t.addInitSelector(()=>`[x-ui-tooltip]`),t.directive(`ui-tooltip`,t.skipDuringClone((t,{expression:n},r)=>{if(!(t instanceof HTMLElement))return;let i=t.ownerDocument.createElement(`div`),a=t.ownerDocument.createElement(`span`);a.setAttribute(`data-ui-tooltip-label`,``),i.append(a);let o=t.ownerDocument.createElement(`span`);o.setAttribute(`data-ui-keybinding`,``),o.setAttribute(`aria-hidden`,`true`),o.className=p({part:w.parts.root,className:p({part:M.parts.shortcut})}),i.append(o);let s=T(o);t.insertAdjacentElement(`afterend`,i);let c=L({owner:()=>t,trigger:()=>t,content:()=>i,schema:D,syncShortcut:e=>s.setValue(e)});c.connect(),e(t,`data-ui-tooltip-disabled`,`data-ui-tooltip-shortcut`);let l=r.evaluateLater(n);r.effect(()=>l(e=>{let n=typeof e==`string`?e.trim():``;a.textContent=n,t.toggleAttribute(`data-ui-tooltip-disabled`,!n),c.sync()})),r.cleanup(()=>{c.destroy(),s.destroy(),i.remove()})})).before(`ui-transition`)},B=e=>{d(`UiTooltip`,R)(e),z(e)},V=new WeakSet,H=e=>{V.has(e)||(V.add(e),t(e),C(e),B(e))};export{R as n,z as r,H as t};
|
|
2
|
-
//# sourceMappingURL=entry.generated-Wl7imdNP.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry.generated-Wl7imdNP.js","names":[],"sources":["../../../../../../../../client/src/components/tooltip/contract.ts","../../../../../../../../client/src/components/tooltip/machine.ts","../../../../../../../../client/src/components/tooltip/styles.ts","../../../../../../../../client/src/components/tooltip/index.ts","../../../../../../../../client/src/components/tooltip/entry.generated.ts"],"sourcesContent":["import {attribute, bool, number, oneOf, string, type SchemaToProps} from '../../runtime';\nimport {\n ALIGNMENTS,\n ELEVATION_REFERENCES,\n POSITIONS,\n SURFACE_REFERENCES,\n type Alignment,\n type ElevationReference,\n type Position,\n type SurfaceReference,\n} from '../common';\n\nconst TOOLTIP_COLORS = ['neutral', 'accent', 'success', 'warning', 'danger'] as const;\nconst TOOLTIP_VARIANTS = ['surface', 'soft', 'solid'] as const;\n\nconst tooltipSchema = {\n side: oneOf(POSITIONS, 'bottom' as Position),\n align: oneOf(ALIGNMENTS, 'center' as Alignment),\n offset: number.clamp(-100, 100).default(0),\n gap: number.clamp(0, 50).default(8),\n openDelay: number.clamp(0, 5000).default(400),\n closeDelay: number.clamp(0, 5000).default(150),\n color: oneOf(TOOLTIP_COLORS, 'neutral'),\n variant: oneOf(TOOLTIP_VARIANTS, 'surface'),\n surface: oneOf(SURFACE_REFERENCES, '2' as SurfaceReference),\n elevation: oneOf(ELEVATION_REFERENCES, '4' as ElevationReference),\n disabled: bool,\n class: string,\n};\n\nconst tooltipDirectiveSchema = {\n side: attribute(tooltipSchema.side, 'ui-tooltip-side'),\n align: attribute(tooltipSchema.align, 'ui-tooltip-align'),\n offset: attribute(tooltipSchema.offset, 'ui-tooltip-offset'),\n gap: attribute(tooltipSchema.gap, 'ui-tooltip-gap'),\n openDelay: attribute(tooltipSchema.openDelay, 'ui-tooltip-open-delay'),\n closeDelay: attribute(tooltipSchema.closeDelay, 'ui-tooltip-close-delay'),\n color: attribute(tooltipSchema.color, 'ui-tooltip-color'),\n variant: attribute(tooltipSchema.variant, 'ui-tooltip-variant'),\n surface: attribute(tooltipSchema.surface, 'ui-tooltip-surface'),\n elevation: attribute(tooltipSchema.elevation, 'ui-tooltip-elevation'),\n disabled: attribute(tooltipSchema.disabled, 'ui-tooltip-disabled'),\n};\n\ntype TooltipProps = SchemaToProps<typeof tooltipSchema>;\ntype TooltipDirectiveProps = SchemaToProps<typeof tooltipDirectiveSchema>;\ntype TooltipColor = typeof TOOLTIP_COLORS[number];\ntype TooltipVariant = typeof TOOLTIP_VARIANTS[number];\n\nexport {\n TOOLTIP_COLORS,\n TOOLTIP_VARIANTS,\n tooltipDirectiveSchema,\n tooltipSchema,\n};\nexport type {TooltipColor, TooltipDirectiveProps, TooltipProps, TooltipVariant};\n","import {createMachine, type Machine, type MachineEventObject} from '../../runtime/state-machine';\nimport {defineHook, type TransitionHookDefinition} from '../../runtime/transition-coordinator';\nimport type {TooltipProps} from './contract';\n\ntype TooltipReason = 'pointer' | 'focus' | 'escape' | 'activation' | 'scroll' | 'blur' | 'disabled' | 'replacement';\ntype TooltipContext = {transition: {reason: TooltipReason; instant: boolean}};\ntype TooltipTransitionData = {reason: TooltipReason; instant: boolean};\ntype TooltipMachineEffects = {\n prepareOpen(): void;\n finishOpen(): void;\n prepareClose(): void;\n finishClose(): void;\n syncProps(): void;\n};\n\nconst transitionData = ({context}: {context: TooltipContext}): TooltipTransitionData => context.transition;\nconst openingHook = defineHook({\n name: 'opening', state: 'opening', project: transitionData, onDone: 'OPENING_DONE', onError: 'OPENING_ERROR',\n} satisfies TransitionHookDefinition<TooltipContext, TooltipProps, TooltipTransitionData, 'opening'>);\nconst closingHook = defineHook({\n name: 'closing', state: 'closing', project: transitionData, onDone: 'CLOSING_DONE', onError: 'CLOSING_ERROR',\n} satisfies TransitionHookDefinition<TooltipContext, TooltipProps, TooltipTransitionData, 'closing'>);\nconst tooltipHooks = [openingHook, closingHook] as const;\n\nconst reasonFrom = (event: MachineEventObject): TooltipReason => {\n const reason = event.reason;\n return reason === 'focus' || reason === 'escape' || reason === 'activation' || reason === 'scroll'\n || reason === 'blur' || reason === 'disabled' || reason === 'replacement' ? reason : 'pointer';\n};\n\nconst createTooltipMachine = (\n props: TooltipProps,\n effects: TooltipMachineEffects,\n): Machine<TooltipContext, TooltipProps> => createMachine<TooltipContext, TooltipProps>({\n initial: 'closed',\n states: {\n closed: {tags: ['closed'], on: {\n OPEN: {target: 'opening', guard: 'canOpen', reduce: 'transition', effects: 'prepareOpen'},\n PROPS_CHANGED: {reduce: 'replaceProps', effects: 'syncProps'},\n }},\n opening: {tags: ['visible', 'expanded', 'transitioning'], on: {\n OPENING_DONE: {target: 'open', effects: 'finishOpen'},\n OPENING_ERROR: {target: 'open', effects: 'finishOpen'},\n CLOSE: {target: 'closing', reduce: 'transition', effects: 'prepareClose'},\n PROPS_CHANGED: [\n {target: 'closing', guard: 'becomesDisabled', reduce: 'replacePropsDisabled', effects: ['syncProps', 'prepareClose']},\n {reduce: 'replaceProps', effects: 'syncProps'},\n ],\n }},\n open: {tags: ['visible', 'expanded', 'open'], on: {\n CLOSE: {target: 'closing', reduce: 'transition', effects: 'prepareClose'},\n PROPS_CHANGED: [\n {target: 'closing', guard: 'becomesDisabled', reduce: 'replacePropsDisabled', effects: ['syncProps', 'prepareClose']},\n {reduce: 'replaceProps', effects: 'syncProps'},\n ],\n }},\n closing: {tags: ['visible', 'transitioning'], on: {\n CLOSING_DONE: {target: 'closed', effects: 'finishClose'},\n CLOSING_ERROR: {target: 'closed', effects: 'finishClose'},\n OPEN: {target: 'opening', guard: 'canOpen', reduce: 'transition', effects: 'prepareOpen'},\n PROPS_CHANGED: {reduce: 'replaceProps', effects: 'syncProps'},\n }},\n },\n}, {\n context: {transition: {reason: 'pointer', instant: false}},\n props,\n reducers: {\n transition: ({context, props: currentProps, event}) => ({\n context: {transition: {reason: reasonFrom(event), instant: event.instant === true}},\n props: currentProps,\n }),\n replaceProps: ({context, props: currentProps, event}) => ({\n context,\n props: (event.props as TooltipProps | undefined) ?? currentProps,\n }),\n replacePropsDisabled: ({context, props: currentProps, event}) => ({\n context: {transition: {reason: 'disabled', instant: true}},\n props: (event.props as TooltipProps | undefined) ?? currentProps,\n }),\n },\n guards: {\n canOpen: ({props: currentProps}) => !currentProps.disabled,\n becomesDisabled: ({event}) => (event.props as TooltipProps | undefined)?.disabled === true,\n },\n effects,\n});\n\nexport {createTooltipMachine, tooltipHooks};\nexport type {TooltipContext, TooltipMachineEffects, TooltipReason, TooltipTransitionData};\n","import {defineStyles} from '../../runtime';\nimport {POPOVER_GEOMETRY_CLASSES} from '../common';\n\nconst tooltipStyles = defineStyles({definition: {\n component: 'ui.tooltip',\n parts: {\n root: {base: 'contents'},\n content: {\n base: [\n POPOVER_GEOMETRY_CLASSES,\n 'pointer-events-auto min-h-control-md max-w-72 auto-cols-max grid-flow-col items-center gap-2 rounded-overlay-sm px-2 py-1',\n 'font-body text-1 [font-weight:var(--font-weight-normal)]',\n 'data-[state=closed]:pointer-events-none data-[state=closed]:opacity-0',\n ],\n variants: {\n color: {neutral: '', accent: '', success: '', warning: '', danger: ''},\n variant: {surface: '', soft: '', solid: ''},\n },\n defaults: {color: 'neutral', variant: 'surface'},\n },\n shortcut: {base: 'ml-1 inline-flex items-center gap-1 text-[var(--ui-semantic-surface-ink-muted)]'},\n },\n}});\n\nexport {tooltipStyles};\n","import type Alpine from 'alpinejs';\n\nimport {\n createAlpineMachine,\n defineAlpineData,\n type SchemaToProps,\n type TransitionForHook,\n type TrellisAlpineComponent,\n} from '@client/runtime';\nimport {createAnchoredPopoverSurface, type AnchoredPopoverSurface} from '@client/runtime/anchored-popover';\nimport type {CodecFn} from '@client/runtime/codecs';\nimport {mergeBindings, type BindingObject} from '@client/runtime/merge-bindings';\nimport {declareMorphAttributes} from '@client/runtime/morph';\nimport {observeSemanticChanges} from '@client/runtime/semantic-observer';\nimport {resolveStyle} from '@client/runtime/styles';\nimport {addListener, dispatch, type CleanupStack} from '@client/utils';\nimport {createKeybindingController} from '../keybinding/controller';\nimport {keybindingStyles} from '../keybinding/styles';\nimport {\n tooltipDirectiveSchema,\n type TooltipDirectiveProps,\n type TooltipProps,\n tooltipSchema,\n} from './contract';\nimport {\n createTooltipMachine,\n tooltipHooks,\n type TooltipContext,\n type TooltipReason,\n} from './machine';\nimport {tooltipStyles} from './styles';\n\ntype TooltipTransitionName = (typeof tooltipHooks)[number]['name'];\ntype TooltipTransition<TName extends TooltipTransitionName = TooltipTransitionName> = TransitionForHook<\n Extract<(typeof tooltipHooks)[number], {name: TName}>,\n HTMLElement\n>;\ntype PopoverElement = HTMLElement & {showPopover(): void; hidePopover(): void};\ntype TooltipSchema = Record<string, CodecFn<unknown>>;\ntype TooltipBridge = ReturnType<typeof createAlpineMachine<TooltipContext, typeof tooltipSchema, typeof tooltipHooks>>;\n\ntype TooltipController = {\n bridge: TooltipBridge;\n connect(snapshot?: {current: TooltipBridge['snapshot']['current']}): void;\n destroy(): void;\n sync(): void;\n close(reason: TooltipReason, instant?: boolean): void;\n};\n\ntype TooltipWarmStore = {active: TooltipController | null};\nconst warmStores = new WeakMap<Document, TooltipWarmStore>();\nconst warmStore = (document: Document): TooltipWarmStore => {\n let store = warmStores.get(document);\n if (!store) {\n store = {active: null};\n warmStores.set(document, store);\n }\n return store;\n};\n\nconst appendDescription = (trigger: HTMLElement, id: string): void => {\n const tokens = new Set((trigger.getAttribute('aria-describedby') ?? '').split(/\\s+/).filter(Boolean));\n tokens.add(id);\n trigger.setAttribute('aria-describedby', [...tokens].join(' '));\n};\n\nconst removeDescription = (trigger: HTMLElement, id: string): void => {\n const tokens = (trigger.getAttribute('aria-describedby') ?? '').split(/\\s+/).filter((token) => token && token !== id);\n if (tokens.length) trigger.setAttribute('aria-describedby', tokens.join(' '));\n else trigger.removeAttribute('aria-describedby');\n};\n\nconst createTooltipController = <TSchema extends TooltipSchema>({\n owner,\n trigger,\n content,\n schema,\n syncShortcut,\n}: {\n owner: () => HTMLElement & Alpine.ElementWithXAttributes;\n trigger: () => HTMLElement;\n content: () => PopoverElement;\n schema: TSchema;\n syncShortcut?: (value: string) => void;\n}): TooltipController => {\n let cleanup: CleanupStack = [];\n let popover: AnchoredPopoverSurface | null = null;\n let openTimer: ReturnType<typeof setTimeout> | null = null;\n let closeTimer: ReturnType<typeof setTimeout> | null = null;\n let describedById = '';\n let pointerOnTrigger = false;\n let pointerOnContent = false;\n\n const clearTimer = (timer: 'open' | 'close'): void => {\n const current = timer === 'open' ? openTimer : closeTimer;\n if (current !== null) clearTimeout(current);\n if (timer === 'open') openTimer = null;\n else closeTimer = null;\n };\n const props = (): Readonly<TooltipProps> => bridge.getSnapshot().props as TooltipProps;\n const visible = (): boolean => bridge.hasTag('visible');\n const syncSurface = (): void => {\n const value = props();\n const surface = content();\n surface.dataset.state = bridge.hasTag('expanded') ? 'open' : 'closed';\n surface.setAttribute('data-ui-semantic-surface', '');\n surface.dataset.color = value.color;\n surface.dataset.variant = value.variant;\n surface.dataset.uiSurface = value.surface;\n surface.dataset.uiElevation = value.elevation;\n surface.className = resolveStyle({\n part: tooltipStyles.parts.content,\n props: value,\n className: surface.dataset.class,\n });\n syncShortcut?.(trigger().dataset.uiTooltipShortcut ?? '');\n popover?.sync();\n };\n const finishClose = (): void => {\n popover?.close();\n content().hidden = true;\n syncSurface();\n const store = warmStore(owner().ownerDocument);\n if (store.active === controller) store.active = null;\n dispatch({el: owner(), name: 'ui:close'});\n };\n const effects = {\n prepareOpen(): void {\n content().hidden = false;\n popover?.open();\n syncSurface();\n },\n finishOpen(): void {\n syncSurface();\n dispatch({el: owner(), name: 'ui:open'});\n },\n prepareClose(): void { syncSurface(); },\n finishClose,\n syncProps(): void {\n syncSurface();\n if (props().disabled && visible()) controller.close('disabled', true);\n },\n };\n const machineBridge = createAlpineMachine({\n schema,\n hooks: tooltipHooks,\n createMachine: ({props: machineProps}) => createTooltipMachine(machineProps as TooltipProps, effects) as never,\n });\n const bridge = machineBridge as unknown as TooltipBridge;\n\n const open = (reason: TooltipReason, instant = false): void => {\n clearTimer('open');\n clearTimer('close');\n if (props().disabled || bridge.hasTag('expanded')) return;\n const store = warmStore(owner().ownerDocument);\n const warm = store.active !== null && store.active !== controller;\n if (store.active && store.active !== controller) store.active.close('replacement', true);\n store.active = controller;\n bridge.send({type: 'OPEN', reason, instant: instant || warm});\n };\n const close = (reason: TooltipReason, instant = false): void => {\n clearTimer('open');\n clearTimer('close');\n if (!visible()) return;\n bridge.send({type: 'CLOSE', reason, instant});\n };\n const scheduleOpen = (): void => {\n clearTimer('close');\n if (visible() || props().disabled) return;\n const delay = warmStore(owner().ownerDocument).active ? 0 : props().openDelay;\n clearTimer('open');\n openTimer = setTimeout(() => open('pointer', delay === 0), delay);\n };\n const scheduleClose = (): void => {\n clearTimer('open');\n if (!visible()) return;\n clearTimer('close');\n closeTimer = setTimeout(() => close('pointer'), props().closeDelay);\n };\n\n const controller: TooltipController = {\n bridge,\n connect(snapshot): void {\n bridge.connect(owner(), snapshot);\n describedById = content().id || `ui-tooltip-${crypto.randomUUID()}`;\n content().id = describedById;\n content().setAttribute('role', 'tooltip');\n content().setAttribute('popover', 'manual');\n content().setAttribute('data-ui-tooltip-content', '');\n content().hidden = true;\n trigger().setAttribute('data-ui-tooltip-trigger', '');\n appendDescription(trigger(), describedById);\n declareMorphAttributes(\n trigger(),\n 'aria-describedby',\n 'data-ui-tooltip-trigger',\n );\n popover = createAnchoredPopoverSurface({\n reference: trigger,\n floating: content,\n position: () => props().side,\n align: () => props().align,\n gap: () => props().gap,\n offset: () => props().offset,\n });\n syncSurface();\n cleanup = [\n addListener({target: trigger(), event: 'pointerenter', handler: () => {\n pointerOnTrigger = true;\n scheduleOpen();\n }}),\n addListener({target: trigger(), event: 'pointermove', handler: scheduleOpen}),\n addListener({target: trigger(), event: 'pointerleave', handler: () => {\n pointerOnTrigger = false;\n if (!pointerOnContent) scheduleClose();\n }}),\n addListener({target: content(), event: 'pointerenter', handler: () => {\n pointerOnContent = true;\n clearTimer('close');\n }}),\n addListener({target: content(), event: 'pointerleave', handler: () => {\n pointerOnContent = false;\n if (!pointerOnTrigger) scheduleClose();\n }}),\n addListener({target: trigger(), event: 'focusin', handler: () => open('focus', true)}),\n addListener({target: trigger(), event: 'focusout', handler: () => {\n if (!pointerOnTrigger && !pointerOnContent) close('blur', true);\n }}),\n addListener({target: trigger(), event: 'pointerdown', handler: () => close('activation', true)}),\n addListener({target: trigger(), event: 'click', handler: () => close('activation', true)}),\n addListener({target: owner().ownerDocument, event: 'keydown', handler: (event) => {\n if (event instanceof KeyboardEvent && event.key === 'Escape' && visible()) close('escape', true);\n }}),\n addListener({target: owner().ownerDocument, event: 'scroll', options: {capture: true}, handler: () => {\n if (visible()) close('scroll', true);\n }}),\n observeSemanticChanges({\n targets: trigger(),\n read: () => trigger().dataset.uiTooltipShortcut ?? '',\n onChange: syncSurface,\n observer: {attributes: true, attributeFilter: ['data-ui-tooltip-shortcut']},\n }),\n ];\n },\n close,\n sync: syncSurface,\n destroy(): void {\n clearTimer('open');\n clearTimer('close');\n cleanup.forEach((dispose) => dispose());\n cleanup = [];\n const store = warmStore(owner().ownerDocument);\n if (store.active === controller) store.active = null;\n popover?.destroy();\n popover = null;\n removeDescription(trigger(), describedById);\n trigger().removeAttribute('data-ui-tooltip-trigger');\n bridge.disconnect();\n },\n };\n return controller;\n};\n\ntype TooltipData = TooltipBridge & {\n readonly root: BindingObject;\n readonly content: BindingObject;\n init(): void;\n destroy(): void;\n};\n\nconst UiTooltip = (): TrellisAlpineComponent<TooltipData> => {\n let rootEl: (HTMLElement & Alpine.ElementWithXAttributes) | null = null;\n let controller: TooltipController | null = null;\n const root = (): HTMLElement & Alpine.ElementWithXAttributes => {\n if (!rootEl) throw new Error('Tooltip has not been initialized.');\n return rootEl;\n };\n const content = (): PopoverElement => {\n const el = root().querySelector<HTMLElement>(':scope > [data-ui-tooltip-content]');\n if (!(el instanceof HTMLElement)) throw new Error('Tooltip requires ui.tooltip.content.');\n return el as PopoverElement;\n };\n const trigger = (): HTMLElement => {\n const el = Array.from(root().children).find((child) => child instanceof HTMLElement && child !== content());\n if (!(el instanceof HTMLElement)) throw new Error('Tooltip requires an interactive trigger before its content.');\n return el;\n };\n const bridge = createAlpineMachine({\n schema: tooltipSchema,\n hooks: tooltipHooks,\n createMachine: ({props}) => createTooltipMachine(props, {\n prepareOpen() {}, finishOpen() {}, prepareClose() {}, finishClose() {}, syncProps() {},\n }),\n }) as TooltipBridge;\n const component: TrellisAlpineComponent<TooltipData> = {\n ...bridge,\n init(): void {\n rootEl = this.$el;\n controller = createTooltipController({owner: root, trigger, content, schema: tooltipSchema});\n controller.connect(this.snapshot);\n },\n destroy(): void {\n controller?.destroy();\n controller = null;\n rootEl = null;\n },\n get root(): BindingObject {\n return mergeBindings({inputs: [\n resolveStyle({part: tooltipStyles.parts.root, props: this.snapshot.current?.props ?? {}}),\n {'data-ui-tooltip-root': ''},\n ]});\n },\n get content(): BindingObject {\n return {'data-ui-tooltip-content': ''};\n },\n };\n return component;\n};\n\nconst registerTooltipDirective = (AlpineInstance: Alpine.Alpine): void => {\n AlpineInstance.addInitSelector(() => '[x-ui-tooltip]');\n AlpineInstance.directive('ui-tooltip', AlpineInstance.skipDuringClone((el, {expression}, utilities) => {\n if (!(el instanceof HTMLElement)) return;\n const content = el.ownerDocument.createElement('div') as PopoverElement;\n const label = el.ownerDocument.createElement('span');\n label.setAttribute('data-ui-tooltip-label', '');\n content.append(label);\n const shortcut = el.ownerDocument.createElement('span');\n shortcut.setAttribute('data-ui-keybinding', '');\n shortcut.setAttribute('aria-hidden', 'true');\n shortcut.className = resolveStyle({\n part: keybindingStyles.parts.root,\n className: resolveStyle({part: tooltipStyles.parts.shortcut}),\n });\n content.append(shortcut);\n const keybinding = createKeybindingController(shortcut);\n el.insertAdjacentElement('afterend', content);\n const owner = () => el as HTMLElement & Alpine.ElementWithXAttributes;\n const controller = createTooltipController({\n owner,\n trigger: () => el,\n content: () => content,\n schema: tooltipDirectiveSchema,\n syncShortcut: (value) => keybinding.setValue(value),\n });\n controller.connect();\n declareMorphAttributes(el, 'data-ui-tooltip-disabled', 'data-ui-tooltip-shortcut');\n const evaluator = utilities.evaluateLater(expression);\n utilities.effect(() => evaluator((value) => {\n const text = typeof value === 'string' ? value.trim() : '';\n label.textContent = text;\n el.toggleAttribute('data-ui-tooltip-disabled', !text);\n controller.sync();\n }));\n utilities.cleanup(() => {\n controller.destroy();\n keybinding.destroy();\n content.remove();\n });\n })).before('ui-transition');\n};\n\nconst registerTooltip = (AlpineInstance: Alpine.Alpine): void => {\n defineAlpineData('UiTooltip', UiTooltip)(AlpineInstance);\n registerTooltipDirective(AlpineInstance);\n};\n\nexport {registerTooltip, registerTooltipDirective, UiTooltip};\nexport type {TooltipData, TooltipDirectiveProps, TooltipTransition};\n","// Generated by scripts/generate_component_entries.mjs from packages/client/component-entries.json.\n// Do not edit by hand.\nimport type {Alpine as AlpineType} from 'alpinejs';\nimport {registerMotionCapability} from '../../capabilities/motion';\nimport {registerShortcutCapability} from '../../capabilities/shortcut';\nimport {registerTooltip as registerComponent} from './index';\n\nconst registered = new WeakSet<AlpineType>();\n\nconst registerTooltip = (AlpineInstance: AlpineType): void => {\n if (registered.has(AlpineInstance)) return;\n registered.add(AlpineInstance);\n registerMotionCapability(AlpineInstance);\n registerShortcutCapability(AlpineInstance);\n registerComponent(AlpineInstance);\n};\n\nexport {registerTooltip};\nexport default registerTooltip;\nexport * from './index';\n"],"mappings":"6sBAeA,IAAM,EAAgB,CAClB,KAAM,EAAM,EAAW,QAAoB,EAC3C,MAAO,EAAM,EAAY,QAAqB,EAC9C,OAAQ,EAAO,MAAM,KAAM,GAAG,EAAE,QAAQ,CAAC,EACzC,IAAK,EAAO,MAAM,EAAG,EAAE,EAAE,QAAQ,CAAC,EAClC,UAAW,EAAO,MAAM,EAAG,GAAI,EAAE,QAAQ,GAAG,EAC5C,WAAY,EAAO,MAAM,EAAG,GAAI,EAAE,QAAQ,GAAG,EAC7C,MAAO,EAAM,CAVO,UAAW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,CAAC,CAChE,CAAC,EACD,EAAQ,OAAO,CAAQ,EACvB,IAAM,EAAa,EAA2B,CAAQ,EACtD,EAAG,sBAAsB,WAAY,CAAO,EAE5C,IAAM,EAAa,EAAwB,CACvC,UAFgB,EAGhB,YAAe,EACf,YAAe,EACf,OAAQ,EACR,aAAe,GAAU,EAAW,SAAS,CAAK,CACtD,CAAC,EACD,EAAW,QAAQ,EACnB,EAAuB,EAAI,2BAA4B,0BAA0B,EACjF,IAAM,EAAY,EAAU,cAAc,CAAU,EACpD,EAAU,WAAa,EAAW,GAAU,CACxC,IAAM,EAAO,OAAO,GAAU,SAAW,EAAM,KAAK,EAAI,GACxD,EAAM,YAAc,EACpB,EAAG,gBAAgB,2BAA4B,CAAC,CAAI,EACpD,EAAW,KAAK,CACpB,CAAC,CAAC,EACF,EAAU,YAAc,CACpB,EAAW,QAAQ,EACnB,EAAW,QAAQ,EACnB,EAAQ,OAAO,CACnB,CAAC,CACL,CAAC,CAAC,EAAE,OAAO,eAAe,CAC9B,EAEM,EAAmB,GAAwC,CAC7D,EAAiB,YAAa,CAAS,EAAE,CAAc,EACvD,EAAyB,CAAc,CAC3C,ECtWM,EAAa,IAAI,QAEjB,EAAmB,GAAqC,CACtD,EAAW,IAAI,CAAc,IACjC,EAAW,IAAI,CAAc,EAC7B,EAAyB,CAAc,EACvC,EAA2B,CAAc,EACzC,EAAkB,CAAc,EACpC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as e,l as t}from"./motion-C3XtSJ4O.js";import{t as n}from"./capability-motion-BeZZfCbD.js";import{a as r,f as i,l as a,n as o}from"./codecs-Cb1ns_47.js";import{i as s,r as c,s as l,t as ee}from"./dom-qAeVl7dc.js";import{i as u,t as te}from"./alpine-machine-BTDXpEr6.js";import{t as d}from"./alpine-data-CytyCyfk.js";import{n as f,t as p}from"./styles-TfvwVPGw.js";import{t as ne}from"./merge-bindings-C8ewA_FD.js";import{t as m}from"./machine-Dqut4h89.js";import{i as re}from"./focus-scope-DtaPVNl5.js";import{t as ie}from"./semantic-observer-CdRbZHir.js";import{t as ae}from"./drag-and-drop-DHq3udf7.js";import{t as h}from"./capability-resizable-Bga8TngJ.js";var g=(e,t)=>{let n=getComputedStyle(e).getPropertyValue(`--breakpoint-${t}`),r=Number.parseFloat(n);return Number.isFinite(r)?r:1/0},_=[`horizontal`,`vertical`],v=[`div`,`section`,`aside`,`main`,`nav`],y=[`1`,`2`,`3`,`4`,`5`,`6`,`fill`],oe=[`none`,`start`,`end`],b=[`toggle`,`expand`,`collapse`],se={id:i.default(`ui-panels`),orientation:a(_,`horizontal`),persist:o,divider:o.default(!0),class:i},ce={id:i,as:a(v,`section`),size:a(y,`fill`),resize:a(oe,`none`),collapsible:o,defaultCollapsed:o,class:i},x={target:i,action:a(b,`toggle`),icon:i.default(`menu`),label:i.default(`Expand`),class:i},le=[u({name:`opening`,state:`changing`,projectEach:e=>e.context.change.openingIds.map(e=>({panelId:e})),onDone:`CHANGE_DONE`,onError:`CHANGE_ERROR`,sends:{expand:e=>({type:`EXPAND`,panelId:e}),collapse:e=>({type:`COLLAPSE`,panelId:e}),toggle:e=>({type:`TOGGLE`,panelId:e})}}),u({name:`closing`,state:`changing`,projectEach:e=>e.context.change.closingIds.map(e=>({panelId:e})),onDone:`CHANGE_DONE`,onError:`CHANGE_ERROR`,sends:{expand:e=>({type:`EXPAND`,panelId:e}),collapse:e=>({type:`COLLAPSE`,panelId:e}),toggle:e=>({type:`TOGGLE`,panelId:e})}}),u({name:`sizing`,state:`sizing`,projectEach:e=>e.context.sizing.changes,onDone:`SIZE_DONE`,onError:`SIZE_ERROR`}),u({name:`persisting`,state:`persisting`,project:e=>({groupId:e.props.id,collapsed:[...e.context.layout.collapsedIds],sizes:{...e.context.layout.committedSizes}}),onDone:`PERSIST_DONE`,onError:`PERSIST_ERROR`})],S=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],C=e=>typeof e.panelId==`string`?e.panelId:``,w=e=>typeof e==`number`&&Number.isFinite(e)?e:null,T=e=>(Array.isArray(e.changes)?e.changes:[e]).flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e,n=typeof t.panelId==`string`?t.panelId:``,r=w(t.from),i=w(t.to),a=t.reset===!0;return n&&r!==null&&i!==null&&(r!==i||a)?[{panelId:n,from:r,to:i,...a?{reset:!0}:{}}]:[]}),E=(e,t)=>typeof e.props==`object`&&e.props!==null?e.props:t,D=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),O=e=>{let t=C(e.event),n=e.context.layout.collapsedIds;switch(e.event.type){case`COLLAPSE`:return e.context.collection.collapsibleIds.includes(t)&&!n.includes(t)?e.context.collection.ids.filter(e=>n.includes(e)||e===t):n;case`EXPAND`:return n.filter(e=>e!==t);case`TOGGLE`:return e.context.collection.collapsibleIds.includes(t)?n.includes(t)?n.filter(e=>e!==t):e.context.collection.ids.filter(e=>n.includes(e)||e===t):n;default:return n}},k=e=>{let t=C(e.event);return e.context.collection.ids.includes(t)&&!D(e.context.layout.collapsedIds,O(e))},A=e=>{let t=C(e.event);return e.context.collection.resizableIds.includes(t)&&!e.context.layout.collapsedIds.includes(t)&&w(e.event.size)!==null},j=e=>{let t=T(e.event);return t.length>0&&t.every(({panelId:t})=>e.context.collection.sizableIds.includes(t)&&!e.context.layout.collapsedIds.includes(t))},M=e=>{let t=T(e.event);return t.length>0&&t.every(({panelId:t})=>e.context.collection.sizableIds.includes(t)&&e.context.layout.collapsedIds.includes(t))},N=e=>{let t=S(e.event.ids);return t.length>0&&t.every(t=>e.context.collection.sizableIds.includes(t)&&e.context.layout.collapsedIds.includes(t)&&Object.hasOwn(e.context.layout.committedSizes,t))},P=e=>{let t=T(e.event),n={...e.context.layout.committedSizes};return t.forEach(({panelId:e,to:t,reset:r})=>{r?delete n[e]:n[e]=t}),{context:{...e.context,layout:{...e.context.layout,committedSizes:n},sizing:{changes:t}}}},F=e=>{let t=T(e.event);return{context:{...e.context,layout:{...e.context.layout,committedSizes:{...e.context.layout.committedSizes,...Object.fromEntries(t.map(({panelId:e,to:t})=>[e,t]))}}}}},I=e=>{let t={...e.context.layout.committedSizes};return S(e.event.ids).forEach(e=>delete t[e]),{context:{...e.context,layout:{...e.context.layout,committedSizes:t}}}},L=e=>{let t=O(e),n=e.context.layout.collapsedIds;return{context:{...e.context,layout:{...e.context.layout,collapsedIds:t},change:{openingIds:n.filter(e=>!t.includes(e)),closingIds:t.filter(e=>!n.includes(e))}}}},R=e=>{let t=S(e.event.ids),n=S(e.event.collapsibleIds).filter(e=>t.includes(e)),r=S(e.event.sizableIds).filter(e=>t.includes(e)),i=S(e.event.resizableIds).filter(e=>t.includes(e)),a=S(e.event.authoredCollapsedIds).filter(e=>n.includes(e)),o=new Set(e.context.collection.ids),s=t.filter(t=>(e.context.layout.collapsedIds.includes(t)||!o.has(t)&&a.includes(t))&&n.includes(t)),c=Object.fromEntries(Object.entries(e.context.layout.committedSizes).filter(([e])=>t.includes(e)&&r.includes(e))),l=t.includes(e.context.resize.activeId)&&i.includes(e.context.resize.activeId);return{context:{...e.context,collection:{ids:t,collapsibleIds:n,sizableIds:r,resizableIds:i},layout:{collapsedIds:s,committedSizes:c},authored:{collapsedIds:a},resize:l?e.context.resize:{activeId:``,initialSize:null,previewSize:null}}}},z=e=>{let t=S(e.event.ids),n=S(e.event.resizableIds);return!t.includes(e.context.resize.activeId)||!n.includes(e.context.resize.activeId)},ue=({props:e,context:t,effects:n})=>m({initial:`stable`,on:{DOM_INVALIDATED:{effects:`sync`}},states:{stable:{tags:[`stable`],on:{COLLAPSE:{target:`changing`,guard:k,reduce:L,effects:`prepareChange`},EXPAND:{target:`changing`,guard:k,reduce:L,effects:`prepareChange`},TOGGLE:{target:`changing`,guard:k,reduce:L,effects:`prepareChange`},SIZE:{target:`sizing`,guard:j,reduce:P,effects:`prepareSizing`},RESTORE_HIDDEN_SIZES:{guard:M,reduce:F},RESET_HIDDEN_SIZES:{target:`persisting`,guard:N,reduce:I,effects:[`sync`,`persist`]},RESIZE_START:{target:`resizing`,guard:A,reduce:`startResize`,effects:`beginResize`},PANELS_CHANGED:{reduce:R,effects:`sync`},PROPS_CHANGED:{reduce:`replaceProps`,effects:`sync`}}},changing:{tags:[`changing`,`transitioning`],on:{CHANGE_DONE:{target:`persisting`,effects:[`finishChange`,`persist`]},CHANGE_ERROR:{target:`persisting`,effects:[`finishChange`,`persist`]},COLLAPSE:{target:`changing`,guard:k,reduce:L,effects:`prepareChange`},EXPAND:{target:`changing`,guard:k,reduce:L,effects:`prepareChange`},TOGGLE:{target:`changing`,guard:k,reduce:L,effects:`prepareChange`},PANELS_CHANGED:{reduce:R,effects:`sync`},PROPS_CHANGED:{reduce:`replaceProps`,effects:`sync`}}},sizing:{tags:[`sizing`,`transitioning`],on:{SIZE_DONE:{target:`persisting`,effects:[`finishSizing`,`persist`]},SIZE_ERROR:{target:`persisting`,effects:[`finishSizing`,`persist`]},SIZE:{target:`sizing`,guard:j,reduce:P,effects:`prepareSizing`},RESIZE_START:{target:`resizing`,guard:A,reduce:`startResize`,effects:`beginResize`},PANELS_CHANGED:{reduce:R,effects:`sync`},PROPS_CHANGED:{reduce:`replaceProps`,effects:`sync`}}},resizing:{tags:[`resizing`],on:{RESIZE:{guard:`activeResize`,reduce:`previewResize`,effects:`previewResize`},RESIZE_END:{target:`persisting`,guard:`activeResize`,reduce:`commitResize`,effects:[`commitResize`,`persist`]},RESIZE_CANCEL:{target:`stable`,reduce:`clearResize`,effects:`cancelResize`},PANELS_CHANGED:[{target:`stable`,guard:z,reduce:R,effects:[`cancelResize`,`sync`]},{reduce:R,effects:`sync`}],PROPS_CHANGED:{reduce:`replaceProps`,effects:`sync`}}},persisting:{tags:[`persisting`],on:{PERSIST_DONE:`stable`,PERSIST_ERROR:`stable`,COLLAPSE:{target:`changing`,guard:k,reduce:L,effects:`prepareChange`},EXPAND:{target:`changing`,guard:k,reduce:L,effects:`prepareChange`},TOGGLE:{target:`changing`,guard:k,reduce:L,effects:`prepareChange`},SIZE:{target:`sizing`,guard:j,reduce:P,effects:`prepareSizing`},PANELS_CHANGED:{reduce:R,effects:`sync`},PROPS_CHANGED:{reduce:`replaceProps`,effects:`sync`}}}}},{props:e,context:t,reducers:{replaceProps:e=>({props:E(e.event,e.props)}),startResize:e=>{let t=w(e.event.size);return{context:{...e.context,resize:{activeId:C(e.event),initialSize:t,previewSize:t}}}},previewResize:e=>({context:{...e.context,resize:{...e.context.resize,previewSize:w(e.event.size)}}}),commitResize:e=>{let t=C(e.event),n=w(e.event.size);if(n!==null)return{context:{...e.context,layout:{...e.context.layout,committedSizes:{...e.context.layout.committedSizes,[t]:n}},resize:{activeId:``,initialSize:null,previewSize:null}}}},clearResize:e=>({context:{...e.context,resize:{activeId:``,initialSize:null,previewSize:null}}})},guards:{activeResize:e=>C(e.event)===e.context.resize.activeId&&w(e.event.size)!==null},effects:{prepareChange:n.prepareChange,finishChange:n.finishChange,sync:n.sync,beginResize:n.beginResize,previewResize:n.previewResize,commitResize:n.commitResize,cancelResize:n.cancelResize,prepareSizing:n.prepareSizing,finishSizing:n.finishSizing,persist:n.persist}}),B=p({definition:{component:`ui.panels`,parts:{root:{base:`relative flex h-full min-h-0 w-full min-w-0`,variants:{orientation:{horizontal:`flex-row`,vertical:`flex-col`}},defaults:{orientation:`horizontal`}},panel:{base:`relative min-w-0 overflow-hidden`,variants:{orientation:{horizontal:`h-full`,vertical:`w-full`},divider:{true:``,false:``},resize:{none:``,start:``,end:``}},defaults:{orientation:`horizontal`,divider:!0,resize:`none`}},expanded:{base:`h-full min-h-0 w-full min-w-0`},collapsed:{base:`flex h-full min-h-0 w-full min-w-0 items-center justify-center overflow-hidden`},resizeHandle:{base:[`absolute z-20 touch-none border-transparent outline-none`,`hover:border-intent-neutral-edge-hover focus-visible:ui-focus-ring-inset`,`data-resizing:border-intent-neutral-edge-strong`],variants:{orientation:{horizontal:`inset-y-0 w-panel-resize-handle cursor-col-resize`,vertical:`inset-x-0 h-panel-resize-handle cursor-row-resize`},edge:{start:``,end:``}},defaults:{orientation:`horizontal`,edge:`end`}},toggle:{base:`inline-flex size-control-md items-center justify-center outline-none focus-visible:ui-focus-ring-inset`},toggleIcon:{base:`size-icon-md shrink-0`}}}}),V=new Set,H=e=>e instanceof CustomEvent&&e.detail&&typeof e.detail==`object`?e.detail:{},de=(()=>{let e=!1;return()=>{if(e||typeof document>`u`)return;let t=e=>t=>{let n=H(t);n.__panelsNotification||!n.panelId||V.forEach(t=>{n.groupId&&n.groupId!==t.id||t.hasPanel(n.panelId)&&t.perform(n.action??e,n.panelId,n.trigger)})};document.addEventListener(`ui:panel-collapse`,t(`collapse`)),document.addEventListener(`ui:panel-expand`,t(`expand`)),document.addEventListener(`ui:panel-toggle`,t(`toggle`)),document.addEventListener(`ui:panel-size`,e=>{let t=H(e);t.__panelsNotification||!t.panelId||!Number.isFinite(t.size)||V.forEach(e=>{t.groupId&&t.groupId!==e.id||e.hasPanel(t.panelId)&&e.resize(t.panelId,t.size)})}),document.addEventListener(`ui:panels-reset`,e=>{let t=H(e);t.__panelsNotification||V.forEach(e=>{t.groupId&&t.groupId!==e.id||t.panelId&&!e.hasPanel(t.panelId)||e.reset(t.panelId)})}),e=!0}})(),U=e=>`trellis-ui:panels:${e}:v1`,fe=e=>typeof e!=`object`||!e||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`number`&&Number.isFinite(e[1]))),W=()=>{let n=null,i=null,a=null,o=`wide`,u=[],d=new Set,p=new Set,m=new Map,h=new Map,_=new Map,v=new Map,y=()=>{if(!n)throw Error(`Panels has not been initialized.`);return n},oe=e=>e.closest(`[data-ui-panels]`)===y(),b=()=>Array.from(y().children).flatMap(e=>{if(!(e instanceof HTMLElement)||!e.hasAttribute(`data-ui-panel`))return[];let t=e.querySelector(`:scope > [data-ui-panel-expanded]`);return!t||!oe(t)?[]:[{panel:e,expanded:t,collapsed:e.querySelector(`:scope > [data-ui-panel-collapsed]`),handle:e.querySelector(`:scope > [data-ui-panel-resize-handle]`),props:r({el:e,schema:ce})}]}),x=e=>b().find(t=>t.props.id===e)??null,S=()=>Q.getCommittedSnapshot().context,C=()=>Q.getCommittedSnapshot().props,w=e=>S().layout.collapsedIds.includes(e),T=()=>C().orientation===`horizontal`&&o===`stacked`,E=()=>T()?`vertical`:C().orientation,D=()=>y().dataset.orientation===`vertical`?`vertical`:`horizontal`,O=e=>{let t=e.getBoundingClientRect();return D()===`horizontal`?t.width:t.height},k=()=>{let e=b(),t=e.map(({props:e})=>e.id);if(t.some(e=>!e))throw Error(`Every Panel requires a stable id.`);if(new Set(t).size!==t.length)throw Error(`Panel ids must be unique within a Panels group.`);if(e.length>0&&!e.some(({props:e})=>e.size===`fill`))throw Error(`A Panels group requires at least one size="fill" Panel.`);if(e.some(({props:e})=>e.size===`fill`&&e.resize!==`none`))throw Error(`A size="fill" Panel cannot own a resize handle.`);return{ids:e.map(({props:e})=>e.id).filter(Boolean),collapsibleIds:e.filter(({props:e})=>e.id&&e.collapsible).map(({props:e})=>e.id),sizableIds:e.filter(({props:e})=>e.id&&e.size!==`fill`).map(({props:e})=>e.id),resizableIds:e.filter(({props:e})=>e.id&&e.size!==`fill`&&e.resize!==`none`).map(({props:e})=>e.id),authoredCollapsedIds:e.filter(({props:e})=>e.id&&e.collapsible&&e.defaultCollapsed).map(({props:e})=>e.id)}},A=e=>{let t=document.createElement(`div`);t.style.cssText=`position:absolute;visibility:hidden;pointer-events:none;inset:0 auto auto 0;`,D()===`horizontal`?t.style.width=`var(${e})`:t.style.height=`var(${e})`,y().append(t);let n=O(t);return t.remove(),n},j=e=>e.props.size===`fill`?{minimum:0,maximum:1/0}:{minimum:A(`--spacing-panel-${e.props.size}-min`),maximum:A(`--spacing-panel-${e.props.size}-max`)},M=(e,t)=>{let{minimum:n,maximum:r}=j(e);return Math.min(r,Math.max(n,t))},N=()=>{let e=k();return{collection:{ids:e.ids,collapsibleIds:e.collapsibleIds,sizableIds:e.sizableIds,resizableIds:e.resizableIds},layout:{collapsedIds:[...e.authoredCollapsedIds],committedSizes:{}},authored:{collapsedIds:e.authoredCollapsedIds},change:{openingIds:[],closingIds:[]},resize:{activeId:``,initialSize:null,previewSize:null},sizing:{changes:[]}}},P=(e,t,n)=>{D()===`horizontal`?(e.style.minWidth=t,e.style.maxWidth=n,e.style.minHeight=``,e.style.maxHeight=``):(e.style.minHeight=t,e.style.maxHeight=n,e.style.minWidth=``,e.style.maxWidth=``)},F=e=>{e.style.flex=``,e.style.minWidth=``,e.style.maxWidth=``,e.style.minHeight=``,e.style.maxHeight=``},I=(e,t)=>{if(T()){F(e.panel);return}if(t!==void 0){e.panel.style.flex=`0 0 ${t}px`,P(e.panel,`0px`,`none`);return}if(w(e.props.id)){if(S().authored.collapsedIds.includes(e.props.id)){F(e.panel);return}let t=e.collapsed?`var(--spacing-panel-collapsed)`:`0px`;e.panel.style.flex=`0 0 ${t}`,P(e.panel,t,t);return}if(e.props.size===`fill`){F(e.panel);return}let n=S().resize.activeId===e.props.id?S().resize.previewSize:S().layout.committedSizes[e.props.id];if(n==null){F(e.panel);return}let r=`${M(e,n)}px`;e.panel.style.flex=`0 1 ${r}`,P(e.panel,`var(--spacing-panel-${e.props.size}-min)`,`var(--spacing-panel-${e.props.size}-max)`)},L=(e,t)=>{e.toggleAttribute(`inert`,t),e.setAttribute(`aria-hidden`,t?`true`:`false`)},R=e=>{let t=C(),n=E(),r=w(e.props.id),i=Q.hasTag(`changing`)&&S().change.openingIds.includes(e.props.id),a=Q.hasTag(`changing`)&&S().change.closingIds.includes(e.props.id),o=!(r&&!a),s=r&&!a&&!i&&e.collapsed!==null;if(e.panel.dataset.state=r?`collapsed`:`expanded`,e.panel.dataset.orientation=n,e.panel.dataset.size=e.props.size,e.panel.dataset.resize=e.props.resize,e.panel.className=f({part:B.parts.panel,props:{orientation:n,divider:t.divider,resize:e.props.resize},className:e.props.class}),l({el:e.panel,attr:`data-collapsible`,present:e.props.collapsible}),l({el:e.panel,attr:`data-resizing`,present:S().resize.activeId===e.props.id}),I(e),e.expanded.hidden=!o,L(e.expanded,!o),e.collapsed&&(e.collapsed.hidden=!s,L(e.collapsed,!s)),e.handle){let t=T()||r||e.props.size===`fill`||e.props.resize===`none`;e.handle.dataset.orientation=n,e.handle.dataset.resizeEdge=e.props.resize,e.handle.setAttribute(`aria-label`,`Resize ${e.props.id} panel`),e.handle.toggleAttribute(`data-resize-disabled`,t),e.handle.hidden=T(),e.handle.className=f({part:B.parts.resizeHandle,props:{orientation:n,edge:e.props.resize},className:e.handle.dataset.class??``})}},z=e=>{e.forEach((t,n)=>{let r=e[n+1],i=t.props.resize===`end`||r?.props.resize===`start`;l({el:t.panel,attr:`data-divider`,present:C().divider&&r!==void 0&&!i})})},H=e=>{let t=e.dataset.target||``;if(!t){let t=e.closest(`[data-ui-panel]`),n=t?.closest(`[data-ui-panels]`),r=[...V].find(e=>e.id===n?.id),i=t&&r===$?x(t.id):null;return i&&r?{record:i,controller:r}:null}let n=e.dataset.groupId||e.closest(`[data-ui-panels]`)?.id,r=[...V].filter(e=>!n||e.id===n).find(e=>e.hasPanel(t)),i=r===$?x(t):null;return i&&r?{record:i,controller:r}:null},W=()=>{document.querySelectorAll(`[data-ui-panel-toggle]`).forEach(e=>{let t=H(e);if(!t||t.controller!==$)return;let n=w(t.record.props.id);e.dataset.target=t.record.props.id,e.dataset.groupId=C().id,e.dataset.state=n?`collapsed`:`expanded`,e.setAttribute(`aria-controls`,t.record.panel.id),e.setAttribute(`aria-expanded`,n?`false`:`true`),e.toggleAttribute(`disabled`,!t.record.props.collapsible)})},G=()=>{let e=C(),t=E();y().dataset.responsiveMode=o,y().dataset.layoutOrientation=t,y().style.flexDirection=t===`horizontal`?`row`:`column`,y().className=f({part:B.parts.root,props:{...e,orientation:t},className:e.class}),l({el:y(),attr:`data-resizing`,present:Q.hasTag(`resizing`)}),l({el:y(),attr:`data-transitioning`,present:Q.hasTag(`transitioning`)});let n=b();n.forEach(R),z(n),W()},pe=(e,t=!1)=>{let n=document.activeElement;if(!t&&(!(n instanceof HTMLElement)||!e.collapsed?.contains(n)))return;let r=_.get(e.props.id);r?.isConnected&&e.expanded.contains(r)?r.focus({preventScroll:!0}):(e.expanded.tabIndex=-1,e.expanded.focus({preventScroll:!0}))},K=(e,t=!1)=>{let n=document.activeElement;if(!t&&(!(n instanceof HTMLElement)||!e.expanded.contains(n)))return;let r=e.collapsed?re(e.collapsed)[0]:void 0,i=v.get(e.props.id),a=i?.isConnected&&!e.panel.contains(i)?i:void 0;r?r.focus({preventScroll:!0}):a?a.focus({preventScroll:!0}):(y().tabIndex=-1,y().focus({preventScroll:!0}))},me=()=>{let e=[...S().change.openingIds,...S().change.closingIds],t=new Set(S().change.openingIds.filter(e=>{let t=x(e),n=document.activeElement;return t!==null&&t.collapsed!==null&&n instanceof HTMLElement&&t.collapsed.contains(n)})),n=new Map(e.flatMap(e=>{let t=x(e);if(!t)return[];if(S().change.closingIds.includes(e)){let n=document.activeElement;n instanceof HTMLElement&&t.expanded.contains(n)&&_.set(e,n)}return[[e,O(t.panel)]]}));G(),S().change.openingIds.forEach(e=>{let n=x(e);n&&pe(n,t.has(e))}),e.forEach(e=>{let t=x(e),r=n.get(e);if(!t||r===void 0)return;let i=O(t.panel);h.set(e,{from:r,to:i}),I(t,r)})},he=()=>{let e=[...S().change.openingIds],t=[...S().change.closingIds],n=new Set(t.filter(e=>{let t=x(e),n=document.activeElement;return t!==null&&n instanceof HTMLElement&&t.expanded.contains(n)}));b().forEach(e=>I(e)),G(),t.forEach(e=>{let t=x(e);t&&K(t,n.has(e))}),e.forEach(e=>q(`ui:panel-expand`,e)),t.forEach(e=>q(`ui:panel-collapse`,e)),[...e,...t].forEach(e=>h.delete(e))},q=(e,t,n={})=>{c({el:y(),name:e,detail:{groupId:C().id,panelId:t,__panelsNotification:!0,...n}})},ge=()=>{let e=S().layout;if(C().persist)try{localStorage.setItem(U(C().id),JSON.stringify({collapsed:e.collapsedIds,sizes:e.committedSizes}))}catch{}c({el:y(),name:`ui:panels-layout-change`,detail:{groupId:C().id,collapsed:[...e.collapsedIds],sizes:{...e.committedSizes},__panelsNotification:!0}})},J=e=>{if(!n)return;if(Q.hasTag(`stable`)){e();return}let t=window.setTimeout(()=>{d.delete(t),J(e)},16);d.add(t)},Y=(e,t)=>{let n=e.find(e=>t(e)!==w(e));n&&(Q.send({type:t(n)?`COLLAPSE`:`EXPAND`,panelId:n}),J(()=>Y(e,t)))},_e=()=>{if(!C().persist)return;let e;try{e=JSON.parse(localStorage.getItem(U(C().id))??`null`)}catch{return}if(typeof e!=`object`||!e)return;let t=k(),n=new Set((Array.isArray(e.collapsed)?e.collapsed:[]).filter(e=>typeof e==`string`&&t.collapsibleIds.includes(e))),r=fe(e.sizes),i=()=>{Y(t.collapsibleIds,e=>n.has(e))},a=()=>{let e=t.sizableIds.flatMap(e=>{let t=x(e),n=r[e];if(!t||n===void 0)return[];let i=O(t.panel),a=M(t,n);return Math.abs(i-a)<.5?[]:[{panelId:e,from:i,to:a}]});if(T()){e.length>0&&Q.send({type:`RESTORE_HIDDEN_SIZES`,changes:e}),i();return}let n=e.filter(({panelId:e})=>w(e)),a=e.filter(({panelId:e})=>!w(e));if(n.length>0&&Q.send({type:`RESTORE_HIDDEN_SIZES`,changes:n}),a.length>0){Q.send({type:`SIZE`,changes:a}),J(i);return}i()},o=t.collapsibleIds.filter(e=>w(e)&&!n.has(e));o.length>0?(Y(o,()=>!1),J(a)):a()},ve=()=>{let e=requestAnimationFrame(()=>{p.delete(e);let t=requestAnimationFrame(()=>{p.delete(t),_e()});p.add(t)});p.add(e)},ye=e=>{let t=k(),n=e?t.ids.filter(t=>t===e):t.ids;if(n.length===0)return;let r=()=>{Y(n.filter(e=>t.collapsibleIds.includes(e)),e=>S().authored.collapsedIds.includes(e))},i=n.filter(e=>t.sizableIds.includes(e)&&Object.hasOwn(S().layout.committedSizes,e));if(T()){i.length>0?(Q.send({type:`RESET_HIDDEN_SIZES`,ids:i}),J(r)):r();return}let a=i.filter(w);a.length>0&&Q.send({type:`RESET_HIDDEN_SIZES`,ids:a});let o=i.filter(e=>!w(e)).flatMap(e=>{let t=x(e);return!t||t.props.size===`fill`?[]:[{panelId:e,from:O(t.panel),to:A(`--spacing-panel-${t.props.size}`),reset:!0}]});if(o.length>0){Q.send({type:`SIZE`,changes:o}),J(r);return}r()},be=()=>{S().sizing.changes.forEach(({panelId:e,from:t})=>{let n=x(e);n&&I(n,t)})},xe=()=>{S().sizing.changes.forEach(({panelId:e,to:t})=>{let n=x(e);n&&(I(n),q(`ui:panel-resize-end`,e,{size:t}))}),G()},Se=e=>{if(E()===`vertical`)return e===`start`?`negative`:`positive`;let t=s({el:y()});return e===`start`?t?`positive`:`negative`:t?`negative`:`positive`},X=()=>{let e=new Set(b().map(({panel:e})=>e));m.forEach((t,n)=>{e.has(n)||(t(),m.delete(n))}),b().forEach(e=>{if(m.has(e.panel)||!e.handle||e.props.size===`fill`||e.props.resize===`none`)return;let t=j(e),n=A(`--spacing-panel-resize-handle`),r=A(`--spacing-panel-resize-handle-coarse`);m.set(e.panel,ae({element:e.panel,handle:e.handle,axis:E()===`horizontal`?`x`:`y`,direction:Se(e.props.resize),min:t.minimum,max:t.maximum,mode:`onChange`,hitArea:n,coarseHitArea:r,disabled:()=>T()||w(e.props.id),onStart:t=>Q.send({type:`RESIZE_START`,panelId:e.props.id,size:Z(t)}),onResize:t=>Q.send({type:`RESIZE`,panelId:e.props.id,size:Z(t)}),onEnd:t=>Q.send({type:`RESIZE_END`,panelId:e.props.id,size:Z(t)})}))})},Ce=()=>{m.forEach(e=>e()),m.clear(),X()},Z=e=>E()===`horizontal`?e.previewWidth:e.previewHeight,we=e=>{let t=C().orientation===`horizontal`&&e<g(y(),`sm`)?`stacked`:`wide`;t!==o&&(o=t,G(),Ce())},Q=te({schema:se,hooks:le,resolveTransitionElement:({data:e})=>{let t=e?.panelId;return t?x(t)?.panel??null:y()},createMachine:({props:e})=>ue({props:e,context:N(),effects:{prepareChange:me,finishChange:he,sync:()=>{G(),Ce()},beginResize:()=>{G()},previewResize:()=>{let e=S().resize.activeId,t=x(e);t&&I(t);let n=S().resize.previewSize;n!==null&&q(`ui:panel-resize`,e,{size:n})},commitResize:e=>{G();let t=typeof e.event.panelId==`string`?e.event.panelId:``,n=S().layout.committedSizes[t];t&&n!==void 0&&q(`ui:panel-resize-end`,t,{size:n})},cancelResize:G,prepareSizing:be,finishSizing:xe,persist:ge}})}),Te=()=>{let e=k();Q.send({type:`PANELS_CHANGED`,...e}),X()},Ee=()=>{i=ie({targets:y(),read:k,onChange:Te,observer:{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`id`,`data-size`,`data-resize`,`data-collapsible`,`data-default-collapsed`]}})},$;return $={...Q,get id(){return y().id||C().id},get orientation(){return E()},get collapsed(){return[...S().layout.collapsedIds]},get sizes(){return{...S().layout.committedSizes}},get root(){let e=this.snapshot.current?.props??C();return ne({inputs:[f({part:B.parts.root,props:e,className:e.class}),{"data-ui-panels":``}]})},init(){n=this.$el,Q.connect(this.$el,this.snapshot),y().id||=C().id,o=C().orientation===`horizontal`&&y().getBoundingClientRect().width<g(y(),`sm`)?`stacked`:`wide`,V.add($),de(),G(),X(),a=new ResizeObserver(e=>{we(e[0]?.contentRect.width??y().clientWidth)}),a.observe(y()),Ee(),C().persist&&ve(),u.push(ee({target:y(),event:`keydown`,handler:()=>W()}))},destroy(){V.delete($),i?.(),i=null,a?.disconnect(),a=null,m.forEach(e=>e()),m.clear(),u.forEach(e=>e()),u=[],d.forEach(e=>window.clearTimeout(e)),d.clear(),p.forEach(e=>cancelAnimationFrame(e)),p.clear(),Q.disconnect(),n=null},transitionPanel(n){let r=n.data.panelId,i=x(r),a=h.get(r);return!i||!a||a.from===a.to?(i&&I(i,a?.to),e()):t(n,{target:i.panel,keyframes:{flexBasis:[`${a.from}px`,`${a.to}px`]},role:`layout`,cleanup:()=>I(i)})},transitionPanelSize(n){let{panelId:r,from:i,to:a}=n.data,o=x(r);return!o||i===a?(o&&I(o),e()):t(n,{target:o.panel,keyframes:{flexBasis:[`${i}px`,`${a}px`]},role:`layoutQuick`,cleanup:()=>I(o)})},hasPanel(e){return x(e)!==null},isCollapsed:w,collapse(e){Q.send({type:`COLLAPSE`,panelId:e})},expand(e){Q.send({type:`EXPAND`,panelId:e})},toggle(e){Q.send({type:`TOGGLE`,panelId:e})},resize(e,t){let n=x(e);if(T()||!n||n.props.size===`fill`||w(e)||!Number.isFinite(t))return;let r=O(n.panel),i=M(n,t);Math.abs(r-i)<.5||Q.send({type:`SIZE`,panelId:e,from:r,to:i})},reset(e){ye(e)},perform(e,t,n){n&&v.set(t,n),{collapse:this.collapse,expand:this.expand,toggle:this.toggle}[e](t)},syncToggles:W},$},G=()=>{let e={};return{get props(){return e},init(){e=r({el:this.$el,schema:x})},destroy(){},get root(){return ne({inputs:[f({part:B.parts.toggle,props:{},className:e.class}),{"data-ui-panel-toggle":``,":data-target":()=>e.target||void 0,":data-action":()=>e.action,"@click":e=>this.trigger(e)}]})},trigger(t){t?.preventDefault();let n=this.$el,r=n.closest(`[data-ui-panel]`),i=r?.closest(`[data-ui-panels]`),a=e.target||r?.id||``;a&&document.dispatchEvent(new CustomEvent(`ui:panel-toggle`,{detail:{panelId:a,groupId:i?.id,action:e.action,trigger:n}}))}}},pe=e=>{d(`UiPanels`,W)(e),d(`UiPanelToggle`,G)(e)},K=new WeakSet,me=e=>{K.has(e)||(K.add(e),n(e),h(e),pe(e))};export{G as n,W as r,me as t};
|
|
2
|
-
//# sourceMappingURL=entry.generated-qNEmG1Ht.js.map
|