@emabuild/core 0.2.0 → 0.3.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.
- package/dist/canvas/column-renderer.d.ts.map +1 -1
- package/dist/canvas/content-renderer.d.ts +1 -1
- package/dist/canvas/content-renderer.d.ts.map +1 -1
- package/dist/canvas/editor-canvas.d.ts +11 -0
- package/dist/canvas/editor-canvas.d.ts.map +1 -1
- package/dist/canvas/inline-toolbar.d.ts +8 -0
- package/dist/canvas/inline-toolbar.d.ts.map +1 -1
- package/dist/canvas/row-renderer.d.ts +2 -0
- package/dist/canvas/row-renderer.d.ts.map +1 -1
- package/dist/compat/unlayer-adapter.d.ts +33 -0
- package/dist/compat/unlayer-adapter.d.ts.map +1 -0
- package/dist/dnd/drag-manager.d.ts +1 -0
- package/dist/dnd/drag-manager.d.ts.map +1 -1
- package/dist/dnd/drag-state.d.ts +10 -3
- package/dist/dnd/drag-state.d.ts.map +1 -1
- package/dist/{form-tool-DdFDrS3b.js → form-tool-C7760Hvm.js} +10 -9
- package/dist/{form-tool-DdFDrS3b.js.map → form-tool-C7760Hvm.js.map} +1 -1
- package/dist/{html-tool-DMtmrF3n.js → html-tool-4zZO2hqE.js} +2 -2
- package/dist/{html-tool-DMtmrF3n.js.map → html-tool-4zZO2hqE.js.map} +1 -1
- package/dist/index-zy5NbC2E.js +4303 -0
- package/dist/index-zy5NbC2E.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -5
- package/dist/mail-editor.d.ts +13 -2
- package/dist/mail-editor.d.ts.map +1 -1
- package/dist/{menu-tool-CJcQdpcP.js → menu-tool-Cu5D_VYs.js} +14 -13
- package/dist/{menu-tool-CJcQdpcP.js.map → menu-tool-Cu5D_VYs.js.map} +1 -1
- package/dist/properties/property-panel.d.ts.map +1 -1
- package/dist/register-elements.d.ts.map +1 -1
- package/dist/sidebar/a11y-checker.d.ts +27 -0
- package/dist/sidebar/a11y-checker.d.ts.map +1 -0
- package/dist/sidebar/body-settings.d.ts +2 -0
- package/dist/sidebar/body-settings.d.ts.map +1 -1
- package/dist/sidebar/editor-sidebar.d.ts +5 -2
- package/dist/sidebar/editor-sidebar.d.ts.map +1 -1
- package/dist/{social-tool-CRY3-_sU.js → social-tool-kPuP-4n6.js} +13 -12
- package/dist/{social-tool-CRY3-_sU.js.map → social-tool-kPuP-4n6.js.map} +1 -1
- package/dist/state/editor-store.d.ts +30 -28
- package/dist/state/editor-store.d.ts.map +1 -1
- package/dist/{table-tool-DeIQci5z.js → table-tool-CcWFvTSc.js} +13 -12
- package/dist/{table-tool-DeIQci5z.js.map → table-tool-CcWFvTSc.js.map} +1 -1
- package/dist/timer-tool-CG1oul_Z.js +55 -0
- package/dist/timer-tool-CG1oul_Z.js.map +1 -0
- package/dist/tools/built-in/button-tool.d.ts.map +1 -1
- package/dist/tools/built-in/divider-tool.d.ts.map +1 -1
- package/dist/tools/built-in/heading-tool.d.ts.map +1 -1
- package/dist/tools/built-in/image-tool.d.ts.map +1 -1
- package/dist/tools/built-in/paragraph-tool.d.ts.map +1 -1
- package/dist/tools/built-in/shared-options.d.ts +105 -0
- package/dist/tools/built-in/shared-options.d.ts.map +1 -0
- package/dist/tools/built-in/text-tool.d.ts.map +1 -1
- package/dist/tools/tool-registry.d.ts.map +1 -1
- package/dist/{video-tool-g1fIoCWW.js → video-tool-CttMka8Z.js} +7 -6
- package/dist/{video-tool-g1fIoCWW.js.map → video-tool-CttMka8Z.js.map} +1 -1
- package/package.json +13 -26
- package/dist/index-CpMbWdgn.js +0 -3092
- package/dist/index-CpMbWdgn.js.map +0 -1
- package/dist/timer-tool-BVE1shO1.js +0 -54
- package/dist/timer-tool-BVE1shO1.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-renderer.d.ts","sourceRoot":"","sources":["../../src/canvas/column-renderer.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"column-renderer.d.ts","sourceRoot":"","sources":["../../src/canvas/column-renderer.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,uBAAuB,CAAC;AAE/B,qBACa,cAAe,SAAQ,UAAU;IAC5C,MAAM,CAAC,MAAM,0BA6BX;IAEF,OAAO,CAAC,SAAS,CAAyC;IAE1B,MAAM,EAAG,YAAY,CAAC;IAEtD,IACI,KAAK,CAAC,CAAC,EAAE,WAAW,EAAiC;IACzD,IAAI,KAAK,IAAI,WAAW,CAAkC;IAE1B,YAAY,EAAG,YAAY,CAAC;IAChC,YAAY,SAAO;IAE/C,MAAM;CA8BP"}
|
|
@@ -12,7 +12,6 @@ export declare class ContentRenderer extends LitElement {
|
|
|
12
12
|
private editing;
|
|
13
13
|
private toolbar;
|
|
14
14
|
private editableEl;
|
|
15
|
-
private saveDebounceTimer;
|
|
16
15
|
private handleClick;
|
|
17
16
|
private handleDblClick;
|
|
18
17
|
private handleMouseEnter;
|
|
@@ -31,6 +30,7 @@ export declare class ContentRenderer extends LitElement {
|
|
|
31
30
|
private handleOverlayBlur;
|
|
32
31
|
private handleInlineKeydown;
|
|
33
32
|
private showToolbar;
|
|
33
|
+
private hoverUnsub;
|
|
34
34
|
connectedCallback(): void;
|
|
35
35
|
disconnectedCallback(): void;
|
|
36
36
|
render(): import('lit').TemplateResult<1>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-renderer.d.ts","sourceRoot":"","sources":["../../src/canvas/content-renderer.ts"],"names":[],"mappings":"AAAA;;;;;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;IAMrB,OAAO,CAAC,YAAY;IAuDpB,OAAO,CAAC,WAAW;IAwBnB,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,iBAAiB,CAKvB;IAEF,OAAO,CAAC,gBAAgB,CAUtB;IAEF,6CAA6C;IAC7C,OAAO,CAAC,iBAAiB,CAUvB;IAEF,OAAO,CAAC,mBAAmB,CAMzB;IAEF,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,UAAU,CAA6B;IAI/C,iBAAiB;IAYjB,oBAAoB;IAUpB,MAAM;IAyEN,4EAA4E;IAC5E,OAAO,CAAC,eAAe;CA0CxB"}
|
|
@@ -7,8 +7,19 @@ export declare class EditorCanvas extends LitElement {
|
|
|
7
7
|
set store(s: EditorStore);
|
|
8
8
|
get store(): EditorStore;
|
|
9
9
|
toolRegistry: ToolRegistry;
|
|
10
|
+
private quickAddIndex;
|
|
11
|
+
private quickAddPos;
|
|
12
|
+
private boundCloseQuickAdd;
|
|
13
|
+
connectedCallback(): void;
|
|
14
|
+
disconnectedCallback(): void;
|
|
10
15
|
private handleCanvasClick;
|
|
11
16
|
private setViewMode;
|
|
17
|
+
private openQuickAdd;
|
|
18
|
+
private closeQuickAdd;
|
|
19
|
+
private quickAddTool;
|
|
20
|
+
private quickAddLayout;
|
|
21
|
+
private renderRowGap;
|
|
22
|
+
private renderQuickAddMenu;
|
|
12
23
|
render(): import('lit').TemplateResult<1>;
|
|
13
24
|
}
|
|
14
25
|
//# sourceMappingURL=editor-canvas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-canvas.d.ts","sourceRoot":"","sources":["../../src/canvas/editor-canvas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"editor-canvas.d.ts","sourceRoot":"","sources":["../../src/canvas/editor-canvas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,mBAAmB,CAAC;AAE3B,qBACa,YAAa,SAAQ,UAAU;IAC1C,MAAM,CAAC,MAAM,0BAmLX;IAEF,OAAO,CAAC,SAAS,CAAqD;IAEtE,IACI,KAAK,CAAC,CAAC,EAAE,WAAW,EAAiC;IACzD,IAAI,KAAK,IAAI,WAAW,CAAkC;IAE1B,YAAY,EAAG,YAAY,CAAC;IAEnD,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,WAAW,CAAkB;IAE9C,OAAO,CAAC,kBAAkB,CAAiC;IAElD,iBAAiB;IAKjB,oBAAoB;IAK7B,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,aAAa;YAMP,YAAY;IAW1B,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,kBAAkB;IAsD1B,MAAM;CAiDP"}
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
+
import { MergeTagGroup } from '@emabuild/types';
|
|
2
3
|
export declare class InlineToolbar extends LitElement {
|
|
3
4
|
static styles: import('lit').CSSResult;
|
|
4
5
|
visible: boolean;
|
|
6
|
+
mergeTags: MergeTagGroup[];
|
|
7
|
+
private mergeDropdownOpen;
|
|
8
|
+
private _outsideClickHandler;
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
disconnectedCallback(): void;
|
|
5
11
|
private exec;
|
|
6
12
|
private isActive;
|
|
7
13
|
/** Position the toolbar above a given element */
|
|
8
14
|
positionAbove(el: HTMLElement): void;
|
|
9
15
|
hide(): void;
|
|
16
|
+
private insertMergeTag;
|
|
17
|
+
private toggleMergeDropdown;
|
|
10
18
|
private handleLink;
|
|
11
19
|
render(): import('lit').TemplateResult<1>;
|
|
12
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-toolbar.d.ts","sourceRoot":"","sources":["../../src/canvas/inline-toolbar.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"inline-toolbar.d.ts","sourceRoot":"","sources":["../../src/canvas/inline-toolbar.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,qBACa,aAAc,SAAQ,UAAU;IAC3C,MAAM,CAAC,MAAM,0BAkGX;IAE2B,OAAO,UAAS;IACb,SAAS,EAAE,aAAa,EAAE,CAAM;IACvD,OAAO,CAAC,iBAAiB,CAAS;IAE3C,OAAO,CAAC,oBAAoB,CAM1B;IAEF,iBAAiB;IAKjB,oBAAoB;IAKpB,OAAO,CAAC,IAAI;IAKZ,OAAO,CAAC,QAAQ;IAIhB,iDAAiD;IACjD,aAAa,CAAC,EAAE,EAAE,WAAW;IAQ7B,IAAI;IAKJ,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,UAAU;IASlB,MAAM;CA0DP"}
|
|
@@ -9,6 +9,8 @@ export declare class RowRenderer extends LitElement {
|
|
|
9
9
|
set store(s: EditorStore);
|
|
10
10
|
get store(): EditorStore;
|
|
11
11
|
toolRegistry: ToolRegistry;
|
|
12
|
+
private handleDragStart;
|
|
13
|
+
private handleDragEnd;
|
|
12
14
|
private handleMoveUp;
|
|
13
15
|
private handleMoveDown;
|
|
14
16
|
private handleDuplicate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row-renderer.d.ts","sourceRoot":"","sources":["../../src/canvas/row-renderer.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"row-renderer.d.ts","sourceRoot":"","sources":["../../src/canvas/row-renderer.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,sBAAsB,CAAC;AAE9B,qBACa,WAAY,SAAQ,UAAU;IACzC,MAAM,CAAC,MAAM,0BAgHX;IAEF,OAAO,CAAC,SAAS,CAAqD;IAEtC,GAAG,EAAG,SAAS,CAAC;IAEhD,IACI,KAAK,CAAC,CAAC,EAAE,WAAW,EAAiC;IACzD,IAAI,KAAK,IAAI,WAAW,CAAkC;IAE1B,YAAY,EAAG,YAAY,CAAC;IAE5D,OAAO,CAAC,eAAe,CAMrB;IAEF,OAAO,CAAC,aAAa,CAEnB;IAEF,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,YAAY;IAKpB,MAAM;CA4EP"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { EmailDesign } from '@emabuild/types';
|
|
2
|
+
/**
|
|
3
|
+
* Convert an Unlayer design JSON to Emabuild format.
|
|
4
|
+
*
|
|
5
|
+
* Handles all known structural differences:
|
|
6
|
+
* - Image src object → string
|
|
7
|
+
* - Button/Image action objects → flat href/target
|
|
8
|
+
* - Button colors nested → flat
|
|
9
|
+
* - BackgroundImage format (size/position → center/cover)
|
|
10
|
+
* - Divider border nested → flat
|
|
11
|
+
* - Menu items nested → JSON string
|
|
12
|
+
* - contentWidth number → string with px
|
|
13
|
+
* - fontWeight number → string
|
|
14
|
+
*
|
|
15
|
+
* Unknown properties are preserved as-is (passthrough).
|
|
16
|
+
*/
|
|
17
|
+
export declare function fromUnlayer(unlayerDesign: Record<string, unknown>): EmailDesign;
|
|
18
|
+
/**
|
|
19
|
+
* Convert an Emabuild design JSON to Unlayer-compatible format.
|
|
20
|
+
*
|
|
21
|
+
* Handles all known structural differences (reverse of fromUnlayer):
|
|
22
|
+
* - Image string → src object
|
|
23
|
+
* - Flat href/target → action objects
|
|
24
|
+
* - Flat button colors → nested buttonColors
|
|
25
|
+
* - BackgroundImage center/cover → size/position
|
|
26
|
+
* - Flat divider keys → nested border
|
|
27
|
+
* - JSON string menu → nested items
|
|
28
|
+
* - contentWidth string → number
|
|
29
|
+
* - paragraph type → text type
|
|
30
|
+
* - fontWeight string → number
|
|
31
|
+
*/
|
|
32
|
+
export declare function toUnlayer(design: EmailDesign): Record<string, unknown>;
|
|
33
|
+
//# sourceMappingURL=unlayer-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unlayer-adapter.d.ts","sourceRoot":"","sources":["../../src/compat/unlayer-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EACV,WAAW,EAKZ,MAAM,iBAAiB,CAAC;AAyVzB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,WAAW,CA4C/E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA4DtE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drag-manager.d.ts","sourceRoot":"","sources":["../../src/dnd/drag-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,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Ac;IAmB5B,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,iBAAiB;IAqBzB,OAAO,CAAC,qBAAqB;IAgD7B,OAAO,CAAC,oBAAoB;IAc5B,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,KAAK;CAId"}
|
package/dist/dnd/drag-state.d.ts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
/** Shared drag state — simple module-level singleton to avoid shadow DOM event propagation issues */
|
|
2
|
-
|
|
2
|
+
interface DragState {
|
|
3
3
|
/** ID of the content currently being dragged (null if not dragging content) */
|
|
4
4
|
draggingContentId: string | null;
|
|
5
|
-
|
|
5
|
+
/** ID of the row currently being dragged (null if not dragging a row) */
|
|
6
|
+
draggingRowId: string | null;
|
|
7
|
+
/** Reference to the element being dragged (for opacity restore on invalid drops) */
|
|
8
|
+
draggingElement: HTMLElement | null;
|
|
9
|
+
startContentDrag(contentId: string, el?: HTMLElement): void;
|
|
10
|
+
startRowDrag(rowId: string, el?: HTMLElement): void;
|
|
6
11
|
reset(): void;
|
|
7
|
-
}
|
|
12
|
+
}
|
|
13
|
+
export declare const dragState: DragState;
|
|
14
|
+
export {};
|
|
8
15
|
//# sourceMappingURL=drag-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drag-state.d.ts","sourceRoot":"","sources":["../../src/dnd/drag-state.ts"],"names":[],"mappings":"AAAA,qGAAqG;
|
|
1
|
+
{"version":3,"file":"drag-state.d.ts","sourceRoot":"","sources":["../../src/dnd/drag-state.ts"],"names":[],"mappings":"AAAA,qGAAqG;AAErG,UAAU,SAAS;IACjB,+EAA+E;IAC/E,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,yEAAyE;IACzE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,oFAAoF;IACpF,eAAe,EAAE,WAAW,GAAG,IAAI,CAAC;IAEpC,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5D,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACpD,KAAK,IAAI,IAAI,CAAC;CACf;AAED,eAAO,MAAM,SAAS,EAAE,SAuBvB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { html as
|
|
2
|
-
import { s as o, j as
|
|
1
|
+
import { html as p } from "lit";
|
|
2
|
+
import { s as o, j as b, e as u } from "./index-zy5NbC2E.js";
|
|
3
3
|
const n = [
|
|
4
4
|
{ label: "Name", name: "name", type: "text", placeholder: "Your name" },
|
|
5
5
|
{ label: "Email", name: "email", type: "email", placeholder: "your@email.com" }
|
|
@@ -42,10 +42,11 @@ const n = [
|
|
|
42
42
|
},
|
|
43
43
|
renderer: {
|
|
44
44
|
renderEditor(t) {
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
o(t, "containerPadding", "10px");
|
|
46
|
+
const l = o(t, "submitText", "Submit"), r = o(t, "buttonBg", "#3b82f6"), d = o(t, "buttonColor", "#ffffff"), a = b(t.fields, n);
|
|
47
|
+
return p`
|
|
47
48
|
<div style="font-family:arial,sans-serif;">
|
|
48
|
-
${a.map((e) =>
|
|
49
|
+
${a.map((e) => p`
|
|
49
50
|
<div style="margin-bottom:12px;">
|
|
50
51
|
<label style="display:block;font-size:13px;color:#374151;margin-bottom:4px;font-weight:500;">${e.label}</label>
|
|
51
52
|
<input type=${e.type || "text"} placeholder=${e.placeholder || ""} style="width:100%;padding:8px 12px;border:1px solid #d1d5db;border-radius:4px;font-size:14px;box-sizing:border-box;" />
|
|
@@ -56,14 +57,14 @@ const n = [
|
|
|
56
57
|
`;
|
|
57
58
|
},
|
|
58
59
|
renderHtml(t) {
|
|
59
|
-
const
|
|
60
|
+
const l = o(t, "containerPadding", "10px"), r = o(t, "actionUrl", "#"), d = o(t, "method", "POST"), a = o(t, "submitText", "Submit"), e = o(t, "buttonBg", "#3b82f6"), f = o(t, "buttonColor", "#ffffff"), m = b(t.fields, n), s = "font-family:arial,helvetica,sans-serif;", c = m.map(
|
|
60
61
|
(i) => `<div style="margin-bottom:12px;"><label style="display:block;font-size:13px;color:#374151;margin-bottom:4px;font-weight:500;${s}">${i.label}</label><input type="${i.type || "text"}" name="${i.name}" placeholder="${i.placeholder || ""}" style="width:100%;padding:8px 12px;border:1px solid #d1d5db;border-radius:4px;font-size:14px;box-sizing:border-box;${s}" /></div>`
|
|
61
|
-
).join(""), x = `<form action="${
|
|
62
|
-
return u(x, { padding:
|
|
62
|
+
).join(""), x = `<form action="${r}" method="${d}">${c}<button type="submit" style="background-color:${e};color:${f};border:none;padding:10px 24px;border-radius:4px;font-size:14px;font-weight:600;cursor:pointer;${s}">${a}</button></form>`;
|
|
63
|
+
return u(x, { padding: l });
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
66
|
};
|
|
66
67
|
export {
|
|
67
68
|
y as formTool
|
|
68
69
|
};
|
|
69
|
-
//# sourceMappingURL=form-tool-
|
|
70
|
+
//# sourceMappingURL=form-tool-C7760Hvm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-tool-
|
|
1
|
+
{"version":3,"file":"form-tool-C7760Hvm.js","sources":["../src/tools/built-in/form-tool.ts"],"sourcesContent":["/**\n * @module form-tool\n *\n * Input form with configurable fields and submit button.\n * Only available in \"web\" display mode (forms don't work in email).\n *\n * Email compatibility: N/A — this tool is for web/popup display mode only.\n */\n\nimport { html, TemplateResult } from 'lit';\nimport type { ContentValues } from '@emabuild/types';\nimport type { LitToolDefinition } from '../tool-registry.js';\nimport { str, jsonParse } from '../helpers/value-extractor.js';\nimport { emailTableCell } from '../helpers/email-html.js';\nimport type { FormField } from '../helpers/types.js';\n\nconst DEFAULT_FIELDS: FormField[] = [\n { label: 'Name', name: 'name', type: 'text', placeholder: 'Your name' },\n { label: 'Email', name: 'email', type: 'email', placeholder: 'your@email.com' },\n];\n\nexport const formTool: LitToolDefinition = {\n name: 'form',\n label: 'Form',\n icon: `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\"/><path d=\"M7 7h10\"/><path d=\"M7 12h10\"/><path d=\"M7 17h6\"/></svg>`,\n supportedDisplayModes: ['web'],\n position: 13,\n options: {\n form: {\n title: 'Form',\n options: {\n actionUrl: { label: 'Action URL', defaultValue: '#', widget: 'text' },\n method: { label: 'Method', defaultValue: 'POST', widget: 'text' },\n submitText: { label: 'Submit Text', defaultValue: 'Submit', widget: 'text' },\n fields: { label: 'Fields (JSON)', defaultValue: JSON.stringify(DEFAULT_FIELDS), widget: 'rich_text' },\n },\n },\n style: {\n title: 'Style',\n options: {\n buttonBg: { label: 'Button Color', defaultValue: '#3b82f6', widget: 'color_picker' },\n buttonColor: { label: 'Button Text', defaultValue: '#ffffff', widget: 'color_picker' },\n },\n },\n spacing: {\n title: 'Spacing',\n options: { containerPadding: { label: 'Padding', defaultValue: '10px', widget: 'padding' } },\n },\n },\n defaultValues: {\n actionUrl: '#', method: 'POST', submitText: 'Submit',\n fields: JSON.stringify(DEFAULT_FIELDS), buttonBg: '#3b82f6',\n buttonColor: '#ffffff', containerPadding: '10px',\n },\n renderer: {\n renderEditor(values: ContentValues): TemplateResult {\n const padding = str(values, 'containerPadding', '10px');\n const submitText = str(values, 'submitText', 'Submit');\n const btnBg = str(values, 'buttonBg', '#3b82f6');\n const btnColor = str(values, 'buttonColor', '#ffffff');\n const fields = jsonParse<FormField[]>(values.fields, DEFAULT_FIELDS);\n\n return html`\n <div style=\"font-family:arial,sans-serif;\">\n ${fields.map((f) => html`\n <div style=\"margin-bottom:12px;\">\n <label style=\"display:block;font-size:13px;color:#374151;margin-bottom:4px;font-weight:500;\">${f.label}</label>\n <input type=${f.type || 'text'} placeholder=${f.placeholder || ''} style=\"width:100%;padding:8px 12px;border:1px solid #d1d5db;border-radius:4px;font-size:14px;box-sizing:border-box;\" />\n </div>\n `)}\n <button style=\"background:${btnBg};color:${btnColor};border:none;padding:10px 24px;border-radius:4px;font-size:14px;font-weight:600;cursor:pointer;\">${submitText}</button>\n </div>\n `;\n },\n renderHtml(values: ContentValues): string {\n const padding = str(values, 'containerPadding', '10px');\n const actionUrl = str(values, 'actionUrl', '#');\n const method = str(values, 'method', 'POST');\n const submitText = str(values, 'submitText', 'Submit');\n const btnBg = str(values, 'buttonBg', '#3b82f6');\n const btnColor = str(values, 'buttonColor', '#ffffff');\n const fields = jsonParse<FormField[]>(values.fields, DEFAULT_FIELDS);\n const font = 'font-family:arial,helvetica,sans-serif;';\n\n const fieldsHtml = fields.map((f) =>\n `<div style=\"margin-bottom:12px;\"><label style=\"display:block;font-size:13px;color:#374151;margin-bottom:4px;font-weight:500;${font}\">${f.label}</label><input type=\"${f.type || 'text'}\" name=\"${f.name}\" placeholder=\"${f.placeholder || ''}\" style=\"width:100%;padding:8px 12px;border:1px solid #d1d5db;border-radius:4px;font-size:14px;box-sizing:border-box;${font}\" /></div>`\n ).join('');\n\n const inner = `<form action=\"${actionUrl}\" method=\"${method}\">${fieldsHtml}<button type=\"submit\" style=\"background-color:${btnBg};color:${btnColor};border:none;padding:10px 24px;border-radius:4px;font-size:14px;font-weight:600;cursor:pointer;${font}\">${submitText}</button></form>`;\n return emailTableCell(inner, { padding });\n },\n },\n};\n"],"names":["DEFAULT_FIELDS","formTool","values","str","submitText","btnBg","btnColor","fields","jsonParse","html","f","padding","actionUrl","method","font","fieldsHtml","inner","emailTableCell"],"mappings":";;AAgBA,MAAMA,IAA8B;AAAA,EAClC,EAAE,OAAO,QAAQ,MAAM,QAAQ,MAAM,QAAQ,aAAa,YAAA;AAAA,EAC1D,EAAE,OAAO,SAAS,MAAM,SAAS,MAAM,SAA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SAAS,GAC/CK,IAASC,EAAuBN,EAAO,QAAQF,CAAc;AAEnE,aAAOS;AAAA;AAAA,YAEDF,EAAO,IAAI,CAACG,MAAMD;AAAA;AAAA,6GAE+EC,EAAE,KAAK;AAAA,4BACxFA,EAAE,QAAQ,MAAM,gBAAgBA,EAAE,eAAe,EAAE;AAAA;AAAA,WAEpE,CAAC;AAAA,sCAC0BL,CAAK,UAAUC,CAAQ,oGAAoGF,CAAU;AAAA;AAAA;AAAA,IAGvK;AAAA,IACA,WAAWF,GAA+B;AACxC,YAAMS,IAAUR,EAAID,GAAQ,oBAAoB,MAAM,GAChDU,IAAYT,EAAID,GAAQ,aAAa,GAAG,GACxCW,IAASV,EAAID,GAAQ,UAAU,MAAM,GACrCE,IAAaD,EAAID,GAAQ,cAAc,QAAQ,GAC/CG,IAAQF,EAAID,GAAQ,YAAY,SAAS,GACzCI,IAAWH,EAAID,GAAQ,eAAe,SAAS,GAC/CK,IAASC,EAAuBN,EAAO,QAAQF,CAAc,GAC7Dc,IAAO,2CAEPC,IAAaR,EAAO;AAAA,QAAI,CAACG,MAC7B,+HAA+HI,CAAI,KAAKJ,EAAE,KAAK,wBAAwBA,EAAE,QAAQ,MAAM,WAAWA,EAAE,IAAI,kBAAkBA,EAAE,eAAe,EAAE,wHAAwHI,CAAI;AAAA,MAAA,EACzW,KAAK,EAAE,GAEHE,IAAQ,iBAAiBJ,CAAS,aAAaC,CAAM,KAAKE,CAAU,iDAAiDV,CAAK,UAAUC,CAAQ,kGAAkGQ,CAAI,KAAKV,CAAU;AACvQ,aAAOa,EAAeD,GAAO,EAAE,SAAAL,GAAS;AAAA,IAC1C;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { html as l } from "lit";
|
|
2
2
|
import { unsafeHTML as i } from "lit/directives/unsafe-html.js";
|
|
3
|
-
import { e as o, s as t } from "./index-
|
|
3
|
+
import { e as o, s as t } from "./index-zy5NbC2E.js";
|
|
4
4
|
const r = {
|
|
5
5
|
name: "html",
|
|
6
6
|
label: "HTML",
|
|
@@ -46,4 +46,4 @@ const r = {
|
|
|
46
46
|
export {
|
|
47
47
|
r as htmlTool
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=html-tool-
|
|
49
|
+
//# sourceMappingURL=html-tool-4zZO2hqE.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-tool-
|
|
1
|
+
{"version":3,"file":"html-tool-4zZO2hqE.js","sources":["../src/tools/built-in/html-tool.ts"],"sourcesContent":["/**\n * @module html-tool\n *\n * Raw HTML content block for custom code injection.\n *\n * Email compatibility: Content is inserted as-is inside a table cell.\n * The user is responsible for email-safe HTML in this block.\n */\n\nimport { html, TemplateResult } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport type { ContentValues } from '@emabuild/types';\nimport type { LitToolDefinition } from '../tool-registry.js';\nimport { str } from '../helpers/value-extractor.js';\nimport { emailTableCell } from '../helpers/email-html.js';\n\nexport const htmlTool: LitToolDefinition = {\n name: 'html',\n label: 'HTML',\n icon: `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"16 18 22 12 16 6\"/><polyline points=\"8 6 2 12 8 18\"/></svg>`,\n supportedDisplayModes: ['email', 'web'],\n position: 6,\n options: {\n html: {\n title: 'HTML',\n options: {\n html: {\n label: 'Custom HTML',\n defaultValue: '<div style=\"padding:20px;text-align:center;color:#999;\">Custom HTML Block</div>',\n widget: 'rich_text',\n },\n },\n },\n spacing: {\n title: 'Spacing',\n options: { containerPadding: { label: 'Padding', defaultValue: '10px', widget: 'text' } },\n },\n general: {\n title: 'General',\n options: {\n hideDesktop: { label: 'Hide on Desktop', defaultValue: false, widget: 'toggle' },\n hideMobile: { label: 'Hide on Mobile', defaultValue: false, widget: 'toggle' },\n },\n },\n },\n defaultValues: {\n html: '<div style=\"padding:20px;text-align:center;color:#999;\">Custom HTML Block</div>',\n containerPadding: '10px',\n },\n renderer: {\n renderEditor(values: ContentValues): TemplateResult {\n return html`<div style=\"\">${unsafeHTML(str(values, 'html'))}</div>`;\n },\n renderHtml(values: ContentValues): string {\n return emailTableCell(str(values, 'html'), { padding: str(values, 'containerPadding', '10px') });\n },\n },\n};\n"],"names":["htmlTool","values","html","unsafeHTML","str","emailTableCell"],"mappings":";;;AAgBO,MAAMA,IAA8B;AAAA,EACzC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,uBAAuB,CAAC,SAAS,KAAK;AAAA,EACtC,UAAU;AAAA,EACV,SAAS;AAAA,IACP,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,SAAS;AAAA,QACP,MAAM;AAAA,UACJ,OAAO;AAAA,UACP,cAAc;AAAA,UACd,QAAQ;AAAA,QAAA;AAAA,MACV;AAAA,IACF;AAAA,IAEF,SAAS;AAAA,MACP,OAAO;AAAA,MACP,SAAS,EAAE,kBAAkB,EAAE,OAAO,WAAW,cAAc,QAAQ,QAAQ,OAAA,EAAO;AAAA,IAAE;AAAA,IAE1F,SAAS;AAAA,MACP,OAAO;AAAA,MACP,SAAS;AAAA,QACP,aAAa,EAAE,OAAO,mBAAmB,cAAc,IAAO,QAAQ,SAAA;AAAA,QACtE,YAAY,EAAE,OAAO,kBAAkB,cAAc,IAAO,QAAQ,SAAA;AAAA,MAAS;AAAA,IAC/E;AAAA,EACF;AAAA,EAEF,eAAe;AAAA,IACb,MAAM;AAAA,IACN,kBAAkB;AAAA,EAAA;AAAA,EAEpB,UAAU;AAAA,IACR,aAAaC,GAAuC;AAClD,aAAOC,kBAAqBC,EAAWC,EAAIH,GAAQ,MAAM,CAAC,CAAC;AAAA,IAC7D;AAAA,IACA,WAAWA,GAA+B;AACxC,aAAOI,EAAeD,EAAIH,GAAQ,MAAM,GAAG,EAAE,SAASG,EAAIH,GAAQ,oBAAoB,MAAM,EAAA,CAAG;AAAA,IACjG;AAAA,EAAA;AAEJ;"}
|