@marimo-team/islands 0.18.5-dev178 → 0.18.5-dev179

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/main.js CHANGED
@@ -82003,7 +82003,7 @@ ${c}
82003
82003
  })), column_id_array = array$2(column_id.describe(FieldOptions.of({
82004
82004
  special: "column_id"
82005
82005
  }))).min(1, "At least one column is required").default([]).describe(FieldOptions.of({
82006
- label: "Group by columns",
82006
+ label: "Columns",
82007
82007
  minLength: 1
82008
82008
  }));
82009
82009
  var ColumnConversionTransformSchema = object$1({
@@ -82072,7 +82072,12 @@ ${c}
82072
82072
  ])
82073
82073
  }), GroupByTransformSchema = object$1({
82074
82074
  type: literal("group_by"),
82075
- column_ids: column_id_array,
82075
+ column_ids: array$2(column_id.describe(FieldOptions.of({
82076
+ special: "column_id"
82077
+ }))).default([]).describe(FieldOptions.of({
82078
+ label: "Group by columns",
82079
+ minLength: 1
82080
+ })),
82076
82081
  aggregation_column_ids: array$2(column_id.describe(FieldOptions.of({
82077
82082
  special: "column_id"
82078
82083
  }))).default([]).describe(FieldOptions.of({
@@ -82148,7 +82153,25 @@ ${c}
82148
82153
  }))
82149
82154
  }).describe(FieldOptions.of({
82150
82155
  direction: "row"
82151
- }))
82156
+ })),
82157
+ object$1({
82158
+ type: literal("pivot"),
82159
+ column_ids: column_id_array,
82160
+ index_column_ids: array$2(column_id.describe(FieldOptions.of({
82161
+ special: "column_id"
82162
+ }))).default([]).describe(FieldOptions.of({
82163
+ label: "Rows"
82164
+ })),
82165
+ value_column_ids: array$2(column_id.describe(FieldOptions.of({
82166
+ special: "column_id"
82167
+ }))).default([]).describe(FieldOptions.of({
82168
+ label: "Values",
82169
+ minLength: 1
82170
+ })),
82171
+ aggregation: _enum(AGGREGATION_FNS).default("sum").describe(FieldOptions.of({
82172
+ label: "Aggregation"
82173
+ }))
82174
+ }).describe(FieldOptions.of({}))
82152
82175
  ]), TransformationsSchema = object$1({
82153
82176
  transforms: array$2(TransformTypeSchema)
82154
82177
  });
@@ -85450,7 +85473,8 @@ ${c}
85450
85473
  sample_rows: Combine,
85451
85474
  explode_columns: Brackets,
85452
85475
  expand_dict: FileBraces,
85453
- unique: CopySlash
85476
+ unique: CopySlash,
85477
+ pivot: Table2
85454
85478
  };
85455
85479
  function _temp3$4(e) {
85456
85480
  e.stopPropagation(), window.open("https://github.com/marimo-team/marimo/issues/new?title=New%20dataframe%20transform:&labels=enhancement&template=feature_request.yaml", "_blank");
@@ -101025,7 +101049,7 @@ Defaulting to \`null\`.`;
101025
101049
  return Logger.warn("Failed to get version from mount config"), null;
101026
101050
  }
101027
101051
  }
101028
- const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.18.5-dev178"), showCodeInRunModeAtom = atom(true);
101052
+ const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.18.5-dev179"), showCodeInRunModeAtom = atom(true);
101029
101053
  atom(null);
