@walkeros/storybook-addon 4.8.0 → 4.8.1-next-1792019907609
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.
- package/CHANGELOG.md +12 -0
- package/dist/manager.js.map +1 -1
- package/dist/preview.cjs.map +1 -1
- package/dist/preview.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @walkeros/storybook-addon
|
|
2
2
|
|
|
3
|
+
## 4.8.1-next-1792019907609
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [7df8a2e]
|
|
8
|
+
- Updated dependencies [1062e99]
|
|
9
|
+
- Updated dependencies [7df8a2e]
|
|
10
|
+
- @walkeros/collector@4.8.1-next-1792019907609
|
|
11
|
+
- @walkeros/core@4.8.1-next-1792019907609
|
|
12
|
+
- @walkeros/web-source-browser@4.8.1-next-1792019907609
|
|
13
|
+
- @walkeros/web-core@4.8.1-next-1792019907609
|
|
14
|
+
|
|
3
15
|
## 4.8.0
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/manager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/constants.ts","../src/components/List.tsx","../../explorer/src/design/index.ts","../src/utils/eventColors.ts","../src/components/HighlightButtons.tsx","../src/components/origin-chip.ts","../src/components/AttributeTreeView.tsx","../src/utils/eventPreview.ts","../src/utils/formatEventTitle.tsx","../src/components/Panel.tsx","../src/manager.tsx"],"names":["ADDON_ID","PANEL_ID","EVENTS","ListWrapper","styled","theme","Wrapper","Icon","ArrowDownIcon","HeaderBar","Description","ListItem","memo","item","isOpen","onToggle","useState","React","Fragment","List","items","idx","vizBg","eventEntity","eventAction","eventProperty","eventContext","eventGlobals","highlightColors","attributeColors","BUTTONS","HighlightButtons","highlights","toggleHighlight","useTheme","kind","label","active","color","Button","originLabel","origin","formatValueForBadge","value","keys","AttributeBadge","type","suffix","base","displayText","suffixNode","AttributeNodeComponent","node","depth","_a","_b","expanded","setExpanded","showDetails","setShowDetails","hasAttributes","hasChildren","p","SyntaxHighlighter","child","index","AttributeTreeView","tree","createEventDataPreview","event","sections","formatValue","v","formatSection","obj","sectionName","entries","key","dataSection","contextSection","formatEventTitle","dataPreview","eventNumber","eventName","baseTitle","Panel","props","api","useStorybookApi","parameters","config","setHighlights","events","setState","liveEvents","setLiveEvents","skeleton","setSkeleton","newHighlights","emit","useChannel","newEvents","prev","result","updateEvents","useCallback","updateAttributes","useEffect","storyEvents","CURRENT_STORY_WAS_SET","SELECT_STORY","STORY_RENDERED","STORY_ARGS_UPDATED","updateAll","getEventTitle","getLiveEventTitle","clearLiveEvents","getSkeletonTitle","count","nodes","total","n","AddonPanel","TabsState","Placeholder","addons","types","viewMode"],"mappings":"ocAAO,IAAMA,CAAAA,CAAW,UAAA,CACXC,CAAAA,CAAW,CAAA,EAAGD,CAAQ,CAAA,MAAA,CAAA,CAG5B,IAAME,CAAAA,CAAS,CACpB,MAAA,CAAQ,CAAA,EAAGF,CAAQ,CAAA,OAAA,CAAA,CACnB,QAAS,CAAA,EAAGA,CAAQ,CAAA,QAAA,CAAA,CACpB,SAAA,CAAW,CAAA,EAAGA,CAAQ,CAAA,UAAA,CAAA,CACtB,UAAA,CAAY,GAAGA,CAAQ,CAAA,WAAA,CAAA,CACvB,iBAAA,CAAmB,CAAA,EAAGA,CAAQ,CAAA,kBAAA,CAAA,CAC9B,kBAAA,CAAoB,CAAA,EAAGA,CAAQ,CAAA,mBAAA,CACjC,CAAA,CCMA,IAAMG,EAAAA,CAAcC,MAAAA,CAAO,EAAA,CAAG,CAAC,CAAE,KAAA,CAAAC,CAAM,CAAA,IAAO,CAC5C,SAAA,CAAW,MAAA,CACX,QAAA,CAAUA,CAAAA,CAAM,UAAA,CAAW,IAAA,CAAK,GAChC,OAAA,CAAS,CAAA,CACT,MAAA,CAAQ,CACV,CAAA,CAA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AA,CAAA+H,CAAS,IAAMA,CAAAA,GAAa,OAAA,CACtC,MAAA,CAAQ,CAAC,CAAE,MAAA,CAAA1F,CAAO,CAAA,GAAMpB,EAAA,aAAA,CAACoE,EAAAA,CAAA,CAAM,MAAA,CAAQ,CAAC,CAAChD,CAAAA,CAAQ,CACnD,CAAC,EACH,CAAC,CAAA","file":"manager.js","sourcesContent":["export const ADDON_ID = 'walkerOS';\nexport const PANEL_ID = `${ADDON_ID}/panel`;\nexport const KEY = `walkerOS`;\n\nexport const EVENTS = {\n RESULT: `${ADDON_ID}/result`,\n REQUEST: `${ADDON_ID}/request`,\n HIGHLIGHT: `${ADDON_ID}/highlight`,\n LIVE_EVENT: `${ADDON_ID}/live-event`,\n ATTRIBUTES_RESULT: `${ADDON_ID}/attributes-result`,\n ATTRIBUTES_REQUEST: `${ADDON_ID}/attributes-request`,\n};\n","import { ArrowDownIcon } from '@storybook/icons';\nimport React, { Fragment, useState, memo } from 'react';\nimport { styled } from 'storybook/theming';\n\ntype Item = {\n title: string | React.ReactNode;\n content: string | React.ReactNode;\n};\n\ninterface ListItemProps {\n item: Item;\n}\n\ninterface ListProps {\n items: Item[];\n}\n\nconst ListWrapper = styled.ul(({ theme }) => ({\n listStyle: 'none',\n fontSize: theme.typography.size.s2,\n padding: 0,\n margin: 0,\n}));\n\nconst Wrapper = styled.div(({ theme }) => ({\n display: 'flex',\n width: '100%',\n borderBottom: `1px solid ${theme.appBorderColor}`,\n '&:hover': {\n background: theme.background.hoverable,\n },\n}));\n\nconst Icon = styled(ArrowDownIcon)(({ theme }) => ({\n height: 10,\n width: 10,\n minWidth: 10,\n color: theme.color.mediumdark,\n marginRight: 10,\n alignSelf: 'center',\n display: 'inline-flex',\n}));\n\nconst HeaderBar = styled.div(({ theme }) => ({\n padding: '6px 12px',\n paddingLeft: 9,\n background: 'none',\n color: 'inherit',\n textAlign: 'left',\n cursor: 'pointer',\n borderLeft: '3px solid transparent',\n width: '100%',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n\n '&:focus': {\n outline: '0 none',\n borderLeft: `3px solid ${theme.color.secondary}`,\n },\n\n '& .event-base': {\n color: 'inherit',\n fontWeight: '500',\n },\n\n '& .event-separator': {\n color: theme.color.mediumdark,\n fontWeight: '300',\n },\n\n '& .event-preview': {\n color: theme.color.mediumdark,\n fontWeight: '400',\n },\n}));\n\nconst Description = styled.div(({ theme }) => ({\n padding: theme.layoutMargin,\n background: theme.background.content,\n fontFamily: theme.typography.fonts.mono,\n whiteSpace: 'pre-wrap',\n textAlign: 'left',\n}));\n\nexport const ListItem: React.FC<ListItemProps> = memo(({ item }) => {\n const [isOpen, onToggle] = useState(false);\n\n return (\n <Fragment>\n <Wrapper>\n <HeaderBar onClick={() => onToggle(!isOpen)} role=\"button\">\n <Icon\n style={{\n transform: `rotate(${isOpen ? 0 : -90}deg)`,\n }}\n />\n {item.title}\n </HeaderBar>\n </Wrapper>\n {isOpen ? <Description>{item.content}</Description> : null}\n </Fragment>\n );\n});\n\nexport const List: React.FC<ListProps> = memo(({ items }) => (\n <ListWrapper>\n {items.map((item, idx) => (\n <ListItem key={`${item.title}-${idx}`} item={item}></ListItem>\n ))}\n </ListWrapper>\n));\n","/* walkerOS design constants, generated from design/tokens.json by src/design/generate.ts. Edit the JSON and run the explorer build, never this file. */\n\nexport type Theme = 'dark' | 'light';\n\n/** Page background (hero, features, FAQ, closing CTA). Default ground for `fg`, `fg-2`, `link`. */\nexport const bg = { dark: \"#111827\", light: \"#ffffff\" } as const;\n\n/** Alternating section band (Why, More features, Plans) and footer. Switch between `bg` and `bg-2` to separate sections, always with a top `border` rule. */\nexport const bg2 = { dark: \"#151e2e\", light: \"#f6f7f9\" } as const;\n\n/** Cards, plan tiers, FAQ items, the install-command chip and secondary buttons. */\nexport const surface = { dark: \"#1a2232\", light: \"#ffffff\" } as const;\n\n/** Inline code background, icon-button hover. */\nexport const surface2 = { dark: \"#222b3c\", light: \"#f1f3f6\" } as const;\n\n/** Hairline for section rules, header underline, card and input outlines. Decorative only; it does not meet 3:1, so never rely on it alone to mark a control. */\nexport const border = { dark: \"#2f3a4d\", light: \"#e3e6eb\" } as const;\n\n/** Headings and body copy on `bg`, `bg-2`, `surface`, `surface-2` (14:1+ both themes). */\nexport const fg = { dark: \"#ffffff\", light: \"#111827\" } as const;\n\n/** Secondary copy: leads, card descriptions, list items, footer links. 5.5:1+ on every ground. */\nexport const fg2 = { dark: \"#9aa3b2\", light: \"#4b5563\" } as const;\n\n/** Tertiary text: tier labels, `$` prompt, FAQ `+`, copyright, input placeholders. 4.5:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes (dark 4.6:1+, light 4.7:1+). */\nexport const fg3 = { dark: \"#8c93a2\", light: \"#656d7a\" } as const;\n\n/** elbwalker blue. Primary button fill, check icons, highlight word in the H1, focus ring, announcement bar. Light theme: 2.4:1 on white — fine as a fill under `on-primary`, too faint for text or as the only marker (flagged, kept from source). */\nexport const primary = { dark: \"#01b5e2\", light: \"#01b5e2\" } as const;\n\n/** Text and icons on `primary` fills (6.9:1). Never put white on `primary` (2.4:1) — the current walkeros.io buttons do; the relaunch fixes it. */\nexport const onPrimary = { dark: \"#04222b\", light: \"#04222b\" } as const;\n\n/** Links, eyebrows, mono step numbers; `info` and the light `focus` ring use it. 4.5:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes (dark 6.0:1+, light 4.6:1+). Underline on hover only. */\nexport const link = { dark: \"#4fb3e0\", light: \"#0076a0\" } as const;\n\n/** Soft primary halo: hero radial glow and the 4px ring around the highlighted plan. */\nexport const glow = { dark: \"rgba(1, 181, 226, 0.16)\", light: \"rgba(1, 181, 226, 0.14)\" } as const;\n\n/** Code-block panel (Palenight family), both themes. */\nexport const codeBg = \"#292d3e\";\n\n/** Code-block title bar / tab strip. */\nexport const codeBar = \"#232636\";\n\n/** Code-block outline. */\nexport const codeBorder = \"#444a5e\";\n\n/** Default code text on `code-bg` (8:1). */\nexport const codeFg = \"#bfc7d5\";\n\n/** Product visualisation panel (tagging and mapping demos). Visualisations stay dark in both themes. */\nexport const vizBg = \"#1a2232\";\n\n/** Code pane inside a visualisation. */\nexport const vizCodeBg = \"#131c2b\";\n\n/** Outlines inside visualisations. */\nexport const vizBorder = \"#334055\";\n\n/** Primary text inside visualisations. */\nexport const vizFg = \"#e8eaf0\";\n\n/** Legend and meta text inside visualisations (5.4:1 on `viz-code-bg`). */\nexport const vizFg2 = \"#8e96aa\";\n\n/** Code comments and file kinds inside visualisations. */\nexport const vizComment = \"#6c7590\";\n\n/** Gutter line numbers. Decorative, below 3:1. */\nexport const vizLineNumber = \"#4a5165\";\n\n/** Raised surfaces inside visualisations: the rendered teaser card, table rules. */\nexport const vizSurface = \"#2b3649\";\n\n/** Syntax: HTML/JSX tag names in visualisation code (6:1+ on `viz-code-bg`). */\nexport const vizTag = \"#e38fd6\";\n\n/** Syntax: string values in visualisation code and JSON cells. */\nexport const vizString = \"#e5c07b\";\n\n/** Syntax: numbers and booleans in mapping code. */\nexport const vizNumber = \"#f78c6c\";\n\n/** Syntax: punctuation and plain code text; visualisation captions. */\nexport const vizPunct = \"#9aa3b8\";\n\n/** Event part: entity (e.g. `product`). Used for syntax highlight, legend chip and the highlighted DOM region in tagging demos. The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventEntity = { dark: \"#c5e478\", light: \"#537a01\" } as const;\n\n/** Event part: action (e.g. `view`, `add`). The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventAction = { dark: \"#c792ea\", light: \"#8c59ac\" } as const;\n\n/** Event part: entity property (`data-elb-product=\"name\"`). The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventProperty = { dark: \"#f0717f\", light: \"#be4456\" } as const;\n\n/** Event part: context. The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventContext = { dark: \"#f2a65a\", light: \"#a25f06\" } as const;\n\n/** Event part: globals. The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventGlobals = { dark: \"#7fc4ea\", light: \"#317699\" } as const;\n\n/** Tag kind: user (who the visitor is). Unlike the five event parts it has no light value: it sits only on dark grounds (`viz-bg`, legends, chips, mark layers) and always pairs with its word. 5.2:1 on `viz-bg`; kept apart from `event-property`, `event-action` and `danger`. */\nexport const eventUser = \"#e65fc4\";\n\n/** Tag kind: consent (consent states and requirements). Dark grounds only, always with its word. 10.7:1 on `viz-bg`. */\nexport const eventConsent = \"#cbd5e1\";\n\n/** Brand scale (walkeros.io docs). Light-theme badge and admonition background. */\nexport const elbwalker100 = \"#edfeff\";\n\n/** Brand scale. Admonition highlight (light). */\nexport const elbwalker200 = \"#abf8ff\";\n\n/** Brand scale. Admonition text (dark). */\nexport const elbwalker300 = \"#69ecfe\";\n\n/** Brand scale. */\nexport const elbwalker400 = \"#27dbfe\";\n\n/** Brand scale anchor = `primary`. Admonition border. */\nexport const elbwalker500 = \"#01b5e2\";\n\n/** Brand scale. Badge text (light), badge fill (dark). */\nexport const elbwalker700 = \"#015372\";\n\n/** Brand scale. Admonition background (dark). */\nexport const elbwalker800 = \"#00283a\";\n\n/** Brand scale, darkest step. */\nexport const elbwalker900 = \"#000203\";\n\n/** Borders that mark a control: input, select, checkbox and switch outlines, the 1px edge of menus, popovers and dialogs, scrollbar thumbs, flow edges. 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes; `border` stays decorative. */\nexport const borderStrong = { dark: \"#6b778d\", light: \"#818a9a\" } as const;\n\n/** Focus ring, 2px solid with a 3px offset, on every interactive element: `primary` in dark, `link` in light, where `primary` is 2.2:1. 3:1 or more on every ground. */\nexport const focus = { dark: \"#01b5e2\", light: \"#0076a0\" } as const;\n\n/** Scrim behind modals and drawers. The layer above it is `surface` with a 1px `border-strong` edge, never a shadow. */\nexport const backdrop = { dark: \"rgba(3, 7, 18, 0.72)\", light: \"rgba(17, 24, 39, 0.4)\" } as const;\n\n/** Errors, destructive actions and invalid fields, always with an icon and a word. Text at 4.5:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. Kept apart from every event and step colour, `event-property` included. */\nexport const danger = { dark: \"#ffa4ac\", light: \"#b91c1c\" } as const;\n\n/** Text and icons on a `danger` fill such as a destructive button (dark 8.6:1, light 6.5:1). */\nexport const onDanger = { dark: \"#450a0a\", light: \"#ffffff\" } as const;\n\n/** Success and healthy states, always with an icon and a word. Sits on the blue side of green, so it stays apart from `danger` with red-green colour blindness, and apart from every step and event colour. Text at 4.5:1 or more on every ground. */\nexport const success = { dark: \"#8cf9ff\", light: \"#07675d\" } as const;\n\n/** Warnings and states that need attention, always with an icon and a word. Kept apart from `step-transformer` and `event-context`. Text at 4.5:1 or more on every ground. */\nexport const warning = { dark: \"#cabb00\", light: \"#886000\" } as const;\n\n/** Neutral information, always with an icon and a word. The `link` colour in both themes. */\nexport const info = { dark: \"#4fb3e0\", light: \"#0076a0\" } as const;\n\n/** Tinted fill for danger banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const dangerBg = { dark: \"rgba(255, 164, 172, 0.16)\", light: \"rgba(185, 28, 28, 0.1)\" } as const;\n\n/** Tinted fill for success banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const successBg = { dark: \"rgba(140, 249, 255, 0.16)\", light: \"rgba(7, 103, 93, 0.1)\" } as const;\n\n/** Tinted fill for warning banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const warningBg = { dark: \"rgba(202, 187, 0, 0.16)\", light: \"rgba(136, 96, 0, 0.1)\" } as const;\n\n/** Tinted fill for information banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const infoBg = { dark: \"rgba(79, 179, 224, 0.16)\", light: \"rgba(0, 118, 160, 0.1)\" } as const;\n\n/** Flow step colour: sources. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepSource = { dark: \"#6ee7b7\", light: \"#428569\" } as const;\n\n/** Flow step colour: transformers. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepTransformer = { dark: \"#fcd34d\", light: \"#bb7000\" } as const;\n\n/** Flow step colour: the collector. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepCollector = { dark: \"#7dd3fc\", light: \"#0c529b\" } as const;\n\n/** Flow step colour: destinations. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepDestination = { dark: \"#c4b5fd\", light: \"#6d1fd8\" } as const;\n\n/** Flow step colour: stores. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepStore = { dark: \"#a5b4fc\", light: \"#4138c9\" } as const;\n\n/** Platform badge: web, always with the word; 3:1 or more on every ground. */\nexport const platformWeb = { dark: \"#0ea5e9\", light: \"#008ddd\" } as const;\n\n/** Platform badge: server, always with the word; 3:1 or more on every ground. */\nexport const platformServer = { dark: \"#8b5cf6\", light: \"#8043f6\" } as const;\n\n/** First chart series: `primary` in dark, `link` in light. Series take `chart-1` to `chart-6` in order; the six stay apart in normal vision and with red-green colour blindness, and reach 3:1 on every ground. Label every series. */\nexport const chart1 = { dark: \"#01b5e2\", light: \"#0076a0\" } as const;\n\n/** Second chart series (orange). */\nexport const chart2 = { dark: \"#e69f00\", light: \"#ce710c\" } as const;\n\n/** Third chart series (bluish green). */\nexport const chart3 = { dark: \"#009563\", light: \"#217b58\" } as const;\n\n/** Fourth chart series (vermilion). */\nexport const chart4 = { dark: \"#e0520a\", light: \"#d32f4d\" } as const;\n\n/** Fifth chart series (reddish purple). */\nexport const chart5 = { dark: \"#ff6fad\", light: \"#b87889\" } as const;\n\n/** Sixth chart series (yellow in dark, olive in light). */\nexport const chart6 = { dark: \"#f0e442\", light: \"#546800\" } as const;\n\n/** Human notes and comment pins over visualisations, tag plans and frames. Kept apart from every step and status colour; 3:1 or more on every ground. */\nexport const annotation = { dark: \"#22c55e\", light: \"#409116\" } as const;\n\n/** Editor syntax (Monaco, Shiki, Prism): comments, 4.6:1 on `code-bg`. */\nexport const syntaxComment = \"#8c94be\";\n\n/** Editor syntax (Monaco, Shiki, Prism): strings, attribute names and inserted text, 9.9:1 on `code-bg`. */\nexport const syntaxString = \"#c3e88d\";\n\n/** Editor syntax (Monaco, Shiki, Prism): numbers, 5.8:1 on `code-bg`. */\nexport const syntaxNumber = \"#f78c6c\";\n\n/** Editor syntax (Monaco, Shiki, Prism): booleans, null and constants, 4.6:1 on `code-bg`. */\nexport const syntaxConstant = \"#ff5d78\";\n\n/** Editor syntax (Monaco, Shiki, Prism): keywords and storage modifiers, 5.2:1 on `code-bg`. */\nexport const syntaxKeyword = \"#c084fc\";\n\n/** Editor syntax (Monaco, Shiki, Prism): functions and built-ins, 5.9:1 on `code-bg`. */\nexport const syntaxFunction = \"#82aaff\";\n\n/** Editor syntax (Monaco, Shiki, Prism): types and class names, 9.1:1 on `code-bg`. */\nexport const syntaxType = \"#ffcb6b\";\n\n/** Editor syntax (Monaco, Shiki, Prism): operators and regular expressions, 9.0:1 on `code-bg`. */\nexport const syntaxOperator = \"#89ddff\";\n\n/** Editor syntax (Monaco, Shiki, Prism): punctuation and delimiters, 5.7:1 on `code-bg`. */\nexport const syntaxPunct = \"#c792ea\";\n\n/** Editor syntax (Monaco, Shiki, Prism): tags, invalid and deleted tokens, 4.6:1 on `code-bg`. */\nexport const syntaxTag = \"#ff5d79\";\n\n/** Editor syntax (Monaco, Shiki, Prism): namespaces, 8.1:1 on `code-bg`. */\nexport const syntaxNamespace = \"#b2ccd6\";\n\n/** Editor gutter line numbers on `code-bg`. Decorative, below 3:1. */\nexport const codeLineNumber = \"#676e95\";\n\n/** Editor selection over `code-bg`; `code-fg` stays at 5.4:1 on it. */\nexport const codeSelection = \"#717cb450\";\n\n/** Inserted lines in diff views over `code-bg`; `code-fg` stays at 5.4:1. */\nexport const codeInsertedBg = \"#c3e88d26\";\n\n/** Deleted lines in diff views over `code-bg`; `code-fg` stays at 6.6:1. */\nexport const codeDeletedBg = \"#ff5d7926\";\n\n/** Font family `sans`. */\nexport const fontSans = \"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif\";\n\n/** Font family `mono`. */\nexport const fontMono = \"SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace\";\n\n/** Font family `viz`. */\nexport const fontViz = \"'Geist', system-ui, sans-serif\";\n\n/** Font family `viz-mono`. */\nexport const fontVizMono = \"'Geist Mono', monospace\";\n\n/** The one transition duration. Read it as var(--motion): reduced motion sets it to 0ms. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const motion = \"180ms\";\n\n/** The one transition easing, beside var(--motion). Read it as var(--ease). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const ease = \"cubic-bezier(0.2, 0, 0, 1)\";\n\n/** Type style `display`: Hero H1 only. Fluid: clamp(38px, 6vw, 64px), max 20ch, text-wrap balance. One phrase may take `primary`. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeDisplay = { size: \"64px\", lineHeight: 1.08, weight: 700, tracking: \"-0.025em\", family: fontSans } as const;\n\n/** Type style `heading-xl`: Large split-section heading (More features). clamp(28px, 3.6vw, 44px). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeHeadingXl = { size: \"44px\", lineHeight: 1.1, weight: 700, tracking: \"-0.025em\", family: fontSans } as const;\n\n/** Type style `heading-lg`: Section H2. clamp(28px, 3.6vw, 40px), text-wrap balance. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeHeadingLg = { size: \"40px\", lineHeight: 1.15, weight: 700, tracking: \"-0.02em\", family: fontSans } as const;\n\n/** Type style `heading-md`: Feature H2 beside its explainer. clamp(26px, 3.2vw, 36px). Also the docs page title (h1), not fluid. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeHeadingMd = { size: \"36px\", lineHeight: 1.15, weight: 700, tracking: \"-0.02em\", family: fontSans } as const;\n\n/** Type style `footer-statement`: The footer's one-line brand statement. clamp(24px, 3.2vw, 34px), max 22ch. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeFooterStatement = { size: \"34px\", lineHeight: 1.2, weight: 700, tracking: \"-0.02em\", family: fontSans } as const;\n\n/** Type style `kicker-lg`: Large coloured kicker above `heading-xl`, in `primary`. clamp(22px, 2.4vw, 28px). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeKickerLg = { size: \"28px\", lineHeight: 1.2, weight: 700, tracking: \"-0.01em\", family: fontSans } as const;\n\n/** Type style `title-plan`: Plan tier name. Also docs h2. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeTitlePlan = { size: \"24px\", lineHeight: 1.3, weight: 700, tracking: \"-0.015em\", family: fontSans } as const;\n\n/** Type style `title-card`: Problem-card H3. Also docs h3; docs h4 takes its weight. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeTitleCard = { size: \"19px\", lineHeight: 1.35, weight: 600, family: fontSans } as const;\n\n/** Type style `title-item`: Feature-list H3. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeTitleItem = { size: \"18px\", lineHeight: 1.35, weight: 600, family: fontSans } as const;\n\n/** Type style `lead`: Hero sub-copy in `fg-2`, max 58ch. clamp(18px, 2vw, 21px). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeLead = { size: \"21px\", lineHeight: 1.65, weight: 400, family: fontSans } as const;\n\n/** Type style `body-lg`: Feature explainer paragraphs, FAQ questions (600). Also docs h4, at the `title-card` weight. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeBodyLg = { size: \"17px\", lineHeight: 1.65, weight: 400, family: fontSans } as const;\n\n/** Type style `body`: Default body copy, docs body copy included; buttons (600). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeBody = { size: \"16px\", lineHeight: 1.65, weight: 400, family: fontSans } as const;\n\n/** Type style `ui`: Nav links, list items, footer links. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeUi = { size: \"15px\", lineHeight: 1.5, weight: 500, family: fontSans } as const;\n\n/** Type style `small`: Announcement bar, `Docs →` links (500), copyright (400). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeSmall = { size: \"14px\", lineHeight: 1.5, weight: 600, family: fontSans } as const;\n\n/** Type style `eyebrow`: Section eyebrow, UPPERCASE, in `link`. One line that states the problem the section answers. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeEyebrow = { size: \"13px\", lineHeight: 1.5, weight: 600, tracking: \"0.12em\", family: fontSans } as const;\n\n/** Type style `label`: Plan tier label, UPPERCASE, in `fg-3` (`link` on the highlighted plan). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeLabel = { size: \"12px\", lineHeight: 1.5, weight: 700, tracking: \"0.12em\", family: fontSans } as const;\n\n/** Type style `code-command`: Install-command chip. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeCodeCommand = { size: \"15px\", lineHeight: 1.5, weight: 500, family: fontMono } as const;\n\n/** Type style `code-step`: Mono step numbers (01, 02, 03) in `link`. Also code panes: the explorer's code editors and docs code blocks. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeCodeStep = { size: \"13px\", lineHeight: 1.5, weight: 400, family: fontMono } as const;\n\n/** Type style `code-inline`: Inline code inside prose, docs inline code included: `surface-2` fill, `border` outline, radius-sm. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeCodeInline = { size: \"0.88em\", lineHeight: 1.5, weight: 400, family: fontMono } as const;\n\n/** Type style `viz-body`: Captions inside product visualisations (Geist). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizBody = { size: \"15px\", lineHeight: 1.5, weight: 400, family: fontViz } as const;\n\n/** Type style `viz-chip`: Step pills inside visualisations. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizChip = { size: \"13px\", lineHeight: 1.4, weight: 500, family: fontViz } as const;\n\n/** Type style `viz-code`: Code pane inside visualisations (Geist Mono). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizCode = { size: \"12px\", lineHeight: 1.8, weight: 400, family: fontVizMono } as const;\n\n/** Type style `viz-legend`: Event-part legend (Geist Mono) in `viz-fg-2`. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizLegend = { size: \"11px\", lineHeight: 1.5, weight: 400, family: fontVizMono } as const;\n\n/** Type style `product-heading`: Page and dialog titles in the app, the explorer and Tag Mode. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductHeading = { size: \"20px\", lineHeight: 1.3, weight: 600, family: fontSans } as const;\n\n/** Type style `product-title`: Panel, card and section titles in product UI. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductTitle = { size: \"16px\", lineHeight: 1.4, weight: 600, family: fontSans } as const;\n\n/** Type style `product-body`: Default product copy: body text, form fields, table cells, buttons (600). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductBody = { size: \"14px\", lineHeight: 1.5, weight: 400, family: fontSans } as const;\n\n/** Type style `product-small`: Secondary rows, help text and dense tables. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductSmall = { size: \"13px\", lineHeight: 1.45, weight: 400, family: fontSans } as const;\n\n/** Type style `product-caption`: Captions, badges and meta labels. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductCaption = { size: \"12px\", lineHeight: 1.4, weight: 500, family: fontSans } as const;\n\n/** Type style `product-micro`: Dense canvas labels only: node badges, edge labels, mark labels and compact tooltip meta. Never body copy, never interactive text. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductMicro = { size: \"11px\", lineHeight: 1.3, weight: 500, family: fontSans } as const;\n","import {\n eventAction,\n eventContext,\n eventEntity,\n eventGlobals,\n eventProperty,\n} from '@walkeros/explorer/design';\nimport type { WalkerOSAddon } from '../types';\n\nexport type HighlightKind = keyof NonNullable<WalkerOSAddon['highlights']>;\nexport type AttributeKind =\n | 'entity'\n | 'action'\n | 'context'\n | 'globals'\n | 'data';\n\n// Event colours of the walkerOS design system, their dark values: every use\n// pairs them with the dark visualisation ground vizBg.\nexport const highlightColors: Record<HighlightKind, string> = {\n globals: eventGlobals.dark,\n context: eventContext.dark,\n entity: eventEntity.dark,\n property: eventProperty.dark,\n action: eventAction.dark,\n};\n\n// Attribute badges name the property kind \"data\".\nexport const attributeColors: Record<AttributeKind, string> = {\n entity: highlightColors.entity,\n action: highlightColors.action,\n context: highlightColors.context,\n globals: highlightColors.globals,\n data: highlightColors.property,\n};\n","import type { WalkerOSAddon } from '../types';\nimport React from 'react';\nimport { Button } from 'storybook/internal/components';\nimport { useTheme } from 'storybook/theming';\nimport { vizBg } from '@walkeros/explorer/design';\nimport { highlightColors, type HighlightKind } from '../utils/eventColors';\n\ninterface HighlightButtonsProps {\n highlights: Record<HighlightKind, boolean>;\n toggleHighlight: (type: HighlightKind) => void;\n}\n\nconst BUTTONS: Array<{ kind: HighlightKind; label: string }> = [\n { kind: 'globals', label: 'Globals' },\n { kind: 'context', label: 'Context' },\n { kind: 'entity', label: 'Entity' },\n { kind: 'property', label: 'Property' },\n { kind: 'action', label: 'Action' },\n];\n\nexport const HighlightButtons: React.FC<HighlightButtonsProps> = ({\n highlights,\n toggleHighlight,\n}) => {\n const theme = useTheme();\n\n return (\n <div\n style={{\n display: 'flex',\n gap: '4px',\n alignItems: 'center',\n flexWrap: 'wrap',\n justifyContent: 'flex-end',\n }}\n >\n <span\n style={{\n fontSize: theme.typography.size.s1,\n color: theme.color.mediumdark,\n marginRight: '8px',\n }}\n >\n Highlight:\n </span>\n {BUTTONS.map(({ kind, label }) => {\n const active = highlights[kind];\n const color = highlightColors[kind];\n\n return (\n <Button\n key={kind}\n size=\"small\"\n variant={active ? 'solid' : 'outline'}\n onClick={() => toggleHighlight(kind)}\n style={{\n fontSize: theme.typography.size.s1,\n padding: '4px 8px',\n // Active: the event colour on the dark visualisation ground.\n backgroundColor: active ? vizBg : 'transparent',\n color: active ? color : theme.color.mediumdark,\n border: `1px solid ${active ? color : theme.color.border}`,\n }}\n >\n {label}\n </Button>\n );\n })}\n </div>\n );\n};\n","import type { PropertyOrigin } from '../types';\n\n// Human-readable origin label for non-default origins (empty for directly\n// declared data). Rendered as a thin \"(generic)\" / \"(scoped)\" suffix.\nexport const originLabel = (origin: PropertyOrigin): string =>\n origin === 'data' ? '' : origin;\n","import React, { useState } from 'react';\nimport { SyntaxHighlighter } from 'storybook/internal/components';\nimport { useTheme } from 'storybook/theming';\nimport type { AttributeNode, PropertyOrigin } from '../types';\nimport type { WalkerOS } from '@walkeros/core';\nimport { vizBg } from '@walkeros/explorer/design';\nimport { originLabel } from './origin-chip';\nimport { attributeColors, type AttributeKind } from '../utils/eventColors';\n\n// Utility to format complex values for display in badges\nconst formatValueForBadge = (value: unknown): string => {\n if (typeof value === 'string') return value;\n if (typeof value === 'number' || typeof value === 'boolean')\n return String(value);\n if (value === null || value === undefined) return '';\n if (typeof value === 'object') {\n if (Array.isArray(value)) {\n return value.length <= 3\n ? value.join(', ')\n : `${value.slice(0, 3).join(', ')}...`;\n }\n // For objects, show the actual keys instead of just the count\n const keys = Object.keys(value);\n if (keys.length === 0) return '';\n if (keys.length <= 3) {\n return keys.join(', ');\n }\n return `${keys.slice(0, 3).join(', ')}...`;\n }\n return String(value);\n};\n\ninterface AttributeTreeViewProps {\n tree: AttributeNode[];\n depth?: number;\n}\n\ninterface AttributeBadgeProps {\n type: AttributeKind;\n label: string;\n value?: string;\n origin?: PropertyOrigin;\n}\n\nconst AttributeBadge: React.FC<AttributeBadgeProps> = ({\n type,\n label,\n value,\n origin,\n}) => {\n const theme = useTheme();\n const suffix = origin ? originLabel(origin) : '';\n const base = value ? `${label}: ${value}` : label;\n const displayText = suffix ? `${base} (${suffix})` : base;\n\n // Thin, muted \"(generic)\" / \"(scoped)\" suffix appended after the value.\n const suffixNode = suffix ? (\n <span\n style={{\n fontSize: theme.typography.size.s1,\n fontWeight: 400,\n fontStyle: 'italic',\n opacity: 0.65,\n marginLeft: '4px',\n }}\n >\n ({suffix})\n </span>\n ) : null;\n\n return (\n <span\n style={{\n display: 'inline-block',\n padding: '2px 6px',\n margin: '0 4px',\n fontSize: theme.typography.size.s2,\n // A dark chip: event colours only sit on the dark visualisation ground.\n color: attributeColors[type],\n backgroundColor: vizBg,\n border: `1px solid ${attributeColors[type]}`,\n borderRadius: '3px',\n maxWidth: '240px',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }}\n title={displayText}\n >\n <span>\n {type === 'data' ? (\n value ? (\n <>\n <strong>{label}:</strong> {value}\n {suffixNode}\n </>\n ) : (\n <>\n <strong>{label}</strong>\n {suffixNode}\n </>\n )\n ) : (\n <>\n <strong>{type}:</strong> {displayText}\n </>\n )}\n </span>\n </span>\n );\n};\n\nconst AttributeNodeComponent: React.FC<{\n node: AttributeNode;\n depth: number;\n}> = ({ node, depth }) => {\n const [expanded, setExpanded] = useState(true);\n const [showDetails, setShowDetails] = useState(false);\n const theme = useTheme();\n\n const hasAttributes =\n node.attributes.entity ||\n node.attributes.action ||\n node.attributes.context ||\n node.attributes.globals ||\n node.attributes.properties?.length;\n\n const hasChildren = node.children.length > 0;\n\n return (\n <div\n style={{\n marginLeft: depth * 16,\n borderLeft: depth > 0 ? `1px solid ${theme.color.border}` : 'none',\n paddingLeft: depth > 0 ? '8px' : '0',\n }}\n >\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n padding: '4px 0',\n }}\n >\n {hasChildren ? (\n <span\n style={{\n marginRight: '8px',\n color: theme.color.mediumdark,\n cursor: 'pointer',\n userSelect: 'none',\n display: 'inline-block',\n width: '12px',\n textAlign: 'center',\n }}\n onClick={() => setExpanded(!expanded)}\n title={expanded ? 'Collapse' : 'Expand'}\n >\n {expanded ? '▼' : '▶'}\n </span>\n ) : (\n <span\n style={{\n marginRight: '8px',\n width: '12px',\n display: 'inline-block',\n }}\n />\n )}\n\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n flexWrap: 'wrap',\n rowGap: '4px',\n cursor: hasAttributes ? 'pointer' : 'default',\n flex: 1,\n minWidth: 0,\n }}\n onClick={\n hasAttributes ? () => setShowDetails(!showDetails) : undefined\n }\n >\n {node.attributes.entity && (\n <AttributeBadge type=\"entity\" label={node.attributes.entity} />\n )}\n\n {node.attributes.action && (\n <AttributeBadge type=\"action\" label={node.attributes.action} />\n )}\n\n {node.attributes.context &&\n Object.keys(node.attributes.context).length > 0 && (\n <AttributeBadge\n key=\"context\"\n type=\"context\"\n label={Object.keys(node.attributes.context).join(', ')}\n />\n )}\n\n {node.attributes.globals &&\n Object.keys(node.attributes.globals).length > 0 && (\n <AttributeBadge\n key=\"globals\"\n type=\"globals\"\n label={Object.keys(node.attributes.globals).join(', ')}\n />\n )}\n\n {node.attributes.properties\n ?.filter((p) => {\n if (\n typeof p.value === 'object' &&\n p.value !== null &&\n Object.keys(p.value).length === 0\n )\n return false;\n return (\n p.value !== null && p.value !== undefined && p.value !== ''\n );\n })\n .map((p) => (\n <AttributeBadge\n key={`data-${p.key}-${p.origin}`}\n type=\"data\"\n label={`data-${p.key}`}\n value={formatValueForBadge(p.value)}\n origin={p.origin}\n />\n ))}\n </div>\n </div>\n\n {showDetails && hasAttributes && node.htmlMarkup && (\n <div\n style={{ marginTop: '8px', marginBottom: '8px', textAlign: 'left' }}\n >\n <SyntaxHighlighter\n language=\"html\"\n copyable={true}\n bordered={true}\n padded={true}\n >\n {node.htmlMarkup}\n </SyntaxHighlighter>\n </div>\n )}\n\n {expanded && hasChildren && (\n <div>\n {node.children.map((child, index) => (\n <AttributeNodeComponent\n key={index}\n node={child}\n depth={depth + 1}\n />\n ))}\n </div>\n )}\n </div>\n );\n};\n\nexport const AttributeTreeView: React.FC<AttributeTreeViewProps> = ({\n tree,\n depth = 0,\n}) => {\n const theme = useTheme();\n\n if (tree.length === 0) {\n return (\n <div\n style={{\n color: theme.color.mediumdark,\n padding: '20px',\n }}\n >\n No walker attributes found\n <br />\n <small>\n Make sure your components have walker attributes like data-elb,\n data-elbaction, etc.\n </small>\n </div>\n );\n }\n\n return (\n <div>\n {tree.map((node, index) => (\n <AttributeNodeComponent key={index} node={node} depth={depth} />\n ))}\n </div>\n );\n};\n","import type { WalkerOS } from '@walkeros/core';\nimport type { Walker } from '@walkeros/web-core';\n\n/**\n * Creates a formatted data preview from a walkerOS event\n * Shows data and context properties in JSON-like syntax\n */\nexport function createEventDataPreview(\n event: WalkerOS.Event | Walker.Event,\n): string {\n const sections: string[] = [];\n\n // Helper to format value\n const formatValue = (value: unknown): string => {\n if (value === null || value === undefined) {\n return 'null';\n }\n if (typeof value === 'string') {\n return `\"${value}\"`;\n }\n if (Array.isArray(value)) {\n const items = value\n .map((v) => (typeof v === 'string' ? `\"${v}\"` : String(v)))\n .join(', ');\n return `[${items}]`;\n }\n if (typeof value === 'object') {\n return '{...}';\n }\n return String(value);\n };\n\n // Helper to format a section (data or context)\n const formatSection = (obj: unknown, sectionName: string): string | null => {\n if (\n !obj ||\n typeof obj !== 'object' ||\n obj === null ||\n Object.keys(obj as Record<string, unknown>).length === 0\n ) {\n return null;\n }\n\n const entries = Object.entries(obj as Record<string, unknown>)\n .map(([key, value]) => `${key}: ${formatValue(value)}`)\n .join(', ');\n\n return `${sectionName}: { ${entries} }`;\n };\n\n // Process data section first\n if (event.data) {\n const dataSection = formatSection(event.data, 'data');\n if (dataSection) {\n sections.push(dataSection);\n }\n }\n\n // Process context section second\n if (event.context) {\n const contextSection = formatSection(event.context, 'context');\n if (contextSection) {\n sections.push(contextSection);\n }\n }\n\n return sections.join('; ');\n}\n","import React from 'react';\nimport type { WalkerOS } from '@walkeros/core';\nimport type { Walker } from '@walkeros/web-core';\nimport { createEventDataPreview } from './eventPreview';\n\n/**\n * Formats an event title with consistent styling across Events and Live Events tabs\n */\nexport function formatEventTitle(\n event: WalkerOS.Event | Walker.Event,\n index: number,\n): React.ReactNode {\n const dataPreview = createEventDataPreview(event);\n\n // Build base title components\n const eventNumber = `#${index + 1}`;\n // Handle both WalkerOS.Event (has name property) and Walker.Event (has entity/action)\n const eventName =\n 'name' in event ? event.name : `${event.entity} ${event.action}`;\n\n // Construct base title\n const baseTitle = `${eventNumber} ${eventName}`;\n\n // Return styled JSX\n if (!dataPreview) {\n return <span className=\"event-base\">{baseTitle}</span>;\n }\n\n return (\n <>\n <span className=\"event-base\">{baseTitle}</span>\n <span className=\"event-separator\"> - </span>\n <span className=\"event-preview\">{dataPreview}</span>\n </>\n );\n}\n","import type { AttributeNode, ResolvedProperty } from '../types';\nimport type { WalkerOS } from '@walkeros/core';\nimport React, { Fragment, memo, useCallback, useEffect, useState } from 'react';\nimport {\n AddonPanel,\n Placeholder,\n TabsState,\n SyntaxHighlighter,\n Button,\n} from 'storybook/internal/components';\nimport { useChannel, useStorybookApi } from 'storybook/manager-api';\nimport { useTheme } from 'storybook/theming';\nimport {\n STORY_ARGS_UPDATED,\n CURRENT_STORY_WAS_SET,\n SELECT_STORY,\n STORY_RENDERED,\n} from 'storybook/internal/core-events';\n\nimport { ADDON_ID, EVENTS } from '../constants';\nimport { List } from './List';\nimport { HighlightButtons } from './HighlightButtons';\nimport { AttributeTreeView } from './AttributeTreeView';\nimport { formatEventTitle } from '../utils/formatEventTitle';\n\ninterface PanelProps {\n active: boolean;\n}\n\nexport const Panel: React.FC<PanelProps> = memo(function MyPanel(props) {\n const theme = useTheme();\n const api = useStorybookApi();\n const { parameters } = api.getCurrentStoryData() || {};\n\n const defaultConfig = {\n autoRefresh: true,\n prefix: 'data-elb',\n };\n\n const config = {\n ...defaultConfig,\n ...parameters?.[ADDON_ID],\n };\n\n // Highlights are now local state, not persistent config\n const [highlights, setHighlights] = useState({\n context: false,\n entity: false,\n property: false,\n action: false,\n globals: false,\n });\n\n const [events, setState] = useState<WalkerOS.Event[]>([]);\n const [liveEvents, setLiveEvents] = useState<WalkerOS.Event[]>([]);\n const [skeleton, setSkeleton] = useState<{\n nodes: AttributeNode[];\n globals: ResolvedProperty[];\n }>({ nodes: [], globals: [] });\n\n const toggleHighlight = (type: keyof typeof highlights) => {\n const newHighlights = {\n ...highlights,\n [type]: !highlights[type],\n };\n setHighlights(newHighlights);\n\n // Send highlighting update to preview with current config + highlights\n emit(EVENTS.HIGHLIGHT, { ...config, highlights: newHighlights });\n };\n\n // https://storybook.js.org/docs/react/addons/addons-api#usechannel\n const emit = useChannel({\n [EVENTS.RESULT]: (newEvents: WalkerOS.Event[]) => {\n setState(newEvents);\n },\n [EVENTS.LIVE_EVENT]: (event: WalkerOS.Event) => {\n setLiveEvents((prev) =>\n [{ ...event, timestamp: Date.now() }].concat(prev).slice(0, 50),\n );\n },\n [EVENTS.ATTRIBUTES_RESULT]: (result: {\n nodes: AttributeNode[];\n globals: ResolvedProperty[];\n }) => {\n setSkeleton(result);\n },\n });\n\n const updateEvents = useCallback(() => {\n emit(EVENTS.REQUEST, { ...config, highlights });\n }, [config, highlights, emit]);\n\n const updateAttributes = useCallback(() => {\n emit(EVENTS.ATTRIBUTES_REQUEST, { ...config, highlights });\n }, [config, highlights, emit]);\n\n // Initial auto-refresh on page load\n useEffect(() => {\n if (config.autoRefresh) {\n updateEvents();\n updateAttributes();\n }\n }, []); // Only run once on mount\n\n // Auto-refresh on story navigation and args updates\n useEffect(() => {\n if (!config.autoRefresh) return;\n\n // Events to listen for\n const storyEvents = [\n CURRENT_STORY_WAS_SET,\n SELECT_STORY,\n STORY_RENDERED,\n STORY_ARGS_UPDATED,\n ];\n\n // Combined update function for events and attributes\n const updateAll = () => {\n updateEvents();\n updateAttributes();\n };\n\n // Listen for story navigation and control changes\n storyEvents.forEach((event) => api.on(event, updateAll));\n // Cleanup listeners on unmount\n return () => storyEvents.forEach((event) => api.off(event, updateAll));\n }, [api, updateEvents, updateAttributes, config.autoRefresh]);\n\n const getEventTitle = (events: WalkerOS.Event[]) =>\n `Events (${events.length})`;\n\n const getLiveEventTitle = () => `Live Events (${liveEvents.length})`;\n\n const clearLiveEvents = () => {\n setLiveEvents([]);\n };\n\n const formatTime = (timestamp: number) => {\n return new Date(timestamp).toLocaleTimeString();\n };\n\n const getSkeletonTitle = () => {\n const count = (nodes: AttributeNode[]): number =>\n nodes.reduce((total, node) => {\n let n = 0;\n if (node.attributes.entity) n++;\n if (node.attributes.action) n++;\n if (\n node.attributes.context &&\n Object.keys(node.attributes.context).length\n )\n n++;\n if (\n node.attributes.globals &&\n Object.keys(node.attributes.globals).length\n )\n n++;\n n += node.attributes.properties?.length ?? 0;\n return total + n + count(node.children || []);\n }, 0);\n return `Skeleton (${count(skeleton.nodes)})`;\n };\n\n return (\n <AddonPanel {...props}>\n <TabsState\n initial=\"live\"\n backgroundColor={theme.background.hoverable as string}\n >\n <div id=\"events\" title={getEventTitle(events)}>\n <Placeholder>\n <Fragment>\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n flexWrap: 'wrap',\n gap: '8px',\n marginBottom: '12px',\n padding: '8px',\n backgroundColor: theme.background.app,\n borderRadius: '4px',\n border: `1px solid ${theme.color.border}`,\n }}\n >\n <Button onClick={updateEvents}>Update events</Button>\n <HighlightButtons\n highlights={highlights}\n toggleHighlight={toggleHighlight}\n />\n </div>\n </Fragment>\n {events.length > 0 ? (\n <List\n items={events.map((item, index) => {\n return {\n title: formatEventTitle(item, index),\n content: (\n <SyntaxHighlighter\n language=\"json\"\n copyable={true}\n bordered={true}\n padded={true}\n >\n {JSON.stringify(item, null, 2)}\n </SyntaxHighlighter>\n ),\n };\n })}\n />\n ) : (\n <p>No events yet</p>\n )}\n </Placeholder>\n </div>\n <div id=\"live\" title={getLiveEventTitle()}>\n <Placeholder>\n <Fragment>\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n flexWrap: 'wrap',\n gap: '8px',\n marginBottom: '12px',\n padding: '8px',\n backgroundColor: theme.background.app,\n borderRadius: '4px',\n border: `1px solid ${theme.color.border}`,\n }}\n >\n <div\n style={{ display: 'flex', gap: '8px', alignItems: 'center' }}\n >\n <Button size=\"small\" onClick={clearLiveEvents}>\n Clear Events\n </Button>\n </div>\n <HighlightButtons\n highlights={highlights}\n toggleHighlight={toggleHighlight}\n />\n </div>\n </Fragment>\n {liveEvents.length > 0 ? (\n <List\n items={liveEvents.map((event, index) => {\n return {\n title: formatEventTitle(\n event,\n liveEvents.length - index - 1,\n ),\n content: (\n <SyntaxHighlighter\n language=\"json\"\n copyable={true}\n bordered={true}\n padded={true}\n >\n {JSON.stringify(event, null, 2)}\n </SyntaxHighlighter>\n ),\n };\n })}\n />\n ) : (\n <p\n style={{\n textAlign: 'center',\n color: theme.color.mediumdark,\n padding: '20px',\n }}\n >\n Waiting for live events...\n <br />\n <small>\n Interact with components to see events appear here in\n real-time\n </small>\n </p>\n )}\n </Placeholder>\n </div>\n <div id=\"attributes\" title={getSkeletonTitle()}>\n <Placeholder>\n <Fragment>\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n flexWrap: 'wrap',\n gap: '8px',\n marginBottom: '12px',\n padding: '8px',\n backgroundColor: theme.background.app,\n borderRadius: '4px',\n border: `1px solid ${theme.color.border}`,\n }}\n >\n <Button onClick={updateAttributes}>Update skeleton</Button>\n <HighlightButtons\n highlights={highlights}\n toggleHighlight={toggleHighlight}\n />\n </div>\n </Fragment>\n <AttributeTreeView tree={skeleton.nodes} />\n </Placeholder>\n </div>\n </TabsState>\n </AddonPanel>\n );\n});\n","import React from 'react';\nimport { addons, types } from 'storybook/manager-api';\n\nimport { Panel } from './components/Panel';\nimport { ADDON_ID, PANEL_ID } from './constants';\n\n/**\n * Note: if you want to use JSX in this file, rename it to `manager.tsx`\n * and update the entry prop in tsup.config.ts to use \"src/manager.tsx\",\n */\n\naddons.register(ADDON_ID, (api) => {\n addons.add(PANEL_ID, {\n type: types.PANEL,\n title: ADDON_ID,\n match: ({ viewMode }) => viewMode === 'story',\n render: ({ active }) => <Panel active={!!active} />,\n });\n});\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/constants.ts","../src/components/List.tsx","../../explorer/src/design/index.ts","../src/utils/eventColors.ts","../src/components/HighlightButtons.tsx","../src/components/origin-chip.ts","../src/components/AttributeTreeView.tsx","../src/utils/eventPreview.ts","../src/utils/formatEventTitle.tsx","../src/components/Panel.tsx","../src/manager.tsx"],"names":["ADDON_ID","PANEL_ID","EVENTS","ListWrapper","styled","theme","Wrapper","Icon","ArrowDownIcon","HeaderBar","Description","ListItem","memo","item","isOpen","onToggle","useState","React","Fragment","List","items","idx","vizBg","eventEntity","eventAction","eventProperty","eventContext","eventGlobals","highlightColors","attributeColors","BUTTONS","HighlightButtons","highlights","toggleHighlight","useTheme","kind","label","active","color","Button","originLabel","origin","formatValueForBadge","value","keys","AttributeBadge","type","suffix","base","displayText","suffixNode","AttributeNodeComponent","node","depth","_a","_b","expanded","setExpanded","showDetails","setShowDetails","hasAttributes","hasChildren","p","SyntaxHighlighter","child","index","AttributeTreeView","tree","createEventDataPreview","event","sections","formatValue","v","formatSection","obj","sectionName","entries","key","dataSection","contextSection","formatEventTitle","dataPreview","eventNumber","eventName","baseTitle","Panel","props","api","useStorybookApi","parameters","config","setHighlights","events","setState","liveEvents","setLiveEvents","skeleton","setSkeleton","newHighlights","emit","useChannel","newEvents","prev","result","updateEvents","useCallback","updateAttributes","useEffect","storyEvents","CURRENT_STORY_WAS_SET","SELECT_STORY","STORY_RENDERED","STORY_ARGS_UPDATED","updateAll","getEventTitle","getLiveEventTitle","clearLiveEvents","getSkeletonTitle","count","nodes","total","n","AddonPanel","TabsState","Placeholder","addons","types","viewMode"],"mappings":"ocAAO,IAAMA,CAAAA,CAAW,UAAA,CACXC,CAAAA,CAAW,CAAA,EAAGD,CAAQ,CAAA,MAAA,CAAA,CAG5B,IAAME,CAAAA,CAAS,CACpB,MAAA,CAAQ,CAAA,EAAGF,CAAQ,CAAA,OAAA,CAAA,CACnB,QAAS,CAAA,EAAGA,CAAQ,CAAA,QAAA,CAAA,CACpB,SAAA,CAAW,CAAA,EAAGA,CAAQ,CAAA,UAAA,CAAA,CACtB,UAAA,CAAY,GAAGA,CAAQ,CAAA,WAAA,CAAA,CACvB,iBAAA,CAAmB,CAAA,EAAGA,CAAQ,CAAA,kBAAA,CAAA,CAC9B,kBAAA,CAAoB,CAAA,EAAGA,CAAQ,CAAA,mBAAA,CACjC,CAAA,CCMA,IAAMG,EAAAA,CAAcC,MAAAA,CAAO,EAAA,CAAG,CAAC,CAAE,KAAA,CAAAC,CAAM,CAAA,IAAO,CAC5C,SAAA,CAAW,MAAA,CACX,QAAA,CAAUA,CAAAA,CAAM,UAAA,CAAW,IAAA,CAAK,GAChC,OAAA,CAAS,CAAA,CACT,MAAA,CAAQ,CACV,CAAA,CAAE,CAAA,CAEIC,EAAAA,CAAUF,MAAAA,CAAO,IAAI,CAAC,CAAE,KAAA,CAAAC,CAAM,KAAO,CACzC,OAAA,CAAS,MAAA,CACT,KAAA,CAAO,OACP,YAAA,CAAc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CAAM,MAAA,CAAQ,CAAC,CAAChD,CAAAA,CAAQ,CACnD,CAAC,EACH,CAAC,CAAA","file":"manager.js","sourcesContent":["export const ADDON_ID = 'walkerOS';\nexport const PANEL_ID = `${ADDON_ID}/panel`;\nexport const KEY = `walkerOS`;\n\nexport const EVENTS = {\n RESULT: `${ADDON_ID}/result`,\n REQUEST: `${ADDON_ID}/request`,\n HIGHLIGHT: `${ADDON_ID}/highlight`,\n LIVE_EVENT: `${ADDON_ID}/live-event`,\n ATTRIBUTES_RESULT: `${ADDON_ID}/attributes-result`,\n ATTRIBUTES_REQUEST: `${ADDON_ID}/attributes-request`,\n};\n","import { ArrowDownIcon } from '@storybook/icons';\nimport React, { Fragment, useState, memo } from 'react';\nimport { styled } from 'storybook/theming';\n\ntype Item = {\n title: string | React.ReactNode;\n content: string | React.ReactNode;\n};\n\ninterface ListItemProps {\n item: Item;\n}\n\ninterface ListProps {\n items: Item[];\n}\n\nconst ListWrapper = styled.ul(({ theme }) => ({\n listStyle: 'none',\n fontSize: theme.typography.size.s2,\n padding: 0,\n margin: 0,\n}));\n\nconst Wrapper = styled.div(({ theme }) => ({\n display: 'flex',\n width: '100%',\n borderBottom: `1px solid ${theme.appBorderColor}`,\n '&:hover': {\n background: theme.background.hoverable,\n },\n}));\n\nconst Icon = styled(ArrowDownIcon)(({ theme }) => ({\n height: 10,\n width: 10,\n minWidth: 10,\n color: theme.color.mediumdark,\n marginRight: 10,\n alignSelf: 'center',\n display: 'inline-flex',\n}));\n\nconst HeaderBar = styled.div(({ theme }) => ({\n padding: '6px 12px',\n paddingLeft: 9,\n background: 'none',\n color: 'inherit',\n textAlign: 'left',\n cursor: 'pointer',\n borderLeft: '3px solid transparent',\n width: '100%',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n\n '&:focus': {\n outline: '0 none',\n borderLeft: `3px solid ${theme.color.secondary}`,\n },\n\n '& .event-base': {\n color: 'inherit',\n fontWeight: '500',\n },\n\n '& .event-separator': {\n color: theme.color.mediumdark,\n fontWeight: '300',\n },\n\n '& .event-preview': {\n color: theme.color.mediumdark,\n fontWeight: '400',\n },\n}));\n\nconst Description = styled.div(({ theme }) => ({\n padding: theme.layoutMargin,\n background: theme.background.content,\n fontFamily: theme.typography.fonts.mono,\n whiteSpace: 'pre-wrap',\n textAlign: 'left',\n}));\n\nexport const ListItem: React.FC<ListItemProps> = memo(({ item }) => {\n const [isOpen, onToggle] = useState(false);\n\n return (\n <Fragment>\n <Wrapper>\n <HeaderBar onClick={() => onToggle(!isOpen)} role=\"button\">\n <Icon\n style={{\n transform: `rotate(${isOpen ? 0 : -90}deg)`,\n }}\n />\n {item.title}\n </HeaderBar>\n </Wrapper>\n {isOpen ? <Description>{item.content}</Description> : null}\n </Fragment>\n );\n});\n\nexport const List: React.FC<ListProps> = memo(({ items }) => (\n <ListWrapper>\n {items.map((item, idx) => (\n <ListItem key={`${item.title}-${idx}`} item={item}></ListItem>\n ))}\n </ListWrapper>\n));\n","/* walkerOS design constants, generated from design/tokens.json by src/design/generate.ts. Edit the JSON and run the explorer build, never this file. */\n\nexport type Theme = 'dark' | 'light';\n\n/** Page background (hero, features, FAQ, closing CTA). Default ground for `fg`, `fg-2`, `link`. */\nexport const bg = { dark: \"#111827\", light: \"#ffffff\" } as const;\n\n/** Alternating section band (Why, More features, Plans) and footer. Switch between `bg` and `bg-2` to separate sections, always with a top `border` rule. */\nexport const bg2 = { dark: \"#151e2e\", light: \"#f6f7f9\" } as const;\n\n/** Cards, plan tiers, FAQ items, the install-command chip and secondary buttons. */\nexport const surface = { dark: \"#1a2232\", light: \"#ffffff\" } as const;\n\n/** Inline code background, icon-button hover. */\nexport const surface2 = { dark: \"#222b3c\", light: \"#f1f3f6\" } as const;\n\n/** Hairline for section rules, header underline, card and input outlines. Decorative only; it does not meet 3:1, so never rely on it alone to mark a control. */\nexport const border = { dark: \"#2f3a4d\", light: \"#e3e6eb\" } as const;\n\n/** Headings and body copy on `bg`, `bg-2`, `surface`, `surface-2` (14:1+ both themes). */\nexport const fg = { dark: \"#ffffff\", light: \"#111827\" } as const;\n\n/** Secondary copy: leads, card descriptions, list items, footer links. 5.5:1+ on every ground. */\nexport const fg2 = { dark: \"#9aa3b2\", light: \"#4b5563\" } as const;\n\n/** Tertiary text: tier labels, `$` prompt, FAQ `+`, copyright, input placeholders. 4.5:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes (dark 4.6:1+, light 4.7:1+). */\nexport const fg3 = { dark: \"#8c93a2\", light: \"#656d7a\" } as const;\n\n/** elbwalker blue. Primary button fill, check icons, highlight word in the H1, focus ring, announcement bar. Light theme: 2.4:1 on white — fine as a fill under `on-primary`, too faint for text or as the only marker (flagged, kept from source). */\nexport const primary = { dark: \"#01b5e2\", light: \"#01b5e2\" } as const;\n\n/** Text and icons on `primary` fills (6.9:1). Never put white on `primary` (2.4:1) — the current walkeros.io buttons do; the relaunch fixes it. */\nexport const onPrimary = { dark: \"#04222b\", light: \"#04222b\" } as const;\n\n/** Links, eyebrows, mono step numbers; `info` and the light `focus` ring use it. 4.5:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes (dark 6.0:1+, light 4.6:1+). Underline on hover only. */\nexport const link = { dark: \"#4fb3e0\", light: \"#0076a0\" } as const;\n\n/** Soft primary halo: hero radial glow and the 4px ring around the highlighted plan. */\nexport const glow = { dark: \"rgba(1, 181, 226, 0.16)\", light: \"rgba(1, 181, 226, 0.14)\" } as const;\n\n/** Code-block panel (Palenight family), both themes. */\nexport const codeBg = \"#292d3e\";\n\n/** Code-block title bar / tab strip. */\nexport const codeBar = \"#232636\";\n\n/** Code-block outline. */\nexport const codeBorder = \"#444a5e\";\n\n/** Default code text on `code-bg` (8:1). */\nexport const codeFg = \"#bfc7d5\";\n\n/** Product visualisation panel (tagging and mapping demos). Visualisations stay dark in both themes. */\nexport const vizBg = \"#1a2232\";\n\n/** Code pane inside a visualisation. */\nexport const vizCodeBg = \"#131c2b\";\n\n/** Outlines inside visualisations. */\nexport const vizBorder = \"#334055\";\n\n/** Primary text inside visualisations. */\nexport const vizFg = \"#e8eaf0\";\n\n/** Legend and meta text inside visualisations (5.4:1 on `viz-code-bg`). */\nexport const vizFg2 = \"#8e96aa\";\n\n/** Code comments and file kinds inside visualisations. */\nexport const vizComment = \"#6c7590\";\n\n/** Gutter line numbers. Decorative, below 3:1. */\nexport const vizLineNumber = \"#4a5165\";\n\n/** Raised surfaces inside visualisations: the rendered teaser card, table rules. */\nexport const vizSurface = \"#2b3649\";\n\n/** Syntax: HTML/JSX tag names in visualisation code (6:1+ on `viz-code-bg`). */\nexport const vizTag = \"#e38fd6\";\n\n/** Syntax: string values in visualisation code and JSON cells. */\nexport const vizString = \"#e5c07b\";\n\n/** Syntax: numbers and booleans in mapping code. */\nexport const vizNumber = \"#f78c6c\";\n\n/** Syntax: punctuation and plain code text; visualisation captions. */\nexport const vizPunct = \"#9aa3b8\";\n\n/** Event part: entity (e.g. `product`). Used for syntax highlight, legend chip and the highlighted DOM region in tagging demos. The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventEntity = { dark: \"#c5e478\", light: \"#537a01\" } as const;\n\n/** Event part: action (e.g. `view`, `add`). The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventAction = { dark: \"#c792ea\", light: \"#8c59ac\" } as const;\n\n/** Event part: entity property (`data-elb-product=\"name\"`). The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventProperty = { dark: \"#f0717f\", light: \"#be4456\" } as const;\n\n/** Event part: context. The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventContext = { dark: \"#f2a65a\", light: \"#a25f06\" } as const;\n\n/** Event part: globals. The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventGlobals = { dark: \"#7fc4ea\", light: \"#317699\" } as const;\n\n/** Tag kind: user (who the visitor is). Unlike the five event parts it has no light value: it sits only on dark grounds (`viz-bg`, legends, chips, mark layers) and always pairs with its word. 5.2:1 on `viz-bg`; kept apart from `event-property`, `event-action` and `danger`. */\nexport const eventUser = \"#e65fc4\";\n\n/** Tag kind: consent (consent states and requirements). Dark grounds only, always with its word. 10.7:1 on `viz-bg`. */\nexport const eventConsent = \"#cbd5e1\";\n\n/** Brand scale (walkeros.io docs). Light-theme badge and admonition background. */\nexport const elbwalker100 = \"#edfeff\";\n\n/** Brand scale. Admonition highlight (light). */\nexport const elbwalker200 = \"#abf8ff\";\n\n/** Brand scale. Admonition text (dark). */\nexport const elbwalker300 = \"#69ecfe\";\n\n/** Brand scale. */\nexport const elbwalker400 = \"#27dbfe\";\n\n/** Brand scale anchor = `primary`. Admonition border. */\nexport const elbwalker500 = \"#01b5e2\";\n\n/** Brand scale. Badge text (light), badge fill (dark). */\nexport const elbwalker700 = \"#015372\";\n\n/** Brand scale. Admonition background (dark). */\nexport const elbwalker800 = \"#00283a\";\n\n/** Brand scale, darkest step. */\nexport const elbwalker900 = \"#000203\";\n\n/** Borders that mark a control: input, select, checkbox and switch outlines, the 1px edge of menus, popovers and dialogs, scrollbar thumbs, flow edges. 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes; `border` stays decorative. */\nexport const borderStrong = { dark: \"#6b778d\", light: \"#818a9a\" } as const;\n\n/** Focus ring, 2px solid with a 3px offset, on every interactive element: `primary` in dark, `link` in light, where `primary` is 2.2:1. 3:1 or more on every ground. */\nexport const focus = { dark: \"#01b5e2\", light: \"#0076a0\" } as const;\n\n/** Scrim behind modals and drawers. The layer above it is `surface` with a 1px `border-strong` edge, never a shadow. */\nexport const backdrop = { dark: \"rgba(3, 7, 18, 0.72)\", light: \"rgba(17, 24, 39, 0.4)\" } as const;\n\n/** Errors, destructive actions and invalid fields, always with an icon and a word. Text at 4.5:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. Kept apart from every event and step colour, `event-property` included. */\nexport const danger = { dark: \"#ffa4ac\", light: \"#b91c1c\" } as const;\n\n/** Text and icons on a `danger` fill such as a destructive button (dark 8.6:1, light 6.5:1). */\nexport const onDanger = { dark: \"#450a0a\", light: \"#ffffff\" } as const;\n\n/** Text and icons on an event-colour fill: a tag card's Done. Dark ink on the dark event values (5.6:1 or more), white on the light ones (about 5:1). */\nexport const onEvent = { dark: \"#111827\", light: \"#ffffff\" } as const;\n\n/** Success and healthy states, always with an icon and a word. Sits on the blue side of green, so it stays apart from `danger` with red-green colour blindness, and apart from every step and event colour. Text at 4.5:1 or more on every ground. */\nexport const success = { dark: \"#8cf9ff\", light: \"#07675d\" } as const;\n\n/** Warnings and states that need attention, always with an icon and a word. Kept apart from `step-transformer` and `event-context`. Text at 4.5:1 or more on every ground. */\nexport const warning = { dark: \"#cabb00\", light: \"#886000\" } as const;\n\n/** Neutral information, always with an icon and a word. The `link` colour in both themes. */\nexport const info = { dark: \"#4fb3e0\", light: \"#0076a0\" } as const;\n\n/** Tinted fill for danger banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const dangerBg = { dark: \"rgba(255, 164, 172, 0.16)\", light: \"rgba(185, 28, 28, 0.1)\" } as const;\n\n/** Tinted fill for success banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const successBg = { dark: \"rgba(140, 249, 255, 0.16)\", light: \"rgba(7, 103, 93, 0.1)\" } as const;\n\n/** Tinted fill for warning banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const warningBg = { dark: \"rgba(202, 187, 0, 0.16)\", light: \"rgba(136, 96, 0, 0.1)\" } as const;\n\n/** Tinted fill for information banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const infoBg = { dark: \"rgba(79, 179, 224, 0.16)\", light: \"rgba(0, 118, 160, 0.1)\" } as const;\n\n/** Flow step colour: sources. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepSource = { dark: \"#6ee7b7\", light: \"#428569\" } as const;\n\n/** Flow step colour: transformers. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepTransformer = { dark: \"#fcd34d\", light: \"#bb7000\" } as const;\n\n/** Flow step colour: the collector. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepCollector = { dark: \"#7dd3fc\", light: \"#0c529b\" } as const;\n\n/** Flow step colour: destinations. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepDestination = { dark: \"#c4b5fd\", light: \"#6d1fd8\" } as const;\n\n/** Flow step colour: stores. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepStore = { dark: \"#a5b4fc\", light: \"#4138c9\" } as const;\n\n/** Platform badge: web, always with the word; 3:1 or more on every ground. */\nexport const platformWeb = { dark: \"#0ea5e9\", light: \"#008ddd\" } as const;\n\n/** Platform badge: server, always with the word; 3:1 or more on every ground. */\nexport const platformServer = { dark: \"#8b5cf6\", light: \"#8043f6\" } as const;\n\n/** First chart series: `primary` in dark, `link` in light. Series take `chart-1` to `chart-6` in order; the six stay apart in normal vision and with red-green colour blindness, and reach 3:1 on every ground. Label every series. */\nexport const chart1 = { dark: \"#01b5e2\", light: \"#0076a0\" } as const;\n\n/** Second chart series (orange). */\nexport const chart2 = { dark: \"#e69f00\", light: \"#ce710c\" } as const;\n\n/** Third chart series (bluish green). */\nexport const chart3 = { dark: \"#009563\", light: \"#217b58\" } as const;\n\n/** Fourth chart series (vermilion). */\nexport const chart4 = { dark: \"#e0520a\", light: \"#d32f4d\" } as const;\n\n/** Fifth chart series (reddish purple). */\nexport const chart5 = { dark: \"#ff6fad\", light: \"#b87889\" } as const;\n\n/** Sixth chart series (yellow in dark, olive in light). */\nexport const chart6 = { dark: \"#f0e442\", light: \"#546800\" } as const;\n\n/** Human notes and comment pins over visualisations, tag plans and frames. Kept apart from every step and status colour; 3:1 or more on every ground. */\nexport const annotation = { dark: \"#22c55e\", light: \"#409116\" } as const;\n\n/** Editor syntax (Monaco, Shiki, Prism): comments, 4.6:1 on `code-bg`. */\nexport const syntaxComment = \"#8c94be\";\n\n/** Editor syntax (Monaco, Shiki, Prism): strings, attribute names and inserted text, 9.9:1 on `code-bg`. */\nexport const syntaxString = \"#c3e88d\";\n\n/** Editor syntax (Monaco, Shiki, Prism): numbers, 5.8:1 on `code-bg`. */\nexport const syntaxNumber = \"#f78c6c\";\n\n/** Editor syntax (Monaco, Shiki, Prism): booleans, null and constants, 4.6:1 on `code-bg`. */\nexport const syntaxConstant = \"#ff5d78\";\n\n/** Editor syntax (Monaco, Shiki, Prism): keywords and storage modifiers, 5.2:1 on `code-bg`. */\nexport const syntaxKeyword = \"#c084fc\";\n\n/** Editor syntax (Monaco, Shiki, Prism): functions and built-ins, 5.9:1 on `code-bg`. */\nexport const syntaxFunction = \"#82aaff\";\n\n/** Editor syntax (Monaco, Shiki, Prism): types and class names, 9.1:1 on `code-bg`. */\nexport const syntaxType = \"#ffcb6b\";\n\n/** Editor syntax (Monaco, Shiki, Prism): operators and regular expressions, 9.0:1 on `code-bg`. */\nexport const syntaxOperator = \"#89ddff\";\n\n/** Editor syntax (Monaco, Shiki, Prism): punctuation and delimiters, 5.7:1 on `code-bg`. */\nexport const syntaxPunct = \"#c792ea\";\n\n/** Editor syntax (Monaco, Shiki, Prism): tags, invalid and deleted tokens, 4.6:1 on `code-bg`. */\nexport const syntaxTag = \"#ff5d79\";\n\n/** Editor syntax (Monaco, Shiki, Prism): namespaces, 8.1:1 on `code-bg`. */\nexport const syntaxNamespace = \"#b2ccd6\";\n\n/** Editor gutter line numbers on `code-bg`. Decorative, below 3:1. */\nexport const codeLineNumber = \"#676e95\";\n\n/** Editor selection over `code-bg`; `code-fg` stays at 5.4:1 on it. */\nexport const codeSelection = \"#717cb450\";\n\n/** Inserted lines in diff views over `code-bg`; `code-fg` stays at 5.4:1. */\nexport const codeInsertedBg = \"#c3e88d26\";\n\n/** Deleted lines in diff views over `code-bg`; `code-fg` stays at 6.6:1. */\nexport const codeDeletedBg = \"#ff5d7926\";\n\n/** Font family `sans`. */\nexport const fontSans = \"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif\";\n\n/** Font family `mono`. */\nexport const fontMono = \"SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace\";\n\n/** Font family `viz`. */\nexport const fontViz = \"'Geist', system-ui, sans-serif\";\n\n/** Font family `viz-mono`. */\nexport const fontVizMono = \"'Geist Mono', monospace\";\n\n/** The one transition duration. Read it as var(--motion): reduced motion sets it to 0ms. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const motion = \"180ms\";\n\n/** The one transition easing, beside var(--motion). Read it as var(--ease). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const ease = \"cubic-bezier(0.2, 0, 0, 1)\";\n\n/** Type style `display`: Hero H1 only. Fluid: clamp(38px, 6vw, 64px), max 20ch, text-wrap balance. One phrase may take `primary`. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeDisplay = { size: \"64px\", lineHeight: 1.08, weight: 700, tracking: \"-0.025em\", family: fontSans } as const;\n\n/** Type style `heading-xl`: Large split-section heading (More features). clamp(28px, 3.6vw, 44px). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeHeadingXl = { size: \"44px\", lineHeight: 1.1, weight: 700, tracking: \"-0.025em\", family: fontSans } as const;\n\n/** Type style `heading-lg`: Section H2. clamp(28px, 3.6vw, 40px), text-wrap balance. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeHeadingLg = { size: \"40px\", lineHeight: 1.15, weight: 700, tracking: \"-0.02em\", family: fontSans } as const;\n\n/** Type style `heading-md`: Feature H2 beside its explainer. clamp(26px, 3.2vw, 36px). Also the docs page title (h1), not fluid. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeHeadingMd = { size: \"36px\", lineHeight: 1.15, weight: 700, tracking: \"-0.02em\", family: fontSans } as const;\n\n/** Type style `footer-statement`: The footer's one-line brand statement. clamp(24px, 3.2vw, 34px), max 22ch. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeFooterStatement = { size: \"34px\", lineHeight: 1.2, weight: 700, tracking: \"-0.02em\", family: fontSans } as const;\n\n/** Type style `kicker-lg`: Large coloured kicker above `heading-xl`, in `primary`. clamp(22px, 2.4vw, 28px). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeKickerLg = { size: \"28px\", lineHeight: 1.2, weight: 700, tracking: \"-0.01em\", family: fontSans } as const;\n\n/** Type style `title-plan`: Plan tier name. Also docs h2. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeTitlePlan = { size: \"24px\", lineHeight: 1.3, weight: 700, tracking: \"-0.015em\", family: fontSans } as const;\n\n/** Type style `title-card`: Problem-card H3. Also docs h3; docs h4 takes its weight. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeTitleCard = { size: \"19px\", lineHeight: 1.35, weight: 600, family: fontSans } as const;\n\n/** Type style `title-item`: Feature-list H3. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeTitleItem = { size: \"18px\", lineHeight: 1.35, weight: 600, family: fontSans } as const;\n\n/** Type style `lead`: Hero sub-copy in `fg-2`, max 58ch. clamp(18px, 2vw, 21px). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeLead = { size: \"21px\", lineHeight: 1.65, weight: 400, family: fontSans } as const;\n\n/** Type style `body-lg`: Feature explainer paragraphs, FAQ questions (600). Also docs h4, at the `title-card` weight. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeBodyLg = { size: \"17px\", lineHeight: 1.65, weight: 400, family: fontSans } as const;\n\n/** Type style `body`: Default body copy, docs body copy included; buttons (600). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeBody = { size: \"16px\", lineHeight: 1.65, weight: 400, family: fontSans } as const;\n\n/** Type style `ui`: Nav links, list items, footer links. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeUi = { size: \"15px\", lineHeight: 1.5, weight: 500, family: fontSans } as const;\n\n/** Type style `small`: Announcement bar, `Docs →` links (500), copyright (400). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeSmall = { size: \"14px\", lineHeight: 1.5, weight: 600, family: fontSans } as const;\n\n/** Type style `eyebrow`: Section eyebrow, UPPERCASE, in `link`. One line that states the problem the section answers. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeEyebrow = { size: \"13px\", lineHeight: 1.5, weight: 600, tracking: \"0.12em\", family: fontSans } as const;\n\n/** Type style `label`: Plan tier label, UPPERCASE, in `fg-3` (`link` on the highlighted plan). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeLabel = { size: \"12px\", lineHeight: 1.5, weight: 700, tracking: \"0.12em\", family: fontSans } as const;\n\n/** Type style `code-command`: Install-command chip. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeCodeCommand = { size: \"15px\", lineHeight: 1.5, weight: 500, family: fontMono } as const;\n\n/** Type style `code-step`: Mono step numbers (01, 02, 03) in `link`. Also code panes: the explorer's code editors and docs code blocks. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeCodeStep = { size: \"13px\", lineHeight: 1.5, weight: 400, family: fontMono } as const;\n\n/** Type style `code-inline`: Inline code inside prose, docs inline code included: `surface-2` fill, `border` outline, radius-sm. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeCodeInline = { size: \"0.88em\", lineHeight: 1.5, weight: 400, family: fontMono } as const;\n\n/** Type style `viz-body`: Captions inside product visualisations (Geist). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizBody = { size: \"15px\", lineHeight: 1.5, weight: 400, family: fontViz } as const;\n\n/** Type style `viz-chip`: Step pills inside visualisations. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizChip = { size: \"13px\", lineHeight: 1.4, weight: 500, family: fontViz } as const;\n\n/** Type style `viz-code`: Code pane inside visualisations (Geist Mono). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizCode = { size: \"12px\", lineHeight: 1.8, weight: 400, family: fontVizMono } as const;\n\n/** Type style `viz-legend`: Event-part legend (Geist Mono) in `viz-fg-2`. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizLegend = { size: \"11px\", lineHeight: 1.5, weight: 400, family: fontVizMono } as const;\n\n/** Type style `product-heading`: Page and dialog titles in the app, the explorer and Tag Mode. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductHeading = { size: \"20px\", lineHeight: 1.3, weight: 600, family: fontSans } as const;\n\n/** Type style `product-title`: Panel, card and section titles in product UI. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductTitle = { size: \"16px\", lineHeight: 1.4, weight: 600, family: fontSans } as const;\n\n/** Type style `product-body`: Default product copy: body text, form fields, table cells, buttons (600). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductBody = { size: \"14px\", lineHeight: 1.5, weight: 400, family: fontSans } as const;\n\n/** Type style `product-small`: Secondary rows, help text and dense tables. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductSmall = { size: \"13px\", lineHeight: 1.45, weight: 400, family: fontSans } as const;\n\n/** Type style `product-caption`: Captions, badges and meta labels. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductCaption = { size: \"12px\", lineHeight: 1.4, weight: 500, family: fontSans } as const;\n\n/** Type style `product-micro`: Dense canvas labels only: node badges, edge labels, mark labels and compact tooltip meta. Never body copy, never interactive text. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductMicro = { size: \"11px\", lineHeight: 1.3, weight: 500, family: fontSans } as const;\n","import {\n eventAction,\n eventContext,\n eventEntity,\n eventGlobals,\n eventProperty,\n} from '@walkeros/explorer/design';\nimport type { WalkerOSAddon } from '../types';\n\nexport type HighlightKind = keyof NonNullable<WalkerOSAddon['highlights']>;\nexport type AttributeKind =\n | 'entity'\n | 'action'\n | 'context'\n | 'globals'\n | 'data';\n\n// Event colours of the walkerOS design system, their dark values: every use\n// pairs them with the dark visualisation ground vizBg.\nexport const highlightColors: Record<HighlightKind, string> = {\n globals: eventGlobals.dark,\n context: eventContext.dark,\n entity: eventEntity.dark,\n property: eventProperty.dark,\n action: eventAction.dark,\n};\n\n// Attribute badges name the property kind \"data\".\nexport const attributeColors: Record<AttributeKind, string> = {\n entity: highlightColors.entity,\n action: highlightColors.action,\n context: highlightColors.context,\n globals: highlightColors.globals,\n data: highlightColors.property,\n};\n","import type { WalkerOSAddon } from '../types';\nimport React from 'react';\nimport { Button } from 'storybook/internal/components';\nimport { useTheme } from 'storybook/theming';\nimport { vizBg } from '@walkeros/explorer/design';\nimport { highlightColors, type HighlightKind } from '../utils/eventColors';\n\ninterface HighlightButtonsProps {\n highlights: Record<HighlightKind, boolean>;\n toggleHighlight: (type: HighlightKind) => void;\n}\n\nconst BUTTONS: Array<{ kind: HighlightKind; label: string }> = [\n { kind: 'globals', label: 'Globals' },\n { kind: 'context', label: 'Context' },\n { kind: 'entity', label: 'Entity' },\n { kind: 'property', label: 'Property' },\n { kind: 'action', label: 'Action' },\n];\n\nexport const HighlightButtons: React.FC<HighlightButtonsProps> = ({\n highlights,\n toggleHighlight,\n}) => {\n const theme = useTheme();\n\n return (\n <div\n style={{\n display: 'flex',\n gap: '4px',\n alignItems: 'center',\n flexWrap: 'wrap',\n justifyContent: 'flex-end',\n }}\n >\n <span\n style={{\n fontSize: theme.typography.size.s1,\n color: theme.color.mediumdark,\n marginRight: '8px',\n }}\n >\n Highlight:\n </span>\n {BUTTONS.map(({ kind, label }) => {\n const active = highlights[kind];\n const color = highlightColors[kind];\n\n return (\n <Button\n key={kind}\n size=\"small\"\n variant={active ? 'solid' : 'outline'}\n onClick={() => toggleHighlight(kind)}\n style={{\n fontSize: theme.typography.size.s1,\n padding: '4px 8px',\n // Active: the event colour on the dark visualisation ground.\n backgroundColor: active ? vizBg : 'transparent',\n color: active ? color : theme.color.mediumdark,\n border: `1px solid ${active ? color : theme.color.border}`,\n }}\n >\n {label}\n </Button>\n );\n })}\n </div>\n );\n};\n","import type { PropertyOrigin } from '../types';\n\n// Human-readable origin label for non-default origins (empty for directly\n// declared data). Rendered as a thin \"(generic)\" / \"(scoped)\" suffix.\nexport const originLabel = (origin: PropertyOrigin): string =>\n origin === 'data' ? '' : origin;\n","import React, { useState } from 'react';\nimport { SyntaxHighlighter } from 'storybook/internal/components';\nimport { useTheme } from 'storybook/theming';\nimport type { AttributeNode, PropertyOrigin } from '../types';\nimport type { WalkerOS } from '@walkeros/core';\nimport { vizBg } from '@walkeros/explorer/design';\nimport { originLabel } from './origin-chip';\nimport { attributeColors, type AttributeKind } from '../utils/eventColors';\n\n// Utility to format complex values for display in badges\nconst formatValueForBadge = (value: unknown): string => {\n if (typeof value === 'string') return value;\n if (typeof value === 'number' || typeof value === 'boolean')\n return String(value);\n if (value === null || value === undefined) return '';\n if (typeof value === 'object') {\n if (Array.isArray(value)) {\n return value.length <= 3\n ? value.join(', ')\n : `${value.slice(0, 3).join(', ')}...`;\n }\n // For objects, show the actual keys instead of just the count\n const keys = Object.keys(value);\n if (keys.length === 0) return '';\n if (keys.length <= 3) {\n return keys.join(', ');\n }\n return `${keys.slice(0, 3).join(', ')}...`;\n }\n return String(value);\n};\n\ninterface AttributeTreeViewProps {\n tree: AttributeNode[];\n depth?: number;\n}\n\ninterface AttributeBadgeProps {\n type: AttributeKind;\n label: string;\n value?: string;\n origin?: PropertyOrigin;\n}\n\nconst AttributeBadge: React.FC<AttributeBadgeProps> = ({\n type,\n label,\n value,\n origin,\n}) => {\n const theme = useTheme();\n const suffix = origin ? originLabel(origin) : '';\n const base = value ? `${label}: ${value}` : label;\n const displayText = suffix ? `${base} (${suffix})` : base;\n\n // Thin, muted \"(generic)\" / \"(scoped)\" suffix appended after the value.\n const suffixNode = suffix ? (\n <span\n style={{\n fontSize: theme.typography.size.s1,\n fontWeight: 400,\n fontStyle: 'italic',\n opacity: 0.65,\n marginLeft: '4px',\n }}\n >\n ({suffix})\n </span>\n ) : null;\n\n return (\n <span\n style={{\n display: 'inline-block',\n padding: '2px 6px',\n margin: '0 4px',\n fontSize: theme.typography.size.s2,\n // A dark chip: event colours only sit on the dark visualisation ground.\n color: attributeColors[type],\n backgroundColor: vizBg,\n border: `1px solid ${attributeColors[type]}`,\n borderRadius: '3px',\n maxWidth: '240px',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }}\n title={displayText}\n >\n <span>\n {type === 'data' ? (\n value ? (\n <>\n <strong>{label}:</strong> {value}\n {suffixNode}\n </>\n ) : (\n <>\n <strong>{label}</strong>\n {suffixNode}\n </>\n )\n ) : (\n <>\n <strong>{type}:</strong> {displayText}\n </>\n )}\n </span>\n </span>\n );\n};\n\nconst AttributeNodeComponent: React.FC<{\n node: AttributeNode;\n depth: number;\n}> = ({ node, depth }) => {\n const [expanded, setExpanded] = useState(true);\n const [showDetails, setShowDetails] = useState(false);\n const theme = useTheme();\n\n const hasAttributes =\n node.attributes.entity ||\n node.attributes.action ||\n node.attributes.context ||\n node.attributes.globals ||\n node.attributes.properties?.length;\n\n const hasChildren = node.children.length > 0;\n\n return (\n <div\n style={{\n marginLeft: depth * 16,\n borderLeft: depth > 0 ? `1px solid ${theme.color.border}` : 'none',\n paddingLeft: depth > 0 ? '8px' : '0',\n }}\n >\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n padding: '4px 0',\n }}\n >\n {hasChildren ? (\n <span\n style={{\n marginRight: '8px',\n color: theme.color.mediumdark,\n cursor: 'pointer',\n userSelect: 'none',\n display: 'inline-block',\n width: '12px',\n textAlign: 'center',\n }}\n onClick={() => setExpanded(!expanded)}\n title={expanded ? 'Collapse' : 'Expand'}\n >\n {expanded ? '▼' : '▶'}\n </span>\n ) : (\n <span\n style={{\n marginRight: '8px',\n width: '12px',\n display: 'inline-block',\n }}\n />\n )}\n\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n flexWrap: 'wrap',\n rowGap: '4px',\n cursor: hasAttributes ? 'pointer' : 'default',\n flex: 1,\n minWidth: 0,\n }}\n onClick={\n hasAttributes ? () => setShowDetails(!showDetails) : undefined\n }\n >\n {node.attributes.entity && (\n <AttributeBadge type=\"entity\" label={node.attributes.entity} />\n )}\n\n {node.attributes.action && (\n <AttributeBadge type=\"action\" label={node.attributes.action} />\n )}\n\n {node.attributes.context &&\n Object.keys(node.attributes.context).length > 0 && (\n <AttributeBadge\n key=\"context\"\n type=\"context\"\n label={Object.keys(node.attributes.context).join(', ')}\n />\n )}\n\n {node.attributes.globals &&\n Object.keys(node.attributes.globals).length > 0 && (\n <AttributeBadge\n key=\"globals\"\n type=\"globals\"\n label={Object.keys(node.attributes.globals).join(', ')}\n />\n )}\n\n {node.attributes.properties\n ?.filter((p) => {\n if (\n typeof p.value === 'object' &&\n p.value !== null &&\n Object.keys(p.value).length === 0\n )\n return false;\n return (\n p.value !== null && p.value !== undefined && p.value !== ''\n );\n })\n .map((p) => (\n <AttributeBadge\n key={`data-${p.key}-${p.origin}`}\n type=\"data\"\n label={`data-${p.key}`}\n value={formatValueForBadge(p.value)}\n origin={p.origin}\n />\n ))}\n </div>\n </div>\n\n {showDetails && hasAttributes && node.htmlMarkup && (\n <div\n style={{ marginTop: '8px', marginBottom: '8px', textAlign: 'left' }}\n >\n <SyntaxHighlighter\n language=\"html\"\n copyable={true}\n bordered={true}\n padded={true}\n >\n {node.htmlMarkup}\n </SyntaxHighlighter>\n </div>\n )}\n\n {expanded && hasChildren && (\n <div>\n {node.children.map((child, index) => (\n <AttributeNodeComponent\n key={index}\n node={child}\n depth={depth + 1}\n />\n ))}\n </div>\n )}\n </div>\n );\n};\n\nexport const AttributeTreeView: React.FC<AttributeTreeViewProps> = ({\n tree,\n depth = 0,\n}) => {\n const theme = useTheme();\n\n if (tree.length === 0) {\n return (\n <div\n style={{\n color: theme.color.mediumdark,\n padding: '20px',\n }}\n >\n No walker attributes found\n <br />\n <small>\n Make sure your components have walker attributes like data-elb,\n data-elbaction, etc.\n </small>\n </div>\n );\n }\n\n return (\n <div>\n {tree.map((node, index) => (\n <AttributeNodeComponent key={index} node={node} depth={depth} />\n ))}\n </div>\n );\n};\n","import type { WalkerOS } from '@walkeros/core';\nimport type { Walker } from '@walkeros/web-core';\n\n/**\n * Creates a formatted data preview from a walkerOS event\n * Shows data and context properties in JSON-like syntax\n */\nexport function createEventDataPreview(\n event: WalkerOS.Event | Walker.Event,\n): string {\n const sections: string[] = [];\n\n // Helper to format value\n const formatValue = (value: unknown): string => {\n if (value === null || value === undefined) {\n return 'null';\n }\n if (typeof value === 'string') {\n return `\"${value}\"`;\n }\n if (Array.isArray(value)) {\n const items = value\n .map((v) => (typeof v === 'string' ? `\"${v}\"` : String(v)))\n .join(', ');\n return `[${items}]`;\n }\n if (typeof value === 'object') {\n return '{...}';\n }\n return String(value);\n };\n\n // Helper to format a section (data or context)\n const formatSection = (obj: unknown, sectionName: string): string | null => {\n if (\n !obj ||\n typeof obj !== 'object' ||\n obj === null ||\n Object.keys(obj as Record<string, unknown>).length === 0\n ) {\n return null;\n }\n\n const entries = Object.entries(obj as Record<string, unknown>)\n .map(([key, value]) => `${key}: ${formatValue(value)}`)\n .join(', ');\n\n return `${sectionName}: { ${entries} }`;\n };\n\n // Process data section first\n if (event.data) {\n const dataSection = formatSection(event.data, 'data');\n if (dataSection) {\n sections.push(dataSection);\n }\n }\n\n // Process context section second\n if (event.context) {\n const contextSection = formatSection(event.context, 'context');\n if (contextSection) {\n sections.push(contextSection);\n }\n }\n\n return sections.join('; ');\n}\n","import React from 'react';\nimport type { WalkerOS } from '@walkeros/core';\nimport type { Walker } from '@walkeros/web-core';\nimport { createEventDataPreview } from './eventPreview';\n\n/**\n * Formats an event title with consistent styling across Events and Live Events tabs\n */\nexport function formatEventTitle(\n event: WalkerOS.Event | Walker.Event,\n index: number,\n): React.ReactNode {\n const dataPreview = createEventDataPreview(event);\n\n // Build base title components\n const eventNumber = `#${index + 1}`;\n // Handle both WalkerOS.Event (has name property) and Walker.Event (has entity/action)\n const eventName =\n 'name' in event ? event.name : `${event.entity} ${event.action}`;\n\n // Construct base title\n const baseTitle = `${eventNumber} ${eventName}`;\n\n // Return styled JSX\n if (!dataPreview) {\n return <span className=\"event-base\">{baseTitle}</span>;\n }\n\n return (\n <>\n <span className=\"event-base\">{baseTitle}</span>\n <span className=\"event-separator\"> - </span>\n <span className=\"event-preview\">{dataPreview}</span>\n </>\n );\n}\n","import type { AttributeNode, ResolvedProperty } from '../types';\nimport type { WalkerOS } from '@walkeros/core';\nimport React, { Fragment, memo, useCallback, useEffect, useState } from 'react';\nimport {\n AddonPanel,\n Placeholder,\n TabsState,\n SyntaxHighlighter,\n Button,\n} from 'storybook/internal/components';\nimport { useChannel, useStorybookApi } from 'storybook/manager-api';\nimport { useTheme } from 'storybook/theming';\nimport {\n STORY_ARGS_UPDATED,\n CURRENT_STORY_WAS_SET,\n SELECT_STORY,\n STORY_RENDERED,\n} from 'storybook/internal/core-events';\n\nimport { ADDON_ID, EVENTS } from '../constants';\nimport { List } from './List';\nimport { HighlightButtons } from './HighlightButtons';\nimport { AttributeTreeView } from './AttributeTreeView';\nimport { formatEventTitle } from '../utils/formatEventTitle';\n\ninterface PanelProps {\n active: boolean;\n}\n\nexport const Panel: React.FC<PanelProps> = memo(function MyPanel(props) {\n const theme = useTheme();\n const api = useStorybookApi();\n const { parameters } = api.getCurrentStoryData() || {};\n\n const defaultConfig = {\n autoRefresh: true,\n prefix: 'data-elb',\n };\n\n const config = {\n ...defaultConfig,\n ...parameters?.[ADDON_ID],\n };\n\n // Highlights are now local state, not persistent config\n const [highlights, setHighlights] = useState({\n context: false,\n entity: false,\n property: false,\n action: false,\n globals: false,\n });\n\n const [events, setState] = useState<WalkerOS.Event[]>([]);\n const [liveEvents, setLiveEvents] = useState<WalkerOS.Event[]>([]);\n const [skeleton, setSkeleton] = useState<{\n nodes: AttributeNode[];\n globals: ResolvedProperty[];\n }>({ nodes: [], globals: [] });\n\n const toggleHighlight = (type: keyof typeof highlights) => {\n const newHighlights = {\n ...highlights,\n [type]: !highlights[type],\n };\n setHighlights(newHighlights);\n\n // Send highlighting update to preview with current config + highlights\n emit(EVENTS.HIGHLIGHT, { ...config, highlights: newHighlights });\n };\n\n // https://storybook.js.org/docs/react/addons/addons-api#usechannel\n const emit = useChannel({\n [EVENTS.RESULT]: (newEvents: WalkerOS.Event[]) => {\n setState(newEvents);\n },\n [EVENTS.LIVE_EVENT]: (event: WalkerOS.Event) => {\n setLiveEvents((prev) =>\n [{ ...event, timestamp: Date.now() }].concat(prev).slice(0, 50),\n );\n },\n [EVENTS.ATTRIBUTES_RESULT]: (result: {\n nodes: AttributeNode[];\n globals: ResolvedProperty[];\n }) => {\n setSkeleton(result);\n },\n });\n\n const updateEvents = useCallback(() => {\n emit(EVENTS.REQUEST, { ...config, highlights });\n }, [config, highlights, emit]);\n\n const updateAttributes = useCallback(() => {\n emit(EVENTS.ATTRIBUTES_REQUEST, { ...config, highlights });\n }, [config, highlights, emit]);\n\n // Initial auto-refresh on page load\n useEffect(() => {\n if (config.autoRefresh) {\n updateEvents();\n updateAttributes();\n }\n }, []); // Only run once on mount\n\n // Auto-refresh on story navigation and args updates\n useEffect(() => {\n if (!config.autoRefresh) return;\n\n // Events to listen for\n const storyEvents = [\n CURRENT_STORY_WAS_SET,\n SELECT_STORY,\n STORY_RENDERED,\n STORY_ARGS_UPDATED,\n ];\n\n // Combined update function for events and attributes\n const updateAll = () => {\n updateEvents();\n updateAttributes();\n };\n\n // Listen for story navigation and control changes\n storyEvents.forEach((event) => api.on(event, updateAll));\n // Cleanup listeners on unmount\n return () => storyEvents.forEach((event) => api.off(event, updateAll));\n }, [api, updateEvents, updateAttributes, config.autoRefresh]);\n\n const getEventTitle = (events: WalkerOS.Event[]) =>\n `Events (${events.length})`;\n\n const getLiveEventTitle = () => `Live Events (${liveEvents.length})`;\n\n const clearLiveEvents = () => {\n setLiveEvents([]);\n };\n\n const formatTime = (timestamp: number) => {\n return new Date(timestamp).toLocaleTimeString();\n };\n\n const getSkeletonTitle = () => {\n const count = (nodes: AttributeNode[]): number =>\n nodes.reduce((total, node) => {\n let n = 0;\n if (node.attributes.entity) n++;\n if (node.attributes.action) n++;\n if (\n node.attributes.context &&\n Object.keys(node.attributes.context).length\n )\n n++;\n if (\n node.attributes.globals &&\n Object.keys(node.attributes.globals).length\n )\n n++;\n n += node.attributes.properties?.length ?? 0;\n return total + n + count(node.children || []);\n }, 0);\n return `Skeleton (${count(skeleton.nodes)})`;\n };\n\n return (\n <AddonPanel {...props}>\n <TabsState\n initial=\"live\"\n backgroundColor={theme.background.hoverable as string}\n >\n <div id=\"events\" title={getEventTitle(events)}>\n <Placeholder>\n <Fragment>\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n flexWrap: 'wrap',\n gap: '8px',\n marginBottom: '12px',\n padding: '8px',\n backgroundColor: theme.background.app,\n borderRadius: '4px',\n border: `1px solid ${theme.color.border}`,\n }}\n >\n <Button onClick={updateEvents}>Update events</Button>\n <HighlightButtons\n highlights={highlights}\n toggleHighlight={toggleHighlight}\n />\n </div>\n </Fragment>\n {events.length > 0 ? (\n <List\n items={events.map((item, index) => {\n return {\n title: formatEventTitle(item, index),\n content: (\n <SyntaxHighlighter\n language=\"json\"\n copyable={true}\n bordered={true}\n padded={true}\n >\n {JSON.stringify(item, null, 2)}\n </SyntaxHighlighter>\n ),\n };\n })}\n />\n ) : (\n <p>No events yet</p>\n )}\n </Placeholder>\n </div>\n <div id=\"live\" title={getLiveEventTitle()}>\n <Placeholder>\n <Fragment>\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n flexWrap: 'wrap',\n gap: '8px',\n marginBottom: '12px',\n padding: '8px',\n backgroundColor: theme.background.app,\n borderRadius: '4px',\n border: `1px solid ${theme.color.border}`,\n }}\n >\n <div\n style={{ display: 'flex', gap: '8px', alignItems: 'center' }}\n >\n <Button size=\"small\" onClick={clearLiveEvents}>\n Clear Events\n </Button>\n </div>\n <HighlightButtons\n highlights={highlights}\n toggleHighlight={toggleHighlight}\n />\n </div>\n </Fragment>\n {liveEvents.length > 0 ? (\n <List\n items={liveEvents.map((event, index) => {\n return {\n title: formatEventTitle(\n event,\n liveEvents.length - index - 1,\n ),\n content: (\n <SyntaxHighlighter\n language=\"json\"\n copyable={true}\n bordered={true}\n padded={true}\n >\n {JSON.stringify(event, null, 2)}\n </SyntaxHighlighter>\n ),\n };\n })}\n />\n ) : (\n <p\n style={{\n textAlign: 'center',\n color: theme.color.mediumdark,\n padding: '20px',\n }}\n >\n Waiting for live events...\n <br />\n <small>\n Interact with components to see events appear here in\n real-time\n </small>\n </p>\n )}\n </Placeholder>\n </div>\n <div id=\"attributes\" title={getSkeletonTitle()}>\n <Placeholder>\n <Fragment>\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n flexWrap: 'wrap',\n gap: '8px',\n marginBottom: '12px',\n padding: '8px',\n backgroundColor: theme.background.app,\n borderRadius: '4px',\n border: `1px solid ${theme.color.border}`,\n }}\n >\n <Button onClick={updateAttributes}>Update skeleton</Button>\n <HighlightButtons\n highlights={highlights}\n toggleHighlight={toggleHighlight}\n />\n </div>\n </Fragment>\n <AttributeTreeView tree={skeleton.nodes} />\n </Placeholder>\n </div>\n </TabsState>\n </AddonPanel>\n );\n});\n","import React from 'react';\nimport { addons, types } from 'storybook/manager-api';\n\nimport { Panel } from './components/Panel';\nimport { ADDON_ID, PANEL_ID } from './constants';\n\n/**\n * Note: if you want to use JSX in this file, rename it to `manager.tsx`\n * and update the entry prop in tsup.config.ts to use \"src/manager.tsx\",\n */\n\naddons.register(ADDON_ID, (api) => {\n addons.add(PANEL_ID, {\n type: types.PANEL,\n title: ADDON_ID,\n match: ({ viewMode }) => viewMode === 'story',\n render: ({ active }) => <Panel active={!!active} />,\n });\n});\n"]}
|
package/dist/preview.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/constants.ts","../src/walker.ts","../src/utils/domUtils.ts","../src/utils/attributeTreeUtils.ts","../../explorer/src/design/index.ts","../src/utils/eventColors.ts","../src/utils/cssUtils.ts","../src/utils/highlightingUtils.ts","../src/withRoundTrip.ts","../src/preview.ts"],"names":["ADDON_ID","EVENTS","destinationConsole","event","context","destinationLive","channel","addons","getIframeContext","iframe","e","initializeWalker","config","iframeDoc","iframeWin","result","startFlow","sourceBrowser","collector","elb","error","getStoryDocument","getStoryRootElement","storyDoc","selectors","selector","element","getElementPath","el","path","current","c","enhanceProperties","storyRoot","prefix","allElements","scopedAttr","getElbAttributeName","Const","actionAttr","contextAttr","globalsAttr","attr","generateElementHTML","tagName","propertyMarker","attribs","PRIORITY","addProperty","acc","key","value","origin","existing","collectValues","name","values","getElbValues","k","v","buildAttributeTree","scope","entityAttr","scopedName","entityEls","entitySet","owningEntity","cur","nodeMap","entity","props","owned","child","o","anc","g","roots","node","parentEl","parentNode","globalsValues","getGlobals","globals","vizBg","eventEntity","eventAction","eventProperty","eventContext","eventGlobals","highlightColors","outline","colors","color","index","generateHighlightCSS","property","action","globalsSelector","contextSelector","baseSelector","propertySelector","injectHighlightingCSS","existingStyle","highlightingStyleElement","css","applyHighlighting","highlights","setupHighlighting","currentStoryId","events","getAllEvents","eventsWithGlobals","withRoundTrip","storyFn","_a","storyId","hasStoryChanged","parameters","autoRefresh","err","preview","preview_default"],"mappings":"+JAAO,IAAMA,CAAAA,CAAW,UAAA,CAIjB,IAAMC,CAAAA,CAAS,CACpB,MAAA,CAAQ,CAAA,EAAGD,CAAQ,UACnB,OAAA,CAAS,CAAA,EAAGA,CAAQ,CAAA,QAAA,CAAA,CACpB,SAAA,CAAW,CAAA,EAAGA,CAAQ,CAAA,UAAA,CAAA,CACtB,UAAA,CAAY,CAAA,EAAGA,CAAQ,CAAA,WAAA,CAAA,CACvB,iBAAA,CAAmB,CAAA,EAAGA,CAAQ,CAAA,kBAAA,CAAA,CAC9B,mBAAoB,CAAA,EAAGA,CAAQ,CAAA,mBAAA,CACjC,CAAA,CCGA,IAAME,CAAAA,CAAqB,CACzB,IAAA,CAAM,SAAA,CACN,IAAA,CAAM,CAACC,CAAAA,CAAuBC,IAAqC,CACjE,OAAA,CAAQ,GAAA,CAAI,kBAAA,CAAoBD,CAAK,EACvC,CAAA,CACA,MAAA,CAAQ,EACV,CAAA,CAGME,CAAAA,CAAkB,CACtB,IAAA,CAAM,MAAA,CACN,IAAA,CAAM,CAACF,CAAAA,CAAuBC,CAAAA,GAAqC,CAEjE,IAAME,CAAAA,CAAUC,iBAAAA,CAAO,UAAA,EAAW,CAC9BD,GACFA,CAAAA,CAAQ,IAAA,CAAKL,CAAAA,CAAO,UAAA,CAAYE,CAAK,EAEzC,CAAA,CACA,MAAA,CAAQ,EACV,CAAA,CAGA,SAASK,CAAAA,EAAmB,CAC1B,GAAI,CAEF,IAAMC,CAAAA,CAAS,MA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ourcesContent":["export const ADDON_ID = 'walkerOS';\nexport const PANEL_ID = `${ADDON_ID}/panel`;\nexport const KEY = `walkerOS`;\n\nexport const EVENTS = {\n RESULT: `${ADDON_ID}/result`,\n REQUEST: `${ADDON_ID}/request`,\n HIGHLIGHT: `${ADDON_ID}/highlight`,\n LIVE_EVENT: `${ADDON_ID}/live-event`,\n ATTRIBUTES_RESULT: `${ADDON_ID}/attributes-result`,\n ATTRIBUTES_REQUEST: `${ADDON_ID}/attributes-request`,\n};\n","import type { Collector, WalkerOS, Destination } from '@walkeros/core';\nimport { startFlow } from '@walkeros/collector';\nimport { sourceBrowser } from '@walkeros/web-source-browser';\nimport { addons } from 'storybook/preview-api';\nimport { EVENTS } from './constants';\n\ndeclare global {\n interface Window {\n __storybookElb: WalkerOS.Elb;\n __storybookWalker: Collector.Instance;\n }\n}\n\n// Simple console destination for Storybook\nconst destinationConsole = {\n type: 'console',\n push: (event: WalkerOS.Event, context: Destination.PushContext) => {\n console.log('Storybook Event:', event);\n },\n config: {},\n};\n\n// Live destination for Storybook panel\nconst destinationLive = {\n type: 'live',\n push: (event: WalkerOS.Event, context: Destination.PushContext) => {\n // Send event to Storybook panel for live display\n const channel = addons.getChannel();\n if (channel) {\n channel.emit(EVENTS.LIVE_EVENT, event);\n }\n },\n config: {},\n};\n\n// Function to get Storybook iframe context\nfunction getIframeContext() {\n try {\n // Try to get iframe from parent document (manager context)\n const iframe = parent.document.querySelector(\n '#storybook-preview-iframe',\n ) as HTMLIFrameElement;\n if (iframe?.contentDocument && iframe?.contentWindow) {\n return {\n document: iframe.contentDocument,\n window: iframe.contentWindow,\n };\n }\n } catch (e) {\n // If we can't access parent, we're likely already in iframe context\n }\n\n // Fallback to current context\n return { document, window };\n}\n\nexport async function initializeWalker(config?: {\n prefix?: string;\n autoRefresh?: boolean;\n}): Promise<void> {\n // Skip initialization if already done\n if (window.__storybookWalker) return;\n\n try {\n // Get iframe context for proper event capture\n const { document: iframeDoc, window: iframeWin } = getIframeContext();\n\n if (!iframeDoc) {\n console.warn('Document not available, skipping walkerOS initialization');\n return;\n }\n\n // Create collector with browser source and destinations\n const result = await startFlow({\n consent: { functional: true },\n sources: {\n browser: {\n code: sourceBrowser,\n config: {\n settings: {\n pageview: true,\n elbLayer: '__storybookElbLayer',\n elb: '__storybookElb',\n prefix: config?.prefix || 'data-elb',\n scope: iframeDoc.body || iframeDoc, // Set scope to iframe document\n },\n },\n env: {\n window: iframeWin,\n document: iframeDoc,\n },\n },\n },\n destinations: {\n console: { code: destinationConsole },\n live: { code: destinationLive },\n },\n });\n\n const { collector, elb } = result;\n\n // Verify collector was created successfully\n if (!collector) {\n throw new Error('Collector creation failed - no collector returned');\n }\n\n // Set global window objects\n window.__storybookWalker = collector;\n window.__storybookElb = elb;\n } catch (error) {\n console.error('Failed to initialize walkerOS:', error);\n }\n}\n","// DOM utilities for working with story elements\n\nimport { Const } from '@walkeros/collector';\nimport { getElbAttributeName } from '@walkeros/web-source-browser';\n\n// Function to get the story document (either iframe or main document)\nexport const getStoryDocument = (): Document => {\n // Try to find story iframe\n const iframe = document.querySelector(\n '#storybook-preview-iframe',\n ) as HTMLIFrameElement;\n if (iframe?.contentDocument) {\n return iframe.contentDocument;\n }\n // Fallback to main document\n return document;\n};\n\n// Function to get the story root element\nexport const getStoryRootElement = (): Element | null => {\n const storyDoc = getStoryDocument();\n\n // Try multiple selectors for story root\n const selectors = [\n '#storybook-root',\n '#root',\n '[data-testid=\"storybook-root\"]',\n 'body',\n ];\n\n for (const selector of selectors) {\n const element = storyDoc.querySelector(selector);\n if (element) {\n return element;\n }\n }\n\n return storyDoc.body;\n};\n\n// Helper to get element path\nexport const getElementPath = (el: Element): string => {\n const path = [];\n let current = el;\n while (current && current !== document.body && current.parentElement) {\n let selector = current.tagName.toLowerCase();\n if (current.id) {\n selector += `#${current.id}`;\n } else if (current.className && typeof current.className === 'string') {\n selector += `.${current.className\n .split(' ')\n .filter((c) => c)\n .join('.')}`;\n }\n path.unshift(selector);\n current = current.parentElement;\n }\n return path.join(' > ');\n};\n\n// Function to enhance DOM with property attributes\nexport const enhanceProperties = (\n storyRoot: Element,\n prefix: string = 'data-elb',\n): void => {\n // Find all elements with any attributes starting with prefix-\n const allElements = Array.from(storyRoot.querySelectorAll('*'));\n\n const scopedAttr = getElbAttributeName(prefix, Const.Commands.Scoped, false); // data-elb_\n const actionAttr = getElbAttributeName(prefix, Const.Commands.Action, false);\n const contextAttr = getElbAttributeName(\n prefix,\n Const.Commands.Context,\n false,\n );\n const globalsAttr = getElbAttributeName(\n prefix,\n Const.Commands.Globals,\n false,\n );\n\n allElements.forEach((el) => {\n const hasProperties = Array.from(el.attributes).some((attr) => {\n if (attr.name === scopedAttr) return true; // scoped generic data-elb_\n return (\n attr.name.startsWith(`${prefix}-`) &&\n attr.name !== actionAttr &&\n attr.name !== contextAttr &&\n attr.name !== globalsAttr\n );\n });\n\n // Mark elements with property attributes\n if (hasProperties) {\n el.setAttribute(getElbAttributeName(prefix, 'property', false), '');\n }\n });\n};\n","// Builds an entity-centric \"skeleton\" tree: each node is a data-elb entity, with\n// generic (data-elb-), scoped (data-elb_), and explicit (data-elb-<entity>)\n// values resolved onto it and tagged by origin. Interim addon-local\n// approximation of the walker's resolution (see the design doc for fidelity\n// limits: cross-DOM links, shadow piercing, exact collision priority, and\n// context ordering index are out of scope for Phase 1).\n\nimport type { WalkerOS } from '@walkeros/core';\nimport { Const } from '@walkeros/collector';\nimport {\n getElbValues,\n getElbAttributeName,\n getGlobals,\n} from '@walkeros/web-source-browser';\nimport type { AttributeNode, ResolvedProperty } from '../types';\nimport { getElementPath } from './domUtils';\n\nconst generateElementHTML = (element: Element, prefix: string): string => {\n const tagName = element.tagName.toLowerCase();\n // Hide the synthetic highlight marker (data-elbproperty) that\n // enhanceProperties stamps on the live DOM; it is an internal helper, not\n // author-written tagging, so it must not appear in the displayed markup.\n const propertyMarker = getElbAttributeName(prefix, 'property', false);\n const attribs = Array.from(element.attributes)\n .filter((a) => a.name !== propertyMarker)\n .map((a) => `${a.name}=\"${a.value}\"`);\n if (attribs.length === 0) return `<${tagName}></${tagName}>`;\n if (attribs.length === 1) return `<${tagName} ${attribs[0]}></${tagName}>`;\n return `<${tagName}\\n${attribs.map((a) => ` ${a}`).join('\\n')}\\n></${tagName}>`;\n};\n\n// Origin priority for same-key collisions (highest first). Approximate; real\n// walker priority is documented as out of scope for Phase 1.\nconst PRIORITY: Record<ResolvedProperty['origin'], number> = {\n data: 3,\n scoped: 2,\n generic: 1,\n};\n\nconst addProperty = (\n acc: Map<string, ResolvedProperty>,\n key: string,\n value: WalkerOS.Property | undefined,\n origin: ResolvedProperty['origin'],\n) => {\n if (!key) return; // never store the blank-key generic\n if (value === undefined || value === null || value === '') return;\n const existing = acc.get(key);\n if (!existing || PRIORITY[origin] > PRIORITY[existing.origin]) {\n acc.set(key, { key, value, origin });\n }\n};\n\nconst collectValues = (\n acc: Map<string, ResolvedProperty>,\n prefix: string,\n el: Element,\n name: string, // '' for generic, entity name for explicit\n origin: ResolvedProperty['origin'],\n) => {\n const values = getElbValues(prefix, el, name, true);\n Object.entries(values).forEach(([k, v]) => addProperty(acc, k, v, origin));\n};\n\nexport const buildAttributeTree = (\n scope: Element,\n prefix: string = Const.Commands.Prefix,\n): { nodes: AttributeNode[]; globals: ResolvedProperty[] } => {\n const entityAttr = getElbAttributeName(prefix); // data-elb\n const scopedName = Const.Commands.Scoped; // '_'\n\n // All entity elements (self + descendants).\n const entityEls: Element[] = [];\n if (scope.matches(`[${entityAttr}]`)) entityEls.push(scope);\n scope.querySelectorAll(`[${entityAttr}]`).forEach((el) => entityEls.push(el));\n const entitySet = new Set(entityEls);\n\n // Nearest ancestor-or-self entity for any element (DOM ancestry).\n const owningEntity = (el: Element): Element | null => {\n let cur: Element | null = el;\n while (cur) {\n if (entitySet.has(cur)) return cur;\n cur = cur.parentElement;\n }\n return null;\n };\n\n const nodeMap = new Map<Element, AttributeNode>();\n\n entityEls.forEach((el) => {\n const entity = el.getAttribute(entityAttr) || '';\n const props = new Map<string, ResolvedProperty>();\n\n // Own + owned descendants: explicit (data-elb-<entity>) and generic (data-elb-)\n const owned: Element[] = [el];\n el.querySelectorAll('*').forEach((child) => {\n if (owningEntity(child) === el) owned.push(child);\n });\n owned.forEach((o) => {\n collectValues(props, prefix, o, entity, 'data');\n collectValues(props, prefix, o, '', 'generic');\n });\n\n // Ancestors (incl. self start): explicit, generic, and scoped (data-elb_)\n let anc: Element | null = el;\n while (anc) {\n collectValues(props, prefix, anc, entity, 'data');\n collectValues(props, prefix, anc, '', 'generic');\n // scoped uses isProperty=false (suffix '_' with no dash)\n Object.entries(getElbValues(prefix, anc, scopedName, false)).forEach(\n ([k, v]) => addProperty(props, k, v, 'scoped'),\n );\n anc = anc.parentElement;\n }\n\n nodeMap.set(el, {\n element: el.tagName.toLowerCase(),\n path: getElementPath(el),\n htmlMarkup: generateElementHTML(el, prefix),\n attributes: {\n entity,\n action:\n el.getAttribute(\n getElbAttributeName(prefix, Const.Commands.Action, false),\n ) || undefined,\n context: (() => {\n const c = getElbValues(prefix, el, Const.Commands.Context, false);\n return Object.keys(c).length ? c : undefined;\n })(),\n globals: (() => {\n const g = getElbValues(prefix, el, Const.Commands.Globals, false);\n return Object.keys(g).length ? g : undefined;\n })(),\n properties: Array.from(props.values()),\n },\n children: [],\n });\n });\n\n // Nest by nearest ancestor entity.\n const roots: AttributeNode[] = [];\n nodeMap.forEach((node, el) => {\n const parentEl = el.parentElement ? owningEntity(el.parentElement) : null;\n const parentNode = parentEl ? nodeMap.get(parentEl) : undefined;\n if (parentNode) parentNode.children.push(node);\n else roots.push(node);\n });\n\n const globalsValues = getGlobals(prefix, scope);\n const globals: ResolvedProperty[] = [];\n Object.entries(globalsValues).forEach(([key, value]) => {\n if (value !== undefined && value !== null && value !== '')\n globals.push({ key, value, origin: 'data' });\n });\n\n return { nodes: roots, globals };\n};\n","/* walkerOS design constants, generated from design/tokens.json by src/design/generate.ts. Edit the JSON and run the explorer build, never this file. */\n\nexport type Theme = 'dark' | 'light';\n\n/** Page background (hero, features, FAQ, closing CTA). Default ground for `fg`, `fg-2`, `link`. */\nexport const bg = { dark: \"#111827\", light: \"#ffffff\" } as const;\n\n/** Alternating section band (Why, More features, Plans) and footer. Switch between `bg` and `bg-2` to separate sections, always with a top `border` rule. */\nexport const bg2 = { dark: \"#151e2e\", light: \"#f6f7f9\" } as const;\n\n/** Cards, plan tiers, FAQ items, the install-command chip and secondary buttons. */\nexport const surface = { dark: \"#1a2232\", light: \"#ffffff\" } as const;\n\n/** Inline code background, icon-button hover. */\nexport const surface2 = { dark: \"#222b3c\", light: \"#f1f3f6\" } as const;\n\n/** Hairline for section rules, header underline, card and input outlines. Decorative only; it does not meet 3:1, so never rely on it alone to mark a control. */\nexport const border = { dark: \"#2f3a4d\", light: \"#e3e6eb\" } as const;\n\n/** Headings and body copy on `bg`, `bg-2`, `surface`, `surface-2` (14:1+ both themes). */\nexport const fg = { dark: \"#ffffff\", light: \"#111827\" } as const;\n\n/** Secondary copy: leads, card descriptions, list items, footer links. 5.5:1+ on every ground. */\nexport const fg2 = { dark: \"#9aa3b2\", light: \"#4b5563\" } as const;\n\n/** Tertiary text: tier labels, `$` prompt, FAQ `+`, copyright, input placeholders. 4.5:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes (dark 4.6:1+, light 4.7:1+). */\nexport const fg3 = { dark: \"#8c93a2\", light: \"#656d7a\" } as const;\n\n/** elbwalker blue. Primary button fill, check icons, highlight word in the H1, focus ring, announcement bar. Light theme: 2.4:1 on white — fine as a fill under `on-primary`, too faint for text or as the only marker (flagged, kept from source). */\nexport const primary = { dark: \"#01b5e2\", light: \"#01b5e2\" } as const;\n\n/** Text and icons on `primary` fills (6.9:1). Never put white on `primary` (2.4:1) — the current walkeros.io buttons do; the relaunch fixes it. */\nexport const onPrimary = { dark: \"#04222b\", light: \"#04222b\" } as const;\n\n/** Links, eyebrows, mono step numbers; `info` and the light `focus` ring use it. 4.5:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes (dark 6.0:1+, light 4.6:1+). Underline on hover only. */\nexport const link = { dark: \"#4fb3e0\", light: \"#0076a0\" } as const;\n\n/** Soft primary halo: hero radial glow and the 4px ring around the highlighted plan. */\nexport const glow = { dark: \"rgba(1, 181, 226, 0.16)\", light: \"rgba(1, 181, 226, 0.14)\" } as const;\n\n/** Code-block panel (Palenight family), both themes. */\nexport const codeBg = \"#292d3e\";\n\n/** Code-block title bar / tab strip. */\nexport const codeBar = \"#232636\";\n\n/** Code-block outline. */\nexport const codeBorder = \"#444a5e\";\n\n/** Default code text on `code-bg` (8:1). */\nexport const codeFg = \"#bfc7d5\";\n\n/** Product visualisation panel (tagging and mapping demos). Visualisations stay dark in both themes. */\nexport const vizBg = \"#1a2232\";\n\n/** Code pane inside a visualisation. */\nexport const vizCodeBg = \"#131c2b\";\n\n/** Outlines inside visualisations. */\nexport const vizBorder = \"#334055\";\n\n/** Primary text inside visualisations. */\nexport const vizFg = \"#e8eaf0\";\n\n/** Legend and meta text inside visualisations (5.4:1 on `viz-code-bg`). */\nexport const vizFg2 = \"#8e96aa\";\n\n/** Code comments and file kinds inside visualisations. */\nexport const vizComment = \"#6c7590\";\n\n/** Gutter line numbers. Decorative, below 3:1. */\nexport const vizLineNumber = \"#4a5165\";\n\n/** Raised surfaces inside visualisations: the rendered teaser card, table rules. */\nexport const vizSurface = \"#2b3649\";\n\n/** Syntax: HTML/JSX tag names in visualisation code (6:1+ on `viz-code-bg`). */\nexport const vizTag = \"#e38fd6\";\n\n/** Syntax: string values in visualisation code and JSON cells. */\nexport const vizString = \"#e5c07b\";\n\n/** Syntax: numbers and booleans in mapping code. */\nexport const vizNumber = \"#f78c6c\";\n\n/** Syntax: punctuation and plain code text; visualisation captions. */\nexport const vizPunct = \"#9aa3b8\";\n\n/** Event part: entity (e.g. `product`). Used for syntax highlight, legend chip and the highlighted DOM region in tagging demos. The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventEntity = { dark: \"#c5e478\", light: \"#537a01\" } as const;\n\n/** Event part: action (e.g. `view`, `add`). The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventAction = { dark: \"#c792ea\", light: \"#8c59ac\" } as const;\n\n/** Event part: entity property (`data-elb-product=\"name\"`). The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventProperty = { dark: \"#f0717f\", light: \"#be4456\" } as const;\n\n/** Event part: context. The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventContext = { dark: \"#f2a65a\", light: \"#a25f06\" } as const;\n\n/** Event part: globals. The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventGlobals = { dark: \"#7fc4ea\", light: \"#317699\" } as const;\n\n/** Tag kind: user (who the visitor is). Unlike the five event parts it has no light value: it sits only on dark grounds (`viz-bg`, legends, chips, mark layers) and always pairs with its word. 5.2:1 on `viz-bg`; kept apart from `event-property`, `event-action` and `danger`. */\nexport const eventUser = \"#e65fc4\";\n\n/** Tag kind: consent (consent states and requirements). Dark grounds only, always with its word. 10.7:1 on `viz-bg`. */\nexport const eventConsent = \"#cbd5e1\";\n\n/** Brand scale (walkeros.io docs). Light-theme badge and admonition background. */\nexport const elbwalker100 = \"#edfeff\";\n\n/** Brand scale. Admonition highlight (light). */\nexport const elbwalker200 = \"#abf8ff\";\n\n/** Brand scale. Admonition text (dark). */\nexport const elbwalker300 = \"#69ecfe\";\n\n/** Brand scale. */\nexport const elbwalker400 = \"#27dbfe\";\n\n/** Brand scale anchor = `primary`. Admonition border. */\nexport const elbwalker500 = \"#01b5e2\";\n\n/** Brand scale. Badge text (light), badge fill (dark). */\nexport const elbwalker700 = \"#015372\";\n\n/** Brand scale. Admonition background (dark). */\nexport const elbwalker800 = \"#00283a\";\n\n/** Brand scale, darkest step. */\nexport const elbwalker900 = \"#000203\";\n\n/** Borders that mark a control: input, select, checkbox and switch outlines, the 1px edge of menus, popovers and dialogs, scrollbar thumbs, flow edges. 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes; `border` stays decorative. */\nexport const borderStrong = { dark: \"#6b778d\", light: \"#818a9a\" } as const;\n\n/** Focus ring, 2px solid with a 3px offset, on every interactive element: `primary` in dark, `link` in light, where `primary` is 2.2:1. 3:1 or more on every ground. */\nexport const focus = { dark: \"#01b5e2\", light: \"#0076a0\" } as const;\n\n/** Scrim behind modals and drawers. The layer above it is `surface` with a 1px `border-strong` edge, never a shadow. */\nexport const backdrop = { dark: \"rgba(3, 7, 18, 0.72)\", light: \"rgba(17, 24, 39, 0.4)\" } as const;\n\n/** Errors, destructive actions and invalid fields, always with an icon and a word. Text at 4.5:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. Kept apart from every event and step colour, `event-property` included. */\nexport const danger = { dark: \"#ffa4ac\", light: \"#b91c1c\" } as const;\n\n/** Text and icons on a `danger` fill such as a destructive button (dark 8.6:1, light 6.5:1). */\nexport const onDanger = { dark: \"#450a0a\", light: \"#ffffff\" } as const;\n\n/** Success and healthy states, always with an icon and a word. Sits on the blue side of green, so it stays apart from `danger` with red-green colour blindness, and apart from every step and event colour. Text at 4.5:1 or more on every ground. */\nexport const success = { dark: \"#8cf9ff\", light: \"#07675d\" } as const;\n\n/** Warnings and states that need attention, always with an icon and a word. Kept apart from `step-transformer` and `event-context`. Text at 4.5:1 or more on every ground. */\nexport const warning = { dark: \"#cabb00\", light: \"#886000\" } as const;\n\n/** Neutral information, always with an icon and a word. The `link` colour in both themes. */\nexport const info = { dark: \"#4fb3e0\", light: \"#0076a0\" } as const;\n\n/** Tinted fill for danger banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const dangerBg = { dark: \"rgba(255, 164, 172, 0.16)\", light: \"rgba(185, 28, 28, 0.1)\" } as const;\n\n/** Tinted fill for success banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const successBg = { dark: \"rgba(140, 249, 255, 0.16)\", light: \"rgba(7, 103, 93, 0.1)\" } as const;\n\n/** Tinted fill for warning banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const warningBg = { dark: \"rgba(202, 187, 0, 0.16)\", light: \"rgba(136, 96, 0, 0.1)\" } as const;\n\n/** Tinted fill for information banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const infoBg = { dark: \"rgba(79, 179, 224, 0.16)\", light: \"rgba(0, 118, 160, 0.1)\" } as const;\n\n/** Flow step colour: sources. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepSource = { dark: \"#6ee7b7\", light: \"#428569\" } as const;\n\n/** Flow step colour: transformers. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepTransformer = { dark: \"#fcd34d\", light: \"#bb7000\" } as const;\n\n/** Flow step colour: the collector. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepCollector = { dark: \"#7dd3fc\", light: \"#0c529b\" } as const;\n\n/** Flow step colour: destinations. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepDestination = { dark: \"#c4b5fd\", light: \"#6d1fd8\" } as const;\n\n/** Flow step colour: stores. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepStore = { dark: \"#a5b4fc\", light: \"#4138c9\" } as const;\n\n/** Platform badge: web, always with the word; 3:1 or more on every ground. */\nexport const platformWeb = { dark: \"#0ea5e9\", light: \"#008ddd\" } as const;\n\n/** Platform badge: server, always with the word; 3:1 or more on every ground. */\nexport const platformServer = { dark: \"#8b5cf6\", light: \"#8043f6\" } as const;\n\n/** First chart series: `primary` in dark, `link` in light. Series take `chart-1` to `chart-6` in order; the six stay apart in normal vision and with red-green colour blindness, and reach 3:1 on every ground. Label every series. */\nexport const chart1 = { dark: \"#01b5e2\", light: \"#0076a0\" } as const;\n\n/** Second chart series (orange). */\nexport const chart2 = { dark: \"#e69f00\", light: \"#ce710c\" } as const;\n\n/** Third chart series (bluish green). */\nexport const chart3 = { dark: \"#009563\", light: \"#217b58\" } as const;\n\n/** Fourth chart series (vermilion). */\nexport const chart4 = { dark: \"#e0520a\", light: \"#d32f4d\" } as const;\n\n/** Fifth chart series (reddish purple). */\nexport const chart5 = { dark: \"#ff6fad\", light: \"#b87889\" } as const;\n\n/** Sixth chart series (yellow in dark, olive in light). */\nexport const chart6 = { dark: \"#f0e442\", light: \"#546800\" } as const;\n\n/** Human notes and comment pins over visualisations, tag plans and frames. Kept apart from every step and status colour; 3:1 or more on every ground. */\nexport const annotation = { dark: \"#22c55e\", light: \"#409116\" } as const;\n\n/** Editor syntax (Monaco, Shiki, Prism): comments, 4.6:1 on `code-bg`. */\nexport const syntaxComment = \"#8c94be\";\n\n/** Editor syntax (Monaco, Shiki, Prism): strings, attribute names and inserted text, 9.9:1 on `code-bg`. */\nexport const syntaxString = \"#c3e88d\";\n\n/** Editor syntax (Monaco, Shiki, Prism): numbers, 5.8:1 on `code-bg`. */\nexport const syntaxNumber = \"#f78c6c\";\n\n/** Editor syntax (Monaco, Shiki, Prism): booleans, null and constants, 4.6:1 on `code-bg`. */\nexport const syntaxConstant = \"#ff5d78\";\n\n/** Editor syntax (Monaco, Shiki, Prism): keywords and storage modifiers, 5.2:1 on `code-bg`. */\nexport const syntaxKeyword = \"#c084fc\";\n\n/** Editor syntax (Monaco, Shiki, Prism): functions and built-ins, 5.9:1 on `code-bg`. */\nexport const syntaxFunction = \"#82aaff\";\n\n/** Editor syntax (Monaco, Shiki, Prism): types and class names, 9.1:1 on `code-bg`. */\nexport const syntaxType = \"#ffcb6b\";\n\n/** Editor syntax (Monaco, Shiki, Prism): operators and regular expressions, 9.0:1 on `code-bg`. */\nexport const syntaxOperator = \"#89ddff\";\n\n/** Editor syntax (Monaco, Shiki, Prism): punctuation and delimiters, 5.7:1 on `code-bg`. */\nexport const syntaxPunct = \"#c792ea\";\n\n/** Editor syntax (Monaco, Shiki, Prism): tags, invalid and deleted tokens, 4.6:1 on `code-bg`. */\nexport const syntaxTag = \"#ff5d79\";\n\n/** Editor syntax (Monaco, Shiki, Prism): namespaces, 8.1:1 on `code-bg`. */\nexport const syntaxNamespace = \"#b2ccd6\";\n\n/** Editor gutter line numbers on `code-bg`. Decorative, below 3:1. */\nexport const codeLineNumber = \"#676e95\";\n\n/** Editor selection over `code-bg`; `code-fg` stays at 5.4:1 on it. */\nexport const codeSelection = \"#717cb450\";\n\n/** Inserted lines in diff views over `code-bg`; `code-fg` stays at 5.4:1. */\nexport const codeInsertedBg = \"#c3e88d26\";\n\n/** Deleted lines in diff views over `code-bg`; `code-fg` stays at 6.6:1. */\nexport const codeDeletedBg = \"#ff5d7926\";\n\n/** Font family `sans`. */\nexport const fontSans = \"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif\";\n\n/** Font family `mono`. */\nexport const fontMono = \"SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace\";\n\n/** Font family `viz`. */\nexport const fontViz = \"'Geist', system-ui, sans-serif\";\n\n/** Font family `viz-mono`. */\nexport const fontVizMono = \"'Geist Mono', monospace\";\n\n/** The one transition duration. Read it as var(--motion): reduced motion sets it to 0ms. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const motion = \"180ms\";\n\n/** The one transition easing, beside var(--motion). Read it as var(--ease). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const ease = \"cubic-bezier(0.2, 0, 0, 1)\";\n\n/** Type style `display`: Hero H1 only. Fluid: clamp(38px, 6vw, 64px), max 20ch, text-wrap balance. One phrase may take `primary`. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeDisplay = { size: \"64px\", lineHeight: 1.08, weight: 700, tracking: \"-0.025em\", family: fontSans } as const;\n\n/** Type style `heading-xl`: Large split-section heading (More features). clamp(28px, 3.6vw, 44px). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeHeadingXl = { size: \"44px\", lineHeight: 1.1, weight: 700, tracking: \"-0.025em\", family: fontSans } as const;\n\n/** Type style `heading-lg`: Section H2. clamp(28px, 3.6vw, 40px), text-wrap balance. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeHeadingLg = { size: \"40px\", lineHeight: 1.15, weight: 700, tracking: \"-0.02em\", family: fontSans } as const;\n\n/** Type style `heading-md`: Feature H2 beside its explainer. clamp(26px, 3.2vw, 36px). Also the docs page title (h1), not fluid. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeHeadingMd = { size: \"36px\", lineHeight: 1.15, weight: 700, tracking: \"-0.02em\", family: fontSans } as const;\n\n/** Type style `footer-statement`: The footer's one-line brand statement. clamp(24px, 3.2vw, 34px), max 22ch. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeFooterStatement = { size: \"34px\", lineHeight: 1.2, weight: 700, tracking: \"-0.02em\", family: fontSans } as const;\n\n/** Type style `kicker-lg`: Large coloured kicker above `heading-xl`, in `primary`. clamp(22px, 2.4vw, 28px). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeKickerLg = { size: \"28px\", lineHeight: 1.2, weight: 700, tracking: \"-0.01em\", family: fontSans } as const;\n\n/** Type style `title-plan`: Plan tier name. Also docs h2. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeTitlePlan = { size: \"24px\", lineHeight: 1.3, weight: 700, tracking: \"-0.015em\", family: fontSans } as const;\n\n/** Type style `title-card`: Problem-card H3. Also docs h3; docs h4 takes its weight. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeTitleCard = { size: \"19px\", lineHeight: 1.35, weight: 600, family: fontSans } as const;\n\n/** Type style `title-item`: Feature-list H3. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeTitleItem = { size: \"18px\", lineHeight: 1.35, weight: 600, family: fontSans } as const;\n\n/** Type style `lead`: Hero sub-copy in `fg-2`, max 58ch. clamp(18px, 2vw, 21px). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeLead = { size: \"21px\", lineHeight: 1.65, weight: 400, family: fontSans } as const;\n\n/** Type style `body-lg`: Feature explainer paragraphs, FAQ questions (600). Also docs h4, at the `title-card` weight. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeBodyLg = { size: \"17px\", lineHeight: 1.65, weight: 400, family: fontSans } as const;\n\n/** Type style `body`: Default body copy, docs body copy included; buttons (600). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeBody = { size: \"16px\", lineHeight: 1.65, weight: 400, family: fontSans } as const;\n\n/** Type style `ui`: Nav links, list items, footer links. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeUi = { size: \"15px\", lineHeight: 1.5, weight: 500, family: fontSans } as const;\n\n/** Type style `small`: Announcement bar, `Docs →` links (500), copyright (400). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeSmall = { size: \"14px\", lineHeight: 1.5, weight: 600, family: fontSans } as const;\n\n/** Type style `eyebrow`: Section eyebrow, UPPERCASE, in `link`. One line that states the problem the section answers. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeEyebrow = { size: \"13px\", lineHeight: 1.5, weight: 600, tracking: \"0.12em\", family: fontSans } as const;\n\n/** Type style `label`: Plan tier label, UPPERCASE, in `fg-3` (`link` on the highlighted plan). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeLabel = { size: \"12px\", lineHeight: 1.5, weight: 700, tracking: \"0.12em\", family: fontSans } as const;\n\n/** Type style `code-command`: Install-command chip. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeCodeCommand = { size: \"15px\", lineHeight: 1.5, weight: 500, family: fontMono } as const;\n\n/** Type style `code-step`: Mono step numbers (01, 02, 03) in `link`. Also code panes: the explorer's code editors and docs code blocks. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeCodeStep = { size: \"13px\", lineHeight: 1.5, weight: 400, family: fontMono } as const;\n\n/** Type style `code-inline`: Inline code inside prose, docs inline code included: `surface-2` fill, `border` outline, radius-sm. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeCodeInline = { size: \"0.88em\", lineHeight: 1.5, weight: 400, family: fontMono } as const;\n\n/** Type style `viz-body`: Captions inside product visualisations (Geist). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizBody = { size: \"15px\", lineHeight: 1.5, weight: 400, family: fontViz } as const;\n\n/** Type style `viz-chip`: Step pills inside visualisations. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizChip = { size: \"13px\", lineHeight: 1.4, weight: 500, family: fontViz } as const;\n\n/** Type style `viz-code`: Code pane inside visualisations (Geist Mono). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizCode = { size: \"12px\", lineHeight: 1.8, weight: 400, family: fontVizMono } as const;\n\n/** Type style `viz-legend`: Event-part legend (Geist Mono) in `viz-fg-2`. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizLegend = { size: \"11px\", lineHeight: 1.5, weight: 400, family: fontVizMono } as const;\n\n/** Type style `product-heading`: Page and dialog titles in the app, the explorer and Tag Mode. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductHeading = { size: \"20px\", lineHeight: 1.3, weight: 600, family: fontSans } as const;\n\n/** Type style `product-title`: Panel, card and section titles in product UI. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductTitle = { size: \"16px\", lineHeight: 1.4, weight: 600, family: fontSans } as const;\n\n/** Type style `product-body`: Default product copy: body text, form fields, table cells, buttons (600). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductBody = { size: \"14px\", lineHeight: 1.5, weight: 400, family: fontSans } as const;\n\n/** Type style `product-small`: Secondary rows, help text and dense tables. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductSmall = { size: \"13px\", lineHeight: 1.45, weight: 400, family: fontSans } as const;\n\n/** Type style `product-caption`: Captions, badges and meta labels. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductCaption = { size: \"12px\", lineHeight: 1.4, weight: 500, family: fontSans } as const;\n\n/** Type style `product-micro`: Dense canvas labels only: node badges, edge labels, mark labels and compact tooltip meta. Never body copy, never interactive text. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductMicro = { size: \"11px\", lineHeight: 1.3, weight: 500, family: fontSans } as const;\n","import {\n eventAction,\n eventContext,\n eventEntity,\n eventGlobals,\n eventProperty,\n} from '@walkeros/explorer/design';\nimport type { WalkerOSAddon } from '../types';\n\nexport type HighlightKind = keyof NonNullable<WalkerOSAddon['highlights']>;\nexport type AttributeKind =\n | 'entity'\n | 'action'\n | 'context'\n | 'globals'\n | 'data';\n\n// Event colours of the walkerOS design system, their dark values: every use\n// pairs them with the dark visualisation ground vizBg.\nexport const highlightColors: Record<HighlightKind, string> = {\n globals: eventGlobals.dark,\n context: eventContext.dark,\n entity: eventEntity.dark,\n property: eventProperty.dark,\n action: eventAction.dark,\n};\n\n// Attribute badges name the property kind \"data\".\nexport const attributeColors: Record<AttributeKind, string> = {\n entity: highlightColors.entity,\n action: highlightColors.action,\n context: highlightColors.context,\n globals: highlightColors.globals,\n data: highlightColors.property,\n};\n","// CSS utilities for highlighting DOM elements\nimport { vizBg } from '@walkeros/explorer/design';\nimport { highlightColors } from './eventColors';\n\n// Stacked 2px rings in the given event colours, closed by a 1px edge in the\n// dark visualisation ground so the outline reads on light and dark stories.\nconst outline = (...colors: string[]): string =>\n [\n ...colors.map((color, index) => `0 0 0 ${(index + 1) * 2}px ${color}`),\n `0 0 0 ${colors.length * 2 + 1}px ${vizBg}`,\n ].join(', ');\n\n// Generate dynamic CSS based on prefix\nexport const generateHighlightCSS = (prefix: string): string => {\n const { globals, context, entity, property, action } = highlightColors;\n\n // Define selectors based on prefix\n const globalsSelector = `${prefix}globals`;\n const contextSelector = `${prefix}context`;\n const baseSelector = prefix;\n const propertySelector = `${prefix}property`;\n\n // Template CSS with actual selectors\n const cssTemplate = `\n .highlight-globals [${globalsSelector}] {\n box-shadow: ${outline(globals)} !important;\n }\n\n .highlight-context [${contextSelector}] {\n box-shadow: ${outline(context)} !important;\n }\n\n .highlight-entity [${baseSelector}] {\n box-shadow: ${outline(entity)} !important;\n }\n\n .highlight-property [${propertySelector}] {\n box-shadow: ${outline(property)} !important;\n }\n\n .highlight-action [${prefix}action] {\n box-shadow: ${outline(action)} !important;\n }\n\n /* Combined highlights with layered solid borders */\n .highlight-entity.highlight-action [${baseSelector}][${prefix}action] {\n box-shadow: ${outline(action, entity)} !important;\n }\n\n .highlight-entity.highlight-context [${baseSelector}][${contextSelector}] {\n box-shadow: ${outline(entity, context)} !important;\n }\n\n .highlight-entity.highlight-property [${baseSelector}][${propertySelector}] {\n box-shadow: ${outline(entity, property)} !important;\n }\n\n .highlight-action.highlight-context [${prefix}action][${contextSelector}] {\n box-shadow: ${outline(action, context)} !important;\n }\n\n .highlight-context.highlight-property [${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(context, property)} !important;\n }\n\n .highlight-action.highlight-property [${prefix}action][${propertySelector}] {\n box-shadow: ${outline(action, property)} !important;\n }\n\n /* Globals combinations */\n .highlight-globals.highlight-entity [${globalsSelector}][${baseSelector}] {\n box-shadow: ${outline(globals, entity)} !important;\n }\n\n .highlight-globals.highlight-action [${globalsSelector}][${prefix}action] {\n box-shadow: ${outline(globals, action)} !important;\n }\n\n .highlight-globals.highlight-context [${globalsSelector}][${contextSelector}] {\n box-shadow: ${outline(globals, context)} !important;\n }\n\n .highlight-globals.highlight-property [${globalsSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, property)} !important;\n }\n\n /* Triple combinations with globals */\n .highlight-globals.highlight-entity.highlight-action\n [${globalsSelector}][${baseSelector}][${prefix}action] {\n box-shadow: ${outline(globals, entity, action)} !important;\n }\n\n .highlight-globals.highlight-entity.highlight-context\n [${globalsSelector}][${baseSelector}][${contextSelector}] {\n box-shadow: ${outline(globals, entity, context)} !important;\n }\n\n .highlight-globals.highlight-entity.highlight-property\n [${globalsSelector}][${baseSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, entity, property)} !important;\n }\n\n .highlight-globals.highlight-action.highlight-context\n [${globalsSelector}][${prefix}action][${contextSelector}] {\n box-shadow: ${outline(globals, action, context)} !important;\n }\n\n .highlight-globals.highlight-action.highlight-property\n [${globalsSelector}][${prefix}action][${propertySelector}] {\n box-shadow: ${outline(globals, action, property)} !important;\n }\n\n .highlight-globals.highlight-context.highlight-property\n [${globalsSelector}][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, context, property)} !important;\n }\n\n /* Triple combinations with distinct layers */\n .highlight-entity.highlight-action.highlight-context\n [${baseSelector}][${prefix}action][${contextSelector}] {\n box-shadow: ${outline(action, entity, context)} !important;\n }\n\n /* Triple combinations with property */\n .highlight-entity.highlight-action.highlight-property\n [${baseSelector}][${prefix}action][${propertySelector}] {\n box-shadow: ${outline(action, entity, property)} !important;\n }\n\n .highlight-entity.highlight-context.highlight-property\n [${baseSelector}][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(context, entity, property)} !important;\n }\n\n .highlight-action.highlight-context.highlight-property\n [${prefix}action][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(action, context, property)} !important;\n }\n\n /* Quadruple combinations with globals */\n .highlight-globals.highlight-entity.highlight-action.highlight-context\n [${globalsSelector}][${baseSelector}][${prefix}action][${contextSelector}] {\n box-shadow: ${outline(globals, entity, action, context)} !important;\n }\n\n .highlight-globals.highlight-entity.highlight-action.highlight-property\n [${globalsSelector}][${baseSelector}][${prefix}action][${propertySelector}] {\n box-shadow: ${outline(globals, entity, action, property)} !important;\n }\n\n .highlight-globals.highlight-entity.highlight-context.highlight-property\n [${globalsSelector}][${baseSelector}][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, entity, context, property)} !important;\n }\n\n .highlight-globals.highlight-action.highlight-context.highlight-property\n [${globalsSelector}][${prefix}action][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, action, context, property)} !important;\n }\n\n /* Quadruple combination */\n .highlight-entity.highlight-action.highlight-context.highlight-property\n [${baseSelector}][${prefix}action][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(action, entity, context, property)} !important;\n }\n\n /* Quintuple combination with all attributes */\n .highlight-globals.highlight-entity.highlight-action.highlight-context.highlight-property\n [${globalsSelector}][${baseSelector}][${prefix}action][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, entity, action, context, property)} !important;\n }\n `;\n\n return cssTemplate;\n};\n\n// Function to inject highlighting CSS into story document\nexport const injectHighlightingCSS = (\n storyDoc: Document,\n prefix: string = 'data-elb',\n): void => {\n // Remove existing styles\n const existingStyle = storyDoc.querySelector('#walkeros-highlighting');\n if (existingStyle) {\n existingStyle.remove();\n }\n\n const highlightingStyleElement = storyDoc.createElement('style');\n highlightingStyleElement.id = 'walkeros-highlighting';\n const css = generateHighlightCSS(prefix);\n highlightingStyleElement.textContent = css;\n\n storyDoc.head.appendChild(highlightingStyleElement);\n};\n","// Utilities for managing DOM highlighting\n\nimport type { WalkerOSAddon } from '../types';\nimport {\n getStoryDocument,\n getStoryRootElement,\n enhanceProperties,\n} from './domUtils';\nimport { injectHighlightingCSS } from './cssUtils';\n\n// Function to apply highlighting to story root\nexport const applyHighlighting = (\n highlights: WalkerOSAddon['highlights'],\n prefix: string = 'data-elb',\n): void => {\n const storyRoot = getStoryRootElement();\n if (!storyRoot) return;\n\n // Remove existing highlighting classes\n storyRoot.classList.remove('highlight-context');\n storyRoot.classList.remove('highlight-entity');\n storyRoot.classList.remove('highlight-property');\n storyRoot.classList.remove('highlight-action');\n storyRoot.classList.remove('highlight-globals');\n\n if (!highlights) return;\n\n // Re-enhance properties FIRST to ensure they're marked\n enhanceProperties(storyRoot, prefix);\n\n // Then add specific highlighting classes\n if (highlights.context) storyRoot.classList.add('highlight-context');\n if (highlights.entity) storyRoot.classList.add('highlight-entity');\n if (highlights.property) storyRoot.classList.add('highlight-property');\n if (highlights.action) storyRoot.classList.add('highlight-action');\n if (highlights.globals) storyRoot.classList.add('highlight-globals');\n};\n\n// Combined function to inject CSS and apply highlighting\nexport const setupHighlighting = (\n highlights: WalkerOSAddon['highlights'],\n prefix: string = 'data-elb',\n): void => {\n const storyDoc = getStoryDocument();\n\n // Always inject CSS first\n injectHighlightingCSS(storyDoc, prefix);\n\n // Then apply highlighting\n applyHighlighting(highlights, prefix);\n};\n","import type { WalkerOSAddon } from './types';\nimport type { DecoratorFunction } from 'storybook/internal/types';\nimport { addons } from 'storybook/preview-api';\nimport { getAllEvents, getGlobals } from '@walkeros/web-source-browser';\n\nimport { ADDON_ID, EVENTS } from './constants';\nimport { initializeWalker } from './walker';\nimport { getStoryRootElement, enhanceProperties } from './utils/domUtils';\nimport { buildAttributeTree } from './utils/attributeTreeUtils';\nimport { setupHighlighting } from './utils/highlightingUtils';\n\n// Set up the channel listener globally, not per story\nconst channel = addons.getChannel();\nlet currentStoryId: string | null = null;\n\n// Global listener for the request events\nchannel.addListener(EVENTS.REQUEST, (config: WalkerOSAddon) => {\n const storyRoot = getStoryRootElement();\n if (!storyRoot) {\n channel.emit(EVENTS.RESULT, []);\n return;\n }\n\n // Enhance DOM with property attributes\n enhanceProperties(storyRoot, config.prefix || 'data-elb');\n\n const events = getAllEvents(storyRoot as Element, config.prefix);\n\n // Collect globals from data-elbglobals attributes\n const globals = getGlobals(config.prefix || 'data-elb', storyRoot as Element);\n\n // Add globals to each event if any globals exist\n const eventsWithGlobals = events.map((event) => {\n if (Object.keys(globals).length > 0) {\n return { ...event, globals };\n }\n return event;\n });\n\n // Send the result back to the manager\n channel.emit(EVENTS.RESULT, eventsWithGlobals);\n});\n\n// Global listener for highlighting events\nchannel.addListener(EVENTS.HIGHLIGHT, (config: WalkerOSAddon) => {\n setupHighlighting(config.highlights, config.prefix);\n});\n\n// Global listener for attribute tree requests\nchannel.addListener(EVENTS.ATTRIBUTES_REQUEST, (config: WalkerOSAddon) => {\n const storyRoot = getStoryRootElement();\n if (!storyRoot) {\n channel.emit(EVENTS.ATTRIBUTES_RESULT, { nodes: [], globals: [] });\n return;\n }\n\n // Build the skeleton tree ({ nodes, globals })\n const result = buildAttributeTree(\n storyRoot as Element,\n config.prefix || 'data-elb',\n );\n\n // Send the result back to the manager\n channel.emit(EVENTS.ATTRIBUTES_RESULT, result);\n});\n\nexport const withRoundTrip: DecoratorFunction = (storyFn, context) => {\n // Check if story changed and auto-run is enabled\n const storyId = context.id;\n const hasStoryChanged = currentStoryId !== storyId;\n const { parameters } = context;\n const autoRefresh = parameters?.[ADDON_ID]?.autoRefresh;\n\n if (hasStoryChanged) {\n currentStoryId = storyId;\n }\n\n const result = storyFn();\n\n // Initialize walker and inject CSS after story renders\n setTimeout(() => {\n // Initialize walkerOS for live event capture\n const prefix = parameters?.[ADDON_ID]?.prefix || 'data-elb';\n initializeWalker({ prefix, autoRefresh }).catch((err) => {\n console.error('Walker initialization failed:', err);\n });\n\n // Inject highlighting CSS and enhance properties\n const storyRoot = getStoryRootElement();\n if (storyRoot) {\n setupHighlighting(undefined, prefix);\n enhanceProperties(storyRoot, prefix);\n }\n\n // Auto-run walker if story changed and auto-refresh is enabled\n if (hasStoryChanged && autoRefresh && window.__storybookElb) {\n window.__storybookElb('walker run');\n }\n }, 200);\n\n return result;\n};\n","/**\n * A decorator is a way to wrap a story in extra “rendering” functionality. Many addons define decorators\n * in order to augment stories:\n * - with extra rendering\n * - gather details about how a story is rendered\n *\n * When writing stories, decorators are typically used to wrap stories with extra markup or context mocking.\n *\n * https://storybook.js.org/docs/react/writing-stories/decorators\n */\nimport type { ProjectAnnotations, Renderer } from 'storybook/internal/types';\n\nimport { ADDON_ID } from './constants';\nimport { withRoundTrip } from './withRoundTrip';\n\n/**\n * Note: if you want to use JSX in this file, rename it to `preview.tsx`\n * and update the entry prop in tsup.config.ts to use \"src/preview.tsx\",\n */\n\nconst preview: ProjectAnnotations<Renderer> = {\n decorators: [withRoundTrip],\n parameters: {\n [ADDON_ID]: {\n autoRefresh: true,\n prefix: 'data-elb',\n },\n },\n};\n\nexport default preview;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/constants.ts","../src/walker.ts","../src/utils/domUtils.ts","../src/utils/attributeTreeUtils.ts","../../explorer/src/design/index.ts","../src/utils/eventColors.ts","../src/utils/cssUtils.ts","../src/utils/highlightingUtils.ts","../src/withRoundTrip.ts","../src/preview.ts"],"names":["ADDON_ID","EVENTS","destinationConsole","event","context","destinationLive","channel","addons","getIframeContext","iframe","e","initializeWalker","config","iframeDoc","iframeWin","result","startFlow","sourceBrowser","collector","elb","error","getStoryDocument","getStoryRootElement","storyDoc","selectors","selector","element","getElementPath","el","path","current","c","enhanceProperties","storyRoot","prefix","allElements","scopedAttr","getElbAttributeName","Const","actionAttr","contextAttr","globalsAttr","attr","generateElementHTML","tagName","propertyMarker","attribs","PRIORITY","addProperty","acc","key","value","origin","existing","collectValues","name","values","getElbValues","k","v","buildAttributeTree","scope","entityAttr","scopedName","entityEls","entitySet","owningEntity","cur","nodeMap","entity","props","owned","child","o","anc","g","roots","node","parentEl","parentNode","globalsValues","getGlobals","globals","vizBg","eventEntity","eventAction","eventProperty","eventContext","eventGlobals","highlightColors","outline","colors","color","index","generateHighlightCSS","property","action","globalsSelector","contextSelector","baseSelector","propertySelector","injectHighlightingCSS","existingStyle","highlightingStyleElement","css","applyHighlighting","highlights","setupHighlighting","currentStoryId","events","getAllEvents","eventsWithGlobals","withRoundTrip","storyFn","_a","storyId","hasStoryChanged","parameters","autoRefresh","err","preview","preview_default"],"mappings":"+JAAO,IAAMA,CAAAA,CAAW,UAAA,CAIjB,IAAMC,CAAAA,CAAS,CACpB,MAAA,CAAQ,CAAA,EAAGD,CAAQ,UACnB,OAAA,CAAS,CAAA,EAAGA,CAAQ,CAAA,QAAA,CAAA,CACpB,SAAA,CAAW,CAAA,EAAGA,CAAQ,CAAA,UAAA,CAAA,CACtB,UAAA,CAAY,CAAA,EAAGA,CAAQ,CAAA,WAAA,CAAA,CACvB,iBAAA,CAAmB,CAAA,EAAGA,CAAQ,CAAA,kBAAA,CAAA,CAC9B,mBAAoB,CAAA,EAAGA,CAAQ,CAAA,mBAAA,CACjC,CAAA,CCGA,IAAME,CAAAA,CAAqB,CACzB,IAAA,CAAM,SAAA,CACN,IAAA,CAAM,CAACC,CAAAA,CAAuBC,IAAqC,CACjE,OAAA,CAAQ,GAAA,CAAI,kBAAA,CAAoBD,CAAK,EACvC,CAAA,CACA,MAAA,CAAQ,EACV,CAAA,CAGME,CAAAA,CAAkB,CACtB,IAAA,CAAM,MAAA,CACN,IAAA,CAAM,CAACF,CAAAA,CAAuBC,CAAAA,GAAqC,CAEjE,IAAME,CAAAA,CAAUC,iBAAAA,CAAO,UAAA,EAAW,CAC9BD,GACFA,CAAAA,CAAQ,IAAA,CAAKL,CAAAA,CAAO,UAAA,CAAYE,CAAK,EAEzC,CAAA,CACA,MAAA,CAAQ,EACV,CAAA,CAGA,SA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Q,UACV,CACF,CACF,CAAA,CAEOyH,EAAAA,CAAQD","file":"preview.cjs","sourcesContent":["export const ADDON_ID = 'walkerOS';\nexport const PANEL_ID = `${ADDON_ID}/panel`;\nexport const KEY = `walkerOS`;\n\nexport const EVENTS = {\n RESULT: `${ADDON_ID}/result`,\n REQUEST: `${ADDON_ID}/request`,\n HIGHLIGHT: `${ADDON_ID}/highlight`,\n LIVE_EVENT: `${ADDON_ID}/live-event`,\n ATTRIBUTES_RESULT: `${ADDON_ID}/attributes-result`,\n ATTRIBUTES_REQUEST: `${ADDON_ID}/attributes-request`,\n};\n","import type { Collector, WalkerOS, Destination } from '@walkeros/core';\nimport { startFlow } from '@walkeros/collector';\nimport { sourceBrowser } from '@walkeros/web-source-browser';\nimport { addons } from 'storybook/preview-api';\nimport { EVENTS } from './constants';\n\ndeclare global {\n interface Window {\n __storybookElb: WalkerOS.Elb;\n __storybookWalker: Collector.Instance;\n }\n}\n\n// Simple console destination for Storybook\nconst destinationConsole = {\n type: 'console',\n push: (event: WalkerOS.Event, context: Destination.PushContext) => {\n console.log('Storybook Event:', event);\n },\n config: {},\n};\n\n// Live destination for Storybook panel\nconst destinationLive = {\n type: 'live',\n push: (event: WalkerOS.Event, context: Destination.PushContext) => {\n // Send event to Storybook panel for live display\n const channel = addons.getChannel();\n if (channel) {\n channel.emit(EVENTS.LIVE_EVENT, event);\n }\n },\n config: {},\n};\n\n// Function to get Storybook iframe context\nfunction getIframeContext() {\n try {\n // Try to get iframe from parent document (manager context)\n const iframe = parent.document.querySelector(\n '#storybook-preview-iframe',\n ) as HTMLIFrameElement;\n if (iframe?.contentDocument && iframe?.contentWindow) {\n return {\n document: iframe.contentDocument,\n window: iframe.contentWindow,\n };\n }\n } catch (e) {\n // If we can't access parent, we're likely already in iframe context\n }\n\n // Fallback to current context\n return { document, window };\n}\n\nexport async function initializeWalker(config?: {\n prefix?: string;\n autoRefresh?: boolean;\n}): Promise<void> {\n // Skip initialization if already done\n if (window.__storybookWalker) return;\n\n try {\n // Get iframe context for proper event capture\n const { document: iframeDoc, window: iframeWin } = getIframeContext();\n\n if (!iframeDoc) {\n console.warn('Document not available, skipping walkerOS initialization');\n return;\n }\n\n // Create collector with browser source and destinations\n const result = await startFlow({\n consent: { functional: true },\n sources: {\n browser: {\n code: sourceBrowser,\n config: {\n settings: {\n pageview: true,\n elbLayer: '__storybookElbLayer',\n elb: '__storybookElb',\n prefix: config?.prefix || 'data-elb',\n scope: iframeDoc.body || iframeDoc, // Set scope to iframe document\n },\n },\n env: {\n window: iframeWin,\n document: iframeDoc,\n },\n },\n },\n destinations: {\n console: { code: destinationConsole },\n live: { code: destinationLive },\n },\n });\n\n const { collector, elb } = result;\n\n // Verify collector was created successfully\n if (!collector) {\n throw new Error('Collector creation failed - no collector returned');\n }\n\n // Set global window objects\n window.__storybookWalker = collector;\n window.__storybookElb = elb;\n } catch (error) {\n console.error('Failed to initialize walkerOS:', error);\n }\n}\n","// DOM utilities for working with story elements\n\nimport { Const } from '@walkeros/collector';\nimport { getElbAttributeName } from '@walkeros/web-source-browser';\n\n// Function to get the story document (either iframe or main document)\nexport const getStoryDocument = (): Document => {\n // Try to find story iframe\n const iframe = document.querySelector(\n '#storybook-preview-iframe',\n ) as HTMLIFrameElement;\n if (iframe?.contentDocument) {\n return iframe.contentDocument;\n }\n // Fallback to main document\n return document;\n};\n\n// Function to get the story root element\nexport const getStoryRootElement = (): Element | null => {\n const storyDoc = getStoryDocument();\n\n // Try multiple selectors for story root\n const selectors = [\n '#storybook-root',\n '#root',\n '[data-testid=\"storybook-root\"]',\n 'body',\n ];\n\n for (const selector of selectors) {\n const element = storyDoc.querySelector(selector);\n if (element) {\n return element;\n }\n }\n\n return storyDoc.body;\n};\n\n// Helper to get element path\nexport const getElementPath = (el: Element): string => {\n const path = [];\n let current = el;\n while (current && current !== document.body && current.parentElement) {\n let selector = current.tagName.toLowerCase();\n if (current.id) {\n selector += `#${current.id}`;\n } else if (current.className && typeof current.className === 'string') {\n selector += `.${current.className\n .split(' ')\n .filter((c) => c)\n .join('.')}`;\n }\n path.unshift(selector);\n current = current.parentElement;\n }\n return path.join(' > ');\n};\n\n// Function to enhance DOM with property attributes\nexport const enhanceProperties = (\n storyRoot: Element,\n prefix: string = 'data-elb',\n): void => {\n // Find all elements with any attributes starting with prefix-\n const allElements = Array.from(storyRoot.querySelectorAll('*'));\n\n const scopedAttr = getElbAttributeName(prefix, Const.Commands.Scoped, false); // data-elb_\n const actionAttr = getElbAttributeName(prefix, Const.Commands.Action, false);\n const contextAttr = getElbAttributeName(\n prefix,\n Const.Commands.Context,\n false,\n );\n const globalsAttr = getElbAttributeName(\n prefix,\n Const.Commands.Globals,\n false,\n );\n\n allElements.forEach((el) => {\n const hasProperties = Array.from(el.attributes).some((attr) => {\n if (attr.name === scopedAttr) return true; // scoped generic data-elb_\n return (\n attr.name.startsWith(`${prefix}-`) &&\n attr.name !== actionAttr &&\n attr.name !== contextAttr &&\n attr.name !== globalsAttr\n );\n });\n\n // Mark elements with property attributes\n if (hasProperties) {\n el.setAttribute(getElbAttributeName(prefix, 'property', false), '');\n }\n });\n};\n","// Builds an entity-centric \"skeleton\" tree: each node is a data-elb entity, with\n// generic (data-elb-), scoped (data-elb_), and explicit (data-elb-<entity>)\n// values resolved onto it and tagged by origin. Interim addon-local\n// approximation of the walker's resolution (see the design doc for fidelity\n// limits: cross-DOM links, shadow piercing, exact collision priority, and\n// context ordering index are out of scope for Phase 1).\n\nimport type { WalkerOS } from '@walkeros/core';\nimport { Const } from '@walkeros/collector';\nimport {\n getElbValues,\n getElbAttributeName,\n getGlobals,\n} from '@walkeros/web-source-browser';\nimport type { AttributeNode, ResolvedProperty } from '../types';\nimport { getElementPath } from './domUtils';\n\nconst generateElementHTML = (element: Element, prefix: string): string => {\n const tagName = element.tagName.toLowerCase();\n // Hide the synthetic highlight marker (data-elbproperty) that\n // enhanceProperties stamps on the live DOM; it is an internal helper, not\n // author-written tagging, so it must not appear in the displayed markup.\n const propertyMarker = getElbAttributeName(prefix, 'property', false);\n const attribs = Array.from(element.attributes)\n .filter((a) => a.name !== propertyMarker)\n .map((a) => `${a.name}=\"${a.value}\"`);\n if (attribs.length === 0) return `<${tagName}></${tagName}>`;\n if (attribs.length === 1) return `<${tagName} ${attribs[0]}></${tagName}>`;\n return `<${tagName}\\n${attribs.map((a) => ` ${a}`).join('\\n')}\\n></${tagName}>`;\n};\n\n// Origin priority for same-key collisions (highest first). Approximate; real\n// walker priority is documented as out of scope for Phase 1.\nconst PRIORITY: Record<ResolvedProperty['origin'], number> = {\n data: 3,\n scoped: 2,\n generic: 1,\n};\n\nconst addProperty = (\n acc: Map<string, ResolvedProperty>,\n key: string,\n value: WalkerOS.Property | undefined,\n origin: ResolvedProperty['origin'],\n) => {\n if (!key) return; // never store the blank-key generic\n if (value === undefined || value === null || value === '') return;\n const existing = acc.get(key);\n if (!existing || PRIORITY[origin] > PRIORITY[existing.origin]) {\n acc.set(key, { key, value, origin });\n }\n};\n\nconst collectValues = (\n acc: Map<string, ResolvedProperty>,\n prefix: string,\n el: Element,\n name: string, // '' for generic, entity name for explicit\n origin: ResolvedProperty['origin'],\n) => {\n const values = getElbValues(prefix, el, name, true);\n Object.entries(values).forEach(([k, v]) => addProperty(acc, k, v, origin));\n};\n\nexport const buildAttributeTree = (\n scope: Element,\n prefix: string = Const.Commands.Prefix,\n): { nodes: AttributeNode[]; globals: ResolvedProperty[] } => {\n const entityAttr = getElbAttributeName(prefix); // data-elb\n const scopedName = Const.Commands.Scoped; // '_'\n\n // All entity elements (self + descendants).\n const entityEls: Element[] = [];\n if (scope.matches(`[${entityAttr}]`)) entityEls.push(scope);\n scope.querySelectorAll(`[${entityAttr}]`).forEach((el) => entityEls.push(el));\n const entitySet = new Set(entityEls);\n\n // Nearest ancestor-or-self entity for any element (DOM ancestry).\n const owningEntity = (el: Element): Element | null => {\n let cur: Element | null = el;\n while (cur) {\n if (entitySet.has(cur)) return cur;\n cur = cur.parentElement;\n }\n return null;\n };\n\n const nodeMap = new Map<Element, AttributeNode>();\n\n entityEls.forEach((el) => {\n const entity = el.getAttribute(entityAttr) || '';\n const props = new Map<string, ResolvedProperty>();\n\n // Own + owned descendants: explicit (data-elb-<entity>) and generic (data-elb-)\n const owned: Element[] = [el];\n el.querySelectorAll('*').forEach((child) => {\n if (owningEntity(child) === el) owned.push(child);\n });\n owned.forEach((o) => {\n collectValues(props, prefix, o, entity, 'data');\n collectValues(props, prefix, o, '', 'generic');\n });\n\n // Ancestors (incl. self start): explicit, generic, and scoped (data-elb_)\n let anc: Element | null = el;\n while (anc) {\n collectValues(props, prefix, anc, entity, 'data');\n collectValues(props, prefix, anc, '', 'generic');\n // scoped uses isProperty=false (suffix '_' with no dash)\n Object.entries(getElbValues(prefix, anc, scopedName, false)).forEach(\n ([k, v]) => addProperty(props, k, v, 'scoped'),\n );\n anc = anc.parentElement;\n }\n\n nodeMap.set(el, {\n element: el.tagName.toLowerCase(),\n path: getElementPath(el),\n htmlMarkup: generateElementHTML(el, prefix),\n attributes: {\n entity,\n action:\n el.getAttribute(\n getElbAttributeName(prefix, Const.Commands.Action, false),\n ) || undefined,\n context: (() => {\n const c = getElbValues(prefix, el, Const.Commands.Context, false);\n return Object.keys(c).length ? c : undefined;\n })(),\n globals: (() => {\n const g = getElbValues(prefix, el, Const.Commands.Globals, false);\n return Object.keys(g).length ? g : undefined;\n })(),\n properties: Array.from(props.values()),\n },\n children: [],\n });\n });\n\n // Nest by nearest ancestor entity.\n const roots: AttributeNode[] = [];\n nodeMap.forEach((node, el) => {\n const parentEl = el.parentElement ? owningEntity(el.parentElement) : null;\n const parentNode = parentEl ? nodeMap.get(parentEl) : undefined;\n if (parentNode) parentNode.children.push(node);\n else roots.push(node);\n });\n\n const globalsValues = getGlobals(prefix, scope);\n const globals: ResolvedProperty[] = [];\n Object.entries(globalsValues).forEach(([key, value]) => {\n if (value !== undefined && value !== null && value !== '')\n globals.push({ key, value, origin: 'data' });\n });\n\n return { nodes: roots, globals };\n};\n","/* walkerOS design constants, generated from design/tokens.json by src/design/generate.ts. Edit the JSON and run the explorer build, never this file. */\n\nexport type Theme = 'dark' | 'light';\n\n/** Page background (hero, features, FAQ, closing CTA). Default ground for `fg`, `fg-2`, `link`. */\nexport const bg = { dark: \"#111827\", light: \"#ffffff\" } as const;\n\n/** Alternating section band (Why, More features, Plans) and footer. Switch between `bg` and `bg-2` to separate sections, always with a top `border` rule. */\nexport const bg2 = { dark: \"#151e2e\", light: \"#f6f7f9\" } as const;\n\n/** Cards, plan tiers, FAQ items, the install-command chip and secondary buttons. */\nexport const surface = { dark: \"#1a2232\", light: \"#ffffff\" } as const;\n\n/** Inline code background, icon-button hover. */\nexport const surface2 = { dark: \"#222b3c\", light: \"#f1f3f6\" } as const;\n\n/** Hairline for section rules, header underline, card and input outlines. Decorative only; it does not meet 3:1, so never rely on it alone to mark a control. */\nexport const border = { dark: \"#2f3a4d\", light: \"#e3e6eb\" } as const;\n\n/** Headings and body copy on `bg`, `bg-2`, `surface`, `surface-2` (14:1+ both themes). */\nexport const fg = { dark: \"#ffffff\", light: \"#111827\" } as const;\n\n/** Secondary copy: leads, card descriptions, list items, footer links. 5.5:1+ on every ground. */\nexport const fg2 = { dark: \"#9aa3b2\", light: \"#4b5563\" } as const;\n\n/** Tertiary text: tier labels, `$` prompt, FAQ `+`, copyright, input placeholders. 4.5:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes (dark 4.6:1+, light 4.7:1+). */\nexport const fg3 = { dark: \"#8c93a2\", light: \"#656d7a\" } as const;\n\n/** elbwalker blue. Primary button fill, check icons, highlight word in the H1, focus ring, announcement bar. Light theme: 2.4:1 on white — fine as a fill under `on-primary`, too faint for text or as the only marker (flagged, kept from source). */\nexport const primary = { dark: \"#01b5e2\", light: \"#01b5e2\" } as const;\n\n/** Text and icons on `primary` fills (6.9:1). Never put white on `primary` (2.4:1) — the current walkeros.io buttons do; the relaunch fixes it. */\nexport const onPrimary = { dark: \"#04222b\", light: \"#04222b\" } as const;\n\n/** Links, eyebrows, mono step numbers; `info` and the light `focus` ring use it. 4.5:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes (dark 6.0:1+, light 4.6:1+). Underline on hover only. */\nexport const link = { dark: \"#4fb3e0\", light: \"#0076a0\" } as const;\n\n/** Soft primary halo: hero radial glow and the 4px ring around the highlighted plan. */\nexport const glow = { dark: \"rgba(1, 181, 226, 0.16)\", light: \"rgba(1, 181, 226, 0.14)\" } as const;\n\n/** Code-block panel (Palenight family), both themes. */\nexport const codeBg = \"#292d3e\";\n\n/** Code-block title bar / tab strip. */\nexport const codeBar = \"#232636\";\n\n/** Code-block outline. */\nexport const codeBorder = \"#444a5e\";\n\n/** Default code text on `code-bg` (8:1). */\nexport const codeFg = \"#bfc7d5\";\n\n/** Product visualisation panel (tagging and mapping demos). Visualisations stay dark in both themes. */\nexport const vizBg = \"#1a2232\";\n\n/** Code pane inside a visualisation. */\nexport const vizCodeBg = \"#131c2b\";\n\n/** Outlines inside visualisations. */\nexport const vizBorder = \"#334055\";\n\n/** Primary text inside visualisations. */\nexport const vizFg = \"#e8eaf0\";\n\n/** Legend and meta text inside visualisations (5.4:1 on `viz-code-bg`). */\nexport const vizFg2 = \"#8e96aa\";\n\n/** Code comments and file kinds inside visualisations. */\nexport const vizComment = \"#6c7590\";\n\n/** Gutter line numbers. Decorative, below 3:1. */\nexport const vizLineNumber = \"#4a5165\";\n\n/** Raised surfaces inside visualisations: the rendered teaser card, table rules. */\nexport const vizSurface = \"#2b3649\";\n\n/** Syntax: HTML/JSX tag names in visualisation code (6:1+ on `viz-code-bg`). */\nexport const vizTag = \"#e38fd6\";\n\n/** Syntax: string values in visualisation code and JSON cells. */\nexport const vizString = \"#e5c07b\";\n\n/** Syntax: numbers and booleans in mapping code. */\nexport const vizNumber = \"#f78c6c\";\n\n/** Syntax: punctuation and plain code text; visualisation captions. */\nexport const vizPunct = \"#9aa3b8\";\n\n/** Event part: entity (e.g. `product`). Used for syntax highlight, legend chip and the highlighted DOM region in tagging demos. The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventEntity = { dark: \"#c5e478\", light: \"#537a01\" } as const;\n\n/** Event part: action (e.g. `view`, `add`). The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventAction = { dark: \"#c792ea\", light: \"#8c59ac\" } as const;\n\n/** Event part: entity property (`data-elb-product=\"name\"`). The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventProperty = { dark: \"#f0717f\", light: \"#be4456\" } as const;\n\n/** Event part: context. The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventContext = { dark: \"#f2a65a\", light: \"#a25f06\" } as const;\n\n/** Event part: globals. The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventGlobals = { dark: \"#7fc4ea\", light: \"#317699\" } as const;\n\n/** Tag kind: user (who the visitor is). Unlike the five event parts it has no light value: it sits only on dark grounds (`viz-bg`, legends, chips, mark layers) and always pairs with its word. 5.2:1 on `viz-bg`; kept apart from `event-property`, `event-action` and `danger`. */\nexport const eventUser = \"#e65fc4\";\n\n/** Tag kind: consent (consent states and requirements). Dark grounds only, always with its word. 10.7:1 on `viz-bg`. */\nexport const eventConsent = \"#cbd5e1\";\n\n/** Brand scale (walkeros.io docs). Light-theme badge and admonition background. */\nexport const elbwalker100 = \"#edfeff\";\n\n/** Brand scale. Admonition highlight (light). */\nexport const elbwalker200 = \"#abf8ff\";\n\n/** Brand scale. Admonition text (dark). */\nexport const elbwalker300 = \"#69ecfe\";\n\n/** Brand scale. */\nexport const elbwalker400 = \"#27dbfe\";\n\n/** Brand scale anchor = `primary`. Admonition border. */\nexport const elbwalker500 = \"#01b5e2\";\n\n/** Brand scale. Badge text (light), badge fill (dark). */\nexport const elbwalker700 = \"#015372\";\n\n/** Brand scale. Admonition background (dark). */\nexport const elbwalker800 = \"#00283a\";\n\n/** Brand scale, darkest step. */\nexport const elbwalker900 = \"#000203\";\n\n/** Borders that mark a control: input, select, checkbox and switch outlines, the 1px edge of menus, popovers and dialogs, scrollbar thumbs, flow edges. 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes; `border` stays decorative. */\nexport const borderStrong = { dark: \"#6b778d\", light: \"#818a9a\" } as const;\n\n/** Focus ring, 2px solid with a 3px offset, on every interactive element: `primary` in dark, `link` in light, where `primary` is 2.2:1. 3:1 or more on every ground. */\nexport const focus = { dark: \"#01b5e2\", light: \"#0076a0\" } as const;\n\n/** Scrim behind modals and drawers. The layer above it is `surface` with a 1px `border-strong` edge, never a shadow. */\nexport const backdrop = { dark: \"rgba(3, 7, 18, 0.72)\", light: \"rgba(17, 24, 39, 0.4)\" } as const;\n\n/** Errors, destructive actions and invalid fields, always with an icon and a word. Text at 4.5:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. Kept apart from every event and step colour, `event-property` included. */\nexport const danger = { dark: \"#ffa4ac\", light: \"#b91c1c\" } as const;\n\n/** Text and icons on a `danger` fill such as a destructive button (dark 8.6:1, light 6.5:1). */\nexport const onDanger = { dark: \"#450a0a\", light: \"#ffffff\" } as const;\n\n/** Text and icons on an event-colour fill: a tag card's Done. Dark ink on the dark event values (5.6:1 or more), white on the light ones (about 5:1). */\nexport const onEvent = { dark: \"#111827\", light: \"#ffffff\" } as const;\n\n/** Success and healthy states, always with an icon and a word. Sits on the blue side of green, so it stays apart from `danger` with red-green colour blindness, and apart from every step and event colour. Text at 4.5:1 or more on every ground. */\nexport const success = { dark: \"#8cf9ff\", light: \"#07675d\" } as const;\n\n/** Warnings and states that need attention, always with an icon and a word. Kept apart from `step-transformer` and `event-context`. Text at 4.5:1 or more on every ground. */\nexport const warning = { dark: \"#cabb00\", light: \"#886000\" } as const;\n\n/** Neutral information, always with an icon and a word. The `link` colour in both themes. */\nexport const info = { dark: \"#4fb3e0\", light: \"#0076a0\" } as const;\n\n/** Tinted fill for danger banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const dangerBg = { dark: \"rgba(255, 164, 172, 0.16)\", light: \"rgba(185, 28, 28, 0.1)\" } as const;\n\n/** Tinted fill for success banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const successBg = { dark: \"rgba(140, 249, 255, 0.16)\", light: \"rgba(7, 103, 93, 0.1)\" } as const;\n\n/** Tinted fill for warning banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const warningBg = { dark: \"rgba(202, 187, 0, 0.16)\", light: \"rgba(136, 96, 0, 0.1)\" } as const;\n\n/** Tinted fill for information banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const infoBg = { dark: \"rgba(79, 179, 224, 0.16)\", light: \"rgba(0, 118, 160, 0.1)\" } as const;\n\n/** Flow step colour: sources. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepSource = { dark: \"#6ee7b7\", light: \"#428569\" } as const;\n\n/** Flow step colour: transformers. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepTransformer = { dark: \"#fcd34d\", light: \"#bb7000\" } as const;\n\n/** Flow step colour: the collector. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepCollector = { dark: \"#7dd3fc\", light: \"#0c529b\" } as const;\n\n/** Flow step colour: destinations. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepDestination = { dark: \"#c4b5fd\", light: \"#6d1fd8\" } as const;\n\n/** Flow step colour: stores. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepStore = { dark: \"#a5b4fc\", light: \"#4138c9\" } as const;\n\n/** Platform badge: web, always with the word; 3:1 or more on every ground. */\nexport const platformWeb = { dark: \"#0ea5e9\", light: \"#008ddd\" } as const;\n\n/** Platform badge: server, always with the word; 3:1 or more on every ground. */\nexport const platformServer = { dark: \"#8b5cf6\", light: \"#8043f6\" } as const;\n\n/** First chart series: `primary` in dark, `link` in light. Series take `chart-1` to `chart-6` in order; the six stay apart in normal vision and with red-green colour blindness, and reach 3:1 on every ground. Label every series. */\nexport const chart1 = { dark: \"#01b5e2\", light: \"#0076a0\" } as const;\n\n/** Second chart series (orange). */\nexport const chart2 = { dark: \"#e69f00\", light: \"#ce710c\" } as const;\n\n/** Third chart series (bluish green). */\nexport const chart3 = { dark: \"#009563\", light: \"#217b58\" } as const;\n\n/** Fourth chart series (vermilion). */\nexport const chart4 = { dark: \"#e0520a\", light: \"#d32f4d\" } as const;\n\n/** Fifth chart series (reddish purple). */\nexport const chart5 = { dark: \"#ff6fad\", light: \"#b87889\" } as const;\n\n/** Sixth chart series (yellow in dark, olive in light). */\nexport const chart6 = { dark: \"#f0e442\", light: \"#546800\" } as const;\n\n/** Human notes and comment pins over visualisations, tag plans and frames. Kept apart from every step and status colour; 3:1 or more on every ground. */\nexport const annotation = { dark: \"#22c55e\", light: \"#409116\" } as const;\n\n/** Editor syntax (Monaco, Shiki, Prism): comments, 4.6:1 on `code-bg`. */\nexport const syntaxComment = \"#8c94be\";\n\n/** Editor syntax (Monaco, Shiki, Prism): strings, attribute names and inserted text, 9.9:1 on `code-bg`. */\nexport const syntaxString = \"#c3e88d\";\n\n/** Editor syntax (Monaco, Shiki, Prism): numbers, 5.8:1 on `code-bg`. */\nexport const syntaxNumber = \"#f78c6c\";\n\n/** Editor syntax (Monaco, Shiki, Prism): booleans, null and constants, 4.6:1 on `code-bg`. */\nexport const syntaxConstant = \"#ff5d78\";\n\n/** Editor syntax (Monaco, Shiki, Prism): keywords and storage modifiers, 5.2:1 on `code-bg`. */\nexport const syntaxKeyword = \"#c084fc\";\n\n/** Editor syntax (Monaco, Shiki, Prism): functions and built-ins, 5.9:1 on `code-bg`. */\nexport const syntaxFunction = \"#82aaff\";\n\n/** Editor syntax (Monaco, Shiki, Prism): types and class names, 9.1:1 on `code-bg`. */\nexport const syntaxType = \"#ffcb6b\";\n\n/** Editor syntax (Monaco, Shiki, Prism): operators and regular expressions, 9.0:1 on `code-bg`. */\nexport const syntaxOperator = \"#89ddff\";\n\n/** Editor syntax (Monaco, Shiki, Prism): punctuation and delimiters, 5.7:1 on `code-bg`. */\nexport const syntaxPunct = \"#c792ea\";\n\n/** Editor syntax (Monaco, Shiki, Prism): tags, invalid and deleted tokens, 4.6:1 on `code-bg`. */\nexport const syntaxTag = \"#ff5d79\";\n\n/** Editor syntax (Monaco, Shiki, Prism): namespaces, 8.1:1 on `code-bg`. */\nexport const syntaxNamespace = \"#b2ccd6\";\n\n/** Editor gutter line numbers on `code-bg`. Decorative, below 3:1. */\nexport const codeLineNumber = \"#676e95\";\n\n/** Editor selection over `code-bg`; `code-fg` stays at 5.4:1 on it. */\nexport const codeSelection = \"#717cb450\";\n\n/** Inserted lines in diff views over `code-bg`; `code-fg` stays at 5.4:1. */\nexport const codeInsertedBg = \"#c3e88d26\";\n\n/** Deleted lines in diff views over `code-bg`; `code-fg` stays at 6.6:1. */\nexport const codeDeletedBg = \"#ff5d7926\";\n\n/** Font family `sans`. */\nexport const fontSans = \"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif\";\n\n/** Font family `mono`. */\nexport const fontMono = \"SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace\";\n\n/** Font family `viz`. */\nexport const fontViz = \"'Geist', system-ui, sans-serif\";\n\n/** Font family `viz-mono`. */\nexport const fontVizMono = \"'Geist Mono', monospace\";\n\n/** The one transition duration. Read it as var(--motion): reduced motion sets it to 0ms. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const motion = \"180ms\";\n\n/** The one transition easing, beside var(--motion). Read it as var(--ease). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const ease = \"cubic-bezier(0.2, 0, 0, 1)\";\n\n/** Type style `display`: Hero H1 only. Fluid: clamp(38px, 6vw, 64px), max 20ch, text-wrap balance. One phrase may take `primary`. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeDisplay = { size: \"64px\", lineHeight: 1.08, weight: 700, tracking: \"-0.025em\", family: fontSans } as const;\n\n/** Type style `heading-xl`: Large split-section heading (More features). clamp(28px, 3.6vw, 44px). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeHeadingXl = { size: \"44px\", lineHeight: 1.1, weight: 700, tracking: \"-0.025em\", family: fontSans } as const;\n\n/** Type style `heading-lg`: Section H2. clamp(28px, 3.6vw, 40px), text-wrap balance. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeHeadingLg = { size: \"40px\", lineHeight: 1.15, weight: 700, tracking: \"-0.02em\", family: fontSans } as const;\n\n/** Type style `heading-md`: Feature H2 beside its explainer. clamp(26px, 3.2vw, 36px). Also the docs page title (h1), not fluid. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeHeadingMd = { size: \"36px\", lineHeight: 1.15, weight: 700, tracking: \"-0.02em\", family: fontSans } as const;\n\n/** Type style `footer-statement`: The footer's one-line brand statement. clamp(24px, 3.2vw, 34px), max 22ch. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeFooterStatement = { size: \"34px\", lineHeight: 1.2, weight: 700, tracking: \"-0.02em\", family: fontSans } as const;\n\n/** Type style `kicker-lg`: Large coloured kicker above `heading-xl`, in `primary`. clamp(22px, 2.4vw, 28px). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeKickerLg = { size: \"28px\", lineHeight: 1.2, weight: 700, tracking: \"-0.01em\", family: fontSans } as const;\n\n/** Type style `title-plan`: Plan tier name. Also docs h2. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeTitlePlan = { size: \"24px\", lineHeight: 1.3, weight: 700, tracking: \"-0.015em\", family: fontSans } as const;\n\n/** Type style `title-card`: Problem-card H3. Also docs h3; docs h4 takes its weight. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeTitleCard = { size: \"19px\", lineHeight: 1.35, weight: 600, family: fontSans } as const;\n\n/** Type style `title-item`: Feature-list H3. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeTitleItem = { size: \"18px\", lineHeight: 1.35, weight: 600, family: fontSans } as const;\n\n/** Type style `lead`: Hero sub-copy in `fg-2`, max 58ch. clamp(18px, 2vw, 21px). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeLead = { size: \"21px\", lineHeight: 1.65, weight: 400, family: fontSans } as const;\n\n/** Type style `body-lg`: Feature explainer paragraphs, FAQ questions (600). Also docs h4, at the `title-card` weight. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeBodyLg = { size: \"17px\", lineHeight: 1.65, weight: 400, family: fontSans } as const;\n\n/** Type style `body`: Default body copy, docs body copy included; buttons (600). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeBody = { size: \"16px\", lineHeight: 1.65, weight: 400, family: fontSans } as const;\n\n/** Type style `ui`: Nav links, list items, footer links. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeUi = { size: \"15px\", lineHeight: 1.5, weight: 500, family: fontSans } as const;\n\n/** Type style `small`: Announcement bar, `Docs →` links (500), copyright (400). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeSmall = { size: \"14px\", lineHeight: 1.5, weight: 600, family: fontSans } as const;\n\n/** Type style `eyebrow`: Section eyebrow, UPPERCASE, in `link`. One line that states the problem the section answers. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeEyebrow = { size: \"13px\", lineHeight: 1.5, weight: 600, tracking: \"0.12em\", family: fontSans } as const;\n\n/** Type style `label`: Plan tier label, UPPERCASE, in `fg-3` (`link` on the highlighted plan). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeLabel = { size: \"12px\", lineHeight: 1.5, weight: 700, tracking: \"0.12em\", family: fontSans } as const;\n\n/** Type style `code-command`: Install-command chip. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeCodeCommand = { size: \"15px\", lineHeight: 1.5, weight: 500, family: fontMono } as const;\n\n/** Type style `code-step`: Mono step numbers (01, 02, 03) in `link`. Also code panes: the explorer's code editors and docs code blocks. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeCodeStep = { size: \"13px\", lineHeight: 1.5, weight: 400, family: fontMono } as const;\n\n/** Type style `code-inline`: Inline code inside prose, docs inline code included: `surface-2` fill, `border` outline, radius-sm. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeCodeInline = { size: \"0.88em\", lineHeight: 1.5, weight: 400, family: fontMono } as const;\n\n/** Type style `viz-body`: Captions inside product visualisations (Geist). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizBody = { size: \"15px\", lineHeight: 1.5, weight: 400, family: fontViz } as const;\n\n/** Type style `viz-chip`: Step pills inside visualisations. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizChip = { size: \"13px\", lineHeight: 1.4, weight: 500, family: fontViz } as const;\n\n/** Type style `viz-code`: Code pane inside visualisations (Geist Mono). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizCode = { size: \"12px\", lineHeight: 1.8, weight: 400, family: fontVizMono } as const;\n\n/** Type style `viz-legend`: Event-part legend (Geist Mono) in `viz-fg-2`. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizLegend = { size: \"11px\", lineHeight: 1.5, weight: 400, family: fontVizMono } as const;\n\n/** Type style `product-heading`: Page and dialog titles in the app, the explorer and Tag Mode. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductHeading = { size: \"20px\", lineHeight: 1.3, weight: 600, family: fontSans } as const;\n\n/** Type style `product-title`: Panel, card and section titles in product UI. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductTitle = { size: \"16px\", lineHeight: 1.4, weight: 600, family: fontSans } as const;\n\n/** Type style `product-body`: Default product copy: body text, form fields, table cells, buttons (600). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductBody = { size: \"14px\", lineHeight: 1.5, weight: 400, family: fontSans } as const;\n\n/** Type style `product-small`: Secondary rows, help text and dense tables. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductSmall = { size: \"13px\", lineHeight: 1.45, weight: 400, family: fontSans } as const;\n\n/** Type style `product-caption`: Captions, badges and meta labels. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductCaption = { size: \"12px\", lineHeight: 1.4, weight: 500, family: fontSans } as const;\n\n/** Type style `product-micro`: Dense canvas labels only: node badges, edge labels, mark labels and compact tooltip meta. Never body copy, never interactive text. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductMicro = { size: \"11px\", lineHeight: 1.3, weight: 500, family: fontSans } as const;\n","import {\n eventAction,\n eventContext,\n eventEntity,\n eventGlobals,\n eventProperty,\n} from '@walkeros/explorer/design';\nimport type { WalkerOSAddon } from '../types';\n\nexport type HighlightKind = keyof NonNullable<WalkerOSAddon['highlights']>;\nexport type AttributeKind =\n | 'entity'\n | 'action'\n | 'context'\n | 'globals'\n | 'data';\n\n// Event colours of the walkerOS design system, their dark values: every use\n// pairs them with the dark visualisation ground vizBg.\nexport const highlightColors: Record<HighlightKind, string> = {\n globals: eventGlobals.dark,\n context: eventContext.dark,\n entity: eventEntity.dark,\n property: eventProperty.dark,\n action: eventAction.dark,\n};\n\n// Attribute badges name the property kind \"data\".\nexport const attributeColors: Record<AttributeKind, string> = {\n entity: highlightColors.entity,\n action: highlightColors.action,\n context: highlightColors.context,\n globals: highlightColors.globals,\n data: highlightColors.property,\n};\n","// CSS utilities for highlighting DOM elements\nimport { vizBg } from '@walkeros/explorer/design';\nimport { highlightColors } from './eventColors';\n\n// Stacked 2px rings in the given event colours, closed by a 1px edge in the\n// dark visualisation ground so the outline reads on light and dark stories.\nconst outline = (...colors: string[]): string =>\n [\n ...colors.map((color, index) => `0 0 0 ${(index + 1) * 2}px ${color}`),\n `0 0 0 ${colors.length * 2 + 1}px ${vizBg}`,\n ].join(', ');\n\n// Generate dynamic CSS based on prefix\nexport const generateHighlightCSS = (prefix: string): string => {\n const { globals, context, entity, property, action } = highlightColors;\n\n // Define selectors based on prefix\n const globalsSelector = `${prefix}globals`;\n const contextSelector = `${prefix}context`;\n const baseSelector = prefix;\n const propertySelector = `${prefix}property`;\n\n // Template CSS with actual selectors\n const cssTemplate = `\n .highlight-globals [${globalsSelector}] {\n box-shadow: ${outline(globals)} !important;\n }\n\n .highlight-context [${contextSelector}] {\n box-shadow: ${outline(context)} !important;\n }\n\n .highlight-entity [${baseSelector}] {\n box-shadow: ${outline(entity)} !important;\n }\n\n .highlight-property [${propertySelector}] {\n box-shadow: ${outline(property)} !important;\n }\n\n .highlight-action [${prefix}action] {\n box-shadow: ${outline(action)} !important;\n }\n\n /* Combined highlights with layered solid borders */\n .highlight-entity.highlight-action [${baseSelector}][${prefix}action] {\n box-shadow: ${outline(action, entity)} !important;\n }\n\n .highlight-entity.highlight-context [${baseSelector}][${contextSelector}] {\n box-shadow: ${outline(entity, context)} !important;\n }\n\n .highlight-entity.highlight-property [${baseSelector}][${propertySelector}] {\n box-shadow: ${outline(entity, property)} !important;\n }\n\n .highlight-action.highlight-context [${prefix}action][${contextSelector}] {\n box-shadow: ${outline(action, context)} !important;\n }\n\n .highlight-context.highlight-property [${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(context, property)} !important;\n }\n\n .highlight-action.highlight-property [${prefix}action][${propertySelector}] {\n box-shadow: ${outline(action, property)} !important;\n }\n\n /* Globals combinations */\n .highlight-globals.highlight-entity [${globalsSelector}][${baseSelector}] {\n box-shadow: ${outline(globals, entity)} !important;\n }\n\n .highlight-globals.highlight-action [${globalsSelector}][${prefix}action] {\n box-shadow: ${outline(globals, action)} !important;\n }\n\n .highlight-globals.highlight-context [${globalsSelector}][${contextSelector}] {\n box-shadow: ${outline(globals, context)} !important;\n }\n\n .highlight-globals.highlight-property [${globalsSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, property)} !important;\n }\n\n /* Triple combinations with globals */\n .highlight-globals.highlight-entity.highlight-action\n [${globalsSelector}][${baseSelector}][${prefix}action] {\n box-shadow: ${outline(globals, entity, action)} !important;\n }\n\n .highlight-globals.highlight-entity.highlight-context\n [${globalsSelector}][${baseSelector}][${contextSelector}] {\n box-shadow: ${outline(globals, entity, context)} !important;\n }\n\n .highlight-globals.highlight-entity.highlight-property\n [${globalsSelector}][${baseSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, entity, property)} !important;\n }\n\n .highlight-globals.highlight-action.highlight-context\n [${globalsSelector}][${prefix}action][${contextSelector}] {\n box-shadow: ${outline(globals, action, context)} !important;\n }\n\n .highlight-globals.highlight-action.highlight-property\n [${globalsSelector}][${prefix}action][${propertySelector}] {\n box-shadow: ${outline(globals, action, property)} !important;\n }\n\n .highlight-globals.highlight-context.highlight-property\n [${globalsSelector}][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, context, property)} !important;\n }\n\n /* Triple combinations with distinct layers */\n .highlight-entity.highlight-action.highlight-context\n [${baseSelector}][${prefix}action][${contextSelector}] {\n box-shadow: ${outline(action, entity, context)} !important;\n }\n\n /* Triple combinations with property */\n .highlight-entity.highlight-action.highlight-property\n [${baseSelector}][${prefix}action][${propertySelector}] {\n box-shadow: ${outline(action, entity, property)} !important;\n }\n\n .highlight-entity.highlight-context.highlight-property\n [${baseSelector}][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(context, entity, property)} !important;\n }\n\n .highlight-action.highlight-context.highlight-property\n [${prefix}action][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(action, context, property)} !important;\n }\n\n /* Quadruple combinations with globals */\n .highlight-globals.highlight-entity.highlight-action.highlight-context\n [${globalsSelector}][${baseSelector}][${prefix}action][${contextSelector}] {\n box-shadow: ${outline(globals, entity, action, context)} !important;\n }\n\n .highlight-globals.highlight-entity.highlight-action.highlight-property\n [${globalsSelector}][${baseSelector}][${prefix}action][${propertySelector}] {\n box-shadow: ${outline(globals, entity, action, property)} !important;\n }\n\n .highlight-globals.highlight-entity.highlight-context.highlight-property\n [${globalsSelector}][${baseSelector}][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, entity, context, property)} !important;\n }\n\n .highlight-globals.highlight-action.highlight-context.highlight-property\n [${globalsSelector}][${prefix}action][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, action, context, property)} !important;\n }\n\n /* Quadruple combination */\n .highlight-entity.highlight-action.highlight-context.highlight-property\n [${baseSelector}][${prefix}action][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(action, entity, context, property)} !important;\n }\n\n /* Quintuple combination with all attributes */\n .highlight-globals.highlight-entity.highlight-action.highlight-context.highlight-property\n [${globalsSelector}][${baseSelector}][${prefix}action][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, entity, action, context, property)} !important;\n }\n `;\n\n return cssTemplate;\n};\n\n// Function to inject highlighting CSS into story document\nexport const injectHighlightingCSS = (\n storyDoc: Document,\n prefix: string = 'data-elb',\n): void => {\n // Remove existing styles\n const existingStyle = storyDoc.querySelector('#walkeros-highlighting');\n if (existingStyle) {\n existingStyle.remove();\n }\n\n const highlightingStyleElement = storyDoc.createElement('style');\n highlightingStyleElement.id = 'walkeros-highlighting';\n const css = generateHighlightCSS(prefix);\n highlightingStyleElement.textContent = css;\n\n storyDoc.head.appendChild(highlightingStyleElement);\n};\n","// Utilities for managing DOM highlighting\n\nimport type { WalkerOSAddon } from '../types';\nimport {\n getStoryDocument,\n getStoryRootElement,\n enhanceProperties,\n} from './domUtils';\nimport { injectHighlightingCSS } from './cssUtils';\n\n// Function to apply highlighting to story root\nexport const applyHighlighting = (\n highlights: WalkerOSAddon['highlights'],\n prefix: string = 'data-elb',\n): void => {\n const storyRoot = getStoryRootElement();\n if (!storyRoot) return;\n\n // Remove existing highlighting classes\n storyRoot.classList.remove('highlight-context');\n storyRoot.classList.remove('highlight-entity');\n storyRoot.classList.remove('highlight-property');\n storyRoot.classList.remove('highlight-action');\n storyRoot.classList.remove('highlight-globals');\n\n if (!highlights) return;\n\n // Re-enhance properties FIRST to ensure they're marked\n enhanceProperties(storyRoot, prefix);\n\n // Then add specific highlighting classes\n if (highlights.context) storyRoot.classList.add('highlight-context');\n if (highlights.entity) storyRoot.classList.add('highlight-entity');\n if (highlights.property) storyRoot.classList.add('highlight-property');\n if (highlights.action) storyRoot.classList.add('highlight-action');\n if (highlights.globals) storyRoot.classList.add('highlight-globals');\n};\n\n// Combined function to inject CSS and apply highlighting\nexport const setupHighlighting = (\n highlights: WalkerOSAddon['highlights'],\n prefix: string = 'data-elb',\n): void => {\n const storyDoc = getStoryDocument();\n\n // Always inject CSS first\n injectHighlightingCSS(storyDoc, prefix);\n\n // Then apply highlighting\n applyHighlighting(highlights, prefix);\n};\n","import type { WalkerOSAddon } from './types';\nimport type { DecoratorFunction } from 'storybook/internal/types';\nimport { addons } from 'storybook/preview-api';\nimport { getAllEvents, getGlobals } from '@walkeros/web-source-browser';\n\nimport { ADDON_ID, EVENTS } from './constants';\nimport { initializeWalker } from './walker';\nimport { getStoryRootElement, enhanceProperties } from './utils/domUtils';\nimport { buildAttributeTree } from './utils/attributeTreeUtils';\nimport { setupHighlighting } from './utils/highlightingUtils';\n\n// Set up the channel listener globally, not per story\nconst channel = addons.getChannel();\nlet currentStoryId: string | null = null;\n\n// Global listener for the request events\nchannel.addListener(EVENTS.REQUEST, (config: WalkerOSAddon) => {\n const storyRoot = getStoryRootElement();\n if (!storyRoot) {\n channel.emit(EVENTS.RESULT, []);\n return;\n }\n\n // Enhance DOM with property attributes\n enhanceProperties(storyRoot, config.prefix || 'data-elb');\n\n const events = getAllEvents(storyRoot as Element, config.prefix);\n\n // Collect globals from data-elbglobals attributes\n const globals = getGlobals(config.prefix || 'data-elb', storyRoot as Element);\n\n // Add globals to each event if any globals exist\n const eventsWithGlobals = events.map((event) => {\n if (Object.keys(globals).length > 0) {\n return { ...event, globals };\n }\n return event;\n });\n\n // Send the result back to the manager\n channel.emit(EVENTS.RESULT, eventsWithGlobals);\n});\n\n// Global listener for highlighting events\nchannel.addListener(EVENTS.HIGHLIGHT, (config: WalkerOSAddon) => {\n setupHighlighting(config.highlights, config.prefix);\n});\n\n// Global listener for attribute tree requests\nchannel.addListener(EVENTS.ATTRIBUTES_REQUEST, (config: WalkerOSAddon) => {\n const storyRoot = getStoryRootElement();\n if (!storyRoot) {\n channel.emit(EVENTS.ATTRIBUTES_RESULT, { nodes: [], globals: [] });\n return;\n }\n\n // Build the skeleton tree ({ nodes, globals })\n const result = buildAttributeTree(\n storyRoot as Element,\n config.prefix || 'data-elb',\n );\n\n // Send the result back to the manager\n channel.emit(EVENTS.ATTRIBUTES_RESULT, result);\n});\n\nexport const withRoundTrip: DecoratorFunction = (storyFn, context) => {\n // Check if story changed and auto-run is enabled\n const storyId = context.id;\n const hasStoryChanged = currentStoryId !== storyId;\n const { parameters } = context;\n const autoRefresh = parameters?.[ADDON_ID]?.autoRefresh;\n\n if (hasStoryChanged) {\n currentStoryId = storyId;\n }\n\n const result = storyFn();\n\n // Initialize walker and inject CSS after story renders\n setTimeout(() => {\n // Initialize walkerOS for live event capture\n const prefix = parameters?.[ADDON_ID]?.prefix || 'data-elb';\n initializeWalker({ prefix, autoRefresh }).catch((err) => {\n console.error('Walker initialization failed:', err);\n });\n\n // Inject highlighting CSS and enhance properties\n const storyRoot = getStoryRootElement();\n if (storyRoot) {\n setupHighlighting(undefined, prefix);\n enhanceProperties(storyRoot, prefix);\n }\n\n // Auto-run walker if story changed and auto-refresh is enabled\n if (hasStoryChanged && autoRefresh && window.__storybookElb) {\n window.__storybookElb('walker run');\n }\n }, 200);\n\n return result;\n};\n","/**\n * A decorator is a way to wrap a story in extra “rendering” functionality. Many addons define decorators\n * in order to augment stories:\n * - with extra rendering\n * - gather details about how a story is rendered\n *\n * When writing stories, decorators are typically used to wrap stories with extra markup or context mocking.\n *\n * https://storybook.js.org/docs/react/writing-stories/decorators\n */\nimport type { ProjectAnnotations, Renderer } from 'storybook/internal/types';\n\nimport { ADDON_ID } from './constants';\nimport { withRoundTrip } from './withRoundTrip';\n\n/**\n * Note: if you want to use JSX in this file, rename it to `preview.tsx`\n * and update the entry prop in tsup.config.ts to use \"src/preview.tsx\",\n */\n\nconst preview: ProjectAnnotations<Renderer> = {\n decorators: [withRoundTrip],\n parameters: {\n [ADDON_ID]: {\n autoRefresh: true,\n prefix: 'data-elb',\n },\n },\n};\n\nexport default preview;\n"]}
|
package/dist/preview.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/constants.ts","../src/walker.ts","../src/utils/domUtils.ts","../src/utils/attributeTreeUtils.ts","../../explorer/src/design/index.ts","../src/utils/eventColors.ts","../src/utils/cssUtils.ts","../src/utils/highlightingUtils.ts","../src/withRoundTrip.ts","../src/preview.ts"],"names":["ADDON_ID","EVENTS","destinationConsole","event","context","destinationLive","channel","addons","getIframeContext","iframe","e","initializeWalker","config","iframeDoc","iframeWin","result","startFlow","sourceBrowser","collector","elb","error","getStoryDocument","getStoryRootElement","storyDoc","selectors","selector","element","getElementPath","el","path","current","c","enhanceProperties","storyRoot","prefix","allElements","scopedAttr","getElbAttributeName","Const","actionAttr","contextAttr","globalsAttr","attr","generateElementHTML","tagName","propertyMarker","attribs","PRIORITY","addProperty","acc","key","value","origin","existing","collectValues","name","values","getElbValues","k","v","buildAttributeTree","scope","entityAttr","scopedName","entityEls","entitySet","owningEntity","cur","nodeMap","entity","props","owned","child","o","anc","g","roots","node","parentEl","parentNode","globalsValues","getGlobals","globals","vizBg","eventEntity","eventAction","eventProperty","eventContext","eventGlobals","highlightColors","outline","colors","color","index","generateHighlightCSS","property","action","globalsSelector","contextSelector","baseSelector","propertySelector","injectHighlightingCSS","existingStyle","highlightingStyleElement","css","applyHighlighting","highlights","setupHighlighting","currentStoryId","events","getAllEvents","eventsWithGlobals","withRoundTrip","storyFn","_a","storyId","hasStoryChanged","parameters","autoRefresh","err","preview","preview_default"],"mappings":"+MAAO,IAAMA,CAAAA,CAAW,UAAA,CAIjB,IAAMC,CAAAA,CAAS,CACpB,MAAA,CAAQ,CAAA,EAAGD,CAAQ,UACnB,OAAA,CAAS,CAAA,EAAGA,CAAQ,CAAA,QAAA,CAAA,CACpB,SAAA,CAAW,CAAA,EAAGA,CAAQ,CAAA,UAAA,CAAA,CACtB,UAAA,CAAY,CAAA,EAAGA,CAAQ,CAAA,WAAA,CAAA,CACvB,iBAAA,CAAmB,CAAA,EAAGA,CAAQ,CAAA,kBAAA,CAAA,CAC9B,mBAAoB,CAAA,EAAGA,CAAQ,CAAA,mBAAA,CACjC,CAAA,CCGA,IAAME,CAAAA,CAAqB,CACzB,IAAA,CAAM,SAAA,CACN,IAAA,CAAM,CAACC,CAAAA,CAAuBC,IAAqC,CACjE,OAAA,CAAQ,GAAA,CAAI,kBAAA,CAAoBD,CAAK,EACvC,CAAA,CACA,MAAA,CAAQ,EACV,CAAA,CAGME,CAAAA,CAAkB,CACtB,IAAA,CAAM,MAAA,CACN,IAAA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O,cAAA,EAC3C,OAAO,cAAA,CAAe,YAAY,EAEtC,CAAA,CAAG,GAAG,EAECvG,CACT,CAAA,KCjFMyG,EAAAA,CAAwC,CAC5C,WAAY,CAACR,CAAa,EAC1B,UAAA,CAAY,CACV,CAAChH,CAAQ,EAAG,CACV,WAAA,CAAa,IAAA,CACb,OAAQ,UACV,CACF,CACF,CAAA,CAEOyH,EAAAA,CAAQD","file":"preview.js","sourcesContent":["export const ADDON_ID = 'walkerOS';\nexport const PANEL_ID = `${ADDON_ID}/panel`;\nexport const KEY = `walkerOS`;\n\nexport const EVENTS = {\n RESULT: `${ADDON_ID}/result`,\n REQUEST: `${ADDON_ID}/request`,\n HIGHLIGHT: `${ADDON_ID}/highlight`,\n LIVE_EVENT: `${ADDON_ID}/live-event`,\n ATTRIBUTES_RESULT: `${ADDON_ID}/attributes-result`,\n ATTRIBUTES_REQUEST: `${ADDON_ID}/attributes-request`,\n};\n","import type { Collector, WalkerOS, Destination } from '@walkeros/core';\nimport { startFlow } from '@walkeros/collector';\nimport { sourceBrowser } from '@walkeros/web-source-browser';\nimport { addons } from 'storybook/preview-api';\nimport { EVENTS } from './constants';\n\ndeclare global {\n interface Window {\n __storybookElb: WalkerOS.Elb;\n __storybookWalker: Collector.Instance;\n }\n}\n\n// Simple console destination for Storybook\nconst destinationConsole = {\n type: 'console',\n push: (event: WalkerOS.Event, context: Destination.PushContext) => {\n console.log('Storybook Event:', event);\n },\n config: {},\n};\n\n// Live destination for Storybook panel\nconst destinationLive = {\n type: 'live',\n push: (event: WalkerOS.Event, context: Destination.PushContext) => {\n // Send event to Storybook panel for live display\n const channel = addons.getChannel();\n if (channel) {\n channel.emit(EVENTS.LIVE_EVENT, event);\n }\n },\n config: {},\n};\n\n// Function to get Storybook iframe context\nfunction getIframeContext() {\n try {\n // Try to get iframe from parent document (manager context)\n const iframe = parent.document.querySelector(\n '#storybook-preview-iframe',\n ) as HTMLIFrameElement;\n if (iframe?.contentDocument && iframe?.contentWindow) {\n return {\n document: iframe.contentDocument,\n window: iframe.contentWindow,\n };\n }\n } catch (e) {\n // If we can't access parent, we're likely already in iframe context\n }\n\n // Fallback to current context\n return { document, window };\n}\n\nexport async function initializeWalker(config?: {\n prefix?: string;\n autoRefresh?: boolean;\n}): Promise<void> {\n // Skip initialization if already done\n if (window.__storybookWalker) return;\n\n try {\n // Get iframe context for proper event capture\n const { document: iframeDoc, window: iframeWin } = getIframeContext();\n\n if (!iframeDoc) {\n console.warn('Document not available, skipping walkerOS initialization');\n return;\n }\n\n // Create collector with browser source and destinations\n const result = await startFlow({\n consent: { functional: true },\n sources: {\n browser: {\n code: sourceBrowser,\n config: {\n settings: {\n pageview: true,\n elbLayer: '__storybookElbLayer',\n elb: '__storybookElb',\n prefix: config?.prefix || 'data-elb',\n scope: iframeDoc.body || iframeDoc, // Set scope to iframe document\n },\n },\n env: {\n window: iframeWin,\n document: iframeDoc,\n },\n },\n },\n destinations: {\n console: { code: destinationConsole },\n live: { code: destinationLive },\n },\n });\n\n const { collector, elb } = result;\n\n // Verify collector was created successfully\n if (!collector) {\n throw new Error('Collector creation failed - no collector returned');\n }\n\n // Set global window objects\n window.__storybookWalker = collector;\n window.__storybookElb = elb;\n } catch (error) {\n console.error('Failed to initialize walkerOS:', error);\n }\n}\n","// DOM utilities for working with story elements\n\nimport { Const } from '@walkeros/collector';\nimport { getElbAttributeName } from '@walkeros/web-source-browser';\n\n// Function to get the story document (either iframe or main document)\nexport const getStoryDocument = (): Document => {\n // Try to find story iframe\n const iframe = document.querySelector(\n '#storybook-preview-iframe',\n ) as HTMLIFrameElement;\n if (iframe?.contentDocument) {\n return iframe.contentDocument;\n }\n // Fallback to main document\n return document;\n};\n\n// Function to get the story root element\nexport const getStoryRootElement = (): Element | null => {\n const storyDoc = getStoryDocument();\n\n // Try multiple selectors for story root\n const selectors = [\n '#storybook-root',\n '#root',\n '[data-testid=\"storybook-root\"]',\n 'body',\n ];\n\n for (const selector of selectors) {\n const element = storyDoc.querySelector(selector);\n if (element) {\n return element;\n }\n }\n\n return storyDoc.body;\n};\n\n// Helper to get element path\nexport const getElementPath = (el: Element): string => {\n const path = [];\n let current = el;\n while (current && current !== document.body && current.parentElement) {\n let selector = current.tagName.toLowerCase();\n if (current.id) {\n selector += `#${current.id}`;\n } else if (current.className && typeof current.className === 'string') {\n selector += `.${current.className\n .split(' ')\n .filter((c) => c)\n .join('.')}`;\n }\n path.unshift(selector);\n current = current.parentElement;\n }\n return path.join(' > ');\n};\n\n// Function to enhance DOM with property attributes\nexport const enhanceProperties = (\n storyRoot: Element,\n prefix: string = 'data-elb',\n): void => {\n // Find all elements with any attributes starting with prefix-\n const allElements = Array.from(storyRoot.querySelectorAll('*'));\n\n const scopedAttr = getElbAttributeName(prefix, Const.Commands.Scoped, false); // data-elb_\n const actionAttr = getElbAttributeName(prefix, Const.Commands.Action, false);\n const contextAttr = getElbAttributeName(\n prefix,\n Const.Commands.Context,\n false,\n );\n const globalsAttr = getElbAttributeName(\n prefix,\n Const.Commands.Globals,\n false,\n );\n\n allElements.forEach((el) => {\n const hasProperties = Array.from(el.attributes).some((attr) => {\n if (attr.name === scopedAttr) return true; // scoped generic data-elb_\n return (\n attr.name.startsWith(`${prefix}-`) &&\n attr.name !== actionAttr &&\n attr.name !== contextAttr &&\n attr.name !== globalsAttr\n );\n });\n\n // Mark elements with property attributes\n if (hasProperties) {\n el.setAttribute(getElbAttributeName(prefix, 'property', false), '');\n }\n });\n};\n","// Builds an entity-centric \"skeleton\" tree: each node is a data-elb entity, with\n// generic (data-elb-), scoped (data-elb_), and explicit (data-elb-<entity>)\n// values resolved onto it and tagged by origin. Interim addon-local\n// approximation of the walker's resolution (see the design doc for fidelity\n// limits: cross-DOM links, shadow piercing, exact collision priority, and\n// context ordering index are out of scope for Phase 1).\n\nimport type { WalkerOS } from '@walkeros/core';\nimport { Const } from '@walkeros/collector';\nimport {\n getElbValues,\n getElbAttributeName,\n getGlobals,\n} from '@walkeros/web-source-browser';\nimport type { AttributeNode, ResolvedProperty } from '../types';\nimport { getElementPath } from './domUtils';\n\nconst generateElementHTML = (element: Element, prefix: string): string => {\n const tagName = element.tagName.toLowerCase();\n // Hide the synthetic highlight marker (data-elbproperty) that\n // enhanceProperties stamps on the live DOM; it is an internal helper, not\n // author-written tagging, so it must not appear in the displayed markup.\n const propertyMarker = getElbAttributeName(prefix, 'property', false);\n const attribs = Array.from(element.attributes)\n .filter((a) => a.name !== propertyMarker)\n .map((a) => `${a.name}=\"${a.value}\"`);\n if (attribs.length === 0) return `<${tagName}></${tagName}>`;\n if (attribs.length === 1) return `<${tagName} ${attribs[0]}></${tagName}>`;\n return `<${tagName}\\n${attribs.map((a) => ` ${a}`).join('\\n')}\\n></${tagName}>`;\n};\n\n// Origin priority for same-key collisions (highest first). Approximate; real\n// walker priority is documented as out of scope for Phase 1.\nconst PRIORITY: Record<ResolvedProperty['origin'], number> = {\n data: 3,\n scoped: 2,\n generic: 1,\n};\n\nconst addProperty = (\n acc: Map<string, ResolvedProperty>,\n key: string,\n value: WalkerOS.Property | undefined,\n origin: ResolvedProperty['origin'],\n) => {\n if (!key) return; // never store the blank-key generic\n if (value === undefined || value === null || value === '') return;\n const existing = acc.get(key);\n if (!existing || PRIORITY[origin] > PRIORITY[existing.origin]) {\n acc.set(key, { key, value, origin });\n }\n};\n\nconst collectValues = (\n acc: Map<string, ResolvedProperty>,\n prefix: string,\n el: Element,\n name: string, // '' for generic, entity name for explicit\n origin: ResolvedProperty['origin'],\n) => {\n const values = getElbValues(prefix, el, name, true);\n Object.entries(values).forEach(([k, v]) => addProperty(acc, k, v, origin));\n};\n\nexport const buildAttributeTree = (\n scope: Element,\n prefix: string = Const.Commands.Prefix,\n): { nodes: AttributeNode[]; globals: ResolvedProperty[] } => {\n const entityAttr = getElbAttributeName(prefix); // data-elb\n const scopedName = Const.Commands.Scoped; // '_'\n\n // All entity elements (self + descendants).\n const entityEls: Element[] = [];\n if (scope.matches(`[${entityAttr}]`)) entityEls.push(scope);\n scope.querySelectorAll(`[${entityAttr}]`).forEach((el) => entityEls.push(el));\n const entitySet = new Set(entityEls);\n\n // Nearest ancestor-or-self entity for any element (DOM ancestry).\n const owningEntity = (el: Element): Element | null => {\n let cur: Element | null = el;\n while (cur) {\n if (entitySet.has(cur)) return cur;\n cur = cur.parentElement;\n }\n return null;\n };\n\n const nodeMap = new Map<Element, AttributeNode>();\n\n entityEls.forEach((el) => {\n const entity = el.getAttribute(entityAttr) || '';\n const props = new Map<string, ResolvedProperty>();\n\n // Own + owned descendants: explicit (data-elb-<entity>) and generic (data-elb-)\n const owned: Element[] = [el];\n el.querySelectorAll('*').forEach((child) => {\n if (owningEntity(child) === el) owned.push(child);\n });\n owned.forEach((o) => {\n collectValues(props, prefix, o, entity, 'data');\n collectValues(props, prefix, o, '', 'generic');\n });\n\n // Ancestors (incl. self start): explicit, generic, and scoped (data-elb_)\n let anc: Element | null = el;\n while (anc) {\n collectValues(props, prefix, anc, entity, 'data');\n collectValues(props, prefix, anc, '', 'generic');\n // scoped uses isProperty=false (suffix '_' with no dash)\n Object.entries(getElbValues(prefix, anc, scopedName, false)).forEach(\n ([k, v]) => addProperty(props, k, v, 'scoped'),\n );\n anc = anc.parentElement;\n }\n\n nodeMap.set(el, {\n element: el.tagName.toLowerCase(),\n path: getElementPath(el),\n htmlMarkup: generateElementHTML(el, prefix),\n attributes: {\n entity,\n action:\n el.getAttribute(\n getElbAttributeName(prefix, Const.Commands.Action, false),\n ) || undefined,\n context: (() => {\n const c = getElbValues(prefix, el, Const.Commands.Context, false);\n return Object.keys(c).length ? c : undefined;\n })(),\n globals: (() => {\n const g = getElbValues(prefix, el, Const.Commands.Globals, false);\n return Object.keys(g).length ? g : undefined;\n })(),\n properties: Array.from(props.values()),\n },\n children: [],\n });\n });\n\n // Nest by nearest ancestor entity.\n const roots: AttributeNode[] = [];\n nodeMap.forEach((node, el) => {\n const parentEl = el.parentElement ? owningEntity(el.parentElement) : null;\n const parentNode = parentEl ? nodeMap.get(parentEl) : undefined;\n if (parentNode) parentNode.children.push(node);\n else roots.push(node);\n });\n\n const globalsValues = getGlobals(prefix, scope);\n const globals: ResolvedProperty[] = [];\n Object.entries(globalsValues).forEach(([key, value]) => {\n if (value !== undefined && value !== null && value !== '')\n globals.push({ key, value, origin: 'data' });\n });\n\n return { nodes: roots, globals };\n};\n","/* walkerOS design constants, generated from design/tokens.json by src/design/generate.ts. Edit the JSON and run the explorer build, never this file. */\n\nexport type Theme = 'dark' | 'light';\n\n/** Page background (hero, features, FAQ, closing CTA). Default ground for `fg`, `fg-2`, `link`. */\nexport const bg = { dark: \"#111827\", light: \"#ffffff\" } as const;\n\n/** Alternating section band (Why, More features, Plans) and footer. Switch between `bg` and `bg-2` to separate sections, always with a top `border` rule. */\nexport const bg2 = { dark: \"#151e2e\", light: \"#f6f7f9\" } as const;\n\n/** Cards, plan tiers, FAQ items, the install-command chip and secondary buttons. */\nexport const surface = { dark: \"#1a2232\", light: \"#ffffff\" } as const;\n\n/** Inline code background, icon-button hover. */\nexport const surface2 = { dark: \"#222b3c\", light: \"#f1f3f6\" } as const;\n\n/** Hairline for section rules, header underline, card and input outlines. Decorative only; it does not meet 3:1, so never rely on it alone to mark a control. */\nexport const border = { dark: \"#2f3a4d\", light: \"#e3e6eb\" } as const;\n\n/** Headings and body copy on `bg`, `bg-2`, `surface`, `surface-2` (14:1+ both themes). */\nexport const fg = { dark: \"#ffffff\", light: \"#111827\" } as const;\n\n/** Secondary copy: leads, card descriptions, list items, footer links. 5.5:1+ on every ground. */\nexport const fg2 = { dark: \"#9aa3b2\", light: \"#4b5563\" } as const;\n\n/** Tertiary text: tier labels, `$` prompt, FAQ `+`, copyright, input placeholders. 4.5:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes (dark 4.6:1+, light 4.7:1+). */\nexport const fg3 = { dark: \"#8c93a2\", light: \"#656d7a\" } as const;\n\n/** elbwalker blue. Primary button fill, check icons, highlight word in the H1, focus ring, announcement bar. Light theme: 2.4:1 on white — fine as a fill under `on-primary`, too faint for text or as the only marker (flagged, kept from source). */\nexport const primary = { dark: \"#01b5e2\", light: \"#01b5e2\" } as const;\n\n/** Text and icons on `primary` fills (6.9:1). Never put white on `primary` (2.4:1) — the current walkeros.io buttons do; the relaunch fixes it. */\nexport const onPrimary = { dark: \"#04222b\", light: \"#04222b\" } as const;\n\n/** Links, eyebrows, mono step numbers; `info` and the light `focus` ring use it. 4.5:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes (dark 6.0:1+, light 4.6:1+). Underline on hover only. */\nexport const link = { dark: \"#4fb3e0\", light: \"#0076a0\" } as const;\n\n/** Soft primary halo: hero radial glow and the 4px ring around the highlighted plan. */\nexport const glow = { dark: \"rgba(1, 181, 226, 0.16)\", light: \"rgba(1, 181, 226, 0.14)\" } as const;\n\n/** Code-block panel (Palenight family), both themes. */\nexport const codeBg = \"#292d3e\";\n\n/** Code-block title bar / tab strip. */\nexport const codeBar = \"#232636\";\n\n/** Code-block outline. */\nexport const codeBorder = \"#444a5e\";\n\n/** Default code text on `code-bg` (8:1). */\nexport const codeFg = \"#bfc7d5\";\n\n/** Product visualisation panel (tagging and mapping demos). Visualisations stay dark in both themes. */\nexport const vizBg = \"#1a2232\";\n\n/** Code pane inside a visualisation. */\nexport const vizCodeBg = \"#131c2b\";\n\n/** Outlines inside visualisations. */\nexport const vizBorder = \"#334055\";\n\n/** Primary text inside visualisations. */\nexport const vizFg = \"#e8eaf0\";\n\n/** Legend and meta text inside visualisations (5.4:1 on `viz-code-bg`). */\nexport const vizFg2 = \"#8e96aa\";\n\n/** Code comments and file kinds inside visualisations. */\nexport const vizComment = \"#6c7590\";\n\n/** Gutter line numbers. Decorative, below 3:1. */\nexport const vizLineNumber = \"#4a5165\";\n\n/** Raised surfaces inside visualisations: the rendered teaser card, table rules. */\nexport const vizSurface = \"#2b3649\";\n\n/** Syntax: HTML/JSX tag names in visualisation code (6:1+ on `viz-code-bg`). */\nexport const vizTag = \"#e38fd6\";\n\n/** Syntax: string values in visualisation code and JSON cells. */\nexport const vizString = \"#e5c07b\";\n\n/** Syntax: numbers and booleans in mapping code. */\nexport const vizNumber = \"#f78c6c\";\n\n/** Syntax: punctuation and plain code text; visualisation captions. */\nexport const vizPunct = \"#9aa3b8\";\n\n/** Event part: entity (e.g. `product`). Used for syntax highlight, legend chip and the highlighted DOM region in tagging demos. The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventEntity = { dark: \"#c5e478\", light: \"#537a01\" } as const;\n\n/** Event part: action (e.g. `view`, `add`). The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventAction = { dark: \"#c792ea\", light: \"#8c59ac\" } as const;\n\n/** Event part: entity property (`data-elb-product=\"name\"`). The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventProperty = { dark: \"#f0717f\", light: \"#be4456\" } as const;\n\n/** Event part: context. The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventContext = { dark: \"#f2a65a\", light: \"#a25f06\" } as const;\n\n/** Event part: globals. The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventGlobals = { dark: \"#7fc4ea\", light: \"#317699\" } as const;\n\n/** Tag kind: user (who the visitor is). Unlike the five event parts it has no light value: it sits only on dark grounds (`viz-bg`, legends, chips, mark layers) and always pairs with its word. 5.2:1 on `viz-bg`; kept apart from `event-property`, `event-action` and `danger`. */\nexport const eventUser = \"#e65fc4\";\n\n/** Tag kind: consent (consent states and requirements). Dark grounds only, always with its word. 10.7:1 on `viz-bg`. */\nexport const eventConsent = \"#cbd5e1\";\n\n/** Brand scale (walkeros.io docs). Light-theme badge and admonition background. */\nexport const elbwalker100 = \"#edfeff\";\n\n/** Brand scale. Admonition highlight (light). */\nexport const elbwalker200 = \"#abf8ff\";\n\n/** Brand scale. Admonition text (dark). */\nexport const elbwalker300 = \"#69ecfe\";\n\n/** Brand scale. */\nexport const elbwalker400 = \"#27dbfe\";\n\n/** Brand scale anchor = `primary`. Admonition border. */\nexport const elbwalker500 = \"#01b5e2\";\n\n/** Brand scale. Badge text (light), badge fill (dark). */\nexport const elbwalker700 = \"#015372\";\n\n/** Brand scale. Admonition background (dark). */\nexport const elbwalker800 = \"#00283a\";\n\n/** Brand scale, darkest step. */\nexport const elbwalker900 = \"#000203\";\n\n/** Borders that mark a control: input, select, checkbox and switch outlines, the 1px edge of menus, popovers and dialogs, scrollbar thumbs, flow edges. 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes; `border` stays decorative. */\nexport const borderStrong = { dark: \"#6b778d\", light: \"#818a9a\" } as const;\n\n/** Focus ring, 2px solid with a 3px offset, on every interactive element: `primary` in dark, `link` in light, where `primary` is 2.2:1. 3:1 or more on every ground. */\nexport const focus = { dark: \"#01b5e2\", light: \"#0076a0\" } as const;\n\n/** Scrim behind modals and drawers. The layer above it is `surface` with a 1px `border-strong` edge, never a shadow. */\nexport const backdrop = { dark: \"rgba(3, 7, 18, 0.72)\", light: \"rgba(17, 24, 39, 0.4)\" } as const;\n\n/** Errors, destructive actions and invalid fields, always with an icon and a word. Text at 4.5:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. Kept apart from every event and step colour, `event-property` included. */\nexport const danger = { dark: \"#ffa4ac\", light: \"#b91c1c\" } as const;\n\n/** Text and icons on a `danger` fill such as a destructive button (dark 8.6:1, light 6.5:1). */\nexport const onDanger = { dark: \"#450a0a\", light: \"#ffffff\" } as const;\n\n/** Success and healthy states, always with an icon and a word. Sits on the blue side of green, so it stays apart from `danger` with red-green colour blindness, and apart from every step and event colour. Text at 4.5:1 or more on every ground. */\nexport const success = { dark: \"#8cf9ff\", light: \"#07675d\" } as const;\n\n/** Warnings and states that need attention, always with an icon and a word. Kept apart from `step-transformer` and `event-context`. Text at 4.5:1 or more on every ground. */\nexport const warning = { dark: \"#cabb00\", light: \"#886000\" } as const;\n\n/** Neutral information, always with an icon and a word. The `link` colour in both themes. */\nexport const info = { dark: \"#4fb3e0\", light: \"#0076a0\" } as const;\n\n/** Tinted fill for danger banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const dangerBg = { dark: \"rgba(255, 164, 172, 0.16)\", light: \"rgba(185, 28, 28, 0.1)\" } as const;\n\n/** Tinted fill for success banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const successBg = { dark: \"rgba(140, 249, 255, 0.16)\", light: \"rgba(7, 103, 93, 0.1)\" } as const;\n\n/** Tinted fill for warning banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const warningBg = { dark: \"rgba(202, 187, 0, 0.16)\", light: \"rgba(136, 96, 0, 0.1)\" } as const;\n\n/** Tinted fill for information banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const infoBg = { dark: \"rgba(79, 179, 224, 0.16)\", light: \"rgba(0, 118, 160, 0.1)\" } as const;\n\n/** Flow step colour: sources. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepSource = { dark: \"#6ee7b7\", light: \"#428569\" } as const;\n\n/** Flow step colour: transformers. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepTransformer = { dark: \"#fcd34d\", light: \"#bb7000\" } as const;\n\n/** Flow step colour: the collector. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepCollector = { dark: \"#7dd3fc\", light: \"#0c529b\" } as const;\n\n/** Flow step colour: destinations. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepDestination = { dark: \"#c4b5fd\", light: \"#6d1fd8\" } as const;\n\n/** Flow step colour: stores. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepStore = { dark: \"#a5b4fc\", light: \"#4138c9\" } as const;\n\n/** Platform badge: web, always with the word; 3:1 or more on every ground. */\nexport const platformWeb = { dark: \"#0ea5e9\", light: \"#008ddd\" } as const;\n\n/** Platform badge: server, always with the word; 3:1 or more on every ground. */\nexport const platformServer = { dark: \"#8b5cf6\", light: \"#8043f6\" } as const;\n\n/** First chart series: `primary` in dark, `link` in light. Series take `chart-1` to `chart-6` in order; the six stay apart in normal vision and with red-green colour blindness, and reach 3:1 on every ground. Label every series. */\nexport const chart1 = { dark: \"#01b5e2\", light: \"#0076a0\" } as const;\n\n/** Second chart series (orange). */\nexport const chart2 = { dark: \"#e69f00\", light: \"#ce710c\" } as const;\n\n/** Third chart series (bluish green). */\nexport const chart3 = { dark: \"#009563\", light: \"#217b58\" } as const;\n\n/** Fourth chart series (vermilion). */\nexport const chart4 = { dark: \"#e0520a\", light: \"#d32f4d\" } as const;\n\n/** Fifth chart series (reddish purple). */\nexport const chart5 = { dark: \"#ff6fad\", light: \"#b87889\" } as const;\n\n/** Sixth chart series (yellow in dark, olive in light). */\nexport const chart6 = { dark: \"#f0e442\", light: \"#546800\" } as const;\n\n/** Human notes and comment pins over visualisations, tag plans and frames. Kept apart from every step and status colour; 3:1 or more on every ground. */\nexport const annotation = { dark: \"#22c55e\", light: \"#409116\" } as const;\n\n/** Editor syntax (Monaco, Shiki, Prism): comments, 4.6:1 on `code-bg`. */\nexport const syntaxComment = \"#8c94be\";\n\n/** Editor syntax (Monaco, Shiki, Prism): strings, attribute names and inserted text, 9.9:1 on `code-bg`. */\nexport const syntaxString = \"#c3e88d\";\n\n/** Editor syntax (Monaco, Shiki, Prism): numbers, 5.8:1 on `code-bg`. */\nexport const syntaxNumber = \"#f78c6c\";\n\n/** Editor syntax (Monaco, Shiki, Prism): booleans, null and constants, 4.6:1 on `code-bg`. */\nexport const syntaxConstant = \"#ff5d78\";\n\n/** Editor syntax (Monaco, Shiki, Prism): keywords and storage modifiers, 5.2:1 on `code-bg`. */\nexport const syntaxKeyword = \"#c084fc\";\n\n/** Editor syntax (Monaco, Shiki, Prism): functions and built-ins, 5.9:1 on `code-bg`. */\nexport const syntaxFunction = \"#82aaff\";\n\n/** Editor syntax (Monaco, Shiki, Prism): types and class names, 9.1:1 on `code-bg`. */\nexport const syntaxType = \"#ffcb6b\";\n\n/** Editor syntax (Monaco, Shiki, Prism): operators and regular expressions, 9.0:1 on `code-bg`. */\nexport const syntaxOperator = \"#89ddff\";\n\n/** Editor syntax (Monaco, Shiki, Prism): punctuation and delimiters, 5.7:1 on `code-bg`. */\nexport const syntaxPunct = \"#c792ea\";\n\n/** Editor syntax (Monaco, Shiki, Prism): tags, invalid and deleted tokens, 4.6:1 on `code-bg`. */\nexport const syntaxTag = \"#ff5d79\";\n\n/** Editor syntax (Monaco, Shiki, Prism): namespaces, 8.1:1 on `code-bg`. */\nexport const syntaxNamespace = \"#b2ccd6\";\n\n/** Editor gutter line numbers on `code-bg`. Decorative, below 3:1. */\nexport const codeLineNumber = \"#676e95\";\n\n/** Editor selection over `code-bg`; `code-fg` stays at 5.4:1 on it. */\nexport const codeSelection = \"#717cb450\";\n\n/** Inserted lines in diff views over `code-bg`; `code-fg` stays at 5.4:1. */\nexport const codeInsertedBg = \"#c3e88d26\";\n\n/** Deleted lines in diff views over `code-bg`; `code-fg` stays at 6.6:1. */\nexport const codeDeletedBg = \"#ff5d7926\";\n\n/** Font family `sans`. */\nexport const fontSans = \"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif\";\n\n/** Font family `mono`. */\nexport const fontMono = \"SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace\";\n\n/** Font family `viz`. */\nexport const fontViz = \"'Geist', system-ui, sans-serif\";\n\n/** Font family `viz-mono`. */\nexport const fontVizMono = \"'Geist Mono', monospace\";\n\n/** The one transition duration. Read it as var(--motion): reduced motion sets it to 0ms. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const motion = \"180ms\";\n\n/** The one transition easing, beside var(--motion). Read it as var(--ease). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const ease = \"cubic-bezier(0.2, 0, 0, 1)\";\n\n/** Type style `display`: Hero H1 only. Fluid: clamp(38px, 6vw, 64px), max 20ch, text-wrap balance. One phrase may take `primary`. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeDisplay = { size: \"64px\", lineHeight: 1.08, weight: 700, tracking: \"-0.025em\", family: fontSans } as const;\n\n/** Type style `heading-xl`: Large split-section heading (More features). clamp(28px, 3.6vw, 44px). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeHeadingXl = { size: \"44px\", lineHeight: 1.1, weight: 700, tracking: \"-0.025em\", family: fontSans } as const;\n\n/** Type style `heading-lg`: Section H2. clamp(28px, 3.6vw, 40px), text-wrap balance. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeHeadingLg = { size: \"40px\", lineHeight: 1.15, weight: 700, tracking: \"-0.02em\", family: fontSans } as const;\n\n/** Type style `heading-md`: Feature H2 beside its explainer. clamp(26px, 3.2vw, 36px). Also the docs page title (h1), not fluid. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeHeadingMd = { size: \"36px\", lineHeight: 1.15, weight: 700, tracking: \"-0.02em\", family: fontSans } as const;\n\n/** Type style `footer-statement`: The footer's one-line brand statement. clamp(24px, 3.2vw, 34px), max 22ch. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeFooterStatement = { size: \"34px\", lineHeight: 1.2, weight: 700, tracking: \"-0.02em\", family: fontSans } as const;\n\n/** Type style `kicker-lg`: Large coloured kicker above `heading-xl`, in `primary`. clamp(22px, 2.4vw, 28px). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeKickerLg = { size: \"28px\", lineHeight: 1.2, weight: 700, tracking: \"-0.01em\", family: fontSans } as const;\n\n/** Type style `title-plan`: Plan tier name. Also docs h2. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeTitlePlan = { size: \"24px\", lineHeight: 1.3, weight: 700, tracking: \"-0.015em\", family: fontSans } as const;\n\n/** Type style `title-card`: Problem-card H3. Also docs h3; docs h4 takes its weight. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeTitleCard = { size: \"19px\", lineHeight: 1.35, weight: 600, family: fontSans } as const;\n\n/** Type style `title-item`: Feature-list H3. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeTitleItem = { size: \"18px\", lineHeight: 1.35, weight: 600, family: fontSans } as const;\n\n/** Type style `lead`: Hero sub-copy in `fg-2`, max 58ch. clamp(18px, 2vw, 21px). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeLead = { size: \"21px\", lineHeight: 1.65, weight: 400, family: fontSans } as const;\n\n/** Type style `body-lg`: Feature explainer paragraphs, FAQ questions (600). Also docs h4, at the `title-card` weight. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeBodyLg = { size: \"17px\", lineHeight: 1.65, weight: 400, family: fontSans } as const;\n\n/** Type style `body`: Default body copy, docs body copy included; buttons (600). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeBody = { size: \"16px\", lineHeight: 1.65, weight: 400, family: fontSans } as const;\n\n/** Type style `ui`: Nav links, list items, footer links. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeUi = { size: \"15px\", lineHeight: 1.5, weight: 500, family: fontSans } as const;\n\n/** Type style `small`: Announcement bar, `Docs →` links (500), copyright (400). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeSmall = { size: \"14px\", lineHeight: 1.5, weight: 600, family: fontSans } as const;\n\n/** Type style `eyebrow`: Section eyebrow, UPPERCASE, in `link`. One line that states the problem the section answers. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeEyebrow = { size: \"13px\", lineHeight: 1.5, weight: 600, tracking: \"0.12em\", family: fontSans } as const;\n\n/** Type style `label`: Plan tier label, UPPERCASE, in `fg-3` (`link` on the highlighted plan). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeLabel = { size: \"12px\", lineHeight: 1.5, weight: 700, tracking: \"0.12em\", family: fontSans } as const;\n\n/** Type style `code-command`: Install-command chip. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeCodeCommand = { size: \"15px\", lineHeight: 1.5, weight: 500, family: fontMono } as const;\n\n/** Type style `code-step`: Mono step numbers (01, 02, 03) in `link`. Also code panes: the explorer's code editors and docs code blocks. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeCodeStep = { size: \"13px\", lineHeight: 1.5, weight: 400, family: fontMono } as const;\n\n/** Type style `code-inline`: Inline code inside prose, docs inline code included: `surface-2` fill, `border` outline, radius-sm. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeCodeInline = { size: \"0.88em\", lineHeight: 1.5, weight: 400, family: fontMono } as const;\n\n/** Type style `viz-body`: Captions inside product visualisations (Geist). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizBody = { size: \"15px\", lineHeight: 1.5, weight: 400, family: fontViz } as const;\n\n/** Type style `viz-chip`: Step pills inside visualisations. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizChip = { size: \"13px\", lineHeight: 1.4, weight: 500, family: fontViz } as const;\n\n/** Type style `viz-code`: Code pane inside visualisations (Geist Mono). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizCode = { size: \"12px\", lineHeight: 1.8, weight: 400, family: fontVizMono } as const;\n\n/** Type style `viz-legend`: Event-part legend (Geist Mono) in `viz-fg-2`. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizLegend = { size: \"11px\", lineHeight: 1.5, weight: 400, family: fontVizMono } as const;\n\n/** Type style `product-heading`: Page and dialog titles in the app, the explorer and Tag Mode. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductHeading = { size: \"20px\", lineHeight: 1.3, weight: 600, family: fontSans } as const;\n\n/** Type style `product-title`: Panel, card and section titles in product UI. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductTitle = { size: \"16px\", lineHeight: 1.4, weight: 600, family: fontSans } as const;\n\n/** Type style `product-body`: Default product copy: body text, form fields, table cells, buttons (600). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductBody = { size: \"14px\", lineHeight: 1.5, weight: 400, family: fontSans } as const;\n\n/** Type style `product-small`: Secondary rows, help text and dense tables. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductSmall = { size: \"13px\", lineHeight: 1.45, weight: 400, family: fontSans } as const;\n\n/** Type style `product-caption`: Captions, badges and meta labels. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductCaption = { size: \"12px\", lineHeight: 1.4, weight: 500, family: fontSans } as const;\n\n/** Type style `product-micro`: Dense canvas labels only: node badges, edge labels, mark labels and compact tooltip meta. Never body copy, never interactive text. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductMicro = { size: \"11px\", lineHeight: 1.3, weight: 500, family: fontSans } as const;\n","import {\n eventAction,\n eventContext,\n eventEntity,\n eventGlobals,\n eventProperty,\n} from '@walkeros/explorer/design';\nimport type { WalkerOSAddon } from '../types';\n\nexport type HighlightKind = keyof NonNullable<WalkerOSAddon['highlights']>;\nexport type AttributeKind =\n | 'entity'\n | 'action'\n | 'context'\n | 'globals'\n | 'data';\n\n// Event colours of the walkerOS design system, their dark values: every use\n// pairs them with the dark visualisation ground vizBg.\nexport const highlightColors: Record<HighlightKind, string> = {\n globals: eventGlobals.dark,\n context: eventContext.dark,\n entity: eventEntity.dark,\n property: eventProperty.dark,\n action: eventAction.dark,\n};\n\n// Attribute badges name the property kind \"data\".\nexport const attributeColors: Record<AttributeKind, string> = {\n entity: highlightColors.entity,\n action: highlightColors.action,\n context: highlightColors.context,\n globals: highlightColors.globals,\n data: highlightColors.property,\n};\n","// CSS utilities for highlighting DOM elements\nimport { vizBg } from '@walkeros/explorer/design';\nimport { highlightColors } from './eventColors';\n\n// Stacked 2px rings in the given event colours, closed by a 1px edge in the\n// dark visualisation ground so the outline reads on light and dark stories.\nconst outline = (...colors: string[]): string =>\n [\n ...colors.map((color, index) => `0 0 0 ${(index + 1) * 2}px ${color}`),\n `0 0 0 ${colors.length * 2 + 1}px ${vizBg}`,\n ].join(', ');\n\n// Generate dynamic CSS based on prefix\nexport const generateHighlightCSS = (prefix: string): string => {\n const { globals, context, entity, property, action } = highlightColors;\n\n // Define selectors based on prefix\n const globalsSelector = `${prefix}globals`;\n const contextSelector = `${prefix}context`;\n const baseSelector = prefix;\n const propertySelector = `${prefix}property`;\n\n // Template CSS with actual selectors\n const cssTemplate = `\n .highlight-globals [${globalsSelector}] {\n box-shadow: ${outline(globals)} !important;\n }\n\n .highlight-context [${contextSelector}] {\n box-shadow: ${outline(context)} !important;\n }\n\n .highlight-entity [${baseSelector}] {\n box-shadow: ${outline(entity)} !important;\n }\n\n .highlight-property [${propertySelector}] {\n box-shadow: ${outline(property)} !important;\n }\n\n .highlight-action [${prefix}action] {\n box-shadow: ${outline(action)} !important;\n }\n\n /* Combined highlights with layered solid borders */\n .highlight-entity.highlight-action [${baseSelector}][${prefix}action] {\n box-shadow: ${outline(action, entity)} !important;\n }\n\n .highlight-entity.highlight-context [${baseSelector}][${contextSelector}] {\n box-shadow: ${outline(entity, context)} !important;\n }\n\n .highlight-entity.highlight-property [${baseSelector}][${propertySelector}] {\n box-shadow: ${outline(entity, property)} !important;\n }\n\n .highlight-action.highlight-context [${prefix}action][${contextSelector}] {\n box-shadow: ${outline(action, context)} !important;\n }\n\n .highlight-context.highlight-property [${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(context, property)} !important;\n }\n\n .highlight-action.highlight-property [${prefix}action][${propertySelector}] {\n box-shadow: ${outline(action, property)} !important;\n }\n\n /* Globals combinations */\n .highlight-globals.highlight-entity [${globalsSelector}][${baseSelector}] {\n box-shadow: ${outline(globals, entity)} !important;\n }\n\n .highlight-globals.highlight-action [${globalsSelector}][${prefix}action] {\n box-shadow: ${outline(globals, action)} !important;\n }\n\n .highlight-globals.highlight-context [${globalsSelector}][${contextSelector}] {\n box-shadow: ${outline(globals, context)} !important;\n }\n\n .highlight-globals.highlight-property [${globalsSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, property)} !important;\n }\n\n /* Triple combinations with globals */\n .highlight-globals.highlight-entity.highlight-action\n [${globalsSelector}][${baseSelector}][${prefix}action] {\n box-shadow: ${outline(globals, entity, action)} !important;\n }\n\n .highlight-globals.highlight-entity.highlight-context\n [${globalsSelector}][${baseSelector}][${contextSelector}] {\n box-shadow: ${outline(globals, entity, context)} !important;\n }\n\n .highlight-globals.highlight-entity.highlight-property\n [${globalsSelector}][${baseSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, entity, property)} !important;\n }\n\n .highlight-globals.highlight-action.highlight-context\n [${globalsSelector}][${prefix}action][${contextSelector}] {\n box-shadow: ${outline(globals, action, context)} !important;\n }\n\n .highlight-globals.highlight-action.highlight-property\n [${globalsSelector}][${prefix}action][${propertySelector}] {\n box-shadow: ${outline(globals, action, property)} !important;\n }\n\n .highlight-globals.highlight-context.highlight-property\n [${globalsSelector}][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, context, property)} !important;\n }\n\n /* Triple combinations with distinct layers */\n .highlight-entity.highlight-action.highlight-context\n [${baseSelector}][${prefix}action][${contextSelector}] {\n box-shadow: ${outline(action, entity, context)} !important;\n }\n\n /* Triple combinations with property */\n .highlight-entity.highlight-action.highlight-property\n [${baseSelector}][${prefix}action][${propertySelector}] {\n box-shadow: ${outline(action, entity, property)} !important;\n }\n\n .highlight-entity.highlight-context.highlight-property\n [${baseSelector}][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(context, entity, property)} !important;\n }\n\n .highlight-action.highlight-context.highlight-property\n [${prefix}action][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(action, context, property)} !important;\n }\n\n /* Quadruple combinations with globals */\n .highlight-globals.highlight-entity.highlight-action.highlight-context\n [${globalsSelector}][${baseSelector}][${prefix}action][${contextSelector}] {\n box-shadow: ${outline(globals, entity, action, context)} !important;\n }\n\n .highlight-globals.highlight-entity.highlight-action.highlight-property\n [${globalsSelector}][${baseSelector}][${prefix}action][${propertySelector}] {\n box-shadow: ${outline(globals, entity, action, property)} !important;\n }\n\n .highlight-globals.highlight-entity.highlight-context.highlight-property\n [${globalsSelector}][${baseSelector}][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, entity, context, property)} !important;\n }\n\n .highlight-globals.highlight-action.highlight-context.highlight-property\n [${globalsSelector}][${prefix}action][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, action, context, property)} !important;\n }\n\n /* Quadruple combination */\n .highlight-entity.highlight-action.highlight-context.highlight-property\n [${baseSelector}][${prefix}action][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(action, entity, context, property)} !important;\n }\n\n /* Quintuple combination with all attributes */\n .highlight-globals.highlight-entity.highlight-action.highlight-context.highlight-property\n [${globalsSelector}][${baseSelector}][${prefix}action][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, entity, action, context, property)} !important;\n }\n `;\n\n return cssTemplate;\n};\n\n// Function to inject highlighting CSS into story document\nexport const injectHighlightingCSS = (\n storyDoc: Document,\n prefix: string = 'data-elb',\n): void => {\n // Remove existing styles\n const existingStyle = storyDoc.querySelector('#walkeros-highlighting');\n if (existingStyle) {\n existingStyle.remove();\n }\n\n const highlightingStyleElement = storyDoc.createElement('style');\n highlightingStyleElement.id = 'walkeros-highlighting';\n const css = generateHighlightCSS(prefix);\n highlightingStyleElement.textContent = css;\n\n storyDoc.head.appendChild(highlightingStyleElement);\n};\n","// Utilities for managing DOM highlighting\n\nimport type { WalkerOSAddon } from '../types';\nimport {\n getStoryDocument,\n getStoryRootElement,\n enhanceProperties,\n} from './domUtils';\nimport { injectHighlightingCSS } from './cssUtils';\n\n// Function to apply highlighting to story root\nexport const applyHighlighting = (\n highlights: WalkerOSAddon['highlights'],\n prefix: string = 'data-elb',\n): void => {\n const storyRoot = getStoryRootElement();\n if (!storyRoot) return;\n\n // Remove existing highlighting classes\n storyRoot.classList.remove('highlight-context');\n storyRoot.classList.remove('highlight-entity');\n storyRoot.classList.remove('highlight-property');\n storyRoot.classList.remove('highlight-action');\n storyRoot.classList.remove('highlight-globals');\n\n if (!highlights) return;\n\n // Re-enhance properties FIRST to ensure they're marked\n enhanceProperties(storyRoot, prefix);\n\n // Then add specific highlighting classes\n if (highlights.context) storyRoot.classList.add('highlight-context');\n if (highlights.entity) storyRoot.classList.add('highlight-entity');\n if (highlights.property) storyRoot.classList.add('highlight-property');\n if (highlights.action) storyRoot.classList.add('highlight-action');\n if (highlights.globals) storyRoot.classList.add('highlight-globals');\n};\n\n// Combined function to inject CSS and apply highlighting\nexport const setupHighlighting = (\n highlights: WalkerOSAddon['highlights'],\n prefix: string = 'data-elb',\n): void => {\n const storyDoc = getStoryDocument();\n\n // Always inject CSS first\n injectHighlightingCSS(storyDoc, prefix);\n\n // Then apply highlighting\n applyHighlighting(highlights, prefix);\n};\n","import type { WalkerOSAddon } from './types';\nimport type { DecoratorFunction } from 'storybook/internal/types';\nimport { addons } from 'storybook/preview-api';\nimport { getAllEvents, getGlobals } from '@walkeros/web-source-browser';\n\nimport { ADDON_ID, EVENTS } from './constants';\nimport { initializeWalker } from './walker';\nimport { getStoryRootElement, enhanceProperties } from './utils/domUtils';\nimport { buildAttributeTree } from './utils/attributeTreeUtils';\nimport { setupHighlighting } from './utils/highlightingUtils';\n\n// Set up the channel listener globally, not per story\nconst channel = addons.getChannel();\nlet currentStoryId: string | null = null;\n\n// Global listener for the request events\nchannel.addListener(EVENTS.REQUEST, (config: WalkerOSAddon) => {\n const storyRoot = getStoryRootElement();\n if (!storyRoot) {\n channel.emit(EVENTS.RESULT, []);\n return;\n }\n\n // Enhance DOM with property attributes\n enhanceProperties(storyRoot, config.prefix || 'data-elb');\n\n const events = getAllEvents(storyRoot as Element, config.prefix);\n\n // Collect globals from data-elbglobals attributes\n const globals = getGlobals(config.prefix || 'data-elb', storyRoot as Element);\n\n // Add globals to each event if any globals exist\n const eventsWithGlobals = events.map((event) => {\n if (Object.keys(globals).length > 0) {\n return { ...event, globals };\n }\n return event;\n });\n\n // Send the result back to the manager\n channel.emit(EVENTS.RESULT, eventsWithGlobals);\n});\n\n// Global listener for highlighting events\nchannel.addListener(EVENTS.HIGHLIGHT, (config: WalkerOSAddon) => {\n setupHighlighting(config.highlights, config.prefix);\n});\n\n// Global listener for attribute tree requests\nchannel.addListener(EVENTS.ATTRIBUTES_REQUEST, (config: WalkerOSAddon) => {\n const storyRoot = getStoryRootElement();\n if (!storyRoot) {\n channel.emit(EVENTS.ATTRIBUTES_RESULT, { nodes: [], globals: [] });\n return;\n }\n\n // Build the skeleton tree ({ nodes, globals })\n const result = buildAttributeTree(\n storyRoot as Element,\n config.prefix || 'data-elb',\n );\n\n // Send the result back to the manager\n channel.emit(EVENTS.ATTRIBUTES_RESULT, result);\n});\n\nexport const withRoundTrip: DecoratorFunction = (storyFn, context) => {\n // Check if story changed and auto-run is enabled\n const storyId = context.id;\n const hasStoryChanged = currentStoryId !== storyId;\n const { parameters } = context;\n const autoRefresh = parameters?.[ADDON_ID]?.autoRefresh;\n\n if (hasStoryChanged) {\n currentStoryId = storyId;\n }\n\n const result = storyFn();\n\n // Initialize walker and inject CSS after story renders\n setTimeout(() => {\n // Initialize walkerOS for live event capture\n const prefix = parameters?.[ADDON_ID]?.prefix || 'data-elb';\n initializeWalker({ prefix, autoRefresh }).catch((err) => {\n console.error('Walker initialization failed:', err);\n });\n\n // Inject highlighting CSS and enhance properties\n const storyRoot = getStoryRootElement();\n if (storyRoot) {\n setupHighlighting(undefined, prefix);\n enhanceProperties(storyRoot, prefix);\n }\n\n // Auto-run walker if story changed and auto-refresh is enabled\n if (hasStoryChanged && autoRefresh && window.__storybookElb) {\n window.__storybookElb('walker run');\n }\n }, 200);\n\n return result;\n};\n","/**\n * A decorator is a way to wrap a story in extra “rendering” functionality. Many addons define decorators\n * in order to augment stories:\n * - with extra rendering\n * - gather details about how a story is rendered\n *\n * When writing stories, decorators are typically used to wrap stories with extra markup or context mocking.\n *\n * https://storybook.js.org/docs/react/writing-stories/decorators\n */\nimport type { ProjectAnnotations, Renderer } from 'storybook/internal/types';\n\nimport { ADDON_ID } from './constants';\nimport { withRoundTrip } from './withRoundTrip';\n\n/**\n * Note: if you want to use JSX in this file, rename it to `preview.tsx`\n * and update the entry prop in tsup.config.ts to use \"src/preview.tsx\",\n */\n\nconst preview: ProjectAnnotations<Renderer> = {\n decorators: [withRoundTrip],\n parameters: {\n [ADDON_ID]: {\n autoRefresh: true,\n prefix: 'data-elb',\n },\n },\n};\n\nexport default preview;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/constants.ts","../src/walker.ts","../src/utils/domUtils.ts","../src/utils/attributeTreeUtils.ts","../../explorer/src/design/index.ts","../src/utils/eventColors.ts","../src/utils/cssUtils.ts","../src/utils/highlightingUtils.ts","../src/withRoundTrip.ts","../src/preview.ts"],"names":["ADDON_ID","EVENTS","destinationConsole","event","context","destinationLive","channel","addons","getIframeContext","iframe","e","initializeWalker","config","iframeDoc","iframeWin","result","startFlow","sourceBrowser","collector","elb","error","getStoryDocument","getStoryRootElement","storyDoc","selectors","selector","element","getElementPath","el","path","current","c","enhanceProperties","storyRoot","prefix","allElements","scopedAttr","getElbAttributeName","Const","actionAttr","contextAttr","globalsAttr","attr","generateElementHTML","tagName","propertyMarker","attribs","PRIORITY","addProperty","acc","key","value","origin","existing","collectValues","name","values","getElbValues","k","v","buildAttributeTree","scope","entityAttr","scopedName","entityEls","entitySet","owningEntity","cur","nodeMap","entity","props","owned","child","o","anc","g","roots","node","parentEl","parentNode","globalsValues","getGlobals","globals","vizBg","eventEntity","eventAction","eventProperty","eventContext","eventGlobals","highlightColors","outline","colors","color","index","generateHighlightCSS","property","action","globalsSelector","contextSelector","baseSelector","propertySelector","injectHighlightingCSS","existingStyle","highlightingStyleElement","css","applyHighlighting","highlights","setupHighlighting","currentStoryId","events","getAllEvents","eventsWithGlobals","withRoundTrip","storyFn","_a","storyId","hasStoryChanged","parameters","autoRefresh","err","preview","preview_default"],"mappings":"+MAAO,IAAMA,CAAAA,CAAW,UAAA,CAIjB,IAAMC,CAAAA,CAAS,CACpB,MAAA,CAAQ,CAAA,EAAGD,CAAQ,UACnB,OAAA,CAAS,CAAA,EAAGA,CAAQ,CAAA,QAAA,CAAA,CACpB,SAAA,CAAW,CAAA,EAAGA,CAAQ,CAAA,UAAA,CAAA,CACtB,UAAA,CAAY,CAAA,EAAGA,CAAQ,CAAA,WAAA,CAAA,CACvB,iBAAA,CAAmB,CAAA,EAAGA,CAAQ,CAAA,kBAAA,CAAA,CAC9B,mBAAoB,CAAA,EAAGA,CAAQ,CAAA,mBAAA,CACjC,CAAA,CCGA,IAAME,CAAAA,CAAqB,CACzB,IAAA,CAAM,SAAA,CACN,IAAA,CAAM,CAACC,CAAAA,CAAuBC,IAAqC,CACjE,OAAA,CAAQ,GAAA,CAAI,kBAAA,CAAoBD,CAAK,EACvC,CAAA,CACA,MAAA,CAAQ,EACV,CAAA,CAGME,CAAA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A,CAIjCkF,CAAAA,EAAmBE,GAAe,MAAA,CAAO,cAAA,EAC3C,OAAO,cAAA,CAAe,YAAY,EAEtC,CAAA,CAAG,GAAG,EAECvG,CACT,CAAA,KCjFMyG,EAAAA,CAAwC,CAC5C,WAAY,CAACR,CAAa,EAC1B,UAAA,CAAY,CACV,CAAChH,CAAQ,EAAG,CACV,WAAA,CAAa,IAAA,CACb,OAAQ,UACV,CACF,CACF,CAAA,CAEOyH,EAAAA,CAAQD","file":"preview.js","sourcesContent":["export const ADDON_ID = 'walkerOS';\nexport const PANEL_ID = `${ADDON_ID}/panel`;\nexport const KEY = `walkerOS`;\n\nexport const EVENTS = {\n RESULT: `${ADDON_ID}/result`,\n REQUEST: `${ADDON_ID}/request`,\n HIGHLIGHT: `${ADDON_ID}/highlight`,\n LIVE_EVENT: `${ADDON_ID}/live-event`,\n ATTRIBUTES_RESULT: `${ADDON_ID}/attributes-result`,\n ATTRIBUTES_REQUEST: `${ADDON_ID}/attributes-request`,\n};\n","import type { Collector, WalkerOS, Destination } from '@walkeros/core';\nimport { startFlow } from '@walkeros/collector';\nimport { sourceBrowser } from '@walkeros/web-source-browser';\nimport { addons } from 'storybook/preview-api';\nimport { EVENTS } from './constants';\n\ndeclare global {\n interface Window {\n __storybookElb: WalkerOS.Elb;\n __storybookWalker: Collector.Instance;\n }\n}\n\n// Simple console destination for Storybook\nconst destinationConsole = {\n type: 'console',\n push: (event: WalkerOS.Event, context: Destination.PushContext) => {\n console.log('Storybook Event:', event);\n },\n config: {},\n};\n\n// Live destination for Storybook panel\nconst destinationLive = {\n type: 'live',\n push: (event: WalkerOS.Event, context: Destination.PushContext) => {\n // Send event to Storybook panel for live display\n const channel = addons.getChannel();\n if (channel) {\n channel.emit(EVENTS.LIVE_EVENT, event);\n }\n },\n config: {},\n};\n\n// Function to get Storybook iframe context\nfunction getIframeContext() {\n try {\n // Try to get iframe from parent document (manager context)\n const iframe = parent.document.querySelector(\n '#storybook-preview-iframe',\n ) as HTMLIFrameElement;\n if (iframe?.contentDocument && iframe?.contentWindow) {\n return {\n document: iframe.contentDocument,\n window: iframe.contentWindow,\n };\n }\n } catch (e) {\n // If we can't access parent, we're likely already in iframe context\n }\n\n // Fallback to current context\n return { document, window };\n}\n\nexport async function initializeWalker(config?: {\n prefix?: string;\n autoRefresh?: boolean;\n}): Promise<void> {\n // Skip initialization if already done\n if (window.__storybookWalker) return;\n\n try {\n // Get iframe context for proper event capture\n const { document: iframeDoc, window: iframeWin } = getIframeContext();\n\n if (!iframeDoc) {\n console.warn('Document not available, skipping walkerOS initialization');\n return;\n }\n\n // Create collector with browser source and destinations\n const result = await startFlow({\n consent: { functional: true },\n sources: {\n browser: {\n code: sourceBrowser,\n config: {\n settings: {\n pageview: true,\n elbLayer: '__storybookElbLayer',\n elb: '__storybookElb',\n prefix: config?.prefix || 'data-elb',\n scope: iframeDoc.body || iframeDoc, // Set scope to iframe document\n },\n },\n env: {\n window: iframeWin,\n document: iframeDoc,\n },\n },\n },\n destinations: {\n console: { code: destinationConsole },\n live: { code: destinationLive },\n },\n });\n\n const { collector, elb } = result;\n\n // Verify collector was created successfully\n if (!collector) {\n throw new Error('Collector creation failed - no collector returned');\n }\n\n // Set global window objects\n window.__storybookWalker = collector;\n window.__storybookElb = elb;\n } catch (error) {\n console.error('Failed to initialize walkerOS:', error);\n }\n}\n","// DOM utilities for working with story elements\n\nimport { Const } from '@walkeros/collector';\nimport { getElbAttributeName } from '@walkeros/web-source-browser';\n\n// Function to get the story document (either iframe or main document)\nexport const getStoryDocument = (): Document => {\n // Try to find story iframe\n const iframe = document.querySelector(\n '#storybook-preview-iframe',\n ) as HTMLIFrameElement;\n if (iframe?.contentDocument) {\n return iframe.contentDocument;\n }\n // Fallback to main document\n return document;\n};\n\n// Function to get the story root element\nexport const getStoryRootElement = (): Element | null => {\n const storyDoc = getStoryDocument();\n\n // Try multiple selectors for story root\n const selectors = [\n '#storybook-root',\n '#root',\n '[data-testid=\"storybook-root\"]',\n 'body',\n ];\n\n for (const selector of selectors) {\n const element = storyDoc.querySelector(selector);\n if (element) {\n return element;\n }\n }\n\n return storyDoc.body;\n};\n\n// Helper to get element path\nexport const getElementPath = (el: Element): string => {\n const path = [];\n let current = el;\n while (current && current !== document.body && current.parentElement) {\n let selector = current.tagName.toLowerCase();\n if (current.id) {\n selector += `#${current.id}`;\n } else if (current.className && typeof current.className === 'string') {\n selector += `.${current.className\n .split(' ')\n .filter((c) => c)\n .join('.')}`;\n }\n path.unshift(selector);\n current = current.parentElement;\n }\n return path.join(' > ');\n};\n\n// Function to enhance DOM with property attributes\nexport const enhanceProperties = (\n storyRoot: Element,\n prefix: string = 'data-elb',\n): void => {\n // Find all elements with any attributes starting with prefix-\n const allElements = Array.from(storyRoot.querySelectorAll('*'));\n\n const scopedAttr = getElbAttributeName(prefix, Const.Commands.Scoped, false); // data-elb_\n const actionAttr = getElbAttributeName(prefix, Const.Commands.Action, false);\n const contextAttr = getElbAttributeName(\n prefix,\n Const.Commands.Context,\n false,\n );\n const globalsAttr = getElbAttributeName(\n prefix,\n Const.Commands.Globals,\n false,\n );\n\n allElements.forEach((el) => {\n const hasProperties = Array.from(el.attributes).some((attr) => {\n if (attr.name === scopedAttr) return true; // scoped generic data-elb_\n return (\n attr.name.startsWith(`${prefix}-`) &&\n attr.name !== actionAttr &&\n attr.name !== contextAttr &&\n attr.name !== globalsAttr\n );\n });\n\n // Mark elements with property attributes\n if (hasProperties) {\n el.setAttribute(getElbAttributeName(prefix, 'property', false), '');\n }\n });\n};\n","// Builds an entity-centric \"skeleton\" tree: each node is a data-elb entity, with\n// generic (data-elb-), scoped (data-elb_), and explicit (data-elb-<entity>)\n// values resolved onto it and tagged by origin. Interim addon-local\n// approximation of the walker's resolution (see the design doc for fidelity\n// limits: cross-DOM links, shadow piercing, exact collision priority, and\n// context ordering index are out of scope for Phase 1).\n\nimport type { WalkerOS } from '@walkeros/core';\nimport { Const } from '@walkeros/collector';\nimport {\n getElbValues,\n getElbAttributeName,\n getGlobals,\n} from '@walkeros/web-source-browser';\nimport type { AttributeNode, ResolvedProperty } from '../types';\nimport { getElementPath } from './domUtils';\n\nconst generateElementHTML = (element: Element, prefix: string): string => {\n const tagName = element.tagName.toLowerCase();\n // Hide the synthetic highlight marker (data-elbproperty) that\n // enhanceProperties stamps on the live DOM; it is an internal helper, not\n // author-written tagging, so it must not appear in the displayed markup.\n const propertyMarker = getElbAttributeName(prefix, 'property', false);\n const attribs = Array.from(element.attributes)\n .filter((a) => a.name !== propertyMarker)\n .map((a) => `${a.name}=\"${a.value}\"`);\n if (attribs.length === 0) return `<${tagName}></${tagName}>`;\n if (attribs.length === 1) return `<${tagName} ${attribs[0]}></${tagName}>`;\n return `<${tagName}\\n${attribs.map((a) => ` ${a}`).join('\\n')}\\n></${tagName}>`;\n};\n\n// Origin priority for same-key collisions (highest first). Approximate; real\n// walker priority is documented as out of scope for Phase 1.\nconst PRIORITY: Record<ResolvedProperty['origin'], number> = {\n data: 3,\n scoped: 2,\n generic: 1,\n};\n\nconst addProperty = (\n acc: Map<string, ResolvedProperty>,\n key: string,\n value: WalkerOS.Property | undefined,\n origin: ResolvedProperty['origin'],\n) => {\n if (!key) return; // never store the blank-key generic\n if (value === undefined || value === null || value === '') return;\n const existing = acc.get(key);\n if (!existing || PRIORITY[origin] > PRIORITY[existing.origin]) {\n acc.set(key, { key, value, origin });\n }\n};\n\nconst collectValues = (\n acc: Map<string, ResolvedProperty>,\n prefix: string,\n el: Element,\n name: string, // '' for generic, entity name for explicit\n origin: ResolvedProperty['origin'],\n) => {\n const values = getElbValues(prefix, el, name, true);\n Object.entries(values).forEach(([k, v]) => addProperty(acc, k, v, origin));\n};\n\nexport const buildAttributeTree = (\n scope: Element,\n prefix: string = Const.Commands.Prefix,\n): { nodes: AttributeNode[]; globals: ResolvedProperty[] } => {\n const entityAttr = getElbAttributeName(prefix); // data-elb\n const scopedName = Const.Commands.Scoped; // '_'\n\n // All entity elements (self + descendants).\n const entityEls: Element[] = [];\n if (scope.matches(`[${entityAttr}]`)) entityEls.push(scope);\n scope.querySelectorAll(`[${entityAttr}]`).forEach((el) => entityEls.push(el));\n const entitySet = new Set(entityEls);\n\n // Nearest ancestor-or-self entity for any element (DOM ancestry).\n const owningEntity = (el: Element): Element | null => {\n let cur: Element | null = el;\n while (cur) {\n if (entitySet.has(cur)) return cur;\n cur = cur.parentElement;\n }\n return null;\n };\n\n const nodeMap = new Map<Element, AttributeNode>();\n\n entityEls.forEach((el) => {\n const entity = el.getAttribute(entityAttr) || '';\n const props = new Map<string, ResolvedProperty>();\n\n // Own + owned descendants: explicit (data-elb-<entity>) and generic (data-elb-)\n const owned: Element[] = [el];\n el.querySelectorAll('*').forEach((child) => {\n if (owningEntity(child) === el) owned.push(child);\n });\n owned.forEach((o) => {\n collectValues(props, prefix, o, entity, 'data');\n collectValues(props, prefix, o, '', 'generic');\n });\n\n // Ancestors (incl. self start): explicit, generic, and scoped (data-elb_)\n let anc: Element | null = el;\n while (anc) {\n collectValues(props, prefix, anc, entity, 'data');\n collectValues(props, prefix, anc, '', 'generic');\n // scoped uses isProperty=false (suffix '_' with no dash)\n Object.entries(getElbValues(prefix, anc, scopedName, false)).forEach(\n ([k, v]) => addProperty(props, k, v, 'scoped'),\n );\n anc = anc.parentElement;\n }\n\n nodeMap.set(el, {\n element: el.tagName.toLowerCase(),\n path: getElementPath(el),\n htmlMarkup: generateElementHTML(el, prefix),\n attributes: {\n entity,\n action:\n el.getAttribute(\n getElbAttributeName(prefix, Const.Commands.Action, false),\n ) || undefined,\n context: (() => {\n const c = getElbValues(prefix, el, Const.Commands.Context, false);\n return Object.keys(c).length ? c : undefined;\n })(),\n globals: (() => {\n const g = getElbValues(prefix, el, Const.Commands.Globals, false);\n return Object.keys(g).length ? g : undefined;\n })(),\n properties: Array.from(props.values()),\n },\n children: [],\n });\n });\n\n // Nest by nearest ancestor entity.\n const roots: AttributeNode[] = [];\n nodeMap.forEach((node, el) => {\n const parentEl = el.parentElement ? owningEntity(el.parentElement) : null;\n const parentNode = parentEl ? nodeMap.get(parentEl) : undefined;\n if (parentNode) parentNode.children.push(node);\n else roots.push(node);\n });\n\n const globalsValues = getGlobals(prefix, scope);\n const globals: ResolvedProperty[] = [];\n Object.entries(globalsValues).forEach(([key, value]) => {\n if (value !== undefined && value !== null && value !== '')\n globals.push({ key, value, origin: 'data' });\n });\n\n return { nodes: roots, globals };\n};\n","/* walkerOS design constants, generated from design/tokens.json by src/design/generate.ts. Edit the JSON and run the explorer build, never this file. */\n\nexport type Theme = 'dark' | 'light';\n\n/** Page background (hero, features, FAQ, closing CTA). Default ground for `fg`, `fg-2`, `link`. */\nexport const bg = { dark: \"#111827\", light: \"#ffffff\" } as const;\n\n/** Alternating section band (Why, More features, Plans) and footer. Switch between `bg` and `bg-2` to separate sections, always with a top `border` rule. */\nexport const bg2 = { dark: \"#151e2e\", light: \"#f6f7f9\" } as const;\n\n/** Cards, plan tiers, FAQ items, the install-command chip and secondary buttons. */\nexport const surface = { dark: \"#1a2232\", light: \"#ffffff\" } as const;\n\n/** Inline code background, icon-button hover. */\nexport const surface2 = { dark: \"#222b3c\", light: \"#f1f3f6\" } as const;\n\n/** Hairline for section rules, header underline, card and input outlines. Decorative only; it does not meet 3:1, so never rely on it alone to mark a control. */\nexport const border = { dark: \"#2f3a4d\", light: \"#e3e6eb\" } as const;\n\n/** Headings and body copy on `bg`, `bg-2`, `surface`, `surface-2` (14:1+ both themes). */\nexport const fg = { dark: \"#ffffff\", light: \"#111827\" } as const;\n\n/** Secondary copy: leads, card descriptions, list items, footer links. 5.5:1+ on every ground. */\nexport const fg2 = { dark: \"#9aa3b2\", light: \"#4b5563\" } as const;\n\n/** Tertiary text: tier labels, `$` prompt, FAQ `+`, copyright, input placeholders. 4.5:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes (dark 4.6:1+, light 4.7:1+). */\nexport const fg3 = { dark: \"#8c93a2\", light: \"#656d7a\" } as const;\n\n/** elbwalker blue. Primary button fill, check icons, highlight word in the H1, focus ring, announcement bar. Light theme: 2.4:1 on white — fine as a fill under `on-primary`, too faint for text or as the only marker (flagged, kept from source). */\nexport const primary = { dark: \"#01b5e2\", light: \"#01b5e2\" } as const;\n\n/** Text and icons on `primary` fills (6.9:1). Never put white on `primary` (2.4:1) — the current walkeros.io buttons do; the relaunch fixes it. */\nexport const onPrimary = { dark: \"#04222b\", light: \"#04222b\" } as const;\n\n/** Links, eyebrows, mono step numbers; `info` and the light `focus` ring use it. 4.5:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes (dark 6.0:1+, light 4.6:1+). Underline on hover only. */\nexport const link = { dark: \"#4fb3e0\", light: \"#0076a0\" } as const;\n\n/** Soft primary halo: hero radial glow and the 4px ring around the highlighted plan. */\nexport const glow = { dark: \"rgba(1, 181, 226, 0.16)\", light: \"rgba(1, 181, 226, 0.14)\" } as const;\n\n/** Code-block panel (Palenight family), both themes. */\nexport const codeBg = \"#292d3e\";\n\n/** Code-block title bar / tab strip. */\nexport const codeBar = \"#232636\";\n\n/** Code-block outline. */\nexport const codeBorder = \"#444a5e\";\n\n/** Default code text on `code-bg` (8:1). */\nexport const codeFg = \"#bfc7d5\";\n\n/** Product visualisation panel (tagging and mapping demos). Visualisations stay dark in both themes. */\nexport const vizBg = \"#1a2232\";\n\n/** Code pane inside a visualisation. */\nexport const vizCodeBg = \"#131c2b\";\n\n/** Outlines inside visualisations. */\nexport const vizBorder = \"#334055\";\n\n/** Primary text inside visualisations. */\nexport const vizFg = \"#e8eaf0\";\n\n/** Legend and meta text inside visualisations (5.4:1 on `viz-code-bg`). */\nexport const vizFg2 = \"#8e96aa\";\n\n/** Code comments and file kinds inside visualisations. */\nexport const vizComment = \"#6c7590\";\n\n/** Gutter line numbers. Decorative, below 3:1. */\nexport const vizLineNumber = \"#4a5165\";\n\n/** Raised surfaces inside visualisations: the rendered teaser card, table rules. */\nexport const vizSurface = \"#2b3649\";\n\n/** Syntax: HTML/JSX tag names in visualisation code (6:1+ on `viz-code-bg`). */\nexport const vizTag = \"#e38fd6\";\n\n/** Syntax: string values in visualisation code and JSON cells. */\nexport const vizString = \"#e5c07b\";\n\n/** Syntax: numbers and booleans in mapping code. */\nexport const vizNumber = \"#f78c6c\";\n\n/** Syntax: punctuation and plain code text; visualisation captions. */\nexport const vizPunct = \"#9aa3b8\";\n\n/** Event part: entity (e.g. `product`). Used for syntax highlight, legend chip and the highlighted DOM region in tagging demos. The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventEntity = { dark: \"#c5e478\", light: \"#537a01\" } as const;\n\n/** Event part: action (e.g. `view`, `add`). The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventAction = { dark: \"#c792ea\", light: \"#8c59ac\" } as const;\n\n/** Event part: entity property (`data-elb-product=\"name\"`). The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventProperty = { dark: \"#f0717f\", light: \"#be4456\" } as const;\n\n/** Event part: context. The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventContext = { dark: \"#f2a65a\", light: \"#a25f06\" } as const;\n\n/** Event part: globals. The dark value is for dark grounds (islands, visualisations, mark layers); the light value reads 4.5:1 or more as text on `bg`, `bg-2`, `surface` and `surface-2`. */\nexport const eventGlobals = { dark: \"#7fc4ea\", light: \"#317699\" } as const;\n\n/** Tag kind: user (who the visitor is). Unlike the five event parts it has no light value: it sits only on dark grounds (`viz-bg`, legends, chips, mark layers) and always pairs with its word. 5.2:1 on `viz-bg`; kept apart from `event-property`, `event-action` and `danger`. */\nexport const eventUser = \"#e65fc4\";\n\n/** Tag kind: consent (consent states and requirements). Dark grounds only, always with its word. 10.7:1 on `viz-bg`. */\nexport const eventConsent = \"#cbd5e1\";\n\n/** Brand scale (walkeros.io docs). Light-theme badge and admonition background. */\nexport const elbwalker100 = \"#edfeff\";\n\n/** Brand scale. Admonition highlight (light). */\nexport const elbwalker200 = \"#abf8ff\";\n\n/** Brand scale. Admonition text (dark). */\nexport const elbwalker300 = \"#69ecfe\";\n\n/** Brand scale. */\nexport const elbwalker400 = \"#27dbfe\";\n\n/** Brand scale anchor = `primary`. Admonition border. */\nexport const elbwalker500 = \"#01b5e2\";\n\n/** Brand scale. Badge text (light), badge fill (dark). */\nexport const elbwalker700 = \"#015372\";\n\n/** Brand scale. Admonition background (dark). */\nexport const elbwalker800 = \"#00283a\";\n\n/** Brand scale, darkest step. */\nexport const elbwalker900 = \"#000203\";\n\n/** Borders that mark a control: input, select, checkbox and switch outlines, the 1px edge of menus, popovers and dialogs, scrollbar thumbs, flow edges. 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes; `border` stays decorative. */\nexport const borderStrong = { dark: \"#6b778d\", light: \"#818a9a\" } as const;\n\n/** Focus ring, 2px solid with a 3px offset, on every interactive element: `primary` in dark, `link` in light, where `primary` is 2.2:1. 3:1 or more on every ground. */\nexport const focus = { dark: \"#01b5e2\", light: \"#0076a0\" } as const;\n\n/** Scrim behind modals and drawers. The layer above it is `surface` with a 1px `border-strong` edge, never a shadow. */\nexport const backdrop = { dark: \"rgba(3, 7, 18, 0.72)\", light: \"rgba(17, 24, 39, 0.4)\" } as const;\n\n/** Errors, destructive actions and invalid fields, always with an icon and a word. Text at 4.5:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. Kept apart from every event and step colour, `event-property` included. */\nexport const danger = { dark: \"#ffa4ac\", light: \"#b91c1c\" } as const;\n\n/** Text and icons on a `danger` fill such as a destructive button (dark 8.6:1, light 6.5:1). */\nexport const onDanger = { dark: \"#450a0a\", light: \"#ffffff\" } as const;\n\n/** Text and icons on an event-colour fill: a tag card's Done. Dark ink on the dark event values (5.6:1 or more), white on the light ones (about 5:1). */\nexport const onEvent = { dark: \"#111827\", light: \"#ffffff\" } as const;\n\n/** Success and healthy states, always with an icon and a word. Sits on the blue side of green, so it stays apart from `danger` with red-green colour blindness, and apart from every step and event colour. Text at 4.5:1 or more on every ground. */\nexport const success = { dark: \"#8cf9ff\", light: \"#07675d\" } as const;\n\n/** Warnings and states that need attention, always with an icon and a word. Kept apart from `step-transformer` and `event-context`. Text at 4.5:1 or more on every ground. */\nexport const warning = { dark: \"#cabb00\", light: \"#886000\" } as const;\n\n/** Neutral information, always with an icon and a word. The `link` colour in both themes. */\nexport const info = { dark: \"#4fb3e0\", light: \"#0076a0\" } as const;\n\n/** Tinted fill for danger banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const dangerBg = { dark: \"rgba(255, 164, 172, 0.16)\", light: \"rgba(185, 28, 28, 0.1)\" } as const;\n\n/** Tinted fill for success banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const successBg = { dark: \"rgba(140, 249, 255, 0.16)\", light: \"rgba(7, 103, 93, 0.1)\" } as const;\n\n/** Tinted fill for warning banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const warningBg = { dark: \"rgba(202, 187, 0, 0.16)\", light: \"rgba(136, 96, 0, 0.1)\" } as const;\n\n/** Tinted fill for information banners and badges. Text on it is `fg`; the status colour marks the icon and the border (3:1 or more on the tint). */\nexport const infoBg = { dark: \"rgba(79, 179, 224, 0.16)\", light: \"rgba(0, 118, 160, 0.1)\" } as const;\n\n/** Flow step colour: sources. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepSource = { dark: \"#6ee7b7\", light: \"#428569\" } as const;\n\n/** Flow step colour: transformers. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepTransformer = { dark: \"#fcd34d\", light: \"#bb7000\" } as const;\n\n/** Flow step colour: the collector. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepCollector = { dark: \"#7dd3fc\", light: \"#0c529b\" } as const;\n\n/** Flow step colour: destinations. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepDestination = { dark: \"#c4b5fd\", light: \"#6d1fd8\" } as const;\n\n/** Flow step colour: stores. Badges, node accents and edges, always beside the step word; 3:1 or more on `bg`, `bg-2`, `surface` and `surface-2` in both themes. */\nexport const stepStore = { dark: \"#a5b4fc\", light: \"#4138c9\" } as const;\n\n/** Platform badge: web, always with the word; 3:1 or more on every ground. */\nexport const platformWeb = { dark: \"#0ea5e9\", light: \"#008ddd\" } as const;\n\n/** Platform badge: server, always with the word; 3:1 or more on every ground. */\nexport const platformServer = { dark: \"#8b5cf6\", light: \"#8043f6\" } as const;\n\n/** First chart series: `primary` in dark, `link` in light. Series take `chart-1` to `chart-6` in order; the six stay apart in normal vision and with red-green colour blindness, and reach 3:1 on every ground. Label every series. */\nexport const chart1 = { dark: \"#01b5e2\", light: \"#0076a0\" } as const;\n\n/** Second chart series (orange). */\nexport const chart2 = { dark: \"#e69f00\", light: \"#ce710c\" } as const;\n\n/** Third chart series (bluish green). */\nexport const chart3 = { dark: \"#009563\", light: \"#217b58\" } as const;\n\n/** Fourth chart series (vermilion). */\nexport const chart4 = { dark: \"#e0520a\", light: \"#d32f4d\" } as const;\n\n/** Fifth chart series (reddish purple). */\nexport const chart5 = { dark: \"#ff6fad\", light: \"#b87889\" } as const;\n\n/** Sixth chart series (yellow in dark, olive in light). */\nexport const chart6 = { dark: \"#f0e442\", light: \"#546800\" } as const;\n\n/** Human notes and comment pins over visualisations, tag plans and frames. Kept apart from every step and status colour; 3:1 or more on every ground. */\nexport const annotation = { dark: \"#22c55e\", light: \"#409116\" } as const;\n\n/** Editor syntax (Monaco, Shiki, Prism): comments, 4.6:1 on `code-bg`. */\nexport const syntaxComment = \"#8c94be\";\n\n/** Editor syntax (Monaco, Shiki, Prism): strings, attribute names and inserted text, 9.9:1 on `code-bg`. */\nexport const syntaxString = \"#c3e88d\";\n\n/** Editor syntax (Monaco, Shiki, Prism): numbers, 5.8:1 on `code-bg`. */\nexport const syntaxNumber = \"#f78c6c\";\n\n/** Editor syntax (Monaco, Shiki, Prism): booleans, null and constants, 4.6:1 on `code-bg`. */\nexport const syntaxConstant = \"#ff5d78\";\n\n/** Editor syntax (Monaco, Shiki, Prism): keywords and storage modifiers, 5.2:1 on `code-bg`. */\nexport const syntaxKeyword = \"#c084fc\";\n\n/** Editor syntax (Monaco, Shiki, Prism): functions and built-ins, 5.9:1 on `code-bg`. */\nexport const syntaxFunction = \"#82aaff\";\n\n/** Editor syntax (Monaco, Shiki, Prism): types and class names, 9.1:1 on `code-bg`. */\nexport const syntaxType = \"#ffcb6b\";\n\n/** Editor syntax (Monaco, Shiki, Prism): operators and regular expressions, 9.0:1 on `code-bg`. */\nexport const syntaxOperator = \"#89ddff\";\n\n/** Editor syntax (Monaco, Shiki, Prism): punctuation and delimiters, 5.7:1 on `code-bg`. */\nexport const syntaxPunct = \"#c792ea\";\n\n/** Editor syntax (Monaco, Shiki, Prism): tags, invalid and deleted tokens, 4.6:1 on `code-bg`. */\nexport const syntaxTag = \"#ff5d79\";\n\n/** Editor syntax (Monaco, Shiki, Prism): namespaces, 8.1:1 on `code-bg`. */\nexport const syntaxNamespace = \"#b2ccd6\";\n\n/** Editor gutter line numbers on `code-bg`. Decorative, below 3:1. */\nexport const codeLineNumber = \"#676e95\";\n\n/** Editor selection over `code-bg`; `code-fg` stays at 5.4:1 on it. */\nexport const codeSelection = \"#717cb450\";\n\n/** Inserted lines in diff views over `code-bg`; `code-fg` stays at 5.4:1. */\nexport const codeInsertedBg = \"#c3e88d26\";\n\n/** Deleted lines in diff views over `code-bg`; `code-fg` stays at 6.6:1. */\nexport const codeDeletedBg = \"#ff5d7926\";\n\n/** Font family `sans`. */\nexport const fontSans = \"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif\";\n\n/** Font family `mono`. */\nexport const fontMono = \"SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace\";\n\n/** Font family `viz`. */\nexport const fontViz = \"'Geist', system-ui, sans-serif\";\n\n/** Font family `viz-mono`. */\nexport const fontVizMono = \"'Geist Mono', monospace\";\n\n/** The one transition duration. Read it as var(--motion): reduced motion sets it to 0ms. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const motion = \"180ms\";\n\n/** The one transition easing, beside var(--motion). Read it as var(--ease). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const ease = \"cubic-bezier(0.2, 0, 0, 1)\";\n\n/** Type style `display`: Hero H1 only. Fluid: clamp(38px, 6vw, 64px), max 20ch, text-wrap balance. One phrase may take `primary`. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeDisplay = { size: \"64px\", lineHeight: 1.08, weight: 700, tracking: \"-0.025em\", family: fontSans } as const;\n\n/** Type style `heading-xl`: Large split-section heading (More features). clamp(28px, 3.6vw, 44px). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeHeadingXl = { size: \"44px\", lineHeight: 1.1, weight: 700, tracking: \"-0.025em\", family: fontSans } as const;\n\n/** Type style `heading-lg`: Section H2. clamp(28px, 3.6vw, 40px), text-wrap balance. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeHeadingLg = { size: \"40px\", lineHeight: 1.15, weight: 700, tracking: \"-0.02em\", family: fontSans } as const;\n\n/** Type style `heading-md`: Feature H2 beside its explainer. clamp(26px, 3.2vw, 36px). Also the docs page title (h1), not fluid. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeHeadingMd = { size: \"36px\", lineHeight: 1.15, weight: 700, tracking: \"-0.02em\", family: fontSans } as const;\n\n/** Type style `footer-statement`: The footer's one-line brand statement. clamp(24px, 3.2vw, 34px), max 22ch. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeFooterStatement = { size: \"34px\", lineHeight: 1.2, weight: 700, tracking: \"-0.02em\", family: fontSans } as const;\n\n/** Type style `kicker-lg`: Large coloured kicker above `heading-xl`, in `primary`. clamp(22px, 2.4vw, 28px). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeKickerLg = { size: \"28px\", lineHeight: 1.2, weight: 700, tracking: \"-0.01em\", family: fontSans } as const;\n\n/** Type style `title-plan`: Plan tier name. Also docs h2. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeTitlePlan = { size: \"24px\", lineHeight: 1.3, weight: 700, tracking: \"-0.015em\", family: fontSans } as const;\n\n/** Type style `title-card`: Problem-card H3. Also docs h3; docs h4 takes its weight. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeTitleCard = { size: \"19px\", lineHeight: 1.35, weight: 600, family: fontSans } as const;\n\n/** Type style `title-item`: Feature-list H3. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeTitleItem = { size: \"18px\", lineHeight: 1.35, weight: 600, family: fontSans } as const;\n\n/** Type style `lead`: Hero sub-copy in `fg-2`, max 58ch. clamp(18px, 2vw, 21px). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeLead = { size: \"21px\", lineHeight: 1.65, weight: 400, family: fontSans } as const;\n\n/** Type style `body-lg`: Feature explainer paragraphs, FAQ questions (600). Also docs h4, at the `title-card` weight. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeBodyLg = { size: \"17px\", lineHeight: 1.65, weight: 400, family: fontSans } as const;\n\n/** Type style `body`: Default body copy, docs body copy included; buttons (600). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeBody = { size: \"16px\", lineHeight: 1.65, weight: 400, family: fontSans } as const;\n\n/** Type style `ui`: Nav links, list items, footer links. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeUi = { size: \"15px\", lineHeight: 1.5, weight: 500, family: fontSans } as const;\n\n/** Type style `small`: Announcement bar, `Docs →` links (500), copyright (400). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeSmall = { size: \"14px\", lineHeight: 1.5, weight: 600, family: fontSans } as const;\n\n/** Type style `eyebrow`: Section eyebrow, UPPERCASE, in `link`. One line that states the problem the section answers. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeEyebrow = { size: \"13px\", lineHeight: 1.5, weight: 600, tracking: \"0.12em\", family: fontSans } as const;\n\n/** Type style `label`: Plan tier label, UPPERCASE, in `fg-3` (`link` on the highlighted plan). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeLabel = { size: \"12px\", lineHeight: 1.5, weight: 700, tracking: \"0.12em\", family: fontSans } as const;\n\n/** Type style `code-command`: Install-command chip. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeCodeCommand = { size: \"15px\", lineHeight: 1.5, weight: 500, family: fontMono } as const;\n\n/** Type style `code-step`: Mono step numbers (01, 02, 03) in `link`. Also code panes: the explorer's code editors and docs code blocks. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeCodeStep = { size: \"13px\", lineHeight: 1.5, weight: 400, family: fontMono } as const;\n\n/** Type style `code-inline`: Inline code inside prose, docs inline code included: `surface-2` fill, `border` outline, radius-sm. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeCodeInline = { size: \"0.88em\", lineHeight: 1.5, weight: 400, family: fontMono } as const;\n\n/** Type style `viz-body`: Captions inside product visualisations (Geist). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizBody = { size: \"15px\", lineHeight: 1.5, weight: 400, family: fontViz } as const;\n\n/** Type style `viz-chip`: Step pills inside visualisations. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizChip = { size: \"13px\", lineHeight: 1.4, weight: 500, family: fontViz } as const;\n\n/** Type style `viz-code`: Code pane inside visualisations (Geist Mono). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizCode = { size: \"12px\", lineHeight: 1.8, weight: 400, family: fontVizMono } as const;\n\n/** Type style `viz-legend`: Event-part legend (Geist Mono) in `viz-fg-2`. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeVizLegend = { size: \"11px\", lineHeight: 1.5, weight: 400, family: fontVizMono } as const;\n\n/** Type style `product-heading`: Page and dialog titles in the app, the explorer and Tag Mode. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductHeading = { size: \"20px\", lineHeight: 1.3, weight: 600, family: fontSans } as const;\n\n/** Type style `product-title`: Panel, card and section titles in product UI. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductTitle = { size: \"16px\", lineHeight: 1.4, weight: 600, family: fontSans } as const;\n\n/** Type style `product-body`: Default product copy: body text, form fields, table cells, buttons (600). Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductBody = { size: \"14px\", lineHeight: 1.5, weight: 400, family: fontSans } as const;\n\n/** Type style `product-small`: Secondary rows, help text and dense tables. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductSmall = { size: \"13px\", lineHeight: 1.45, weight: 400, family: fontSans } as const;\n\n/** Type style `product-caption`: Captions, badges and meta labels. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductCaption = { size: \"12px\", lineHeight: 1.4, weight: 500, family: fontSans } as const;\n\n/** Type style `product-micro`: Dense canvas labels only: node badges, edge labels, mark labels and compact tooltip meta. Never body copy, never interactive text. Only for places CSS variables cannot reach, such as email HTML, styles injected by script and editor options. */\nexport const typeProductMicro = { size: \"11px\", lineHeight: 1.3, weight: 500, family: fontSans } as const;\n","import {\n eventAction,\n eventContext,\n eventEntity,\n eventGlobals,\n eventProperty,\n} from '@walkeros/explorer/design';\nimport type { WalkerOSAddon } from '../types';\n\nexport type HighlightKind = keyof NonNullable<WalkerOSAddon['highlights']>;\nexport type AttributeKind =\n | 'entity'\n | 'action'\n | 'context'\n | 'globals'\n | 'data';\n\n// Event colours of the walkerOS design system, their dark values: every use\n// pairs them with the dark visualisation ground vizBg.\nexport const highlightColors: Record<HighlightKind, string> = {\n globals: eventGlobals.dark,\n context: eventContext.dark,\n entity: eventEntity.dark,\n property: eventProperty.dark,\n action: eventAction.dark,\n};\n\n// Attribute badges name the property kind \"data\".\nexport const attributeColors: Record<AttributeKind, string> = {\n entity: highlightColors.entity,\n action: highlightColors.action,\n context: highlightColors.context,\n globals: highlightColors.globals,\n data: highlightColors.property,\n};\n","// CSS utilities for highlighting DOM elements\nimport { vizBg } from '@walkeros/explorer/design';\nimport { highlightColors } from './eventColors';\n\n// Stacked 2px rings in the given event colours, closed by a 1px edge in the\n// dark visualisation ground so the outline reads on light and dark stories.\nconst outline = (...colors: string[]): string =>\n [\n ...colors.map((color, index) => `0 0 0 ${(index + 1) * 2}px ${color}`),\n `0 0 0 ${colors.length * 2 + 1}px ${vizBg}`,\n ].join(', ');\n\n// Generate dynamic CSS based on prefix\nexport const generateHighlightCSS = (prefix: string): string => {\n const { globals, context, entity, property, action } = highlightColors;\n\n // Define selectors based on prefix\n const globalsSelector = `${prefix}globals`;\n const contextSelector = `${prefix}context`;\n const baseSelector = prefix;\n const propertySelector = `${prefix}property`;\n\n // Template CSS with actual selectors\n const cssTemplate = `\n .highlight-globals [${globalsSelector}] {\n box-shadow: ${outline(globals)} !important;\n }\n\n .highlight-context [${contextSelector}] {\n box-shadow: ${outline(context)} !important;\n }\n\n .highlight-entity [${baseSelector}] {\n box-shadow: ${outline(entity)} !important;\n }\n\n .highlight-property [${propertySelector}] {\n box-shadow: ${outline(property)} !important;\n }\n\n .highlight-action [${prefix}action] {\n box-shadow: ${outline(action)} !important;\n }\n\n /* Combined highlights with layered solid borders */\n .highlight-entity.highlight-action [${baseSelector}][${prefix}action] {\n box-shadow: ${outline(action, entity)} !important;\n }\n\n .highlight-entity.highlight-context [${baseSelector}][${contextSelector}] {\n box-shadow: ${outline(entity, context)} !important;\n }\n\n .highlight-entity.highlight-property [${baseSelector}][${propertySelector}] {\n box-shadow: ${outline(entity, property)} !important;\n }\n\n .highlight-action.highlight-context [${prefix}action][${contextSelector}] {\n box-shadow: ${outline(action, context)} !important;\n }\n\n .highlight-context.highlight-property [${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(context, property)} !important;\n }\n\n .highlight-action.highlight-property [${prefix}action][${propertySelector}] {\n box-shadow: ${outline(action, property)} !important;\n }\n\n /* Globals combinations */\n .highlight-globals.highlight-entity [${globalsSelector}][${baseSelector}] {\n box-shadow: ${outline(globals, entity)} !important;\n }\n\n .highlight-globals.highlight-action [${globalsSelector}][${prefix}action] {\n box-shadow: ${outline(globals, action)} !important;\n }\n\n .highlight-globals.highlight-context [${globalsSelector}][${contextSelector}] {\n box-shadow: ${outline(globals, context)} !important;\n }\n\n .highlight-globals.highlight-property [${globalsSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, property)} !important;\n }\n\n /* Triple combinations with globals */\n .highlight-globals.highlight-entity.highlight-action\n [${globalsSelector}][${baseSelector}][${prefix}action] {\n box-shadow: ${outline(globals, entity, action)} !important;\n }\n\n .highlight-globals.highlight-entity.highlight-context\n [${globalsSelector}][${baseSelector}][${contextSelector}] {\n box-shadow: ${outline(globals, entity, context)} !important;\n }\n\n .highlight-globals.highlight-entity.highlight-property\n [${globalsSelector}][${baseSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, entity, property)} !important;\n }\n\n .highlight-globals.highlight-action.highlight-context\n [${globalsSelector}][${prefix}action][${contextSelector}] {\n box-shadow: ${outline(globals, action, context)} !important;\n }\n\n .highlight-globals.highlight-action.highlight-property\n [${globalsSelector}][${prefix}action][${propertySelector}] {\n box-shadow: ${outline(globals, action, property)} !important;\n }\n\n .highlight-globals.highlight-context.highlight-property\n [${globalsSelector}][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, context, property)} !important;\n }\n\n /* Triple combinations with distinct layers */\n .highlight-entity.highlight-action.highlight-context\n [${baseSelector}][${prefix}action][${contextSelector}] {\n box-shadow: ${outline(action, entity, context)} !important;\n }\n\n /* Triple combinations with property */\n .highlight-entity.highlight-action.highlight-property\n [${baseSelector}][${prefix}action][${propertySelector}] {\n box-shadow: ${outline(action, entity, property)} !important;\n }\n\n .highlight-entity.highlight-context.highlight-property\n [${baseSelector}][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(context, entity, property)} !important;\n }\n\n .highlight-action.highlight-context.highlight-property\n [${prefix}action][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(action, context, property)} !important;\n }\n\n /* Quadruple combinations with globals */\n .highlight-globals.highlight-entity.highlight-action.highlight-context\n [${globalsSelector}][${baseSelector}][${prefix}action][${contextSelector}] {\n box-shadow: ${outline(globals, entity, action, context)} !important;\n }\n\n .highlight-globals.highlight-entity.highlight-action.highlight-property\n [${globalsSelector}][${baseSelector}][${prefix}action][${propertySelector}] {\n box-shadow: ${outline(globals, entity, action, property)} !important;\n }\n\n .highlight-globals.highlight-entity.highlight-context.highlight-property\n [${globalsSelector}][${baseSelector}][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, entity, context, property)} !important;\n }\n\n .highlight-globals.highlight-action.highlight-context.highlight-property\n [${globalsSelector}][${prefix}action][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, action, context, property)} !important;\n }\n\n /* Quadruple combination */\n .highlight-entity.highlight-action.highlight-context.highlight-property\n [${baseSelector}][${prefix}action][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(action, entity, context, property)} !important;\n }\n\n /* Quintuple combination with all attributes */\n .highlight-globals.highlight-entity.highlight-action.highlight-context.highlight-property\n [${globalsSelector}][${baseSelector}][${prefix}action][${contextSelector}][${propertySelector}] {\n box-shadow: ${outline(globals, entity, action, context, property)} !important;\n }\n `;\n\n return cssTemplate;\n};\n\n// Function to inject highlighting CSS into story document\nexport const injectHighlightingCSS = (\n storyDoc: Document,\n prefix: string = 'data-elb',\n): void => {\n // Remove existing styles\n const existingStyle = storyDoc.querySelector('#walkeros-highlighting');\n if (existingStyle) {\n existingStyle.remove();\n }\n\n const highlightingStyleElement = storyDoc.createElement('style');\n highlightingStyleElement.id = 'walkeros-highlighting';\n const css = generateHighlightCSS(prefix);\n highlightingStyleElement.textContent = css;\n\n storyDoc.head.appendChild(highlightingStyleElement);\n};\n","// Utilities for managing DOM highlighting\n\nimport type { WalkerOSAddon } from '../types';\nimport {\n getStoryDocument,\n getStoryRootElement,\n enhanceProperties,\n} from './domUtils';\nimport { injectHighlightingCSS } from './cssUtils';\n\n// Function to apply highlighting to story root\nexport const applyHighlighting = (\n highlights: WalkerOSAddon['highlights'],\n prefix: string = 'data-elb',\n): void => {\n const storyRoot = getStoryRootElement();\n if (!storyRoot) return;\n\n // Remove existing highlighting classes\n storyRoot.classList.remove('highlight-context');\n storyRoot.classList.remove('highlight-entity');\n storyRoot.classList.remove('highlight-property');\n storyRoot.classList.remove('highlight-action');\n storyRoot.classList.remove('highlight-globals');\n\n if (!highlights) return;\n\n // Re-enhance properties FIRST to ensure they're marked\n enhanceProperties(storyRoot, prefix);\n\n // Then add specific highlighting classes\n if (highlights.context) storyRoot.classList.add('highlight-context');\n if (highlights.entity) storyRoot.classList.add('highlight-entity');\n if (highlights.property) storyRoot.classList.add('highlight-property');\n if (highlights.action) storyRoot.classList.add('highlight-action');\n if (highlights.globals) storyRoot.classList.add('highlight-globals');\n};\n\n// Combined function to inject CSS and apply highlighting\nexport const setupHighlighting = (\n highlights: WalkerOSAddon['highlights'],\n prefix: string = 'data-elb',\n): void => {\n const storyDoc = getStoryDocument();\n\n // Always inject CSS first\n injectHighlightingCSS(storyDoc, prefix);\n\n // Then apply highlighting\n applyHighlighting(highlights, prefix);\n};\n","import type { WalkerOSAddon } from './types';\nimport type { DecoratorFunction } from 'storybook/internal/types';\nimport { addons } from 'storybook/preview-api';\nimport { getAllEvents, getGlobals } from '@walkeros/web-source-browser';\n\nimport { ADDON_ID, EVENTS } from './constants';\nimport { initializeWalker } from './walker';\nimport { getStoryRootElement, enhanceProperties } from './utils/domUtils';\nimport { buildAttributeTree } from './utils/attributeTreeUtils';\nimport { setupHighlighting } from './utils/highlightingUtils';\n\n// Set up the channel listener globally, not per story\nconst channel = addons.getChannel();\nlet currentStoryId: string | null = null;\n\n// Global listener for the request events\nchannel.addListener(EVENTS.REQUEST, (config: WalkerOSAddon) => {\n const storyRoot = getStoryRootElement();\n if (!storyRoot) {\n channel.emit(EVENTS.RESULT, []);\n return;\n }\n\n // Enhance DOM with property attributes\n enhanceProperties(storyRoot, config.prefix || 'data-elb');\n\n const events = getAllEvents(storyRoot as Element, config.prefix);\n\n // Collect globals from data-elbglobals attributes\n const globals = getGlobals(config.prefix || 'data-elb', storyRoot as Element);\n\n // Add globals to each event if any globals exist\n const eventsWithGlobals = events.map((event) => {\n if (Object.keys(globals).length > 0) {\n return { ...event, globals };\n }\n return event;\n });\n\n // Send the result back to the manager\n channel.emit(EVENTS.RESULT, eventsWithGlobals);\n});\n\n// Global listener for highlighting events\nchannel.addListener(EVENTS.HIGHLIGHT, (config: WalkerOSAddon) => {\n setupHighlighting(config.highlights, config.prefix);\n});\n\n// Global listener for attribute tree requests\nchannel.addListener(EVENTS.ATTRIBUTES_REQUEST, (config: WalkerOSAddon) => {\n const storyRoot = getStoryRootElement();\n if (!storyRoot) {\n channel.emit(EVENTS.ATTRIBUTES_RESULT, { nodes: [], globals: [] });\n return;\n }\n\n // Build the skeleton tree ({ nodes, globals })\n const result = buildAttributeTree(\n storyRoot as Element,\n config.prefix || 'data-elb',\n );\n\n // Send the result back to the manager\n channel.emit(EVENTS.ATTRIBUTES_RESULT, result);\n});\n\nexport const withRoundTrip: DecoratorFunction = (storyFn, context) => {\n // Check if story changed and auto-run is enabled\n const storyId = context.id;\n const hasStoryChanged = currentStoryId !== storyId;\n const { parameters } = context;\n const autoRefresh = parameters?.[ADDON_ID]?.autoRefresh;\n\n if (hasStoryChanged) {\n currentStoryId = storyId;\n }\n\n const result = storyFn();\n\n // Initialize walker and inject CSS after story renders\n setTimeout(() => {\n // Initialize walkerOS for live event capture\n const prefix = parameters?.[ADDON_ID]?.prefix || 'data-elb';\n initializeWalker({ prefix, autoRefresh }).catch((err) => {\n console.error('Walker initialization failed:', err);\n });\n\n // Inject highlighting CSS and enhance properties\n const storyRoot = getStoryRootElement();\n if (storyRoot) {\n setupHighlighting(undefined, prefix);\n enhanceProperties(storyRoot, prefix);\n }\n\n // Auto-run walker if story changed and auto-refresh is enabled\n if (hasStoryChanged && autoRefresh && window.__storybookElb) {\n window.__storybookElb('walker run');\n }\n }, 200);\n\n return result;\n};\n","/**\n * A decorator is a way to wrap a story in extra “rendering” functionality. Many addons define decorators\n * in order to augment stories:\n * - with extra rendering\n * - gather details about how a story is rendered\n *\n * When writing stories, decorators are typically used to wrap stories with extra markup or context mocking.\n *\n * https://storybook.js.org/docs/react/writing-stories/decorators\n */\nimport type { ProjectAnnotations, Renderer } from 'storybook/internal/types';\n\nimport { ADDON_ID } from './constants';\nimport { withRoundTrip } from './withRoundTrip';\n\n/**\n * Note: if you want to use JSX in this file, rename it to `preview.tsx`\n * and update the entry prop in tsup.config.ts to use \"src/preview.tsx\",\n */\n\nconst preview: ProjectAnnotations<Renderer> = {\n decorators: [withRoundTrip],\n parameters: {\n [ADDON_ID]: {\n autoRefresh: true,\n prefix: 'data-elb',\n },\n },\n};\n\nexport default preview;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/storybook-addon",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.1-next-1792019907609",
|
|
4
4
|
"description": "Visualize, debug, and validate walkerOS event tracking in your Storybook stories. Real-time event capture with visual DOM highlighting for data-attribute based tagging.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook-addons",
|
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@storybook/icons": "^2.0.1",
|
|
65
|
-
"@walkeros/collector": "4.8.
|
|
66
|
-
"@walkeros/core": "4.8.
|
|
67
|
-
"@walkeros/web-core": "4.8.
|
|
68
|
-
"@walkeros/web-source-browser": "4.8.
|
|
65
|
+
"@walkeros/collector": "4.8.1-next-1792019907609",
|
|
66
|
+
"@walkeros/core": "4.8.1-next-1792019907609",
|
|
67
|
+
"@walkeros/web-core": "4.8.1-next-1792019907609",
|
|
68
|
+
"@walkeros/web-source-browser": "4.8.1-next-1792019907609"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@storybook/addon-docs": "^10.1.9",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"@types/react": "^19.2.7",
|
|
75
75
|
"@types/react-dom": "^19.2.3",
|
|
76
76
|
"@vitejs/plugin-react": "^6.0.2",
|
|
77
|
-
"@walkeros/config": "4.8.
|
|
78
|
-
"@walkeros/explorer": "4.8.
|
|
77
|
+
"@walkeros/config": "4.8.1-next-1792019907609",
|
|
78
|
+
"@walkeros/explorer": "4.8.1-next-1792019907609",
|
|
79
79
|
"auto": "^11.3.6",
|
|
80
80
|
"boxen": "^8.0.1",
|
|
81
81
|
"npm-run-all2": "^8.0.4",
|