@webquark/browser 1.1.0-dev.9 → 1.1.1-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{action.props-N0urQtdP.js → action.props-CNe2JXR5.js} +1 -1
- package/dist/cjs/{dom-Dk77oFF6.js → dom-BYrqRYna.js} +1 -1
- package/dist/cjs/{field-CsrQGhG-.js → field-BRAR56Ex.js} +1 -1
- package/dist/cjs/{form-control-validity-D1ukC0_e.js → form-control-validity-BkilGb3E.js} +3 -3
- package/dist/cjs/{index-DWXhKHCB.js → index-BN-WdOQM.js} +17 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/q-accordion.cjs.entry.js +2 -2
- package/dist/cjs/q-alert.cjs.entry.js +2 -2
- package/dist/cjs/q-avatar.cjs.entry.js +2 -2
- package/dist/cjs/q-banner.cjs.entry.js +1 -1
- package/dist/cjs/q-button_3.cjs.entry.js +907 -0
- package/dist/cjs/q-card.cjs.entry.js +3 -3
- package/dist/cjs/q-carousel.cjs.entry.js +120 -18
- package/dist/cjs/q-chip.cjs.entry.js +2 -2
- package/dist/cjs/q-control-group.cjs.entry.js +64 -0
- package/dist/cjs/q-conversation-bubble.cjs.entry.js +1 -1
- package/dist/cjs/q-data-table.cjs.entry.js +4 -4
- package/dist/cjs/q-dialog.cjs.entry.js +4 -4
- package/dist/cjs/q-divider.cjs.entry.js +26 -0
- package/dist/cjs/q-dropdown.cjs.entry.js +320 -104
- package/dist/cjs/q-form.cjs.entry.js +17 -7
- package/dist/cjs/q-grid.cjs.entry.js +3 -3
- package/dist/cjs/q-icon.cjs.entry.js +1 -1
- package/dist/cjs/q-image-comparison.cjs.entry.js +2 -2
- package/dist/cjs/q-inline.cjs.entry.js +3 -3
- package/dist/cjs/q-input_2.cjs.entry.js +10 -8
- package/dist/cjs/q-link.cjs.entry.js +2 -2
- package/dist/cjs/q-map.cjs.entry.js +2 -2
- package/dist/cjs/q-media.cjs.entry.js +2 -2
- package/dist/cjs/q-navbar.cjs.entry.js +3 -3
- package/dist/cjs/q-pagination.cjs.entry.js +2 -2
- package/dist/cjs/q-panel.cjs.entry.js +7 -7
- package/dist/cjs/q-quantity-selector.cjs.entry.js +6 -6
- package/dist/cjs/q-radio-group.cjs.entry.js +4 -4
- package/dist/cjs/q-reel.cjs.entry.js +24 -24
- package/dist/cjs/q-section.cjs.entry.js +2 -2
- package/dist/cjs/q-sidepanel.cjs.entry.js +5 -4
- package/dist/cjs/q-slider.cjs.entry.js +122 -0
- package/dist/cjs/q-stack.cjs.entry.js +3 -3
- package/dist/cjs/q-step-diagram-item.cjs.entry.js +2 -2
- package/dist/cjs/q-step-diagram.cjs.entry.js +4 -4
- package/dist/cjs/q-syntax-box.cjs.entry.js +180 -719
- package/dist/cjs/q-syntax-view.cjs.entry.js +65 -0
- package/dist/cjs/q-tabs.cjs.entry.js +2 -2
- package/dist/cjs/q-textarea.cjs.entry.js +8 -6
- package/dist/cjs/q-thumbnail.cjs.entry.js +3 -3
- package/dist/cjs/q-toast.cjs.entry.js +1 -1
- package/dist/cjs/q-toggle.cjs.entry.js +7 -7
- package/dist/cjs/q-toolbar.cjs.entry.js +4 -4
- package/dist/cjs/syntax-content-BmSExDiW.js +910 -0
- package/dist/cjs/{tokens-RMRaIOqv.js → tokens-BMrfol_M.js} +4 -1
- package/dist/cjs/webquark.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +6 -1
- package/dist/collection/components/actions/button/button.css +49 -9
- package/dist/collection/components/actions/button/{button.utils.unit.test.js → test/button.utils.unit.test.js} +1 -1
- package/dist/collection/components/communication/alert/alert.css +4 -1
- package/dist/collection/components/content/carousel/carousel.css +7 -0
- package/dist/collection/components/content/carousel/carousel.js +256 -10
- package/dist/collection/components/content/carousel/internals/autoplay.js +31 -6
- package/dist/collection/components/content/carousel/test/transitions.cmp.test.js +122 -0
- package/dist/collection/components/data-display/accordion/accordion.js +1 -1
- package/dist/collection/components/data-display/data-table/data-table.js +3 -3
- package/dist/collection/components/data-display/map/map.js +1 -1
- package/dist/collection/components/data-display/map/test/map.cmp.test.js +1 -1
- package/dist/collection/components/data-display/pagination/pagination.js +1 -1
- package/dist/collection/components/data-display/syntax-box/internals/formatters/css.js +4 -0
- package/dist/collection/components/data-display/syntax-box/internals/formatters/formatter.js +20 -0
- package/dist/collection/{utils → components/data-display/syntax-box/internals/formatters}/formatter.unit.test.js +38 -11
- package/dist/collection/components/data-display/syntax-box/internals/formatters/html.js +4 -0
- package/dist/collection/components/data-display/syntax-box/internals/formatters/javascript.js +4 -0
- package/dist/collection/{utils/formatter.js → components/data-display/syntax-box/internals/formatters/json.js} +2 -20
- package/dist/collection/components/data-display/syntax-box/internals/formatters/languages.js +15 -0
- package/dist/collection/components/data-display/syntax-box/internals/formatters/util/prettier.js +17 -0
- package/dist/collection/{utils → components/data-display/syntax-box/internals}/syntax.unit.test.js +1 -1
- package/dist/collection/components/data-display/syntax-box/internals/views.js +29 -0
- package/dist/collection/components/data-display/syntax-box/internals/views.unit.test.js +19 -0
- package/dist/collection/components/data-display/syntax-box/syntax-box.css +107 -36
- package/dist/collection/components/data-display/syntax-box/syntax-box.js +179 -637
- package/dist/collection/components/data-display/syntax-box/syntax-content.js +748 -0
- package/dist/collection/components/data-display/syntax-box/syntax-ui.js +8 -0
- package/dist/collection/components/data-display/syntax-box/test/format-fixtures.js +2 -2
- package/dist/collection/components/data-display/syntax-box/test/syntax-box.cmp.test.js +1 -1
- package/dist/collection/components/data-display/syntax-box/test/syntax-format.cmp.test.js +20 -20
- package/dist/collection/components/data-display/syntax-box/test/syntax-views.cmp.test.js +228 -0
- package/dist/collection/components/data-display/syntax-view/syntax-view.js +64 -0
- package/dist/collection/components/indicators/step-diagram/step-diagram.js +2 -2
- package/dist/collection/components/indicators/step-diagram-item/step-diagram-item.js +1 -1
- package/dist/collection/components/inputs/dropdown/dropdown.css +148 -0
- package/dist/collection/components/inputs/dropdown/dropdown.js +422 -104
- package/dist/collection/components/inputs/dropdown/test/dropdown.cmp.test.js +28 -0
- package/dist/collection/components/inputs/dropdown/test/fit-options.cmp.test.js +120 -0
- package/dist/collection/components/inputs/dropdown/test/multiple.cmp.test.js +124 -0
- package/dist/collection/components/inputs/dropdown/test/search-mode.cmp.test.js +186 -0
- package/dist/collection/components/inputs/form/form.js +2 -2
- package/dist/collection/components/inputs/form/internals/controls.js +2 -2
- package/dist/collection/components/inputs/form/internals/field-state.js +6 -1
- package/dist/collection/components/inputs/form/internals/values.js +5 -0
- package/dist/collection/components/inputs/form/test/form-submit.cmp.test.js +14 -8
- package/dist/collection/components/inputs/input/input.css +42 -0
- package/dist/collection/components/inputs/input/input.js +31 -3
- package/dist/collection/components/inputs/quantity-selector/quantity-selector.css +22 -0
- package/dist/collection/components/inputs/quantity-selector/quantity-selector.js +4 -4
- package/dist/collection/components/inputs/radio-group/radio-group.js +2 -2
- package/dist/collection/components/inputs/slider/slider.css +44 -0
- package/dist/collection/components/inputs/slider/slider.js +383 -0
- package/dist/collection/components/inputs/slider/test/slider.cmp.test.js +45 -0
- package/dist/collection/components/inputs/textarea/textarea.css +20 -0
- package/dist/collection/components/inputs/textarea/textarea.js +30 -2
- package/dist/collection/components/inputs/toggle/test/toggle-layout.cmp.test.js +69 -0
- package/dist/collection/components/inputs/toggle/toggle.css +27 -0
- package/dist/collection/components/inputs/toggle/toggle.js +3 -3
- package/dist/collection/components/layout/control-group/control-group.css +108 -0
- package/dist/collection/components/layout/control-group/control-group.js +142 -0
- package/dist/collection/components/layout/control-group/test/control-group.cmp.test.js +163 -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.js +1 -1
- package/dist/collection/components/layout/inline/inline.js +1 -1
- package/dist/collection/components/layout/navbar/navbar.js +2 -2
- package/dist/collection/components/layout/panel/panel.js +4 -4
- package/dist/collection/components/layout/scrollable/scrollable.js +3 -3
- package/dist/collection/components/layout/section/section.js +1 -1
- package/dist/collection/components/layout/sidepanel/internals/nav-items.js +2 -2
- package/dist/collection/components/layout/sidepanel/sidepanel.js +3 -0
- package/dist/collection/components/layout/stack/stack.js +1 -1
- package/dist/collection/components/layout/tabs/tabs.js +1 -1
- package/dist/collection/components/layout/toolbar/toolbar.js +2 -2
- package/dist/collection/components/media/avatar/avatar.js +1 -1
- package/dist/collection/components/media/image-comparison/image-comparison.js +1 -1
- package/dist/collection/components/media/media/media.js +1 -1
- package/dist/collection/components/media/reel/reel.js +23 -23
- package/dist/collection/components/media/reel/test/focus.cmp.test.js +33 -0
- package/dist/collection/components/media/thumbnail/thumbnail.js +2 -2
- package/dist/collection/components/overlays/dialog/dialog.js +2 -2
- package/dist/collection/components/overlays/tooltip/tooltip.js +2 -2
- package/dist/collection/theme/test/input-width.cmp.test.js +117 -0
- package/dist/collection/theme/test/presets.unit.test.js +58 -0
- package/dist/collection/theme/tokens.js +4 -1
- package/dist/collection/utils/dom.js +1 -1
- package/dist/collection/utils/form-control-validity.js +3 -3
- package/dist/components/index.js +1 -1
- package/dist/components/p-B610wOGe.js +1 -0
- package/dist/components/p-BGlbV43y.js +13 -0
- package/dist/components/{p-Dfp_If-_.js → p-BKWL9zOn.js} +1 -1
- package/dist/components/p-BxxU73QQ.js +1 -0
- package/dist/components/{p-Cg0Mv7Vb.js → p-CVEQfA-v.js} +1 -1
- package/dist/components/p-CpbWWDiY.js +1 -0
- package/dist/{webquark/p-Dhsn99q4.js → components/p-D2fczi8m.js} +1 -1
- package/dist/components/{p-6PPZ2sIO.js → p-D5vpGqZ9.js} +1 -1
- package/dist/components/p-DQIYo8zC.js +1 -0
- package/dist/components/p-DX6PCIPS.js +1 -0
- package/dist/components/p-DY9D4z7Z.js +1 -0
- package/dist/components/p-DbzjRzhu.js +1 -0
- package/dist/components/{p-DQhiqYeq.js → p-DkanItP3.js} +1 -1
- package/dist/components/{p-CKuPOxKN.js → p-RX4DjgmV.js} +1 -1
- package/dist/components/{p-DlIn_ZWk.js → p-Ts5oOvg8.js} +1 -1
- package/dist/components/p-u1Qz6OcP.js +1 -0
- package/dist/components/q-accordion.js +1 -1
- package/dist/components/q-alert.js +1 -1
- package/dist/components/q-avatar.js +1 -1
- package/dist/components/q-banner.js +1 -1
- package/dist/components/q-button.js +1 -1
- package/dist/components/q-card.js +1 -1
- package/dist/components/q-carousel.js +1 -1
- package/dist/components/q-chip.js +1 -1
- package/dist/components/q-control-group.d.ts +11 -0
- package/dist/components/q-control-group.js +1 -0
- package/dist/components/q-conversation-bubble.js +1 -1
- package/dist/components/q-data-table.js +1 -1
- package/dist/components/q-dialog.js +1 -1
- package/dist/components/q-divider.d.ts +11 -0
- package/dist/components/q-divider.js +1 -0
- package/dist/components/q-dropdown.js +1 -1
- package/dist/components/q-form.js +1 -1
- package/dist/components/q-grid.js +1 -1
- package/dist/components/q-icon.js +1 -1
- package/dist/components/q-image-comparison.js +1 -1
- package/dist/components/q-inline.js +1 -1
- package/dist/components/q-input.js +1 -1
- package/dist/components/q-link.js +1 -1
- package/dist/components/q-map.js +1 -1
- package/dist/components/q-media.js +1 -1
- package/dist/components/q-navbar.js +1 -1
- package/dist/components/q-pagination.js +1 -1
- package/dist/components/q-panel.js +1 -1
- package/dist/components/q-progress.js +1 -1
- package/dist/components/q-quantity-selector.js +1 -1
- package/dist/components/q-radio-group.js +1 -1
- package/dist/components/q-reel.js +1 -1
- package/dist/components/q-scrollable.js +1 -1
- package/dist/components/q-section.js +1 -1
- package/dist/components/q-sidepanel.js +2 -2
- package/dist/components/q-slider.d.ts +11 -0
- package/dist/components/q-slider.js +1 -0
- package/dist/components/q-stack.js +1 -1
- package/dist/components/q-step-diagram-item.js +1 -1
- package/dist/components/q-step-diagram.js +1 -1
- package/dist/components/q-syntax-box.js +1 -13
- package/dist/components/q-syntax-view.d.ts +11 -0
- package/dist/components/q-syntax-view.js +1 -0
- package/dist/components/q-tabs.js +1 -1
- package/dist/components/q-textarea.js +1 -1
- package/dist/components/q-thumbnail.js +1 -1
- package/dist/components/q-toast.js +1 -1
- package/dist/components/q-toggle.js +1 -1
- package/dist/components/q-toolbar.js +1 -1
- package/dist/components/q-tooltip.js +1 -1
- package/dist/esm/{action.props-CpnGza8z.js → action.props-CbSH7c-q.js} +1 -1
- package/dist/esm/{dom-ByfrUWx1.js → dom-B610wOGe.js} +2 -2
- package/dist/esm/{field-zfD6OQ02.js → field-D5xUxo11.js} +1 -1
- package/dist/esm/{form-control-validity-Bj2RJb2E.js → form-control-validity-BxxU73QQ.js} +3 -3
- package/dist/esm/{form-submit-action-CoEIvDqE.js → form-submit-action-BjjfVWyu.js} +1 -1
- package/dist/esm/{index-B5ElFlHv.js → index-CIMzZPQO.js} +16 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/q-accordion.entry.js +2 -2
- package/dist/esm/q-alert.entry.js +2 -2
- package/dist/esm/q-avatar.entry.js +2 -2
- package/dist/esm/q-banner.entry.js +1 -1
- package/dist/esm/q-button_3.entry.js +903 -0
- package/dist/esm/q-card.entry.js +3 -3
- package/dist/esm/q-carousel.entry.js +120 -18
- package/dist/esm/q-chip.entry.js +2 -2
- package/dist/esm/q-control-group.entry.js +62 -0
- package/dist/esm/q-conversation-bubble.entry.js +1 -1
- package/dist/esm/q-data-table.entry.js +4 -4
- package/dist/esm/q-dialog.entry.js +4 -4
- package/dist/esm/q-divider.entry.js +24 -0
- package/dist/esm/q-dropdown.entry.js +320 -104
- package/dist/esm/q-form.entry.js +18 -8
- package/dist/esm/q-grid.entry.js +3 -3
- package/dist/esm/q-icon.entry.js +1 -1
- package/dist/esm/q-image-comparison.entry.js +2 -2
- package/dist/esm/q-inline.entry.js +3 -3
- package/dist/esm/q-input_2.entry.js +10 -8
- package/dist/esm/q-link.entry.js +2 -2
- package/dist/esm/q-map.entry.js +2 -2
- package/dist/esm/q-media.entry.js +2 -2
- package/dist/esm/q-navbar.entry.js +3 -3
- package/dist/esm/q-pagination.entry.js +2 -2
- package/dist/esm/q-panel.entry.js +7 -7
- package/dist/esm/q-quantity-selector.entry.js +6 -6
- package/dist/esm/q-radio-group.entry.js +4 -4
- package/dist/esm/q-reel.entry.js +24 -24
- package/dist/esm/q-section.entry.js +2 -2
- package/dist/esm/q-sidepanel.entry.js +5 -4
- package/dist/esm/q-slider.entry.js +120 -0
- package/dist/esm/q-stack.entry.js +3 -3
- package/dist/esm/q-step-diagram-item.entry.js +2 -2
- package/dist/esm/q-step-diagram.entry.js +4 -4
- package/dist/esm/q-syntax-box.entry.js +180 -719
- package/dist/esm/q-syntax-view.entry.js +63 -0
- package/dist/esm/q-tabs.entry.js +2 -2
- package/dist/esm/q-textarea.entry.js +8 -6
- package/dist/esm/q-thumbnail.entry.js +3 -3
- package/dist/esm/q-toast.entry.js +1 -1
- package/dist/esm/q-toggle.entry.js +7 -7
- package/dist/esm/q-toolbar.entry.js +4 -4
- package/dist/esm/syntax-content-Cr9kSbmA.js +903 -0
- package/dist/esm/{tokens-B4Mg1xEw.js → tokens-DbzjRzhu.js} +4 -1
- package/dist/esm/webquark.js +3 -3
- package/dist/formatters/prettier/LICENSE +7 -0
- package/dist/formatters/prettier/THIRD-PARTY-NOTICES.md +7941 -0
- package/dist/formatters/prettier/html-fragment.mjs +1 -0
- package/dist/formatters/prettier/html-fragment.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/angular.mjs +1 -0
- package/dist/formatters/prettier/languages/angular.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/css.mjs +1 -0
- package/dist/formatters/prettier/languages/css.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/flow.mjs +1 -0
- package/dist/formatters/prettier/languages/flow.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/graphql.mjs +1 -0
- package/dist/formatters/prettier/languages/graphql.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/handlebars.mjs +1 -0
- package/dist/formatters/prettier/languages/handlebars.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/html.mjs +1 -0
- package/dist/formatters/prettier/languages/html.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/javascript.mjs +1 -0
- package/dist/formatters/prettier/languages/javascript.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/json-stringify.mjs +1 -0
- package/dist/formatters/prettier/languages/json-stringify.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/json.mjs +1 -0
- package/dist/formatters/prettier/languages/json.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/json5.mjs +1 -0
- package/dist/formatters/prettier/languages/json5.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/jsonc.mjs +1 -0
- package/dist/formatters/prettier/languages/jsonc.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/jsx.mjs +1 -0
- package/dist/formatters/prettier/languages/jsx.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/less.mjs +1 -0
- package/dist/formatters/prettier/languages/less.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/lwc.mjs +1 -0
- package/dist/formatters/prettier/languages/lwc.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/markdown.mjs +1 -0
- package/dist/formatters/prettier/languages/markdown.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/mdx.mjs +1 -0
- package/dist/formatters/prettier/languages/mdx.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/mjml.mjs +1 -0
- package/dist/formatters/prettier/languages/mjml.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/postcss.mjs +1 -0
- package/dist/formatters/prettier/languages/postcss.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/scss.mjs +1 -0
- package/dist/formatters/prettier/languages/scss.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/tsx.mjs +1 -0
- package/dist/formatters/prettier/languages/tsx.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/typescript.mjs +1 -0
- package/dist/formatters/prettier/languages/typescript.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/vue.mjs +1 -0
- package/dist/formatters/prettier/languages/vue.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/yaml.mjs +1 -0
- package/dist/formatters/prettier/languages/yaml.mjs.gz +0 -0
- package/dist/formatters/prettier/manifest.json +87 -0
- package/dist/formatters/prettier/plugins/acorn.mjs +17 -0
- package/dist/formatters/prettier/plugins/acorn.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/angular.mjs +7 -0
- package/dist/formatters/prettier/plugins/angular.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/babel.mjs +16 -0
- package/dist/formatters/prettier/plugins/babel.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/estree.mjs +44 -0
- package/dist/formatters/prettier/plugins/estree.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/flow.mjs +7 -0
- package/dist/formatters/prettier/plugins/flow.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/glimmer.mjs +37 -0
- package/dist/formatters/prettier/plugins/glimmer.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/graphql.mjs +17 -0
- package/dist/formatters/prettier/plugins/graphql.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/html.mjs +25 -0
- package/dist/formatters/prettier/plugins/html.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/markdown.mjs +70 -0
- package/dist/formatters/prettier/plugins/markdown.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/meriyah.mjs +9 -0
- package/dist/formatters/prettier/plugins/meriyah.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/postcss.mjs +62 -0
- package/dist/formatters/prettier/plugins/postcss.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/typescript.mjs +22 -0
- package/dist/formatters/prettier/plugins/typescript.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/yaml.mjs +150 -0
- package/dist/formatters/prettier/plugins/yaml.mjs.gz +0 -0
- package/dist/formatters/prettier/runtime.d.mts +2 -0
- package/dist/formatters/prettier/runtime.mjs +1 -0
- package/dist/formatters/prettier/runtime.mjs.gz +0 -0
- package/dist/formatters/prettier/standalone.mjs +29 -0
- package/dist/formatters/prettier/standalone.mjs.gz +0 -0
- package/dist/playground/components/theme-designer/dimension-tokens.js +9 -0
- package/dist/playground/components/theme-designer/token-row.js +60 -0
- package/dist/playground/dom-factory.js +76 -0
- package/dist/playground/utils/color.js +15 -0
- package/dist/playground/utils/dom.js +38 -0
- package/dist/playground/utils/index.js +2 -0
- package/dist/types/components/content/carousel/carousel.d.ts +23 -2
- package/dist/types/components/content/carousel/carousel.types.d.ts +6 -0
- package/dist/types/components/content/carousel/internals/autoplay.d.ts +5 -0
- package/dist/types/components/data-display/syntax-box/internals/formatters/css.d.ts +1 -0
- package/dist/types/components/data-display/syntax-box/internals/formatters/formatter.d.ts +10 -0
- package/dist/types/components/data-display/syntax-box/internals/formatters/formatter.types.d.ts +4 -0
- package/dist/types/components/data-display/syntax-box/internals/formatters/html.d.ts +1 -0
- package/dist/types/components/data-display/syntax-box/internals/formatters/javascript.d.ts +1 -0
- package/dist/types/components/data-display/syntax-box/internals/formatters/json.d.ts +6 -0
- package/dist/types/components/data-display/syntax-box/internals/formatters/languages.d.ts +27 -0
- package/dist/types/components/data-display/syntax-box/internals/formatters/util/prettier.d.ts +3 -0
- package/dist/types/{utils → components/data-display/syntax-box/internals}/syntax.d.ts +1 -1
- 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/views.d.ts +11 -0
- package/dist/types/components/data-display/syntax-box/internals/views.unit.test.d.ts +1 -0
- package/dist/types/components/data-display/syntax-box/syntax-box.d.ts +66 -63
- package/dist/types/components/data-display/syntax-box/syntax-box.types.d.ts +1 -1
- package/dist/types/components/data-display/syntax-box/syntax-content.d.ts +41 -0
- package/dist/types/components/data-display/syntax-box/syntax-ui.d.ts +15 -0
- package/dist/types/components/data-display/syntax-box/test/format-fixtures.d.ts +1 -1
- package/dist/types/components/data-display/syntax-box/test/syntax-views.cmp.test.d.ts +1 -0
- package/dist/types/components/data-display/syntax-view/syntax-view.d.ts +48 -0
- package/dist/types/components/inputs/dropdown/dropdown.d.ts +45 -1
- package/dist/types/components/inputs/dropdown/test/fit-options.cmp.test.d.ts +3 -0
- package/dist/types/components/inputs/dropdown/test/multiple.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/internals/field-state.d.ts +1 -1
- package/dist/types/components/inputs/input/input.d.ts +3 -0
- package/dist/types/components/inputs/slider/slider.d.ts +45 -0
- package/dist/types/components/inputs/slider/test/slider.cmp.test.d.ts +1 -0
- package/dist/types/components/inputs/textarea/textarea.d.ts +3 -1
- package/dist/types/components/inputs/toggle/test/toggle-layout.cmp.test.d.ts +1 -0
- package/dist/types/components/layout/control-group/control-group.d.ts +20 -0
- package/dist/types/components/layout/control-group/test/control-group.cmp.test.d.ts +7 -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/sidepanel/sidepanel.d.ts +2 -0
- package/dist/types/components/layout/sidepanel/sidepanel.types.d.ts +1 -0
- package/dist/types/components/media/reel/reel.d.ts +3 -3
- package/dist/types/components/media/reel/test/focus.cmp.test.d.ts +1 -0
- package/dist/types/components.d.ts +591 -13
- 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 +13 -0
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/utils/color.d.ts +2 -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 +2 -2
- package/dist/types/theme/test/input-width.cmp.test.d.ts +3 -0
- package/dist/types/theme/test/presets.unit.test.d.ts +1 -0
- package/dist/types/theme/tokens.d.ts +9 -0
- package/dist/types/utils/form-control-validity.d.ts +2 -1
- package/dist/types/utils/form-field-adapter.d.ts +3 -3
- package/dist/webquark/p-014c2f4a.entry.js +1 -0
- package/dist/webquark/p-0389577c.entry.js +1 -0
- package/dist/webquark/p-041e17c1.entry.js +1 -0
- package/dist/webquark/p-0479c571.entry.js +1 -0
- package/dist/webquark/p-0ebca9be.entry.js +1 -0
- package/dist/webquark/{p-fe8c634a.entry.js → p-1bf375f7.entry.js} +2 -2
- package/dist/webquark/{p-6bfffa79.entry.js → p-20dc3ab5.entry.js} +1 -1
- package/dist/webquark/p-28d3348f.entry.js +1 -0
- package/dist/webquark/p-35c177d3.entry.js +1 -0
- package/dist/webquark/{p-99d785ca.entry.js → p-3a60086d.entry.js} +1 -1
- package/dist/webquark/{p-3bc4629c.entry.js → p-3ab798aa.entry.js} +1 -1
- package/dist/webquark/{p-9e78b796.entry.js → p-3b580baf.entry.js} +1 -1
- package/dist/webquark/{p-888e46a8.entry.js → p-3b65f787.entry.js} +1 -1
- package/dist/webquark/p-4bf610f8.entry.js +1 -0
- package/dist/webquark/{p-4d61b70d.entry.js → p-4d30227e.entry.js} +1 -1
- package/dist/webquark/{p-70d9ffde.entry.js → p-4de536ae.entry.js} +1 -1
- package/dist/webquark/{p-90b0858c.entry.js → p-4e4d70c9.entry.js} +1 -1
- package/dist/webquark/p-4efeb7c9.entry.js +1 -0
- package/dist/webquark/{p-dd115868.entry.js → p-51b3d71b.entry.js} +1 -1
- package/dist/webquark/p-778b6bbb.entry.js +1 -0
- package/dist/webquark/{p-f63b7214.entry.js → p-7da78b2f.entry.js} +1 -1
- package/dist/webquark/{p-9ff7e5a4.entry.js → p-7f8f986b.entry.js} +1 -1
- package/dist/webquark/p-8253c742.entry.js +1 -0
- package/dist/webquark/{p-059daa8a.entry.js → p-9a1ddeb7.entry.js} +1 -1
- package/dist/webquark/p-B610wOGe.js +1 -0
- package/dist/webquark/p-BxxU73QQ.js +1 -0
- package/dist/webquark/p-CIMzZPQO.js +3 -0
- package/dist/webquark/p-CfR85WgM.js +13 -0
- package/dist/{components/p-BofcK-7Z.js → webquark/p-D8p28N9s.js} +1 -1
- package/dist/webquark/p-DbzjRzhu.js +1 -0
- package/dist/webquark/{p-BOdNg0jc.js → p-DeOEN0si.js} +1 -1
- package/dist/webquark/{p-d0fbd2b1.entry.js → p-a2b1de23.entry.js} +1 -1
- package/dist/webquark/{p-48fb5228.entry.js → p-a55edc17.entry.js} +1 -1
- package/dist/webquark/p-a8808020.entry.js +1 -0
- package/dist/webquark/{p-f4f97e74.entry.js → p-b1084b3c.entry.js} +1 -1
- package/dist/webquark/{p-36118d90.entry.js → p-b6c4dff4.entry.js} +1 -1
- package/dist/webquark/p-b962e950.entry.js +1 -0
- package/dist/webquark/{p-023f8437.entry.js → p-bc369cd6.entry.js} +1 -1
- package/dist/webquark/p-c119a8ea.entry.js +1 -0
- package/dist/webquark/p-c6b77e9a.entry.js +1 -0
- package/dist/webquark/{p-030ecde3.entry.js → p-ca1c03b4.entry.js} +1 -1
- package/dist/webquark/{p-8ece2c62.entry.js → p-ce436162.entry.js} +1 -1
- package/dist/webquark/{p-0aa74ad6.entry.js → p-d0a47a7c.entry.js} +1 -1
- package/dist/webquark/{p-fec6fe0a.entry.js → p-e1fbc8fc.entry.js} +1 -1
- package/dist/webquark/{p-09cca7b9.entry.js → p-e32833ce.entry.js} +1 -1
- package/dist/webquark/p-e369a4aa.entry.js +1 -0
- package/dist/webquark/p-e4430c61.entry.js +1 -0
- package/dist/webquark/{p-f9ad63ff.entry.js → p-e9c0052b.entry.js} +1 -1
- package/dist/webquark/{p-f1bac94c.entry.js → p-f5c4ca18.entry.js} +1 -1
- package/dist/webquark/{p-64096386.entry.js → p-f6683126.entry.js} +1 -1
- package/dist/webquark/{p-DWO-pleQ.js → p-ojSDiptZ.js} +1 -1
- package/dist/webquark/webquark.css +1 -1
- package/dist/webquark/webquark.esm.js +1 -1
- package/package.json +6 -2
- package/dist/cjs/q-button_2.cjs.entry.js +0 -462
- package/dist/cjs/q-scrollable.cjs.entry.js +0 -449
- package/dist/components/p-B4Mg1xEw.js +0 -1
- package/dist/components/p-BH4gQWub.js +0 -1
- package/dist/components/p-Bj2RJb2E.js +0 -1
- package/dist/components/p-ByfrUWx1.js +0 -1
- package/dist/components/p-CN1ut2Lb.js +0 -1
- package/dist/components/p-ye27qtRo.js +0 -1
- package/dist/esm/q-button_2.entry.js +0 -459
- package/dist/esm/q-scrollable.entry.js +0 -447
- package/dist/types/utils/formatter.d.ts +0 -15
- package/dist/webquark/p-04c8cb9e.entry.js +0 -1
- package/dist/webquark/p-0ae43d6c.entry.js +0 -1
- package/dist/webquark/p-0c3aac3f.entry.js +0 -1
- package/dist/webquark/p-144ef339.entry.js +0 -1
- package/dist/webquark/p-296fbdb1.entry.js +0 -1
- package/dist/webquark/p-5f232b44.entry.js +0 -13
- package/dist/webquark/p-6e28cfe2.entry.js +0 -1
- package/dist/webquark/p-91fff6b6.entry.js +0 -1
- package/dist/webquark/p-923dac41.entry.js +0 -1
- package/dist/webquark/p-97a89cae.entry.js +0 -1
- package/dist/webquark/p-B4Mg1xEw.js +0 -1
- package/dist/webquark/p-B5ElFlHv.js +0 -3
- package/dist/webquark/p-Bj2RJb2E.js +0 -1
- package/dist/webquark/p-ByfrUWx1.js +0 -1
- package/dist/webquark/p-c523ec6f.entry.js +0 -1
- package/dist/webquark/p-d0253d64.entry.js +0 -1
- package/dist/webquark/p-f98f9439.entry.js +0 -1
- package/dist/webquark/p-fe200f68.entry.js +0 -1
- /package/dist/{types/components/actions/button/button.utils.unit.test.d.ts → collection/components/data-display/syntax-box/internals/formatters/formatter.types.js} +0 -0
- /package/dist/collection/{utils → components/data-display/syntax-box/internals}/syntax.js +0 -0
- /package/dist/types/{utils/formatter.unit.test.d.ts → components/actions/button/test/button.utils.unit.test.d.ts} +0 -0
- /package/dist/types/{utils/syntax.unit.test.d.ts → components/data-display/syntax-box/internals/formatters/formatter.unit.test.d.ts} +0 -0
|
@@ -226,14 +226,14 @@ export class QDataTable {
|
|
|
226
226
|
sortColumn: this.sortColumn,
|
|
227
227
|
sortDirection: this.sortDirection,
|
|
228
228
|
});
|
|
229
|
-
return (h("div", { key: '
|
|
229
|
+
return (h("div", { key: '9c73c6d30d081e5519af9ae93a465eac2181fcde', class: "table-container", role: "grid", "aria-label": this.ariaLabel?.trim() || this.toolbarTitle?.trim() || 'Data table' }, renderDataTableToolbar({
|
|
230
230
|
showToolbar: this.showToolbar,
|
|
231
231
|
toolbarTitle: this.toolbarTitle,
|
|
232
232
|
showSearch: this.showSearch,
|
|
233
233
|
searchPlaceholder: this.searchPlaceholder,
|
|
234
234
|
searchValue: this.searchValue,
|
|
235
235
|
onSearchInput: this.handleSearchInput,
|
|
236
|
-
}), h("div", { key: '
|
|
236
|
+
}), h("div", { key: '4b1b1059c2bfd59aefb048188563f3effc8dbf72', class: "table-scroll-area" }, h("table", { key: '790c6909a3ecfd66cd452e5314d1f5a2cd2b70ae', class: "table-el", style: this.twoLineRows ? { '--q-table-action-count': String(model.rowActions.length) } : undefined }, renderDataTableHead({
|
|
237
237
|
model,
|
|
238
238
|
onSelectAllChange: event => this.handleSelectAllChange(event),
|
|
239
239
|
onSortToggle: column => this.handleSortToggle(column),
|
|
@@ -246,7 +246,7 @@ export class QDataTable {
|
|
|
246
246
|
onRowCheckboxChange: (item, index, event) => this.handleRowCheckboxChange(item, index, event),
|
|
247
247
|
onRowAction: (item, index, action, event) => this.handleRowAction(item, index, action, event),
|
|
248
248
|
renderCell: (item, column) => this.renderCell(item, column),
|
|
249
|
-
}))), h("slot", { key: '
|
|
249
|
+
}))), h("slot", { key: '570258218b4c63d2d48b29d58135e89ffee70add', name: "footer" })));
|
|
250
250
|
}
|
|
251
251
|
static get is() { return "q-data-table"; }
|
|
252
252
|
static get encapsulation() { return "shadow"; }
|
|
@@ -729,7 +729,7 @@ export class QMap {
|
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
731
|
render() {
|
|
732
|
-
return (h("div", { key: '
|
|
732
|
+
return (h("div", { key: 'cc1311b01c382e8fb9fa56dfe106df28d0f53284', class: "map-surface", part: "surface" }, h("div", { key: '7a045981dcf9ef74d1b56044c9cccedb136b5fe3', class: "map-canvas", part: "canvas", role: "region", "aria-label": this.ariaLabel, "aria-busy": this.providerStatus === 'initializing' ? 'true' : undefined, ref: this.setCanvas }), h("q-icon", { key: 'afc8b162325d4773a204337439787a3c8b4d4618', class: "map-icon-registration", "aria-hidden": "true" }), this.providerStatus === 'empty' && (h("div", { key: '5cd6e3499fa313b8674d270c3b603bf4f99b3f82', class: "map-empty", part: "empty", role: "status" }, h("slot", { key: '208a04301474df21413c9ecd088964071199c8b2', name: "empty" }, "Map provider is not configured."))), this.providerStatus === 'error' && (h("div", { key: 'fa3e8abf20064b642bbe81ed4cae631cb005e95e', class: "map-empty map-error", part: "error", role: "alert" }, h("slot", { key: 'f2920a6e59a7dadd0585a3c3e0f8a017749477fd', name: "error" }, this.errorMessage ?? 'Map imagery is unavailable.'))), this.renderAttribution()));
|
|
733
733
|
}
|
|
734
734
|
static get is() { return "q-map"; }
|
|
735
735
|
static get encapsulation() { return "shadow"; }
|
|
@@ -187,7 +187,7 @@ describe('q-map in Chromium', () => {
|
|
|
187
187
|
style.textContent = mapStyles;
|
|
188
188
|
element.shadowRoot.prepend(style);
|
|
189
189
|
element.markers = [
|
|
190
|
-
{ id: '
|
|
190
|
+
{ id: 'north', latitude: -33.5, longitude: 18.5, label: 'North marker' },
|
|
191
191
|
{ id: 'cape', latitude: -33.9249, longitude: 18.4241, label: 'Cape Town' },
|
|
192
192
|
{ id: 'invalid', latitude: 200, longitude: 0, label: 'Invalid' },
|
|
193
193
|
];
|
|
@@ -55,7 +55,7 @@ export class QPagination {
|
|
|
55
55
|
const itemLabel = this.itemLabel.trim() || 'items';
|
|
56
56
|
const previousDisabled = this.disabled || totalItems === 0 || page <= 1;
|
|
57
57
|
const nextDisabled = this.disabled || totalItems === 0 || page >= pageCount;
|
|
58
|
-
return (h("nav", { key: '
|
|
58
|
+
return (h("nav", { key: '29cfb956b6c7c1e4b962496f2711dc2fb05a27ed', class: "pagination", part: "container", "aria-label": this.ariaLabel?.trim() || 'Pagination' }, this.showSummary && (h("span", { key: '4ad6cbdeb1bc6019bc794a3150b167a0664a111d', class: "summary", part: "summary", "aria-live": "polite" }, "Showing ", pageStart, "-", pageEnd, " of ", totalItems, " ", itemLabel)), h("div", { key: 'f0935b57c18c9f91600f0b9b953d24a895dc6359', class: "controls", part: "controls" }, h("button", { key: '209ac953359ca06ce51d7a92288993c476696c3c', class: "page-button", part: "previous-button", type: "button", disabled: previousDisabled, "aria-label": "Previous page", onClick: () => this.requestPage(page - 1) }, "Previous"), h("span", { key: 'd092e6c1998326189e2fba31a18a8f17ccce40b8', class: "page-count", part: "page-count", "aria-label": `Page ${page} of ${pageCount}` }, page, " / ", pageCount), h("button", { key: '3e3ffa0e201b07248cad027cb4c50345dd9f035d', class: "page-button", part: "next-button", type: "button", disabled: nextDisabled, "aria-label": "Next page", onClick: () => this.requestPage(page + 1) }, "Next"))));
|
|
59
59
|
}
|
|
60
60
|
static get is() { return "q-pagination"; }
|
|
61
61
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { formatJsonSource } from "./json";
|
|
2
|
+
import { formatterLanguage } from "./languages";
|
|
3
|
+
import { formatPrettierSource } from "./util/prettier";
|
|
4
|
+
export { formatHtml } from './html';
|
|
5
|
+
export { formatJs } from './javascript';
|
|
6
|
+
export { formatCss } from './css';
|
|
7
|
+
export { formatJson } from './json';
|
|
8
|
+
export function isFormatSupported(language) {
|
|
9
|
+
return formatterLanguage(language) !== undefined;
|
|
10
|
+
}
|
|
11
|
+
export function formatSource(code, language) {
|
|
12
|
+
const selected = formatterLanguage(language);
|
|
13
|
+
if (!selected)
|
|
14
|
+
return { code, status: 'unsupported' };
|
|
15
|
+
return selected === 'json' ? formatJsonSource(code) : formatPrettierSource(code, selected);
|
|
16
|
+
}
|
|
17
|
+
export function formatCode(code, language) {
|
|
18
|
+
const result = formatSource(code, language);
|
|
19
|
+
return result instanceof Promise ? result.then(value => value.code) : result.code;
|
|
20
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { describe, expect, it, vi } from "vitest";
|
|
2
|
-
import { formatCode, formatCss, formatHtml, formatJs, formatJson, formatSource, isFormatSupported
|
|
3
|
-
import {
|
|
2
|
+
import { formatCode, formatCss, formatHtml, formatJs, formatJson, formatSource, isFormatSupported } from "./formatter";
|
|
3
|
+
import { MAX_JSON_FORMAT_DEPTH, MAX_JSON_FORMAT_INPUT, MAX_JSON_FORMAT_OUTPUT } from "./json";
|
|
4
|
+
import { INVALID_JSON, JSON_EXPECTED, JSON_SOURCE, jsonTokens, NON_JSON_SOURCE } from "../../test/format-fixtures";
|
|
4
5
|
describe('explicit token-preserving formatter', () => {
|
|
5
6
|
it('formats JSON with two-space/LF indentation', () => {
|
|
6
7
|
expect(formatCode('{"a":1,"b":[2,3]}', 'json')).toBe('{\n "a": 1,\n "b": [\n 2,\n 3\n ]\n}');
|
|
@@ -19,20 +20,46 @@ describe('explicit token-preserving formatter', () => {
|
|
|
19
20
|
expect(formatSource(source, 'json')).toEqual({ code: source, status: 'invalid' });
|
|
20
21
|
expect(formatCode(source, 'json')).toBe(source);
|
|
21
22
|
});
|
|
22
|
-
it.each(
|
|
23
|
-
expect(isFormatSupported(language)).toBe(
|
|
24
|
-
|
|
25
|
-
expect(
|
|
23
|
+
it.each(NON_JSON_SOURCE)('routes %s through its embedded formatter', async (language, source) => {
|
|
24
|
+
expect(isFormatSupported(language)).toBe(true);
|
|
25
|
+
const result = await formatSource(source, language);
|
|
26
|
+
expect(result.status).toBe('formatted');
|
|
27
|
+
expect(await formatCode(result.code, language)).toBe(result.code);
|
|
26
28
|
});
|
|
27
|
-
it('retains named
|
|
28
|
-
expect(formatHtml(
|
|
29
|
-
expect(formatJs(
|
|
30
|
-
expect(formatCss(
|
|
31
|
-
expect(formatCode(UNSUPPORTED_SOURCE[1][1], 'js')).toBe(UNSUPPORTED_SOURCE[1][1]);
|
|
29
|
+
it('retains named helpers and the JavaScript alias', async () => {
|
|
30
|
+
expect(await formatHtml('Hello <b>world</b>!')).toContain('Hello <b>world</b>!');
|
|
31
|
+
expect(await formatJs('const x=1')).toBe(await formatCode('const x=1', 'js'));
|
|
32
|
+
expect(await formatCss('p{color:red}')).toContain('color: red;');
|
|
32
33
|
expect(formatCode('literal', 'unknown')).toBe('literal');
|
|
33
34
|
expect(formatCode('', 'json')).toBe('');
|
|
34
35
|
expect(isFormatSupported('JSON')).toBe(true);
|
|
35
36
|
});
|
|
37
|
+
it.each(['<q-button>', '<div><b>x</b>', '<q-button label="'])('keeps an incomplete HTML draft intact: %s', async (code) => {
|
|
38
|
+
expect(await formatSource(code, 'html')).toEqual({ code, status: 'invalid' });
|
|
39
|
+
});
|
|
40
|
+
it('preserves text-only slots, outer spacing and literal element contents', async () => {
|
|
41
|
+
const label = ' Save changes\r\n';
|
|
42
|
+
expect(await formatSource(label, 'html')).toEqual({ code: label, status: 'unchanged' });
|
|
43
|
+
const raw = ['pre', 'textarea', 'script', 'style'].map(name => `<${name}>\r\n x \r\n</${name}>`).join('');
|
|
44
|
+
const source = '\t<div id="log">' + raw + '</div> ';
|
|
45
|
+
const result = await formatSource(source, 'html');
|
|
46
|
+
expect(result.status).toBe('formatted');
|
|
47
|
+
expect(result.code.startsWith('\t<div id="log">')).toBe(true);
|
|
48
|
+
expect(result.code.match(/\s+$/)?.[0]).toBe(' ');
|
|
49
|
+
for (const tag of ['pre', 'textarea', 'script', 'style']) {
|
|
50
|
+
expect(result.code).toContain(`<${tag}>\r\n x \r\n</${tag}`);
|
|
51
|
+
}
|
|
52
|
+
expect(await formatHtml(result.code)).toBe(result.code);
|
|
53
|
+
});
|
|
54
|
+
it('accepts HTML with optional end tags', async () => {
|
|
55
|
+
expect((await formatSource('<ul><li>one<li>two</ul>', 'html')).status).toBe('formatted');
|
|
56
|
+
});
|
|
57
|
+
it('distinguishes a rejected Vue draft from a missing formatter', async () => {
|
|
58
|
+
const source = '<template></bad>';
|
|
59
|
+
const result = await formatSource(source, 'vue');
|
|
60
|
+
expect(result.code).toBe(source);
|
|
61
|
+
expect(['invalid', 'failed']).toContain(result.status);
|
|
62
|
+
});
|
|
36
63
|
it('never parses JSON through JavaScript values or stringifies values', () => {
|
|
37
64
|
const parse = vi.spyOn(JSON, 'parse');
|
|
38
65
|
const stringify = vi.spyOn(JSON, 'stringify');
|
|
@@ -3,9 +3,6 @@ export const MAX_JSON_FORMAT_OUTPUT = 2_097_152;
|
|
|
3
3
|
export const MAX_JSON_FORMAT_DEPTH = 128;
|
|
4
4
|
class FormatLimitError extends Error {
|
|
5
5
|
}
|
|
6
|
-
export function isFormatSupported(language) {
|
|
7
|
-
return typeof language === 'string' && language.toLowerCase() === 'json';
|
|
8
|
-
}
|
|
9
6
|
/** Validates JSON grammar while emitting original tokens, never JavaScript values. */
|
|
10
7
|
function layoutJson(source) {
|
|
11
8
|
if (source.length > MAX_JSON_FORMAT_INPUT) {
|
|
@@ -127,10 +124,7 @@ function layoutJson(source) {
|
|
|
127
124
|
}
|
|
128
125
|
return parts.join('');
|
|
129
126
|
}
|
|
130
|
-
export function
|
|
131
|
-
if (!isFormatSupported(language)) {
|
|
132
|
-
return { code, status: 'unsupported' };
|
|
133
|
-
}
|
|
127
|
+
export function formatJsonSource(code) {
|
|
134
128
|
try {
|
|
135
129
|
const formatted = layoutJson(code);
|
|
136
130
|
return { code: formatted, status: formatted === code ? 'unchanged' : 'formatted' };
|
|
@@ -140,17 +134,5 @@ export function formatSource(code, language) {
|
|
|
140
134
|
}
|
|
141
135
|
}
|
|
142
136
|
export function formatJson(code) {
|
|
143
|
-
return
|
|
144
|
-
}
|
|
145
|
-
export function formatCss(code) {
|
|
146
|
-
return code;
|
|
147
|
-
}
|
|
148
|
-
export function formatHtml(code) {
|
|
149
|
-
return code;
|
|
150
|
-
}
|
|
151
|
-
export function formatJs(code) {
|
|
152
|
-
return code;
|
|
153
|
-
}
|
|
154
|
-
export function formatCode(code, language) {
|
|
155
|
-
return formatSource(code, language).code;
|
|
137
|
+
return formatJsonSource(code).code;
|
|
156
138
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// The keys are the language values accepted by both Syntax Box and Syntax View.
|
|
2
|
+
export const formatterLanguages = {
|
|
3
|
+
html: 'HTML', javascript: 'JavaScript', css: 'CSS', json: 'JSON',
|
|
4
|
+
typescript: 'TypeScript', jsx: 'JSX', tsx: 'TSX', flow: 'Flow',
|
|
5
|
+
json5: 'JSON5', jsonc: 'JSON with Comments', 'json-stringify': 'JSON.stringify',
|
|
6
|
+
postcss: 'PostCSS', less: 'Less', scss: 'SCSS',
|
|
7
|
+
angular: 'Angular', vue: 'Vue', lwc: 'Lightning Web Components', mjml: 'MJML',
|
|
8
|
+
handlebars: 'Handlebars', graphql: 'GraphQL', markdown: 'Markdown', mdx: 'MDX', yaml: 'YAML',
|
|
9
|
+
};
|
|
10
|
+
export function formatterLanguage(value) {
|
|
11
|
+
const key = typeof value === 'string' ? value.toLowerCase() : '';
|
|
12
|
+
if (key === 'js')
|
|
13
|
+
return 'javascript';
|
|
14
|
+
return Object.prototype.hasOwnProperty.call(formatterLanguages, key) ? key : undefined;
|
|
15
|
+
}
|
package/dist/collection/components/data-display/syntax-box/internals/formatters/util/prettier.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export async function formatPrettierSource(code, language) {
|
|
2
|
+
let format;
|
|
3
|
+
try {
|
|
4
|
+
const formatter = await import('@webquark/browser/formatters/runtime');
|
|
5
|
+
format = await formatter.loadFormatter(language);
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
return { code, status: 'unavailable' };
|
|
9
|
+
}
|
|
10
|
+
try {
|
|
11
|
+
const formatted = await format(code);
|
|
12
|
+
return { code: formatted, status: formatted === code ? 'unchanged' : 'formatted' };
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
return { code, status: error instanceof SyntaxError ? 'invalid' : 'failed' };
|
|
16
|
+
}
|
|
17
|
+
}
|
package/dist/collection/{utils → components/data-display/syntax-box/internals}/syntax.unit.test.js
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it, vi } from "vitest";
|
|
2
2
|
import { escapeHtml, highlight, tokenizeSyntax } from "./syntax";
|
|
3
|
-
import { LANGUAGE_SOURCE, LITERAL_SOURCES, SYNTAX_LANGUAGES } from "../
|
|
3
|
+
import { LANGUAGE_SOURCE, LITERAL_SOURCES, SYNTAX_LANGUAGES } from "../test/syntax-fixtures";
|
|
4
4
|
describe('literal syntax helpers', () => {
|
|
5
5
|
it('highlights HTML names, values and comments without scanning quoted markup as tags', () => {
|
|
6
6
|
const source = '<x-card data-note = "<b>< 雪" disabled><!-- <i key=\'x\'> -->🐦</x-card>';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Stencil can load the box and its child views from independently bundled entry points.
|
|
2
|
+
const registryKey = Symbol.for('@webquark/browser:syntax-views:v1');
|
|
3
|
+
const runtime = globalThis;
|
|
4
|
+
export const { syntaxBoxes, syntaxScrollRestorers, syntaxVisibility } = runtime[registryKey] ??= {
|
|
5
|
+
syntaxBoxes: new WeakMap(),
|
|
6
|
+
syntaxScrollRestorers: new WeakMap(),
|
|
7
|
+
syntaxVisibility: new WeakMap(),
|
|
8
|
+
};
|
|
9
|
+
export function syntaxOwner(view) {
|
|
10
|
+
return syntaxBoxes.get(view) ?? (view.localName === 'q-syntax-view' && view.parentElement
|
|
11
|
+
? syntaxBoxes.get(view.parentElement)
|
|
12
|
+
: undefined);
|
|
13
|
+
}
|
|
14
|
+
export function revealSyntaxEditor(editor) {
|
|
15
|
+
const ancestors = [];
|
|
16
|
+
for (let node = editor; node; node = node.parentElement) {
|
|
17
|
+
if (node === editor || node.localName === 'q-syntax-view')
|
|
18
|
+
ancestors.push(node);
|
|
19
|
+
}
|
|
20
|
+
for (const view of ancestors.reverse())
|
|
21
|
+
syntaxOwner(view)?.select(view);
|
|
22
|
+
}
|
|
23
|
+
export function ownContentNodes(host) {
|
|
24
|
+
return Array.from(host.childNodes).filter(node => node.nodeType === 3 ||
|
|
25
|
+
(node instanceof Element && !node.slot && node.localName !== 'q-syntax-view'));
|
|
26
|
+
}
|
|
27
|
+
export function hasSlottedSource(host) {
|
|
28
|
+
return ownContentNodes(host).some(node => node.nodeType === 1 || Boolean(node.textContent?.trim()));
|
|
29
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { expect, it, vi } from "vitest";
|
|
2
|
+
it('connects a box and its views across independently loaded modules', async () => {
|
|
3
|
+
const parentModule = await import('./views');
|
|
4
|
+
vi.resetModules();
|
|
5
|
+
const childModule = await import('./views');
|
|
6
|
+
expect(childModule.syntaxOwner).not.toBe(parentModule.syntaxOwner);
|
|
7
|
+
const box = document.createElement('q-syntax-box');
|
|
8
|
+
const view = document.createElement('q-syntax-view');
|
|
9
|
+
box.append(view);
|
|
10
|
+
const owner = { variant: 'panel', visible: () => true, select: vi.fn() };
|
|
11
|
+
parentModule.syntaxBoxes.set(box, owner);
|
|
12
|
+
expect(childModule.syntaxOwner(view)).toBe(owner);
|
|
13
|
+
const syncVisibility = vi.fn();
|
|
14
|
+
const restoreScroll = vi.fn();
|
|
15
|
+
childModule.syntaxVisibility.set(view, syncVisibility);
|
|
16
|
+
childModule.syntaxScrollRestorers.set(view, restoreScroll);
|
|
17
|
+
expect(parentModule.syntaxVisibility.get(view)).toBe(syncVisibility);
|
|
18
|
+
expect(parentModule.syntaxScrollRestorers.get(view)).toBe(restoreScroll);
|
|
19
|
+
});
|
|
@@ -20,44 +20,111 @@
|
|
|
20
20
|
|
|
21
21
|
/* Panel Layout */
|
|
22
22
|
.panel-container {
|
|
23
|
-
position: relative;
|
|
24
23
|
border-radius: var(--q-radius-lg, 12px);
|
|
25
24
|
background: var(--q-syntax-bg);
|
|
26
25
|
border: 1px solid var(--q-syntax-border);
|
|
27
26
|
overflow: hidden;
|
|
28
27
|
height: 100%;
|
|
29
|
-
display: flex;
|
|
30
|
-
flex-direction: column;
|
|
31
28
|
box-sizing: border-box;
|
|
32
29
|
}
|
|
33
30
|
|
|
34
31
|
.panel-header {
|
|
35
|
-
display:
|
|
36
|
-
|
|
32
|
+
display: grid;
|
|
33
|
+
grid-area: 1 / 1 / 2 / 3;
|
|
34
|
+
grid-template-columns: subgrid;
|
|
37
35
|
align-items: center;
|
|
38
|
-
gap: 16px;
|
|
39
|
-
padding: var(--q-syntax-header-padding, 4px 16px);
|
|
40
36
|
background: var(--q-syntax-header-bg);
|
|
41
37
|
border-bottom: 1px solid var(--q-syntax-border);
|
|
42
38
|
font-size: var(--q-syntax-header-font-size);
|
|
43
39
|
color: var(--q-syntax-comment);
|
|
44
40
|
box-sizing: border-box;
|
|
45
|
-
flex-shrink: 0;
|
|
46
41
|
}
|
|
47
42
|
|
|
48
|
-
.
|
|
49
|
-
|
|
43
|
+
.syntax-layout {
|
|
44
|
+
position: relative;
|
|
45
|
+
display: grid;
|
|
46
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
47
|
+
grid-template-rows: auto auto;
|
|
48
|
+
min-width: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.view-panel,
|
|
52
|
+
:host(.embedded-view) {
|
|
53
|
+
display: grid;
|
|
54
|
+
grid-area: 1 / 1 / 3 / 3;
|
|
55
|
+
grid-template-columns: subgrid;
|
|
56
|
+
grid-template-rows: subgrid;
|
|
50
57
|
min-width: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.view-panel[data-inactive],
|
|
61
|
+
.validation-anchor {
|
|
62
|
+
position: absolute;
|
|
51
63
|
overflow: hidden;
|
|
52
|
-
|
|
53
|
-
|
|
64
|
+
clip-path: inset(50%);
|
|
65
|
+
pointer-events: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Interactive native form validation can focus this anchor to reveal an inactive editor. */
|
|
69
|
+
.view-panel[data-inactive] {
|
|
70
|
+
inset-inline: 0;
|
|
71
|
+
inset-block-start: 0;
|
|
72
|
+
visibility: hidden;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.validation-anchor {
|
|
76
|
+
width: 1px;
|
|
77
|
+
height: 1px;
|
|
78
|
+
visibility: visible;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.panel-header > span,
|
|
82
|
+
.panel-header > q-tabs {
|
|
83
|
+
z-index: 1;
|
|
84
|
+
grid-column: 1;
|
|
85
|
+
min-width: 0;
|
|
86
|
+
margin: var(--q-syntax-header-padding, 4px 16px);
|
|
87
|
+
align-self: center;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.panel-header > q-tabs {
|
|
91
|
+
--q-tabs-border: 0;
|
|
92
|
+
--q-tabs-tab-max-width: 100%;
|
|
93
|
+
display: grid;
|
|
94
|
+
align-self: stretch;
|
|
95
|
+
margin-block: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.panel-container > .panel-header > q-tabs {
|
|
99
|
+
/* Let the active underline paint over the header's one-pixel divider. */
|
|
100
|
+
margin-block-end: -1px;
|
|
54
101
|
}
|
|
55
102
|
|
|
56
103
|
.panel-actions {
|
|
57
104
|
display: flex;
|
|
58
105
|
align-items: center;
|
|
59
106
|
gap: 8px;
|
|
60
|
-
|
|
107
|
+
z-index: 1;
|
|
108
|
+
grid-area: 1 / 2 / 2 / 3;
|
|
109
|
+
justify-self: end;
|
|
110
|
+
align-self: center;
|
|
111
|
+
padding: var(--q-syntax-header-padding, 4px 16px);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.view-content {
|
|
115
|
+
grid-area: 2 / 1 / 3 / 3;
|
|
116
|
+
min-width: 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.plain-container .panel-header {
|
|
120
|
+
border: 0;
|
|
121
|
+
background: transparent;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.panel-header > span {
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
text-overflow: ellipsis;
|
|
127
|
+
white-space: nowrap;
|
|
61
128
|
}
|
|
62
129
|
|
|
63
130
|
/* Plain Layout */
|
|
@@ -75,19 +142,37 @@
|
|
|
75
142
|
}
|
|
76
143
|
|
|
77
144
|
/* Code Typography and Style */
|
|
78
|
-
.code-body
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
overflow-y: auto;
|
|
145
|
+
.code-body,
|
|
146
|
+
.slotted-body,
|
|
147
|
+
.editor-textarea {
|
|
148
|
+
padding: var(--q-syntax-padding, var(--q-padding-lg, 1rem));
|
|
83
149
|
font-family: var(--q-syntax-font-mono);
|
|
84
150
|
font-size: var(--q-syntax-code-font-size);
|
|
85
151
|
line-height: 1.5;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.code-body,
|
|
155
|
+
.slotted-body {
|
|
86
156
|
color: var(--q-syntax-text);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.slotted-body {
|
|
160
|
+
overflow-wrap: anywhere;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.code-body {
|
|
164
|
+
margin: 0;
|
|
165
|
+
overflow-x: hidden;
|
|
166
|
+
overflow-y: auto;
|
|
87
167
|
white-space: pre-wrap;
|
|
88
168
|
word-wrap: break-word;
|
|
89
169
|
}
|
|
90
170
|
|
|
171
|
+
:host([role='log']),
|
|
172
|
+
:host(.q-syntax-log-content) {
|
|
173
|
+
--q-syntax-padding: var(--q-padding-md, .75rem) var(--q-padding-lg, 1rem);
|
|
174
|
+
}
|
|
175
|
+
|
|
91
176
|
/* For plain variant custom classes if needed */
|
|
92
177
|
:host(.variant-card-code) .code-body {
|
|
93
178
|
padding: var(--q-syntax-compact-padding, 10px);
|
|
@@ -134,11 +219,7 @@
|
|
|
134
219
|
width: 100%;
|
|
135
220
|
height: 100%;
|
|
136
221
|
margin: 0;
|
|
137
|
-
padding: var(--q-syntax-padding, 16px);
|
|
138
222
|
box-sizing: border-box;
|
|
139
|
-
font-family: var(--q-syntax-font-mono);
|
|
140
|
-
font-size: var(--q-syntax-code-font-size);
|
|
141
|
-
line-height: 1.5;
|
|
142
223
|
white-space: pre-wrap;
|
|
143
224
|
word-wrap: break-word;
|
|
144
225
|
overflow-x: hidden;
|
|
@@ -157,29 +238,20 @@
|
|
|
157
238
|
color: transparent;
|
|
158
239
|
}
|
|
159
240
|
|
|
241
|
+
.editor-textarea:focus-visible {
|
|
242
|
+
border-block-end: var(--q-focus-ring, 2px solid var(--q-color-primary, #60a5fa));
|
|
243
|
+
}
|
|
244
|
+
|
|
160
245
|
.editor-area .code-body {
|
|
161
246
|
position: relative;
|
|
162
247
|
width: 100%;
|
|
163
248
|
height: 100%;
|
|
164
249
|
margin: 0;
|
|
165
|
-
padding: var(--q-syntax-padding, 16px);
|
|
166
250
|
box-sizing: border-box;
|
|
167
251
|
overflow: hidden;
|
|
168
252
|
pointer-events: none;
|
|
169
253
|
}
|
|
170
254
|
|
|
171
|
-
/* Panel focus and active state styling */
|
|
172
|
-
.panel-container:focus-within {
|
|
173
|
-
outline: var(--q-focus-ring, 2px solid var(--q-color-primary, #60a5fa));
|
|
174
|
-
outline-offset: -1px;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/* Plain variant editor styles */
|
|
178
|
-
:host([editable]) .plain-container:focus-within {
|
|
179
|
-
outline: var(--q-focus-ring, 2px solid var(--q-color-primary, #60a5fa));
|
|
180
|
-
border-radius: var(--q-radius-md, 8px);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
255
|
/* Disabled State Visual Styling */
|
|
184
256
|
:host([disabled]) {
|
|
185
257
|
opacity: 0.6;
|
|
@@ -206,4 +278,3 @@
|
|
|
206
278
|
white-space: nowrap;
|
|
207
279
|
border: 0;
|
|
208
280
|
}
|
|
209
|
-
|