@star-this/starwind-prose-print 0.1.0 → 0.1.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/package.json
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var __typeError = (msg) => {
|
|
2
|
+
throw TypeError(msg);
|
|
3
|
+
};
|
|
4
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
5
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
6
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
7
|
+
|
|
8
|
+
// src/starwind.layout.prose-print.js
|
|
9
|
+
function defineElement(tagName, elementClass) {
|
|
10
|
+
if (!customElements.get(tagName)) {
|
|
11
|
+
customElements.define(tagName, elementClass);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function setOrRemoveClass(el, className, on) {
|
|
15
|
+
if (on) el.classList.add(className);
|
|
16
|
+
else el.classList.remove(className);
|
|
17
|
+
}
|
|
18
|
+
var _SwProsePrint_instances, apply_fn;
|
|
19
|
+
var SwProsePrint = class extends HTMLElement {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
__privateAdd(this, _SwProsePrint_instances);
|
|
23
|
+
}
|
|
24
|
+
static get observedAttributes() {
|
|
25
|
+
return ["compact"];
|
|
26
|
+
}
|
|
27
|
+
connectedCallback() {
|
|
28
|
+
if (!this.style.display) this.style.display = "block";
|
|
29
|
+
this.classList.add("sw-prose");
|
|
30
|
+
__privateMethod(this, _SwProsePrint_instances, apply_fn).call(this);
|
|
31
|
+
}
|
|
32
|
+
attributeChangedCallback() {
|
|
33
|
+
__privateMethod(this, _SwProsePrint_instances, apply_fn).call(this);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
_SwProsePrint_instances = new WeakSet();
|
|
37
|
+
apply_fn = function() {
|
|
38
|
+
setOrRemoveClass(this, "sw-prose-compact", this.hasAttribute("compact"));
|
|
39
|
+
};
|
|
40
|
+
function defineSwProsePrint() {
|
|
41
|
+
defineElement("sw-prose-print", SwProsePrint);
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
defineSwProsePrint
|
|
45
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=t=>{throw TypeError(t)};var d=(t,s,e)=>s.has(t)||a("Cannot "+e);var o=(t,s,e)=>s.has(t)?a("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,e);var c=(t,s,e)=>(d(t,s,"access private method"),e);function r(t,s){customElements.get(t)||customElements.define(t,s)}function p(t,s,e){e?t.classList.add(s):t.classList.remove(s)}var i,l,n=class extends HTMLElement{constructor(){super(...arguments);o(this,i)}static get observedAttributes(){return["compact"]}connectedCallback(){this.style.display||(this.style.display="block"),this.classList.add("sw-prose"),c(this,i,l).call(this)}attributeChangedCallback(){c(this,i,l).call(this)}};i=new WeakSet,l=function(){p(this,"sw-prose-compact",this.hasAttribute("compact"))};function h(){r("sw-prose-print",n)}export{h as defineSwProsePrint};
|