From 37c434525e2d66637971ccaa7b97de236e40efc4 Mon Sep 17 00:00:00 2001 From: Julien Froidefond Date: Fri, 9 Apr 2021 09:28:23 +0200 Subject: [PATCH] feat: adding a plugin for folder tree editable --- package.json | 4 +- plugins/tree-view-bookmarks/.editorconfig | 7 + plugins/tree-view-bookmarks/.gitattributes | 103 ++++++++++++++ plugins/tree-view-bookmarks/.gitignore | 10 ++ plugins/tree-view-bookmarks/README.md | 3 + .../admin/src/containers/App/index.js | 27 ++++ .../admin/src/containers/HomePage/index.js | 31 ++++ .../admin/src/containers/Initializer/index.js | 26 ++++ .../tree-view-bookmarks/admin/src/index.js | 52 +++++++ .../admin/src/lifecycles.js | 3 + .../tree-view-bookmarks/admin/src/pluginId.js | 7 + .../admin/src/translations/ar.json | 1 + .../admin/src/translations/cs.json | 1 + .../admin/src/translations/de.json | 1 + .../admin/src/translations/en.json | 1 + .../admin/src/translations/es.json | 1 + .../admin/src/translations/fr.json | 1 + .../admin/src/translations/id.json | 1 + .../admin/src/translations/index.js | 49 +++++++ .../admin/src/translations/it.json | 1 + .../admin/src/translations/ko.json | 1 + .../admin/src/translations/ms.json | 1 + .../admin/src/translations/nl.json | 1 + .../admin/src/translations/pl.json | 1 + .../admin/src/translations/pt-BR.json | 1 + .../admin/src/translations/pt.json | 1 + .../admin/src/translations/ru.json | 1 + .../admin/src/translations/sk.json | 1 + .../admin/src/translations/th.json | 1 + .../admin/src/translations/tr.json | 1 + .../admin/src/translations/uk.json | 1 + .../admin/src/translations/vi.json | 1 + .../admin/src/translations/zh-Hans.json | 1 + .../admin/src/translations/zh.json | 1 + .../admin/src/utils/getTrad.js | 5 + .../tree-view-bookmarks/config/routes.json | 12 ++ .../controllers/tree-view-bookmarks.js | 25 ++++ plugins/tree-view-bookmarks/package.json | 28 ++++ .../services/tree-view-bookmarks.js | 11 ++ yarn.lock | 133 ++++++++++++++++-- 40 files changed, 548 insertions(+), 10 deletions(-) create mode 100644 plugins/tree-view-bookmarks/.editorconfig create mode 100644 plugins/tree-view-bookmarks/.gitattributes create mode 100644 plugins/tree-view-bookmarks/.gitignore create mode 100644 plugins/tree-view-bookmarks/README.md create mode 100644 plugins/tree-view-bookmarks/admin/src/containers/App/index.js create mode 100644 plugins/tree-view-bookmarks/admin/src/containers/HomePage/index.js create mode 100644 plugins/tree-view-bookmarks/admin/src/containers/Initializer/index.js create mode 100644 plugins/tree-view-bookmarks/admin/src/index.js create mode 100644 plugins/tree-view-bookmarks/admin/src/lifecycles.js create mode 100644 plugins/tree-view-bookmarks/admin/src/pluginId.js create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/ar.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/cs.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/de.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/en.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/es.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/fr.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/id.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/index.js create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/it.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/ko.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/ms.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/nl.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/pl.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/pt-BR.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/pt.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/ru.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/sk.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/th.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/tr.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/uk.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/vi.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/zh-Hans.json create mode 100644 plugins/tree-view-bookmarks/admin/src/translations/zh.json create mode 100644 plugins/tree-view-bookmarks/admin/src/utils/getTrad.js create mode 100644 plugins/tree-view-bookmarks/config/routes.json create mode 100644 plugins/tree-view-bookmarks/controllers/tree-view-bookmarks.js create mode 100644 plugins/tree-view-bookmarks/package.json create mode 100644 plugins/tree-view-bookmarks/services/tree-view-bookmarks.js diff --git a/package.json b/package.json index 4cbce82..0ab9b0c 100644 --- a/package.json +++ b/package.json @@ -18,10 +18,12 @@ "@request/api": "0.6.0", "knex": "0.95.4", "pg": "8.5.1", + "react-sortable-tree": "2.7.1", "sqlite3": "5.0.2", "strapi": "3.5.4", "strapi-admin": "3.5.4", "strapi-connector-bookshelf": "3.5.4", + "strapi-helper-plugin": "^3.5.4", "strapi-plugin-content-manager": "3.5.4", "strapi-plugin-content-type-builder": "3.5.4", "strapi-plugin-documentation": "3.5.4", @@ -46,4 +48,4 @@ "path": "./node_modules/cz-conventional-changelog" } } -} \ No newline at end of file +} diff --git a/plugins/tree-view-bookmarks/.editorconfig b/plugins/tree-view-bookmarks/.editorconfig new file mode 100644 index 0000000..d4eed84 --- /dev/null +++ b/plugins/tree-view-bookmarks/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = false +indent_style = space +indent_size = 2 diff --git a/plugins/tree-view-bookmarks/.gitattributes b/plugins/tree-view-bookmarks/.gitattributes new file mode 100644 index 0000000..065a11c --- /dev/null +++ b/plugins/tree-view-bookmarks/.gitattributes @@ -0,0 +1,103 @@ +# From https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes + +# Handle line endings automatically for files detected as text +# and leave all files detected as binary untouched. +* text=auto + +# +# The above will handle all files NOT found below +# + +# +## These files are text and should be normalized (Convert crlf => lf) +# + +# source code +*.php text +*.css text +*.sass text +*.scss text +*.less text +*.styl text +*.js text eol=lf +*.coffee text +*.json text +*.htm text +*.html text +*.xml text +*.svg text +*.txt text +*.ini text +*.inc text +*.pl text +*.rb text +*.py text +*.scm text +*.sql text +*.sh text +*.bat text + +# templates +*.ejs text +*.hbt text +*.jade text +*.haml text +*.hbs text +*.dot text +*.tmpl text +*.phtml text + +# git config +.gitattributes text +.gitignore text +.gitconfig text + +# code analysis config +.jshintrc text +.jscsrc text +.jshintignore text +.csslintrc text + +# misc config +*.yaml text +*.yml text +.editorconfig text + +# build config +*.npmignore text +*.bowerrc text + +# Heroku +Procfile text +.slugignore text + +# Documentation +*.md text +LICENSE text +AUTHORS text + + +# +## These files are binary and should be left untouched +# + +# (binary is a macro for -text -diff) +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.mov binary +*.mp4 binary +*.mp3 binary +*.flv binary +*.fla binary +*.swf binary +*.gz binary +*.zip binary +*.7z binary +*.ttf binary +*.eot binary +*.woff binary +*.pyc binary +*.pdf binary diff --git a/plugins/tree-view-bookmarks/.gitignore b/plugins/tree-view-bookmarks/.gitignore new file mode 100644 index 0000000..afe256b --- /dev/null +++ b/plugins/tree-view-bookmarks/.gitignore @@ -0,0 +1,10 @@ +# Don't check auto-generated stuff into git +coverage +node_modules +stats.json +package-lock.json + +# Cruft +.DS_Store +npm-debug.log +.idea diff --git a/plugins/tree-view-bookmarks/README.md b/plugins/tree-view-bookmarks/README.md new file mode 100644 index 0000000..fbafb83 --- /dev/null +++ b/plugins/tree-view-bookmarks/README.md @@ -0,0 +1,3 @@ +# Strapi plugin tree-view-bookmarks + +A quick description of tree-view-bookmarks. diff --git a/plugins/tree-view-bookmarks/admin/src/containers/App/index.js b/plugins/tree-view-bookmarks/admin/src/containers/App/index.js new file mode 100644 index 0000000..9755fb0 --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/containers/App/index.js @@ -0,0 +1,27 @@ +/** + * + * This component is the skeleton around the actual pages, and should only + * contain code that should be seen on all pages. (e.g. navigation bar) + * + */ + +import React from 'react'; +import { Switch, Route } from 'react-router-dom'; +import { NotFound } from 'strapi-helper-plugin'; +// Utils +import pluginId from '../../pluginId'; +// Containers +import HomePage from '../HomePage'; + +const App = () => { + return ( +
+ + + + +
+ ); +}; + +export default App; diff --git a/plugins/tree-view-bookmarks/admin/src/containers/HomePage/index.js b/plugins/tree-view-bookmarks/admin/src/containers/HomePage/index.js new file mode 100644 index 0000000..dc1ed65 --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/containers/HomePage/index.js @@ -0,0 +1,31 @@ +/* + * + * HomePage + * + */ +import SortableTree from "react-sortable-tree"; +import "react-sortable-tree/style.css"; // This only needs to be imported once in your app +import * as strapiHelper from "strapi-helper-plugin"; + +import React, { memo, useState } from "react"; +// import PropTypes from 'prop-types'; + +const HomePage = () => { + console.log(strapiHelper); // Is there an helper for getting Tree ? + const treeDataInit = [ + { title: "Chicken", children: [{ title: "Egg" }, { title: "dazdaz" }] }, + { title: "coucou" }, + ]; + const [treeData, setTreeData] = useState(treeDataInit); + return ( +
+

