@webquark/browser 0.0.0-stage → 1.1.0-dev.11
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/LICENSE +21 -0
- package/README.md +12 -2
- package/dist/cjs/Leaflet.GoogleMutant-i4bYl6qy.js +768 -0
- package/dist/cjs/action.props-DmLaQuU2.js +35 -0
- package/dist/cjs/chevron-up-D4t2OSHA.js +30 -0
- package/dist/cjs/collection-identity-CV5HLD9Z.js +141 -0
- package/dist/cjs/data-table-cell-8uUCk2Qz.js +51 -0
- package/dist/cjs/dom-Dk77oFF6.js +247 -0
- package/dist/cjs/field-CEZ9NsWK.js +14 -0
- package/dist/cjs/form-control-validity-D1ukC0_e.js +49 -0
- package/dist/cjs/form-field-adapter-D0CJ6poh.js +51 -0
- package/dist/cjs/form-field-state-P63wN30v.js +51 -0
- package/dist/cjs/form-submit-action-C6c4aq6C.js +227 -0
- package/dist/cjs/image-crop-BZD5Cxd7.js +53 -0
- package/dist/cjs/index-CMAcJ6t1.js +1869 -0
- package/dist/cjs/index.cjs.js +34 -0
- package/dist/cjs/leaflet-maplibre-gl-JIaCQ-7v.js +1025 -0
- package/dist/cjs/leaflet-src-mrRg-Srs.js +14551 -0
- package/dist/cjs/loader.cjs.js +12 -0
- package/dist/cjs/map.types-BWymIRql.js +24 -0
- package/dist/cjs/q-accordion.cjs.entry.js +18 -0
- package/dist/cjs/q-alert.cjs.entry.js +52 -0
- package/dist/cjs/q-avatar.cjs.entry.js +101 -0
- package/dist/cjs/q-banner.cjs.entry.js +19 -0
- package/dist/cjs/q-button_2.cjs.entry.js +462 -0
- package/dist/cjs/q-card.cjs.entry.js +88 -0
- package/dist/cjs/q-carousel.cjs.entry.js +718 -0
- package/dist/cjs/q-chip.cjs.entry.js +124 -0
- package/dist/cjs/q-conversation-bubble.cjs.entry.js +70 -0
- package/dist/cjs/q-data-table.cjs.entry.js +611 -0
- package/dist/cjs/q-dialog.cjs.entry.js +271 -0
- package/dist/cjs/q-divider.cjs.entry.js +26 -0
- package/dist/cjs/q-dropdown.cjs.entry.js +718 -0
- package/dist/cjs/q-form.cjs.entry.js +1002 -0
- package/dist/cjs/q-grid.cjs.entry.js +24 -0
- package/dist/cjs/q-icon.cjs.entry.js +439 -0
- package/dist/cjs/q-image-comparison.cjs.entry.js +201 -0
- package/dist/cjs/q-inline.cjs.entry.js +22 -0
- package/dist/cjs/q-input_2.cjs.entry.js +440 -0
- package/dist/cjs/q-link.cjs.entry.js +80 -0
- package/dist/cjs/q-map.cjs.entry.js +3509 -0
- package/dist/cjs/q-media.cjs.entry.js +21 -0
- package/dist/cjs/q-navbar.cjs.entry.js +415 -0
- package/dist/cjs/q-pagination.cjs.entry.js +68 -0
- package/dist/cjs/q-panel.cjs.entry.js +76 -0
- package/dist/cjs/q-quantity-selector.cjs.entry.js +204 -0
- package/dist/cjs/q-radio-group.cjs.entry.js +261 -0
- package/dist/cjs/q-reel.cjs.entry.js +170 -0
- package/dist/cjs/q-scrollable.cjs.entry.js +449 -0
- package/dist/cjs/q-section.cjs.entry.js +20 -0
- package/dist/cjs/q-sidepanel.cjs.entry.js +793 -0
- package/dist/cjs/q-stack.cjs.entry.js +20 -0
- package/dist/cjs/q-step-diagram-item.cjs.entry.js +45 -0
- package/dist/cjs/q-step-diagram.cjs.entry.js +56 -0
- package/dist/cjs/q-syntax-box.cjs.entry.js +782 -0
- package/dist/cjs/q-tabs.cjs.entry.js +155 -0
- package/dist/cjs/q-textarea.cjs.entry.js +297 -0
- package/dist/cjs/q-thumbnail.cjs.entry.js +51 -0
- package/dist/cjs/q-toast.cjs.entry.js +400 -0
- package/dist/cjs/q-toggle.cjs.entry.js +233 -0
- package/dist/cjs/q-toolbar.cjs.entry.js +33 -0
- package/dist/cjs/registry-CzkkkaZO.js +323 -0
- package/dist/cjs/toast-controller-CIXagxbV.js +111 -0
- package/dist/cjs/tokens-Cd7g-VMz.js +960 -0
- package/dist/cjs/utils-DGQOjEwT.js +33 -0
- package/dist/cjs/webquark.cjs.js +24 -0
- package/dist/collection/assets/icons/braces.svg +14 -0
- package/dist/collection/assets/icons/check.svg +1 -0
- package/dist/collection/assets/icons/chevron-down.svg +1 -0
- package/dist/collection/assets/icons/chevron-left.svg +1 -0
- package/dist/collection/assets/icons/chevron-right.svg +1 -0
- package/dist/collection/assets/icons/chevron-up.svg +1 -0
- package/dist/collection/assets/icons/copy.svg +4 -0
- package/dist/collection/assets/icons/eye-off.svg +1 -0
- package/dist/collection/assets/icons/eye.svg +1 -0
- package/dist/collection/assets/icons/minus.svg +1 -0
- package/dist/collection/assets/icons/play.svg +1 -0
- package/dist/collection/assets/icons/plus.svg +1 -0
- package/dist/collection/assets/icons/search.svg +1 -0
- package/dist/collection/assets/icons/spinner.svg +1 -0
- package/dist/collection/assets/icons/trash-2.svg +1 -0
- package/dist/collection/assets/icons/x.svg +1 -0
- package/dist/collection/collection-manifest.json +57 -0
- package/dist/collection/components/actions/action.props.js +130 -0
- package/dist/collection/components/actions/button/button.css +242 -0
- package/dist/collection/components/actions/button/button.js +748 -0
- package/dist/collection/components/actions/button/button.types.js +1 -0
- package/dist/collection/components/actions/button/button.utils.js +9 -0
- package/dist/collection/components/actions/button/test/button-slots.cmp.test.js +70 -0
- package/dist/collection/components/actions/button/test/button.utils.unit.test.js +44 -0
- package/dist/collection/components/actions/link/link.css +102 -0
- package/dist/collection/components/actions/link/link.js +316 -0
- package/dist/collection/components/actions/link/link.types.js +1 -0
- package/dist/collection/components/communication/alert/alert.css +118 -0
- package/dist/collection/components/communication/alert/alert.js +208 -0
- package/dist/collection/components/communication/alert/alert.types.js +1 -0
- package/dist/collection/components/communication/conversation-bubble/conversation-bubble.css +154 -0
- package/dist/collection/components/communication/conversation-bubble/conversation-bubble.js +207 -0
- package/dist/collection/components/communication/conversation-bubble/conversation-bubble.types.js +1 -0
- package/dist/collection/components/communication/toast/internals/icons.js +25 -0
- package/dist/collection/components/communication/toast/internals/queue.js +64 -0
- package/dist/collection/components/communication/toast/internals/timers.js +75 -0
- package/dist/collection/components/communication/toast/test/toast.cmp.test.js +38 -0
- package/dist/collection/components/communication/toast/test/toast.unit.test.js +104 -0
- package/dist/collection/components/communication/toast/toast-controller.js +105 -0
- package/dist/collection/components/communication/toast/toast.css +141 -0
- package/dist/collection/components/communication/toast/toast.js +556 -0
- package/dist/collection/components/communication/toast/toast.types.js +1 -0
- package/dist/collection/components/content/banner/banner.css +1 -0
- package/dist/collection/components/content/banner/banner.js +84 -0
- package/dist/collection/components/content/banner/banner.types.js +1 -0
- package/dist/collection/components/content/card/card.css +105 -0
- package/dist/collection/components/content/card/card.js +308 -0
- package/dist/collection/components/content/card/card.types.js +1 -0
- package/dist/collection/components/content/card/card.utils.js +15 -0
- package/dist/collection/components/content/carousel/carousel.css +254 -0
- package/dist/collection/components/content/carousel/carousel.js +956 -0
- package/dist/collection/components/content/carousel/carousel.types.js +1 -0
- package/dist/collection/components/content/carousel/carousel.utils.js +1 -0
- package/dist/collection/components/content/carousel/internals/autoplay.js +64 -0
- package/dist/collection/components/content/carousel/internals/metrics.js +59 -0
- package/dist/collection/components/content/carousel/internals/slide-state.js +50 -0
- package/dist/collection/components/content/carousel/test/transitions.cmp.test.js +328 -0
- package/dist/collection/components/data-display/accordion/accordion.css +1 -0
- package/dist/collection/components/data-display/accordion/accordion.js +54 -0
- package/dist/collection/components/data-display/accordion/accordion.types.js +1 -0
- package/dist/collection/components/data-display/chip/chip.css +219 -0
- package/dist/collection/components/data-display/chip/chip.js +381 -0
- package/dist/collection/components/data-display/chip/chip.types.js +1 -0
- package/dist/collection/components/data-display/data-table/data-table-cell.js +44 -0
- package/dist/collection/components/data-display/data-table/data-table.css +429 -0
- package/dist/collection/components/data-display/data-table/data-table.js +862 -0
- package/dist/collection/components/data-display/data-table/data-table.types.js +1 -0
- package/dist/collection/components/data-display/data-table/internals/data-access.js +43 -0
- package/dist/collection/components/data-display/data-table/internals/render-row-actions.js +22 -0
- package/dist/collection/components/data-display/data-table/internals/render-sort-indicator.js +5 -0
- package/dist/collection/components/data-display/data-table/internals/render-table-body.js +59 -0
- package/dist/collection/components/data-display/data-table/internals/render-table-head.js +42 -0
- package/dist/collection/components/data-display/data-table/internals/render-toolbar.js +6 -0
- package/dist/collection/components/data-display/data-table/internals/row-events.js +27 -0
- package/dist/collection/components/data-display/data-table/internals/selection.js +31 -0
- package/dist/collection/components/data-display/data-table/internals/sort.js +57 -0
- package/dist/collection/components/data-display/data-table/internals/table-model.js +92 -0
- package/dist/collection/components/data-display/data-table/test/row-gutter.cmp.test.js +104 -0
- package/dist/collection/components/data-display/data-table/test/two-line-rows.cmp.test.js +164 -0
- package/dist/collection/components/data-display/map/internals/base-layer.js +140 -0
- package/dist/collection/components/data-display/map/internals/bounds.js +66 -0
- package/dist/collection/components/data-display/map/internals/buffered-tile-layer.js +128 -0
- package/dist/collection/components/data-display/map/internals/cluster-collision.js +73 -0
- package/dist/collection/components/data-display/map/internals/google-maps.js +117 -0
- package/dist/collection/components/data-display/map/internals/google-mutant.js +51 -0
- package/dist/collection/components/data-display/map/internals/maplibre.js +50 -0
- package/dist/collection/components/data-display/map/internals/marker-cluster-index.js +136 -0
- package/dist/collection/components/data-display/map/internals/marker-controller.js +425 -0
- package/dist/collection/components/data-display/map/internals/marker-presentation.js +266 -0
- package/dist/collection/components/data-display/map/internals/marker-visibility.js +158 -0
- package/dist/collection/components/data-display/map/internals/markers.js +191 -0
- package/dist/collection/components/data-display/map/internals/tile-layer-readiness.js +67 -0
- package/dist/collection/components/data-display/map/internals/tile-preload-buffer.js +8 -0
- package/dist/collection/components/data-display/map/internals/vector-padding.js +8 -0
- package/dist/collection/components/data-display/map/map.css +742 -0
- package/dist/collection/components/data-display/map/map.js +1595 -0
- package/dist/collection/components/data-display/map/map.types.js +12 -0
- package/dist/collection/components/data-display/map/test/map.cmp.test.js +961 -0
- package/dist/collection/components/data-display/pagination/pagination.css +81 -0
- package/dist/collection/components/data-display/pagination/pagination.js +240 -0
- package/dist/collection/components/data-display/pagination/test/pagination.cmp.test.js +57 -0
- package/dist/collection/components/data-display/syntax-box/internals/clipboard.js +9 -0
- package/dist/collection/components/data-display/syntax-box/internals/editor-key-action.js +14 -0
- package/dist/collection/components/data-display/syntax-box/internals/formatter.js +156 -0
- package/dist/collection/components/data-display/syntax-box/internals/formatter.unit.test.js +71 -0
- package/dist/collection/components/data-display/syntax-box/internals/syntax.js +239 -0
- package/dist/collection/components/data-display/syntax-box/internals/syntax.unit.test.js +134 -0
- package/dist/collection/components/data-display/syntax-box/internals/value-sync.js +10 -0
- package/dist/collection/components/data-display/syntax-box/internals/value-sync.unit.test.js +25 -0
- package/dist/collection/components/data-display/syntax-box/syntax-box.css +209 -0
- package/dist/collection/components/data-display/syntax-box/syntax-box.js +678 -0
- package/dist/collection/components/data-display/syntax-box/syntax-box.types.js +1 -0
- package/dist/collection/components/data-display/syntax-box/syntax-box.utils.js +1 -0
- package/dist/collection/components/data-display/syntax-box/test/format-fixtures.js +20 -0
- package/dist/collection/components/data-display/syntax-box/test/syntax-box.cmp.test.js +241 -0
- package/dist/collection/components/data-display/syntax-box/test/syntax-fixtures.js +14 -0
- package/dist/collection/components/data-display/syntax-box/test/syntax-format.cmp.test.js +157 -0
- package/dist/collection/components/indicators/progress/progress.css +223 -0
- package/dist/collection/components/indicators/progress/progress.js +275 -0
- package/dist/collection/components/indicators/progress/progress.types.js +1 -0
- package/dist/collection/components/indicators/step-diagram/step-diagram.css +21 -0
- package/dist/collection/components/indicators/step-diagram/step-diagram.js +143 -0
- package/dist/collection/components/indicators/step-diagram/step-diagram.types.js +1 -0
- package/dist/collection/components/indicators/step-diagram-item/step-diagram-item.css +252 -0
- package/dist/collection/components/indicators/step-diagram-item/step-diagram-item.js +185 -0
- package/dist/collection/components/indicators/step-diagram-item/step-diagram-item.types.js +1 -0
- package/dist/collection/components/indicators/step-diagram-item/step-diagram-item.utils.js +3 -0
- package/dist/collection/components/inputs/dropdown/dropdown.css +420 -0
- package/dist/collection/components/inputs/dropdown/dropdown.js +1303 -0
- package/dist/collection/components/inputs/dropdown/dropdown.types.js +1 -0
- package/dist/collection/components/inputs/dropdown/internals/options.js +30 -0
- package/dist/collection/components/inputs/dropdown/internals/position.js +35 -0
- package/dist/collection/components/inputs/dropdown/test/dropdown.cmp.test.js +90 -0
- package/dist/collection/components/inputs/dropdown/test/search-mode.cmp.test.js +186 -0
- package/dist/collection/components/inputs/form/form.css +85 -0
- package/dist/collection/components/inputs/form/form.js +808 -0
- package/dist/collection/components/inputs/form/form.types.js +1 -0
- package/dist/collection/components/inputs/form/internals/controls.js +173 -0
- package/dist/collection/components/inputs/form/internals/enter-behavior.js +25 -0
- package/dist/collection/components/inputs/form/internals/field-state.js +129 -0
- package/dist/collection/components/inputs/form/internals/reset.js +50 -0
- package/dist/collection/components/inputs/form/internals/submission.js +140 -0
- package/dist/collection/components/inputs/form/internals/values.js +199 -0
- package/dist/collection/components/inputs/form/internals/values.unit.test.js +59 -0
- package/dist/collection/components/inputs/form/test/form-reset-state.cmp.test.js +559 -0
- package/dist/collection/components/inputs/form/test/form-submit-transport.cmp.test.js +352 -0
- package/dist/collection/components/inputs/form/test/form-submit.cmp.test.js +444 -0
- package/dist/collection/components/inputs/form/test/form-values.cmp.test.js +440 -0
- package/dist/collection/components/inputs/form/test/form.cmp.test.js +157 -0
- package/dist/collection/components/inputs/input/input.css +313 -0
- package/dist/collection/components/inputs/input/input.js +935 -0
- package/dist/collection/components/inputs/input/input.types.js +1 -0
- package/dist/collection/components/inputs/input/input.utils.js +3 -0
- package/dist/collection/components/inputs/quantity-selector/internals/number-value.js +64 -0
- package/dist/collection/components/inputs/quantity-selector/quantity-selector.css +171 -0
- package/dist/collection/components/inputs/quantity-selector/quantity-selector.js +390 -0
- package/dist/collection/components/inputs/quantity-selector/quantity-selector.types.js +1 -0
- package/dist/collection/components/inputs/radio-group/radio-group.css +224 -0
- package/dist/collection/components/inputs/radio-group/radio-group.js +668 -0
- package/dist/collection/components/inputs/radio-group/radio-group.types.js +1 -0
- package/dist/collection/components/inputs/radio-group/radio-group.utils.js +18 -0
- package/dist/collection/components/inputs/textarea/textarea.css +192 -0
- package/dist/collection/components/inputs/textarea/textarea.js +827 -0
- package/dist/collection/components/inputs/textarea/textarea.types.js +1 -0
- package/dist/collection/components/inputs/toggle/test/toggle-layout.cmp.test.js +69 -0
- package/dist/collection/components/inputs/toggle/toggle.css +257 -0
- package/dist/collection/components/inputs/toggle/toggle.js +610 -0
- package/dist/collection/components/inputs/toggle/toggle.types.js +1 -0
- package/dist/collection/components/inputs/toggle/toggle.utils.js +3 -0
- package/dist/collection/components/layout/divider/divider.css +40 -0
- package/dist/collection/components/layout/divider/divider.js +121 -0
- package/dist/collection/components/layout/divider/test/divider.cmp.test.js +105 -0
- package/dist/collection/components/layout/grid/grid.css +11 -0
- package/dist/collection/components/layout/grid/grid.js +152 -0
- package/dist/collection/components/layout/inline/inline.css +4 -0
- package/dist/collection/components/layout/inline/inline.js +118 -0
- package/dist/collection/components/layout/navbar/navbar.css +584 -0
- package/dist/collection/components/layout/navbar/navbar.js +848 -0
- package/dist/collection/components/layout/navbar/navbar.types.js +1 -0
- package/dist/collection/components/layout/navbar/navbar.utils.js +13 -0
- package/dist/collection/components/layout/navbar/test/navbar.cmp.test.js +369 -0
- package/dist/collection/components/layout/panel/panel.css +114 -0
- package/dist/collection/components/layout/panel/panel.js +394 -0
- package/dist/collection/components/layout/panel/panel.types.js +1 -0
- package/dist/collection/components/layout/scrollable/internals/metrics.js +61 -0
- package/dist/collection/components/layout/scrollable/internals/native-scrollbar.js +41 -0
- package/dist/collection/components/layout/scrollable/scrollable.css +123 -0
- package/dist/collection/components/layout/scrollable/scrollable.js +565 -0
- package/dist/collection/components/layout/scrollable/scrollable.types.js +1 -0
- package/dist/collection/components/layout/section/section.css +1 -0
- package/dist/collection/components/layout/section/section.js +98 -0
- package/dist/collection/components/layout/section/section.types.js +1 -0
- package/dist/collection/components/layout/sidepanel/internals/drawer.js +98 -0
- package/dist/collection/components/layout/sidepanel/internals/groups.js +56 -0
- package/dist/collection/components/layout/sidepanel/internals/nav-items.js +30 -0
- package/dist/collection/components/layout/sidepanel/sidepanel.css +1035 -0
- package/dist/collection/components/layout/sidepanel/sidepanel.js +1001 -0
- package/dist/collection/components/layout/sidepanel/sidepanel.types.js +1 -0
- package/dist/collection/components/layout/sidepanel/sidepanel.utils.js +17 -0
- package/dist/collection/components/layout/sidepanel/test/nav-drawer-transitions.cmp.test.js +120 -0
- package/dist/collection/components/layout/sidepanel/test/panel-transitions.cmp.test.js +180 -0
- package/dist/collection/components/layout/stack/stack.css +4 -0
- package/dist/collection/components/layout/stack/stack.js +76 -0
- package/dist/collection/components/layout/tabs/tabs.css +248 -0
- package/dist/collection/components/layout/tabs/tabs.js +322 -0
- package/dist/collection/components/layout/tabs/tabs.types.js +1 -0
- package/dist/collection/components/layout/tabs/tabs.utils.js +31 -0
- package/dist/collection/components/layout/tabs/test/tabs.cmp.test.js +165 -0
- package/dist/collection/components/layout/toolbar/toolbar.css +168 -0
- package/dist/collection/components/layout/toolbar/toolbar.js +251 -0
- package/dist/collection/components/layout/toolbar/toolbar.types.js +1 -0
- package/dist/collection/components/media/avatar/avatar.css +71 -0
- package/dist/collection/components/media/avatar/avatar.js +302 -0
- package/dist/collection/components/media/avatar/avatar.types.js +1 -0
- package/dist/collection/components/media/icon/icon.css +42 -0
- package/dist/collection/components/media/icon/icon.js +510 -0
- package/dist/collection/components/media/icon/icon.types.js +1 -0
- package/dist/collection/components/media/icon/internals/constants.js +3 -0
- package/dist/collection/components/media/icon/internals/fetch-icon.js +47 -0
- package/dist/collection/components/media/icon/internals/fetch-icon.unit.test.js +51 -0
- package/dist/collection/components/media/icon/internals/policy.js +184 -0
- package/dist/collection/components/media/icon/internals/policy.unit.test.js +65 -0
- package/dist/collection/components/media/icon/internals/registry-lucide.unit.test.js +78 -0
- package/dist/collection/components/media/icon/internals/registry.js +122 -0
- package/dist/collection/components/media/icon/internals/registry.unit.test.js +42 -0
- package/dist/collection/components/media/icon/internals/render-definition.js +24 -0
- package/dist/collection/components/media/icon/internals/sanitize-svg.js +86 -0
- package/dist/collection/components/media/icon/internals/size.js +12 -0
- package/dist/collection/components/media/icon/internals/url.js +52 -0
- package/dist/collection/components/media/icon/internals/url.unit.test.js +34 -0
- package/dist/collection/components/media/icon/test/icon-fixtures.js +47 -0
- package/dist/collection/components/media/icon/test/icon.cmp.test.js +223 -0
- package/dist/collection/components/media/image-comparison/image-comparison.css +124 -0
- package/dist/collection/components/media/image-comparison/image-comparison.js +468 -0
- package/dist/collection/components/media/image-comparison/test/image-comparison.cmp.test.js +234 -0
- package/dist/collection/components/media/media/media.css +1 -0
- package/dist/collection/components/media/media/media.js +125 -0
- package/dist/collection/components/media/media/media.types.js +1 -0
- package/dist/collection/components/media/reel/reel.css +193 -0
- package/dist/collection/components/media/reel/reel.js +279 -0
- package/dist/collection/components/media/reel/reel.types.js +1 -0
- package/dist/collection/components/media/thumbnail/thumbnail.css +111 -0
- package/dist/collection/components/media/thumbnail/thumbnail.js +184 -0
- package/dist/collection/components/media/thumbnail/thumbnail.types.js +1 -0
- package/dist/collection/components/overlays/dialog/dialog.css +264 -0
- package/dist/collection/components/overlays/dialog/dialog.js +743 -0
- package/dist/collection/components/overlays/dialog/dialog.types.js +1 -0
- package/dist/collection/components/overlays/dialog/internals/backdrop.js +9 -0
- package/dist/collection/components/overlays/dialog/internals/lifecycle.js +53 -0
- package/dist/collection/components/overlays/tooltip/internals/aria.js +27 -0
- package/dist/collection/components/overlays/tooltip/internals/positioning.js +84 -0
- package/dist/collection/components/overlays/tooltip/internals/scroll-listeners.js +18 -0
- package/dist/collection/components/overlays/tooltip/tooltip.css +69 -0
- package/dist/collection/components/overlays/tooltip/tooltip.js +196 -0
- package/dist/collection/components/overlays/tooltip/tooltip.types.js +1 -0
- package/dist/collection/components/shared/field.js +8 -0
- package/dist/collection/components/shared/test/orientation.cmp.test.js +36 -0
- package/dist/collection/index.js +16 -0
- package/dist/collection/native-content.css +24 -0
- package/dist/collection/theme/test/foundation.cmp.test.js +353 -0
- package/dist/collection/theme/test/input-width.cmp.test.js +117 -0
- package/dist/collection/theme/test/presets.cmp.test.js +129 -0
- package/dist/collection/theme/test/presets.unit.test.js +58 -0
- package/dist/collection/theme/tokens.js +963 -0
- package/dist/collection/utils/collection-identity.js +136 -0
- package/dist/collection/utils/collection-identity.unit.test.js +107 -0
- package/dist/collection/utils/dom.js +236 -0
- package/dist/collection/utils/form-control-validity.js +44 -0
- package/dist/collection/utils/form-field-adapter.js +44 -0
- package/dist/collection/utils/form-field-state.js +45 -0
- package/dist/collection/utils/form-reset-action.js +60 -0
- package/dist/collection/utils/form-submit-action.js +151 -0
- package/dist/collection/utils/form-submit-action.unit.test.js +15 -0
- package/dist/collection/utils/image-crop.js +47 -0
- package/dist/collection/utils/image-crop.unit.test.js +57 -0
- package/dist/collection/utils/math.js +19 -0
- package/dist/collection/utils/utils.js +28 -0
- package/dist/collection/utils/utils.unit.test.js +16 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/p--r63tfQH.js +1 -0
- package/dist/components/p-0feRVg70.js +1 -0
- package/dist/components/p-BDsIecIx.js +1 -0
- package/dist/components/p-BIIQL66b.js +1 -0
- package/dist/components/p-BJiYCN3i.js +1 -0
- package/dist/components/p-BOdNg0jc.js +1 -0
- package/dist/components/p-BcL0NVv0.js +1 -0
- package/dist/components/p-Bj2RJb2E.js +1 -0
- package/dist/components/p-ByfrUWx1.js +1 -0
- package/dist/components/p-CGZPmEUB.js +1 -0
- package/dist/components/p-CGml_DQ8.js +1 -0
- package/dist/components/p-CLErjC1f.js +1 -0
- package/dist/components/p-CSucjZb7.js +1 -0
- package/dist/components/p-CYG3Oakz.js +1 -0
- package/dist/components/p-C_RztzNv.js +5 -0
- package/dist/components/p-CoIMrUb3.js +1 -0
- package/dist/components/p-CpI3m4_T.js +1 -0
- package/dist/components/p-DBbiaYqQ.js +1 -0
- package/dist/components/p-DKrPmn2y.js +13 -0
- package/dist/components/p-DQhiqYeq.js +1 -0
- package/dist/components/p-DYMWBqU1.js +5 -0
- package/dist/components/p-DbI_F3z0.js +1 -0
- package/dist/components/p-DstNl_WY.js +1 -0
- package/dist/components/p-DuX-9GOi.js +1 -0
- package/dist/components/p-SzKf4WZF.js +1 -0
- package/dist/components/p-cSh-5xis.js +1 -0
- package/dist/components/p-iXEnb5d5.js +1 -0
- package/dist/components/q-accordion.d.ts +11 -0
- package/dist/components/q-accordion.js +1 -0
- package/dist/components/q-alert.d.ts +11 -0
- package/dist/components/q-alert.js +1 -0
- package/dist/components/q-avatar.d.ts +11 -0
- package/dist/components/q-avatar.js +1 -0
- package/dist/components/q-banner.d.ts +11 -0
- package/dist/components/q-banner.js +1 -0
- package/dist/components/q-button.d.ts +11 -0
- package/dist/components/q-button.js +1 -0
- package/dist/components/q-card.d.ts +11 -0
- package/dist/components/q-card.js +1 -0
- package/dist/components/q-carousel.d.ts +11 -0
- package/dist/components/q-carousel.js +1 -0
- package/dist/components/q-chip.d.ts +11 -0
- package/dist/components/q-chip.js +1 -0
- package/dist/components/q-conversation-bubble.d.ts +11 -0
- package/dist/components/q-conversation-bubble.js +1 -0
- package/dist/components/q-data-table.d.ts +11 -0
- package/dist/components/q-data-table.js +1 -0
- package/dist/components/q-dialog.d.ts +11 -0
- package/dist/components/q-dialog.js +1 -0
- package/dist/components/q-divider.d.ts +11 -0
- package/dist/components/q-divider.js +1 -0
- package/dist/components/q-dropdown.d.ts +11 -0
- package/dist/components/q-dropdown.js +1 -0
- package/dist/components/q-form.d.ts +11 -0
- package/dist/components/q-form.js +1 -0
- package/dist/components/q-grid.d.ts +11 -0
- package/dist/components/q-grid.js +1 -0
- package/dist/components/q-icon.d.ts +11 -0
- package/dist/components/q-icon.js +1 -0
- package/dist/components/q-image-comparison.d.ts +11 -0
- package/dist/components/q-image-comparison.js +1 -0
- package/dist/components/q-inline.d.ts +11 -0
- package/dist/components/q-inline.js +1 -0
- package/dist/components/q-input.d.ts +11 -0
- package/dist/components/q-input.js +1 -0
- package/dist/components/q-link.d.ts +11 -0
- package/dist/components/q-link.js +1 -0
- package/dist/components/q-map.d.ts +11 -0
- package/dist/components/q-map.js +1 -0
- package/dist/components/q-media.d.ts +11 -0
- package/dist/components/q-media.js +1 -0
- package/dist/components/q-navbar.d.ts +11 -0
- package/dist/components/q-navbar.js +1 -0
- package/dist/components/q-pagination.d.ts +11 -0
- package/dist/components/q-pagination.js +1 -0
- package/dist/components/q-panel.d.ts +11 -0
- package/dist/components/q-panel.js +1 -0
- package/dist/components/q-progress.d.ts +11 -0
- package/dist/components/q-progress.js +1 -0
- package/dist/components/q-quantity-selector.d.ts +11 -0
- package/dist/components/q-quantity-selector.js +1 -0
- package/dist/components/q-radio-group.d.ts +11 -0
- package/dist/components/q-radio-group.js +1 -0
- package/dist/components/q-reel.d.ts +11 -0
- package/dist/components/q-reel.js +1 -0
- package/dist/components/q-scrollable.d.ts +11 -0
- package/dist/components/q-scrollable.js +1 -0
- package/dist/components/q-section.d.ts +11 -0
- package/dist/components/q-section.js +1 -0
- package/dist/components/q-sidepanel.d.ts +11 -0
- package/dist/components/q-sidepanel.js +13 -0
- package/dist/components/q-stack.d.ts +11 -0
- package/dist/components/q-stack.js +1 -0
- package/dist/components/q-step-diagram-item.d.ts +11 -0
- package/dist/components/q-step-diagram-item.js +1 -0
- package/dist/components/q-step-diagram.d.ts +11 -0
- package/dist/components/q-step-diagram.js +1 -0
- package/dist/components/q-syntax-box.d.ts +11 -0
- package/dist/components/q-syntax-box.js +13 -0
- package/dist/components/q-tabs.d.ts +11 -0
- package/dist/components/q-tabs.js +1 -0
- package/dist/components/q-textarea.d.ts +11 -0
- package/dist/components/q-textarea.js +1 -0
- package/dist/components/q-thumbnail.d.ts +11 -0
- package/dist/components/q-thumbnail.js +1 -0
- package/dist/components/q-toast.d.ts +11 -0
- package/dist/components/q-toast.js +1 -0
- package/dist/components/q-toggle.d.ts +11 -0
- package/dist/components/q-toggle.js +1 -0
- package/dist/components/q-toolbar.d.ts +11 -0
- package/dist/components/q-toolbar.js +1 -0
- package/dist/components/q-tooltip.d.ts +11 -0
- package/dist/components/q-tooltip.js +1 -0
- package/dist/esm/Leaflet.GoogleMutant-MpxOb4Jm.js +766 -0
- package/dist/esm/action.props-DhnvhbLl.js +32 -0
- package/dist/esm/chevron-up-DKrPmn2y.js +27 -0
- package/dist/esm/collection-identity-CGZPmEUB.js +138 -0
- package/dist/esm/data-table-cell-SzKf4WZF.js +46 -0
- package/dist/esm/dom-ByfrUWx1.js +238 -0
- package/dist/esm/field-u-k7C7Rf.js +11 -0
- package/dist/esm/form-control-validity-Bj2RJb2E.js +46 -0
- package/dist/esm/form-field-adapter-CGml_DQ8.js +46 -0
- package/dist/esm/form-field-state-DstNl_WY.js +47 -0
- package/dist/esm/form-submit-action-CoEIvDqE.js +213 -0
- package/dist/esm/image-crop-BcL0NVv0.js +49 -0
- package/dist/esm/index-DaJmsCb7.js +1858 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/leaflet-maplibre-gl-BvKlNmWf.js +1020 -0
- package/dist/esm/leaflet-src-DYMWBqU1.js +14547 -0
- package/dist/esm/loader.js +10 -0
- package/dist/esm/map.types-CoIMrUb3.js +14 -0
- package/dist/esm/q-accordion.entry.js +16 -0
- package/dist/esm/q-alert.entry.js +50 -0
- package/dist/esm/q-avatar.entry.js +99 -0
- package/dist/esm/q-banner.entry.js +17 -0
- package/dist/esm/q-button_2.entry.js +459 -0
- package/dist/esm/q-card.entry.js +86 -0
- package/dist/esm/q-carousel.entry.js +716 -0
- package/dist/esm/q-chip.entry.js +122 -0
- package/dist/esm/q-conversation-bubble.entry.js +68 -0
- package/dist/esm/q-data-table.entry.js +609 -0
- package/dist/esm/q-dialog.entry.js +269 -0
- package/dist/esm/q-divider.entry.js +24 -0
- package/dist/esm/q-dropdown.entry.js +716 -0
- package/dist/esm/q-form.entry.js +1000 -0
- package/dist/esm/q-grid.entry.js +22 -0
- package/dist/esm/q-icon.entry.js +437 -0
- package/dist/esm/q-image-comparison.entry.js +199 -0
- package/dist/esm/q-inline.entry.js +20 -0
- package/dist/esm/q-input_2.entry.js +437 -0
- package/dist/esm/q-link.entry.js +78 -0
- package/dist/esm/q-map.entry.js +3507 -0
- package/dist/esm/q-media.entry.js +19 -0
- package/dist/esm/q-navbar.entry.js +413 -0
- package/dist/esm/q-pagination.entry.js +66 -0
- package/dist/esm/q-panel.entry.js +74 -0
- package/dist/esm/q-quantity-selector.entry.js +202 -0
- package/dist/esm/q-radio-group.entry.js +259 -0
- package/dist/esm/q-reel.entry.js +168 -0
- package/dist/esm/q-scrollable.entry.js +447 -0
- package/dist/esm/q-section.entry.js +18 -0
- package/dist/esm/q-sidepanel.entry.js +791 -0
- package/dist/esm/q-stack.entry.js +18 -0
- package/dist/esm/q-step-diagram-item.entry.js +43 -0
- package/dist/esm/q-step-diagram.entry.js +54 -0
- package/dist/esm/q-syntax-box.entry.js +780 -0
- package/dist/esm/q-tabs.entry.js +153 -0
- package/dist/esm/q-textarea.entry.js +295 -0
- package/dist/esm/q-thumbnail.entry.js +49 -0
- package/dist/esm/q-toast.entry.js +398 -0
- package/dist/esm/q-toggle.entry.js +231 -0
- package/dist/esm/q-toolbar.entry.js +31 -0
- package/dist/esm/registry-CpI3m4_T.js +308 -0
- package/dist/esm/toast-controller-BIIQL66b.js +107 -0
- package/dist/esm/tokens-BDsIecIx.js +956 -0
- package/dist/esm/utils-BJiYCN3i.js +30 -0
- package/dist/esm/webquark.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/loader/cdn.js +1 -0
- package/dist/loader/index.cjs.js +1 -0
- package/dist/loader/index.d.ts +24 -0
- package/dist/loader/index.es2017.js +1 -0
- package/dist/loader/index.js +2 -0
- package/dist/playground/components/theme-designer/dimension-tokens.js +9 -0
- package/dist/playground/components/theme-designer/token-row.js +89 -0
- package/dist/playground/dom-factory.js +76 -0
- package/dist/playground/utils/color.js +26 -0
- package/dist/playground/utils/dom.js +38 -0
- package/dist/playground/utils/index.js +2 -0
- package/dist/types/components/actions/action.props.d.ts +19 -0
- package/dist/types/components/actions/button/button.d.ts +87 -0
- package/dist/types/components/actions/button/button.types.d.ts +6 -0
- package/dist/types/components/actions/button/button.utils.d.ts +8 -0
- package/dist/types/components/actions/button/test/button-slots.cmp.test.d.ts +1 -0
- package/dist/types/components/actions/button/test/button.utils.unit.test.d.ts +1 -0
- package/dist/types/components/actions/link/link.d.ts +43 -0
- package/dist/types/components/actions/link/link.types.d.ts +3 -0
- package/dist/types/components/communication/alert/alert.d.ts +32 -0
- package/dist/types/components/communication/alert/alert.types.d.ts +2 -0
- package/dist/types/components/communication/conversation-bubble/conversation-bubble.d.ts +38 -0
- package/dist/types/components/communication/conversation-bubble/conversation-bubble.types.d.ts +1 -0
- package/dist/types/components/communication/toast/internals/icons.d.ts +2 -0
- package/dist/types/components/communication/toast/internals/queue.d.ts +19 -0
- package/dist/types/components/communication/toast/internals/timers.d.ts +12 -0
- package/dist/types/components/communication/toast/test/toast.cmp.test.d.ts +2 -0
- package/dist/types/components/communication/toast/test/toast.unit.test.d.ts +1 -0
- package/dist/types/components/communication/toast/toast-controller.d.ts +9 -0
- package/dist/types/components/communication/toast/toast.d.ts +44 -0
- package/dist/types/components/communication/toast/toast.types.d.ts +30 -0
- package/dist/types/components/content/banner/banner.d.ts +12 -0
- package/dist/types/components/content/banner/banner.types.d.ts +2 -0
- package/dist/types/components/content/card/card.d.ts +35 -0
- package/dist/types/components/content/card/card.types.d.ts +1 -0
- package/dist/types/components/content/card/card.utils.d.ts +5 -0
- package/dist/types/components/content/carousel/carousel.d.ts +123 -0
- package/dist/types/components/content/carousel/carousel.types.d.ts +10 -0
- package/dist/types/components/content/carousel/carousel.utils.d.ts +1 -0
- package/dist/types/components/content/carousel/internals/autoplay.d.ts +22 -0
- package/dist/types/components/content/carousel/internals/metrics.d.ts +23 -0
- package/dist/types/components/content/carousel/internals/slide-state.d.ts +8 -0
- package/dist/types/components/content/carousel/test/transitions.cmp.test.d.ts +1 -0
- package/dist/types/components/data-display/accordion/accordion.d.ts +9 -0
- package/dist/types/components/data-display/accordion/accordion.types.d.ts +1 -0
- package/dist/types/components/data-display/chip/chip.d.ts +55 -0
- package/dist/types/components/data-display/chip/chip.types.d.ts +13 -0
- package/dist/types/components/data-display/data-table/data-table-cell.d.ts +7 -0
- package/dist/types/components/data-display/data-table/data-table.d.ts +95 -0
- package/dist/types/components/data-display/data-table/data-table.types.d.ts +56 -0
- package/dist/types/components/data-display/data-table/internals/data-access.d.ts +9 -0
- package/dist/types/components/data-display/data-table/internals/render-row-actions.d.ts +9 -0
- package/dist/types/components/data-display/data-table/internals/render-sort-indicator.d.ts +5 -0
- package/dist/types/components/data-display/data-table/internals/render-table-body.d.ts +13 -0
- package/dist/types/components/data-display/data-table/internals/render-table-head.d.ts +8 -0
- package/dist/types/components/data-display/data-table/internals/render-toolbar.d.ts +9 -0
- package/dist/types/components/data-display/data-table/internals/row-events.d.ts +1 -0
- package/dist/types/components/data-display/data-table/internals/selection.d.ts +10 -0
- package/dist/types/components/data-display/data-table/internals/sort.d.ts +3 -0
- package/dist/types/components/data-display/data-table/internals/table-model.d.ts +56 -0
- package/dist/types/components/data-display/data-table/test/row-gutter.cmp.test.d.ts +1 -0
- package/dist/types/components/data-display/data-table/test/two-line-rows.cmp.test.d.ts +1 -0
- package/dist/types/components/data-display/map/internals/base-layer.d.ts +63 -0
- package/dist/types/components/data-display/map/internals/bounds.d.ts +23 -0
- package/dist/types/components/data-display/map/internals/buffered-tile-layer.d.ts +10 -0
- package/dist/types/components/data-display/map/internals/cluster-collision.d.ts +15 -0
- package/dist/types/components/data-display/map/internals/google-maps.d.ts +9 -0
- package/dist/types/components/data-display/map/internals/google-mutant-module.d.ts +11 -0
- package/dist/types/components/data-display/map/internals/google-mutant.d.ts +18 -0
- package/dist/types/components/data-display/map/internals/maplibre.d.ts +14 -0
- package/dist/types/components/data-display/map/internals/marker-cluster-index.d.ts +36 -0
- package/dist/types/components/data-display/map/internals/marker-controller.d.ts +57 -0
- package/dist/types/components/data-display/map/internals/marker-presentation.d.ts +8 -0
- package/dist/types/components/data-display/map/internals/marker-visibility.d.ts +10 -0
- package/dist/types/components/data-display/map/internals/markers.d.ts +4 -0
- package/dist/types/components/data-display/map/internals/tile-layer-readiness.d.ts +11 -0
- package/dist/types/components/data-display/map/internals/tile-preload-buffer.d.ts +4 -0
- package/dist/types/components/data-display/map/internals/vector-padding.d.ts +4 -0
- package/dist/types/components/data-display/map/map.d.ts +175 -0
- package/dist/types/components/data-display/map/map.types.d.ts +132 -0
- package/dist/types/components/data-display/map/test/map.cmp.test.d.ts +1 -0
- package/dist/types/components/data-display/pagination/pagination.d.ts +33 -0
- package/dist/types/components/data-display/pagination/test/pagination.cmp.test.d.ts +2 -0
- package/dist/types/components/data-display/syntax-box/internals/clipboard.d.ts +2 -0
- package/dist/types/components/data-display/syntax-box/internals/editor-key-action.d.ts +12 -0
- package/dist/types/components/data-display/syntax-box/internals/formatter.d.ts +15 -0
- package/dist/types/components/data-display/syntax-box/internals/formatter.unit.test.d.ts +1 -0
- package/dist/types/components/data-display/syntax-box/internals/syntax.d.ts +13 -0
- package/dist/types/components/data-display/syntax-box/internals/syntax.unit.test.d.ts +1 -0
- package/dist/types/components/data-display/syntax-box/internals/value-sync.d.ts +15 -0
- package/dist/types/components/data-display/syntax-box/internals/value-sync.unit.test.d.ts +1 -0
- package/dist/types/components/data-display/syntax-box/syntax-box.d.ts +72 -0
- package/dist/types/components/data-display/syntax-box/syntax-box.types.d.ts +2 -0
- package/dist/types/components/data-display/syntax-box/syntax-box.utils.d.ts +1 -0
- package/dist/types/components/data-display/syntax-box/test/format-fixtures.d.ts +6 -0
- package/dist/types/components/data-display/syntax-box/test/syntax-box.cmp.test.d.ts +1 -0
- package/dist/types/components/data-display/syntax-box/test/syntax-fixtures.d.ts +9 -0
- package/dist/types/components/data-display/syntax-box/test/syntax-format.cmp.test.d.ts +1 -0
- package/dist/types/components/indicators/progress/progress.d.ts +30 -0
- package/dist/types/components/indicators/progress/progress.types.d.ts +3 -0
- package/dist/types/components/indicators/step-diagram/step-diagram.d.ts +19 -0
- package/dist/types/components/indicators/step-diagram/step-diagram.types.d.ts +3 -0
- package/dist/types/components/indicators/step-diagram-item/step-diagram-item.d.ts +26 -0
- package/dist/types/components/indicators/step-diagram-item/step-diagram-item.types.d.ts +5 -0
- package/dist/types/components/indicators/step-diagram-item/step-diagram-item.utils.d.ts +1 -0
- package/dist/types/components/inputs/dropdown/dropdown.d.ts +125 -0
- package/dist/types/components/inputs/dropdown/dropdown.types.d.ts +9 -0
- package/dist/types/components/inputs/dropdown/internals/options.d.ts +6 -0
- package/dist/types/components/inputs/dropdown/internals/position.d.ts +26 -0
- package/dist/types/components/inputs/dropdown/test/dropdown.cmp.test.d.ts +1 -0
- package/dist/types/components/inputs/dropdown/test/search-mode.cmp.test.d.ts +1 -0
- package/dist/types/components/inputs/form/form.d.ts +80 -0
- package/dist/types/components/inputs/form/form.types.d.ts +40 -0
- package/dist/types/components/inputs/form/internals/controls.d.ts +8 -0
- package/dist/types/components/inputs/form/internals/enter-behavior.d.ts +2 -0
- package/dist/types/components/inputs/form/internals/field-state.d.ts +19 -0
- package/dist/types/components/inputs/form/internals/reset.d.ts +3 -0
- package/dist/types/components/inputs/form/internals/submission.d.ts +17 -0
- package/dist/types/components/inputs/form/internals/values.d.ts +10 -0
- package/dist/types/components/inputs/form/internals/values.unit.test.d.ts +1 -0
- package/dist/types/components/inputs/form/test/form-reset-state.cmp.test.d.ts +1 -0
- package/dist/types/components/inputs/form/test/form-submit-transport.cmp.test.d.ts +1 -0
- package/dist/types/components/inputs/form/test/form-submit.cmp.test.d.ts +1 -0
- package/dist/types/components/inputs/form/test/form-values.cmp.test.d.ts +1 -0
- package/dist/types/components/inputs/form/test/form.cmp.test.d.ts +4 -0
- package/dist/types/components/inputs/input/input.d.ts +92 -0
- package/dist/types/components/inputs/input/input.types.d.ts +3 -0
- package/dist/types/components/inputs/input/input.utils.d.ts +1 -0
- package/dist/types/components/inputs/quantity-selector/internals/number-value.d.ts +13 -0
- package/dist/types/components/inputs/quantity-selector/quantity-selector.d.ts +37 -0
- package/dist/types/components/inputs/quantity-selector/quantity-selector.types.d.ts +3 -0
- package/dist/types/components/inputs/radio-group/radio-group.d.ts +70 -0
- package/dist/types/components/inputs/radio-group/radio-group.types.d.ts +12 -0
- package/dist/types/components/inputs/radio-group/radio-group.utils.d.ts +2 -0
- package/dist/types/components/inputs/textarea/textarea.d.ts +81 -0
- package/dist/types/components/inputs/textarea/textarea.types.d.ts +1 -0
- package/dist/types/components/inputs/toggle/test/toggle-layout.cmp.test.d.ts +1 -0
- package/dist/types/components/inputs/toggle/toggle.d.ts +67 -0
- package/dist/types/components/inputs/toggle/toggle.types.d.ts +3 -0
- package/dist/types/components/inputs/toggle/toggle.utils.d.ts +1 -0
- package/dist/types/components/layout/divider/divider.d.ts +15 -0
- package/dist/types/components/layout/divider/test/divider.cmp.test.d.ts +1 -0
- package/dist/types/components/layout/grid/grid.d.ts +13 -0
- package/dist/types/components/layout/inline/inline.d.ts +12 -0
- package/dist/types/components/layout/navbar/navbar.d.ts +94 -0
- package/dist/types/components/layout/navbar/navbar.types.d.ts +33 -0
- package/dist/types/components/layout/navbar/navbar.utils.d.ts +2 -0
- package/dist/types/components/layout/navbar/test/navbar.cmp.test.d.ts +1 -0
- package/dist/types/components/layout/panel/panel.d.ts +41 -0
- package/dist/types/components/layout/panel/panel.types.d.ts +3 -0
- package/dist/types/components/layout/scrollable/internals/metrics.d.ts +26 -0
- package/dist/types/components/layout/scrollable/internals/native-scrollbar.d.ts +4 -0
- package/dist/types/components/layout/scrollable/scrollable.d.ts +67 -0
- package/dist/types/components/layout/scrollable/scrollable.types.d.ts +6 -0
- package/dist/types/components/layout/section/section.d.ts +13 -0
- package/dist/types/components/layout/section/section.types.d.ts +1 -0
- package/dist/types/components/layout/sidepanel/internals/drawer.d.ts +2 -0
- package/dist/types/components/layout/sidepanel/internals/groups.d.ts +7 -0
- package/dist/types/components/layout/sidepanel/internals/nav-items.d.ts +2 -0
- package/dist/types/components/layout/sidepanel/sidepanel.d.ts +110 -0
- package/dist/types/components/layout/sidepanel/sidepanel.types.d.ts +43 -0
- package/dist/types/components/layout/sidepanel/sidepanel.utils.d.ts +2 -0
- package/dist/types/components/layout/sidepanel/test/nav-drawer-transitions.cmp.test.d.ts +1 -0
- package/dist/types/components/layout/sidepanel/test/panel-transitions.cmp.test.d.ts +1 -0
- package/dist/types/components/layout/stack/stack.d.ts +10 -0
- package/dist/types/components/layout/tabs/tabs.d.ts +29 -0
- package/dist/types/components/layout/tabs/tabs.types.d.ts +14 -0
- package/dist/types/components/layout/tabs/tabs.utils.d.ts +4 -0
- package/dist/types/components/layout/tabs/test/tabs.cmp.test.d.ts +1 -0
- package/dist/types/components/layout/toolbar/toolbar.d.ts +27 -0
- package/dist/types/components/layout/toolbar/toolbar.types.d.ts +1 -0
- package/dist/types/components/media/avatar/avatar.d.ts +37 -0
- package/dist/types/components/media/avatar/avatar.types.d.ts +2 -0
- package/dist/types/components/media/icon/icon.d.ts +48 -0
- package/dist/types/components/media/icon/icon.types.d.ts +30 -0
- package/dist/types/components/media/icon/internals/constants.d.ts +3 -0
- package/dist/types/components/media/icon/internals/fetch-icon.d.ts +1 -0
- package/dist/types/components/media/icon/internals/fetch-icon.unit.test.d.ts +1 -0
- package/dist/types/components/media/icon/internals/policy.d.ts +19 -0
- package/dist/types/components/media/icon/internals/policy.unit.test.d.ts +1 -0
- package/dist/types/components/media/icon/internals/registry-lucide.unit.test.d.ts +1 -0
- package/dist/types/components/media/icon/internals/registry.d.ts +11 -0
- package/dist/types/components/media/icon/internals/registry.unit.test.d.ts +1 -0
- package/dist/types/components/media/icon/internals/render-definition.d.ts +2 -0
- package/dist/types/components/media/icon/internals/sanitize-svg.d.ts +2 -0
- package/dist/types/components/media/icon/internals/size.d.ts +2 -0
- package/dist/types/components/media/icon/internals/url.d.ts +11 -0
- package/dist/types/components/media/icon/internals/url.unit.test.d.ts +1 -0
- package/dist/types/components/media/icon/test/icon-fixtures.d.ts +4 -0
- package/dist/types/components/media/icon/test/icon.cmp.test.d.ts +1 -0
- package/dist/types/components/media/image-comparison/image-comparison.d.ts +63 -0
- package/dist/types/components/media/image-comparison/test/image-comparison.cmp.test.d.ts +1 -0
- package/dist/types/components/media/media/media.d.ts +13 -0
- package/dist/types/components/media/media/media.types.d.ts +2 -0
- package/dist/types/components/media/reel/reel.d.ts +34 -0
- package/dist/types/components/media/reel/reel.types.d.ts +3 -0
- package/dist/types/components/media/thumbnail/thumbnail.d.ts +21 -0
- package/dist/types/components/media/thumbnail/thumbnail.types.d.ts +7 -0
- package/dist/types/components/overlays/dialog/dialog.d.ts +83 -0
- package/dist/types/components/overlays/dialog/dialog.types.d.ts +1 -0
- package/dist/types/components/overlays/dialog/internals/backdrop.d.ts +2 -0
- package/dist/types/components/overlays/dialog/internals/lifecycle.d.ts +21 -0
- package/dist/types/components/overlays/tooltip/internals/aria.d.ts +13 -0
- package/dist/types/components/overlays/tooltip/internals/positioning.d.ts +7 -0
- package/dist/types/components/overlays/tooltip/internals/scroll-listeners.d.ts +2 -0
- package/dist/types/components/overlays/tooltip/tooltip.d.ts +33 -0
- package/dist/types/components/overlays/tooltip/tooltip.types.d.ts +1 -0
- package/dist/types/components/shared/field.d.ts +3 -0
- package/dist/types/components/shared/test/orientation.cmp.test.d.ts +1 -0
- package/dist/types/components.d.ts +6156 -0
- package/dist/types/declarations.d.ts +14 -0
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/components/theme-designer/dimension-tokens.d.ts +3 -0
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/components/theme-designer/token-row.d.ts +14 -0
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/dom-factory.d.ts +12 -0
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/utils/color.d.ts +8 -0
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/utils/dom.d.ts +15 -0
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/utils/index.d.ts +2 -0
- package/dist/types/index.d.ts +31 -0
- package/dist/types/stencil-public-runtime.d.ts +1879 -0
- package/dist/types/theme/test/assets.d.ts +4 -0
- package/dist/types/theme/test/foundation.cmp.test.d.ts +16 -0
- package/dist/types/theme/test/input-width.cmp.test.d.ts +3 -0
- package/dist/types/theme/test/presets.cmp.test.d.ts +7 -0
- package/dist/types/theme/test/presets.unit.test.d.ts +1 -0
- package/dist/types/theme/tokens.d.ts +150 -0
- package/dist/types/utils/collection-identity.d.ts +55 -0
- package/dist/types/utils/collection-identity.unit.test.d.ts +1 -0
- package/dist/types/utils/dom.d.ts +68 -0
- package/dist/types/utils/form-control-validity.d.ts +14 -0
- package/dist/types/utils/form-field-adapter.d.ts +17 -0
- package/dist/types/utils/form-field-state.d.ts +4 -0
- package/dist/types/utils/form-reset-action.d.ts +5 -0
- package/dist/types/utils/form-submit-action.d.ts +17 -0
- package/dist/types/utils/form-submit-action.unit.test.d.ts +1 -0
- package/dist/types/utils/image-crop.d.ts +30 -0
- package/dist/types/utils/image-crop.unit.test.d.ts +1 -0
- package/dist/types/utils/math.d.ts +10 -0
- package/dist/types/utils/utils.d.ts +11 -0
- package/dist/types/utils/utils.unit.test.d.ts +1 -0
- package/dist/webquark/index.esm.js +1 -0
- package/dist/webquark/native-content.css +24 -0
- package/dist/webquark/p-0f04ceab.entry.js +1 -0
- package/dist/webquark/p-10dc5cce.entry.js +1 -0
- package/dist/webquark/p-191a7063.entry.js +1 -0
- package/dist/webquark/p-1e8797d1.entry.js +1 -0
- package/dist/webquark/p-220ec9cf.entry.js +1 -0
- package/dist/webquark/p-2291095e.entry.js +1 -0
- package/dist/webquark/p-32055acd.entry.js +1 -0
- package/dist/webquark/p-3af50215.entry.js +13 -0
- package/dist/webquark/p-41deb44c.entry.js +1 -0
- package/dist/webquark/p-44eda084.entry.js +1 -0
- package/dist/webquark/p-473a1810.entry.js +1 -0
- package/dist/webquark/p-4cf40080.entry.js +1 -0
- package/dist/webquark/p-4d611b93.entry.js +1 -0
- package/dist/webquark/p-596737cc.entry.js +1 -0
- package/dist/webquark/p-5cccb6bc.entry.js +1 -0
- package/dist/webquark/p-5d6fb0d1.entry.js +1 -0
- package/dist/webquark/p-687be7d4.entry.js +1 -0
- package/dist/webquark/p-6a5033da.entry.js +1 -0
- package/dist/webquark/p-6d2d016a.entry.js +1 -0
- package/dist/webquark/p-70e3a23a.entry.js +1 -0
- package/dist/webquark/p-7723e966.entry.js +1 -0
- package/dist/webquark/p-78c56cd3.entry.js +1 -0
- package/dist/webquark/p-8a0733a1.entry.js +1 -0
- package/dist/webquark/p-BDsIecIx.js +1 -0
- package/dist/webquark/p-BIIQL66b.js +1 -0
- package/dist/webquark/p-BJiYCN3i.js +1 -0
- package/dist/webquark/p-BOdNg0jc.js +1 -0
- package/dist/webquark/p-BcL0NVv0.js +1 -0
- package/dist/webquark/p-Bj2RJb2E.js +1 -0
- package/dist/webquark/p-Bk4FnOfb.js +1 -0
- package/dist/webquark/p-BuctNczf.js +1 -0
- package/dist/webquark/p-ByfrUWx1.js +1 -0
- package/dist/webquark/p-CGZPmEUB.js +1 -0
- package/dist/webquark/p-CGml_DQ8.js +1 -0
- package/dist/webquark/p-C_RztzNv.js +5 -0
- package/dist/webquark/p-CoIMrUb3.js +1 -0
- package/dist/webquark/p-CpI3m4_T.js +1 -0
- package/dist/webquark/p-DKrPmn2y.js +13 -0
- package/dist/webquark/p-DYMWBqU1.js +5 -0
- package/dist/webquark/p-DaJmsCb7.js +3 -0
- package/dist/webquark/p-DstNl_WY.js +1 -0
- package/dist/webquark/p-DuX-9GOi.js +1 -0
- package/dist/webquark/p-SzKf4WZF.js +1 -0
- package/dist/webquark/p-a199de7d.entry.js +1 -0
- package/dist/webquark/p-a30d212f.entry.js +13 -0
- package/dist/webquark/p-a87f0bde.entry.js +1 -0
- package/dist/webquark/p-b75ec829.entry.js +1 -0
- package/dist/webquark/p-b82aaf4c.entry.js +1 -0
- package/dist/webquark/p-b8f4994a.entry.js +1 -0
- package/dist/webquark/p-b9c8c081.entry.js +1 -0
- package/dist/webquark/p-bf568cda.entry.js +1 -0
- package/dist/webquark/p-c662904e.entry.js +1 -0
- package/dist/webquark/p-cab898c2.entry.js +1 -0
- package/dist/webquark/p-d2c4696f.entry.js +1 -0
- package/dist/webquark/p-ddeb2d4c.entry.js +1 -0
- package/dist/webquark/p-dee50f0a.entry.js +1 -0
- package/dist/webquark/p-e3c18c0e.entry.js +1 -0
- package/dist/webquark/p-e7384b6e.entry.js +1 -0
- package/dist/webquark/p-f63fd66f.entry.js +1 -0
- package/dist/webquark/p-f95aeb8d.entry.js +1 -0
- package/dist/webquark/p-fbd1cbbe.entry.js +1 -0
- package/dist/webquark/webquark.css +1 -0
- package/dist/webquark/webquark.esm.js +1 -0
- package/package.json +78 -4
|
@@ -0,0 +1,782 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CMAcJ6t1.js');
|
|
4
|
+
var formFieldState = require('./form-field-state-P63wN30v.js');
|
|
5
|
+
var formFieldAdapter = require('./form-field-adapter-D0CJ6poh.js');
|
|
6
|
+
var formControlValidity = require('./form-control-validity-D1ukC0_e.js');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @license @lucide/icons v1.54.0 - ISC
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the ISC license.
|
|
12
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const Braces = {
|
|
16
|
+
name: "braces",
|
|
17
|
+
size: 24,
|
|
18
|
+
node: [
|
|
19
|
+
[
|
|
20
|
+
"path",
|
|
21
|
+
{ d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1", key: "ezmyqa" }
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"path",
|
|
25
|
+
{
|
|
26
|
+
d: "M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",
|
|
27
|
+
key: "e1hn23"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
],
|
|
31
|
+
aliases: ["curly-braces"]
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @license @lucide/icons v1.54.0 - ISC
|
|
36
|
+
*
|
|
37
|
+
* This source code is licensed under the ISC license.
|
|
38
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
const Check = {
|
|
42
|
+
name: "check",
|
|
43
|
+
size: 24,
|
|
44
|
+
node: [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @license @lucide/icons v1.54.0 - ISC
|
|
49
|
+
*
|
|
50
|
+
* This source code is licensed under the ISC license.
|
|
51
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
const Copy = {
|
|
55
|
+
name: "copy",
|
|
56
|
+
size: 24,
|
|
57
|
+
node: [
|
|
58
|
+
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
59
|
+
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
60
|
+
]
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const MAX_JSON_FORMAT_INPUT = 1_048_576;
|
|
64
|
+
const MAX_JSON_FORMAT_OUTPUT = 2_097_152;
|
|
65
|
+
const MAX_JSON_FORMAT_DEPTH = 128;
|
|
66
|
+
class FormatLimitError extends Error {
|
|
67
|
+
}
|
|
68
|
+
function isFormatSupported(language) {
|
|
69
|
+
return typeof language === 'string' && language.toLowerCase() === 'json';
|
|
70
|
+
}
|
|
71
|
+
/** Validates JSON grammar while emitting original tokens, never JavaScript values. */
|
|
72
|
+
function layoutJson(source) {
|
|
73
|
+
if (source.length > MAX_JSON_FORMAT_INPUT) {
|
|
74
|
+
throw new FormatLimitError();
|
|
75
|
+
}
|
|
76
|
+
let index = 0;
|
|
77
|
+
let outputLength = 0;
|
|
78
|
+
const parts = [];
|
|
79
|
+
const emit = (text) => {
|
|
80
|
+
outputLength += text.length;
|
|
81
|
+
if (outputLength > MAX_JSON_FORMAT_OUTPUT) {
|
|
82
|
+
throw new FormatLimitError();
|
|
83
|
+
}
|
|
84
|
+
parts.push(text);
|
|
85
|
+
};
|
|
86
|
+
const whitespace = () => {
|
|
87
|
+
while (/[\x20\t\r\n]/.test(source.charAt(index)) && index < source.length) {
|
|
88
|
+
index++;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const requireCharacter = (character) => {
|
|
92
|
+
if (source[index++] !== character) {
|
|
93
|
+
throw new SyntaxError('Invalid JSON.');
|
|
94
|
+
}
|
|
95
|
+
whitespace();
|
|
96
|
+
};
|
|
97
|
+
const stringToken = () => {
|
|
98
|
+
const start = index;
|
|
99
|
+
if (source[index++] !== '"') {
|
|
100
|
+
throw new SyntaxError('Invalid JSON string.');
|
|
101
|
+
}
|
|
102
|
+
while (index < source.length) {
|
|
103
|
+
const character = source[index++];
|
|
104
|
+
if (character === '"') {
|
|
105
|
+
return source.slice(start, index);
|
|
106
|
+
}
|
|
107
|
+
if (character.charCodeAt(0) < 0x20) {
|
|
108
|
+
throw new SyntaxError('Invalid JSON string.');
|
|
109
|
+
}
|
|
110
|
+
if (character === '\\') {
|
|
111
|
+
const escaped = source[index++];
|
|
112
|
+
if (escaped === 'u') {
|
|
113
|
+
if (!/^[\da-fA-F]{4}$/.test(source.slice(index, index + 4))) {
|
|
114
|
+
throw new SyntaxError('Invalid JSON escape.');
|
|
115
|
+
}
|
|
116
|
+
index += 4;
|
|
117
|
+
}
|
|
118
|
+
else if (!escaped || !'"\\/bfnrt'.includes(escaped)) {
|
|
119
|
+
throw new SyntaxError('Invalid JSON escape.');
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
throw new SyntaxError('Unterminated JSON string.');
|
|
124
|
+
};
|
|
125
|
+
const newline = (depth) => emit('\n' + ' '.repeat(depth));
|
|
126
|
+
const value = (depth) => {
|
|
127
|
+
whitespace();
|
|
128
|
+
const character = source[index];
|
|
129
|
+
if (character === '{' || character === '[') {
|
|
130
|
+
if (depth >= MAX_JSON_FORMAT_DEPTH) {
|
|
131
|
+
throw new FormatLimitError();
|
|
132
|
+
}
|
|
133
|
+
const object = character === '{';
|
|
134
|
+
const close = object ? '}' : ']';
|
|
135
|
+
index++;
|
|
136
|
+
emit(character);
|
|
137
|
+
whitespace();
|
|
138
|
+
if (source[index] === close) {
|
|
139
|
+
index++;
|
|
140
|
+
emit(close);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
newline(depth + 1);
|
|
144
|
+
while (true) {
|
|
145
|
+
if (object) {
|
|
146
|
+
emit(stringToken());
|
|
147
|
+
whitespace();
|
|
148
|
+
requireCharacter(':');
|
|
149
|
+
emit(': ');
|
|
150
|
+
}
|
|
151
|
+
value(depth + 1);
|
|
152
|
+
whitespace();
|
|
153
|
+
if (source[index] === close) {
|
|
154
|
+
index++;
|
|
155
|
+
newline(depth);
|
|
156
|
+
emit(close);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
requireCharacter(',');
|
|
160
|
+
emit(',');
|
|
161
|
+
newline(depth + 1);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (character === '"') {
|
|
165
|
+
emit(stringToken());
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
for (const literal of ['true', 'false', 'null']) {
|
|
169
|
+
if (source.startsWith(literal, index)) {
|
|
170
|
+
index += literal.length;
|
|
171
|
+
emit(literal);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const start = index;
|
|
176
|
+
while (index < source.length && /[\d.eE+-]/.test(source[index])) {
|
|
177
|
+
index++;
|
|
178
|
+
}
|
|
179
|
+
const token = source.slice(start, index);
|
|
180
|
+
if (!/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/.test(token)) {
|
|
181
|
+
throw new SyntaxError('Invalid JSON value.');
|
|
182
|
+
}
|
|
183
|
+
emit(token);
|
|
184
|
+
};
|
|
185
|
+
value(0);
|
|
186
|
+
whitespace();
|
|
187
|
+
if (index !== source.length) {
|
|
188
|
+
throw new SyntaxError('Trailing JSON content.');
|
|
189
|
+
}
|
|
190
|
+
return parts.join('');
|
|
191
|
+
}
|
|
192
|
+
function formatSource(code, language) {
|
|
193
|
+
if (!isFormatSupported(language)) {
|
|
194
|
+
return { code, status: 'unsupported' };
|
|
195
|
+
}
|
|
196
|
+
try {
|
|
197
|
+
const formatted = layoutJson(code);
|
|
198
|
+
return { code: formatted, status: formatted === code ? 'unchanged' : 'formatted' };
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
return { code, status: error instanceof FormatLimitError ? 'unsupported' : 'invalid' };
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** Each token and gap is an unchanged slice of the source; generated markup is never scanned. */
|
|
206
|
+
function scan(text, pattern, classify) {
|
|
207
|
+
const tokens = [];
|
|
208
|
+
let offset = 0;
|
|
209
|
+
let match;
|
|
210
|
+
while ((match = pattern.exec(text)) !== null) {
|
|
211
|
+
if (offset < match.index)
|
|
212
|
+
tokens.push({ text: text.slice(offset, match.index) });
|
|
213
|
+
tokens.push({ text: match[0], className: classify(match) });
|
|
214
|
+
offset = match.index + match[0].length;
|
|
215
|
+
}
|
|
216
|
+
if (offset < text.length)
|
|
217
|
+
tokens.push({ text: text.slice(offset) });
|
|
218
|
+
return tokens;
|
|
219
|
+
}
|
|
220
|
+
/** Keep unhighlighted runs together so long edits do not create a text node per character. */
|
|
221
|
+
function tokenWriter(text) {
|
|
222
|
+
const tokens = [];
|
|
223
|
+
let plainStart = 0;
|
|
224
|
+
return {
|
|
225
|
+
emit(start, end, className) {
|
|
226
|
+
if (plainStart < start)
|
|
227
|
+
tokens.push({ text: text.slice(plainStart, start) });
|
|
228
|
+
tokens.push({ text: text.slice(start, end), className });
|
|
229
|
+
plainStart = end;
|
|
230
|
+
},
|
|
231
|
+
finish() {
|
|
232
|
+
if (plainStart < text.length)
|
|
233
|
+
tokens.push({ text: text.slice(plainStart) });
|
|
234
|
+
return tokens;
|
|
235
|
+
},
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
function isLetter(char) {
|
|
239
|
+
return char >= 'a' && char <= 'z' || char >= 'A' && char <= 'Z';
|
|
240
|
+
}
|
|
241
|
+
function isDigit(char) {
|
|
242
|
+
return char >= '0' && char <= '9';
|
|
243
|
+
}
|
|
244
|
+
function isWord(char) {
|
|
245
|
+
return isLetter(char) || isDigit(char) || char === '_';
|
|
246
|
+
}
|
|
247
|
+
function skipWhitespace(text, offset) {
|
|
248
|
+
while (offset < text.length && /\s/.test(text[offset]))
|
|
249
|
+
offset++;
|
|
250
|
+
return offset;
|
|
251
|
+
}
|
|
252
|
+
function quotedEnd(text, start, escaped) {
|
|
253
|
+
const quote = text[start];
|
|
254
|
+
let offset = start + 1;
|
|
255
|
+
while (offset < text.length) {
|
|
256
|
+
if (escaped && text[offset] === '\\')
|
|
257
|
+
offset = Math.min(text.length, offset + 2);
|
|
258
|
+
else if (text[offset++] === quote)
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
return offset;
|
|
262
|
+
}
|
|
263
|
+
/** Consume each name once instead of retrying an attribute lookahead at every suffix. */
|
|
264
|
+
function tokenizeHtml(text) {
|
|
265
|
+
const writer = tokenWriter(text);
|
|
266
|
+
let offset = 0;
|
|
267
|
+
while (offset < text.length) {
|
|
268
|
+
const start = offset;
|
|
269
|
+
const char = text[offset];
|
|
270
|
+
if (text.startsWith('<!--', offset)) {
|
|
271
|
+
const end = text.indexOf('-->', offset + 4);
|
|
272
|
+
offset = end === -1 ? text.length : end + 3;
|
|
273
|
+
writer.emit(start, offset, 'code-comment');
|
|
274
|
+
}
|
|
275
|
+
else if (char === '<' && isLetter(text[offset + (text[offset + 1] === '/' ? 2 : 1)])) {
|
|
276
|
+
offset += text[offset + 1] === '/' ? 3 : 2;
|
|
277
|
+
while (offset < text.length && (isWord(text[offset]) || text[offset] === ':' || text[offset] === '-'))
|
|
278
|
+
offset++;
|
|
279
|
+
writer.emit(start, offset, 'code-tag');
|
|
280
|
+
}
|
|
281
|
+
else if (char === '"' || char === "'") {
|
|
282
|
+
// HTML uses entities for embedded quotes; a backslash does not escape its delimiter.
|
|
283
|
+
offset = quotedEnd(text, start, false);
|
|
284
|
+
writer.emit(start, offset, 'code-value');
|
|
285
|
+
}
|
|
286
|
+
else if (char === '>' || char === '/' && text[offset + 1] === '>') {
|
|
287
|
+
offset += char === '/' ? 2 : 1;
|
|
288
|
+
writer.emit(start, offset, 'code-tag');
|
|
289
|
+
}
|
|
290
|
+
else if (isWord(char) || char === ':' || char === '-') {
|
|
291
|
+
offset++;
|
|
292
|
+
while (offset < text.length && (isWord(text[offset]) || text[offset] === ':' || text[offset] === '-'))
|
|
293
|
+
offset++;
|
|
294
|
+
if (text[skipWhitespace(text, offset)] === '=')
|
|
295
|
+
writer.emit(start, offset, 'code-attr');
|
|
296
|
+
}
|
|
297
|
+
else
|
|
298
|
+
offset++;
|
|
299
|
+
}
|
|
300
|
+
return writer.finish();
|
|
301
|
+
}
|
|
302
|
+
const JAVASCRIPT_KEYWORDS = new Set([
|
|
303
|
+
'const', 'let', 'var', 'function', 'return', 'if', 'else', 'for', 'while', 'do', 'switch', 'case',
|
|
304
|
+
'break', 'continue', 'class', 'export', 'import', 'from', 'new', 'this', 'typeof', 'instanceof',
|
|
305
|
+
'try', 'catch', 'finally', 'throw', 'async', 'await', 'null', 'undefined', 'true', 'false',
|
|
306
|
+
]);
|
|
307
|
+
/** Consume strings/comments before identifiers so their contents are never scanned as code. */
|
|
308
|
+
function tokenizeJavascript(text) {
|
|
309
|
+
const writer = tokenWriter(text);
|
|
310
|
+
let offset = 0;
|
|
311
|
+
while (offset < text.length) {
|
|
312
|
+
const start = offset;
|
|
313
|
+
const char = text[offset];
|
|
314
|
+
if (char === '/' && text[offset + 1] === '/') {
|
|
315
|
+
offset += 2;
|
|
316
|
+
while (offset < text.length && !/[\r\n\u2028\u2029]/.test(text[offset]))
|
|
317
|
+
offset++;
|
|
318
|
+
writer.emit(start, offset, 'code-comment');
|
|
319
|
+
}
|
|
320
|
+
else if (char === '/' && text[offset + 1] === '*') {
|
|
321
|
+
const end = text.indexOf('*/', offset + 2);
|
|
322
|
+
offset = end === -1 ? text.length : end + 2;
|
|
323
|
+
writer.emit(start, offset, 'code-comment');
|
|
324
|
+
}
|
|
325
|
+
else if (char === '"' || char === "'" || char === '`') {
|
|
326
|
+
offset = quotedEnd(text, start, true);
|
|
327
|
+
writer.emit(start, offset, 'code-value');
|
|
328
|
+
}
|
|
329
|
+
else if (isLetter(char) || char === '_' || char === '$') {
|
|
330
|
+
offset++;
|
|
331
|
+
while (offset < text.length && (isWord(text[offset]) || text[offset] === '$'))
|
|
332
|
+
offset++;
|
|
333
|
+
if (JAVASCRIPT_KEYWORDS.has(text.slice(start, offset)))
|
|
334
|
+
writer.emit(start, offset, 'code-tag');
|
|
335
|
+
else if (text[skipWhitespace(text, offset)] === '(')
|
|
336
|
+
writer.emit(start, offset, 'code-attr');
|
|
337
|
+
}
|
|
338
|
+
else if (isDigit(char)) {
|
|
339
|
+
while (offset < text.length && isDigit(text[offset]))
|
|
340
|
+
offset++;
|
|
341
|
+
if (text[offset] === '.' && isDigit(text[offset + 1])) {
|
|
342
|
+
offset++;
|
|
343
|
+
while (offset < text.length && isDigit(text[offset]))
|
|
344
|
+
offset++;
|
|
345
|
+
}
|
|
346
|
+
if (isWord(text[offset]) || text[offset] === '$') {
|
|
347
|
+
// An unfinished number/identifier is one plain run, not a highlighted suffix.
|
|
348
|
+
while (offset < text.length && (isWord(text[offset]) || text[offset] === '$'))
|
|
349
|
+
offset++;
|
|
350
|
+
}
|
|
351
|
+
else
|
|
352
|
+
writer.emit(start, offset, 'code-number');
|
|
353
|
+
}
|
|
354
|
+
else
|
|
355
|
+
offset++;
|
|
356
|
+
}
|
|
357
|
+
return writer.finish();
|
|
358
|
+
}
|
|
359
|
+
/** Consume CSS once, including incomplete edits; never retry a selector suffix. */
|
|
360
|
+
function tokenizeCss(text) {
|
|
361
|
+
const tokens = [];
|
|
362
|
+
let mode = 'selector';
|
|
363
|
+
let depth = 0;
|
|
364
|
+
let offset = 0;
|
|
365
|
+
const emit = (start, end, className) => {
|
|
366
|
+
if (end > start)
|
|
367
|
+
tokens.push({ text: text.slice(start, end), className });
|
|
368
|
+
};
|
|
369
|
+
while (offset < text.length) {
|
|
370
|
+
const start = offset;
|
|
371
|
+
const char = text[offset];
|
|
372
|
+
if (char === '/' && text[offset + 1] === '*') {
|
|
373
|
+
const end = text.indexOf('*/', offset + 2);
|
|
374
|
+
offset = end === -1 ? text.length : end + 2;
|
|
375
|
+
emit(start, offset, 'code-comment');
|
|
376
|
+
}
|
|
377
|
+
else if (char === '"' || char === "'") {
|
|
378
|
+
offset++;
|
|
379
|
+
while (offset < text.length) {
|
|
380
|
+
if (text[offset] === '\\')
|
|
381
|
+
offset = Math.min(text.length, offset + 2);
|
|
382
|
+
else if (text[offset++] === char)
|
|
383
|
+
break;
|
|
384
|
+
}
|
|
385
|
+
emit(start, offset, 'code-value');
|
|
386
|
+
}
|
|
387
|
+
else if (char === '{' || char === '}' || char === ';' || (char === ':' && mode === 'property')) {
|
|
388
|
+
offset++;
|
|
389
|
+
emit(start, offset);
|
|
390
|
+
if (char === '{') {
|
|
391
|
+
depth++;
|
|
392
|
+
mode = 'property';
|
|
393
|
+
}
|
|
394
|
+
else if (char === '}') {
|
|
395
|
+
depth = Math.max(0, depth - 1);
|
|
396
|
+
mode = depth ? 'property' : 'selector';
|
|
397
|
+
}
|
|
398
|
+
else if (char === ';')
|
|
399
|
+
mode = depth ? 'property' : 'selector';
|
|
400
|
+
else
|
|
401
|
+
mode = 'value';
|
|
402
|
+
}
|
|
403
|
+
else {
|
|
404
|
+
// Each character belongs to exactly one run or lexical token.
|
|
405
|
+
while (offset < text.length) {
|
|
406
|
+
const next = text[offset];
|
|
407
|
+
if (next === '"' || next === "'" || next === '{' || next === '}' || next === ';' ||
|
|
408
|
+
(next === ':' && mode === 'property') || (next === '/' && text[offset + 1] === '*'))
|
|
409
|
+
break;
|
|
410
|
+
offset++;
|
|
411
|
+
}
|
|
412
|
+
emit(start, offset, mode === 'selector' ? 'code-tag' : mode === 'property' ? 'code-attr' : 'code-value');
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return tokens;
|
|
416
|
+
}
|
|
417
|
+
function tokenizeSyntax(text, language) {
|
|
418
|
+
switch (language) {
|
|
419
|
+
case 'html':
|
|
420
|
+
return tokenizeHtml(text);
|
|
421
|
+
case 'javascript':
|
|
422
|
+
return tokenizeJavascript(text);
|
|
423
|
+
case 'css':
|
|
424
|
+
return tokenizeCss(text);
|
|
425
|
+
case 'json':
|
|
426
|
+
return scan(text, /("(?:[^"\\]|\\[\s\S])*")|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|\b(?:true|false|null)\b)/g, match => match[1] ? /^\s*:/.test(text.slice(match.index + match[0].length)) ? 'code-tag' : 'code-value' : 'code-attr');
|
|
427
|
+
default:
|
|
428
|
+
return text ? [{ text }] : [];
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
function getSyntaxBoxCopyText(code, fallbackText) {
|
|
433
|
+
return code !== undefined ? code : fallbackText || '';
|
|
434
|
+
}
|
|
435
|
+
async function writeClipboardText(text) {
|
|
436
|
+
if (!navigator.clipboard || typeof navigator.clipboard.writeText !== 'function') {
|
|
437
|
+
throw new Error('Clipboard API unavailable');
|
|
438
|
+
}
|
|
439
|
+
await navigator.clipboard.writeText(text);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
function getSyntaxBoxEditorKeyAction(event, value, start, end) {
|
|
443
|
+
if (event.key === 'Escape') {
|
|
444
|
+
return { type: 'blur' };
|
|
445
|
+
}
|
|
446
|
+
if (event.key !== 'Tab' || event.shiftKey || event.ctrlKey || event.metaKey || event.altKey) {
|
|
447
|
+
return { type: 'none' };
|
|
448
|
+
}
|
|
449
|
+
const spaces = ' ';
|
|
450
|
+
return {
|
|
451
|
+
type: 'indent',
|
|
452
|
+
value: value.substring(0, start) + spaces + value.substring(end),
|
|
453
|
+
caret: start + spaces.length,
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/** Missing editable content is empty; supplied source is never reformatted. */
|
|
458
|
+
function normalizeSyntaxBoxValue(value, options) {
|
|
459
|
+
return options.editable ? value ?? '' : value;
|
|
460
|
+
}
|
|
461
|
+
function resolveInitialSyntaxBoxValue(options) {
|
|
462
|
+
const code = normalizeSyntaxBoxValue(options.code ?? options.value, options);
|
|
463
|
+
// Preserve the existing read-only behavior when both aliases were supplied differently.
|
|
464
|
+
const value = options.editable ? code : options.value ?? code;
|
|
465
|
+
return { code, value, initialValue: code ?? '' };
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
const syntaxBoxCss = () => `:host{--q-syntax-bg:#0d1117;--q-syntax-border:#21262d;--q-syntax-header-bg:#161b22;--q-syntax-text:#c9d1d9;--q-syntax-comment:#8b949e;--q-syntax-tag:#ff7b72;--q-syntax-attr:#79c0ff;--q-syntax-value:#a5d6ff;--q-syntax-number:#f0883e;--q-syntax-font-mono:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;--q-syntax-header-font-size:var(--q-font-size-sm, 0.7rem);--q-syntax-code-font-size:var(--q-font-size-base, 0.9rem);--q-syntax-compact-font-size:var(--q-font-size-sm, 0.7rem);display:block;box-sizing:border-box}.panel-container{position:relative;border-radius:var(--q-radius-lg, 12px);background:var(--q-syntax-bg);border:1px solid var(--q-syntax-border);overflow:hidden;height:100%;display:flex;flex-direction:column;box-sizing:border-box}.panel-header{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:var(--q-syntax-header-padding, 4px 16px);background:var(--q-syntax-header-bg);border-bottom:1px solid var(--q-syntax-border);font-size:var(--q-syntax-header-font-size);color:var(--q-syntax-comment);box-sizing:border-box;flex-shrink:0}.panel-header>span{flex-shrink:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.panel-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}.format-feedback{padding:4px 16px;font-size:var(--q-syntax-header-font-size);color:var(--q-syntax-comment);border-bottom:1px solid var(--q-syntax-border)}.plain-container{margin:0;padding:0;box-sizing:border-box}.code-body{margin:0;padding:var(--q-syntax-padding, 16px);overflow-x:hidden;overflow-y:auto;font-family:var(--q-syntax-font-mono);font-size:var(--q-syntax-code-font-size);line-height:1.5;color:var(--q-syntax-text);white-space:pre-wrap;word-wrap:break-word}:host(.variant-card-code) .code-body{padding:var(--q-syntax-compact-padding, 10px);font-size:var(--q-syntax-compact-font-size);border-radius:var(--q-radius-md, 8px);background:var(--q-syntax-bg);border:1px solid var(--q-syntax-border)}.code-comment{color:var(--q-syntax-comment);font-style:italic}.code-tag{color:var(--q-syntax-tag);font-weight:600}.code-attr{color:var(--q-syntax-attr)}.code-value{color:var(--q-syntax-value)}.code-number{color:var(--q-syntax-number)}.editor-area{position:relative;width:100%;box-sizing:border-box}.editor-textarea{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;padding:var(--q-syntax-padding, 16px);box-sizing:border-box;font-family:var(--q-syntax-font-mono);font-size:var(--q-syntax-code-font-size);line-height:1.5;white-space:pre-wrap;word-wrap:break-word;overflow-x:hidden;overflow-y:auto;background:transparent;color:transparent;caret-color:var(--q-color-primary, #60a5fa);border:none;outline:none;resize:none;z-index:1}.editor-textarea::selection{background:rgba(96, 165, 250, 0.3);color:transparent}.editor-area .code-body{position:relative;width:100%;height:100%;margin:0;padding:var(--q-syntax-padding, 16px);box-sizing:border-box;overflow:hidden;pointer-events:none}.panel-container:focus-within{outline:var(--q-focus-ring, 2px solid var(--q-color-primary, #60a5fa));outline-offset:-1px}:host([editable]) .plain-container:focus-within{outline:var(--q-focus-ring, 2px solid var(--q-color-primary, #60a5fa));border-radius:var(--q-radius-md, 8px)}:host([disabled]){opacity:0.6;cursor:not-allowed !important}:host([disabled]) .editor-textarea,.editor-textarea:disabled,:host([disabled]) .code-body,:host([disabled]) .code-body *{cursor:not-allowed !important;user-select:none;-webkit-user-select:none}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}`;
|
|
469
|
+
|
|
470
|
+
const QSyntaxBox = class {
|
|
471
|
+
constructor(hostRef) {
|
|
472
|
+
index.registerInstance(this, hostRef);
|
|
473
|
+
this.qChange = index.createEvent(this, "qChange");
|
|
474
|
+
this.qInput = index.createEvent(this, "qInput");
|
|
475
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
476
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
477
|
+
}
|
|
478
|
+
else {
|
|
479
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
480
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
get el() { return index.getElement(this); }
|
|
484
|
+
internals;
|
|
485
|
+
/** Mirrored with `value`; prefer `code` for domain usage. */
|
|
486
|
+
code;
|
|
487
|
+
/** Form-value alias mirrored with `code` for compatibility. */
|
|
488
|
+
value;
|
|
489
|
+
/** Shown only in the panel variant. */
|
|
490
|
+
heading;
|
|
491
|
+
/** Accessible name for the editor; falls back to `heading`, then the language. */
|
|
492
|
+
ariaLabel = null;
|
|
493
|
+
variant = 'panel';
|
|
494
|
+
/** Explicit content height. Panel mode defaults to 110px; plain mode defaults to auto. */
|
|
495
|
+
height;
|
|
496
|
+
copyable = false;
|
|
497
|
+
editable = false;
|
|
498
|
+
/** Form field name used when the component is editable. */
|
|
499
|
+
name;
|
|
500
|
+
/** Marks the editable textarea as required for form validation. */
|
|
501
|
+
required = false;
|
|
502
|
+
language = 'html';
|
|
503
|
+
/** Disables editing and panel actions. */
|
|
504
|
+
disabled = false;
|
|
505
|
+
/** Emitted when editable content is committed by the native change event or by formatting. */
|
|
506
|
+
qChange;
|
|
507
|
+
/** Emitted on each editable content input and after formatting. */
|
|
508
|
+
qInput;
|
|
509
|
+
// ======================== [2] INTERNAL STATE & REFS ========================
|
|
510
|
+
disabledState = false;
|
|
511
|
+
get isDisabled() {
|
|
512
|
+
return formFieldState.isFieldDisabled(this.el, this.disabled);
|
|
513
|
+
}
|
|
514
|
+
copied = false;
|
|
515
|
+
copyFailed = false;
|
|
516
|
+
formatMessage;
|
|
517
|
+
initialValue = '';
|
|
518
|
+
copiedTimeoutId;
|
|
519
|
+
scrollableEl;
|
|
520
|
+
preEl;
|
|
521
|
+
// ========================= [3] LIFECYCLE & WATCHERS =========================
|
|
522
|
+
watchCode(newCode) {
|
|
523
|
+
this.formatMessage = undefined;
|
|
524
|
+
const finalCode = normalizeSyntaxBoxValue(newCode, {
|
|
525
|
+
editable: this.editable,
|
|
526
|
+
});
|
|
527
|
+
if (finalCode !== newCode) {
|
|
528
|
+
this.code = finalCode;
|
|
529
|
+
}
|
|
530
|
+
if (this.value !== finalCode) {
|
|
531
|
+
this.value = finalCode;
|
|
532
|
+
}
|
|
533
|
+
this.syncFormValue(finalCode);
|
|
534
|
+
}
|
|
535
|
+
watchValue(newValue) {
|
|
536
|
+
this.formatMessage = undefined;
|
|
537
|
+
const finalVal = normalizeSyntaxBoxValue(newValue, {
|
|
538
|
+
editable: this.editable,
|
|
539
|
+
});
|
|
540
|
+
if (finalVal !== newValue) {
|
|
541
|
+
this.value = finalVal;
|
|
542
|
+
}
|
|
543
|
+
if (this.code !== finalVal) {
|
|
544
|
+
this.code = finalVal;
|
|
545
|
+
}
|
|
546
|
+
this.syncFormValue(finalVal);
|
|
547
|
+
}
|
|
548
|
+
watchConstraints() {
|
|
549
|
+
this.syncValidity();
|
|
550
|
+
}
|
|
551
|
+
watchEditable() {
|
|
552
|
+
if (this.editable)
|
|
553
|
+
this.watchCode(this.code);
|
|
554
|
+
this.syncFormValue(this.code);
|
|
555
|
+
}
|
|
556
|
+
componentWillLoad() {
|
|
557
|
+
const initial = resolveInitialSyntaxBoxValue({
|
|
558
|
+
code: this.code,
|
|
559
|
+
value: this.value,
|
|
560
|
+
editable: this.editable,
|
|
561
|
+
});
|
|
562
|
+
this.code = initial.code;
|
|
563
|
+
this.value = initial.value;
|
|
564
|
+
this.initialValue = initial.initialValue;
|
|
565
|
+
this.syncFormValue(this.code);
|
|
566
|
+
}
|
|
567
|
+
formDisabledCallback() {
|
|
568
|
+
this.syncValidity();
|
|
569
|
+
}
|
|
570
|
+
componentDidLoad() {
|
|
571
|
+
formFieldAdapter.registerFormField(this.el, {
|
|
572
|
+
kind: 'text',
|
|
573
|
+
owner: () => this.internals?.form ?? null,
|
|
574
|
+
active: () => this.editable,
|
|
575
|
+
value: () => this.code ?? '',
|
|
576
|
+
assign: value => { this.value = value; },
|
|
577
|
+
reconcile: () => {
|
|
578
|
+
const textarea = this.el.shadowRoot?.querySelector('textarea');
|
|
579
|
+
if (textarea && textarea.value !== (this.code ?? ''))
|
|
580
|
+
textarea.value = this.code ?? '';
|
|
581
|
+
this.syncFormValue(this.code);
|
|
582
|
+
this.syncValidity();
|
|
583
|
+
},
|
|
584
|
+
reset: () => this.formResetCallback(),
|
|
585
|
+
validate: report => report ? this.internals?.reportValidity?.() ?? true : this.internals?.checkValidity?.() ?? true,
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
componentDidRender() {
|
|
589
|
+
this.syncValidity();
|
|
590
|
+
}
|
|
591
|
+
disconnectedCallback() {
|
|
592
|
+
this.clearCopiedTimeout();
|
|
593
|
+
}
|
|
594
|
+
formResetCallback() {
|
|
595
|
+
this.code = this.initialValue;
|
|
596
|
+
this.value = this.initialValue;
|
|
597
|
+
this.syncFormValue(this.code);
|
|
598
|
+
this.syncValidity();
|
|
599
|
+
}
|
|
600
|
+
// ========================== [4] EXPOSED METHODS ==========================
|
|
601
|
+
/** Programmatically scrolls the read-only code body to the bottom when it is wrapped by q-scrollable. */
|
|
602
|
+
async scrollToBottom() {
|
|
603
|
+
await this.scrollableEl?.scrollToBottom();
|
|
604
|
+
}
|
|
605
|
+
/** Returns whether editable content satisfies native constraints. */
|
|
606
|
+
async checkValidity() {
|
|
607
|
+
this.syncValidity();
|
|
608
|
+
if (typeof this.internals.checkValidity === 'function') {
|
|
609
|
+
return this.internals.checkValidity();
|
|
610
|
+
}
|
|
611
|
+
return this.el.shadowRoot?.querySelector('textarea')?.checkValidity?.() ?? true;
|
|
612
|
+
}
|
|
613
|
+
/** Reports editable constraint violations and returns whether the control is valid. */
|
|
614
|
+
async reportValidity() {
|
|
615
|
+
this.syncValidity();
|
|
616
|
+
if (typeof this.internals.reportValidity === 'function') {
|
|
617
|
+
return this.internals.reportValidity();
|
|
618
|
+
}
|
|
619
|
+
return this.el.shadowRoot?.querySelector('textarea')?.reportValidity?.() ?? true;
|
|
620
|
+
}
|
|
621
|
+
// =================== [5] EVENT HANDLERS & INTERNAL METHODS ===================
|
|
622
|
+
syncFormValue(value) {
|
|
623
|
+
if (!this.internals || typeof this.internals.setFormValue !== 'function')
|
|
624
|
+
return;
|
|
625
|
+
this.internals.setFormValue(this.editable ? value || '' : null);
|
|
626
|
+
this.syncValidity();
|
|
627
|
+
}
|
|
628
|
+
syncValidity() {
|
|
629
|
+
const disabled = formFieldState.syncFieldHost(this.el, this.disabled, this.name, this.required);
|
|
630
|
+
if (this.disabledState !== disabled)
|
|
631
|
+
this.disabledState = disabled;
|
|
632
|
+
const textarea = this.el.shadowRoot?.querySelector('textarea');
|
|
633
|
+
if (textarea) {
|
|
634
|
+
textarea.disabled = disabled;
|
|
635
|
+
textarea.required = this.required;
|
|
636
|
+
textarea.readOnly = this.el.hasAttribute('readonly');
|
|
637
|
+
if (textarea.value !== (this.code ?? ''))
|
|
638
|
+
textarea.value = this.code ?? '';
|
|
639
|
+
}
|
|
640
|
+
this.internals?.setFormValue?.(this.editable && !disabled ? this.code ?? '' : null);
|
|
641
|
+
if (!this.internals || !textarea || !this.editable) {
|
|
642
|
+
if (typeof this.internals?.setValidity === 'function') {
|
|
643
|
+
this.internals.setValidity({});
|
|
644
|
+
}
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
formControlValidity.syncNativeControlValidity({
|
|
648
|
+
internals: this.internals,
|
|
649
|
+
control: textarea,
|
|
650
|
+
disabled: this.isDisabled,
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
clearCopiedTimeout() {
|
|
654
|
+
if (this.copiedTimeoutId !== undefined) {
|
|
655
|
+
clearTimeout(this.copiedTimeoutId);
|
|
656
|
+
this.copiedTimeoutId = undefined;
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
scheduleCopyStateReset() {
|
|
660
|
+
this.clearCopiedTimeout();
|
|
661
|
+
this.copiedTimeoutId = setTimeout(() => {
|
|
662
|
+
this.copied = false;
|
|
663
|
+
this.copyFailed = false;
|
|
664
|
+
this.copiedTimeoutId = undefined;
|
|
665
|
+
}, 1500);
|
|
666
|
+
}
|
|
667
|
+
copyCode = async () => {
|
|
668
|
+
if (this.isDisabled)
|
|
669
|
+
return;
|
|
670
|
+
const codeToCopy = getSyntaxBoxCopyText(this.code, this.el.textContent);
|
|
671
|
+
try {
|
|
672
|
+
await writeClipboardText(codeToCopy);
|
|
673
|
+
if (!this.el.isConnected)
|
|
674
|
+
return;
|
|
675
|
+
this.copied = true;
|
|
676
|
+
this.copyFailed = false;
|
|
677
|
+
}
|
|
678
|
+
catch {
|
|
679
|
+
if (!this.el.isConnected)
|
|
680
|
+
return;
|
|
681
|
+
this.copied = false;
|
|
682
|
+
this.copyFailed = true;
|
|
683
|
+
}
|
|
684
|
+
this.scheduleCopyStateReset();
|
|
685
|
+
};
|
|
686
|
+
handleScroll = (e) => {
|
|
687
|
+
const textarea = e.target;
|
|
688
|
+
if (this.preEl) {
|
|
689
|
+
this.preEl.scrollLeft = textarea.scrollLeft;
|
|
690
|
+
this.preEl.scrollTop = textarea.scrollTop;
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
handleInput = (ev) => {
|
|
694
|
+
const target = ev.target;
|
|
695
|
+
this.code = target.value;
|
|
696
|
+
this.value = target.value;
|
|
697
|
+
this.qInput.emit(this.code);
|
|
698
|
+
};
|
|
699
|
+
handleChange = (ev) => {
|
|
700
|
+
const target = ev.target;
|
|
701
|
+
this.code = target.value;
|
|
702
|
+
this.value = target.value;
|
|
703
|
+
this.qChange.emit(this.code);
|
|
704
|
+
};
|
|
705
|
+
handleKeyDown = (ev) => {
|
|
706
|
+
const textarea = ev.target;
|
|
707
|
+
const action = getSyntaxBoxEditorKeyAction(ev, textarea.value, textarea.selectionStart, textarea.selectionEnd);
|
|
708
|
+
if (action.type === 'none') {
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
if (action.type === 'blur') {
|
|
712
|
+
textarea.blur();
|
|
713
|
+
return;
|
|
714
|
+
}
|
|
715
|
+
ev.preventDefault();
|
|
716
|
+
this.code = action.value;
|
|
717
|
+
this.value = action.value;
|
|
718
|
+
this.qInput.emit(this.code);
|
|
719
|
+
requestAnimationFrame(() => {
|
|
720
|
+
textarea.selectionStart = textarea.selectionEnd = action.caret;
|
|
721
|
+
});
|
|
722
|
+
};
|
|
723
|
+
handleFormat = () => {
|
|
724
|
+
if (this.isDisabled || !isFormatSupported(this.language))
|
|
725
|
+
return;
|
|
726
|
+
if (this.code) {
|
|
727
|
+
const result = formatSource(this.code, this.language);
|
|
728
|
+
this.code = result.code;
|
|
729
|
+
this.value = result.code;
|
|
730
|
+
this.formatMessage = result.status === 'invalid' ? 'Invalid JSON; source unchanged.'
|
|
731
|
+
: result.status === 'unsupported' ? 'JSON formatting limit reached; source unchanged.' : undefined;
|
|
732
|
+
this.qInput.emit(result.code);
|
|
733
|
+
this.qChange.emit(result.code);
|
|
734
|
+
}
|
|
735
|
+
};
|
|
736
|
+
getCopyTooltipContent() {
|
|
737
|
+
if (this.copyFailed)
|
|
738
|
+
return 'Copy failed';
|
|
739
|
+
if (this.copied)
|
|
740
|
+
return 'Copied!';
|
|
741
|
+
return 'Copy';
|
|
742
|
+
}
|
|
743
|
+
// ===================== [6] RENDER (Visual Template Only) =====================
|
|
744
|
+
render() {
|
|
745
|
+
const resolvedHeight = this.height !== undefined ? this.height : this.variant === 'panel' ? '110px' : 'auto';
|
|
746
|
+
const isScrollable = resolvedHeight !== 'auto' && resolvedHeight !== '';
|
|
747
|
+
const formatSupported = isFormatSupported(this.language);
|
|
748
|
+
const formatFeedback = this.editable ? formatSupported ? this.formatMessage : 'Formatting is available for JSON only.' : undefined;
|
|
749
|
+
const highlighted = tokenizeSyntax(this.code ?? '', this.language).map(token => token.className ? index.h("span", { class: token.className }, token.text) : token.text);
|
|
750
|
+
const content = this.editable || this.code !== undefined ? (this.editable ? (index.h("div", { class: "editor-area", style: { height: resolvedHeight } }, index.h("span", { id: "syntax-box-keyboard-help", class: "visually-hidden" }, "Press Escape to leave the code editor. Press Tab to insert two spaces."), index.h("textarea", { class: "editor-textarea", value: this.code ?? '', name: this.name, disabled: this.isDisabled, required: this.required, "aria-label": this.ariaLabel?.trim() || this.heading?.trim() || `${this.language.toUpperCase()} code editor`, "aria-describedby": "syntax-box-keyboard-help", onInput: this.handleInput, onChange: this.handleChange, onScroll: this.handleScroll, onKeyDown: this.handleKeyDown }), index.h("pre", { class: "code-body", ref: el => (this.preEl = el) }, index.h("code", null, highlighted)))) : (index.h("pre", { class: "code-body" }, index.h("code", null, highlighted)))) : (index.h("slot", null));
|
|
751
|
+
const bodyContent = isScrollable && !this.editable ? (index.h("q-scrollable", { height: resolvedHeight, ref: el => (this.scrollableEl = el) }, content)) : (content);
|
|
752
|
+
if (this.variant === 'panel') {
|
|
753
|
+
return (index.h(index.Host, { class: { 'q-syntax-box-panel': true } }, index.h("div", { class: "panel-container" }, index.h("div", { class: "panel-header" }, index.h("span", null, this.heading), index.h("div", { class: "panel-actions" }, index.h("slot", { name: "actions" }), this.editable && (index.h("q-button", { class: "format-btn", variant: "ghost", size: "sm", onClick: this.handleFormat, disabled: this.isDisabled || !formatSupported }, index.h("q-icon", { slot: "icon-left", definition: Braces, name: "braces", size: "sm" }), index.h("q-tooltip", { slot: "icon-left", position: "bottom", content: formatSupported ? 'Format JSON' : 'Formatting is available for JSON only.' }))), this.copyable && (index.h("q-button", { variant: "ghost", size: "sm", onClick: this.copyCode, disabled: this.isDisabled }, index.h("q-icon", { slot: "icon-left", definition: this.copied ? Check : Copy, name: this.copied ? 'check' : 'copy', size: "sm" }), index.h("q-tooltip", { slot: "icon-left", position: "bottom", content: this.getCopyTooltipContent() }))))), formatFeedback && index.h("div", { class: "format-feedback", role: "status" }, formatFeedback), bodyContent)));
|
|
754
|
+
}
|
|
755
|
+
return (index.h(index.Host, { class: { 'q-syntax-box-plain': true } }, index.h("div", { class: "plain-container" }, bodyContent)));
|
|
756
|
+
}
|
|
757
|
+
static get delegatesFocus() { return true; }
|
|
758
|
+
static get formAssociated() { return true; }
|
|
759
|
+
static get watchers() { return {
|
|
760
|
+
"code": [{
|
|
761
|
+
"watchCode": 0
|
|
762
|
+
}],
|
|
763
|
+
"value": [{
|
|
764
|
+
"watchValue": 0
|
|
765
|
+
}],
|
|
766
|
+
"disabled": [{
|
|
767
|
+
"watchConstraints": 0
|
|
768
|
+
}],
|
|
769
|
+
"required": [{
|
|
770
|
+
"watchConstraints": 0
|
|
771
|
+
}],
|
|
772
|
+
"name": [{
|
|
773
|
+
"watchConstraints": 0
|
|
774
|
+
}],
|
|
775
|
+
"editable": [{
|
|
776
|
+
"watchEditable": 0
|
|
777
|
+
}]
|
|
778
|
+
}; }
|
|
779
|
+
};
|
|
780
|
+
QSyntaxBox.style = syntaxBoxCss();
|
|
781
|
+
|
|
782
|
+
exports.q_syntax_box = QSyntaxBox;
|