101030
101054
  var VIRTUAL_FILE_REGEX = /\/@file\/([^\s"&'/]+)\.([\dA-Za-z]+)/g, VirtualFileTracker = class e {
101031
101055
  constructor() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/islands",
3
- "version": "0.18.5-dev178",
3
+ "version": "0.18.5-dev179",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -20,7 +20,7 @@ exports[`renderZodSchema > should render a form aggregate 1`] = `
20
20
  class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
21
21
  for="_r_26_-form-item"
22
22
  >
23
- Group by columns
23
+ Columns
24
24
  </label>
25
25
  <div
26
26
  aria-describedby="_r_26_-form-item-description"
@@ -39,7 +39,7 @@ exports[`renderZodSchema > should render a form aggregate 1`] = `
39
39
  <span
40
40
  class="truncate flex-1 min-w-0"
41
41
  >
42
- Select group by columns
42
+ Select columns
43
43
  </span>
44
44
  <svg
45
45
  aria-hidden="true"
@@ -392,7 +392,7 @@ exports[`renderZodSchema > should render a form explode_columns 1`] = `
392
392
  class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
393
393
  for="_r_2o_-form-item"
394
394
  >
395
- Group by columns
395
+ Columns
396
396
  </label>
397
397
  <div
398
398
  aria-describedby="_r_2o_-form-item-description"
@@ -411,7 +411,7 @@ exports[`renderZodSchema > should render a form explode_columns 1`] = `
411
411
  <span
412
412
  class="truncate flex-1 min-w-0"
413
413
  >
414
- Select group by columns
414
+ Select columns
415
415
  </span>
416
416
  <svg
417
417
  aria-hidden="true"
@@ -771,6 +771,233 @@ exports[`renderZodSchema > should render a form group_by 1`] = `
771
771
  </DocumentFragment>
772
772
  `;
773
773
 
774
+ exports[`renderZodSchema > should render a form pivot 1`] = `
775
+ <DocumentFragment>
776
+ <div
777
+ class="flex flex-col gap-6"
778
+ >
779
+ <input
780
+ name="type"
781
+ type="hidden"
782
+ value="pivot"
783
+ />
784
+ <div
785
+ class="flex flex-row align-start"
786
+ >
787
+ <div
788
+ class="flex flex-col gap-1"
789
+ >
790
+ <label
791
+ class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
792
+ for="_r_3a_-form-item"
793
+ >
794
+ Columns
795
+ </label>
796
+ <div
797
+ aria-describedby="_r_3a_-form-item-description"
798
+ aria-invalid="false"
799
+ class="relative"
800
+ id="_r_3a_-form-item"
801
+ >
802
+ <div
803
+ aria-controls="radix-_r_3b_"
804
+ aria-expanded="false"
805
+ aria-haspopup="dialog"
806
+ class="flex h-6 w-fit mb-1 shadow-xs-solid items-center justify-between rounded-sm border border-input bg-transparent px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground hover:shadow-sm-solid focus:outline-hidden focus:ring-1 focus:ring-ring focus:border-primary focus:shadow-md-solid disabled:cursor-not-allowed disabled:opacity-50 min-w-[180px]"
807
+ data-state="closed"
808
+ type="button"
809
+ >
810
+ <span
811
+ class="truncate flex-1 min-w-0"
812
+ >
813
+ Select columns
814
+ </span>
815
+ <svg
816
+ aria-hidden="true"
817
+ class="lucide lucide-chevron-down ml-3 w-4 h-4 opacity-50 shrink-0"
818
+ fill="none"
819
+ height="24"
820
+ stroke="currentColor"
821
+ stroke-linecap="round"
822
+ stroke-linejoin="round"
823
+ stroke-width="2"
824
+ viewBox="0 0 24 24"
825
+ width="24"
826
+ xmlns="http://www.w3.org/2000/svg"
827
+ >
828
+ <path
829
+ d="m6 9 6 6 6-6"
830
+ />
831
+ </svg>
832
+ </div>
833
+ <div
834
+ class="flex flex-col gap-1 items-start"
835
+ />
836
+ </div>
837
+ </div>
838
+ </div>
839
+ <div
840
+ class="flex flex-row align-start"
841
+ >
842
+ <div
843
+ class="flex flex-col gap-1"
844
+ >
845
+ <label
846
+ class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
847
+ for="_r_3c_-form-item"
848
+ >
849
+ Rows
850
+ </label>
851
+ <div
852
+ aria-describedby="_r_3c_-form-item-description"
853
+ aria-invalid="false"
854
+ class="relative"
855
+ id="_r_3c_-form-item"
856
+ >
857
+ <div
858
+ aria-controls="radix-_r_3d_"
859
+ aria-expanded="false"
860
+ aria-haspopup="dialog"
861
+ class="flex h-6 w-fit mb-1 shadow-xs-solid items-center justify-between rounded-sm border border-input bg-transparent px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground hover:shadow-sm-solid focus:outline-hidden focus:ring-1 focus:ring-ring focus:border-primary focus:shadow-md-solid disabled:cursor-not-allowed disabled:opacity-50 min-w-[180px]"
862
+ data-state="closed"
863
+ type="button"
864
+ >
865
+ <span
866
+ class="truncate flex-1 min-w-0"
867
+ >
868
+ Select rows
869
+ </span>
870
+ <svg
871
+ aria-hidden="true"
872
+ class="lucide lucide-chevron-down ml-3 w-4 h-4 opacity-50 shrink-0"
873
+ fill="none"
874
+ height="24"
875
+ stroke="currentColor"
876
+ stroke-linecap="round"
877
+ stroke-linejoin="round"
878
+ stroke-width="2"
879
+ viewBox="0 0 24 24"
880
+ width="24"
881
+ xmlns="http://www.w3.org/2000/svg"
882
+ >
883
+ <path
884
+ d="m6 9 6 6 6-6"
885
+ />
886
+ </svg>
887
+ </div>
888
+ <div
889
+ class="flex flex-col gap-1 items-start"
890
+ />
891
+ </div>
892
+ </div>
893
+ </div>
894
+ <div
895
+ class="flex flex-row align-start"
896
+ >
897
+ <div
898
+ class="flex flex-col gap-1"
899
+ >
900
+ <label
901
+ class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
902
+ for="_r_3e_-form-item"
903
+ >
904
+ Values
905
+ </label>
906
+ <div
907
+ aria-describedby="_r_3e_-form-item-description"
908
+ aria-invalid="false"
909
+ class="relative"
910
+ id="_r_3e_-form-item"
911
+ >
912
+ <div
913
+ aria-controls="radix-_r_3f_"
914
+ aria-expanded="false"
915
+ aria-haspopup="dialog"
916
+ class="flex h-6 w-fit mb-1 shadow-xs-solid items-center justify-between rounded-sm border border-input bg-transparent px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground hover:shadow-sm-solid focus:outline-hidden focus:ring-1 focus:ring-ring focus:border-primary focus:shadow-md-solid disabled:cursor-not-allowed disabled:opacity-50 min-w-[180px]"
917
+ data-state="closed"
918
+ type="button"
919
+ >
920
+ <span
921
+ class="truncate flex-1 min-w-0"
922
+ >
923
+ Select values
924
+ </span>
925
+ <svg
926
+ aria-hidden="true"
927
+ class="lucide lucide-chevron-down ml-3 w-4 h-4 opacity-50 shrink-0"
928
+ fill="none"
929
+ height="24"
930
+ stroke="currentColor"
931
+ stroke-linecap="round"
932
+ stroke-linejoin="round"
933
+ stroke-width="2"
934
+ viewBox="0 0 24 24"
935
+ width="24"
936
+ xmlns="http://www.w3.org/2000/svg"
937
+ >
938
+ <path
939
+ d="m6 9 6 6 6-6"
940
+ />
941
+ </svg>
942
+ </div>
943
+ <div
944
+ class="flex flex-col gap-1 items-start"
945
+ />
946
+ </div>
947
+ </div>
948
+ </div>
949
+ <div
950
+ class="flex flex-row align-start"
951
+ >
952
+ <div
953
+ class="flex flex-col gap-1"
954
+ >
955
+ <label
956
+ class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 whitespace-pre"
957
+ for="_r_3g_-form-item"
958
+ >
959
+ Aggregation
960
+ </label>
961
+ <button
962
+ aria-autocomplete="none"
963
+ aria-controls="radix-_r_3h_"
964
+ aria-expanded="false"
965
+ class="flex h-6 w-fit items-center justify-between rounded-sm bg-background px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer shadow-xs-solid border border-input hover:shadow-sm-solid focus:border-primary focus:shadow-md-solid disabled:hover:shadow-xs-solid mb-0 min-w-[180px]"
966
+ data-placeholder=""
967
+ data-state="closed"
968
+ dir="ltr"
969
+ role="combobox"
970
+ type="button"
971
+ >
972
+ <span
973
+ style="pointer-events: none;"
974
+ >
975
+ --
976
+ </span>
977
+ <svg
978
+ aria-hidden="true"
979
+ class="lucide lucide-chevron-down h-4 w-4 opacity-50"
980
+ fill="none"
981
+ height="24"
982
+ stroke="currentColor"
983
+ stroke-linecap="round"
984
+ stroke-linejoin="round"
985
+ stroke-width="2"
986
+ viewBox="0 0 24 24"
987
+ width="24"
988
+ xmlns="http://www.w3.org/2000/svg"
989
+ >
990
+ <path
991
+ d="m6 9 6 6 6-6"
992
+ />
993
+ </svg>
994
+ </button>
995
+ </div>
996
+ </div>
997
+ </div>
998
+ </DocumentFragment>
999
+ `;
1000
+
774
1001
  exports[`renderZodSchema > should render a form rename_column 1`] = `
775
1002
  <DocumentFragment>
776
1003
  <div
@@ -1064,7 +1291,7 @@ exports[`renderZodSchema > should render a form select_columns 1`] = `
1064
1291
  class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
1065
1292
  for="_r_3_-form-item"
1066
1293
  >
1067
- Group by columns
1294
+ Columns
1068
1295
  </label>
1069
1296
  <div
1070
1297
  aria-describedby="_r_3_-form-item-description"
@@ -1083,7 +1310,7 @@ exports[`renderZodSchema > should render a form select_columns 1`] = `
1083
1310
  <span
1084
1311
  class="truncate flex-1 min-w-0"
1085
1312
  >
1086
- Select group by columns
1313
+ Select columns
1087
1314
  </span>
1088
1315
  <svg
1089
1316
  aria-hidden="true"
@@ -1347,7 +1574,7 @@ exports[`renderZodSchema > should render a form unique 1`] = `
1347
1574
  class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
1348
1575
  for="_r_31_-form-item"
1349
1576
  >
1350
- Group by columns
1577
+ Columns
1351
1578
  </label>
1352
1579
  <div
1353
1580
  aria-describedby="_r_31_-form-item-description"
@@ -1366,7 +1593,7 @@ exports[`renderZodSchema > should render a form unique 1`] = `
1366
1593
  <span
1367
1594
  class="truncate flex-1 min-w-0"
1368
1595
  >
1369
- Select group by columns
1596
+ Select columns
1370
1597
  </span>
1371
1598
  <svg
1372
1599
  aria-hidden="true"
@@ -1451,7 +1678,7 @@ exports[`renders custom forms column_id 1`] = `
1451
1678
  >
1452
1679
  <label
1453
1680
  class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
1454
- for="_r_3a_-form-item"
1681
+ for="_r_3p_-form-item"
1455
1682
  >
1456
1683
  Column
1457
1684
  </label>
@@ -1460,7 +1687,7 @@ exports[`renders custom forms column_id 1`] = `
1460
1687
  >
1461
1688
  <button
1462
1689
  aria-autocomplete="none"
1463
- aria-controls="radix-_r_3b_"
1690
+ aria-controls="radix-_r_3q_"
1464
1691
  aria-expanded="false"
1465
1692
  class="flex h-6 w-fit items-center justify-between rounded-sm bg-background px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer shadow-xs-solid border border-input hover:shadow-sm-solid focus:border-primary focus:shadow-md-solid disabled:hover:shadow-xs-solid mb-0 min-w-[180px]"
1466
1693
  data-placeholder=""
@@ -1504,18 +1731,18 @@ exports[`renders custom forms column_id_array 1`] = `
1504
1731
  >
1505
1732
  <label
1506
1733
  class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
1507
- for="_r_3h_-form-item"
1734
+ for="_r_40_-form-item"
1508
1735
  >
1509
- Group by columns
1736
+ Columns
1510
1737
  </label>
1511
1738
  <div
1512
- aria-describedby="_r_3h_-form-item-description"
1739
+ aria-describedby="_r_40_-form-item-description"
1513
1740
  aria-invalid="false"
1514
1741
  class="relative"
1515
- id="_r_3h_-form-item"
1742
+ id="_r_40_-form-item"
1516
1743
  >
1517
1744
  <div
1518
- aria-controls="radix-_r_3i_"
1745
+ aria-controls="radix-_r_41_"
1519
1746
  aria-expanded="false"
1520
1747
  aria-haspopup="dialog"
1521
1748
  class="flex h-6 w-fit mb-1 shadow-xs-solid items-center justify-between rounded-sm border border-input bg-transparent px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground hover:shadow-sm-solid focus:outline-hidden focus:ring-1 focus:ring-ring focus:border-primary focus:shadow-md-solid disabled:cursor-not-allowed disabled:opacity-50 min-w-[180px]"
@@ -1525,7 +1752,7 @@ exports[`renders custom forms column_id_array 1`] = `
1525
1752
  <span
1526
1753
  class="truncate flex-1 min-w-0"
1527
1754
  >
1528
- Select group by columns
1755
+ Select columns
1529
1756
  </span>
1530
1757
  <svg
1531
1758
  aria-hidden="true"
@@ -1559,13 +1786,13 @@ exports[`renders custom forms column_id_dot_array 1`] = `
1559
1786
  class="flex flex-col gap-1"
1560
1787
  >
1561
1788
  <div
1562
- aria-describedby="_r_3j_-form-item-description"
1789
+ aria-describedby="_r_42_-form-item-description"
1563
1790
  aria-invalid="false"
1564
1791
  class="relative"
1565
- id="_r_3j_-form-item"
1792
+ id="_r_42_-form-item"
1566
1793
  >
1567
1794
  <div
1568
- aria-controls="radix-_r_3k_"
1795
+ aria-controls="radix-_r_43_"
1569
1796
  aria-expanded="false"
1570
1797
  aria-haspopup="dialog"
1571
1798
  class="flex h-6 w-fit mb-1 shadow-xs-solid items-center justify-between rounded-sm border border-input bg-transparent px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground hover:shadow-sm-solid focus:outline-hidden focus:ring-1 focus:ring-ring focus:border-primary focus:shadow-md-solid disabled:cursor-not-allowed disabled:opacity-50 min-w-[180px]"
@@ -1610,7 +1837,7 @@ exports[`renders custom forms column_id_optional 1`] = `
1610
1837
  >
1611
1838
  <label
1612
1839
  class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
1613
- for="_r_3l_-form-item"
1840
+ for="_r_44_-form-item"
1614
1841
  >
1615
1842
  Column
1616
1843
  </label>
@@ -1619,7 +1846,7 @@ exports[`renders custom forms column_id_optional 1`] = `
1619
1846
  >
1620
1847
  <button
1621
1848
  aria-autocomplete="none"
1622
- aria-controls="radix-_r_3m_"
1849
+ aria-controls="radix-_r_45_"
1623
1850
  aria-expanded="false"
1624
1851
  class="flex h-6 w-fit items-center justify-between rounded-sm bg-background px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer shadow-xs-solid border border-input hover:shadow-sm-solid focus:border-primary focus:shadow-md-solid disabled:hover:shadow-xs-solid mb-0 min-w-[180px]"
1625
1852
  data-placeholder=""
@@ -17,6 +17,7 @@ import {
17
17
  PlusIcon,
18
18
  ShuffleIcon,
19
19
  SquareMousePointerIcon,
20
+ Table2Icon,
20
21
  Trash2Icon,
21
22
  } from "lucide-react";
22
23
  import React, {
@@ -394,4 +395,5 @@ const ICONS: Record<TransformType["type"], React.FC<{ className?: string }>> = {
394
395
  explode_columns: BracketsIcon,
395
396
  expand_dict: FileJsonIcon,
396
397
  unique: CopySlashIcon,
398
+ pivot: Table2Icon,
397
399
  };
@@ -29,7 +29,7 @@ export const column_id_array = z
29
29
  .array(column_id.describe(FieldOptions.of({ special: "column_id" })))
30
30
  .min(1, "At least one column is required")
31
31
  .default([])
32
- .describe(FieldOptions.of({ label: "Group by columns", minLength: 1 }));
32
+ .describe(FieldOptions.of({ label: "Columns", minLength: 1 }));
33
33
 
34
34
  const ColumnConversionTransformSchema = z
35
35
  .object({
@@ -107,7 +107,10 @@ const FilterRowsTransformSchema = z.object({
107
107
  const GroupByTransformSchema = z
108
108
  .object({
109
109
  type: z.literal("group_by"),
110
- column_ids: column_id_array,
110
+ column_ids: z
111
+ .array(column_id.describe(FieldOptions.of({ special: "column_id" })))
112
+ .default([])
113
+ .describe(FieldOptions.of({ label: "Group by columns", minLength: 1 })),
111
114
  aggregation_column_ids: z
112
115
  .array(column_id.describe(FieldOptions.of({ special: "column_id" })))
113
116
  .default([])
@@ -193,6 +196,25 @@ const UniqueTransformSchema = z
193
196
  })
194
197
  .describe(FieldOptions.of({ direction: "row" }));
195
198
 
199
+ const PivotTransformSchema = z
200
+ .object({
201
+ type: z.literal("pivot"),
202
+ column_ids: column_id_array,
203
+ index_column_ids: z
204
+ .array(column_id.describe(FieldOptions.of({ special: "column_id" })))
205
+ .default([])
206
+ .describe(FieldOptions.of({ label: "Rows" })),
207
+ value_column_ids: z
208
+ .array(column_id.describe(FieldOptions.of({ special: "column_id" })))
209
+ .default([])
210
+ .describe(FieldOptions.of({ label: "Values", minLength: 1 })),
211
+ aggregation: z
212
+ .enum(AGGREGATION_FNS)
213
+ .default("sum")
214
+ .describe(FieldOptions.of({ label: "Aggregation" })),
215
+ })
216
+ .describe(FieldOptions.of({}));
217
+
196
218
  export const TransformTypeSchema = z.union([
197
219
  FilterRowsTransformSchema,
198
220
  SelectColumnsTransformSchema,
@@ -206,6 +228,7 @@ export const TransformTypeSchema = z.union([
206
228
  ExplodeColumnsTransformSchema,
207
229
  ExpandDictTransformSchema,
208
230
  UniqueTransformSchema,
231
+ PivotTransformSchema,
209
232
  ]);
210
233
 
211
234
  export type TransformType = z.infer<typeof TransformTypeSchema>;