From acdd2f08ae8e98c3cdbbcd2face2c6228034fc3a Mon Sep 17 00:00:00 2001 From: Raffael Comi Date: Fri, 1 Feb 2019 13:09:06 +0100 Subject: [PATCH] !!!TASK: Compatibility with Neos.Ui 2.x/3.x Incompatible with Neos.Ui 1.x --- Resources/Private/JavaScript/AnchorView/src/AnchorView.js | 2 +- Resources/Public/JavaScript/AnchorView/Plugin.js | 2 +- Resources/Public/JavaScript/AnchorView/Plugin.js.map | 2 +- composer.json | 3 +++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Resources/Private/JavaScript/AnchorView/src/AnchorView.js b/Resources/Private/JavaScript/AnchorView/src/AnchorView.js index 0f3ea54..6fce2bd 100644 --- a/Resources/Private/JavaScript/AnchorView/src/AnchorView.js +++ b/Resources/Private/JavaScript/AnchorView/src/AnchorView.js @@ -7,7 +7,7 @@ import I18n from '@neos-project/neos-ui-i18n'; import {$get} from 'plow-js'; @connect(state => ({ - documentNode: selectors.UI.ContentCanvas.documentNodeSelector(state), + documentNode: selectors.CR.Nodes.documentNodeSelector(state), focusedNode: selectors.CR.Nodes.focusedSelector(state), transientSectionId: $get('sectionId.value', selectors.UI.Inspector.transientValues(state)) })) diff --git a/Resources/Public/JavaScript/AnchorView/Plugin.js b/Resources/Public/JavaScript/AnchorView/Plugin.js index c2a5afd..00b0d41 100644 --- a/Resources/Public/JavaScript/AnchorView/Plugin.js +++ b/Resources/Public/JavaScript/AnchorView/Plugin.js @@ -262,7 +262,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" var AnchorView = (_dec = (0, _reactRedux.connect)(function (state) { return { - documentNode: _neosUiReduxStore.selectors.UI.ContentCanvas.documentNodeSelector(state), + documentNode: _neosUiReduxStore.selectors.CR.Nodes.documentNodeSelector(state), focusedNode: _neosUiReduxStore.selectors.CR.Nodes.focusedSelector(state), transientSectionId: (0, _plowJs.$get)('sectionId.value', _neosUiReduxStore.selectors.UI.Inspector.transientValues(state)) }; diff --git a/Resources/Public/JavaScript/AnchorView/Plugin.js.map b/Resources/Public/JavaScript/AnchorView/Plugin.js.map index 8dc1e4f..4a0067f 100644 --- a/Resources/Public/JavaScript/AnchorView/Plugin.js.map +++ b/Resources/Public/JavaScript/AnchorView/Plugin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap 023ddd545450451a8c4f","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/readFromConsumerApi.js","webpack:///./src/index.js","webpack:///./src/manifest.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/createConsumerApi.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/package.json","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/manifest.js","webpack:///./src/AnchorView.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/prop-types/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/react-ui-components/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react-redux/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-redux-store/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-i18n/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/plow-js/index.js"],"names":["readFromConsumerApi","key","window","Error","require","viewsRegistry","globalRegistry","get","set","component","hasOwnLabel","createConsumerApi","createReadOnlyValue","value","writable","enumerable","configurable","manifests","exposureMap","api","Object","keys","forEach","defineProperty","manifest","identifier","options","bootstrap","push","AnchorView","documentNode","UI","ContentCanvas","documentNodeSelector","state","focusedNode","CR","Nodes","focusedSelector","transientSectionId","Inspector","transientValues","isCopied","getSetionId","props","copyToClipboard","documentNodeIdentifier","link","textArea","document","createElement","innerText","body","appendChild","select","execCommand","parentNode","removeChild","setState","display","width","height","fill","marginLeft","verticalAlign","propTypes","object","string","module","exports","React","PropTypes","ReactUiComponents","reactRedux","NeosUiReduxStore","NeosUiI18n","plow"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;kBC7DwBA,mB;AAAT,SAASA,mBAAT,CAA6BC,GAA7B,EAAkC;AAC7C,WAAO,YAAa;AAChB,YAAIC,OAAO,qBAAP,KAAiCA,OAAO,qBAAP,QAAkCD,GAAlC,CAArC,EAA+E;AAAA;;AAC3E,mBAAO,8BAAO,qBAAP,SAAkCA,GAAlC,uCAAP;AACH;;AAED,cAAM,IAAIE,KAAJ,iFAAN;AACH,KAND;AAOH,C;;;;;;;;;ACRD,mBAAAC,CAAQ,CAAR,E;;;;;;;;;ACAA;;;;AACA;;;;;;AAEA,mCAAS,mCAAT,EAA8C,EAA9C,EAAkD,0BAAkB;AAChE,QAAMC,gBAAgBC,eAAeC,GAAf,CAAmB,WAAnB,EAAgCA,GAAhC,CAAoC,OAApC,CAAtB;;AAEAF,kBAAcG,GAAd,CAAkB,yCAAlB,EAA6D;AACzDC,uCADyD;AAEzDC,qBAAa;AAF4C,KAA7D;AAIH,CAPD,E;;;;;;;;;;;;;;ACHA;;;;AACA;;;;;;kBAEe,mCAAoB,UAApB,C;QAGXC,iB;;;;;;;;;;;;kBCIoBA,iB;;AAVxB;;AACA;;;;;;AAEA,IAAMC,sBAAsB,SAAtBA,mBAAsB;AAAA,WAAU;AAClCC,oBADkC;AAElCC,kBAAU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ALJ,aADJ;AAoBH;;;;6BA7CMC,S,GAAY;AACf9B,iBAAa,oBAAU+B,MADR;AAEfpC,kBAAc,oBAAUoC,MAFT;AAGf3B,wBAAoB,oBAAU4B;AAHf,C;kBADFtC,U;;;;;;;;;ACbrB;;;;;;AAEAuC,OAAOC,OAAP,GAAiB,mCAAoB,QAApB,IAAgCC,KAAjD,C;;;;;;;;;ACFA;;;;;;AAEAF,OAAOC,OAAP,GAAiB,mCAAoB,QAApB,IAAgCE,SAAjD,C;;;;;;;;;ACFA;;;;;;AAEAH,OAAOC,OAAP,GAAiB,mCAAoB,qBAApB,IAA6CG,iBAA9D,C;;;;;;;;;ACFA;;;;;;AAEAJ,OAAOC,OAAP,GAAiB,mCAAoB,QAApB,IAAgCI,UAAjD,C;;;;;;;;;ACFA;;;;;;AAEAL,OAAOC,OAAP,GAAiB,mCAAoB,qBAApB,IAA6CK,gBAA9D,C;;;;;;;;;ACFA;;;;;;AAEAN,OAAOC,OAAP,GAAiB,mCAAoB,qBAApB,IAA6CM,UAA9D,C;;;;;;;;;ACFA;;;;;;AAEAP,OAAOC,OAAP,GAAiB,mCAAoB,QAApB,IAAgCO,IAAjD,C","file":"Plugin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 023ddd545450451a8c4f","export default function readFromConsumerApi(key) {\n return (...args) => {\n if (window['@Neos:HostPluginAPI'] && window['@Neos:HostPluginAPI'][`@${key}`]) {\n return window['@Neos:HostPluginAPI'][`@${key}`](...args);\n }\n\n throw new Error(`You are trying to read from a consumer api that hasn't been initialized yet!`);\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/readFromConsumerApi.js","require('./manifest');\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","import manifest from '@neos-project/neos-ui-extensibility';\nimport AnchorView from './AnchorView';\n\nmanifest('Flownative.AnchorLinks:AnchorView', {}, globalRegistry => {\n const viewsRegistry = globalRegistry.get('inspector').get('views');\n\n viewsRegistry.set('Flownative.Anchorlinks/Views/AnchorView', {\n component: AnchorView,\n hasOwnLabel: true\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./src/manifest.js","import createConsumerApi from './createConsumerApi';\nimport readFromConsumerApi from './readFromConsumerApi';\n\nexport default readFromConsumerApi('manifest');\n\nexport {\n createConsumerApi\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/index.js","import {version} from '../package.json';\nimport createManifestFunction from './manifest';\n\nconst createReadOnlyValue = value => ({\n value,\n writable: false,\n enumerable: false,\n configurable: true\n});\n\nexport default function createConsumerApi(manifests, exposureMap) {\n const api = {};\n\n Object.keys(exposureMap).forEach(key => {\n Object.defineProperty(api, key, createReadOnlyValue(exposureMap[key]));\n });\n\n Object.defineProperty(api, '@manifest', createReadOnlyValue(\n createManifestFunction(manifests)\n ));\n\n Object.defineProperty(window, '@Neos:HostPluginAPI', createReadOnlyValue(api));\n Object.defineProperty(window['@Neos:HostPluginAPI'], 'VERSION', createReadOnlyValue(version));\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/createConsumerApi.js","module.exports = {\"name\":\"@neos-project/neos-ui-extensibility\",\"version\":\"1.0.9\",\"description\":\"Extensibility mechanisms for the Neos CMS UI\",\"main\":\"./src/index.js\",\"scripts\":{\"prebuild\":\"check-dependencies && yarn clean\",\"test\":\"yarn jest -- -w 2 --coverage\",\"test:watch\":\"yarn jest -- --watch\",\"build\":\"exit 0\",\"build:watch\":\"exit 0\",\"clean\":\"rimraf ./lib ./dist\",\"lint\":\"eslint src\",\"jest\":\"NODE_ENV=test jest\"},\"devDependencies\":{\"@neos-project/babel-preset-neos-ui\":\"1.0.9\",\"@neos-project/jest-preset-neos-ui\":\"1.0.9\"},\"dependencies\":{\"@neos-project/build-essentials\":\"1.0.9\",\"@neos-project/positional-array-sorter\":\"1.0.9\",\"babel-core\":\"^6.13.2\",\"babel-eslint\":\"^7.1.1\",\"babel-loader\":\"^7.1.2\",\"babel-plugin-transform-decorators-legacy\":\"^1.3.4\",\"babel-plugin-transform-object-rest-spread\":\"^6.20.1\",\"babel-plugin-webpack-alias\":\"^2.1.1\",\"babel-preset-es2015\":\"^6.13.2\",\"babel-preset-react\":\"^6.3.13\",\"babel-preset-stage-0\":\"^6.3.13\",\"chalk\":\"^1.1.3\",\"css-loader\":\"^0.28.4\",\"file-loader\":\"^1.1.5\",\"json-loader\":\"^0.5.4\",\"postcss-loader\":\"^2.0.10\",\"react-dev-utils\":\"^0.5.0\",\"style-loader\":\"^0.19.0\"},\"bin\":{\"neos-react-scripts\":\"./bin/neos-react-scripts.js\"},\"jest\":{\"preset\":\"@neos-project/jest-preset-neos-ui\"}}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/@neos-project/neos-ui-extensibility/package.json\n// module id = 5\n// module chunks = 0","export default manifests => {\n return function manifest(identifier, options, bootstrap) {\n manifests.push({\n [identifier]: {\n options,\n bootstrap\n }\n });\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/manifest.js","import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {Button} from '@neos-project/react-ui-components';\nimport {connect} from 'react-redux';\nimport {selectors} from '@neos-project/neos-ui-redux-store';\nimport I18n from '@neos-project/neos-ui-i18n';\nimport {$get} from 'plow-js';\n\n@connect(state => ({\n documentNode: selectors.UI.ContentCanvas.documentNodeSelector(state),\n focusedNode: selectors.CR.Nodes.focusedSelector(state),\n transientSectionId: $get('sectionId.value', selectors.UI.Inspector.transientValues(state))\n}))\nexport default class AnchorView extends Component {\n static propTypes = {\n focusedNode: PropTypes.object,\n documentNode: PropTypes.object,\n transientSectionId: PropTypes.string\n };\n\n state = {\n isCopied: false\n };\n\n getSetionId = () => this.props.transientSectionId || $get('properties.sectionId', this.props.focusedNode)\n\n copyToClipboard = () => {\n const documentNodeIdentifier = $get('identifier', this.props.documentNode);\n const link = 'node://' + documentNodeIdentifier + '#' + this.getSetionId();\n const textArea = document.createElement('textarea');\n textArea.innerText = link;\n document.body.appendChild(textArea);\n textArea.select();\n document.execCommand('copy');\n textArea.parentNode.removeChild(textArea);\n this.setState({isCopied: true});\n };\n\n render() {\n return this.getSetionId() && (\n \n );\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/AnchorView.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().React;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().PropTypes;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/prop-types/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().ReactUiComponents;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/react-ui-components/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().reactRedux;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react-redux/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().NeosUiReduxStore;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-redux-store/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().NeosUiI18n;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-i18n/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().plow;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/plow-js/index.js"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap 39a37263f5f7a67d7786","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/readFromConsumerApi.js","webpack:///./src/index.js","webpack:///./src/manifest.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/createConsumerApi.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/package.json","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/manifest.js","webpack:///./src/AnchorView.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/prop-types/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/react-ui-components/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react-redux/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-redux-store/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-i18n/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/plow-js/index.js"],"names":["readFromConsumerApi","key","window","Error","require","viewsRegistry","globalRegistry","get","set","component","hasOwnLabel","createConsumerApi","createReadOnlyValue","value","writable","enumerable","configurable","manifests","exposureMap","api","Object","keys","forEach","defineProperty","manifest","identifier","options","bootstrap","push","AnchorView","documentNode","CR","Nodes","documentNodeSelector","state","focusedNode","focusedSelector","transientSectionId","UI","Inspector","transientValues","isCopied","getSetionId","props","copyToClipboard","documentNodeIdentifier","link","textArea","document","createElement","innerText","body","appendChild","select","execCommand","parentNode","removeChild","setState","display","width","height","fill","marginLeft","verticalAlign","propTypes","object","string","module","exports","React","PropTypes","ReactUiComponents","reactRedux","NeosUiReduxStore","NeosUiI18n","plow"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA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;;;ACFA;;;;;;AAEAF,OAAOC,OAAP,GAAiB,mCAAoB,QAApB,IAAgCE,SAAjD,C;;;;;;;;;ACFA;;;;;;AAEAH,OAAOC,OAAP,GAAiB,mCAAoB,qBAApB,IAA6CG,iBAA9D,C;;;;;;;;;ACFA;;;;;;AAEAJ,OAAOC,OAAP,GAAiB,mCAAoB,QAApB,IAAgCI,UAAjD,C;;;;;;;;;ACFA;;;;;;AAEAL,OAAOC,OAAP,GAAiB,mCAAoB,qBAApB,IAA6CK,gBAA9D,C;;;;;;;;;ACFA;;;;;;AAEAN,OAAOC,OAAP,GAAiB,mCAAoB,qBAApB,IAA6CM,UAA9D,C;;;;;;;;;ACFA;;;;;;AAEAP,OAAOC,OAAP,GAAiB,mCAAoB,QAApB,IAAgCO,IAAjD,C","file":"Plugin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 39a37263f5f7a67d7786","export default function readFromConsumerApi(key) {\n return (...args) => {\n if (window['@Neos:HostPluginAPI'] && window['@Neos:HostPluginAPI'][`@${key}`]) {\n return window['@Neos:HostPluginAPI'][`@${key}`](...args);\n }\n\n throw new Error(`You are trying to read from a consumer api that hasn't been initialized yet!`);\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/readFromConsumerApi.js","require('./manifest');\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","import manifest from '@neos-project/neos-ui-extensibility';\nimport AnchorView from './AnchorView';\n\nmanifest('Flownative.AnchorLinks:AnchorView', {}, globalRegistry => {\n const viewsRegistry = globalRegistry.get('inspector').get('views');\n\n viewsRegistry.set('Flownative.Anchorlinks/Views/AnchorView', {\n component: AnchorView,\n hasOwnLabel: true\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./src/manifest.js","import createConsumerApi from './createConsumerApi';\nimport readFromConsumerApi from './readFromConsumerApi';\n\nexport default readFromConsumerApi('manifest');\n\nexport {\n createConsumerApi\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/index.js","import {version} from '../package.json';\nimport createManifestFunction from './manifest';\n\nconst createReadOnlyValue = value => ({\n value,\n writable: false,\n enumerable: false,\n configurable: true\n});\n\nexport default function createConsumerApi(manifests, exposureMap) {\n const api = {};\n\n Object.keys(exposureMap).forEach(key => {\n Object.defineProperty(api, key, createReadOnlyValue(exposureMap[key]));\n });\n\n Object.defineProperty(api, '@manifest', createReadOnlyValue(\n createManifestFunction(manifests)\n ));\n\n Object.defineProperty(window, '@Neos:HostPluginAPI', createReadOnlyValue(api));\n Object.defineProperty(window['@Neos:HostPluginAPI'], 'VERSION', createReadOnlyValue(version));\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/createConsumerApi.js","module.exports = {\"name\":\"@neos-project/neos-ui-extensibility\",\"version\":\"1.0.9\",\"description\":\"Extensibility mechanisms for the Neos CMS UI\",\"main\":\"./src/index.js\",\"scripts\":{\"prebuild\":\"check-dependencies && yarn clean\",\"test\":\"yarn jest -- -w 2 --coverage\",\"test:watch\":\"yarn jest -- --watch\",\"build\":\"exit 0\",\"build:watch\":\"exit 0\",\"clean\":\"rimraf ./lib ./dist\",\"lint\":\"eslint src\",\"jest\":\"NODE_ENV=test jest\"},\"devDependencies\":{\"@neos-project/babel-preset-neos-ui\":\"1.0.9\",\"@neos-project/jest-preset-neos-ui\":\"1.0.9\"},\"dependencies\":{\"@neos-project/build-essentials\":\"1.0.9\",\"@neos-project/positional-array-sorter\":\"1.0.9\",\"babel-core\":\"^6.13.2\",\"babel-eslint\":\"^7.1.1\",\"babel-loader\":\"^7.1.2\",\"babel-plugin-transform-decorators-legacy\":\"^1.3.4\",\"babel-plugin-transform-object-rest-spread\":\"^6.20.1\",\"babel-plugin-webpack-alias\":\"^2.1.1\",\"babel-preset-es2015\":\"^6.13.2\",\"babel-preset-react\":\"^6.3.13\",\"babel-preset-stage-0\":\"^6.3.13\",\"chalk\":\"^1.1.3\",\"css-loader\":\"^0.28.4\",\"file-loader\":\"^1.1.5\",\"json-loader\":\"^0.5.4\",\"postcss-loader\":\"^2.0.10\",\"react-dev-utils\":\"^0.5.0\",\"style-loader\":\"^0.19.0\"},\"bin\":{\"neos-react-scripts\":\"./bin/neos-react-scripts.js\"},\"jest\":{\"preset\":\"@neos-project/jest-preset-neos-ui\"}}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/@neos-project/neos-ui-extensibility/package.json\n// module id = 5\n// module chunks = 0","export default manifests => {\n return function manifest(identifier, options, bootstrap) {\n manifests.push({\n [identifier]: {\n options,\n bootstrap\n }\n });\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/manifest.js","import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {Button} from '@neos-project/react-ui-components';\nimport {connect} from 'react-redux';\nimport {selectors} from '@neos-project/neos-ui-redux-store';\nimport I18n from '@neos-project/neos-ui-i18n';\nimport {$get} from 'plow-js';\n\n@connect(state => ({\n documentNode: selectors.CR.Nodes.documentNodeSelector(state),\n focusedNode: selectors.CR.Nodes.focusedSelector(state),\n transientSectionId: $get('sectionId.value', selectors.UI.Inspector.transientValues(state))\n}))\nexport default class AnchorView extends Component {\n static propTypes = {\n focusedNode: PropTypes.object,\n documentNode: PropTypes.object,\n transientSectionId: PropTypes.string\n };\n\n state = {\n isCopied: false\n };\n\n getSetionId = () => this.props.transientSectionId || $get('properties.sectionId', this.props.focusedNode)\n\n copyToClipboard = () => {\n const documentNodeIdentifier = $get('identifier', this.props.documentNode);\n const link = 'node://' + documentNodeIdentifier + '#' + this.getSetionId();\n const textArea = document.createElement('textarea');\n textArea.innerText = link;\n document.body.appendChild(textArea);\n textArea.select();\n document.execCommand('copy');\n textArea.parentNode.removeChild(textArea);\n this.setState({isCopied: true});\n };\n\n render() {\n return this.getSetionId() && (\n \n );\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/AnchorView.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().React;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().PropTypes;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/prop-types/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().ReactUiComponents;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/react-ui-components/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().reactRedux;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react-redux/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().NeosUiReduxStore;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-redux-store/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().NeosUiI18n;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-i18n/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().plow;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/plow-js/index.js"],"sourceRoot":""} \ No newline at end of file diff --git a/composer.json b/composer.json index f01a88e..6d0af36 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,9 @@ "require": { "neos/neos": "^3.0 || ^4.0" }, + "conflict": { + "neos/neos-ui": "<2.0.0" + }, "autoload": { "psr-4": { "Flownative\\Anchorlinks\\": "Classes/"