@haxtheweb/d-d-d
Advanced tools
Comparing version 9.0.1 to 9.0.2
@@ -6,3 +6,3 @@ { | ||
"name": "d-d-docs", | ||
"description": "Attributes:\n\n * `option` {`string`} - \n\n * `options` {`any[]`} - \n\n * `accent-color` {`string`} - a selected accent-\"color\": grey, red, pink, purple, etc.\n\n * `dark` {`boolean`} - make the default theme dark?\n\nProperties:\n\n * `option` {`string`} - \n\n * `options` {`any[]`} - \n\n * `accentColor` {`string`} - a selected accent-\"color\": grey, red, pink, purple, etc.\n\n * `dark` {`boolean`} - make the default theme dark?\n\n * `colors` - ", | ||
"description": "Attributes:\n\n * `option` {`string`} - \n\n * `options` {`any[]`} - \n\n * `is-safari` {`boolean`} - \n\n * `accent-color` {`string`} - a selected accent-\"color\": grey, red, pink, purple, etc.\n\n * `dark` {`boolean`} - make the default theme dark?\n\nProperties:\n\n * `option` {`string`} - \n\n * `options` {`any[]`} - \n\n * `isSafari` {`boolean`} - \n\n * `accentColor` {`string`} - a selected accent-\"color\": grey, red, pink, purple, etc.\n\n * `dark` {`boolean`} - make the default theme dark?\n\n * `colors` - ", | ||
"attributes": [ | ||
@@ -18,17 +18,7 @@ { | ||
{ | ||
"name": "accent-color", | ||
"description": "`accent-color` {`string`} - a selected accent-\"color\": grey, red, pink, purple, etc.\n\nProperty: accentColor\n\nDefault: grey" | ||
"name": "is-safari", | ||
"description": "`is-safari` {`boolean`} - \n\nProperty: isSafari", | ||
"valueSet": "v" | ||
}, | ||
{ | ||
"name": "dark", | ||
"description": "`dark` {`boolean`} - make the default theme dark?\n\nProperty: dark\n\nDefault: false", | ||
"valueSet": "v" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "mini-map", | ||
"description": "Events:\n\n * `simple-modal-show` {`CustomEvent<{ elements: { content: HTMLDivElement; }; invokedBy: HTMLButtonElement; clone: boolean; onShow: () => void; }>`} - \n\n * `simple-modal-hide` {`CustomEvent<any>`} - \n\nAttributes:\n\n * `accent-color` {`string`} - a selected accent-\"color\": grey, red, pink, purple, etc.\n\n * `dark` {`boolean`} - make the default theme dark?\n\nProperties:\n\n * `properties` {`{ gridSize: { type: NumberConstructor; }; nodeList: { type: ArrayConstructor; }; lineList: { type: ArrayConstructor; }; activeNode: { ...; }; availableNodes: { ...; }; }`} - \n\n * `gridSize` {`number`} - \n\n * `nodeList` {`never[]`} - \n\n * `lineList` {`never[]`} - \n\n * `activeNode` - \n\n * `availableNodes` {`never[]`} - \n\n * `accentColor` {`string`} - a selected accent-\"color\": grey, red, pink, purple, etc.\n\n * `dark` {`boolean`} - make the default theme dark?\n\n * `colors` - ", | ||
"attributes": [ | ||
{ | ||
"name": "accent-color", | ||
@@ -41,10 +31,2 @@ "description": "`accent-color` {`string`} - a selected accent-\"color\": grey, red, pink, purple, etc.\n\nProperty: accentColor\n\nDefault: grey" | ||
"valueSet": "v" | ||
}, | ||
{ | ||
"name": "onsimple-modal-show", | ||
"description": "`simple-modal-show` {`CustomEvent<{ elements: { content: HTMLDivElement; }; invokedBy: HTMLButtonElement; clone: boolean; onShow: () => void; }>`} - " | ||
}, | ||
{ | ||
"name": "onsimple-modal-hide", | ||
"description": "`simple-modal-hide` {`CustomEvent<any>`} - " | ||
} | ||
@@ -51,0 +33,0 @@ ] |
13
d-d-d.js
@@ -44,3 +44,3 @@ /** | ||
console.warn("Adding dropCap-noSupport class"); | ||
document.body.classList.add("dropCap-noSupport"); | ||
globalThis.document.body.classList.add("dropCap-noSupport"); | ||
} | ||
@@ -157,3 +157,7 @@ } | ||
globalThis.DDDSharedStyles.requestAvailability = () => { | ||
if (globalThis.DDDSharedStyles.instance == null) { | ||
if ( | ||
globalThis.DDDSharedStyles.instance == null && | ||
globalThis.document && | ||
globalThis.document.head | ||
) { | ||
// convert css into text content of arrays mashed together | ||
@@ -178,5 +182,4 @@ // this way we can inject it into a global style sheet | ||
globalThis.DDDSharedStyles.instance = adoptableDDD; | ||
} | ||
catch(e) { | ||
const oldStyleSafariBs = document.createElement('style'); | ||
} catch (e) { | ||
const oldStyleSafariBs = globalThis.document.createElement("style"); | ||
oldStyleSafariBs.innerHTML = globalStyles; | ||
@@ -183,0 +186,0 @@ globalThis.document.head.appendChild(oldStyleSafariBs); |
@@ -94,3 +94,3 @@ import { css, html } from "lit"; | ||
showModal(id) { | ||
const c = document.createElement("div"); | ||
const c = globalThis.document.createElement("div"); | ||
c.classList.add("modal-form"); | ||
@@ -151,3 +151,3 @@ const nodeExists = this.nodeList ? this.nodeList.includes(id) : false; | ||
const saveButton = document.createElement("button"); | ||
const saveButton = globalThis.document.createElement("button"); | ||
saveButton.id = "nodeSaveBtn"; | ||
@@ -157,3 +157,3 @@ saveButton.textContent = "Save"; | ||
const cancelButton = document.createElement("button"); | ||
const cancelButton = globalThis.document.createElement("button"); | ||
cancelButton.id = "nodeCancelBtn"; | ||
@@ -163,3 +163,3 @@ cancelButton.textContent = "Cancel"; | ||
const deleteButton = document.createElement("button"); | ||
const deleteButton = globalThis.document.createElement("button"); | ||
deleteButton.id = "nodeDeleteBtn"; | ||
@@ -185,3 +185,3 @@ deleteButton.textContent = "Delete"; | ||
document.addEventListener("simple-modal-opened", (e) => { | ||
globalThis.document.addEventListener("simple-modal-opened", (e) => { | ||
console.log("Modal opened", e); | ||
@@ -212,6 +212,6 @@ this.addModalListeners(); | ||
saveNode() { | ||
const type = document.querySelector("#node-input-type").value; | ||
const name = document.querySelector("#node-input-name").value; | ||
const url = document.querySelector("#node-input-url").value; | ||
const id = document.querySelector("#node-input-id").innerText; | ||
const type = globalThis.document.querySelector("#node-input-type").value; | ||
const name = globalThis.document.querySelector("#node-input-name").value; | ||
const url = globalThis.document.querySelector("#node-input-url").value; | ||
const id = globalThis.document.querySelector("#node-input-id").innerText; | ||
console.log(id, type, name, url); | ||
@@ -233,12 +233,14 @@ this.nodeList = this.nodeList ? this.nodeList : []; | ||
} else { | ||
document.querySelector("mini-map").nodeList.push(id); | ||
document.querySelector("mini-map").addNode(id, type, name, url); | ||
globalThis.document.querySelector("mini-map").nodeList.push(id); | ||
globalThis.document | ||
.querySelector("mini-map") | ||
.addNode(id, type, name, url); | ||
} | ||
document.querySelector("mini-map").closeModal(); | ||
globalThis.document.querySelector("mini-map").closeModal(); | ||
} | ||
async addNode(id, type, name, url) { | ||
const miniMap = document.querySelector("mini-map").shadowRoot; | ||
const miniMap = globalThis.document.querySelector("mini-map").shadowRoot; | ||
const cell = miniMap.querySelector(`#cell-${id}`); | ||
const node = document.createElement("a"); | ||
const node = globalThis.document.createElement("a"); | ||
node.classList.add("node"); | ||
@@ -297,2 +299,2 @@ node.classList.add(`node-${type}`); | ||
window.customElements.define("mini-map", MiniMap); | ||
globalThis.customElements.define("mini-map", MiniMap); |
@@ -12,3 +12,2 @@ { | ||
"css": "src/d-d-d.css", | ||
"scss": "src/d-d-d.scss", | ||
"html": "src/d-d-d.html", | ||
@@ -24,3 +23,3 @@ "js": "src/d-d-d.js", | ||
}, | ||
"version": "9.0.1", | ||
"version": "9.0.2", | ||
"description": "design, develop, destroy the competition", | ||
@@ -31,2 +30,3 @@ "repository": { | ||
}, | ||
"type": "module", | ||
"main": "d-d-d.js", | ||
@@ -50,9 +50,9 @@ "module": "d-d-d.js", | ||
"dependencies": { | ||
"@haxtheweb/hax-iconset": "^9.0.1", | ||
"@haxtheweb/simple-colors": "^9.0.1", | ||
"@haxtheweb/simple-icon": "^9.0.1", | ||
"@haxtheweb/hax-iconset": "^9.0.2", | ||
"@haxtheweb/simple-colors": "^9.0.2", | ||
"@haxtheweb/simple-icon": "^9.0.2", | ||
"lit": "^3.1.4" | ||
}, | ||
"devDependencies": { | ||
"@haxtheweb/deduping-fix": "^9.0.1", | ||
"@haxtheweb/deduping-fix": "^9.0.2", | ||
"@open-wc/testing": "4.0.0", | ||
@@ -78,3 +78,3 @@ "@polymer/iron-component-page": "github:PolymerElements/iron-component-page", | ||
], | ||
"gitHead": "7f62cde6a6242afcb57715e1e2067ea767c777fd" | ||
"gitHead": "f528e4aac8aeadf5350d9262fb515d14d208e376" | ||
} |
@@ -44,3 +44,3 @@ /** | ||
console.warn("Adding dropCap-noSupport class"); | ||
document.body.classList.add("dropCap-noSupport"); | ||
globalThis.document.body.classList.add("dropCap-noSupport"); | ||
} | ||
@@ -157,3 +157,7 @@ } | ||
globalThis.DDDSharedStyles.requestAvailability = () => { | ||
if (globalThis.DDDSharedStyles.instance == null) { | ||
if ( | ||
globalThis.DDDSharedStyles.instance == null && | ||
globalThis.document && | ||
globalThis.document.head | ||
) { | ||
// convert css into text content of arrays mashed together | ||
@@ -178,5 +182,4 @@ // this way we can inject it into a global style sheet | ||
globalThis.DDDSharedStyles.instance = adoptableDDD; | ||
} | ||
catch(e) { | ||
const oldStyleSafariBs = document.createElement('style'); | ||
} catch (e) { | ||
const oldStyleSafariBs = globalThis.document.createElement("style"); | ||
oldStyleSafariBs.innerHTML = globalStyles; | ||
@@ -183,0 +186,0 @@ globalThis.document.head.appendChild(oldStyleSafariBs); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
260380
23
8405
Yes