@webitel/styleguide 26.8.3 → 26.8.4
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/package.json +5 -2
- package/src/lib/styleguide/styleguide.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/Dark.tokens.json +4219 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/Light.tokens.json +4231 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/app-header/colors/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/app-header/colors/root/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/app-header/colors/root/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/app-header/colors/root/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/app-header/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/app-header/sizes/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/app-header/sizes/root/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/avatar/colors/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/avatar/colors/unknown-user/dark/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/avatar/colors/unknown-user/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/avatar/colors/unknown-user/light/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/avatar/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/avatar/sizes/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/avatar/sizes/unknown-user/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/colors/action-bar/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/colors/action-bar/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/colors/action-bar/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/colors/floating-call-widget/active/dark/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/colors/floating-call-widget/active/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/colors/floating-call-widget/active/light/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/colors/floating-call-widget/hold/dark/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/colors/floating-call-widget/hold/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/colors/floating-call-widget/hold/light/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/colors/floating-call-widget/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/colors/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/colors/root/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/colors/root/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/colors/root/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/sizes/action-bar/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/sizes/floating-call-widget/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/sizes/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-dock/sizes/root/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/colors/call-details-drawer/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/colors/call-details-drawer/members-item/dark/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/colors/call-details-drawer/members-item/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/colors/call-details-drawer/members-item/light/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/colors/call-details-drawer/root/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/colors/call-details-drawer/root/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/colors/call-details-drawer/root/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/colors/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/colors/root/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/colors/root/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/colors/root/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/colors/top-bar/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/colors/top-bar/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/colors/top-bar/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/sizes/call-details-drawer/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/sizes/call-details-drawer/members-item/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/sizes/call-details-drawer/root/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/sizes/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/sizes/root/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/call-page/sizes/top-bar/index.css +7 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-card/colors/active/dark/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-card/colors/active/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-card/colors/active/light/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-card/colors/closed/dark/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-card/colors/closed/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-card/colors/closed/light/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-card/colors/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-card/colors/snoozed/dark/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-card/colors/snoozed/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-card/colors/snoozed/light/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-card/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-card/sizes/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-card/sizes/root/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-dock/colors/floating-chat-widget/dark/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-dock/colors/floating-chat-widget/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-dock/colors/floating-chat-widget/light/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-dock/colors/header/dark/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-dock/colors/header/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-dock/colors/header/light/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-dock/colors/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-dock/colors/root/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-dock/colors/root/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-dock/colors/root/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-dock/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-dock/sizes/floating-chat-widget/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-dock/sizes/header/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-dock/sizes/index.css +8 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/chat-details-drawer/chat-search-item/dark/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/chat-details-drawer/chat-search-item/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/chat-details-drawer/chat-search-item/light/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/chat-details-drawer/history-item/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/chat-details-drawer/history-item/history-card/dark/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/chat-details-drawer/history-item/history-card/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/chat-details-drawer/history-item/history-card/light/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/chat-details-drawer/history-item/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/chat-details-drawer/history-item/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/chat-details-drawer/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/chat-details-drawer/members-item/dark/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/chat-details-drawer/members-item/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/chat-details-drawer/members-item/light/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/chat-details-drawer/root/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/chat-details-drawer/root/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/chat-details-drawer/root/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/top-bar/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/top-bar/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/colors/top-bar/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/sizes/chat-details-drawer/chat-search-item/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/sizes/chat-details-drawer/history-item/history-card/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/sizes/chat-details-drawer/history-item/index.css +7 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/sizes/chat-details-drawer/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/sizes/chat-details-drawer/members-item/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/sizes/chat-details-drawer/root/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/sizes/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-page/sizes/top-bar/index.css +7 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/chat-end-reason-indicator/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/chat-end-reason-indicator/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/chat-end-reason-indicator/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/control-panel/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/control-panel/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/control-panel/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/last-message-text/agent/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/last-message-text/agent/read/dark/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/last-message-text/agent/read/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/last-message-text/agent/read/light/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/last-message-text/agent/unread/dark/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/last-message-text/agent/unread/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/last-message-text/agent/unread/light/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/last-message-text/client/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/last-message-text/client/read/dark/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/last-message-text/client/read/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/last-message-text/client/read/light/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/last-message-text/client/unread/dark/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/last-message-text/client/unread/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/last-message-text/client/unread/light/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/last-message-text/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/root/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/root/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/colors/root/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/sizes/chat-end-reason-indicator/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/sizes/control-panel/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/sizes/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/sizes/last-message-text/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-queue-pannel/sizes/root/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/colors/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/colors/message-item/chat-message/agent/dark/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/colors/message-item/chat-message/agent/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/colors/message-item/chat-message/agent/light/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/colors/message-item/chat-message/client/dark/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/colors/message-item/chat-message/client/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/colors/message-item/chat-message/client/light/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/colors/message-item/chat-message/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/colors/message-item/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/colors/message-item/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/colors/message-item/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/colors/root/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/colors/root/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/colors/root/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/sizes/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/sizes/message-item/chat-message/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/sizes/message-item/index.css +7 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/chat-window/sizes/root/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/client-identity-block/colors/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/client-identity-block/colors/root/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/client-identity-block/colors/root/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/client-identity-block/colors/root/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/client-identity-block/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/client-identity-block/sizes/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/client-identity-block/sizes/root/index.css +7 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/conversation-tray/colors/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/conversation-tray/colors/root/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/conversation-tray/colors/root/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/conversation-tray/colors/root/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/conversation-tray/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/conversation-tray/sizes/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/conversation-tray/sizes/root/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/connection-feedback-block/call-status-indicator/error/dark/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/connection-feedback-block/call-status-indicator/error/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/connection-feedback-block/call-status-indicator/error/light/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/connection-feedback-block/call-status-indicator/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/connection-feedback-block/call-status-indicator/secondary/dark/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/connection-feedback-block/call-status-indicator/secondary/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/connection-feedback-block/call-status-indicator/secondary/light/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/connection-feedback-block/call-status-indicator/success/dark/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/connection-feedback-block/call-status-indicator/success/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/connection-feedback-block/call-status-indicator/success/light/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/connection-feedback-block/call-status-indicator/warning/dark/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/connection-feedback-block/call-status-indicator/warning/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/connection-feedback-block/call-status-indicator/warning/light/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/connection-feedback-block/dark/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/connection-feedback-block/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/connection-feedback-block/light/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/numpad/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/numpad/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/numpad/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/root/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/root/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/colors/root/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/sizes/connection-feedback-block/call-status-indicator/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/sizes/connection-feedback-block/index.css +7 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/sizes/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/sizes/numpad/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/dialer/sizes/root/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/incoming-interaction-preview/colors/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/incoming-interaction-preview/colors/root/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/incoming-interaction-preview/colors/root/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/incoming-interaction-preview/colors/root/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/incoming-interaction-preview/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/incoming-interaction-preview/sizes/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/incoming-interaction-preview/sizes/root/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/index.css +23 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/layout/colors/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/layout/colors/root/dark/index.css +7 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/layout/colors/root/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/layout/colors/root/light/index.css +7 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/layout/index.css +7 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/layout/sizes/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/layout/sizes/root/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/message-composer/colors/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/message-composer/colors/root/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/message-composer/colors/root/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/message-composer/colors/root/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/message-composer/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/message-composer/sizes/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/message-composer/sizes/root/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/page-toolbar/colors/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/page-toolbar/colors/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/page-toolbar/colors/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/page-toolbar/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/page-toolbar/sizes/index.css +7 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/semantic/colors/inbound/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/semantic/colors/inbound/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/semantic/colors/inbound/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/semantic/colors/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/semantic/colors/missed/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/semantic/colors/missed/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/semantic/colors/missed/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/semantic/colors/outbound/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/semantic/colors/outbound/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/semantic/colors/outbound/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/semantic/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/sidebar-menu/colors/button/filled/dark/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/sidebar-menu/colors/button/filled/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/sidebar-menu/colors/button/filled/light/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/sidebar-menu/colors/button/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/sidebar-menu/colors/button/outlined/dark/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/sidebar-menu/colors/button/outlined/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/sidebar-menu/colors/button/outlined/light/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/sidebar-menu/colors/button/text/dark/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/sidebar-menu/colors/button/text/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/sidebar-menu/colors/button/text/light/index.css +5 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/sidebar-menu/colors/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/sidebar-menu/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/sidebar-menu/sizes/index.css +1 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/sidebar-menu/sizes/root/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/widgets/colors/card/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/widgets/colors/card/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/widgets/colors/card/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/widgets/colors/icon-box/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/widgets/colors/icon-box/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/widgets/colors/icon-box/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/widgets/colors/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/widgets/colors/row/dark/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/widgets/colors/row/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/widgets/colors/row/light/index.css +4 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/widgets/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/widgets/sizes/card/index.css +7 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/widgets/sizes/icon-box/icon/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/widgets/sizes/icon-box/index.css +7 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/widgets/sizes/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/widgets/sizes/row/index.css +6 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/wrap-up-timer/colors/dark/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/wrap-up-timer/colors/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/wrap-up-timer/colors/light/index.css +3 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/wrap-up-timer/index.css +2 -0
- package/src/lib/styleguide/token-generation/apps/agent-workspace-app/dist/ws/wrap-up-timer/sizes/index.css +7 -0
- package/src/lib/styleguide/token-generation/apps/index.css +1 -0
- package/src/lib/styleguide/token-generation/index.css +1 -0
- package/src/lib/styleguide/token-generation/script/check-css-imports.ts +79 -0
- package/src/lib/styleguide/token-generation/script/console-colors.ts +12 -0
- package/src/lib/styleguide/token-generation/script/discover-sources.ts +68 -0
- package/src/lib/styleguide/token-generation/script/generate.ts +200 -0
- package/src/lib/styleguide/token-generation/script/index.ts +82 -0
- package/src/lib/styleguide/token-generation/script/output/write-css.ts +74 -0
- package/src/lib/styleguide/token-generation/script/output/write-glue-css.ts +70 -0
- package/src/lib/styleguide/token-generation/script/transform/collect-variables.ts +65 -0
- package/src/lib/styleguide/token-generation/script/transform/format-value.ts +86 -0
- package/src/lib/styleguide/token-generation/script/transform/slugify.ts +16 -0
- package/src/lib/styleguide/token-generation/script/transform/token-refs.ts +21 -0
- package/src/lib/styleguide/token-generation/script/types.ts +75 -0
- package/src/lib/styleguide/token-generation/script/validation/css-var-names.ts +40 -0
- package/src/lib/styleguide/token-generation/script/validation/errors.ts +47 -0
- package/src/lib/styleguide/token-generation/script/validation/parity.ts +73 -0
- package/src/lib/styleguide/token-generation/script/validation/references.ts +95 -0
- package/src/lib/styleguide/token-generation/script/validation/theme-file.ts +15 -0
- package/src/lib/styleguide/token-generation/script/validation/tree.ts +194 -0
- package/src/lib/styleguide/token-generation/script/validation/typo-detection.ts +64 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { slugify } from '../transform/slugify';
|
|
2
|
+
import type { Variable } from '../types';
|
|
3
|
+
import { ValidationErrorCollector } from './errors';
|
|
4
|
+
|
|
5
|
+
/** Validate that no two distinct token paths slugify to the same CSS variable name,
|
|
6
|
+
* and that no path segment slugifies to an empty string. */
|
|
7
|
+
export function validateCssVarNames(
|
|
8
|
+
variables: Variable[],
|
|
9
|
+
fileLabel: string,
|
|
10
|
+
): ValidationErrorCollector {
|
|
11
|
+
const collector = new ValidationErrorCollector(fileLabel);
|
|
12
|
+
const byVarName = new Map<string, string[]>();
|
|
13
|
+
|
|
14
|
+
for (const variable of variables) {
|
|
15
|
+
variable.pathSegments.forEach((segment, i) => {
|
|
16
|
+
if (slugify(segment) === '') {
|
|
17
|
+
collector.add(
|
|
18
|
+
`Сегмент шляху "${segment}" за шляхом "${variable.pathSegments.slice(0, i + 1).join('.')}" перетворюється на порожній рядок`,
|
|
19
|
+
[
|
|
20
|
+
`Повний шлях: ${variable.pathSegments.join('.')}`,
|
|
21
|
+
],
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
if (!byVarName.has(variable.cssVarName)) {
|
|
26
|
+
byVarName.set(variable.cssVarName, []);
|
|
27
|
+
}
|
|
28
|
+
byVarName.get(variable.cssVarName)?.push(variable.pathSegments.join('.'));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
for (const [varName, paths] of byVarName) {
|
|
32
|
+
if (paths.length > 1) {
|
|
33
|
+
collector.add(`Колізія назви CSS-змінної: "${varName}"`, [
|
|
34
|
+
`Створюється ${paths.length} різними шляхами токенів: ${paths.join(', ')}`,
|
|
35
|
+
]);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return collector;
|
|
40
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { bold, red } from '../console-colors';
|
|
2
|
+
|
|
3
|
+
interface ValidationError {
|
|
4
|
+
message: string;
|
|
5
|
+
details?: string[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** A collection of validation errors, each with full contextual detail. */
|
|
9
|
+
export class ValidationErrorCollector {
|
|
10
|
+
readonly fileLabel: string;
|
|
11
|
+
readonly errors: ValidationError[] = [];
|
|
12
|
+
|
|
13
|
+
constructor(fileLabel: string) {
|
|
14
|
+
this.fileLabel = fileLabel;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
add(message: string, details?: string[]): void {
|
|
18
|
+
this.errors.push({
|
|
19
|
+
message,
|
|
20
|
+
details,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
get hasErrors(): boolean {
|
|
25
|
+
return this.errors.length > 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Print all collected errors to the console with full detail, grouped and numbered. */
|
|
29
|
+
report(): void {
|
|
30
|
+
console.error(
|
|
31
|
+
red(
|
|
32
|
+
bold(
|
|
33
|
+
`\nПеревірку не пройдено для ${this.fileLabel}: знайдено помилок - ${this.errors.length}:\n`,
|
|
34
|
+
),
|
|
35
|
+
),
|
|
36
|
+
);
|
|
37
|
+
this.errors.forEach((err, i) => {
|
|
38
|
+
console.error(red(`${i + 1}) ${err.message}`));
|
|
39
|
+
if (err.details) {
|
|
40
|
+
for (const line of err.details) {
|
|
41
|
+
console.error(red(` ${line}`));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
console.error('');
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { TokenNode, TokenTree } from '../types';
|
|
2
|
+
import { ValidationErrorCollector } from './errors';
|
|
3
|
+
|
|
4
|
+
function collectLeafTypes(
|
|
5
|
+
node: TokenNode,
|
|
6
|
+
pathSegments: string[],
|
|
7
|
+
out: Map<string, string>,
|
|
8
|
+
): void {
|
|
9
|
+
if (node && typeof node === 'object' && '$type' in node) {
|
|
10
|
+
out.set(
|
|
11
|
+
pathSegments.join('.'),
|
|
12
|
+
(
|
|
13
|
+
node as {
|
|
14
|
+
$type: string;
|
|
15
|
+
}
|
|
16
|
+
).$type,
|
|
17
|
+
);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (node && typeof node === 'object') {
|
|
21
|
+
for (const [key, child] of Object.entries(
|
|
22
|
+
node as Record<string, TokenNode>,
|
|
23
|
+
)) {
|
|
24
|
+
if (key.startsWith('$')) continue;
|
|
25
|
+
collectLeafTypes(child, pathSegments.concat(key), out);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Validate structural parity between themes: same leaf token paths, same $type per path. */
|
|
31
|
+
export function validateThemeParity(
|
|
32
|
+
rootsByTheme: Record<string, TokenTree>,
|
|
33
|
+
): ValidationErrorCollector {
|
|
34
|
+
const collector = new ValidationErrorCollector('узгодженість між темами');
|
|
35
|
+
const themeNames = Object.keys(rootsByTheme);
|
|
36
|
+
|
|
37
|
+
const leavesByTheme: Record<string, Map<string, string>> = {};
|
|
38
|
+
for (const themeName of themeNames) {
|
|
39
|
+
const leaves = new Map<string, string>();
|
|
40
|
+
collectLeafTypes(rootsByTheme[themeName], [], leaves);
|
|
41
|
+
leavesByTheme[themeName] = leaves;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const allPaths = new Set<string>();
|
|
45
|
+
for (const leaves of Object.values(leavesByTheme)) {
|
|
46
|
+
for (const p of leaves.keys()) allPaths.add(p);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
for (const p of allPaths) {
|
|
50
|
+
const presentIn = themeNames.filter((t) => leavesByTheme[t].has(p));
|
|
51
|
+
const missingFrom = themeNames.filter((t) => !leavesByTheme[t].has(p));
|
|
52
|
+
if (missingFrom.length > 0) {
|
|
53
|
+
collector.add(
|
|
54
|
+
`Токен "${p}" відсутній у темі(-ах): ${missingFrom.join(', ')}`,
|
|
55
|
+
[
|
|
56
|
+
`Присутній у: ${presentIn.join(', ')}`,
|
|
57
|
+
],
|
|
58
|
+
);
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
const types = new Set(themeNames.map((t) => leavesByTheme[t].get(p)));
|
|
62
|
+
if (types.size > 1) {
|
|
63
|
+
const detail = themeNames
|
|
64
|
+
.map((t) => `${t}=${leavesByTheme[t].get(p)}`)
|
|
65
|
+
.join(', ');
|
|
66
|
+
collector.add(`Токен "${p}" має різний $type у різних темах`, [
|
|
67
|
+
detail,
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return collector;
|
|
73
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { getNodeByPath, parseRef } from '../transform/token-refs';
|
|
2
|
+
import type { TokenNode, TokenTree } from '../types';
|
|
3
|
+
import type { ValidationErrorCollector } from './errors';
|
|
4
|
+
|
|
5
|
+
/** Validate every alias reference in the tree resolves to a real leaf token, and that
|
|
6
|
+
* following the chain terminates (no circular references). */
|
|
7
|
+
export function validateReferences(
|
|
8
|
+
root: TokenTree,
|
|
9
|
+
node: TokenNode,
|
|
10
|
+
pathSegments: string[],
|
|
11
|
+
collector: ValidationErrorCollector,
|
|
12
|
+
): void {
|
|
13
|
+
if (node == null || typeof node !== 'object') return;
|
|
14
|
+
|
|
15
|
+
if ('$value' in node) {
|
|
16
|
+
const value = (
|
|
17
|
+
node as {
|
|
18
|
+
$value: unknown;
|
|
19
|
+
}
|
|
20
|
+
).$value;
|
|
21
|
+
if (typeof value === 'string') {
|
|
22
|
+
const refPath = parseRef(value);
|
|
23
|
+
if (refPath) {
|
|
24
|
+
checkReferenceChain(
|
|
25
|
+
root,
|
|
26
|
+
refPath,
|
|
27
|
+
[
|
|
28
|
+
pathSegments.join('.'),
|
|
29
|
+
],
|
|
30
|
+
pathSegments,
|
|
31
|
+
collector,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
for (const [key, child] of Object.entries(
|
|
39
|
+
node as Record<string, TokenNode>,
|
|
40
|
+
)) {
|
|
41
|
+
if (key.startsWith('$')) continue;
|
|
42
|
+
validateReferences(root, child, pathSegments.concat(key), collector);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function checkReferenceChain(
|
|
47
|
+
root: TokenTree,
|
|
48
|
+
refPath: string[],
|
|
49
|
+
chainLabels: string[],
|
|
50
|
+
originPathSegments: string[],
|
|
51
|
+
collector: ValidationErrorCollector,
|
|
52
|
+
): void {
|
|
53
|
+
const refLabel = refPath.join('.');
|
|
54
|
+
if (chainLabels.includes(refLabel)) {
|
|
55
|
+
collector.add(
|
|
56
|
+
`Циклічне посилання за шляхом "${originPathSegments.join('.')}"`,
|
|
57
|
+
[
|
|
58
|
+
`Ланцюжок посилань: ${chainLabels.concat(refLabel).join(' -> ')}`,
|
|
59
|
+
],
|
|
60
|
+
);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const target = getNodeByPath(root, refPath);
|
|
65
|
+
if (!target || typeof target !== 'object' || !('$value' in target)) {
|
|
66
|
+
collector.add(
|
|
67
|
+
`Неможливо розв'язати посилання за шляхом "${originPathSegments.join('.')}"`,
|
|
68
|
+
[
|
|
69
|
+
`Посилання "{${refLabel}}" не вказує на дійсний токен.`,
|
|
70
|
+
chainLabels.length > 1
|
|
71
|
+
? `Ланцюжок посилань до цього моменту: ${chainLabels.join(' -> ')}`
|
|
72
|
+
: undefined,
|
|
73
|
+
].filter((line): line is string => Boolean(line)),
|
|
74
|
+
);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const targetValue = (
|
|
79
|
+
target as {
|
|
80
|
+
$value: unknown;
|
|
81
|
+
}
|
|
82
|
+
).$value;
|
|
83
|
+
if (typeof targetValue === 'string') {
|
|
84
|
+
const nextRefPath = parseRef(targetValue);
|
|
85
|
+
if (nextRefPath) {
|
|
86
|
+
checkReferenceChain(
|
|
87
|
+
root,
|
|
88
|
+
nextRefPath,
|
|
89
|
+
chainLabels.concat(refLabel),
|
|
90
|
+
originPathSegments,
|
|
91
|
+
collector,
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TokenTree } from '../types';
|
|
2
|
+
import { ValidationErrorCollector } from './errors';
|
|
3
|
+
import { validateReferences } from './references';
|
|
4
|
+
import { validateTree } from './tree';
|
|
5
|
+
|
|
6
|
+
/** Validate one theme file's full token tree (structure + leaves + references). */
|
|
7
|
+
export function validateThemeFile(
|
|
8
|
+
root: TokenTree,
|
|
9
|
+
fileLabel: string,
|
|
10
|
+
): ValidationErrorCollector {
|
|
11
|
+
const collector = new ValidationErrorCollector(fileLabel);
|
|
12
|
+
validateTree(root, [], collector);
|
|
13
|
+
validateReferences(root, root, [], collector);
|
|
14
|
+
return collector;
|
|
15
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { parseRef } from '../transform/token-refs';
|
|
2
|
+
import type { TokenNode } from '../types';
|
|
3
|
+
import type { ValidationErrorCollector } from './errors';
|
|
4
|
+
import { findTypoLikeNames } from './typo-detection';
|
|
5
|
+
|
|
6
|
+
const SUPPORTED_TYPES = [
|
|
7
|
+
'color',
|
|
8
|
+
'number',
|
|
9
|
+
'string',
|
|
10
|
+
];
|
|
11
|
+
const HEX_COLOR_RE = /^#[0-9a-fA-F]{6}$/;
|
|
12
|
+
|
|
13
|
+
/** Validate the raw token tree structure of a single theme file: every node is either
|
|
14
|
+
* a group (plain object of children) or a well-formed leaf ({$type, $value, ...}), and
|
|
15
|
+
* flags sibling group names that look like typos of structural keywords ("Colors"/"Sizes"). */
|
|
16
|
+
export function validateTree(
|
|
17
|
+
node: TokenNode,
|
|
18
|
+
pathSegments: string[],
|
|
19
|
+
collector: ValidationErrorCollector,
|
|
20
|
+
): void {
|
|
21
|
+
if (node == null || typeof node !== 'object' || Array.isArray(node)) {
|
|
22
|
+
collector.add(`Некоректний вузол за шляхом "${pathSegments.join('.')}"`, [
|
|
23
|
+
`Очікувався об'єкт (група або токен), отримано: ${JSON.stringify(node)}`,
|
|
24
|
+
]);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const record = node as Record<string, TokenNode>;
|
|
29
|
+
const childKeys = Object.keys(record).filter((k) => !k.startsWith('$'));
|
|
30
|
+
const isLeaf = '$type' in record || '$value' in record;
|
|
31
|
+
|
|
32
|
+
if (isLeaf) {
|
|
33
|
+
validateLeaf(record, pathSegments, collector);
|
|
34
|
+
if (childKeys.length > 0) {
|
|
35
|
+
collector.add(
|
|
36
|
+
`Токен має неочікувані вкладені групи за шляхом "${pathSegments.join('.')}"`,
|
|
37
|
+
[
|
|
38
|
+
`Вузол із $type/$value має бути кінцевим токеном, але містить вкладені ключі: ${childKeys.join(', ')}`,
|
|
39
|
+
],
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (childKeys.length === 0) {
|
|
46
|
+
collector.add(
|
|
47
|
+
`Порожня група за шляхом "${pathSegments.join('.') || '<корінь>'}"`,
|
|
48
|
+
[
|
|
49
|
+
'Група не містить жодних токенів або вкладених груп.',
|
|
50
|
+
],
|
|
51
|
+
);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Only compare *group* child names against structural keywords - a leaf token
|
|
56
|
+
// legitimately named "color" or "size" is not a typo of "Colors"/"Sizes".
|
|
57
|
+
const groupChildKeys = childKeys.filter((key) => {
|
|
58
|
+
const child = record[key];
|
|
59
|
+
return (
|
|
60
|
+
child &&
|
|
61
|
+
typeof child === 'object' &&
|
|
62
|
+
!('$type' in child) &&
|
|
63
|
+
!('$value' in child)
|
|
64
|
+
);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const typoFindings = findTypoLikeNames(groupChildKeys);
|
|
68
|
+
for (const finding of typoFindings) {
|
|
69
|
+
collector.add(
|
|
70
|
+
`Підозріла назва групи "${finding.name}" за шляхом "${pathSegments.concat(finding.name).join('.')}"`,
|
|
71
|
+
[
|
|
72
|
+
`Схоже на помилку в написанні "${finding.keyword}" (відстань редагування: ${finding.distance}).`,
|
|
73
|
+
`Сусідні групи тут: ${groupChildKeys.join(', ')}`,
|
|
74
|
+
finding.keyword === 'Colors'
|
|
75
|
+
? 'Папка з назвою "Colors" (без урахування регістру) вважається залежною від теми; помилка в назві призведе до того, що вона мовчки оброблятиметься як незалежна від теми.'
|
|
76
|
+
: undefined,
|
|
77
|
+
].filter((line): line is string => Boolean(line)),
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
for (const key of childKeys) {
|
|
82
|
+
validateTree(record[key], pathSegments.concat(key), collector);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Validate a single leaf token's $type/$value shape. */
|
|
87
|
+
function validateLeaf(
|
|
88
|
+
node: Record<string, TokenNode>,
|
|
89
|
+
pathSegments: string[],
|
|
90
|
+
collector: ValidationErrorCollector,
|
|
91
|
+
): void {
|
|
92
|
+
const label = pathSegments.join('.');
|
|
93
|
+
|
|
94
|
+
if (!('$value' in node)) {
|
|
95
|
+
collector.add(`Відсутнє поле $value за шляхом "${label}"`, [
|
|
96
|
+
`Вузол: ${JSON.stringify(node)}`,
|
|
97
|
+
]);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (!('$type' in node) || typeof node.$type !== 'string') {
|
|
101
|
+
collector.add(`Відсутнє або некоректне поле $type за шляхом "${label}"`, [
|
|
102
|
+
`Вузол: ${JSON.stringify(node)}`,
|
|
103
|
+
]);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const type = node.$type as string;
|
|
108
|
+
const value = node.$value as unknown;
|
|
109
|
+
|
|
110
|
+
// Alias references are validated separately (after the whole tree is known), since
|
|
111
|
+
// resolving them requires looking up other parts of the tree.
|
|
112
|
+
if (typeof value === 'string' && parseRef(value)) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (!SUPPORTED_TYPES.includes(type)) {
|
|
117
|
+
collector.add(`Непідтримуваний $type "${type}" за шляхом "${label}"`, [
|
|
118
|
+
`Підтримувані типи: ${SUPPORTED_TYPES.join(', ')}`,
|
|
119
|
+
`Значення: ${JSON.stringify(value)}`,
|
|
120
|
+
]);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (type === 'color') {
|
|
125
|
+
validateColorValue(value, label, collector);
|
|
126
|
+
} else if (type === 'number') {
|
|
127
|
+
validateNumberValue(value, label, collector);
|
|
128
|
+
} else if (type === 'string') {
|
|
129
|
+
if (typeof value !== 'string') {
|
|
130
|
+
collector.add(`Некоректне значення типу string за шляхом "${label}"`, [
|
|
131
|
+
`Очікувався рядок, отримано: ${JSON.stringify(value)}`,
|
|
132
|
+
]);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function validateColorValue(
|
|
138
|
+
value: unknown,
|
|
139
|
+
label: string,
|
|
140
|
+
collector: ValidationErrorCollector,
|
|
141
|
+
): void {
|
|
142
|
+
if (typeof value === 'string') {
|
|
143
|
+
// A raw (non-alias) string color, e.g. "#RRGGBB" - allowed by colorToHex().
|
|
144
|
+
if (!HEX_COLOR_RE.test(value)) {
|
|
145
|
+
collector.add(`Некоректний рядок кольору за шляхом "${label}"`, [
|
|
146
|
+
`Очікувався hex-рядок формату "#RRGGBB", отримано: ${JSON.stringify(value)}`,
|
|
147
|
+
]);
|
|
148
|
+
}
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (!value || typeof value !== 'object') {
|
|
152
|
+
collector.add(`Некоректне значення кольору за шляхом "${label}"`, [
|
|
153
|
+
`Очікувався об'єкт із полем "hex", отримано: ${JSON.stringify(value)}`,
|
|
154
|
+
]);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const colorValue = value as {
|
|
158
|
+
hex?: unknown;
|
|
159
|
+
alpha?: unknown;
|
|
160
|
+
};
|
|
161
|
+
if (
|
|
162
|
+
typeof colorValue.hex !== 'string' ||
|
|
163
|
+
!HEX_COLOR_RE.test(colorValue.hex)
|
|
164
|
+
) {
|
|
165
|
+
collector.add(`Відсутнє або некоректне поле "hex" за шляхом "${label}"`, [
|
|
166
|
+
`Очікувалося, що "hex" буде рядком формату "#RRGGBB", отримано: ${JSON.stringify(colorValue.hex)}`,
|
|
167
|
+
]);
|
|
168
|
+
}
|
|
169
|
+
if ('alpha' in colorValue) {
|
|
170
|
+
const alpha = colorValue.alpha;
|
|
171
|
+
if (
|
|
172
|
+
typeof alpha !== 'number' ||
|
|
173
|
+
Number.isNaN(alpha) ||
|
|
174
|
+
alpha < 0 ||
|
|
175
|
+
alpha > 1
|
|
176
|
+
) {
|
|
177
|
+
collector.add(`Некоректне поле "alpha" за шляхом "${label}"`, [
|
|
178
|
+
`Очікувалося число в діапазоні від 0 до 1, отримано: ${JSON.stringify(alpha)}`,
|
|
179
|
+
]);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function validateNumberValue(
|
|
185
|
+
value: unknown,
|
|
186
|
+
label: string,
|
|
187
|
+
collector: ValidationErrorCollector,
|
|
188
|
+
): void {
|
|
189
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
190
|
+
collector.add(`Некоректне значення типу number за шляхом "${label}"`, [
|
|
191
|
+
`Очікувалося скінченне число, отримано: ${JSON.stringify(value)}`,
|
|
192
|
+
]);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** Words that carry structural meaning (drive theme-awareness, grouping, etc.);
|
|
2
|
+
* a sibling group name that's a near-miss of one of these is almost always a typo. */
|
|
3
|
+
export const STRUCTURAL_KEYWORDS = [
|
|
4
|
+
'Colors',
|
|
5
|
+
'Sizes',
|
|
6
|
+
];
|
|
7
|
+
|
|
8
|
+
export interface TypoFinding {
|
|
9
|
+
name: string;
|
|
10
|
+
keyword: string;
|
|
11
|
+
distance: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Levenshtein edit distance between two strings (case-insensitive). */
|
|
15
|
+
export function editDistance(a: string, b: string): number {
|
|
16
|
+
a = a.toLowerCase();
|
|
17
|
+
b = b.toLowerCase();
|
|
18
|
+
const dp: number[][] = Array.from(
|
|
19
|
+
{
|
|
20
|
+
length: a.length + 1,
|
|
21
|
+
},
|
|
22
|
+
(_, i) =>
|
|
23
|
+
[
|
|
24
|
+
i,
|
|
25
|
+
].concat(Array(b.length).fill(0)),
|
|
26
|
+
);
|
|
27
|
+
for (let j = 0; j <= b.length; j++) dp[0][j] = j;
|
|
28
|
+
for (let i = 1; i <= a.length; i++) {
|
|
29
|
+
for (let j = 1; j <= b.length; j++) {
|
|
30
|
+
dp[i][j] =
|
|
31
|
+
a[i - 1] === b[j - 1]
|
|
32
|
+
? dp[i - 1][j - 1]
|
|
33
|
+
: 1 + Math.min(dp[i - 1][j - 1], dp[i - 1][j], dp[i][j - 1]);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return dp[a.length][b.length];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Detect group names among `names` that look like typos of a structural keyword
|
|
40
|
+
* (close edit distance, but not an exact/case-insensitive match). Only meant to be
|
|
41
|
+
* called with the names of *group* children (never leaf token names) - "color" or
|
|
42
|
+
* "size" as an actual property name is common and not a typo of "Colors"/"Sizes". */
|
|
43
|
+
export function findTypoLikeNames(names: string[]): TypoFinding[] {
|
|
44
|
+
const findings: TypoFinding[] = [];
|
|
45
|
+
for (const name of names) {
|
|
46
|
+
for (const keyword of STRUCTURAL_KEYWORDS) {
|
|
47
|
+
if (name.toLowerCase() === keyword.toLowerCase()) continue;
|
|
48
|
+
const distance = editDistance(name, keyword);
|
|
49
|
+
if (
|
|
50
|
+
distance > 0 &&
|
|
51
|
+
distance <= 2 &&
|
|
52
|
+
Math.abs(name.length - keyword.length) <= 2
|
|
53
|
+
) {
|
|
54
|
+
findings.push({
|
|
55
|
+
name,
|
|
56
|
+
keyword,
|
|
57
|
+
distance,
|
|
58
|
+
});
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return findings;
|
|
64
|
+
}
|