@cntrl-site/sdk-nextjs 1.6.7 → 1.6.8-alpha.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.
@@ -0,0 +1,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
4
+ </state>
5
+ </component>
@@ -0,0 +1,15 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
5
+ <option name="myValues">
6
+ <value>
7
+ <list size="1">
8
+ <item index="0" class="java.lang.String" itemvalue="jsx" />
9
+ </list>
10
+ </value>
11
+ </option>
12
+ <option name="myCustomValuesEnabled" value="true" />
13
+ </inspection_tool>
14
+ </profile>
15
+ </component>
package/eslint.config.mjs CHANGED
@@ -28,7 +28,8 @@ export default antfu(
28
28
  'no-extra-boolean-cast': 'off',
29
29
  'prefer-promise-reject-errors': 'off',
30
30
  'new-cap': 'off',
31
- 'perfectionist/sort-named-exports': 'off'
31
+ 'perfectionist/sort-named-exports': 'off',
32
+ 'style/multiline-ternary': 'off'
32
33
  },
33
34
  },
34
35
  );
@@ -4,7 +4,8 @@ exports.LinkWrapper = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const LinkWrapper = ({ url, children, target }) => {
6
6
  const validUrl = url && buildValidUrl(url);
7
- return url ? ((0, jsx_runtime_1.jsx)("a", { href: validUrl, target: target, rel: "noreferrer", children: children })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }));
7
+ const targetParams = target === '_blank' ? { target, rel: 'noreferrer' } : {};
8
+ return url ? ((0, jsx_runtime_1.jsx)("a", Object.assign({ href: validUrl }, targetParams, { children: children }))) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }));
8
9
  };
9
10
  exports.LinkWrapper = LinkWrapper;
10
11
  function buildValidUrl(url) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk-nextjs",
3
- "version": "1.6.7",
3
+ "version": "1.6.8-alpha.0",
4
4
  "description": "SDK for Next.js",
5
5
  "author": "arsen@momdesign.nyc",
6
6
  "license": "MIT",
@@ -8,11 +8,11 @@ interface Props {
8
8
 
9
9
  export const LinkWrapper: React.FC<Props> = ({ url, children, target }) => {
10
10
  const validUrl = url && buildValidUrl(url);
11
+ const targetParams = target === '_blank' ? { target, rel: 'noreferrer' } : {};
11
12
  return url ? (
12
13
  <a
13
14
  href={validUrl}
14
- target={target}
15
- rel="noreferrer"
15
+ {...targetParams}
16
16
  >
17
17
  {children}
18
18
  </a>
@@ -21,7 +21,6 @@ export const LinkWrapper: React.FC<Props> = ({ url, children, target }) => {
21
21
  );
22
22
  };
23
23
 
24
-
25
24
  function buildValidUrl(url: string): string {
26
25
  const prefixes = [
27
26
  'http://',
Binary file
Binary file
Binary file