strapi-plugin-magic-mark 1.1.0

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.
Files changed (68) hide show
  1. package/COPYRIGHT_NOTICE.txt +20 -0
  2. package/LICENSE +28 -0
  3. package/README.md +372 -0
  4. package/dist/_chunks/App-7ZH1Reka.mjs +1390 -0
  5. package/dist/_chunks/App-CMSut1pt.js +1392 -0
  6. package/dist/_chunks/de-Bag-366k.mjs +49 -0
  7. package/dist/_chunks/de-Dic_hhjg.js +49 -0
  8. package/dist/_chunks/en-C5BvHqNo.js +54 -0
  9. package/dist/_chunks/en-zokEerzt.mjs +54 -0
  10. package/dist/_chunks/es-BlSQpU1z.js +54 -0
  11. package/dist/_chunks/es-Br1ucP3h.mjs +54 -0
  12. package/dist/_chunks/fr-BHciYPYG.js +54 -0
  13. package/dist/_chunks/fr-Dzo3kt_q.mjs +54 -0
  14. package/dist/_chunks/index-B-Cc7QNW.mjs +322 -0
  15. package/dist/_chunks/index-B11QBtag.js +324 -0
  16. package/dist/_chunks/index-DYHEyGJr.mjs +2020 -0
  17. package/dist/_chunks/index-DkkmdRgb.js +2024 -0
  18. package/dist/_chunks/pt-DQoGyzyD.mjs +54 -0
  19. package/dist/_chunks/pt-Dawo5aUA.js +54 -0
  20. package/dist/admin/index.js +3 -0
  21. package/dist/admin/index.mjs +4 -0
  22. package/dist/admin/src/components/AdvancedFilterButton.d.ts +3 -0
  23. package/dist/admin/src/components/AdvancedFilterModal.d.ts +21 -0
  24. package/dist/admin/src/components/CreateEditModal.d.ts +11 -0
  25. package/dist/admin/src/components/CreateViewModal.d.ts +9 -0
  26. package/dist/admin/src/components/CustomSelect.d.ts +13 -0
  27. package/dist/admin/src/components/FilterPreview.d.ts +6 -0
  28. package/dist/admin/src/components/HomePage.d.ts +0 -0
  29. package/dist/admin/src/components/Initializer.d.ts +6 -0
  30. package/dist/admin/src/components/LicenseGuard.d.ts +6 -0
  31. package/dist/admin/src/components/PluginIcon.d.ts +3 -0
  32. package/dist/admin/src/components/QueryBuilder.d.ts +23 -0
  33. package/dist/admin/src/components/SimpleAdvancedFilterModal.d.ts +15 -0
  34. package/dist/admin/src/components/ViewsListPopover.d.ts +2 -0
  35. package/dist/admin/src/components/ViewsWidget.d.ts +8 -0
  36. package/dist/admin/src/index.d.ts +15 -0
  37. package/dist/admin/src/pages/App.d.ts +3 -0
  38. package/dist/admin/src/pages/HomePage.d.ts +3 -0
  39. package/dist/admin/src/pages/HomePageModern.d.ts +3 -0
  40. package/dist/admin/src/pages/License/index.d.ts +3 -0
  41. package/dist/admin/src/permissions.d.ts +15 -0
  42. package/dist/admin/src/pluginId.d.ts +2 -0
  43. package/dist/admin/src/utils/queryGenerator.d.ts +28 -0
  44. package/dist/admin/src/utils/queryParser.d.ts +25 -0
  45. package/dist/admin/src/utils/queryToStructure.d.ts +20 -0
  46. package/dist/server/index.js +1309 -0
  47. package/dist/server/index.mjs +1307 -0
  48. package/dist/server/src/bootstrap.d.ts +5 -0
  49. package/dist/server/src/config/index.d.ts +5 -0
  50. package/dist/server/src/content-types/index.d.ts +82 -0
  51. package/dist/server/src/controllers/controller.d.ts +11 -0
  52. package/dist/server/src/controllers/index.d.ts +20 -0
  53. package/dist/server/src/controllers/license.d.ts +27 -0
  54. package/dist/server/src/destroy.d.ts +5 -0
  55. package/dist/server/src/index.d.ts +195 -0
  56. package/dist/server/src/middlewares/index.d.ts +4 -0
  57. package/dist/server/src/middlewares/license-check.d.ts +6 -0
  58. package/dist/server/src/policies/index.d.ts +4 -0
  59. package/dist/server/src/policies/license-check.d.ts +6 -0
  60. package/dist/server/src/register.d.ts +5 -0
  61. package/dist/server/src/routes/admin.d.ts +12 -0
  62. package/dist/server/src/routes/content-api.d.ts +5 -0
  63. package/dist/server/src/routes/index.d.ts +18 -0
  64. package/dist/server/src/services/index.d.ts +57 -0
  65. package/dist/server/src/services/license-guard.d.ts +103 -0
  66. package/dist/server/src/services/service.d.ts +33 -0
  67. package/package.json +108 -0
  68. package/strapi-server.js +4 -0
