@geekron/strapi 0.2.1 → 0.2.3
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 +188 -174
- package/dist/server/index.mjs +188 -174
- 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,85 @@ 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
|
+
logo: {
|
|
271
|
+
type: "component",
|
|
272
|
+
pluginOptions: {
|
|
273
|
+
i18n: {
|
|
274
|
+
localized: true
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
component: "base.image",
|
|
278
|
+
repeatable: false
|
|
279
|
+
},
|
|
280
|
+
icon: {
|
|
281
|
+
type: "component",
|
|
282
|
+
pluginOptions: {
|
|
283
|
+
i18n: {
|
|
284
|
+
localized: true
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
component: "base.image",
|
|
288
|
+
repeatable: false
|
|
289
|
+
},
|
|
290
|
+
styles: {
|
|
291
|
+
type: "text",
|
|
292
|
+
pluginOptions: {
|
|
293
|
+
i18n: {
|
|
294
|
+
localized: true
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
scripts: {
|
|
299
|
+
type: "text",
|
|
300
|
+
pluginOptions: {
|
|
301
|
+
i18n: {
|
|
302
|
+
localized: true
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
// server/src/api/theme/controllers/theme.ts
|
|
310
|
+
import { factories as factories10 } from "@strapi/strapi";
|
|
311
|
+
var theme_default = factories10.createCoreController("plugin::website.theme");
|
|
312
|
+
|
|
313
|
+
// server/src/api/theme/routes/theme.ts
|
|
314
|
+
import { factories as factories11 } from "@strapi/strapi";
|
|
315
|
+
var theme_default2 = factories11.createCoreRouter("plugin::website.theme");
|
|
316
|
+
|
|
317
|
+
// server/src/api/theme/services/theme.ts
|
|
318
|
+
import { factories as factories12 } from "@strapi/strapi";
|
|
319
|
+
var theme_default3 = factories12.createCoreService("plugin::website.theme");
|
|
320
|
+
|
|
321
|
+
// server/src/api/theme/index.ts
|
|
322
|
+
var theme_default4 = {
|
|
323
|
+
schema: schema_default4,
|
|
324
|
+
controllers: theme_default,
|
|
325
|
+
services: theme_default3,
|
|
326
|
+
routes: theme_default2
|
|
327
|
+
};
|
|
328
|
+
// server/src/api/translation/content-types/translation/schema.json
|
|
329
|
+
var schema_default5 = {
|
|
274
330
|
kind: "collectionType",
|
|
275
331
|
collectionName: "translations",
|
|
276
332
|
info: {
|
|
@@ -310,59 +366,45 @@ var schema_default4 = {
|
|
|
310
366
|
};
|
|
311
367
|
|
|
312
368
|
// server/src/api/translation/controllers/translation.ts
|
|
313
|
-
import { factories as
|
|
314
|
-
var translation_default =
|
|
369
|
+
import { factories as factories13 } from "@strapi/strapi";
|
|
370
|
+
var translation_default = factories13.createCoreController("plugin::website.translation");
|
|
315
371
|
|
|
316
372
|
// server/src/api/translation/routes/translation.ts
|
|
317
|
-
import { factories as
|
|
318
|
-
var translation_default2 =
|
|
373
|
+
import { factories as factories14 } from "@strapi/strapi";
|
|
374
|
+
var translation_default2 = factories14.createCoreRouter("plugin::website.translation");
|
|
319
375
|
|
|
320
376
|
// server/src/api/translation/services/translation.ts
|
|
321
|
-
import { factories as
|
|
322
|
-
var translation_default3 =
|
|
377
|
+
import { factories as factories15 } from "@strapi/strapi";
|
|
378
|
+
var translation_default3 = factories15.createCoreService("plugin::website.translation");
|
|
323
379
|
|
|
324
380
|
// server/src/api/translation/index.ts
|
|
325
381
|
var translation_default4 = {
|
|
326
|
-
schema:
|
|
382
|
+
schema: schema_default5,
|
|
327
383
|
controllers: translation_default,
|
|
328
384
|
services: translation_default3,
|
|
329
385
|
routes: translation_default2
|
|
330
386
|
};
|
|
331
387
|
|
|
332
388
|
// server/src/api/index.ts
|
|
389
|
+
var modules = { translation: translation_default4, common: common_default4, menu: menu_default4, site: site_default4, theme: theme_default4 };
|
|
333
390
|
var contentTypes = {};
|
|
334
391
|
var controllers = {};
|
|
335
392
|
var routes = {};
|
|
336
393
|
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;
|
|
394
|
+
Object.keys(modules).forEach((moduleName) => {
|
|
395
|
+
const module = modules[moduleName];
|
|
396
|
+
services[moduleName] = module.services;
|
|
397
|
+
routes[moduleName] = module.routes;
|
|
398
|
+
controllers[moduleName] = module.controllers;
|
|
399
|
+
contentTypes[moduleName] = {
|
|
400
|
+
schema: module.schema
|
|
401
|
+
};
|
|
402
|
+
});
|
|
361
403
|
var api_default = {
|
|
362
404
|
contentTypes,
|
|
363
405
|
controllers,
|
|
364
|
-
|
|
365
|
-
|
|
406
|
+
services,
|
|
407
|
+
routes
|
|
366
408
|
};
|
|
367
409
|
|
|
368
410
|
// server/src/bootstrap.ts
|
|
@@ -633,35 +675,14 @@ var destroy = ({ strapi: strapi2 }) => {
|
|
|
633
675
|
strapi2.log.info("dashboard server plugin: bootstrap");
|
|
634
676
|
};
|
|
635
677
|
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",
|
|
678
|
+
// server/src/components/schema/banner.json
|
|
679
|
+
var banner_default = {
|
|
680
|
+
collectionName: "components_website_banners",
|
|
681
|
+
info: {
|
|
682
|
+
displayName: "Banner",
|
|
683
|
+
icon: "landscape"
|
|
684
|
+
},
|
|
685
|
+
options: {},
|
|
665
686
|
attributes: {
|
|
666
687
|
title: {
|
|
667
688
|
type: "string"
|
|
@@ -673,49 +694,27 @@ var component = {
|
|
|
673
694
|
type: "string"
|
|
674
695
|
},
|
|
675
696
|
image: {
|
|
676
|
-
type: "
|
|
677
|
-
|
|
678
|
-
|
|
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"]
|
|
697
|
+
type: "component",
|
|
698
|
+
component: "base.image",
|
|
699
|
+
repeatable: false
|
|
705
700
|
}
|
|
706
701
|
}
|
|
707
702
|
};
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
703
|
+
// server/src/components/schema/social.json
|
|
704
|
+
var social_default = {
|
|
705
|
+
collectionName: "components_website_socials",
|
|
706
|
+
info: {
|
|
707
|
+
displayName: "Social",
|
|
708
|
+
icon: "paperPlane"
|
|
709
|
+
},
|
|
710
|
+
options: {},
|
|
715
711
|
attributes: {
|
|
716
712
|
type: {
|
|
717
713
|
type: "enumeration",
|
|
718
|
-
enum: [
|
|
714
|
+
enum: [
|
|
715
|
+
"url",
|
|
716
|
+
"qrcode"
|
|
717
|
+
]
|
|
719
718
|
},
|
|
720
719
|
url: {
|
|
721
720
|
type: "string",
|
|
@@ -730,6 +729,14 @@ var component3 = {
|
|
|
730
729
|
}
|
|
731
730
|
}
|
|
732
731
|
},
|
|
732
|
+
icon: {
|
|
733
|
+
type: "customField",
|
|
734
|
+
customField: "plugin::website.iconPicker"
|
|
735
|
+
},
|
|
736
|
+
color: {
|
|
737
|
+
type: "customField",
|
|
738
|
+
customField: "plugin::website.colorPicker"
|
|
739
|
+
},
|
|
733
740
|
qrcode: {
|
|
734
741
|
type: "media",
|
|
735
742
|
conditions: {
|
|
@@ -743,43 +750,50 @@ var component3 = {
|
|
|
743
750
|
}
|
|
744
751
|
},
|
|
745
752
|
multiple: false,
|
|
746
|
-
allowedTypes: [
|
|
753
|
+
allowedTypes: [
|
|
754
|
+
"images"
|
|
755
|
+
]
|
|
747
756
|
}
|
|
748
757
|
}
|
|
749
758
|
};
|
|
750
|
-
var social_default = component3;
|
|
751
759
|
|
|
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"]
|
|
760
|
+
// server/src/components/index.ts
|
|
761
|
+
var schemas = { banner: banner_default, social: social_default };
|
|
762
|
+
var createComponent = (strapi2, { name, displayName, icon, attributes }) => {
|
|
763
|
+
const category = "website";
|
|
764
|
+
if (strapi2.components[`${category}.${name}`])
|
|
765
|
+
return;
|
|
766
|
+
const builder = strapi2.plugin("content-type-builder");
|
|
767
|
+
builder.services.components.createComponent({
|
|
768
|
+
component: {
|
|
769
|
+
icon,
|
|
770
|
+
category,
|
|
771
|
+
displayName,
|
|
772
|
+
attributes
|
|
769
773
|
}
|
|
770
|
-
}
|
|
774
|
+
}).then(() => {
|
|
775
|
+
console.log(`create ${name} component`);
|
|
776
|
+
});
|
|
777
|
+
};
|
|
778
|
+
var registerComponents = (strapi2, components) => {
|
|
779
|
+
components.forEach((component) => {
|
|
780
|
+
createComponent(strapi2, component);
|
|
781
|
+
});
|
|
771
782
|
};
|
|
772
|
-
var
|
|
783
|
+
var components = [];
|
|
784
|
+
Object.entries(schemas).forEach(([name, schema]) => {
|
|
785
|
+
components.push({
|
|
786
|
+
name,
|
|
787
|
+
icon: schema.info.icon,
|
|
788
|
+
displayName: schema.info.displayName,
|
|
789
|
+
attributes: schema.attributes
|
|
790
|
+
});
|
|
791
|
+
});
|
|
773
792
|
|
|
774
793
|
// server/src/register.ts
|
|
775
794
|
var register = ({ strapi: strapi2 }) => {
|
|
795
|
+
registerComponents(strapi2, components);
|
|
776
796
|
strapi2.log.info("website server plugin: register");
|
|
777
|
-
registerComponents(strapi2, [
|
|
778
|
-
banner_default,
|
|
779
|
-
social_default,
|
|
780
|
-
logo_default,
|
|
781
|
-
video_default
|
|
782
|
-
]);
|
|
783
797
|
strapi2.customFields.register([
|
|
784
798
|
{
|
|
785
799
|
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.3",
|
|
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
|
-
}
|