@verdocs/web-sdk 6.8.8 → 6.8.9
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/cjs/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.entry.cjs.js.map +1 -1
- package/dist/cjs/verdocs-preview_6.cjs.entry.js +13 -3
- package/dist/collection/components/embeds/verdocs-preview/verdocs-preview.js +6 -3
- package/dist/collection/components/embeds/verdocs-preview/verdocs-preview.js.map +1 -1
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +7 -0
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js.map +1 -1
- package/dist/components/{p-Dj2R-VU1.js → p-Cj8PYi4t.js} +8 -5
- package/dist/components/p-Cj8PYi4t.js.map +1 -0
- package/dist/components/{p-BEI7Iwuj.js → p-DNYvorxL.js} +9 -2
- package/dist/components/p-DNYvorxL.js.map +1 -0
- package/dist/components/verdocs-build.js +2 -2
- package/dist/components/verdocs-preview.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/esm/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.entry.js.map +1 -1
- package/dist/esm/verdocs-preview_6.entry.js +13 -3
- package/dist/esm-es5/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-preview_6.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_6.entry.js.map +1 -1
- package/dist/types/components/embeds/verdocs-preview/verdocs-preview.d.ts +1 -0
- package/dist/verdocs-web-sdk/p-B8zpaHu-.system.js +1 -1
- package/dist/verdocs-web-sdk/p-H1Y4Zb4E.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-abfa8b47.system.entry.js → p-d4e3efdb.system.entry.js} +3 -3
- package/dist/verdocs-web-sdk/p-d4e3efdb.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-0e4aa0d1.entry.js → p-fc308ef0.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-fc308ef0.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.entry.esm.js.map +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/components/p-BEI7Iwuj.js.map +0 -1
- package/dist/components/p-Dj2R-VU1.js.map +0 -1
- package/dist/verdocs-web-sdk/p-0e4aa0d1.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-Db5fIu2w.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-abfa8b47.system.entry.js.map +0 -1
|
@@ -72,11 +72,13 @@ const VerdocsPreview = class {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
componentDidRender() {
|
|
75
|
+
var _a;
|
|
75
76
|
// Defensive hack: fields rendered in other tabs (e.g. the builder's Fields tab) may share DOM
|
|
76
77
|
// IDs with fields shown here, and interact.js — being vanilla JS — is unaware of Stencil's
|
|
77
|
-
// re-renders. Unbind any drag/resize handlers on
|
|
78
|
-
//
|
|
79
|
-
|
|
78
|
+
// re-renders. Unbind any drag/resize handlers on fields inside our own subtree after each
|
|
79
|
+
// render so they stay non-interactive in preview mode. Scope to hostEl so we don't clobber
|
|
80
|
+
// handlers on fields belonging to a sibling component during brief tab-switch overlaps.
|
|
81
|
+
(_a = this.hostEl) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.verdocs-field').forEach(el => {
|
|
80
82
|
interact_min.interact(el).unset();
|
|
81
83
|
});
|
|
82
84
|
}
|
|
@@ -113,6 +115,7 @@ const VerdocsPreview = class {
|
|
|
113
115
|
})));
|
|
114
116
|
})));
|
|
115
117
|
}
|
|
118
|
+
get hostEl() { return index$1.getElement(this); }
|
|
116
119
|
static get watchers() { return {
|
|
117
120
|
"templateId": ["onTemplateIdChanged"]
|
|
118
121
|
}; }
|
|
@@ -740,6 +743,13 @@ const VerdocsTemplateFields = class {
|
|
|
740
743
|
}
|
|
741
744
|
componentDidRender() {
|
|
742
745
|
interact_min.interact.dynamicDrop(true);
|
|
746
|
+
// Defensive re-attach: when returning to the Fields tab from Preview, the preview component
|
|
747
|
+
// may have unset interact bindings on shared field DOM elements. pageRendered doesn't always
|
|
748
|
+
// refire in that case, so ensure every .verdocs-field in the document has a drag handler.
|
|
749
|
+
// makeDraggable is idempotent (interact re-configures the same Interactable).
|
|
750
|
+
document.querySelectorAll('.verdocs-field').forEach(el => {
|
|
751
|
+
this.makeDraggable(el);
|
|
752
|
+
});
|
|
743
753
|
const toolbarTarget = this.toolbarTargetId ? document.getElementById(this.toolbarTargetId) : null;
|
|
744
754
|
const toolbarEl = document.getElementById('verdocs-template-fields-toolbar');
|
|
745
755
|
if (toolbarTarget && toolbarEl) {
|
|
@@ -71,11 +71,13 @@ export class VerdocsPreview {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
componentDidRender() {
|
|
74
|
+
var _a;
|
|
74
75
|
// Defensive hack: fields rendered in other tabs (e.g. the builder's Fields tab) may share DOM
|
|
75
76
|
// IDs with fields shown here, and interact.js — being vanilla JS — is unaware of Stencil's
|
|
76
|
-
// re-renders. Unbind any drag/resize handlers on
|
|
77
|
-
//
|
|
78
|
-
|
|
77
|
+
// re-renders. Unbind any drag/resize handlers on fields inside our own subtree after each
|
|
78
|
+
// render so they stay non-interactive in preview mode. Scope to hostEl so we don't clobber
|
|
79
|
+
// handlers on fields belonging to a sibling component during brief tab-switch overlaps.
|
|
80
|
+
(_a = this.hostEl) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.verdocs-field').forEach(el => {
|
|
79
81
|
interact(el).unset();
|
|
80
82
|
});
|
|
81
83
|
}
|
|
@@ -201,6 +203,7 @@ export class VerdocsPreview {
|
|
|
201
203
|
}
|
|
202
204
|
}];
|
|
203
205
|
}
|
|
206
|
+
static get elementRef() { return "hostEl"; }
|
|
204
207
|
static get watchers() {
|
|
205
208
|
return [{
|
|
206
209
|
"propName": "templateId",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdocs-preview.js","sourceRoot":"","sources":["../../../../src/components/embeds/verdocs-preview/verdocs-preview.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAC,WAAW,EAAE,eAAe,EAAa,eAAe,EAAC,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAAC,KAAK,EAAgB,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AACpG,OAAO,EAAC,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAC,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAE/C;;;;;;;;;;;GAWG;AAMH,MAAM,OAAO,cAAc;IAL3B;QAMU,uBAAkB,GAAG,IAAI,CAAC;QAC1B,kBAAa,GAAsC,EAAE,CAAC;QAE9D;;WAEG;QACK,aAAQ,GAAoB,eAAe,CAAC,UAAU,EAAE,CAAC;QAEjE;;WAEG;QACK,eAAU,GAAkB,IAAI,CAAC;QAQhC,YAAO,GAAG,IAAI,CAAC;QACf,aAAQ,GAAqB,IAAI,CAAC;KA2H5C;IAzHC,oBAAoB;QAClB,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,KAAK,CAAC,SAAS,CACb,WAAW,EACX,IAAI,CAAC,UAAU,EACf,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC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point} from '@verdocs/js-sdk';\nimport {Event, EventEmitter, Host, Component, Prop, h, State, Fragment, Watch} from '@stencil/core';\nimport {renderDocumentField} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Display a template preview experience. This will display the template's attached\n * documents with signing fields overlaid on each page. Fields will be color-coded\n * by recipient, and will be read-only (cannot be filled, moved, or altered).\n *\n * ```ts\n * <verdocs-preview\n * templateId={TEMPLATE_ID}\n * onSdkError={({ detail }) => { console.log('SDK error', detail) }\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-preview',\n styleUrl: 'verdocs-preview.scss',\n shadow: false,\n})\nexport class VerdocsPreview {\n private templateListenerId = null;\n private renderedPages: Record<string, IDocumentPageInfo> = {};\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop() templateId: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n @Watch('templateId')\n onTemplateIdChanged(newTemplateId: string) {\n console.log('[PREVIEW] Template ID changed', newTemplateId);\n this.listenToTemplate();\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n if (!this.endpoint.session) {\n console.log('[PREVIEW] Unable to start builder session, must be authenticated');\n return;\n }\n\n if (!this.templateId) {\n console.log(`[PREVIEW] Missing required template ID ${this.templateId}`);\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[PREVIEW] Error with preview session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n componentDidRender() {\n // Defensive hack: fields rendered in other tabs (e.g. the builder's Fields tab) may share DOM\n // IDs with fields shown here, and interact.js — being vanilla JS — is unaware of Stencil's\n // re-renders. Unbind any drag/resize handlers on every .verdocs-field after each render so\n // fields stay non-interactive in preview mode regardless of where they came from.\n document.querySelectorAll('.verdocs-field').forEach(el => {\n interact(el as HTMLElement).unset();\n });\n }\n\n handlePageRendered(e: any) {\n const pageInfo = e.detail as IDocumentPageInfo;\n this.renderedPages[`${pageInfo.documentId}:${pageInfo.pageNumber}`] = pageInfo;\n\n const fields = (this.template?.fields || []).filter(field => {\n // Templates created on the new builder have document_id set, but old ones may not.\n // If document_id is missing, we assume it's for the first document or use legacy logic.\n // However, for this fix, we primarily care about multi-doc templates which should have IDs.\n if (field['document_id']) {\n return field['document_id'] === pageInfo.documentId && field.page === pageInfo.pageNumber;\n }\n return field.page === pageInfo.pageNumber;\n });\n\n // console.log('[PREVIEW] Page rendered', pageInfo, fields);\n fields.forEach(field => renderDocumentField('template', field, pageInfo, {disabled: true, editable: false, draggable: false}));\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n return (\n <Host>\n {(this.template?.documents || []).map(document => {\n const pageNumbers = integerSequence(1, document.pages);\n return (\n <Fragment>\n {pageNumbers.map(pageNumber => {\n const pageSize = document.page_sizes?.[pageNumber] || {width: 612, height: 792};\n\n return (\n <verdocs-template-document-page\n templateId={document.template_id}\n documentId={document.id}\n pageNumber={pageNumber}\n disabled={true}\n editable={false}\n done={false}\n virtualWidth={pageSize.width}\n virtualHeight={pageSize.height}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n );\n })}\n </Fragment>\n );\n })}\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"verdocs-preview.js","sourceRoot":"","sources":["../../../../src/components/embeds/verdocs-preview/verdocs-preview.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAC,WAAW,EAAE,eAAe,EAAa,eAAe,EAAC,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAAC,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAC,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAC,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAE/C;;;;;;;;;;;GAWG;AAMH,MAAM,OAAO,cAAc;IAL3B;QAMU,uBAAkB,GAAG,IAAI,CAAC;QAC1B,kBAAa,GAAsC,EAAE,CAAC;QAI9D;;WAEG;QACK,aAAQ,GAAoB,eAAe,CAAC,UAAU,EAAE,CAAC;QAEjE;;WAEG;QACK,eAAU,GAAkB,IAAI,CAAC;QAQhC,YAAO,GAAG,IAAI,CAAC;QACf,aAAQ,GAAqB,IAAI,CAAC;KA4H5C;IA1HC,oBAAoB;QAClB,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,KAAK,CAAC,SAAS,CACb,WAAW,EACX,IAAI,CAAC,UAAU,EACf,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,EACjD,KAAK,EACL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Endpoint} from '@verdocs/js-sdk';\nimport {Element, Event, EventEmitter, Host, Component, Prop, h, State, Fragment, Watch} from '@stencil/core';\nimport {renderDocumentField} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Display a template preview experience. This will display the template's attached\n * documents with signing fields overlaid on each page. Fields will be color-coded\n * by recipient, and will be read-only (cannot be filled, moved, or altered).\n *\n * ```ts\n * <verdocs-preview\n * templateId={TEMPLATE_ID}\n * onSdkError={({ detail }) => { console.log('SDK error', detail) }\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-preview',\n styleUrl: 'verdocs-preview.scss',\n shadow: false,\n})\nexport class VerdocsPreview {\n private templateListenerId = null;\n private renderedPages: Record<string, IDocumentPageInfo> = {};\n\n @Element() hostEl: HTMLElement;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop() templateId: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n @Watch('templateId')\n onTemplateIdChanged(newTemplateId: string) {\n console.log('[PREVIEW] Template ID changed', newTemplateId);\n this.listenToTemplate();\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n if (!this.endpoint.session) {\n console.log('[PREVIEW] Unable to start builder session, must be authenticated');\n return;\n }\n\n if (!this.templateId) {\n console.log(`[PREVIEW] Missing required template ID ${this.templateId}`);\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[PREVIEW] Error with preview session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n componentDidRender() {\n // Defensive hack: fields rendered in other tabs (e.g. the builder's Fields tab) may share DOM\n // IDs with fields shown here, and interact.js — being vanilla JS — is unaware of Stencil's\n // re-renders. Unbind any drag/resize handlers on fields inside our own subtree after each\n // render so they stay non-interactive in preview mode. Scope to hostEl so we don't clobber\n // handlers on fields belonging to a sibling component during brief tab-switch overlaps.\n this.hostEl?.querySelectorAll('.verdocs-field').forEach(el => {\n interact(el as HTMLElement).unset();\n });\n }\n\n handlePageRendered(e: any) {\n const pageInfo = e.detail as IDocumentPageInfo;\n this.renderedPages[`${pageInfo.documentId}:${pageInfo.pageNumber}`] = pageInfo;\n\n const fields = (this.template?.fields || []).filter(field => {\n // Templates created on the new builder have document_id set, but old ones may not.\n // If document_id is missing, we assume it's for the first document or use legacy logic.\n // However, for this fix, we primarily care about multi-doc templates which should have IDs.\n if (field['document_id']) {\n return field['document_id'] === pageInfo.documentId && field.page === pageInfo.pageNumber;\n }\n return field.page === pageInfo.pageNumber;\n });\n\n // console.log('[PREVIEW] Page rendered', pageInfo, fields);\n fields.forEach(field => renderDocumentField('template', field, pageInfo, {disabled: true, editable: false, draggable: false}));\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n return (\n <Host>\n {(this.template?.documents || []).map(document => {\n const pageNumbers = integerSequence(1, document.pages);\n return (\n <Fragment>\n {pageNumbers.map(pageNumber => {\n const pageSize = document.page_sizes?.[pageNumber] || {width: 612, height: 792};\n\n return (\n <verdocs-template-document-page\n templateId={document.template_id}\n documentId={document.id}\n pageNumber={pageNumber}\n disabled={true}\n editable={false}\n done={false}\n virtualWidth={pageSize.width}\n virtualHeight={pageSize.height}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n );\n })}\n </Fragment>\n );\n })}\n </Host>\n );\n }\n}\n"]}
|
package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js
CHANGED
|
@@ -103,6 +103,13 @@ export class VerdocsTemplateFields {
|
|
|
103
103
|
}
|
|
104
104
|
componentDidRender() {
|
|
105
105
|
interact.dynamicDrop(true);
|
|
106
|
+
// Defensive re-attach: when returning to the Fields tab from Preview, the preview component
|
|
107
|
+
// may have unset interact bindings on shared field DOM elements. pageRendered doesn't always
|
|
108
|
+
// refire in that case, so ensure every .verdocs-field in the document has a drag handler.
|
|
109
|
+
// makeDraggable is idempotent (interact re-configures the same Interactable).
|
|
110
|
+
document.querySelectorAll('.verdocs-field').forEach(el => {
|
|
111
|
+
this.makeDraggable(el);
|
|
112
|
+
});
|
|
106
113
|
const toolbarTarget = this.toolbarTargetId ? document.getElementById(this.toolbarTargetId) : null;
|
|
107
114
|
const toolbarEl = document.getElementById('verdocs-template-fields-toolbar');
|
|
108
115
|
if (toolbarTarget && toolbarEl) {
|
package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdocs-template-fields.js","sourceRoot":"","sources":["../../../../src/components/templates/verdocs-template-fields/verdocs-template-fields.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAgB,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,eAAe,EAAyC,WAAW,EAAE,eAAe,EAAC,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,0CAAE,KAAK,KAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,4CAA4C,CAAC,CAAC,CAAC,oDAAoD,EACtJ,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,GAC/C,CACH,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import interact from 'interactjs';\nimport {Component, h, Event, EventEmitter, Fragment, Prop, Host, State, Listen, Watch} from '@stencil/core';\nimport {createField, getTemplate, integerSequence, ITemplate, ITemplateField, TFieldType, updateField, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {defaultHeight, defaultWidth, getFieldId, removeCssTransform, setControlStyles, updateCssTransform} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {DocumentPageIcon} from '../../../utils/Icons';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst iconTextbox = '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z\"/></svg>';\n\nconst iconCheck =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z\"/></svg>';\n\nconst iconRadio =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z\"/></svg>';\n\nconst iconDatepicker =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z\"/></svg>';\n\nconst iconSignature =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z\"/></svg>';\n\nconst iconInitial =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z\"/></svg>';\n\n// const iconTimestamp =\n// '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z\"></path></svg>';\n\nconst iconDropdown =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\" stroke-width=\"1.5\" stroke=\"currentColor\"><path stroke=\"#ffffff\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25\" /></svg>';\n\nconst iconAttachment =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13\" /></svg>';\n\nconst separator = '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 14.707 14.707\"><g><rect x=\"6.275\" y=\"0\" fill=\"#ffffff7f\" width=\"1\" height=\"15\"/></g></svg>';\n\nconst menuOptions = [\n {id: 'signature', tooltip: 'Signature', icon: iconSignature, class: 'signature'},\n {id: 'initial', tooltip: 'Initials', icon: iconInitial, class: 'initial'},\n {id: 'sep1', tooltip: '', icon: separator, class: 'separator'},\n {id: 'textbox', tooltip: 'Text Box', icon: iconTextbox, class: 'textbox'},\n {id: 'checkbox', tooltip: 'Check Box', icon: iconCheck, class: 'checkbox'},\n {id: 'radio', tooltip: 'Radio Button', icon: iconRadio, class: 'radio'},\n {id: 'dropdown', tooltip: 'Dropdown', icon: iconDropdown, class: 'dropdown'},\n {id: 'sep2', tooltip: '', icon: separator, class: 'separator'},\n {id: 'date', tooltip: 'Date', icon: iconDatepicker, class: 'date'},\n // {id: 'timestamp', tooltip: 'Timestamp', icon: iconTimestamp, class: 'timestamp'},\n // {id: 'sep3', tooltip: '', icon: separator},\n {id: 'attachment', tooltip: 'Attachment', icon: iconAttachment, class: 'attachment'},\n // {id: 'payment', tooltip: 'Payment', icon: 'P'},\n];\n\n/**\n * Displays a builder experience for laying out fields in a template. Note that this experience requires a large display area to\n * present all of the required controls, so it is primarily intended to be used in desktop environments.\n */\n@Component({\n tag: 'verdocs-template-fields',\n styleUrl: 'verdocs-template-fields.scss',\n shadow: false,\n})\nexport class VerdocsTemplateFields {\n private templateListenerId = null;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop({reflect: true, mutable: true}) templateId: string | null = null;\n\n /**\n * If set, (recommended), the host application should create a <DIV> element with a unique ID. When this\n * component renders, the toolbar will be removed from its default location and placed in the target element.\n * This allows the parent application to more easily control its placement and scroll effects.\n *\n * The movement of the toolbar to the target container is not dynamic - it is performed only on the initial\n * render. Host applications should not conditionally render this container. If the toolbar's visibility must\n * be externally controlled, use CSS display options to hide/show it instead.\n */\n @Prop() toolbarTargetId: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the template is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.\n */\n @Event({composed: true}) templateUpdated: EventEmitter<{endpoint: VerdocsEndpoint; template: ITemplate; event: 'added-field' | 'updated-field' | 'deleted-field'}>;\n\n @State() placing: TFieldType | null = null;\n @State() showMustSelectRole = false;\n @State() selectedRoleName = '';\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n pageHeights: Record<number, number> = {};\n\n @Watch('templateId')\n onTemplateIdChanged() {\n this.listenToTemplate();\n }\n\n // Stop field-placement mode if ESC is pressed\n @Listen('keydown', {target: 'document'})\n handleKeyDown(ev: KeyboardEvent) {\n if (ev.key === 'Escape') {\n this.placing = null;\n }\n }\n\n @Listen('settingsChanged')\n handleFieldSettingsChanged() {\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'updated-field'});\n }\n\n @Listen('deleted')\n handleFieldDeleted() {\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'deleted-field'});\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[FIELDS] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[FIELDS] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[FIELDS] Error with fields session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n componentDidRender() {\n interact.dynamicDrop(true);\n\n const toolbarTarget = this.toolbarTargetId ? document.getElementById(this.toolbarTargetId) : null;\n const toolbarEl = document.getElementById('verdocs-template-fields-toolbar');\n if (toolbarTarget && toolbarEl) {\n toolbarEl.remove();\n toolbarTarget.append(toolbarEl);\n }\n }\n\n componentWillUpdate() {\n // If a new role was added and there were none yet so far, or the \"selected\" role was deleted, reset our selection\n const roles = [...(this.template?.roles || [])].sort((a, b) => (a.sequence ?? 0) - (b.sequence ?? 0));\n if (!this.selectedRoleName || !roles.find(role => role && role.name === this.selectedRoleName)) {\n this.selectedRoleName = roles[0]?.name || '';\n console.log('[FIELDS] Selected new role', this.selectedRoleName);\n }\n }\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n console.log('Template updated');\n this.template = template;\n this.loading = false;\n\n if (!this.selectedRoleName) {\n const sorted = [...(template.roles || [])].sort((a, b) => (a.sequence ?? 0) - (b.sequence ?? 0));\n this.selectedRoleName = sorted[0]?.name || '';\n }\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n cachedPageInfo: Record<string, Record<number, IDocumentPageInfo>> = {};\n handlePageRendered(e: any) {\n const pageInfo = e.detail as IDocumentPageInfo;\n console.log('[FIELDS] Page rendered', pageInfo.documentId, pageInfo.pageNumber, pageInfo.xScale, pageInfo.yScale);\n this.cachedPageInfo[pageInfo.documentId] ??= {};\n this.cachedPageInfo[pageInfo.documentId][pageInfo.pageNumber] = pageInfo;\n\n this.pageHeights[pageInfo.pageNumber] = pageInfo.naturalHeight;\n\n (this.template?.fields || [])\n .filter(field => field && field.page === pageInfo.pageNumber)\n .forEach(field => {\n const id = getFieldId(field);\n const el = document.getElementById(id);\n if (el) {\n el.setAttribute('templateid', this.templateId);\n el.setAttribute('fieldname', field.name);\n el.setAttribute('documentid', String(field.document_id));\n el.setAttribute('pagenumber', String(field.page));\n el.setAttribute('xScale', String(pageInfo.xScale));\n el.setAttribute('yScale', String(pageInfo.yScale));\n this.makeDraggable(el);\n }\n });\n }\n\n makeDraggable(el: HTMLElement) {\n interact(el).draggable({\n listeners: {\n move: this.handleMoveField.bind(this),\n end: this.handleMoveEnd.bind(this),\n },\n });\n }\n\n async handleMoveField(event: any) {\n const oldX = +(event.target.getAttribute('posX') || 0);\n const oldY = +(event.target.getAttribute('posY') || 0);\n const xScale = +(event.target.getAttribute('xScale') || 1);\n const yScale = +(event.target.getAttribute('yScale') || 1);\n const newX = event.dx / xScale + oldX;\n const newY = event.dy / yScale + oldY;\n event.target.setAttribute('posX', newX);\n event.target.setAttribute('posy', newY);\n updateCssTransform(event.target, 'translate', `${newX}px, ${newY}px`);\n }\n\n async handleMoveEnd(event: any) {\n const name = event.target.getAttribute('fieldname');\n const field = (this.template?.fields || []).find(field => field.name === name);\n if (!field) {\n console.log('[FIELDS] Unable to find field', name, event.target);\n return;\n }\n\n const pageNumber = event.target.getAttribute('pagenumber');\n const documentId = event.target.getAttribute('documentid');\n let {naturalWidth = 612, naturalHeight = 792, renderedHeight = 792} = this.cachedPageInfo[documentId][pageNumber];\n const clientRect = event.target.getBoundingClientRect();\n const parent = event.target.parentElement;\n const parentRect = parent.getBoundingClientRect();\n\n const width = field.width || defaultWidth(field.type);\n const height = field.height || defaultHeight(field.type);\n\n // These two being backwards is not a mistake. Left measures \"over\" from the left\n // (positive displacement) while bottom measures \"up\" from the bottom (negative displacement).\n const newX = Math.max(clientRect.left - parentRect.left, 0);\n let newY = Math.max(renderedHeight - (parentRect.bottom - clientRect.bottom), 0);\n\n let newPageNumber = parseInt(pageNumber);\n if (newY > renderedHeight) {\n newPageNumber = Math.min(newPageNumber + 1, (this.template?.documents || [])?.[0]?.pages || 1);\n newY -= renderedHeight;\n renderedHeight = this.cachedPageInfo[documentId][newPageNumber].renderedHeight;\n\n console.log('Next page', {newPageNumber, newY, renderedHeight});\n } else if (newY < 0) {\n newPageNumber = Math.max(newPageNumber - 1, 1);\n renderedHeight = this.cachedPageInfo[documentId][newPageNumber].renderedHeight;\n newY += renderedHeight;\n console.log('[FIELDS] Next page', {newPageNumber, newY, renderedHeight});\n }\n\n const {x, y} = this.viewCoordinatesToPageCoordinates(newX, newY, documentId, pageNumber, naturalWidth - width, naturalHeight - height);\n try {\n const params = {x, y, page: newPageNumber};\n const updatedField = await updateField(this.endpoint, this.templateId, name, params);\n console.log('[FIELDS] Updated', updatedField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n const fieldIndex = newTemplate.fields.findIndex(field => field.name === name);\n if (fieldIndex > -1) {\n newTemplate.fields[fieldIndex] = updatedField;\n }\n\n Store.updateTemplate(this.templateId, newTemplate);\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n const {xScale = 1, yScale = 1} = this.cachedPageInfo[documentId][pageNumber];\n setControlStyles(event.target, updatedField, xScale, yScale);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'updated-field'});\n } catch (e) {\n VerdocsToast('Error updating field, please try again later', {style: 'error'});\n console.log('[FIELDS] Error updating field', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n }\n }\n\n generateFieldName(type: string, pageNumber: number) {\n let i = 1;\n let fieldName: string;\n do {\n fieldName = `${type}P${pageNumber}-${i}`;\n i++;\n } while ((this.template?.fields || []).some(field => field && field.name === fieldName));\n\n return fieldName;\n }\n\n // Scale the X,Y clicks to the virtual page dimensions. Also ensure the field doesn't go off the page.\n viewCoordinatesToPageCoordinates(viewX: number, viewY: number, documentId: string, pageNumber: number, xMax: number, yMax: number) {\n const {xScale = 1, yScale = 1, renderedHeight = 792} = this.cachedPageInfo[documentId][pageNumber];\n const x = Math.floor(Math.min(viewX / xScale, xMax));\n const y = Math.floor(Math.min(Math.max(renderedHeight - viewY, 0) / yScale, yMax));\n return {x, y};\n }\n\n async handleClickPage(e: any, documentId: string, pageNumber: number) {\n if (this.placing) {\n // console.log('Placing field', {documentId, pageNumber});\n const clickedX = e.offsetX;\n const clickedY = e.offsetY;\n\n const width = defaultWidth(this.placing);\n const height = defaultHeight(this.placing);\n\n const cachedPage = this.cachedPageInfo[documentId][pageNumber];\n const {naturalWidth = 612, naturalHeight = 792} = cachedPage;\n\n const coords = this.viewCoordinatesToPageCoordinates(clickedX, clickedY, documentId, pageNumber, naturalWidth - width, naturalHeight - height);\n const x = Math.floor(coords.x);\n const y = Math.floor(coords.y);\n\n const field: ITemplateField = {\n name: this.generateFieldName(this.placing, pageNumber), // 'textboxP1-22',\n role_name: this.selectedRoleName,\n template_id: this.templateId,\n document_id: cachedPage.documentId,\n type: this.placing,\n required: this.placing !== 'radio' && this.placing !== 'attachment' && this.placing !== 'checkbox',\n page: pageNumber,\n validator: null,\n label: null,\n default: null,\n placeholder: null,\n group: null,\n settings: {},\n x,\n y,\n width,\n height,\n multiline: false,\n readonly: false,\n options: this.placing === 'radio' ? [{id: 'option-1', label: 'Option 1'}] : [],\n };\n\n const newField = await createField(this.endpoint, this.templateId, field);\n console.log('[FIELDS] Created field', newField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n newTemplate.fields.push(newField);\n\n Store.updateTemplate(this.templateId, newTemplate);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'added-field'});\n\n this.placing = null;\n }\n }\n\n render() {\n console.log('Rendering');\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (!this.endpoint.session) {\n return (\n <Host>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n const sortedRoles = [...(this.template?.roles || [])].sort((a, b) => (a.sequence ?? 0) - (b.sequence ?? 0));\n const selectableRoles = sortedRoles.map(role => ({value: role.name, label: role.full_name ? `${role.name}: ${role.full_name}` : role.name}));\n\n return (\n <Host class={this.placing ? {[`placing-${this.placing}`]: true} : {}} onSubmit={() => {}}>\n <div id=\"verdocs-template-fields-toolbar\">\n <div class=\"add-for\">Add field:</div>\n <verdocs-select-input value={this.selectedRoleName} options={selectableRoles} onInput={(e: any) => (this.selectedRoleName = e.target.value)} />\n\n {menuOptions.map(option => (\n <verdocs-toolbar-icon\n text={option.tooltip}\n icon={option.icon}\n class={option.class}\n onClick={() => {\n // We ignore empty-tooltip entries because they're separators\n if (option.tooltip) {\n // We require a role to be selected first\n if (this.selectedRoleName) {\n this.placing = option.id as TFieldType;\n } else {\n this.showMustSelectRole = true;\n }\n }\n }}\n />\n ))}\n </div>\n\n {/* <div class=\"page-0\" ref={el => (this.page0El = el as HTMLDivElement)}>*/}\n {/* <div class=\"user-placed-fields\">*/}\n {/* <div class=\"title\">User-Placed Fields</div>*/}\n {/* <verdocs-field-signature*/}\n {/* field={testField}*/}\n {/* style={{width: '82px', height: '41px', left: '20px', top: '40px', transform: 'scale(1,1)', backgroundColor: getRGBA(0)}}*/}\n {/* moveable={true}*/}\n {/* editable={true}*/}\n {/* />*/}\n {/* </div>*/}\n {/*</div>*/}\n\n <div class=\"pages\">\n {(this.template?.documents || []).map(document => {\n const pageNumbers = integerSequence(1, document.pages);\n\n return pageNumbers.map(page => {\n const pageSize = document.page_sizes[page];\n\n return (\n <Fragment>\n {this.template?.documents.length > 1 && (\n <div class=\"document-separator\">\n <div innerHTML={DocumentPageIcon} />\n <span>{document.name}</span>\n </div>\n )}\n\n <verdocs-template-document-page\n templateId={this.templateId}\n documentId={document.id}\n pageNumber={page}\n virtualWidth={pageSize?.width || 612}\n virtualHeight={pageSize?.height || 792}\n disabled={true}\n editable={true}\n done={false}\n onClick={(e: PointerEvent) => this.handleClickPage(e, document.id, page)}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n </Fragment>\n );\n });\n })}\n </div>\n {this.showMustSelectRole && (\n <verdocs-ok-dialog\n heading=\"Unable to add field\"\n message={(this.template?.roles || []).length > 0 ? 'Please select a role before adding fields.' : 'Please add at least one role before adding fields.'}\n onNext={() => (this.showMustSelectRole = false)}\n />\n )}\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"verdocs-template-fields.js","sourceRoot":"","sources":["../../../../src/components/templates/verdocs-template-fields/verdocs-template-fields.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAgB,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,eAAe,EAAyC,WAAW,EAAE,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAC/I,OAAO,EAAC,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAEvI,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAC,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAE/C,MAAM,WAAW,GAAG,mJAAmJ,CAAC;AAExK,MAAM,SAAS,GACb,mZAAmZ,CAAC;AAEtZ,MAAM,SAAS,GACb,0qBAA0qB,CAAC;AAE7qB,MAAM,cAAc,GAClB,ytBAAytB,CAAC;AAE5tB,MAAM,aAAa,GACjB,oXAAoX,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import interact from 'interactjs';\nimport {Component, h, Event, EventEmitter, Fragment, Prop, Host, State, Listen, Watch} from '@stencil/core';\nimport {createField, getTemplate, integerSequence, ITemplate, ITemplateField, TFieldType, updateField, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {defaultHeight, defaultWidth, getFieldId, removeCssTransform, setControlStyles, updateCssTransform} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {DocumentPageIcon} from '../../../utils/Icons';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst iconTextbox = '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z\"/></svg>';\n\nconst iconCheck =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z\"/></svg>';\n\nconst iconRadio =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z\"/></svg>';\n\nconst iconDatepicker =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z\"/></svg>';\n\nconst iconSignature =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z\"/></svg>';\n\nconst iconInitial =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z\"/></svg>';\n\n// const iconTimestamp =\n// '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z\"></path></svg>';\n\nconst iconDropdown =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\" stroke-width=\"1.5\" stroke=\"currentColor\"><path stroke=\"#ffffff\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25\" /></svg>';\n\nconst iconAttachment =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13\" /></svg>';\n\nconst separator = '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 14.707 14.707\"><g><rect x=\"6.275\" y=\"0\" fill=\"#ffffff7f\" width=\"1\" height=\"15\"/></g></svg>';\n\nconst menuOptions = [\n {id: 'signature', tooltip: 'Signature', icon: iconSignature, class: 'signature'},\n {id: 'initial', tooltip: 'Initials', icon: iconInitial, class: 'initial'},\n {id: 'sep1', tooltip: '', icon: separator, class: 'separator'},\n {id: 'textbox', tooltip: 'Text Box', icon: iconTextbox, class: 'textbox'},\n {id: 'checkbox', tooltip: 'Check Box', icon: iconCheck, class: 'checkbox'},\n {id: 'radio', tooltip: 'Radio Button', icon: iconRadio, class: 'radio'},\n {id: 'dropdown', tooltip: 'Dropdown', icon: iconDropdown, class: 'dropdown'},\n {id: 'sep2', tooltip: '', icon: separator, class: 'separator'},\n {id: 'date', tooltip: 'Date', icon: iconDatepicker, class: 'date'},\n // {id: 'timestamp', tooltip: 'Timestamp', icon: iconTimestamp, class: 'timestamp'},\n // {id: 'sep3', tooltip: '', icon: separator},\n {id: 'attachment', tooltip: 'Attachment', icon: iconAttachment, class: 'attachment'},\n // {id: 'payment', tooltip: 'Payment', icon: 'P'},\n];\n\n/**\n * Displays a builder experience for laying out fields in a template. Note that this experience requires a large display area to\n * present all of the required controls, so it is primarily intended to be used in desktop environments.\n */\n@Component({\n tag: 'verdocs-template-fields',\n styleUrl: 'verdocs-template-fields.scss',\n shadow: false,\n})\nexport class VerdocsTemplateFields {\n private templateListenerId = null;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop({reflect: true, mutable: true}) templateId: string | null = null;\n\n /**\n * If set, (recommended), the host application should create a <DIV> element with a unique ID. When this\n * component renders, the toolbar will be removed from its default location and placed in the target element.\n * This allows the parent application to more easily control its placement and scroll effects.\n *\n * The movement of the toolbar to the target container is not dynamic - it is performed only on the initial\n * render. Host applications should not conditionally render this container. If the toolbar's visibility must\n * be externally controlled, use CSS display options to hide/show it instead.\n */\n @Prop() toolbarTargetId: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the template is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.\n */\n @Event({composed: true}) templateUpdated: EventEmitter<{endpoint: VerdocsEndpoint; template: ITemplate; event: 'added-field' | 'updated-field' | 'deleted-field'}>;\n\n @State() placing: TFieldType | null = null;\n @State() showMustSelectRole = false;\n @State() selectedRoleName = '';\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n pageHeights: Record<number, number> = {};\n\n @Watch('templateId')\n onTemplateIdChanged() {\n this.listenToTemplate();\n }\n\n // Stop field-placement mode if ESC is pressed\n @Listen('keydown', {target: 'document'})\n handleKeyDown(ev: KeyboardEvent) {\n if (ev.key === 'Escape') {\n this.placing = null;\n }\n }\n\n @Listen('settingsChanged')\n handleFieldSettingsChanged() {\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'updated-field'});\n }\n\n @Listen('deleted')\n handleFieldDeleted() {\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'deleted-field'});\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[FIELDS] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[FIELDS] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[FIELDS] Error with fields session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n componentDidRender() {\n interact.dynamicDrop(true);\n\n // Defensive re-attach: when returning to the Fields tab from Preview, the preview component\n // may have unset interact bindings on shared field DOM elements. pageRendered doesn't always\n // refire in that case, so ensure every .verdocs-field in the document has a drag handler.\n // makeDraggable is idempotent (interact re-configures the same Interactable).\n document.querySelectorAll('.verdocs-field').forEach(el => {\n this.makeDraggable(el as HTMLElement);\n });\n\n const toolbarTarget = this.toolbarTargetId ? document.getElementById(this.toolbarTargetId) : null;\n const toolbarEl = document.getElementById('verdocs-template-fields-toolbar');\n if (toolbarTarget && toolbarEl) {\n toolbarEl.remove();\n toolbarTarget.append(toolbarEl);\n }\n }\n\n componentWillUpdate() {\n // If a new role was added and there were none yet so far, or the \"selected\" role was deleted, reset our selection\n const roles = [...(this.template?.roles || [])].sort((a, b) => (a.sequence ?? 0) - (b.sequence ?? 0));\n if (!this.selectedRoleName || !roles.find(role => role && role.name === this.selectedRoleName)) {\n this.selectedRoleName = roles[0]?.name || '';\n console.log('[FIELDS] Selected new role', this.selectedRoleName);\n }\n }\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n console.log('Template updated');\n this.template = template;\n this.loading = false;\n\n if (!this.selectedRoleName) {\n const sorted = [...(template.roles || [])].sort((a, b) => (a.sequence ?? 0) - (b.sequence ?? 0));\n this.selectedRoleName = sorted[0]?.name || '';\n }\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n cachedPageInfo: Record<string, Record<number, IDocumentPageInfo>> = {};\n handlePageRendered(e: any) {\n const pageInfo = e.detail as IDocumentPageInfo;\n console.log('[FIELDS] Page rendered', pageInfo.documentId, pageInfo.pageNumber, pageInfo.xScale, pageInfo.yScale);\n this.cachedPageInfo[pageInfo.documentId] ??= {};\n this.cachedPageInfo[pageInfo.documentId][pageInfo.pageNumber] = pageInfo;\n\n this.pageHeights[pageInfo.pageNumber] = pageInfo.naturalHeight;\n\n (this.template?.fields || [])\n .filter(field => field && field.page === pageInfo.pageNumber)\n .forEach(field => {\n const id = getFieldId(field);\n const el = document.getElementById(id);\n if (el) {\n el.setAttribute('templateid', this.templateId);\n el.setAttribute('fieldname', field.name);\n el.setAttribute('documentid', String(field.document_id));\n el.setAttribute('pagenumber', String(field.page));\n el.setAttribute('xScale', String(pageInfo.xScale));\n el.setAttribute('yScale', String(pageInfo.yScale));\n this.makeDraggable(el);\n }\n });\n }\n\n makeDraggable(el: HTMLElement) {\n interact(el).draggable({\n listeners: {\n move: this.handleMoveField.bind(this),\n end: this.handleMoveEnd.bind(this),\n },\n });\n }\n\n async handleMoveField(event: any) {\n const oldX = +(event.target.getAttribute('posX') || 0);\n const oldY = +(event.target.getAttribute('posY') || 0);\n const xScale = +(event.target.getAttribute('xScale') || 1);\n const yScale = +(event.target.getAttribute('yScale') || 1);\n const newX = event.dx / xScale + oldX;\n const newY = event.dy / yScale + oldY;\n event.target.setAttribute('posX', newX);\n event.target.setAttribute('posy', newY);\n updateCssTransform(event.target, 'translate', `${newX}px, ${newY}px`);\n }\n\n async handleMoveEnd(event: any) {\n const name = event.target.getAttribute('fieldname');\n const field = (this.template?.fields || []).find(field => field.name === name);\n if (!field) {\n console.log('[FIELDS] Unable to find field', name, event.target);\n return;\n }\n\n const pageNumber = event.target.getAttribute('pagenumber');\n const documentId = event.target.getAttribute('documentid');\n let {naturalWidth = 612, naturalHeight = 792, renderedHeight = 792} = this.cachedPageInfo[documentId][pageNumber];\n const clientRect = event.target.getBoundingClientRect();\n const parent = event.target.parentElement;\n const parentRect = parent.getBoundingClientRect();\n\n const width = field.width || defaultWidth(field.type);\n const height = field.height || defaultHeight(field.type);\n\n // These two being backwards is not a mistake. Left measures \"over\" from the left\n // (positive displacement) while bottom measures \"up\" from the bottom (negative displacement).\n const newX = Math.max(clientRect.left - parentRect.left, 0);\n let newY = Math.max(renderedHeight - (parentRect.bottom - clientRect.bottom), 0);\n\n let newPageNumber = parseInt(pageNumber);\n if (newY > renderedHeight) {\n newPageNumber = Math.min(newPageNumber + 1, (this.template?.documents || [])?.[0]?.pages || 1);\n newY -= renderedHeight;\n renderedHeight = this.cachedPageInfo[documentId][newPageNumber].renderedHeight;\n\n console.log('Next page', {newPageNumber, newY, renderedHeight});\n } else if (newY < 0) {\n newPageNumber = Math.max(newPageNumber - 1, 1);\n renderedHeight = this.cachedPageInfo[documentId][newPageNumber].renderedHeight;\n newY += renderedHeight;\n console.log('[FIELDS] Next page', {newPageNumber, newY, renderedHeight});\n }\n\n const {x, y} = this.viewCoordinatesToPageCoordinates(newX, newY, documentId, pageNumber, naturalWidth - width, naturalHeight - height);\n try {\n const params = {x, y, page: newPageNumber};\n const updatedField = await updateField(this.endpoint, this.templateId, name, params);\n console.log('[FIELDS] Updated', updatedField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n const fieldIndex = newTemplate.fields.findIndex(field => field.name === name);\n if (fieldIndex > -1) {\n newTemplate.fields[fieldIndex] = updatedField;\n }\n\n Store.updateTemplate(this.templateId, newTemplate);\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n const {xScale = 1, yScale = 1} = this.cachedPageInfo[documentId][pageNumber];\n setControlStyles(event.target, updatedField, xScale, yScale);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'updated-field'});\n } catch (e) {\n VerdocsToast('Error updating field, please try again later', {style: 'error'});\n console.log('[FIELDS] Error updating field', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n }\n }\n\n generateFieldName(type: string, pageNumber: number) {\n let i = 1;\n let fieldName: string;\n do {\n fieldName = `${type}P${pageNumber}-${i}`;\n i++;\n } while ((this.template?.fields || []).some(field => field && field.name === fieldName));\n\n return fieldName;\n }\n\n // Scale the X,Y clicks to the virtual page dimensions. Also ensure the field doesn't go off the page.\n viewCoordinatesToPageCoordinates(viewX: number, viewY: number, documentId: string, pageNumber: number, xMax: number, yMax: number) {\n const {xScale = 1, yScale = 1, renderedHeight = 792} = this.cachedPageInfo[documentId][pageNumber];\n const x = Math.floor(Math.min(viewX / xScale, xMax));\n const y = Math.floor(Math.min(Math.max(renderedHeight - viewY, 0) / yScale, yMax));\n return {x, y};\n }\n\n async handleClickPage(e: any, documentId: string, pageNumber: number) {\n if (this.placing) {\n // console.log('Placing field', {documentId, pageNumber});\n const clickedX = e.offsetX;\n const clickedY = e.offsetY;\n\n const width = defaultWidth(this.placing);\n const height = defaultHeight(this.placing);\n\n const cachedPage = this.cachedPageInfo[documentId][pageNumber];\n const {naturalWidth = 612, naturalHeight = 792} = cachedPage;\n\n const coords = this.viewCoordinatesToPageCoordinates(clickedX, clickedY, documentId, pageNumber, naturalWidth - width, naturalHeight - height);\n const x = Math.floor(coords.x);\n const y = Math.floor(coords.y);\n\n const field: ITemplateField = {\n name: this.generateFieldName(this.placing, pageNumber), // 'textboxP1-22',\n role_name: this.selectedRoleName,\n template_id: this.templateId,\n document_id: cachedPage.documentId,\n type: this.placing,\n required: this.placing !== 'radio' && this.placing !== 'attachment' && this.placing !== 'checkbox',\n page: pageNumber,\n validator: null,\n label: null,\n default: null,\n placeholder: null,\n group: null,\n settings: {},\n x,\n y,\n width,\n height,\n multiline: false,\n readonly: false,\n options: this.placing === 'radio' ? [{id: 'option-1', label: 'Option 1'}] : [],\n };\n\n const newField = await createField(this.endpoint, this.templateId, field);\n console.log('[FIELDS] Created field', newField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n newTemplate.fields.push(newField);\n\n Store.updateTemplate(this.templateId, newTemplate);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'added-field'});\n\n this.placing = null;\n }\n }\n\n render() {\n console.log('Rendering');\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (!this.endpoint.session) {\n return (\n <Host>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n const sortedRoles = [...(this.template?.roles || [])].sort((a, b) => (a.sequence ?? 0) - (b.sequence ?? 0));\n const selectableRoles = sortedRoles.map(role => ({value: role.name, label: role.full_name ? `${role.name}: ${role.full_name}` : role.name}));\n\n return (\n <Host class={this.placing ? {[`placing-${this.placing}`]: true} : {}} onSubmit={() => {}}>\n <div id=\"verdocs-template-fields-toolbar\">\n <div class=\"add-for\">Add field:</div>\n <verdocs-select-input value={this.selectedRoleName} options={selectableRoles} onInput={(e: any) => (this.selectedRoleName = e.target.value)} />\n\n {menuOptions.map(option => (\n <verdocs-toolbar-icon\n text={option.tooltip}\n icon={option.icon}\n class={option.class}\n onClick={() => {\n // We ignore empty-tooltip entries because they're separators\n if (option.tooltip) {\n // We require a role to be selected first\n if (this.selectedRoleName) {\n this.placing = option.id as TFieldType;\n } else {\n this.showMustSelectRole = true;\n }\n }\n }}\n />\n ))}\n </div>\n\n {/* <div class=\"page-0\" ref={el => (this.page0El = el as HTMLDivElement)}>*/}\n {/* <div class=\"user-placed-fields\">*/}\n {/* <div class=\"title\">User-Placed Fields</div>*/}\n {/* <verdocs-field-signature*/}\n {/* field={testField}*/}\n {/* style={{width: '82px', height: '41px', left: '20px', top: '40px', transform: 'scale(1,1)', backgroundColor: getRGBA(0)}}*/}\n {/* moveable={true}*/}\n {/* editable={true}*/}\n {/* />*/}\n {/* </div>*/}\n {/*</div>*/}\n\n <div class=\"pages\">\n {(this.template?.documents || []).map(document => {\n const pageNumbers = integerSequence(1, document.pages);\n\n return pageNumbers.map(page => {\n const pageSize = document.page_sizes[page];\n\n return (\n <Fragment>\n {this.template?.documents.length > 1 && (\n <div class=\"document-separator\">\n <div innerHTML={DocumentPageIcon} />\n <span>{document.name}</span>\n </div>\n )}\n\n <verdocs-template-document-page\n templateId={this.templateId}\n documentId={document.id}\n pageNumber={page}\n virtualWidth={pageSize?.width || 612}\n virtualHeight={pageSize?.height || 792}\n disabled={true}\n editable={true}\n done={false}\n onClick={(e: PointerEvent) => this.handleClickPage(e, document.id, page)}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n </Fragment>\n );\n });\n })}\n </div>\n {this.showMustSelectRole && (\n <verdocs-ok-dialog\n heading=\"Unable to add field\"\n message={(this.template?.roles || []).length > 0 ? 'Please select a role before adding fields.' : 'Please add at least one role before adding fields.'}\n onNext={() => (this.showMustSelectRole = false)}\n />\n )}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -91,11 +91,13 @@ const VerdocsPreview = /*@__PURE__*/ proxyCustomElement(class VerdocsPreview ext
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
componentDidRender() {
|
|
94
|
+
var _a;
|
|
94
95
|
// Defensive hack: fields rendered in other tabs (e.g. the builder's Fields tab) may share DOM
|
|
95
96
|
// IDs with fields shown here, and interact.js — being vanilla JS — is unaware of Stencil's
|
|
96
|
-
// re-renders. Unbind any drag/resize handlers on
|
|
97
|
-
//
|
|
98
|
-
|
|
97
|
+
// re-renders. Unbind any drag/resize handlers on fields inside our own subtree after each
|
|
98
|
+
// render so they stay non-interactive in preview mode. Scope to hostEl so we don't clobber
|
|
99
|
+
// handlers on fields belonging to a sibling component during brief tab-switch overlaps.
|
|
100
|
+
(_a = this.hostEl) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.verdocs-field').forEach(el => {
|
|
99
101
|
interact(el).unset();
|
|
100
102
|
});
|
|
101
103
|
}
|
|
@@ -132,6 +134,7 @@ const VerdocsPreview = /*@__PURE__*/ proxyCustomElement(class VerdocsPreview ext
|
|
|
132
134
|
})));
|
|
133
135
|
})));
|
|
134
136
|
}
|
|
137
|
+
get hostEl() { return this; }
|
|
135
138
|
static get watchers() { return {
|
|
136
139
|
"templateId": ["onTemplateIdChanged"]
|
|
137
140
|
}; }
|
|
@@ -279,6 +282,6 @@ function defineCustomElement() {
|
|
|
279
282
|
}
|
|
280
283
|
|
|
281
284
|
export { VerdocsPreview as V, defineCustomElement as d };
|
|
282
|
-
//# sourceMappingURL=p-
|
|
285
|
+
//# sourceMappingURL=p-Cj8PYi4t.js.map
|
|
283
286
|
|
|
284
|
-
//# sourceM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C,MAAM,WAAW,GAAG,eAAe,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC;AACtD,YAAA,QACE,CAAC,CAAA,QAAQ,EACN,IAAA,EAAA,WAAW,CAAC,GAAG,CAAC,UAAU,IAAG;;AAC5B,gBAAA,MAAM,QAAQ,GAAG,CAAA,CAAA,EAAA,GAAA,QAAQ,CAAC,UAAU,0CAAG,UAAU,CAAC,KAAI,EAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAC;AAE/E,gBAAA,QACE,CACE,CAAA,gCAAA,EAAA,EAAA,UAAU,EAAE,QAAQ,CAAC,WAAW,EAChC,UAAU,EAAE,QAAQ,CAAC,EAAE,EACvB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,KAAK,EACf,IAAI,EAAE,KAAK,EACX,YAAY,EAAE,QAAQ,CAAC,KAAK,EAC5B,aAAa,EAAE,QAAQ,CAAC,MAAM,EAC9B,cAAc,EAAE,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAC/C,MAAM,EAAE;AACN,wBAAA,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAC;AAC9B,wBAAA,EAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAC;qBAChC,EAAA,CACD;aAEL,CAAC,CACO;SAEd,CAAC,CACG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/embeds/verdocs-preview/verdocs-preview.scss?tag=verdocs-preview","src/components/embeds/verdocs-preview/verdocs-preview.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-preview {\n font-family: $verdocs-primary-font;\n display: flex;\n padding: 15px;\n row-gap: 15px;\n min-height: 200px;\n position: relative;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n\n div,\n canvas {\n box-sizing: border-box;\n }\n}\n","import interact from 'interactjs';\nimport {getTemplate, integerSequence, ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Element, Event, EventEmitter, Host, Component, Prop, h, State, Fragment, Watch} from '@stencil/core';\nimport {renderDocumentField} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Display a template preview experience. This will display the template's attached\n * documents with signing fields overlaid on each page. Fields will be color-coded\n * by recipient, and will be read-only (cannot be filled, moved, or altered).\n *\n * ```ts\n * <verdocs-preview\n * templateId={TEMPLATE_ID}\n * onSdkError={({ detail }) => { console.log('SDK error', detail) }\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-preview',\n styleUrl: 'verdocs-preview.scss',\n shadow: false,\n})\nexport class VerdocsPreview {\n private templateListenerId = null;\n private renderedPages: Record<string, IDocumentPageInfo> = {};\n\n @Element() hostEl: HTMLElement;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop() templateId: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n @Watch('templateId')\n onTemplateIdChanged(newTemplateId: string) {\n console.log('[PREVIEW] Template ID changed', newTemplateId);\n this.listenToTemplate();\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n if (!this.endpoint.session) {\n console.log('[PREVIEW] Unable to start builder session, must be authenticated');\n return;\n }\n\n if (!this.templateId) {\n console.log(`[PREVIEW] Missing required template ID ${this.templateId}`);\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[PREVIEW] Error with preview session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n componentDidRender() {\n // Defensive hack: fields rendered in other tabs (e.g. the builder's Fields tab) may share DOM\n // IDs with fields shown here, and interact.js — being vanilla JS — is unaware of Stencil's\n // re-renders. Unbind any drag/resize handlers on fields inside our own subtree after each\n // render so they stay non-interactive in preview mode. Scope to hostEl so we don't clobber\n // handlers on fields belonging to a sibling component during brief tab-switch overlaps.\n this.hostEl?.querySelectorAll('.verdocs-field').forEach(el => {\n interact(el as HTMLElement).unset();\n });\n }\n\n handlePageRendered(e: any) {\n const pageInfo = e.detail as IDocumentPageInfo;\n this.renderedPages[`${pageInfo.documentId}:${pageInfo.pageNumber}`] = pageInfo;\n\n const fields = (this.template?.fields || []).filter(field => {\n // Templates created on the new builder have document_id set, but old ones may not.\n // If document_id is missing, we assume it's for the first document or use legacy logic.\n // However, for this fix, we primarily care about multi-doc templates which should have IDs.\n if (field['document_id']) {\n return field['document_id'] === pageInfo.documentId && field.page === pageInfo.pageNumber;\n }\n return field.page === pageInfo.pageNumber;\n });\n\n // console.log('[PREVIEW] Page rendered', pageInfo, fields);\n fields.forEach(field => renderDocumentField('template', field, pageInfo, {disabled: true, editable: false, draggable: false}));\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n return (\n <Host>\n {(this.template?.documents || []).map(document => {\n const pageNumbers = integerSequence(1, document.pages);\n return (\n <Fragment>\n {pageNumbers.map(pageNumber => {\n const pageSize = document.page_sizes?.[pageNumber] || {width: 612, height: 792};\n\n return (\n <verdocs-template-document-page\n templateId={document.template_id}\n documentId={document.id}\n pageNumber={pageNumber}\n disabled={true}\n editable={false}\n done={false}\n virtualWidth={pageSize.width}\n virtualHeight={pageSize.height}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n );\n })}\n </Fragment>\n );\n })}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -133,6 +133,13 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class VerdocsTemp
|
|
|
133
133
|
}
|
|
134
134
|
componentDidRender() {
|
|
135
135
|
interact.dynamicDrop(true);
|
|
136
|
+
// Defensive re-attach: when returning to the Fields tab from Preview, the preview component
|
|
137
|
+
// may have unset interact bindings on shared field DOM elements. pageRendered doesn't always
|
|
138
|
+
// refire in that case, so ensure every .verdocs-field in the document has a drag handler.
|
|
139
|
+
// makeDraggable is idempotent (interact re-configures the same Interactable).
|
|
140
|
+
document.querySelectorAll('.verdocs-field').forEach(el => {
|
|
141
|
+
this.makeDraggable(el);
|
|
142
|
+
});
|
|
136
143
|
const toolbarTarget = this.toolbarTargetId ? document.getElementById(this.toolbarTargetId) : null;
|
|
137
144
|
const toolbarEl = document.getElementById('verdocs-template-fields-toolbar');
|
|
138
145
|
if (toolbarTarget && toolbarEl) {
|
|
@@ -525,6 +532,6 @@ function defineCustomElement() {
|
|
|
525
532
|
}
|
|
526
533
|
|
|
527
534
|
export { VerdocsTemplateFields as V, defineCustomElement as d };
|
|
528
|
-
//# sourceMappingURL=p-
|
|
535
|
+
//# sourceMappingURL=p-DNYvorxL.js.map
|
|
529
536
|
|
|
530
|
-
//# sourceMappingURL=p-
|
|
537
|
+
//# sourceMappingURL=p-DNYvorxL.js.map
|
|
@@ -0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AqB,EAC7B,OAAO,EAAE,CAAC,CAAA,CAAA,EAAA,GAAA,IAAI,CAAC,QAAQ,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,KAAK,KAAI,EAAE,EAAE,MAAM,GAAG,CAAC,GAAG,4CAA4C,GAAG,oDAAoD,EACtJ,MAAM,EAAE,OAAO,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,EAC/C,CAAA,CACH,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/templates/verdocs-template-fields/verdocs-template-fields.scss?tag=verdocs-template-fields","src/components/templates/verdocs-template-fields/verdocs-template-fields.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-fields {\n font-family: $verdocs-primary-font;\n position: relative;\n display: block;\n min-height: 600px;\n\n .page-0 {\n padding: 65px 15px 0 15px;\n box-sizing: border-box;\n\n .user-placed-fields {\n height: 100px;\n position: relative;\n background: #ffffff;\n box-shadow: 0 0 10px 5px #0000000f;\n\n .title {\n top: 0;\n left: 0;\n color: #ffffff;\n font-size: 12px;\n padding: 3px 6px;\n font-weight: bold;\n position: absolute;\n background: $verdocs-grey-blue;\n }\n }\n }\n\n .pages {\n display: flex;\n padding: 15px;\n row-gap: 15px;\n min-height: 200px;\n position: relative;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n\n div,\n canvas {\n box-sizing: border-box;\n }\n\n .document-separator {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 12px 20px;\n width: 100%;\n box-sizing: border-box;\n background-color: $verdocs-grey-1;\n color: white;\n border-radius: 6px;\n font-size: 16px;\n font-weight: 500;\n margin-top: 20px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n\n svg {\n flex-shrink: 0;\n }\n\n // Remove margin for the very first one if desired, but 20px spacing is probably good even for the first one\n &:first-child {\n margin-top: 0;\n }\n }\n }\n\n #verdocs-template-fields-toolbar {\n width: 100%;\n height: 50px;\n display: flex;\n column-gap: 15px;\n font-weight: 700;\n padding: 0 20px 0 0; // Right-only to better balance the visual\n align-items: center;\n flex-direction: row;\n color: $verdocs-grey-3;\n justify-content: center;\n background: $verdocs-grey-blue;\n\n > verdocs-select-input {\n margin: 0;\n }\n\n svg {\n width: 24px;\n height: 24px;\n }\n\n .add-for {\n margin: 0;\n font-weight: 500;\n color: $verdocs-grey-3;\n }\n\n verdocs-select-input {\n margin: 0 20px 0 0;\n }\n\n @media all and (max-width: 1000px) {\n column-gap: 8px;\n padding: 0 10px 0 0; // Right-only to better balance the visual\n\n svg {\n transform: scale(0.8);\n }\n\n .add-for,\n verdocs-select-input {\n display: none;\n }\n }\n\n @media all and (max-width: 600px) {\n column-gap: 6px;\n\n svg {\n transform: scale(0.6);\n }\n\n .separator,\n .add-for,\n verdocs-select-input {\n display: none;\n }\n }\n }\n\n &.placing-attachment {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-checkbox {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-date {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-dropdown {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-initial {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-payment {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-radio {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-signature {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-textarea {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-textbox {\n cursor:\n url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\")\n 0 14,\n pointer;\n }\n\n &.placing-timestamp {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n}\n","import interact from 'interactjs';\nimport {Component, h, Event, EventEmitter, Fragment, Prop, Host, State, Listen, Watch} from '@stencil/core';\nimport {createField, getTemplate, integerSequence, ITemplate, ITemplateField, TFieldType, updateField, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {defaultHeight, defaultWidth, getFieldId, removeCssTransform, setControlStyles, updateCssTransform} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {DocumentPageIcon} from '../../../utils/Icons';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst iconTextbox = '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z\"/></svg>';\n\nconst iconCheck =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z\"/></svg>';\n\nconst iconRadio =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z\"/></svg>';\n\nconst iconDatepicker =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z\"/></svg>';\n\nconst iconSignature =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z\"/></svg>';\n\nconst iconInitial =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z\"/></svg>';\n\n// const iconTimestamp =\n// '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z\"></path></svg>';\n\nconst iconDropdown =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\" stroke-width=\"1.5\" stroke=\"currentColor\"><path stroke=\"#ffffff\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25\" /></svg>';\n\nconst iconAttachment =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13\" /></svg>';\n\nconst separator = '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 14.707 14.707\"><g><rect x=\"6.275\" y=\"0\" fill=\"#ffffff7f\" width=\"1\" height=\"15\"/></g></svg>';\n\nconst menuOptions = [\n {id: 'signature', tooltip: 'Signature', icon: iconSignature, class: 'signature'},\n {id: 'initial', tooltip: 'Initials', icon: iconInitial, class: 'initial'},\n {id: 'sep1', tooltip: '', icon: separator, class: 'separator'},\n {id: 'textbox', tooltip: 'Text Box', icon: iconTextbox, class: 'textbox'},\n {id: 'checkbox', tooltip: 'Check Box', icon: iconCheck, class: 'checkbox'},\n {id: 'radio', tooltip: 'Radio Button', icon: iconRadio, class: 'radio'},\n {id: 'dropdown', tooltip: 'Dropdown', icon: iconDropdown, class: 'dropdown'},\n {id: 'sep2', tooltip: '', icon: separator, class: 'separator'},\n {id: 'date', tooltip: 'Date', icon: iconDatepicker, class: 'date'},\n // {id: 'timestamp', tooltip: 'Timestamp', icon: iconTimestamp, class: 'timestamp'},\n // {id: 'sep3', tooltip: '', icon: separator},\n {id: 'attachment', tooltip: 'Attachment', icon: iconAttachment, class: 'attachment'},\n // {id: 'payment', tooltip: 'Payment', icon: 'P'},\n];\n\n/**\n * Displays a builder experience for laying out fields in a template. Note that this experience requires a large display area to\n * present all of the required controls, so it is primarily intended to be used in desktop environments.\n */\n@Component({\n tag: 'verdocs-template-fields',\n styleUrl: 'verdocs-template-fields.scss',\n shadow: false,\n})\nexport class VerdocsTemplateFields {\n private templateListenerId = null;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop({reflect: true, mutable: true}) templateId: string | null = null;\n\n /**\n * If set, (recommended), the host application should create a <DIV> element with a unique ID. When this\n * component renders, the toolbar will be removed from its default location and placed in the target element.\n * This allows the parent application to more easily control its placement and scroll effects.\n *\n * The movement of the toolbar to the target container is not dynamic - it is performed only on the initial\n * render. Host applications should not conditionally render this container. If the toolbar's visibility must\n * be externally controlled, use CSS display options to hide/show it instead.\n */\n @Prop() toolbarTargetId: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the template is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.\n */\n @Event({composed: true}) templateUpdated: EventEmitter<{endpoint: VerdocsEndpoint; template: ITemplate; event: 'added-field' | 'updated-field' | 'deleted-field'}>;\n\n @State() placing: TFieldType | null = null;\n @State() showMustSelectRole = false;\n @State() selectedRoleName = '';\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n pageHeights: Record<number, number> = {};\n\n @Watch('templateId')\n onTemplateIdChanged() {\n this.listenToTemplate();\n }\n\n // Stop field-placement mode if ESC is pressed\n @Listen('keydown', {target: 'document'})\n handleKeyDown(ev: KeyboardEvent) {\n if (ev.key === 'Escape') {\n this.placing = null;\n }\n }\n\n @Listen('settingsChanged')\n handleFieldSettingsChanged() {\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'updated-field'});\n }\n\n @Listen('deleted')\n handleFieldDeleted() {\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'deleted-field'});\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[FIELDS] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[FIELDS] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[FIELDS] Error with fields session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n componentDidRender() {\n interact.dynamicDrop(true);\n\n // Defensive re-attach: when returning to the Fields tab from Preview, the preview component\n // may have unset interact bindings on shared field DOM elements. pageRendered doesn't always\n // refire in that case, so ensure every .verdocs-field in the document has a drag handler.\n // makeDraggable is idempotent (interact re-configures the same Interactable).\n document.querySelectorAll('.verdocs-field').forEach(el => {\n this.makeDraggable(el as HTMLElement);\n });\n\n const toolbarTarget = this.toolbarTargetId ? document.getElementById(this.toolbarTargetId) : null;\n const toolbarEl = document.getElementById('verdocs-template-fields-toolbar');\n if (toolbarTarget && toolbarEl) {\n toolbarEl.remove();\n toolbarTarget.append(toolbarEl);\n }\n }\n\n componentWillUpdate() {\n // If a new role was added and there were none yet so far, or the \"selected\" role was deleted, reset our selection\n const roles = [...(this.template?.roles || [])].sort((a, b) => (a.sequence ?? 0) - (b.sequence ?? 0));\n if (!this.selectedRoleName || !roles.find(role => role && role.name === this.selectedRoleName)) {\n this.selectedRoleName = roles[0]?.name || '';\n console.log('[FIELDS] Selected new role', this.selectedRoleName);\n }\n }\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n console.log('Template updated');\n this.template = template;\n this.loading = false;\n\n if (!this.selectedRoleName) {\n const sorted = [...(template.roles || [])].sort((a, b) => (a.sequence ?? 0) - (b.sequence ?? 0));\n this.selectedRoleName = sorted[0]?.name || '';\n }\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n cachedPageInfo: Record<string, Record<number, IDocumentPageInfo>> = {};\n handlePageRendered(e: any) {\n const pageInfo = e.detail as IDocumentPageInfo;\n console.log('[FIELDS] Page rendered', pageInfo.documentId, pageInfo.pageNumber, pageInfo.xScale, pageInfo.yScale);\n this.cachedPageInfo[pageInfo.documentId] ??= {};\n this.cachedPageInfo[pageInfo.documentId][pageInfo.pageNumber] = pageInfo;\n\n this.pageHeights[pageInfo.pageNumber] = pageInfo.naturalHeight;\n\n (this.template?.fields || [])\n .filter(field => field && field.page === pageInfo.pageNumber)\n .forEach(field => {\n const id = getFieldId(field);\n const el = document.getElementById(id);\n if (el) {\n el.setAttribute('templateid', this.templateId);\n el.setAttribute('fieldname', field.name);\n el.setAttribute('documentid', String(field.document_id));\n el.setAttribute('pagenumber', String(field.page));\n el.setAttribute('xScale', String(pageInfo.xScale));\n el.setAttribute('yScale', String(pageInfo.yScale));\n this.makeDraggable(el);\n }\n });\n }\n\n makeDraggable(el: HTMLElement) {\n interact(el).draggable({\n listeners: {\n move: this.handleMoveField.bind(this),\n end: this.handleMoveEnd.bind(this),\n },\n });\n }\n\n async handleMoveField(event: any) {\n const oldX = +(event.target.getAttribute('posX') || 0);\n const oldY = +(event.target.getAttribute('posY') || 0);\n const xScale = +(event.target.getAttribute('xScale') || 1);\n const yScale = +(event.target.getAttribute('yScale') || 1);\n const newX = event.dx / xScale + oldX;\n const newY = event.dy / yScale + oldY;\n event.target.setAttribute('posX', newX);\n event.target.setAttribute('posy', newY);\n updateCssTransform(event.target, 'translate', `${newX}px, ${newY}px`);\n }\n\n async handleMoveEnd(event: any) {\n const name = event.target.getAttribute('fieldname');\n const field = (this.template?.fields || []).find(field => field.name === name);\n if (!field) {\n console.log('[FIELDS] Unable to find field', name, event.target);\n return;\n }\n\n const pageNumber = event.target.getAttribute('pagenumber');\n const documentId = event.target.getAttribute('documentid');\n let {naturalWidth = 612, naturalHeight = 792, renderedHeight = 792} = this.cachedPageInfo[documentId][pageNumber];\n const clientRect = event.target.getBoundingClientRect();\n const parent = event.target.parentElement;\n const parentRect = parent.getBoundingClientRect();\n\n const width = field.width || defaultWidth(field.type);\n const height = field.height || defaultHeight(field.type);\n\n // These two being backwards is not a mistake. Left measures \"over\" from the left\n // (positive displacement) while bottom measures \"up\" from the bottom (negative displacement).\n const newX = Math.max(clientRect.left - parentRect.left, 0);\n let newY = Math.max(renderedHeight - (parentRect.bottom - clientRect.bottom), 0);\n\n let newPageNumber = parseInt(pageNumber);\n if (newY > renderedHeight) {\n newPageNumber = Math.min(newPageNumber + 1, (this.template?.documents || [])?.[0]?.pages || 1);\n newY -= renderedHeight;\n renderedHeight = this.cachedPageInfo[documentId][newPageNumber].renderedHeight;\n\n console.log('Next page', {newPageNumber, newY, renderedHeight});\n } else if (newY < 0) {\n newPageNumber = Math.max(newPageNumber - 1, 1);\n renderedHeight = this.cachedPageInfo[documentId][newPageNumber].renderedHeight;\n newY += renderedHeight;\n console.log('[FIELDS] Next page', {newPageNumber, newY, renderedHeight});\n }\n\n const {x, y} = this.viewCoordinatesToPageCoordinates(newX, newY, documentId, pageNumber, naturalWidth - width, naturalHeight - height);\n try {\n const params = {x, y, page: newPageNumber};\n const updatedField = await updateField(this.endpoint, this.templateId, name, params);\n console.log('[FIELDS] Updated', updatedField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n const fieldIndex = newTemplate.fields.findIndex(field => field.name === name);\n if (fieldIndex > -1) {\n newTemplate.fields[fieldIndex] = updatedField;\n }\n\n Store.updateTemplate(this.templateId, newTemplate);\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n const {xScale = 1, yScale = 1} = this.cachedPageInfo[documentId][pageNumber];\n setControlStyles(event.target, updatedField, xScale, yScale);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'updated-field'});\n } catch (e) {\n VerdocsToast('Error updating field, please try again later', {style: 'error'});\n console.log('[FIELDS] Error updating field', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n }\n }\n\n generateFieldName(type: string, pageNumber: number) {\n let i = 1;\n let fieldName: string;\n do {\n fieldName = `${type}P${pageNumber}-${i}`;\n i++;\n } while ((this.template?.fields || []).some(field => field && field.name === fieldName));\n\n return fieldName;\n }\n\n // Scale the X,Y clicks to the virtual page dimensions. Also ensure the field doesn't go off the page.\n viewCoordinatesToPageCoordinates(viewX: number, viewY: number, documentId: string, pageNumber: number, xMax: number, yMax: number) {\n const {xScale = 1, yScale = 1, renderedHeight = 792} = this.cachedPageInfo[documentId][pageNumber];\n const x = Math.floor(Math.min(viewX / xScale, xMax));\n const y = Math.floor(Math.min(Math.max(renderedHeight - viewY, 0) / yScale, yMax));\n return {x, y};\n }\n\n async handleClickPage(e: any, documentId: string, pageNumber: number) {\n if (this.placing) {\n // console.log('Placing field', {documentId, pageNumber});\n const clickedX = e.offsetX;\n const clickedY = e.offsetY;\n\n const width = defaultWidth(this.placing);\n const height = defaultHeight(this.placing);\n\n const cachedPage = this.cachedPageInfo[documentId][pageNumber];\n const {naturalWidth = 612, naturalHeight = 792} = cachedPage;\n\n const coords = this.viewCoordinatesToPageCoordinates(clickedX, clickedY, documentId, pageNumber, naturalWidth - width, naturalHeight - height);\n const x = Math.floor(coords.x);\n const y = Math.floor(coords.y);\n\n const field: ITemplateField = {\n name: this.generateFieldName(this.placing, pageNumber), // 'textboxP1-22',\n role_name: this.selectedRoleName,\n template_id: this.templateId,\n document_id: cachedPage.documentId,\n type: this.placing,\n required: this.placing !== 'radio' && this.placing !== 'attachment' && this.placing !== 'checkbox',\n page: pageNumber,\n validator: null,\n label: null,\n default: null,\n placeholder: null,\n group: null,\n settings: {},\n x,\n y,\n width,\n height,\n multiline: false,\n readonly: false,\n options: this.placing === 'radio' ? [{id: 'option-1', label: 'Option 1'}] : [],\n };\n\n const newField = await createField(this.endpoint, this.templateId, field);\n console.log('[FIELDS] Created field', newField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n newTemplate.fields.push(newField);\n\n Store.updateTemplate(this.templateId, newTemplate);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'added-field'});\n\n this.placing = null;\n }\n }\n\n render() {\n console.log('Rendering');\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (!this.endpoint.session) {\n return (\n <Host>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n const sortedRoles = [...(this.template?.roles || [])].sort((a, b) => (a.sequence ?? 0) - (b.sequence ?? 0));\n const selectableRoles = sortedRoles.map(role => ({value: role.name, label: role.full_name ? `${role.name}: ${role.full_name}` : role.name}));\n\n return (\n <Host class={this.placing ? {[`placing-${this.placing}`]: true} : {}} onSubmit={() => {}}>\n <div id=\"verdocs-template-fields-toolbar\">\n <div class=\"add-for\">Add field:</div>\n <verdocs-select-input value={this.selectedRoleName} options={selectableRoles} onInput={(e: any) => (this.selectedRoleName = e.target.value)} />\n\n {menuOptions.map(option => (\n <verdocs-toolbar-icon\n text={option.tooltip}\n icon={option.icon}\n class={option.class}\n onClick={() => {\n // We ignore empty-tooltip entries because they're separators\n if (option.tooltip) {\n // We require a role to be selected first\n if (this.selectedRoleName) {\n this.placing = option.id as TFieldType;\n } else {\n this.showMustSelectRole = true;\n }\n }\n }}\n />\n ))}\n </div>\n\n {/* <div class=\"page-0\" ref={el => (this.page0El = el as HTMLDivElement)}>*/}\n {/* <div class=\"user-placed-fields\">*/}\n {/* <div class=\"title\">User-Placed Fields</div>*/}\n {/* <verdocs-field-signature*/}\n {/* field={testField}*/}\n {/* style={{width: '82px', height: '41px', left: '20px', top: '40px', transform: 'scale(1,1)', backgroundColor: getRGBA(0)}}*/}\n {/* moveable={true}*/}\n {/* editable={true}*/}\n {/* />*/}\n {/* </div>*/}\n {/*</div>*/}\n\n <div class=\"pages\">\n {(this.template?.documents || []).map(document => {\n const pageNumbers = integerSequence(1, document.pages);\n\n return pageNumbers.map(page => {\n const pageSize = document.page_sizes[page];\n\n return (\n <Fragment>\n {this.template?.documents.length > 1 && (\n <div class=\"document-separator\">\n <div innerHTML={DocumentPageIcon} />\n <span>{document.name}</span>\n </div>\n )}\n\n <verdocs-template-document-page\n templateId={this.templateId}\n documentId={document.id}\n pageNumber={page}\n virtualWidth={pageSize?.width || 612}\n virtualHeight={pageSize?.height || 792}\n disabled={true}\n editable={true}\n done={false}\n onClick={(e: PointerEvent) => this.handleClickPage(e, document.id, page)}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n </Fragment>\n );\n });\n })}\n </div>\n {this.showMustSelectRole && (\n <verdocs-ok-dialog\n heading=\"Unable to add field\"\n message={(this.template?.roles || []).length > 0 ? 'Please select a role before adding fields.' : 'Please add at least one role before adding fields.'}\n onNext={() => (this.showMustSelectRole = false)}\n />\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -24,7 +24,7 @@ import { d as defineCustomElement$k } from './p-CNKACBaL.js';
|
|
|
24
24
|
import { d as defineCustomElement$j } from './p-C4BOQLSR.js';
|
|
25
25
|
import { d as defineCustomElement$i } from './p-o9BQIoXw.js';
|
|
26
26
|
import { d as defineCustomElement$h } from './p-DUYRis3A.js';
|
|
27
|
-
import { d as defineCustomElement$g } from './p-
|
|
27
|
+
import { d as defineCustomElement$g } from './p-Cj8PYi4t.js';
|
|
28
28
|
import { d as defineCustomElement$f } from './p-DzEqts-G.js';
|
|
29
29
|
import { d as defineCustomElement$e } from './p-C1AtapGD.js';
|
|
30
30
|
import { d as defineCustomElement$d } from './p-BrtyCjOf.js';
|
|
@@ -33,7 +33,7 @@ import { d as defineCustomElement$b } from './p-Dz6Xrh7z.js';
|
|
|
33
33
|
import { d as defineCustomElement$a } from './p-BqoZV7Do.js';
|
|
34
34
|
import { d as defineCustomElement$9 } from './p-aH_YLUuP.js';
|
|
35
35
|
import { d as defineCustomElement$8 } from './p-DmEzMnt3.js';
|
|
36
|
-
import { d as defineCustomElement$7 } from './p-
|
|
36
|
+
import { d as defineCustomElement$7 } from './p-DNYvorxL.js';
|
|
37
37
|
import { d as defineCustomElement$6 } from './p-BCiVZnf0.js';
|
|
38
38
|
import { d as defineCustomElement$5 } from './p-IJa78J36.js';
|
|
39
39
|
import { d as defineCustomElement$4 } from './p--qy4LrSt.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as VerdocsTemplateFields$1, d as defineCustomElement$1 } from './p-
|
|
1
|
+
import { V as VerdocsTemplateFields$1, d as defineCustomElement$1 } from './p-DNYvorxL.js';
|
|
2
2
|
|
|
3
3
|
const VerdocsTemplateFields = VerdocsTemplateFields$1;
|
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|