@geekron/strapi 0.2.1 → 0.2.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/dist/admin/index.js +18 -2
- package/dist/admin/index.mjs +18 -2
- package/dist/server/index.js +165 -176
- package/dist/server/index.mjs +165 -176
- package/package.json +2 -2
- package/i18n/translations/en/admin.json +0 -10
- package/i18n/translations/en/auth.json +0 -6
- package/i18n/translations/en/reset/content-manager.json +0 -4
- package/i18n/translations/zh-Hans/admin.json +0 -213
- package/i18n/translations/zh-Hans/auth.json +0 -6
- package/i18n/translations/zh-Hans/base.json +0 -93
- package/i18n/translations/zh-Hans/missing.json +0 -105
- package/i18n/translations/zh-Hans/model.json +0 -396
- package/i18n/translations/zh-Hans/plugin.json +0 -13
- package/i18n/translations/zh-Hans/prefix/content-manager.json +0 -321
- package/i18n/translations/zh-Hans/prefix/content-releases.json +0 -106
- package/i18n/translations/zh-Hans/prefix/content-type-builder.json +0 -68
- package/i18n/translations/zh-Hans/prefix/email.json +0 -10
- package/i18n/translations/zh-Hans/prefix/review-workflows.json +0 -17
- package/i18n/translations/zh-Hans/prefix/seo.json +0 -109
- package/i18n/translations/zh-Hans/reset/content-manager.json +0 -4
- package/i18n/translations/zh-Hans/reset/content-type-builder.json +0 -228
- package/i18n/translations/zh-Hans/reset/i18n.json +0 -4
package/dist/server/index.mjs
CHANGED
|
@@ -17,21 +17,6 @@ var schema_default = {
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
attributes: {
|
|
20
|
-
favicon: {
|
|
21
|
-
type: "media",
|
|
22
|
-
pluginOptions: {
|
|
23
|
-
i18n: {
|
|
24
|
-
localized: true
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
multiple: false,
|
|
28
|
-
required: false,
|
|
29
|
-
allowedTypes: [
|
|
30
|
-
"images",
|
|
31
|
-
"files",
|
|
32
|
-
"videos"
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
20
|
title: {
|
|
36
21
|
type: "string",
|
|
37
22
|
pluginOptions: {
|
|
@@ -115,6 +100,15 @@ var schema_default2 = {
|
|
|
115
100
|
}
|
|
116
101
|
},
|
|
117
102
|
required: true
|
|
103
|
+
},
|
|
104
|
+
items: {
|
|
105
|
+
type: "customField",
|
|
106
|
+
pluginOptions: {
|
|
107
|
+
i18n: {
|
|
108
|
+
localized: true
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
customField: "plugin::website.dataNested"
|
|
118
112
|
}
|
|
119
113
|
}
|
|
120
114
|
};
|
|
@@ -156,17 +150,8 @@ var schema_default3 = {
|
|
|
156
150
|
}
|
|
157
151
|
},
|
|
158
152
|
attributes: {
|
|
159
|
-
enabled: {
|
|
160
|
-
type: "boolean",
|
|
161
|
-
pluginOptions: {
|
|
162
|
-
i18n: {
|
|
163
|
-
localized: true
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
required: true,
|
|
167
|
-
default: true
|
|
168
|
-
},
|
|
169
153
|
title: {
|
|
154
|
+
required: true,
|
|
170
155
|
type: "string",
|
|
171
156
|
pluginOptions: {
|
|
172
157
|
i18n: {
|
|
@@ -174,37 +159,32 @@ var schema_default3 = {
|
|
|
174
159
|
}
|
|
175
160
|
}
|
|
176
161
|
},
|
|
177
|
-
|
|
178
|
-
|
|
162
|
+
url: {
|
|
163
|
+
required: true,
|
|
164
|
+
type: "string",
|
|
179
165
|
pluginOptions: {
|
|
180
166
|
i18n: {
|
|
181
167
|
localized: true
|
|
182
168
|
}
|
|
183
|
-
}
|
|
184
|
-
multiple: false,
|
|
185
|
-
allowedTypes: [
|
|
186
|
-
"images"
|
|
187
|
-
]
|
|
169
|
+
}
|
|
188
170
|
},
|
|
189
|
-
|
|
190
|
-
type: "
|
|
171
|
+
enabled: {
|
|
172
|
+
type: "boolean",
|
|
191
173
|
pluginOptions: {
|
|
192
174
|
i18n: {
|
|
193
175
|
localized: true
|
|
194
176
|
}
|
|
195
177
|
},
|
|
196
|
-
|
|
197
|
-
allowedTypes: [
|
|
198
|
-
"images"
|
|
199
|
-
]
|
|
178
|
+
default: true
|
|
200
179
|
},
|
|
201
|
-
|
|
202
|
-
type: "
|
|
180
|
+
index: {
|
|
181
|
+
type: "boolean",
|
|
203
182
|
pluginOptions: {
|
|
204
183
|
i18n: {
|
|
205
184
|
localized: true
|
|
206
185
|
}
|
|
207
|
-
}
|
|
186
|
+
},
|
|
187
|
+
default: false
|
|
208
188
|
},
|
|
209
189
|
robots: {
|
|
210
190
|
type: "text",
|
|
@@ -230,22 +210,21 @@ var schema_default3 = {
|
|
|
230
210
|
}
|
|
231
211
|
}
|
|
232
212
|
},
|
|
233
|
-
|
|
234
|
-
type: "
|
|
213
|
+
gtagId: {
|
|
214
|
+
type: "string",
|
|
235
215
|
pluginOptions: {
|
|
236
216
|
i18n: {
|
|
237
217
|
localized: true
|
|
238
218
|
}
|
|
239
219
|
}
|
|
240
220
|
},
|
|
241
|
-
|
|
242
|
-
type: "
|
|
221
|
+
inquiryEmail: {
|
|
222
|
+
type: "email",
|
|
243
223
|
pluginOptions: {
|
|
244
224
|
i18n: {
|
|
245
225
|
localized: true
|
|
246
226
|
}
|
|
247
|
-
}
|
|
248
|
-
default: false
|
|
227
|
+
}
|
|
249
228
|
}
|
|
250
229
|
}
|
|
251
230
|
};
|
|
@@ -269,8 +248,65 @@ var site_default4 = {
|
|
|
269
248
|
services: site_default3,
|
|
270
249
|
routes: site_default2
|
|
271
250
|
};
|
|
272
|
-
// server/src/api/
|
|
251
|
+
// server/src/api/theme/content-types/theme/schema.json
|
|
273
252
|
var schema_default4 = {
|
|
253
|
+
kind: "singleType",
|
|
254
|
+
collectionName: "themes",
|
|
255
|
+
info: {
|
|
256
|
+
singularName: "theme",
|
|
257
|
+
pluralName: "themes",
|
|
258
|
+
displayName: "Theme",
|
|
259
|
+
description: "Theme setting"
|
|
260
|
+
},
|
|
261
|
+
options: {
|
|
262
|
+
draftAndPublish: true
|
|
263
|
+
},
|
|
264
|
+
pluginOptions: {
|
|
265
|
+
i18n: {
|
|
266
|
+
localized: true
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
attributes: {
|
|
270
|
+
styles: {
|
|
271
|
+
type: "text",
|
|
272
|
+
pluginOptions: {
|
|
273
|
+
i18n: {
|
|
274
|
+
localized: true
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
scripts: {
|
|
279
|
+
type: "text",
|
|
280
|
+
pluginOptions: {
|
|
281
|
+
i18n: {
|
|
282
|
+
localized: true
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
// server/src/api/theme/controllers/theme.ts
|
|
290
|
+
import { factories as factories10 } from "@strapi/strapi";
|
|
291
|
+
var theme_default = factories10.createCoreController("plugin::website.theme");
|
|
292
|
+
|
|
293
|
+
// server/src/api/theme/routes/theme.ts
|
|
294
|
+
import { factories as factories11 } from "@strapi/strapi";
|
|
295
|
+
var theme_default2 = factories11.createCoreRouter("plugin::website.theme");
|
|
296
|
+
|
|
297
|
+
// server/src/api/theme/services/theme.ts
|
|
298
|
+
import { factories as factories12 } from "@strapi/strapi";
|
|
299
|
+
var theme_default3 = factories12.createCoreService("plugin::website.theme");
|
|
300
|
+
|
|
301
|
+
// server/src/api/theme/index.ts
|
|
302
|
+
var theme_default4 = {
|
|
303
|
+
schema: schema_default4,
|
|
304
|
+
controllers: theme_default,
|
|
305
|
+
services: theme_default3,
|
|
306
|
+
routes: theme_default2
|
|
307
|
+
};
|
|
308
|
+
// server/src/api/translation/content-types/translation/schema.json
|
|
309
|
+
var schema_default5 = {
|
|
274
310
|
kind: "collectionType",
|
|
275
311
|
collectionName: "translations",
|
|
276
312
|
info: {
|
|
@@ -310,59 +346,45 @@ var schema_default4 = {
|
|
|
310
346
|
};
|
|
311
347
|
|
|
312
348
|
// server/src/api/translation/controllers/translation.ts
|
|
313
|
-
import { factories as
|
|
314
|
-
var translation_default =
|
|
349
|
+
import { factories as factories13 } from "@strapi/strapi";
|
|
350
|
+
var translation_default = factories13.createCoreController("plugin::website.translation");
|
|
315
351
|
|
|
316
352
|
// server/src/api/translation/routes/translation.ts
|
|
317
|
-
import { factories as
|
|
318
|
-
var translation_default2 =
|
|
353
|
+
import { factories as factories14 } from "@strapi/strapi";
|
|
354
|
+
var translation_default2 = factories14.createCoreRouter("plugin::website.translation");
|
|
319
355
|
|
|
320
356
|
// server/src/api/translation/services/translation.ts
|
|
321
|
-
import { factories as
|
|
322
|
-
var translation_default3 =
|
|
357
|
+
import { factories as factories15 } from "@strapi/strapi";
|
|
358
|
+
var translation_default3 = factories15.createCoreService("plugin::website.translation");
|
|
323
359
|
|
|
324
360
|
// server/src/api/translation/index.ts
|
|
325
361
|
var translation_default4 = {
|
|
326
|
-
schema:
|
|
362
|
+
schema: schema_default5,
|
|
327
363
|
controllers: translation_default,
|
|
328
364
|
services: translation_default3,
|
|
329
365
|
routes: translation_default2
|
|
330
366
|
};
|
|
331
367
|
|
|
332
368
|
// server/src/api/index.ts
|
|
369
|
+
var modules = { translation: translation_default4, common: common_default4, menu: menu_default4, site: site_default4, theme: theme_default4 };
|
|
333
370
|
var contentTypes = {};
|
|
334
371
|
var controllers = {};
|
|
335
372
|
var routes = {};
|
|
336
373
|
var services = {};
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
};
|
|
346
|
-
contentTypes.translation = {
|
|
347
|
-
schema: translation_default4.schema
|
|
348
|
-
};
|
|
349
|
-
routes.common = common_default4.routes;
|
|
350
|
-
routes.menu = menu_default4.routes;
|
|
351
|
-
routes.site = site_default4.routes;
|
|
352
|
-
routes.translation = translation_default4.routes;
|
|
353
|
-
services.common = common_default4.services;
|
|
354
|
-
services.menu = menu_default4.services;
|
|
355
|
-
services.site = site_default4.services;
|
|
356
|
-
services.translation = translation_default4.services;
|
|
357
|
-
controllers.common = common_default4.controllers;
|
|
358
|
-
controllers.menu = menu_default4.controllers;
|
|
359
|
-
controllers.site = site_default4.controllers;
|
|
360
|
-
controllers.translation = translation_default4.controllers;
|
|
374
|
+
Object.keys(modules).forEach((moduleName) => {
|
|
375
|
+
const module = modules[moduleName];
|
|
376
|
+
services[moduleName] = module.services;
|
|
377
|
+
routes[moduleName] = module.routes;
|
|
378
|
+
controllers[moduleName] = module.controllers;
|
|
379
|
+
contentTypes[moduleName] = {
|
|
380
|
+
schema: module.schema
|
|
381
|
+
};
|
|
382
|
+
});
|
|
361
383
|
var api_default = {
|
|
362
384
|
contentTypes,
|
|
363
385
|
controllers,
|
|
364
|
-
|
|
365
|
-
|
|
386
|
+
services,
|
|
387
|
+
routes
|
|
366
388
|
};
|
|
367
389
|
|
|
368
390
|
// server/src/bootstrap.ts
|
|
@@ -633,35 +655,14 @@ var destroy = ({ strapi: strapi2 }) => {
|
|
|
633
655
|
strapi2.log.info("dashboard server plugin: bootstrap");
|
|
634
656
|
};
|
|
635
657
|
var destroy_default = destroy;
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
component: {
|
|
645
|
-
icon,
|
|
646
|
-
category,
|
|
647
|
-
displayName,
|
|
648
|
-
attributes
|
|
649
|
-
}
|
|
650
|
-
}).then((r) => {
|
|
651
|
-
console.log(`create ${name} component`, r);
|
|
652
|
-
});
|
|
653
|
-
};
|
|
654
|
-
var registerComponents = (strapi2, components) => {
|
|
655
|
-
components.forEach((component) => {
|
|
656
|
-
createComponent(strapi2, component);
|
|
657
|
-
});
|
|
658
|
-
};
|
|
659
|
-
|
|
660
|
-
// server/src/components/banner.ts
|
|
661
|
-
var component = {
|
|
662
|
-
name: "banner",
|
|
663
|
-
icon: "landscape",
|
|
664
|
-
displayName: "Banner",
|
|
658
|
+
// server/src/components/schema/banner.json
|
|
659
|
+
var banner_default = {
|
|
660
|
+
collectionName: "components_website_banners",
|
|
661
|
+
info: {
|
|
662
|
+
displayName: "Banner",
|
|
663
|
+
icon: "landscape"
|
|
664
|
+
},
|
|
665
|
+
options: {},
|
|
665
666
|
attributes: {
|
|
666
667
|
title: {
|
|
667
668
|
type: "string"
|
|
@@ -671,51 +672,24 @@ var component = {
|
|
|
671
672
|
},
|
|
672
673
|
description: {
|
|
673
674
|
type: "string"
|
|
674
|
-
},
|
|
675
|
-
image: {
|
|
676
|
-
type: "media",
|
|
677
|
-
multiple: false,
|
|
678
|
-
required: true,
|
|
679
|
-
allowedTypes: ["images"]
|
|
680
|
-
},
|
|
681
|
-
mImage: {
|
|
682
|
-
type: "media",
|
|
683
|
-
multiple: false,
|
|
684
|
-
allowedTypes: ["images"]
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
};
|
|
688
|
-
var banner_default = component;
|
|
689
|
-
|
|
690
|
-
// server/src/components/logo.ts
|
|
691
|
-
var component2 = {
|
|
692
|
-
name: "logo",
|
|
693
|
-
icon: "picture",
|
|
694
|
-
displayName: "Logo",
|
|
695
|
-
attributes: {
|
|
696
|
-
main: {
|
|
697
|
-
type: "media",
|
|
698
|
-
multiple: false,
|
|
699
|
-
allowedTypes: ["images"]
|
|
700
|
-
},
|
|
701
|
-
sub: {
|
|
702
|
-
type: "media",
|
|
703
|
-
multiple: false,
|
|
704
|
-
allowedTypes: ["images"]
|
|
705
675
|
}
|
|
706
676
|
}
|
|
707
677
|
};
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
678
|
+
// server/src/components/schema/social.json
|
|
679
|
+
var social_default = {
|
|
680
|
+
collectionName: "components_website_socials",
|
|
681
|
+
info: {
|
|
682
|
+
displayName: "Social",
|
|
683
|
+
icon: "paperPlane"
|
|
684
|
+
},
|
|
685
|
+
options: {},
|
|
715
686
|
attributes: {
|
|
716
687
|
type: {
|
|
717
688
|
type: "enumeration",
|
|
718
|
-
enum: [
|
|
689
|
+
enum: [
|
|
690
|
+
"url",
|
|
691
|
+
"qrcode"
|
|
692
|
+
]
|
|
719
693
|
},
|
|
720
694
|
url: {
|
|
721
695
|
type: "string",
|
|
@@ -730,6 +704,14 @@ var component3 = {
|
|
|
730
704
|
}
|
|
731
705
|
}
|
|
732
706
|
},
|
|
707
|
+
icon: {
|
|
708
|
+
type: "customField",
|
|
709
|
+
customField: "plugin::website.iconPicker"
|
|
710
|
+
},
|
|
711
|
+
color: {
|
|
712
|
+
type: "customField",
|
|
713
|
+
customField: "plugin::website.colorPicker"
|
|
714
|
+
},
|
|
733
715
|
qrcode: {
|
|
734
716
|
type: "media",
|
|
735
717
|
conditions: {
|
|
@@ -743,43 +725,50 @@ var component3 = {
|
|
|
743
725
|
}
|
|
744
726
|
},
|
|
745
727
|
multiple: false,
|
|
746
|
-
allowedTypes: [
|
|
728
|
+
allowedTypes: [
|
|
729
|
+
"images"
|
|
730
|
+
]
|
|
747
731
|
}
|
|
748
732
|
}
|
|
749
733
|
};
|
|
750
|
-
var social_default = component3;
|
|
751
734
|
|
|
752
|
-
// server/src/components/
|
|
753
|
-
var
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
image: {
|
|
766
|
-
type: "media",
|
|
767
|
-
multiple: false,
|
|
768
|
-
allowedTypes: ["images"]
|
|
735
|
+
// server/src/components/index.ts
|
|
736
|
+
var schemas = { banner: banner_default, social: social_default };
|
|
737
|
+
var createComponent = (strapi2, { name, displayName, icon, attributes }) => {
|
|
738
|
+
const category = "website";
|
|
739
|
+
if (strapi2.components[`${category}.${name}`])
|
|
740
|
+
return;
|
|
741
|
+
const builder = strapi2.plugin("content-type-builder");
|
|
742
|
+
builder.services.components.createComponent({
|
|
743
|
+
component: {
|
|
744
|
+
icon,
|
|
745
|
+
category,
|
|
746
|
+
displayName,
|
|
747
|
+
attributes
|
|
769
748
|
}
|
|
770
|
-
}
|
|
749
|
+
}).then(() => {
|
|
750
|
+
console.log(`create ${name} component`);
|
|
751
|
+
});
|
|
771
752
|
};
|
|
772
|
-
var
|
|
753
|
+
var registerComponents = (strapi2, components) => {
|
|
754
|
+
components.forEach((component) => {
|
|
755
|
+
createComponent(strapi2, component);
|
|
756
|
+
});
|
|
757
|
+
};
|
|
758
|
+
var components = [];
|
|
759
|
+
Object.entries(schemas).forEach(([name, schema]) => {
|
|
760
|
+
components.push({
|
|
761
|
+
name,
|
|
762
|
+
icon: schema.info.icon,
|
|
763
|
+
displayName: schema.info.displayName,
|
|
764
|
+
attributes: schema.attributes
|
|
765
|
+
});
|
|
766
|
+
});
|
|
773
767
|
|
|
774
768
|
// server/src/register.ts
|
|
775
769
|
var register = ({ strapi: strapi2 }) => {
|
|
770
|
+
registerComponents(strapi2, components);
|
|
776
771
|
strapi2.log.info("website server plugin: register");
|
|
777
|
-
registerComponents(strapi2, [
|
|
778
|
-
banner_default,
|
|
779
|
-
social_default,
|
|
780
|
-
logo_default,
|
|
781
|
-
video_default
|
|
782
|
-
]);
|
|
783
772
|
strapi2.customFields.register([
|
|
784
773
|
{
|
|
785
774
|
name: "slugInput",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geekron/strapi",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "极客领航网站管理插件",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"author": "Geekron",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"zod": "3.25.76"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@biomejs/biome": "^2.3.
|
|
79
|
+
"@biomejs/biome": "^2.3.11",
|
|
80
80
|
"@types/bun": "latest",
|
|
81
81
|
"@types/react": "^18.3.27",
|
|
82
82
|
"@types/react-dom": "^18.3.7",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"app.components.NpsSurvey.banner-title": "您有多大可能会向朋友或同事推荐极客领航?",
|
|
3
|
-
"app.components.NpsSurvey.feedback-response": "非常感谢您的反馈!",
|
|
4
|
-
"app.components.NpsSurvey.feedback-question": "您有任何改进建议吗?",
|
|
5
|
-
"app.components.NpsSurvey.submit-feedback": "提交反馈",
|
|
6
|
-
"app.components.NpsSurvey.dismiss-survey-label": "关闭问卷",
|
|
7
|
-
"app.components.NpsSurvey.no-recommendation": "完全不可能",
|
|
8
|
-
"app.components.NpsSurvey.happy-to-recommend": "非常愿意",
|
|
9
|
-
"app.components.NpsSurvey.select-rating": "选择评分"
|
|
10
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Auth.form.welcome.subtitle": "Log in to your account",
|
|
3
|
-
"Auth.form.welcome.title": "Hello, Welcome!",
|
|
4
|
-
"Auth.form.register.subtitle": "Credentials are only used to authenticate in Admin panel. All saved data will be stored in your database.",
|
|
5
|
-
"Auth.form.register.news.label": "By doing this you accept the {terms} and the {policy}."
|
|
6
|
-
}
|