@@ -0,0 +1,54 @@
1
+ const title = "🔖 MagicMark";
2
+ const subtitle = "Salve visualizações filtradas para acesso rápido";
3
+ const loading = "Carregando marcadores...";
4
+ const empty = "Ainda não há marcadores. Salve sua primeira visualização filtrada!";
5
+ const pt = {
6
+ "plugin.name": "MagicMark",
7
+ title,
8
+ subtitle,
9
+ loading,
10
+ empty,
11
+ "stats.pinned": "Fixados",
12
+ "stats.total": "Total",
13
+ "button.create": "+ Salvar marcador",
14
+ "button.save": "Salvar marcador",
15
+ "button.cancel": "Cancelar",
16
+ "button.update": "Atualizar",
17
+ "button.edit": "Editar",
18
+ "button.delete": "Excluir",
19
+ "button.pin": "Fixar",
20
+ "button.unpin": "Desfixar",
21
+ "confirm.delete": "Tem certeza de que deseja excluir este marcador?",
22
+ "modal.create": "Salvar como marcador",
23
+ "modal.edit": "Editar marcador",
24
+ "form.emoji": "Escolher ícone",
25
+ "form.selectEmoji": "Clique para selecionar",
26
+ "form.name": "Nome do marcador",
27
+ "form.path": "Caminho do gerenciador de conteúdo",
28
+ "form.pathHelp": "Capturado automaticamente do gerenciador de conteúdo",
29
+ "form.query": "Filtros e ordenação",
30
+ "form.queryHelp": "Estes filtros serão restaurados quando você clicar neste marcador",
31
+ "form.filterPreview": "Filtros e configurações capturados",
32
+ "form.description": "Descrição (Opcional)",
33
+ "error.nameRequired": "O nome é obrigatório",
34
+ "error.pathRequired": "O caminho é obrigatório",
35
+ "error.save": "Falha ao salvar o marcador",
36
+ "table.emoji": "Emoji",
37
+ "table.name": "Nome",
38
+ "table.filters": "Filtros",
39
+ "table.description": "Descrição",
40
+ "table.status": "Status",
41
+ "table.actions": "Ações",
42
+ "ViewsWidget.actions.create": "Salvar marcador",
43
+ "ViewsWidget.actions.showList": "Magicmark",
44
+ "Admin.MainMenu.PluginName": "MagicMark",
45
+ "settings.title": "MagicMark",
46
+ "settings.license": "Licença"
47
+ };
48
+ export {
49
+ pt as default,
50
+ empty,
51
+ loading,
52
+ subtitle,
53
+ title
54
+ };
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const title = "🔖 MagicMark";
4
+ const subtitle = "Salve visualizações filtradas para acesso rápido";
5
+ const loading = "Carregando marcadores...";
6
+ const empty = "Ainda não há marcadores. Salve sua primeira visualização filtrada!";
7
+ const pt = {
8
+ "plugin.name": "MagicMark",
9
+ title,
10
+ subtitle,
11
+ loading,
12
+ empty,
13
+ "stats.pinned": "Fixados",
14
+ "stats.total": "Total",
15
+ "button.create": "+ Salvar marcador",
16
+ "button.save": "Salvar marcador",
17
+ "button.cancel": "Cancelar",
18
+ "button.update": "Atualizar",
19
+ "button.edit": "Editar",
20
+ "button.delete": "Excluir",
21
+ "button.pin": "Fixar",
22
+ "button.unpin": "Desfixar",
23
+ "confirm.delete": "Tem certeza de que deseja excluir este marcador?",
24
+ "modal.create": "Salvar como marcador",
25
+ "modal.edit": "Editar marcador",
26
+ "form.emoji": "Escolher ícone",
27
+ "form.selectEmoji": "Clique para selecionar",
28
+ "form.name": "Nome do marcador",
29
+ "form.path": "Caminho do gerenciador de conteúdo",
30
+ "form.pathHelp": "Capturado automaticamente do gerenciador de conteúdo",
31
+ "form.query": "Filtros e ordenação",
32
+ "form.queryHelp": "Estes filtros serão restaurados quando você clicar neste marcador",
33
+ "form.filterPreview": "Filtros e configurações capturados",
34
+ "form.description": "Descrição (Opcional)",
35
+ "error.nameRequired": "O nome é obrigatório",
36
+ "error.pathRequired": "O caminho é obrigatório",
37
+ "error.save": "Falha ao salvar o marcador",
38
+ "table.emoji": "Emoji",
39
+ "table.name": "Nome",
40
+ "table.filters": "Filtros",
41
+ "table.description": "Descrição",
42
+ "table.status": "Status",
43
+ "table.actions": "Ações",
44
+ "ViewsWidget.actions.create": "Salvar marcador",
45
+ "ViewsWidget.actions.showList": "Magicmark",
46
+ "Admin.MainMenu.PluginName": "MagicMark",
47
+ "settings.title": "MagicMark",
48
+ "settings.license": "Licença"
49
+ };
50
+ exports.default = pt;
51
+ exports.empty = empty;
52
+ exports.loading = loading;
53
+ exports.subtitle = subtitle;
54
+ exports.title = title;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ const index = require("../_chunks/index-DkkmdRgb.js");
3
+ module.exports = index.index;
@@ -0,0 +1,4 @@
1
+ import { i } from "../_chunks/index-DYHEyGJr.mjs";
2
+ export {
3
+ i as default
4
+ };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const AdvancedFilterButton: React.FC;
3
+ export default AdvancedFilterButton;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ interface FilterCondition {
3
+ id: string;
4
+ field: string;
5
+ operator: string;
6
+ value: string;
7
+ }
8
+ interface AdvancedFilterModalProps {
9
+ onClose: () => void;
10
+ onApply: (queryString: string) => void;
11
+ availableFields: Array<{
12
+ name: string;
13
+ type: string;
14
+ }>;
15
+ availableRelations?: Array<{
16
+ name: string;
17
+ }>;
18
+ currentFilters?: FilterCondition[];
19
+ }
20
+ declare const AdvancedFilterModal: React.FC<AdvancedFilterModalProps>;
21
+ export default AdvancedFilterModal;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface CreateEditModalProps {
3
+ bookmark: any | null;
4
+ onClose: () => void;
5
+ onSuccess: () => void;
6
+ pluginId: string;
7
+ currentPath?: string;
8
+ currentQuery?: string;
9
+ }
10
+ declare const CreateEditModal: React.FC<CreateEditModalProps>;
11
+ export default CreateEditModal;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface CreateEditModalProps {
3
+ bookmark: any | null;
4
+ onClose: () => void;
5
+ onSuccess: () => void;
6
+ pluginId: string;
7
+ }
8
+ declare const CreateEditModal: React.FC<CreateEditModalProps>;
9
+ export default CreateEditModal;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ interface CustomSelectProps {
3
+ value: string;
4
+ onChange: (value: string) => void;
5
+ options: Array<{
6
+ value: string;
7
+ label: string;
8
+ }>;
9
+ placeholder?: string;
10
+ searchable?: boolean;
11
+ }
12
+ declare const CustomSelect: React.FC<CustomSelectProps>;
13
+ export default CustomSelect;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface FilterPreviewProps {
3
+ query: string;
4
+ }
5
+ declare const FilterPreview: React.FC<FilterPreviewProps>;
6
+ export default FilterPreview;
File without changes
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface InitializerProps {
3
+ setPlugin: (pluginId: string) => void;
4
+ }
5
+ declare const Initializer: React.FC<InitializerProps>;
6
+ export default Initializer;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface LicenseGuardProps {
3
+ children: React.ReactNode;
4
+ }
5
+ declare const LicenseGuard: React.FC<LicenseGuardProps>;
6
+ export default LicenseGuard;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const PluginIcon: React.FC;
3
+ export default PluginIcon;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ interface Condition {
3
+ id: string;
4
+ field: string;
5
+ operator: string;
6
+ value: string;
7
+ }
8
+ interface ConditionGroup {
9
+ id: string;
10
+ logic: 'AND' | 'OR';
11
+ conditions: (Condition | ConditionGroup)[];
12
+ isGroup?: boolean;
13
+ }
14
+ interface QueryBuilderProps {
15
+ availableFields: Array<{
16
+ name: string;
17
+ type: string;
18
+ }>;
19
+ onQueryChange: (query: ConditionGroup) => void;
20
+ initialStructure?: ConditionGroup;
21
+ }
22
+ declare const QueryBuilder: React.FC<QueryBuilderProps>;
23
+ export default QueryBuilder;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ interface SimpleAdvancedFilterModalProps {
3
+ onClose: () => void;
4
+ onApply: (queryString: string) => void;
5
+ availableFields: Array<{
6
+ name: string;
7
+ type: string;
8
+ }>;
9
+ availableRelations?: Array<{
10
+ name: string;
11
+ }>;
12
+ currentQuery?: string;
13
+ }
14
+ declare const SimpleAdvancedFilterModal: React.FC<SimpleAdvancedFilterModalProps>;
15
+ export default SimpleAdvancedFilterModal;
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface ViewsWidgetProps {
3
+ privateViews?: any[];
4
+ onCreateView?: () => void;
5
+ onShowViews?: () => void;
6
+ }
7
+ declare const ViewsWidget: React.FC<ViewsWidgetProps>;
8
+ export default ViewsWidget;
@@ -0,0 +1,15 @@
1
+ import type { StrapiApp } from '@strapi/strapi/admin';
2
+ declare const _default: {
3
+ register(app: StrapiApp): void;
4
+ bootstrap(app: StrapiApp): Promise<void>;
5
+ registerTrads({ locales }: {
6
+ locales: string[];
7
+ }): Promise<({
8
+ data: Record<string, any>;
9
+ locale: string;
10
+ } | {
11
+ data: {};
12
+ locale: string;
13
+ })[]>;
14
+ };
15
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const App: React.FC;
3
+ export default App;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const HomePage: React.FC;
3
+ export default HomePage;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const HomePageModern: React.FC;
3
+ export default HomePageModern;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const LicensePage: React.FC;
3
+ export default LicensePage;
@@ -0,0 +1,15 @@
1
+ declare const pluginPermissions: {
2
+ accessSettings: {
3
+ action: string;
4
+ subject: any;
5
+ }[];
6
+ readSettings: {
7
+ action: string;
8
+ subject: any;
9
+ }[];
10
+ updateSettings: {
11
+ action: string;
12
+ subject: any;
13
+ }[];
14
+ };
15
+ export default pluginPermissions;
@@ -0,0 +1,2 @@
1
+ declare const pluginId = "magic-mark";
2
+ export default pluginId;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Generates correct Strapi v5 filter query strings from QueryBuilder structure
3
+ * Based on: https://docs.strapi.io/cms/api/document-service/filters
4
+ */
5
+ export interface Condition {
6
+ id: string;
7
+ field: string;
8
+ operator: string;
9
+ value: string;
10
+ }
11
+ export interface ConditionGroup {
12
+ id: string;
13
+ logic: 'AND' | 'OR';
14
+ conditions: (Condition | ConditionGroup)[];
15
+ isGroup?: boolean;
16
+ }
17
+ /**
18
+ * Convert QueryBuilder structure to Strapi filter object
19
+ */
20
+ export declare const structureToFilters: (group: ConditionGroup) => any;
21
+ /**
22
+ * Generate complete query string with filters, sort, and populate
23
+ */
24
+ export declare const generateQueryString: (structure: ConditionGroup, sortField?: string, sortOrder?: 'ASC' | 'DESC', populateFields?: Array<{
25
+ name: string;
26
+ enabled: boolean;
27
+ deep: boolean;
28
+ }>) => string;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Parses URL query parameters and extracts filters, sorting, and population info
3
+ * into a human-readable format
4
+ */
5
+ export interface ParsedFilter {
6
+ field: string;
7
+ operator: string;
8
+ value: string;
9
+ logic?: 'AND' | 'OR';
10
+ }
11
+ export interface ParsedQuery {
12
+ filters: ParsedFilter[];
13
+ sort: string[];
14
+ populate: string[];
15
+ page?: number;
16
+ pageSize?: number;
17
+ }
18
+ /**
19
+ * Parses query string into structured filter information
20
+ */
21
+ export declare const parseQueryString: (queryString: string) => ParsedQuery;
22
+ /**
23
+ * Generates a human-readable summary of parsed query
24
+ */
25
+ export declare const generateQuerySummary: (parsed: ParsedQuery) => string;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Converts URL query string back into QueryBuilder structure
3
+ */
4
+ export interface Condition {
5
+ id: string;
6
+ field: string;
7
+ operator: string;
8
+ value: string;
9
+ }
10
+ export interface ConditionGroup {
11
+ id: string;
12
+ logic: 'AND' | 'OR';
13
+ conditions: (Condition | ConditionGroup)[];
14
+ isGroup?: boolean;
15
+ }
16
+ /**
17
+ * Parse URL query parameters into QueryBuilder structure
18
+ * Supports nested groups like: filters[$and][1][$or][0][field][$eq]=value
19
+ */
20
+ export declare const parseQueryToStructure: (queryString: string) => ConditionGroup;