@zolomedia/bifrost-client 1.7.74

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.
Files changed (140) hide show
  1. package/L1_Foundation/L1_Foundation.js +13 -0
  2. package/L1_Foundation/bootstrap/bootstrap.js +11 -0
  3. package/L1_Foundation/bootstrap/bootstrap_hooks.js +123 -0
  4. package/L1_Foundation/bootstrap/bootstrap_index.js +15 -0
  5. package/L1_Foundation/bootstrap/bootstrap_logger.js +135 -0
  6. package/L1_Foundation/bootstrap/cdn_loader.js +217 -0
  7. package/L1_Foundation/bootstrap/module_registry.js +102 -0
  8. package/L1_Foundation/bootstrap/prism_loader.js +164 -0
  9. package/L1_Foundation/config/client_config.js +110 -0
  10. package/L1_Foundation/config/config.js +7 -0
  11. package/L1_Foundation/connection/connection.js +8 -0
  12. package/L1_Foundation/connection/websocket_connection.js +122 -0
  13. package/L1_Foundation/constants/bifrost_constants.js +284 -0
  14. package/L1_Foundation/constants/constants.js +7 -0
  15. package/L1_Foundation/logger/logger.js +10 -0
  16. package/L2_Handling/L2_Handling.js +15 -0
  17. package/L2_Handling/cache/cache.js +22 -0
  18. package/L2_Handling/cache/cache_constants.js +69 -0
  19. package/L2_Handling/cache/orchestration/cache_manager.js +299 -0
  20. package/L2_Handling/cache/orchestration/cache_orchestrator.js +260 -0
  21. package/L2_Handling/cache/orchestration/orchestration.js +12 -0
  22. package/L2_Handling/cache/storage/session_manager.js +289 -0
  23. package/L2_Handling/cache/storage/storage.js +10 -0
  24. package/L2_Handling/cache/storage/storage_manager.js +590 -0
  25. package/L2_Handling/display/composite/composite.js +13 -0
  26. package/L2_Handling/display/composite/dashboard_renderer.js +221 -0
  27. package/L2_Handling/display/composite/swiper_renderer.js +564 -0
  28. package/L2_Handling/display/composite/terminal_renderer.js +922 -0
  29. package/L2_Handling/display/composite/wizard_conditional_renderer.js +274 -0
  30. package/L2_Handling/display/display.js +30 -0
  31. package/L2_Handling/display/feedback/feedback.js +11 -0
  32. package/L2_Handling/display/feedback/progressbar_renderer.js +418 -0
  33. package/L2_Handling/display/feedback/spinner_renderer.js +246 -0
  34. package/L2_Handling/display/inputs/button_renderer.js +634 -0
  35. package/L2_Handling/display/inputs/form_renderer.js +583 -0
  36. package/L2_Handling/display/inputs/input_renderer.js +658 -0
  37. package/L2_Handling/display/inputs/inputs.js +12 -0
  38. package/L2_Handling/display/navigation/menu_renderer.js +206 -0
  39. package/L2_Handling/display/navigation/navigation.js +11 -0
  40. package/L2_Handling/display/navigation/navigation_renderer.js +703 -0
  41. package/L2_Handling/display/orchestration/orchestration.js +11 -0
  42. package/L2_Handling/display/orchestration/renderer.js +430 -0
  43. package/L2_Handling/display/orchestration/zdisplay_orchestrator.js +1759 -0
  44. package/L2_Handling/display/outputs/alert_renderer.js +161 -0
  45. package/L2_Handling/display/outputs/audio_renderer.js +94 -0
  46. package/L2_Handling/display/outputs/card_renderer.js +229 -0
  47. package/L2_Handling/display/outputs/code_renderer.js +66 -0
  48. package/L2_Handling/display/outputs/dl_renderer.js +131 -0
  49. package/L2_Handling/display/outputs/header_renderer.js +162 -0
  50. package/L2_Handling/display/outputs/icon_renderer.js +107 -0
  51. package/L2_Handling/display/outputs/image_renderer.js +145 -0
  52. package/L2_Handling/display/outputs/list_renderer.js +190 -0
  53. package/L2_Handling/display/outputs/outputs.js +19 -0
  54. package/L2_Handling/display/outputs/table_renderer.js +765 -0
  55. package/L2_Handling/display/outputs/text_renderer.js +818 -0
  56. package/L2_Handling/display/outputs/typography_renderer.js +293 -0
  57. package/L2_Handling/display/outputs/video_renderer.js +116 -0
  58. package/L2_Handling/display/primitives/document_structure_primitives.js +319 -0
  59. package/L2_Handling/display/primitives/form_primitives.js +526 -0
  60. package/L2_Handling/display/primitives/generic_containers.js +109 -0
  61. package/L2_Handling/display/primitives/interactive_primitives.js +305 -0
  62. package/L2_Handling/display/primitives/link_primitives.js +552 -0
  63. package/L2_Handling/display/primitives/lists_primitives.js +262 -0
  64. package/L2_Handling/display/primitives/media_primitives.js +383 -0
  65. package/L2_Handling/display/primitives/primitives.js +19 -0
  66. package/L2_Handling/display/primitives/semantic_element_primitive.js +226 -0
  67. package/L2_Handling/display/primitives/table_primitives.js +528 -0
  68. package/L2_Handling/display/primitives/typography_primitives.js +175 -0
  69. package/L2_Handling/display/specialized/input_request_renderer.js +467 -0
  70. package/L2_Handling/display/specialized/specialized.js +10 -0
  71. package/L2_Handling/hooks/hooks.js +9 -0
  72. package/L2_Handling/hooks/menu_integration.js +57 -0
  73. package/L2_Handling/hooks/widget_hook_manager.js +292 -0
  74. package/L2_Handling/message/message.js +8 -0
  75. package/L2_Handling/message/message_handler.js +701 -0
  76. package/L2_Handling/navigation/navigation.js +8 -0
  77. package/L2_Handling/navigation/navigation_manager.js +403 -0
  78. package/L2_Handling/zhooks/features/cache_live.js +287 -0
  79. package/L2_Handling/zhooks/features/crumbs_live.js +292 -0
  80. package/L2_Handling/zhooks/zhooks_manager.js +65 -0
  81. package/L2_Handling/zvaf/zvaf.js +8 -0
  82. package/L2_Handling/zvaf/zvaf_manager.js +334 -0
  83. package/L3_Abstraction/L3_Abstraction.js +12 -0
  84. package/L3_Abstraction/orchestrator/container_unwrapper.js +101 -0
  85. package/L3_Abstraction/orchestrator/group_renderer.js +698 -0
  86. package/L3_Abstraction/orchestrator/input_event_handler.js +797 -0
  87. package/L3_Abstraction/orchestrator/metadata_processor.js +249 -0
  88. package/L3_Abstraction/orchestrator/navbar_builder.js +201 -0
  89. package/L3_Abstraction/orchestrator/orchestrator.js +13 -0
  90. package/L3_Abstraction/orchestrator/wizard_gate_handler.js +360 -0
  91. package/L3_Abstraction/renderer/renderer.js +1 -0
  92. package/L3_Abstraction/session/session.js +1 -0
  93. package/L4_Orchestration/L4_Orchestration.js +11 -0
  94. package/L4_Orchestration/client/client.js +1 -0
  95. package/L4_Orchestration/facade/facade.js +9 -0
  96. package/L4_Orchestration/facade/manager_registry.js +118 -0
  97. package/L4_Orchestration/facade/renderer_registry.js +274 -0
  98. package/L4_Orchestration/lifecycle/asset_loader.js +255 -0
  99. package/L4_Orchestration/lifecycle/initializer.js +135 -0
  100. package/L4_Orchestration/lifecycle/lifecycle.js +8 -0
  101. package/L4_Orchestration/rendering/facade.js +94 -0
  102. package/L4_Orchestration/rendering/rendering.js +7 -0
  103. package/LICENSE +21 -0
  104. package/README.md +82 -0
  105. package/bifrost_client.js +204 -0
  106. package/bifrost_core.js +1686 -0
  107. package/docs/ARCHITECTURE.md +111 -0
  108. package/docs/PROTOCOL.md +106 -0
  109. package/docs/RENDERERS.md +101 -0
  110. package/docs/SECURITY.md +92 -0
  111. package/package.json +24 -0
  112. package/syntax/prism-zconfig.js +41 -0
  113. package/syntax/prism-zenv.js +69 -0
  114. package/syntax/prism-zolo-theme.css +288 -0
  115. package/syntax/prism-zolo.js +380 -0
  116. package/syntax/prism-zschema.js +38 -0
  117. package/syntax/prism-zspark.js +25 -0
  118. package/syntax/prism-zui.js +68 -0
  119. package/zSys/accessibility/accessibility.js +10 -0
  120. package/zSys/accessibility/emoji_accessibility.js +173 -0
  121. package/zSys/dom/block_utils.js +122 -0
  122. package/zSys/dom/container_utils.js +370 -0
  123. package/zSys/dom/dom.js +13 -0
  124. package/zSys/dom/dom_utils.js +328 -0
  125. package/zSys/dom/encoding_utils.js +117 -0
  126. package/zSys/dom/style_utils.js +71 -0
  127. package/zSys/errors/error_display.js +299 -0
  128. package/zSys/errors/errors.js +10 -0
  129. package/zSys/theme/color_utils.js +274 -0
  130. package/zSys/theme/dark_mode_utils.js +272 -0
  131. package/zSys/theme/size_utils.js +256 -0
  132. package/zSys/theme/spacing_utils.js +405 -0
  133. package/zSys/theme/theme.js +14 -0
  134. package/zSys/theme/zbase.css +1735 -0
  135. package/zSys/theme/zbase_inject.js +161 -0
  136. package/zSys/theme/ztheme_utils.js +305 -0
  137. package/zSys/validation/error_boundary.js +201 -0
  138. package/zSys/validation/validation.js +11 -0
  139. package/zSys/validation/validation_utils.js +238 -0
  140. package/zSys/zSys.js +14 -0
