ywana-core8 0.1.98 → 0.1.101
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.
- package/doc/src/index.js +2 -1
- package/package.json +19 -25
- package/publish.sh +5 -288
- package/src/html/accordion.example.js +74 -0
- package/src/html/property.js +5 -5
- package/src/incubator/pdfViewer.js +33 -0
- package/README-PUBLISH.md +0 -166
- package/dist/index.css +0 -16646
- package/dist/index.js +0 -42641
- package/dist/index.js.map +0 -1
- package/dist/index.modern.js +0 -42641
- package/dist/index.modern.js.map +0 -1
- package/dist/index.umd.js +0 -42644
- package/dist/index.umd.js.map +0 -1
- package/doc/src/ywana-core8.css +0 -16646
- package/src/setupTests.js +0 -38
- package/test-publish.sh +0 -159
- package/vite.config.js +0 -86
- package/vitest.config.js +0 -42
package/doc/src/index.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ywana-core8",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.101",
|
4
4
|
"description": "ywana-core8",
|
5
5
|
"homepage": "https://ywana.github.io/workspace",
|
6
6
|
"author": "Ernesto Roldan Garcia",
|
@@ -12,63 +12,57 @@
|
|
12
12
|
"previewjs": {
|
13
13
|
"framework": "react",
|
14
14
|
"react": {
|
15
|
-
"version":
|
15
|
+
"version": 17
|
16
16
|
}
|
17
17
|
},
|
18
18
|
"scripts": {
|
19
|
-
"build": "
|
20
|
-
"dev": "
|
19
|
+
"build": "microbundle --no-compress --jsx React.createElement",
|
20
|
+
"dev": "microbundle watch --no-compress --jsx React.createElement",
|
21
21
|
"test": "jest",
|
22
|
-
"test:vitest": "vitest run",
|
23
|
-
"test:watch": "vitest",
|
24
|
-
"test:ui": "vitest --ui",
|
25
22
|
"deploy-docs": "gh-pages -d doc/build"
|
26
23
|
},
|
27
24
|
"bugs": {
|
28
25
|
"url": "https://github.com/ywana/ywana-core8/issues"
|
29
26
|
},
|
30
27
|
"resolutions": {
|
31
|
-
"react-error-overlay": "6.0.9"
|
32
|
-
"nth-check": "^2.1.1",
|
33
|
-
"postcss": "^8.4.31",
|
34
|
-
"svgo": "^3.0.0",
|
35
|
-
"webpack-dev-server": "^4.15.1"
|
28
|
+
"react-error-overlay": "6.0.9"
|
36
29
|
},
|
37
30
|
"peerDependencies": {
|
38
|
-
"react": "
|
39
|
-
"react-dom": "
|
31
|
+
"react": "17.x",
|
32
|
+
"react-dom": "17.x"
|
40
33
|
},
|
41
34
|
"devDependencies": {
|
42
35
|
"@babel/preset-env": "^7.28.0",
|
43
36
|
"@babel/preset-react": "^7.27.1",
|
44
|
-
"@testing-library/jest-dom": "^6.
|
45
|
-
"@testing-library/react": "^
|
37
|
+
"@testing-library/jest-dom": "^6.6.4",
|
38
|
+
"@testing-library/react": "^12.1.5",
|
46
39
|
"@testing-library/user-event": "^14.6.1",
|
47
|
-
"@vitejs/plugin-react": "^5.0.2",
|
48
|
-
"@vitest/ui": "^3.2.4",
|
49
40
|
"babel-jest": "^30.0.5",
|
50
|
-
"gh-pages": "^
|
41
|
+
"gh-pages": "^3.2.3",
|
51
42
|
"identity-obj-proxy": "^3.0.0",
|
52
43
|
"jest": "^29.7.0",
|
53
44
|
"jsdom": "^26.1.0",
|
54
|
-
"
|
55
|
-
"react
|
56
|
-
"
|
57
|
-
"
|
45
|
+
"microbundle": "^0.14.2",
|
46
|
+
"react": "^17.0.2",
|
47
|
+
"react-dom": "^17.0.2",
|
48
|
+
"react-scripts": "^5.0.1"
|
58
49
|
},
|
59
50
|
"dependencies": {
|
60
51
|
"axios": "^1.3.4",
|
61
52
|
"crypto-js": "^4.1.1",
|
62
53
|
"deep-equal": "^2.0.5",
|
54
|
+
"framer-motion": "^5.3.1",
|
63
55
|
"material-design-icons-iconfont": "^6.7.0",
|
64
56
|
"moment": "^2.29.1",
|
65
57
|
"moment-range": "^4.0.2",
|
66
58
|
"react-datepicker": "^4.6.0",
|
67
59
|
"react-error-overlay": "^6.0.10",
|
68
60
|
"react-image-pan-zoom-rotate": "^1.6.0",
|
69
|
-
"react-notifications-component": "^4.
|
61
|
+
"react-notifications-component": "^3.4.1",
|
62
|
+
"react-pdf": "^7.0.3",
|
70
63
|
"react-switch": "^6.0.0",
|
71
|
-
"react-syntax-highlighter": "^15.6.
|
64
|
+
"react-syntax-highlighter": "^15.6.1",
|
65
|
+
"react-tooltip": "^4.2.21",
|
72
66
|
"resumablejs": "^1.1.0"
|
73
67
|
}
|
74
68
|
}
|
package/publish.sh
CHANGED
@@ -1,289 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
# 🚀 Ywana Core8 - Script de Publicación Automatizada
|
4
|
-
# ================================================
|
5
|
-
|
6
|
-
set -e # Salir si cualquier comando falla
|
7
|
-
|
8
|
-
# Colores para output
|
9
|
-
RED='\033[0;31m'
|
10
|
-
GREEN='\033[0;32m'
|
11
|
-
YELLOW='\033[1;33m'
|
12
|
-
BLUE='\033[0;34m'
|
13
|
-
PURPLE='\033[0;35m'
|
14
|
-
CYAN='\033[0;36m'
|
15
|
-
NC='\033[0m' # No Color
|
16
|
-
|
17
|
-
# Función para mostrar barras de progreso
|
18
|
-
show_progress() {
|
19
|
-
local duration=$1
|
20
|
-
local message=$2
|
21
|
-
local progress=0
|
22
|
-
local bar_length=50
|
23
|
-
|
24
|
-
echo -e "${CYAN}${message}${NC}"
|
25
|
-
|
26
|
-
while [ $progress -le $duration ]; do
|
27
|
-
local filled=$((progress * bar_length / duration))
|
28
|
-
local empty=$((bar_length - filled))
|
29
|
-
|
30
|
-
printf "\r${GREEN}["
|
31
|
-
printf "%*s" $filled | tr ' ' '='
|
32
|
-
printf "%*s" $empty | tr ' ' '-'
|
33
|
-
printf "]${NC} %d%%" $((progress * 100 / duration))
|
34
|
-
|
35
|
-
sleep 0.1
|
36
|
-
progress=$((progress + 1))
|
37
|
-
done
|
38
|
-
echo ""
|
39
|
-
}
|
40
|
-
|
41
|
-
# Función para mostrar spinner
|
42
|
-
show_spinner() {
|
43
|
-
local pid=$1
|
44
|
-
local message=$2
|
45
|
-
local spin='⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏'
|
46
|
-
local i=0
|
47
|
-
|
48
|
-
echo -e "${CYAN}${message}${NC}"
|
49
|
-
while kill -0 $pid 2>/dev/null; do
|
50
|
-
i=$(( (i+1) %10 ))
|
51
|
-
printf "\r${YELLOW}${spin:$i:1}${NC} Procesando..."
|
52
|
-
sleep 0.1
|
53
|
-
done
|
54
|
-
printf "\r${GREEN}✓${NC} Completado\n"
|
55
|
-
}
|
56
|
-
|
57
|
-
# Función para log con timestamp
|
58
|
-
log() {
|
59
|
-
local level=$1
|
60
|
-
local message=$2
|
61
|
-
local timestamp=$(date '+%H:%M:%S')
|
62
|
-
|
63
|
-
case $level in
|
64
|
-
"INFO") echo -e "${BLUE}[${timestamp}]${NC} ${message}" ;;
|
65
|
-
"SUCCESS") echo -e "${GREEN}[${timestamp}] ✓${NC} ${message}" ;;
|
66
|
-
"WARNING") echo -e "${YELLOW}[${timestamp}] ⚠${NC} ${message}" ;;
|
67
|
-
"ERROR") echo -e "${RED}[${timestamp}] ✗${NC} ${message}" ;;
|
68
|
-
esac
|
69
|
-
}
|
70
|
-
|
71
|
-
# Banner inicial
|
72
|
-
echo -e "${PURPLE}"
|
73
|
-
echo "╔══════════════════════════════════════════════════════════════╗"
|
74
|
-
echo "║ 🚀 YWANA CORE8 PUBLISHER ║"
|
75
|
-
echo "║ Automated Release Pipeline ║"
|
76
|
-
echo "╚══════════════════════════════════════════════════════════════╝"
|
77
|
-
echo -e "${NC}"
|
78
|
-
|
79
|
-
# Obtener mensaje de commit del usuario
|
80
|
-
if [ -z "$1" ]; then
|
81
|
-
echo -e "${YELLOW}💬 Ingresa el mensaje de commit:${NC}"
|
82
|
-
read -r COMMIT_MESSAGE
|
83
|
-
if [ -z "$COMMIT_MESSAGE" ]; then
|
84
|
-
log "ERROR" "Mensaje de commit requerido"
|
85
|
-
exit 1
|
86
|
-
fi
|
87
|
-
else
|
88
|
-
COMMIT_MESSAGE="$1"
|
89
|
-
fi
|
90
|
-
|
91
|
-
log "INFO" "Mensaje de commit: ${COMMIT_MESSAGE}"
|
92
|
-
|
93
|
-
echo ""
|
94
|
-
log "INFO" "Iniciando pipeline de publicación..."
|
95
|
-
|
96
|
-
# ============================================================================
|
97
|
-
# PASO 1: Verificaciones Previas
|
98
|
-
# ============================================================================
|
99
|
-
echo -e "\n${PURPLE}📋 PASO 1: Verificaciones Previas${NC}"
|
100
|
-
|
101
|
-
# Verificar que estamos en la rama correcta
|
102
|
-
CURRENT_BRANCH=$(git branch --show-current)
|
103
|
-
log "INFO" "Rama actual: ${CURRENT_BRANCH}"
|
104
|
-
|
105
|
-
if [ "$CURRENT_BRANCH" != "main" ] && [ "$CURRENT_BRANCH" != "master" ]; then
|
106
|
-
log "WARNING" "No estás en la rama principal. ¿Continuar? (y/N)"
|
107
|
-
read -r CONTINUE
|
108
|
-
if [ "$CONTINUE" != "y" ] && [ "$CONTINUE" != "Y" ]; then
|
109
|
-
log "INFO" "Publicación cancelada"
|
110
|
-
exit 0
|
111
|
-
fi
|
112
|
-
fi
|
113
|
-
|
114
|
-
# Verificar que no hay cambios sin commitear
|
115
|
-
if ! git diff-index --quiet HEAD --; then
|
116
|
-
log "INFO" "Hay cambios sin commitear. Se añadirán al commit."
|
117
|
-
else
|
118
|
-
log "SUCCESS" "Working directory limpio"
|
119
|
-
fi
|
120
|
-
|
121
|
-
# Verificar conexión a internet
|
122
|
-
if ! ping -c 1 google.com &> /dev/null; then
|
123
|
-
log "ERROR" "Sin conexión a internet"
|
124
|
-
exit 1
|
125
|
-
fi
|
126
|
-
|
127
|
-
log "SUCCESS" "Verificaciones previas completadas"
|
128
|
-
|
129
|
-
# ============================================================================
|
130
|
-
# PASO 2: Tests Omitidos (Opcional)
|
131
|
-
# ============================================================================
|
132
|
-
echo -e "\n${PURPLE}🧪 PASO 2: Tests (Omitido)${NC}"
|
133
|
-
|
134
|
-
log "WARNING" "Tests omitidos para esta publicación"
|
135
|
-
log "INFO" "Puedes ejecutar 'npm test' manualmente si lo deseas"
|
136
|
-
|
137
|
-
# ============================================================================
|
138
|
-
# PASO 3: Build del Proyecto
|
139
|
-
# ============================================================================
|
140
|
-
echo -e "\n${PURPLE}🔨 PASO 3: Building Proyecto${NC}"
|
141
|
-
|
142
|
-
log "INFO" "Limpiando build anterior..."
|
143
|
-
rm -rf dist/
|
144
|
-
log "SUCCESS" "Build anterior eliminado"
|
145
|
-
|
146
|
-
log "INFO" "Iniciando build con Vite..."
|
147
|
-
BUILD_START=$(date +%s)
|
148
|
-
|
149
|
-
if npm run build > /tmp/build_output.log 2>&1 & then
|
150
|
-
BUILD_PID=$!
|
151
|
-
show_spinner $BUILD_PID "Compilando con Vite"
|
152
|
-
wait $BUILD_PID
|
153
|
-
BUILD_EXIT_CODE=$?
|
154
|
-
|
155
|
-
BUILD_END=$(date +%s)
|
156
|
-
BUILD_TIME=$((BUILD_END - BUILD_START))
|
157
|
-
|
158
|
-
if [ $BUILD_EXIT_CODE -eq 0 ]; then
|
159
|
-
log "SUCCESS" "Build completado en ${BUILD_TIME}s"
|
160
|
-
|
161
|
-
# Mostrar tamaños de archivos
|
162
|
-
echo -e "${CYAN}📦 Archivos generados:${NC}"
|
163
|
-
ls -lah dist/ | grep -E '\.(js|css)$' | awk '{print " " $9 " (" $5 ")"}'
|
164
|
-
else
|
165
|
-
log "ERROR" "Build falló. Ver /tmp/build_output.log para detalles"
|
166
|
-
echo -e "${RED}Últimas líneas del log:${NC}"
|
167
|
-
tail -10 /tmp/build_output.log
|
168
|
-
exit 1
|
169
|
-
fi
|
170
|
-
else
|
171
|
-
log "ERROR" "No se pudo iniciar el build"
|
172
|
-
exit 1
|
173
|
-
fi
|
174
|
-
|
175
|
-
# ============================================================================
|
176
|
-
# PASO 4: Incrementar Versión
|
177
|
-
# ============================================================================
|
178
|
-
echo -e "\n${PURPLE}📈 PASO 4: Incrementando Versión${NC}"
|
179
|
-
|
180
|
-
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
181
|
-
log "INFO" "Versión actual: v${CURRENT_VERSION}"
|
182
|
-
|
183
|
-
# Incrementar versión patch
|
184
|
-
npm version patch --no-git-tag-version > /dev/null
|
185
|
-
NEW_VERSION=$(node -p "require('./package.json').version")
|
186
|
-
log "SUCCESS" "Nueva versión: v${NEW_VERSION}"
|
187
|
-
|
188
|
-
# ============================================================================
|
189
|
-
# PASO 5: Git Commit y Push
|
190
|
-
# ============================================================================
|
191
|
-
echo -e "\n${PURPLE}📤 PASO 5: Git Commit y Push${NC}"
|
192
|
-
|
193
|
-
log "INFO" "Añadiendo archivos al staging..."
|
1
|
+
npm run build
|
194
2
|
git add --all
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
git commit -m "$FULL_COMMIT_MESSAGE"
|
200
|
-
log "SUCCESS" "Commit creado"
|
201
|
-
|
202
|
-
log "INFO" "Creando tag de versión..."
|
203
|
-
git tag "v${NEW_VERSION}"
|
204
|
-
log "SUCCESS" "Tag v${NEW_VERSION} creado"
|
205
|
-
|
206
|
-
log "INFO" "Pushing a GitHub..."
|
207
|
-
if git push origin "$CURRENT_BRANCH" --tags > /tmp/push_output.log 2>&1 & then
|
208
|
-
PUSH_PID=$!
|
209
|
-
show_spinner $PUSH_PID "Subiendo cambios a GitHub"
|
210
|
-
wait $PUSH_PID
|
211
|
-
PUSH_EXIT_CODE=$?
|
212
|
-
|
213
|
-
if [ $PUSH_EXIT_CODE -eq 0 ]; then
|
214
|
-
log "SUCCESS" "Push completado exitosamente"
|
215
|
-
else
|
216
|
-
log "ERROR" "Push falló. Ver /tmp/push_output.log para detalles"
|
217
|
-
exit 1
|
218
|
-
fi
|
219
|
-
else
|
220
|
-
log "ERROR" "No se pudo iniciar el push"
|
221
|
-
exit 1
|
222
|
-
fi
|
223
|
-
|
224
|
-
# ============================================================================
|
225
|
-
# PASO 6: Publicar a NPM
|
226
|
-
# ============================================================================
|
227
|
-
echo -e "\n${PURPLE}📦 PASO 6: Publicando a NPM${NC}"
|
228
|
-
|
229
|
-
# Verificar que estamos logueados en NPM
|
230
|
-
if ! npm whoami > /dev/null 2>&1; then
|
231
|
-
log "ERROR" "No estás logueado en NPM. Ejecuta 'npm login' primero"
|
232
|
-
exit 1
|
233
|
-
fi
|
234
|
-
|
235
|
-
NPM_USER=$(npm whoami)
|
236
|
-
log "INFO" "Usuario NPM: ${NPM_USER}"
|
237
|
-
|
238
|
-
log "INFO" "Publicando v${NEW_VERSION} a NPM..."
|
239
|
-
if npm publish > /tmp/publish_output.log 2>&1 & then
|
240
|
-
PUBLISH_PID=$!
|
241
|
-
show_spinner $PUBLISH_PID "Publicando a NPM Registry"
|
242
|
-
wait $PUBLISH_PID
|
243
|
-
PUBLISH_EXIT_CODE=$?
|
244
|
-
|
245
|
-
if [ $PUBLISH_EXIT_CODE -eq 0 ]; then
|
246
|
-
log "SUCCESS" "Paquete publicado exitosamente"
|
247
|
-
else
|
248
|
-
log "ERROR" "Publicación falló. Ver /tmp/publish_output.log para detalles"
|
249
|
-
echo -e "${RED}Últimas líneas del log:${NC}"
|
250
|
-
tail -10 /tmp/publish_output.log
|
251
|
-
exit 1
|
252
|
-
fi
|
253
|
-
else
|
254
|
-
log "ERROR" "No se pudo iniciar la publicación"
|
255
|
-
exit 1
|
256
|
-
fi
|
257
|
-
|
258
|
-
# ============================================================================
|
259
|
-
# RESUMEN FINAL
|
260
|
-
# ============================================================================
|
261
|
-
echo -e "\n${GREEN}"
|
262
|
-
echo "╔══════════════════════════════════════════════════════════════╗"
|
263
|
-
echo "║ 🎉 PUBLICACIÓN EXITOSA ║"
|
264
|
-
echo "╚══════════════════════════════════════════════════════════════╝"
|
265
|
-
echo -e "${NC}"
|
266
|
-
|
267
|
-
TOTAL_END=$(date +%s)
|
268
|
-
TOTAL_TIME=$((TOTAL_END - $(date +%s -d "1 minute ago")))
|
269
|
-
|
270
|
-
echo -e "${CYAN}📊 Resumen de la publicación:${NC}"
|
271
|
-
echo -e " ${GREEN}✓${NC} Versión: v${CURRENT_VERSION} → v${NEW_VERSION}"
|
272
|
-
echo -e " ${GREEN}✓${NC} Commit: ${FULL_COMMIT_MESSAGE}"
|
273
|
-
echo -e " ${GREEN}✓${NC} Rama: ${CURRENT_BRANCH}"
|
274
|
-
echo -e " ${GREEN}✓${NC} Usuario NPM: ${NPM_USER}"
|
275
|
-
echo -e " ${GREEN}✓${NC} Build time: ${BUILD_TIME}s"
|
276
|
-
|
277
|
-
echo -e "\n${CYAN}🔗 Enlaces útiles:${NC}"
|
278
|
-
echo -e " 📦 NPM: https://www.npmjs.com/package/ywana-core8"
|
279
|
-
echo -e " 🐙 GitHub: https://github.com/ywana/ywana-core8"
|
280
|
-
echo -e " 📋 Tag: https://github.com/ywana/ywana-core8/releases/tag/v${NEW_VERSION}"
|
281
|
-
|
282
|
-
echo -e "\n${CYAN}📥 Para instalar la nueva versión:${NC}"
|
283
|
-
echo -e " ${YELLOW}npm install ywana-core8@${NEW_VERSION}${NC}"
|
284
|
-
|
285
|
-
# Limpiar archivos temporales
|
286
|
-
rm -f /tmp/test_output.log /tmp/build_output.log /tmp/push_output.log /tmp/publish_output.log
|
287
|
-
|
288
|
-
echo -e "\n${GREEN}🚀 ¡Publicación completada exitosamente!${NC}"
|
289
|
-
echo -e "${PURPLE}Gracias por usar Ywana Core8 Publisher${NC}\n"
|
3
|
+
git commit -m $0
|
4
|
+
git push
|
5
|
+
npm version patch
|
6
|
+
npm publish
|
@@ -176,43 +176,117 @@ export const AccordionExamples = () => {
|
|
176
176
|
const sections =
|
177
177
|
|
178
178
|
[
|
179
|
+
|
180
|
+
|
179
181
|
{
|
182
|
+
|
183
|
+
|
180
184
|
"id": "overview",
|
185
|
+
|
186
|
+
|
181
187
|
"title": "Introducción",
|
188
|
+
|
189
|
+
|
182
190
|
"icon": "info"
|
191
|
+
|
192
|
+
|
183
193
|
},
|
194
|
+
|
195
|
+
|
184
196
|
{
|
197
|
+
|
198
|
+
|
185
199
|
"id": "basic-examples",
|
200
|
+
|
201
|
+
|
186
202
|
"title": "Ejemplos Básicos",
|
203
|
+
|
204
|
+
|
187
205
|
"icon": "widgets"
|
206
|
+
|
207
|
+
|
188
208
|
},
|
209
|
+
|
210
|
+
|
189
211
|
{
|
212
|
+
|
213
|
+
|
190
214
|
"id": "advanced-features",
|
215
|
+
|
216
|
+
|
191
217
|
"title": "Características Avanzadas",
|
218
|
+
|
219
|
+
|
192
220
|
"icon": "settings"
|
221
|
+
|
222
|
+
|
193
223
|
},
|
224
|
+
|
225
|
+
|
194
226
|
{
|
227
|
+
|
228
|
+
|
195
229
|
"id": "variants",
|
230
|
+
|
231
|
+
|
196
232
|
"title": "Variantes y Temas",
|
233
|
+
|
234
|
+
|
197
235
|
"icon": "palette"
|
236
|
+
|
237
|
+
|
198
238
|
},
|
239
|
+
|
240
|
+
|
199
241
|
{
|
242
|
+
|
243
|
+
|
200
244
|
"id": "states",
|
245
|
+
|
246
|
+
|
201
247
|
"title": "Estados",
|
248
|
+
|
249
|
+
|
202
250
|
"icon": "toggle_on"
|
251
|
+
|
252
|
+
|
203
253
|
},
|
254
|
+
|
255
|
+
|
204
256
|
{
|
257
|
+
|
258
|
+
|
205
259
|
"id": "sizes",
|
260
|
+
|
261
|
+
|
206
262
|
"title": "Tamaños",
|
263
|
+
|
264
|
+
|
207
265
|
"icon": "format_size"
|
266
|
+
|
267
|
+
|
208
268
|
},
|
269
|
+
|
270
|
+
|
209
271
|
{
|
272
|
+
|
273
|
+
|
210
274
|
"id": "api-reference",
|
275
|
+
|
276
|
+
|
211
277
|
"title": "Referencia API",
|
278
|
+
|
279
|
+
|
212
280
|
"icon": "code"
|
281
|
+
|
282
|
+
|
213
283
|
}
|
284
|
+
|
285
|
+
|
214
286
|
]
|
215
287
|
|
288
|
+
|
289
|
+
|
216
290
|
return (
|
217
291
|
<ExampleLayout title="Accordion Examples" sections={sections}>
|
218
292
|
<ExampleSection id="overview" title="Ejemplos de Componente Accordion Mejorado" icon="widgets">
|
package/src/html/property.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { useState, useCallback, useRef, useEffect } from 'react'
|
1
|
+
import React, { useState, useCallback, useRef, useEffect, Fragment } from 'react'
|
2
2
|
import PropTypes from 'prop-types'
|
3
3
|
import { Icon } from './icon'
|
4
4
|
import { Text } from './text'
|
@@ -229,7 +229,7 @@ export const Property = (props) => {
|
|
229
229
|
{/* Property value (maintaining original structure) */}
|
230
230
|
<div className="property-value">
|
231
231
|
{editable ? (
|
232
|
-
|
232
|
+
<Fragment>
|
233
233
|
{multiline ? (
|
234
234
|
<textarea
|
235
235
|
ref={inputRef}
|
@@ -282,9 +282,9 @@ export const Property = (props) => {
|
|
282
282
|
aria-label="Clear value"
|
283
283
|
/>
|
284
284
|
)}
|
285
|
-
|
285
|
+
</Fragment>
|
286
286
|
) : (
|
287
|
-
|
287
|
+
<Fragment>
|
288
288
|
{/* Display value */}
|
289
289
|
<span
|
290
290
|
className={`property-value__display ${copyable ? 'property-value__display--copyable' : ''}`}
|
@@ -303,7 +303,7 @@ export const Property = (props) => {
|
|
303
303
|
aria-label="Copy value"
|
304
304
|
/>
|
305
305
|
)}
|
306
|
-
|
306
|
+
</Fragment>
|
307
307
|
)}
|
308
308
|
</div>
|
309
309
|
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import React, {useState} from 'react'
|
2
|
+
import { Document, Page } from 'react-pdf'
|
3
|
+
|
4
|
+
export const PDFViewer = (props) => {
|
5
|
+
|
6
|
+
const { file } = props
|
7
|
+
const [numPages, setNumPages] = useState(null)
|
8
|
+
const [pageNumber, setPageNumber] = useState(1)
|
9
|
+
|
10
|
+
function onDocumentLoadSuccess({ numPages }) {
|
11
|
+
setNumPages(numPages)
|
12
|
+
}
|
13
|
+
|
14
|
+
return (
|
15
|
+
<div className="pdfViewer">
|
16
|
+
<Document file={file} onLoadSuccess={onDocumentLoadSuccess}>
|
17
|
+
<Page pageNumber={pageNumber} />
|
18
|
+
</Document>
|
19
|
+
</div>
|
20
|
+
)
|
21
|
+
}
|
22
|
+
|
23
|
+
export const PDFViewerTest = (props) => {
|
24
|
+
|
25
|
+
const base64 = "xx"
|
26
|
+
|
27
|
+
const file = "https://pro.ywanadigital.com/files/20230602102630601/original/files/Label1_7_ok.pdf"
|
28
|
+
|
29
|
+
return (
|
30
|
+
<PDFViewer file={file} />
|
31
|
+
)
|
32
|
+
|
33
|
+
}
|