@dosgato/templating
Advanced tools
Comparing version 0.0.133 to 0.0.134
@@ -133,2 +133,34 @@ import type { ComponentData, PageData } from './component.js'; | ||
} | ||
export interface BaseEvent { | ||
/** The larger UI area the user is interacting with that the event is emitted from. | ||
* @example 'ActionPanel', 'PageEditor', 'ComponentDialog' */ | ||
eventType: string; | ||
/** The specific action the user took. Typically the label for the element that emits | ||
* the event. | ||
* @example 'Add Page', 'Edit Page', 'Preview', 'Cancel Preview' */ | ||
action: string; | ||
/** Additional data points specific to a particular event type's context. These should | ||
* be significant enough to understanding the event to merrit adding additional columns | ||
* in tools like elastic-search. | ||
* @warning This is NOT a catch-all property. | ||
* @example { hiddenLabel: action.hiddenLabel } // The aria label for an action element. */ | ||
additionalProperties?: Record<string, string | undefined>; | ||
} | ||
/** Events triggered by user interactions with interface elements in DosGato. This interface | ||
* is intended to provide a common model for succinctly expressing the contextually important | ||
* properties of these events to loggers that can be pointed to analytics and metrics services. */ | ||
export interface UserEvent extends BaseEvent { | ||
/** The page, screen, or dialog the user is looking at in which the associated event emitter is | ||
* in context to. | ||
* @example '/pages', '/pages/[id]', '/pages/[id]/dialog' */ | ||
screen: string; | ||
/** The target the emitted event is to trigger actions on. | ||
* Each page/screen, or dialog, needs to set their target for what events in it are targeted | ||
* to act on in in its context. | ||
* | ||
* For example: The page in the page tree of the Pages screen that ActionPanel actions, | ||
* such as edit or preview, will act on. | ||
* @example '/site3-sandbox/about' */ | ||
target: string; | ||
} | ||
/** | ||
@@ -144,3 +176,3 @@ * A type for the config object that should be exported from a CMS instance's admin/local/index.js | ||
* to our SSO login page. Since we use sveltekit we redirect by throwing: | ||
* `throw redirect(302, 'my.sso.org/login')` | ||
* `throw redirect(302, 'https://my.sso.org/login')` | ||
*/ | ||
@@ -185,3 +217,3 @@ handleUnauthorized: (environmentConfig: any) => void; | ||
* | ||
* Since we use sveltekit, you trigger navigation with `goto('my.sso.org/logout')` | ||
* Since we use sveltekit, you trigger navigation with `goto('https://my.sso.org/logout')` | ||
*/ | ||
@@ -200,3 +232,8 @@ logout?: (environmentConfig: any, token: string) => void; | ||
tracing?: TracingInterface; | ||
/** Non-Awaited async call for logging interface interactions if defined. | ||
* Useful for defining how to log form submissions, interaction clicks, page edits, or state | ||
* changes of different interfaces. Can be directed to separate endpoint for APM logging as | ||
* long as that POST is also non-awaited. */ | ||
uiInteractionsLogger?: (info: UserEvent, environmentConfig: any) => void; | ||
} | ||
export {}; |
{ | ||
"name": "@dosgato/templating", | ||
"version": "0.0.133", | ||
"version": "0.0.134", | ||
"description": "A library to support building templates for dosgato CMS.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108061
2353