@commmerce/ui 1.16.0 → 1.17.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.
- package/dist/cdn.js +752 -577
- package/dist/color-source.d.ts +51 -0
- package/dist/color-source.js +73 -0
- package/dist/color.d.ts +60 -0
- package/dist/color.js +205 -0
- package/dist/components/color-field.d.ts +70 -13
- package/dist/components/color-field.js +170 -36
- package/dist/components/color-picker.d.ts +179 -0
- package/dist/components/color-picker.js +648 -0
- package/dist/custom-elements.json +1320 -24
- package/dist/index.d.ts +6 -2
- package/dist/index.js +4 -1
- package/package.json +3 -3
|
@@ -9643,24 +9643,6 @@
|
|
|
9643
9643
|
"kind": "javascript-module",
|
|
9644
9644
|
"path": "src/components/color-field.ts",
|
|
9645
9645
|
"declarations": [
|
|
9646
|
-
{
|
|
9647
|
-
"kind": "function",
|
|
9648
|
-
"name": "normalizeHex",
|
|
9649
|
-
"return": {
|
|
9650
|
-
"type": {
|
|
9651
|
-
"text": "string | null"
|
|
9652
|
-
}
|
|
9653
|
-
},
|
|
9654
|
-
"parameters": [
|
|
9655
|
-
{
|
|
9656
|
-
"name": "text",
|
|
9657
|
-
"type": {
|
|
9658
|
-
"text": "string"
|
|
9659
|
-
}
|
|
9660
|
-
}
|
|
9661
|
-
],
|
|
9662
|
-
"description": "`#RGB`, `RRGGBB`, `#RRGGBB` (any case, spaces around) -> `#rrggbb`; anything else -> null."
|
|
9663
|
-
},
|
|
9664
9646
|
{
|
|
9665
9647
|
"kind": "function",
|
|
9666
9648
|
"name": "checkColor",
|
|
@@ -9681,7 +9663,7 @@
|
|
|
9681
9663
|
},
|
|
9682
9664
|
{
|
|
9683
9665
|
"kind": "class",
|
|
9684
|
-
"description": "Colour field: a palette of swatches, a hex box and, optionally, the browser's
|
|
9666
|
+
"description": "Colour field: a palette of swatches, a hex box and, optionally, a colour picker (`picker`): the cm-color-picker\npanel with the store's brand colours, recent colours, opacity, formats and gradients, or the browser's own\n(`picker=\"native\"`). For colours that mean something to the merchant, such as the colour of each lead status.\nThe value is lowercase `#rrggbb` unless you allow more with `formats`, `alpha` or `gradient`.\nParticipates in native forms.",
|
|
9685
9667
|
"name": "CmColorField",
|
|
9686
9668
|
"cssParts": [
|
|
9687
9669
|
{
|
|
@@ -9802,12 +9784,96 @@
|
|
|
9802
9784
|
"kind": "field",
|
|
9803
9785
|
"name": "picker",
|
|
9804
9786
|
"privacy": "public",
|
|
9787
|
+
"type": {
|
|
9788
|
+
"text": "boolean | 'native'"
|
|
9789
|
+
},
|
|
9790
|
+
"default": "false",
|
|
9791
|
+
"description": "Adds a button that opens a colour picker for colours outside the palette: the Commmerce picker panel (since\n1.17.0), or the browser's own with `picker=\"native\"`.",
|
|
9792
|
+
"attribute": "picker",
|
|
9793
|
+
"reflects": true
|
|
9794
|
+
},
|
|
9795
|
+
{
|
|
9796
|
+
"kind": "field",
|
|
9797
|
+
"name": "alpha",
|
|
9798
|
+
"privacy": "public",
|
|
9799
|
+
"type": {
|
|
9800
|
+
"text": "boolean"
|
|
9801
|
+
},
|
|
9802
|
+
"default": "false",
|
|
9803
|
+
"description": "Allows see-through colours: the picker shows opacity; the value may be `#rrggbbaa`, `rgba()` or `hsla()`.",
|
|
9804
|
+
"attribute": "alpha"
|
|
9805
|
+
},
|
|
9806
|
+
{
|
|
9807
|
+
"kind": "field",
|
|
9808
|
+
"name": "gradient",
|
|
9809
|
+
"privacy": "public",
|
|
9810
|
+
"type": {
|
|
9811
|
+
"text": "boolean"
|
|
9812
|
+
},
|
|
9813
|
+
"default": "false",
|
|
9814
|
+
"description": "Allows linear and radial gradients from the picker; the value may then be a CSS gradient.",
|
|
9815
|
+
"attribute": "gradient"
|
|
9816
|
+
},
|
|
9817
|
+
{
|
|
9818
|
+
"kind": "field",
|
|
9819
|
+
"name": "formats",
|
|
9820
|
+
"privacy": "public",
|
|
9821
|
+
"type": {
|
|
9822
|
+
"text": "string"
|
|
9823
|
+
},
|
|
9824
|
+
"default": "'hex'",
|
|
9825
|
+
"description": "Formats the merchant may pick in the picker, space separated: `hex`, `rgb`, `hsl`. Default `hex` only, so the\nvalue stays `#rrggbb`. With more, the value is written in the format they chose.",
|
|
9826
|
+
"attribute": "formats"
|
|
9827
|
+
},
|
|
9828
|
+
{
|
|
9829
|
+
"kind": "field",
|
|
9830
|
+
"name": "brandColors",
|
|
9831
|
+
"privacy": "public",
|
|
9832
|
+
"type": {
|
|
9833
|
+
"text": "Array<string | ColorSwatch> | undefined"
|
|
9834
|
+
},
|
|
9835
|
+
"description": "The store's brand colours, shown first in the picker. In HTML, pass JSON. Wins over `source`.",
|
|
9836
|
+
"attribute": "brand-colors"
|
|
9837
|
+
},
|
|
9838
|
+
{
|
|
9839
|
+
"kind": "field",
|
|
9840
|
+
"name": "recentColors",
|
|
9841
|
+
"privacy": "public",
|
|
9842
|
+
"type": {
|
|
9843
|
+
"text": "string[] | undefined"
|
|
9844
|
+
},
|
|
9845
|
+
"description": "Recent colours for the picker, newest first. Wins over `source`.",
|
|
9846
|
+
"attribute": "recent-colors"
|
|
9847
|
+
},
|
|
9848
|
+
{
|
|
9849
|
+
"kind": "field",
|
|
9850
|
+
"name": "source",
|
|
9851
|
+
"privacy": "public",
|
|
9852
|
+
"type": {
|
|
9853
|
+
"text": "ColorSource | undefined"
|
|
9854
|
+
},
|
|
9855
|
+
"description": "Where the picker gets brand and recent colours: `app.colors` (App Bridge), `httpColorSource()` or your own."
|
|
9856
|
+
},
|
|
9857
|
+
{
|
|
9858
|
+
"kind": "field",
|
|
9859
|
+
"name": "recentKey",
|
|
9860
|
+
"privacy": "public",
|
|
9861
|
+
"type": {
|
|
9862
|
+
"text": "string"
|
|
9863
|
+
},
|
|
9864
|
+
"default": "''",
|
|
9865
|
+
"description": "Keeps recent colours in this browser under this key when there is no `source`.",
|
|
9866
|
+
"attribute": "recent-key"
|
|
9867
|
+
},
|
|
9868
|
+
{
|
|
9869
|
+
"kind": "field",
|
|
9870
|
+
"name": "_open",
|
|
9871
|
+
"privacy": "public",
|
|
9805
9872
|
"type": {
|
|
9806
9873
|
"text": "boolean"
|
|
9807
9874
|
},
|
|
9808
9875
|
"default": "false",
|
|
9809
|
-
"
|
|
9810
|
-
"attribute": "picker"
|
|
9876
|
+
"attribute": "_open"
|
|
9811
9877
|
},
|
|
9812
9878
|
{
|
|
9813
9879
|
"kind": "field",
|
|
@@ -9859,6 +9925,12 @@
|
|
|
9859
9925
|
"name": "#internals",
|
|
9860
9926
|
"privacy": "private"
|
|
9861
9927
|
},
|
|
9928
|
+
{
|
|
9929
|
+
"kind": "field",
|
|
9930
|
+
"name": "#layer",
|
|
9931
|
+
"privacy": "private",
|
|
9932
|
+
"default": "new TopLayer()"
|
|
9933
|
+
},
|
|
9862
9934
|
{
|
|
9863
9935
|
"kind": "field",
|
|
9864
9936
|
"name": "#v",
|
|
@@ -9888,6 +9960,46 @@
|
|
|
9888
9960
|
},
|
|
9889
9961
|
"description": "The value this element set itself from the hex box; any other new value replaces the box's text."
|
|
9890
9962
|
},
|
|
9963
|
+
{
|
|
9964
|
+
"kind": "field",
|
|
9965
|
+
"name": "#wide",
|
|
9966
|
+
"privacy": "private",
|
|
9967
|
+
"description": "Takes more than `#rrggbb` (other formats, opacity or gradients).",
|
|
9968
|
+
"readonly": true
|
|
9969
|
+
},
|
|
9970
|
+
{
|
|
9971
|
+
"kind": "method",
|
|
9972
|
+
"name": "#normalize",
|
|
9973
|
+
"privacy": "private",
|
|
9974
|
+
"return": {
|
|
9975
|
+
"type": {
|
|
9976
|
+
"text": "string | null"
|
|
9977
|
+
}
|
|
9978
|
+
},
|
|
9979
|
+
"parameters": [
|
|
9980
|
+
{
|
|
9981
|
+
"name": "text",
|
|
9982
|
+
"type": {
|
|
9983
|
+
"text": "string"
|
|
9984
|
+
}
|
|
9985
|
+
}
|
|
9986
|
+
],
|
|
9987
|
+
"description": "The value as stored: hex normalised; in wide mode any colour or gradient as written. Null if it isn't one."
|
|
9988
|
+
},
|
|
9989
|
+
{
|
|
9990
|
+
"kind": "method",
|
|
9991
|
+
"name": "show",
|
|
9992
|
+
"description": "Opens or closes the picker panel."
|
|
9993
|
+
},
|
|
9994
|
+
{
|
|
9995
|
+
"kind": "method",
|
|
9996
|
+
"name": "close"
|
|
9997
|
+
},
|
|
9998
|
+
{
|
|
9999
|
+
"kind": "field",
|
|
10000
|
+
"name": "#onOutside",
|
|
10001
|
+
"privacy": "private"
|
|
10002
|
+
},
|
|
9891
10003
|
{
|
|
9892
10004
|
"kind": "field",
|
|
9893
10005
|
"name": "form",
|
|
@@ -10063,6 +10175,55 @@
|
|
|
10063
10175
|
}
|
|
10064
10176
|
]
|
|
10065
10177
|
},
|
|
10178
|
+
{
|
|
10179
|
+
"kind": "method",
|
|
10180
|
+
"name": "#onPanelInput",
|
|
10181
|
+
"privacy": "private",
|
|
10182
|
+
"parameters": [
|
|
10183
|
+
{
|
|
10184
|
+
"name": "e",
|
|
10185
|
+
"type": {
|
|
10186
|
+
"text": "Event"
|
|
10187
|
+
}
|
|
10188
|
+
}
|
|
10189
|
+
]
|
|
10190
|
+
},
|
|
10191
|
+
{
|
|
10192
|
+
"kind": "method",
|
|
10193
|
+
"name": "#onPanelChange",
|
|
10194
|
+
"privacy": "private",
|
|
10195
|
+
"parameters": [
|
|
10196
|
+
{
|
|
10197
|
+
"name": "e",
|
|
10198
|
+
"type": {
|
|
10199
|
+
"text": "Event"
|
|
10200
|
+
}
|
|
10201
|
+
}
|
|
10202
|
+
]
|
|
10203
|
+
},
|
|
10204
|
+
{
|
|
10205
|
+
"kind": "method",
|
|
10206
|
+
"name": "#onPopKey",
|
|
10207
|
+
"privacy": "private",
|
|
10208
|
+
"parameters": [
|
|
10209
|
+
{
|
|
10210
|
+
"name": "e",
|
|
10211
|
+
"type": {
|
|
10212
|
+
"text": "KeyboardEvent"
|
|
10213
|
+
}
|
|
10214
|
+
}
|
|
10215
|
+
]
|
|
10216
|
+
},
|
|
10217
|
+
{
|
|
10218
|
+
"kind": "method",
|
|
10219
|
+
"name": "#formatOf",
|
|
10220
|
+
"privacy": "private",
|
|
10221
|
+
"return": {
|
|
10222
|
+
"type": {
|
|
10223
|
+
"text": "ColorFormat"
|
|
10224
|
+
}
|
|
10225
|
+
}
|
|
10226
|
+
},
|
|
10066
10227
|
{
|
|
10067
10228
|
"kind": "method",
|
|
10068
10229
|
"name": "finalize",
|
|
@@ -10174,6 +10335,10 @@
|
|
|
10174
10335
|
{
|
|
10175
10336
|
"description": "When the colour is committed: a swatch picked, the hex box left or Enter pressed, the picker closed.",
|
|
10176
10337
|
"name": "change"
|
|
10338
|
+
},
|
|
10339
|
+
{
|
|
10340
|
+
"description": "From the picker panel: `detail.colors`, the new recent list.",
|
|
10341
|
+
"name": "cm-recent-change"
|
|
10177
10342
|
}
|
|
10178
10343
|
],
|
|
10179
10344
|
"attributes": [
|
|
@@ -10242,12 +10407,72 @@
|
|
|
10242
10407
|
{
|
|
10243
10408
|
"name": "picker",
|
|
10244
10409
|
"type": {
|
|
10245
|
-
"text": "boolean"
|
|
10410
|
+
"text": "boolean | 'native'"
|
|
10246
10411
|
},
|
|
10247
10412
|
"default": "false",
|
|
10248
|
-
"description": "Adds a button that opens
|
|
10413
|
+
"description": "Adds a button that opens a colour picker for colours outside the palette: the Commmerce picker panel (since\n1.17.0), or the browser's own with `picker=\"native\"`.",
|
|
10249
10414
|
"fieldName": "picker"
|
|
10250
10415
|
},
|
|
10416
|
+
{
|
|
10417
|
+
"name": "alpha",
|
|
10418
|
+
"type": {
|
|
10419
|
+
"text": "boolean"
|
|
10420
|
+
},
|
|
10421
|
+
"default": "false",
|
|
10422
|
+
"description": "Allows see-through colours: the picker shows opacity; the value may be `#rrggbbaa`, `rgba()` or `hsla()`.",
|
|
10423
|
+
"fieldName": "alpha"
|
|
10424
|
+
},
|
|
10425
|
+
{
|
|
10426
|
+
"name": "gradient",
|
|
10427
|
+
"type": {
|
|
10428
|
+
"text": "boolean"
|
|
10429
|
+
},
|
|
10430
|
+
"default": "false",
|
|
10431
|
+
"description": "Allows linear and radial gradients from the picker; the value may then be a CSS gradient.",
|
|
10432
|
+
"fieldName": "gradient"
|
|
10433
|
+
},
|
|
10434
|
+
{
|
|
10435
|
+
"name": "formats",
|
|
10436
|
+
"type": {
|
|
10437
|
+
"text": "string"
|
|
10438
|
+
},
|
|
10439
|
+
"default": "'hex'",
|
|
10440
|
+
"description": "Formats the merchant may pick in the picker, space separated: `hex`, `rgb`, `hsl`. Default `hex` only, so the\nvalue stays `#rrggbb`. With more, the value is written in the format they chose.",
|
|
10441
|
+
"fieldName": "formats"
|
|
10442
|
+
},
|
|
10443
|
+
{
|
|
10444
|
+
"name": "brand-colors",
|
|
10445
|
+
"type": {
|
|
10446
|
+
"text": "Array<string | ColorSwatch> | undefined"
|
|
10447
|
+
},
|
|
10448
|
+
"description": "The store's brand colours, shown first in the picker. In HTML, pass JSON. Wins over `source`.",
|
|
10449
|
+
"fieldName": "brandColors"
|
|
10450
|
+
},
|
|
10451
|
+
{
|
|
10452
|
+
"name": "recent-colors",
|
|
10453
|
+
"type": {
|
|
10454
|
+
"text": "string[] | undefined"
|
|
10455
|
+
},
|
|
10456
|
+
"description": "Recent colours for the picker, newest first. Wins over `source`.",
|
|
10457
|
+
"fieldName": "recentColors"
|
|
10458
|
+
},
|
|
10459
|
+
{
|
|
10460
|
+
"name": "recent-key",
|
|
10461
|
+
"type": {
|
|
10462
|
+
"text": "string"
|
|
10463
|
+
},
|
|
10464
|
+
"default": "''",
|
|
10465
|
+
"description": "Keeps recent colours in this browser under this key when there is no `source`.",
|
|
10466
|
+
"fieldName": "recentKey"
|
|
10467
|
+
},
|
|
10468
|
+
{
|
|
10469
|
+
"name": "_open",
|
|
10470
|
+
"type": {
|
|
10471
|
+
"text": "boolean"
|
|
10472
|
+
},
|
|
10473
|
+
"default": "false",
|
|
10474
|
+
"fieldName": "_open"
|
|
10475
|
+
},
|
|
10251
10476
|
{
|
|
10252
10477
|
"name": "required",
|
|
10253
10478
|
"type": {
|
|
@@ -10305,12 +10530,20 @@
|
|
|
10305
10530
|
}
|
|
10306
10531
|
],
|
|
10307
10532
|
"exports": [
|
|
10533
|
+
{
|
|
10534
|
+
"kind": "js",
|
|
10535
|
+
"name": "ColorSwatch",
|
|
10536
|
+
"declaration": {
|
|
10537
|
+
"name": "ColorSwatch",
|
|
10538
|
+
"module": "../color-source.js"
|
|
10539
|
+
}
|
|
10540
|
+
},
|
|
10308
10541
|
{
|
|
10309
10542
|
"kind": "js",
|
|
10310
10543
|
"name": "normalizeHex",
|
|
10311
10544
|
"declaration": {
|
|
10312
10545
|
"name": "normalizeHex",
|
|
10313
|
-
"module": "
|
|
10546
|
+
"module": "../color.js"
|
|
10314
10547
|
}
|
|
10315
10548
|
},
|
|
10316
10549
|
{
|
|
@@ -10331,6 +10564,1069 @@
|
|
|
10331
10564
|
}
|
|
10332
10565
|
]
|
|
10333
10566
|
},
|
|
10567
|
+
{
|
|
10568
|
+
"kind": "javascript-module",
|
|
10569
|
+
"path": "src/components/color-picker.ts",
|
|
10570
|
+
"declarations": [
|
|
10571
|
+
{
|
|
10572
|
+
"kind": "variable",
|
|
10573
|
+
"name": "DEFAULT_PALETTE",
|
|
10574
|
+
"type": {
|
|
10575
|
+
"text": "ColorSwatch[]"
|
|
10576
|
+
},
|
|
10577
|
+
"description": "The default palette (the hues of the Commmerce light theme), shared with cm-color-field."
|
|
10578
|
+
},
|
|
10579
|
+
{
|
|
10580
|
+
"kind": "class",
|
|
10581
|
+
"description": "Colour picker: a saturation and brightness square, hue and opacity sliders, the value as hex, RGB or HSL, the\nbrowser's eyedropper, gradients, and swatches for the store's brand colours, the merchant's recent colours and a\npalette. Use it inline in a panel, or let cm-color-field open it (`picker`).\n\nBrand and recent colours come from `brand-colors` / `recent-colors`, or from a `source`: `app.colors` (App\nBridge), `httpColorSource()` (your server, Colour API) or `localColorSource()`. Each committed colour that isn't\na brand or palette colour is added to the recents: through `source.addRecentColor`, or kept locally when\n`recent-key` is set, and announced with `cm-recent-change` either way.",
|
|
10582
|
+
"name": "CmColorPicker",
|
|
10583
|
+
"cssParts": [
|
|
10584
|
+
{
|
|
10585
|
+
"description": "The saturation and brightness square.",
|
|
10586
|
+
"name": "area"
|
|
10587
|
+
},
|
|
10588
|
+
{
|
|
10589
|
+
"description": "Each swatch button.",
|
|
10590
|
+
"name": "swatch"
|
|
10591
|
+
}
|
|
10592
|
+
],
|
|
10593
|
+
"members": [
|
|
10594
|
+
{
|
|
10595
|
+
"kind": "field",
|
|
10596
|
+
"name": "value",
|
|
10597
|
+
"privacy": "public",
|
|
10598
|
+
"type": {
|
|
10599
|
+
"text": "string"
|
|
10600
|
+
},
|
|
10601
|
+
"default": "''",
|
|
10602
|
+
"description": "The colour: hex, `rgb()`, `hsl()` or, with `gradient`, a `linear-gradient()` / `radial-gradient()`. Empty for none.",
|
|
10603
|
+
"attribute": "value"
|
|
10604
|
+
},
|
|
10605
|
+
{
|
|
10606
|
+
"kind": "field",
|
|
10607
|
+
"name": "format",
|
|
10608
|
+
"privacy": "public",
|
|
10609
|
+
"type": {
|
|
10610
|
+
"text": "ColorFormat"
|
|
10611
|
+
},
|
|
10612
|
+
"default": "'hex'",
|
|
10613
|
+
"description": "How the value is written: `hex` (default), `rgb` or `hsl`. Changes when the merchant picks another format.",
|
|
10614
|
+
"attribute": "format",
|
|
10615
|
+
"reflects": true
|
|
10616
|
+
},
|
|
10617
|
+
{
|
|
10618
|
+
"kind": "field",
|
|
10619
|
+
"name": "formats",
|
|
10620
|
+
"privacy": "public",
|
|
10621
|
+
"type": {
|
|
10622
|
+
"text": "string"
|
|
10623
|
+
},
|
|
10624
|
+
"default": "'hex rgb hsl'",
|
|
10625
|
+
"description": "Formats the merchant may switch between, space separated. Default `hex rgb hsl`; one format hides the menu.",
|
|
10626
|
+
"attribute": "formats"
|
|
10627
|
+
},
|
|
10628
|
+
{
|
|
10629
|
+
"kind": "field",
|
|
10630
|
+
"name": "alpha",
|
|
10631
|
+
"privacy": "public",
|
|
10632
|
+
"type": {
|
|
10633
|
+
"text": "boolean"
|
|
10634
|
+
},
|
|
10635
|
+
"default": "false",
|
|
10636
|
+
"description": "Shows the opacity slider. A see-through colour is written `#rrggbbaa`, `rgba()` or `hsla()`.",
|
|
10637
|
+
"attribute": "alpha"
|
|
10638
|
+
},
|
|
10639
|
+
{
|
|
10640
|
+
"kind": "field",
|
|
10641
|
+
"name": "gradient",
|
|
10642
|
+
"privacy": "public",
|
|
10643
|
+
"type": {
|
|
10644
|
+
"text": "boolean"
|
|
10645
|
+
},
|
|
10646
|
+
"default": "false",
|
|
10647
|
+
"description": "Adds Solid / Gradient tabs: linear or radial gradients with two or more stops.",
|
|
10648
|
+
"attribute": "gradient"
|
|
10649
|
+
},
|
|
10650
|
+
{
|
|
10651
|
+
"kind": "field",
|
|
10652
|
+
"name": "swatches",
|
|
10653
|
+
"privacy": "public",
|
|
10654
|
+
"type": {
|
|
10655
|
+
"text": "Array<string | ColorSwatch> | undefined"
|
|
10656
|
+
},
|
|
10657
|
+
"description": "The palette, as colours or `{ value, name }`. Default: 12 colours from the Commmerce tokens. `[]` hides it.",
|
|
10658
|
+
"attribute": "swatches"
|
|
10659
|
+
},
|
|
10660
|
+
{
|
|
10661
|
+
"kind": "field",
|
|
10662
|
+
"name": "brandColors",
|
|
10663
|
+
"privacy": "public",
|
|
10664
|
+
"type": {
|
|
10665
|
+
"text": "Array<string | ColorSwatch> | undefined"
|
|
10666
|
+
},
|
|
10667
|
+
"description": "The store's brand colours. Wins over `source`. In HTML, pass JSON.",
|
|
10668
|
+
"attribute": "brand-colors"
|
|
10669
|
+
},
|
|
10670
|
+
{
|
|
10671
|
+
"kind": "field",
|
|
10672
|
+
"name": "recentColors",
|
|
10673
|
+
"privacy": "public",
|
|
10674
|
+
"type": {
|
|
10675
|
+
"text": "string[] | undefined"
|
|
10676
|
+
},
|
|
10677
|
+
"description": "Recent colours, newest first. Wins over `source`; update it from `cm-recent-change`.",
|
|
10678
|
+
"attribute": "recent-colors"
|
|
10679
|
+
},
|
|
10680
|
+
{
|
|
10681
|
+
"kind": "field",
|
|
10682
|
+
"name": "source",
|
|
10683
|
+
"privacy": "public",
|
|
10684
|
+
"type": {
|
|
10685
|
+
"text": "ColorSource | undefined"
|
|
10686
|
+
},
|
|
10687
|
+
"description": "Where brand and recent colours come from (see the colour picker docs)."
|
|
10688
|
+
},
|
|
10689
|
+
{
|
|
10690
|
+
"kind": "field",
|
|
10691
|
+
"name": "recentKey",
|
|
10692
|
+
"privacy": "public",
|
|
10693
|
+
"type": {
|
|
10694
|
+
"text": "string"
|
|
10695
|
+
},
|
|
10696
|
+
"default": "''",
|
|
10697
|
+
"description": "Keeps recents in this browser under this key when there is no `source` (a `localColorSource`).",
|
|
10698
|
+
"attribute": "recent-key"
|
|
10699
|
+
},
|
|
10700
|
+
{
|
|
10701
|
+
"kind": "field",
|
|
10702
|
+
"name": "maxRecent",
|
|
10703
|
+
"privacy": "public",
|
|
10704
|
+
"type": {
|
|
10705
|
+
"text": "number"
|
|
10706
|
+
},
|
|
10707
|
+
"default": "MAX_RECENT",
|
|
10708
|
+
"description": "How many recent colours to show. Default 16.",
|
|
10709
|
+
"attribute": "max-recent"
|
|
10710
|
+
},
|
|
10711
|
+
{
|
|
10712
|
+
"kind": "field",
|
|
10713
|
+
"name": "eyedropper",
|
|
10714
|
+
"privacy": "public",
|
|
10715
|
+
"type": {
|
|
10716
|
+
"text": "boolean"
|
|
10717
|
+
},
|
|
10718
|
+
"default": "true",
|
|
10719
|
+
"description": "Shows the eyedropper where the browser has one (Chrome and Edge on desktop). Default on.",
|
|
10720
|
+
"attribute": "eyedropper"
|
|
10721
|
+
},
|
|
10722
|
+
{
|
|
10723
|
+
"kind": "field",
|
|
10724
|
+
"name": "disabled",
|
|
10725
|
+
"privacy": "public",
|
|
10726
|
+
"type": {
|
|
10727
|
+
"text": "boolean"
|
|
10728
|
+
},
|
|
10729
|
+
"default": "false",
|
|
10730
|
+
"description": "Blocks interaction.",
|
|
10731
|
+
"attribute": "disabled",
|
|
10732
|
+
"reflects": true
|
|
10733
|
+
},
|
|
10734
|
+
{
|
|
10735
|
+
"kind": "field",
|
|
10736
|
+
"name": "_hsva",
|
|
10737
|
+
"privacy": "public",
|
|
10738
|
+
"type": {
|
|
10739
|
+
"text": "Hsva"
|
|
10740
|
+
},
|
|
10741
|
+
"default": "{ h: 0, s: 0, v: 0, a: 1 }",
|
|
10742
|
+
"attribute": "_hsva"
|
|
10743
|
+
},
|
|
10744
|
+
{
|
|
10745
|
+
"kind": "field",
|
|
10746
|
+
"name": "_grad",
|
|
10747
|
+
"privacy": "public",
|
|
10748
|
+
"type": {
|
|
10749
|
+
"text": "Gradient | null"
|
|
10750
|
+
},
|
|
10751
|
+
"default": "null",
|
|
10752
|
+
"attribute": "_grad"
|
|
10753
|
+
},
|
|
10754
|
+
{
|
|
10755
|
+
"kind": "field",
|
|
10756
|
+
"name": "_stop",
|
|
10757
|
+
"privacy": "public",
|
|
10758
|
+
"type": {
|
|
10759
|
+
"text": "number"
|
|
10760
|
+
},
|
|
10761
|
+
"default": "0",
|
|
10762
|
+
"attribute": "_stop"
|
|
10763
|
+
},
|
|
10764
|
+
{
|
|
10765
|
+
"kind": "field",
|
|
10766
|
+
"name": "_brand",
|
|
10767
|
+
"privacy": "public",
|
|
10768
|
+
"type": {
|
|
10769
|
+
"text": "ColorSwatch[]"
|
|
10770
|
+
},
|
|
10771
|
+
"default": "[]",
|
|
10772
|
+
"attribute": "_brand"
|
|
10773
|
+
},
|
|
10774
|
+
{
|
|
10775
|
+
"kind": "field",
|
|
10776
|
+
"name": "_recent",
|
|
10777
|
+
"privacy": "public",
|
|
10778
|
+
"type": {
|
|
10779
|
+
"text": "string[]"
|
|
10780
|
+
},
|
|
10781
|
+
"default": "[]",
|
|
10782
|
+
"attribute": "_recent"
|
|
10783
|
+
},
|
|
10784
|
+
{
|
|
10785
|
+
"kind": "field",
|
|
10786
|
+
"name": "_drafts",
|
|
10787
|
+
"privacy": "public",
|
|
10788
|
+
"type": {
|
|
10789
|
+
"text": "Record<string, string>"
|
|
10790
|
+
},
|
|
10791
|
+
"default": "{}",
|
|
10792
|
+
"description": "Text in a box while it differs from the colour, keyed by box.",
|
|
10793
|
+
"attribute": "_drafts"
|
|
10794
|
+
},
|
|
10795
|
+
{
|
|
10796
|
+
"kind": "field",
|
|
10797
|
+
"name": "#id",
|
|
10798
|
+
"privacy": "private"
|
|
10799
|
+
},
|
|
10800
|
+
{
|
|
10801
|
+
"kind": "field",
|
|
10802
|
+
"name": "#written",
|
|
10803
|
+
"privacy": "private",
|
|
10804
|
+
"type": {
|
|
10805
|
+
"text": "string | undefined"
|
|
10806
|
+
},
|
|
10807
|
+
"description": "The value this element wrote last, so an outside change is told apart from our own."
|
|
10808
|
+
},
|
|
10809
|
+
{
|
|
10810
|
+
"kind": "field",
|
|
10811
|
+
"name": "#loaded",
|
|
10812
|
+
"privacy": "private",
|
|
10813
|
+
"type": {
|
|
10814
|
+
"text": "ColorSource | undefined"
|
|
10815
|
+
}
|
|
10816
|
+
},
|
|
10817
|
+
{
|
|
10818
|
+
"kind": "field",
|
|
10819
|
+
"name": "#local",
|
|
10820
|
+
"privacy": "private",
|
|
10821
|
+
"type": {
|
|
10822
|
+
"text": "ColorSource | undefined"
|
|
10823
|
+
}
|
|
10824
|
+
},
|
|
10825
|
+
{
|
|
10826
|
+
"kind": "field",
|
|
10827
|
+
"name": "#drag",
|
|
10828
|
+
"privacy": "private",
|
|
10829
|
+
"type": {
|
|
10830
|
+
"text": "'area' | number | null"
|
|
10831
|
+
},
|
|
10832
|
+
"default": "null"
|
|
10833
|
+
},
|
|
10834
|
+
{
|
|
10835
|
+
"kind": "field",
|
|
10836
|
+
"name": "allowedFormats",
|
|
10837
|
+
"type": {
|
|
10838
|
+
"text": "ColorFormat[]"
|
|
10839
|
+
},
|
|
10840
|
+
"description": "Formats the merchant may choose.",
|
|
10841
|
+
"readonly": true
|
|
10842
|
+
},
|
|
10843
|
+
{
|
|
10844
|
+
"kind": "field",
|
|
10845
|
+
"name": "palette",
|
|
10846
|
+
"type": {
|
|
10847
|
+
"text": "ColorSwatch[]"
|
|
10848
|
+
},
|
|
10849
|
+
"description": "The palette in use.",
|
|
10850
|
+
"readonly": true
|
|
10851
|
+
},
|
|
10852
|
+
{
|
|
10853
|
+
"kind": "field",
|
|
10854
|
+
"name": "brand",
|
|
10855
|
+
"type": {
|
|
10856
|
+
"text": "ColorSwatch[]"
|
|
10857
|
+
},
|
|
10858
|
+
"description": "Brand colours in use (`brand-colors`, else from `source`).",
|
|
10859
|
+
"readonly": true
|
|
10860
|
+
},
|
|
10861
|
+
{
|
|
10862
|
+
"kind": "field",
|
|
10863
|
+
"name": "recent",
|
|
10864
|
+
"type": {
|
|
10865
|
+
"text": "string[]"
|
|
10866
|
+
},
|
|
10867
|
+
"description": "Recent colours in use (`recent-colors`, else from `source` / `recent-key`), without gradients unless `gradient`.",
|
|
10868
|
+
"readonly": true
|
|
10869
|
+
},
|
|
10870
|
+
{
|
|
10871
|
+
"kind": "method",
|
|
10872
|
+
"name": "#store",
|
|
10873
|
+
"privacy": "private",
|
|
10874
|
+
"return": {
|
|
10875
|
+
"type": {
|
|
10876
|
+
"text": "ColorSource | undefined"
|
|
10877
|
+
}
|
|
10878
|
+
}
|
|
10879
|
+
},
|
|
10880
|
+
{
|
|
10881
|
+
"kind": "method",
|
|
10882
|
+
"name": "#loadSources",
|
|
10883
|
+
"privacy": "private"
|
|
10884
|
+
},
|
|
10885
|
+
{
|
|
10886
|
+
"kind": "method",
|
|
10887
|
+
"name": "#readValue",
|
|
10888
|
+
"privacy": "private",
|
|
10889
|
+
"description": "Reads `value` into the editing state."
|
|
10890
|
+
},
|
|
10891
|
+
{
|
|
10892
|
+
"kind": "method",
|
|
10893
|
+
"name": "#setHsvaFrom",
|
|
10894
|
+
"privacy": "private",
|
|
10895
|
+
"parameters": [
|
|
10896
|
+
{
|
|
10897
|
+
"name": "c",
|
|
10898
|
+
"type": {
|
|
10899
|
+
"text": "Rgba"
|
|
10900
|
+
}
|
|
10901
|
+
}
|
|
10902
|
+
],
|
|
10903
|
+
"description": "Keeps the hue (and saturation) when the colour is grey or black, so the square doesn't jump."
|
|
10904
|
+
},
|
|
10905
|
+
{
|
|
10906
|
+
"kind": "field",
|
|
10907
|
+
"name": "#rgba",
|
|
10908
|
+
"privacy": "private",
|
|
10909
|
+
"type": {
|
|
10910
|
+
"text": "Rgba"
|
|
10911
|
+
},
|
|
10912
|
+
"readonly": true
|
|
10913
|
+
},
|
|
10914
|
+
{
|
|
10915
|
+
"kind": "method",
|
|
10916
|
+
"name": "#write",
|
|
10917
|
+
"privacy": "private",
|
|
10918
|
+
"parameters": [
|
|
10919
|
+
{
|
|
10920
|
+
"name": "emitChange",
|
|
10921
|
+
"default": "false"
|
|
10922
|
+
}
|
|
10923
|
+
],
|
|
10924
|
+
"description": "Writes the current state to `value` and fires `input`."
|
|
10925
|
+
},
|
|
10926
|
+
{
|
|
10927
|
+
"kind": "method",
|
|
10928
|
+
"name": "#emit",
|
|
10929
|
+
"privacy": "private",
|
|
10930
|
+
"parameters": [
|
|
10931
|
+
{
|
|
10932
|
+
"name": "type",
|
|
10933
|
+
"type": {
|
|
10934
|
+
"text": "'input' | 'change'"
|
|
10935
|
+
}
|
|
10936
|
+
}
|
|
10937
|
+
]
|
|
10938
|
+
},
|
|
10939
|
+
{
|
|
10940
|
+
"kind": "method",
|
|
10941
|
+
"name": "#commit",
|
|
10942
|
+
"privacy": "private",
|
|
10943
|
+
"description": "Fires `change` and remembers the colour as recent unless it is a brand or palette colour."
|
|
10944
|
+
},
|
|
10945
|
+
{
|
|
10946
|
+
"kind": "method",
|
|
10947
|
+
"name": "#areaAt",
|
|
10948
|
+
"privacy": "private",
|
|
10949
|
+
"parameters": [
|
|
10950
|
+
{
|
|
10951
|
+
"name": "e",
|
|
10952
|
+
"type": {
|
|
10953
|
+
"text": "PointerEvent"
|
|
10954
|
+
}
|
|
10955
|
+
}
|
|
10956
|
+
]
|
|
10957
|
+
},
|
|
10958
|
+
{
|
|
10959
|
+
"kind": "method",
|
|
10960
|
+
"name": "#onAreaDown",
|
|
10961
|
+
"privacy": "private",
|
|
10962
|
+
"parameters": [
|
|
10963
|
+
{
|
|
10964
|
+
"name": "e",
|
|
10965
|
+
"type": {
|
|
10966
|
+
"text": "PointerEvent"
|
|
10967
|
+
}
|
|
10968
|
+
}
|
|
10969
|
+
]
|
|
10970
|
+
},
|
|
10971
|
+
{
|
|
10972
|
+
"kind": "method",
|
|
10973
|
+
"name": "#onAreaMove",
|
|
10974
|
+
"privacy": "private",
|
|
10975
|
+
"parameters": [
|
|
10976
|
+
{
|
|
10977
|
+
"name": "e",
|
|
10978
|
+
"type": {
|
|
10979
|
+
"text": "PointerEvent"
|
|
10980
|
+
}
|
|
10981
|
+
}
|
|
10982
|
+
]
|
|
10983
|
+
},
|
|
10984
|
+
{
|
|
10985
|
+
"kind": "method",
|
|
10986
|
+
"name": "#onUp",
|
|
10987
|
+
"privacy": "private"
|
|
10988
|
+
},
|
|
10989
|
+
{
|
|
10990
|
+
"kind": "method",
|
|
10991
|
+
"name": "#onAreaKey",
|
|
10992
|
+
"privacy": "private",
|
|
10993
|
+
"parameters": [
|
|
10994
|
+
{
|
|
10995
|
+
"name": "e",
|
|
10996
|
+
"type": {
|
|
10997
|
+
"text": "KeyboardEvent"
|
|
10998
|
+
}
|
|
10999
|
+
}
|
|
11000
|
+
]
|
|
11001
|
+
},
|
|
11002
|
+
{
|
|
11003
|
+
"kind": "method",
|
|
11004
|
+
"name": "#onHue",
|
|
11005
|
+
"privacy": "private",
|
|
11006
|
+
"parameters": [
|
|
11007
|
+
{
|
|
11008
|
+
"name": "e",
|
|
11009
|
+
"type": {
|
|
11010
|
+
"text": "Event"
|
|
11011
|
+
}
|
|
11012
|
+
},
|
|
11013
|
+
{
|
|
11014
|
+
"name": "commit",
|
|
11015
|
+
"type": {
|
|
11016
|
+
"text": "boolean"
|
|
11017
|
+
}
|
|
11018
|
+
}
|
|
11019
|
+
]
|
|
11020
|
+
},
|
|
11021
|
+
{
|
|
11022
|
+
"kind": "method",
|
|
11023
|
+
"name": "#onAlpha",
|
|
11024
|
+
"privacy": "private",
|
|
11025
|
+
"parameters": [
|
|
11026
|
+
{
|
|
11027
|
+
"name": "e",
|
|
11028
|
+
"type": {
|
|
11029
|
+
"text": "Event"
|
|
11030
|
+
}
|
|
11031
|
+
},
|
|
11032
|
+
{
|
|
11033
|
+
"name": "commit",
|
|
11034
|
+
"type": {
|
|
11035
|
+
"text": "boolean"
|
|
11036
|
+
}
|
|
11037
|
+
}
|
|
11038
|
+
]
|
|
11039
|
+
},
|
|
11040
|
+
{
|
|
11041
|
+
"kind": "method",
|
|
11042
|
+
"name": "#onFormat",
|
|
11043
|
+
"privacy": "private",
|
|
11044
|
+
"parameters": [
|
|
11045
|
+
{
|
|
11046
|
+
"name": "e",
|
|
11047
|
+
"type": {
|
|
11048
|
+
"text": "Event"
|
|
11049
|
+
}
|
|
11050
|
+
}
|
|
11051
|
+
]
|
|
11052
|
+
},
|
|
11053
|
+
{
|
|
11054
|
+
"kind": "method",
|
|
11055
|
+
"name": "#onBox",
|
|
11056
|
+
"privacy": "private",
|
|
11057
|
+
"parameters": [
|
|
11058
|
+
{
|
|
11059
|
+
"name": "e",
|
|
11060
|
+
"type": {
|
|
11061
|
+
"text": "Event"
|
|
11062
|
+
}
|
|
11063
|
+
},
|
|
11064
|
+
{
|
|
11065
|
+
"name": "key",
|
|
11066
|
+
"type": {
|
|
11067
|
+
"text": "string"
|
|
11068
|
+
}
|
|
11069
|
+
},
|
|
11070
|
+
{
|
|
11071
|
+
"name": "commit",
|
|
11072
|
+
"type": {
|
|
11073
|
+
"text": "boolean"
|
|
11074
|
+
}
|
|
11075
|
+
}
|
|
11076
|
+
]
|
|
11077
|
+
},
|
|
11078
|
+
{
|
|
11079
|
+
"kind": "method",
|
|
11080
|
+
"name": "#fromBoxes",
|
|
11081
|
+
"privacy": "private",
|
|
11082
|
+
"return": {
|
|
11083
|
+
"type": {
|
|
11084
|
+
"text": "Rgba | null"
|
|
11085
|
+
}
|
|
11086
|
+
},
|
|
11087
|
+
"parameters": [
|
|
11088
|
+
{
|
|
11089
|
+
"name": "key",
|
|
11090
|
+
"type": {
|
|
11091
|
+
"text": "string"
|
|
11092
|
+
}
|
|
11093
|
+
},
|
|
11094
|
+
{
|
|
11095
|
+
"name": "text",
|
|
11096
|
+
"type": {
|
|
11097
|
+
"text": "string"
|
|
11098
|
+
}
|
|
11099
|
+
}
|
|
11100
|
+
],
|
|
11101
|
+
"description": "The colour the boxes describe after `key` changes to `text`, or null while it isn't one."
|
|
11102
|
+
},
|
|
11103
|
+
{
|
|
11104
|
+
"kind": "method",
|
|
11105
|
+
"name": "#onEyedropper",
|
|
11106
|
+
"privacy": "private"
|
|
11107
|
+
},
|
|
11108
|
+
{
|
|
11109
|
+
"kind": "method",
|
|
11110
|
+
"name": "#setMode",
|
|
11111
|
+
"privacy": "private",
|
|
11112
|
+
"parameters": [
|
|
11113
|
+
{
|
|
11114
|
+
"name": "gradient",
|
|
11115
|
+
"type": {
|
|
11116
|
+
"text": "boolean"
|
|
11117
|
+
}
|
|
11118
|
+
}
|
|
11119
|
+
]
|
|
11120
|
+
},
|
|
11121
|
+
{
|
|
11122
|
+
"kind": "method",
|
|
11123
|
+
"name": "#setGrad",
|
|
11124
|
+
"privacy": "private",
|
|
11125
|
+
"parameters": [
|
|
11126
|
+
{
|
|
11127
|
+
"name": "patch",
|
|
11128
|
+
"type": {
|
|
11129
|
+
"text": "Partial<Gradient>"
|
|
11130
|
+
}
|
|
11131
|
+
},
|
|
11132
|
+
{
|
|
11133
|
+
"name": "commit",
|
|
11134
|
+
"default": "true"
|
|
11135
|
+
}
|
|
11136
|
+
]
|
|
11137
|
+
},
|
|
11138
|
+
{
|
|
11139
|
+
"kind": "method",
|
|
11140
|
+
"name": "#selectStop",
|
|
11141
|
+
"privacy": "private",
|
|
11142
|
+
"parameters": [
|
|
11143
|
+
{
|
|
11144
|
+
"name": "i",
|
|
11145
|
+
"type": {
|
|
11146
|
+
"text": "number"
|
|
11147
|
+
}
|
|
11148
|
+
}
|
|
11149
|
+
]
|
|
11150
|
+
},
|
|
11151
|
+
{
|
|
11152
|
+
"kind": "method",
|
|
11153
|
+
"name": "#posAt",
|
|
11154
|
+
"privacy": "private",
|
|
11155
|
+
"parameters": [
|
|
11156
|
+
{
|
|
11157
|
+
"name": "e",
|
|
11158
|
+
"type": {
|
|
11159
|
+
"text": "PointerEvent"
|
|
11160
|
+
}
|
|
11161
|
+
},
|
|
11162
|
+
{
|
|
11163
|
+
"name": "bar",
|
|
11164
|
+
"type": {
|
|
11165
|
+
"text": "HTMLElement"
|
|
11166
|
+
}
|
|
11167
|
+
}
|
|
11168
|
+
]
|
|
11169
|
+
},
|
|
11170
|
+
{
|
|
11171
|
+
"kind": "method",
|
|
11172
|
+
"name": "#onBarDown",
|
|
11173
|
+
"privacy": "private",
|
|
11174
|
+
"parameters": [
|
|
11175
|
+
{
|
|
11176
|
+
"name": "e",
|
|
11177
|
+
"type": {
|
|
11178
|
+
"text": "PointerEvent"
|
|
11179
|
+
}
|
|
11180
|
+
}
|
|
11181
|
+
]
|
|
11182
|
+
},
|
|
11183
|
+
{
|
|
11184
|
+
"kind": "method",
|
|
11185
|
+
"name": "#onHandleDown",
|
|
11186
|
+
"privacy": "private",
|
|
11187
|
+
"parameters": [
|
|
11188
|
+
{
|
|
11189
|
+
"name": "e",
|
|
11190
|
+
"type": {
|
|
11191
|
+
"text": "PointerEvent"
|
|
11192
|
+
}
|
|
11193
|
+
},
|
|
11194
|
+
{
|
|
11195
|
+
"name": "i",
|
|
11196
|
+
"type": {
|
|
11197
|
+
"text": "number"
|
|
11198
|
+
}
|
|
11199
|
+
}
|
|
11200
|
+
]
|
|
11201
|
+
},
|
|
11202
|
+
{
|
|
11203
|
+
"kind": "method",
|
|
11204
|
+
"name": "#onHandleMove",
|
|
11205
|
+
"privacy": "private",
|
|
11206
|
+
"parameters": [
|
|
11207
|
+
{
|
|
11208
|
+
"name": "e",
|
|
11209
|
+
"type": {
|
|
11210
|
+
"text": "PointerEvent"
|
|
11211
|
+
}
|
|
11212
|
+
},
|
|
11213
|
+
{
|
|
11214
|
+
"name": "i",
|
|
11215
|
+
"type": {
|
|
11216
|
+
"text": "number"
|
|
11217
|
+
}
|
|
11218
|
+
}
|
|
11219
|
+
]
|
|
11220
|
+
},
|
|
11221
|
+
{
|
|
11222
|
+
"kind": "method",
|
|
11223
|
+
"name": "#moveStop",
|
|
11224
|
+
"privacy": "private",
|
|
11225
|
+
"parameters": [
|
|
11226
|
+
{
|
|
11227
|
+
"name": "i",
|
|
11228
|
+
"type": {
|
|
11229
|
+
"text": "number"
|
|
11230
|
+
}
|
|
11231
|
+
},
|
|
11232
|
+
{
|
|
11233
|
+
"name": "position",
|
|
11234
|
+
"type": {
|
|
11235
|
+
"text": "number"
|
|
11236
|
+
}
|
|
11237
|
+
},
|
|
11238
|
+
{
|
|
11239
|
+
"name": "commit",
|
|
11240
|
+
"type": {
|
|
11241
|
+
"text": "boolean"
|
|
11242
|
+
}
|
|
11243
|
+
}
|
|
11244
|
+
]
|
|
11245
|
+
},
|
|
11246
|
+
{
|
|
11247
|
+
"kind": "method",
|
|
11248
|
+
"name": "#removeStop",
|
|
11249
|
+
"privacy": "private",
|
|
11250
|
+
"parameters": [
|
|
11251
|
+
{
|
|
11252
|
+
"name": "i",
|
|
11253
|
+
"type": {
|
|
11254
|
+
"text": "number"
|
|
11255
|
+
}
|
|
11256
|
+
}
|
|
11257
|
+
]
|
|
11258
|
+
},
|
|
11259
|
+
{
|
|
11260
|
+
"kind": "method",
|
|
11261
|
+
"name": "#onHandleKey",
|
|
11262
|
+
"privacy": "private",
|
|
11263
|
+
"parameters": [
|
|
11264
|
+
{
|
|
11265
|
+
"name": "e",
|
|
11266
|
+
"type": {
|
|
11267
|
+
"text": "KeyboardEvent"
|
|
11268
|
+
}
|
|
11269
|
+
},
|
|
11270
|
+
{
|
|
11271
|
+
"name": "i",
|
|
11272
|
+
"type": {
|
|
11273
|
+
"text": "number"
|
|
11274
|
+
}
|
|
11275
|
+
}
|
|
11276
|
+
]
|
|
11277
|
+
},
|
|
11278
|
+
{
|
|
11279
|
+
"kind": "method",
|
|
11280
|
+
"name": "#pickSwatch",
|
|
11281
|
+
"privacy": "private",
|
|
11282
|
+
"parameters": [
|
|
11283
|
+
{
|
|
11284
|
+
"name": "value",
|
|
11285
|
+
"type": {
|
|
11286
|
+
"text": "string"
|
|
11287
|
+
}
|
|
11288
|
+
}
|
|
11289
|
+
]
|
|
11290
|
+
},
|
|
11291
|
+
{
|
|
11292
|
+
"kind": "method",
|
|
11293
|
+
"name": "#swatchGroup",
|
|
11294
|
+
"privacy": "private",
|
|
11295
|
+
"parameters": [
|
|
11296
|
+
{
|
|
11297
|
+
"name": "title",
|
|
11298
|
+
"type": {
|
|
11299
|
+
"text": "string"
|
|
11300
|
+
}
|
|
11301
|
+
},
|
|
11302
|
+
{
|
|
11303
|
+
"name": "list",
|
|
11304
|
+
"type": {
|
|
11305
|
+
"text": "ColorSwatch[]"
|
|
11306
|
+
}
|
|
11307
|
+
}
|
|
11308
|
+
]
|
|
11309
|
+
},
|
|
11310
|
+
{
|
|
11311
|
+
"kind": "method",
|
|
11312
|
+
"name": "#boxes",
|
|
11313
|
+
"privacy": "private"
|
|
11314
|
+
},
|
|
11315
|
+
{
|
|
11316
|
+
"kind": "method",
|
|
11317
|
+
"name": "finalize",
|
|
11318
|
+
"static": true,
|
|
11319
|
+
"description": "A property declared with `string: 'key'` (e.g. `saveLabel: { attribute: 'save-label', string: 'save' }`) reads\nas that built-in string until it is set, so `el.saveLabel` is \"Save\" in English and the translation elsewhere.\nSetting it overrides the string for this element; setting `undefined` goes back to the built-in one.",
|
|
11320
|
+
"inheritedFrom": {
|
|
11321
|
+
"name": "CmLocalizedElement",
|
|
11322
|
+
"module": "src/localize.ts"
|
|
11323
|
+
}
|
|
11324
|
+
},
|
|
11325
|
+
{
|
|
11326
|
+
"kind": "field",
|
|
11327
|
+
"name": "strings",
|
|
11328
|
+
"privacy": "public",
|
|
11329
|
+
"type": {
|
|
11330
|
+
"text": "Record<string, Message> | null | undefined"
|
|
11331
|
+
},
|
|
11332
|
+
"description": "Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation).",
|
|
11333
|
+
"attribute": "strings",
|
|
11334
|
+
"inheritedFrom": {
|
|
11335
|
+
"name": "CmLocalizedElement",
|
|
11336
|
+
"module": "src/localize.ts"
|
|
11337
|
+
}
|
|
11338
|
+
},
|
|
11339
|
+
{
|
|
11340
|
+
"kind": "field",
|
|
11341
|
+
"name": "stringsNamespace",
|
|
11342
|
+
"privacy": "protected",
|
|
11343
|
+
"description": "The string namespace: the tag name without `cm-`, in camelCase.",
|
|
11344
|
+
"readonly": true,
|
|
11345
|
+
"inheritedFrom": {
|
|
11346
|
+
"name": "CmLocalizedElement",
|
|
11347
|
+
"module": "src/localize.ts"
|
|
11348
|
+
}
|
|
11349
|
+
},
|
|
11350
|
+
{
|
|
11351
|
+
"kind": "method",
|
|
11352
|
+
"name": "t",
|
|
11353
|
+
"privacy": "protected",
|
|
11354
|
+
"parameters": [
|
|
11355
|
+
{
|
|
11356
|
+
"name": "key",
|
|
11357
|
+
"type": {
|
|
11358
|
+
"text": "string"
|
|
11359
|
+
}
|
|
11360
|
+
},
|
|
11361
|
+
{
|
|
11362
|
+
"name": "vars",
|
|
11363
|
+
"optional": true,
|
|
11364
|
+
"type": {
|
|
11365
|
+
"text": "MessageVars"
|
|
11366
|
+
}
|
|
11367
|
+
}
|
|
11368
|
+
],
|
|
11369
|
+
"description": "The component's text for `key`, in its language, with `{placeholders}` filled from `vars`.",
|
|
11370
|
+
"inheritedFrom": {
|
|
11371
|
+
"name": "CmLocalizedElement",
|
|
11372
|
+
"module": "src/localize.ts"
|
|
11373
|
+
}
|
|
11374
|
+
},
|
|
11375
|
+
{
|
|
11376
|
+
"kind": "field",
|
|
11377
|
+
"name": "locale",
|
|
11378
|
+
"privacy": "protected",
|
|
11379
|
+
"description": "The locale used for numbers, dates and plurals.",
|
|
11380
|
+
"readonly": true,
|
|
11381
|
+
"inheritedFrom": {
|
|
11382
|
+
"name": "CmLocalizedElement",
|
|
11383
|
+
"module": "src/localize.ts"
|
|
11384
|
+
}
|
|
11385
|
+
},
|
|
11386
|
+
{
|
|
11387
|
+
"kind": "method",
|
|
11388
|
+
"name": "formatNumber",
|
|
11389
|
+
"privacy": "protected",
|
|
11390
|
+
"parameters": [
|
|
11391
|
+
{
|
|
11392
|
+
"name": "n",
|
|
11393
|
+
"type": {
|
|
11394
|
+
"text": "number"
|
|
11395
|
+
}
|
|
11396
|
+
},
|
|
11397
|
+
{
|
|
11398
|
+
"name": "options",
|
|
11399
|
+
"optional": true,
|
|
11400
|
+
"type": {
|
|
11401
|
+
"text": "Intl.NumberFormatOptions"
|
|
11402
|
+
}
|
|
11403
|
+
}
|
|
11404
|
+
],
|
|
11405
|
+
"description": "A number formatted for the component's locale.",
|
|
11406
|
+
"inheritedFrom": {
|
|
11407
|
+
"name": "CmLocalizedElement",
|
|
11408
|
+
"module": "src/localize.ts"
|
|
11409
|
+
}
|
|
11410
|
+
}
|
|
11411
|
+
],
|
|
11412
|
+
"events": [
|
|
11413
|
+
{
|
|
11414
|
+
"name": "type",
|
|
11415
|
+
"type": {
|
|
11416
|
+
"text": "Event"
|
|
11417
|
+
}
|
|
11418
|
+
},
|
|
11419
|
+
{
|
|
11420
|
+
"name": "cm-recent-change",
|
|
11421
|
+
"type": {
|
|
11422
|
+
"text": "CustomEvent"
|
|
11423
|
+
},
|
|
11424
|
+
"description": "`detail.colors`: the new recent list (newest first) after a commit added to it."
|
|
11425
|
+
},
|
|
11426
|
+
{
|
|
11427
|
+
"description": "While the colour changes (dragging, typing a complete value).",
|
|
11428
|
+
"name": "input"
|
|
11429
|
+
},
|
|
11430
|
+
{
|
|
11431
|
+
"description": "When a colour is committed: a drag ends, a swatch is picked, a box is left or Enter pressed.",
|
|
11432
|
+
"name": "change"
|
|
11433
|
+
}
|
|
11434
|
+
],
|
|
11435
|
+
"attributes": [
|
|
11436
|
+
{
|
|
11437
|
+
"name": "value",
|
|
11438
|
+
"type": {
|
|
11439
|
+
"text": "string"
|
|
11440
|
+
},
|
|
11441
|
+
"default": "''",
|
|
11442
|
+
"description": "The colour: hex, `rgb()`, `hsl()` or, with `gradient`, a `linear-gradient()` / `radial-gradient()`. Empty for none.",
|
|
11443
|
+
"fieldName": "value"
|
|
11444
|
+
},
|
|
11445
|
+
{
|
|
11446
|
+
"name": "format",
|
|
11447
|
+
"type": {
|
|
11448
|
+
"text": "ColorFormat"
|
|
11449
|
+
},
|
|
11450
|
+
"default": "'hex'",
|
|
11451
|
+
"description": "How the value is written: `hex` (default), `rgb` or `hsl`. Changes when the merchant picks another format.",
|
|
11452
|
+
"fieldName": "format"
|
|
11453
|
+
},
|
|
11454
|
+
{
|
|
11455
|
+
"name": "formats",
|
|
11456
|
+
"type": {
|
|
11457
|
+
"text": "string"
|
|
11458
|
+
},
|
|
11459
|
+
"default": "'hex rgb hsl'",
|
|
11460
|
+
"description": "Formats the merchant may switch between, space separated. Default `hex rgb hsl`; one format hides the menu.",
|
|
11461
|
+
"fieldName": "formats"
|
|
11462
|
+
},
|
|
11463
|
+
{
|
|
11464
|
+
"name": "alpha",
|
|
11465
|
+
"type": {
|
|
11466
|
+
"text": "boolean"
|
|
11467
|
+
},
|
|
11468
|
+
"default": "false",
|
|
11469
|
+
"description": "Shows the opacity slider. A see-through colour is written `#rrggbbaa`, `rgba()` or `hsla()`.",
|
|
11470
|
+
"fieldName": "alpha"
|
|
11471
|
+
},
|
|
11472
|
+
{
|
|
11473
|
+
"name": "gradient",
|
|
11474
|
+
"type": {
|
|
11475
|
+
"text": "boolean"
|
|
11476
|
+
},
|
|
11477
|
+
"default": "false",
|
|
11478
|
+
"description": "Adds Solid / Gradient tabs: linear or radial gradients with two or more stops.",
|
|
11479
|
+
"fieldName": "gradient"
|
|
11480
|
+
},
|
|
11481
|
+
{
|
|
11482
|
+
"name": "swatches",
|
|
11483
|
+
"type": {
|
|
11484
|
+
"text": "Array<string | ColorSwatch> | undefined"
|
|
11485
|
+
},
|
|
11486
|
+
"description": "The palette, as colours or `{ value, name }`. Default: 12 colours from the Commmerce tokens. `[]` hides it.",
|
|
11487
|
+
"fieldName": "swatches"
|
|
11488
|
+
},
|
|
11489
|
+
{
|
|
11490
|
+
"name": "brand-colors",
|
|
11491
|
+
"type": {
|
|
11492
|
+
"text": "Array<string | ColorSwatch> | undefined"
|
|
11493
|
+
},
|
|
11494
|
+
"description": "The store's brand colours. Wins over `source`. In HTML, pass JSON.",
|
|
11495
|
+
"fieldName": "brandColors"
|
|
11496
|
+
},
|
|
11497
|
+
{
|
|
11498
|
+
"name": "recent-colors",
|
|
11499
|
+
"type": {
|
|
11500
|
+
"text": "string[] | undefined"
|
|
11501
|
+
},
|
|
11502
|
+
"description": "Recent colours, newest first. Wins over `source`; update it from `cm-recent-change`.",
|
|
11503
|
+
"fieldName": "recentColors"
|
|
11504
|
+
},
|
|
11505
|
+
{
|
|
11506
|
+
"name": "recent-key",
|
|
11507
|
+
"type": {
|
|
11508
|
+
"text": "string"
|
|
11509
|
+
},
|
|
11510
|
+
"default": "''",
|
|
11511
|
+
"description": "Keeps recents in this browser under this key when there is no `source` (a `localColorSource`).",
|
|
11512
|
+
"fieldName": "recentKey"
|
|
11513
|
+
},
|
|
11514
|
+
{
|
|
11515
|
+
"name": "max-recent",
|
|
11516
|
+
"type": {
|
|
11517
|
+
"text": "number"
|
|
11518
|
+
},
|
|
11519
|
+
"default": "MAX_RECENT",
|
|
11520
|
+
"description": "How many recent colours to show. Default 16.",
|
|
11521
|
+
"fieldName": "maxRecent"
|
|
11522
|
+
},
|
|
11523
|
+
{
|
|
11524
|
+
"name": "eyedropper",
|
|
11525
|
+
"type": {
|
|
11526
|
+
"text": "boolean"
|
|
11527
|
+
},
|
|
11528
|
+
"default": "true",
|
|
11529
|
+
"description": "Shows the eyedropper where the browser has one (Chrome and Edge on desktop). Default on.",
|
|
11530
|
+
"fieldName": "eyedropper"
|
|
11531
|
+
},
|
|
11532
|
+
{
|
|
11533
|
+
"name": "disabled",
|
|
11534
|
+
"type": {
|
|
11535
|
+
"text": "boolean"
|
|
11536
|
+
},
|
|
11537
|
+
"default": "false",
|
|
11538
|
+
"description": "Blocks interaction.",
|
|
11539
|
+
"fieldName": "disabled"
|
|
11540
|
+
},
|
|
11541
|
+
{
|
|
11542
|
+
"name": "_hsva",
|
|
11543
|
+
"type": {
|
|
11544
|
+
"text": "Hsva"
|
|
11545
|
+
},
|
|
11546
|
+
"default": "{ h: 0, s: 0, v: 0, a: 1 }",
|
|
11547
|
+
"fieldName": "_hsva"
|
|
11548
|
+
},
|
|
11549
|
+
{
|
|
11550
|
+
"name": "_grad",
|
|
11551
|
+
"type": {
|
|
11552
|
+
"text": "Gradient | null"
|
|
11553
|
+
},
|
|
11554
|
+
"default": "null",
|
|
11555
|
+
"fieldName": "_grad"
|
|
11556
|
+
},
|
|
11557
|
+
{
|
|
11558
|
+
"name": "_stop",
|
|
11559
|
+
"type": {
|
|
11560
|
+
"text": "number"
|
|
11561
|
+
},
|
|
11562
|
+
"default": "0",
|
|
11563
|
+
"fieldName": "_stop"
|
|
11564
|
+
},
|
|
11565
|
+
{
|
|
11566
|
+
"name": "_brand",
|
|
11567
|
+
"type": {
|
|
11568
|
+
"text": "ColorSwatch[]"
|
|
11569
|
+
},
|
|
11570
|
+
"default": "[]",
|
|
11571
|
+
"fieldName": "_brand"
|
|
11572
|
+
},
|
|
11573
|
+
{
|
|
11574
|
+
"name": "_recent",
|
|
11575
|
+
"type": {
|
|
11576
|
+
"text": "string[]"
|
|
11577
|
+
},
|
|
11578
|
+
"default": "[]",
|
|
11579
|
+
"fieldName": "_recent"
|
|
11580
|
+
},
|
|
11581
|
+
{
|
|
11582
|
+
"name": "_drafts",
|
|
11583
|
+
"type": {
|
|
11584
|
+
"text": "Record<string, string>"
|
|
11585
|
+
},
|
|
11586
|
+
"default": "{}",
|
|
11587
|
+
"description": "Text in a box while it differs from the colour, keyed by box.",
|
|
11588
|
+
"fieldName": "_drafts"
|
|
11589
|
+
},
|
|
11590
|
+
{
|
|
11591
|
+
"name": "strings",
|
|
11592
|
+
"type": {
|
|
11593
|
+
"text": "Record<string, Message> | null | undefined"
|
|
11594
|
+
},
|
|
11595
|
+
"description": "Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation).",
|
|
11596
|
+
"fieldName": "strings",
|
|
11597
|
+
"inheritedFrom": {
|
|
11598
|
+
"name": "CmLocalizedElement",
|
|
11599
|
+
"module": "src/localize.ts"
|
|
11600
|
+
}
|
|
11601
|
+
}
|
|
11602
|
+
],
|
|
11603
|
+
"superclass": {
|
|
11604
|
+
"name": "CmLocalizedElement",
|
|
11605
|
+
"module": "/src/localize.js"
|
|
11606
|
+
},
|
|
11607
|
+
"tagName": "cm-color-picker",
|
|
11608
|
+
"customElement": true
|
|
11609
|
+
}
|
|
11610
|
+
],
|
|
11611
|
+
"exports": [
|
|
11612
|
+
{
|
|
11613
|
+
"kind": "js",
|
|
11614
|
+
"name": "DEFAULT_PALETTE",
|
|
11615
|
+
"declaration": {
|
|
11616
|
+
"name": "DEFAULT_PALETTE",
|
|
11617
|
+
"module": "src/components/color-picker.ts"
|
|
11618
|
+
}
|
|
11619
|
+
},
|
|
11620
|
+
{
|
|
11621
|
+
"kind": "js",
|
|
11622
|
+
"name": "CmColorPicker",
|
|
11623
|
+
"declaration": {
|
|
11624
|
+
"name": "CmColorPicker",
|
|
11625
|
+
"module": "src/components/color-picker.ts"
|
|
11626
|
+
}
|
|
11627
|
+
}
|
|
11628
|
+
]
|
|
11629
|
+
},
|
|
10334
11630
|
{
|
|
10335
11631
|
"kind": "javascript-module",
|
|
10336
11632
|
"path": "src/components/combobox.ts",
|