mountain-ui 1.0.171 → 1.0.172

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 (23) hide show
  1. package/package.json +1 -1
  2. package/src/lib/registry/navigationRegistry/components/Navbar.svelte +1 -3
  3. package/src/lib/registry/webComponentRegistry/components/WebComponent.svelte +27 -0
  4. package/src/lib/registry/webComponentRegistry/createWebComponent.js +619 -0
  5. package/src/lib/registry/webComponentRegistry/registerWebComponents.js +12 -0
  6. package/src/lib/registry/webComponentRegistry/registry.svelte.js +64 -0
  7. package/src/lib/registry/webComponentTypeRegistry/components/WebComponentType.svelte +18 -0
  8. package/src/lib/registry/webComponentTypeRegistry/createWebComponentType.js +59 -0
  9. package/src/lib/registry/webComponentTypeRegistry/registerWebComponentTypes.js +12 -0
  10. package/src/lib/registry/webComponentTypeRegistry/registry.svelte.js +42 -0
  11. package/src/lib/registry/webComponentTypeRegistry/webComponentTypes/Frame/Frame.svelte +7 -0
  12. package/src/lib/registry/webComponentTypeRegistry/webComponentTypes/Frame/index.js +52 -0
  13. package/src/lib/registry/webComponentTypeRegistry/webComponentTypes/Page/Page.svelte +259 -0
  14. package/src/lib/registry/webComponentTypeRegistry/webComponentTypes/Page/index.js +52 -0
  15. package/src/lib/registry/webPageRegistry/components/WebPage.svelte +14 -0
  16. package/src/lib/registry/webPageRegistry/createWebPage.js +22 -0
  17. package/src/lib/registry/webPageRegistry/registerWebPage.js +9 -0
  18. package/src/lib/registry/webPageRegistry/registry.svelte.js +106 -0
  19. package/src/lib/registry/webSite/components/Editor.svelte +11 -0
  20. package/src/lib/registry/webSite/createWebComponentType.js +13 -0
  21. package/src/lib/registry/webSite/registerWebComponentTypes.js +12 -0
  22. package/src/lib/registry/webSite/registry.svelte.js +42 -0
  23. package/src/routes/exemple/[project_normalized_name]/site-builder/+page.svelte +391 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mountain-ui",
3
3
  "private": false,
4
- "version": "1.0.171",
4
+ "version": "1.0.172",
5
5
  "description": "A comprehensive UI component library for ERP systems with field types, entities, and registry management built with Svelte",
6
6
  "type": "module",
7
7
  "module": "index.js",
@@ -10,12 +10,10 @@
10
10
  import NavbarIcon from './NavbarIcon.svelte';
11
11
  import { onMount } from 'svelte';
12
12
 
13
- let {} = $props();
13
+ let { settingsIsOpen = $bindable(false)} = $props();
14
14
 
15
15
  let content = $state(null);
16
16
 
17
- let settingsIsOpen = $state(false);
18
-
19
17
  const allEntities = entityRegistry.getAll();
20
18
 
21
19
  const navigation = navigationRegistry.selectNavbarState();
