@nil-/doc 0.2.56 → 0.3.0

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 (35) hide show
  1. package/components/Base.svelte +1 -0
  2. package/components/block/Block.svelte +12 -67
  3. package/components/block/Controls.svelte +1 -6
  4. package/components/block/Controls.svelte.d.ts +0 -2
  5. package/components/block/Instance.svelte +72 -51
  6. package/components/block/context.d.ts +12 -8
  7. package/components/block/context.js +8 -8
  8. package/components/block/controls/Controls.svelte +43 -0
  9. package/components/block/controls/Controls.svelte.d.ts +14 -0
  10. package/components/block/controls/Styler.svelte +9 -12
  11. package/components/block/controls/events/Events.svelte +14 -55
  12. package/components/block/controls/events/Events.svelte.d.ts +6 -6
  13. package/components/block/controls/props/Button.svelte +4 -3
  14. package/components/block/controls/props/Button.svelte.d.ts +1 -0
  15. package/components/block/controls/props/Color.svelte +33 -13
  16. package/components/block/controls/props/Component.svelte +3 -2
  17. package/components/block/controls/props/Number.svelte +10 -3
  18. package/components/block/controls/props/Props.svelte +3 -8
  19. package/components/block/controls/props/Props.svelte.d.ts +1 -3
  20. package/components/block/controls/props/Range.svelte +16 -30
  21. package/components/block/controls/props/Select.svelte +3 -3
  22. package/components/block/controls/props/Text.svelte +10 -3
  23. package/components/block/controls/props/Toggle.svelte +3 -5
  24. package/components/block/controls/props/misc/GroupHeader.svelte +6 -14
  25. package/components/block/controls/props/misc/Toggle.svelte +85 -0
  26. package/components/block/controls/props/misc/Toggle.svelte.d.ts +19 -0
  27. package/components/block/controls/props/misc/utils.d.ts +1 -1
  28. package/components/block/controls/props/misc/utils.js +7 -28
  29. package/components/block/icons/ControlView.svelte +1 -6
  30. package/components/block/icons/Position.svelte +14 -14
  31. package/components/layout/Container.svelte +10 -8
  32. package/components/layout/Layout.svelte +18 -7
  33. package/components/layout/icons/Theme.svelte +6 -24
  34. package/package.json +11 -29
  35. package/CHANGELOG.md +0 -370
@@ -5,10 +5,12 @@ const defaultRenamer = (s) => s;
5
5
  <script>import Base from "../Base.svelte";
6
6
  import Container from "./Container.svelte";
7
7
  import Content from "./Content.svelte";
8
+ import Controls from "../block/controls/Controls.svelte";
8
9
  import Scrollable from "./Scrollable.svelte";
9
10
  import VerticalPanel from "./VerticalPanel.svelte";
10
11
  import Nav from "../navigation/Nav.svelte";
11
12
  import Icon from "./icons/Icon.svelte";
13
+ import { initControlInfo, initControlValue } from "../block/context";
12
14
  import { getTheme, initTheme } from "../context";
13
15
  import ThemeIcon from "./icons/Theme.svelte";
14
16
  export let data;
@@ -17,6 +19,8 @@ export let sorter = null;
17
19
  export let renamer = null;
18
20
  export let theme = void 0;
19
21
  export let offset = 250;
22
+ initControlInfo();
23
+ initControlValue();
20
24
  const parentTheme = getTheme();
21
25
  const dark = initTheme();
22
26
  $:
