@devx-labs/strapi-preview 1.0.4 → 1.0.5

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/README.md CHANGED
@@ -14,18 +14,9 @@ yarn add @devx-labs/strapi-preview
14
14
  bun add @devx-labs/strapi-preview
15
15
  ```
16
16
 
17
- Register the plugin in `config/plugins.ts` (Strapi only auto-discovers packages whose names start with `strapi-plugin-` this one uses a scope, so an explicit entry is needed):
17
+ Strapi auto-discovers the plugin from `node_modules` on next boot no `config/plugins.ts` entry required.
18
18
 
19
- ```ts
20
- export default () => ({
21
- 'component-preview-image': {
22
- enabled: true,
23
- resolve: '@devx-labs/strapi-preview',
24
- },
25
- });
26
- ```
27
-
28
- The plugin's internal id is `component-preview-image` (that's why the key in the config object is `component-preview-image`, not `strapi-preview`). Don't change that key.
19
+ > If you want to disable it or pass options later, the plugin's internal id is `component-preview-image` (set via `strapi.name`). Use that as the key in `config/plugins.ts`, e.g. `'component-preview-image': { enabled: false }`.
29
20
 
30
21
  Rebuild the admin:
31
22
 
@@ -5,7 +5,7 @@ const optionsController = ({ strapi }) => ({
5
5
  const result = {};
6
6
  for (const [uid, schema] of Object.entries(strapi.components)) {
7
7
  for (const attr of Object.values(schema.attributes)) {
8
- if (attr.type === "customField" && attr.customField === CUSTOM_FIELD_KEY && attr.options?.url) {
8
+ if (attr.customField === CUSTOM_FIELD_KEY && attr.options?.url) {
9
9
  result[uid] = {
10
10
  name: schema.info?.displayName || uid,
11
11
  url: attr.options.url
@@ -4,7 +4,7 @@ const optionsController = ({ strapi }) => ({
4
4
  const result = {};
5
5
  for (const [uid, schema] of Object.entries(strapi.components)) {
6
6
  for (const attr of Object.values(schema.attributes)) {
7
- if (attr.type === "customField" && attr.customField === CUSTOM_FIELD_KEY && attr.options?.url) {
7
+ if (attr.customField === CUSTOM_FIELD_KEY && attr.options?.url) {
8
8
  result[uid] = {
9
9
  name: schema.info?.displayName || uid,
10
10
  url: attr.options.url
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devx-labs/strapi-preview",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Strapi 5 plugin that adds a preview-image custom field (configured per component in the Content-Type Builder with a direct image URL) and renders a side panel in the edit view showing each component's preview image in dynamic-zone order.",
5
5
  "keywords": [
6
6
  "strapi",