@jsb188/mday-web 1.1.11 → 1.1.13

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.
@@ -0,0 +1,184 @@
1
+ import { compileIconMatchRules } from './log-web.helpers.ts';
2
+
3
+ // Definition order does not control priority. Tiers, match position, overlapping specificity, and stable keys do.
4
+ // Keep each alias beside its icon; use prefixes only for intentional stems, and generic terms as fallbacks.
5
+ export const ARABLE_ICON_MATCHERS = compileIconMatchRules([
6
+ {
7
+ icon: 'vegetable-lettuce-top',
8
+ tier: 'specific',
9
+ words: ['marciano', 'spretnak', 'newham', 'bokchoy'],
10
+ phrases: ['little gem', 'lil gem', 'red butter', 'green gem', 'red gem', 'bok choy'],
11
+ },
12
+ { icon: 'vegetable-lettuce-top', tier: 'fallback', words: ['gems'] },
13
+ {
14
+ icon: 'vegetable-lettuce',
15
+ tier: 'specific',
16
+ words: ['lettuce', 'lettuces', 'romaine', 'radicchio', 'treviso', 'thaddeus', 'cruced'],
17
+ phrases: ['red oak', 'braci ardenti', 'braci adenti', 'di lusia', 'di lusio'],
18
+ prefixes: ['escarol'],
19
+ },
20
+ { icon: 'vegetable-lavender', tier: 'specific', words: ['lavendar', 'lavender', 'alyssum'], phrases: ['anise hyssop'] },
21
+ { icon: 'vegetable-basil', tier: 'specific', words: ['basil'] },
22
+ { icon: 'vegetable-beet', tier: 'specific', words: ['chioggia', 'beet', 'beets', 'beetroot'], phrases: ['yellow tooth'] },
23
+ { icon: 'vegetable-broccoli', tier: 'specific', words: ['broccoli'], prefixes: ['cauliflow', 'piracicab'] },
24
+ {
25
+ icon: 'vegetable-pumpkin',
26
+ tier: 'specific',
27
+ words: ['pumpkin', 'pumpkins', 'benning'],
28
+ phrases: ['cargo pump', 'bennings green'],
29
+ },
30
+ { icon: 'vegetable-pumpkin', tier: 'fallback', words: ['pump'] },
31
+ {
32
+ icon: 'vegetable-spinach',
33
+ tier: 'specific',
34
+ words: ['mesclun', 'spinach', 'chard'],
35
+ phrases: ['mustard green', 'mustard greens'],
36
+ },
37
+ { icon: 'vegetable-spinach', tier: 'fallback', words: ['mix', 'mixes'] },
38
+ { icon: 'vegetable-tomato', tier: 'specific', words: ['tomato', 'tomatoes'] },
39
+ { icon: 'fruit-grapes', tier: 'specific', words: ['grape', 'grapes'] },
40
+ { icon: 'fruit-apricot', tier: 'specific', words: ['apricot', 'apricots', 'peach', 'peaches', 'plum', 'plums'] },
41
+ { icon: 'raspberry', tier: 'specific', prefixes: ['raspberr'] },
42
+ { icon: 'fruit-cloud-berry', tier: 'specific', prefixes: ['blackberr', 'cloudberr', 'cloud berr'] },
43
+ { icon: 'fruit-billberry-blackberry-blueberry', tier: 'specific', prefixes: ['blueberr', 'billberr', 'bilberr'] },
44
+ { icon: 'fruit-billberry-blackberry-blueberry', tier: 'fallback', patterns: ['\\p{L}*berr(?:y|ies)'] },
45
+ { icon: 'vegetable-asparagus', tier: 'specific', words: ['asparagus'] },
46
+ {
47
+ icon: 'vegetable-acornsquash',
48
+ tier: 'specific',
49
+ words: ['acornsquash'],
50
+ phrases: ['sunshine kabocha', 'acorn squash', 'yellow star patty', 'sweet pepper', 'sweet peppers', 'bell pepper', 'bell peppers'],
51
+ },
52
+ { icon: 'fruit-strawberry', tier: 'specific', prefixes: ['strawberr'] },
53
+ { icon: 'seasoning-chilli', tier: 'specific', words: ['chilli', 'chillies'] },
54
+ { icon: 'seasoning-chilli', tier: 'fallback', words: ['pepper', 'peppers'] },
55
+ { icon: 'vegetable-delicata-squash', tier: 'specific', words: ['delicata'], phrases: ['delicata squash'] },
56
+ { icon: 'vegetable-hubbard-squash', tier: 'specific', words: ['hubbard'], phrases: ['hubbard squash', 'red kuri'] },
57
+ { icon: 'vegetable-cucumber', tier: 'specific', words: ['shinto', 'cucumber', 'cucumbers', 'pickle', 'pickles'] },
58
+ {
59
+ icon: 'vegetable-butternutsquash',
60
+ tier: 'specific',
61
+ words: ['butternutsquash', 'butternut'],
62
+ phrases: ['butternut squash', 'starry night'],
63
+ },
64
+ { icon: 'vegetable-butternutsquash', tier: 'fallback', words: ['squash', 'squashes'] },
65
+ {
66
+ icon: 'vegetable-thyme',
67
+ tier: 'specific',
68
+ words: ['thyme', 'rosemary', 'savory'],
69
+ prefixes: ['summar savor', 'summer savor', 'summery savor', 'summary savor'],
70
+ },
71
+ {
72
+ icon: 'vegetable-arugula',
73
+ tier: 'specific',
74
+ words: ['arugula', 'chicory', 'puntarelle', 'frisee', 'kale'],
75
+ phrases: ['green curl'],
76
+ },
77
+ { icon: 'vegetable-arugula', tier: 'fallback', words: ['dino'] },
78
+ { icon: 'vegetable-parsley', tier: 'specific', words: ['parsley', 'wasabina', 'chervil'], phrases: ['beoc raab'] },
79
+ { icon: 'vegetable-carrot', tier: 'specific', words: ['carrot', 'carrots'] },
80
+ { icon: 'vegetable-artichoke', tier: 'specific', words: ['artichoke', 'artichokes', 'romanesco'] },
81
+ { icon: 'vegetable-artichoke', tier: 'fallback', words: ['star', 'stars'] },
82
+ { icon: 'vegetable-cabbage', tier: 'specific', prefixes: ['cabbag'] },
83
+ { icon: 'vegetable-kohlrabi', tier: 'specific', prefixes: ['kohlrab'] },
84
+ { icon: 'vegetable-zucchini', tier: 'specific', words: ['zucchini', 'zucchinis', 'zuchini'], phrases: ['midnight light'] },
85
+ { icon: 'vegetable-potato', tier: 'specific', words: ['potato', 'potatoes'] },
86
+ { icon: 'vegetable-eggplant', tier: 'specific', words: ['eggplant', 'eggplants'] },
87
+ { icon: 'vegetable-jalapeno', tier: 'specific', words: ['jalapeno', 'jalapenos', 'jalapeño', 'jalapeños'] },
88
+ {
89
+ icon: 'vegetable-stinging-kettle',
90
+ tier: 'specific',
91
+ words: ['nettle', 'nettles', 'cardoon', 'cardunculus', 'cresta', 'shiso'],
92
+ phrases: ['stinging kettle', 'cynara cardunculus'],
93
+ },
94
+ { icon: 'vegetable-okra', tier: 'specific', words: ['okra'] },
95
+ { icon: 'plant-1', tier: 'specific', words: ['sage', 'sages', 'marjoram', 'sorrel', 'mint'] },
96
+ {
97
+ icon: 'vegetable-scallion',
98
+ tier: 'specific',
99
+ words: ['scallion', 'scallions', 'scalion', 'springonion', 'springonions'],
100
+ phrases: ['spring onion', 'spring onions'],
101
+ },
102
+ { icon: 'gardening-seed-bag', tier: 'fallback', words: ['seed', 'seeds', 'seeding', 'seedling', 'seedlings'] },
103
+ { icon: 'vegetable-onion', tier: 'specific', words: ['onion', 'onions', 'shallot', 'shallots', 'matador'] },
104
+ { icon: 'vegetable-black-bean', tier: 'specific', prefixes: ['oliv'] },
105
+ { icon: 'vegetable-stringbean-1', tier: 'specific', words: ['bean', 'beans', 'stringbean', 'stringbeans'] },
106
+ { icon: 'vegetable-cilantro', tier: 'specific', words: ['cilantro'] },
107
+ { icon: 'vegetable-cilantro', tier: 'fallback', words: ['flor'] },
108
+ { icon: 'vegetable-radish', tier: 'specific', words: ['raddish', 'raddishes', 'radish', 'radishes'] },
109
+ { icon: 'vegetable-wasabi', tier: 'specific', words: ['wasabi'] },
110
+ { icon: 'flower', tier: 'fallback', words: ['flower', 'flowers'] },
111
+ // Activity aliases follow display text; update these if the corresponding i18n labels change.
112
+ { icon: 'product-growth-tree-box', tier: 'activity', words: ['soil'] },
113
+ { icon: 'gardening-sprinkler', tier: 'activity', words: ['irrigation'] },
114
+ { icon: 'agriculture-machine-seeder', tier: 'activity', phrases: ['direct seed', 'direct seeding'] },
115
+ { icon: 'organic-bag-leaf', tier: 'activity', words: ['fertilization'] },
116
+ { icon: 'gardening-tools-1', tier: 'activity', phrases: ['crop protection'] },
117
+ { icon: 'farming-barn-sun', tier: 'activity', phrases: ['crop monitoring'] },
118
+ { icon: 'farming-barn-sun', tier: 'fallback', words: ['field', 'fields'] },
119
+ { icon: 'gardening-scissors', tier: 'activity', words: ['pruning'] },
120
+ { icon: 'barbed-wire-fence', tier: 'activity', words: ['trellising'] },
121
+ { icon: 'protein-gluten-wheat', tier: 'activity', phrases: ['preparing crops'] },
122
+ { icon: 'harvest-product', tier: 'activity', phrases: ['grading produce', 'moving produce'] },
123
+ { icon: 'harvest-product', tier: 'fallback', words: ['crop', 'crops'] },
124
+ { icon: 'crop-info-biotech-1', tier: 'activity', phrases: ['estimating yield', 'other harvest'] },
125
+ { icon: 'warehouse-storage', tier: 'activity', phrases: ['post harvest'] },
126
+ { icon: 'temperature-control-warehouse-1', tier: 'activity', phrases: ['cold storage temperature'] },
127
+ { icon: 'receipt-dollar', tier: 'activity', words: ['sale', 'sales'] },
128
+ { icon: 'organic-flask', tier: 'activity', phrases: ['water testing', 'chlorine level'] },
129
+ ]);
130
+
131
+ export const FARMERS_MARKET_ICON_MATCHERS = compileIconMatchRules([{ icon: 'farming-hay', tier: 'specific', words: ['hay'] }]);
132
+
133
+ export const FOOD_MANUFACTURING_DEFAULT_ICON = 'meal-can';
134
+
135
+ export const FOOD_MANUFACTURING_ICON_MATCHERS = compileIconMatchRules([
136
+ {
137
+ icon: FOOD_MANUFACTURING_DEFAULT_ICON,
138
+ tier: 'fallback',
139
+ words: ['can', 'cans', 'canned', 'canning', 'tin', 'tins', 'tinned'],
140
+ phrases: ['canned goods', 'canned food', 'canned foods', 'tin can', 'tin cans'],
141
+ },
142
+ {
143
+ icon: 'exotic-food-rolls',
144
+ tier: 'specific',
145
+ words: ['lumpia'],
146
+ phrases: ['spring roll', 'spring rolls', 'egg roll', 'egg rolls', 'fried roll', 'fried rolls'],
147
+ },
148
+ { icon: 'pasta-cavatappi', tier: 'specific', prefixes: ['cavatap'] },
149
+ // A named pasta type wins over the generic pasta fallback, regardless of its position in the text.
150
+ { icon: 'pasta-cavatappi', tier: 'fallback', words: ['pasta', 'pastas'] },
151
+ { icon: 'pasta-farfalle', tier: 'specific', prefixes: ['farfal'] },
152
+ { icon: 'pasta-fusili', tier: 'specific', prefixes: ['fusil', 'fussil'] },
153
+ { icon: 'pasta-lasagne', tier: 'specific', prefixes: ['lasagn', 'lasang'] },
154
+ { icon: 'pasta-penne', tier: 'specific', words: ['penne', 'pene', 'penni'] },
155
+ { icon: 'pasta-ravioli', tier: 'specific', prefixes: ['raviol'] },
156
+ { icon: 'pasta-rigatoni', tier: 'specific', prefixes: ['rigaton'] },
157
+ {
158
+ icon: 'salami',
159
+ tier: 'specific',
160
+ // Match word-start stems and common spelling variants, allowing incomplete or misspelled endings.
161
+ prefixes: [
162
+ 'salam',
163
+ 'choriz',
164
+ 'choris',
165
+ 'soppres',
166
+ 'sopres',
167
+ 'capicol',
168
+ 'cappicol',
169
+ 'capocol',
170
+ 'bologn',
171
+ 'balogn',
172
+ 'bolon',
173
+ 'balon',
174
+ 'pepperon',
175
+ 'peperon',
176
+ ],
177
+ },
178
+ {
179
+ icon: 'wood-material-1',
180
+ tier: 'specific',
181
+ words: ['meatloaf', 'meatloaves'],
182
+ phrases: ['meat loaf', 'meat loaves'],
183
+ },
184
+ ]);