@pie-element/shared-configure-events 0.1.0

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.
@@ -0,0 +1,62 @@
1
+ /**
2
+ * PIE Configure Events
3
+ *
4
+ * Custom events for PIE configuration UI interactions (image/sound upload, model updates).
5
+ * Internalized from @pie-framework/pie-configure-events for ESM compatibility.
6
+ */
7
+ export type ModelUpdatedDetail = {
8
+ update: any;
9
+ reset: boolean;
10
+ };
11
+ export declare class ModelUpdatedEvent extends CustomEvent<ModelUpdatedDetail> {
12
+ readonly update: any;
13
+ readonly reset: boolean;
14
+ static TYPE: string;
15
+ constructor(update: any, reset?: boolean);
16
+ }
17
+ export type DeleteDone = (e?: Error) => void;
18
+ export type DeleteImageDetail = {
19
+ src: string;
20
+ done: DeleteDone;
21
+ };
22
+ export declare class DeleteImageEvent extends CustomEvent<DeleteImageDetail> {
23
+ readonly src: string;
24
+ readonly done: DeleteDone;
25
+ static TYPE: string;
26
+ constructor(src: string, done: DeleteDone);
27
+ }
28
+ export interface ImageHandler {
29
+ isPasted?: boolean;
30
+ cancel: () => void;
31
+ done: (err?: Error, src?: string) => void;
32
+ fileChosen: (file: File) => void;
33
+ getChosenFile?: () => File;
34
+ progress: (percent: number, bytes: number, total: number) => void;
35
+ }
36
+ export declare class InsertImageEvent extends CustomEvent<ImageHandler> {
37
+ readonly handler: ImageHandler;
38
+ static TYPE: string;
39
+ constructor(handler: ImageHandler);
40
+ }
41
+ export type DeleteSoundDetail = {
42
+ src: string;
43
+ done: DeleteDone;
44
+ };
45
+ export declare class DeleteSoundEvent extends CustomEvent<DeleteSoundDetail> {
46
+ readonly src: string;
47
+ readonly done: DeleteDone;
48
+ static TYPE: string;
49
+ constructor(src: string, done: DeleteDone);
50
+ }
51
+ export interface SoundHandler {
52
+ cancel: () => void;
53
+ done: (err?: Error, src?: string) => void;
54
+ fileChosen: File;
55
+ progress: (percent: number, bytes: number, total: number) => void;
56
+ }
57
+ export declare class InsertSoundEvent extends CustomEvent<SoundHandler> {
58
+ readonly handler: SoundHandler;
59
+ static TYPE: string;
60
+ constructor(handler: SoundHandler);
61
+ }
62
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,GAAG,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,qBAAa,iBAAkB,SAAQ,WAAW,CAAC,kBAAkB,CAAC;IAGxD,QAAQ,CAAC,MAAM,EAAE,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO;IAFzD,MAAM,CAAC,IAAI,SAAmB;gBAET,MAAM,EAAE,GAAG,EAAW,KAAK,GAAE,OAAe;CAGlE;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;AAE7C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;CAClB,CAAC;AAEF,qBAAa,gBAAiB,SAAQ,WAAW,CAAC,iBAAiB,CAAC;IAGtD,QAAQ,CAAC,GAAG,EAAE,MAAM;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU;IAF3D,MAAM,CAAC,IAAI,SAAkB;gBAER,GAAG,EAAE,MAAM,EAAW,IAAI,EAAE,UAAU;CAG5D;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnE;AAED,qBAAa,gBAAiB,SAAQ,WAAW,CAAC,YAAY,CAAC;IAGjD,QAAQ,CAAC,OAAO,EAAE,YAAY;IAF1C,MAAM,CAAC,IAAI,SAAkB;gBAER,OAAO,EAAE,YAAY;CAG3C;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;CAClB,CAAC;AAEF,qBAAa,gBAAiB,SAAQ,WAAW,CAAC,iBAAiB,CAAC;IAGtD,QAAQ,CAAC,GAAG,EAAE,MAAM;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU;IAF3D,MAAM,CAAC,IAAI,SAAkB;gBAER,GAAG,EAAE,MAAM,EAAW,IAAI,EAAE,UAAU;CAG5D;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,UAAU,EAAE,IAAI,CAAC;IACjB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnE;AAED,qBAAa,gBAAiB,SAAQ,WAAW,CAAC,YAAY,CAAC;IAGjD,QAAQ,CAAC,OAAO,EAAE,YAAY;IAF1C,MAAM,CAAC,IAAI,SAAkB;gBAER,OAAO,EAAE,YAAY;CAG3C"}
package/dist/index.js ADDED
@@ -0,0 +1,42 @@
1
+ const i = class i extends CustomEvent {
2
+ constructor(s, t = !1) {
3
+ super(i.TYPE, { bubbles: !0, detail: { update: s, reset: t } }), this.update = s, this.reset = t;
4
+ }
5
+ };
6
+ i.TYPE = "model.updated";
7
+ let e = i;
8
+ const u = class u extends CustomEvent {
9
+ constructor(s, t) {
10
+ super(u.TYPE, { bubbles: !0, detail: { src: s, done: t } }), this.src = s, this.done = t;
11
+ }
12
+ };
13
+ u.TYPE = "delete.image";
14
+ let a = u;
15
+ const c = class c extends CustomEvent {
16
+ constructor(s) {
17
+ super(c.TYPE, { bubbles: !0, detail: s }), this.handler = s;
18
+ }
19
+ };
20
+ c.TYPE = "insert.image";
21
+ let h = c;
22
+ const r = class r extends CustomEvent {
23
+ constructor(s, t) {
24
+ super(r.TYPE, { bubbles: !0, detail: { src: s, done: t } }), this.src = s, this.done = t;
25
+ }
26
+ };
27
+ r.TYPE = "delete.sound";
28
+ let l = r;
29
+ const b = class b extends CustomEvent {
30
+ constructor(s) {
31
+ super(b.TYPE, { bubbles: !0, detail: s }), this.handler = s;
32
+ }
33
+ };
34
+ b.TYPE = "insert.sound";
35
+ let o = b;
36
+ export {
37
+ a as DeleteImageEvent,
38
+ l as DeleteSoundEvent,
39
+ h as InsertImageEvent,
40
+ o as InsertSoundEvent,
41
+ e as ModelUpdatedEvent
42
+ };
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@pie-element/shared-configure-events",
3
+ "version": "0.1.0",
4
+ "description": "PIE Configure Events (ESM) - internalized from @pie-framework/pie-configure-events",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "scripts": {
18
+ "build": "rm -rf dist tsconfig.tsbuildinfo && vite build && tsc --emitDeclarationOnly",
19
+ "dev": "vite build --watch",
20
+ "test": "vitest",
21
+ "clean": "rm -rf dist"
22
+ },
23
+ "dependencies": {},
24
+ "devDependencies": {
25
+ "@types/bun": "latest",
26
+ "typescript": "^5.9.3",
27
+ "vite": "^7.2.2",
28
+ "vitest": "^4.0.17"
29
+ },
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "license": "MIT"
34
+ }