Tree modifier

+ setTreeData(treeData)} + /> +
+ ); +}; + +export default memo(HomePage); diff --git a/plugins/tree-view-bookmarks/admin/src/containers/Initializer/index.js b/plugins/tree-view-bookmarks/admin/src/containers/Initializer/index.js new file mode 100644 index 0000000..06b5488 --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/containers/Initializer/index.js @@ -0,0 +1,26 @@ +/** + * + * Initializer + * + */ + +import { useEffect, useRef } from 'react'; +import PropTypes from 'prop-types'; +import pluginId from '../../pluginId'; + +const Initializer = ({ updatePlugin }) => { + const ref = useRef(); + ref.current = updatePlugin; + + useEffect(() => { + ref.current(pluginId, 'isReady', true); + }, []); + + return null; +}; + +Initializer.propTypes = { + updatePlugin: PropTypes.func.isRequired, +}; + +export default Initializer; diff --git a/plugins/tree-view-bookmarks/admin/src/index.js b/plugins/tree-view-bookmarks/admin/src/index.js new file mode 100644 index 0000000..6c5be5b --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/index.js @@ -0,0 +1,52 @@ +import pluginPkg from '../../package.json'; +import pluginId from './pluginId'; +import App from './containers/App'; +import Initializer from './containers/Initializer'; +import lifecycles from './lifecycles'; +import trads from './translations'; + +export default strapi => { + const pluginDescription = pluginPkg.strapi.description || pluginPkg.description; + const icon = pluginPkg.strapi.icon; + const name = pluginPkg.strapi.name; + + const plugin = { + blockerComponent: null, + blockerComponentProps: {}, + description: pluginDescription, + icon, + id: pluginId, + initializer: Initializer, + injectedComponents: [], + isReady: false, + isRequired: pluginPkg.strapi.required || false, + layout: null, + lifecycles, + mainComponent: App, + name, + preventComponentRendering: false, + trads, + menu: { + pluginsSectionLinks: [ + { + destination: `/plugins/${pluginId}`, + icon, + label: { + id: `${pluginId}.plugin.name`, + defaultMessage: name, + }, + name, + permissions: [ + // Uncomment to set the permissions of the plugin here + // { + // action: '', // the action name should be plugins::plugin-name.actionType + // subject: null, + // }, + ], + }, + ], + }, + }; + + return strapi.registerPlugin(plugin); +}; diff --git a/plugins/tree-view-bookmarks/admin/src/lifecycles.js b/plugins/tree-view-bookmarks/admin/src/lifecycles.js new file mode 100644 index 0000000..81b0172 --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/lifecycles.js @@ -0,0 +1,3 @@ +function lifecycles() {} + +export default lifecycles; diff --git a/plugins/tree-view-bookmarks/admin/src/pluginId.js b/plugins/tree-view-bookmarks/admin/src/pluginId.js new file mode 100644 index 0000000..1b059dd --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/pluginId.js @@ -0,0 +1,7 @@ +const pluginPkg = require('../../package.json'); +const pluginId = pluginPkg.name.replace( + /^strapi-plugin-/i, + '' +); + +module.exports = pluginId; diff --git a/plugins/tree-view-bookmarks/admin/src/translations/ar.json b/plugins/tree-view-bookmarks/admin/src/translations/ar.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/ar.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/tree-view-bookmarks/admin/src/translations/cs.json b/plugins/tree-view-bookmarks/admin/src/translations/cs.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/cs.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/tree-view-bookmarks/admin/src/translations/de.json b/plugins/tree-view-bookmarks/admin/src/translations/de.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/de.json @@ -0,0 +1 @@ +{} diff --git a/plugins/tree-view-bookmarks/admin/src/translations/en.json b/plugins/tree-view-bookmarks/admin/src/translations/en.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/en.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/tree-view-bookmarks/admin/src/translations/es.json b/plugins/tree-view-bookmarks/admin/src/translations/es.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/es.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/tree-view-bookmarks/admin/src/translations/fr.json b/plugins/tree-view-bookmarks/admin/src/translations/fr.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/fr.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/tree-view-bookmarks/admin/src/translations/id.json b/plugins/tree-view-bookmarks/admin/src/translations/id.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/id.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/tree-view-bookmarks/admin/src/translations/index.js b/plugins/tree-view-bookmarks/admin/src/translations/index.js new file mode 100644 index 0000000..d990d5a --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/index.js @@ -0,0 +1,49 @@ +import ar from './ar.json'; +import cs from './cs.json'; +import de from './de.json'; +import en from './en.json'; +import es from './es.json'; +import fr from './fr.json'; +import id from './id.json'; +import it from './it.json'; +import ko from './ko.json'; +import ms from './ms.json'; +import nl from './nl.json'; +import pl from './pl.json'; +import ptBR from './pt-BR.json'; +import pt from './pt.json'; +import ru from './ru.json'; +import th from './th.json'; +import tr from './tr.json'; +import uk from './uk.json'; +import vi from './vi.json'; +import zhHans from './zh-Hans.json'; +import zh from './zh.json'; +import sk from './sk.json'; + +const trads = { + ar, + cs, + de, + en, + es, + fr, + id, + it, + ko, + ms, + nl, + pl, + 'pt-BR': ptBR, + pt, + ru, + th, + tr, + uk, + vi, + 'zh-Hans': zhHans, + zh, + sk, +}; + +export default trads; diff --git a/plugins/tree-view-bookmarks/admin/src/translations/it.json b/plugins/tree-view-bookmarks/admin/src/translations/it.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/it.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/tree-view-bookmarks/admin/src/translations/ko.json b/plugins/tree-view-bookmarks/admin/src/translations/ko.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/ko.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/tree-view-bookmarks/admin/src/translations/ms.json b/plugins/tree-view-bookmarks/admin/src/translations/ms.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/ms.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/tree-view-bookmarks/admin/src/translations/nl.json b/plugins/tree-view-bookmarks/admin/src/translations/nl.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/nl.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/tree-view-bookmarks/admin/src/translations/pl.json b/plugins/tree-view-bookmarks/admin/src/translations/pl.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/pl.json @@ -0,0 +1 @@ +{} diff --git a/plugins/tree-view-bookmarks/admin/src/translations/pt-BR.json b/plugins/tree-view-bookmarks/admin/src/translations/pt-BR.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/pt-BR.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/tree-view-bookmarks/admin/src/translations/pt.json b/plugins/tree-view-bookmarks/admin/src/translations/pt.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/pt.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/tree-view-bookmarks/admin/src/translations/ru.json b/plugins/tree-view-bookmarks/admin/src/translations/ru.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/ru.json @@ -0,0 +1 @@ +{} diff --git a/plugins/tree-view-bookmarks/admin/src/translations/sk.json b/plugins/tree-view-bookmarks/admin/src/translations/sk.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/sk.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/tree-view-bookmarks/admin/src/translations/th.json b/plugins/tree-view-bookmarks/admin/src/translations/th.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/th.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/tree-view-bookmarks/admin/src/translations/tr.json b/plugins/tree-view-bookmarks/admin/src/translations/tr.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/tr.json @@ -0,0 +1 @@ +{} diff --git a/plugins/tree-view-bookmarks/admin/src/translations/uk.json b/plugins/tree-view-bookmarks/admin/src/translations/uk.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/uk.json @@ -0,0 +1 @@ +{} diff --git a/plugins/tree-view-bookmarks/admin/src/translations/vi.json b/plugins/tree-view-bookmarks/admin/src/translations/vi.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/vi.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/tree-view-bookmarks/admin/src/translations/zh-Hans.json b/plugins/tree-view-bookmarks/admin/src/translations/zh-Hans.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/zh-Hans.json @@ -0,0 +1 @@ +{} diff --git a/plugins/tree-view-bookmarks/admin/src/translations/zh.json b/plugins/tree-view-bookmarks/admin/src/translations/zh.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/translations/zh.json @@ -0,0 +1 @@ +{} diff --git a/plugins/tree-view-bookmarks/admin/src/utils/getTrad.js b/plugins/tree-view-bookmarks/admin/src/utils/getTrad.js new file mode 100644 index 0000000..a2b8632 --- /dev/null +++ b/plugins/tree-view-bookmarks/admin/src/utils/getTrad.js @@ -0,0 +1,5 @@ +import pluginId from '../pluginId'; + +const getTrad = id => `${pluginId}.${id}`; + +export default getTrad; diff --git a/plugins/tree-view-bookmarks/config/routes.json b/plugins/tree-view-bookmarks/config/routes.json new file mode 100644 index 0000000..22616c3 --- /dev/null +++ b/plugins/tree-view-bookmarks/config/routes.json @@ -0,0 +1,12 @@ +{ + "routes": [ + { + "method": "GET", + "path": "/", + "handler": "tree-view-bookmarks.index", + "config": { + "policies": [] + } + } + ] +} diff --git a/plugins/tree-view-bookmarks/controllers/tree-view-bookmarks.js b/plugins/tree-view-bookmarks/controllers/tree-view-bookmarks.js new file mode 100644 index 0000000..113a25e --- /dev/null +++ b/plugins/tree-view-bookmarks/controllers/tree-view-bookmarks.js @@ -0,0 +1,25 @@ +'use strict'; + +/** + * tree-view-bookmarks.js controller + * + * @description: A set of functions called "actions" of the `tree-view-bookmarks` plugin. + */ + +module.exports = { + + /** + * Default action. + * + * @return {Object} + */ + + index: async (ctx) => { + // Add your own logic here. + + // Send 200 `ok` + ctx.send({ + message: 'ok' + }); + } +}; diff --git a/plugins/tree-view-bookmarks/package.json b/plugins/tree-view-bookmarks/package.json new file mode 100644 index 0000000..a85bca3 --- /dev/null +++ b/plugins/tree-view-bookmarks/package.json @@ -0,0 +1,28 @@ +{ + "name": "strapi-plugin-tree-view-bookmarks", + "version": "0.0.0", + "description": "This is the description of the plugin.", + "strapi": { + "name": "tree-view-bookmarks", + "icon": "plug", + "description": "Description of tree-view-bookmarks plugin." + }, + "dependencies": {}, + "author": { + "name": "A Strapi developer", + "email": "", + "url": "" + }, + "maintainers": [ + { + "name": "A Strapi developer", + "email": "", + "url": "" + } + ], + "engines": { + "node": ">=10.16.0 <=14.x.x", + "npm": ">=6.0.0" + }, + "license": "MIT" +} diff --git a/plugins/tree-view-bookmarks/services/tree-view-bookmarks.js b/plugins/tree-view-bookmarks/services/tree-view-bookmarks.js new file mode 100644 index 0000000..b1b331c --- /dev/null +++ b/plugins/tree-view-bookmarks/services/tree-view-bookmarks.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * tree-view-bookmarks.js service + * + * @description: A set of functions similar to controller's actions to avoid code duplication. + */ + +module.exports = { + +}; diff --git a/yarn.lock b/yarn.lock index 81f2b0d..1d5f20c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1347,6 +1347,11 @@ dependencies: defer-to-connect "^1.0.1" +"@types/asap@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@types/asap/-/asap-2.0.0.tgz#d529e9608c83499a62ae08c871c5e62271aa2963" + integrity sha512-upIS0Gt9Mc8eEpCbYMZ1K8rhNosfKUtimNcINce+zLwJF5UpM3Vv7yz3S5l/1IX+DxTa8lTkUjqynvjRXyJzsg== + "@types/bson@*": version "4.0.3" resolved "https://registry.yarnpkg.com/@types/bson/-/bson-4.0.3.tgz#30889d2ffde6262abbe38659364c631454999fbf" @@ -1377,7 +1382,7 @@ "@types/react" "*" hoist-non-react-statics "^3.3.0" -"@types/invariant@^2.2.31": +"@types/invariant@^2.2.30", "@types/invariant@^2.2.31": version "2.2.34" resolved "https://registry.yarnpkg.com/@types/invariant/-/invariant-2.2.34.tgz#05e4f79f465c2007884374d4795452f995720bbe" integrity sha512-lYUtmJ9BqUN688fGY1U1HZoWT1/Jrmgigx2loq4ZcJpICECm/Om3V314BxdzypO0u5PORKGMM6x0OXaljV1YFg== @@ -1429,6 +1434,11 @@ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275" integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA== +"@types/shallowequal@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/shallowequal/-/shallowequal-1.1.1.tgz#aad262bb3f2b1257d94c71d545268d592575c9b1" + integrity sha512-Lhni3aX80zbpdxRuWhnuYPm8j8UQaa571lHP/xI4W+7BAFhSIhRReXnqjEgT/XzPoXZTJkCqstFMJ8CZTK6IlQ== + "@webassemblyjs/ast@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964" @@ -1835,7 +1845,7 @@ array.prototype.flat@^1.2.1: define-properties "^1.1.3" es-abstract "^1.18.0-next.1" -asap@~2.0.3: +asap@^2.0.6, asap@~2.0.3: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= @@ -3534,6 +3544,26 @@ dnd-core@^10.0.2: "@react-dnd/invariant" "^2.0.0" redux "^4.0.4" +dnd-core@^11.1.3: + version "11.1.3" + resolved "https://registry.yarnpkg.com/dnd-core/-/dnd-core-11.1.3.tgz#f92099ba7245e49729d2433157031a6267afcc98" + integrity sha512-QugF55dNW+h+vzxVJ/LSJeTeUw9MCJ2cllhmVThVPEtF16ooBkxj0WBE5RB+AceFxMFo1rO6bJKXtqKl+JNnyA== + dependencies: + "@react-dnd/asap" "^4.0.0" + "@react-dnd/invariant" "^2.0.0" + redux "^4.0.4" + +dnd-core@^9.5.1: + version "9.5.1" + resolved "https://registry.yarnpkg.com/dnd-core/-/dnd-core-9.5.1.tgz#e9ec02d33529b68fa528865704d40ac4b14f2baf" + integrity sha512-/yEWFF2jg51yyB8uA2UbvBr9Qis0Oo/4p9cqHLEKZdxzHHVSPfq0a/ool8NG6dIS6Q4uN+oKGObY0rNWiopJDA== + dependencies: + "@types/asap" "^2.0.0" + "@types/invariant" "^2.2.30" + asap "^2.0.6" + invariant "^2.2.4" + redux "^4.0.4" + dns-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" @@ -4354,6 +4384,19 @@ from2@^2.1.0: inherits "^2.0.1" readable-stream "^2.0.0" +frontend-collective-react-dnd-scrollzone@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/frontend-collective-react-dnd-scrollzone/-/frontend-collective-react-dnd-scrollzone-1.0.2.tgz#cf5ed6165335f7d26504a40126f8e972ee644698" + integrity sha512-me/D9PZJq9j/sjEjs/OPmm6V6nbaHbhgeQiwrWu0t35lhwAOKWc+QBzzKKcZQeboYTkgE8UvCD9el+5ANp+g5Q== + dependencies: + hoist-non-react-statics "^3.1.0" + lodash.throttle "^4.0.1" + prop-types "^15.5.9" + raf "^3.2.0" + react "^16.3.0" + react-display-name "^0.2.0" + react-dom "^16.3.0" + fs-constants@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" @@ -6137,6 +6180,11 @@ lodash.isboolean@^3.0.3: resolved "https://registry.yarnpkg.com/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz#6c2e171db2a257cd96802fd43b01b20d5f5870f6" integrity sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY= +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= + lodash.isinteger@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343" @@ -6167,7 +6215,7 @@ lodash.once@^4.0.0: resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= -lodash.throttle@^4.1.1: +lodash.throttle@^4.0.1, lodash.throttle@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4" integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ= @@ -7743,7 +7791,7 @@ prop-types-exact@^1.2.0: object.assign "^4.1.0" reflect.ownkeys "^0.2.0" -prop-types@^15.5.0, prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: +prop-types@^15.5.0, prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.5.9, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -7890,7 +7938,7 @@ quick-format-unescaped@^1.1.2: dependencies: fast-safe-stringify "^1.0.8" -raf@^3.4.1: +raf@^3.2.0, raf@^3.4.1: version "3.4.1" resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39" integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA== @@ -7995,6 +8043,11 @@ react-dates@^21.1.0, react-dates@^21.5.1: react-with-styles "^4.1.0" react-with-styles-interface-css "^6.0.0" +react-display-name@^0.2.0: + version "0.2.5" + resolved "https://registry.yarnpkg.com/react-display-name/-/react-display-name-0.2.5.tgz#304c7cbfb59ee40389d436e1a822c17fe27936c6" + integrity sha512-I+vcaK9t4+kypiSgaiVWAipqHRXYmZIuAiS8vzFvXHHXVigg/sMKwlRgLy6LH2i3rmP+0Vzfl5lFsFRwF1r3pg== + react-dnd-html5-backend@^10.0.2: version "10.0.2" resolved "https://registry.yarnpkg.com/react-dnd-html5-backend/-/react-dnd-html5-backend-10.0.2.tgz#15cb9d2b923f43576a136df854e288cb5969784c" @@ -8002,6 +8055,20 @@ react-dnd-html5-backend@^10.0.2: dependencies: dnd-core "^10.0.2" +react-dnd-html5-backend@^11.1.3: + version "11.1.3" + resolved "https://registry.yarnpkg.com/react-dnd-html5-backend/-/react-dnd-html5-backend-11.1.3.tgz#2749f04f416ec230ea193f5c1fbea2de7dffb8f7" + integrity sha512-/1FjNlJbW/ivkUxlxQd7o3trA5DE33QiRZgxent3zKme8DwF4Nbw3OFVhTRFGaYhHFNL1rZt6Rdj1D78BjnNLw== + dependencies: + dnd-core "^11.1.3" + +react-dnd-html5-backend@^9.3.4: + version "9.5.1" + resolved "https://registry.yarnpkg.com/react-dnd-html5-backend/-/react-dnd-html5-backend-9.5.1.tgz#e6a0aed3ece800c1abe004f9ed9991513e2e644c" + integrity sha512-wUdzjREwLqHxFkA6E+XDVL5IFjRDbBI3SHVKil9n3qrGT5dm2tA2oi1aIALdfMKsu00c+OXA9lz/LuKZCE9KXg== + dependencies: + dnd-core "^9.5.1" + react-dnd@^10.0.2: version "10.0.2" resolved "https://registry.yarnpkg.com/react-dnd/-/react-dnd-10.0.2.tgz#a6ad8eb3d9f2c573031f7ce05012e5c767a0b1fc" @@ -8012,7 +8079,28 @@ react-dnd@^10.0.2: dnd-core "^10.0.2" hoist-non-react-statics "^3.3.0" -react-dom@^16.9.0: +react-dnd@^11.1.3: + version "11.1.3" + resolved "https://registry.yarnpkg.com/react-dnd/-/react-dnd-11.1.3.tgz#f9844f5699ccc55dfc81462c2c19f726e670c1af" + integrity sha512-8rtzzT8iwHgdSC89VktwhqdKKtfXaAyC4wiqp0SywpHG12TTLvfOoL6xNEIUWXwIEWu+CFfDn4GZJyynCEuHIQ== + dependencies: + "@react-dnd/shallowequal" "^2.0.0" + "@types/hoist-non-react-statics" "^3.3.1" + dnd-core "^11.1.3" + hoist-non-react-statics "^3.3.0" + +react-dnd@^9.3.4: + version "9.5.1" + resolved "https://registry.yarnpkg.com/react-dnd/-/react-dnd-9.5.1.tgz#907e55c791d6c50cbed1a4021c14b989b86ac467" + integrity sha512-j2MvziPNLsxXkb3kIJzLvvOv/TQ4sysp6U4CmxAXd4C884dXm/9UGdB7K1wkTW3ZxVpI1K7XhKbX0JgNlPfLcA== + dependencies: + "@types/hoist-non-react-statics" "^3.3.1" + "@types/shallowequal" "^1.1.1" + dnd-core "^9.5.1" + hoist-non-react-statics "^3.3.0" + shallowequal "^1.1.0" + +react-dom@^16.3.0, react-dom@^16.9.0: version "16.14.0" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.14.0.tgz#7ad838ec29a777fb3c75c3a190f661cf92ab8b89" integrity sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw== @@ -8180,6 +8268,33 @@ react-side-effect@^2.1.0: resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.1.tgz#66c5701c3e7560ab4822a4ee2742dee215d72eb3" integrity sha512-2FoTQzRNTncBVtnzxFOk2mCpcfxQpenBMbk5kSVBg5UcPqV9fRbgY2zhb7GTWWOlpFmAxhClBDlIq8Rsubz1yQ== +react-sortable-tree@2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/react-sortable-tree/-/react-sortable-tree-2.7.1.tgz#99bce93fe838ed90258c1796ccd7ac59b70f8fbd" + integrity sha512-J78/6AXv9RN0XxoBAIDz8a7aNFdi/Mezcv/9lKNYTYzqAWxEyOTMeqZjpmvwLhM2HRpChTn0yYLHTdRSNHRACw== + dependencies: + frontend-collective-react-dnd-scrollzone "^1.0.2" + lodash.isequal "^4.5.0" + prop-types "^15.6.1" + react-dnd "^9.3.4" + react-dnd-html5-backend "^9.3.4" + react-lifecycles-compat "^3.0.4" + react-sortable-tree "^2.6.0" + react-virtualized "^9.19.1" + +react-sortable-tree@^2.6.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/react-sortable-tree/-/react-sortable-tree-2.8.0.tgz#9901711778628d0546c045f845216480507c366a" + integrity sha512-gTjwxRNt7z0FC76KeNTnGqx1qUSlV3N78mMPRushBpSUXzZYhiFNsWHUIruyPnaAbw4SA7LgpItV7VieAuwDpw== + dependencies: + frontend-collective-react-dnd-scrollzone "^1.0.2" + lodash.isequal "^4.5.0" + prop-types "^15.6.1" + react-dnd "^11.1.3" + react-dnd-html5-backend "^11.1.3" + react-lifecycles-compat "^3.0.4" + react-virtualized "^9.21.2" + react-tooltip@4.2.15, react-tooltip@^4.2.11: version "4.2.15" resolved "https://registry.yarnpkg.com/react-tooltip/-/react-tooltip-4.2.15.tgz#ae278931a222434ae597c57aab07be215a2aa5f9" @@ -8208,7 +8323,7 @@ react-transition-group@^2.3.1: prop-types "^15.6.2" react-lifecycles-compat "^3.0.4" -react-virtualized@^9.22.3: +react-virtualized@^9.19.1, react-virtualized@^9.21.2, react-virtualized@^9.22.3: version "9.22.3" resolved "https://registry.yarnpkg.com/react-virtualized/-/react-virtualized-9.22.3.tgz#f430f16beb0a42db420dbd4d340403c0de334421" integrity sha512-MKovKMxWTcwPSxE1kK1HcheQTWfuCxAuBoSTf2gwyMM21NdX/PXUhnoP8Uc5dRKd+nKm8v41R36OellhdCpkrw== @@ -8253,7 +8368,7 @@ react-with-styles@^4.1.0: prop-types "^15.7.2" react-with-direction "^1.3.1" -react@^16.13.1: +react@^16.13.1, react@^16.3.0: version "16.14.0" resolved "https://registry.yarnpkg.com/react/-/react-16.14.0.tgz#94d776ddd0aaa37da3eda8fc5b6b18a4c9a3114d" integrity sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g== @@ -9538,7 +9653,7 @@ strapi-generate@3.5.4: reportback "^2.0.2" strapi-utils "3.5.4" -strapi-helper-plugin@3.5.4: +strapi-helper-plugin@3.5.4, strapi-helper-plugin@^3.5.4: version "3.5.4" resolved "https://registry.yarnpkg.com/strapi-helper-plugin/-/strapi-helper-plugin-3.5.4.tgz#d49d173ccb1c66abbc1e3891fab528400aef1ae2" integrity sha512-u/5YDtCoZ4p1crJmK4md2Zh/R8/odk+3X65CVqI/EoZC8T2YiqOQ75Ec62CCpTn8gk1tBZmaAS9sxNDjalLPMw==