pageBuilderData = async (req, context) => {
  const views = await View.find();
  const pages = await Page.find();
  const page_groups = (await PageGroup.find()).map((g) => ({ name: g.name }));
  const images = await File.find({ mime_super: "image" });
  images.forEach((im) => (im.location = im.path_to_serve));
  const roles = await User.get_roles();
  const stateActions = getState().actions;
  const actions = [
    "GoBack",
    ...Object.entries(stateActions)
      .filter(([k, v]) => !v.requireRow && !v.disableInBuilder)
      .map(([k, v]) => k),
  ];
  const triggers = await Trigger.find({
    when_trigger: { or: ["API call", "Never"] },
  });
  triggers.forEach((tr) => {
    actions.push(tr.name);
  });
  const actionConfigForms = {};
  for (const name of actions) {
    const action = stateActions[name];
    if (action && action.configFields) {
      actionConfigForms[name] = await getActionConfigFields(action, null, {
        mode: "page",
        req,
      });
    }
  }
  const actionsNotRequiringRow = Trigger.action_options({
    notRequireRow: true,
    apiNeverTriggers: true,
    builtInLabel: "Page Actions",
    builtIns: ["GoBack"],
  });
  const library = (await Library.find({})).filter((l) => l.suitableFor("page"));
  const fixed_state_fields = {};
  for (const view of views) {
    fixed_state_fields[view.name] = [];
    const table = Table.findOne(view.table_id || view.exttable_name);
    if (table) view.table_name = table.name;
    const fs = await view.get_state_fields();
    for (const frec of fs) {
      const f = new Field(frec);
      if (f.input_type === "hidden") continue;
      if (f.name === "_fts") continue;

      f.required = false;
      if (f.type && f.type.name === "Bool") f.fieldview = "tristate";

      //await f.fill_fkey_options(true);
      fixed_state_fields[view.name].push(f);
      if (table.name === "users" && f.primary_key)
        fixed_state_fields[view.name].push(
          new Field({
            name: "preset_" + f.name,
            label: req.__("Preset %s", f.label),
            type: "String",
            attributes: { options: ["LoggedIn"] },
          })
        );
      if (f.presets) {
        fixed_state_fields[view.name].push(
          new Field({
            name: "preset_" + f.name,
            label: req.__("Preset %s", f.label),
            type: "String",
            attributes: { options: Object.keys(f.presets) },
          })
        );
      }
    }
  }

  //console.log(fixed_state_fields.ListTasks);
  const icons = getState().icons;
  return {
    views: views.map((v) => v.select_option),
    images,
    pages,
    page_groups,
    actions: actionsNotRequiringRow,
    builtInActions: ["GoBack"],
    library,
    min_role: context.min_role,
    actionConfigForms,
    allowMultiStepAction: true,
    page_name: context.name,
    page_id: context.id,
    mode: "page",
    roles,
    icons,
    fixed_state_fields,
    next_button_label: "Done",
    fonts: getState().fonts,
    tables: [],
    keyframes: getState().keyframes,
  };
}
@param {object} req
@param {object} context
@returns {Promise<object>}