@salesforce/ui-bundle-template-feature-react-file-upload 10.12.3 → 10.13.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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [10.13.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v10.12.4...v10.13.0) (2026-06-16)
7
+
8
+ **Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
9
+
10
+
11
+
12
+
13
+
14
+ ## [10.12.4](https://github.com/salesforce-experience-platform-emu/webapps/compare/v10.12.3...v10.12.4) (2026-06-16)
15
+
16
+ **Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
17
+
18
+
19
+
20
+
21
+
6
22
  ## [10.12.3](https://github.com/salesforce-experience-platform-emu/webapps/compare/v10.12.2...v10.12.3) (2026-06-15)
7
23
 
8
24
  **Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
@@ -18,8 +18,8 @@
18
18
  "graphql:schema": "node scripts/get-graphql-schema.mjs"
19
19
  },
20
20
  "dependencies": {
21
- "@salesforce/platform-sdk": "^10.12.3",
22
- "@salesforce/ui-bundle": "^10.12.3",
21
+ "@salesforce/platform-sdk": "^10.13.0",
22
+ "@salesforce/ui-bundle": "^10.13.0",
23
23
  "@tailwindcss/vite": "^4.1.17",
24
24
  "class-variance-authority": "^0.7.1",
25
25
  "clsx": "^2.1.1",
@@ -46,7 +46,7 @@
46
46
  "@graphql-eslint/eslint-plugin": "^4.1.0",
47
47
  "@graphql-tools/utils": "^11.0.0",
48
48
  "@playwright/test": "^1.49.0",
49
- "@salesforce/vite-plugin-ui-bundle": "^10.12.3",
49
+ "@salesforce/vite-plugin-ui-bundle": "^10.13.0",
50
50
  "@testing-library/jest-dom": "^6.6.3",
51
51
  "@testing-library/react": "^16.1.0",
52
52
  "@testing-library/user-event": "^14.5.2",
@@ -1,19 +1,35 @@
1
1
  /**
2
- * Thin GraphQL client: createDataSDK + sdk.graphql.query with centralized
3
- * error handling. Use with gql-tagged queries and generated operation types
4
- * for type-safe calls.
2
+ * Thin GraphQL client: createDataSDK + sdk.graphql with centralized error
3
+ * handling. Mutations are routed to sdk.graphql.mutate and everything else to
4
+ * sdk.graphql.query (the SDK rejects an operation sent to the wrong method).
5
+ * Use with gql-tagged queries and generated operation types for type-safe calls.
5
6
  */
6
7
  import { createDataSDK } from '@salesforce/platform-sdk';
7
8
 
9
+ /**
10
+ * True when the operation's first definition is a `mutation`. Strips GraphQL
11
+ * comments first so a leading `# ...` line can't mask the keyword. Queries
12
+ * (named or anonymous `{ ... }` shorthand) and subscriptions fall through to
13
+ * query().
14
+ */
15
+ function isMutation(operation: string): boolean {
16
+ return /^\s*mutation\b/.test(operation.replace(/#[^\n\r]*/g, ''));
17
+ }
18
+
8
19
  export async function executeGraphQL<TData, TVariables>(
9
- query: string,
20
+ operation: string,
10
21
  variables?: TVariables
11
22
  ): Promise<TData> {
12
23
  const data = await createDataSDK();
13
- const result = await data.graphql!.query<TData, TVariables>({
14
- query: query,
15
- variables: variables,
16
- });
24
+ const result = isMutation(operation)
25
+ ? await data.graphql!.mutate<TData, TVariables>({
26
+ mutation: operation,
27
+ variables: variables,
28
+ })
29
+ : await data.graphql!.query<TData, TVariables>({
30
+ query: operation,
31
+ variables: variables,
32
+ });
17
33
 
18
34
  if (result.errors?.length) {
19
35
  const msg = result.errors.map(e => e.message).join('; ');
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-base-sfdx-project-experimental",
3
- "version": "10.12.3",
3
+ "version": "10.13.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@salesforce/webapp-template-base-sfdx-project-experimental",
9
- "version": "10.12.3",
9
+ "version": "10.13.0",
10
10
  "license": "SEE LICENSE IN LICENSE.txt",
11
11
  "devDependencies": {
12
12
  "@lwc/eslint-plugin-lwc": "^3.3.0",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle-template-base-sfdx-project",
3
- "version": "10.12.3",
3
+ "version": "10.13.0",
4
4
  "description": "Base SFDX project template",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "publishConfig": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle-template-feature-react-file-upload",
3
- "version": "10.12.3",
3
+ "version": "10.13.0",
4
4
  "description": "File upload feature with a component to upload files to core",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "",
@@ -40,7 +40,7 @@
40
40
  }
41
41
  },
42
42
  "devDependencies": {
43
- "@salesforce/ui-bundle": "^10.12.3",
43
+ "@salesforce/ui-bundle": "^10.13.0",
44
44
  "@types/react": "^19.2.7",
45
45
  "@types/react-dom": "^19.2.3",
46
46
  "nodemon": "^3.1.0",