Space Configuration

Each user has a set of space configurations (tabs). They can name these tabs and the url configuration will be as follows: nounspace.com/s/[username]/[tab name] The default name of the starting space will be "My Space" If someone accesses just the user, the default tab shown will be the first in the list - the user can rearrange the order of the tabs at will.

Configs consist of:

  • Unique ID (tab name)

  • List of Fidgets + Fidget Locations

  • Editable Boolean (authentication set at the page level)

    • Spaces will have an edit mode which is enabled by the 'Editable' variable.

Space Config:

type FidgetInstanceConfig = {
  editable: boolean;
  // Both size and settings type values are actually constrained
  // by the related FidgetEditConfig
  size: {
    height: NumericRange<1,36>;
    width: NumericRange<1,36>;
  };
  // Settings are the Fidget specific config
  settings: {
    [key: string]: any;
  };
}

type FidgetFieldConfig = {
  readonly fieldName: string;
  readonly validator?: (value) => boolean;
  // InputSelectorComponent is any component in the valid
  // set of allowed input types
  readonly inputSelector: InputSelectorComponent;
  readonly default?: any;
  readonly required: boolean;
}

type FidgetEditConfig = {
  fields: FidgetFieldConfig[];
  size: {
    // NumericRange is a helper type that generates a set of valid
    // values in the range inclusive on both ends
    minHeight: NumericRange<1,36>;
    maxHeight: NumericRange<1,36>;
    minWidth: NumericRange<1,36>;
    maxWidth: NumericRange<1,36>;
  }
}

type FigdgetConfig = {
  editConfig: FidgetEditConfig;
  instanceConfig: FidgetInstanceConfig;
}

type LayoutConfig = {
  [key: FidgetID]: {
    x: NumericRange<1,36>;
    y: NumericRange<1,36>;
  };
}

type FidgetId = string;

type SpaceConfig = {
  readonly ID: FidgetID;
  fidgetConfig: FidgetConfig[];
  layout: LayoutConfig;
  editable: boolean;
}

Last updated