eddev 0.3.25 → 0.3.27

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.
@@ -13,6 +13,8 @@ declare type PropTypes<T extends ElementType> = {
13
13
  defaultValue?: string;
14
14
  /** Append a new block when the user hits 'Enter' */
15
15
  appendOnEnter?: boolean;
16
+ /** Placeholder text, shown in the editor only */
17
+ placeholder?: string;
16
18
  } & ComponentPropsWithoutRef<T>;
17
19
  export declare function EditableText<T extends ElementType>({ id, as, appendOnEnter, ...props }: PropTypes<T>): import("react/jsx-runtime").JSX.Element | null;
18
20
  declare type AppenderConfig = {
@@ -167,7 +167,7 @@ function beginWork(opts) {
167
167
  });
168
168
  }); };
169
169
  // Create RPC/API types
170
- (0, promises_1.writeFile)(Path.join(opts.baseDirectory, "types.api.ts"), "\n import type { router, createContext } from \"./apis/_rpc\"\n import { createReactQueryHooks } from \"@trpc/react\"\n export {}\n \n const createQueryHooks = process.rpcEnabled ? () => createReactQueryHooks<typeof router>() : null\n \n declare global {\n type RPCUse = ReturnType<typeof createQueryHooks>\n type RPCRouter = typeof router\n type RPCContextType = Awaited<ReturnType<typeof createContext>>\n type RPCClient = ReturnType<RPCUse[\"createClient\"]>\n type RPCUseQuery = RPCUse[\"useQuery\"]\n type RPCUseMutation = RPCUse[\"useMutation\"]\n type RPCUseInfiniteQuery = RPCUse[\"useInfiniteQuery\"]\n }\n\n declare global {\n namespace NodeJS {\n interface Process {\n // @ts-ignore\n browser: boolean\n dev: boolean\n admin: boolean\n serverless: boolean\n }\n }\n }\n \n ");
170
+ (0, promises_1.writeFile)(Path.join(opts.baseDirectory, "types.api.ts"), "\n import type { router, createContext } from \"./apis/_rpc\"\n import { createReactQueryHooks } from \"@trpc/react\"\n export {}\n \n const createQueryHooks = process.rpcEnabled ? () => createReactQueryHooks<typeof router>() : null\n \n declare global {\n type RPCUse = ReturnType<Exclude<typeof createQueryHooks, null>>\n type RPCRouter = typeof router\n type RPCContextType = Awaited<ReturnType<typeof createContext>>\n type RPCClient = ReturnType<RPCUse[\"createClient\"]>\n type RPCUseQuery = RPCUse[\"useQuery\"]\n type RPCUseMutation = RPCUse[\"useMutation\"]\n type RPCUseInfiniteQuery = RPCUse[\"useInfiniteQuery\"]\n }\n\n declare global {\n namespace NodeJS {\n interface Process {\n // @ts-ignore\n browser: boolean\n dev: boolean\n admin: boolean\n serverless: boolean\n rpcEnabled: boolean\n }\n }\n }\n \n ");
171
171
  regenerate = debounce(100, function () { return __awaiter(_this, void 0, void 0, function () {
172
172
  var startTime, hasChanged, err_1, documentSets, parseErrors, _loop_1, _a, _b, _i, key, generates, errors, _c, _d, _e, file, base, config, output, err_2;
173
173
  var _this = this;
@@ -152,6 +152,7 @@ function useGravityForm(opts) {
152
152
  dispatch({ type: "field", id: field.id, value: value });
153
153
  } }), optionsForField(field)), { showLabel: field.labelPlacement !== "hidden_label" })); });
154
154
  var _b = (0, react_2.useState)(null), submitter = _b[0], setSubmitter = _b[1];
