light-chain-open-ui 1.0.4 → 1.0.5
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/dist/{button-ClBAD6mB.js → button-BnE0JWRX.js} +18 -3
- package/dist/{button-BN6fkYfk.cjs → button-DGQ4b8f2.cjs} +3 -3
- package/dist/lightchain-ui.cjs +1 -1
- package/dist/lightchain-ui.mjs +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.mjs +1 -1
- package/dist/types/components/enum-selector/enum-selector.d.ts +6 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1090,7 +1090,7 @@ x([y({ type: String })], C.prototype, "label", void 0), x([y({ type: String })],
|
|
|
1090
1090
|
//#region src/components/enum-selector/enum-selector.ts
|
|
1091
1091
|
var w = class extends a {
|
|
1092
1092
|
constructor(...e) {
|
|
1093
|
-
super(...e), this.label = "", this.name = "", this.value = "", this.mode = "button", this.multiple = !1, this.required = !1, this.disabled = !1, this.showIcon = !1, this.options =
|
|
1093
|
+
super(...e), this.label = "", this.name = "", this.value = "", this.mode = "button", this.multiple = !1, this.required = !1, this.disabled = !1, this.showIcon = !1, this.options = [];
|
|
1094
1094
|
}
|
|
1095
1095
|
static {
|
|
1096
1096
|
this.styles = o`
|
|
@@ -1220,8 +1220,10 @@ var w = class extends a {
|
|
|
1220
1220
|
`;
|
|
1221
1221
|
}
|
|
1222
1222
|
get parsedOptions() {
|
|
1223
|
+
if (typeof this.options != "string") return this.options;
|
|
1223
1224
|
try {
|
|
1224
|
-
|
|
1225
|
+
let e = JSON.parse(this.options);
|
|
1226
|
+
return Array.isArray(e) ? e : [];
|
|
1225
1227
|
} catch {
|
|
1226
1228
|
return [];
|
|
1227
1229
|
}
|
|
@@ -1357,7 +1359,20 @@ var w = class extends a {
|
|
|
1357
1359
|
x([y({ type: String })], w.prototype, "label", void 0), x([y({ type: String })], w.prototype, "name", void 0), x([y()], w.prototype, "value", void 0), x([y({ type: String })], w.prototype, "mode", void 0), x([y({ type: Boolean })], w.prototype, "multiple", void 0), x([y({ type: Boolean })], w.prototype, "required", void 0), x([y({ type: Boolean })], w.prototype, "disabled", void 0), x([y({
|
|
1358
1360
|
type: Boolean,
|
|
1359
1361
|
attribute: "show-icon"
|
|
1360
|
-
})], w.prototype, "showIcon", void 0), x([y({
|
|
1362
|
+
})], w.prototype, "showIcon", void 0), x([y({ converter: {
|
|
1363
|
+
fromAttribute(e) {
|
|
1364
|
+
if (!e) return [];
|
|
1365
|
+
try {
|
|
1366
|
+
let t = JSON.parse(e);
|
|
1367
|
+
return Array.isArray(t) ? t : [];
|
|
1368
|
+
} catch {
|
|
1369
|
+
return [];
|
|
1370
|
+
}
|
|
1371
|
+
},
|
|
1372
|
+
toAttribute(e) {
|
|
1373
|
+
return typeof e == "string" ? e : JSON.stringify(e);
|
|
1374
|
+
}
|
|
1375
|
+
} })], w.prototype, "options", void 0), w = x([f("lc-enum-selector")], w);
|
|
1361
1376
|
//#endregion
|
|
1362
1377
|
//#region src/components/prompt-input/prompt-input.ts
|
|
1363
1378
|
var T = class extends a {
|
|
@@ -444,7 +444,7 @@ const e=require(`./client-Dt9_oZey.cjs`),t=require(`./constants-BTXokn3H.cjs`);r
|
|
|
444
444
|
<button type="button" @click=${()=>this._clearCanvas()}>清空</button>
|
|
445
445
|
</div>
|
|
446
446
|
</div>
|
|
447
|
-
`}};y([_({type:String})],x.prototype,`label`,void 0),y([_({type:String})],x.prototype,`name`,void 0),y([_({type:String})],x.prototype,`hint`,void 0),y([_({type:Boolean})],x.prototype,`required`,void 0),y([_({type:String})],x.prototype,`value`,void 0),y([_({type:String})],x.prototype,`source`,void 0),y([_({type:Boolean})],x.prototype,`disabled`,void 0),y([_({type:Number})],x.prototype,`brushSize`,void 0),y([v()],x.prototype,`_mode`,void 0),y([v()],x.prototype,`_isDrawing`,void 0),y([v()],x.prototype,`_errorMessage`,void 0),y([v()],x.prototype,`_aspectRatio`,void 0),y([v()],x.prototype,`_canUndo`,void 0),y([v()],x.prototype,`_canRedo`,void 0),y([v()],x.prototype,`_zoom`,void 0),y([v()],x.prototype,`_isSpacePressed`,void 0),y([v()],x.prototype,`_isPanning`,void 0),y([v()],x.prototype,`_panX`,void 0),y([v()],x.prototype,`_panY`,void 0),y([ge(`canvas`)],x.prototype,`_canvas`,void 0),x=y([o(`lc-mask-editor`)],x);var S=class extends n.LitElement{constructor(...e){super(...e),this.label=``,this.name=``,this.value=``,this.mode=`button`,this.multiple=!1,this.required=!1,this.disabled=!1,this.showIcon=!1,this.options
|
|
447
|
+
`}};y([_({type:String})],x.prototype,`label`,void 0),y([_({type:String})],x.prototype,`name`,void 0),y([_({type:String})],x.prototype,`hint`,void 0),y([_({type:Boolean})],x.prototype,`required`,void 0),y([_({type:String})],x.prototype,`value`,void 0),y([_({type:String})],x.prototype,`source`,void 0),y([_({type:Boolean})],x.prototype,`disabled`,void 0),y([_({type:Number})],x.prototype,`brushSize`,void 0),y([v()],x.prototype,`_mode`,void 0),y([v()],x.prototype,`_isDrawing`,void 0),y([v()],x.prototype,`_errorMessage`,void 0),y([v()],x.prototype,`_aspectRatio`,void 0),y([v()],x.prototype,`_canUndo`,void 0),y([v()],x.prototype,`_canRedo`,void 0),y([v()],x.prototype,`_zoom`,void 0),y([v()],x.prototype,`_isSpacePressed`,void 0),y([v()],x.prototype,`_isPanning`,void 0),y([v()],x.prototype,`_panX`,void 0),y([v()],x.prototype,`_panY`,void 0),y([ge(`canvas`)],x.prototype,`_canvas`,void 0),x=y([o(`lc-mask-editor`)],x);var S=class extends n.LitElement{constructor(...e){super(...e),this.label=``,this.name=``,this.value=``,this.mode=`button`,this.multiple=!1,this.required=!1,this.disabled=!1,this.showIcon=!1,this.options=[]}static{this.styles=n.css`
|
|
448
448
|
:host {
|
|
449
449
|
display: block;
|
|
450
450
|
font-family: var(--lc-font-family);
|
|
@@ -568,7 +568,7 @@ const e=require(`./client-Dt9_oZey.cjs`),t=require(`./constants-BTXokn3H.cjs`);r
|
|
|
568
568
|
outline: none;
|
|
569
569
|
border-color: var(--lc-color-primary);
|
|
570
570
|
}
|
|
571
|
-
`}get parsedOptions(){try{
|
|
571
|
+
`}get parsedOptions(){if(typeof this.options!=`string`)return this.options;try{let e=JSON.parse(this.options);return Array.isArray(e)?e:[]}catch{return[]}}get selectedValues(){if(Array.isArray(this.value))return this.value;if(this.multiple&&typeof this.value==`string`&&this.value)try{let e=JSON.parse(this.value);if(Array.isArray(e))return e.map(String)}catch{return this.value.split(`,`).map(e=>e.trim()).filter(Boolean)}return typeof this.value==`string`&&this.value?[this.value]:[]}isSelected(e){return this.selectedValues.includes(e)}emitChange(e){this.dispatchEvent(new CustomEvent(t.o.CHANGE,{detail:{value:e},bubbles:!0,composed:!0}))}getRatioBoxDimensions(e){let[t,n]=e.split(`:`).map(Number),r=32/Math.max(t,n);return{width:Math.round(t*r),height:Math.round(n*r)}}isRatioValue(e){return/^\d+(?:\.\d+)?:\d+(?:\.\d+)?$/.test(e)}renderOptionIcon(e){if(!this.showIcon)return n.nothing;if(e.icon)return n.html`<span class="option-icon" aria-hidden="true">${e.icon}</span>`;if(this.isRatioValue(e.value)){let t=this.getRatioBoxDimensions(e.value);return n.html`
|
|
572
572
|
<span class="option-icon" aria-hidden="true">
|
|
573
573
|
<span class="ratio-box" style="width: ${t.width}px; height: ${t.height}px;"></span>
|
|
574
574
|
</span>
|
|
@@ -621,7 +621,7 @@ const e=require(`./client-Dt9_oZey.cjs`),t=require(`./constants-BTXokn3H.cjs`);r
|
|
|
621
621
|
${e.label}
|
|
622
622
|
</option>`)}
|
|
623
623
|
</select>
|
|
624
|
-
`}};y([_({type:String})],S.prototype,`label`,void 0),y([_({type:String})],S.prototype,`name`,void 0),y([_()],S.prototype,`value`,void 0),y([_({type:String})],S.prototype,`mode`,void 0),y([_({type:Boolean})],S.prototype,`multiple`,void 0),y([_({type:Boolean})],S.prototype,`required`,void 0),y([_({type:Boolean})],S.prototype,`disabled`,void 0),y([_({type:Boolean,attribute:`show-icon`})],S.prototype,`showIcon`,void 0),y([_({
|
|
624
|
+
`}};y([_({type:String})],S.prototype,`label`,void 0),y([_({type:String})],S.prototype,`name`,void 0),y([_()],S.prototype,`value`,void 0),y([_({type:String})],S.prototype,`mode`,void 0),y([_({type:Boolean})],S.prototype,`multiple`,void 0),y([_({type:Boolean})],S.prototype,`required`,void 0),y([_({type:Boolean})],S.prototype,`disabled`,void 0),y([_({type:Boolean,attribute:`show-icon`})],S.prototype,`showIcon`,void 0),y([_({converter:{fromAttribute(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}},toAttribute(e){return typeof e==`string`?e:JSON.stringify(e)}}})],S.prototype,`options`,void 0),S=y([o(`lc-enum-selector`)],S);var C=class extends n.LitElement{constructor(...e){super(...e),this.value=``,this.name=``,this.label=``,this.placeholder=``,this.maxLength=500,this.required=!1,this.disabled=!1}static{this.styles=n.css`
|
|
625
625
|
:host {
|
|
626
626
|
display: block;
|
|
627
627
|
font-family: var(--lc-font-family);
|
package/dist/lightchain-ui.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./button-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./button-DGQ4b8f2.cjs`),t=require(`./client-Dt9_oZey.cjs`),n=require(`./constants-BTXokn3H.cjs`);require(`./core-DkseUrte.cjs`),e.f();function r(){}exports.ACCEPTED_FILE_TYPES=n.t,exports.API_BASE_URL=n.n,exports.ASPECT_RATIOS=t.d,exports.AUTH_HEADER_KEY=n.r,exports.CallbackStatus=t.f,exports.ERROR_CODES=n.i,exports.ERROR_MESSAGES=n.a,exports.EVENT_NAMES=n.o,exports.FIELD_TYPES=n.s,exports.FILE_SIZE_LIMITS=n.c,exports.IMAGE_LIMITS=t.p,Object.defineProperty(exports,`LcButton`,{enumerable:!0,get:function(){return e.t}}),Object.defineProperty(exports,`LcColorPicker`,{enumerable:!0,get:function(){return e.s}}),Object.defineProperty(exports,`LcEnumSelector`,{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(exports,`LcImageCompareSlider`,{enumerable:!0,get:function(){return e.r}}),Object.defineProperty(exports,`LcImageUploader`,{enumerable:!0,get:function(){return e.d}}),Object.defineProperty(exports,`LcMaskEditor`,{enumerable:!0,get:function(){return e.u}}),Object.defineProperty(exports,`LcPromptInput`,{enumerable:!0,get:function(){return e.c}}),Object.defineProperty(exports,`LcResultGallery`,{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(exports,`LcStrengthSlider`,{enumerable:!0,get:function(){return e.o}}),Object.defineProperty(exports,`LcTaskProgressCard`,{enumerable:!0,get:function(){return e.a}}),Object.defineProperty(exports,`LcTaskWorkflow`,{enumerable:!0,get:function(){return e.n}}),exports.LightChainClient=t.t,exports.OPTIONS_ACCESSORY_TYPE=n.l,exports.OPTIONS_AGE=n.u,exports.OPTIONS_ASPECT_RATIO=n.d,exports.OPTIONS_BODY_SHAPE=n.f,exports.OPTIONS_CROP_MODE=n.p,exports.OPTIONS_DETAIL_LIST=n.m,exports.OPTIONS_DURATION=n.h,exports.OPTIONS_GENDER=n.g,exports.OPTIONS_IMAGE_TYPE=n._,exports.OPTIONS_NATIONALITY=n.v,exports.OPTIONS_PATTERN_TYPE=n.y,exports.OPTIONS_PERSPECTIVE=n.b,exports.OPTIONS_POSITION=n.x,exports.OPTIONS_RACE=n.S,exports.OPTIONS_RECOGNITION_TYPE=n.C,exports.OPTIONS_REMOVE_PATTERN=n.w,exports.OPTIONS_SCALE=n.T,exports.OPTIONS_SIMILARITY=n.E,exports.OPTIONS_SIZE=n.D,exports.OPTIONS_SKIN_COLOR=n.O,exports.OPTIONS_TEMPLATE_ID=n.k,exports.TASK_PROGRESS_PATH=n.A,exports.TASK_SUBMIT_PREFIX=n.j,exports.TASK_TYPES=t.r,exports.TASK_TYPES_PART_A=t.s,exports.TASK_TYPES_PART_B=t.o,exports.TASK_WORKFLOW_TYPES=n.M,exports.TaskStatus=t.m,exports.WORKFLOW_DEFAULTS=n.N,exports.WORKFLOW_PHASES=n.P,exports.getAllTaskTypes=t.i,exports.getTaskTypeDef=t.a,exports.registerAllComponents=r,exports.validateFormData=t.n,exports.validateImage=t.c,exports.validateImageFile=t.l,exports.validateMask=t.u;
|
package/dist/lightchain-ui.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./button-
|
|
1
|
+
import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./button-BnE0JWRX.js";
|
|
2
2
|
import { a as f, c as p, d as m, f as h, i as g, l as _, m as v, n as y, o as b, p as x, r as S, s as C, t as w, u as T } from "./client-C5AgfBeT.js";
|
|
3
3
|
import { A as E, C as D, D as O, E as k, M as A, N as j, O as M, P as N, S as P, T as F, _ as I, a as L, b as R, c as z, d as B, f as V, g as H, h as U, i as W, j as G, k as K, l as q, m as J, n as Y, o as X, p as Z, r as Q, s as $, t as ee, u as te, v as ne, w as re, x as ie, y as ae } from "./constants-DmzJOR2G.js";
|
|
4
4
|
import "./core-C5cKUOSx.js";
|
package/dist/react.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require(`./button-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require(`./button-DGQ4b8f2.cjs`),l=require(`./constants-BTXokn3H.cjs`);let u=require(`@lit/react`),d=require(`react`);d=s(d,1);var f=l.o;c.f();var p=(0,u.createComponent)({react:d.default,tagName:`lc-image-uploader`,elementClass:c.d,events:{onChange:f.CHANGE}}),m=(0,u.createComponent)({react:d.default,tagName:`lc-mask-editor`,elementClass:c.u,events:{onChange:f.CHANGE}}),h=(0,u.createComponent)({react:d.default,tagName:`lc-enum-selector`,elementClass:c.l,events:{onChange:f.CHANGE}}),g=(0,u.createComponent)({react:d.default,tagName:`lc-prompt-input`,elementClass:c.c,events:{onChange:f.CHANGE}}),_=(0,u.createComponent)({react:d.default,tagName:`lc-color-picker`,elementClass:c.s,events:{onChange:f.CHANGE}}),v=(0,u.createComponent)({react:d.default,tagName:`lc-strength-slider`,elementClass:c.o,events:{onChange:f.CHANGE}}),y=(0,u.createComponent)({react:d.default,tagName:`lc-task-progress-card`,elementClass:c.a,events:{}}),b=(0,u.createComponent)({react:d.default,tagName:`lc-result-gallery`,elementClass:c.i,events:{onImageClick:f.IMAGE_CLICK,onCompare:f.COMPARE}}),x=(0,u.createComponent)({react:d.default,tagName:`lc-image-compare-slider`,elementClass:c.r,events:{}}),S=(0,u.createComponent)({react:d.default,tagName:`lc-task-workflow`,elementClass:c.n,events:{onSubmit:f.SUBMIT,onPoll:f.POLL,onPolling:f.POLL,onSuccess:f.SUCCESS,onError:f.ERROR}}),C=(0,u.createComponent)({react:d.default,tagName:`lc-button`,elementClass:c.t,events:{}});exports.LcButtonReact=C,exports.LcColorPickerReact=_,exports.LcEnumSelectorReact=h,exports.LcImageCompareSliderReact=x,exports.LcImageUploaderReact=p,exports.LcMaskEditorReact=m,exports.LcPromptInputReact=g,exports.LcResultGalleryReact=b,exports.LcStrengthSliderReact=v,exports.LcTaskProgressCardReact=y,exports.LcTaskWorkflowReact=S,exports.t=s;
|
package/dist/react.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./button-
|
|
1
|
+
import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./button-BnE0JWRX.js";
|
|
2
2
|
import { o as f } from "./constants-DmzJOR2G.js";
|
|
3
3
|
import { createComponent as p } from "@lit/react";
|
|
4
4
|
import m from "react";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
export interface EnumSelectorOption {
|
|
3
|
-
label: string;
|
|
4
|
-
value: string;
|
|
5
|
-
icon?: string;
|
|
3
|
+
readonly label: string;
|
|
4
|
+
readonly value: string;
|
|
5
|
+
readonly icon?: string;
|
|
6
6
|
}
|
|
7
|
+
export type EnumSelectorOptions = ReadonlyArray<EnumSelectorOption>;
|
|
7
8
|
type SelectorValue = string | string[];
|
|
8
9
|
export declare class LcEnumSelector extends LitElement {
|
|
9
10
|
static styles: import("lit").CSSResult;
|
|
@@ -15,8 +16,8 @@ export declare class LcEnumSelector extends LitElement {
|
|
|
15
16
|
required: boolean;
|
|
16
17
|
disabled: boolean;
|
|
17
18
|
showIcon: boolean;
|
|
18
|
-
options: string;
|
|
19
|
-
get parsedOptions():
|
|
19
|
+
options: EnumSelectorOptions | string;
|
|
20
|
+
get parsedOptions(): EnumSelectorOptions;
|
|
20
21
|
private get selectedValues();
|
|
21
22
|
private isSelected;
|
|
22
23
|
private emitChange;
|