@jahia/data-helper 1.0.7 → 1.0.8

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.
@@ -1,5 +1,5 @@
1
1
  var _templateObject;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
3
  import gql from 'graphql-tag';
4
- import { nodeCacheRequiredFields } from '../../fragments/PredefinedFragments';
5
- export var CONTENT_PREVIEW_QUERY = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["query previewQueryByWorkspace($path: String!, $templateType: String!, $view: String!, $contextConfiguration: String!, $language: String!, $workspace: Workspace!, $requestAttributes: [InputRenderRequestAttributeInput]) {\n jcr(workspace: $workspace) {\n nodeByPath(path: $path) {\n id: uuid\n isFile: isNodeType(type: {types: [\"jnt:file\"]})\n path\n lastModified: property(name: \"jcr:lastModified\", language: $language) {\n value\n }\n renderedContent(templateType: $templateType, view: $view, contextConfiguration: $contextConfiguration, language: $language, requestAttributes: $requestAttributes) {\n output\n staticAssets(type: \"css\") {\n key\n }\n }\n ...NodeCacheRequiredFields\n }\n }\n}", ""])), nodeCacheRequiredFields.gql);
4
+ import { mimeTypes, nodeCacheRequiredFields } from '../../fragments';
5
+ export var CONTENT_PREVIEW_QUERY = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["query previewQueryByWorkspace($path: String!, $templateType: String!, $view: String!, $contextConfiguration: String!, $language: String!, $workspace: Workspace!, $requestAttributes: [InputRenderRequestAttributeInput]) {\n jcr(workspace: $workspace) {\n nodeByPath(path: $path) {\n id: uuid\n isFile: isNodeType(type: {types: [\"jnt:file\"]})\n path\n lastModified: property(name: \"jcr:lastModified\", language: $language) {\n value\n }\n renderedContent(templateType: $templateType, view: $view, contextConfiguration: $contextConfiguration, language: $language, requestAttributes: $requestAttributes) {\n output\n staticAssets(type: \"css\") {\n key\n }\n }\n ...NodeInfoResourceNode\n ...NodeCacheRequiredFields\n }\n }\n}", "", ""])), nodeCacheRequiredFields.gql, mimeTypes.gql);
@@ -28,7 +28,7 @@ describe('useContentPreview', function () {
28
28
  useContentPreview(args);
29
29
  expect(useQuery).toHaveBeenCalled();
30
30
  });
31
- it('should return empty object when return emtpy data', function () {
31
+ it('should return empty object when return empty data', function () {
32
32
  expect(useContentPreview(args).data).toEqual({});
33
33
  });
34
34
  });
@@ -3,7 +3,6 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
3
3
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
4
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
5
  import { useNodeChecks } from './index.js';
6
- import { useQuery } from 'react-apollo';
7
6
  import React from 'react';
8
7
  import { getQuery } from '../useNodeInfo/useNodeInfo.gql-queries';
9
8
  var wait = function wait() {
@@ -133,7 +133,7 @@ export var useNodeInfo = function useNodeInfo(variables, options, queryOptions)
133
133
  return function () {
134
134
  queue.splice(queue.indexOf(currentRequest), 1);
135
135
  };
136
- }, [currentRequest]);
136
+ }, [client, currentRequest]);
137
137
  return result;
138
138
  };
139
139
  var getResult = function getResult(data, others, options, query, generatedVariables) {
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.CONTENT_PREVIEW_QUERY = void 0;
7
7
  var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
8
- var _PredefinedFragments = require("../../fragments/PredefinedFragments");
8
+ var _fragments = require("../../fragments");
9
9
  var _templateObject;
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
11
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
12
- var CONTENT_PREVIEW_QUERY = (0, _graphqlTag["default"])(_templateObject || (_templateObject = _taggedTemplateLiteral(["query previewQueryByWorkspace($path: String!, $templateType: String!, $view: String!, $contextConfiguration: String!, $language: String!, $workspace: Workspace!, $requestAttributes: [InputRenderRequestAttributeInput]) {\n jcr(workspace: $workspace) {\n nodeByPath(path: $path) {\n id: uuid\n isFile: isNodeType(type: {types: [\"jnt:file\"]})\n path\n lastModified: property(name: \"jcr:lastModified\", language: $language) {\n value\n }\n renderedContent(templateType: $templateType, view: $view, contextConfiguration: $contextConfiguration, language: $language, requestAttributes: $requestAttributes) {\n output\n staticAssets(type: \"css\") {\n key\n }\n }\n ...NodeCacheRequiredFields\n }\n }\n}", ""])), _PredefinedFragments.nodeCacheRequiredFields.gql);
12
+ var CONTENT_PREVIEW_QUERY = (0, _graphqlTag["default"])(_templateObject || (_templateObject = _taggedTemplateLiteral(["query previewQueryByWorkspace($path: String!, $templateType: String!, $view: String!, $contextConfiguration: String!, $language: String!, $workspace: Workspace!, $requestAttributes: [InputRenderRequestAttributeInput]) {\n jcr(workspace: $workspace) {\n nodeByPath(path: $path) {\n id: uuid\n isFile: isNodeType(type: {types: [\"jnt:file\"]})\n path\n lastModified: property(name: \"jcr:lastModified\", language: $language) {\n value\n }\n renderedContent(templateType: $templateType, view: $view, contextConfiguration: $contextConfiguration, language: $language, requestAttributes: $requestAttributes) {\n output\n staticAssets(type: \"css\") {\n key\n }\n }\n ...NodeInfoResourceNode\n ...NodeCacheRequiredFields\n }\n }\n}", "", ""])), _fragments.nodeCacheRequiredFields.gql, _fragments.mimeTypes.gql);
13
13
  exports.CONTENT_PREVIEW_QUERY = CONTENT_PREVIEW_QUERY;
@@ -30,7 +30,7 @@ describe('useContentPreview', function () {
30
30
  (0, _index.useContentPreview)(args);
31
31
  expect(_reactApollo.useQuery).toHaveBeenCalled();
32
32
  });
33
- it('should return empty object when return emtpy data', function () {
33
+ it('should return empty object when return empty data', function () {
34
34
  expect((0, _index.useContentPreview)(args).data).toEqual({});
35
35
  });
36
36
  });
@@ -2,7 +2,6 @@
2
2
 
3
3
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
4
  var _index = require("./index.js");
5
- var _reactApollo = require("react-apollo");
6
5
  var _react = _interopRequireDefault(require("react"));
7
6
  var _useNodeInfo = require("../useNodeInfo/useNodeInfo.gql-queries");
8
7
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -140,7 +140,7 @@ var useNodeInfo = function useNodeInfo(variables, options, queryOptions) {
140
140
  return function () {
141
141
  queue.splice(queue.indexOf(currentRequest), 1);
142
142
  };
143
- }, [currentRequest]);
143
+ }, [client, currentRequest]);
144
144
  return result;
145
145
  };
146
146
  exports.useNodeInfo = useNodeInfo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jahia/data-helper",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "scripts": {
5
5
  "babel:js": "jahia-babel-js",
6
6
  "babel:module": "jahia-babel-module",