Spectrum Web Components 2.0

Hi all!

Has anyone tried the current Sectrum Web Components (SWC UXP Wrappers 2.0) in InDesign? Has anything changed regarding the implementation? Not according to the documentation.

@spectrum-web-components/theme”: “^0.42.3”,
@swc-uxp-wrappers/button”: “^1.1.1”,
@swc-uxp-wrappers/utils”: “^1.0.0”

vs.

@spectrum-web-components/theme”: “^0.49.0”,
@swc-uxp-wrappers/utils”: “^2.0.1”,
@swc-uxp-wrappers/button”: “^2.0.0”

Roland

What version of Spectrum do you wrap with wrappers? Did you update those as well?

Also somewhere in documentation/sample I have seen some magic version numbers we should use… but not sure what is currently recommended number and where to find it. Some docs mentioned you should use very specific version numbers instead of the latest ones.

Adobe writes in the documentation: ”Note: With UXP v8.0.0, all the SWC components in UXP are locked to version 0.37.0.”

But I don’t wrap them myself, I used the current version of NPM:
SWC UXP Wrappers in version 2.0.0 is linked to @spectrum-web-components/button version 0.37.0

I found this @swc-uxp-wrappers/create-swc-uxp-app on npm. Does that mean we can or should create them ourselves?

Can you share parts of your package.json?

What do you have in resolutions? uxp-photoshop-plugin-samples/swc-uxp-starter/package.json at main · AdobeDocs/uxp-photoshop-plugin-samples · GitHub

This is the old package.json that works:

{
  ...,
  "dependencies": {
		"@spectrum-web-components/theme": "^0.42.3",
		"@swc-uxp-wrappers/button": "^1.1.1",
		"@swc-uxp-wrappers/utils": "^1.0.0"
  },
  "devDependencies": {
    "@adobe/cc-ext-uxp-types": "^7.3.1",
    "@types/node": "^22.7.7",
    "esbuild": "^0.24.0"
  },
  "types": "types",
  "config": {
    "app": "Adobe InDesign CC2023+",
    "distributionFolderPath": "./pkg"
  }
}

It does not work with:

“@spectrum-web-components/theme”: “^0.49.0”,
“@swc-uxp-wrappers/utils”: “^2.0.1”,
“@swc-uxp-wrappers/button”: “^2.0.0”

I don’t see resolutions in there. And I don’t see what it wraps.

I do not use yarn but npm as in the documentation. Maybe that is the problem. I will look at it. Thanks!

I don’t see resolutions in there.

In my test with UXP 8.0.1 in PS and version 2 wrappers, no more resolutions were necessary. This seems to have changed now.
The correct version for the components themselves is 0.37.0, as listed here.

Ok… then I have no clue how it works. I had it working on my machine but decided not to use it yet.

This is an example snippet of the manifest.json if working with React:

  "dependencies": {
    "@swc-react/action-button": "0.37.0",
    "@swc-react/theme": "0.37.0",
    "@swc-uxp-wrappers/action-button": "^2.0.0",
    "@swc-uxp-wrappers/utils": "^2.0.1",
  },

It seems to be due to the @spectrum-web-component/theme version. From version 0.48.0 upwards, no custom properties are loaded for the theme. Don’t ask me why.