@pairbo/ui-kit 0.2.5 → 0.2.6
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 +186 -0
- package/dist/assets/page-manager.component-Dzd6xKY5.js +307 -0
- package/dist/defaultTheme.css +1 -0
- package/dist/pboBridge.js +1 -0
- package/dist/ui-kit.js +2902 -0
- package/package.json +8 -10
- package/dist/pairbo.es.js +0 -21415
- package/dist/pairbo.umd.js +0 -2616
package/README.md
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
## **🚀 V1 To-Do List**
|
|
2
|
+
|
|
3
|
+
### **🔧 Pending Setup**
|
|
4
|
+
|
|
5
|
+
- [ ] **11ty setup is incomplete.**
|
|
6
|
+
- [ ] **Mock API needed** for:
|
|
7
|
+
- Fetching and submitting cards
|
|
8
|
+
- Processing handwritten images
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## **🎨 Global Theme ([src/themes](src/themes))**
|
|
13
|
+
|
|
14
|
+
- [ ] Define global theme styles
|
|
15
|
+
- Identify `--sl-` global CSS variables in component styles, and replace with `--pbo-`
|
|
16
|
+
- Declare variables in [`default.css`](src/themes/default.css)
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## **📌 Components Overview**
|
|
21
|
+
|
|
22
|
+
### **🗂️ Drawer ([src/components/drawer](src/components/drawer))**
|
|
23
|
+
|
|
24
|
+
- [x] Implement **window-like title bar** with:
|
|
25
|
+
- **Left:** Back icon (if not on Card Selection page)
|
|
26
|
+
- **Center:** Current page name (**Card Selection** / **Card Editing**)
|
|
27
|
+
- **Right:** Close icon to dismiss drawer
|
|
28
|
+
- [x] Make styles more flexible:
|
|
29
|
+
- Support top/bottom/left/right drawers
|
|
30
|
+
- Allow setting drawer size (`30%`, `50%`, `60%`, `100%`)
|
|
31
|
+
- Add opening animations
|
|
32
|
+
- [ ] _(Optional)_ Customizable themes (background, colors, etc.)
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
### **✍️ Editor ([src/components/editor](src/components/editor))**
|
|
37
|
+
|
|
38
|
+
#### 🖥️ **Desktop Layout**
|
|
39
|
+
|
|
40
|
+
- [x] Implement responsive grid layout for desktop
|
|
41
|
+
- Grid rows: `1`
|
|
42
|
+
- Grid cols: `12`
|
|
43
|
+
- Image Slider:
|
|
44
|
+
- `sm`: col start `2`, end `7`
|
|
45
|
+
- `2xl`: col start `3`, end `7`
|
|
46
|
+
- Message Editor:
|
|
47
|
+
- `sm`: col start `7`, end `12`
|
|
48
|
+
- `2xl`: col start `7`, end `11`
|
|
49
|
+
|
|
50
|
+
#### 📱 **Mobile Layout**
|
|
51
|
+
|
|
52
|
+
- [x] Implement responsive flex layout for mobile
|
|
53
|
+
- `display: flex`
|
|
54
|
+
- `flex-direction: column`
|
|
55
|
+
- `gap: 1rem`
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## **📝 Form Elements**
|
|
60
|
+
|
|
61
|
+
### **📄 Type Form ([src/components/type-form](src/components/type-form))**
|
|
62
|
+
|
|
63
|
+
- [x] Add gap between form elements
|
|
64
|
+
- [ ] Implement submit logic:
|
|
65
|
+
- If message is empty → CTA button turns **red** and shows `Skip` link
|
|
66
|
+
- **❓ Where to implement validation logic?** (At type form level or button level?)
|
|
67
|
+
- [x] **Editor ↔️ Image Slider Communication**
|
|
68
|
+
- Auto-focus image slider when user types in textarea
|
|
69
|
+
- Improve communication logic between image slider and type form
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
### **🔠 Font Selector**
|
|
74
|
+
|
|
75
|
+
- [ ] **Extract** `font-selector` as a separate reusable component
|
|
76
|
+
- [ ] Optimize font variable passing
|
|
77
|
+
- [ ] Display font preview in dropdown
|
|
78
|
+
- [ ] Enable global font imports
|
|
79
|
+
- [ ] Improve font variable handling in `<pbo-selector>`
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### **📝 Textarea ([src/components/textarea](src/components/textarea))**
|
|
84
|
+
|
|
85
|
+
- [x] Show **current/max characters** indicator
|
|
86
|
+
- [ ] _(Optional)_ Show **current/max lines** indicator
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## **🎛️ Form Controls**
|
|
91
|
+
|
|
92
|
+
### **️ Radio Button, Group, and Button Enhancements**
|
|
93
|
+
|
|
94
|
+
#### **✅ Submit Button ([src/components/button](src/components/button))**
|
|
95
|
+
|
|
96
|
+
- [ ] **Submit Button Logic**
|
|
97
|
+
- Add validation to check form inputs
|
|
98
|
+
- Support `pre-submit` & `post-submit` callbacks:
|
|
99
|
+
- `pre-submit`: E.g. validate stock before adding a card
|
|
100
|
+
- `post-submit`: E.g. update cart after adding a card
|
|
101
|
+
|
|
102
|
+
#### **🎛️ Button Group ([src/components/button-group](src/components/button-group))**
|
|
103
|
+
|
|
104
|
+
- [x] Define group styles
|
|
105
|
+
- [ ] Implement submit validation & error handling
|
|
106
|
+
|
|
107
|
+
#### **🔘 Radio Button ([src/components/radio-button](src/components/radio-button))**
|
|
108
|
+
|
|
109
|
+
- [x] Enhance styling and logic based on button component
|
|
110
|
+
|
|
111
|
+
#### **📻 Radio Group ([src/components/radio-group](src/components/radio-group))**
|
|
112
|
+
|
|
113
|
+
- [x] Define group styles
|
|
114
|
+
- [ ] Implement validation & error handling
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## **📂 Category & Category Image Components**
|
|
119
|
+
|
|
120
|
+
### **📦 Category ([src/components/category](src/components/category))**
|
|
121
|
+
|
|
122
|
+
- [x] Fix **image aspect ratio** (currently responsive)
|
|
123
|
+
- [x] Ensure **responsive slider**:
|
|
124
|
+
- **Desktop:** Show **4** cards
|
|
125
|
+
- **Mobile:** Show **2** cards
|
|
126
|
+
- Hide arrows if fewer than needed cards
|
|
127
|
+
- [x] Add **hover animations**
|
|
128
|
+
- [x] Improve **category title styling**
|
|
129
|
+
|
|
130
|
+
## Roadmap
|
|
131
|
+
|
|
132
|
+
### Preprepare
|
|
133
|
+
|
|
134
|
+
- [x] **Live Documentation for Development and Future Reference**
|
|
135
|
+
_Status_: The basic structure has been initialized using **11ty**. However, the bundling process for `src/components` is not fully configured. Additionally, rendering inline `` `html` `` within Markdown to actual HTML in **11ty** is not yet fully functional.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
### Phase 1: Core Card Editor
|
|
140
|
+
|
|
141
|
+
- [x] **Font Dropdown Selector**
|
|
142
|
+
- [x] **Editor Dropdown Selector**
|
|
143
|
+
- [x] **Text Alignment Button Group**
|
|
144
|
+
- [x] **Text Color Block**
|
|
145
|
+
- [x] **Live Preview (Zoomed View)**
|
|
146
|
+
- [x] **Typing Live Preview**
|
|
147
|
+
- [ ] **Handwritten Live Preview**
|
|
148
|
+
- [x] **Image Slider**
|
|
149
|
+
- [ ] **CTA Button**
|
|
150
|
+
- [ ] **Handwritten Description Section**
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### Phase 2: Core Card Selection
|
|
155
|
+
|
|
156
|
+
- [x] **Image Slider for Card Covers**
|
|
157
|
+
_(4 columns on desktop, 2 columns on mobile)_
|
|
158
|
+
- [x] **Category Selection**
|
|
159
|
+
- [x] **Image Components (Optional)**
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
### Phase 3: Integration Components
|
|
164
|
+
|
|
165
|
+
- [x] **Card Selection - Main Content**
|
|
166
|
+
- [x] **Card Editor (Typing) - Right Content Group**
|
|
167
|
+
- [ ] **Card Editor (Handwritten) - Right Content Group**
|
|
168
|
+
- [ ] **Card Editor (Handwritten) - Content Section**
|
|
169
|
+
- [x] **Card Editor (Typing) - Content Section**
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
### Phase 4: Modal/Pop-up
|
|
174
|
+
|
|
175
|
+
- [ ] **Checkboxes**
|
|
176
|
+
- [x] **Basic Modal Implementation**
|
|
177
|
+
- [x] **Sectioned Form in Modal**
|
|
178
|
+
- [ ] **Modal Submission API**
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
### Phase 5: Abstract Internal Logic
|
|
183
|
+
|
|
184
|
+
- **TBD** _(Detailed planning will be decided later.)_
|
|
185
|
+
|
|
186
|
+
This phase will focus on abstracting internal logic, such as retrieving card data and synchronizing editing information across different components.
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/const z=globalThis,Z=z.ShadowRoot&&(z.ShadyCSS===void 0||z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,G=Symbol(),tt=new WeakMap;let pt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==G)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(Z&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=tt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&tt.set(e,t))}return t}toString(){return this.cssText}};const _t=r=>new pt(typeof r=="string"?r:r+"",void 0,G),J=(r,...t)=>{const e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new pt(e,r,G)},vt=(r,t)=>{if(Z)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),i=z.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},et=Z?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return _t(e)})(r):r;/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2017 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
+
*/const{is:wt,defineProperty:At,getOwnPropertyDescriptor:Et,getOwnPropertyNames:St,getOwnPropertySymbols:Ct,getPrototypeOf:Pt}=Object,_=globalThis,st=_.trustedTypes,xt=st?st.emptyScript:"",D=_.reactiveElementPolyfillSupport,T=(r,t)=>r,F={toAttribute(r,t){switch(t){case Boolean:r=r?xt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},K=(r,t)=>!wt(r,t),it={attribute:!0,type:String,converter:F,reflect:!1,hasChanged:K};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),_.litPropertyMetadata??(_.litPropertyMetadata=new WeakMap);class C extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=it){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&At(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:o}=Et(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i==null?void 0:i.call(this)},set(n){const l=i==null?void 0:i.call(this);o.call(this,n),this.requestUpdate(t,l,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??it}static _$Ei(){if(this.hasOwnProperty(T("elementProperties")))return;const t=Pt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(T("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(T("properties"))){const e=this.properties,s=[...St(e),...Ct(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(et(i))}else t!==void 0&&e.push(et(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s: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(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return vt(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){var o;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const n=(((o=s.converter)==null?void 0:o.toAttribute)!==void 0?s.converter:F).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){var o;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const n=s.getPropertyOptions(i),l=typeof n.converter=="function"?{fromAttribute:n.converter}:((o=n.converter)==null?void 0:o.fromAttribute)!==void 0?n.converter:F;this._$Em=i,this[i]=l.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??K)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[o,n]of i)n.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],n)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(i=>{var o;return(o=i.hostUpdate)==null?void 0:o.call(i)}),this.update(e)):this._$EU()}catch(i){throw t=!1,this._$EU(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}C.elementStyles=[],C.shadowRootOptions={mode:"open"},C[T("elementProperties")]=new Map,C[T("finalized")]=new Map,D==null||D({ReactiveElement:C}),(_.reactiveElementVersions??(_.reactiveElementVersions=[])).push("2.0.4");/**
|
|
10
|
+
* @license
|
|
11
|
+
* Copyright 2017 Google LLC
|
|
12
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
+
*/const O=globalThis,j=O.trustedTypes,rt=j?j.createPolicy("lit-html",{createHTML:r=>r}):void 0,ut="$lit$",b=`lit$${Math.random().toFixed(9).slice(2)}$`,gt="?"+b,Ut=`<${gt}>`,A=document,R=()=>A.createComment(""),k=r=>r===null||typeof r!="object"&&typeof r!="function",Y=Array.isArray,Tt=r=>Y(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",L=`[
|
|
14
|
+
\f\r]`,U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ot=/-->/g,nt=/>/g,v=RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),at=/'/g,lt=/"/g,ft=/^(?:script|style|textarea|title)$/i,Ot=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),W=Ot(1),E=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),dt=new WeakMap,w=A.createTreeWalker(A,129);function mt(r,t){if(!Y(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return rt!==void 0?rt.createHTML(t):t}const Ht=(r,t)=>{const e=r.length-1,s=[];let i,o=t===2?"<svg>":t===3?"<math>":"",n=U;for(let l=0;l<e;l++){const a=r[l];let h,c,d=-1,m=0;for(;m<a.length&&(n.lastIndex=m,c=n.exec(a),c!==null);)m=n.lastIndex,n===U?c[1]==="!--"?n=ot:c[1]!==void 0?n=nt:c[2]!==void 0?(ft.test(c[2])&&(i=RegExp("</"+c[2],"g")),n=v):c[3]!==void 0&&(n=v):n===v?c[0]===">"?(n=i??U,d=-1):c[1]===void 0?d=-2:(d=n.lastIndex-c[2].length,h=c[1],n=c[3]===void 0?v:c[3]==='"'?lt:at):n===lt||n===at?n=v:n===ot||n===nt?n=U:(n=v,i=void 0);const y=n===v&&r[l+1].startsWith("/>")?" ":"";o+=n===U?a+Ut:d>=0?(s.push(h),a.slice(0,d)+ut+a.slice(d)+b+y):a+b+(d===-2?l:y)}return[mt(r,o+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class I{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0;const l=t.length-1,a=this.parts,[h,c]=Ht(t,e);if(this.el=I.createElement(h,s),w.currentNode=this.el.content,e===2||e===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=w.nextNode())!==null&&a.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const d of i.getAttributeNames())if(d.endsWith(ut)){const m=c[n++],y=i.getAttribute(d).split(b),N=/([.?@])?(.*)/.exec(m);a.push({type:1,index:o,name:N[2],strings:y,ctor:N[1]==="."?kt:N[1]==="?"?It:N[1]==="@"?Mt:B}),i.removeAttribute(d)}else d.startsWith(b)&&(a.push({type:6,index:o}),i.removeAttribute(d));if(ft.test(i.tagName)){const d=i.textContent.split(b),m=d.length-1;if(m>0){i.textContent=j?j.emptyScript:"";for(let y=0;y<m;y++)i.append(d[y],R()),w.nextNode(),a.push({type:2,index:++o});i.append(d[m],R())}}}else if(i.nodeType===8)if(i.data===gt)a.push({type:2,index:o});else{let d=-1;for(;(d=i.data.indexOf(b,d+1))!==-1;)a.push({type:7,index:o}),d+=b.length-1}o++}}static createElement(t,e){const s=A.createElement("template");return s.innerHTML=t,s}}function P(r,t,e=r,s){var n,l;if(t===E)return t;let i=s!==void 0?(n=e._$Co)==null?void 0:n[s]:e._$Cl;const o=k(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==o&&((l=i==null?void 0:i._$AO)==null||l.call(i,!1),o===void 0?i=void 0:(i=new o(r),i._$AT(r,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=P(r,i._$AS(r,t.values),i,s)),t}class Rt{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){const{el:{content:e},parts:s}=this._$AD,i=((t==null?void 0:t.creationScope)??A).importNode(e,!0);w.currentNode=i;let o=w.nextNode(),n=0,l=0,a=s[0];for(;a!==void 0;){if(n===a.index){let h;a.type===2?h=new x(o,o.nextSibling,this,t):a.type===1?h=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(h=new Nt(o,this,t)),this._$AV.push(h),a=s[++l]}n!==(a==null?void 0:a.index)&&(o=w.nextNode(),n++)}return w.currentNode=A,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class x{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=P(this,t,e),k(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==E&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Tt(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!==p&&k(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){var o;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=I.createElement(mt(s.h,s.h[0]),this.options)),s);if(((o=this._$AH)==null?void 0:o._$AD)===i)this._$AH.p(e);else{const n=new Rt(i,this),l=n.u(this.options);n.p(e),this.T(l),this._$AH=n}}_$AC(t){let e=dt.get(t.strings);return e===void 0&&dt.set(t.strings,e=new I(t)),e}k(t){Y(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const o of t)i===e.length?e.push(s=new x(this.O(R()),this.O(R()),this,this.options)):s=e[i],s._$AI(o),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class B{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,o){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=p}_$AI(t,e=this,s,i){const o=this.strings;let n=!1;if(o===void 0)t=P(this,t,e,0),n=!k(t)||t!==this._$AH&&t!==E,n&&(this._$AH=t);else{const l=t;let a,h;for(t=o[0],a=0;a<o.length-1;a++)h=P(this,l[s+a],e,a),h===E&&(h=this._$AH[a]),n||(n=!k(h)||h!==this._$AH[a]),h===p?t=p:t!==p&&(t+=(h??"")+o[a+1]),this._$AH[a]=h}n&&!i&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class kt extends B{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}}class It extends B{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}}class Mt extends B{constructor(t,e,s,i,o){super(t,e,s,i,o),this.type=5}_$AI(t,e=this){if((t=P(this,t,e,0)??p)===E)return;const s=this._$AH,i=t===p&&s!==p||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==p&&(s===p||i);i&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Nt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){P(this,t)}}const Qt={I:x},V=O.litHtmlPolyfillSupport;V==null||V(I,x),(O.litHtmlVersions??(O.litHtmlVersions=[])).push("3.2.1");const zt=(r,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const o=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new x(t.insertBefore(R(),o),o,void 0,e??{})}return i._$AI(r),i};/**
|
|
16
|
+
* @license
|
|
17
|
+
* Copyright 2017 Google LLC
|
|
18
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
+
*/let H=class extends C{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=zt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return E}};var ct;H._$litElement$=!0,H.finalized=!0,(ct=globalThis.litElementHydrateSupport)==null||ct.call(globalThis,{LitElement:H});const q=globalThis.litElementPolyfillSupport;q==null||q({LitElement:H});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
|
|
20
|
+
* @license
|
|
21
|
+
* Copyright 2017 Google LLC
|
|
22
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
+
*/const $t=r=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(r,t)}):customElements.define(r,t)};/**
|
|
24
|
+
* @license
|
|
25
|
+
* Copyright 2017 Google LLC
|
|
26
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
+
*/const Ft={attribute:!0,type:String,converter:F,reflect:!1,hasChanged:K},jt=(r=Ft,t,e)=>{const{kind:s,metadata:i}=e;let o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,r),s==="accessor"){const{name:n}=e;return{set(l){const a=t.get.call(this);t.set.call(this,l),this.requestUpdate(n,a,r)},init(l){return l!==void 0&&this.P(n,void 0,r),l}}}if(s==="setter"){const{name:n}=e;return function(l){const a=this[n];t.call(this,l),this.requestUpdate(n,a,r)}}throw Error("Unsupported decorator location: "+s)};function f(r){return(t,e)=>typeof e=="object"?jt(r,t,e):((s,i,o)=>{const n=i.hasOwnProperty(o);return i.constructor.createProperty(o,n?{...s,wrapped:!0}:s),n?Object.getOwnPropertyDescriptor(i,o):void 0})(r,t,e)}/**
|
|
28
|
+
* @license
|
|
29
|
+
* Copyright 2017 Google LLC
|
|
30
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
31
|
+
*/function Q(r){return f({...r,state:!0,attribute:!1})}/**
|
|
32
|
+
* @license
|
|
33
|
+
* Copyright 2017 Google LLC
|
|
34
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
35
|
+
*/const Bt=(r,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(r,t,e),e);/**
|
|
36
|
+
* @license
|
|
37
|
+
* Copyright 2017 Google LLC
|
|
38
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
+
*/function X(r,t){return(e,s,i)=>{const o=n=>{var l;return((l=n.renderRoot)==null?void 0:l.querySelector(r))??null};return Bt(e,s,{get(){return o(this)}})}}function M(r,t){const e={waitUntilFirstUpdate:!1,...t};return function(s,i){const o=Array.isArray(r)?r:[r],{update:n}=s;s.update=function(l){o.forEach(a=>{const h=a;if(l.has(h)){const c=l.get(h),d=this[h];c!==d&&(!e.waitUntilFirstUpdate||this.hasUpdated)&&this[i](c,d)}}),n.call(this,l)}}}const yt=J`
|
|
40
|
+
:host {
|
|
41
|
+
box-sizing: border-box;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:host *,
|
|
45
|
+
:host *::before,
|
|
46
|
+
:host *::after {
|
|
47
|
+
box-sizing: inherit;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
[hidden] {
|
|
51
|
+
display: none !important;
|
|
52
|
+
}
|
|
53
|
+
`;/**
|
|
54
|
+
* @license
|
|
55
|
+
* Copyright 2017 Google LLC
|
|
56
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
57
|
+
*/const Dt={ATTRIBUTE:1,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},Lt=r=>(...t)=>({_$litDirective$:r,values:t});class Vt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
|
|
58
|
+
* @license
|
|
59
|
+
* Copyright 2018 Google LLC
|
|
60
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
61
|
+
*/const ht=Lt(class extends Vt{constructor(r){var t;if(super(r),r.type!==Dt.ATTRIBUTE||r.name!=="class"||((t=r.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(r){return" "+Object.keys(r).filter(t=>r[t]).join(" ")+" "}update(r,[t]){var s,i;if(this.st===void 0){this.st=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in t)t[o]&&!((s=this.nt)!=null&&s.has(o))&&this.st.add(o);return this.render(t)}const e=r.element.classList;for(const o of this.st)o in t||(e.remove(o),this.st.delete(o));for(const o in t){const n=!!t[o];n===this.st.has(o)||(i=this.nt)!=null&&i.has(o)||(n?(e.add(o),this.st.add(o)):(e.remove(o),this.st.delete(o)))}return E}});class bt extends H{emit(t,e){const s=new CustomEvent(t,{bubbles:!0,cancelable:!0,composed:!0,detail:{},...e});return this.dispatchEvent(s),s}}const qt=J`
|
|
62
|
+
:host {
|
|
63
|
+
--size: 70%;
|
|
64
|
+
--header-spacing: var(--pbo-spacing-large);
|
|
65
|
+
--body-spacing: var(--pbo-spacing-large);
|
|
66
|
+
--footer-spacing: var(--pbo-spacing-large);
|
|
67
|
+
--panel-background-color: var(--pbo-panel-background-color);
|
|
68
|
+
--overlay-background-color: var(--pbo-overlay-background-color);
|
|
69
|
+
display: contents;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.drawer {
|
|
73
|
+
top: 0;
|
|
74
|
+
inset-inline-start: 0;
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: 100%;
|
|
77
|
+
pointer-events: none;
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.drawer__overlay {
|
|
82
|
+
display: block;
|
|
83
|
+
position: fixed;
|
|
84
|
+
top: 0;
|
|
85
|
+
right: 0;
|
|
86
|
+
bottom: 0;
|
|
87
|
+
left: 0;
|
|
88
|
+
background-color: var(--overlay-background-color);
|
|
89
|
+
pointer-events: all;
|
|
90
|
+
backdrop-filter: blur(1px);
|
|
91
|
+
-webkit-backdrop-filter: blur(1px);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.drawer--contained .drawer__overlay {
|
|
95
|
+
display: none;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.drawer__panel {
|
|
99
|
+
position: absolute;
|
|
100
|
+
flex-direction: column;
|
|
101
|
+
z-index: 2;
|
|
102
|
+
max-width: 100%;
|
|
103
|
+
max-height: 100%;
|
|
104
|
+
background-color: var(--panel-background-color);
|
|
105
|
+
box-shadow: var(--pbo-shadow-x-large);
|
|
106
|
+
overflow: auto;
|
|
107
|
+
pointer-events: all;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.drawer--bottom .drawer__panel {
|
|
111
|
+
top: auto;
|
|
112
|
+
inset-inline-end: auto;
|
|
113
|
+
bottom: 0;
|
|
114
|
+
inset-inline-start: 0;
|
|
115
|
+
width: 100%;
|
|
116
|
+
height: var(--size);
|
|
117
|
+
border-radius: var(--pbo-border-radius-large) var(--pbo-border-radius-large) 0 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.drawer--left .drawer__panel {
|
|
121
|
+
top: auto;
|
|
122
|
+
inset-inline-end: auto;
|
|
123
|
+
left: 0;
|
|
124
|
+
inset-inline-start: 0;
|
|
125
|
+
height: 100%;
|
|
126
|
+
width: var(--size);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.drawer--right .drawer__panel {
|
|
130
|
+
top: auto;
|
|
131
|
+
inset-inline-end: auto;
|
|
132
|
+
right: 0;
|
|
133
|
+
inset-inline-start: 0;
|
|
134
|
+
height: 100%;
|
|
135
|
+
width: var(--size);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.drawer--top .drawer__panel {
|
|
139
|
+
top: auto;
|
|
140
|
+
inset-inline-end: auto;
|
|
141
|
+
top: 0;
|
|
142
|
+
inset-inline-start: 0;
|
|
143
|
+
width: 100%;
|
|
144
|
+
height: var(--size);
|
|
145
|
+
}
|
|
146
|
+
`;var Wt=Object.defineProperty,Zt=Object.getOwnPropertyDescriptor,S=(r,t,e,s)=>{for(var i=s>1?void 0:s?Zt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&Wt(t,e,i),i};let $=class extends bt{constructor(){super(...arguments),this.open=!1,this.placement="bottom",this.radius=!0,this.contained=!1}requestClose(r){this.hide()}async hide(){this.open=!1,this.emit("pbo-after-drawer-closed")}async show(){this.open||(this.open=!0)}handleOpenChange(){this.open?this.drawer.hidden=!1:this.drawer.hidden=!0}firstUpdated(){this.drawer.hidden=!this.open}render(){return W`
|
|
147
|
+
<div
|
|
148
|
+
part="base"
|
|
149
|
+
class=${ht({drawer:!0,"drawer--bottom":this.placement==="bottom","drawer--top":this.placement==="top","drawer--left":this.placement==="left","drawer--right":this.placement==="right","drawer--open":this.open,"drawer--contained":this.contained})}
|
|
150
|
+
>
|
|
151
|
+
<div part="overlay" class="drawer__overlay" @click=${()=>this.requestClose("overlay")}></div>
|
|
152
|
+
<div
|
|
153
|
+
part="panel"
|
|
154
|
+
class="${ht({drawer__panel:!0})}"
|
|
155
|
+
role="dialog"
|
|
156
|
+
aria-modal="true"
|
|
157
|
+
aria-hidden=${this.open?"false":"true"}
|
|
158
|
+
tabindex="0"
|
|
159
|
+
>
|
|
160
|
+
<slot part="body" class="drawer__body"></slot>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
`}};$.styles=[yt,qt];S([X(".drawer")],$.prototype,"drawer",2);S([f({type:Boolean,reflect:!0})],$.prototype,"open",2);S([f({reflect:!0})],$.prototype,"placement",2);S([f({type:Boolean,reflect:!0})],$.prototype,"radius",2);S([f({type:Boolean,reflect:!0})],$.prototype,"contained",2);S([M("open",{waitUntilFirstUpdate:!0})],$.prototype,"handleOpenChange",1);$=S([$t("pbo-drawer")],$);const Gt=J`
|
|
164
|
+
:host {
|
|
165
|
+
display: block;
|
|
166
|
+
width: 100%;
|
|
167
|
+
height: 100%;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.body {
|
|
171
|
+
overflow: scroll;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.back-button {
|
|
175
|
+
display: flex;
|
|
176
|
+
justify-content: start;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.close-button {
|
|
180
|
+
display: flex;
|
|
181
|
+
justify-content: end;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.header {
|
|
185
|
+
height: 2.5rem;
|
|
186
|
+
padding: 0 var(--pbo-spacing-large);
|
|
187
|
+
user-select: none;
|
|
188
|
+
position: sticky;
|
|
189
|
+
top: 0;
|
|
190
|
+
background-color: var(--pbo-color-gray-100);
|
|
191
|
+
display: grid;
|
|
192
|
+
grid-template-columns: 1fr auto 1fr;
|
|
193
|
+
align-items: center;
|
|
194
|
+
font-size: var(--pbo-font-size-2xl);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.title {
|
|
198
|
+
font-size: var(--pbo-font-size-x-large);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.icon-button {
|
|
202
|
+
all: unset; /* Removes default button styles (border, background, padding, etc.) */
|
|
203
|
+
display: flex;
|
|
204
|
+
align-items: center;
|
|
205
|
+
justify-content: center;
|
|
206
|
+
cursor: pointer;
|
|
207
|
+
color: var(--pbo-color-gray-500); /* Default icon color */
|
|
208
|
+
transition:
|
|
209
|
+
transform 0.2s ease-in-out,
|
|
210
|
+
color 0.2s ease-in-out;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* Apply hover effect */
|
|
214
|
+
.icon-button:hover {
|
|
215
|
+
transform: scale(1.1); /* Slightly enlarges the icon */
|
|
216
|
+
color: var(--pbo-color-gray-700); /* Changes icon color on hover */
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.page-manager {
|
|
220
|
+
position: relative;
|
|
221
|
+
height: 100%;
|
|
222
|
+
width: 100%;
|
|
223
|
+
display: grid;
|
|
224
|
+
grid-template-rows: min-content auto;
|
|
225
|
+
grid-gap: 0;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.category-selection {
|
|
229
|
+
display: grid;
|
|
230
|
+
height: 100%;
|
|
231
|
+
grid-template-columns: repeat(12, 1fr);
|
|
232
|
+
padding: var(--pbo-spacing-small);
|
|
233
|
+
}
|
|
234
|
+
@media screen and (min-width: 640px) {
|
|
235
|
+
.category-selection {
|
|
236
|
+
padding: var(--pbo-spacing-medium);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.category-selection pbo-card-selection {
|
|
241
|
+
grid-column: 1 / span 12;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.editor {
|
|
245
|
+
padding: var(--pbo-spacing-small);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
@media screen and (min-width: 640px) {
|
|
249
|
+
.editor {
|
|
250
|
+
padding: var(--pbo-spacing-medium);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
@media screen and (min-width: 768px) {
|
|
255
|
+
.category-selection pbo-card-selection {
|
|
256
|
+
grid-column: 2 / span 10;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
@media screen and (min-width: 1280px) {
|
|
261
|
+
.category-selection pbo-card-selection {
|
|
262
|
+
grid-column: 4 / span 7;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
`;var Jt=Object.defineProperty,Kt=Object.getOwnPropertyDescriptor,g=(r,t,e,s)=>{for(var i=s>1?void 0:s?Kt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&Jt(t,e,i),i};let u=class extends bt{constructor(){super(...arguments),this.onClose=()=>{},this.currentPage="selection",this.categories=[],this.selectedCard=null,this.selectedCardId=null,this.selectedCardDetails=null,this.handleCardSelected=r=>{const{cardId:t}=r.detail,e=this.findCardInCategoryById(t);console.log(r),this.editorEl.card=e,this.goToEditor()}}handleSubmitTypeFormUpdate(){this.editorEl.submitTypeForm=async r=>{this.submitTypeForm&&(this.editorEl.typeForm.disabled=!0,this.editorEl.typeForm.loading=!0,await this.submitTypeForm(r),this.editorEl.typeForm.disabled=!1,this.editorEl.typeForm.loading=!1)}}handleSubmitHandwrittenFormUpdate(){this.editorEl.submitHandwrittenForm=async r=>{this.submitHandwrittenForm&&(this.editorEl.handwrittenForm.isSubmitDisabled=!0,this.editorEl.handwrittenForm.isSubmitLoading=!0,await this.submitHandwrittenForm(r),this.editorEl.handwrittenForm.isSubmitDisabled=!1,this.editorEl.handwrittenForm.isSubmitLoading=!1)}}handleGetProcessedImgUpdate(){this.editorEl.getProcessedImg=this.getProcessedImg}goToEditor(){this.currentPage="editor"}goToSelector(){this.currentPage="selection"}connectedCallback(){var r;super.connectedCallback(),(r=this.shadowRoot)==null||r.addEventListener("pbo-category-card-selected",this.handleCardSelected)}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this.shadowRoot)==null||r.removeEventListener("pbo-category-card-selected",this.handleCardSelected)}firstUpdated(){this.cardSelectionEl.categories=this.categories}handleCategoriesUpdate(){console.log(this.categories),this.cardSelectionEl&&this.categories!==void 0&&this.categories.length>0&&(this.cardSelectionEl.categories=this.categories,this.requestUpdate())}findCardInCategoryById(r){console.log("Categories from findCardInCategoryById",this.categories);for(const t of this.categories){const e=t.cards.find(s=>s.pboId===r);if(console.log("card from findCardInCategoryById",e),e)return e}return null}render(){return W`
|
|
266
|
+
<div part="base" class="page-manager">
|
|
267
|
+
<div class="header">
|
|
268
|
+
<div class="back-button">
|
|
269
|
+
${this.currentPage!=="selection"?W`<button @click=${this.goToSelector} class="icon-button">
|
|
270
|
+
<svg
|
|
271
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
272
|
+
height="24px"
|
|
273
|
+
viewBox="0 -960 960 960"
|
|
274
|
+
width="24px"
|
|
275
|
+
fill="currentColor"
|
|
276
|
+
>
|
|
277
|
+
<path d="m313-440 224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z" />
|
|
278
|
+
</svg>
|
|
279
|
+
</button>`:""}
|
|
280
|
+
</div>
|
|
281
|
+
<div class="title">${this.currentPage==="selection"?"SELECT CARD":"PERSONALIZE"}</div>
|
|
282
|
+
<div class="close-button">
|
|
283
|
+
<button @click=${this.onClose} class="icon-button">
|
|
284
|
+
<svg
|
|
285
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
286
|
+
height="24px"
|
|
287
|
+
viewBox="0 -960 960 960"
|
|
288
|
+
width="24px"
|
|
289
|
+
fill="currentColor"
|
|
290
|
+
>
|
|
291
|
+
<path
|
|
292
|
+
d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"
|
|
293
|
+
/>
|
|
294
|
+
</svg>
|
|
295
|
+
</button>
|
|
296
|
+
</div>
|
|
297
|
+
</div>
|
|
298
|
+
<div class="body">
|
|
299
|
+
<div class="category-selection" ?hidden=${this.currentPage!=="selection"}>
|
|
300
|
+
<pbo-card-selection name="selection"></pbo-card-selection>
|
|
301
|
+
</div>
|
|
302
|
+
<div class="editor" ?hidden=${this.currentPage!=="editor"}>
|
|
303
|
+
<pbo-editor name="editor" ?hidden=${this.currentPage!=="editor"}></pbo-editor>
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
</div>
|
|
307
|
+
`}};u.styles=[yt,Gt];g([X("pbo-card-selection")],u.prototype,"cardSelectionEl",2);g([X("pbo-editor")],u.prototype,"editorEl",2);g([f({type:Function})],u.prototype,"onClose",2);g([f({type:String,reflect:!0})],u.prototype,"currentPage",2);g([f()],u.prototype,"categories",2);g([f()],u.prototype,"submitTypeForm",2);g([f()],u.prototype,"submitHandwrittenForm",2);g([f()],u.prototype,"getProcessedImg",2);g([Q()],u.prototype,"selectedCard",2);g([Q()],u.prototype,"selectedCardId",2);g([Q()],u.prototype,"selectedCardDetails",2);g([M("submitTypeForm")],u.prototype,"handleSubmitTypeFormUpdate",1);g([M("submitHandwrittenForm")],u.prototype,"handleSubmitHandwrittenFormUpdate",1);g([M("getProcessedImg")],u.prototype,"handleGetProcessedImgUpdate",1);g([M("categories")],u.prototype,"handleCategoriesUpdate",1);u=g([$t("pbo-page-manager")],u);export{zt as B,p as E,bt as P,E as T,Qt as Z,X as a,Q as b,yt as c,_t as d,Bt as e,ht as f,Lt as g,Vt as h,J as i,Dt as j,$ as k,u as l,f as n,H as r,$t as t,M as w,W as x};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root,:host,.pbo-theme-default{--pbo-color-gray-50: rgb(249 249 250);--pbo-color-gray-100: rgb(235 236 238);--pbo-color-gray-200: rgb(220 222 225);--pbo-color-gray-300: rgb(204 207 211);--pbo-color-gray-400: rgb(183 186 193);--pbo-color-gray-500: rgb(155 160 169);--pbo-color-gray-600: rgb(126 132 144);--pbo-color-gray-700: rgb(102 108 122);--pbo-color-gray-800: rgb(84 89 100);--pbo-color-gray-900: rgb(59 63 71);--pbo-color-gray-950: rgb(36 39 44);--pbo-color-red-50: rgb(253 248 248);--pbo-color-red-100: rgb(248 233 233);--pbo-color-red-200: rgb(243 216 216);--pbo-color-red-300: rgb(237 197 197);--pbo-color-red-400: rgb(229 172 172);--pbo-color-red-500: rgb(219 138 138);--pbo-color-red-600: rgb(207 99 99);--pbo-color-red-700: rgb(195 59 59);--pbo-color-red-800: rgb(175 27 27);--pbo-color-red-900: rgb(127 19 19);--pbo-color-red-950: rgb(80 12 12);--pbo-color-orange-50: rgb(254 249 244);--pbo-color-orange-100: rgb(250 233 219);--pbo-color-orange-200: rgb(246 217 191);--pbo-color-orange-300: rgb(242 198 161);--pbo-color-orange-400: rgb(236 173 118);--pbo-color-orange-500: rgb(228 138 60);--pbo-color-orange-600: rgb(211 100 3);--pbo-color-orange-700: rgb(174 82 2);--pbo-color-orange-800: rgb(143 68 2);--pbo-color-orange-900: rgb(102 48 1);--pbo-color-orange-950: rgb(63 30 1);--pbo-color-amber-50: rgb(253 249 243);--pbo-color-amber-100: rgb(249 234 217);--pbo-color-amber-200: rgb(245 218 187);--pbo-color-amber-300: rgb(240 200 154);--pbo-color-amber-400: rgb(233 175 108);--pbo-color-amber-500: rgb(223 141 46);--pbo-color-amber-600: rgb(199 109 5);--pbo-color-amber-700: rgb(163 89 5);--pbo-color-amber-800: rgb(135 74 4);--pbo-color-amber-900: rgb(96 53 3);--pbo-color-amber-950: rgb(59 32 2);--pbo-color-yellow-50: rgb(253 249 237);--pbo-color-yellow-100: rgb(250 236 193);--pbo-color-yellow-200: rgb(245 221 143);--pbo-color-yellow-300: rgb(241 203 86);--pbo-color-yellow-400: rgb(232 178 8);--pbo-color-yellow-500: rgb(200 153 7);--pbo-color-yellow-600: rgb(165 126 6);--pbo-color-yellow-700: rgb(135 104 5);--pbo-color-yellow-800: rgb(112 85 4);--pbo-color-yellow-900: rgb(79 61 3);--pbo-color-yellow-950: rgb(49 37 2);--pbo-color-lime-50: rgb(247 250 243);--pbo-color-lime-100: rgb(230 240 215);--pbo-color-lime-200: rgb(211 228 185);--pbo-color-lime-300: rgb(189 216 151);--pbo-color-lime-400: rgb(160 198 106);--pbo-color-lime-500: rgb(121 175 45);--pbo-color-lime-600: rgb(91 147 12);--pbo-color-lime-700: rgb(75 120 10);--pbo-color-lime-800: rgb(62 99 8);--pbo-color-lime-900: rgb(44 71 6);--pbo-color-lime-950: rgb(27 43 3);--pbo-color-green-50: rgb(246 250 248);--pbo-color-green-100: rgb(226 239 231);--pbo-color-green-200: rgb(205 228 213);--pbo-color-green-300: rgb(180 215 193);--pbo-color-green-400: rgb(148 197 166);--pbo-color-green-500: rgb(106 174 131);--pbo-color-green-600: rgb(59 148 92);--pbo-color-green-700: rgb(20 124 59);--pbo-color-green-800: rgb(17 103 49);--pbo-color-green-900: rgb(12 73 35);--pbo-color-green-950: rgb(7 45 22);--pbo-color-emerald-50: rgb(245 251 249);--pbo-color-emerald-100: rgb(221 241 234);--pbo-color-emerald-200: rgb(194 230 219);--pbo-color-emerald-300: rgb(165 217 201);--pbo-color-emerald-400: rgb(125 200 177);--pbo-color-emerald-500: rgb(71 178 144);--pbo-color-emerald-600: rgb(6 150 106);--pbo-color-emerald-700: rgb(4 124 86);--pbo-color-emerald-800: rgb(3 102 71);--pbo-color-emerald-900: rgb(2 73 51);--pbo-color-emerald-950: rgb(2 45 32);--pbo-color-teal-50: rgb(245 251 250);--pbo-color-teal-100: rgb(221 240 238);--pbo-color-teal-200: rgb(195 229 226);--pbo-color-teal-300: rgb(167 216 212);--pbo-color-teal-400: rgb(127 199 192);--pbo-color-teal-500: rgb(75 175 166);--pbo-color-teal-600: rgb(13 148 136);--pbo-color-teal-700: rgb(11 121 112);--pbo-color-teal-800: rgb(9 100 92);--pbo-color-teal-900: rgb(6 71 66);--pbo-color-teal-950: rgb(4 44 41);--pbo-color-cyan-50: rgb(245 250 252);--pbo-color-cyan-100: rgb(221 240 244);--pbo-color-cyan-200: rgb(194 228 236);--pbo-color-cyan-300: rgb(165 215 227);--pbo-color-cyan-400: rgb(124 197 214);--pbo-color-cyan-500: rgb(70 172 197);--pbo-color-cyan-600: rgb(8 144 176);--pbo-color-cyan-700: rgb(7 118 145);--pbo-color-cyan-800: rgb(5 97 120);--pbo-color-cyan-900: rgb(4 69 85);--pbo-color-cyan-950: rgb(2 43 53);--pbo-color-sky-50: rgb(245 250 253);--pbo-color-sky-100: rgb(222 239 248);--pbo-color-sky-200: rgb(197 227 242);--pbo-color-sky-300: rgb(169 213 236);--pbo-color-sky-400: rgb(130 194 227);--pbo-color-sky-500: rgb(78 169 216);--pbo-color-sky-600: rgb(17 139 202);--pbo-color-sky-700: rgb(2 114 172);--pbo-color-sky-800: rgb(1 94 142);--pbo-color-sky-900: rgb(1 67 101);--pbo-color-sky-950: rgb(1 42 63);--pbo-color-blue-50: rgb(248 249 254);--pbo-color-blue-100: rgb(231 236 251);--pbo-color-blue-200: rgb(213 222 248);--pbo-color-blue-300: rgb(193 206 244);--pbo-color-blue-400: rgb(166 185 240);--pbo-color-blue-500: rgb(131 158 234);--pbo-color-blue-600: rgb(92 127 227);--pbo-color-blue-700: rgb(56 99 221);--pbo-color-blue-800: rgb(28 76 210);--pbo-color-blue-900: rgb(20 54 150);--pbo-color-blue-950: rgb(13 34 93);--pbo-color-indigo-50: rgb(249 249 254);--pbo-color-indigo-100: rgb(236 235 252);--pbo-color-indigo-200: rgb(221 219 250);--pbo-color-indigo-300: rgb(205 202 248);--pbo-color-indigo-400: rgb(183 179 244);--pbo-color-indigo-500: rgb(155 150 240);--pbo-color-indigo-600: rgb(124 117 236);--pbo-color-indigo-700: rgb(95 87 231);--pbo-color-indigo-800: rgb(73 65 213);--pbo-color-indigo-900: rgb(52 46 152);--pbo-color-indigo-950: rgb(33 29 94);--pbo-color-violet-50: rgb(251 248 254);--pbo-color-violet-100: rgb(240 233 253);--pbo-color-violet-200: rgb(229 216 251);--pbo-color-violet-300: rgb(217 198 250);--pbo-color-violet-400: rgb(201 173 248);--pbo-color-violet-500: rgb(179 140 245);--pbo-color-violet-600: rgb(154 103 241);--pbo-color-violet-700: rgb(130 67 238);--pbo-color-violet-800: rgb(108 51 207);--pbo-color-violet-900: rgb(77 36 148);--pbo-color-violet-950: rgb(48 23 92);--pbo-color-purple-50: rgb(251 248 254);--pbo-color-purple-100: rgb(243 232 253);--pbo-color-purple-200: rgb(234 215 251);--pbo-color-purple-300: rgb(224 196 249);--pbo-color-purple-400: rgb(210 170 246);--pbo-color-purple-500: rgb(192 135 243);--pbo-color-purple-600: rgb(170 95 239);--pbo-color-purple-700: rgb(149 54 234);--pbo-color-purple-800: rgb(124 43 197);--pbo-color-purple-900: rgb(89 31 141);--pbo-color-purple-950: rgb(55 19 88);--pbo-color-fuchsia-50: rgb(253 248 254);--pbo-color-fuchsia-100: rgb(248 231 250);--pbo-color-fuchsia-200: rgb(243 212 246);--pbo-color-fuchsia-300: rgb(237 192 242);--pbo-color-fuchsia-400: rgb(228 163 236);--pbo-color-fuchsia-500: rgb(217 125 229);--pbo-color-fuchsia-600: rgb(203 76 219);--pbo-color-fuchsia-700: rgb(180 36 198);--pbo-color-fuchsia-800: rgb(149 30 164);--pbo-color-fuchsia-900: rgb(107 21 118);--pbo-color-fuchsia-950: rgb(67 13 74);--pbo-color-pink-50: rgb(254 248 250);--pbo-color-pink-100: rgb(251 231 240);--pbo-color-pink-200: rgb(248 213 228);--pbo-color-pink-300: rgb(245 192 215);--pbo-color-pink-400: rgb(240 164 198);--pbo-color-pink-500: rgb(233 125 173);--pbo-color-pink-600: rgb(225 75 142);--pbo-color-pink-700: rgb(202 36 110);--pbo-color-pink-800: rgb(168 30 91);--pbo-color-pink-900: rgb(121 22 66);--pbo-color-pink-950: rgb(76 14 41);--pbo-color-rose-50: rgb(254 248 249);--pbo-color-rose-100: rgb(252 231 236);--pbo-color-rose-200: rgb(249 213 221);--pbo-color-rose-300: rgb(247 192 204);--pbo-color-rose-400: rgb(243 164 181);--pbo-color-rose-500: rgb(238 125 150);--pbo-color-rose-600: rgb(231 74 109);--pbo-color-rose-700: rgb(211 27 67);--pbo-color-rose-800: rgb(175 23 56);--pbo-color-rose-900: rgb(126 16 40);--pbo-color-rose-950: rgb(80 10 26);--pbo-color-primary-50: var(--pbo-color-sky-50);--pbo-color-primary-100: var(--pbo-color-sky-100);--pbo-color-primary-200: var(--pbo-color-sky-200);--pbo-color-primary-300: var(--pbo-color-sky-300);--pbo-color-primary-400: var(--pbo-color-sky-400);--pbo-color-primary-500: var(--pbo-color-sky-500);--pbo-color-primary-600: var(--pbo-color-sky-600);--pbo-color-primary-700: var(--pbo-color-sky-700);--pbo-color-primary-800: var(--pbo-color-sky-800);--pbo-color-primary-900: var(--pbo-color-sky-900);--pbo-color-primary-950: var(--pbo-color-sky-950);--pbo-color-success-50: var(--pbo-color-green-50);--pbo-color-success-100: var(--pbo-color-green-100);--pbo-color-success-200: var(--pbo-color-green-200);--pbo-color-success-300: var(--pbo-color-green-300);--pbo-color-success-400: var(--pbo-color-green-400);--pbo-color-success-500: var(--pbo-color-green-500);--pbo-color-success-600: var(--pbo-color-green-600);--pbo-color-success-700: var(--pbo-color-green-700);--pbo-color-success-800: var(--pbo-color-green-800);--pbo-color-success-900: var(--pbo-color-green-900);--pbo-color-success-950: var(--pbo-color-green-950);--pbo-color-warning-50: var(--pbo-color-amber-50);--pbo-color-warning-100: var(--pbo-color-amber-100);--pbo-color-warning-200: var(--pbo-color-amber-200);--pbo-color-warning-300: var(--pbo-color-amber-300);--pbo-color-warning-400: var(--pbo-color-amber-400);--pbo-color-warning-500: var(--pbo-color-amber-500);--pbo-color-warning-600: var(--pbo-color-amber-600);--pbo-color-warning-700: var(--pbo-color-amber-700);--pbo-color-warning-800: var(--pbo-color-amber-800);--pbo-color-warning-900: var(--pbo-color-amber-900);--pbo-color-warning-950: var(--pbo-color-amber-950);--pbo-color-danger-50: var(--pbo-color-red-50);--pbo-color-danger-100: var(--pbo-color-red-100);--pbo-color-danger-200: var(--pbo-color-red-200);--pbo-color-danger-300: var(--pbo-color-red-300);--pbo-color-danger-400: var(--pbo-color-red-400);--pbo-color-danger-500: var(--pbo-color-red-500);--pbo-color-danger-600: var(--pbo-color-red-600);--pbo-color-danger-700: var(--pbo-color-red-700);--pbo-color-danger-800: var(--pbo-color-red-800);--pbo-color-danger-900: var(--pbo-color-red-900);--pbo-color-danger-950: var(--pbo-color-red-950);--pbo-color-neutral-50: var(--pbo-color-gray-50);--pbo-color-neutral-100: var(--pbo-color-gray-100);--pbo-color-neutral-200: var(--pbo-color-gray-200);--pbo-color-neutral-300: var(--pbo-color-gray-300);--pbo-color-neutral-400: var(--pbo-color-gray-400);--pbo-color-neutral-500: var(--pbo-color-gray-500);--pbo-color-neutral-600: var(--pbo-color-gray-600);--pbo-color-neutral-700: var(--pbo-color-gray-700);--pbo-color-neutral-800: var(--pbo-color-gray-800);--pbo-color-neutral-900: var(--pbo-color-gray-900);--pbo-color-neutral-950: var(--pbo-color-gray-950);--pbo-color-neutral-0: rgb(255 255 255);--pbo-color-neutral-1000: rgb(0 0 0);--pbo-border-radius-small: .125rem;--pbo-border-radius-medium: .25rem;--pbo-border-radius-large: .5rem;--pbo-border-radius-x-large: 1rem;--pbo-shadow-x-small: 0 1px 2px hsl(240 3.8% 46.1% / 6%);--pbo-shadow-small: 0 1px 2px hsl(240 3.8% 46.1% / 12%);--pbo-shadow-medium: 0 2px 4px hsl(240 3.8% 46.1% / 12%);--pbo-shadow-large: 0 2px 8px hsl(240 3.8% 46.1% / 12%);--pbo-shadow-x-large: 0 4px 16px hsl(240 3.8% 46.1% / 12%);--pbo-spacing-3x-small: .125rem;--pbo-spacing-2x-small: .25rem;--pbo-spacing-x-small: .5rem;--pbo-spacing-small: .75rem;--pbo-spacing-medium: 1rem;--pbo-spacing-large: 1.25rem;--pbo-spacing-x-large: 1.75rem;--pbo-spacing-2x-large: 2.25rem;--pbo-spacing-3x-large: 3rem;--pbo-spacing-4x-large: 4.5rem;--pbo-transition-x-slow: 1s;--pbo-transition-slow: .5s;--pbo-transition-medium: .25s;--pbo-transition-fast: .15s;--pbo-transition-x-fast: 50ms;--pbo-font-mono: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;--pbo-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--pbo-font-serif: Georgia, "Times New Roman", serif;--pbo-font-size-2x-small: .625rem;--pbo-font-size-x-small: .75rem;--pbo-font-size-small: .875rem;--pbo-font-size-medium: 1rem;--pbo-font-size-large: 1.25rem;--pbo-font-size-x-large: 1.5rem;--pbo-font-size-2x-large: 2.25rem;--pbo-font-size-3x-large: 3rem;--pbo-font-size-4x-large: 4.5rem;--pbo-font-weight-light: 300;--pbo-font-weight-normal: 400;--pbo-font-weight-semibold: 500;--pbo-font-weight-bold: 700;--pbo-letter-spacing-denser: -.03em;--pbo-letter-spacing-dense: -.015em;--pbo-letter-spacing-normal: normal;--pbo-letter-spacing-loose: .075em;--pbo-letter-spacing-looser: .15em;--pbo-line-height-denser: 1;--pbo-line-height-dense: 1.4;--pbo-line-height-normal: 1.8;--pbo-line-height-loose: 2.2;--pbo-line-height-looser: 2.6;--pbo-focus-ring-color: var(--pbo-color-primary-600);--pbo-focus-ring-style: solid;--pbo-focus-ring-width: 3px;--pbo-focus-ring: var(--pbo-focus-ring-style) var(--pbo-focus-ring-width) var(--pbo-focus-ring-color);--pbo-focus-ring-offset: 1px;--pbo-button-font-size-small: var(--pbo-font-size-x-small);--pbo-button-font-size-medium: var(--pbo-font-size-small);--pbo-button-font-size-large: var(--pbo-font-size-medium);--pbo-input-height-small: 1.875rem;--pbo-input-height-medium: 2.5rem;--pbo-input-height-large: 3.125rem;--pbo-input-background-color: var(--pbo-color-neutral-0);--pbo-input-background-color-hover: var(--pbo-input-background-color);--pbo-input-background-color-focus: var(--pbo-input-background-color);--pbo-input-background-color-disabled: var(--pbo-color-neutral-100);--pbo-input-border-color: var(--pbo-color-neutral-300);--pbo-input-border-color-hover: var(--pbo-color-neutral-400);--pbo-input-border-color-focus: var(--pbo-color-primary-500);--pbo-input-border-color-disabled: var(--pbo-color-neutral-300);--pbo-input-border-width: 1px;--pbo-input-required-content: "*";--pbo-input-required-content-offset: -2px;--pbo-input-required-content-color: var(--pbo-input-label-color);--pbo-input-border-radius-small: var(--pbo-border-radius-medium);--pbo-input-border-radius-medium: var(--pbo-border-radius-medium);--pbo-input-border-radius-large: var(--pbo-border-radius-medium);--pbo-input-font-family: var(--pbo-font-sans);--pbo-input-font-weight: var(--pbo-font-weight-normal);--pbo-input-font-size-small: var(--pbo-font-size-small);--pbo-input-font-size-medium: var(--pbo-font-size-medium);--pbo-input-font-size-large: var(--pbo-font-size-large);--pbo-input-letter-spacing: var(--pbo-letter-spacing-normal);--pbo-input-color: var(--pbo-color-neutral-700);--pbo-input-color-hover: var(--pbo-color-neutral-700);--pbo-input-color-focus: var(--pbo-color-neutral-700);--pbo-input-color-disabled: var(--pbo-color-neutral-900);--pbo-input-icon-color: var(--pbo-color-neutral-500);--pbo-input-icon-color-hover: var(--pbo-color-neutral-600);--pbo-input-icon-color-focus: var(--pbo-color-neutral-600);--pbo-input-placeholder-color: var(--pbo-color-neutral-500);--pbo-input-placeholder-color-disabled: var(--pbo-color-neutral-600);--pbo-input-spacing-small: var(--pbo-spacing-small);--pbo-input-spacing-medium: var(--pbo-spacing-medium);--pbo-input-spacing-large: var(--pbo-spacing-large);--pbo-input-focus-ring-color: hsl(198.6 88.7% 48.4% / 40%);--pbo-input-focus-ring-offset: 0;--pbo-input-filled-background-color: var(--pbo-color-neutral-100);--pbo-input-filled-background-color-hover: var(--pbo-color-neutral-100);--pbo-input-filled-background-color-focus: var(--pbo-color-neutral-100);--pbo-input-filled-background-color-disabled: var(--pbo-color-neutral-100);--pbo-input-filled-color: var(--pbo-color-neutral-800);--pbo-input-filled-color-hover: var(--pbo-color-neutral-800);--pbo-input-filled-color-focus: var(--pbo-color-neutral-700);--pbo-input-filled-color-disabled: var(--pbo-color-neutral-800);--pbo-input-label-font-size-small: var(--pbo-font-size-small);--pbo-input-label-font-size-medium: var(--pbo-font-size-medium);--pbo-input-label-font-size-large: var(--pbo-font-size-large);--pbo-input-label-color: inherit;--pbo-input-help-text-font-size-small: var(--pbo-font-size-x-small);--pbo-input-help-text-font-size-medium: var(--pbo-font-size-small);--pbo-input-help-text-font-size-large: var(--pbo-font-size-medium);--pbo-input-help-text-color: var(--pbo-color-neutral-500);--pbo-toggle-size-small: .875rem;--pbo-toggle-size-medium: 1.125rem;--pbo-toggle-size-large: 1.375rem;--pbo-overlay-background-color: hsl(240 3.8% 46.1% / 33%);--pbo-panel-background-color: var(--pbo-color-neutral-0);--pbo-panel-border-color: var(--pbo-color-neutral-200);--pbo-panel-border-width: 1px;--pbo-tooltip-border-radius: var(--pbo-border-radius-medium);--pbo-tooltip-background-color: var(--pbo-color-neutral-800);--pbo-tooltip-color: var(--pbo-color-neutral-0);--pbo-tooltip-font-family: var(--pbo-font-sans);--pbo-tooltip-font-weight: var(--pbo-font-weight-normal);--pbo-tooltip-font-size: var(--pbo-font-size-small);--pbo-tooltip-line-height: var(--pbo-line-height-dense);--pbo-tooltip-padding: var(--pbo-spacing-2x-small) var(--pbo-spacing-x-small);--pbo-tooltip-arrow-size: 6px;--pbo-z-index-drawer: 700;--pbo-z-index-dialog: 800;--pbo-z-index-dropdown: 900;--pbo-z-index-toast: 950;--pbo-z-index-tooltip: 1000}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as c,l as w}from"./assets/page-manager.component-Dzd6xKY5.js";class b{constructor({getCards:e,getCategories:t,drawer:l,pageManager:f,giftOptions:u,selectionGroupBy:o="category",submitTypeForm:a,submitHandwrittenForm:g,getProcessedImg:h}){this._isLoading={isLoading:!1,isError:!1},this._cards=[],this._categories=[],this.setDrawer(l||null),this.setPageManager(f||null),this.setGiftOptions(u||null);const r=this.getDrawer(),n=this.getPageManager(),i=this.getGiftOptions();if(!n)throw new Error("Page manager element is required");if(r&&(console.log(r),document.addEventListener("pbo-open-drawer",s=>{console.log("pbo-open-drawer event triggered",s),r==null||r.show()})),r==null||r.addEventListener("pbo-after-drawer-closed",()=>{i==null||i.setPremiumEnabled(!1)}),n.onClose=()=>{r==null||r.hide()},o==="category"){if(!t)throw new Error("getCategories function is required when selectionGroupBy is 'category'");this.setIsLoading(!0),t().then(s=>{this.setCategories(s)}).catch(s=>{console.error("Failed to fetch categories:",s),this.setIsError(!0)}).finally(()=>{this.setIsLoading(!1)})}if(o==="none"){if(!e)throw new Error("getCards function is required when selectionGroupBy is 'none'");this.setIsLoading(!0),e().then(s=>{this.setCards(s)}).catch(s=>{console.error("Failed to fetch cards:",s),this.setIsError(!0)}).finally(()=>{this.setIsLoading(!1)})}a&&(n.submitTypeForm=a),g&&(n.submitHandwrittenForm=g),h&&(n.getProcessedImg=h)}setDrawer(e){if(this._drawer===null||this._drawer)throw new Error("Drawer can only be set during initialization");if(e===null){this._drawer=null;return}switch(typeof e){case"string":const t=document.querySelector(e);if(!t)throw new Error(`Drawer element with selector ${e} not found`);this._drawer=t;break;case"object":if(e instanceof c){this._drawer=e;break}throw new Error("Drawer must be a string or an instance of PboDrawer");default:throw new Error("Drawer must be a string or an instance of PboDrawer")}}getDrawer(){return this._drawer}setGiftOptions(e){if(this._giftOptions===null||this._giftOptions)throw new Error("Gift options can only be set during initialization");if(e===null){this._giftOptions=null;return}switch(typeof e){case"string":const t=document.querySelector(e);if(!t)throw new Error(`Gift options element with selector "${e}" not found`);this._giftOptions=t;return;case"object":if(e instanceof c){this._giftOptions=e;return}throw new Error("Gift options must be a string or an instance of PboDrawer");default:throw new Error("Gift options must be a string or an instance of PboDrawer")}}getGiftOptions(){return this._giftOptions}setPageManager(e){if(this._pageManager===null||this._pageManager)throw new Error("Page manager can only be set during initialization");if(e===null){this._pageManager=null;return}switch(typeof e){case"string":const t=document.querySelector(e);if(!t)throw new Error(`Page manager element with selector "${e}" not found`);this._pageManager=t;return;case"object":if(e instanceof w){this._pageManager=e;return}throw new Error("Page manager must be a string or an instance of PboDrawer");default:throw new Error("Page manager must be a string or an instance of PboDrawer")}}getPageManager(){return this._pageManager}getCategories(){return this._categories}setCategories(e){this._categories=e,this._pageManager?this._pageManager.categories=e:console.warn("Page manager is not set, categories will not be updated")}getCards(){return this._cards}setCards(e){this._cards=e,this._pageManager||console.warn("Page manager is not set, cards will not be updated")}setIsLoading(e){this._isLoading.isLoading=e}setIsError(e){this._isLoading.isError=e}}export{b as PboBridge};
|