strapi-plugin-hubspot 0.6.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/_chunks/{Forms-B2y_0-x4.mjs → Forms-77Mornxt.mjs} +115 -18
  3. package/dist/_chunks/{Forms-CaT0YEJo.js → Forms-B8kkPY0c.js} +133 -36
  4. package/dist/_chunks/HubspotFormInput-BVknnlmR.mjs +61 -0
  5. package/dist/_chunks/HubspotFormInput-kx3LlQYF.js +79 -0
  6. package/dist/_chunks/{HubspotObjectInput-DdLAUh0N.mjs → HubspotObjectInput-B-Y1PZ6c.mjs} +4 -3
  7. package/dist/_chunks/{HubspotObjectInput-Crpcpa8T.js → HubspotObjectInput-BOO1PvOj.js} +8 -7
  8. package/dist/_chunks/{HubspotPropertyInput-k7wMSmeF.mjs → HubspotPropertyInput-Drxn_Ddt.mjs} +4 -3
  9. package/dist/_chunks/{HubspotPropertyInput-SnJMFsII.js → HubspotPropertyInput-awfD1opH.js} +18 -17
  10. package/dist/_chunks/{Settings-BPAAD-QW.js → Settings-BT1NhvxO.js} +16 -15
  11. package/dist/_chunks/{Settings-BMOmj4NJ.mjs → Settings-DrujhMxS.mjs} +3 -2
  12. package/dist/_chunks/{en-C_-N8cjv.js → en-B8adhJhO.js} +17 -3
  13. package/dist/_chunks/{en-CJ9wYHgN.mjs → en-BYKKi1LK.mjs} +17 -3
  14. package/dist/_chunks/{fr-BHObPoUp.js → fr-DnKtGXaB.js} +17 -3
  15. package/dist/_chunks/{fr-DttDn-2Y.mjs → fr-DzgArgi3.mjs} +17 -3
  16. package/dist/_chunks/{objectLabels-C9ocOgVY.mjs → index-CEh8vkxY.mjs} +0 -14
  17. package/dist/_chunks/{objectLabels-VTt_-qTZ.js → index-DkTxsEqL.js} +0 -14
  18. package/dist/_chunks/{index-foVSGFWb.mjs → index-LrCSAHoH.mjs} +21 -5
  19. package/dist/_chunks/{index-D_CPrIHe.js → index-P7p8ASb6.js} +21 -5
  20. package/dist/_chunks/objectLabels-Dn-zriuZ.js +15 -0
  21. package/dist/_chunks/objectLabels-yNrnTOBo.mjs +16 -0
  22. package/dist/_chunks/{useHubspotSchema-B8SctALV.js → useHubspotSchema-BottzdRR.js} +1 -1
  23. package/dist/_chunks/{useHubspotSchema-Du3rLY_O.mjs → useHubspotSchema-DccG2KbZ.mjs} +1 -1
  24. package/dist/admin/index.js +1 -1
  25. package/dist/admin/index.mjs +1 -1
  26. package/dist/admin/src/builder/types.d.ts +1 -0
  27. package/dist/admin/src/components/HubspotFormInput.d.ts +29 -0
  28. package/dist/server/index.js +100 -8
  29. package/dist/server/index.mjs +100 -8
  30. package/dist/server/src/content-types.d.ts +3 -0
  31. package/dist/server/src/forms.d.ts +2 -0
  32. package/dist/server/src/formsAdmin.d.ts +13 -0
  33. package/dist/server/src/importLegacy.d.ts +1 -0
  34. package/dist/server/src/index.d.ts +5 -0
  35. package/dist/shared/types.d.ts +2 -0
  36. package/package.json +1 -1
