@webquark/browser 1.1.0 → 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-B6vl_1p5.js → action.props-CNe2JXR5.js} +1 -1
- package/dist/cjs/{field-B5nxD8Kc.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-BD6Jjssb.js → index-BN-WdOQM.js} +13 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/q-accordion.cjs.entry.js +1 -1
- 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 +2 -2
- package/dist/cjs/q-carousel.cjs.entry.js +1 -1
- package/dist/cjs/q-chip.cjs.entry.js +2 -2
- package/dist/cjs/q-control-group.cjs.entry.js +3 -3
- package/dist/cjs/q-conversation-bubble.cjs.entry.js +1 -1
- package/dist/cjs/q-data-table.cjs.entry.js +1 -1
- package/dist/cjs/q-dialog.cjs.entry.js +3 -3
- package/dist/cjs/q-divider.cjs.entry.js +3 -3
- package/dist/cjs/q-dropdown.cjs.entry.js +4 -4
- package/dist/cjs/q-form.cjs.entry.js +6 -6
- 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 +6 -6
- package/dist/cjs/q-link.cjs.entry.js +2 -2
- package/dist/cjs/q-map.cjs.entry.js +1 -1
- 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 +1 -1
- package/dist/cjs/q-panel.cjs.entry.js +6 -6
- package/dist/cjs/q-quantity-selector.cjs.entry.js +5 -5
- package/dist/cjs/q-radio-group.cjs.entry.js +4 -4
- package/dist/cjs/q-reel.cjs.entry.js +23 -23
- package/dist/cjs/q-section.cjs.entry.js +2 -2
- package/dist/cjs/q-sidepanel.cjs.entry.js +4 -3
- package/dist/cjs/q-slider.cjs.entry.js +2 -2
- 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 +3 -3
- 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 +5 -5
- 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 +6 -6
- package/dist/cjs/q-toolbar.cjs.entry.js +4 -4
- package/dist/cjs/syntax-content-BmSExDiW.js +910 -0
- package/dist/cjs/{tokens-Cd7g-VMz.js → tokens-BMrfol_M.js} +1 -1
- package/dist/cjs/webquark.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/actions/button/button.css +27 -9
- package/dist/collection/components/communication/alert/alert.css +4 -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/components/data-display/syntax-box/internals/{formatter.unit.test.js → 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/components/data-display/syntax-box/internals/{formatter.js → 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/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-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.js +2 -2
- 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/input/input.js +3 -3
- 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.js +1 -1
- package/dist/collection/components/inputs/textarea/textarea.js +2 -2
- package/dist/collection/components/inputs/toggle/toggle.js +3 -3
- package/dist/collection/components/layout/control-group/control-group.js +1 -1
- package/dist/collection/components/layout/divider/divider.js +1 -1
- 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/tokens.js +1 -1
- package/dist/collection/utils/form-control-validity.js +3 -3
- package/dist/components/index.js +1 -1
- package/dist/components/{p-CArIPzJU.js → p-B610wOGe.js} +1 -1
- package/dist/components/p-BGlbV43y.js +13 -0
- package/dist/components/{p-BZXIeEKC.js → p-BKWL9zOn.js} +1 -1
- package/dist/components/p-BxxU73QQ.js +1 -0
- package/dist/components/{p-kfrqZyfJ.js → p-CVEQfA-v.js} +1 -1
- package/dist/components/p-CpbWWDiY.js +1 -0
- package/dist/components/{p-BwPMm43W.js → p-D2fczi8m.js} +1 -1
- package/dist/components/{p-BGHNFaaC.js → p-D5vpGqZ9.js} +1 -1
- package/dist/components/p-DQIYo8zC.js +1 -0
- package/dist/components/{p-IwIJb0Mc.js → p-DX6PCIPS.js} +1 -1
- package/dist/components/{p-CpkX9YAW.js → p-DY9D4z7Z.js} +1 -1
- package/dist/{webquark/p-BDsIecIx.js → components/p-DbzjRzhu.js} +1 -1
- package/dist/components/{p-Bp6Xr92S.js → p-RX4DjgmV.js} +1 -1
- package/dist/components/{p-Bc2_QcLn.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.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- 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-Di_LpF5H.js → action.props-CbSH7c-q.js} +1 -1
- package/dist/esm/{dom-CArIPzJU.js → dom-B610wOGe.js} +1 -1
- package/dist/esm/{field-C4Iilew6.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-DoGM9gsC.js → index-CIMzZPQO.js} +13 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/q-accordion.entry.js +1 -1
- 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 +2 -2
- package/dist/esm/q-chip.entry.js +2 -2
- package/dist/esm/q-control-group.entry.js +3 -3
- package/dist/esm/q-conversation-bubble.entry.js +1 -1
- package/dist/esm/q-data-table.entry.js +1 -1
- package/dist/esm/q-dialog.entry.js +4 -4
- package/dist/esm/q-divider.entry.js +3 -3
- package/dist/esm/q-dropdown.entry.js +4 -4
- package/dist/esm/q-form.entry.js +7 -7
- 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 +7 -7
- package/dist/esm/q-link.entry.js +2 -2
- package/dist/esm/q-map.entry.js +1 -1
- 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 +1 -1
- package/dist/esm/q-panel.entry.js +7 -7
- package/dist/esm/q-quantity-selector.entry.js +5 -5
- 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 +2 -2
- 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 +5 -5
- 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 +6 -6
- package/dist/esm/q-toolbar.entry.js +4 -4
- package/dist/esm/syntax-content-Cr9kSbmA.js +903 -0
- package/dist/esm/{tokens-BDsIecIx.js → tokens-DbzjRzhu.js} +1 -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/token-row.js +45 -74
- package/dist/playground/utils/color.js +14 -25
- 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/formatter.unit.test.d.ts +1 -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/components/data-display/syntax-box/internals/syntax.d.ts +1 -1
- 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/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 +201 -7
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/components/theme-designer/token-row.d.ts +1 -1
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/dom-factory.d.ts +1 -0
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/utils/color.d.ts +2 -8
- package/dist/types/utils/form-control-validity.d.ts +2 -1
- package/dist/webquark/{p-846dc838.entry.js → p-014c2f4a.entry.js} +1 -1
- package/dist/webquark/{p-0182e114.entry.js → p-0389577c.entry.js} +1 -1
- package/dist/webquark/p-041e17c1.entry.js +1 -0
- package/dist/webquark/p-0479c571.entry.js +1 -0
- package/dist/webquark/{p-17b9713f.entry.js → p-0ebca9be.entry.js} +1 -1
- package/dist/webquark/{p-0a2c52de.entry.js → p-1bf375f7.entry.js} +2 -2
- package/dist/webquark/{p-e2721e77.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-f4d23ffe.entry.js → p-3a60086d.entry.js} +1 -1
- package/dist/webquark/{p-e723a7ae.entry.js → p-3ab798aa.entry.js} +1 -1
- package/dist/webquark/{p-15bad9ef.entry.js → p-3b580baf.entry.js} +1 -1
- package/dist/webquark/{p-4609c362.entry.js → p-3b65f787.entry.js} +1 -1
- package/dist/webquark/p-4bf610f8.entry.js +1 -0
- package/dist/webquark/{p-f51e1098.entry.js → p-4d30227e.entry.js} +1 -1
- package/dist/webquark/p-4de536ae.entry.js +1 -0
- package/dist/webquark/{p-3daafc56.entry.js → p-4e4d70c9.entry.js} +1 -1
- package/dist/webquark/p-4efeb7c9.entry.js +1 -0
- package/dist/webquark/{p-a314bc21.entry.js → p-51b3d71b.entry.js} +1 -1
- package/dist/webquark/p-778b6bbb.entry.js +1 -0
- package/dist/webquark/{p-a66550da.entry.js → p-7da78b2f.entry.js} +1 -1
- package/dist/webquark/{p-fe14f038.entry.js → p-7f8f986b.entry.js} +1 -1
- package/dist/webquark/{p-e0943d41.entry.js → p-8253c742.entry.js} +1 -1
- package/dist/webquark/{p-a2334abe.entry.js → p-9a1ddeb7.entry.js} +1 -1
- package/dist/webquark/{p-CArIPzJU.js → p-B610wOGe.js} +1 -1
- 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/webquark/{p-DDUED8LT.js → p-D8p28N9s.js} +1 -1
- package/dist/{components/p-BDsIecIx.js → webquark/p-DbzjRzhu.js} +1 -1
- package/dist/webquark/{p-BOdNg0jc.js → p-DeOEN0si.js} +1 -1
- package/dist/webquark/p-a2b1de23.entry.js +1 -0
- package/dist/webquark/{p-dbcf7592.entry.js → p-a55edc17.entry.js} +1 -1
- package/dist/webquark/p-a8808020.entry.js +1 -0
- package/dist/webquark/{p-9a76cd71.entry.js → p-b1084b3c.entry.js} +1 -1
- package/dist/webquark/{p-a2ff1b64.entry.js → p-b6c4dff4.entry.js} +1 -1
- package/dist/webquark/{p-b21ad707.entry.js → p-b962e950.entry.js} +1 -1
- package/dist/webquark/{p-5b584d3c.entry.js → p-bc369cd6.entry.js} +1 -1
- package/dist/webquark/p-c119a8ea.entry.js +1 -0
- package/dist/webquark/{p-85131314.entry.js → p-c6b77e9a.entry.js} +1 -1
- package/dist/webquark/{p-84b350a3.entry.js → p-ca1c03b4.entry.js} +1 -1
- package/dist/webquark/{p-b8fdef4f.entry.js → p-ce436162.entry.js} +1 -1
- package/dist/webquark/{p-86c05afd.entry.js → p-d0a47a7c.entry.js} +1 -1
- package/dist/webquark/{p-222405b8.entry.js → p-e1fbc8fc.entry.js} +1 -1
- package/dist/webquark/{p-44bbe12f.entry.js → p-e32833ce.entry.js} +1 -1
- package/dist/webquark/{p-d86bd51d.entry.js → p-e369a4aa.entry.js} +1 -1
- package/dist/webquark/p-e4430c61.entry.js +1 -0
- package/dist/webquark/{p-aa342e81.entry.js → p-e9c0052b.entry.js} +1 -1
- package/dist/webquark/{p-852e88ae.entry.js → p-f5c4ca18.entry.js} +1 -1
- package/dist/webquark/{p-d4788321.entry.js → p-f6683126.entry.js} +1 -1
- package/dist/webquark/{p-Dnz3WmdX.js → p-ojSDiptZ.js} +1 -1
- package/dist/webquark/webquark.css +1 -1
- package/dist/webquark/webquark.esm.js +1 -1
- package/package.json +5 -1
- 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-Bj2RJb2E.js +0 -1
- package/dist/components/p-D2nxHd1b.js +0 -1
- package/dist/components/p-x3C-wjU9.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/components/data-display/syntax-box/internals/formatter.d.ts +0 -15
- package/dist/webquark/p-048103e0.entry.js +0 -1
- package/dist/webquark/p-0baf478a.entry.js +0 -1
- package/dist/webquark/p-2eaa3a9f.entry.js +0 -1
- package/dist/webquark/p-65fe9cac.entry.js +0 -1
- package/dist/webquark/p-8c5b2706.entry.js +0 -1
- package/dist/webquark/p-923527f0.entry.js +0 -1
- package/dist/webquark/p-Bj2RJb2E.js +0 -1
- package/dist/webquark/p-DoGM9gsC.js +0 -3
- package/dist/webquark/p-a0d97367.entry.js +0 -1
- package/dist/webquark/p-a16bd8d5.entry.js +0 -13
- package/dist/webquark/p-a3e1096d.entry.js +0 -1
- package/dist/webquark/p-b1c771fb.entry.js +0 -1
- package/dist/webquark/p-b45ca926.entry.js +0 -1
- package/dist/webquark/p-eb800d1e.entry.js +0 -1
- /package/dist/{types/components/data-display/syntax-box/internals/formatter.unit.test.d.ts → collection/components/data-display/syntax-box/internals/formatters/formatter.types.js} +0 -0
|
@@ -1,293 +1,205 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { formatSource, isFormatSupported } from "./internals/formatter";
|
|
6
|
-
import { syncNativeControlValidity } from "../../../utils/form-control-validity";
|
|
7
|
-
import { tokenizeSyntax } from "./internals/syntax";
|
|
8
|
-
import { getSyntaxBoxCopyText, writeClipboardText } from "./internals/clipboard";
|
|
9
|
-
import { getSyntaxBoxEditorKeyAction } from "./internals/editor-key-action";
|
|
10
|
-
import { normalizeSyntaxBoxValue, resolveInitialSyntaxBoxValue } from "./internals/value-sync";
|
|
1
|
+
import { Host, Mixin, forceUpdate, h } from "@stencil/core";
|
|
2
|
+
import { hasSlottedSource, syntaxBoxes, syntaxScrollRestorers, syntaxVisibility } from "./internals/views";
|
|
3
|
+
import { withSyntaxContent } from "./syntax-content";
|
|
4
|
+
let nextBox = 0;
|
|
11
5
|
/**
|
|
12
|
-
* Displays
|
|
13
|
-
* @slot - Read-only fallback content
|
|
14
|
-
* @slot
|
|
6
|
+
* Displays syntax-highlighted content and automatically adds tabs for multiple views.
|
|
7
|
+
* @slot - Read-only fallback content or direct q-syntax-view children.
|
|
8
|
+
* @slot heading - Custom title content in the single-view panel header.
|
|
9
|
+
* @slot actions - Additional actions for the box's own view.
|
|
15
10
|
*/
|
|
16
|
-
export class QSyntaxBox {
|
|
17
|
-
|
|
11
|
+
export class QSyntaxBox extends Mixin(withSyntaxContent) {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
}
|
|
18
15
|
el;
|
|
19
16
|
internals;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/** Emitted when editable content is committed by the native change event or by formatting. */
|
|
41
|
-
qChange;
|
|
42
|
-
/** Emitted on each editable content input and after formatting. */
|
|
43
|
-
qInput;
|
|
44
|
-
// ======================== [2] INTERNAL STATE & REFS ========================
|
|
45
|
-
disabledState = false;
|
|
46
|
-
get isDisabled() {
|
|
47
|
-
return isFieldDisabled(this.el, this.disabled);
|
|
48
|
-
}
|
|
49
|
-
copied = false;
|
|
50
|
-
copyFailed = false;
|
|
51
|
-
formatMessage;
|
|
52
|
-
initialValue = '';
|
|
53
|
-
copiedTimeoutId;
|
|
54
|
-
scrollableEl;
|
|
55
|
-
preEl;
|
|
56
|
-
// ========================= [3] LIFECYCLE & WATCHERS =========================
|
|
57
|
-
watchCode(newCode) {
|
|
58
|
-
this.formatMessage = undefined;
|
|
59
|
-
const finalCode = normalizeSyntaxBoxValue(newCode, {
|
|
60
|
-
editable: this.editable,
|
|
17
|
+
instanceId = `q-syntax-box-${++nextBox}`;
|
|
18
|
+
identities = new WeakMap();
|
|
19
|
+
nextView = 0;
|
|
20
|
+
views = [];
|
|
21
|
+
selected;
|
|
22
|
+
observer;
|
|
23
|
+
tabSelector;
|
|
24
|
+
focusWithin = false;
|
|
25
|
+
restoreFocus = false;
|
|
26
|
+
activeVariant;
|
|
27
|
+
linkFrame;
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
syntaxBoxes.set(this.el, this);
|
|
30
|
+
this.el.addEventListener('focusin', this.onFocusIn);
|
|
31
|
+
this.el.addEventListener('focusout', this.onFocusOut);
|
|
32
|
+
this.observer = new MutationObserver(changes => {
|
|
33
|
+
const changed = changes.some(change => change.target === this.el || change.target.parentNode === this.el &&
|
|
34
|
+
(change.type === 'characterData' || change.type === 'attributes'));
|
|
35
|
+
if (changed && this.collectViews())
|
|
36
|
+
forceUpdate(this.el);
|
|
61
37
|
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (this.value !== finalCode) {
|
|
66
|
-
this.value = finalCode;
|
|
67
|
-
}
|
|
68
|
-
this.syncFormValue(finalCode);
|
|
69
|
-
}
|
|
70
|
-
watchValue(newValue) {
|
|
71
|
-
this.formatMessage = undefined;
|
|
72
|
-
const finalVal = normalizeSyntaxBoxValue(newValue, {
|
|
73
|
-
editable: this.editable,
|
|
38
|
+
this.observer.observe(this.el, {
|
|
39
|
+
childList: true, subtree: true, characterData: true, attributes: true,
|
|
40
|
+
attributeFilter: ['heading', 'view-key', 'slot'],
|
|
74
41
|
});
|
|
75
|
-
if (finalVal !== newValue) {
|
|
76
|
-
this.value = finalVal;
|
|
77
|
-
}
|
|
78
|
-
if (this.code !== finalVal) {
|
|
79
|
-
this.code = finalVal;
|
|
80
|
-
}
|
|
81
|
-
this.syncFormValue(finalVal);
|
|
82
|
-
}
|
|
83
|
-
watchConstraints() {
|
|
84
|
-
this.syncValidity();
|
|
85
42
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
this.watchCode(this.code);
|
|
89
|
-
this.syncFormValue(this.code);
|
|
90
|
-
}
|
|
91
|
-
componentWillLoad() {
|
|
92
|
-
const initial = resolveInitialSyntaxBoxValue({
|
|
93
|
-
code: this.code,
|
|
94
|
-
value: this.value,
|
|
95
|
-
editable: this.editable,
|
|
96
|
-
});
|
|
97
|
-
this.code = initial.code;
|
|
98
|
-
this.value = initial.value;
|
|
99
|
-
this.initialValue = initial.initialValue;
|
|
100
|
-
this.syncFormValue(this.code);
|
|
101
|
-
}
|
|
102
|
-
formDisabledCallback() {
|
|
103
|
-
this.syncValidity();
|
|
104
|
-
}
|
|
105
|
-
componentDidLoad() {
|
|
106
|
-
registerFormField(this.el, {
|
|
107
|
-
kind: 'text',
|
|
108
|
-
owner: () => this.internals?.form ?? null,
|
|
109
|
-
active: () => this.editable,
|
|
110
|
-
value: () => this.code ?? '',
|
|
111
|
-
assign: value => { this.value = value; },
|
|
112
|
-
reconcile: () => {
|
|
113
|
-
const textarea = this.el.shadowRoot?.querySelector('textarea');
|
|
114
|
-
if (textarea && textarea.value !== (this.code ?? ''))
|
|
115
|
-
textarea.value = this.code ?? '';
|
|
116
|
-
this.syncFormValue(this.code);
|
|
117
|
-
this.syncValidity();
|
|
118
|
-
},
|
|
119
|
-
reset: () => this.formResetCallback(),
|
|
120
|
-
validate: report => report ? this.internals?.reportValidity?.() ?? true : this.internals?.checkValidity?.() ?? true,
|
|
121
|
-
});
|
|
43
|
+
componentWillRender() {
|
|
44
|
+
this.collectViews();
|
|
122
45
|
}
|
|
123
46
|
componentDidRender() {
|
|
124
|
-
|
|
47
|
+
super.componentDidRender();
|
|
48
|
+
if (this.activeVariant !== this.variant) {
|
|
49
|
+
this.activeVariant = this.variant;
|
|
50
|
+
for (const view of this.views)
|
|
51
|
+
if (view.element !== this.el)
|
|
52
|
+
forceUpdate(view.element);
|
|
53
|
+
}
|
|
54
|
+
this.syncPanels();
|
|
55
|
+
if (this.linkFrame !== undefined)
|
|
56
|
+
cancelAnimationFrame(this.linkFrame);
|
|
57
|
+
this.linkFrame = requestAnimationFrame(() => {
|
|
58
|
+
this.linkFrame = undefined;
|
|
59
|
+
this.linkTabs();
|
|
60
|
+
if (this.selected)
|
|
61
|
+
syntaxScrollRestorers.get(this.selected)?.();
|
|
62
|
+
this.recoverFocus();
|
|
63
|
+
});
|
|
125
64
|
}
|
|
126
65
|
disconnectedCallback() {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
this.
|
|
131
|
-
this.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
/** Returns whether editable content satisfies native constraints. */
|
|
141
|
-
async checkValidity() {
|
|
142
|
-
this.syncValidity();
|
|
143
|
-
if (typeof this.internals.checkValidity === 'function') {
|
|
144
|
-
return this.internals.checkValidity();
|
|
145
|
-
}
|
|
146
|
-
return this.el.shadowRoot?.querySelector('textarea')?.checkValidity?.() ?? true;
|
|
147
|
-
}
|
|
148
|
-
/** Reports editable constraint violations and returns whether the control is valid. */
|
|
149
|
-
async reportValidity() {
|
|
150
|
-
this.syncValidity();
|
|
151
|
-
if (typeof this.internals.reportValidity === 'function') {
|
|
152
|
-
return this.internals.reportValidity();
|
|
153
|
-
}
|
|
154
|
-
return this.el.shadowRoot?.querySelector('textarea')?.reportValidity?.() ?? true;
|
|
155
|
-
}
|
|
156
|
-
// =================== [5] EVENT HANDLERS & INTERNAL METHODS ===================
|
|
157
|
-
syncFormValue(value) {
|
|
158
|
-
if (!this.internals || typeof this.internals.setFormValue !== 'function')
|
|
66
|
+
super.disconnectedCallback();
|
|
67
|
+
this.observer?.disconnect();
|
|
68
|
+
this.el.removeEventListener('focusin', this.onFocusIn);
|
|
69
|
+
this.el.removeEventListener('focusout', this.onFocusOut);
|
|
70
|
+
if (this.linkFrame !== undefined)
|
|
71
|
+
cancelAnimationFrame(this.linkFrame);
|
|
72
|
+
}
|
|
73
|
+
visible(view) {
|
|
74
|
+
return !this.selected || view === this.selected;
|
|
75
|
+
}
|
|
76
|
+
select(view) {
|
|
77
|
+
if (!this.views.some(candidate => candidate.element === view) || this.selected === view)
|
|
159
78
|
return;
|
|
160
|
-
this.
|
|
161
|
-
this.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
if (!
|
|
177
|
-
|
|
178
|
-
|
|
79
|
+
this.selected = view;
|
|
80
|
+
this.syncPanels();
|
|
81
|
+
forceUpdate(this.el);
|
|
82
|
+
}
|
|
83
|
+
onFocusIn = () => { this.focusWithin = true; };
|
|
84
|
+
onFocusOut = (event) => {
|
|
85
|
+
if (event.relatedTarget instanceof Node && !this.el.contains(event.relatedTarget))
|
|
86
|
+
this.focusWithin = false;
|
|
87
|
+
};
|
|
88
|
+
collectViews() {
|
|
89
|
+
const children = Array.from(this.el.children).filter((child) => child.localName === 'q-syntax-view');
|
|
90
|
+
const hostHasContent = this.code !== undefined || this.value !== undefined || this.editable || hasSlottedSource(this.el);
|
|
91
|
+
const elements = hostHasContent || !children.length ? [this.el, ...children] : children;
|
|
92
|
+
const views = elements.map((element, index) => this.describeView(element, index));
|
|
93
|
+
const previous = this.views;
|
|
94
|
+
const changed = previous.length !== views.length || views.some((view, index) => previous[index]?.element !== view.element || previous[index]?.tab.label !== view.tab.label || previous[index]?.key !== view.key);
|
|
95
|
+
if (!changed)
|
|
96
|
+
return false;
|
|
97
|
+
if (!views.some(view => view.element === this.selected)) {
|
|
98
|
+
this.restoreFocus = this.selected !== undefined && this.focusWithin;
|
|
99
|
+
this.selected = this.replacementView(views).element;
|
|
100
|
+
}
|
|
101
|
+
if (previous.length > 1 && views.length === 1 && this.el.shadowRoot?.activeElement === this.tabSelector)
|
|
102
|
+
this.restoreFocus = true;
|
|
103
|
+
for (const old of previous) {
|
|
104
|
+
if (!elements.includes(old.element) && old.element.slot === old.tab.value) {
|
|
105
|
+
old.element.removeAttribute('slot');
|
|
106
|
+
forceUpdate(old.element);
|
|
179
107
|
}
|
|
180
|
-
return;
|
|
181
108
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
control: textarea,
|
|
185
|
-
disabled: this.isDisabled,
|
|
186
|
-
});
|
|
109
|
+
this.views = views;
|
|
110
|
+
return true;
|
|
187
111
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
112
|
+
describeView(element, index) {
|
|
113
|
+
let id = this.identities.get(element);
|
|
114
|
+
if (!id) {
|
|
115
|
+
id = `${this.instanceId}-view-${++this.nextView}`;
|
|
116
|
+
this.identities.set(element, id);
|
|
192
117
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
this.copyFailed = false;
|
|
199
|
-
this.copiedTimeoutId = undefined;
|
|
200
|
-
}, 1500);
|
|
201
|
-
}
|
|
202
|
-
copyCode = async () => {
|
|
203
|
-
if (this.isDisabled)
|
|
204
|
-
return;
|
|
205
|
-
const codeToCopy = getSyntaxBoxCopyText(this.code, this.el.textContent);
|
|
206
|
-
try {
|
|
207
|
-
await writeClipboardText(codeToCopy);
|
|
208
|
-
if (!this.el.isConnected)
|
|
209
|
-
return;
|
|
210
|
-
this.copied = true;
|
|
211
|
-
this.copyFailed = false;
|
|
118
|
+
const child = element !== this.el;
|
|
119
|
+
if (child && element.slot !== id) {
|
|
120
|
+
element.slot = id;
|
|
121
|
+
if (element.shadowRoot?.childElementCount)
|
|
122
|
+
forceUpdate(element);
|
|
212
123
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
this.
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
this.qChange.emit(this.code);
|
|
124
|
+
const label = (child ? element.getAttribute('heading') : this.heading)?.trim() || `View ${index + 1}`;
|
|
125
|
+
return {
|
|
126
|
+
element,
|
|
127
|
+
key: child ? element.getAttribute('view-key')?.trim() : undefined,
|
|
128
|
+
tab: { label, value: id, tabId: id + '-tab', panelId: id + '-panel' },
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
replacementView(views) {
|
|
132
|
+
const index = this.views.findIndex(view => view.element === this.selected);
|
|
133
|
+
if (index < 0)
|
|
134
|
+
return views[0];
|
|
135
|
+
const key = this.views[index].key;
|
|
136
|
+
if (key && this.views.filter(view => view.key === key).length === 1) {
|
|
137
|
+
const replacements = views.filter(view => view.key === key);
|
|
138
|
+
if (replacements.length === 1)
|
|
139
|
+
return replacements[0];
|
|
140
|
+
}
|
|
141
|
+
const neighbors = [...this.views.slice(index + 1), ...this.views.slice(0, index).reverse()];
|
|
142
|
+
return neighbors.find(old => views.some(view => view.element === old.element)) ?? views[0];
|
|
143
|
+
}
|
|
144
|
+
onTabChange = (event) => {
|
|
145
|
+
event.stopPropagation();
|
|
146
|
+
const view = this.views.find(candidate => candidate.tab.value === event.detail);
|
|
147
|
+
if (view)
|
|
148
|
+
this.select(view.element);
|
|
239
149
|
};
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
150
|
+
panel(view) {
|
|
151
|
+
return this.el.shadowRoot?.getElementById(view.tab.panelId);
|
|
152
|
+
}
|
|
153
|
+
syncPanels() {
|
|
154
|
+
for (const view of this.views) {
|
|
155
|
+
const panel = this.panel(view);
|
|
156
|
+
if (!panel)
|
|
157
|
+
continue;
|
|
158
|
+
const inactive = !this.visible(view.element);
|
|
159
|
+
panel.toggleAttribute('data-inactive', inactive);
|
|
160
|
+
if (inactive)
|
|
161
|
+
panel.setAttribute('aria-hidden', 'true');
|
|
162
|
+
else
|
|
163
|
+
panel.removeAttribute('aria-hidden');
|
|
164
|
+
panel.tabIndex = !inactive && this.views.length > 1 ? 0 : -1;
|
|
165
|
+
syntaxVisibility.get(view.element)?.();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
linkTabs() {
|
|
169
|
+
for (const view of this.views) {
|
|
170
|
+
const tab = this.tabSelector?.shadowRoot?.getElementById(view.tab.tabId);
|
|
171
|
+
const panel = this.panel(view);
|
|
172
|
+
if (!tab || !panel)
|
|
173
|
+
continue;
|
|
174
|
+
if ('ariaControlsElements' in tab)
|
|
175
|
+
tab.ariaControlsElements = [panel];
|
|
176
|
+
if ('ariaLabelledByElements' in panel)
|
|
177
|
+
panel.ariaLabelledByElements = [tab];
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
recoverFocus() {
|
|
181
|
+
if (!this.restoreFocus)
|
|
244
182
|
return;
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
183
|
+
this.restoreFocus = false;
|
|
184
|
+
const focused = this.el.ownerDocument.activeElement;
|
|
185
|
+
if (focused && focused !== this.el.ownerDocument.body && focused !== this.el && !this.el.contains(focused))
|
|
248
186
|
return;
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
this.code = action.value;
|
|
252
|
-
this.value = action.value;
|
|
253
|
-
this.qInput.emit(this.code);
|
|
254
|
-
requestAnimationFrame(() => {
|
|
255
|
-
textarea.selectionStart = textarea.selectionEnd = action.caret;
|
|
256
|
-
});
|
|
257
|
-
};
|
|
258
|
-
handleFormat = () => {
|
|
259
|
-
if (this.isDisabled || !isFormatSupported(this.language))
|
|
187
|
+
const view = this.views.find(candidate => candidate.element === this.selected);
|
|
188
|
+
if (!view)
|
|
260
189
|
return;
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
this.code = result.code;
|
|
264
|
-
this.value = result.code;
|
|
265
|
-
this.formatMessage = result.status === 'invalid' ? 'Invalid JSON; source unchanged.'
|
|
266
|
-
: result.status === 'unsupported' ? 'JSON formatting limit reached; source unchanged.' : undefined;
|
|
267
|
-
this.qInput.emit(result.code);
|
|
268
|
-
this.qChange.emit(result.code);
|
|
269
|
-
}
|
|
270
|
-
};
|
|
271
|
-
getCopyTooltipContent() {
|
|
272
|
-
if (this.copyFailed)
|
|
273
|
-
return 'Copy failed';
|
|
274
|
-
if (this.copied)
|
|
275
|
-
return 'Copied!';
|
|
276
|
-
return 'Copy';
|
|
190
|
+
const tab = this.tabSelector?.shadowRoot?.getElementById(view.tab.tabId);
|
|
191
|
+
(tab ?? this.panel(view))?.focus({ preventScroll: true });
|
|
277
192
|
}
|
|
278
|
-
// ===================== [6] RENDER (Visual Template Only) =====================
|
|
279
193
|
render() {
|
|
280
|
-
const
|
|
281
|
-
const
|
|
282
|
-
const
|
|
283
|
-
const
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}
|
|
290
|
-
return (h(Host, { class: { 'q-syntax-box-plain': true } }, h("div", { class: "plain-container" }, bodyContent)));
|
|
194
|
+
const tabbed = this.views.length > 1;
|
|
195
|
+
const panelStyle = this.variant === 'panel';
|
|
196
|
+
const active = this.views.find(view => view.element === this.selected);
|
|
197
|
+
const title = this.heading || (active?.element !== this.el ? active?.element.getAttribute('heading') : '');
|
|
198
|
+
return (h(Host, { key: 'd80b3540ede49d88b0a2990f30b8ceba69bac746', class: { 'q-syntax-box-panel': panelStyle, 'q-syntax-box-plain': !panelStyle } }, h("div", { key: '1470ea00ab877363757f55047c415394e07e6dfc', class: `syntax-layout ${panelStyle ? 'panel-container' : 'plain-container'}` }, (panelStyle || tabbed) && h("div", { key: "header", class: "panel-header" }, tabbed
|
|
199
|
+
? h("q-tabs", { size: "sm", items: this.views.map(view => view.tab), value: active?.tab.value, ariaLabel: this.heading || 'Syntax views', onQChange: this.onTabChange, ref: el => { this.tabSelector = el; } })
|
|
200
|
+
: h("span", null, h("slot", { name: "heading" }, title))), this.views.map(view => h("div", { key: view.tab.value, class: "view-panel", id: view.tab.panelId, "data-inactive": this.visible(view.element) ? undefined : '', role: tabbed ? 'tabpanel' : undefined, "aria-hidden": this.visible(view.element) ? undefined : 'true', "aria-label": tabbed ? view.tab.label : undefined, tabindex: tabbed && this.visible(view.element) ? 0 : -1 }, view.element === this.el
|
|
201
|
+
? [panelStyle && this.renderActions(), this.renderContent(this.variant)]
|
|
202
|
+
: h("slot", { name: view.tab.value }))))));
|
|
291
203
|
}
|
|
292
204
|
static get is() { return "q-syntax-box"; }
|
|
293
205
|
static get encapsulation() { return "shadow"; }
|
|
@@ -303,376 +215,6 @@ export class QSyntaxBox {
|
|
|
303
215
|
"$": ["syntax-box.css"]
|
|
304
216
|
};
|
|
305
217
|
}
|
|
306
|
-
static get properties() {
|
|
307
|
-
return {
|
|
308
|
-
"code": {
|
|
309
|
-
"type": "string",
|
|
310
|
-
"mutable": true,
|
|
311
|
-
"complexType": {
|
|
312
|
-
"original": "string",
|
|
313
|
-
"resolved": "string",
|
|
314
|
-
"references": {}
|
|
315
|
-
},
|
|
316
|
-
"required": false,
|
|
317
|
-
"optional": true,
|
|
318
|
-
"docs": {
|
|
319
|
-
"tags": [],
|
|
320
|
-
"text": "Mirrored with `value`; prefer `code` for domain usage."
|
|
321
|
-
},
|
|
322
|
-
"getter": false,
|
|
323
|
-
"setter": false,
|
|
324
|
-
"reflect": false,
|
|
325
|
-
"attribute": "code"
|
|
326
|
-
},
|
|
327
|
-
"value": {
|
|
328
|
-
"type": "string",
|
|
329
|
-
"mutable": true,
|
|
330
|
-
"complexType": {
|
|
331
|
-
"original": "string",
|
|
332
|
-
"resolved": "string",
|
|
333
|
-
"references": {}
|
|
334
|
-
},
|
|
335
|
-
"required": false,
|
|
336
|
-
"optional": true,
|
|
337
|
-
"docs": {
|
|
338
|
-
"tags": [],
|
|
339
|
-
"text": "Form-value alias mirrored with `code` for compatibility."
|
|
340
|
-
},
|
|
341
|
-
"getter": false,
|
|
342
|
-
"setter": false,
|
|
343
|
-
"reflect": false,
|
|
344
|
-
"attribute": "value"
|
|
345
|
-
},
|
|
346
|
-
"heading": {
|
|
347
|
-
"type": "string",
|
|
348
|
-
"mutable": false,
|
|
349
|
-
"complexType": {
|
|
350
|
-
"original": "string",
|
|
351
|
-
"resolved": "string",
|
|
352
|
-
"references": {}
|
|
353
|
-
},
|
|
354
|
-
"required": false,
|
|
355
|
-
"optional": true,
|
|
356
|
-
"docs": {
|
|
357
|
-
"tags": [],
|
|
358
|
-
"text": "Shown only in the panel variant."
|
|
359
|
-
},
|
|
360
|
-
"getter": false,
|
|
361
|
-
"setter": false,
|
|
362
|
-
"reflect": false,
|
|
363
|
-
"attribute": "heading"
|
|
364
|
-
},
|
|
365
|
-
"ariaLabel": {
|
|
366
|
-
"type": "string",
|
|
367
|
-
"mutable": false,
|
|
368
|
-
"complexType": {
|
|
369
|
-
"original": "string | null",
|
|
370
|
-
"resolved": "string",
|
|
371
|
-
"references": {}
|
|
372
|
-
},
|
|
373
|
-
"required": false,
|
|
374
|
-
"optional": false,
|
|
375
|
-
"docs": {
|
|
376
|
-
"tags": [],
|
|
377
|
-
"text": "Accessible name for the editor; falls back to `heading`, then the language."
|
|
378
|
-
},
|
|
379
|
-
"getter": false,
|
|
380
|
-
"setter": false,
|
|
381
|
-
"reflect": false,
|
|
382
|
-
"attribute": "aria-label",
|
|
383
|
-
"defaultValue": "null"
|
|
384
|
-
},
|
|
385
|
-
"variant": {
|
|
386
|
-
"type": "string",
|
|
387
|
-
"mutable": false,
|
|
388
|
-
"complexType": {
|
|
389
|
-
"original": "QSyntaxBoxVariant",
|
|
390
|
-
"resolved": "\"panel\" | \"plain\"",
|
|
391
|
-
"references": {
|
|
392
|
-
"QSyntaxBoxVariant": {
|
|
393
|
-
"location": "import",
|
|
394
|
-
"path": "./syntax-box.types",
|
|
395
|
-
"id": "../../../src/browser/components/data-display/syntax-box/syntax-box.types.ts::QSyntaxBoxVariant",
|
|
396
|
-
"referenceLocation": "QSyntaxBoxVariant"
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
},
|
|
400
|
-
"required": false,
|
|
401
|
-
"optional": false,
|
|
402
|
-
"docs": {
|
|
403
|
-
"tags": [],
|
|
404
|
-
"text": ""
|
|
405
|
-
},
|
|
406
|
-
"getter": false,
|
|
407
|
-
"setter": false,
|
|
408
|
-
"reflect": false,
|
|
409
|
-
"attribute": "variant",
|
|
410
|
-
"defaultValue": "'panel'"
|
|
411
|
-
},
|
|
412
|
-
"height": {
|
|
413
|
-
"type": "string",
|
|
414
|
-
"mutable": false,
|
|
415
|
-
"complexType": {
|
|
416
|
-
"original": "string",
|
|
417
|
-
"resolved": "string",
|
|
418
|
-
"references": {}
|
|
419
|
-
},
|
|
420
|
-
"required": false,
|
|
421
|
-
"optional": true,
|
|
422
|
-
"docs": {
|
|
423
|
-
"tags": [],
|
|
424
|
-
"text": "Explicit content height. Panel mode defaults to 110px; plain mode defaults to auto."
|
|
425
|
-
},
|
|
426
|
-
"getter": false,
|
|
427
|
-
"setter": false,
|
|
428
|
-
"reflect": false,
|
|
429
|
-
"attribute": "height"
|
|
430
|
-
},
|
|
431
|
-
"copyable": {
|
|
432
|
-
"type": "boolean",
|
|
433
|
-
"mutable": false,
|
|
434
|
-
"complexType": {
|
|
435
|
-
"original": "boolean",
|
|
436
|
-
"resolved": "boolean",
|
|
437
|
-
"references": {}
|
|
438
|
-
},
|
|
439
|
-
"required": false,
|
|
440
|
-
"optional": false,
|
|
441
|
-
"docs": {
|
|
442
|
-
"tags": [],
|
|
443
|
-
"text": ""
|
|
444
|
-
},
|
|
445
|
-
"getter": false,
|
|
446
|
-
"setter": false,
|
|
447
|
-
"reflect": false,
|
|
448
|
-
"attribute": "copyable",
|
|
449
|
-
"defaultValue": "false"
|
|
450
|
-
},
|
|
451
|
-
"editable": {
|
|
452
|
-
"type": "boolean",
|
|
453
|
-
"mutable": false,
|
|
454
|
-
"complexType": {
|
|
455
|
-
"original": "boolean",
|
|
456
|
-
"resolved": "boolean",
|
|
457
|
-
"references": {}
|
|
458
|
-
},
|
|
459
|
-
"required": false,
|
|
460
|
-
"optional": false,
|
|
461
|
-
"docs": {
|
|
462
|
-
"tags": [],
|
|
463
|
-
"text": ""
|
|
464
|
-
},
|
|
465
|
-
"getter": false,
|
|
466
|
-
"setter": false,
|
|
467
|
-
"reflect": true,
|
|
468
|
-
"attribute": "editable",
|
|
469
|
-
"defaultValue": "false"
|
|
470
|
-
},
|
|
471
|
-
"name": {
|
|
472
|
-
"type": "string",
|
|
473
|
-
"mutable": false,
|
|
474
|
-
"complexType": {
|
|
475
|
-
"original": "string",
|
|
476
|
-
"resolved": "string",
|
|
477
|
-
"references": {}
|
|
478
|
-
},
|
|
479
|
-
"required": false,
|
|
480
|
-
"optional": true,
|
|
481
|
-
"docs": {
|
|
482
|
-
"tags": [],
|
|
483
|
-
"text": "Form field name used when the component is editable."
|
|
484
|
-
},
|
|
485
|
-
"getter": false,
|
|
486
|
-
"setter": false,
|
|
487
|
-
"reflect": true,
|
|
488
|
-
"attribute": "name"
|
|
489
|
-
},
|
|
490
|
-
"required": {
|
|
491
|
-
"type": "boolean",
|
|
492
|
-
"mutable": false,
|
|
493
|
-
"complexType": {
|
|
494
|
-
"original": "boolean",
|
|
495
|
-
"resolved": "boolean",
|
|
496
|
-
"references": {}
|
|
497
|
-
},
|
|
498
|
-
"required": false,
|
|
499
|
-
"optional": false,
|
|
500
|
-
"docs": {
|
|
501
|
-
"tags": [],
|
|
502
|
-
"text": "Marks the editable textarea as required for form validation."
|
|
503
|
-
},
|
|
504
|
-
"getter": false,
|
|
505
|
-
"setter": false,
|
|
506
|
-
"reflect": true,
|
|
507
|
-
"attribute": "required",
|
|
508
|
-
"defaultValue": "false"
|
|
509
|
-
},
|
|
510
|
-
"language": {
|
|
511
|
-
"type": "string",
|
|
512
|
-
"mutable": false,
|
|
513
|
-
"complexType": {
|
|
514
|
-
"original": "QSyntaxBoxLanguage",
|
|
515
|
-
"resolved": "\"css\" | \"html\" | \"javascript\" | \"json\"",
|
|
516
|
-
"references": {
|
|
517
|
-
"QSyntaxBoxLanguage": {
|
|
518
|
-
"location": "import",
|
|
519
|
-
"path": "./syntax-box.types",
|
|
520
|
-
"id": "../../../src/browser/components/data-display/syntax-box/syntax-box.types.ts::QSyntaxBoxLanguage",
|
|
521
|
-
"referenceLocation": "QSyntaxBoxLanguage"
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
},
|
|
525
|
-
"required": false,
|
|
526
|
-
"optional": false,
|
|
527
|
-
"docs": {
|
|
528
|
-
"tags": [],
|
|
529
|
-
"text": ""
|
|
530
|
-
},
|
|
531
|
-
"getter": false,
|
|
532
|
-
"setter": false,
|
|
533
|
-
"reflect": false,
|
|
534
|
-
"attribute": "language",
|
|
535
|
-
"defaultValue": "'html'"
|
|
536
|
-
},
|
|
537
|
-
"disabled": {
|
|
538
|
-
"type": "boolean",
|
|
539
|
-
"mutable": false,
|
|
540
|
-
"complexType": {
|
|
541
|
-
"original": "boolean",
|
|
542
|
-
"resolved": "boolean",
|
|
543
|
-
"references": {}
|
|
544
|
-
},
|
|
545
|
-
"required": false,
|
|
546
|
-
"optional": false,
|
|
547
|
-
"docs": {
|
|
548
|
-
"tags": [],
|
|
549
|
-
"text": "Disables editing and panel actions."
|
|
550
|
-
},
|
|
551
|
-
"getter": false,
|
|
552
|
-
"setter": false,
|
|
553
|
-
"reflect": true,
|
|
554
|
-
"attribute": "disabled",
|
|
555
|
-
"defaultValue": "false"
|
|
556
|
-
}
|
|
557
|
-
};
|
|
558
|
-
}
|
|
559
|
-
static get states() {
|
|
560
|
-
return {
|
|
561
|
-
"disabledState": {},
|
|
562
|
-
"copied": {},
|
|
563
|
-
"copyFailed": {},
|
|
564
|
-
"formatMessage": {}
|
|
565
|
-
};
|
|
566
|
-
}
|
|
567
|
-
static get events() {
|
|
568
|
-
return [{
|
|
569
|
-
"method": "qChange",
|
|
570
|
-
"name": "qChange",
|
|
571
|
-
"bubbles": true,
|
|
572
|
-
"cancelable": true,
|
|
573
|
-
"composed": true,
|
|
574
|
-
"docs": {
|
|
575
|
-
"tags": [],
|
|
576
|
-
"text": "Emitted when editable content is committed by the native change event or by formatting."
|
|
577
|
-
},
|
|
578
|
-
"complexType": {
|
|
579
|
-
"original": "string",
|
|
580
|
-
"resolved": "string",
|
|
581
|
-
"references": {}
|
|
582
|
-
}
|
|
583
|
-
}, {
|
|
584
|
-
"method": "qInput",
|
|
585
|
-
"name": "qInput",
|
|
586
|
-
"bubbles": true,
|
|
587
|
-
"cancelable": true,
|
|
588
|
-
"composed": true,
|
|
589
|
-
"docs": {
|
|
590
|
-
"tags": [],
|
|
591
|
-
"text": "Emitted on each editable content input and after formatting."
|
|
592
|
-
},
|
|
593
|
-
"complexType": {
|
|
594
|
-
"original": "string",
|
|
595
|
-
"resolved": "string",
|
|
596
|
-
"references": {}
|
|
597
|
-
}
|
|
598
|
-
}];
|
|
599
|
-
}
|
|
600
|
-
static get methods() {
|
|
601
|
-
return {
|
|
602
|
-
"scrollToBottom": {
|
|
603
|
-
"complexType": {
|
|
604
|
-
"signature": "() => Promise<void>",
|
|
605
|
-
"parameters": [],
|
|
606
|
-
"references": {
|
|
607
|
-
"Promise": {
|
|
608
|
-
"location": "global",
|
|
609
|
-
"id": "global::Promise"
|
|
610
|
-
}
|
|
611
|
-
},
|
|
612
|
-
"return": "Promise<void>"
|
|
613
|
-
},
|
|
614
|
-
"docs": {
|
|
615
|
-
"text": "Programmatically scrolls the read-only code body to the bottom when it is wrapped by q-scrollable.",
|
|
616
|
-
"tags": []
|
|
617
|
-
}
|
|
618
|
-
},
|
|
619
|
-
"checkValidity": {
|
|
620
|
-
"complexType": {
|
|
621
|
-
"signature": "() => Promise<boolean>",
|
|
622
|
-
"parameters": [],
|
|
623
|
-
"references": {
|
|
624
|
-
"Promise": {
|
|
625
|
-
"location": "global",
|
|
626
|
-
"id": "global::Promise"
|
|
627
|
-
}
|
|
628
|
-
},
|
|
629
|
-
"return": "Promise<boolean>"
|
|
630
|
-
},
|
|
631
|
-
"docs": {
|
|
632
|
-
"text": "Returns whether editable content satisfies native constraints.",
|
|
633
|
-
"tags": []
|
|
634
|
-
}
|
|
635
|
-
},
|
|
636
|
-
"reportValidity": {
|
|
637
|
-
"complexType": {
|
|
638
|
-
"signature": "() => Promise<boolean>",
|
|
639
|
-
"parameters": [],
|
|
640
|
-
"references": {
|
|
641
|
-
"Promise": {
|
|
642
|
-
"location": "global",
|
|
643
|
-
"id": "global::Promise"
|
|
644
|
-
}
|
|
645
|
-
},
|
|
646
|
-
"return": "Promise<boolean>"
|
|
647
|
-
},
|
|
648
|
-
"docs": {
|
|
649
|
-
"text": "Reports editable constraint violations and returns whether the control is valid.",
|
|
650
|
-
"tags": []
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
};
|
|
654
|
-
}
|
|
655
218
|
static get elementRef() { return "el"; }
|
|
656
|
-
static get watchers() {
|
|
657
|
-
return [{
|
|
658
|
-
"propName": "code",
|
|
659
|
-
"methodName": "watchCode"
|
|
660
|
-
}, {
|
|
661
|
-
"propName": "value",
|
|
662
|
-
"methodName": "watchValue"
|
|
663
|
-
}, {
|
|
664
|
-
"propName": "disabled",
|
|
665
|
-
"methodName": "watchConstraints"
|
|
666
|
-
}, {
|
|
667
|
-
"propName": "required",
|
|
668
|
-
"methodName": "watchConstraints"
|
|
669
|
-
}, {
|
|
670
|
-
"propName": "name",
|
|
671
|
-
"methodName": "watchConstraints"
|
|
672
|
-
}, {
|
|
673
|
-
"propName": "editable",
|
|
674
|
-
"methodName": "watchEditable"
|
|
675
|
-
}];
|
|
676
|
-
}
|
|
677
219
|
static get attachInternalsMemberName() { return "internals"; }
|
|
678
220
|
}
|