Skip to content

Commit

Permalink
Merge pull request #1614 from mkszepp/drop-outdated-dev-dependencies
Browse files Browse the repository at this point in the history
Drop outdated devDependencies
  • Loading branch information
mkszepp authored Dec 6, 2023
2 parents f547046 + 053081d commit bd5bee4
Show file tree
Hide file tree
Showing 6 changed files with 620 additions and 22,685 deletions.
23,197 changes: 517 additions & 22,680 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,13 @@
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-cli": "~4.12.1",
"ember-cli-blueprint-test-helpers": "^0.19.2",
"ember-cli-dependency-checker": "^3.3.1",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-mirage": "^3.0.0",
"ember-cli-sass": "^11.0.1",
"ember-cli-terser": "^4.0.2",
"ember-cli-typescript-blueprints": "^3.0.0",
"ember-code-example-component": "^0.4.1",
"ember-code-snippet": "git+https://git@github.com/ef4/ember-code-snippet.git#d054b697098ad52481c94a952ccf8d89ba1f25fe",
"ember-data": "~4.12.0",
"ember-disable-prototype-extensions": "^1.1.3",
"ember-href-to": "^5.0.0",
"ember-load-initializers": "^2.1.2",
"ember-prism": "^0.13.0",
Expand Down
21 changes: 21 additions & 0 deletions tests/dummy/app/components/code-example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';

export default class CodeExampleComponent extends Component {
showResult = true;
@tracked _activeTab = undefined;

get activeTab() {
return this._activeTab || (this.showResult ? 'result' : 'js');
}

get partialName() {
return `snippets/${this.args.hbs.replace('.hbs', '')}`;
}

@action
setActiveTab(value) {
this._activeTab = value;
}
}
4 changes: 3 additions & 1 deletion tests/dummy/app/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
@import 'components/side-nav';
@import 'components/docs';
@import 'components/cookbook';
@import 'ember-code-example';

// Docs
@import 'docs/code-example';
@include ember-code-example($brand-color);

// Legacy demo
Expand Down
35 changes: 35 additions & 0 deletions tests/dummy/app/styles/docs/code-example.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Docs
.code-example {
margin-bottom: 1rem;
}

.code-example-tabs {
display: flex;
}
.code-example-tab {
padding: 0.2rem 0.5rem;
background-color: white;
text-transform: capitalize;
&:not(.active) {
color: #999;
cursor: pointer;
}
&.active {
cursor: normal;
}
}
.code-example-snippet {
margin-bottom: 0;
background-color: #f9f9f9;
padding: 1rem;
&:not(.active) {
display: none;
}
}

@mixin ember-code-example($color) {
.code-example-tab.active {
border-bottom: 2px solid $color;
color: $color;
}
}
44 changes: 44 additions & 0 deletions tests/dummy/app/templates/components/code-example.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<article class="code-example" ...attributes>
<nav class="code-example-tabs">
{{#if @hbs}}
<div class="code-example-tab {{if (eq this.activeTab "hbs") 'active'}}" role="button" {{on "click" (fn this.setActiveTab "hbs")}}>Template</div>
{{/if}}
{{#if @hbs2}}
<div class="code-example-tab {{if (eq this.activeTab "hbs2") 'active'}}" role="button" {{on "click" (fn this.setActiveTab "hbs2")}}>Template 2</div>
{{/if}}
{{#if @js}}
<div class="code-example-tab {{if (eq this.activeTab "js") 'active'}}" role="button" {{on "click" (fn this.setActiveTab "js")}}>Javascript</div>
{{/if}}
{{#if @css}}
<div class="code-example-tab {{if (eq this.activeTab "css") 'active'}}" role="button" {{on "click" (fn this.setActiveTab "css")}}>CSS</div>
{{/if}}
{{#if this.showResult}}
<div class="code-example-tab {{if (eq this.activeTab "result") 'active'}}" role="button" {{on "click" (fn this.setActiveTab "result")}}>Result</div>
{{/if}}
</nav>
{{#if (and @hbs (eq this.activeTab 'hbs'))}}
{{#let (get-code-snippet @hbs) as |snippet|}}
<CodeBlock @language="markup" @code={{snippet.source}} />
{{/let}}
{{/if}}
{{#if @hbs2}}
{{#let (get-code-snippet @hbs2) as |snippet|}}
<CodeBlock @language="markup" @code={{snippet.source}} />
{{/let}}
{{/if}}
{{#if (and @js (eq this.activeTab 'js'))}}
{{#let (get-code-snippet @js) as |snippet|}}
<CodeBlock @language={{snippet.language}} @code={{snippet.source}} />
{{/let}}
{{/if}}
{{#if (and @css (eq this.activeTab 'css'))}}
{{#let (get-code-snippet @css) as |snippet|}}
<CodeBlock @language={{snippet.language}} @code={{snippet.source}} />
{{/let}}
{{/if}}
{{#if (and this.showResult (has-block))}}
<div class="code-example-snippet result {{if (eq this.activeTab 'result') 'active'}}">
{{yield this.partialName}}
</div>
{{/if}}
</article>

0 comments on commit bd5bee4

Please sign in to comment.