@@ -0,0 +1,61 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { u as useIntl } from "./index-CEh8vkxY.mjs";
4
+ import { Field, Flex, Loader, Combobox, ComboboxOption } from "@strapi/design-system";
5
+ import { useFetchClient } from "@strapi/strapi/admin";
6
+ import { P as PLUGIN_ID, g as getTranslation } from "./index-LrCSAHoH.mjs";
7
+ const HubspotFormInput = React.forwardRef(
8
+ ({ name, value, onChange, disabled, error, required, label, hint, labelAction }, ref) => {
9
+ const { formatMessage } = useIntl();
10
+ const { get } = useFetchClient();
11
+ const [forms, setForms] = React.useState(null);
12
+ const [failed, setFailed] = React.useState(false);
13
+ const t = (id, defaultMessage, values) => formatMessage({ id: getTranslation(id), defaultMessage }, values);
14
+ React.useEffect(() => {
15
+ let cancelled = false;
16
+ get(`/${PLUGIN_ID}/forms-options`).then(({ data }) => !cancelled && setForms(data.forms ?? [])).catch(() => !cancelled && setFailed(true));
17
+ return () => {
18
+ cancelled = true;
19
+ };
20
+ }, [get]);
21
+ const emit = (next) => onChange({ target: { name, value: next ?? "", type: "string" } });
22
+ const known = forms ?? [];
23
+ const orphan = value && !known.some((f) => f.slug === value);
24
+ return /* @__PURE__ */ jsxs(Field.Root, { name, error, hint, required, children: [
25
+ /* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
26
+ failed ? /* @__PURE__ */ jsx(
27
+ Field.Input,
28
+ {
29
+ ref,
30
+ value: value || "",
31
+ onChange: (e) => emit(e.target.value),
32
+ disabled,
33
+ placeholder: t("form-picker.fallback", "Form slug")
34
+ }
35
+ ) : !forms ? /* @__PURE__ */ jsx(Flex, { paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsx(Loader, { small: true, children: t("form-picker.loading", "Loading the forms…") }) }) : /* @__PURE__ */ jsxs(
36
+ Combobox,
37
+ {
38
+ ref,
39
+ value: value || "",
40
+ onChange: (next) => emit(next),
41
+ onClear: () => emit(""),
42
+ disabled,
43
+ placeholder: t("form-picker.placeholder", "Choose a form…"),
44
+ children: [
45
+ orphan && /* @__PURE__ */ jsx(ComboboxOption, { value, children: t("form-picker.orphan", "{slug} — unknown form", { slug: value }) }),
46
+ known.map((form) => /* @__PURE__ */ jsx(ComboboxOption, { value: form.slug, children: form.published ? `${form.name} (${form.slug})` : t("form-picker.draft", "{name} ({slug}) — draft, not served yet", {
47
+ name: form.name,
48
+ slug: form.slug
49
+ }) }, form.slug))
50
+ ]
51
+ }
52
+ ),
53
+ /* @__PURE__ */ jsx(Field.Hint, {}),
54
+ /* @__PURE__ */ jsx(Field.Error, {})
55
+ ] });
56
+ }
57
+ );
58
+ HubspotFormInput.displayName = "HubspotFormInput";
59
+ export {
60
+ HubspotFormInput as default
61
+ };
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ const index = require("./index-DkTxsEqL.js");
6
+ const designSystem = require("@strapi/design-system");
7
+ const admin = require("@strapi/strapi/admin");
8
+ const index$1 = require("./index-P7p8ASb6.js");
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
12
+ if (e) {
13
+ for (const k in e) {
14
+ if (k !== "default") {
15
+ const d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: () => e[k]
19
+ });
20
+ }
21
+ }
22
+ }
23
+ n.default = e;
24
+ return Object.freeze(n);
25
+ }
26
+ const React__namespace = /* @__PURE__ */ _interopNamespace(React);
27
+ const HubspotFormInput = React__namespace.forwardRef(
28
+ ({ name, value, onChange, disabled, error, required, label, hint, labelAction }, ref) => {
29
+ const { formatMessage } = index.useIntl();
30
+ const { get } = admin.useFetchClient();
31
+ const [forms, setForms] = React__namespace.useState(null);
32
+ const [failed, setFailed] = React__namespace.useState(false);
33
+ const t = (id, defaultMessage, values) => formatMessage({ id: index$1.getTranslation(id), defaultMessage }, values);
34
+ React__namespace.useEffect(() => {
35
+ let cancelled = false;
36
+ get(`/${index$1.PLUGIN_ID}/forms-options`).then(({ data }) => !cancelled && setForms(data.forms ?? [])).catch(() => !cancelled && setFailed(true));
37
+ return () => {
38
+ cancelled = true;
39
+ };
40
+ }, [get]);
41
+ const emit = (next) => onChange({ target: { name, value: next ?? "", type: "string" } });
42
+ const known = forms ?? [];
43
+ const orphan = value && !known.some((f) => f.slug === value);
44
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name, error, hint, required, children: [
45
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: labelAction, children: label }),
46
+ failed ? /* @__PURE__ */ jsxRuntime.jsx(
47
+ designSystem.Field.Input,
48
+ {
49
+ ref,
50
+ value: value || "",
51
+ onChange: (e) => emit(e.target.value),
52
+ disabled,
53
+ placeholder: t("form-picker.fallback", "Form slug")
54
+ }
55
+ ) : !forms ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, { small: true, children: t("form-picker.loading", "Loading the forms…") }) }) : /* @__PURE__ */ jsxRuntime.jsxs(
56
+ designSystem.Combobox,
57
+ {
58
+ ref,
59
+ value: value || "",
60
+ onChange: (next) => emit(next),
61
+ onClear: () => emit(""),
62
+ disabled,
63
+ placeholder: t("form-picker.placeholder", "Choose a form…"),
64
+ children: [
65
+ orphan && /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value, children: t("form-picker.orphan", "{slug} — unknown form", { slug: value }) }),
66
+ known.map((form) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: form.slug, children: form.published ? `${form.name} (${form.slug})` : t("form-picker.draft", "{name} ({slug}) — draft, not served yet", {
67
+ name: form.name,
68
+ slug: form.slug
69
+ }) }, form.slug))
70
+ ]
71
+ }
72
+ ),
73
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {}),
74
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
75
+ ] });
76
+ }
77
+ );
78
+ HubspotFormInput.displayName = "HubspotFormInput";
79
+ exports.default = HubspotFormInput;
@@ -1,9 +1,10 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { u as useIntl, o as objectLabel } from "./objectLabels-C9ocOgVY.mjs";
3
+ import { u as useIntl } from "./index-CEh8vkxY.mjs";
4
4
  import { Field, Flex, Loader, SingleSelect, SingleSelectOption } from "@strapi/design-system";
