@pixelated-tech/components 3.14.5 → 3.15.1
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/components/admin/site-health/site-health-core-web-vitals.integration.js +21 -8
- package/dist/components/admin/site-health/site-health-github.integration.js +6 -6
- package/dist/components/admin/site-health/site-health-on-site-seo.integration.js +36 -16
- package/dist/components/admin/site-health/site-health-template.js +10 -6
- package/dist/components/config/config.types.js +12 -0
- package/dist/components/general/markdown.js +35 -0
- package/dist/components/general/nerdjoke.js +2 -4
- package/dist/components/general/proxy-handler.js +2 -2
- package/dist/components/general/sitemap.js +2 -4
- package/dist/components/general/smartfetch.js +211 -0
- package/dist/components/general/tiles.js +1 -1
- package/dist/components/general/urlbuilder.js +74 -0
- package/dist/components/integrations/contentful.delivery.js +24 -20
- package/dist/components/integrations/contentful.items.components.js +6 -2
- package/dist/components/integrations/contentful.management.js +188 -151
- package/dist/components/integrations/flickr.js +15 -22
- package/dist/components/integrations/gemini-api.client.js +22 -21
- package/dist/components/integrations/gemini-api.server.js +50 -46
- package/dist/components/integrations/google.reviews.functions.js +19 -5
- package/dist/components/integrations/googleplaces.js +33 -9
- package/dist/components/integrations/gravatar.functions.js +15 -7
- package/dist/components/integrations/hubspot.components.js +8 -10
- package/dist/components/integrations/instagram.functions.js +9 -4
- package/dist/components/integrations/lipsum.js +6 -10
- package/dist/components/integrations/loremipsum.js +21 -21
- package/dist/components/integrations/socialcard.js +14 -8
- package/dist/components/integrations/spotify.functions.js +7 -4
- package/dist/components/integrations/wordpress.functions.js +17 -19
- package/dist/components/integrations/yelp.js +6 -7
- package/dist/components/shoppingcart/ebay.functions.js +69 -53
- package/dist/components/shoppingcart/shoppingcart.components.js +1 -1
- package/dist/components/sitebuilder/config/google-fonts.js +13 -6
- package/dist/components/sitebuilder/form/formbuilder.js +1 -1
- package/dist/components/sitebuilder/form/formengine.js +37 -10
- package/dist/components/sitebuilder/form/formsubmit.js +205 -0
- package/dist/components/sitebuilder/page/components/SaveLoadSection.js +24 -12
- package/dist/config/pixelated.config.json.enc +1 -1
- package/dist/data/form.json +7 -0
- package/dist/index.js +4 -2
- package/dist/index.server.js +3 -1
- package/dist/scripts/pixelated-eslint-plugin.js +51 -0
- package/dist/types/components/admin/site-health/site-health-core-web-vitals.integration.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-github.integration.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-on-site-seo.integration.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-template.d.ts.map +1 -1
- package/dist/types/components/config/config.types.d.ts +11 -0
- package/dist/types/components/config/config.types.d.ts.map +1 -1
- package/dist/types/components/general/markdown.d.ts +12 -0
- package/dist/types/components/general/markdown.d.ts.map +1 -1
- package/dist/types/components/general/nerdjoke.d.ts.map +1 -1
- package/dist/types/components/general/proxy-handler.d.ts.map +1 -1
- package/dist/types/components/general/sitemap.d.ts.map +1 -1
- package/dist/types/components/general/smartfetch.d.ts +85 -0
- package/dist/types/components/general/smartfetch.d.ts.map +1 -0
- package/dist/types/components/general/tiles.d.ts.map +1 -1
- package/dist/types/components/general/urlbuilder.d.ts +64 -0
- package/dist/types/components/general/urlbuilder.d.ts.map +1 -0
- package/dist/types/components/integrations/contentful.delivery.d.ts.map +1 -1
- package/dist/types/components/integrations/contentful.items.components.d.ts.map +1 -1
- package/dist/types/components/integrations/contentful.management.d.ts.map +1 -1
- package/dist/types/components/integrations/flickr.d.ts.map +1 -1
- package/dist/types/components/integrations/gemini-api.client.d.ts.map +1 -1
- package/dist/types/components/integrations/gemini-api.server.d.ts +1 -1
- package/dist/types/components/integrations/gemini-api.server.d.ts.map +1 -1
- package/dist/types/components/integrations/google.reviews.functions.d.ts.map +1 -1
- package/dist/types/components/integrations/googleplaces.d.ts.map +1 -1
- package/dist/types/components/integrations/gravatar.functions.d.ts.map +1 -1
- package/dist/types/components/integrations/hubspot.components.d.ts.map +1 -1
- package/dist/types/components/integrations/instagram.functions.d.ts.map +1 -1
- package/dist/types/components/integrations/lipsum.d.ts.map +1 -1
- package/dist/types/components/integrations/loremipsum.d.ts.map +1 -1
- package/dist/types/components/integrations/socialcard.d.ts.map +1 -1
- package/dist/types/components/integrations/spotify.functions.d.ts.map +1 -1
- package/dist/types/components/integrations/wordpress.functions.d.ts.map +1 -1
- package/dist/types/components/integrations/yelp.d.ts.map +1 -1
- package/dist/types/components/shoppingcart/ebay.functions.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/config/google-fonts.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/form/formengine.d.ts +4 -4
- package/dist/types/components/sitebuilder/form/formengine.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/form/{formutils.d.ts → formengineutilities.d.ts} +1 -1
- package/dist/types/components/sitebuilder/form/formengineutilities.d.ts.map +1 -0
- package/dist/types/components/sitebuilder/form/formsubmit.d.ts +70 -0
- package/dist/types/components/sitebuilder/form/formsubmit.d.ts.map +1 -0
- package/dist/types/components/sitebuilder/page/components/SaveLoadSection.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -2
- package/dist/types/index.server.d.ts +3 -1
- package/dist/types/scripts/pixelated-eslint-plugin.d.ts +21 -0
- package/dist/types/stories/admin/contentful-migration.stories.d.ts +43 -0
- package/dist/types/stories/admin/contentful-migration.stories.d.ts.map +1 -1
- package/dist/types/stories/general/text-generation.stories.d.ts +116 -0
- package/dist/types/stories/general/text-generation.stories.d.ts.map +1 -0
- package/dist/types/stories/integrations/google.reviews.stories.d.ts +52 -0
- package/dist/types/stories/integrations/google.reviews.stories.d.ts.map +1 -1
- package/dist/types/stories/integrations/gravatar.stories.d.ts.map +1 -1
- package/dist/types/stories/integrations/instagram.stories.d.ts +38 -0
- package/dist/types/stories/integrations/instagram.stories.d.ts.map +1 -1
- package/dist/types/stories/sitebuilder/form-engine.stories.d.ts +13 -7
- package/dist/types/stories/sitebuilder/form-engine.stories.d.ts.map +1 -1
- package/dist/types/stories/sitebuilder/form.honeypot.stories.d.ts +0 -19
- package/dist/types/stories/sitebuilder/form.honeypot.stories.d.ts.map +1 -1
- package/dist/types/test/test-utils.d.ts +2 -0
- package/dist/types/test/test-utils.d.ts.map +1 -1
- package/dist/types/tests/formengineutilities.test.d.ts +2 -0
- package/dist/types/tests/formengineutilities.test.d.ts.map +1 -0
- package/dist/types/tests/google-apis.test.d.ts +2 -0
- package/dist/types/tests/google-apis.test.d.ts.map +1 -0
- package/dist/types/tests/google-fonts.test.d.ts +2 -0
- package/dist/types/tests/google-fonts.test.d.ts.map +1 -0
- package/dist/types/tests/site-health-core-web-vitals.test.d.ts +2 -0
- package/dist/types/tests/site-health-core-web-vitals.test.d.ts.map +1 -0
- package/dist/types/tests/smartfetch.test.d.ts +2 -0
- package/dist/types/tests/smartfetch.test.d.ts.map +1 -0
- package/dist/types/tests/social-media-apis.test.d.ts +7 -0
- package/dist/types/tests/social-media-apis.test.d.ts.map +1 -0
- package/dist/types/tests/specialized-apis.test.d.ts +7 -0
- package/dist/types/tests/specialized-apis.test.d.ts.map +1 -0
- package/dist/types/tests/urlbuilder.test.d.ts +2 -0
- package/dist/types/tests/urlbuilder.test.d.ts.map +1 -0
- package/dist/types/tests/useFormSubmit.test.d.ts +2 -0
- package/dist/types/tests/useFormSubmit.test.d.ts.map +1 -0
- package/package.json +9 -9
- package/dist/components/sitebuilder/form/formemailer.js +0 -119
- package/dist/types/components/sitebuilder/form/formemailer.d.ts +0 -3
- package/dist/types/components/sitebuilder/form/formemailer.d.ts.map +0 -1
- package/dist/types/components/sitebuilder/form/formutils.d.ts.map +0 -1
- package/dist/types/stories/integrations/lipsum.stories.d.ts +0 -38
- package/dist/types/stories/integrations/lipsum.stories.d.ts.map +0 -1
- package/dist/types/stories/integrations/loremipsum.stories.d.ts +0 -46
- package/dist/types/stories/integrations/loremipsum.stories.d.ts.map +0 -1
- package/dist/types/tests/formemailer.honeypot.test.d.ts +0 -2
- package/dist/types/tests/formemailer.honeypot.test.d.ts.map +0 -1
- /package/dist/components/sitebuilder/form/{formutils.js → formengineutilities.js} +0 -0
|
@@ -3,13 +3,19 @@ declare namespace _default {
|
|
|
3
3
|
export { FormEngine as component };
|
|
4
4
|
}
|
|
5
5
|
export default _default;
|
|
6
|
-
export namespace
|
|
7
|
-
|
|
8
|
-
export { data as formData };
|
|
9
|
-
export { onSubmit as onSubmitHandler };
|
|
10
|
-
}
|
|
6
|
+
export namespace FormEngineWithJSONProperties {
|
|
7
|
+
export { FormEngineWithJSONPropertiesStory as render };
|
|
11
8
|
}
|
|
12
9
|
import { FormEngine } from '@/components/sitebuilder/form/formengine';
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
/**
|
|
11
|
+
* FormEngine with JSON-driven submission behavior
|
|
12
|
+
*
|
|
13
|
+
* The form data includes a `properties` section that defines:
|
|
14
|
+
* - name, id: Form identity
|
|
15
|
+
* - toggleLoading, openModal, resetForm: Behavior flags
|
|
16
|
+
*
|
|
17
|
+
* FormEngine automatically wraps itself in FormSubmitWrapper,
|
|
18
|
+
* handling all submission lifecycle internally.
|
|
19
|
+
*/
|
|
20
|
+
declare function FormEngineWithJSONPropertiesStory(): import("react/jsx-runtime").JSX.Element;
|
|
15
21
|
//# sourceMappingURL=form-engine.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-engine.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/sitebuilder/form-engine.stories.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"form-engine.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/sitebuilder/form-engine.stories.js"],"names":[],"mappings":";;;;;;;;2BAC2B,0CAA0C;AAIrE;;;;;;;;;GASG;AACH,8FAMC"}
|
|
@@ -1,20 +1 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
title: string;
|
|
3
|
-
parameters: {
|
|
4
|
-
layout: string;
|
|
5
|
-
docs: {
|
|
6
|
-
description: {
|
|
7
|
-
component: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export default _default;
|
|
13
|
-
export declare const HoneypotReject: {
|
|
14
|
-
(): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
storyName: string;
|
|
16
|
-
play(context: {
|
|
17
|
-
canvasElement: HTMLElement;
|
|
18
|
-
}): Promise<void>;
|
|
19
|
-
};
|
|
20
1
|
//# sourceMappingURL=form.honeypot.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.honeypot.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/sitebuilder/form.honeypot.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"form.honeypot.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/sitebuilder/form.honeypot.stories.tsx"],"names":[],"mappings":""}
|
|
@@ -20,8 +20,10 @@ declare function renderWithProviders(ui: ReactElement, { config, ...renderOption
|
|
|
20
20
|
globlalConfig?: import("@/components/config/config.types").GlobalConfig;
|
|
21
21
|
google?: import("@/components/config/config.types").Google;
|
|
22
22
|
googleAnalytics?: import("@/components/config/config.types").GoogleAnalyticsConfig;
|
|
23
|
+
googleGemini?: import("@/components/config/config.types").GoogleGemini;
|
|
23
24
|
googleMaps?: import("@/components/config/config.types").GoogleMapsConfig;
|
|
24
25
|
googlePlaces?: import("@/components/config/config.types").GooglePlacesConfig;
|
|
26
|
+
googlePSI?: import("@/components/config/config.types").GooglePSI;
|
|
25
27
|
googleSearchConsole?: import("@/components/config/config.types").GoogleSearchConsoleConfig;
|
|
26
28
|
hubspot?: import("@/components/config/config.types").HubspotConfig;
|
|
27
29
|
instagram?: import("@/components/config/config.types").InstagramConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../src/test/test-utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAU,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,UAAU,qBAAsB,SAAQ,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC;IACpE,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACnC;AAED;;;GAGG;AACH,iBAAS,mBAAmB,CAC3B,EAAE,EAAE,YAAY,EAChB,EACC,MAAW,EACX,GAAG,aAAa,EAChB,GAAE,qBAA0B
|
|
1
|
+
{"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../src/test/test-utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAU,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,UAAU,qBAAsB,SAAQ,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC;IACpE,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACnC;AAED;;;GAGG;AACH,iBAAS,mBAAmB,CAC3B,EAAE,EAAE,YAAY,EAChB,EACC,MAAW,EACX,GAAG,aAAa,EAChB,GAAE,qBAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAQf,CAAC,yJAUU,CAAC,6BACA,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAH3B;AAGD,cAAc,wBAAwB,CAAC;AAGvC,OAAO,EAAE,mBAAmB,IAAI,MAAM,EAAE,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formengineutilities.test.d.ts","sourceRoot":"","sources":["../../../src/tests/formengineutilities.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-apis.test.d.ts","sourceRoot":"","sources":["../../../src/tests/google-apis.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-fonts.test.d.ts","sourceRoot":"","sources":["../../../src/tests/google-fonts.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site-health-core-web-vitals.test.d.ts","sourceRoot":"","sources":["../../../src/tests/site-health-core-web-vitals.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smartfetch.test.d.ts","sourceRoot":"","sources":["../../../src/tests/smartfetch.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"social-media-apis.test.d.ts","sourceRoot":"","sources":["../../../src/tests/social-media-apis.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specialized-apis.test.d.ts","sourceRoot":"","sources":["../../../src/tests/specialized-apis.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urlbuilder.test.d.ts","sourceRoot":"","sources":["../../../src/tests/urlbuilder.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormSubmit.test.d.ts","sourceRoot":"","sources":["../../../src/tests/useFormSubmit.test.tsx"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixelated-tech/components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": {
|
|
@@ -114,10 +114,10 @@
|
|
|
114
114
|
"html-entities": "^2.6.0"
|
|
115
115
|
},
|
|
116
116
|
"devDependencies": {
|
|
117
|
-
"@aws-sdk/client-amplify": "^3.
|
|
118
|
-
"@aws-sdk/client-cloudwatch": "^3.
|
|
119
|
-
"@aws-sdk/client-iam": "^3.
|
|
120
|
-
"@aws-sdk/client-route-53": "^3.
|
|
117
|
+
"@aws-sdk/client-amplify": "^3.1025.0",
|
|
118
|
+
"@aws-sdk/client-cloudwatch": "^3.1025.0",
|
|
119
|
+
"@aws-sdk/client-iam": "^3.1025.0",
|
|
120
|
+
"@aws-sdk/client-route-53": "^3.1025.0",
|
|
121
121
|
"@aws-sdk/xml-builder": "^3.972.16",
|
|
122
122
|
"@babel/core": "^7.29.0",
|
|
123
123
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
@@ -142,8 +142,8 @@
|
|
|
142
142
|
"@typescript-eslint/eslint-plugin": "^8.58.0",
|
|
143
143
|
"@typescript-eslint/parser": "^8.58.0",
|
|
144
144
|
"@vitejs/plugin-react": "^6.0.1",
|
|
145
|
-
"@vitest/coverage-v8": "^4.1.
|
|
146
|
-
"@vitest/ui": "^4.1.
|
|
145
|
+
"@vitest/coverage-v8": "^4.1.3",
|
|
146
|
+
"@vitest/ui": "^4.1.3",
|
|
147
147
|
"ajv": "^8.18.0",
|
|
148
148
|
"ajv-keywords": "^5.1.0",
|
|
149
149
|
"babel-loader": "^10.1.1",
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"eslint-plugin-react": "^7.37.5",
|
|
157
157
|
"file-loader": "^6.2.0",
|
|
158
158
|
"happy-dom": "^20.8.9",
|
|
159
|
-
"jsdom": "^29.0.
|
|
159
|
+
"jsdom": "^29.0.2",
|
|
160
160
|
"less-loader": "^12.3.2",
|
|
161
161
|
"mini-css-extract-plugin": "^2.10.2",
|
|
162
162
|
"next": "16.2.2",
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
"ts-loader": "^9.5.7",
|
|
175
175
|
"typescript": "^6.0.2",
|
|
176
176
|
"url-loader": "^4.1.1",
|
|
177
|
-
"vitest": "^4.1.
|
|
177
|
+
"vitest": "^4.1.3",
|
|
178
178
|
"webpack": "^5.105.4",
|
|
179
179
|
"webpack-cli": "^7.0.2",
|
|
180
180
|
"webpack-dev-server": "^5.2.3",
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
event.target.id = form id
|
|
3
|
-
event.body : {
|
|
4
|
-
to: "",
|
|
5
|
-
from: "",
|
|
6
|
-
subject: ""
|
|
7
|
-
}
|
|
8
|
-
*/
|
|
9
|
-
export async function emailFormData(e, callback) {
|
|
10
|
-
const debug = false;
|
|
11
|
-
// const sendmail_api = "https://nlbqdrixmj.execute-api.us-east-2.amazonaws.com/default/sendmail";
|
|
12
|
-
const sendmail_api = "https://sendmail.pixelated.tech/default/sendmail";
|
|
13
|
-
const target = e.target;
|
|
14
|
-
const myform = document.getElementById(target.id);
|
|
15
|
-
e.preventDefault?.();
|
|
16
|
-
const myFormData = {};
|
|
17
|
-
const formData = new FormData(myform);
|
|
18
|
-
for (const [key, value] of formData.entries()) {
|
|
19
|
-
myFormData[key] = value;
|
|
20
|
-
}
|
|
21
|
-
const hpField = myform?.elements.namedItem('winnie');
|
|
22
|
-
const hpFieldVal = hpField?.value.toString();
|
|
23
|
-
// If either DOM or FormData indicate a filled honeypot, silently drop the submission.
|
|
24
|
-
if ((hpField && hpFieldVal.trim())) {
|
|
25
|
-
// Prevent native navigation where possible and mirror success path.
|
|
26
|
-
try {
|
|
27
|
-
e?.preventDefault?.();
|
|
28
|
-
}
|
|
29
|
-
catch (err) {
|
|
30
|
-
if (debug)
|
|
31
|
-
console.debug('preventDefault failed in honeypot guard', err);
|
|
32
|
-
}
|
|
33
|
-
if (debug)
|
|
34
|
-
console.info('honeypot triggered — dropping submit');
|
|
35
|
-
// Ensure callback is invoked so calling code shows the same UX as a normal submit
|
|
36
|
-
callback(e);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
myFormData.Date = new Date().toISOString();
|
|
40
|
-
myFormData.Status = "Submitted";
|
|
41
|
-
const startTime = new Date().toISOString();
|
|
42
|
-
if (debug)
|
|
43
|
-
console.info('[emailFormData] submit-start', { sendmail_api, startTime, myFormData });
|
|
44
|
-
try {
|
|
45
|
-
const response = await fetch(sendmail_api, {
|
|
46
|
-
method: 'POST',
|
|
47
|
-
mode: 'cors',
|
|
48
|
-
headers: {
|
|
49
|
-
Accept: 'application/json',
|
|
50
|
-
'Content-Type': 'application/json',
|
|
51
|
-
},
|
|
52
|
-
body: JSON.stringify(myFormData),
|
|
53
|
-
});
|
|
54
|
-
const responseText = await response.text();
|
|
55
|
-
const requestId = response.headers.get('x-amzn-requestid') || response.headers.get('x-amz-requestid');
|
|
56
|
-
const elapsedMs = new Date().getTime() - new Date(startTime).getTime();
|
|
57
|
-
if (debug)
|
|
58
|
-
console.info('[emailFormData] submit-finish', { sendmail_api, status: response.status, statusText: response.statusText, requestId, elapsedMs, responseText });
|
|
59
|
-
if (!response.ok) {
|
|
60
|
-
console.error('emailFormData sendmail failed', {
|
|
61
|
-
url: sendmail_api,
|
|
62
|
-
status: response.status,
|
|
63
|
-
statusText: response.statusText,
|
|
64
|
-
body: responseText,
|
|
65
|
-
});
|
|
66
|
-
throw new Error(`sendmail failed ${response.status} ${response.statusText} ${responseText}`);
|
|
67
|
-
}
|
|
68
|
-
let parsed;
|
|
69
|
-
try {
|
|
70
|
-
parsed = responseText ? JSON.parse(responseText) : null;
|
|
71
|
-
}
|
|
72
|
-
catch (parseErr) {
|
|
73
|
-
if (debug)
|
|
74
|
-
console.warn('emailFormData response JSON parse failed', parseErr, responseText);
|
|
75
|
-
parsed = null;
|
|
76
|
-
}
|
|
77
|
-
if (debug)
|
|
78
|
-
console.debug('emailFormData — submission data:', myFormData, 'response:', parsed);
|
|
79
|
-
callback(e);
|
|
80
|
-
}
|
|
81
|
-
catch (err) {
|
|
82
|
-
console.error('emailFormData error', err);
|
|
83
|
-
callback(e);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
export async function emailJSON(jsonData, callback) {
|
|
87
|
-
// const sendmail_api = "https://nlbqdrixmj.execute-api.us-east-2.amazonaws.com/default/sendmail";
|
|
88
|
-
const sendmail_api = "https://sendmail.pixelated.tech/default/sendmail";
|
|
89
|
-
const myJsonData = {};
|
|
90
|
-
for (const [key, value] of Object.entries(jsonData)) {
|
|
91
|
-
myJsonData[key] = value;
|
|
92
|
-
}
|
|
93
|
-
// MVP honeypot guard: check both the canonical id/key 'winnie' and the
|
|
94
|
-
// FormHoneypot default name 'website' to cover both DOM- and JSON-based calls.
|
|
95
|
-
if (myJsonData['winnie'] || myJsonData['website']) {
|
|
96
|
-
if (callback)
|
|
97
|
-
callback();
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
myJsonData.Date = new Date().toLocaleDateString();
|
|
101
|
-
myJsonData.Status = "Submitted";
|
|
102
|
-
await fetch(sendmail_api, {
|
|
103
|
-
method: 'POST',
|
|
104
|
-
mode: 'cors',
|
|
105
|
-
headers: {
|
|
106
|
-
Accept: 'application/json',
|
|
107
|
-
'Content-Type': 'application/json',
|
|
108
|
-
},
|
|
109
|
-
body: JSON.stringify(myJsonData),
|
|
110
|
-
})
|
|
111
|
-
.then(async (response) => {
|
|
112
|
-
if (response.status !== 200) {
|
|
113
|
-
throw new Error(response.statusText);
|
|
114
|
-
}
|
|
115
|
-
return await response.json();
|
|
116
|
-
});
|
|
117
|
-
if (callback)
|
|
118
|
-
callback();
|
|
119
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formemailer.d.ts","sourceRoot":"","sources":["../../../../../src/components/sitebuilder/form/formemailer.tsx"],"names":[],"mappings":"AASA,wBAAsB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,iBAyEzE;AAID,wBAAsB,SAAS,CAAC,QAAQ,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,iBA+BnE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formutils.d.ts","sourceRoot":"","sources":["../../../../../src/components/sitebuilder/form/formutils.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAczD;AAiKD;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,GAAG,CAwBvC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI,CAgBpD"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
title: string;
|
|
3
|
-
component: null;
|
|
4
|
-
argTypes: {
|
|
5
|
-
LipsumTypeId: {
|
|
6
|
-
control: {
|
|
7
|
-
type: string;
|
|
8
|
-
};
|
|
9
|
-
options: string[];
|
|
10
|
-
};
|
|
11
|
-
Amount: {
|
|
12
|
-
control: string;
|
|
13
|
-
};
|
|
14
|
-
StartWithLoremIpsum: {
|
|
15
|
-
control: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export default _default;
|
|
20
|
-
export declare const Playground: {
|
|
21
|
-
render: (args: any) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
args: {
|
|
23
|
-
LipsumTypeId: string;
|
|
24
|
-
Amount: number;
|
|
25
|
-
StartWithLoremIpsum: boolean;
|
|
26
|
-
};
|
|
27
|
-
parameters: {
|
|
28
|
-
docs: {
|
|
29
|
-
source: {
|
|
30
|
-
type: string;
|
|
31
|
-
};
|
|
32
|
-
description: {
|
|
33
|
-
story: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=lipsum.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lipsum.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/integrations/lipsum.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAGA,wBAQE;AAgCF,eAAO,MAAM,UAAU;mBACN,GAAG;;;;;;;;;;;;;;;;CAcnB,CAAC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { LoremIpsum } from '@/components/integrations/loremipsum';
|
|
3
|
-
declare const _default: {
|
|
4
|
-
title: string;
|
|
5
|
-
component: typeof LoremIpsum;
|
|
6
|
-
argTypes: {
|
|
7
|
-
paragraphs: {
|
|
8
|
-
control: string;
|
|
9
|
-
};
|
|
10
|
-
seed: {
|
|
11
|
-
control: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export default _default;
|
|
16
|
-
export declare const Playground: {
|
|
17
|
-
render: React.FC<import("prop-types").InferPropsInner<Pick<{
|
|
18
|
-
paragraphs: import("prop-types").Requireable<number>;
|
|
19
|
-
seed: import("prop-types").Requireable<string>;
|
|
20
|
-
proxyBase: import("prop-types").Requireable<string>;
|
|
21
|
-
className: import("prop-types").Requireable<string>;
|
|
22
|
-
}, never>> & Partial<import("prop-types").InferPropsInner<Pick<{
|
|
23
|
-
paragraphs: import("prop-types").Requireable<number>;
|
|
24
|
-
seed: import("prop-types").Requireable<string>;
|
|
25
|
-
proxyBase: import("prop-types").Requireable<string>;
|
|
26
|
-
className: import("prop-types").Requireable<string>;
|
|
27
|
-
}, "className" | "seed" | "proxyBase" | "paragraphs">>> & {
|
|
28
|
-
proxyBase?: string;
|
|
29
|
-
}>;
|
|
30
|
-
args: {
|
|
31
|
-
paragraphs: number;
|
|
32
|
-
seed: string;
|
|
33
|
-
proxyBase: string;
|
|
34
|
-
};
|
|
35
|
-
parameters: {
|
|
36
|
-
docs: {
|
|
37
|
-
source: {
|
|
38
|
-
type: string;
|
|
39
|
-
};
|
|
40
|
-
description: {
|
|
41
|
-
story: string;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=loremipsum.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loremipsum.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/integrations/loremipsum.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;;;;;;;;;;;;;AAElE,wBAOE;AASF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formemailer.honeypot.test.d.ts","sourceRoot":"","sources":["../../../src/tests/formemailer.honeypot.test.ts"],"names":[],"mappings":""}
|
|
File without changes
|