web-app/lib/wrapperStore

Browser-local "wrapper" presets: a named pair of DPL snippets — a START and an END — that frame the prompt (the v3 root layer = open + middle + close). Stored in localStorage only, the no-server equivalent of a saved wrapper. See notes/plans/v3-layers.md.

Description:
  • Browser-local "wrapper" presets: a named pair of DPL snippets — a START and an END — that frame the prompt (the v3 root layer = open + middle + close). Stored in localStorage only, the no-server equivalent of a saved wrapper. See notes/plans/v3-layers.md.

Source:

Methods

(static) getDefaultWrapper() → {Object}

Description:
  • The live "Default" wrapper: the user-editable copy of the seed. It behaves like a preset you can't delete — if its backing entry is missing (never edited, or reset), it is the seed.

Source:
Returns:

The live default.

Type
Object

(static) getWrappers() → {object}

Source:
Returns:

All wrapper presets ({ name: { start, end } }).

Type
object

(static) removeWrapper(name)

Source:
Parameters:
Name Type Description
name string

The preset to remove. @returns {void}

(static) renameWrapper(from, to) → {void}

Description:
  • Rename a wrapper preset (no-op if from is missing or to is blank).

Source:
Parameters:
Name Type Description
from string

The current name.

to string

The new name.

Returns:
Type
void

(static) resetDefaultWrapper() → {void}

Description:
  • Reset the Default wrapper back to the hard-coded seed (drops the local edit).

Source:
Returns:
Type
void

(static) saveDefaultWrapper(value) → {void}

Description:
  • Persist edits to the live Default wrapper (kept local; never overwritten unless reset).

Source:
Parameters:
Name Type Description
value Object

The edited start/end.

Returns:
Type
void

(static) saveWrapper(name, value) → {void}

Description:
  • Save (or overwrite) a wrapper preset.

Source:
Parameters:
Name Type Description
name string

The preset name.

value Object

The start/end snippets.

Returns:
Type
void

(inner) read() → {object}

Source:
Returns:

The wrapper presets ({ name: { start, end } }).

Type
object

(inner) write(obj)

Source:
Parameters:
Name Type Description
obj object

The presets to persist. @returns {void}