5
- import { g as getTranslation } from "./index-foVSGFWb.mjs";
6
- import { u as useHubspotSchema } from "./useHubspotSchema-Du3rLY_O.mjs";
5
+ import { g as getTranslation } from "./index-LrCSAHoH.mjs";
6
+ import { o as objectLabel } from "./objectLabels-yNrnTOBo.mjs";
7
+ import { u as useHubspotSchema } from "./useHubspotSchema-DccG2KbZ.mjs";
7
8
  const HubspotObjectInput = React.forwardRef(
8
9
  ({ name, value, onChange, disabled, error, required, label, hint, labelAction }, ref) => {
9
10
  const intl = useIntl();
@@ -2,10 +2,11 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
- const objectLabels = require("./objectLabels-VTt_-qTZ.js");
5
+ const index = require("./index-DkTxsEqL.js");
6
6
  const designSystem = require("@strapi/design-system");
7
- const index = require("./index-D_CPrIHe.js");
8
- const useHubspotSchema = require("./useHubspotSchema-B8SctALV.js");
7
+ const index$1 = require("./index-P7p8ASb6.js");
8
+ const objectLabels = require("./objectLabels-Dn-zriuZ.js");
9
+ const useHubspotSchema = require("./useHubspotSchema-BottzdRR.js");
9
10
  function _interopNamespace(e) {
10
11
  if (e && e.__esModule) return e;
11
12
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -26,7 +27,7 @@ function _interopNamespace(e) {
26
27
  const React__namespace = /* @__PURE__ */ _interopNamespace(React);
27
28
  const HubspotObjectInput = React__namespace.forwardRef(
28
29
  ({ name, value, onChange, disabled, error, required, label, hint, labelAction }, ref) => {
29
- const intl = objectLabels.useIntl();
30
+ const intl = index.useIntl();
30
31
  const { formatMessage } = intl;
31
32
  const { schema } = useHubspotSchema.useHubspotSchema();
32
33
  const emit = (next) => onChange({ target: { name, value: String(next ?? ""), type: "string" } });
@@ -38,7 +39,7 @@ const HubspotObjectInput = React__namespace.forwardRef(
38
39
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name, error, hint, required, children: [
39
40
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: labelAction, children: label }),
40
41
  !schema ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, { small: true, children: formatMessage({
41
- id: index.getTranslation("object.loading"),
42
+ id: index$1.getTranslation("object.loading"),
42
43
  defaultMessage: "Loading HubSpot objects…"
43
44
  }) }) }) : schema.configured ? /* @__PURE__ */ jsxRuntime.jsx(
44
45
  designSystem.SingleSelect,
@@ -49,12 +50,12 @@ const HubspotObjectInput = React__namespace.forwardRef(
49
50
  onClear: () => emit(""),
50
51
  disabled,
51
52
  placeholder: formatMessage({
52
- id: index.getTranslation("object.placeholder"),
53
+ id: index$1.getTranslation("object.placeholder"),
53
54
  defaultMessage: "Choose an object…"
54
55
  }),
55
56
  children: options.map((object) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: object, children: schema.unavailable.some((u) => u.object === object) ? formatMessage(
56
57
  {
57
- id: index.getTranslation("object.no-scope"),
58
+ id: index$1.getTranslation("object.no-scope"),
58
59
  defaultMessage: "{object} — missing scope on the token"
59
60
  },
60
61
  { object: objectLabels.objectLabel(intl, object) }
@@ -1,11 +1,12 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { u as useIntl, o as objectLabel } from "./objectLabels-C9ocOgVY.mjs";
3
+ import { u as useIntl } from "./index-CEh8vkxY.mjs";
4
4
  import { Field, Flex, Loader, Combobox, ComboboxOption, IconButton, Button, Typography, Link } from "@strapi/design-system";
5
5
  import { ArrowClockwise } from "@strapi/icons";
6
6
  import { useField } from "@strapi/strapi/admin";
7
- import { g as getTranslation } from "./index-foVSGFWb.mjs";
8
- import { u as useHubspotSchema } from "./useHubspotSchema-Du3rLY_O.mjs";
7
+ import { g as getTranslation } from "./index-LrCSAHoH.mjs";
8
+ import { o as objectLabel } from "./objectLabels-yNrnTOBo.mjs";
9
+ import { u as useHubspotSchema } from "./useHubspotSchema-DccG2KbZ.mjs";
9
10
  const oneLine = {
10
11
  display: "block",
11
12
  whiteSpace: "nowrap",
@@ -2,12 +2,13 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
- const objectLabels = require("./objectLabels-VTt_-qTZ.js");
5
+ const index = require("./index-DkTxsEqL.js");
6
6
  const designSystem = require("@strapi/design-system");
7
7
  const icons = require("@strapi/icons");
8
8
  const admin = require("@strapi/strapi/admin");
9
- const index = require("./index-D_CPrIHe.js");
10
- const useHubspotSchema = require("./useHubspotSchema-B8SctALV.js");
9
+ const index$1 = require("./index-P7p8ASb6.js");
10
+ const objectLabels = require("./objectLabels-Dn-zriuZ.js");
11
+ const useHubspotSchema = require("./useHubspotSchema-BottzdRR.js");
11
12
  function _interopNamespace(e) {
12
13
  if (e && e.__esModule) return e;
13
14
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -45,7 +46,7 @@ const HubspotPropertyInput = React__namespace.forwardRef(
45
46
  hint,
46
47
  labelAction
47
48
  }, ref) => {
48
- const intl = objectLabels.useIntl();
49
+ const intl = index.useIntl();
49
50
  const { formatMessage } = intl;
50
51
  const { schema, loadError, refresh, refreshing } = useHubspotSchema.useHubspotSchema();
51
52
  const objectFieldName = attribute?.options?.objectField || "hsObject";
@@ -90,7 +91,7 @@ const HubspotPropertyInput = React__namespace.forwardRef(
90
91
  value,
91
92
  label: elsewhere ? formatMessage(
92
93
  {
93
- id: index.getTranslation("picker.belongs-to"),
94
+ id: index$1.getTranslation("picker.belongs-to"),
94
95
  defaultMessage: "{property} — belongs to {object}"
95
96
  },
96
97
  {
@@ -99,7 +100,7 @@ const HubspotPropertyInput = React__namespace.forwardRef(
99
100
  }
100
101
  ) : formatMessage(
101
102
  {
102
- id: index.getTranslation("picker.unknown"),
103
+ id: index$1.getTranslation("picker.unknown"),
103
104
  defaultMessage: "{property} — unknown to the portal"
104
105
  },
105
106
  { property: value }
@@ -111,20 +112,20 @@ const HubspotPropertyInput = React__namespace.forwardRef(
111
112
  const describe = () => {
112
113
  if (loadError !== null) {
113
114
  return loadError || formatMessage({
114
- id: index.getTranslation("picker.load-error"),
115
+ id: index$1.getTranslation("picker.load-error"),
115
116
  defaultMessage: "HubSpot properties unavailable"
116
117
  });
117
118
  }
118
119
  if (schema && !schema.configured) {
119
120
  return formatMessage({
120
- id: index.getTranslation("picker.not-configured"),
121
+ id: index$1.getTranslation("picker.not-configured"),
121
122
  defaultMessage: "No HubSpot API key — free text. Set it in Settings → HubSpot."
122
123
  });
123
124
  }
124
125
  if (selectedObject && schema?.unavailable.some((u) => u.object === selectedObject)) {
125
126
  return formatMessage(
126
127
  {
127
- id: index.getTranslation("picker.object-unavailable"),
128
+ id: index$1.getTranslation("picker.object-unavailable"),
128
129
  defaultMessage: "Properties of “{object}” unreadable — missing scope on the token."
129
130
  },
130
131
  { object: objectLabels.objectLabel(intl, selectedObject) }
@@ -160,7 +161,7 @@ const HubspotPropertyInput = React__namespace.forwardRef(
160
161
  children: [
161
162
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: labelAction, children: label }),
162
163
  !schema ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, { small: true, children: formatMessage({
163
- id: index.getTranslation("picker.loading"),
164
+ id: index$1.getTranslation("picker.loading"),
164
165
  defaultMessage: "Loading HubSpot properties…"
165
166
  }) }) }) : schema.configured ? /* @__PURE__ */ jsxRuntime.jsx(
166
167
  designSystem.Combobox,
@@ -171,12 +172,12 @@ const HubspotPropertyInput = React__namespace.forwardRef(
171
172
  onClear: () => emit(""),
172
173
  disabled,
173
174
  placeholder: formatMessage({
174
- id: index.getTranslation("picker.placeholder"),
175
+ id: index$1.getTranslation("picker.placeholder"),
175
176
  defaultMessage: "Search a property…"
176
177
  }),
177
178
  autocomplete: { type: "list", filter: "contains" },
178
179
  noOptionsMessage: () => formatMessage({
179
- id: index.getTranslation("picker.no-results"),
180
+ id: index$1.getTranslation("picker.no-results"),
180
181
  defaultMessage: "No matching property — properties are managed in HubSpot."
181
182
  }),
182
183
  children: options.map((o) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: o.value, textValue: o.label, children: /* @__PURE__ */ jsxRuntime.jsx("span", { title: o.label, style: oneLine, children: o.label }) }, o.value))
@@ -189,7 +190,7 @@ const HubspotPropertyInput = React__namespace.forwardRef(
189
190
  onChange: (e) => emit(e.target.value),
190
191
  disabled,
191
192
  placeholder: formatMessage({
192
- id: index.getTranslation("picker.free-placeholder"),
193
+ id: index$1.getTranslation("picker.free-placeholder"),
193
194
  defaultMessage: "e.g. hs_role, numberofemployees"
194
195
  })
195
196
  }
@@ -199,7 +200,7 @@ const HubspotPropertyInput = React__namespace.forwardRef(
199
200
  designSystem.IconButton,
200
201
  {
201
202
  label: formatMessage({
202
- id: index.getTranslation("picker.refresh"),
203
+ id: index$1.getTranslation("picker.refresh"),
203
204
  defaultMessage: "Refresh the properties from HubSpot"
204
205
  }),
205
206
  variant: "ghost",
@@ -218,7 +219,7 @@ const HubspotPropertyInput = React__namespace.forwardRef(
218
219
  disabled,
219
220
  children: formatMessage(
220
221
  {
221
- id: index.getTranslation("picker.import"),
222
+ id: index$1.getTranslation("picker.import"),
222
223
  defaultMessage: "Import the {count} options from HubSpot"
223
224
  },
224
225
  { count: selectedProperty?.options.length ?? 0 }
@@ -226,11 +227,11 @@ const HubspotPropertyInput = React__namespace.forwardRef(
226
227
  }
227
228
  ) : null,
228
229
  imported ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "success600", children: formatMessage({
229
- id: index.getTranslation("picker.imported"),
230
+ id: index$1.getTranslation("picker.imported"),
230
231
  defaultMessage: "Options imported — save to keep them."
231
232
  }) }) : null,
232
233
  crmLink ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Link, { href: crmLink, isExternal: true, children: formatMessage({
233
- id: index.getTranslation("picker.view"),
234
+ id: index$1.getTranslation("picker.view"),
234
235
  defaultMessage: "View in HubSpot"
235
236
  }) }) : null
236
237
  ] }) : null,
@@ -2,11 +2,12 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
- const objectLabels = require("./objectLabels-VTt_-qTZ.js");
5
+ const index = require("./index-DkTxsEqL.js");
6
6
  const designSystem = require("@strapi/design-system");
7
7
  const admin = require("@strapi/strapi/admin");
8
- const index = require("./index-D_CPrIHe.js");
8
+ const index$1 = require("./index-P7p8ASb6.js");
9
9
  const reactRouterDom = require("react-router-dom");
10
+ const objectLabels = require("./objectLabels-Dn-zriuZ.js");
10
11
  function _interopNamespace(e) {
11
12
  if (e && e.__esModule) return e;
12
13
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -26,13 +27,13 @@ function _interopNamespace(e) {
26
27
  }
27
28
  const React__namespace = /* @__PURE__ */ _interopNamespace(React);
28
29
  const AuditSection = ({ configured }) => {
29
- const intl = objectLabels.useIntl();
30
+ const intl = index.useIntl();
30
31
  const { formatMessage } = intl;
31
32
  const { get } = admin.useFetchClient();
32
33
  const [busy, setBusy] = React__namespace.useState(false);
33
34
  const [error, setError] = React__namespace.useState(false);
34
35
  const [result, setResult] = React__namespace.useState(null);
35
- const t = (id, defaultMessage, values) => formatMessage({ id: index.getTranslation(id), defaultMessage }, values);
36
+ const t = (id, defaultMessage, values) => formatMessage({ id: index$1.getTranslation(id), defaultMessage }, values);
36
37
  const problemText = (p) => {
37
38
  switch (p.code) {
38
39
  case "unknown":
@@ -62,7 +63,7 @@ const AuditSection = ({ configured }) => {
62
63
  setError(false);
63
64
  setResult(null);
64
65
  try {
65
- const { data } = await get(`/${index.PLUGIN_ID}/audit`);
66
+ const { data } = await get(`/${index$1.PLUGIN_ID}/audit`);
66
67
  setResult(data);
67
68
  } catch {
68
69
  setError(true);
@@ -119,17 +120,17 @@ const AuditSection = ({ configured }) => {
119
120
  ] });
120
121
  };
121
122
  const FailuresSection = ({ configured }) => {
122
- const { formatMessage } = objectLabels.useIntl();
123
+ const { formatMessage } = index.useIntl();
123
124
  const { get, post } = admin.useFetchClient();
124
125
  const [total, setTotal] = React__namespace.useState(null);
125
126
  const [busy, setBusy] = React__namespace.useState(false);
126
127
  const [feedback, setFeedback] = React__namespace.useState(
127
128
  null
128
129
  );
129
- const t = (id, defaultMessage, values) => formatMessage({ id: index.getTranslation(id), defaultMessage }, values);
130
+ const t = (id, defaultMessage, values) => formatMessage({ id: index$1.getTranslation(id), defaultMessage }, values);
130
131
  const load = React__namespace.useCallback(async () => {
131
132
  try {
132
- const { data } = await get(`/${index.PLUGIN_ID}/failures`);
133
+ const { data } = await get(`/${index$1.PLUGIN_ID}/failures`);
133
134
  setTotal(data.total);
134
135
  } catch {
135
136
  setTotal(null);
@@ -143,7 +144,7 @@ const FailuresSection = ({ configured }) => {
143
144
  setFeedback(null);
144
145
  try {
145
146
  const { data } = await post(
146
- `/${index.PLUGIN_ID}/failures/retry`
147
+ `/${index$1.PLUGIN_ID}/failures/retry`
147
148
  );
148
149
  setFeedback({
149
150
  tone: data.failed ? "danger" : "success",
@@ -192,7 +193,7 @@ const FailuresSection = ({ configured }) => {
192
193
  ] });
193
194
  };
194
195
  const HubspotSettings = () => {
195
- const { formatMessage } = objectLabels.useIntl();
196
+ const { formatMessage } = index.useIntl();
196
197
  const { get, put, del } = admin.useFetchClient();
197
198
  const [settings, setSettings] = React__namespace.useState(null);
198
199
  const [apiKey, setApiKey] = React__namespace.useState("");
@@ -200,9 +201,9 @@ const HubspotSettings = () => {
200
201
  const [feedback, setFeedback] = React__namespace.useState(
201
202
  null
202
203
  );
203
- const t = (id, defaultMessage, values) => formatMessage({ id: index.getTranslation(id), defaultMessage }, values);
204
+ const t = (id, defaultMessage, values) => formatMessage({ id: index$1.getTranslation(id), defaultMessage }, values);
204
205
  const load = React__namespace.useCallback(async () => {
205
- const { data } = await get(`/${index.PLUGIN_ID}/settings`);
206
+ const { data } = await get(`/${index$1.PLUGIN_ID}/settings`);
206
207
  setSettings(data);
207
208
  }, [get]);
208
209
  React__namespace.useEffect(() => {
@@ -214,7 +215,7 @@ const HubspotSettings = () => {
214
215
  setBusy(true);
215
216
  setFeedback(null);
216
217
  try {
217
- const { data } = await put(`/${index.PLUGIN_ID}/settings`, { apiKey });
218
+ const { data } = await put(`/${index$1.PLUGIN_ID}/settings`, { apiKey });
218
219
  setSettings(data);
219
220
  setApiKey("");
220
221
  setFeedback({ tone: "success", text: t("settings.saved", "Key saved.") });
@@ -228,7 +229,7 @@ const HubspotSettings = () => {
228
229
  setBusy(true);
229
230
  setFeedback(null);
230
231
  try {
231
- const { data } = await del(`/${index.PLUGIN_ID}/settings`);
232
+ const { data } = await del(`/${index$1.PLUGIN_ID}/settings`);
232
233
  setSettings(data);
233
234
  setApiKey("");
234
235
  setFeedback({ tone: "success", text: t("settings.removed", "Key removed.") });
@@ -243,7 +244,7 @@ const HubspotSettings = () => {
243
244
  setFeedback(null);
244
245
  try {
245
246
  const { data } = await get(
246
- `/${index.PLUGIN_ID}/properties?refresh=1`
247
+ `/${index$1.PLUGIN_ID}/properties?refresh=1`
247
248
  );
248
249
  setFeedback(
249
250
  data.configured ? {
@@ -1,10 +1,11 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { u as useIntl, o as objectLabel } from "./objectLabels-C9ocOgVY.mjs";
3
+ import { u as useIntl } from "./index-CEh8vkxY.mjs";
4
4
  import { Flex, Divider, Typography, Button, Box, Link, Badge, Loader, Field } from "@strapi/design-system";
5
5
  import { useFetchClient } from "@strapi/strapi/admin";
6
- import { g as getTranslation, P as PLUGIN_ID } from "./index-foVSGFWb.mjs";
6
+ import { g as getTranslation, P as PLUGIN_ID } from "./index-LrCSAHoH.mjs";
7
7
  import { Link as Link$1 } from "react-router-dom";
8
+ import { o as objectLabel } from "./objectLabels-yNrnTOBo.mjs";
8
9
  const AuditSection = ({ configured }) => {
9
10
  const intl = useIntl();
10
11
  const { formatMessage } = intl;
@@ -94,8 +94,8 @@ const en = {
94
94
  "forms.col-structure": "Structure",
95
95
  "forms.col-status": "Status",
96
96
  "forms.col-updated": "Updated",
97
- "forms.col-actions": "",
98
- "forms.structure": "{steps} steps · {fields} fields",
97
+ "forms.col-actions": "Actions",
98
+ "forms.structure": "{steps, plural, one {# step} other {# steps}} · {fields, plural, one {# field} other {# fields}}",
99
99
  "forms.published": "Published",
100
100
  "forms.draft": "Draft",
101
101
  "forms.delete": "Delete",
@@ -192,6 +192,20 @@ const en = {
192
192
  "forms.import-hint": "Converts a legacy content-type form (all locales) into a draft here — same slug, source untouched. Re-importing overwrites the draft.",
193
193
  "forms.import-source": "Form to import",
194
194
  "forms.import": "Import",
195
- "forms.import-error": "Could not import the form."
195
+ "forms.import-error": "Could not import the form.",
196
+ "form-picker.label": "HubSpot form",
197
+ "form-picker.description": "A form built in the HubSpot form builder, stored by slug",
198
+ "form-picker.loading": "Loading the forms…",
199
+ "form-picker.placeholder": "Choose a form…",
200
+ "form-picker.fallback": "Form slug",
201
+ "form-picker.orphan": "{slug} — unknown form",
202
+ "form-picker.draft": "{name} ({slug}) — draft, not served yet",
203
+ "forms.duplicate": "Duplicate",
204
+ "forms.duplicate-error": "Could not duplicate the form.",
205
+ "panel.icon": "Icon",
206
+ "panel.persist": "Answer memory",
207
+ "panel.persist-session": "This visit only",
208
+ "panel.persist-days30": "30 days (non-identifying fields only)",
209
+ "panel.class": "CSS classes"
196
210
  };
197
211
  exports.default = en;
@@ -92,8 +92,8 @@ const en = {
92
92
  "forms.col-structure": "Structure",
93
93
  "forms.col-status": "Status",
94
94
  "forms.col-updated": "Updated",
95
- "forms.col-actions": "",
96
- "forms.structure": "{steps} steps · {fields} fields",
95
+ "forms.col-actions": "Actions",
96
+ "forms.structure": "{steps, plural, one {# step} other {# steps}} · {fields, plural, one {# field} other {# fields}}",
97
97
  "forms.published": "Published",
98
98
  "forms.draft": "Draft",
99
99
  "forms.delete": "Delete",
@@ -190,7 +190,21 @@ const en = {
190
190
  "forms.import-hint": "Converts a legacy content-type form (all locales) into a draft here — same slug, source untouched. Re-importing overwrites the draft.",
191
191
  "forms.import-source": "Form to import",
192
192
  "forms.import": "Import",
193
- "forms.import-error": "Could not import the form."
193
+ "forms.import-error": "Could not import the form.",
194
+ "form-picker.label": "HubSpot form",
195
+ "form-picker.description": "A form built in the HubSpot form builder, stored by slug",
196
+ "form-picker.loading": "Loading the forms…",
197
+ "form-picker.placeholder": "Choose a form…",
198
+ "form-picker.fallback": "Form slug",
199
+ "form-picker.orphan": "{slug} — unknown form",
200
+ "form-picker.draft": "{name} ({slug}) — draft, not served yet",
201
+ "forms.duplicate": "Duplicate",
202
+ "forms.duplicate-error": "Could not duplicate the form.",
203
+ "panel.icon": "Icon",
204
+ "panel.persist": "Answer memory",
205
+ "panel.persist-session": "This visit only",
206
+ "panel.persist-days30": "30 days (non-identifying fields only)",
207
+ "panel.class": "CSS classes"
194
208
  };
195
209
  export {
196
210
  en as default
@@ -94,8 +94,8 @@ const fr = {
94
94
  "forms.col-structure": "Structure",
95
95
  "forms.col-status": "Statut",
96
96
  "forms.col-updated": "Modifié",
97
- "forms.col-actions": "",
98
- "forms.structure": "{steps} étapes · {fields} champs",
97
+ "forms.col-actions": "Actions",
98
+ "forms.structure": "{steps, plural, one {# étape} other {# étapes}} · {fields, plural, one {# champ} other {# champs}}",
99
99
  "forms.published": "Publié",
100
100
  "forms.draft": "Brouillon",
101
101
  "forms.delete": "Supprimer",
@@ -192,6 +192,20 @@ const fr = {
192
192
  "forms.import-hint": "Convertit un formulaire du content type historique (toutes locales) en brouillon ici — même slug, source intacte. Ré-importer écrase le brouillon.",
193
193
  "forms.import-source": "Formulaire à importer",
194
194
  "forms.import": "Importer",
195
- "forms.import-error": "Impossible d'importer le formulaire."
195
+ "forms.import-error": "Impossible d'importer le formulaire.",
196
+ "form-picker.label": "Formulaire HubSpot",
197
+ "form-picker.description": "Un formulaire construit dans le form builder HubSpot, stocké par slug",
198
+ "form-picker.loading": "Chargement des formulaires…",
199
+ "form-picker.placeholder": "Choisir un formulaire…",
200
+ "form-picker.fallback": "Slug du formulaire",
201
+ "form-picker.orphan": "{slug} — formulaire inconnu",
202
+ "form-picker.draft": "{name} ({slug}) — brouillon, pas encore servi",
203
+ "forms.duplicate": "Dupliquer",
204
+ "forms.duplicate-error": "Impossible de dupliquer le formulaire.",
205
+ "panel.icon": "Icône",
206
+ "panel.persist": "Mémoire de la réponse",
207
+ "panel.persist-session": "Cette visite seulement",
208
+ "panel.persist-days30": "30 jours (champs non identifiants uniquement)",
209
+ "panel.class": "Classes CSS"
196
210
  };
197
211
  exports.default = fr;
@@ -92,8 +92,8 @@ const fr = {
92
92
  "forms.col-structure": "Structure",
93
93
  "forms.col-status": "Statut",
94
94
  "forms.col-updated": "Modifié",
95
- "forms.col-actions": "",
96
- "forms.structure": "{steps} étapes · {fields} champs",
95
+ "forms.col-actions": "Actions",
96
+ "forms.structure": "{steps, plural, one {# étape} other {# étapes}} · {fields, plural, one {# champ} other {# champs}}",
97
97
  "forms.published": "Publié",
98
98
  "forms.draft": "Brouillon",
99
99
  "forms.delete": "Supprimer",
@@ -190,7 +190,21 @@ const fr = {
190
190
  "forms.import-hint": "Convertit un formulaire du content type historique (toutes locales) en brouillon ici — même slug, source intacte. Ré-importer écrase le brouillon.",
191
191
  "forms.import-source": "Formulaire à importer",
192
192
  "forms.import": "Importer",
193
- "forms.import-error": "Impossible d'importer le formulaire."
193
+ "forms.import-error": "Impossible d'importer le formulaire.",
194
+ "form-picker.label": "Formulaire HubSpot",
195
+ "form-picker.description": "Un formulaire construit dans le form builder HubSpot, stocké par slug",
196
+ "form-picker.loading": "Chargement des formulaires…",
197
+ "form-picker.placeholder": "Choisir un formulaire…",
198
+ "form-picker.fallback": "Slug du formulaire",
199
+ "form-picker.orphan": "{slug} — formulaire inconnu",
200
+ "form-picker.draft": "{name} ({slug}) — brouillon, pas encore servi",
201
+ "forms.duplicate": "Dupliquer",
202
+ "forms.duplicate-error": "Impossible de dupliquer le formulaire.",
203
+ "panel.icon": "Icône",
204
+ "panel.persist": "Mémoire de la réponse",
205
+ "panel.persist-session": "Cette visite seulement",
206
+ "panel.persist-days30": "30 jours (champs non identifiants uniquement)",
207
+ "panel.class": "Classes CSS"
194
208
  };
195
209
  export {
196
210
  fr as default
@@ -1,5 +1,4 @@
1
1
  import * as React from "react";
2
- import { g as getTranslation } from "./index-foVSGFWb.mjs";
3
2
  var __assign = function() {
4
3
  __assign = Object.assign || function __assign2(t) {
5
4
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -407,19 +406,6 @@ createFormattedComponent("formatList");
407
406
  createFormattedComponent("formatDisplayName");
408
407
  createFormattedDateTimePartsComponent("formatDate");
409
408
  createFormattedDateTimePartsComponent("formatTime");
410
- const STANDARD = /* @__PURE__ */ new Set([
411
- "contact",
412
- "company",
413
- "deal",
414
- "ticket",
415
- "product",
416
- "line_item",
417
- "quote"
418
- ]);
419
- function objectLabel(intl, object) {
420
- return STANDARD.has(object) ? intl.formatMessage({ id: getTranslation(`objects.${object}`), defaultMessage: object }) : object;
421
- }
422
409
  export {
423
- objectLabel as o,
424
410
  useIntl as u
425
411
  };