shiny-url-input-box 1.3.4 → 1.3.6

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.
@@ -3,7 +3,7 @@ import { useState, useEffect, useCallback } from 'react';
3
3
  import { Box, Paper, Typography, Button, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, IconButton, TextField, Dialog, DialogTitle, DialogContent, DialogActions, Alert, Chip, Snackbar, CircularProgress } from '@mui/material';
4
4
  import AddIcon from '@mui/icons-material/Add';
5
5
  import ContentCopyIcon from '@mui/icons-material/ContentCopy';
6
- import { getDefaultApiBaseUrl } from './shortener';
6
+ import { getDefaultApiBaseUrl } from './shortener.js';
7
7
  export const ShinyUrlApiKeys = ({ apiKey, apiBaseUrl, className = '' }) => {
8
8
  const [loading, setLoading] = useState(true);
9
9
  const [keys, setKeys] = useState([]);
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState, useEffect } from 'react';
3
3
  import { Grid, Paper, Typography, Box, Card, CardContent, CircularProgress } from '@mui/material';
4
4
  import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer, } from 'recharts';
5
- import { getDefaultApiBaseUrl } from './shortener';
5
+ import { getDefaultApiBaseUrl } from './shortener.js';
6
6
  export const ShinyUrlDashboard = ({ apiKey, apiBaseUrl, className = '', title = 'Analytics Dashboard' }) => {
7
7
  const [loading, setLoading] = useState(true);
8
8
  const [error, setError] = useState(null);
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { useState, useEffect } from 'react';
3
3
  import { Dialog, DialogTitle, DialogContent, DialogActions, Button, Box, Typography, Tabs, Tab, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Chip, Grid, Card, CardContent, CircularProgress } from '@mui/material';
4
4
  import { LineChart, Line, BarChart, Bar, PieChart, Pie, Cell, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer, } from 'recharts';
5
- import { getDefaultApiBaseUrl } from './shortener';
5
+ import { getDefaultApiBaseUrl } from './shortener.js';
6
6
  function TabPanel(props) {
7
7
  const { children, value, index, ...other } = props;
8
8
  return (_jsx("div", { role: "tabpanel", hidden: value !== index, id: `url-tabpanel-${index}`, "aria-labelledby": `url-tab-${index}`, ...other, children: value === index && _jsx(Box, { sx: { p: 3 }, children: children }) }));
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useState, useMemo, useEffect } from 'react';
4
4
  import './TinyUrlInput.css';
5
- import { shortenUrl, getDefaultApiBaseUrl, sanitizeInput, isValidUrl } from './shortener';
5
+ import { shortenUrl, getDefaultApiBaseUrl, sanitizeInput, isValidUrl } from './shortener.js';
6
6
  const ShinyUrlInput = ({ apiKey, apiBaseUrl, onSuccess, onError, label = 'Enter URL to shorten', buttonText = 'Shorten URL', className = '', installationPageUrl }) => {
7
7
  const [url, setUrl] = useState('');
8
8
  const [loading, setLoading] = useState(false);
@@ -3,8 +3,8 @@ import { useState, useEffect, useCallback } from 'react';
3
3
  import { Box, Typography, TextField, Paper } from '@mui/material';
4
4
  import { DataGrid, GridActionsCellItem, GridToolbar } from '@mui/x-data-grid';
5
5
  import DeleteIcon from '@mui/icons-material/Delete';
6
- import { ShinyUrlDetailsModal } from './ShinyUrlDetailsModal';
7
- import { getDefaultApiBaseUrl } from './shortener';
6
+ import { ShinyUrlDetailsModal } from './ShinyUrlDetailsModal.js';
7
+ import { getDefaultApiBaseUrl } from './shortener.js';
8
8
  export const ShinyUrlUrls = ({ apiKey, apiBaseUrl, className = '' }) => {
9
9
  const [page, setPage] = useState(0);
10
10
  const [pageSize, setPageSize] = useState(10);
@@ -0,0 +1,127 @@
1
+ .tiny-url-input-wrapper {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 1rem;
5
+ max-width: 600px;
6
+ margin: 0 auto;
7
+ }
8
+
9
+ .tiny-url-form {
10
+ display: flex;
11
+ flex-direction: column;
12
+ gap: 0.75rem;
13
+ }
14
+
15
+ .tiny-url-label {
16
+ font-size: 1rem;
17
+ font-weight: 500;
18
+ color: #333;
19
+ }
20
+
21
+ .tiny-url-input-group {
22
+ display: flex;
23
+ gap: 0.5rem;
24
+ flex-wrap: wrap;
25
+ }
26
+
27
+ .tiny-url-input {
28
+ flex: 1;
29
+ min-width: 200px;
30
+ padding: 0.75rem 1rem;
31
+ font-size: 1rem;
32
+ border: 2px solid #ddd;
33
+ border-radius: 6px;
34
+ outline: none;
35
+ transition: border-color 0.2s;
36
+ }
37
+
38
+ .tiny-url-input:focus {
39
+ border-color: #4a90e2;
40
+ }
41
+
42
+ .tiny-url-input:disabled {
43
+ background-color: #f5f5f5;
44
+ cursor: not-allowed;
45
+ }
46
+
47
+ .tiny-url-button {
48
+ padding: 0.75rem 1.5rem;
49
+ font-size: 1rem;
50
+ font-weight: 500;
51
+ color: white;
52
+ background-color: #4a90e2;
53
+ border: none;
54
+ border-radius: 6px;
55
+ cursor: pointer;
56
+ transition: background-color 0.2s;
57
+ white-space: nowrap;
58
+ }
59
+
60
+ .tiny-url-button:hover:not(:disabled) {
61
+ background-color: #357abd;
62
+ }
63
+
64
+ .tiny-url-button:disabled {
65
+ background-color: #ccc;
66
+ cursor: not-allowed;
67
+ }
68
+
69
+ .tiny-url-error {
70
+ padding: 0.75rem 1rem;
71
+ background-color: #fee;
72
+ color: #c33;
73
+ border: 1px solid #fcc;
74
+ border-radius: 6px;
75
+ font-size: 0.9rem;
76
+ }
77
+
78
+ .tiny-url-result {
79
+ padding: 1rem;
80
+ background-color: #f0f8ff;
81
+ border: 1px solid #b0d4f1;
82
+ border-radius: 6px;
83
+ }
84
+
85
+ .tiny-url-result-label {
86
+ font-size: 0.9rem;
87
+ font-weight: 500;
88
+ color: #555;
89
+ margin-bottom: 0.5rem;
90
+ }
91
+
92
+ .tiny-url-result-content {
93
+ display: flex;
94
+ gap: 0.5rem;
95
+ align-items: center;
96
+ flex-wrap: wrap;
97
+ }
98
+
99
+ .tiny-url-link {
100
+ flex: 1;
101
+ min-width: 200px;
102
+ color: #4a90e2;
103
+ text-decoration: none;
104
+ word-break: break-all;
105
+ font-size: 0.95rem;
106
+ }
107
+
108
+ .tiny-url-link:hover {
109
+ text-decoration: underline;
110
+ }
111
+
112
+ .tiny-url-copy-button {
113
+ padding: 0.5rem 1rem;
114
+ font-size: 0.9rem;
115
+ color: white;
116
+ background-color: #28a745;
117
+ border: none;
118
+ border-radius: 4px;
119
+ cursor: pointer;
120
+ transition: background-color 0.2s;
121
+ white-space: nowrap;
122
+ }
123
+
124
+ .tiny-url-copy-button:hover {
125
+ background-color: #218838;
126
+ }
127
+
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- export { default as ShinyUrlInput } from './ShinyUrlInput';
2
- export type { ShinyUrlInputProps } from './ShinyUrlInput';
3
- export * from './shortener';
4
- export { ShinyUrlDashboard } from './ShinyUrlDashboard';
5
- export type { ShinyUrlDashboardProps } from './ShinyUrlDashboard';
6
- export { ShinyUrlApiKeys } from './ShinyUrlApiKeys';
7
- export type { ShinyUrlApiKeysProps } from './ShinyUrlApiKeys';
8
- export { ShinyUrlUrls } from './ShinyUrlUrls';
9
- export type { ShinyUrlUrlsProps } from './ShinyUrlUrls';
10
- export { ShinyUrlDetailsModal } from './ShinyUrlDetailsModal';
11
- export type { ShinyUrlDetailsModalProps } from './ShinyUrlDetailsModal';
1
+ export { default as ShinyUrlInput } from './ShinyUrlInput.js';
2
+ export type { ShinyUrlInputProps } from './ShinyUrlInput.js';
3
+ export * from './shortener.js';
4
+ export { ShinyUrlDashboard } from './ShinyUrlDashboard.js';
5
+ export type { ShinyUrlDashboardProps } from './ShinyUrlDashboard.js';
6
+ export { ShinyUrlApiKeys } from './ShinyUrlApiKeys.js';
7
+ export type { ShinyUrlApiKeysProps } from './ShinyUrlApiKeys.js';
8
+ export { ShinyUrlUrls } from './ShinyUrlUrls.js';
9
+ export type { ShinyUrlUrlsProps } from './ShinyUrlUrls.js';
10
+ export { ShinyUrlDetailsModal } from './ShinyUrlDetailsModal.js';
11
+ export type { ShinyUrlDetailsModalProps } from './ShinyUrlDetailsModal.js';
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC9D,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export { default as ShinyUrlInput } from './ShinyUrlInput';
2
- export * from './shortener';
3
- export { ShinyUrlDashboard } from './ShinyUrlDashboard';
4
- export { ShinyUrlApiKeys } from './ShinyUrlApiKeys';
5
- export { ShinyUrlUrls } from './ShinyUrlUrls';
6
- export { ShinyUrlDetailsModal } from './ShinyUrlDetailsModal';
1
+ export { default as ShinyUrlInput } from './ShinyUrlInput.js';
2
+ export * from './shortener.js';
3
+ export { ShinyUrlDashboard } from './ShinyUrlDashboard.js';
4
+ export { ShinyUrlApiKeys } from './ShinyUrlApiKeys.js';
5
+ export { ShinyUrlUrls } from './ShinyUrlUrls.js';
6
+ export { ShinyUrlDetailsModal } from './ShinyUrlDetailsModal.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shiny-url-input-box",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "type": "module",
5
5
  "description": "A reusable React component for generating ShinyURLs",
6
6
  "main": "dist/index.js",
@@ -13,7 +13,7 @@
13
13
  }
14
14
  },
15
15
  "scripts": {
16
- "build": "tsc",
16
+ "build": "tsc && node scripts/copy-assets.cjs",
17
17
  "test": "echo \"Error: no test specified\" && exit 1"
18
18
  },
19
19
  "keywords": [
@@ -0,0 +1,12 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ const src = path.join(__dirname, '../src/TinyUrlInput.css');
5
+ const dest = path.join(__dirname, '../dist/TinyUrlInput.css');
6
+
7
+ if (!fs.existsSync(path.join(__dirname, '../dist'))) {
8
+ fs.mkdirSync(path.join(__dirname, '../dist'));
9
+ }
10
+
11
+ fs.copyFileSync(src, dest);
12
+ console.log('Copied TinyUrlInput.css to dist/');
@@ -23,7 +23,7 @@ import {
23
23
  } from '@mui/material';
24
24
  import AddIcon from '@mui/icons-material/Add';
25
25
  import ContentCopyIcon from '@mui/icons-material/ContentCopy';
26
- import { getDefaultApiBaseUrl } from './shortener';
26
+ import { getDefaultApiBaseUrl } from './shortener.js';
27
27
 
28
28
  export interface ShinyUrlApiKeysProps {
29
29
  apiKey: string; // The user's/admin's token to authenticate
@@ -18,7 +18,7 @@ import {
18
18
  Legend,
19
19
  ResponsiveContainer,
20
20
  } from 'recharts';
21
- import { getDefaultApiBaseUrl } from './shortener';
21
+ import { getDefaultApiBaseUrl } from './shortener.js';
22
22
 
23
23
  export interface ShinyUrlDashboardProps {
24
24
  apiKey: string;
@@ -37,7 +37,7 @@ import {
37
37
  Legend,
38
38
  ResponsiveContainer,
39
39
  } from 'recharts';
40
- import { getDefaultApiBaseUrl } from './shortener';
40
+ import { getDefaultApiBaseUrl } from './shortener.js';
41
41
 
42
42
  export interface ShinyUrlDetailsModalProps {
43
43
  open: boolean;
@@ -2,7 +2,7 @@
2
2
 
3
3
  import React, { useState, useMemo, useEffect } from 'react';
4
4
  import './TinyUrlInput.css';
5
- import { shortenUrl, ShortenResponse, getDefaultApiBaseUrl, sanitizeInput, isValidUrl } from './shortener';
5
+ import { shortenUrl, ShortenResponse, getDefaultApiBaseUrl, sanitizeInput, isValidUrl } from './shortener.js';
6
6
 
7
7
  export interface ShinyUrlInputProps {
8
8
  apiKey: string;
@@ -15,8 +15,8 @@ import {
15
15
  GridPaginationModel
16
16
  } from '@mui/x-data-grid';
17
17
  import DeleteIcon from '@mui/icons-material/Delete';
18
- import { ShinyUrlDetailsModal } from './ShinyUrlDetailsModal';
19
- import { getDefaultApiBaseUrl } from './shortener';
18
+ import { ShinyUrlDetailsModal } from './ShinyUrlDetailsModal.js';
19
+ import { getDefaultApiBaseUrl } from './shortener.js';
20
20
 
21
21
  export interface ShinyUrlUrlsProps {
22
22
  apiKey: string;
package/src/index.ts CHANGED
@@ -1,12 +1,12 @@
1
- export { default as ShinyUrlInput } from './ShinyUrlInput';
2
- export type { ShinyUrlInputProps } from './ShinyUrlInput';
3
- export * from './shortener';
4
- export { ShinyUrlDashboard } from './ShinyUrlDashboard';
5
- export type { ShinyUrlDashboardProps } from './ShinyUrlDashboard';
6
- export { ShinyUrlApiKeys } from './ShinyUrlApiKeys';
7
- export type { ShinyUrlApiKeysProps } from './ShinyUrlApiKeys';
8
- export { ShinyUrlUrls } from './ShinyUrlUrls';
9
- export type { ShinyUrlUrlsProps } from './ShinyUrlUrls';
10
- export { ShinyUrlDetailsModal } from './ShinyUrlDetailsModal';
11
- export type { ShinyUrlDetailsModalProps } from './ShinyUrlDetailsModal';
1
+ export { default as ShinyUrlInput } from './ShinyUrlInput.js';
2
+ export type { ShinyUrlInputProps } from './ShinyUrlInput.js';
3
+ export * from './shortener.js';
4
+ export { ShinyUrlDashboard } from './ShinyUrlDashboard.js';
5
+ export type { ShinyUrlDashboardProps } from './ShinyUrlDashboard.js';
6
+ export { ShinyUrlApiKeys } from './ShinyUrlApiKeys.js';
7
+ export type { ShinyUrlApiKeysProps } from './ShinyUrlApiKeys.js';
8
+ export { ShinyUrlUrls } from './ShinyUrlUrls.js';
9
+ export type { ShinyUrlUrlsProps } from './ShinyUrlUrls.js';
10
+ export { ShinyUrlDetailsModal } from './ShinyUrlDetailsModal.js';
11
+ export type { ShinyUrlDetailsModalProps } from './ShinyUrlDetailsModal.js';
12
12