155
+ console.log("form.fields", opts.form.fields);
155
156
  (0, react_1.useEffect)(function () {
156
157
  var cancelled = false;
157
158
  setSubmitter({
@@ -184,7 +185,7 @@ function useGravityForm(opts) {
184
185
  }
185
186
  exports.useGravityForm = useGravityForm;
186
187
  function prepareValuesPayload(form, state, data) {
187
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
188
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
188
189
  var _loop_1 = function (field) {
189
190
  var value = state.values[field.id];
190
191
  var key = "input_" + field.id;
@@ -195,23 +196,24 @@ function prepareValuesPayload(form, state, data) {
195
196
  }
196
197
  else if (field.type === "consent") {
197
198
  data.append("".concat(key, "_1"), value ? "1" : "");
198
- data.append("".concat(key, ".2"), (_a = field === null || field === void 0 ? void 0 : field.consentText) !== null && _a !== void 0 ? _a : "");
199
+ data.append("".concat(key, ".1"), value ? "1" : "");
200
+ data.append("".concat(key, ".2"), (_b = (_a = field === null || field === void 0 ? void 0 : field.consentText) !== null && _a !== void 0 ? _a : field === null || field === void 0 ? void 0 : field.checkboxLabel) !== null && _b !== void 0 ? _b : "");
199
201
  data.append("".concat(key, ".3"), "2");
200
202
  }
201
203
  else if (field.type === "name") {
202
- data.append("".concat(key, "_2"), (_b = value === null || value === void 0 ? void 0 : value.prefix) !== null && _b !== void 0 ? _b : "");
203
- data.append("".concat(key, "_3"), (_c = value === null || value === void 0 ? void 0 : value.first) !== null && _c !== void 0 ? _c : "");
204
- data.append("".concat(key, "_4"), (_d = value === null || value === void 0 ? void 0 : value.middle) !== null && _d !== void 0 ? _d : "");
205
- data.append("".concat(key, "_6"), (_e = value === null || value === void 0 ? void 0 : value.last) !== null && _e !== void 0 ? _e : "");
206
- data.append("".concat(key, "_8"), (_f = value === null || value === void 0 ? void 0 : value.suffix) !== null && _f !== void 0 ? _f : "");
204
+ data.append("".concat(key, "_2"), (_c = value === null || value === void 0 ? void 0 : value.prefix) !== null && _c !== void 0 ? _c : "");
205
+ data.append("".concat(key, "_3"), (_d = value === null || value === void 0 ? void 0 : value.first) !== null && _d !== void 0 ? _d : "");
206
+ data.append("".concat(key, "_4"), (_e = value === null || value === void 0 ? void 0 : value.middle) !== null && _e !== void 0 ? _e : "");
207
+ data.append("".concat(key, "_6"), (_f = value === null || value === void 0 ? void 0 : value.last) !== null && _f !== void 0 ? _f : "");
208
+ data.append("".concat(key, "_8"), (_g = value === null || value === void 0 ? void 0 : value.suffix) !== null && _g !== void 0 ? _g : "");
207
209
  }
208
210
  else if (field.type === "address") {
209
- data.append("".concat(key, "_1"), (_g = value === null || value === void 0 ? void 0 : value.address1) !== null && _g !== void 0 ? _g : "");
210
- data.append("".concat(key, "_2"), (_h = value === null || value === void 0 ? void 0 : value.address2) !== null && _h !== void 0 ? _h : "");
211
- data.append("".concat(key, "_3"), (_j = value === null || value === void 0 ? void 0 : value.city) !== null && _j !== void 0 ? _j : "");
212
- data.append("".concat(key, "_4"), (_k = value === null || value === void 0 ? void 0 : value.state) !== null && _k !== void 0 ? _k : "");
213
- data.append("".concat(key, "_5"), (_l = value === null || value === void 0 ? void 0 : value.zip) !== null && _l !== void 0 ? _l : "");
214
- data.append("".concat(key, "_6"), (_m = value === null || value === void 0 ? void 0 : value.country) !== null && _m !== void 0 ? _m : "");
211
+ data.append("".concat(key, "_1"), (_h = value === null || value === void 0 ? void 0 : value.address1) !== null && _h !== void 0 ? _h : "");
212
+ data.append("".concat(key, "_2"), (_j = value === null || value === void 0 ? void 0 : value.address2) !== null && _j !== void 0 ? _j : "");
213
+ data.append("".concat(key, "_3"), (_k = value === null || value === void 0 ? void 0 : value.city) !== null && _k !== void 0 ? _k : "");
214
+ data.append("".concat(key, "_4"), (_l = value === null || value === void 0 ? void 0 : value.state) !== null && _l !== void 0 ? _l : "");
215
+ data.append("".concat(key, "_5"), (_m = value === null || value === void 0 ? void 0 : value.zip) !== null && _m !== void 0 ? _m : "");
216
+ data.append("".concat(key, "_6"), (_o = value === null || value === void 0 ? void 0 : value.country) !== null && _o !== void 0 ? _o : "");
215
217
  }
216
218
  else if (field.type === "captcha") {
217
219
  data.append("g-recaptcha-response", value);
@@ -236,8 +238,8 @@ function prepareValuesPayload(form, state, data) {
236
238
  }
237
239
  }
238
240
  };
239
- for (var _i = 0, _o = form.fields; _i < _o.length; _i++) {
240
- var field = _o[_i];
241
+ for (var _i = 0, _p = form.fields; _i < _p.length; _i++) {
242
+ var field = _p[_i];
241
243
  _loop_1(field);
242
244
  }
243
245
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "0.3.25",
3
+ "version": "0.3.27",
4
4
  "main": "./index.js",
5
5
  "license": "MIT",
6
6
  "bin": {