New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@iwsio/react-blog-examples

Package Overview
Dependencies
Maintainers
0
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iwsio/react-blog-examples - npm Package Compare versions

Comparing version 3.2.0 to 4.0.0

4

dist/json-csv/data.d.ts

@@ -21,8 +21,8 @@ export declare const items: {

label: string;
transform: (v: any) => "downloaded" | "pending";
transform: (v: unknown) => "downloaded" | "pending";
} | {
name: string;
label: string;
transform: (value: any) => "Test 1" | "Test 2" | "Unknown";
transform: (value: unknown) => "Test 1" | "Test 2" | "Unknown";
})[];
};

@@ -44,3 +44,3 @@ export const items = [

label: 'Downloaded',
transform: v => v ? 'downloaded' : 'pending'
transform: (v) => v ? 'downloaded' : 'pending'
},

@@ -54,3 +54,3 @@ {

label: 'Level',
transform: function (value) {
transform: (value) => {
switch (value) {

@@ -57,0 +57,0 @@ case 1: return 'Test 1';

import { ExportOptions } from '@iwsio/json-csv-core/types';
export type JsonCsvExampleProps = {
export interface JsonCsvExampleProps {
resultUpdated?: () => void;
};
export type JsonValues = {
}
export interface JsonValues {
items: Record<string, any>[];
options: Partial<ExportOptions>;
};
}
export declare const JsonCsvExample: import("react").ForwardRefExoticComponent<JsonCsvExampleProps & import("react").RefAttributes<HTMLFormElement>>;
export default JsonCsvExample;
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { FieldManager } from '@iwsio/forms/FieldManager';
import { useForwardRef } from '@iwsio/forms/useForwardRef';
import { toCsv } from '@iwsio/json-csv-core';
import { forwardRef, useEffect, useState } from 'react';
import { items as initialItems, options as initialOptions } from './data.js';
import { JsonField } from './JsonField.js';
import { ResetButton } from './ResetButton.js';
import { ResultView } from './ResultView.js';
import { items as initialItems, options as initialOptions } from './data.js';
import { simpleErrorMapping } from './simpleErrors.js';
import { useForwardRef } from '@iwsio/forms/useForwardRef';
import { FieldManager } from '@iwsio/forms/FieldManager';
const defaultValues = { items: JSON.stringify(initialItems, null, 2), options: JSON.stringify(initialOptions, null, 2) };

@@ -34,4 +34,4 @@ // forwarding ref here because I was tinkering with hljs and the example dom

resultUpdated();
}, [result]);
return (_jsxs(FieldManager, { fields: { ...defaultValues }, defaultValues: defaultValues, onValidSubmit: handleValidSubmit, errorMapping: simpleErrorMapping, ref: refDom, children: [_jsxs("div", { className: "flex flex-col sm:flex-row sm:gap-4", children: [_jsx(JsonField, { name: "items", label: "Items" }), _jsx(JsonField, { name: "options", label: "Options" })] }), _jsx("div", { className: "form-row my-3", children: _jsx("div", { className: "col", children: _jsxs("p", { className: "text-right gap-2", children: [_jsx(ResetButton, { onReset: () => setResult(_old => '') }), _jsx("button", { type: "submit", className: "btn", children: "Convert" })] }) }) }), _jsx(ResultView, { result: result })] }));
}, [result, resultUpdated]);
return (_jsxs(FieldManager, { fields: { ...defaultValues }, defaultValues: defaultValues, onValidSubmit: handleValidSubmit, errorMapping: simpleErrorMapping, ref: refDom, children: [_jsxs("div", { className: "flex flex-col sm:flex-row sm:gap-4", children: [_jsx(JsonField, { name: "items", label: "Items" }), _jsx(JsonField, { name: "options", label: "Options" })] }), _jsx("div", { className: "form-row my-3", children: _jsx("div", { className: "col", children: _jsxs("p", { className: "gap-2 text-right", children: [_jsx(ResetButton, { onReset: () => setResult(_old => '') }), _jsx("button", { type: "submit", className: "btn", children: "Convert" })] }) }) }), _jsx(ResultView, { result: result })] }));
});

@@ -38,0 +38,0 @@ JsonCsvExample.displayName = 'JsonCsvExample';

@@ -19,3 +19,3 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";

}
}, [onChange, setFieldError]);
}, [name, onChange, setFieldError]);
useEffect(() => {

@@ -30,5 +30,5 @@ if (fields[name] == null)

};
}, [fields[name]]);
return (_jsx("div", { className: "grow", children: _jsxs("label", { className: "label flex-col items-start prose", children: [_jsx("h3", { children: label }), _jsxs("div", { className: "w-full indicator", children: [_jsx(InvalidFeedbackForField, { name: name, className: "indicator-item badge badge-error" }), _jsx(TextAreaField, { name: name, className: `w-full font-mono textarea textarea-bordered ${fieldError ? 'textarea-error' : ''}`, rows: 25, required: true, ...props })] })] }) }));
}, [checkValueAndTriggerChange, fields, name]);
return (_jsx("div", { className: "grow", children: _jsxs("label", { className: "label prose flex-col items-start", children: [_jsx("h3", { children: label }), _jsxs("div", { className: "indicator w-full", children: [_jsx(InvalidFeedbackForField, { name: name, className: "indicator-item badge badge-error" }), _jsx(TextAreaField, { name: name, className: `textarea textarea-bordered w-full font-mono ${fieldError ? 'textarea-error' : ''}`, rows: 25, required: true, ...props })] })] }) }));
};
//# sourceMappingURL=JsonField.js.map
{
"name": "@iwsio/react-blog-examples",
"version": "3.2.0",
"version": "4.0.0",
"description": "Example React components for blog posts.",

@@ -37,19 +37,21 @@ "exports": {

"devDependencies": {
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.2",
"jsdom": "^24.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"rimraf": "^5.0.7",
"vitest": "^1.6.0"
"@iwsio/forms": "^5.0.2",
"@iwsio/json-csv-core": "^1.2.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",
"@testing-library/user-event": "^14.6.1",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"jsdom": "^26.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"rimraf": "^6.0.1",
"vitest": "^3.0.5"
},
"peerDependencies": {
"react": "^18",
"react-dom": "^18"
},
"dependencies": {
"@iwsio/forms": "^4.3.0",
"@iwsio/json-csv-core": "^1.1.5"
"react": ">= 18 < 20",
"react-dom": ">= 18 < 20",
"@iwsio/forms": ">= 5",
"@iwsio/json-csv-core": ">= 1"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc