@contentful/field-editor-reference 5.30.1 → 5.30.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.
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "ExternalEntryCard", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return ExternalEntryCard;
9
+ }
10
+ });
11
+ const _react = _interop_require_wildcard(require("react"));
12
+ const _ExternalResourceCard = require("../ExternalResourceCard/ExternalResourceCard");
13
+ function _getRequireWildcardCache(nodeInterop) {
14
+ if (typeof WeakMap !== "function") return null;
15
+ var cacheBabelInterop = new WeakMap();
16
+ var cacheNodeInterop = new WeakMap();
17
+ return (_getRequireWildcardCache = function(nodeInterop) {
18
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
19
+ })(nodeInterop);
20
+ }
21
+ function _interop_require_wildcard(obj, nodeInterop) {
22
+ if (!nodeInterop && obj && obj.__esModule) {
23
+ return obj;
24
+ }
25
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
26
+ return {
27
+ default: obj
28
+ };
29
+ }
30
+ var cache = _getRequireWildcardCache(nodeInterop);
31
+ if (cache && cache.has(obj)) {
32
+ return cache.get(obj);
33
+ }
34
+ var newObj = {
35
+ __proto__: null
36
+ };
37
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
38
+ for(var key in obj){
39
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
40
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
41
+ if (desc && (desc.get || desc.set)) {
42
+ Object.defineProperty(newObj, key, desc);
43
+ } else {
44
+ newObj[key] = obj[key];
45
+ }
46
+ }
47
+ }
48
+ newObj.default = obj;
49
+ if (cache) {
50
+ cache.set(obj, newObj);
51
+ }
52
+ return newObj;
53
+ }
54
+ function ExternalEntryCard(props) {
55
+ const openEntryDetail = ()=>{
56
+ window.open(props.info.resource.fields.externalUrl, '_blank', 'noopener,noreferrer');
57
+ };
58
+ return _react.createElement(_ExternalResourceCard.ExternalResourceCard, {
59
+ ...props,
60
+ onEdit: openEntryDetail
61
+ });
62
+ }
@@ -13,8 +13,8 @@ const _reactintersectionobserver = require("react-intersection-observer");
13
13
  const _f36components = require("@contentful/f36-components");
14
14
  const _EntityStore = require("../../common/EntityStore");
15
15
  const _components = require("../../components");
16
- const _ExternalResourceCard = require("../ExternalResourceCard/ExternalResourceCard");
17
16
  const _ContentfulEntryCard = require("./ContentfulEntryCard");
17
+ const _ExternalEntryCard = require("./ExternalEntryCard");
18
18
  function _getRequireWildcardCache(nodeInterop) {
19
19
  if (typeof WeakMap !== "function") return null;
20
20
  var cacheBabelInterop = new WeakMap();
@@ -87,7 +87,7 @@ function ExistingResourceCard(props) {
87
87
  ...props
88
88
  });
89
89
  }
90
- return _react.createElement(_ExternalResourceCard.ExternalResourceCard, {
90
+ return _react.createElement(_ExternalEntryCard.ExternalEntryCard, {
91
91
  info: info,
92
92
  ...props
93
93
  });
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import { ExternalResourceCard } from '../ExternalResourceCard/ExternalResourceCard';
3
+ export function ExternalEntryCard(props) {
4
+ const openEntryDetail = ()=>{
5
+ window.open(props.info.resource.fields.externalUrl, '_blank', 'noopener,noreferrer');
6
+ };
7
+ return React.createElement(ExternalResourceCard, {
8
+ ...props,
9
+ onEdit: openEntryDetail
10
+ });
11
+ }
@@ -3,8 +3,8 @@ import { useInView } from 'react-intersection-observer';
3
3
  import { EntryCard } from '@contentful/f36-components';
4
4
  import { isContentfulResourceInfo, useResource } from '../../common/EntityStore';
5
5
  import { ResourceEntityErrorCard } from '../../components';
6
- import { ExternalResourceCard } from '../ExternalResourceCard/ExternalResourceCard';
7
6
  import { ContentfulEntryCard } from './ContentfulEntryCard';
7
+ import { ExternalEntryCard } from './ExternalEntryCard';
8
8
  function ResourceCardSkeleton() {
9
9
  return React.createElement(EntryCard, {
10
10
  size: "small",
@@ -36,7 +36,7 @@ function ExistingResourceCard(props) {
36
36
  ...props
37
37
  });
38
38
  }
39
- return React.createElement(ExternalResourceCard, {
39
+ return React.createElement(ExternalEntryCard, {
40
40
  info: info,
41
41
  ...props
42
42
  });
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { type ExternalResourceCardProps } from '../ExternalResourceCard/ExternalResourceCard';
3
+ type ExternalEntryCardProps = ExternalResourceCardProps;
4
+ export declare function ExternalEntryCard(props: ExternalEntryCardProps): JSX.Element;
5
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-reference",
3
- "version": "5.30.1",
3
+ "version": "5.30.3",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "registry": "https://npm.pkg.github.com/"
67
67
  },
68
- "gitHead": "09499ab6b249a6daa745d92fa887ff87cfb78d8c"
68
+ "gitHead": "759fde7b73a0ae4380021335304b3f387ceedce5"
69
69
  }