@@ -0,0 +1,319 @@
1
+ /**
2
+ *
3
+ * Document Structure Primitives - Semantic HTML5 Landmarks
4
+ *
5
+ *
6
+ * Semantic HTML5 elements that define document structure and meaning.
7
+ * These provide accessibility landmarks and improve SEO.
8
+ *
9
+ * @module rendering/document_structure_primitives
10
+ * @layer 0.0 (RAWEST - semantic structure)
11
+ * @pattern Pure Factory Functions
12
+ *
13
+ * Philosophy:
14
+ * - Semantic structure over generic divs
15
+ * - Accessibility landmarks (ARIA roles implicit)
16
+ * - SEO and screen reader optimization
17
+ * - NO styling, NO classes (dress up later)
18
+ *
19
+ * Semantic Meaning:
20
+ * - <header>: Introductory content or navigation (implicit role="banner" at top-level)
21
+ * - <footer>: Footer content, copyright (implicit role="contentinfo" at top-level)
22
+ * - <main>: Primary content (implicit role="main", ONE per page)
23
+ * - <nav>: Navigation links (implicit role="navigation")
24
+ * - <section>: Thematic grouping with heading (implicit role="region" if labeled)
25
+ * - <article>: Self-contained content (implicit role="article")
26
+ * - <aside>: Tangentially related content (implicit role="complementary")
27
+ *
28
+ * zReboot Context:
29
+ * - <main> has flex: 1 (for sticky footer layouts)
30
+ *
31
+ * Dependencies:
32
+ * - utils/dom_utils.js (createElement, setAttributes)
33
+ *
34
+ * Exports:
35
+ * - createHeader(attributes) → HTMLElement
36
+ * - createFooter(attributes) → HTMLElement
37
+ * - createMain(attributes) → HTMLElement
38
+ * - createNav(attributes) → HTMLElement
39
+ * - createSection(attributes) → HTMLElement
40
+ * - createArticle(attributes) → HTMLElement
41
+ * - createAside(attributes) → HTMLElement
42
+ *
43
+ * Example:
44
+ * ```javascript
45
+ * import { createHeader, createMain, createFooter } from './document_structure_primitives.js';
46
+ *
47
+ * const header = createHeader({ id: 'site-header' });
48
+ * const main = createMain({ id: 'main-content' });
49
+ * const footer = createFooter({ id: 'site-footer' });
50
+ *
51
+ * document.body.appendChild(header);
52
+ * document.body.appendChild(main);
53
+ * document.body.appendChild(footer);
54
+ * ```
55
+ */
56
+
57
+ // ─────────────────────────────────────────────────────────────────
58
+ // Imports
59
+ // ─────────────────────────────────────────────────────────────────
60
+
61
+ // Layer 2: Utilities
62
+ import { createElement, setAttributes } from '../../../zSys/dom/dom_utils.js';
63
+
64
+ //
65
+ // Top-Level Structural Elements
66
+ //
67
+
68
+ /**
69
+ * Create a <header> element
70
+ *
71
+ * Represents introductory content or navigational aids.
72
+ * Typically contains logo, site title, navigation, search.
73
+ * When used at top level (direct child of <body>), has implicit role="banner".
74
+ *
75
+ * Common Uses:
76
+ * - Site-wide header (logo, nav, search)
77
+ * - Article/section headers (title, metadata)
78
+ * - Modal/dialog headers
79
+ *
80
+ * @param {Object} [attributes={}] - HTML attributes (id, class, data-*, etc.)
81
+ * @returns {HTMLElement} The created header element
82
+ *
83
+ * @example
84
+ * // Site-wide header
85
+ * const siteHeader = createHeader({ id: 'site-header', class: 'sticky-header' });
86
+ *
87
+ * // Article header
88
+ * const articleHeader = createHeader({ class: 'article-header' });
89
+ */
90
+ export function createHeader(attributes = {}) {
91
+ const header = createElement('header');
92
+
93
+ if (Object.keys(attributes).length > 0) {
94
+ setAttributes(header, attributes);
95
+ }
96
+
97
+ return header;
98
+ }
99
+
100
+ /**
101
+ * Create a <footer> element
102
+ *
103
+ * Represents footer content for its nearest sectioning content or root.
104
+ * Typically contains copyright, links, contact info.
105
+ * When used at top level (direct child of <body>), has implicit role="contentinfo".
106
+ *
107
+ * Common Uses:
108
+ * - Site-wide footer (copyright, links, social)
109
+ * - Article/section footers (author, tags, share)
110
+ * - Modal/dialog footers (action buttons)
111
+ *
112
+ * @param {Object} [attributes={}] - HTML attributes (id, class, data-*, etc.)
113
+ * @returns {HTMLElement} The created footer element
114
+ *
115
+ * @example
116
+ * // Site-wide footer
117
+ * const siteFooter = createFooter({ id: 'site-footer', class: 'sticky-footer' });
118
+ *
119
+ * // Article footer
120
+ * const articleFooter = createFooter({ class: 'article-footer' });
121
+ */
122
+ export function createFooter(attributes = {}) {
123
+ const footer = createElement('footer');
124
+
125
+ if (Object.keys(attributes).length > 0) {
126
+ setAttributes(footer, attributes);
127
+ }
128
+
129
+ return footer;
130
+ }
131
+
132
+ /**
133
+ * Create a <main> element
134
+ *
135
+ * Represents the dominant/primary content of the <body>.
136
+ * Should be UNIQUE in the document (only ONE <main> per page).
137
+ * Has implicit role="main" for accessibility.
138
+ *
139
+ * zReboot: Sets flex: 1 (allows main to grow in flexbox layouts for sticky footer).
140
+ *
141
+ * Best Practice:
142
+ * - Use once per page
143
+ * - Contains the primary content (skip nav, sidebars, ads)
144
+ * - Helps screen readers jump to main content
145
+ *
146
+ * @param {Object} [attributes={}] - HTML attributes (id, class, data-*, etc.)
147
+ * @returns {HTMLElement} The created main element
148
+ *
149
+ * @example
150
+ * // Primary content area
151
+ * const mainContent = createMain({ id: 'main-content', role: 'main' });
152
+ *
153
+ * // In a SPA, might toggle aria-busy during loading
154
+ * const main = createMain({ 'aria-busy': 'true' });
155
+ */
156
+ export function createMain(attributes = {}) {
157
+ const main = createElement('main');
158
+
159
+ if (Object.keys(attributes).length > 0) {
160
+ setAttributes(main, attributes);
161
+ }
162
+
163
+ return main;
164
+ }
165
+
166
+ /**
167
+ * Create a <nav> element
168
+ *
169
+ * Represents a section with navigation links.
170
+ * Has implicit role="navigation" for accessibility.
171
+ * Can have multiple <nav> elements per page (site nav, TOC, breadcrumbs).
172
+ *
173
+ * Best Practice:
174
+ * - Use for major navigation blocks
175
+ * - Consider aria-label to distinguish multiple navs
176
+ * - Not every link group needs <nav>, just primary navigation
177
+ *
178
+ * @param {Object} [attributes={}] - HTML attributes (id, class, aria-label, etc.)
179
+ * @returns {HTMLElement} The created nav element
180
+ *
181
+ * @example
182
+ * // Primary site navigation
183
+ * const mainNav = createNav({ id: 'main-nav', 'aria-label': 'Main navigation' });
184
+ *
185
+ * // Table of contents
186
+ * const tocNav = createNav({ id: 'toc', 'aria-label': 'Table of contents' });
187
+ *
188
+ * // Breadcrumb navigation
189
+ * const breadcrumb = createNav({ 'aria-label': 'Breadcrumb' });
190
+ */
191
+ export function createNav(attributes = {}) {
192
+ const nav = createElement('nav');
193
+
194
+ if (Object.keys(attributes).length > 0) {
195
+ setAttributes(nav, attributes);
196
+ }
197
+
198
+ return nav;
199
+ }
200
+
201
+ //
202
+ // Content Sectioning Elements
203
+ //
204
+
205
+ /**
206
+ * Create a <section> element
207
+ *
208
+ * Represents a thematic grouping of content, typically with a heading.
209
+ * Groups related content together (features, testimonials, chapters).
210
+ * Has implicit role="region" if it has an accessible name (aria-label/aria-labelledby).
211
+ *
212
+ * Best Practice:
213
+ * - Should have a heading (h1-h6) as a child
214
+ * - Use when content doesn't fit <article>, <nav>, or <aside>
215
+ * - Think: "Would this appear in a table of contents?"
216
+ *
217
+ * @param {Object} [attributes={}] - HTML attributes (id, class, aria-labelledby, etc.)
218
+ * @returns {HTMLElement} The created section element
219
+ *
220
+ * @example
221
+ * // Features section
222
+ * const features = createSection({ id: 'features', 'aria-labelledby': 'features-heading' });
223
+ *
224
+ * // Chapter in a document
225
+ * const chapter = createSection({ class: 'chapter', 'data-chapter': '1' });
226
+ */
227
+ export function createSection(attributes = {}) {
228
+ const section = createElement('section');
229
+
230
+ if (Object.keys(attributes).length > 0) {
231
+ setAttributes(section, attributes);
232
+ }
233
+
234
+ return section;
235
+ }
236
+
237
+ /**
238
+ * Create an <article> element
239
+ *
240
+ * Represents self-contained, independently distributable content.
241
+ * Think: blog post, news article, forum post, product card, comment.
242
+ * Has implicit role="article" for accessibility.
243
+ *
244
+ * Best Practice:
245
+ * - Should make sense on its own (syndication test)
246
+ * - Typically has a heading
247
+ * - Can be nested (e.g., blog post with comments)
248
+ *
249
+ * @param {Object} [attributes={}] - HTML attributes (id, class, data-*, etc.)
250
+ * @returns {HTMLElement} The created article element
251
+ *
252
+ * @example
253
+ * // Blog post
254
+ * const post = createArticle({ id: 'post-123', class: 'blog-post' });
255
+ *
256
+ * // Product card in e-commerce
257
+ * const product = createArticle({ 'data-product-id': '456', class: 'product-card' });
258
+ *
259
+ * // Comment
260
+ * const comment = createArticle({ id: 'comment-789', class: 'comment' });
261
+ */
262
+ export function createArticle(attributes = {}) {
263
+ const article = createElement('article');
264
+
265
+ if (Object.keys(attributes).length > 0) {
266
+ setAttributes(article, attributes);
267
+ }
268
+
269
+ return article;
270
+ }
271
+
272
+ /**
273
+ * Create an <aside> element
274
+ *
275
+ * Represents content tangentially related to the main content.
276
+ * Think: sidebars, callouts, pull quotes, related links.
277
+ * Has implicit role="complementary" when not nested in <article> or <section>.
278
+ *
279
+ * Best Practice:
280
+ * - Content is related but not essential
281
+ * - Could be moved to a sidebar without breaking flow
282
+ * - Not for unrelated content (use <div> or other semantics)
283
+ *
284
+ * @param {Object} [attributes={}] - HTML attributes (id, class, aria-label, etc.)
285
+ * @returns {HTMLElement} The created aside element
286
+ *
287
+ * @example
288
+ * // Sidebar with related content
289
+ * const sidebar = createAside({ id: 'sidebar', 'aria-label': 'Related articles' });
290
+ *
291
+ * // Pull quote in an article
292
+ * const pullQuote = createAside({ class: 'pull-quote' });
293
+ *
294
+ * // Call-to-action box
295
+ * const cta = createAside({ class: 'cta-box', 'data-cta': 'newsletter' });
296
+ */
297
+ export function createAside(attributes = {}) {
298
+ const aside = createElement('aside');
299
+
300
+ if (Object.keys(attributes).length > 0) {
301
+ setAttributes(aside, attributes);
302
+ }
303
+
304
+ return aside;
305
+ }
306
+
307
+ //
308
+ // Default Export (for convenience)
309
+ //
310
+ export default {
311
+ createHeader,
312
+ createFooter,
313
+ createMain,
314
+ createNav,
315
+ createSection,
316
+ createArticle,
317
+ createAside
318
+ };
319
+