Skip to content

Commit 578e6c6

Browse files
committed
1 parent acb0969 commit 578e6c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2376
-910
lines changed

elements/clean-one/clean-one.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,8 +816,9 @@ class CleanOne extends LTIResizingMixin(
816816
}, 0);
817817
});
818818
}
819-
let DesignSystemManager = globalThis.DesignSystemManager.requestAvailability();
820-
DesignSystemManager.active = 'ddd';
819+
let DesignSystemManager =
820+
globalThis.DesignSystemManager.requestAvailability();
821+
DesignSystemManager.active = "ddd";
821822
}
822823
/**
823824
* life cycle, element is removed from the DOM

elements/clean-one/src/clean-one.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,8 +816,9 @@ class CleanOne extends LTIResizingMixin(
816816
}, 0);
817817
});
818818
}
819-
let DesignSystemManager = globalThis.DesignSystemManager.requestAvailability();
820-
DesignSystemManager.active = 'ddd';
819+
let DesignSystemManager =
820+
globalThis.DesignSystemManager.requestAvailability();
821+
DesignSystemManager.active = "ddd";
821822
}
822823
/**
823824
* life cycle, element is removed from the DOM

elements/clean-two/clean-two.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,9 @@ class CleanTwo extends LTIResizingMixin(
645645
// shadow ready which means we should be able to open this even on a slow load
646646
// if we are the route in question
647647
store.internalRoutes["search"].callback = this.siteModalForceClick;
648-
let DesignSystemManager = globalThis.DesignSystemManager.requestAvailability();
649-
DesignSystemManager.active = 'ddd';
648+
let DesignSystemManager =
649+
globalThis.DesignSystemManager.requestAvailability();
650+
DesignSystemManager.active = "ddd";
650651
}
651652

652653
searchItemSelected(e) {

elements/clean-two/src/clean-two.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,9 @@ class CleanTwo extends LTIResizingMixin(
645645
// shadow ready which means we should be able to open this even on a slow load
646646
// if we are the route in question
647647
store.internalRoutes["search"].callback = this.siteModalForceClick;
648-
let DesignSystemManager = globalThis.DesignSystemManager.requestAvailability();
649-
DesignSystemManager.active = 'ddd';
648+
let DesignSystemManager =
649+
globalThis.DesignSystemManager.requestAvailability();
650+
DesignSystemManager.active = "ddd";
650651
}
651652

652653
searchItemSelected(e) {

elements/course-model/course-model.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,9 @@ class CourseModel extends LitElement {
145145
if (globalThis.HaxStore) {
146146
globalThis.ModelViewerController = new AbortController();
147147
globalThis.addEventListener(
148-
"hax-insert-content", (e) => {
149-
if (e.detail.tag === 'model-viewer') {
148+
"hax-insert-content",
149+
(e) => {
150+
if (e.detail.tag === "model-viewer") {
150151
// import when something gets inserted that matches the model
151152
// this is because the library is memory intense even for editing users
152153
import("@google/model-viewer/dist/model-viewer.js");
@@ -364,7 +365,7 @@ class CourseModel extends LitElement {
364365

365366
firstUpdated(changedProperties) {
366367
if (super.firstUpdated) {
367-
super.firstUpdated(changedProperties)
368+
super.firstUpdated(changedProperties);
368369
}
369370
// this is a heavy library in memory so import if we actually are rendering
370371
import("@google/model-viewer/dist/model-viewer.js");

elements/course-model/src/course-model.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,9 @@ class CourseModel extends LitElement {
145145
if (globalThis.HaxStore) {
146146
globalThis.ModelViewerController = new AbortController();
147147
globalThis.addEventListener(
148-
"hax-insert-content", (e) => {
149-
if (e.detail.tag === 'model-viewer') {
148+
"hax-insert-content",
149+
(e) => {
150+
if (e.detail.tag === "model-viewer") {
150151
// import when something gets inserted that matches the model
151152
// this is because the library is memory intense even for editing users
152153
import("@google/model-viewer/dist/model-viewer.js");
@@ -364,7 +365,7 @@ class CourseModel extends LitElement {
364365

365366
firstUpdated(changedProperties) {
366367
if (super.firstUpdated) {
367-
super.firstUpdated(changedProperties)
368+
super.firstUpdated(changedProperties);
368369
}
369370
// this is a heavy library in memory so import if we actually are rendering
370371
import("@google/model-viewer/dist/model-viewer.js");

elements/d-d-d/custom-elements.json

Lines changed: 684 additions & 40 deletions
Large diffs are not rendered by default.

elements/d-d-d/d-d-d.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
DDDDataAttributes,
1414
ApplicationAttributeData,
1515
} from "./lib/DDDStyles.js";
16-
import {DesignSystemManager} from "./lib/DesignSystemManager.js";
16+
import { DesignSystemManager } from "./lib/DesignSystemManager.js";
1717

1818
/**
1919
* `d-d-d`
@@ -93,7 +93,7 @@ export const DDDSuper = function (SuperClass) {
9393
name: "ddd",
9494
styles: DDDAllStyles,
9595
fonts: DDDFonts,
96-
onload: () =>{
96+
onload: () => {
9797
// check for css feature support
9898
if (!CSS.supports("initial-letter", "1")) {
9999
console.warn("CSS feature: initial-letter not supported");
@@ -103,7 +103,7 @@ export const DDDSuper = function (SuperClass) {
103103
},
104104
hax: true,
105105
});
106-
DesignSystemManager.active = 'ddd';
106+
DesignSystemManager.active = "ddd";
107107
}
108108
}
109109
static get properties() {

elements/d-d-d/lib/DesignSystemManager.js

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,33 @@ export class DesignSystem extends LitElement {
1414
this.systems = [];
1515
}
1616
static get tag() {
17-
return 'design-system';
17+
return "design-system";
1818
}
1919

2020
static get properties() {
2121
return {
2222
active: { type: String },
2323
systems: { type: Object },
24-
}
24+
};
2525
}
2626

2727
updated(changedProperties) {
2828
if (super.updated) {
2929
super.updated(changedProperties);
3030
}
3131
changedProperties.forEach((oldValue, propName) => {
32-
if (propName === 'active' && this[propName]) {
32+
if (propName === "active" && this[propName]) {
3333
// remove the current global stylesheet / adopted styles for the design system
3434
// replace it with the new active one
35-
if (this.systems[this.active] && globalThis.document && globalThis.document.head) {
36-
this.applyDesignSystem(oldValue ? this.systems[oldValue] : null, this.systems[this.active]);
35+
if (
36+
this.systems[this.active] &&
37+
globalThis.document &&
38+
globalThis.document.head
39+
) {
40+
this.applyDesignSystem(
41+
oldValue ? this.systems[oldValue] : null,
42+
this.systems[this.active],
43+
);
3744
}
3845
}
3946
});
@@ -57,16 +64,17 @@ export class DesignSystem extends LitElement {
5764
}
5865
});
5966
}
60-
6167
} catch (e) {
6268
const oldStyleSafariBs = globalThis.document.createElement("style");
6369
oldStyleSafariBs.innerHTML = globalStyles;
6470
globalThis.document.head.appendChild(oldStyleSafariBs);
6571
}
6672
if (oldSystem.fonts) {
67-
globalThis.document.head.querySelectorAll('[data-ds]').forEach((font) => {
68-
font.remove();
69-
});
73+
globalThis.document.head
74+
.querySelectorAll("[data-ds]")
75+
.forEach((font) => {
76+
font.remove();
77+
});
7078
}
7179
if (oldSystem.onload) {
7280
globalThis.document.onload = null;
@@ -76,9 +84,9 @@ export class DesignSystem extends LitElement {
7684
if (newSystem) {
7785
// convert css into text content of arrays mashed together
7886
// this way we can inject it into a global style sheet
79-
let globalStyles = newSystem.styles.map((st) =>
80-
st.cssText ? st.cssText : "",
81-
).join("");
87+
let globalStyles = newSystem.styles
88+
.map((st) => (st.cssText ? st.cssText : ""))
89+
.join("");
8290
try {
8391
const adoptableDS = new CSSStyleSheet();
8492
// flag it so we can remove it later
@@ -118,15 +126,19 @@ export class DesignSystem extends LitElement {
118126

119127
globalThis.customElements.define(DesignSystem.tag, DesignSystem);
120128

121-
122129
globalThis.DesignSystemManager = globalThis.DesignSystemManager || {};
123130
globalThis.DesignSystemManager.requestAvailability = () => {
124-
if (!globalThis.DesignSystemManager.instance && globalThis.document && globalThis.document.body) {
125-
let ds = globalThis.document.createElement('design-system');
131+
if (
132+
!globalThis.DesignSystemManager.instance &&
133+
globalThis.document &&
134+
globalThis.document.body
135+
) {
136+
let ds = globalThis.document.createElement("design-system");
126137
globalThis.document.body.appendChild(ds);
127138
globalThis.DesignSystemManager.instance = ds;
128139
}
129140
return globalThis.DesignSystemManager.instance;
130141
};
131142

132-
export const DesignSystemManager = globalThis.DesignSystemManager.requestAvailability();
143+
export const DesignSystemManager =
144+
globalThis.DesignSystemManager.requestAvailability();

elements/d-d-d/lib/ddd-card.haxProperties.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@
106106
"title": "Title",
107107
"link": "https://hax.cloud"
108108
},
109-
"content":
110-
"<p>The card content</p>"
109+
"content": "<p>The card content</p>"
111110
}
112111
]
113-
}
112+
}

0 commit comments

Comments
 (0)