@saasira/holi 0.1.4 → 0.1.6
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 +18 -0
- package/README.md +145 -10
- package/dist/components.html +910 -0
- package/dist/holi.css +489 -0
- package/dist/holi.html +122 -2
- package/dist/holi.js +1 -1
- package/dist/layouts/3x9.html +29 -0
- package/dist/layouts.html +34 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.1.5] - 2026-03-19
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added runtime page-layout composition with configurable layout resolution, named `block` and `region` slot mapping, and optional inherited slot fallbacks.
|
|
10
|
+
- Added layout-owned asset placement through `layout-head` for real head nodes and `tail` for deferred body-end assets.
|
|
11
|
+
- Added in-memory template and layout registries backed by bundled `dist/components.html` and `dist/layouts.html`.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Stopped injecting bundled component templates into the live page body; templates now stay in an internal registry.
|
|
16
|
+
- Renamed the primary bundled component-template artifact from `holi.html` to `components.html` while keeping `holi.html` as a compatibility bundle.
|
|
17
|
+
- Extended the example/build pipeline and smoke checks to cover runtime layout composition and layout asset containers.
|
|
18
|
+
|
|
19
|
+
### Validation
|
|
20
|
+
|
|
21
|
+
- Verified with `npm run build`, `npm run smoke:examples`, and `npm pack --dry-run`.
|
|
22
|
+
|
|
5
23
|
## [0.1.4] - 2026-03-19
|
|
6
24
|
|
|
7
25
|
### Changed
|
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ Canonical reference: `docs/holi-principles.md`.
|
|
|
26
26
|
- Tag: `<tabs></tabs>`
|
|
27
27
|
- Attribute: `<section component="tabs"></section>`
|
|
28
28
|
- Role: `<section role="tabs"></section>`
|
|
29
|
-
-
|
|
29
|
+
- Component-template bundling (`dist/components.html`) and runtime in-memory template registration.
|
|
30
30
|
- Template bindings:
|
|
31
31
|
- `@{expression}` interpolation
|
|
32
32
|
- `data-if`, `data-show`, `data-open`, `visible`
|
|
@@ -73,27 +73,48 @@ Main artifacts:
|
|
|
73
73
|
|
|
74
74
|
- `dist/holi.js`
|
|
75
75
|
- `dist/holi.css`
|
|
76
|
-
- `dist/
|
|
76
|
+
- `dist/components.html` (component templates)
|
|
77
|
+
- `dist/layouts.html` (layout templates)
|
|
78
|
+
- `dist/holi.html` (legacy compatibility bundle)
|
|
79
|
+
- `dist/layouts/**` (optional runtime-resolved layouts)
|
|
77
80
|
- Example site output: `public/examples/**`
|
|
78
81
|
|
|
82
|
+
## CDN Quick Start
|
|
83
|
+
|
|
84
|
+
For application pages that consume Holi directly from a CDN, use the published npm package via jsDelivr:
|
|
85
|
+
|
|
86
|
+
```html
|
|
87
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@saasira/holi@0.1.5/dist/holi.css" />
|
|
88
|
+
<script src="https://cdn.jsdelivr.net/npm/@saasira/holi@0.1.5/dist/holi.js"></script>
|
|
89
|
+
<link rel="preload" as="fetch" href="https://cdn.jsdelivr.net/npm/@saasira/holi@0.1.5/dist/components.html" crossorigin="anonymous" />
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Direct file URLs:
|
|
93
|
+
|
|
94
|
+
- `https://cdn.jsdelivr.net/npm/@saasira/holi@0.1.5/dist/holi.js`
|
|
95
|
+
- `https://cdn.jsdelivr.net/npm/@saasira/holi@0.1.5/dist/holi.css`
|
|
96
|
+
- `https://cdn.jsdelivr.net/npm/@saasira/holi@0.1.5/dist/components.html`
|
|
97
|
+
|
|
98
|
+
Pin an exact version in production so releases remain repeatable.
|
|
99
|
+
|
|
79
100
|
## CDN Usage
|
|
80
101
|
|
|
81
102
|
Holi can be shipped directly from a free CDN after publishing the package to npm.
|
|
82
103
|
|
|
83
|
-
Recommended jsDelivr links for `v0.1.
|
|
104
|
+
Recommended jsDelivr links for `v0.1.5`:
|
|
84
105
|
|
|
85
106
|
```html
|
|
86
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@saasira/holi@0.1.
|
|
87
|
-
<script src="https://cdn.jsdelivr.net/npm/@saasira/holi@0.1.
|
|
88
|
-
<link rel="preload" as="fetch" href="https://cdn.jsdelivr.net/npm/@saasira/holi@0.1.
|
|
107
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@saasira/holi@0.1.5/dist/holi.css" />
|
|
108
|
+
<script src="https://cdn.jsdelivr.net/npm/@saasira/holi@0.1.5/dist/holi.js"></script>
|
|
109
|
+
<link rel="preload" as="fetch" href="https://cdn.jsdelivr.net/npm/@saasira/holi@0.1.5/dist/components.html" crossorigin="anonymous" />
|
|
89
110
|
```
|
|
90
111
|
|
|
91
112
|
Fallback unpkg links:
|
|
92
113
|
|
|
93
114
|
```html
|
|
94
|
-
<link rel="stylesheet" href="https://unpkg.com/@saasira/holi@0.1.
|
|
95
|
-
<script src="https://unpkg.com/@saasira/holi@0.1.
|
|
96
|
-
<link rel="preload" as="fetch" href="https://unpkg.com/@saasira/holi@0.1.
|
|
115
|
+
<link rel="stylesheet" href="https://unpkg.com/@saasira/holi@0.1.5/dist/holi.css" />
|
|
116
|
+
<script src="https://unpkg.com/@saasira/holi@0.1.5/dist/holi.js"></script>
|
|
117
|
+
<link rel="preload" as="fetch" href="https://unpkg.com/@saasira/holi@0.1.5/dist/components.html" crossorigin="anonymous" />
|
|
97
118
|
```
|
|
98
119
|
|
|
99
120
|
Repository setup details for automated npm publishing are documented in `docs/CDN.md`.
|
|
@@ -134,12 +155,92 @@ Repository setup details for automated npm publishing are documented in `docs/CD
|
|
|
134
155
|
- Component styles: `src/styles/components/<componentname>.css`
|
|
135
156
|
- Component templates: `src/templates/components/<componentname>.html`
|
|
136
157
|
- Shared utilities: `src/scripts/utils/<utilityname>.js`
|
|
158
|
+
- Optional layout templates:
|
|
159
|
+
- library layouts: `src/templates/layouts/*.html`
|
|
160
|
+
- example/app layouts in examples: `src/examples/layouts/*.html`
|
|
137
161
|
- Example sources:
|
|
138
162
|
- `src/examples/pages/*.html`
|
|
139
163
|
- `src/examples/styles/*.css`
|
|
140
164
|
- `src/examples/scripts/*.js`
|
|
141
165
|
- Built examples: `public/examples/**` (referencing `dist/holi.js` and `dist/holi.css`)
|
|
142
166
|
|
|
167
|
+
## Page Layout Composition
|
|
168
|
+
|
|
169
|
+
Holi supports runtime page composition with a layout template plus named placeholders.
|
|
170
|
+
|
|
171
|
+
Supported structure:
|
|
172
|
+
|
|
173
|
+
```html
|
|
174
|
+
<page layout="3x9" layouts-base="/examples/layouts/">
|
|
175
|
+
<block name="head">
|
|
176
|
+
<region name="meta">
|
|
177
|
+
<meta name="page-layout-demo" content="true" />
|
|
178
|
+
</region>
|
|
179
|
+
<region name="styles">
|
|
180
|
+
<style>.page-title { letter-spacing: 0.02em; }</style>
|
|
181
|
+
</region>
|
|
182
|
+
<region name="scripts">
|
|
183
|
+
<script>window.pageLayoutExampleLoaded = true;</script>
|
|
184
|
+
</region>
|
|
185
|
+
</block>
|
|
186
|
+
|
|
187
|
+
<block name="header">
|
|
188
|
+
<h1 class="page-title">Project Dashboard</h1>
|
|
189
|
+
</block>
|
|
190
|
+
|
|
191
|
+
<block name="main">
|
|
192
|
+
<region name="lhs"><div>Navigation</div></region>
|
|
193
|
+
<region name="middle"><div>Primary content</div></region>
|
|
194
|
+
<region name="rhs"><div>Context tools</div></region>
|
|
195
|
+
</block>
|
|
196
|
+
</page>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Layout template example:
|
|
200
|
+
|
|
201
|
+
```html
|
|
202
|
+
<template id="page-layout-3x9" data-layout="3x9">
|
|
203
|
+
<layout-head data-layout-head="true">
|
|
204
|
+
<meta name="example-layout" content="3x9" />
|
|
205
|
+
<slot name="meta"></slot>
|
|
206
|
+
<slot name="styles"></slot>
|
|
207
|
+
<slot name="scripts"></slot>
|
|
208
|
+
</layout-head>
|
|
209
|
+
|
|
210
|
+
<header><slot name="header"></slot></header>
|
|
211
|
+
<slot name="main">
|
|
212
|
+
<main>
|
|
213
|
+
<aside><slot name="lhs"></slot></aside>
|
|
214
|
+
<section><slot name="middle"></slot></section>
|
|
215
|
+
<aside><slot name="rhs"></slot></aside>
|
|
216
|
+
</main>
|
|
217
|
+
</slot>
|
|
218
|
+
</template>
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Rules:
|
|
222
|
+
|
|
223
|
+
- Top-level `block[name]` fills a matching layout slot.
|
|
224
|
+
- Direct `region[name]` inside a block fills matching nested slots inside that block's assigned subtree.
|
|
225
|
+
- Missing slots are empty by default.
|
|
226
|
+
- Set `inherit-missing="true"` on `page` to keep fallback slot content.
|
|
227
|
+
- Use `renderer="browser"` on source pages to show the built-in placeholder until runtime composition completes.
|
|
228
|
+
- After browser or compiler rendering completes, both `renderer` and `rendered` should be removed from the final page node.
|
|
229
|
+
- Use `layout-src` for an explicit layout file or `layouts-base` for a layout folder.
|
|
230
|
+
- Page-level attributes `title`, `description`, `canonical`, and `lang` are applied to the real document metadata.
|
|
231
|
+
- Page-level `theme` is applied to the real `<body>` element for theme scoping and switching.
|
|
232
|
+
- Use `<layout-head data-layout-head="true">` for shared head assets in layouts.
|
|
233
|
+
- Use `<tail data-layout-tail="true">` for deferred body-end assets in layouts.
|
|
234
|
+
- Non-script nodes from `layout-head` go to the real HTML `<head>`.
|
|
235
|
+
- Nodes from `tail` are appended near the end of `<body>`.
|
|
236
|
+
- Built-in region `meta` always targets the real HTML `<head>`.
|
|
237
|
+
- Built-in regions `styles` and `page-styles` always target the real HTML `<head>`, even when the layout does not declare those slots.
|
|
238
|
+
- Built-in regions `scripts` and `page-scripts` always target the end of `<body>`, even when the layout does not declare those slots.
|
|
239
|
+
- Use `styles` for external asset nodes such as `<link rel="stylesheet" href="...">`.
|
|
240
|
+
- Use `scripts` for external asset nodes such as `<script src="..."></script>`.
|
|
241
|
+
- Use `page-styles` for inline `<style>` tags.
|
|
242
|
+
- Use `page-scripts` for inline `<script>` tags.
|
|
243
|
+
|
|
143
244
|
## Holi vs React / Angular / Vue
|
|
144
245
|
|
|
145
246
|
| Area | Holi | React | Angular | Vue |
|
|
@@ -170,4 +271,38 @@ Practical summary:
|
|
|
170
271
|
|
|
171
272
|
- Holi exports `window.HoliApp` / `window.Holi`.
|
|
172
273
|
- Auto init can be disabled with `window.HoliAutoInit = false` before loading `dist/holi.js`.
|
|
173
|
-
-
|
|
274
|
+
- Component templates are loaded from `dist/components.html` (with runtime fallback paths).
|
|
275
|
+
- Layout templates are loaded from `dist/layouts.html` (with runtime fallback paths).
|
|
276
|
+
|
|
277
|
+
## OfflineIndicator
|
|
278
|
+
|
|
279
|
+
`OfflineIndicator` provides a template-driven connectivity banner with automatic polling and queue count display.
|
|
280
|
+
|
|
281
|
+
Supported declaration styles:
|
|
282
|
+
|
|
283
|
+
- `<offline></offline>`
|
|
284
|
+
- `<section component="offline"></section>`
|
|
285
|
+
- `<section role="offline"></section>`
|
|
286
|
+
- `[data-offline]`
|
|
287
|
+
|
|
288
|
+
Useful attributes:
|
|
289
|
+
|
|
290
|
+
- `scope="page|block|inline"`
|
|
291
|
+
- `position="top-left|top-right|bottom-left|bottom-right|top-center|bottom-center"`
|
|
292
|
+
- `host="#selector"` for `scope="block"`
|
|
293
|
+
- `ping-url="/api/ping"`
|
|
294
|
+
- `heartbeat-ms="2500"`
|
|
295
|
+
- `probe-timeout-ms="1800"`
|
|
296
|
+
- `duration="1200"`
|
|
297
|
+
- `max-attempts="4"`
|
|
298
|
+
|
|
299
|
+
Instance/static helpers:
|
|
300
|
+
|
|
301
|
+
- `el.offlineIndicator.retryConnection()`
|
|
302
|
+
- `el.offlineIndicator.simulateOffline()`
|
|
303
|
+
- `el.offlineIndicator.simulateOnline()`
|
|
304
|
+
- `window.OfflineIndicator.queue(payload)`
|
|
305
|
+
- `window.OfflineIndicator.clearQueue()`
|
|
306
|
+
- `window.OfflineIndicator.create(options)`
|
|
307
|
+
|
|
308
|
+
See [offline example](/D:/Work/Self/Holi/src/examples/pages/offline.html) for page-scoped, block-scoped, and queue-sync scenarios.
|