native-document 1.0.166 → 1.0.168
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/.vitepress/config.js +166 -0
- package/CHANGELOG.md +153 -0
- package/components.js +2 -1
- package/dist/native-document.components.min.js +495 -228
- package/dist/native-document.dev.js +7 -0
- package/dist/native-document.dev.js.map +1 -1
- package/dist/native-document.min.js +1 -1
- package/docs/advanced-components.md +213 -608
- package/docs/anchor.md +173 -312
- package/docs/cache.md +95 -803
- package/docs/cli.md +179 -0
- package/docs/components/accordion.md +172 -0
- package/docs/components/alert.md +99 -0
- package/docs/components/avatar.md +160 -0
- package/docs/components/badge.md +102 -0
- package/docs/components/breadcrumb.md +89 -0
- package/docs/components/button.md +183 -0
- package/docs/components/card.md +69 -0
- package/docs/components/context-menu.md +118 -0
- package/docs/components/data-table.md +345 -0
- package/docs/components/dropdown.md +214 -0
- package/docs/components/form/autocomplete-field.md +81 -0
- package/docs/components/form/checkbox-field.md +41 -0
- package/docs/components/form/checkbox-group-field.md +54 -0
- package/docs/components/form/color-field.md +64 -0
- package/docs/components/form/date-field.md +92 -0
- package/docs/components/form/field-collection.md +63 -0
- package/docs/components/form/file-field.md +203 -0
- package/docs/components/form/form-control.md +87 -0
- package/docs/components/form/image-field.md +90 -0
- package/docs/components/form/index.md +115 -0
- package/docs/components/form/number-field.md +65 -0
- package/docs/components/form/radio-field.md +51 -0
- package/docs/components/form/select-field.md +123 -0
- package/docs/components/form/slider.md +136 -0
- package/docs/components/form/string-field.md +134 -0
- package/docs/components/form/textarea-field.md +65 -0
- package/docs/components/form-fields.md +372 -0
- package/docs/components/getting-started.md +264 -0
- package/docs/components/index.md +337 -0
- package/docs/components/layout.md +279 -0
- package/docs/components/list.md +73 -0
- package/docs/components/menu.md +215 -0
- package/docs/components/modal.md +156 -0
- package/docs/components/pagination.md +95 -0
- package/docs/components/popover.md +131 -0
- package/docs/components/progress.md +111 -0
- package/docs/components/shortcut-manager.md +221 -0
- package/docs/components/simple-table.md +107 -0
- package/docs/components/skeleton.md +155 -0
- package/docs/components/spinner.md +100 -0
- package/docs/components/splitter.md +133 -0
- package/docs/components/stepper.md +163 -0
- package/docs/components/switch.md +113 -0
- package/docs/components/tabs.md +153 -0
- package/docs/components/toast.md +119 -0
- package/docs/components/tooltip.md +151 -0
- package/docs/components/traits.md +261 -0
- package/docs/conditional-rendering.md +170 -588
- package/docs/contributing.md +300 -25
- package/docs/core-concepts.md +205 -374
- package/docs/elements.md +251 -367
- package/docs/extending-native-document-element.md +192 -207
- package/docs/filters.md +153 -1122
- package/docs/getting-started.md +193 -267
- package/docs/i18n.md +241 -0
- package/docs/index.md +76 -0
- package/docs/lifecycle-events.md +143 -75
- package/docs/list-rendering.md +227 -852
- package/docs/memory-management.md +134 -47
- package/docs/native-document-element.md +337 -186
- package/docs/native-fetch.md +99 -630
- package/docs/observable-resource.md +364 -0
- package/docs/observables.md +592 -526
- package/docs/routing.md +244 -653
- package/docs/state-management.md +134 -241
- package/docs/svg-elements.md +231 -0
- package/docs/theming.md +409 -0
- package/docs/tutorials/.gitkeep +0 -0
- package/docs/validation.md +95 -97
- package/docs/vitepress-conventions.md +219 -0
- package/package.json +34 -13
- package/readme.md +269 -89
- package/src/components/card/Card.js +93 -39
- package/src/components/card/index.js +1 -1
- package/src/components/list/HasListItem.js +171 -0
- package/src/components/list/List.js +41 -107
- package/src/components/list/ListDivider.js +39 -0
- package/src/components/list/ListGroup.js +76 -59
- package/src/components/list/ListItem.js +117 -69
- package/src/components/list/index.js +3 -1
- package/src/components/list/types/ListItem.d.ts +45 -34
- package/src/components/spacer/Spacer.js +1 -1
- package/src/core/data/ObservableResource.js +5 -0
- package/src/core/data/observable-helpers/observable.prototypes.js +2 -0
- package/src/ui/components/card/CardRender.js +133 -0
- package/src/ui/components/card/card.css +169 -0
- package/src/ui/components/contextmenu/ContextmenuRender.js +1 -1
- package/src/ui/components/list/ListRender.js +18 -0
- package/src/ui/components/list/divider/ListDividerRender.js +10 -0
- package/src/ui/components/list/divider/list-divider.css +12 -0
- package/src/ui/components/list/group/ListGroupRender.js +61 -0
- package/src/ui/components/list/group/list-group.css +62 -0
- package/src/ui/components/list/item/ListItemRender.js +238 -0
- package/src/ui/components/list/item/list-item.css +191 -0
- package/src/ui/components/list/list.css +24 -0
- package/src/ui/components/spacer/SpacerRender.js +10 -0
- package/src/ui/index.js +8 -0
package/docs/contributing.md
CHANGED
|
@@ -1,51 +1,326 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Contributing
|
|
3
|
+
description: How to contribute to NativeDocument - bug reports, feature requests, code contributions, and documentation improvements
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# Contributing to NativeDocument
|
|
2
7
|
|
|
3
8
|
Thank you for your interest in contributing to NativeDocument! We welcome all types of contributions.
|
|
4
9
|
|
|
5
|
-
## Quick Start
|
|
10
|
+
## Quick Start
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
git clone https://github.com/afrocodeur/native-document.git
|
|
14
|
+
cd native-document
|
|
15
|
+
npm install
|
|
16
|
+
npm run dev
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Available Scripts
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm run dev # Start development mode
|
|
23
|
+
npm run build # Build for production
|
|
24
|
+
npm run lint # Run ESLint
|
|
25
|
+
```
|
|
6
26
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
4. **Start development**: `npm run dev`
|
|
27
|
+
> There is currently no automated test suite. Changes are verified manually using the provided examples.
|
|
28
|
+
|
|
29
|
+
---
|
|
11
30
|
|
|
12
31
|
## Types of Contributions
|
|
13
32
|
|
|
14
33
|
### Bug Reports
|
|
15
|
-
|
|
34
|
+
|
|
35
|
+
Found a bug? Please open an issue and include:
|
|
36
|
+
|
|
16
37
|
- Steps to reproduce
|
|
17
38
|
- Expected vs actual behavior
|
|
18
|
-
- Browser
|
|
19
|
-
-
|
|
39
|
+
- Browser and environment details
|
|
40
|
+
- A minimal code example
|
|
20
41
|
|
|
21
42
|
### Feature Requests
|
|
22
|
-
|
|
23
|
-
|
|
43
|
+
|
|
44
|
+
Have an idea? Please describe:
|
|
45
|
+
|
|
46
|
+
- The problem you are solving
|
|
24
47
|
- Your proposed solution
|
|
25
48
|
- Alternative approaches considered
|
|
26
49
|
|
|
27
50
|
### Code Contributions
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Fork the repo, then:
|
|
54
|
+
git checkout -b feature/my-feature
|
|
55
|
+
# Make your changes
|
|
56
|
+
# Test manually with examples
|
|
57
|
+
# Submit a pull request with a clear description
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Documentation
|
|
61
|
+
|
|
62
|
+
Help improve the docs:
|
|
63
|
+
|
|
64
|
+
- Fix typos and unclear explanations
|
|
65
|
+
- Add missing examples
|
|
66
|
+
- Create tutorial content
|
|
67
|
+
|
|
68
|
+
---
|
|
32
69
|
|
|
33
70
|
## Development Guidelines
|
|
34
71
|
|
|
35
72
|
### Code Style
|
|
73
|
+
|
|
36
74
|
- Use camelCase for variables and functions
|
|
37
|
-
- Add JSDoc comments for public APIs
|
|
75
|
+
- Add JSDoc comments for all public APIs
|
|
38
76
|
- Keep functions small and focused
|
|
39
77
|
- Use meaningful variable names
|
|
78
|
+
- Always use braces for `if` blocks
|
|
40
79
|
|
|
41
|
-
###
|
|
42
|
-
- Test your changes with provided examples
|
|
43
|
-
- Create new examples to demonstrate features
|
|
44
|
-
- Verify cross-browser compatibility
|
|
80
|
+
### Build Output
|
|
45
81
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
|
|
82
|
+
Running `npm run build` produces:
|
|
83
|
+
|
|
84
|
+
- `dist/native-document.min.js` - CDN bundle (all features)
|
|
85
|
+
- `dist/native-document.js` - Full unminified bundle
|
|
86
|
+
- Tree-shakeable ESM output for bundlers
|
|
87
|
+
|
|
88
|
+
### Commit Messages
|
|
89
|
+
|
|
90
|
+
Follow the conventional commits format:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
feat(observable): add resource() async data fetching
|
|
94
|
+
fix(singleton): route section updates by named key
|
|
95
|
+
docs(routing): document RouteParamPatterns built-in entries
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## CLI Contributions
|
|
101
|
+
|
|
102
|
+
The CLI is a separate repository:
|
|
103
|
+
|
|
104
|
+
- [github.com/afrocodeur/native-document-cli](https://github.com/afrocodeur/native-document-cli)
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## License
|
|
109
|
+
|
|
110
|
+
By contributing, you agree that your contributions will be licensed under the MIT License.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
# Documentation Conventions
|
|
115
|
+
|
|
116
|
+
This section is for contributors working on the documentation itself.
|
|
117
|
+
|
|
118
|
+
## Frontmatter
|
|
119
|
+
|
|
120
|
+
Every markdown file must start with a frontmatter block:
|
|
121
|
+
|
|
122
|
+
```yaml
|
|
123
|
+
---
|
|
124
|
+
title: Page Title
|
|
125
|
+
description: One sentence description for SEO and sidebar tooltip
|
|
126
|
+
---
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Special pages:
|
|
130
|
+
- Home page (`index.md`) uses the `layout: home` frontmatter with hero and features blocks
|
|
131
|
+
- API reference pages can add `outline: deep` to show all heading levels in the right sidebar
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Folder & File Structure
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
docs/
|
|
139
|
+
├── index.md # Home page (layout: home)
|
|
140
|
+
├── getting-started.md
|
|
141
|
+
├── core-concepts.md
|
|
142
|
+
├── observables.md
|
|
143
|
+
├── elements.md
|
|
144
|
+
├── conditional-rendering.md
|
|
145
|
+
├── list-rendering.md
|
|
146
|
+
├── routing.md
|
|
147
|
+
├── state-management.md
|
|
148
|
+
├── lifecycle-events.md
|
|
149
|
+
├── native-document-element.md
|
|
150
|
+
├── extending-native-document-element.md
|
|
151
|
+
├── advanced-components.md
|
|
152
|
+
├── validation.md
|
|
153
|
+
├── memory-management.md
|
|
154
|
+
├── anchor.md
|
|
155
|
+
├── svg-elements.md
|
|
156
|
+
├── i18n.md
|
|
157
|
+
├── components/
|
|
158
|
+
│ ├── index.md
|
|
159
|
+
│ ├── getting-started.md
|
|
160
|
+
│ ├── traits.md
|
|
161
|
+
│ ├── layout.md
|
|
162
|
+
│ ├── accordion.md
|
|
163
|
+
│ ├── alert.md
|
|
164
|
+
│ ├── avatar.md
|
|
165
|
+
│ ├── breadcrumb.md
|
|
166
|
+
│ ├── button.md
|
|
167
|
+
│ ├── context-menu.md
|
|
168
|
+
│ ├── data-table.md
|
|
169
|
+
│ ├── dropdown.md
|
|
170
|
+
│ ├── file.md
|
|
171
|
+
│ ├── form-fields.md
|
|
172
|
+
│ ├── form/checkbox-field.md
|
|
173
|
+
│ ├── select.md
|
|
174
|
+
│ ├── menu.md
|
|
175
|
+
│ ├── modal.md
|
|
176
|
+
│ ├── slider-stepper.md
|
|
177
|
+
│ ├── splitter.md
|
|
178
|
+
│ ├── switch.md
|
|
179
|
+
│ ├── tabs.md
|
|
180
|
+
│ ├── toast.md
|
|
181
|
+
│ └── tooltip.md
|
|
182
|
+
└── utils/
|
|
183
|
+
├── cache.md
|
|
184
|
+
├── native-fetch.md
|
|
185
|
+
└── filters.md
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Internal Links
|
|
191
|
+
|
|
192
|
+
VitePress resolves links relative to the current file.
|
|
193
|
+
Always use `.md` extension - VitePress strips it at build time.
|
|
194
|
+
|
|
195
|
+
```markdown
|
|
196
|
+
<!-- From docs/readme.md or docs/getting-started.md -->
|
|
197
|
+
[Observables](./observables.md)
|
|
198
|
+
[Cache](./cache.md)
|
|
199
|
+
[Components](./components/index.md)
|
|
200
|
+
|
|
201
|
+
<!-- From docs/components/accordion.md -->
|
|
202
|
+
[Getting Started](./getting-started.md) <!-- components/getting-started.md -->
|
|
203
|
+
[Observables](./observables.md) <!-- docs/observables.md -->
|
|
204
|
+
[Cache](../utils/cache.md) <!-- docs/utils/cache.md -->
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Never use absolute paths (`/docs/...`) or paths without `.md`.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## `.vitepress/config.js` - Sidebar & Nav
|
|
212
|
+
|
|
213
|
+
```javascript
|
|
214
|
+
// .vitepress/config.js
|
|
215
|
+
export default {
|
|
216
|
+
title: 'NativeDocument',
|
|
217
|
+
description: 'A reactive JavaScript framework that preserves native DOM simplicity',
|
|
218
|
+
themeConfig: {
|
|
219
|
+
nav: [
|
|
220
|
+
{ text: 'Guide', link: '/getting-started' },
|
|
221
|
+
{ text: 'Components', link: '/components/' },
|
|
222
|
+
{ text: 'Utilities', link: '/cache' },
|
|
223
|
+
],
|
|
224
|
+
sidebar: {
|
|
225
|
+
'/components/': [
|
|
226
|
+
{
|
|
227
|
+
text: 'Components',
|
|
228
|
+
items: [
|
|
229
|
+
{ text: 'Overview', link: '/components/' },
|
|
230
|
+
{ text: 'Getting Started', link: '/components/getting-started' },
|
|
231
|
+
{ text: 'Traits', link: '/components/traits' },
|
|
232
|
+
{ text: 'Layout', link: '/components/layout' },
|
|
233
|
+
{ text: 'Accordion', link: '/components/accordion' },
|
|
234
|
+
{ text: 'Alert & Feedback', link: '/components/alert' },
|
|
235
|
+
{ text: 'Avatar', link: '/components/avatar' },
|
|
236
|
+
{ text: 'Breadcrumb', link: '/components/breadcrumb' },
|
|
237
|
+
{ text: 'Button', link: '/components/button' },
|
|
238
|
+
{ text: 'Context Menu', link: '/components/context-menu' },
|
|
239
|
+
{ text: 'Data Table', link: '/components/data-table' },
|
|
240
|
+
{ text: 'Dropdown', link: '/components/dropdown' },
|
|
241
|
+
{ text: 'File Upload', link: '/components/form/file-field' },
|
|
242
|
+
{ text: 'Form Fields', link: '/components/form-fields' },
|
|
243
|
+
{ text: 'Checkbox & Radio', link: '/components/form/checkbox-field' },
|
|
244
|
+
{ text: 'Select', link: '/components/form/select-field' },
|
|
245
|
+
{ text: 'Menu', link: '/components/menu' },
|
|
246
|
+
{ text: 'Modal & Popover', link: '/components/modal' },
|
|
247
|
+
{ text: 'Slider', link: '/components/form/slider' },
|
|
248
|
+
{ text: 'Stepper', link: '/components/stepper' },
|
|
249
|
+
{ text: 'Splitter', link: '/components/splitter' },
|
|
250
|
+
{ text: 'Switch', link: '/components/switch' },
|
|
251
|
+
{ text: 'Tabs', link: '/components/tabs' },
|
|
252
|
+
{ text: 'Toast', link: '/components/toast' },
|
|
253
|
+
{ text: 'Tooltip', link: '/components/tooltip' },
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
],
|
|
257
|
+
'/': [
|
|
258
|
+
'/': [
|
|
259
|
+
{
|
|
260
|
+
text: 'Guide',
|
|
261
|
+
items: [
|
|
262
|
+
{ text: 'Getting Started', link: '/getting-started' },
|
|
263
|
+
{ text: 'Core Concepts', link: '/core-concepts' },
|
|
264
|
+
{ text: 'Observables', link: '/observables' },
|
|
265
|
+
{ text: 'Elements', link: '/elements' },
|
|
266
|
+
{ text: 'Conditional Rendering', link: '/conditional-rendering' },
|
|
267
|
+
{ text: 'List Rendering', link: '/list-rendering' },
|
|
268
|
+
{ text: 'Routing', link: '/routing' },
|
|
269
|
+
{ text: 'State Management', link: '/state-management' },
|
|
270
|
+
{ text: 'Lifecycle Events', link: '/lifecycle-events' },
|
|
271
|
+
{ text: 'NDElement', link: '/native-document-element' },
|
|
272
|
+
{ text: 'Extending NDElement', link: '/extending-native-document-element' },
|
|
273
|
+
{ text: 'Advanced Components', link: '/advanced-components' },
|
|
274
|
+
{ text: 'Args Validation', link: '/validation' },
|
|
275
|
+
{ text: 'Memory Management', link: '/memory-management' },
|
|
276
|
+
{ text: 'Anchor', link: '/anchor' },
|
|
277
|
+
{ text: 'SVG Elements', link: '/svg-elements' },
|
|
278
|
+
{ text: 'i18n & Formatting', link: '/i18n' },
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
]
|
|
282
|
+
},
|
|
283
|
+
socialLinks: [
|
|
284
|
+
{ icon: 'github', link: 'https://github.com/afrocodeur/native-document' }
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## Page Template
|
|
293
|
+
|
|
294
|
+
Every doc page follows this structure:
|
|
295
|
+
|
|
296
|
+
```markdown
|
|
297
|
+
---
|
|
298
|
+
title: Page Title
|
|
299
|
+
description: One sentence description
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
# Page Title
|
|
303
|
+
|
|
304
|
+
Brief intro paragraph.
|
|
305
|
+
|
|
306
|
+
## Section
|
|
307
|
+
|
|
308
|
+
Content.
|
|
309
|
+
|
|
310
|
+
## Next Steps
|
|
311
|
+
|
|
312
|
+
- [Link to related page](./related.md)
|
|
313
|
+
- [Another link](./other.md)
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## Rules Applied to All Files
|
|
319
|
+
|
|
320
|
+
1. Every file starts with frontmatter (`title` + `description`)
|
|
321
|
+
2. All internal links use relative paths with `.md` extension
|
|
322
|
+
3. No `docs/` prefix in any link (files are already inside `docs/`)
|
|
323
|
+
4. Utility links: `./utils/cache.md`, `./utils/native-fetch.md`, `./utils/filters.md`
|
|
324
|
+
5. Component links from guide pages: `./components/index.md`
|
|
325
|
+
6. Component links from component pages: `../observables.md` to go up to guide
|
|
326
|
+
7. The "Next Steps" section at the bottom of each page replaces the old flat link lists
|