diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 83730fe9f4e..4f5d303ceee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -821,6 +821,9 @@ importers: '@tsconfig/ember': specifier: ^3.0.10 version: 3.0.11 + '@types/ember-cli-fastboot': + specifier: ^2.2.6 + version: 2.2.6 '@types/qunit': specifier: ^2.19.12 version: 2.19.12 @@ -890,9 +893,6 @@ importers: ember-cli-clean-css: specifier: ^3.0.0 version: 3.0.0 - ember-cli-clipboard: - specifier: ^1.2.1 - version: 1.3.0(@babel/core@7.28.0)(@ember/test-helpers@5.4.0(@babel/core@7.28.0)(@glint/template@1.5.2))(@glint/template@1.5.2)(webpack@5.101.0) ember-cli-dependency-checker: specifier: ^3.3.3 version: 3.3.3(ember-cli@6.4.0(babel-core@6.26.3)(handlebars@4.7.8)(underscore@1.13.7)) @@ -959,9 +959,15 @@ importers: ember-router-scroll: specifier: ^4.1.2 version: 4.1.2(@babel/core@7.28.0) + ember-shiki: + specifier: ^0.3.0 + version: 0.3.0(@babel/core@7.28.0)(ember-source@6.4.0(@glimmer/component@2.0.0)(rsvp@4.8.5)) ember-source: specifier: ~6.4.0 version: 6.4.0(@glimmer/component@2.0.0)(rsvp@4.8.5) + ember-style-modifier: + specifier: ^4.4.0 + version: 4.4.0(@babel/core@7.28.0)(@ember/string@4.0.1)(ember-source@6.4.0(@glimmer/component@2.0.0)(rsvp@4.8.5)) ember-template-imports: specifier: ^4.3.0 version: 4.3.0 @@ -3580,6 +3586,9 @@ packages: '@types/debug@4.1.12': resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} + '@types/ember-cli-fastboot@2.2.6': + resolution: {integrity: sha512-zyXMLlIoC28rAlIof9e71RUxb/Ka5JTdlKqGd0QnNF2W3GgPRUQZzr1hK3CJLNJr9N2ecFEM4ew2qduxDynhGg==} + '@types/ember@3.16.14': resolution: {integrity: sha512-m3fM87W1J75ri9Uu79hzKimiAhxdAF3dZyzmwGrf4OPPQp3yt2L9uHAkwmMIxstk4F1rBWG/SHJOnvlqif23Rw==} @@ -4082,6 +4091,9 @@ packages: resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} engines: {node: '>=12'} + ansi-sequence-parser@1.1.3: + resolution: {integrity: sha512-+fksAx9eG3Ab6LDnLs3ZqZa8KVJ/jYnX+D4Qe1azX+LFGFAXqynCQLOdLpNYN/l9e7l6hMWwZbrnctqr6eSQSw==} + ansi-styles@2.2.1: resolution: {integrity: sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==} engines: {node: '>=0.10.0'} @@ -5109,9 +5121,6 @@ packages: clipboard-polyfill@4.1.1: resolution: {integrity: sha512-nbvNLrcX0zviek5QHLFRAaLrx8y/s8+RF2stH43tuS+kP5XlHMrcD0UGBWq43Hwp6WuuK7KefRMP56S45ibZkA==} - clipboard@2.0.11: - resolution: {integrity: sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==} - cliui@7.0.4: resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} @@ -5865,9 +5874,6 @@ packages: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} - delegate@3.2.0: - resolution: {integrity: sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==} - delegates@1.0.0: resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} @@ -6044,10 +6050,6 @@ packages: resolution: {integrity: sha512-7140A/4OJuYBlncfxmreZHX5S7FxO/4KX5NswowIrvGZpaLuoeULjBHgiKBWC1OUzsdHST4jwaDufniHEROajg==} engines: {node: 12.* || 14.* || >= 16} - ember-arg-types@1.1.0: - resolution: {integrity: sha512-hWpUz0eiNkWzi3FgHW5QU6LyCDyUlTWwuIROHluEKZoa9m6LJVXbb/EVFgIG3FkAib6a5Ie00WvkXEZFXxh3+A==} - engines: {node: 14.* || >= 16} - ember-assign-helper@0.5.0: resolution: {integrity: sha512-swH7FqmqB5iSeoKlU6X41iqw5HQ+EdBDyFDXmwytTyUd5GRvfGfZUn2SMUUGdyvo5FxXJWqMJ0rBT//EcGC0+Q==} peerDependencies: @@ -6095,12 +6097,6 @@ packages: resolution: {integrity: sha512-BbveJCyRvzzkaTH1llLW+MpHe/yzA5zpHOpMIg2vp/3JD9mban9zUm7lphaB0TSpPuMuby9rAhTI8pgXq0ifIA==} engines: {node: 16.* || >= 18} - ember-cli-clipboard@1.3.0: - resolution: {integrity: sha512-GTX+zzfxhfGyDgk00PcFIEAT063QrpeB3F2UYrKQYZmJiIFFlyriSRw9LrVcXjhEROCVjrHoOVrhcqCATEDAKw==} - engines: {node: 14.* || >= 16} - peerDependencies: - '@ember/test-helpers': '>= 2.9.3' - ember-cli-dependency-checker@3.3.3: resolution: {integrity: sha512-mvp+HrE0M5Zhc2oW8cqs8wdhtqq0CfQXAYzaIstOzHJJn/U01NZEGu3hz7J7zl/+jxZkyygylzcS57QqmPXMuQ==} engines: {node: '>= 6'} @@ -6224,6 +6220,12 @@ packages: resolution: {integrity: sha512-BtkjulweiXo9c3yVWrtexw2dTmBrvavD/xixNC6TKOBdrixUwU+6nuOO9dufDWsMxoid7MvtmDpzc9+mE8PdaA==} engines: {node: 10.* || >= 12.*} + ember-concurrency@3.1.1: + resolution: {integrity: sha512-doXFYYfy1C7jez+jDDlfahTp03QdjXeSY/W3Zbnx/q3UNJ9g10Shf2d7M/HvWo/TC22eU+6dPLIpqd/6q4pR+Q==} + engines: {node: 16.* || >= 18} + peerDependencies: + ember-source: ^3.28.0 || ^4.0.0 || >=5.0.0 + ember-concurrency@4.0.4: resolution: {integrity: sha512-Y+PwbFE2r3+ANlT0lTBNokLXTRFLV6lnGkZ8u5tDhND5o2wD1wkh9JdP8KZ8aJ+J0dmhncVGQNi+Dbbtc6xTfg==} engines: {node: 16.* || >= 18} @@ -6274,10 +6276,6 @@ packages: resolution: {integrity: sha512-y1osD6g8wV/BlDjuaN6OG5MT0iHY2X/yE38gUj/05uUIMIRfpcwOdWnFQHBiXIhDojvAJQTEF1VOYFIETQMkeQ==} engines: {node: 12.* || 14.* || >= 16} - ember-get-config@2.1.1: - resolution: {integrity: sha512-uNmv1cPG/4qsac8oIf5txJ2FZ8p88LEpG4P3dNcjsJS98Y8hd0GPMFwVqpnzI78Lz7VYRGQWY4jnE4qm5R3j4g==} - engines: {node: 12.* || 14.* || >= 16} - ember-in-element-polyfill@1.0.1: resolution: {integrity: sha512-eHs+7D7PuQr8a1DPqsJTsEyo3FZ1XuH6WEZaEBPDa9s0xLlwByCNKl8hi1EbXOgvgEZNHHi9Rh0vjxyfakrlgg==} engines: {node: 10.* || >= 12} @@ -6382,6 +6380,12 @@ packages: ember-set-helper@3.0.1: resolution: {integrity: sha512-Ord3CuttDiF88wiNpHNDjf4aFKPnHSkpeK7zFfH9nV7YdDFSJissDCZEg42A0ReWY1WuqWbc2hMl5XkgupdyZQ==} + ember-shiki@0.3.0: + resolution: {integrity: sha512-rX61cltjBtQqxJlWyj61CE/y10wrrzukHACRGPLd4NbNQH2hqrrjT3nBf5uYAOZK6SnEd4eI+QZvpqIXKQyWwA==} + engines: {node: 16.* || >= 18} + peerDependencies: + ember-source: '>= 4.0.0' + ember-source-channel-url@3.0.0: resolution: {integrity: sha512-vF/8BraOc66ZxIDo3VuNP7iiDrnXEINclJgSJmqwAAEpg84Zb1DHPI22XTXSDA+E8fW5btPUxu65c3ZXi8AQFA==} engines: {node: 10.* || 12.* || >= 14} @@ -7436,9 +7440,6 @@ packages: engines: {node: '>=0.6.0'} hasBin: true - good-listener@1.2.2: - resolution: {integrity: sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==} - gopd@1.2.0: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} @@ -8418,6 +8419,9 @@ packages: resolution: {integrity: sha512-LeRPlP93Mz6+Klu13OKcnXNLvtH1gbeo/yfThqihAMw7vUBCWWs6jHImpR/tQwzAxJi7F1+bfVJxeHoNCrbZiQ==} engines: {node: '>=0.12'} + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + jsonfile@2.4.0: resolution: {integrity: sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==} @@ -9826,9 +9830,6 @@ packages: resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} engines: {node: '>= 6'} - prop-types@15.8.1: - resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} - proper-lockfile@4.1.2: resolution: {integrity: sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==} @@ -9926,9 +9927,6 @@ packages: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true - react-is@16.13.1: - resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} - react-is@18.3.1: resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} @@ -10382,9 +10380,6 @@ packages: resolution: {integrity: sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==} engines: {node: '>=4'} - select@1.1.2: - resolution: {integrity: sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==} - semver@5.7.2: resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} hasBin: true @@ -10461,6 +10456,9 @@ packages: shellwords@0.1.1: resolution: {integrity: sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==} + shiki@0.14.7: + resolution: {integrity: sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==} + showdown@2.1.0: resolution: {integrity: sha512-/6NVYu4U819R2pUIk79n67SYgJHWCce0a5xTP979WbNp0FL9MN1I1QK662IDU1b6JzKTvmhgI7T7JYIxBi3kMQ==} hasBin: true @@ -11057,9 +11055,6 @@ packages: resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} engines: {node: '>=4'} - tiny-emitter@2.1.0: - resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==} - tiny-glob@0.2.9: resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==} @@ -11537,6 +11532,12 @@ packages: resolution: {integrity: sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==} hasBin: true + vscode-oniguruma@1.7.0: + resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==} + + vscode-textmate@8.0.0: + resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} + vscode-uri@3.1.0: resolution: {integrity: sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==} @@ -15158,6 +15159,10 @@ snapshots: dependencies: '@types/ms': 0.7.34 + '@types/ember-cli-fastboot@2.2.6': + dependencies: + '@types/ember__service': 3.16.9 + '@types/ember@3.16.14': dependencies: '@types/ember__application': 3.16.10 @@ -15811,6 +15816,8 @@ snapshots: ansi-regex@6.1.0: {} + ansi-sequence-parser@1.1.3: {} + ansi-styles@2.2.1: {} ansi-styles@3.2.1: @@ -17540,12 +17547,6 @@ snapshots: clipboard-polyfill@4.1.1: {} - clipboard@2.0.11: - dependencies: - good-listener: 1.2.2 - select: 1.1.2 - tiny-emitter: 2.1.0 - cliui@7.0.4: dependencies: string-width: 4.2.3 @@ -18222,8 +18223,6 @@ snapshots: delayed-stream@1.0.0: {} - delegate@3.2.0: {} - delegates@1.0.0: {} depd@1.1.2: {} @@ -18422,19 +18421,6 @@ snapshots: - '@babel/core' - supports-color - ember-arg-types@1.1.0(@glint/template@1.5.2)(webpack@5.101.0): - dependencies: - '@embroider/macros': 1.18.1(@glint/template@1.5.2) - ember-auto-import: 2.10.0(@glint/template@1.5.2)(webpack@5.101.0) - ember-cli-babel: 7.26.11 - ember-cli-typescript: 5.3.0 - ember-get-config: 2.1.1(@glint/template@1.5.2) - prop-types: 15.8.1 - transitivePeerDependencies: - - '@glint/template' - - supports-color - - webpack - ember-assign-helper@0.5.0(ember-source@6.4.0(@glimmer/component@2.0.0)(rsvp@4.8.5)): dependencies: '@embroider/addon-shim': 1.10.0 @@ -18675,23 +18661,6 @@ snapshots: transitivePeerDependencies: - supports-color - ember-cli-clipboard@1.3.0(@babel/core@7.28.0)(@ember/test-helpers@5.4.0(@babel/core@7.28.0)(@glint/template@1.5.2))(@glint/template@1.5.2)(webpack@5.101.0): - dependencies: - '@ember/test-helpers': 5.4.0(@babel/core@7.28.0)(@glint/template@1.5.2) - '@embroider/macros': 1.18.1(@glint/template@1.5.2) - clipboard: 2.0.11 - ember-arg-types: 1.1.0(@glint/template@1.5.2)(webpack@5.101.0) - ember-auto-import: 2.10.0(@glint/template@1.5.2)(webpack@5.101.0) - ember-cli-babel: 7.26.11 - ember-cli-htmlbars: 6.3.0 - ember-modifier: 4.2.2(@babel/core@7.28.0) - prop-types: 15.8.1 - transitivePeerDependencies: - - '@babel/core' - - '@glint/template' - - supports-color - - webpack - ember-cli-dependency-checker@3.3.3(ember-cli@6.4.0(babel-core@6.26.3)(handlebars@4.7.8)(underscore@1.13.7)): dependencies: chalk: 2.4.2 @@ -19235,6 +19204,20 @@ snapshots: - '@babel/core' - supports-color + ember-concurrency@3.1.1(@babel/core@7.28.0)(ember-source@6.4.0(@glimmer/component@2.0.0)(rsvp@4.8.5)): + dependencies: + '@babel/helper-plugin-utils': 7.27.1 + '@babel/types': 7.28.2 + '@glimmer/tracking': 1.1.2 + ember-cli-babel: 7.26.11 + ember-cli-babel-plugin-helpers: 1.1.1 + ember-cli-htmlbars: 6.3.0 + ember-compatibility-helpers: 1.2.7(@babel/core@7.28.0) + ember-source: 6.4.0(@glimmer/component@2.0.0)(rsvp@4.8.5) + transitivePeerDependencies: + - '@babel/core' + - supports-color + ember-concurrency@4.0.4(@babel/core@7.28.0)(@glint/template@1.5.2): dependencies: '@babel/helper-module-imports': 7.27.1 @@ -19349,14 +19332,6 @@ snapshots: transitivePeerDependencies: - supports-color - ember-get-config@2.1.1(@glint/template@1.5.2): - dependencies: - '@embroider/macros': 1.18.1(@glint/template@1.5.2) - ember-cli-babel: 7.26.11 - transitivePeerDependencies: - - '@glint/template' - - supports-color - ember-in-element-polyfill@1.0.1: dependencies: debug: 4.4.1 @@ -19623,6 +19598,18 @@ snapshots: - '@babel/core' - supports-color + ember-shiki@0.3.0(@babel/core@7.28.0)(ember-source@6.4.0(@glimmer/component@2.0.0)(rsvp@4.8.5)): + dependencies: + '@embroider/addon-shim': 1.10.0 + ember-concurrency: 3.1.1(@babel/core@7.28.0)(ember-source@6.4.0(@glimmer/component@2.0.0)(rsvp@4.8.5)) + ember-functions-as-helper-polyfill: 2.1.3(ember-source@6.4.0(@glimmer/component@2.0.0)(rsvp@4.8.5)) + ember-modifier: 4.2.2(@babel/core@7.28.0) + ember-source: 6.4.0(@glimmer/component@2.0.0)(rsvp@4.8.5) + shiki: 0.14.7 + transitivePeerDependencies: + - '@babel/core' + - supports-color + ember-source-channel-url@3.0.0: dependencies: node-fetch: 2.7.0 @@ -21228,10 +21215,6 @@ snapshots: dependencies: minimist: 1.2.8 - good-listener@1.2.2: - dependencies: - delegate: 3.2.0 - gopd@1.2.0: {} got@9.6.0: @@ -22504,6 +22487,8 @@ snapshots: inflected: 1.1.7 lodash: 4.17.21 + jsonc-parser@3.3.1: {} + jsonfile@2.4.0: optionalDependencies: graceful-fs: 4.2.11 @@ -24083,12 +24068,6 @@ snapshots: kleur: 3.0.3 sisteransi: 1.0.5 - prop-types@15.8.1: - dependencies: - loose-envify: 1.4.0 - object-assign: 4.1.1 - react-is: 16.13.1 - proper-lockfile@4.1.2: dependencies: graceful-fs: 4.2.11 @@ -24186,8 +24165,6 @@ snapshots: minimist: 1.2.8 strip-json-comments: 2.0.1 - react-is@16.13.1: {} - react-is@18.3.1: {} read-pkg-up@3.0.0: @@ -24791,8 +24768,6 @@ snapshots: extend-shallow: 2.0.1 kind-of: 6.0.3 - select@1.1.2: {} - semver@5.7.2: {} semver@6.3.1: {} @@ -24885,6 +24860,13 @@ snapshots: shellwords@0.1.1: {} + shiki@0.14.7: + dependencies: + ansi-sequence-parser: 1.1.3 + jsonc-parser: 3.3.1 + vscode-oniguruma: 1.7.0 + vscode-textmate: 8.0.0 + showdown@2.1.0: dependencies: commander: 9.5.0 @@ -25749,8 +25731,6 @@ snapshots: time-zone@1.0.0: {} - tiny-emitter@2.1.0: {} - tiny-glob@0.2.9: dependencies: globalyzer: 0.1.0 @@ -26283,6 +26263,10 @@ snapshots: dependencies: vscode-languageserver-protocol: 3.17.3 + vscode-oniguruma@1.7.0: {} + + vscode-textmate@8.0.0: {} + vscode-uri@3.1.0: {} w3c-hr-time@1.0.2: diff --git a/website/.prettierignore b/website/.prettierignore index 6f6775cd3ad..7af6438b891 100644 --- a/website/.prettierignore +++ b/website/.prettierignore @@ -14,4 +14,5 @@ ember-cli-update.json *.scss # temporary ignore -/docs/ +/docs/**/*.md +/docs/**/*.js diff --git a/website/app/components/doc/code-group/index.gts b/website/app/components/doc/code-group/index.gts new file mode 100644 index 00000000000..773bfa25b96 --- /dev/null +++ b/website/app/components/doc/code-group/index.gts @@ -0,0 +1,216 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: MPL-2.0 + */ +import Component from '@glimmer/component'; +import { CodeBlock } from 'ember-shiki'; +import { tracked } from '@glimmer/tracking'; +import { on } from '@ember/modifier'; +import { notEq, eq } from 'ember-truth-helpers'; +import { guidFor } from '@ember/object/internals'; + +import { HdsIcon } from '@hashicorp/design-system-components/components'; +import type { HdsIconSignature } from '@hashicorp/design-system-components/components/hds/icon/index'; + +import DynamicTemplate from 'website/components/dynamic-template'; +import docClipboard from 'website/modifiers/doc-clipboard'; + +interface DocCodeGroupSignature { + Args: { + filename?: string; + hbsSnippet: string; + gtsSnippet: string; + hidePreview?: boolean; + }; + Blocks: { + default: []; + }; + Element: HTMLDivElement; +} + +// Helper to undo code escaping for display +const unescapeCode = (code: string) => { + return code.replace(/\\n/g, '\n'); +}; + +export default class DocCodeGroup extends Component { + @tracked currentView = 'hbs'; + @tracked isExpanded = false; + @tracked copyStatus = 'idle'; + @tracked copyTimer: ReturnType | undefined; + @tracked copyIconName: HdsIconSignature['Args']['name'] = 'clipboard-copy'; + @tracked expandIconName: HdsIconSignature['Args']['name'] = 'unfold-open'; + + componentId = guidFor(this); + + get unescapedHbsSnippet() { + return unescapeCode(this.args.hbsSnippet); + } + + get unescapedGtsSnippet() { + return unescapeCode(this.args.gtsSnippet); + } + + get gtsSnippet() { + if (this.isExpanded) { + return this.unescapedGtsSnippet; + } + + // When not expanded, show a short GTS-like version of the HBS snippet + return this.unescapedHbsSnippet.replace(/::/g, '').trim(); + } + + get toggleButtonLabel() { + return this.isExpanded ? 'Collapse code' : 'Expand code'; + } + + get language() { + if (this.currentView === 'gts' && this.isExpanded) { + return 'gts'; + } + + return 'hbs'; + } + + get currentViewSnippet() { + return this.currentView === 'hbs' + ? this.unescapedHbsSnippet + : this.gtsSnippet; + } + + get copyButtonLabel() { + let label; + switch (this.copyStatus) { + case 'success': + label = 'Copied'; + break; + case 'error': + label = 'Error'; + break; + default: + label = 'Copy'; + break; + } + return label; + } + + get copyButtonClassNames() { + const classNames = ['doc-code-group__copy-button']; + if (this.copyStatus === 'success') { + classNames.push('doc-code-group__copy-button--status-success'); + } else if (this.copyStatus === 'error') { + classNames.push('doc-code-group__copy-button--status-error'); + } + return classNames.join(' '); + } + + handleGtsExpandClick = () => { + this.isExpanded = !this.isExpanded; + this.expandIconName = this.isExpanded ? 'unfold-close' : 'unfold-open'; + }; + + handleLanguageChange = (event: Event) => { + const input = event.target as HTMLInputElement; + if (input.checked) { + this.currentView = input.value; + } + }; + + onSuccess = () => { + this.copyStatus = 'success'; + this.copyIconName = 'clipboard-checked'; + this.resetStatusDelayed(); + }; + + onError = () => { + this.copyStatus = 'error'; + this.copyIconName = 'alert-triangle'; + this.resetStatusDelayed(); + }; + + resetStatusDelayed() { + clearTimeout(this.copyTimer); + // make it fade back to the default state + this.copyTimer = setTimeout(() => { + this.copyStatus = 'idle'; + this.copyIconName = 'clipboard-copy'; + }, 2000); + } + + +} diff --git a/website/app/components/doc/copy-button/index.js b/website/app/components/doc/copy-button/index.gts similarity index 55% rename from website/app/components/doc/copy-button/index.js rename to website/app/components/doc/copy-button/index.gts index d2f5b349abb..c0ea4cc8e02 100644 --- a/website/app/components/doc/copy-button/index.js +++ b/website/app/components/doc/copy-button/index.gts @@ -2,15 +2,33 @@ * Copyright (c) HashiCorp, Inc. * SPDX-License-Identifier: MPL-2.0 */ - import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; -import { action } from '@ember/object'; -export default class DocCopyButtonComponent extends Component { +import { HdsIcon } from '@hashicorp/design-system-components/components'; +import type { HdsIconSignature } from '@hashicorp/design-system-components/components/hds/icon/index'; + +import docClipboard from 'website/modifiers/doc-clipboard'; + +interface DocCopyButtonCodeSignature { + Args: { + type?: 'solid' | 'ghost'; + textToCopy: string; + textToShow?: string; + encoded?: boolean; + isFullWidth?: boolean; + id?: string; + }; + Blocks: { + default: []; + }; + Element: HTMLButtonElement; +} + +export default class DocCopyButton extends Component { @tracked status = 'idle'; - @tracked iconName = 'clipboard-copy'; - @tracked timer; + @tracked iconName: HdsIconSignature['Args']['name'] = 'clipboard-copy'; + @tracked timer: ReturnType | undefined; get type() { return this.args.type ?? 'solid'; // options are `solid` or `ghost` @@ -58,19 +76,17 @@ export default class DocCopyButtonComponent extends Component { return this.args.isFullWidth ?? false; } - @action - onSuccess() { + onSuccess = () => { this.status = 'success'; this.iconName = 'clipboard-checked'; this.resetStatusDelayed(); - } + }; - @action - onError() { + onError = () => { this.status = 'error'; this.iconName = 'alert-triangle'; this.resetStatusDelayed(); - } + }; resetStatusDelayed() { clearTimeout(this.timer); @@ -82,11 +98,38 @@ export default class DocCopyButtonComponent extends Component { } get classNames() { - let classes = ['doc-copy-button']; + const classes = ['doc-copy-button']; classes.push(`doc-copy-button--type-${this.type}`); if (this.isFullWidth) { classes.push(`doc-copy-button--width-full`); } return classes.join(' '); } + + } diff --git a/website/app/components/doc/copy-button/index.hbs b/website/app/components/doc/copy-button/index.hbs deleted file mode 100644 index a1203142df1..00000000000 --- a/website/app/components/doc/copy-button/index.hbs +++ /dev/null @@ -1,20 +0,0 @@ -{{! - Copyright (c) HashiCorp, Inc. - SPDX-License-Identifier: MPL-2.0 -}} - - - {{#if this.textToShow}} - {{this.textToShow}} - {{/if}} - {{#if this.label}} - {{this.label}} - {{/if}} - - \ No newline at end of file diff --git a/website/app/components/doc/meta-row.gts b/website/app/components/doc/meta-row.gts index daebbd89886..37181a223db 100644 --- a/website/app/components/doc/meta-row.gts +++ b/website/app/components/doc/meta-row.gts @@ -26,6 +26,7 @@ const DocMetaRow: TemplateOnlyComponent =