@@ -0,0 +1,27 @@
1
+ <script>
2
+ import WebComponentType from '$lib/registry/webComponentTypeRegistry/components/WebComponentType.svelte';
3
+ import { webPageRegistry } from '$lib/registry/webPageRegistry/registry.svelte';
4
+ import { webComponentRegistry } from '../registry.svelte';
5
+ import WebComponent from './WebComponent.svelte';
6
+
7
+ let { id, pagePath = '/' } = $props();
8
+
9
+ const webComponent = $derived(webComponentRegistry.select(id));
10
+ const webPage = $derived(webPageRegistry.select(pagePath));
11
+ const webComponentChildren = $derived(webPageRegistry.getChildrenIds(pagePath, id));
12
+
13
+ </script>
14
+
15
+ {#if $webComponent}
16
+ <WebComponentType
17
+ type={$webComponent.type}
18
+ webComponentId={$webComponent.id}
19
+ webPagePath={pagePath}
20
+ >
21
+ {#if $webComponentChildren && $webComponentChildren.length > 0}
22
+ {#each $webComponentChildren as webComponentChild}
23
+ <WebComponent id={webComponentChild} {pagePath}></WebComponent>
24
+ {/each}
25
+ {/if}
26
+ </WebComponentType>
27
+ {/if}
@@ -0,0 +1,619 @@
1
+ import { webComponentTypeRegistry } from "../webComponentTypeRegistry/registry.svelte";
2
+ import { webComponentRegistry } from "./registry.svelte";
3
+ import { derived, get } from "svelte/store";
4
+
5
+ export function createWebComponent(config = {}) {
6
+ const webComponent = {
7
+ id: null,
8
+ type: null,
9
+ path: [],
10
+ children: [],
11
+ breakPoints: [
12
+ {
13
+ name: "Default",
14
+ width: 1200
15
+ }
16
+ ],
17
+ scrollSection: {
18
+ enable: false,
19
+ name: "",
20
+ offsetY: 0,
21
+ },
22
+ layout: {
23
+ type: "stack", // stack | grid | null
24
+ stack: {
25
+ direction: "row", // row | column
26
+ distribution: "start", // start | center | end | space-evenly | space-around | space-between
27
+ alignement: "start", // start | center | end
28
+ wrap: false,
29
+ },
30
+ grid: {
31
+ type: "fixed", // fixed | auto
32
+ cols: 2,
33
+ rows: 2
34
+ },
35
+ gap: {
36
+ x: 0,
37
+ y: 0,
38
+ },
39
+ padding: {
40
+ top: 0,
41
+ right: 0,
42
+ bottom: 0,
43
+ left: 0,
44
+ },
45
+ },
46
+ typography: {
47
+ content: "exemple",
48
+ weigth: "Regular", // thin | thin-italic | extra-light | extra-light-italic | light | light-italic | regular | italic | medium | medium-italic | semi-bold | semi-bold-italic | bold | bold-italic | extra-bold | extra-bold-italic | black | black-italic
49
+ fontSize: 16,
50
+ fontSizeType: "px", // px | rem
51
+ letterSpacing: 0,
52
+ lineHeight: 16,
53
+ alignement: "left", // left | center | right | justify
54
+ tag: "p", // left | center | right | justify
55
+ },
56
+ // overlay
57
+ overlay: [
58
+ {
59
+ type: "fixed", // fixed | relative
60
+ preset: "instant", // instant | fade-in | fade-in-out | fade-out
61
+ fill: {
62
+ r: 0,
63
+ g: 0,
64
+ b: 0,
65
+ a: 1,
66
+ },
67
+ clickToExit: false,
68
+ // overlay/relative
69
+ relative: {
70
+ position: "bottom",
71
+ align: "left",
72
+ hoverToPreserve: false,
73
+ clickOnTriggerToToggle: false,
74
+ },
75
+ }
76
+ ],
77
+ // styles
78
+ style: {
79
+ opacity: 1,
80
+ visibilty: true,
81
+ fill: {
82
+ r: 0,
83
+ g: 0,
84
+ b: 0,
85
+ a: 1,
86
+ },
87
+ overflow: "visible", // visible | clip | hidden | scroll
88
+ borderRadius: {
89
+ tl: 0,
90
+ tr: 0,
91
+ br: 0,
92
+ bl: 0,
93
+ },
94
+ border: {
95
+ r: 0,
96
+ g: 0,
97
+ b: 0,
98
+ a: 1,
99
+ },
100
+ ZIndex: 1,
101
+ },
102
+ // link
103
+ link: {
104
+ enable: false,
105
+ href: "",
106
+ newTab: true,
107
+ },
108
+ // position
109
+ position: {
110
+ type: "absolute", // absolute | relative | fixed | sticky
111
+ absolute: {
112
+ top: null,
113
+ left: null,
114
+ right: null,
115
+ bottom: null,
116
+ },
117
+ fixed: {
118
+ top: null,
119
+ left: null,
120
+ right: null,
121
+ bottom: null,
122
+ },
123
+ sticky: {
124
+ top: 0,
125
+ },
126
+ },
127
+ // size
128
+ size: {
129
+ widthType: "relative", // relative | fill | fixed | fit-content | viewport
130
+ width: 100,
131
+ heightType: "relative", // relative | fill | fixed | fit-content | viewport
132
+ height: 100,
133
+ minWidthType: "relative", // relative | fill | fixed | fit-content | viewport
134
+ minWidth: null,
135
+ maxWidthType: "relative", // relative | fill | fixed | fit-content | viewport
136
+ maxWidth: null,
137
+ minHeightType: "relative", // relative | fill | fixed | fit-content | viewport
138
+ minHeight: null,
139
+ maxHeightType: "relative", // relative | fill | fixed | fit-content | viewport
140
+ maxHeight: null,
141
+ }
142
+ };
143
+
144
+ Object.assign(webComponent, config);
145
+
146
+ // breakpoint
147
+ webComponent.addBreakpoint = (name, width) => {
148
+ // verifier si un breakpoint existe avec le meme nom
149
+ for (const breakPoint of webComponent.breakPoints) {
150
+ if (breakPoint.name === name) {
151
+ return false
152
+ }
153
+ }
154
+
155
+ webComponent.breakPoints.push({
156
+ name,
157
+ width,
158
+ })
159
+ }
160
+ webComponent.deleteBreakpoint = (name) => {
161
+ if (webComponent.breakPoints.length <= 1) {
162
+ return false
163
+ }
164
+ // verifier si un breakpoint existe avec le meme nom
165
+ webComponent.breakPoints = webComponent.breakPoints.filter(bp => bp.name !== name)
166
+ }
167
+
168
+ // scrollsection
169
+ webComponent.addScrollSection = () => {
170
+ webComponent.scrollSection.enable = true
171
+ }
172
+ webComponent.removeScrollSection = () => {
173
+ webComponent.scrollSection.enable = false
174
+ }
175
+ webComponent.setScrollSectionName = (name) => {
176
+ webComponent.scrollSection.name = name
177
+ }
178
+ webComponent.setScrollSectionOffsetY = (offsetY) => {
179
+ webComponent.scrollSection.offsetY = offsetY
180
+ }
181
+
182
+ // layout
183
+ webComponent.setLayout = (type) => {
184
+ // verifier si le type est valide
185
+
186
+ webComponent.layout.type = type
187
+ webComponentRegistry.update()
188
+ }
189
+
190
+ webComponent.setLayoutDistribution = (distribution) => {
191
+ if (webComponent.layout.type !== "stack") {
192
+ return false
193
+ }
194
+
195
+ webComponent.layout.stack.distribution = distribution
196
+ }
197
+
198
+ webComponent.setLayoutAlignement = (alignement) => {
199
+ if (webComponent.layout.type !== "stack") {
200
+ return false
201
+ }
202
+
203
+ webComponent.layout.stack.alignement = alignement
204
+ }
205
+
206
+ webComponent.setLayoutWrap = (wrap) => {
207
+ if (webComponent.layout.type !== "stack") {
208
+ return false
209
+ }
210
+
211
+ webComponent.layout.stack.wrap = wrap
212
+ }
213
+
214
+ webComponent.setLayoutGap = (x, y) => {
215
+ webComponent.layout.gap.x = x
216
+ webComponent.layout.gap.y = y
217
+
218
+ }
219
+
220
+ webComponent.setLayoutPadding = (top, right, bottom, left) => {
221
+ webComponent.layout.padding.top = top
222
+ webComponent.layout.padding.right = right
223
+ webComponent.layout.padding.bottom = bottom
224
+ webComponent.layout.padding.left = left
225
+ }
226
+
227
+ webComponent.getCSS = () => {
228
+ const activeWebComponent = webComponentRegistry.getActive()
229
+
230
+ return derived(activeWebComponent, ($activeWebComponent) => {
231
+ const type = webComponentTypeRegistry.get(webComponent.type)
232
+
233
+ let CSS = ""
234
+ // layout
235
+ if (type.allowLayout) {
236
+
237
+ switch (webComponent.layout.type) {
238
+ case "stack":
239
+ if (type.allowLayout.allowStack) {
240
+ CSS += "display:flex;"
241
+ CSS += `flex-direction:${webComponent.layout.stack.direction};`
242
+ CSS += `align-items:${webComponent.layout.stack.alignement};`
243
+ CSS += `justify-content:${webComponent.layout.stack.distribution};`
244
+ if (type.allowLayout.allowWrap) {
245
+ CSS += `flex-wrap:${webComponent.layout.stack.wrap ? "wrap" : "nowrap"};`
246
+ }
247
+ }
248
+
249
+ break;
250
+ case "grid":
251
+ if (type.allowLayout.allowGrid) {
252
+ CSS += "display:grid;"
253
+ CSS += `grid-template-columns:`
254
+ for (const el of Array.from({ length: webComponent.layout.grid.cols })) {
255
+ CSS += webComponent.layout.grid.type === "fixed" ? ` 1fr ` : " auto "
256
+ }
257
+ CSS += `;`
258
+ CSS += `grid-template-rows:`
259
+ for (const el of Array.from({ length: webComponent.layout.grid.rows })) {
260
+ CSS += ` auto `
261
+ }
262
+ CSS += `;`
263
+ }
264
+
265
+ break;
266
+ default:
267
+ break;
268
+ }
269
+ if (type.allowLayout.allowGap) {
270
+ CSS += `column-gap:calc(var(--zoom) * ${webComponent.layout.gap.x}px);`
271
+ CSS += `row-gap:calc(var(--zoom) * ${webComponent.layout.gap.y}px);`
272
+ }
273
+ if (type.allowLayout.allowPadding) {
274
+ CSS += `padding-top:calc(var(--zoom) * ${webComponent.layout.padding.top}px);`
275
+ CSS += `padding-right:calc(var(--zoom) * ${webComponent.layout.padding.right}px);`
276
+ CSS += `padding-bottom:calc(var(--zoom) * ${webComponent.layout.padding.bottom}px);`
277
+ CSS += `padding-left:calc(var(--zoom) * ${webComponent.layout.padding.left}px);`
278
+ }
279
+ }
280
+ // typographie
281
+ // overlay
282
+ // style
283
+ if (type.allowStyle) {
284
+ if (type.allowStyle.allowOpacity) {
285
+ CSS += `opacity:${webComponent.style.opacity};`
286
+ }
287
+ if (type.allowStyle.allowVisibility && !webComponent.style.visibilty) {
288
+ CSS += `display:none;`
289
+ }
290
+ if (type.allowStyle.allowOverflow) {
291
+ CSS += `overflow:${webComponent.style.overflow};`
292
+ }
293
+ if (type.allowStyle.allowRadius) {
294
+ CSS += `border-radius:${webComponent.style.borderRadius.tl}px ${webComponent.style.borderRadius.tr}px ${webComponent.style.borderRadius.br}px ${webComponent.style.borderRadius.bl}px;`
295
+ }
296
+ if (type.allowStyle.allowZIndex) {
297
+ CSS += `z-index:${webComponent.style.ZIndex};`
298
+ }
299
+ if (type.allowStyle.allowedPosition) {
300
+ switch (webComponent.position.type) {
301
+ case "fixed":
302
+ CSS += `position:sticky;`
303
+ if (webComponent.position.absolute.top === null && webComponent.position.absolute.right === null && webComponent.position.absolute.bottom === null && webComponent.position.absolute.left === null) {
304
+ CSS += `top:50%;`
305
+ CSS += `left:50%;`
306
+ CSS += `transform:translate(-50%, -50%);`
307
+ } else {
308
+ if (webComponent.position.absolute.top) {
309
+ CSS += `top:${webComponent.position.absolute.top}px;`
310
+ }
311
+ if (webComponent.position.absolute.right) {
312
+ CSS += `right:${webComponent.position.absolute.right}px;`
313
+ }
314
+ if (webComponent.position.absolute.bottom) {
315
+ CSS += `bottom:${webComponent.position.absolute.bottom}px;`
316
+ }
317
+ if (webComponent.position.absolute.left) {
318
+ CSS += `left:${webComponent.position.absolute.left}px;`
319
+ }
320
+ }
321
+ break;
322
+ case "fixed":
323
+ CSS += `position:fixed;`
324
+ if (webComponent.position.fixed.top === null && webComponent.position.fixed.right === null && webComponent.position.fixed.bottom === null && webComponent.position.fixed.left === null) {
325
+ CSS += `top:50%;`
326
+ CSS += `left:50%;`
327
+ CSS += `transform:translate(-50%, -50%);`
328
+ } else {
329
+ if (webComponent.position.fixed.top) {
330
+ CSS += `top:${webComponent.position.fixed.top}px;`
331
+ }
332
+ if (webComponent.position.fixed.right) {
333
+ CSS += `right:${webComponent.position.fixed.right}px;`
334
+ }
335
+ if (webComponent.position.fixed.bottom) {
336
+ CSS += `bottom:${webComponent.position.fixed.bottom}px;`
337
+ }
338
+ if (webComponent.position.fixed.left) {
339
+ CSS += `left:${webComponent.position.fixed.left}px;`
340
+ }
341
+ }
342
+ break;
343
+ case "sticky":
344
+ CSS += `position:sticky;`
345
+ CSS += `top:${webComponent.position.sticky.top}px;`
346
+ break;
347
+
348
+ default:
349
+ CSS += `position:relative;`
350
+ break;
351
+ }
352
+ }
353
+ }
354
+
355
+ // size
356
+ if (type.allowSize) {
357
+ const getSize = (type, size) => {
358
+ switch (type) {
359
+ case "relative":
360
+ return `${size}%`
361
+ break;
362
+ case "fill":
363
+ return `width:1fr;`
364
+ break;
365
+ case "fixed":
366
+ return `${webComponent.size.width}px`
367
+ break;
368
+ case "fit-content":
369
+ CSS += `width:fit-content;`
370
+ break;
371
+ case "viewport":
372
+ return `${webComponent.size.width}dvw`
373
+ break;
374
+ default:
375
+ break;
376
+ }
377
+ }
378
+ CSS += `width:${getSize(webComponent.size.widthType, webComponent.size.width)}%;`
379
+ CSS += `height:${getSize(webComponent.size.heightType, webComponent.size.height)}%;`
380
+ if (type.allowSize.allowMinMaxWidth) {
381
+ if (webComponent.size.minWidth) {
382
+ CSS += `min-width:${getSize(webComponent.size.minWidthType, webComponent.size.minWidth)}%;`
383
+ }
384
+ if (webComponent.size.maxWidth) {
385
+ CSS += `max-width:${getSize(webComponent.size.maxWidthType, webComponent.size.maxWidth)}%;`
386
+ }
387
+ }
388
+ if (type.allowSize.allowMinMaxHeight) {
389
+ if (webComponent.size.minHeight) {
390
+ CSS += `min-height:${getSize(webComponent.size.minHeightType, webComponent.size.minHeight)}%;`
391
+ }
392
+ if (webComponent.size.maxHeight) {
393
+ CSS += `max-height:${getSize(webComponent.size.maxHeightType, webComponent.size.maxHeight)}%;`
394
+ }
395
+ }
396
+ }
397
+
398
+ if ($activeWebComponent?.id === webComponent.id) {
399
+ CSS += "outline:1px solid var(--accent);"
400
+ }
401
+ return CSS
402
+ })
403
+ }
404
+
405
+ webComponent.setTypographyContent = (content) => {
406
+ webComponent.typography.content = content
407
+ }
408
+
409
+ webComponent.setTypographyFontWeight = (weightType) => {
410
+ // verifier que c est valide
411
+
412
+
413
+ webComponent.typography.weigth = weightType
414
+ }
415
+
416
+ webComponent.setTypographyFontSize = (size) => {
417
+ webComponent.typography.fontSize = size
418
+ }
419
+ webComponent.setTypographyFontSizeType = (fontSizeType) => {
420
+ webComponent.typography.fontSizeType = fontSizeType
421
+ }
422
+
423
+ webComponent.setTypographyLetterSpacing = (letterSpacing) => {
424
+ webComponent.typography.letterSpacing = letterSpacing
425
+ }
426
+ webComponent.setTypographyAlignement = (alignement) => {
427
+ webComponent.typography.alignement = alignement
428
+
429
+ }
430
+
431
+ webComponent.setTypographyTag = (tag) => {
432
+ webComponent.typography.tag = tag
433
+ }
434
+
435
+ // overlay
436
+ webComponent.addOverlay = (type) => {
437
+ webComponent.overlay.push({
438
+ type: type, // fixed | relative
439
+ preset: "instant", // instant | fade-in | fade-in-out | fade-out
440
+ fill: {
441
+ r: 0,
442
+ g: 0,
443
+ b: 0,
444
+ a: 1,
445
+ },
446
+ clickToExit: false,
447
+ // overlay/relative
448
+ relative: {
449
+ position: "bottom",
450
+ align: "left",
451
+ hoverToPreserve: false,
452
+ clickOnTriggerToToggle: false,
453
+ },
454
+ })
455
+ }
456
+
457
+ webComponent.setOverlayPreset = (index, preset) => {
458
+ webComponent.overlay[index].preset = preset
459
+
460
+ }
461
+ webComponent.setOverlayFill = (index, r, g, b, a) => {
462
+ webComponent.overlay[index].fill = { r, g, b, a }
463
+ }
464
+ webComponent.setOverlayClickToExit = (index, bool) => {
465
+ webComponent.overlay[index].clickToExit = bool
466
+ }
467
+
468
+ // overlay/fixed
469
+ // overlay/relative
470
+ webComponent.setOverlayPosition = (index, position) => {
471
+ // verifier si la position est bonne
472
+
473
+ webComponent.overlay[index].position = position
474
+ }
475
+ webComponent.setOverlayAlign = (index, align) => {
476
+ // verifier si align est bon
477
+
478
+ webComponent.overlay[index].align = align
479
+ }
480
+ webComponent.setOverlayHoverToPreserve = (index, bool) => {
481
+ webComponent.overlay[index].hoverToPreserve = bool
482
+ }
483
+ webComponent.setOverlayClickOnTriggerToToggle = (index, bool) => {
484
+ webComponent.overlay[index].clickOnTriggerToToggle = bool
485
+ }
486
+
487
+ // styles
488
+ webComponent.setStyleOpacity = (percentOpacity) => {
489
+ webComponent.style.opacity = percentOpacity
490
+ }
491
+ webComponent.setStyleVisibility = (boolVisibility) => {
492
+ webComponent.style.visibilty = boolVisibility
493
+ }
494
+ webComponent.setStyleFill = (r, g, b, a) => {
495
+ webComponent.style.fill = { r, g, b, a }
496
+ }
497
+ webComponent.setStyleOverflow = (type) => {
498
+ // verifier si le type d overflow est bon
499
+ webComponent.style.overflow = type
500
+ }
501
+ webComponent.setStyleBorderRadius = (tl, tr, br, bl) => {
502
+ webComponent.style.borderRadius = { tl, tr, br, bl }
503
+ }
504
+ webComponent.setStyleBorderColor = (r, g, b, a) => {
505
+ webComponent.style.border = { r, g, b, a }
506
+ }
507
+ webComponent.setStyleZIndex = (ZIndex) => {
508
+ webComponent.style.ZIndex = ZIndex
509
+ }
510
+
511
+ // link
512
+ webComponent.addLink = () => {
513
+ webComponent.link.enable = true
514
+ }
515
+ webComponent.setLink = (link) => {
516
+ webComponent.link.href = link
517
+ }
518
+ webComponent.setLinkNewTab = (bool) => {
519
+ webComponent.link.newTab = bool
520
+ }
521
+
522
+ // position
523
+ webComponent.setPosition = (position) => {
524
+ webComponent.position.type = position
525
+ }
526
+ // position/absolute
527
+ webComponent.togglePositionCenter = () => {
528
+ webComponent.position.absolute = {
529
+ top: null,
530
+ left: null,
531
+ right: null,
532
+ bottom: null,
533
+ }
534
+ }
535
+ webComponent.setPositionValue = (dir, value) => {
536
+ switch (webComponent.position.type) {
537
+ case "absolute":
538
+ webComponent.absolute[dir] = value
539
+ break;
540
+ case "fixed":
541
+ webComponent.fixed[dir] = value
542
+ break;
543
+ case "sticky":
544
+ webComponent.sticky.top = value
545
+ break;
546
+ default:
547
+ break;
548
+ }
549
+ }
550
+
551
+ // size
552
+ webComponent.setSizeWidthType = (widthType) => {
553
+ webComponent.size.widthType = widthType
554
+ }
555
+ webComponent.setSizeWidth = (value) => {
556
+ webComponent.size.width = value
557
+ }
558
+ webComponent.setSizeHeightType = (heightType) => {
559
+ webComponent.size.heightType = heightType
560
+ }
561
+
562
+ webComponent.setSizeHeight = (value) => {
563
+ webComponent.size.height = value
564
+ }
565
+
566
+ webComponent.addSizeMinHeight = () => {
567
+ webComponent.size.minHeight = 100
568
+ }
569
+ webComponent.addSizeMaxHeight = () => {
570
+ webComponent.size.maxHeight = 100
571
+ }
572
+ webComponent.addSizeMinWidth = () => {
573
+ webComponent.size.minWidth = 100
574
+ }
575
+ webComponent.addSizeMaxWidth = () => {
576
+ webComponent.size.maxWidth = 100
577
+ }
578
+
579
+ webComponent.setSizeMinHeight = (value) => {
580
+ webComponent.size.minHeight = value
581
+ }
582
+ webComponent.setSizeMinHeightType = (type) => {
583
+ webComponent.size.minHeightType = type
584
+ }
585
+ webComponent.setSizeMaxHeight = (value) => {
586
+ webComponent.size.maxHeight = value
587
+ }
588
+ webComponent.setSizeMaxHeightType = (type) => {
589
+ webComponent.size.maxHeightType = type
590
+ }
591
+ webComponent.setSizeMinWidth = (value) => {
592
+ webComponent.size.minWidth = value
593
+ }
594
+ webComponent.setSizeMinWidthType = (type) => {
595
+ webComponent.size.minWidthType = type
596
+ }
597
+ webComponent.setSizeMaxWidth = (value) => {
598
+ webComponent.size.maxWidth = value
599
+ }
600
+ webComponent.setSizeMaxWidthType = (type) => {
601
+ webComponent.size.maxWidthType = type
602
+ }
603
+
604
+ webComponent.deleteSizeMinHeight = () => {
605
+ webComponent.size.minHeight = null
606
+ }
607
+ webComponent.deleteSizeMaxHeight = () => {
608
+ webComponent.size.maxHeight = null
609
+ }
610
+ webComponent.deleteSizeMinWidth = () => {
611
+ webComponent.size.minWidth = null
612
+ }
613
+ webComponent.deleteSizeMaxWidth = () => {
614
+ webComponent.size.maxWidth = null
615
+ }
616
+
617
+
618
+ return webComponent;
619
+ }
@@ -0,0 +1,12 @@
1
+ import { sendRequest } from "hamzus-ui";
2
+ import { webComponentRegistry } from "./registry.svelte";
3
+ import { createWebComponent } from "./createWebComponent";
4
+
5
+ import Page from "./webComponents/Page";
6
+ import Frame from "./webComponents/Frame";
7
+
8
+
9
+ export async function registerWebComponents() {
10
+ webComponentRegistry.register(Page)
11
+ webComponentRegistry.register(Frame)
12
+ }