@salesforce/vite-plugin-lwc-ui-bundle 11.13.2 → 11.15.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/index.d.ts +33 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +103 -6
- package/dist/index.js.map +1 -1
- package/dist/plugins/generate-meta-xml.d.ts +13 -0
- package/dist/plugins/generate-meta-xml.d.ts.map +1 -0
- package/dist/providers/access-check.d.ts.map +1 -1
- package/dist/providers/gate.d.ts.map +1 -1
- package/dist/providers/i18n.d.ts +16 -0
- package/dist/providers/i18n.d.ts.map +1 -1
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +3 -178
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/labels-graphql/index.d.ts.map +1 -1
- package/dist/providers/labels-graphql/index.js +12 -3
- package/dist/providers/labels-graphql/index.js.map +1 -1
- package/dist/providers/labels-graphql/runtime.d.ts +21 -14
- package/dist/providers/labels-graphql/runtime.d.ts.map +1 -1
- package/dist/providers/labels-graphql/runtime.js +39 -26
- package/dist/providers/labels-graphql/runtime.js.map +1 -1
- package/dist/providers/platform-graphql/constants.d.ts +15 -0
- package/dist/providers/platform-graphql/constants.d.ts.map +1 -0
- package/dist/providers/platform-graphql/i18n-static.d.ts +19 -0
- package/dist/providers/platform-graphql/i18n-static.d.ts.map +1 -0
- package/dist/providers/platform-graphql/index.d.ts +58 -0
- package/dist/providers/platform-graphql/index.d.ts.map +1 -0
- package/dist/providers/platform-graphql/index.js +312 -0
- package/dist/providers/platform-graphql/index.js.map +1 -0
- package/dist/providers/platform-graphql/runtime.d.ts +30 -0
- package/dist/providers/platform-graphql/runtime.d.ts.map +1 -0
- package/dist/providers/platform-graphql/runtime.js +189 -0
- package/dist/providers/platform-graphql/runtime.js.map +1 -0
- package/dist/types.d.ts +29 -0
- package/dist/types.d.ts.map +1 -1
- package/docs/consumer-guide.md +120 -4
- package/package.json +5 -5
- package/skills/setup-lwc-vite-plugin/SKILL.md +44 -1
- package/skills/setup-lwc-vite-plugin/references/known-pitfalls.md +57 -0
package/dist/providers/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { i as i18n, platformGraphql } from "./platform-graphql/index.js";
|
|
1
2
|
import { lds } from "./lds/index.js";
|
|
2
3
|
import { labelsGraphql } from "./labels-graphql/index.js";
|
|
3
4
|
const LABEL_DEFAULTS = {
|
|
@@ -29,184 +30,6 @@ function label(overrides = {}) {
|
|
|
29
30
|
}
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
|
-
const BROWSER_DERIVED = /* @__PURE__ */ new Set([
|
|
33
|
-
"lang",
|
|
34
|
-
"dir",
|
|
35
|
-
"locale",
|
|
36
|
-
"currency",
|
|
37
|
-
"timeZone",
|
|
38
|
-
"firstDayOfWeek"
|
|
39
|
-
]);
|
|
40
|
-
const STATIC_DEFAULTS = {
|
|
41
|
-
"dateTime.shortDateFormat": "M/d/yyyy",
|
|
42
|
-
"dateTime.mediumDateFormat": "MMM d, yyyy",
|
|
43
|
-
"dateTime.longDateFormat": "MMMM d, yyyy",
|
|
44
|
-
"dateTime.shortTimeFormat": "h:mm a",
|
|
45
|
-
"dateTime.mediumTimeFormat": "h:mm:ss a",
|
|
46
|
-
"dateTime.longTimeFormat": "h:mm:ss a z",
|
|
47
|
-
"dateTime.shortDateTimeFormat": "M/d/yyyy, h:mm a",
|
|
48
|
-
"number.numberFormat": "#,##0.##",
|
|
49
|
-
"number.currencyFormat": "¤#,##0.00",
|
|
50
|
-
"number.decimalSeparator": ".",
|
|
51
|
-
"number.groupingSeparator": ",",
|
|
52
|
-
"number.percentFormat": "#,##0%",
|
|
53
|
-
"number.percentSign": "%",
|
|
54
|
-
"number.plusSign": "+",
|
|
55
|
-
"number.minusSign": "-",
|
|
56
|
-
"number.exponentialSign": "E",
|
|
57
|
-
"number.superscriptingExponentSign": "×",
|
|
58
|
-
"number.perMilleSign": "‰",
|
|
59
|
-
"number.infinity": "∞",
|
|
60
|
-
"number.nan": "NaN",
|
|
61
|
-
"number.currencySymbol": "$",
|
|
62
|
-
defaultCalendar: "gregory",
|
|
63
|
-
defaultNumberingSystem: "latn"
|
|
64
|
-
};
|
|
65
|
-
const MONTHS_WIDE = [
|
|
66
|
-
"January",
|
|
67
|
-
"February",
|
|
68
|
-
"March",
|
|
69
|
-
"April",
|
|
70
|
-
"May",
|
|
71
|
-
"June",
|
|
72
|
-
"July",
|
|
73
|
-
"August",
|
|
74
|
-
"September",
|
|
75
|
-
"October",
|
|
76
|
-
"November",
|
|
77
|
-
"December"
|
|
78
|
-
];
|
|
79
|
-
const MONTHS_ABBR = [
|
|
80
|
-
"Jan",
|
|
81
|
-
"Feb",
|
|
82
|
-
"Mar",
|
|
83
|
-
"Apr",
|
|
84
|
-
"May",
|
|
85
|
-
"Jun",
|
|
86
|
-
"Jul",
|
|
87
|
-
"Aug",
|
|
88
|
-
"Sep",
|
|
89
|
-
"Oct",
|
|
90
|
-
"Nov",
|
|
91
|
-
"Dec"
|
|
92
|
-
];
|
|
93
|
-
const DAYS_WIDE = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
94
|
-
const DAYS_ABBR = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
95
|
-
const OBJECT_DEFAULTS = {
|
|
96
|
-
"common.digits": { latn: "0123456789" },
|
|
97
|
-
"common.calendarData": {
|
|
98
|
-
gregory: { calendarSystem: "solar", eras: {} }
|
|
99
|
-
},
|
|
100
|
-
calendarData: {
|
|
101
|
-
gregory: {
|
|
102
|
-
months: {
|
|
103
|
-
format: {
|
|
104
|
-
wide: MONTHS_WIDE,
|
|
105
|
-
abbreviated: MONTHS_ABBR,
|
|
106
|
-
narrow: MONTHS_ABBR
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
days: {
|
|
110
|
-
format: {
|
|
111
|
-
wide: DAYS_WIDE,
|
|
112
|
-
abbreviated: DAYS_ABBR,
|
|
113
|
-
narrow: DAYS_ABBR
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
dayPeriods: {
|
|
117
|
-
format: {
|
|
118
|
-
wide: ["AM", "PM"],
|
|
119
|
-
abbreviated: ["am", "pm"],
|
|
120
|
-
narrow: ["a", "p"]
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
eras: {
|
|
124
|
-
eraAbbr: ["AD"],
|
|
125
|
-
eraNames: ["Anno Domini"],
|
|
126
|
-
eraNarrow: ["A"]
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
const RUNTIME_SOURCE = `
|
|
132
|
-
const RTL_LANGS = new Set([
|
|
133
|
-
'ar', 'arc', 'dv', 'fa', 'ha', 'he', 'khw', 'ks', 'ku', 'ps', 'ur', 'yi',
|
|
134
|
-
]);
|
|
135
|
-
|
|
136
|
-
function getLocale() {
|
|
137
|
-
if (typeof navigator === 'undefined') return 'en-US';
|
|
138
|
-
return navigator.language || 'en-US';
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function getLang() {
|
|
142
|
-
return getLocale().split('-')[0];
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function getDir() {
|
|
146
|
-
return RTL_LANGS.has(getLang()) ? 'rtl' : 'ltr';
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
function getCurrency() {
|
|
150
|
-
try {
|
|
151
|
-
const parts = new Intl.NumberFormat(getLocale(), {
|
|
152
|
-
style: 'currency',
|
|
153
|
-
currency: 'USD',
|
|
154
|
-
currencyDisplay: 'code',
|
|
155
|
-
}).resolvedOptions();
|
|
156
|
-
return parts.currency || 'USD';
|
|
157
|
-
} catch {
|
|
158
|
-
return 'USD';
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function getTimeZone() {
|
|
163
|
-
try {
|
|
164
|
-
return Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC';
|
|
165
|
-
} catch {
|
|
166
|
-
return 'UTC';
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function getFirstDayOfWeek() {
|
|
171
|
-
try {
|
|
172
|
-
const loc = new Intl.Locale(getLocale());
|
|
173
|
-
if (loc.weekInfo) return String(loc.weekInfo.firstDay);
|
|
174
|
-
if (typeof loc.getWeekInfo === 'function') return String(loc.getWeekInfo().firstDay);
|
|
175
|
-
} catch { /* unsupported in this browser */ }
|
|
176
|
-
return '7';
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
const values = {
|
|
180
|
-
lang: getLang(),
|
|
181
|
-
dir: getDir(),
|
|
182
|
-
locale: getLocale(),
|
|
183
|
-
currency: getCurrency(),
|
|
184
|
-
timeZone: getTimeZone(),
|
|
185
|
-
firstDayOfWeek: getFirstDayOfWeek(),
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
export default values['__KEY__'];
|
|
189
|
-
`;
|
|
190
|
-
function i18n(options = {}) {
|
|
191
|
-
const { staticOverrides = {}, objectOverrides = {} } = options;
|
|
192
|
-
const statics = { ...STATIC_DEFAULTS, ...staticOverrides };
|
|
193
|
-
const objects = { ...OBJECT_DEFAULTS, ...objectOverrides };
|
|
194
|
-
return {
|
|
195
|
-
prefix: "@salesforce/i18n/",
|
|
196
|
-
resolve(specifier) {
|
|
197
|
-
if (!specifier.startsWith("@salesforce/i18n/")) return null;
|
|
198
|
-
const key = specifier.slice("@salesforce/i18n/".length);
|
|
199
|
-
if (BROWSER_DERIVED.has(key)) {
|
|
200
|
-
return RUNTIME_SOURCE.replace("__KEY__", key);
|
|
201
|
-
}
|
|
202
|
-
if (key in objects) {
|
|
203
|
-
return `export default ${JSON.stringify(objects[key])};`;
|
|
204
|
-
}
|
|
205
|
-
const value = statics[key] ?? key;
|
|
206
|
-
return `export default ${JSON.stringify(value)};`;
|
|
207
|
-
}
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
33
|
function gate(overrides = {}) {
|
|
211
34
|
return {
|
|
212
35
|
prefix: "@salesforce/gate/",
|
|
@@ -388,6 +211,7 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
388
211
|
messageChannel,
|
|
389
212
|
messageService,
|
|
390
213
|
navigation,
|
|
214
|
+
platformGraphql,
|
|
391
215
|
primitiveUtils
|
|
392
216
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
393
217
|
export {
|
|
@@ -403,6 +227,7 @@ export {
|
|
|
403
227
|
messageChannel,
|
|
404
228
|
messageService,
|
|
405
229
|
navigation,
|
|
230
|
+
platformGraphql,
|
|
406
231
|
primitiveUtils
|
|
407
232
|
};
|
|
408
233
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/providers/label.ts","../../src/providers/i18n.ts","../../src/providers/gate.ts","../../src/providers/access-check.ts","../../src/providers/apex.ts","../../src/providers/client.ts","../../src/providers/message-channel.ts","../../src/providers/message-service.ts","../../src/providers/navigation.ts","../../src/providers/primitive-utils.ts"],"sourcesContent":["/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\nconst LABEL_DEFAULTS: Record<string, string> = {\n\t\"LightningForm.edit\": \"Edit\",\n\t\"LightningForm.save\": \"Save\",\n\t\"LightningForm.cancel\": \"Cancel\",\n\t\"LightningForm.error\": \"Error\",\n\t\"RecordDetailUC.Expand\": \"Expand\",\n\t\"RecordDetailUC.Collapse\": \"Collapse\",\n\t\"Global_Entity.created_by\": \"Created By\",\n\t\"Global_Entity.last_modified_by\": \"Last Modified By\",\n\t\"DetailError.GenericSaveError\": \"An error occurred while saving.\",\n\t\"MobileWebError.NoPreEditAccess\": \"You don't have access to edit this record.\",\n\t\"DuplicateList.ToastMessageBlock\": \"Duplicate records were found.\",\n\t\"DuplicateList.NonBlockingHeaderText\": \"Duplicate records found\",\n\t\"DuplicateList.ToastMessageAlertEdit\": \"Duplicate records were found. You can continue editing.\",\n\t\"Errors.ErrorPopoverHeading\": \"Error\",\n};\n\nexport function label(overrides: Record<string, string> = {}): Provider {\n\tconst defaults = { ...LABEL_DEFAULTS, ...overrides };\n\treturn {\n\t\tprefix: \"@salesforce/label/\",\n\t\tresolve(specifier) {\n\t\t\tif (!specifier.startsWith(\"@salesforce/label/\")) return null;\n\n\t\t\tconst key = specifier.slice(\"@salesforce/label/\".length);\n\t\t\tconst fallbackLabel = key\n\t\t\t\t.split(\".\")\n\t\t\t\t.at(-1)!\n\t\t\t\t.replace(/([a-z0-9])([A-Z])/g, \"$1 $2\")\n\t\t\t\t.replace(/_/g, \" \")\n\t\t\t\t.trim();\n\t\t\tconst value = defaults[key] ?? fallbackLabel;\n\t\t\treturn `export default ${JSON.stringify(value)};`;\n\t\t},\n\t};\n}\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\nconst BROWSER_DERIVED = new Set([\n\t\"lang\",\n\t\"dir\",\n\t\"locale\",\n\t\"currency\",\n\t\"timeZone\",\n\t\"firstDayOfWeek\",\n]);\n\nconst STATIC_DEFAULTS: Record<string, string> = {\n\t\"dateTime.shortDateFormat\": \"M/d/yyyy\",\n\t\"dateTime.mediumDateFormat\": \"MMM d, yyyy\",\n\t\"dateTime.longDateFormat\": \"MMMM d, yyyy\",\n\t\"dateTime.shortTimeFormat\": \"h:mm a\",\n\t\"dateTime.mediumTimeFormat\": \"h:mm:ss a\",\n\t\"dateTime.longTimeFormat\": \"h:mm:ss a z\",\n\t\"dateTime.shortDateTimeFormat\": \"M/d/yyyy, h:mm a\",\n\t\"number.numberFormat\": \"#,##0.##\",\n\t\"number.currencyFormat\": \"¤#,##0.00\",\n\t\"number.decimalSeparator\": \".\",\n\t\"number.groupingSeparator\": \",\",\n\t\"number.percentFormat\": \"#,##0%\",\n\t\"number.percentSign\": \"%\",\n\t\"number.plusSign\": \"+\",\n\t\"number.minusSign\": \"-\",\n\t\"number.exponentialSign\": \"E\",\n\t\"number.superscriptingExponentSign\": \"×\",\n\t\"number.perMilleSign\": \"‰\",\n\t\"number.infinity\": \"∞\",\n\t\"number.nan\": \"NaN\",\n\t\"number.currencySymbol\": \"$\",\n\tdefaultCalendar: \"gregory\",\n\tdefaultNumberingSystem: \"latn\",\n};\n\nconst MONTHS_WIDE = [\n\t\"January\",\n\t\"February\",\n\t\"March\",\n\t\"April\",\n\t\"May\",\n\t\"June\",\n\t\"July\",\n\t\"August\",\n\t\"September\",\n\t\"October\",\n\t\"November\",\n\t\"December\",\n];\nconst MONTHS_ABBR = [\n\t\"Jan\",\n\t\"Feb\",\n\t\"Mar\",\n\t\"Apr\",\n\t\"May\",\n\t\"Jun\",\n\t\"Jul\",\n\t\"Aug\",\n\t\"Sep\",\n\t\"Oct\",\n\t\"Nov\",\n\t\"Dec\",\n];\nconst DAYS_WIDE = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\nconst DAYS_ABBR = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\n\nconst OBJECT_DEFAULTS: Record<string, unknown> = {\n\t\"common.digits\": { latn: \"0123456789\" },\n\t\"common.calendarData\": {\n\t\tgregory: { calendarSystem: \"solar\", eras: {} },\n\t},\n\tcalendarData: {\n\t\tgregory: {\n\t\t\tmonths: {\n\t\t\t\tformat: {\n\t\t\t\t\twide: MONTHS_WIDE,\n\t\t\t\t\tabbreviated: MONTHS_ABBR,\n\t\t\t\t\tnarrow: MONTHS_ABBR,\n\t\t\t\t},\n\t\t\t},\n\t\t\tdays: {\n\t\t\t\tformat: {\n\t\t\t\t\twide: DAYS_WIDE,\n\t\t\t\t\tabbreviated: DAYS_ABBR,\n\t\t\t\t\tnarrow: DAYS_ABBR,\n\t\t\t\t},\n\t\t\t},\n\t\t\tdayPeriods: {\n\t\t\t\tformat: {\n\t\t\t\t\twide: [\"AM\", \"PM\"],\n\t\t\t\t\tabbreviated: [\"am\", \"pm\"],\n\t\t\t\t\tnarrow: [\"a\", \"p\"],\n\t\t\t\t},\n\t\t\t},\n\t\t\teras: {\n\t\t\t\teraAbbr: [\"AD\"],\n\t\t\t\teraNames: [\"Anno Domini\"],\n\t\t\t\teraNarrow: [\"A\"],\n\t\t\t},\n\t\t},\n\t},\n};\n\nconst RUNTIME_SOURCE = `\nconst RTL_LANGS = new Set([\n 'ar', 'arc', 'dv', 'fa', 'ha', 'he', 'khw', 'ks', 'ku', 'ps', 'ur', 'yi',\n]);\n\nfunction getLocale() {\n if (typeof navigator === 'undefined') return 'en-US';\n return navigator.language || 'en-US';\n}\n\nfunction getLang() {\n return getLocale().split('-')[0];\n}\n\nfunction getDir() {\n return RTL_LANGS.has(getLang()) ? 'rtl' : 'ltr';\n}\n\nfunction getCurrency() {\n try {\n const parts = new Intl.NumberFormat(getLocale(), {\n style: 'currency',\n currency: 'USD',\n currencyDisplay: 'code',\n }).resolvedOptions();\n return parts.currency || 'USD';\n } catch {\n return 'USD';\n }\n}\n\nfunction getTimeZone() {\n try {\n return Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC';\n } catch {\n return 'UTC';\n }\n}\n\nfunction getFirstDayOfWeek() {\n try {\n const loc = new Intl.Locale(getLocale());\n if (loc.weekInfo) return String(loc.weekInfo.firstDay);\n if (typeof loc.getWeekInfo === 'function') return String(loc.getWeekInfo().firstDay);\n } catch { /* unsupported in this browser */ }\n return '7';\n}\n\nconst values = {\n lang: getLang(),\n dir: getDir(),\n locale: getLocale(),\n currency: getCurrency(),\n timeZone: getTimeZone(),\n firstDayOfWeek: getFirstDayOfWeek(),\n};\n\nexport default values['__KEY__'];\n`;\n\nexport interface I18nOptions {\n\tstaticOverrides?: Record<string, string>;\n\tobjectOverrides?: Record<string, unknown>;\n}\n\nexport function i18n(options: I18nOptions = {}): Provider {\n\tconst { staticOverrides = {}, objectOverrides = {} } = options;\n\tconst statics = { ...STATIC_DEFAULTS, ...staticOverrides };\n\tconst objects = { ...OBJECT_DEFAULTS, ...objectOverrides };\n\n\treturn {\n\t\tprefix: \"@salesforce/i18n/\",\n\t\tresolve(specifier) {\n\t\t\tif (!specifier.startsWith(\"@salesforce/i18n/\")) return null;\n\n\t\t\tconst key = specifier.slice(\"@salesforce/i18n/\".length);\n\n\t\t\tif (BROWSER_DERIVED.has(key)) {\n\t\t\t\treturn RUNTIME_SOURCE.replace(\"__KEY__\", key);\n\t\t\t}\n\n\t\t\tif (key in objects) {\n\t\t\t\treturn `export default ${JSON.stringify(objects[key])};`;\n\t\t\t}\n\n\t\t\tconst value = statics[key] ?? key;\n\t\t\treturn `export default ${JSON.stringify(value)};`;\n\t\t},\n\t};\n}\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\nexport function gate(overrides: Record<string, boolean> = {}): Provider {\n\treturn {\n\t\tprefix: \"@salesforce/gate/\",\n\t\tresolve(specifier) {\n\t\t\tif (!specifier.startsWith(\"@salesforce/gate/\")) return null;\n\t\t\tconst name = specifier.slice(\"@salesforce/gate/\".length);\n\t\t\tconst isOpen = overrides[name] ?? true;\n\t\t\treturn `export default { isOpen: () => ${isOpen} };`;\n\t\t},\n\t};\n}\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\nexport function accessCheck(overrides: Record<string, boolean> = {}): Provider {\n\treturn {\n\t\tprefix: \"@salesforce/accessCheck/\",\n\t\tresolve(specifier) {\n\t\t\tif (!specifier.startsWith(\"@salesforce/accessCheck/\")) return null;\n\t\t\tconst name = specifier.slice(\"@salesforce/accessCheck/\".length);\n\t\t\tconst value = overrides[name] ?? false;\n\t\t\treturn `export default ${value};`;\n\t\t},\n\t};\n}\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\nconst PREFIX = \"@salesforce/apex/\";\n\nconst STUB_SOURCE = `\nconst UNSUPPORTED_MSG = '[LWC UI Bundle] Imperative Apex (@salesforce/apex) is not supported in static bundles. Use the Platform Data SDK instead.';\n\nexport default async function apexStub() {\n console.warn(UNSUPPORTED_MSG);\n throw new Error(UNSUPPORTED_MSG);\n}\n`;\n\nexport function apex(): Provider {\n\treturn {\n\t\tprefix: PREFIX,\n\t\tresolve(specifier) {\n\t\t\tif (!specifier.startsWith(PREFIX)) return null;\n\t\t\treturn STUB_SOURCE;\n\t\t},\n\t};\n}\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\nconst FORM_FACTOR_SOURCE = `\nfunction getFormFactor() {\n if (typeof window === 'undefined') return 'Large';\n if (window.matchMedia('(max-width: 767px)').matches) return 'Small';\n if (window.matchMedia('(max-width: 1023px)').matches) return 'Medium';\n return 'Large';\n}\n\nexport default getFormFactor();\n`;\n\nexport function client(): Provider {\n\treturn {\n\t\tprefix: \"@salesforce/client/\",\n\t\tresolve(specifier) {\n\t\t\tif (specifier === \"@salesforce/client/formFactor\") {\n\t\t\t\treturn FORM_FACTOR_SOURCE;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t};\n}\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\nconst PREFIX = \"@salesforce/messageChannel/\";\n\nexport function messageChannel(): Provider {\n\treturn {\n\t\tprefix: PREFIX,\n\t\tresolve(specifier) {\n\t\t\tif (!specifier.startsWith(PREFIX)) return null;\n\t\t\treturn `export default Symbol('${specifier}:stub');`;\n\t\t},\n\t};\n}\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\nconst SPECIFIER = \"lightning/messageService\";\n\nconst STUB_SOURCE = `\nconst WARN_MSG = '[LWC UI Bundle] lightning/messageService is not supported in static bundles.';\n\nexport function createMessageContext() { return {}; }\nexport function releaseMessageContext() {}\nexport function publish(_ctx, _channel, _message) {\n console.warn(WARN_MSG);\n}\nexport function subscribe(_ctx, _channel, _handler, _options) {\n console.warn(WARN_MSG);\n return {};\n}\nexport function unsubscribe(_subscription) {}\nexport const APPLICATION_SCOPE = Symbol('APPLICATION_SCOPE');\nexport const MessageContext = {};\nexport default {\n createMessageContext,\n releaseMessageContext,\n publish,\n subscribe,\n unsubscribe,\n APPLICATION_SCOPE,\n MessageContext,\n};\n`;\n\nexport function messageService(): Provider {\n\treturn {\n\t\tmatch(id) {\n\t\t\treturn id === SPECIFIER;\n\t\t},\n\t\tresolve(specifier) {\n\t\t\tif (specifier !== SPECIFIER) return null;\n\t\t\treturn STUB_SOURCE;\n\t\t},\n\t};\n}\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\nconst SPECIFIER = \"lightning/navigation\";\n\nconst STUB_SOURCE = `\nconst WARN_MSG = '[LWC UI Bundle] lightning/navigation is not supported in static bundles.';\n\nexport const NavigationMixin = (Base) => {\n return class extends Base {\n [Symbol.for('NavigationMixin.Navigate')](pageRef, replace) {\n console.warn(WARN_MSG, { pageRef, replace });\n }\n [Symbol.for('NavigationMixin.GenerateUrl')](pageRef) {\n console.warn(WARN_MSG, { pageRef });\n return Promise.resolve('#');\n }\n };\n};\n\nNavigationMixin.Navigate = Symbol.for('NavigationMixin.Navigate');\nNavigationMixin.GenerateUrl = Symbol.for('NavigationMixin.GenerateUrl');\n\nexport default NavigationMixin;\n`;\n\nexport function navigation(): Provider {\n\treturn {\n\t\tmatch(id) {\n\t\t\treturn id === SPECIFIER;\n\t\t},\n\t\tresolve(specifier) {\n\t\t\tif (specifier !== SPECIFIER) return null;\n\t\t\treturn STUB_SOURCE;\n\t\t},\n\t};\n}\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\nexport function primitiveUtils(): Provider {\n\treturn {\n\t\tprefix: \"lightning/primitiveUtils\",\n\t\tmatch(id) {\n\t\t\treturn id === \"lightning/primitiveUtils\";\n\t\t},\n\t\tresolve(specifier) {\n\t\t\tif (specifier !== \"lightning/primitiveUtils\") return null;\n\n\t\t\treturn `export function normalizeBoolean(value) {\n return typeof value === 'string' || !!value;\n}\n\nexport function reflectAttribute(element, attrName, value) {\n if (!element) return;\n if (typeof value === 'string') {\n element.setAttribute(attrName, value);\n } else if (value === true) {\n element.setAttribute(attrName, '');\n } else if (!value) {\n element.removeAttribute(attrName);\n } else {\n console.warn(\\`Invalid attribute value for \"\\${attrName}\": \\${value}\\`);\n }\n}\n`;\n\t\t},\n\t};\n}\n"],"names":["PREFIX","STUB_SOURCE","SPECIFIER"],"mappings":";;AAOA,MAAM,iBAAyC;AAAA,EAC9C,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EACxB,uBAAuB;AAAA,EACvB,yBAAyB;AAAA,EACzB,2BAA2B;AAAA,EAC3B,4BAA4B;AAAA,EAC5B,kCAAkC;AAAA,EAClC,gCAAgC;AAAA,EAChC,kCAAkC;AAAA,EAClC,mCAAmC;AAAA,EACnC,uCAAuC;AAAA,EACvC,uCAAuC;AAAA,EACvC,8BAA8B;AAC/B;AAEO,SAAS,MAAM,YAAoC,IAAc;AACvE,QAAM,WAAW,EAAE,GAAG,gBAAgB,GAAG,UAAA;AACzC,SAAO;AAAA,IACN,QAAQ;AAAA,IACR,QAAQ,WAAW;AAClB,UAAI,CAAC,UAAU,WAAW,oBAAoB,EAAG,QAAO;AAExD,YAAM,MAA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,cAAc,UAAW,QAAO;AACpC,aAAO;AAAA,IACR;AAAA,EAAA;AAEF;ACjCO,SAAS,iBAA2B;AAC1C,SAAO;AAAA,IACN,QAAQ;AAAA,IACR,MAAM,IAAI;AACT,aAAO,OAAO;AAAA,IACf;AAAA,IACA,QAAQ,WAAW;AAClB,UAAI,cAAc,2BAA4B,QAAO;AAErD,aAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAiBR;AAAA,EAAA;AAEF;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/providers/label.ts","../../src/providers/gate.ts","../../src/providers/access-check.ts","../../src/providers/apex.ts","../../src/providers/client.ts","../../src/providers/message-channel.ts","../../src/providers/message-service.ts","../../src/providers/navigation.ts","../../src/providers/primitive-utils.ts"],"sourcesContent":["/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\nconst LABEL_DEFAULTS: Record<string, string> = {\n\t\"LightningForm.edit\": \"Edit\",\n\t\"LightningForm.save\": \"Save\",\n\t\"LightningForm.cancel\": \"Cancel\",\n\t\"LightningForm.error\": \"Error\",\n\t\"RecordDetailUC.Expand\": \"Expand\",\n\t\"RecordDetailUC.Collapse\": \"Collapse\",\n\t\"Global_Entity.created_by\": \"Created By\",\n\t\"Global_Entity.last_modified_by\": \"Last Modified By\",\n\t\"DetailError.GenericSaveError\": \"An error occurred while saving.\",\n\t\"MobileWebError.NoPreEditAccess\": \"You don't have access to edit this record.\",\n\t\"DuplicateList.ToastMessageBlock\": \"Duplicate records were found.\",\n\t\"DuplicateList.NonBlockingHeaderText\": \"Duplicate records found\",\n\t\"DuplicateList.ToastMessageAlertEdit\": \"Duplicate records were found. You can continue editing.\",\n\t\"Errors.ErrorPopoverHeading\": \"Error\",\n};\n\nexport function label(overrides: Record<string, string> = {}): Provider {\n\tconst defaults = { ...LABEL_DEFAULTS, ...overrides };\n\treturn {\n\t\tprefix: \"@salesforce/label/\",\n\t\tresolve(specifier) {\n\t\t\tif (!specifier.startsWith(\"@salesforce/label/\")) return null;\n\n\t\t\tconst key = specifier.slice(\"@salesforce/label/\".length);\n\t\t\tconst fallbackLabel = key\n\t\t\t\t.split(\".\")\n\t\t\t\t.at(-1)!\n\t\t\t\t.replace(/([a-z0-9])([A-Z])/g, \"$1 $2\")\n\t\t\t\t.replace(/_/g, \" \")\n\t\t\t\t.trim();\n\t\t\tconst value = defaults[key] ?? fallbackLabel;\n\t\t\treturn `export default ${JSON.stringify(value)};`;\n\t\t},\n\t};\n}\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\n// Static resolution by design — and it must stay static. A GraphQL field for\n// gate state exists (uiapi.platform.gates) but is restricted to a UiTier context\n// and is NOT reachable off-core: verified against the org it returns either\n// \"Field 'gates' is undefined\" or \"'platform.gates' can only be executed in a\n// UiTier context.\" So unlike i18n / userPermission / customPermission / label\n// (which DO resolve off-core via platform-graphql / labels-graphql), gates have\n// no off-core GraphQL path; they resolve from build-time overrides (W-22167030).\nexport function gate(overrides: Record<string, boolean> = {}): Provider {\n\treturn {\n\t\tprefix: \"@salesforce/gate/\",\n\t\tresolve(specifier) {\n\t\t\tif (!specifier.startsWith(\"@salesforce/gate/\")) return null;\n\t\t\tconst name = specifier.slice(\"@salesforce/gate/\".length);\n\t\t\tconst isOpen = overrides[name] ?? true;\n\t\t\treturn `export default { isOpen: () => ${isOpen} };`;\n\t\t},\n\t};\n}\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\n// Static build-time resolution — now an OPT-OUT. By default,\n// @salesforce/accessCheck/* resolves at runtime via GraphQL\n// (uiapi.platform.userPermissions) through builtins.platformGraphql(); see\n// providers/platform-graphql. Use this static provider explicitly when you want\n// build-time-only access-check values with no runtime fetch (W-22167030).\nexport function accessCheck(overrides: Record<string, boolean> = {}): Provider {\n\treturn {\n\t\tprefix: \"@salesforce/accessCheck/\",\n\t\tresolve(specifier) {\n\t\t\tif (!specifier.startsWith(\"@salesforce/accessCheck/\")) return null;\n\t\t\tconst name = specifier.slice(\"@salesforce/accessCheck/\".length);\n\t\t\tconst value = overrides[name] ?? false;\n\t\t\treturn `export default ${value};`;\n\t\t},\n\t};\n}\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\nconst PREFIX = \"@salesforce/apex/\";\n\nconst STUB_SOURCE = `\nconst UNSUPPORTED_MSG = '[LWC UI Bundle] Imperative Apex (@salesforce/apex) is not supported in static bundles. Use the Platform Data SDK instead.';\n\nexport default async function apexStub() {\n console.warn(UNSUPPORTED_MSG);\n throw new Error(UNSUPPORTED_MSG);\n}\n`;\n\nexport function apex(): Provider {\n\treturn {\n\t\tprefix: PREFIX,\n\t\tresolve(specifier) {\n\t\t\tif (!specifier.startsWith(PREFIX)) return null;\n\t\t\treturn STUB_SOURCE;\n\t\t},\n\t};\n}\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\nconst FORM_FACTOR_SOURCE = `\nfunction getFormFactor() {\n if (typeof window === 'undefined') return 'Large';\n if (window.matchMedia('(max-width: 767px)').matches) return 'Small';\n if (window.matchMedia('(max-width: 1023px)').matches) return 'Medium';\n return 'Large';\n}\n\nexport default getFormFactor();\n`;\n\nexport function client(): Provider {\n\treturn {\n\t\tprefix: \"@salesforce/client/\",\n\t\tresolve(specifier) {\n\t\t\tif (specifier === \"@salesforce/client/formFactor\") {\n\t\t\t\treturn FORM_FACTOR_SOURCE;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t};\n}\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\nconst PREFIX = \"@salesforce/messageChannel/\";\n\nexport function messageChannel(): Provider {\n\treturn {\n\t\tprefix: PREFIX,\n\t\tresolve(specifier) {\n\t\t\tif (!specifier.startsWith(PREFIX)) return null;\n\t\t\treturn `export default Symbol('${specifier}:stub');`;\n\t\t},\n\t};\n}\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\nconst SPECIFIER = \"lightning/messageService\";\n\nconst STUB_SOURCE = `\nconst WARN_MSG = '[LWC UI Bundle] lightning/messageService is not supported in static bundles.';\n\nexport function createMessageContext() { return {}; }\nexport function releaseMessageContext() {}\nexport function publish(_ctx, _channel, _message) {\n console.warn(WARN_MSG);\n}\nexport function subscribe(_ctx, _channel, _handler, _options) {\n console.warn(WARN_MSG);\n return {};\n}\nexport function unsubscribe(_subscription) {}\nexport const APPLICATION_SCOPE = Symbol('APPLICATION_SCOPE');\nexport const MessageContext = {};\nexport default {\n createMessageContext,\n releaseMessageContext,\n publish,\n subscribe,\n unsubscribe,\n APPLICATION_SCOPE,\n MessageContext,\n};\n`;\n\nexport function messageService(): Provider {\n\treturn {\n\t\tmatch(id) {\n\t\t\treturn id === SPECIFIER;\n\t\t},\n\t\tresolve(specifier) {\n\t\t\tif (specifier !== SPECIFIER) return null;\n\t\t\treturn STUB_SOURCE;\n\t\t},\n\t};\n}\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\nconst SPECIFIER = \"lightning/navigation\";\n\nconst STUB_SOURCE = `\nconst WARN_MSG = '[LWC UI Bundle] lightning/navigation is not supported in static bundles.';\n\nexport const NavigationMixin = (Base) => {\n return class extends Base {\n [Symbol.for('NavigationMixin.Navigate')](pageRef, replace) {\n console.warn(WARN_MSG, { pageRef, replace });\n }\n [Symbol.for('NavigationMixin.GenerateUrl')](pageRef) {\n console.warn(WARN_MSG, { pageRef });\n return Promise.resolve('#');\n }\n };\n};\n\nNavigationMixin.Navigate = Symbol.for('NavigationMixin.Navigate');\nNavigationMixin.GenerateUrl = Symbol.for('NavigationMixin.GenerateUrl');\n\nexport default NavigationMixin;\n`;\n\nexport function navigation(): Provider {\n\treturn {\n\t\tmatch(id) {\n\t\t\treturn id === SPECIFIER;\n\t\t},\n\t\tresolve(specifier) {\n\t\t\tif (specifier !== SPECIFIER) return null;\n\t\t\treturn STUB_SOURCE;\n\t\t},\n\t};\n}\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport type { Provider } from \"../types\";\n\nexport function primitiveUtils(): Provider {\n\treturn {\n\t\tprefix: \"lightning/primitiveUtils\",\n\t\tmatch(id) {\n\t\t\treturn id === \"lightning/primitiveUtils\";\n\t\t},\n\t\tresolve(specifier) {\n\t\t\tif (specifier !== \"lightning/primitiveUtils\") return null;\n\n\t\t\treturn `export function normalizeBoolean(value) {\n return typeof value === 'string' || !!value;\n}\n\nexport function reflectAttribute(element, attrName, value) {\n if (!element) return;\n if (typeof value === 'string') {\n element.setAttribute(attrName, value);\n } else if (value === true) {\n element.setAttribute(attrName, '');\n } else if (!value) {\n element.removeAttribute(attrName);\n } else {\n console.warn(\\`Invalid attribute value for \"\\${attrName}\": \\${value}\\`);\n }\n}\n`;\n\t\t},\n\t};\n}\n"],"names":["PREFIX","STUB_SOURCE","SPECIFIER"],"mappings":";;;AAOA,MAAM,iBAAyC;AAAA,EAC9C,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EACxB,uBAAuB;AAAA,EACvB,yBAAyB;AAAA,EACzB,2BAA2B;AAAA,EAC3B,4BAA4B;AAAA,EAC5B,kCAAkC;AAAA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ClB,UAAI,cAAc,UAAW,QAAO;AACpC,aAAO;AAAA,IACR;AAAA,EAAA;AAEF;ACjCO,SAAS,iBAA2B;AAC1C,SAAO;AAAA,IACN,QAAQ;AAAA,IACR,MAAM,IAAI;AACT,aAAO,OAAO;AAAA,IACf;AAAA,IACA,QAAQ,WAAW;AAClB,UAAI,cAAc,2BAA4B,QAAO;AAErD,aAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAiBR;AAAA,EAAA;AAEF;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/labels-graphql/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE9D,YAAY,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAsBpD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,MAAM,CAwBxE;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/labels-graphql/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE9D,YAAY,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAsBpD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,MAAM,CAwBxE;AAmBD,iBAAS,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAM1C;AAED,eAAO,MAAM,QAAQ;;;CAAqC,CAAC;AAC3D,YAAY,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -44,10 +44,19 @@ function labelsGraphql(options = {}) {
|
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
function generateLabelModule(key, fallback) {
|
|
47
|
+
const k = JSON.stringify(key);
|
|
48
|
+
const fb = JSON.stringify(fallback);
|
|
47
49
|
return [
|
|
48
|
-
`import { getLabel } from "${RUNTIME_MODULE_ID}";`,
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
`import { getLabel, subscribe as __subscribe } from "${RUNTIME_MODULE_ID}";`,
|
|
51
|
+
// Default export: the build-time string (resolves synchronously to the
|
|
52
|
+
// fallback, then to the cached org value on subsequent reads). This is the
|
|
53
|
+
// standard @salesforce/label contract and stays a plain string.
|
|
54
|
+
`const label = getLabel(${k}, ${fb});`,
|
|
55
|
+
`export default label;`,
|
|
56
|
+
// Opt-in reactive accessor: `subscribe(cb)` fires with the current value
|
|
57
|
+
// immediately and again when the runtime's GraphQL fetch resolves the real
|
|
58
|
+
// org value, so a component can reflect the resolved label in the DOM.
|
|
59
|
+
`export function subscribe(callback) { return __subscribe(${k}, ${fb}, callback); }`
|
|
51
60
|
].join("\n");
|
|
52
61
|
}
|
|
53
62
|
function camelFallback(key) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/providers/labels-graphql/constants.ts","../../../src/providers/labels-graphql/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\n\n/** The scoped-module prefix for Salesforce custom label imports. */\nexport const LABEL_PREFIX = \"@salesforce/label/\";\n\n/** Vite virtual-module prefix for resolved label modules. */\nexport const VIRTUAL_LABEL_PREFIX = \"\\0sf-label-graphql:\";\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport { readFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport type { Plugin } from \"vite\";\nimport { LABEL_PREFIX, VIRTUAL_LABEL_PREFIX } from \"./constants\";\nimport type { LabelsGraphqlOptions, LabelKey } from \"./types\";\n\nexport type { LabelsGraphqlOptions } from \"./types\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\nconst RUNTIME_MODULE_ID = \"\\0sf-labels-graphql-runtime\";\n\nconst STATIC_DEFAULTS: Record<string, string> = {\n\t\"LightningForm.edit\": \"Edit\",\n\t\"LightningForm.save\": \"Save\",\n\t\"LightningForm.cancel\": \"Cancel\",\n\t\"LightningForm.error\": \"Error\",\n\t\"RecordDetailUC.Expand\": \"Expand\",\n\t\"RecordDetailUC.Collapse\": \"Collapse\",\n\t\"Global_Entity.created_by\": \"Created By\",\n\t\"Global_Entity.last_modified_by\": \"Last Modified By\",\n\t\"DetailError.GenericSaveError\": \"An error occurred while saving.\",\n\t\"MobileWebError.NoPreEditAccess\": \"You don't have access to edit this record.\",\n\t\"DuplicateList.ToastMessageBlock\": \"Duplicate records were found.\",\n\t\"DuplicateList.NonBlockingHeaderText\": \"Duplicate records found\",\n\t\"DuplicateList.ToastMessageAlertEdit\": \"Duplicate records were found. You can continue editing.\",\n\t\"Errors.ErrorPopoverHeading\": \"Error\",\n};\n\n/**\n * Runtime GraphQL-backed label resolution.\n *\n * Each `@salesforce/label/c.foo` import becomes a module that calls into a\n * shared runtime. The runtime batches label keys and fetches their translated\n * values via UI API GraphQL at runtime, ensuring labels reflect the current\n * user's locale.\n */\nexport function labelsGraphql(options: LabelsGraphqlOptions = {}): Plugin {\n\tconst overrides = { ...STATIC_DEFAULTS, ...(options.staticOverrides ?? {}) };\n\n\treturn {\n\t\tname: \"vite-plugin-labels-graphql\",\n\t\tenforce: \"pre\",\n\n\t\tresolveId(id) {\n\t\t\tif (id === RUNTIME_MODULE_ID) return RUNTIME_MODULE_ID;\n\t\t\tif (!id.startsWith(LABEL_PREFIX)) return null;\n\t\t\treturn VIRTUAL_LABEL_PREFIX + id;\n\t\t},\n\n\t\tload(id) {\n\t\t\tif (id === RUNTIME_MODULE_ID) {\n\t\t\t\treturn readFileSync(join(__dirname, \"runtime.js\"), \"utf-8\");\n\t\t\t}\n\t\t\tif (!id.startsWith(VIRTUAL_LABEL_PREFIX)) return null;\n\t\t\tconst specifier = id.slice(VIRTUAL_LABEL_PREFIX.length);\n\t\t\tconst key = specifier.slice(LABEL_PREFIX.length);\n\t\t\tconst fallback = overrides[key] ?? camelFallback(key);\n\t\t\treturn generateLabelModule(key, fallback);\n\t\t},\n\t};\n}\n\nfunction generateLabelModule(key: string, fallback: string): string {\n\treturn [\n\t\t`import { getLabel } from \"${RUNTIME_MODULE_ID}\";`,\n\t\t`const label = getLabel(${
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/providers/labels-graphql/constants.ts","../../../src/providers/labels-graphql/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\n\n/** The scoped-module prefix for Salesforce custom label imports. */\nexport const LABEL_PREFIX = \"@salesforce/label/\";\n\n/** Vite virtual-module prefix for resolved label modules. */\nexport const VIRTUAL_LABEL_PREFIX = \"\\0sf-label-graphql:\";\n","/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport { readFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport type { Plugin } from \"vite\";\nimport { LABEL_PREFIX, VIRTUAL_LABEL_PREFIX } from \"./constants\";\nimport type { LabelsGraphqlOptions, LabelKey } from \"./types\";\n\nexport type { LabelsGraphqlOptions } from \"./types\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\nconst RUNTIME_MODULE_ID = \"\\0sf-labels-graphql-runtime\";\n\nconst STATIC_DEFAULTS: Record<string, string> = {\n\t\"LightningForm.edit\": \"Edit\",\n\t\"LightningForm.save\": \"Save\",\n\t\"LightningForm.cancel\": \"Cancel\",\n\t\"LightningForm.error\": \"Error\",\n\t\"RecordDetailUC.Expand\": \"Expand\",\n\t\"RecordDetailUC.Collapse\": \"Collapse\",\n\t\"Global_Entity.created_by\": \"Created By\",\n\t\"Global_Entity.last_modified_by\": \"Last Modified By\",\n\t\"DetailError.GenericSaveError\": \"An error occurred while saving.\",\n\t\"MobileWebError.NoPreEditAccess\": \"You don't have access to edit this record.\",\n\t\"DuplicateList.ToastMessageBlock\": \"Duplicate records were found.\",\n\t\"DuplicateList.NonBlockingHeaderText\": \"Duplicate records found\",\n\t\"DuplicateList.ToastMessageAlertEdit\": \"Duplicate records were found. You can continue editing.\",\n\t\"Errors.ErrorPopoverHeading\": \"Error\",\n};\n\n/**\n * Runtime GraphQL-backed label resolution.\n *\n * Each `@salesforce/label/c.foo` import becomes a module that calls into a\n * shared runtime. The runtime batches label keys and fetches their translated\n * values via UI API GraphQL at runtime, ensuring labels reflect the current\n * user's locale.\n */\nexport function labelsGraphql(options: LabelsGraphqlOptions = {}): Plugin {\n\tconst overrides = { ...STATIC_DEFAULTS, ...(options.staticOverrides ?? {}) };\n\n\treturn {\n\t\tname: \"vite-plugin-labels-graphql\",\n\t\tenforce: \"pre\",\n\n\t\tresolveId(id) {\n\t\t\tif (id === RUNTIME_MODULE_ID) return RUNTIME_MODULE_ID;\n\t\t\tif (!id.startsWith(LABEL_PREFIX)) return null;\n\t\t\treturn VIRTUAL_LABEL_PREFIX + id;\n\t\t},\n\n\t\tload(id) {\n\t\t\tif (id === RUNTIME_MODULE_ID) {\n\t\t\t\treturn readFileSync(join(__dirname, \"runtime.js\"), \"utf-8\");\n\t\t\t}\n\t\t\tif (!id.startsWith(VIRTUAL_LABEL_PREFIX)) return null;\n\t\t\tconst specifier = id.slice(VIRTUAL_LABEL_PREFIX.length);\n\t\t\tconst key = specifier.slice(LABEL_PREFIX.length);\n\t\t\tconst fallback = overrides[key] ?? camelFallback(key);\n\t\t\treturn generateLabelModule(key, fallback);\n\t\t},\n\t};\n}\n\nfunction generateLabelModule(key: string, fallback: string): string {\n\tconst k = JSON.stringify(key);\n\tconst fb = JSON.stringify(fallback);\n\treturn [\n\t\t`import { getLabel, subscribe as __subscribe } from \"${RUNTIME_MODULE_ID}\";`,\n\t\t// Default export: the build-time string (resolves synchronously to the\n\t\t// fallback, then to the cached org value on subsequent reads). This is the\n\t\t// standard @salesforce/label contract and stays a plain string.\n\t\t`const label = getLabel(${k}, ${fb});`,\n\t\t`export default label;`,\n\t\t// Opt-in reactive accessor: `subscribe(cb)` fires with the current value\n\t\t// immediately and again when the runtime's GraphQL fetch resolves the real\n\t\t// org value, so a component can reflect the resolved label in the DOM.\n\t\t`export function subscribe(callback) { return __subscribe(${k}, ${fb}, callback); }`,\n\t].join(\"\\n\");\n}\n\nfunction camelFallback(key: string): string {\n\tconst tail = key.slice(1 + key.lastIndexOf(\".\"));\n\treturn tail\n\t\t.replace(/([a-z0-9])([A-Z])/g, \"$1 $2\")\n\t\t.replace(/_/g, \" \")\n\t\t.trim();\n}\n\nexport const __test__ = { camelFallback, STATIC_DEFAULTS };\nexport type { LabelKey };\n"],"names":["__dirname"],"mappings":";;;AAOO,MAAM,eAAe;AAGrB,MAAM,uBAAuB;ACIpC,MAAMA,cAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;AACxD,MAAM,oBAAoB;AAE1B,MAAM,kBAA0C;AAAA,EAC/C,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EACxB,uBAAuB;AAAA,EACvB,yBAAyB;AAAA,EACzB,2BAA2B;AAAA,EAC3B,4BAA4B;AAAA,EAC5B,kCAAkC;AAAA,EAClC,gCAAgC;AAAA,EAChC,kCAAkC;AAAA,EAClC,mCAAmC;AAAA,EACnC,uCAAuC;AAAA,EACvC,uCAAuC;AAAA,EACvC,8BAA8B;AAC/B;AAUO,SAAS,cAAc,UAAgC,IAAY;AACzE,QAAM,YAAY,EAAE,GAAG,iBAAiB,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ved value. The callback fires immediately with the
|
|
8
|
+
* current value (fallback if not yet resolved) and again when the runtime's
|
|
9
|
+
* GraphQL fetch resolves the real org value. Returns an unsubscribe function.
|
|
10
|
+
*
|
|
11
|
+
* The default `@salesforce/label/*` export stays a plain build-time string for
|
|
12
|
+
* back-compat; this opt-in accessor is what lets a component reactively reflect
|
|
13
|
+
* the resolved value once it arrives.
|
|
14
|
+
*/
|
|
15
|
+
export declare function subscribe(key: string, fallback: string, callback: (value: string) => void): () => void;
|
|
6
16
|
export declare function getApiShape(): Promise<boolean>;
|
|
7
17
|
export declare function getLabel(key: string, fallback: string): string;
|
|
8
18
|
export declare function groupByNamespace(keys: string[]): Map<string, string[]>;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
}
|
|
19
|
+
/**
|
|
20
|
+
* Fetch labels through the Platform Data SDK — the single, surface-aware GraphQL
|
|
21
|
+
* path. `createDataSDK()` resolves to a direct session-authenticated GraphQL
|
|
22
|
+
* request on a full-page WebApp / Micro-Frontend surface, or to the
|
|
23
|
+
* window.openai.callTool bridge on the OpenAI/MCP surface. There is no separate
|
|
24
|
+
* transport fallback: when no data surface is available the labels simply keep
|
|
25
|
+
* their build-time fallback values (handled by the caller).
|
|
26
|
+
*
|
|
27
|
+
* @returns The response normalized to `{ data, errors }`, or `{}` when no data
|
|
28
|
+
* surface is available.
|
|
29
|
+
*/
|
|
22
30
|
export declare function graphqlFetch(query: string, variables: Record<string, unknown>): Promise<unknown>;
|
|
23
31
|
/** Reset internal state — exposed for tests only. */
|
|
24
32
|
export declare function __resetForTest(): void;
|
|
25
|
-
export {};
|
|
26
33
|
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/providers/labels-graphql/runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/providers/labels-graphql/runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CACxB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAC/B,MAAM,IAAI,CAYZ;AA4CD,wBAAgB,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAK9C;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM9D;AA8CD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAWtE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,YAAY,CACjC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,OAAO,CAAC,OAAO,CAAC,CA2BlB;AAED,qDAAqD;AACrD,wBAAgB,cAAc,IAAI,IAAI,CAMrC"}
|
|
@@ -2,7 +2,26 @@ const labelCache = /* @__PURE__ */ new Map();
|
|
|
2
2
|
const pendingKeys = /* @__PURE__ */ new Set();
|
|
3
3
|
let fetchScheduled = false;
|
|
4
4
|
let probePromise = null;
|
|
5
|
-
const
|
|
5
|
+
const subscribers = /* @__PURE__ */ new Map();
|
|
6
|
+
function subscribe(key, fallback, callback) {
|
|
7
|
+
let set = subscribers.get(key);
|
|
8
|
+
if (!set) {
|
|
9
|
+
set = /* @__PURE__ */ new Set();
|
|
10
|
+
subscribers.set(key, set);
|
|
11
|
+
}
|
|
12
|
+
set.add(callback);
|
|
13
|
+
callback(getLabel(key, fallback));
|
|
14
|
+
return () => {
|
|
15
|
+
subscribers.get(key)?.delete(callback);
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function setResolved(key, value) {
|
|
19
|
+
if (labelCache.get(key) === value) return;
|
|
20
|
+
labelCache.set(key, value);
|
|
21
|
+
const set = subscribers.get(key);
|
|
22
|
+
if (set) for (const cb of set) cb(value);
|
|
23
|
+
}
|
|
24
|
+
const QUERY_264 = `query Labels($namespace: String, $names: [String!]!) {
|
|
6
25
|
uiapi {
|
|
7
26
|
platform {
|
|
8
27
|
labels(namespace: $namespace, names: $names) {
|
|
@@ -13,7 +32,7 @@ const QUERY_264 = `query Labels($namespace: String, $names: [String!]) {
|
|
|
13
32
|
}
|
|
14
33
|
}
|
|
15
34
|
}`;
|
|
16
|
-
const QUERY_262 = `query Labels($namespace: String, $names: [String!]) {
|
|
35
|
+
const QUERY_262 = `query Labels($namespace: String, $names: [String!]!) {
|
|
17
36
|
uiapi {
|
|
18
37
|
labels(namespace: $namespace, names: $names) {
|
|
19
38
|
namespace
|
|
@@ -67,7 +86,7 @@ async function fetchLabelsFromOrg(keys) {
|
|
|
67
86
|
const labels = isPlatform ? responseTyped?.data?.uiapi?.platform?.labels ?? [] : responseTyped?.data?.uiapi?.labels ?? [];
|
|
68
87
|
for (const item of labels) {
|
|
69
88
|
const ns = item.namespace ?? namespace;
|
|
70
|
-
|
|
89
|
+
setResolved(ns + "." + item.name, item.value);
|
|
71
90
|
}
|
|
72
91
|
} catch (e) {
|
|
73
92
|
console.warn("[labels-graphql] Runtime fetch failed:", e);
|
|
@@ -88,36 +107,29 @@ function groupByNamespace(keys) {
|
|
|
88
107
|
return grouped;
|
|
89
108
|
}
|
|
90
109
|
async function graphqlFetch(query, variables) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const sdk = window.openai;
|
|
96
|
-
if (typeof sdk.callTool === "function") {
|
|
97
|
-
return sdk.callTool("graphqlQuery", { query, variables });
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
const endpoint = typeof window !== "undefined" ? window.__SF_GRAPHQL_ENDPOINT__ : void 0;
|
|
101
|
-
if (!endpoint) {
|
|
110
|
+
let createDataSDK;
|
|
111
|
+
try {
|
|
112
|
+
({ createDataSDK } = await import("@salesforce/platform-sdk"));
|
|
113
|
+
} catch {
|
|
102
114
|
console.warn(
|
|
103
|
-
"[labels-graphql]
|
|
115
|
+
"[labels-graphql] @salesforce/platform-sdk is not available. Labels will use fallback values."
|
|
104
116
|
);
|
|
105
117
|
return {};
|
|
106
118
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
return res.json();
|
|
119
|
+
if (typeof createDataSDK !== "function") {
|
|
120
|
+
return {};
|
|
121
|
+
}
|
|
122
|
+
const sdk = await createDataSDK();
|
|
123
|
+
if (!sdk.graphql) {
|
|
124
|
+
return {};
|
|
125
|
+
}
|
|
126
|
+
const result = await sdk.graphql.query({ query, variables });
|
|
127
|
+
return { data: result.data, errors: result.errors };
|
|
117
128
|
}
|
|
118
129
|
function __resetForTest() {
|
|
119
130
|
labelCache.clear();
|
|
120
131
|
pendingKeys.clear();
|
|
132
|
+
subscribers.clear();
|
|
121
133
|
fetchScheduled = false;
|
|
122
134
|
probePromise = null;
|
|
123
135
|
}
|
|
@@ -126,6 +138,7 @@ export {
|
|
|
126
138
|
getApiShape,
|
|
127
139
|
getLabel,
|
|
128
140
|
graphqlFetch,
|
|
129
|
-
groupByNamespace
|
|
141
|
+
groupByNamespace,
|
|
142
|
+
subscribe
|
|
130
143
|
};
|
|
131
144
|
//# sourceMappingURL=runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sources":["../../../src/providers/labels-graphql/runtime.ts"],"sourcesContent":["/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\n\nconst labelCache = new Map<string, string>();\nconst pendingKeys = new Set<string>();\nlet fetchScheduled = false;\nlet probePromise: Promise<boolean> | null = null;\n\nconst QUERY_264 = `query Labels($namespace: String, $names: [String!]) {\n uiapi {\n platform {\n labels(namespace: $namespace, names: $names) {\n namespace\n name\n value\n }\n }\n }\n}`;\n\nconst QUERY_262 = `query Labels($namespace: String, $names: [String!]) {\n uiapi {\n labels(namespace: $namespace, names: $names) {\n namespace\n name\n value\n }\n }\n}`;\n\nasync function detectPlatformPath(): Promise<boolean> {\n\ttry {\n\t\tconst response = (await graphqlFetch(`{ uiapi { platform { __typename } } }`, {})) as {\n\t\t\tdata?: { uiapi?: { platform?: unknown } };\n\t\t\terrors?: unknown[];\n\t\t};\n\t\treturn !!response?.data?.uiapi?.platform;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport function getApiShape(): Promise<boolean> {\n\tif (!probePromise) {\n\t\tprobePromise = detectPlatformPath();\n\t}\n\treturn probePromise;\n}\n\nexport function getLabel(key: string, fallback: string): string {\n\tif (labelCache.has(key)) return labelCache.get(key)!;\n\tlabelCache.set(key, fallback);\n\tpendingKeys.add(key);\n\tscheduleFetch();\n\treturn fallback;\n}\n\nfunction scheduleFetch(): void {\n\tif (fetchScheduled) return;\n\tfetchScheduled = true;\n\tPromise.resolve().then(() => {\n\t\tfetchScheduled = false;\n\t\tif (pendingKeys.size === 0) return;\n\t\tconst keys = [...pendingKeys];\n\t\tpendingKeys.clear();\n\t\tfetchLabelsFromOrg(keys);\n\t});\n}\n\nasync function fetchLabelsFromOrg(keys: string[]): Promise<void> {\n\tconst isPlatform = await getApiShape();\n\tconst query = isPlatform ? QUERY_264 : QUERY_262;\n\tconst grouped = groupByNamespace(keys);\n\tfor (const [namespace, names] of grouped) {\n\t\tfor (let i = 0; i < names.length; i += 100) {\n\t\t\tconst batch = names.slice(i, i + 100);\n\t\t\ttry {\n\t\t\t\tconst response = await graphqlFetch(query, { namespace, names: batch });\n\t\t\t\tconst responseTyped = response as {\n\t\t\t\t\tdata?: { uiapi?: { platform?: { labels?: LabelRecord[] }; labels?: LabelRecord[] } };\n\t\t\t\t};\n\t\t\t\tconst labels = isPlatform\n\t\t\t\t\t? (responseTyped?.data?.uiapi?.platform?.labels ?? [])\n\t\t\t\t\t: (responseTyped?.data?.uiapi?.labels ?? []);\n\t\t\t\tfor (const item of labels) {\n\t\t\t\t\tconst ns = item.namespace ?? namespace;\n\t\t\t\t\
|
|
1
|
+
{"version":3,"file":"runtime.js","sources":["../../../src/providers/labels-graphql/runtime.ts"],"sourcesContent":["/**\n * Copyright (c) 2026, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\n\nconst labelCache = new Map<string, string>();\nconst pendingKeys = new Set<string>();\nlet fetchScheduled = false;\nlet probePromise: Promise<boolean> | null = null;\n\n/** Per-key subscriber callbacks, notified when a key's value changes (fallback → resolved). */\nconst subscribers = new Map<string, Set<(value: string) => void>>();\n\n/**\n * Subscribe to a label's resolved value. The callback fires immediately with the\n * current value (fallback if not yet resolved) and again when the runtime's\n * GraphQL fetch resolves the real org value. Returns an unsubscribe function.\n *\n * The default `@salesforce/label/*` export stays a plain build-time string for\n * back-compat; this opt-in accessor is what lets a component reactively reflect\n * the resolved value once it arrives.\n */\nexport function subscribe(\n\tkey: string,\n\tfallback: string,\n\tcallback: (value: string) => void,\n): () => void {\n\tlet set = subscribers.get(key);\n\tif (!set) {\n\t\tset = new Set();\n\t\tsubscribers.set(key, set);\n\t}\n\tset.add(callback);\n\t// Prime resolution (also seeds the cache + schedules the fetch) and emit current value.\n\tcallback(getLabel(key, fallback));\n\treturn () => {\n\t\tsubscribers.get(key)?.delete(callback);\n\t};\n}\n\n/** Update the cache and notify subscribers if the value actually changed. */\nfunction setResolved(key: string, value: string): void {\n\tif (labelCache.get(key) === value) return;\n\tlabelCache.set(key, value);\n\tconst set = subscribers.get(key);\n\tif (set) for (const cb of set) cb(value);\n}\n\nconst QUERY_264 = `query Labels($namespace: String, $names: [String!]!) {\n uiapi {\n platform {\n labels(namespace: $namespace, names: $names) {\n namespace\n name\n value\n }\n }\n }\n}`;\n\nconst QUERY_262 = `query Labels($namespace: String, $names: [String!]!) {\n uiapi {\n labels(namespace: $namespace, names: $names) {\n namespace\n name\n value\n }\n }\n}`;\n\nasync function detectPlatformPath(): Promise<boolean> {\n\ttry {\n\t\tconst response = (await graphqlFetch(`{ uiapi { platform { __typename } } }`, {})) as {\n\t\t\tdata?: { uiapi?: { platform?: unknown } };\n\t\t\terrors?: unknown[];\n\t\t};\n\t\treturn !!response?.data?.uiapi?.platform;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport function getApiShape(): Promise<boolean> {\n\tif (!probePromise) {\n\t\tprobePromise = detectPlatformPath();\n\t}\n\treturn probePromise;\n}\n\nexport function getLabel(key: string, fallback: string): string {\n\tif (labelCache.has(key)) return labelCache.get(key)!;\n\tlabelCache.set(key, fallback);\n\tpendingKeys.add(key);\n\tscheduleFetch();\n\treturn fallback;\n}\n\nfunction scheduleFetch(): void {\n\tif (fetchScheduled) return;\n\tfetchScheduled = true;\n\tPromise.resolve().then(() => {\n\t\tfetchScheduled = false;\n\t\tif (pendingKeys.size === 0) return;\n\t\tconst keys = [...pendingKeys];\n\t\tpendingKeys.clear();\n\t\tfetchLabelsFromOrg(keys);\n\t});\n}\n\nasync function fetchLabelsFromOrg(keys: string[]): Promise<void> {\n\tconst isPlatform = await getApiShape();\n\tconst query = isPlatform ? QUERY_264 : QUERY_262;\n\tconst grouped = groupByNamespace(keys);\n\tfor (const [namespace, names] of grouped) {\n\t\tfor (let i = 0; i < names.length; i += 100) {\n\t\t\tconst batch = names.slice(i, i + 100);\n\t\t\ttry {\n\t\t\t\tconst response = await graphqlFetch(query, { namespace, names: batch });\n\t\t\t\tconst responseTyped = response as {\n\t\t\t\t\tdata?: { uiapi?: { platform?: { labels?: LabelRecord[] }; labels?: LabelRecord[] } };\n\t\t\t\t};\n\t\t\t\tconst labels = isPlatform\n\t\t\t\t\t? (responseTyped?.data?.uiapi?.platform?.labels ?? [])\n\t\t\t\t\t: (responseTyped?.data?.uiapi?.labels ?? []);\n\t\t\t\tfor (const item of labels) {\n\t\t\t\t\tconst ns = item.namespace ?? namespace;\n\t\t\t\t\tsetResolved(ns + \".\" + item.name, item.value);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.warn(\"[labels-graphql] Runtime fetch failed:\", e);\n\t\t\t}\n\t\t}\n\t}\n}\n\ninterface LabelRecord {\n\tnamespace?: string;\n\tname: string;\n\tvalue: string;\n}\n\nexport function groupByNamespace(keys: string[]): Map<string, string[]> {\n\tconst grouped = new Map<string, string[]>();\n\tfor (const key of keys) {\n\t\tconst dot = key.indexOf(\".\");\n\t\tconst namespace = dot === -1 ? \"c\" : key.slice(0, dot);\n\t\tconst name = dot === -1 ? key : key.slice(dot + 1);\n\t\tif (name.includes(\".\")) continue;\n\t\tif (!grouped.has(namespace)) grouped.set(namespace, []);\n\t\tgrouped.get(namespace)!.push(name);\n\t}\n\treturn grouped;\n}\n\n/**\n * Fetch labels through the Platform Data SDK — the single, surface-aware GraphQL\n * path. `createDataSDK()` resolves to a direct session-authenticated GraphQL\n * request on a full-page WebApp / Micro-Frontend surface, or to the\n * window.openai.callTool bridge on the OpenAI/MCP surface. There is no separate\n * transport fallback: when no data surface is available the labels simply keep\n * their build-time fallback values (handled by the caller).\n *\n * @returns The response normalized to `{ data, errors }`, or `{}` when no data\n * surface is available.\n */\nexport async function graphqlFetch(\n\tquery: string,\n\tvariables: Record<string, unknown>,\n): Promise<unknown> {\n\tlet createDataSDK:\n\t\t| ((options?: unknown) => Promise<{\n\t\t\t\tgraphql?: { query: (opts: unknown) => Promise<{ data?: unknown; errors?: unknown }> };\n\t\t }>)\n\t\t| undefined;\n\ttry {\n\t\t({ createDataSDK } = (await import(\"@salesforce/platform-sdk\")) as unknown as {\n\t\t\tcreateDataSDK: typeof createDataSDK;\n\t\t});\n\t} catch {\n\t\tconsole.warn(\n\t\t\t\"[labels-graphql] @salesforce/platform-sdk is not available. Labels will use fallback values.\",\n\t\t);\n\t\treturn {};\n\t}\n\tif (typeof createDataSDK !== \"function\") {\n\t\treturn {};\n\t}\n\tconst sdk = await createDataSDK();\n\tif (!sdk.graphql) {\n\t\t// Surface has no data operations (e.g. MCPApps stub). Keep fallbacks.\n\t\treturn {};\n\t}\n\t// GraphQLRawDocument is a plain string; pass the query through directly.\n\tconst result = await sdk.graphql.query({ query, variables });\n\treturn { data: result.data, errors: result.errors };\n}\n\n/** Reset internal state — exposed for tests only. */\nexport function __resetForTest(): void {\n\tlabelCache.clear();\n\tpendingKeys.clear();\n\tsubscribers.clear();\n\tfetchScheduled = false;\n\tprobePromise = null;\n}\n"],"names":[],"mappings":"AAMA,MAAM,iCAAiB,IAAA;AACvB,MAAM,kCAAkB,IAAA;AACxB,IAAI,iBAAiB;AACrB,IAAI,eAAwC;AAG5C,MAAM,kCAAkB,IAAA;AAWjB,SAAS,UACf,KACA,UACA,UACa;AACb,MAAI,MAAM,YAAY,IAAI,GAAG;AAC7B,MAAI,CAAC,KAAK;AACT,8BAAU,IAAA;AACV,gBAAY,IAAI,KAAK,GAAG;AAAA,EACzB;AACA,MAAI,IAAI,QAAQ;AAEhB,WAAS,SAAS,KAAK,QAAQ,CAAC;AAChC,SAAO,MAAM;AACZ,gBAAY,IAAI,GAAG,GAAG,OAAO,QAAQ;AAAA,EACtC;AACD;AAGA,SAAS,YAAY,KAAa,OAAqB;AACtD,MAAI,WAAW,IAAI,GAAG,MAAM,MAAO;AACnC,aAAW,IAAI,KAAK,KAAK;AACzB,QAAM,MAAM,YAAY,IAAI,GAAG;AAC/B,MAAI,IAAK,YAAW,MAAM,QAAQ,KAAK;AACxC;AAEA,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYlB,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUlB,eAA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.txt file
|
|
5
|
+
*/
|
|
6
|
+
/** Scoped-module prefixes resolved via `uiapi.platform.*` GraphQL off-core. */
|
|
7
|
+
export declare const USER_PERMISSION_PREFIX = "@salesforce/userPermission/";
|
|
8
|
+
export declare const CUSTOM_PERMISSION_PREFIX = "@salesforce/customPermission/";
|
|
9
|
+
export declare const ACCESS_CHECK_PREFIX = "@salesforce/accessCheck/";
|
|
10
|
+
export declare const I18N_PREFIX = "@salesforce/i18n/";
|
|
11
|
+
/** Vite virtual-module prefix for resolved platform-graphql modules. */
|
|
12
|
+
export declare const VIRTUAL_PLATFORM_PREFIX = "\0sf-platform-graphql:";
|
|
13
|
+
/** Shared runtime module id (read-as-string and injected at build). */
|
|
14
|
+
export declare const RUNTIME_MODULE_ID = "\0sf-platform-graphql-runtime";
|
|
15
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/providers/platform-graphql/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,+EAA+E;AAC/E,eAAO,MAAM,sBAAsB,gCAAgC,CAAC;AACpE,eAAO,MAAM,wBAAwB,kCAAkC,CAAC;AACxE,eAAO,MAAM,mBAAmB,6BAA6B,CAAC;AAC9D,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAE/C,wEAAwE;AACxE,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAEhE,uEAAuE;AACvE,eAAO,MAAM,iBAAiB,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Static CLDR i18n data for `@salesforce/i18n/*` keys that have NO org GraphQL
|
|
8
|
+
* source. The locale-IDENTITY scalars (lang/dir/locale/currency/timeZone/
|
|
9
|
+
* firstDayOfWeek/defaultCalendar/defaultNumberingSystem) come from
|
|
10
|
+
* `uiapi.platform.i18n` at runtime; everything here (number/date FORMAT patterns
|
|
11
|
+
* and calendar data) is CLDR reference data, not org data, so it stays static.
|
|
12
|
+
*
|
|
13
|
+
* These tables are the SAME reference data the opt-out `i18n()` provider uses,
|
|
14
|
+
* so they are re-exported from a single source (`../i18n`) rather than
|
|
15
|
+
* duplicated — this is what keeps them from drifting (e.g. the calendar key
|
|
16
|
+
* `gregorian` vs `gregory`).
|
|
17
|
+
*/
|
|
18
|
+
export { CLDR_FORMAT_DEFAULTS as I18N_STATIC_DEFAULTS, CLDR_OBJECT_DEFAULTS as I18N_OBJECT_DEFAULTS, } from '../i18n';
|
|
19
|
+
//# sourceMappingURL=i18n-static.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n-static.d.ts","sourceRoot":"","sources":["../../../src/providers/platform-graphql/i18n-static.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;GAWG;AACH,OAAO,EACN,oBAAoB,IAAI,oBAAoB,EAC5C,oBAAoB,IAAI,oBAAoB,GAC5C,MAAM,SAAS,CAAC"}
|