@upsnap/strapi 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.
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const en = {};
4
+ exports.default = en;
@@ -0,0 +1,4 @@
1
+ const en = {};
2
+ export {
3
+ en as default
4
+ };
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const React = require("react");
4
+ const jsxRuntime = require("react/jsx-runtime");
5
+ const icons = require("@strapi/icons");
6
+ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
7
+ const v = glob[path];
8
+ if (v) {
9
+ return typeof v === "function" ? v() : Promise.resolve(v);
10
+ }
11
+ return new Promise((_, reject) => {
12
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
13
+ reject.bind(
14
+ null,
15
+ new Error(
16
+ "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
17
+ )
18
+ )
19
+ );
20
+ });
21
+ };
22
+ const PLUGIN_ID = "upsnap";
23
+ const Initializer = ({ setPlugin }) => {
24
+ const ref = React.useRef(setPlugin);
25
+ React.useEffect(() => {
26
+ ref.current(PLUGIN_ID);
27
+ }, []);
28
+ return null;
29
+ };
30
+ const PluginIcon = () => /* @__PURE__ */ jsxRuntime.jsx(icons.ChartCircle, {});
31
+ const index = {
32
+ register(app) {
33
+ app.addMenuLink({
34
+ to: `plugins/${PLUGIN_ID}`,
35
+ icon: PluginIcon,
36
+ intlLabel: {
37
+ id: `${PLUGIN_ID}.plugin.name`,
38
+ defaultMessage: PLUGIN_ID
39
+ },
40
+ Component: async () => {
41
+ const { App } = await Promise.resolve().then(() => require("./App-CWtrva1J.js"));
42
+ return App;
43
+ }
44
+ });
45
+ app.registerPlugin({
46
+ id: PLUGIN_ID,
47
+ initializer: Initializer,
48
+ isReady: false,
49
+ name: PLUGIN_ID
50
+ });
51
+ },
52
+ async registerTrads({ locales }) {
53
+ return Promise.all(
54
+ locales.map(async (locale) => {
55
+ try {
56
+ const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-B4KWt_jN.js")) }), `./translations/${locale}.json`, 3);
57
+ return { data, locale };
58
+ } catch {
59
+ return { data: {}, locale };
60
+ }
61
+ })
62
+ );
63
+ }
64
+ };
65
+ exports.default = index;
@@ -0,0 +1,65 @@
1
+ import { useRef, useEffect } from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { ChartCircle } from "@strapi/icons";
4
+ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
5
+ const v = glob[path];
6
+ if (v) {
7
+ return typeof v === "function" ? v() : Promise.resolve(v);
8
+ }
9
+ return new Promise((_, reject) => {
10
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
11
+ reject.bind(
12
+ null,
13
+ new Error(
14
+ "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
15
+ )
16
+ )
17
+ );
18
+ });
19
+ };
20
+ const PLUGIN_ID = "upsnap";
21
+ const Initializer = ({ setPlugin }) => {
22
+ const ref = useRef(setPlugin);
23
+ useEffect(() => {
24
+ ref.current(PLUGIN_ID);
25
+ }, []);
26
+ return null;
27
+ };
28
+ const PluginIcon = () => /* @__PURE__ */ jsx(ChartCircle, {});
29
+ const index = {
30
+ register(app) {
31
+ app.addMenuLink({
32
+ to: `plugins/${PLUGIN_ID}`,
33
+ icon: PluginIcon,
34
+ intlLabel: {
35
+ id: `${PLUGIN_ID}.plugin.name`,
36
+ defaultMessage: PLUGIN_ID
37
+ },
38
+ Component: async () => {
39
+ const { App } = await import("./App-gQQDdsJk.mjs");
40
+ return App;
41
+ }
42
+ });
43
+ app.registerPlugin({
44
+ id: PLUGIN_ID,
45
+ initializer: Initializer,
46
+ isReady: false,
47
+ name: PLUGIN_ID
48
+ });
49
+ },
50
+ async registerTrads({ locales }) {
51
+ return Promise.all(
52
+ locales.map(async (locale) => {
53
+ try {
54
+ const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("./en-Byx4XI2L.mjs") }), `./translations/${locale}.json`, 3);
55
+ return { data, locale };
56
+ } catch {
57
+ return { data: {}, locale };
58
+ }
59
+ })
60
+ );
61
+ }
62
+ };
63
+ export {
64
+ index as default
65
+ };
@@ -0,0 +1,10 @@
1
+ declare const _default: {
2
+ register(app: any): void;
3
+ registerTrads({ locales }: {
4
+ locales: string[];
5
+ }): Promise<{
6
+ data: any;
7
+ locale: string;
8
+ }[]>;
9
+ };
10
+ export default _default;