@@ -62,13 +66,20 @@ const toggle = () => {
62
66
  </Scrollable>
63
67
  </svelte:fragment>
64
68
  <svelte:fragment slot="B">
65
- <Scrollable>
66
- <Content>
67
- {#key current}
68
- <slot />
69
- {/key}
70
- </Content>
71
- </Scrollable>
69
+ <Container offset={100}>
70
+ <svelte:fragment slot="A">
71
+ <Scrollable>
72
+ <Content>
73
+ {#key current}
74
+ <slot />
75
+ {/key}
76
+ </Content>
77
+ </Scrollable>
78
+ </svelte:fragment>
79
+ <svelte:fragment slot="B">
80
+ <Controls />
81
+ </svelte:fragment>
82
+ </Container>
72
83
  </svelte:fragment>
73
84
  </Container>
74
85
  </div>
@@ -3,15 +3,17 @@
3
3
 
4
4
  <script>export let theme = "dark";
5
5
  const index = indexer++;
6
+ $:
7
+ dark = theme === "dark";
6
8
  </script>
7
9
 
8
- <svg viewBox="-25 -25 50 50" class:dark={theme === "light"}>
10
+ <svg viewBox="-25 -25 50 50" style:transform={dark ? "rotate(40deg)" : "rotate(180deg)"}>
9
11
  <mask id={`nil_doc_theme_icon_${index}`}>
10
12
  <rect x="-25" y="-25" fill="white" />
11
- <circle r="11" fill="black" stroke="black" />
13
+ <circle r="11" cy={dark ? -8 : -24} fill="black" stroke="black" />
12
14
  </mask>
13
- <circle mask={`url(#nil_doc_theme_icon_${index})`} />
14
- <g>
15
+ <circle r={dark ? 10 : 5} mask={`url(#nil_doc_theme_icon_${index})`} />
16
+ <g opacity={dark ? 0 : 1}>
15
17
  <g>
16
18
  <line x1="0" y1="9" x2="0" y2="11" />
17
19
  <line x1="9" y1="0" x2="11" y2="0" />
@@ -47,37 +49,17 @@ const index = indexer++;
47
49
 
48
50
  svg {
49
51
  transition: transform var(--i-nil-doc-transition-time);
50
- transform: rotate(40deg);
51
52
  }
52
53
 
53
54
  svg > g {
54
55
  transition: opacity var(--i-nil-doc-transition-time);
55
- opacity: 0;
56
56
  }
57
57
 
58
58
  svg > mask > circle {
59
59
  transition: cy var(--i-nil-doc-transition-time);
60
- cy: -8px;
61
60
  }
62
61
 
63
62
  svg > circle {
64
63
  transition: r var(--i-nil-doc-transition-time);
65
- r: 10px;
66
- }
67
-
68
- svg.dark {
69
- transform: rotate(180deg);
70
- }
71
-
72
- svg.dark > g {
73
- opacity: 1;
74
- }
75
-
76
- svg.dark > mask > circle {
77
- cy: -24px;
78
- }
79
-
80
- svg.dark > circle {
81
- r: 5px;
82
64
  }
83
65
  </style>
package/package.json CHANGED
@@ -1,34 +1,14 @@
1
1
  {
2
2
  "name": "@nil-/doc",
3
- "version": "0.2.56",
3
+ "version": "0.3.0",
4
4
  "author": {
5
5
  "email": "njaldea@gmail.com",
6
6
  "name": "Neil Aldea"
7
7
  },
8
8
  "license": "ISC",
9
- "devDependencies": {
10
- "@sveltejs/adapter-vercel": "^1.0.6",
11
- "@sveltejs/kit": "^1.8.8",
12
- "@sveltejs/package": "^1.0.2",
13
- "@vitest/coverage-c8": "^0.26.3",
14
- "mdsvex": "^0.10.6",
15
- "remark-admonitions": "^1.2.1",
16
- "svelte-check": "^2.10.3",
17
- "tslib": "^2.5.0",
18
- "typescript": "^4.9.5",
19
- "vite": "^4.1.4",
20
- "vitest": "^0.26.3",
21
- "@typescript-eslint/eslint-plugin": "^5.54.0",
22
- "@typescript-eslint/parser": "^5.54.0",
23
- "eslint": "^8.35.0",
24
- "eslint-config-prettier": "^8.6.0",
25
- "eslint-plugin-svelte3": "^4.0.0"
26
- },
27
9
  "peerDependencies": {
28
- "svelte": "^3.55.1"
29
- },
30
- "publishConfig": {
31
- "linkDirectory": true
10
+ "@sveltejs/kit": "^1.15.0",
11
+ "svelte": "^3.58.0"
32
12
  },
33
13
  "keywords": [
34
14
  "svelte",
@@ -36,14 +16,16 @@
36
16
  "component"
37
17
  ],
38
18
  "type": "module",
39
- "dependencies": {
40
- "svelte-toggle": "^3.1.0",
41
- "vanilla-picker": "^2.12.1"
42
- },
43
19
  "exports": {
44
20
  "./package.json": "./package.json",
45
- ".": "./index.js",
21
+ ".": {
22
+ "default": "./index.js",
23
+ "svelte": "./index.js",
24
+ "types": "./index.d.ts"
25
+ },
46
26
  "./sveltekit": "./sveltekit/index.js"
47
27
  },
48
- "svelte": "./index.js"
28
+ "dependencies": {
29
+ "vanilla-picker": "^2.12.1"
30
+ }
49
31
  }
package/CHANGELOG.md DELETED
@@ -1,370 +0,0 @@
1
- # @nil-/doc
2
-
3
- ## 0.2.56
4
-
5
- ### Patch Changes
6
-
7
- - [doc][patch] use consolas as default font ([#98](https://github.com/njaldea/mono/pull/98))
8
-
9
- ## 0.2.55
10
-
11
- ### Patch Changes
12
-
13
- - [all][fix] separate eslint configuration ([#96](https://github.com/njaldea/mono/pull/96))
14
-
15
- - [doc][docu] fix switch -> toggle ([#96](https://github.com/njaldea/mono/pull/96))
16
-
17
- - [all][patch] update deps ([#96](https://github.com/njaldea/mono/pull/96))
18
-
19
- - [doc][new] added special prop control "button" ([#96](https://github.com/njaldea/mono/pull/96))
20
-
21
- ## 0.2.54
22
-
23
- ### Patch Changes
24
-
25
- - [doc][fix] dynamic import of vanilla-picker to avoid ssr document access ([#94](https://github.com/njaldea/mono/pull/94))
26
- - [doc][patch] temporarily used svelte-toggle for checkbox/toggle ([#94](https://github.com/njaldea/mono/pull/94))
27
-
28
- ## 0.2.53
29
-
30
- ### Patch Changes
31
-
32
- - [doc][break] removed "scale" prop ([#92](https://github.com/njaldea/mono/pull/92))
33
- - [doc][fix] better block scrollable handling ([#92](https://github.com/njaldea/mono/pull/92))
34
- - [doc][fix] better style to vanilla-color popup ([#92](https://github.com/njaldea/mono/pull/92))
35
-
36
- ## 0.2.52
37
-
38
- ### Patch Changes
39
-
40
- - [doc][fix] fix layout scrollable sections ([#90](https://github.com/njaldea/mono/pull/90))
41
- - [doc][patch] restructure code ([#90](https://github.com/njaldea/mono/pull/90))
42
- - [doc][patch] use vannilla-color library for color picker ([#90](https://github.com/njaldea/mono/pull/90))
43
- - [doc][fix] removed position relative and overflow scroll for misc (controls) ([#90](https://github.com/njaldea/mono/pull/90))
44
- - [doc][fix] content fill width/height ([#90](https://github.com/njaldea/mono/pull/90))
45
- - [doc][new] added offset Layout.svelte and sveltekit for keeping state ([#90](https://github.com/njaldea/mono/pull/90))
46
-
47
- ## 0.2.51
48
-
49
- ### Patch Changes
50
-
51
- - [doc][fix] components now rely on root font-size ([#88](https://github.com/njaldea/mono/pull/88))
52
- - [doc][fix] fix object prop control ([#88](https://github.com/njaldea/mono/pull/88))
53
- - [doc][new] block button controls ([#88](https://github.com/njaldea/mono/pull/88))
54
- - [doc][new] centralized custom css ([#88](https://github.com/njaldea/mono/pull/88))
55
- - [doc][misc] change styling ([#88](https://github.com/njaldea/mono/pull/88))
56
- - [doc][fix] scrolling content of container ([#88](https://github.com/njaldea/mono/pull/88))
57
-
58
- ## 0.2.50
59
-
60
- ### Patch Changes
61
-
62
- - [doc][new] removed default nil icon ([#86](https://github.com/njaldea/mono/pull/86))
63
- - [doc][new] allow override of theme icon ([#86](https://github.com/njaldea/mono/pull/86))
64
-
65
- ## 0.2.49
66
-
67
- ### Patch Changes
68
-
69
- - [doc][fix] fix range number formatting ([#83](https://github.com/njaldea/mono/pull/83))
70
-
71
- ## 0.2.48
72
-
73
- ### Patch Changes
74
-
75
- - [doc][fix] Fix type support ([#81](https://github.com/njaldea/mono/pull/81))
76
-
77
- ## 0.2.47
78
-
79
- ### Patch Changes
80
-
81
- - [doc][docu] minor adjustments to documentation ([#79](https://github.com/njaldea/mono/pull/79))
82
- - [doc][new] added support for flattened prop schema ([#79](https://github.com/njaldea/mono/pull/79))
83
-
84
- ## 0.2.46
85
-
86
- ### Patch Changes
87
-
88
- - [doc][break] added event control support ([#77](https://github.com/njaldea/mono/pull/77))
89
-
90
- ## 0.2.45
91
-
92
- ### Patch Changes
93
-
94
- - [doc][fix] keep control state when disabled after tuple/object parent toggles expand #[75](https://github.com/njaldea/mono/issues/75) ([#74](https://github.com/njaldea/mono/pull/74))
95
-
96
- ## 0.2.44
97
-
98
- ### Patch Changes
99
-
100
- - [doc][new] tuple and object controls now collapsible without disabling ([#72](https://github.com/njaldea/mono/pull/72))
101
-
102
- ## 0.2.43
103
-
104
- ### Patch Changes
105
-
106
- - [doc][fix] disable Range.svelte tooltip when disabled ([#70](https://github.com/njaldea/mono/pull/70))
107
- - [doc][new] added auto scroll when content of layout is only one component ([#70](https://github.com/njaldea/mono/pull/70))
108
-
109
- ## 0.2.42
110
-
111
- ### Patch Changes
112
-
113
- - [doc][new] added theme store in sveltekit to retain used theme ([#67](https://github.com/njaldea/mono/pull/67))
114
-
115
- ## 0.2.41
116
-
117
- ### Patch Changes
118
-
119
- - [doc][docu] added page for fuzzy matching ([#65](https://github.com/njaldea/mono/pull/65))
120
-
121
- ## 0.2.40
122
-
123
- ### Patch Changes
124
-
125
- - [doc][new] added scale flag prop for Instance/Template componen ([#63](https://github.com/njaldea/mono/pull/63))
126
- - [doc][patch] fixed jsdoc link for public components ([#63](https://github.com/njaldea/mono/pull/63))
127
- - [doc][docu] moved Sorting and Renaming section to their own pages ([#63](https://github.com/njaldea/mono/pull/63))
128
- - [doc][new] added placeholder to search bar ([#63](https://github.com/njaldea/mono/pull/63))
129
- - [doc][docu] added admonitions plugin ([#63](https://github.com/njaldea/mono/pull/63))
130
-
131
- ## 0.2.39
132
-
133
- ### Patch Changes
134
-
135
- - [doc][fix] force state of navigation expand icon when filtering ([#61](https://github.com/njaldea/mono/pull/61))
136
- - [doc][patch] tighter eslint ([#61](https://github.com/njaldea/mono/pull/61))
137
- - [doc][patch] added tests for non-UI related code ([#61](https://github.com/njaldea/mono/pull/61))
138
- - [doc][patch] moved type definition ([#61](https://github.com/njaldea/mono/pull/61))
139
- - [doc][patch] enabled typescript eslint rules ([#61](https://github.com/njaldea/mono/pull/61))
140
-
141
- ## 0.2.38
142
-
143
- ### Patch Changes
144
-
145
- - [doc][new] added fuzzy match for nav filter ([#59](https://github.com/njaldea/mono/pull/59))
146
-
147
- ## 0.2.37
148
-
149
- ### Patch Changes
150
-
151
- - [doc][fix] params prop is now reactive ([#57](https://github.com/njaldea/mono/pull/57))
152
- - [doc][docu] added component documentation link to deployment ([#57](https://github.com/njaldea/mono/pull/57))
153
- - [doc][patch] removed inRoot ([#57](https://github.com/njaldea/mono/pull/57))
154
- - [doc][patch] refactored Instance/Template/Params ([#57](https://github.com/njaldea/mono/pull/57))
155
-
156
- ## 0.2.36
157
-
158
- ### Patch Changes
159
-
160
- - [doc][fix] color changes and transition ([#55](https://github.com/njaldea/mono/pull/55))
161
- - [doc][patch] added html meta details ([#55](https://github.com/njaldea/mono/pull/55))
162
-
163
- ## 0.2.35
164
-
165
- ### Patch Changes
166
-
167
- - [doc][break] changed Control "side" flag to "position" prop ([#53](https://github.com/njaldea/mono/pull/53))
168
- - [doc][new] added nil icon ([#53](https://github.com/njaldea/mono/pull/53))
169
-
170
- ## 0.2.34
171
-
172
- ### Patch Changes
173
-
174
- - [doc][new] added Control hide property ([#51](https://github.com/njaldea/mono/pull/51))
175
- [doc][break] renamed Control expand property to hide
176
- [doc][break] Control now defaults to show
177
-
178
- ## 0.2.33
179
-
180
- ### Patch Changes
181
-
182
- - [doc][patch] update formatting (camel case use) ([#49](https://github.com/njaldea/mono/pull/49))
183
-
184
- ## 0.2.32
185
-
186
- ### Patch Changes
187
-
188
- - [doc][new] relaxed file extension for sveltekit helper ([#47](https://github.com/njaldea/mono/pull/47))
189
-
190
- ## 0.2.31
191
-
192
- ### Patch Changes
193
-
194
- - [doc][patch] better container style ([#45](https://github.com/njaldea/mono/pull/45))
195
- - [doc][patch] improved ThemeIcon ([#45](https://github.com/njaldea/mono/pull/45))
196
-
197
- ## 0.2.30
198
-
199
- ### Patch Changes
200
-
201
- - [doc] Added color transition in Layout ([#43](https://github.com/njaldea/mono/pull/43))
202
- - [doc] added Instance component ([#43](https://github.com/njaldea/mono/pull/43))
203
-
204
- ## 0.2.29
205
-
206
- ### Patch Changes
207
-
208
- - [doc][feature] ThemeIcon ([#41](https://github.com/njaldea/mono/pull/41))
209
- - [doc][feature] added top bar to separate title and other controls ([#41](https://github.com/njaldea/mono/pull/41))
210
-
211
- ## 0.2.28
212
-
213
- ### Patch Changes
214
-
215
- - [doc][fix] reorder css style ([#37](https://github.com/njaldea/mono/pull/37))
216
-
217
- ## 0.2.27
218
-
219
- ### Patch Changes
220
-
221
- - [doc][fix] fix fira code css import ([#35](https://github.com/njaldea/mono/pull/35))
222
-
223
- ## 0.2.26
224
-
225
- ### Patch Changes
226
-
227
- - [doc][docu] removed fallback page in documentation ([#30](https://github.com/njaldea/mono/pull/30))
228
-
229
- ## 0.2.25
230
-
231
- ### Patch Changes
232
-
233
- - 186187c: [doc][new] removed layout slot prop for content. all unnamed slots will be part of the default slot
234
- - 186187c: [doc][fix] fix range tooltip styling
235
- - a82c0de: [doc][new] support dark/light mode
236
-
237
- ## 0.2.24
238
-
239
- ### Patch Changes
240
-
241
- - 782e6fa: [doc][new] simplified sveltekit glue layer
242
- - 782e6fa: [doc][docu] added documentation to public methods
243
-
244
- ## 0.2.23
245
-
246
- ### Patch Changes
247
-
248
- - 5655f86: [doc][new] added slot prop `key` to Template component
249
- - 5655f86: [doc][patch] moved some devDependencies to peerDependencies
250
-
251
- ## 0.2.22
252
-
253
- ### Patch Changes
254
-
255
- - 3ce0a62: [doc][new] support for touch event via pointerevent (draggable container)
256
-
257
- ## 0.2.21
258
-
259
- ### Patch Changes
260
-
261
- - 0398a72: [doc][fix] remove dependency on box-sizing
262
- - 0398a72: [doc][fix] control min width
263
- - 0398a72: [doc][new] made template configurable by column prop
264
-
265
- ## 0.2.20
266
-
267
- ### Patch Changes
268
-
269
- - 3eee0ce: [doc][fix] removed setting of margin/padding
270
- - 3eee0ce: [doc][fix] only propagate box-sizing (inherit)
271
-
272
- ## 0.2.19
273
-
274
- ### Patch Changes
275
-
276
- - 1dad00f: [doc][fix] removed external css. inlined css even duplicating some of them.
277
-
278
- ## 0.2.18
279
-
280
- ### Patch Changes
281
-
282
- - a63dd42: [doc][fix] added tooltip for range
283
-
284
- ## 0.2.17
285
-
286
- ### Patch Changes
287
-
288
- - af86341: [doc][fix] moved default mapping in a common lib
289
- - af86341: [doc][fix] fix typing
290
- - af86341: [doc][patch] if Param's tag is not provided, use stringified id
291
-
292
- ## 0.2.16
293
-
294
- ### Patch Changes
295
-
296
- - 650eb4b: [doc][fix] revived proper ordering of params
297
- - 650eb4b: [doc][new] each param now has its own defaults (which is resolved from template's default and pram's props)
298
-
299
- ## 0.2.15
300
-
301
- ### Patch Changes
302
-
303
- - 44a7113: [doc][docu] added documentation for internal Container
304
- - 44a7113: [doc][new] adjusted api for load (now `routes`)
305
- - 44a7113: [doc][fix] fix for layout group route
306
-
307
- ## 0.2.14
308
-
309
- ### Patch Changes
310
-
311
- - 6265fa6: [doc][new] added Tuple and Object Controls
312
- - 6265fa6: [doc][docu] added temporary internal doc
313
-
314
- ## 0.2.13
315
-
316
- ### Patch Changes
317
-
318
- - 39dbce9: [doc][new] navigation now automatically opens when redirected to a route that is still collapsed
319
-
320
- ## 0.2.12
321
-
322
- ### Patch Changes
323
-
324
- - 6c2d946: [doc][fix] Nav now is not scrollable
325
- - 6c2d946: [doc][fix] Removes Container's "reversed" flag
326
- - 6c2d946: [doc][fix] Adds "secondary" flag to Container
327
- - 6c2d946: [doc][fix] Changes Container slot name (primary is top or left, seconadry is bottom or right)
328
- - 6c2d946: [doc][fix] load now removes routes with parameters
329
- - 6c2d946: [doc][fix] Template now supports `noreset`
330
- - 6c2d946: [doc][fix] Updates documentation
331
-
332
- ## 0.2.10
333
-
334
- ### Patch Changes
335
-
336
- - c6de380: [doc][new] container collapsing now supported
337
- - c6de380: [doc][patch] styling of container now uses grid for easier handling
338
-
339
- ## 0.2.9
340
-
341
- ### Patch Changes
342
-
343
- - 5c10f11: [doc][patch] layout fill height
344
-
345
- ## 0.2.8
346
-
347
- ### Patch Changes
348
-
349
- - 865eef0: Adjusted Container to allow collapsing (based on primary/secondary and double clicking the divider)
350
-
351
- ## 0.2.7
352
-
353
- ### Patch Changes
354
-
355
- - a286896: Removed fonts to css
356
- Moved common style to css files
357
- Moved static in src
358
- Moved Controls to its own component
359
- Scoped styles by `nil-doc` prefix
360
- Fixed css reset for Layout and Block
361
- Allow filtering after renaming (url paths)
362
- Added title to +layout.svelte
363
- Updated layout documentation
364
- Update dependencies
365
-
366
- ## 0.1.0
367
-
368
- ### Minor Changes
369
-
370
- - Alpha release