@onlyworlds/sdk 1.5.0 → 2.0.1

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/dist/index.mjs CHANGED
@@ -332,93 +332,120 @@ function getElementIcon(elementType) {
332
332
  function getElementUnicodeIcon(elementType) {
333
333
  return ELEMENT_UNICODE_ICONS[elementType];
334
334
  }
335
- var ELEMENT_MATERIAL_ICONS = ELEMENT_ICONS;
336
- var getElementMaterialIcon = getElementIcon;
337
335
  var FIELD_SCHEMA = {
338
336
  ability: {
339
- // Text fields
337
+ // Base fields (shared by all elements)
338
+ name: { type: "text", required: true },
339
+ description: { type: "text", required: false },
340
+ supertype: { type: "text", required: false },
341
+ subtype: { type: "text", required: false },
342
+ image_url: { type: "text", required: false },
343
+ // Mechanics
340
344
  activation: { type: "text" },
341
- duration: { type: "text" },
342
- potency: { type: "text" },
343
- range: { type: "text" },
345
+ duration: { type: "number" },
346
+ potency: { type: "number" },
347
+ range: { type: "number" },
348
+ effects: { type: "multi_link", target: "phenomenon" },
344
349
  challenges: { type: "text" },
350
+ talents: { type: "multi_link", target: "trait" },
351
+ requisites: { type: "multi_link", target: "construct" },
352
+ // World
345
353
  prevalence: { type: "text" },
346
- // Link fields
347
354
  tradition: { type: "single_link", target: "construct" },
348
355
  source: { type: "single_link", target: "phenomenon" },
349
356
  locus: { type: "single_link", target: "location" },
350
- effects: { type: "multi_link", target: "phenomenon" },
351
- talents: { type: "multi_link", target: "trait" },
352
- requisites: { type: "multi_link", target: "construct" },
353
357
  instruments: { type: "multi_link", target: "object" },
354
358
  systems: { type: "multi_link", target: "construct" }
355
359
  },
356
360
  character: {
357
- // Text fields
361
+ // Base fields (shared by all elements)
362
+ name: { type: "text", required: true },
363
+ description: { type: "text", required: false },
364
+ supertype: { type: "text", required: false },
365
+ subtype: { type: "text", required: false },
366
+ image_url: { type: "text", required: false },
367
+ // Constitution
358
368
  physicality: { type: "text" },
359
369
  mentality: { type: "text" },
360
- height: { type: "text" },
361
- weight: { type: "text" },
362
- background: { type: "text" },
363
- motivations: { type: "text" },
364
- birth_date: { type: "text" },
365
- reputation: { type: "text" },
366
- charisma: { type: "text" },
367
- coercion: { type: "text" },
368
- competence: { type: "text" },
369
- compassion: { type: "text" },
370
- creativity: { type: "text" },
371
- courage: { type: "text" },
372
- level: { type: "text" },
373
- hit_points: { type: "text" },
374
- STR: { type: "text" },
375
- DEX: { type: "text" },
376
- CON: { type: "text" },
377
- INT: { type: "text" },
378
- WIS: { type: "text" },
379
- CHA: { type: "text" },
380
- // Link fields
381
- birthplace: { type: "single_link", target: "location" },
382
- location: { type: "single_link", target: "location" },
370
+ height: { type: "number" },
371
+ weight: { type: "number" },
383
372
  species: { type: "multi_link", target: "species" },
384
373
  traits: { type: "multi_link", target: "trait" },
385
374
  abilities: { type: "multi_link", target: "ability" },
375
+ // Origins
376
+ background: { type: "text" },
377
+ motivations: { type: "text" },
378
+ birth_date: { type: "number" },
379
+ birthplace: { type: "single_link", target: "location" },
386
380
  languages: { type: "multi_link", target: "language" },
381
+ // World
382
+ reputation: { type: "text" },
383
+ location: { type: "single_link", target: "location" },
387
384
  objects: { type: "multi_link", target: "object" },
388
385
  institutions: { type: "multi_link", target: "institution" },
386
+ // Personality
387
+ charisma: { type: "number" },
388
+ coercion: { type: "number" },
389
+ competence: { type: "number" },
390
+ compassion: { type: "number" },
391
+ creativity: { type: "number" },
392
+ courage: { type: "number" },
393
+ // Social
389
394
  family: { type: "multi_link", target: "family" },
390
395
  friends: { type: "multi_link", target: "character" },
391
- rivals: { type: "multi_link", target: "character" }
396
+ rivals: { type: "multi_link", target: "character" },
397
+ // TTRPG
398
+ level: { type: "number" },
399
+ hit_points: { type: "number" },
400
+ STR: { type: "number" },
401
+ DEX: { type: "number" },
402
+ CON: { type: "number" },
403
+ INT: { type: "number" },
404
+ WIS: { type: "number" },
405
+ CHA: { type: "number" }
392
406
  },
393
407
  collective: {
394
- // Text fields
408
+ // Base fields (shared by all elements)
409
+ name: { type: "text", required: true },
410
+ description: { type: "text", required: false },
411
+ supertype: { type: "text", required: false },
412
+ subtype: { type: "text", required: false },
413
+ image_url: { type: "text", required: false },
414
+ // Formation
395
415
  composition: { type: "text" },
396
- count: { type: "text" },
397
- formation_date: { type: "text" },
416
+ count: { type: "number" },
417
+ formation_date: { type: "number" },
418
+ operator: { type: "single_link", target: "institution" },
419
+ equipment: { type: "multi_link", target: "construct" },
420
+ // Dynamics
398
421
  activity: { type: "text" },
399
422
  disposition: { type: "text" },
400
423
  state: { type: "text" },
401
- // Link fields
402
- operator: { type: "single_link", target: "institution" },
403
- equipment: { type: "multi_link", target: "construct" },
404
424
  abilities: { type: "multi_link", target: "ability" },
405
425
  symbolism: { type: "multi_link", target: "construct" },
426
+ // World
406
427
  species: { type: "multi_link", target: "species" },
407
428
  characters: { type: "multi_link", target: "character" },
408
429
  creatures: { type: "multi_link", target: "creature" },
409
430
  phenomena: { type: "multi_link", target: "phenomenon" }
410
431
  },
411
432
  construct: {
412
- // Text fields
433
+ // Base fields (shared by all elements)
434
+ name: { type: "text", required: true },
435
+ description: { type: "text", required: false },
436
+ supertype: { type: "text", required: false },
437
+ subtype: { type: "text", required: false },
438
+ image_url: { type: "text", required: false },
439
+ // Nature
413
440
  rationale: { type: "text" },
414
441
  history: { type: "text" },
415
442
  status: { type: "text" },
416
443
  reach: { type: "text" },
417
- start_date: { type: "text" },
418
- end_date: { type: "text" },
419
- // Link fields
444
+ start_date: { type: "number" },
445
+ end_date: { type: "number" },
420
446
  founder: { type: "single_link", target: "character" },
421
447
  custodian: { type: "single_link", target: "institution" },
448
+ // Involves
422
449
  characters: { type: "multi_link", target: "character" },
423
450
  objects: { type: "multi_link", target: "object" },
424
451
  locations: { type: "multi_link", target: "location" },
@@ -439,36 +466,50 @@ var FIELD_SCHEMA = {
439
466
  narratives: { type: "multi_link", target: "narrative" }
440
467
  },
441
468
  creature: {
442
- // Text fields
469
+ // Base fields (shared by all elements)
470
+ name: { type: "text", required: true },
471
+ description: { type: "text", required: false },
472
+ supertype: { type: "text", required: false },
473
+ subtype: { type: "text", required: false },
474
+ image_url: { type: "text", required: false },
475
+ // Biology
443
476
  appearance: { type: "text" },
444
- weight: { type: "text" },
445
- height: { type: "text" },
477
+ weight: { type: "number" },
478
+ height: { type: "number" },
479
+ species: { type: "multi_link", target: "species" },
480
+ // Behaviour
446
481
  habits: { type: "text" },
447
482
  demeanor: { type: "text" },
448
- status: { type: "text" },
449
- birth_date: { type: "text" },
450
- challenge_rating: { type: "text" },
451
- hit_points: { type: "text" },
452
- armor_class: { type: "text" },
453
- speed: { type: "text" },
454
- // Link fields
455
- location: { type: "single_link", target: "location" },
456
- zone: { type: "single_link", target: "zone" },
457
- species: { type: "multi_link", target: "species" },
458
483
  traits: { type: "multi_link", target: "trait" },
459
484
  abilities: { type: "multi_link", target: "ability" },
460
485
  languages: { type: "multi_link", target: "language" },
486
+ // World
487
+ status: { type: "text" },
488
+ birth_date: { type: "number" },
489
+ location: { type: "single_link", target: "location" },
490
+ zone: { type: "single_link", target: "zone" },
491
+ // TTRPG
492
+ challenge_rating: { type: "number" },
493
+ hit_points: { type: "number" },
494
+ armor_class: { type: "number" },
495
+ speed: { type: "number" },
461
496
  actions: { type: "multi_link", target: "ability" }
462
497
  },
463
498
  event: {
464
- // Text fields
499
+ // Base fields (shared by all elements)
500
+ name: { type: "text", required: true },
501
+ description: { type: "text", required: false },
502
+ supertype: { type: "text", required: false },
503
+ subtype: { type: "text", required: false },
504
+ image_url: { type: "text", required: false },
505
+ // Nature
465
506
  history: { type: "text" },
466
507
  challenges: { type: "text" },
467
508
  consequences: { type: "text" },
468
- start_date: { type: "text" },
469
- end_date: { type: "text" },
470
- // Link fields
471
- triggers: { type: "multi_link", target: "event" },
509
+ start_date: { type: "number" },
510
+ end_date: { type: "number" },
511
+ triggers: { type: "multi_link", target: "construct" },
512
+ // Involves
472
513
  characters: { type: "multi_link", target: "character" },
473
514
  objects: { type: "multi_link", target: "object" },
474
515
  locations: { type: "multi_link", target: "location" },
@@ -487,56 +528,81 @@ var FIELD_SCHEMA = {
487
528
  constructs: { type: "multi_link", target: "construct" }
488
529
  },
489
530
  family: {
490
- // Text fields
531
+ // Base fields (shared by all elements)
532
+ name: { type: "text", required: true },
533
+ description: { type: "text", required: false },
534
+ supertype: { type: "text", required: false },
535
+ subtype: { type: "text", required: false },
536
+ image_url: { type: "text", required: false },
537
+ // Identity
491
538
  spirit: { type: "text" },
492
539
  history: { type: "text" },
493
- reputation: { type: "text" },
494
- // Link fields
495
540
  traditions: { type: "multi_link", target: "construct" },
496
541
  traits: { type: "multi_link", target: "trait" },
497
542
  abilities: { type: "multi_link", target: "ability" },
498
543
  languages: { type: "multi_link", target: "language" },
499
544
  ancestors: { type: "multi_link", target: "character" },
545
+ // World
546
+ reputation: { type: "text" },
500
547
  estates: { type: "multi_link", target: "location" },
501
548
  governs: { type: "multi_link", target: "institution" },
502
549
  heirlooms: { type: "multi_link", target: "object" },
503
550
  creatures: { type: "multi_link", target: "creature" }
504
551
  },
505
552
  institution: {
506
- // Text fields
553
+ // Base fields (shared by all elements)
554
+ name: { type: "text", required: true },
555
+ description: { type: "text", required: false },
556
+ supertype: { type: "text", required: false },
557
+ subtype: { type: "text", required: false },
558
+ image_url: { type: "text", required: false },
559
+ // Foundation
507
560
  doctrine: { type: "text" },
508
- founding_date: { type: "text" },
509
- status: { type: "text" },
510
- // Link fields
561
+ founding_date: { type: "number" },
511
562
  parent_institution: { type: "single_link", target: "institution" },
563
+ // Claims
512
564
  zones: { type: "multi_link", target: "zone" },
513
565
  objects: { type: "multi_link", target: "object" },
514
566
  creatures: { type: "multi_link", target: "creature" },
567
+ // World
568
+ status: { type: "text" },
515
569
  allies: { type: "multi_link", target: "institution" },
516
570
  adversaries: { type: "multi_link", target: "institution" },
517
571
  constructs: { type: "multi_link", target: "construct" }
518
572
  },
519
573
  language: {
520
- // Text fields
574
+ // Base fields (shared by all elements)
575
+ name: { type: "text", required: true },
576
+ description: { type: "text", required: false },
577
+ supertype: { type: "text", required: false },
578
+ subtype: { type: "text", required: false },
579
+ image_url: { type: "text", required: false },
580
+ // Structure
521
581
  phonology: { type: "text" },
522
582
  grammar: { type: "text" },
523
583
  lexicon: { type: "text" },
524
584
  writing: { type: "text" },
525
- status: { type: "text" },
526
- // Link fields
527
585
  classification: { type: "single_link", target: "construct" },
586
+ // World
587
+ status: { type: "text" },
528
588
  spread: { type: "multi_link", target: "location" },
529
589
  dialects: { type: "multi_link", target: "language" }
530
590
  },
531
591
  law: {
532
- // Text fields
592
+ // Base fields (shared by all elements)
593
+ name: { type: "text", required: true },
594
+ description: { type: "text", required: false },
595
+ supertype: { type: "text", required: false },
596
+ subtype: { type: "text", required: false },
597
+ image_url: { type: "text", required: false },
598
+ // Code
533
599
  declaration: { type: "text" },
534
600
  purpose: { type: "text" },
535
- date: { type: "text" },
536
- // Link fields
601
+ date: { type: "number" },
537
602
  parent_law: { type: "single_link", target: "law" },
538
- author: { type: "single_link", target: "institution" },
539
603
  penalties: { type: "multi_link", target: "construct" },
604
+ // World
605
+ author: { type: "single_link", target: "institution" },
540
606
  locations: { type: "multi_link", target: "location" },
541
607
  zones: { type: "multi_link", target: "zone" },
542
608
  prohibitions: { type: "multi_link", target: "construct" },
@@ -544,73 +610,100 @@ var FIELD_SCHEMA = {
544
610
  enforcers: { type: "multi_link", target: "title" }
545
611
  },
546
612
  location: {
547
- // Text fields
613
+ // Base fields (shared by all elements)
614
+ name: { type: "text", required: true },
615
+ description: { type: "text", required: false },
616
+ supertype: { type: "text", required: false },
617
+ subtype: { type: "text", required: false },
618
+ image_url: { type: "text", required: false },
619
+ // Setting
548
620
  form: { type: "text" },
549
621
  function: { type: "text" },
550
- founding_date: { type: "text" },
551
- political_climate: { type: "text" },
552
- customs: { type: "text" },
553
- infrastructure: { type: "text" },
554
- architecture: { type: "text" },
555
- defensibility: { type: "text" },
556
- elevation: { type: "text" },
557
- // Link fields
622
+ founding_date: { type: "number" },
558
623
  parent_location: { type: "single_link", target: "location" },
624
+ populations: { type: "multi_link", target: "collective" },
625
+ // Politics
626
+ political_climate: { type: "text" },
559
627
  primary_power: { type: "single_link", target: "institution" },
560
628
  governing_title: { type: "single_link", target: "title" },
629
+ secondary_powers: { type: "multi_link", target: "institution" },
561
630
  zone: { type: "single_link", target: "zone" },
562
631
  rival: { type: "single_link", target: "location" },
563
632
  partner: { type: "single_link", target: "location" },
564
- populations: { type: "multi_link", target: "collective" },
565
- secondary_powers: { type: "multi_link", target: "institution" },
633
+ // World
634
+ customs: { type: "text" },
566
635
  founders: { type: "multi_link", target: "character" },
567
636
  cults: { type: "multi_link", target: "construct" },
568
637
  delicacies: { type: "multi_link", target: "species" },
638
+ // Production
569
639
  extraction_methods: { type: "multi_link", target: "construct" },
570
640
  extraction_goods: { type: "multi_link", target: "construct" },
571
641
  industry_methods: { type: "multi_link", target: "construct" },
572
642
  industry_goods: { type: "multi_link", target: "construct" },
643
+ // Commerce
644
+ infrastructure: { type: "text" },
573
645
  extraction_markets: { type: "multi_link", target: "location" },
574
646
  industry_markets: { type: "multi_link", target: "location" },
575
647
  currencies: { type: "multi_link", target: "construct" },
648
+ // Construction
649
+ architecture: { type: "text" },
576
650
  buildings: { type: "multi_link", target: "object" },
577
651
  building_methods: { type: "multi_link", target: "construct" },
652
+ // Defense
653
+ defensibility: { type: "text" },
654
+ elevation: { type: "number" },
578
655
  fighters: { type: "multi_link", target: "construct" },
579
656
  defensive_objects: { type: "multi_link", target: "object" }
580
657
  },
581
658
  map: {
582
- // Text fields
659
+ // Base fields (shared by all elements)
660
+ name: { type: "text", required: true },
661
+ description: { type: "text", required: false },
662
+ supertype: { type: "text", required: false },
663
+ subtype: { type: "text", required: false },
664
+ image_url: { type: "text", required: false },
665
+ // Details
583
666
  background_color: { type: "text" },
584
- hierarchy: { type: "text" },
585
- width: { type: "text" },
586
- height: { type: "text" },
587
- depth: { type: "text" },
588
- // Link fields
667
+ hierarchy: { type: "number" },
668
+ width: { type: "number" },
669
+ height: { type: "number" },
670
+ depth: { type: "number" },
589
671
  parent_map: { type: "single_link", target: "map" },
590
672
  location: { type: "single_link", target: "location" }
591
673
  },
592
674
  marker: {
593
- // Integer fields
594
- x: { type: "integer" },
595
- y: { type: "integer" },
596
- z: { type: "integer" },
597
- // Link fields
675
+ // Base fields (shared by all elements)
676
+ name: { type: "text", required: true },
677
+ description: { type: "text", required: false },
678
+ supertype: { type: "text", required: false },
679
+ subtype: { type: "text", required: false },
680
+ image_url: { type: "text", required: false },
681
+ // Details
598
682
  map: { type: "single_link", target: "map" },
599
- zone: { type: "single_link", target: "zone" }
683
+ zone: { type: "single_link", target: "zone" },
684
+ x: { type: "number" },
685
+ y: { type: "number" },
686
+ z: { type: "number" }
600
687
  },
601
688
  narrative: {
602
- // Text fields
689
+ // Base fields (shared by all elements)
690
+ name: { type: "text", required: true },
691
+ description: { type: "text", required: false },
692
+ supertype: { type: "text", required: false },
693
+ subtype: { type: "text", required: false },
694
+ image_url: { type: "text", required: false },
695
+ // Context
603
696
  story: { type: "text" },
604
697
  consequences: { type: "text" },
605
- start_date: { type: "text" },
606
- end_date: { type: "text" },
607
- order: { type: "text" },
608
- // Link fields
698
+ start_date: { type: "number" },
699
+ end_date: { type: "number" },
700
+ order: { type: "number" },
609
701
  parent_narrative: { type: "single_link", target: "narrative" },
610
702
  protagonist: { type: "single_link", target: "character" },
611
703
  antagonist: { type: "single_link", target: "character" },
612
704
  narrator: { type: "single_link", target: "character" },
613
705
  conservator: { type: "single_link", target: "institution" },
706
+ // Involves
614
707
  events: { type: "multi_link", target: "event" },
615
708
  characters: { type: "multi_link", target: "character" },
616
709
  objects: { type: "multi_link", target: "object" },
@@ -631,58 +724,82 @@ var FIELD_SCHEMA = {
631
724
  laws: { type: "multi_link", target: "law" }
632
725
  },
633
726
  object: {
634
- // Text fields
727
+ // Base fields (shared by all elements)
728
+ name: { type: "text", required: true },
729
+ description: { type: "text", required: false },
730
+ supertype: { type: "text", required: false },
731
+ subtype: { type: "text", required: false },
732
+ image_url: { type: "text", required: false },
733
+ // Form
635
734
  aesthetics: { type: "text" },
636
- weight: { type: "text" },
637
- amount: { type: "text" },
638
- utility: { type: "text" },
639
- origins: { type: "text" },
640
- // Link fields
735
+ weight: { type: "number" },
736
+ amount: { type: "number" },
641
737
  parent_object: { type: "single_link", target: "object" },
642
- location: { type: "single_link", target: "location" },
643
- language: { type: "single_link", target: "language" },
644
738
  materials: { type: "multi_link", target: "construct" },
645
739
  technology: { type: "multi_link", target: "construct" },
740
+ // Function
741
+ utility: { type: "text" },
646
742
  effects: { type: "multi_link", target: "phenomenon" },
647
743
  abilities: { type: "multi_link", target: "ability" },
648
744
  consumes: { type: "multi_link", target: "construct" },
745
+ // World
746
+ origins: { type: "text" },
747
+ location: { type: "single_link", target: "location" },
748
+ language: { type: "single_link", target: "language" },
649
749
  affinities: { type: "multi_link", target: "trait" }
650
750
  },
651
751
  phenomenon: {
652
- // Text fields
752
+ // Base fields (shared by all elements)
753
+ name: { type: "text", required: true },
754
+ description: { type: "text", required: false },
755
+ supertype: { type: "text", required: false },
756
+ subtype: { type: "text", required: false },
757
+ image_url: { type: "text", required: false },
758
+ // Mechanics
653
759
  expression: { type: "text" },
654
760
  effects: { type: "text" },
655
- duration: { type: "text" },
656
- mythology: { type: "text" },
657
- // Link fields
658
- system: { type: "single_link", target: "phenomenon" },
761
+ duration: { type: "number" },
659
762
  catalysts: { type: "multi_link", target: "object" },
660
763
  empowerments: { type: "multi_link", target: "ability" },
764
+ // World
765
+ mythology: { type: "text" },
766
+ system: { type: "single_link", target: "phenomenon" },
661
767
  triggers: { type: "multi_link", target: "construct" },
662
768
  wielders: { type: "multi_link", target: "character" },
663
769
  environments: { type: "multi_link", target: "location" }
664
770
  },
665
771
  pin: {
666
- // Special fields
772
+ // Base fields (shared by all elements)
773
+ name: { type: "text", required: true },
774
+ description: { type: "text", required: false },
775
+ supertype: { type: "text", required: false },
776
+ subtype: { type: "text", required: false },
777
+ image_url: { type: "text", required: false },
778
+ // Details
779
+ map: { type: "single_link", target: "map" },
667
780
  element_type: { type: "text" },
668
781
  // ElementType enum value
669
- // Integer fields
670
- x: { type: "integer" },
671
- y: { type: "integer" },
672
- z: { type: "integer" },
673
- // Link fields
674
- map: { type: "single_link", target: "map" },
675
- element_id: { type: "single_link", target: "any" }
782
+ element_id: { type: "single_link", target: "any" },
676
783
  // Can reference any element
784
+ x: { type: "number" },
785
+ y: { type: "number" },
786
+ z: { type: "number" }
677
787
  },
678
788
  relation: {
679
- // Text fields
789
+ // Base fields (shared by all elements)
790
+ name: { type: "text", required: true },
791
+ description: { type: "text", required: false },
792
+ supertype: { type: "text", required: false },
793
+ subtype: { type: "text", required: false },
794
+ image_url: { type: "text", required: false },
795
+ // Nature
680
796
  background: { type: "text" },
681
- start_date: { type: "text" },
682
- end_date: { type: "text" },
683
- intensity: { type: "text" },
684
- // Link fields
797
+ start_date: { type: "number" },
798
+ end_date: { type: "number" },
799
+ intensity: { type: "number" },
685
800
  actor: { type: "single_link", target: "character" },
801
+ events: { type: "multi_link", target: "event" },
802
+ // Involves
686
803
  characters: { type: "multi_link", target: "character" },
687
804
  objects: { type: "multi_link", target: "object" },
688
805
  locations: { type: "multi_link", target: "location" },
@@ -696,46 +813,59 @@ var FIELD_SCHEMA = {
696
813
  phenomena: { type: "multi_link", target: "phenomenon" },
697
814
  languages: { type: "multi_link", target: "language" },
698
815
  families: { type: "multi_link", target: "family" },
816
+ relations: { type: "multi_link", target: "relation" },
699
817
  titles: { type: "multi_link", target: "title" },
700
818
  constructs: { type: "multi_link", target: "construct" },
701
- events: { type: "multi_link", target: "event" },
702
819
  narratives: { type: "multi_link", target: "narrative" }
703
820
  },
704
821
  species: {
705
- // Text fields
822
+ // Base fields (shared by all elements)
823
+ name: { type: "text", required: true },
824
+ description: { type: "text", required: false },
825
+ supertype: { type: "text", required: false },
826
+ subtype: { type: "text", required: false },
827
+ image_url: { type: "text", required: false },
828
+ // Biology
706
829
  appearance: { type: "text" },
707
- life_span: { type: "text" },
708
- weight: { type: "text" },
830
+ life_span: { type: "number" },
831
+ weight: { type: "number" },
832
+ nourishment: { type: "multi_link", target: "species" },
833
+ reproduction: { type: "multi_link", target: "construct" },
834
+ adaptations: { type: "multi_link", target: "ability" },
835
+ // Psychology
709
836
  instincts: { type: "text" },
710
837
  sociality: { type: "text" },
711
838
  temperament: { type: "text" },
712
839
  communication: { type: "text" },
713
- aggression: { type: "text" },
840
+ aggression: { type: "number" },
841
+ traits: { type: "multi_link", target: "trait" },
842
+ // World
714
843
  role: { type: "text" },
715
- // Link fields
716
844
  parent_species: { type: "single_link", target: "species" },
717
- nourishment: { type: "multi_link", target: "species" },
718
- reproduction: { type: "multi_link", target: "construct" },
719
- adaptations: { type: "multi_link", target: "ability" },
720
- traits: { type: "multi_link", target: "trait" },
721
845
  locations: { type: "multi_link", target: "location" },
722
846
  zones: { type: "multi_link", target: "zone" },
723
847
  affinities: { type: "multi_link", target: "phenomenon" }
724
848
  },
725
849
  title: {
726
- // Text fields
850
+ // Base fields (shared by all elements)
851
+ name: { type: "text", required: true },
852
+ description: { type: "text", required: false },
853
+ supertype: { type: "text", required: false },
854
+ subtype: { type: "text", required: false },
855
+ image_url: { type: "text", required: false },
856
+ // Mandate
727
857
  authority: { type: "text" },
728
858
  eligibility: { type: "text" },
729
- grant_date: { type: "text" },
730
- revoke_date: { type: "text" },
731
- status: { type: "text" },
732
- history: { type: "text" },
733
- // Link fields
859
+ grant_date: { type: "number" },
860
+ revoke_date: { type: "number" },
734
861
  issuer: { type: "single_link", target: "institution" },
735
862
  body: { type: "single_link", target: "institution" },
736
863
  superior_title: { type: "single_link", target: "title" },
737
864
  holders: { type: "multi_link", target: "character" },
738
865
  symbols: { type: "multi_link", target: "object" },
866
+ // World
867
+ status: { type: "text" },
868
+ history: { type: "text" },
739
869
  characters: { type: "multi_link", target: "character" },
740
870
  institutions: { type: "multi_link", target: "institution" },
741
871
  families: { type: "multi_link", target: "family" },
@@ -751,45 +881,50 @@ var FIELD_SCHEMA = {
751
881
  languages: { type: "multi_link", target: "language" }
752
882
  },
753
883
  trait: {
754
- // Text fields
884
+ // Base fields (shared by all elements)
885
+ name: { type: "text", required: true },
886
+ description: { type: "text", required: false },
887
+ supertype: { type: "text", required: false },
888
+ subtype: { type: "text", required: false },
889
+ image_url: { type: "text", required: false },
890
+ // Qualitative
755
891
  social_effects: { type: "text" },
756
892
  physical_effects: { type: "text" },
757
893
  functional_effects: { type: "text" },
758
894
  personality_effects: { type: "text" },
759
895
  behaviour_effects: { type: "text" },
760
- charisma: { type: "text" },
761
- coercion: { type: "text" },
762
- competence: { type: "text" },
763
- compassion: { type: "text" },
764
- creativity: { type: "text" },
765
- courage: { type: "text" },
896
+ // Quantitative
897
+ charisma: { type: "number" },
898
+ coercion: { type: "number" },
899
+ competence: { type: "number" },
900
+ compassion: { type: "number" },
901
+ creativity: { type: "number" },
902
+ courage: { type: "number" },
903
+ // World
766
904
  significance: { type: "text" },
767
- // Link fields
768
905
  anti_trait: { type: "single_link", target: "trait" },
769
906
  empowered_abilities: { type: "multi_link", target: "ability" }
770
907
  },
771
908
  zone: {
772
- // Text fields
909
+ // Base fields (shared by all elements)
910
+ name: { type: "text", required: true },
911
+ description: { type: "text", required: false },
912
+ supertype: { type: "text", required: false },
913
+ subtype: { type: "text", required: false },
914
+ image_url: { type: "text", required: false },
915
+ // Scope
773
916
  role: { type: "text" },
774
- start_date: { type: "text" },
775
- end_date: { type: "text" },
776
- context: { type: "text" },
777
- // Link fields
917
+ start_date: { type: "number" },
918
+ end_date: { type: "number" },
778
919
  phenomena: { type: "multi_link", target: "phenomenon" },
779
920
  linked_zones: { type: "multi_link", target: "zone" },
921
+ // World
922
+ context: { type: "text" },
780
923
  populations: { type: "multi_link", target: "collective" },
781
924
  titles: { type: "multi_link", target: "title" },
782
925
  principles: { type: "multi_link", target: "construct" }
783
926
  }
784
927
  };
785
- var FIELD_MAPPINGS = Object.fromEntries(
786
- Object.entries(FIELD_SCHEMA).map(([elementType, fields]) => [
787
- elementType,
788
- Object.fromEntries(
789
- Object.entries(fields).filter(([_, fieldInfo]) => ["single_link", "multi_link"].includes(fieldInfo.type)).map(([fieldName, fieldInfo]) => [fieldName, fieldInfo.target])
790
- )
791
- ])
792
- );
793
928
  function createElementId(id) {
794
929
  return id;
795
930
  }
@@ -802,11 +937,9 @@ function createAnyElementId(id) {
802
937
  export {
803
938
  ELEMENT_ICONS,
804
939
  ELEMENT_LABELS,
805
- ELEMENT_MATERIAL_ICONS,
806
940
  ELEMENT_SECTIONS,
807
941
  ELEMENT_UNICODE_ICONS,
808
942
  ElementType,
809
- FIELD_MAPPINGS,
810
943
  FIELD_SCHEMA,
811
944
  ONLYWORLDS_VERSION,
812
945
  OnlyWorldsClient,
@@ -815,7 +948,6 @@ export {
815
948
  createElementIds,
816
949
  getElementIcon,
817
950
  getElementLabel,
818
- getElementMaterialIcon,
819
951
  getElementSections,
820
952
  getElementUnicodeIcon
821
953
  };