@bangerpage/core 0.1.2 → 0.2.0-rc.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/README.md +1 -1
- package/custom-elements.json +449 -4
- package/dist/base-style.d.ts +2 -0
- package/dist/chunks/{chart-impl-4XQPQZ4J.js → chart-impl-CMVBON4X.js} +2 -2
- package/dist/chunks/chunk-6BFFJEGA.js +43 -0
- package/dist/chunks/{chunk-YW2TRY4C.js.map → chunk-6BFFJEGA.js.map} +4 -4
- package/dist/deck-check.d.ts +5 -0
- package/dist/frame.d.ts +7 -1
- package/dist/index.js +43 -42
- package/dist/index.js.map +3 -3
- package/dist/language.d.ts +35 -0
- package/dist/presenter.d.ts +3 -0
- package/dist/root.d.ts +19 -0
- package/dist/stop.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunks/chunk-YW2TRY4C.js +0 -41
- /package/dist/chunks/{chart-impl-4XQPQZ4J.js.LEGAL.txt → chart-impl-CMVBON4X.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chart-impl-4XQPQZ4J.js.map → chart-impl-CMVBON4X.js.map} +0 -0
- /package/dist/chunks/{chunk-YW2TRY4C.js.LEGAL.txt → chunk-6BFFJEGA.js.LEGAL.txt} +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const LANGUAGE_TAG: RegExp;
|
|
2
|
+
export interface LanguageNode {
|
|
3
|
+
localName: string;
|
|
4
|
+
parentElement: LanguageNode | null;
|
|
5
|
+
getAttribute(name: string): string | null;
|
|
6
|
+
}
|
|
7
|
+
/** Lower-cases ASCII letters only, so the comparison matches CSS's `i` flag. */
|
|
8
|
+
export declare function foldTag(tag: string): string;
|
|
9
|
+
/** Splits on whitespace; keeps tags that match `LANGUAGE_TAG` once each (ignoring case), in order. */
|
|
10
|
+
export declare function parseLanguages(raw: string | null): {
|
|
11
|
+
languages: string[];
|
|
12
|
+
invalid: string[];
|
|
13
|
+
};
|
|
14
|
+
/** The spelling in `languages` of the tag that equals `tag` ignoring case, or undefined. */
|
|
15
|
+
export declare function canonicalLanguage(tag: string | null, languages: readonly string[]): string | undefined;
|
|
16
|
+
/** Picks the language: `?lang=`, then the browser's languages, then the first. `languages` has at least one. */
|
|
17
|
+
export declare function resolveLanguage(input: {
|
|
18
|
+
languages: readonly string[];
|
|
19
|
+
query: string | null;
|
|
20
|
+
navigatorLanguages: readonly string[];
|
|
21
|
+
useNavigator: boolean;
|
|
22
|
+
}): {
|
|
23
|
+
language: string;
|
|
24
|
+
queryIgnored: boolean;
|
|
25
|
+
};
|
|
26
|
+
/** The language after `current` in `languages`; the first after the last. */
|
|
27
|
+
export declare function nextLanguage(languages: readonly string[], current: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Per language, a rule hiding the other languages' elements inside frames, and one removing the group space from the
|
|
30
|
+
* first shown item of a grouped list (the list's own `:first-child` rule would pick a hidden item); "" for fewer than
|
|
31
|
+
* two languages.
|
|
32
|
+
*/
|
|
33
|
+
export declare function languageCss(languages: readonly string[]): string;
|
|
34
|
+
/** False when `el` is inside a frame under a `lang` that is one of the deck's languages but not the current one. Same definition as `languageCss`. */
|
|
35
|
+
export declare function inLanguage(el: LanguageNode): boolean;
|
package/dist/presenter.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export declare class PresenterSync {
|
|
|
6
6
|
private readonly id;
|
|
7
7
|
constructor();
|
|
8
8
|
send(state: BangState): void;
|
|
9
|
+
sendLanguage(lang: string): void;
|
|
10
|
+
onRemoteLanguage(callback: (lang: string) => void): void;
|
|
9
11
|
onRemote(callback: (state: BangState) => void): void;
|
|
10
12
|
close(): void;
|
|
11
13
|
}
|
|
@@ -15,6 +17,7 @@ export interface PresenterView {
|
|
|
15
17
|
step: number;
|
|
16
18
|
steps: number;
|
|
17
19
|
notes: string;
|
|
20
|
+
language?: string;
|
|
18
21
|
elapsedMs: number;
|
|
19
22
|
onPrev: () => void;
|
|
20
23
|
onNext: () => void;
|
package/dist/root.d.ts
CHANGED
|
@@ -52,6 +52,13 @@ export declare class BangRoot extends BangElement {
|
|
|
52
52
|
* `map` is experimental: its look and behaviour may change in any release. Use `slides` unless the author asks for a map.
|
|
53
53
|
*/
|
|
54
54
|
format: "slides" | "map";
|
|
55
|
+
/**
|
|
56
|
+
* The languages of the deck as BCP 47 tags separated by spaces, for example `ja en`; the first is the author's language.
|
|
57
|
+
* An element inside a frame (and a `bang-notes`) with a `lang` of one of them shows only while that language is selected;
|
|
58
|
+
* elements without `lang` show in every language. The language comes from `?lang=`, then the browser's languages, then the first.
|
|
59
|
+
* The root writes the selected language to its own `lang` attribute. Read once when the root connects; changing it later has no effect.
|
|
60
|
+
*/
|
|
61
|
+
languages?: string;
|
|
55
62
|
private ground;
|
|
56
63
|
/** The first stop of each frame, for the fog and for clicks in the overview. */
|
|
57
64
|
private firstStop;
|
|
@@ -75,6 +82,10 @@ export declare class BangRoot extends BangElement {
|
|
|
75
82
|
private reducedMotion;
|
|
76
83
|
private initialized;
|
|
77
84
|
private sync;
|
|
85
|
+
private languageList;
|
|
86
|
+
private currentLanguage;
|
|
87
|
+
private get multilingual();
|
|
88
|
+
private readonly onFontsLoaded;
|
|
78
89
|
private resizeObserver;
|
|
79
90
|
private statusTimer;
|
|
80
91
|
private clockTimer;
|
|
@@ -103,6 +114,12 @@ export declare class BangRoot extends BangElement {
|
|
|
103
114
|
private readonly onHashChange;
|
|
104
115
|
private readonly onMotionChange;
|
|
105
116
|
connectedCallback(): void;
|
|
117
|
+
private initLanguage;
|
|
118
|
+
/** The deck's languages from the `languages` attribute; empty for a deck without them. */
|
|
119
|
+
getLanguages(): string[];
|
|
120
|
+
/** The selected language; "" for a deck without languages. */
|
|
121
|
+
getLanguage(): string;
|
|
122
|
+
private setLanguage;
|
|
106
123
|
disconnectedCallback(): void;
|
|
107
124
|
protected willUpdate(changed: PropertyValues): void;
|
|
108
125
|
protected firstUpdated(_changed: PropertyValues): void;
|
|
@@ -112,6 +129,8 @@ export declare class BangRoot extends BangElement {
|
|
|
112
129
|
private onSlotChange;
|
|
113
130
|
/** Overlays the colors and fonts of the bang-theme child as inline variables when theme="custom". */
|
|
114
131
|
private applyTheme;
|
|
132
|
+
/** Translation mistakes are the same in every language, so only the first language's pass reports them. */
|
|
133
|
+
private languageWarnings;
|
|
115
134
|
/** Warnings that depend on the elements in the deck; rebuilt on every call so frames added later are covered. */
|
|
116
135
|
private deckWarnings;
|
|
117
136
|
/** Publishes each frame tone's colours as --bang-frame-<tone>-<token>; bang-frame[tone] maps them onto its own --bang-color-*. */
|
package/dist/stop.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export declare class BangStop extends BangElement {
|
|
|
36
36
|
render(): import("lit").TemplateResult<1>;
|
|
37
37
|
}
|
|
38
38
|
/** `auto` is true when the stop has no `steps` attribute; the root then fills `steps` in from the frame's content. */
|
|
39
|
-
export declare function readStop(el: Element): {
|
|
39
|
+
export declare function readStop(el: Element, language?: string): {
|
|
40
40
|
stop: StopModel;
|
|
41
41
|
notes: string;
|
|
42
42
|
auto: boolean;
|
package/package.json
CHANGED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import{b as lt,d as ct}from"./chunk-ISQU3ATQ.js";var H=globalThis,L=H.ShadowRoot&&(H.ShadyCSS===void 0||H.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),ht=new WeakMap,x=class{constructor(t,e,n){if(this._$cssResult$=!0,n!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(L&&t===void 0){let n=e!==void 0&&e.length===1;n&&(t=ht.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&ht.set(e,t))}return t}toString(){return this.cssText}},dt=s=>new x(typeof s=="string"?s:s+"",void 0,V),Lt=(s,...t)=>{let e=s.length===1?s[0]:t.reduce((n,r,o)=>n+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[o+1],s[0]);return new x(e,s,V)},ut=(s,t)=>{if(L)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let n=document.createElement("style"),r=H.litNonce;r!==void 0&&n.setAttribute("nonce",r),n.textContent=e.cssText,s.appendChild(n)}},G=L?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let n of t.cssRules)e+=n.cssText;return dt(e)})(s):s;var{is:jt,defineProperty:qt,getOwnPropertyDescriptor:Dt,getOwnPropertyNames:It,getOwnPropertySymbols:Bt,getPrototypeOf:Ft}=Object,j=globalThis,pt=j.trustedTypes,Wt=pt?pt.emptyScript:"",zt=j.reactiveElementPolyfillSupport,C=(s,t)=>s,P={toAttribute(s,t){switch(t){case Boolean:s=s?Wt:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},q=(s,t)=>!jt(s,t),ft={attribute:!0,type:String,converter:P,reflect:!1,useDefault:!1,hasChanged:q};Symbol.metadata??=Symbol("metadata"),j.litPropertyMetadata??=new WeakMap;var f=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=ft){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(t,n,e);r!==void 0&&qt(this.prototype,t,r)}}static getPropertyDescriptor(t,e,n){let{get:r,set:o}=Dt(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:r,set(i){let a=r?.call(this);o?.call(this,i),this.requestUpdate(t,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??ft}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let t=Ft(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties,n=[...It(e),...Bt(e)];for(let r of n)this.createProperty(r,e[r])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[n,r]of e)this.elementProperties.set(n,r)}this._$Eh=new Map;for(let[e,n]of this.elementProperties){let r=this._$Eu(e,n);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let n=new Set(t.flat(1/0).reverse());for(let r of n)e.unshift(G(r))}else t!==void 0&&e.push(G(t));return e}static _$Eu(t,e){let n=e.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let n of e.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ut(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$ET(t,e){let n=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,n);if(r!==void 0&&n.reflect===!0){let o=(n.converter?.toAttribute!==void 0?n.converter:P).toAttribute(e,n.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){let n=this.constructor,r=n._$Eh.get(t);if(r!==void 0&&this._$Em!==r){let o=n.getPropertyOptions(r),i=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:P;this._$Em=r;let a=i.fromAttribute(e,o.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(t,e,n,r=!1,o){if(t!==void 0){let i=this.constructor;if(r===!1&&(o=this[t]),n??=i.getPropertyOptions(t),!((n.hasChanged??q)(o,e)||n.useDefault&&n.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,n))))return;this.C(t,e,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:n,reflect:r,wrapped:o},i){n&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),o!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||n||(e=void 0),this._$AL.set(t,e)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[r,o]of n){let{wrapped:i}=o,a=this[r];i!==!0||this._$AL.has(r)||a===void 0||this.C(r,void 0,o,a)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(n=>n.hostUpdate?.()),this.update(e)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};f.elementStyles=[],f.shadowRootOptions={mode:"open"},f[C("elementProperties")]=new Map,f[C("finalized")]=new Map,zt?.({ReactiveElement:f}),(j.reactiveElementVersions??=[]).push("2.1.2");var tt=globalThis,mt=s=>s,D=tt.trustedTypes,gt=D?D.createPolicy("lit-html",{createHTML:s=>s}):void 0,At="$lit$",b=`lit$${Math.random().toFixed(9).slice(2)}$`,wt="?"+b,Vt=`<${wt}>`,v=document,O=()=>v.createComment(""),T=s=>s===null||typeof s!="object"&&typeof s!="function",et=Array.isArray,Gt=s=>et(s)||typeof s?.[Symbol.iterator]=="function",X=`[
|
|
2
|
-
\f\r]`,R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,bt=/-->/g,yt=/>/g,$=RegExp(`>|${X}(?:([^\\s"'>=/]+)(${X}*=${X}*(?:[^
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),$t=/'/g,_t=/"/g,St=/^(?:script|style|textarea|title)$/i,nt=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),Se=nt(1),Ee=nt(2),xe=nt(3),A=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),vt=new WeakMap,_=v.createTreeWalker(v,129);function Et(s,t){if(!et(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return gt!==void 0?gt.createHTML(t):t}var Xt=(s,t)=>{let e=s.length-1,n=[],r,o=t===2?"<svg>":t===3?"<math>":"",i=R;for(let a=0;a<e;a++){let l=s[a],h,u,c=-1,p=0;for(;p<l.length&&(i.lastIndex=p,u=i.exec(l),u!==null);)p=i.lastIndex,i===R?u[1]==="!--"?i=bt:u[1]!==void 0?i=yt:u[2]!==void 0?(St.test(u[2])&&(r=RegExp("</"+u[2],"g")),i=$):u[3]!==void 0&&(i=$):i===$?u[0]===">"?(i=r??R,c=-1):u[1]===void 0?c=-2:(c=i.lastIndex-u[2].length,h=u[1],i=u[3]===void 0?$:u[3]==='"'?_t:$t):i===_t||i===$t?i=$:i===bt||i===yt?i=R:(i=$,r=void 0);let g=i===$&&s[a+1].startsWith("/>")?" ":"";o+=i===R?l+Vt:c>=0?(n.push(h),l.slice(0,c)+At+l.slice(c)+b+g):l+b+(c===-2?a:g)}return[Et(s,o+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),n]},k=class s{constructor({strings:t,_$litType$:e},n){let r;this.parts=[];let o=0,i=0,a=t.length-1,l=this.parts,[h,u]=Xt(t,e);if(this.el=s.createElement(h,n),_.currentNode=this.el.content,e===2||e===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(r=_.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let c of r.getAttributeNames())if(c.endsWith(At)){let p=u[i++],g=r.getAttribute(c).split(b),U=/([.?@])?(.*)/.exec(p);l.push({type:1,index:o,name:U[2],strings:g,ctor:U[1]==="."?J:U[1]==="?"?K:U[1]==="@"?Z:E}),r.removeAttribute(c)}else c.startsWith(b)&&(l.push({type:6,index:o}),r.removeAttribute(c));if(St.test(r.tagName)){let c=r.textContent.split(b),p=c.length-1;if(p>0){r.textContent=D?D.emptyScript:"";for(let g=0;g<p;g++)r.append(c[g],O()),_.nextNode(),l.push({type:2,index:++o});r.append(c[p],O())}}}else if(r.nodeType===8)if(r.data===wt)l.push({type:2,index:o});else{let c=-1;for(;(c=r.data.indexOf(b,c+1))!==-1;)l.push({type:7,index:o}),c+=b.length-1}o++}}static createElement(t,e){let n=v.createElement("template");return n.innerHTML=t,n}};function S(s,t,e=s,n){if(t===A)return t;let r=n!==void 0?e._$Co?.[n]:e._$Cl,o=T(t)?void 0:t._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),o===void 0?r=void 0:(r=new o(s),r._$AT(s,e,n)),n!==void 0?(e._$Co??=[])[n]=r:e._$Cl=r),r!==void 0&&(t=S(s,r._$AS(s,t.values),r,n)),t}var Y=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:n}=this._$AD,r=(t?.creationScope??v).importNode(e,!0);_.currentNode=r;let o=_.nextNode(),i=0,a=0,l=n[0];for(;l!==void 0;){if(i===l.index){let h;l.type===2?h=new M(o,o.nextSibling,this,t):l.type===1?h=new l.ctor(o,l.name,l.strings,this,t):l.type===6&&(h=new Q(o,this,t)),this._$AV.push(h),l=n[++a]}i!==l?.index&&(o=_.nextNode(),i++)}return _.currentNode=v,r}p(t){let e=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}},M=class s{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,n,r){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=S(this,t,e),T(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==A&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Gt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&T(this._$AH)?this._$AA.nextSibling.data=t:this.T(v.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:n}=t,r=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=k.createElement(Et(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(e);else{let o=new Y(r,this),i=o.u(this.options);o.p(e),this.T(i),this._$AH=o}}_$AC(t){let e=vt.get(t.strings);return e===void 0&&vt.set(t.strings,e=new k(t)),e}k(t){et(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,n,r=0;for(let o of t)r===e.length?e.push(n=new s(this.O(O()),this.O(O()),this,this.options)):n=e[r],n._$AI(o),r++;r<e.length&&(this._$AR(n&&n._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let n=mt(t).nextSibling;mt(t).remove(),t=n}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},E=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,r,o){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=d}_$AI(t,e=this,n,r){let o=this.strings,i=!1;if(o===void 0)t=S(this,t,e,0),i=!T(t)||t!==this._$AH&&t!==A,i&&(this._$AH=t);else{let a=t,l,h;for(t=o[0],l=0;l<o.length-1;l++)h=S(this,a[n+l],e,l),h===A&&(h=this._$AH[l]),i||=!T(h)||h!==this._$AH[l],h===d?t=d:t!==d&&(t+=(h??"")+o[l+1]),this._$AH[l]=h}i&&!r&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},J=class extends E{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},K=class extends E{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},Z=class extends E{constructor(t,e,n,r,o){super(t,e,n,r,o),this.type=5}_$AI(t,e=this){if((t=S(this,t,e,0)??d)===A)return;let n=this._$AH,r=t===d&&n!==d||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==d&&(n===d||r);r&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},Q=class{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}};var Yt=tt.litHtmlPolyfillSupport;Yt?.(k,M),(tt.litHtmlVersions??=[]).push("3.3.3");var xt=(s,t,e)=>{let n=e?.renderBefore??t,r=n._$litPart$;if(r===void 0){let o=e?.renderBefore??null;n._$litPart$=r=new M(t.insertBefore(O(),o),o,void 0,e??{})}return r._$AI(s),r};var st=globalThis,y=class extends f{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=xt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return A}};y._$litElement$=!0,y.finalized=!0,st.litElementHydrateSupport?.({LitElement:y});var Jt=st.litElementPolyfillSupport;Jt?.({LitElement:y});(st.litElementVersions??=[]).push("4.2.2");var Kt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:q},Zt=(s=Kt,t,e)=>{let{kind:n,metadata:r}=e,o=globalThis.litPropertyMetadata.get(r);if(o===void 0&&globalThis.litPropertyMetadata.set(r,o=new Map),n==="setter"&&((s=Object.create(s)).wrapped=!0),o.set(e.name,s),n==="accessor"){let{name:i}=e;return{set(a){let l=t.get.call(this);t.set.call(this,a),this.requestUpdate(i,l,s,!0,a)},init(a){return a!==void 0&&this.C(i,void 0,s,a),a}}}if(n==="setter"){let{name:i}=e;return function(a){let l=this[i];t.call(this,a),this.requestUpdate(i,l,s,!0,a)}}throw Error("Unsupported decorator location: "+n)};function I(s){return(t,e)=>typeof e=="object"?Zt(s,t,e):((n,r,o)=>{let i=r.hasOwnProperty(o);return r.constructor.createProperty(o,n),i?Object.getOwnPropertyDescriptor(r,o):void 0})(s,t,e)}function Fe(s){return I({...s,state:!0,attribute:!1})}var Ct=15e3;function gn(s,t){customElements.get(s)||customElements.define(s,t)}function m(s){let t=n=>{let r=n.localName;if(n.id)return`${r}#${n.id}`;let o=n.parentElement;if(!o)return r;let i=[...o.children].filter(a=>a.localName===r).indexOf(n)+1;return`${r}:nth-of-type(${i})`},e=[];for(let n=s;n&&(e.unshift(t(n)),!(n.id||n.localName==="bang-root"));n=n.parentElement);return e.join(" > ")}var ot=class extends y{constructor(){super(...arguments);this.renderDone=Promise.resolve()}get renderReady(){return this.updateComplete.then(()=>this.renderDone)}},rt=class extends ot{constructor(){super(...arguments);this.frameStep=0}get stepCount(){return 0}connectedCallback(){super.connectedCallback();let e=this.closest("bang-frame");e&&typeof e.currentStep=="number"&&(this.frameStep=e.currentStep)}};lt([I({attribute:!1})],rt.prototype,"frameStep",2);var $n=["xs","s","m","l","xl","2xl"],_n=["default","muted","accent"],Pt=new Set,Rt=new Set;function W(s,t){Pt.has(s)||(Pt.add(s),Rt.add(t.replace(/^\[banger\] /,"")),console.warn(t))}function Ot(){return[...Rt]}var F=s=>s.localName??"element";function vn(s,t,e,n){let r=s.getAttribute(t);return r===null?n:e.includes(r)?r:(W(`${F(s)}|${t}|${r}`,`[banger] <${F(s)} ${t}="${r}"> is not one of: ${e.join(", ")}; using "${n}"`),n)}function An(s,t,e,n,r){let o=s.getAttribute(t);if(o===null)return r;let i=Number(o);return/^-?\d+$/.test(o.trim())&&i>=e&&i<=n?i:(W(`${F(s)}|${t}|${o}`,`[banger] <${F(s)} ${t}="${o}"> is not an integer from ${e} to ${n}; using ${r}`),r)}function wn(s,t){if(!/^\d+(:\d+)*$/.test(s))return null;let e=s.split(":").map(Number);return e.length!==t||e.some(n=>n<1)?null:e}var Qt=2,te=["style","fill","stroke","color","stop-color","flood-color","lighting-color"],ee=new Set(["path","ellipse","circle","rect","line","polyline","polygon","text","image","use"]),ne=/(?<!url\(\s*["']?)#[0-9a-fA-F]{3,8}(?![\w-])|\b(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color)\([^)]*\)/i;function se(s,t,e){let n=r=>{let o=r/e;return o>Qt?Math.round(o):0};return{x:n(Math.max(s.left-t.left,t.right-s.right)),y:n(Math.max(s.top-t.top,t.bottom-s.bottom))}}function Tt(s){return ne.exec(s)?.[0]??null}function xn(s){return`@scope {
|
|
4
|
-
${s}
|
|
5
|
-
}`}function Cn(){return typeof CSSScopeRule=="function"}function re(s){let t=[s.overflowX!==0?`${s.overflowX}px horizontally`:"",s.overflowY!==0?`${s.overflowY}px vertically`:""].filter(Boolean).join(", ");return`${s.frame}: ${s.selector} sticks out of its bang-free box by ${t}; the part outside is clipped`}function oe(s,t){let e=t.length>1?` (and ${t.length-1} more)`:"";return`${s}: color code "${t[0]}" in the CSS${e}; take colors from the theme with var(--bang-color-*)`}function ie(s){return`${s}: <style> is not a direct child of bang-free, so it is not scoped and applies to the whole page; move it directly under bang-free`}function ae(s,t){return`${s}: ${t} must be the only bang-free[overlay] and the last child of its bang-frame; otherwise the other parts move`}function kt(s,t){if(s)for(let e of s){let n=e.style;if(n){let o=Tt(n.cssText);o&&t.push(o)}let r=e.cssRules;r&&kt(r,t)}}function le(s){let t=[];for(let e of s.querySelectorAll("style"))kt(e.sheet?.cssRules,t);for(let e of s.querySelectorAll("*"))for(let n of te){let r=Tt(e.getAttribute(n)??"");r&&t.push(r)}return[...new Set(t)]}function ce(s){let t=s.parentElement;return!t||t.localName!=="bang-frame"||s.nextElementSibling?!0:[...t.children].filter(e=>e.localName==="bang-free"&&e.hasAttribute("overlay")).length>=2}function he(s){let t=s;for(let e=s.ownerSVGElement;e;e=e.ownerSVGElement)t=e;return t}function de(s,t){let e=s.getBoundingClientRect(),n=m(s.closest("bang-frame")??s),r=null;for(let o of s.querySelectorAll("*")){let i=o.getBoundingClientRect();if(i.width===0&&i.height===0)continue;let a=e;if(o instanceof SVGElement&&o.ownerSVGElement){if(!ee.has(o.localName)||o.closest("defs, marker, clipPath, mask, pattern, symbol"))continue;a=he(o).getBoundingClientRect()}let{x:l,y:h}=se(a,i,t);l===0&&h===0||(!r||Math.max(l,h)>Math.max(r.overflowX,r.overflowY))&&(r={frame:n,selector:m(o),overflowX:l,overflowY:h})}return r}function Mt(s){let t=[];for(let e of s.querySelectorAll("bang-free")){let n=le(e);n.length>0&&t.push(oe(m(e),n));let r=[...e.querySelectorAll("style")].find(a=>a.parentElement!==e);r&&t.push(ie(m(r))),e.hasAttribute("overlay")&&ce(e)&&t.push(ae(m(e.closest("bang-frame")??e),m(e)));let o=e.offsetWidth;if(o===0)continue;let i=de(e,e.getBoundingClientRect().width/o);i&&t.push(re(i))}return t}function N(s,t,e="timed out"){let n,r=new Promise((o,i)=>{n=setTimeout(()=>i(new Error(e)),t)});return Promise.race([s,r]).finally(()=>clearTimeout(n))}var ue=1e4;function pe(s){return((s instanceof Error?s.message:String(s)).split(`
|
|
6
|
-
`)[0]??"").slice(0,200)}async function fe(s,t){let e=await Promise.allSettled(s.map(r=>N(r.ready,t,`timed out after ${t}ms`))),n=[];return e.forEach((r,o)=>{r.status==="rejected"&&n.push({selector:s[o].selector,tag:s[o].tag,reason:pe(r.reason)})}),n}function me(s){let t=new Set,e=n=>{if(n.nodeType===Node.TEXT_NODE){for(let r of n.data)r.trim()!==""&&t.add(r);return}if(n instanceof Element){if(n.localName==="script"||n.localName==="style")return;n.shadowRoot&&n.shadowRoot.childNodes.forEach(e)}n.childNodes.forEach(e)};return e(s),[...t].join("")}async function Mn(s,t={}){let e=t.timeoutMs??Ct,n=t.fontsTimeoutMs??ue,r=new Set(t.extraWarnings??[]);(await it(n)).forEach(a=>r.add(a));let o=[];for(let a of s.querySelectorAll("*")){let l=a.renderReady;l instanceof Promise&&o.push({selector:m(a),tag:a.localName,ready:l})}let i=await fe(o,e);return(await Nt(me(s),n)).forEach(a=>r.add(a)),Mt(s).forEach(a=>r.add(a)),Ot().forEach(a=>r.add(a)),{ok:i.length===0,failed:i,warnings:[...r]}}var ge=[{family:"Bricolage Grotesque",weights:[800]},{family:"Noto Sans JP",weights:[400,700]},{family:"JetBrains Mono",weights:[400]}],Ht=null,z=null,w=null,at=null,be=`
|
|
7
|
-
html, body { margin: 0; overflow: hidden; background: var(--bang-color-paper, #F6F5F1); }
|
|
8
|
-
[data-step], bang-list > li, bang-list > bang-list { transition: opacity var(--bang-duration-fast, 200ms); }
|
|
9
|
-
[data-bang-hidden] { opacity: 0; pointer-events: none; }
|
|
10
|
-
/* Set after the first mouse flick: a page-turner remote is driving the deck, and its drags would otherwise select text or drag images on every press. */
|
|
11
|
-
html[data-bang-remote] { -webkit-user-select: none; user-select: none; }
|
|
12
|
-
html[data-bang-remote] img { -webkit-user-drag: none; }
|
|
13
|
-
/* The remote also moves the cursor up and down on every press; bang-root hides it until a person moves the mouse. */
|
|
14
|
-
bang-root[data-bang-nocursor] * { cursor: none !important; }
|
|
15
|
-
/* --bang-near is 1 when the frame fills the screen and 0 when the camera is far from it; bang-root sets it on every move. */
|
|
16
|
-
bang-frame [show="near"] { opacity: var(--bang-near, 1); }
|
|
17
|
-
bang-frame [show="far"] { opacity: calc(1 - var(--bang-near, 1)); }
|
|
18
|
-
/* A focus stop keeps its element at full strength and fades the rest, so the edges of neighbours that fall inside the screen read as background rather than as part of the slide. */
|
|
19
|
-
bang-frame[data-bang-spot], bang-frame [data-bang-spot] { transition: opacity var(--bang-duration-slow, 400ms); }
|
|
20
|
-
bang-frame[data-bang-dim], bang-frame [data-bang-dim]:not([data-bang-hidden], [show="far"]) { opacity: 0.16; }
|
|
21
|
-
@media (prefers-reduced-motion: reduce) { bang-frame[data-bang-spot], bang-frame [data-bang-spot] { transition: none; } }
|
|
22
|
-
/* Layouts keep their natural height so the frame can centre them; only those holding a chart or image grow. Set here because document rules outrank :host. */
|
|
23
|
-
/* A band spans its stack even when the stack centres or end-aligns its children. */
|
|
24
|
-
bang-stack > bang-card[kind="band"] { align-self: stretch; }
|
|
25
|
-
bang-stack:has(bang-chart, bang-image, bang-free:not([overlay])), bang-columns:has(bang-chart, bang-image, bang-free:not([overlay])), bang-card:has(bang-chart, bang-image, bang-free:not([overlay])) { flex: 1 1 0; }
|
|
26
|
-
/* A column that holds a free box takes the full row height even when the columns centre or end-align their cells; otherwise the box fills a content-high cell and collapses to 0. */
|
|
27
|
-
bang-columns > :has(bang-free:not([overlay])) { align-self: stretch; }
|
|
28
|
-
/* An arrow or mark between cards sits on the row's centre line, even when the columns stretch their cells. */
|
|
29
|
-
bang-columns > bang-shape { align-self: center; justify-self: center; }
|
|
30
|
-
/* The frame centres its children; when it opens with a title, free space is split between these two auto margins so the title stays on top and the rest is centred below it. */
|
|
31
|
-
bang-frame:not([valign="spread"]) > bang-title:first-child, bang-frame:not([valign="spread"]):has(> bang-title:first-child) > :last-child { margin-bottom: auto; }
|
|
32
|
-
bang-frame:not([valign="spread"]):has(> bang-title:first-child) > :nth-last-child(2):has(+ bang-free[overlay]:last-child) { margin-bottom: auto; }
|
|
33
|
-
/* Inline emphasis lives in the document: ::slotted() cannot reach a <mark> inside a list's li. The text colour is pinned to ink so the highlight contrast check holds whatever the surrounding tone. */
|
|
34
|
-
bang-text mark, bang-title mark, bang-list mark { color: var(--bang-color-ink); background: linear-gradient(transparent 60%, var(--bang-highlight, color-mix(in srgb, var(--bang-color-signal) 40%, transparent)) 60%); -webkit-box-decoration-break: clone; box-decoration-break: clone; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
|
|
35
|
-
/* Tone frames flip the text colour and put signal or ink behind it, so a light band would swallow the text; underline in the text colour instead. */
|
|
36
|
-
bang-frame[tone="accent"] :is(bang-text, bang-title, bang-list) mark, bang-frame[tone="inverse"] :is(bang-text, bang-title, bang-list) mark { color: inherit; background: linear-gradient(transparent 88%, currentColor 88%); }
|
|
37
|
-
`,ye=`
|
|
38
|
-
@page { size: 1920px 1080px; margin: 0 }
|
|
39
|
-
html, body { height: 1080px; }
|
|
40
|
-
`;function jn(s){if(document.getElementById("bang-base"))return;let t=document.head,e=(o,i)=>{let a=document.createElement("link");a.rel="preconnect",a.href=o,i&&(a.crossOrigin=""),t.append(a)};e("https://fonts.googleapis.com",!1),e("https://fonts.gstatic.com",!0);let n=document.createElement("link");n.id="bang-fonts",n.rel="stylesheet",n.href=ct,Ht=new Promise(o=>{n.addEventListener("load",()=>o("load")),n.addEventListener("error",()=>o("error"))}),t.append(n);let r=document.createElement("style");r.id="bang-base",r.textContent=be+(s==="export"?ye:""),t.append(r)}function qn(s){if(w){w.request.href!==s.href&&W(`themefonts|${s.href}`,"[banger] the theme fonts stylesheet is set once per page; a different fontsHref is ignored");return}let t=document.createElement("link");t.id="bang-theme-fonts",t.rel="stylesheet",t.href=s.href;let e=new Promise(n=>{t.addEventListener("load",()=>n("load")),t.addEventListener("error",()=>n("error"))});document.head.append(t),w={request:s,status:e},z=null}async function Ut(s,t,e){if(!s)return{warnings:[],settled:!0};try{return{warnings:await N(s,t)==="error"?[e.failed]:[],settled:!0}}catch{return{warnings:[e.timedOut],settled:!1}}}async function it(s){if(z)return z;let t=w,[e,n]=await Promise.all([Ut(Ht,s,{failed:"fonts stylesheet failed to load; system fonts are used",timedOut:"fonts stylesheet timed out; system fonts are used"}),Ut(t?.status,s,{failed:"theme fonts stylesheet failed to load; the font stack falls back",timedOut:"theme fonts stylesheet timed out; the font stack falls back"})]),r=[...e.warnings,...n.warnings];return e.settled&&n.settled&&w===t&&(z=r),r}async function $e(s,t){let e=Date.now()+t,n=()=>Math.max(0,e-Date.now()),r=new Set(await it(t));await Promise.all([...ge,...w?.request.families??[]].flatMap(({family:o,weights:i})=>i.map(async a=>{try{await N(document.fonts.load(`${a} 1em "${o}"`,s),n())}catch(l){r.add(l instanceof Error&&l.message==="timed out"?"fonts timed out":`font load failed: ${o}`)}})));try{await N(document.fonts.ready,n())}catch{r.add("fonts timed out")}return[...r]}function Nt(s,t){let e=`${s}\0${w?.request.href??""}`;if(at?.key===e)return at.result;let n=$e(s,t);return at={key:e,result:n},n}export{dt as a,Lt as b,Se as c,Ee as d,d as e,I as f,Fe as g,gn as h,m as i,ot as j,rt as k,$n as l,_n as m,W as n,vn as o,An as p,wn as q,Qt as r,xn as s,Cn as t,Mn as u,jn as v,qn as w,Nt as x};
|
|
41
|
-
//# sourceMappingURL=chunk-YW2TRY4C.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|