strapi-plugin-radiocult-uploader 1.0.0 → 1.0.2
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 +1 -1
- package/dist/admin/{App-DTOuR7aY.js → App-BF6sl43A.js} +1 -1
- package/dist/admin/{App-Cd-TZrqC.mjs → App-CyfM4LcR.mjs} +1 -1
- package/dist/admin/{Settings-B3cZR7VF.mjs → Settings-kAsf9BQP.mjs} +1 -1
- package/dist/admin/{Settings-DHv9SmRU.js → Settings-qalA-Gda.js} +1 -1
- package/dist/admin/{index-BLAtUo_j.js → index-D14SHuJI.js} +17 -8
- package/dist/admin/{index-Dj3e3A79.mjs → index-MVv9-_DA.mjs} +17 -8
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/Panel.d.ts +7 -3
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ Built by [Sister Midnight FM](https://radio.sistermidnight.org/), a community ra
|
|
|
20
20
|
|
|
21
21
|
## Requirements
|
|
22
22
|
|
|
23
|
-
- Strapi **v5**
|
|
23
|
+
- Strapi **v5** (any 5.x, including installs still on the `@strapi/design-system` 2.0.0-rc line)
|
|
24
24
|
- Node **20+** (uploads stream files with `fs.openAsBlob`)
|
|
25
25
|
- A Radio Cult station with API access; third-party publishing (SoundCloud/Mixcloud) needs a Radio Cult plan that includes the Connect endpoints (Premium/Business or the Connect add-on)
|
|
26
26
|
|
|
@@ -6,7 +6,7 @@ const reactRouterDom = require("react-router-dom");
|
|
|
6
6
|
const designSystem = require("@strapi/design-system");
|
|
7
7
|
const React = require("react");
|
|
8
8
|
const styled = require("styled-components");
|
|
9
|
-
const index = require("./index-
|
|
9
|
+
const index = require("./index-D14SHuJI.js");
|
|
10
10
|
const tokens = require("./tokens-CDeNcvZq.js");
|
|
11
11
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
12
12
|
function _interopNamespace(e) {
|
|
@@ -4,7 +4,7 @@ import { useNavigate, useParams, Routes, Route } from "react-router-dom";
|
|
|
4
4
|
import { Main, Typography, Box, Flex, Button } from "@strapi/design-system";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import styled from "styled-components";
|
|
7
|
-
import { f as fetchStatus, P as PLATFORMS, a as PLATFORM_LABEL, b as apiError, c as fetchUiConfig, s as saveTrackDetails, u as uploadTrack, p as publishTrack } from "./index-
|
|
7
|
+
import { f as fetchStatus, P as PLATFORMS, a as PLATFORM_LABEL, b as apiError, c as fetchUiConfig, s as saveTrackDetails, u as uploadTrack, p as publishTrack } from "./index-MVv9-_DA.mjs";
|
|
8
8
|
import { u as useGoogleFont, g as googleFontHref, r as resolveFont, t as themeToCssVars } from "./tokens-ACCekCH6.mjs";
|
|
9
9
|
const HomePage = () => {
|
|
10
10
|
const navigate = useNavigate();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { Main, Typography, Flex, Box, Button, Grid, Field, TextInput, Toggle, SingleSelect, SingleSelectOption, Textarea } from "@strapi/design-system";
|
|
4
|
-
import { d as fetchSettings, e as fetchContentTypes, g as fetchDiagnostics, b as apiError, h as saveSettings, t as testConnection } from "./index-
|
|
4
|
+
import { d as fetchSettings, e as fetchContentTypes, g as fetchDiagnostics, b as apiError, h as saveSettings, t as testConnection } from "./index-MVv9-_DA.mjs";
|
|
5
5
|
import { u as useGoogleFont, g as googleFontHref, r as resolveFont, a as resolveTokens, b as tokensToCssVars, P as PRESETS, F as FONTS, E as EDITABLE_TOKENS, p as pickEditableOverrides } from "./tokens-ACCekCH6.mjs";
|
|
6
6
|
const MAPPING_FIELDS = [
|
|
7
7
|
{ key: "title", label: "Title", hint: "Track title on Radio Cult", types: ["string", "text"], required: true },
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const designSystem = require("@strapi/design-system");
|
|
6
|
-
const index = require("./index-
|
|
6
|
+
const index = require("./index-D14SHuJI.js");
|
|
7
7
|
const tokens = require("./tokens-CDeNcvZq.js");
|
|
8
8
|
function _interopNamespace(e) {
|
|
9
9
|
if (e && e.__esModule) return e;
|
|
@@ -232,19 +232,28 @@ const PanelContent = ({ documentId }) => {
|
|
|
232
232
|
const PANEL_TITLE = "Upload to Soundcloud/Mixcloud/Radio Cult";
|
|
233
233
|
let configuredType;
|
|
234
234
|
let configPromise = null;
|
|
235
|
-
const
|
|
235
|
+
const loadConfig = () => {
|
|
236
236
|
configPromise ?? (configPromise = fetchUiConfig().then(({ contentType }) => {
|
|
237
237
|
configuredType = contentType;
|
|
238
238
|
}).catch(() => {
|
|
239
239
|
configuredType = null;
|
|
240
240
|
}));
|
|
241
|
+
return configPromise;
|
|
241
242
|
};
|
|
242
243
|
const RadioCultPanel = (props) => {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
return
|
|
246
|
-
|
|
247
|
-
|
|
244
|
+
const [resolvedType, setResolvedType] = React__namespace.useState(configuredType);
|
|
245
|
+
React__namespace.useEffect(() => {
|
|
246
|
+
if (configuredType !== void 0) return;
|
|
247
|
+
let active = true;
|
|
248
|
+
loadConfig().finally(() => {
|
|
249
|
+
if (active) setResolvedType(configuredType);
|
|
250
|
+
});
|
|
251
|
+
return () => {
|
|
252
|
+
active = false;
|
|
253
|
+
};
|
|
254
|
+
}, []);
|
|
255
|
+
if (resolvedType === void 0) return null;
|
|
256
|
+
if (resolvedType !== props.model) return null;
|
|
248
257
|
if (!props.documentId) {
|
|
249
258
|
return {
|
|
250
259
|
title: PANEL_TITLE,
|
|
@@ -265,7 +274,7 @@ const plugin = {
|
|
|
265
274
|
id: `${PLUGIN_ID}.plugin.name`,
|
|
266
275
|
defaultMessage: "Radio Cult Uploader"
|
|
267
276
|
},
|
|
268
|
-
Component: () => Promise.resolve().then(() => require("./App-
|
|
277
|
+
Component: () => Promise.resolve().then(() => require("./App-BF6sl43A.js")),
|
|
269
278
|
permissions: []
|
|
270
279
|
});
|
|
271
280
|
app.createSettingSection(
|
|
@@ -284,7 +293,7 @@ const plugin = {
|
|
|
284
293
|
},
|
|
285
294
|
id: `${PLUGIN_ID}-settings`,
|
|
286
295
|
to: `radiocult-uploader`,
|
|
287
|
-
Component: () => Promise.resolve().then(() => require("./Settings-
|
|
296
|
+
Component: () => Promise.resolve().then(() => require("./Settings-qalA-Gda.js")),
|
|
288
297
|
permissions: [{ action: `plugin::${PLUGIN_ID}.settings`, subject: null }]
|
|
289
298
|
}
|
|
290
299
|
]
|
|
@@ -214,19 +214,28 @@ const PanelContent = ({ documentId }) => {
|
|
|
214
214
|
const PANEL_TITLE = "Upload to Soundcloud/Mixcloud/Radio Cult";
|
|
215
215
|
let configuredType;
|
|
216
216
|
let configPromise = null;
|
|
217
|
-
const
|
|
217
|
+
const loadConfig = () => {
|
|
218
218
|
configPromise ?? (configPromise = fetchUiConfig().then(({ contentType }) => {
|
|
219
219
|
configuredType = contentType;
|
|
220
220
|
}).catch(() => {
|
|
221
221
|
configuredType = null;
|
|
222
222
|
}));
|
|
223
|
+
return configPromise;
|
|
223
224
|
};
|
|
224
225
|
const RadioCultPanel = (props) => {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
return
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
const [resolvedType, setResolvedType] = React.useState(configuredType);
|
|
227
|
+
React.useEffect(() => {
|
|
228
|
+
if (configuredType !== void 0) return;
|
|
229
|
+
let active = true;
|
|
230
|
+
loadConfig().finally(() => {
|
|
231
|
+
if (active) setResolvedType(configuredType);
|
|
232
|
+
});
|
|
233
|
+
return () => {
|
|
234
|
+
active = false;
|
|
235
|
+
};
|
|
236
|
+
}, []);
|
|
237
|
+
if (resolvedType === void 0) return null;
|
|
238
|
+
if (resolvedType !== props.model) return null;
|
|
230
239
|
if (!props.documentId) {
|
|
231
240
|
return {
|
|
232
241
|
title: PANEL_TITLE,
|
|
@@ -247,7 +256,7 @@ const plugin = {
|
|
|
247
256
|
id: `${PLUGIN_ID}.plugin.name`,
|
|
248
257
|
defaultMessage: "Radio Cult Uploader"
|
|
249
258
|
},
|
|
250
|
-
Component: () => import("./App-
|
|
259
|
+
Component: () => import("./App-CyfM4LcR.mjs"),
|
|
251
260
|
permissions: []
|
|
252
261
|
});
|
|
253
262
|
app.createSettingSection(
|
|
@@ -266,7 +275,7 @@ const plugin = {
|
|
|
266
275
|
},
|
|
267
276
|
id: `${PLUGIN_ID}-settings`,
|
|
268
277
|
to: `radiocult-uploader`,
|
|
269
|
-
Component: () => import("./Settings-
|
|
278
|
+
Component: () => import("./Settings-kAsf9BQP.mjs"),
|
|
270
279
|
permissions: [{ action: `plugin::${PLUGIN_ID}.settings`, subject: null }]
|
|
271
280
|
}
|
|
272
281
|
]
|
package/dist/admin/index.js
CHANGED
package/dist/admin/index.mjs
CHANGED
|
@@ -5,9 +5,13 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
/**
|
|
8
|
-
* PanelComponent for content-manager's addEditViewSidePanel.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* PanelComponent for content-manager's addEditViewSidePanel.
|
|
9
|
+
*
|
|
10
|
+
* content-manager calls this inside a React component (see its
|
|
11
|
+
* DescriptionComponentRenderer), so hooks are allowed here — and they are
|
|
12
|
+
* required: that wrapper is memoised on props, so a panel that returns null
|
|
13
|
+
* while its config loads is never re-rendered when the config arrives. The
|
|
14
|
+
* state update below is what brings the panel back.
|
|
11
15
|
*/
|
|
12
16
|
export declare const RadioCultPanel: (props: {
|
|
13
17
|
model: string;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.0.
|
|
2
|
+
"version": "1.0.2",
|
|
3
3
|
"keywords": [
|
|
4
4
|
"strapi",
|
|
5
5
|
"strapi-plugin",
|
|
@@ -65,14 +65,14 @@
|
|
|
65
65
|
"yalc": "^1.0.0-pre.53"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@strapi/design-system": "^2.0.0",
|
|
69
|
-
"@strapi/icons": "^2.0.0",
|
|
68
|
+
"@strapi/design-system": "^2.0.0-rc.29",
|
|
69
|
+
"@strapi/icons": "^2.0.0-rc.29",
|
|
70
70
|
"@strapi/strapi": "^5.0.0",
|
|
71
|
-
"react": "^18.
|
|
72
|
-
"react-dom": "^18.
|
|
73
|
-
"react-intl": "^6.
|
|
74
|
-
"react-router-dom": "^6.
|
|
75
|
-
"styled-components": "^6.
|
|
71
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
72
|
+
"react-dom": "^17.0.0 || ^18.0.0",
|
|
73
|
+
"react-intl": "^6.6.2",
|
|
74
|
+
"react-router-dom": "^6.0.0",
|
|
75
|
+
"styled-components": "^6.0.0"
|
|
76
76
|
},
|
|
77
77
|
"strapi": {
|
|
78
78
|
"kind": "plugin",
|