sveltekit-ui 1.0.76 → 1.0.77

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.
@@ -115,9 +115,11 @@ export function create_table_advanced_manager(config) {
115
115
  let row_json_schema = $derived(get_row_json_schema(columns_prepped))
116
116
 
117
117
  function get_row_json_schema(input) {
118
+ console.log("get_row_json_schema", input)
118
119
  let properties = {}
119
120
  if (Object.keys(input || {}).length > 0) {
120
121
  for (let key of Object.keys(input)) {
122
+ console.log("key", key)
121
123
  if (input?.[key]?.is_db_column && !input?.[key]?.is_autogenerated) {
122
124
  properties[key] = get_json_schema_from_db_type(input?.[key]?.db_data_type)
123
125
  }
@@ -145,6 +147,9 @@ export function create_table_advanced_manager(config) {
145
147
  properties[key] = get_json_schema_from_db_type(input?.properties?.[key])
146
148
  }
147
149
  return { type: "object", properties: properties, required: Object.keys(properties), additionalProperties: false }
150
+ } else if (input?.type == "object_uniform_literal") {
151
+ // tbd try and avoid this
152
+ return { type: "null_literal" }
148
153
  }
149
154
  let default_json_schema = literal_types?.[input?.type]?.json_schema
150
155
  if (default_json_schema?.type == "object") {
@@ -1,3 +1,5 @@
1
+ import { time_formats } from "../../Components/TimeInput/index.js"
2
+
1
3
  export const mime_type_extensions = {
2
4
  "image/webp": "webp",
3
5
  "image/jpeg": "jpeg",
@@ -392,19 +394,161 @@ const time_literal = {
392
394
  json_schema: {
393
395
  type: "object",
394
396
  properties: {
395
- epoch: { type: "number" },
396
- granularity: { type: "string", enum: ["year", "month", "week", "day", "hour", "minute", "second"] },
397
- year: { type: "number" },
398
- month: { type: "number", enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] },
399
- day_of_month: { type: "number", minimum: 1, maximum: 31 },
400
- day_of_week: { type: "number", enum: [0, 1, 2, 3, 4, 5, 6] },
401
- day_of_year: { type: "number", minimum: 1, maximum: 365 },
402
- week_of_year: { type: "number", minimum: 1, maximum: 52 },
403
- hour: { type: "number", minimum: 1, maximum: 24 },
404
- minute: { type: "number", minimum: 1, maximum: 60 },
405
- timezone: { type: "string" },
406
- content: { type: "string" },
407
- datetime: { type: "string" },
397
+ format: {
398
+ type: "string",
399
+ description: JSON.stringify(time_formats),
400
+ },
401
+ epoch: {
402
+ anyOf: [
403
+ {
404
+ type: "number",
405
+ description: "epoch in seconds",
406
+ },
407
+ {
408
+ type: "null",
409
+ },
410
+ ],
411
+ description: "derived can keep null",
412
+ },
413
+ granularity: {
414
+ type: "string",
415
+ enum: ["year", "month", "week", "day", "hour", "minute", "second"],
416
+ description: ["year", "month", "week", "day", "hour", "minute", "second"].join(", "),
417
+ },
418
+ year: {
419
+ anyOf: [
420
+ {
421
+ type: "number",
422
+ },
423
+ {
424
+ type: "null",
425
+ },
426
+ ],
427
+ description: "derived can keep null",
428
+ },
429
+ month: {
430
+ anyOf: [
431
+ {
432
+ type: "number",
433
+ enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
434
+ },
435
+ {
436
+ type: "null",
437
+ },
438
+ ],
439
+ description: "derived can keep null",
440
+ },
441
+ day_of_month: {
442
+ anyOf: [
443
+ {
444
+ type: "number",
445
+ minimum: 1,
446
+ maximum: 31,
447
+ },
448
+ {
449
+ type: "null",
450
+ },
451
+ ],
452
+ description: "derived can keep null",
453
+ },
454
+ day_of_week: {
455
+ anyOf: [
456
+ {
457
+ type: "number",
458
+ enum: [0, 1, 2, 3, 4, 5, 6],
459
+ },
460
+ {
461
+ type: "null",
462
+ },
463
+ ],
464
+ description: "derived can keep null",
465
+ },
466
+ day_of_year: {
467
+ anyOf: [
468
+ {
469
+ type: "number",
470
+ minimum: 1,
471
+ maximum: 365,
472
+ },
473
+ {
474
+ type: "null",
475
+ },
476
+ ],
477
+ description: "derived can keep null",
478
+ },
479
+ week_of_year: {
480
+ anyOf: [
481
+ {
482
+ type: "number",
483
+ minimum: 1,
484
+ maximum: 52,
485
+ },
486
+ {
487
+ type: "null",
488
+ },
489
+ ],
490
+ description: "derived can keep null",
491
+ },
492
+ hour: {
493
+ anyOf: [
494
+ {
495
+ type: "number",
496
+ minimum: 1,
497
+ maximum: 24,
498
+ },
499
+ {
500
+ type: "null",
501
+ },
502
+ ],
503
+ description: "derived can keep null",
504
+ },
505
+ minute: {
506
+ anyOf: [
507
+ {
508
+ type: "number",
509
+ minimum: 1,
510
+ maximum: 60,
511
+ },
512
+ {
513
+ type: "null",
514
+ },
515
+ ],
516
+ description: "derived can keep null",
517
+ },
518
+ timezone: {
519
+ anyOf: [
520
+ {
521
+ type: "string",
522
+ description: time_zone_options.map((h) => h?.key).join(", "),
523
+ },
524
+ {
525
+ type: "null",
526
+ },
527
+ ],
528
+ description: "derived can keep null",
529
+ },
530
+ content: {
531
+ anyOf: [
532
+ {
533
+ type: "string",
534
+ },
535
+ {
536
+ type: "null",
537
+ },
538
+ ],
539
+ description: "derived can keep null",
540
+ },
541
+ datetime: {
542
+ anyOf: [
543
+ {
544
+ type: "string",
545
+ },
546
+ {
547
+ type: "null",
548
+ },
549
+ ],
550
+ description: "derived can keep null",
551
+ },
408
552
  },
409
553
  additionalProperties: false,
410
554
  required: ["epoch"],
@@ -2078,7 +2222,6 @@ export const language_options = [
2078
2222
  { key: "ta", name: "தமிழ்", english_name: "Tamil", emoji: "🇮🇳" },
2079
2223
  { key: "te", name: "తెలుగు", english_name: "Telugu", emoji: "🇮🇳" },
2080
2224
  ]
2081
- // javascript: sequelize model definition using the iana timezone identifier
2082
2225
 
2083
2226
  export const time_zone_options = [
2084
2227
  { key: "america/puerto_rico", name: "atlantic time / puerto rico (ast)", emoji: "🇵🇷" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sveltekit-ui",
3
- "version": "1.0.76",
3
+ "version": "1.0.77",
4
4
  "description": "A SvelteKit UI component library for building modern web applications",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -19,14 +19,14 @@
19
19
  "dependencies": {
20
20
  "context-filter-polyfill": "^0.3.23",
21
21
  "qr-code-styling": "^1.9.2",
22
- "svelte": "^5.39.10"
22
+ "svelte": "^5.39.11"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@sveltejs/kit": "^2.22.2"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@sveltejs/adapter-vercel": "^5.10.3",
29
- "@sveltejs/kit": "^2.46.2",
29
+ "@sveltejs/kit": "^2.46.4",
30
30
  "@sveltejs/package": "^2.5.4",
31
31
  "@sveltejs/vite-plugin-svelte": "^6.2.1",
32
32
  "@vercel/analytics": "^1.5.0",
@@ -115,9 +115,11 @@ export function create_table_advanced_manager(config) {
115
115
  let row_json_schema = $derived(get_row_json_schema(columns_prepped))
116
116
 
117
117
  function get_row_json_schema(input) {
118
+ console.log("get_row_json_schema", input)
118
119
  let properties = {}
119
120
  if (Object.keys(input || {}).length > 0) {
120
121
  for (let key of Object.keys(input)) {
122
+ console.log("key", key)
121
123
  if (input?.[key]?.is_db_column && !input?.[key]?.is_autogenerated) {
122
124
  properties[key] = get_json_schema_from_db_type(input?.[key]?.db_data_type)
123
125
  }
@@ -145,6 +147,9 @@ export function create_table_advanced_manager(config) {
145
147
  properties[key] = get_json_schema_from_db_type(input?.properties?.[key])
146
148
  }
147
149
  return { type: "object", properties: properties, required: Object.keys(properties), additionalProperties: false }
150
+ } else if (input?.type == "object_uniform_literal") {
151
+ // tbd try and avoid this
152
+ return { type: "null_literal" }
148
153
  }
149
154
  let default_json_schema = literal_types?.[input?.type]?.json_schema
150
155
  if (default_json_schema?.type == "object") {
@@ -1,3 +1,5 @@
1
+ import { time_formats } from "$lib/Components/TimeInput/index.js"
2
+
1
3
  export const mime_type_extensions = {
2
4
  "image/webp": "webp",
3
5
  "image/jpeg": "jpeg",
@@ -392,19 +394,161 @@ const time_literal = {
392
394
  json_schema: {
393
395
  type: "object",
394
396
  properties: {
395
- epoch: { type: "number" },
396
- granularity: { type: "string", enum: ["year", "month", "week", "day", "hour", "minute", "second"] },
397
- year: { type: "number" },
398
- month: { type: "number", enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] },
399
- day_of_month: { type: "number", minimum: 1, maximum: 31 },
400
- day_of_week: { type: "number", enum: [0, 1, 2, 3, 4, 5, 6] },
401
- day_of_year: { type: "number", minimum: 1, maximum: 365 },
402
- week_of_year: { type: "number", minimum: 1, maximum: 52 },
403
- hour: { type: "number", minimum: 1, maximum: 24 },
404
- minute: { type: "number", minimum: 1, maximum: 60 },
405
- timezone: { type: "string" },
406
- content: { type: "string" },
407
- datetime: { type: "string" },
397
+ format: {
398
+ type: "string",
399
+ description: JSON.stringify(time_formats),
400
+ },
401
+ epoch: {
402
+ anyOf: [
403
+ {
404
+ type: "number",
405
+ description: "epoch in seconds",
406
+ },
407
+ {
408
+ type: "null",
409
+ },
410
+ ],
411
+ description: "derived can keep null",
412
+ },
413
+ granularity: {
414
+ type: "string",
415
+ enum: ["year", "month", "week", "day", "hour", "minute", "second"],
416
+ description: ["year", "month", "week", "day", "hour", "minute", "second"].join(", "),
417
+ },
418
+ year: {
419
+ anyOf: [
420
+ {
421
+ type: "number",
422
+ },
423
+ {
424
+ type: "null",
425
+ },
426
+ ],
427
+ description: "derived can keep null",
428
+ },
429
+ month: {
430
+ anyOf: [
431
+ {
432
+ type: "number",
433
+ enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
434
+ },
435
+ {
436
+ type: "null",
437
+ },
438
+ ],
439
+ description: "derived can keep null",
440
+ },
441
+ day_of_month: {
442
+ anyOf: [
443
+ {
444
+ type: "number",
445
+ minimum: 1,
446
+ maximum: 31,
447
+ },
448
+ {
449
+ type: "null",
450
+ },
451
+ ],
452
+ description: "derived can keep null",
453
+ },
454
+ day_of_week: {
455
+ anyOf: [
456
+ {
457
+ type: "number",
458
+ enum: [0, 1, 2, 3, 4, 5, 6],
459
+ },
460
+ {
461
+ type: "null",
462
+ },
463
+ ],
464
+ description: "derived can keep null",
465
+ },
466
+ day_of_year: {
467
+ anyOf: [
468
+ {
469
+ type: "number",
470
+ minimum: 1,
471
+ maximum: 365,
472
+ },
473
+ {
474
+ type: "null",
475
+ },
476
+ ],
477
+ description: "derived can keep null",
478
+ },
479
+ week_of_year: {
480
+ anyOf: [
481
+ {
482
+ type: "number",
483
+ minimum: 1,
484
+ maximum: 52,
485
+ },
486
+ {
487
+ type: "null",
488
+ },
489
+ ],
490
+ description: "derived can keep null",
491
+ },
492
+ hour: {
493
+ anyOf: [
494
+ {
495
+ type: "number",
496
+ minimum: 1,
497
+ maximum: 24,
498
+ },
499
+ {
500
+ type: "null",
501
+ },
502
+ ],
503
+ description: "derived can keep null",
504
+ },
505
+ minute: {
506
+ anyOf: [
507
+ {
508
+ type: "number",
509
+ minimum: 1,
510
+ maximum: 60,
511
+ },
512
+ {
513
+ type: "null",
514
+ },
515
+ ],
516
+ description: "derived can keep null",
517
+ },
518
+ timezone: {
519
+ anyOf: [
520
+ {
521
+ type: "string",
522
+ description: time_zone_options.map((h) => h?.key).join(", "),
523
+ },
524
+ {
525
+ type: "null",
526
+ },
527
+ ],
528
+ description: "derived can keep null",
529
+ },
530
+ content: {
531
+ anyOf: [
532
+ {
533
+ type: "string",
534
+ },
535
+ {
536
+ type: "null",
537
+ },
538
+ ],
539
+ description: "derived can keep null",
540
+ },
541
+ datetime: {
542
+ anyOf: [
543
+ {
544
+ type: "string",
545
+ },
546
+ {
547
+ type: "null",
548
+ },
549
+ ],
550
+ description: "derived can keep null",
551
+ },
408
552
  },
409
553
  additionalProperties: false,
410
554
  required: ["epoch"],
@@ -2078,7 +2222,6 @@ export const language_options = [
2078
2222
  { key: "ta", name: "தமிழ்", english_name: "Tamil", emoji: "🇮🇳" },
2079
2223
  { key: "te", name: "తెలుగు", english_name: "Telugu", emoji: "🇮🇳" },
2080
2224
  ]
2081
- // javascript: sequelize model definition using the iana timezone identifier
2082
2225
 
2083
2226
  export const time_zone_options = [
2084
2227
  { key: "america/puerto_rico", name: "atlantic time / puerto rico (ast)", emoji: "🇵🇷" },